text:
In the [previous post](https://kkulma.github.io/2017-04-24-determining-optimal-number-of-clusters-in-your-data/) I showed several methods that can be used to determine the optimal number of clusters in your data - this often needs to be defined for the actual clustering algorithm to run. Once it's run, however, there's no guarantee that those clusters are stable and reliable.

**In this post I'll show a couple of tests for cluster validation that can be easily run in `R`.**

Let's start!

VALIDATION MEASURES
-------------------

### INTERNAL MEASURES

As the name suggests, internal validation measures rely on information in the data only, that is the characteristics of the clusters themselves, such as compactness and separation. In the perfect world we want our clusters to be as compact and separated as possible. How can this be measured?

**CONNECTIVITY**

This measure reflects the extent to which items that are placed in the same cluster are also considered their nearest neighbors in the data space - or, in other words, the degree of connectedness of the clusters. And yes, you guessed it, **it should be minimised**.

**SILHOUETTE WIDTH**

This index defines compactness based on the pairwise distances between all elements in the cluster, and separation based on pairwise distances between all points in the cluster and all points in the closest other cluster ([Van Craenendonck & Blockeel 2015](https://lirias.kuleuven.be/bitstream/123456789/504712/1/automl_camera.pdf)) We used `silhouette` function to asses the optimal number of clusters in the previous post - and like there, **the values as close to (+) 1 as possible are mose desirable**.

**DUNN INDEX**

Dunn Index represents the ratio of the smallest distance between observations not in the same cluster to the largest intra-cluster distance. As you can imagine, the nominator should be maximised and the denomitor minimised, **therefore the index should be maximized**.

(you can find a more detailed description of various internat cluster validation measures and their performance in this [Hui Xiong's paper](datamining.rutgers.edu/publication/internalmeasures.pdf).)

### STABILITY MEASURES

A slightly different approach is to assess the suitability of clustering algorithm by testing how sensitive it is to perturbations in the input data. In `clValid` package this means removing each column one at a time and re-rnning the clustering. There are several measures included, such as *average proportion of non-overlap* (APN), the *average distance* (AD),the *average distance between means* (ADM), and the *figure of merit* (FOM), all of which should be **minimised**.

Stability of clusters can be also computed using `fpc::clusterboot()` function, however the *perturbations in the input data* is a bit different here: it's done by resampling the data in a chosen way (e.g. bootstraping).

### BIOLOGICAL MEASURES

These measures can be only applied to the narrow class of biological data, such as microarray or RNAseq data where observations correspond to genes. Essentially, biological validation evaluates the ability of a clustering algorithm to produce biologically meaningful clusters.

To find out more about all these measures, check out the `clValid` vignette by opening the [link](https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=8&cad=rja&uact=8&sqi=2&ved=0ahUKEwiSzaO5lNfTAhWKA8AKHVDRD88QFghaMAc&url=http%3A%2F%2Fhbanaszak.mjr.uw.edu.pl%2FTempTxt%2FBrockEtAl_2008_CIValidAnRPackageForClusterValidation.pdf&usg=AFQjCNGeuXuGr1_CugB1rLygXSojbs1DvQ&sig2=EkSz5W04IXOfCAUSQBLKvw) or by typing `?clValid` in your R console.

EXAMPLES
--------

Enough of theory! Let's have a look at the R code and some examples.

I'll rely on the scaled `wine` dataset that I used in my [previous post](https://kkulma.github.io/2017-04-24-determining-optimal-number-of-clusters-in-your-data/)). I'm not going to evaluate ALL clustering algorithms described there, but this will be enough to give you an idea how to run the cluster validation on your dataset.

### Clusterwise cluster stability assessment by resampling (fpc::clusterboot())

After preparing the data...

``` r
library(gclus)
library(ggplot2)
library(dplyr)

data(wine)
scaled_wine <- scale(wine) %>% as.data.frame()
scaled_wine2 <- scaled_wine[-1]
```

... let's validate a simple k-means algorithm using stability measures using `fpc::clusterboot()`. In my previous post, depending on the clustering method, I obtained different number of possible "best" clusters: 2,3,4 and 15. I'll now test each of these options by bootstrapping the orginal dataset 100 times:

``` r
library(fpc)

set.seed(20)
km.boot2 <- clusterboot(scaled_wine2, B=100, bootmethod="boot",
                        clustermethod=kmeansCBI,
                        krange=2, seed=20)

km.boot3 <- clusterboot(scaled_wine2, B=100, bootmethod="boot",
                        clustermethod=kmeansCBI,
                        krange=3, seed=20)

km.boot4 <- clusterboot(scaled_wine2, B=100, bootmethod="boot",
                        clustermethod=kmeansCBI,
                        krange=4, seed=20)

km.boot15 <- clusterboot(scaled_wine2, B=100, bootmethod="boot",
                        clustermethod=kmeansCBI,krange=15, seed=20)
```

Have a look at the results below. Keep in mind that

1.  Clusterwise Jaccard bootstrap mean should be **maximised**
2.  number of dissolved clusters should be **minimised** and
3.  number of recovered clusters should be **maximised** and as close to the number of pre-defined bootstraps as possible

``` r
print(km.boot2)
```

    ## * Cluster stability assessment *
    ## Cluster method:  kmeans
    ## Full clustering results are given as parameter result
    ## of the clusterboot object, which also provides further statistics
    ## of the resampling results.
    ## Number of resampling runs:  100
    ##
    ## Number of clusters found in data:  2
    ##
    ##  Clusterwise Jaccard bootstrap (omitting multiple points) mean:
    ## [1] 0.8865301 0.8737611
    ## dissolved:
    ## [1] 3 3
    ## recovered:
    ## [1] 87 79

``` r
print(km.boot3)
```

    ## * Cluster stability assessment *
    ## Cluster method:  kmeans
    ## Full clustering results are given as parameter result
    ## of the clusterboot object, which also provides further statistics
    ## of the resampling results.
    ## Number of resampling runs:  100
    ##
    ## Number of clusters found in data:  3
    ##
    ##  Clusterwise Jaccard bootstrap (omitting multiple points) mean:
    ## [1] 0.9784658 0.9532739 0.9693787
    ## dissolved:
    ## [1] 1 2 0
    ## recovered:
    ## [1] 99 98 99

``` r
print(km.boot4)
```

    ## * Cluster stability assessment *
    ## Cluster method:  kmeans
    ## Full clustering results are given as parameter result
    ## of the clusterboot object, which also provides further statistics
    ## of the resampling results.
    ## Number of resampling runs:  100
    ##
    ## Number of clusters found in data:  4
    ##
    ##  Clusterwise Jaccard bootstrap (omitting multiple points) mean:
    ## [1] 0.5734544 0.4196592 0.8783064 0.6995180
    ## dissolved:
    ## [1] 30 85  2 10
    ## recovered:
    ## [1]  8  7 89 37

``` r
print(km.boot15)
```

    ## * Cluster stability assessment *
    ## Cluster method:  kmeans
    ## Full clustering results are given as parameter result
    ## of the clusterboot object, which also provides further statistics
    ## of the resampling results.
    ## Number of resampling runs:  100
    ##
    ## Number of clusters found in data:  15
    ##
    ##  Clusterwise Jaccard bootstrap (omitting multiple points) mean:
    ##  [1] 0.5906143 0.6545620 0.4729595 0.7117276 0.4056387 0.5572698 0.5706721
    ##  [8] 0.5678161 0.7510311 0.4268624 0.4443128 0.5212228 0.5508409 0.6876913
    ## [15] 0.3160002
    ## dissolved:
    ##  [1] 35 30 70 23 82 54 44 48 31 75 74 48 50 37 90
    ## recovered:
    ##  [1] 24 32 10 48  4 25 29 25 60  8  5  6 26 48  1

According to the above guidelines, it looks like 3 clusters are most stable out of all tested options.

### Multivariate validation of cluster results (clValid package)

Now, let's validate several different clustering algorithms at the same time using internal and stability measures. `clValid` package makes it easy to compare all those measures for different clustering methods across different number of clusters (from 3 to 15). In fact, this can be done in 2 (rather long) lines of code:

``` r
library(clValid)
library(kohonen)
library(mclust)

# transfrm data.frame into matrix
m_wine <- as.matrix(scaled_wine2)

valid_test <- clValid(m_wine, c(2:4, 15),
                      clMethods = c("hierarchical", "kmeans",  "pam" ),
                      validation = c("internal", "stability")
)
```

``` r
summary(valid_test)
```

    ##
    ## Clustering Methods:
    ##  hierarchical kmeans pam
    ##
    ## Cluster sizes:
    ##  2 3 4 15
    ##
    ## Validation Measures:
    ##                                   2        3        4       15
    ##
    ## hierarchical APN             0.0060   0.0349   0.0705   0.0991
    ##              AD              4.8351   4.7541   4.6705   3.0421
    ##              ADM             0.0567   0.1705   0.3321   0.4131
    ##              FOM             0.9973   0.9923   0.9894   0.6834
    ##              Connectivity    2.9290   9.9492  17.0651  75.0897
    ##              Dunn            0.3711   0.2243   0.2307   0.3094
    ##              Silhouette      0.2591   0.1575   0.1490   0.1781
    ## kmeans       APN             0.1255   0.0470   0.1851   0.3079
    ##              AD              4.2577   3.6137   3.6186   2.9210
    ##              ADM             0.6454   0.2231   0.7547   0.9147
    ##              FOM             0.9139   0.7842   0.7728   0.7000
    ##              Connectivity   37.6512  28.0504  61.1659 160.6163
    ##              Dunn            0.1357   0.2323   0.1621   0.2620
    ##              Silhouette      0.2593   0.2849   0.2128   0.1516
    ## pam          APN             0.0907   0.1191   0.1641   0.3514
    ##              AD              4.1958   3.7183   3.6150   2.9652
    ##              ADM             0.4359   0.4961   0.5622   1.0177
    ##              FOM             0.8686   0.7909   0.7819   0.7092
    ##              Connectivity   34.7790  45.0008  75.9865 184.7397
    ##              Dunn            0.1919   0.2035   0.1564   0.1743
    ##              Silhouette      0.2579   0.2676   0.1987   0.1117
    ##
    ## Optimal Scores:
    ##
    ##              Score  Method       Clusters
    ## APN          0.0060 hierarchical 2
    ## AD           2.9210 kmeans       15
    ## ADM          0.0567 hierarchical 2
    ## FOM          0.6834 hierarchical 15
    ## Connectivity 2.9290 hierarchical 2
    ## Dunn         0.3711 hierarchical 2
    ## Silhouette   0.2849 kmeans       3

I love this summary! Just look at it: it not only gives you a summary of all the specified validation measures across different clustering algorithms and number of inspected clusters, but also it lists those algorithms and number of clusters pairs that performed best in regard to a given validation metric. Very helpful, especially when evaluating more algorithms and possible numbers of clusters!

So, following the last summary, it looks like the hierarchical clustering with 2 clusters performed best in terms of stability and internal measures, as this pair appears in 2 out of 4 stability measures and 2 out of 3 internal measures.

BEFORE YOU GO
-------------

Coming to the end of this post, it's important to stress that there are more packages and methods you can use to evaluate your clusters (for the start, I would explore [clusteval package](ftp://ftp.u-aizu.ac.jp/pub/lang/R/CRAN/web/packages/clusteval/index.html) ), but these quick glimpses can go a long way and give you a good idea of what works for your data and what doesn't.

gha_language: JavaScript


text:
# Ownership and moves

Because variables are in charge of freeing their own resources,
**resources can only have one owner**. This also prevents resources
from being freed more than once. Note that not all variables own
resources (e.g. [references]).

When doing assignments (`let x = y`) or passing function arguments by value
(`foo(x)`), the *ownership* of the resources is transferred. In Rust-speak,
this is known as a *move*.

After moving resources, the previous owner can no longer be used. This avoids
creating dangling pointers.

```rust,editable
// This function takes ownership of the heap allocated memory
fn destroy_box(c: Box<i32>) {
    println!("Destroying a box that contains {}", c);

    // `c` is destroyed and the memory freed
}

fn main() {
    // _Stack_ allocated integer
    let x = 5u32;

    // *Copy* `x` into `y` - no resources are moved
    let y = x;

    // Both values can be independently used
    println!("x is {}, and y is {}", x, y);

    // `a` is a pointer to a _heap_ allocated integer
    let a = Box::new(5i32);

    println!("a contains: {}", a);

    // *Move* `a` into `b`
    let b = a;
    // The pointer address of `a` is copied (not the data) into `b`.
    // Both are now pointers to the same heap allocated data, but
    // `b` now owns it.

    // Error! `a` can no longer access the data, because it no longer owns the
    // heap memory
    //println!("a contains: {}", a);
    // TODO ^ Try uncommenting this line

    // This function takes ownership of the heap allocated memory from `b`
    destroy_box(b);

    // Since the heap memory has been freed at this point, this action would
    // result in dereferencing freed memory, but it's forbidden by the compiler
    // Error! Same reason as the previous Error
    //println!("b contains: {}", b);
    // TODO ^ Try uncommenting this line
}
```

[references]: ../flow_control/match/destructuring/destructure_pointers.md

repository: rust-lang/rust-by-example

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: rust-lang/rust-by-example


text:
# Telegram Integration Pack

StackStorm integration with [Telegram](https://telegram.org) messaging application.

## Configuration

Copy the example configuration in [telegram.yaml.example](./telegram.yaml.example)
to `/opt/stackstorm/configs/telegram.yaml` and edit as required.

It should contain:

* ``apikey`` - Telegram API

You can also use dynamic values from the datastore. See the
[docs](https://docs.stackstorm.com/reference/pack_configs.html) for more info.

**Note** : When modifying the configuration in `/opt/stackstorm/configs/` please
           remember to tell StackStorm to load these new values by running
           `st2ctl reload --register-configs`

## Sensors

### TelegramSensor

This sensor monitors Telegram every 5s, for new messages.
When a new update is detected, it dispatches a trigger.

## Actions

* ``send_message`` - Send a message to a user or group

repository: StackStorm-Exchange/stackstorm-telegram

gha_language: Python

repo_name: StackStorm-Exchange/stackstorm-telegram


text:
# pastebin

Code snippits, file templates, text notes and other random stuff

## file list

### float2binary.py

converting fractional part of a float to binary in Python

### ipwatcher.sh

script that uses the fping command to see pingable IP addresses appear
and disappear on a network segment

### lubuntu-setuserpass.exp

expect script to login to a lubunt host and set a user password

### muc.cmd

input file for the muc.py program

### muc.py

started but not finished Modbus client over UDP

### mue.py

started but not finished Modbus server emulator over UDP

### monopng.py

Python code to create a monochrome PNG file

### nile.csv

test data file containing historic records of flood levels of the nile

### recsv.py, recsv2.py and recsv3.py

CGI scripts in Python to reformat a CSV file

### sbxml.py

a CGI Python utility to analyse Hewlett Packard XML files
from their sales/smart portal

### snmptrapRECV.c

SNMP trap receiver written in C

### socomec-reset-ksh.sh

a shell script to reset counters on a Socomec power
distribution unit

### squidauth.c

a simple Squid proxy authentication module written in C.  good
to prove Squid is calling the module.

### testfile.c

simple C program to generate test data files of a required size

### timestable.c

example program to ask times table questions but real purpose is to
show timeout with C setjmp.h functions

-----------------

end of file

license: MIT

repository: andycranston/pastebin

repo_name: andycranston/pastebin


text:
events
======

[![Go Reference](https://pkg.go.dev/badge/github.com/shurcooL/events.svg)](https://pkg.go.dev/github.com/shurcooL/events)

Package events provides an events service definition.

Installation
------------

```sh
go get github.com/shurcooL/events
```

Directories
-----------

| Path                                                                 | Synopsis                                                             |
|----------------------------------------------------------------------|----------------------------------------------------------------------|
| [event](https://pkg.go.dev/github.com/shurcooL/events/event)         | Package event defines event types.                                   |
| [fs](https://pkg.go.dev/github.com/shurcooL/events/fs)               | Package fs implements events.Service using a virtual filesystem.     |
| [githubapi](https://pkg.go.dev/github.com/shurcooL/events/githubapi) | Package githubapi implements events.Service using GitHub API client. |

License
-------

-	[MIT License](LICENSE)

repository: shurcooL/events

gha_language: Go

repo_name: shurcooL/events


text:
This image of Docker is similar to the official [Docker image](https://github.com/docker-library/docker), generated from Debian instead of alpine linux.
This project has two purposes, on the one hand, constitutes a proof of concept and, on the other is the basis of other images, including my development center. If you want to know more about it, follow the following link: walrus.

### How to use this image
To run this image you have to expose the Docker socket to your Docker CI container, by bind-mounting it with the flag -v.
~~~
docker run -v /var/run/docker.sock:/var/run/docker.sock \
           -it irespaldiza/dockerinsidedocker
~~~

repository: irespaldiza/dockerinsidedocker

repo_name: irespaldiza/dockerinsidedocker


text:
# __A4988__
A4988 motor driver library
* Constant speed movement
* Movement by degrees and millimetres
* Movement in local and absolute coordinate systems
* Microstepping
# __Microstepping__
The library can handle all microstepping modes supported by A4988 driver (up to 1/16)
__Warning:__ high RPM + high microstep might not work properly as there is a speed limit for every motor.
# __Motor__
Motor should be a 4-wire stepper motor or a 6-wire stepper motor in 4-wire configuration (leaving central wires out)
# __Connection__
![Configuration](https://user-images.githubusercontent.com/76576112/103371182-6830a100-4b01-11eb-9a4c-b20d923c33a0.jpg)
# __Wiring__
This pin-out works for the example (located in ./examples). All of these can be changed.
* Driver to Arduino:
    * DIR - D9
    * STEP - D10
    * MS1 - 3
    * MS2 - 5
    * MS3 - 6
    * GND - Arduino GND
    * GND - Motor power supply GND
    * VMOT - Motor power supply
    * VDD - Arduino 5V
* Driver to stepper motor (1A,1B,2A,2B, these vary on every motor, check coil specifications of your motor)
* 100 uF capacitor between VMOT - GND
* Make sure the motor power supply voltage is within the range supported by the driver board
# __Code__
The sample code and its explanation are located in ./examples folder.
__To open it:__
* Launch your Arduino IDE
* Go to File > Examples
* Find the A4988 library on the list and open the desired example file.
# __Hardware__
All you need is:
* Arduino board
* A4988 stepper motor driver
* Stepper Motor
* 100 uF capacitor
# __To-do__
* Add linear (accelerated) movement mode


text:
Jive Search is the open source search engine that doesn't track you. Search privately, now : https://jivesearch.com

## 💾 Installation
```bash
go get -u github.com/jivesearch/jivesearch
JIVESEARCH_YANDEX_USER="" && JIVESEARCH_YANDEX_KEY="" && JIVESEARCH_PIXABAY_KEY=""
cd ~/go/src/github.com/jivesearch/jivesearch/frontend && go run ./cmd/frontend.go --debug=true --provider=yandex --images_provider=pixabay
```

A Yandex user/API key can be obtained here: https://tech.yandex.com/xml/

A Pixabay API key can be obtained here: https://pixabay.com/api/docs/

Other API keys and settings can likewise be set via environment variables: https://github.com/jivesearch/jivesearch/blob/master/config/config.go

For production usage see https://github.com/jivesearch/jivesearch/blob/bcf9c1e6e52cd2bc9fe7e97982509fe8288b41dc/README.md

## 🚀 **Roadmap**
### Our goal is to create a search engine that respects your privacy AND delivers great search results, instant answers, maps, image search, news, and more.

Marked items indicate progress has been made in that category. There is much more to do in each area. Suggestions are welcome!
- [x] Privacy
- [x] !Bangs
- [x] Core Search Results & Distributed Crawler
    - [ ] Advanced Search (exact phrase, dogs OR cats,  -cats, site/domain search, etc.)
    - [ ] Filetype search
    - [x] Language & Region
    - [ ] Phrase Suggester (a.k.a. "Did You Mean?")
    - [x] Proxy Links
    - [x] SafeSearch
    - [ ] Time Search (past year/month/day/hour, etc.
    - [x] 3rd party search providers
        - [x] Yandex API
- [x] Autocomplete
- [x] Instant Answers
    - [x] Birthstone, camelcase, characters, coin toss, frequency, POTUS, prime, random, reverse, stats, user agent, etc.
    - [x] Breach (a.k.a. have i been pwned)
    - [x] Discography/Music albums
    - [x] Economic stats (GDP, population)
    - [ ] Flight Info & Status
    - [x] JavaScript-based answers
        - [x] Basic calculator
            - [x] Mortgage, financial and other calculators
        - [x] CSS/JavaScript/JSON/etc minifier and prettifier
        - [x] Converters (foreign exchange, meters to feet, mb to gb, etc...)
    - [x] Maps
    - [x] Nutrition
    - [x] Package Tracking (UPS, FedEx, USPS, etc...)
    - [ ] Shopping
    - [x] Stack Overflow
    - [x] Stock Quotes & Charts
    - [x] Weather
    - [x] WHOIS
    - [x] Wikipedia summary
    - [x] Wikidata answers (how tall is, birthday, etc.)
    - [x] Wikiquote
    - [x] Wiktionary
    - [ ] Many more instant answers (including from 3rd party APIs)
    - [ ] Translate trigger words and answers to other languages
- [x] Image Search
- [ ] Video Search
- [ ] News
- [ ] Custom CSS Themes
- [x] Tor

## 📙 Documentation
Jive Search's documentation is hosted on GoDoc Page [here](https://godoc.org/github.com/jivesearch/jivesearch).

## 💬 Contributing
Want to contribute? Great!

Search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue [here](https://github.com/jivesearch/jivesearch/issues/new).

You can also [join us on Slack](https://join.slack.com/t/jivesearch/shared_invite/enQtNTkwMjg1OTc3MjgyLWZiMDFjMWM5NGU4OWNmY2Q3YjUzZGMxN2ZiNDBmYWVhMzZkMzlmNThlNTE3ZjY1MTU5MDBhNDNkNDM0NmU2MmY) or contact us on Twitter @jivesearch.

## 📜 Copyright and License
Code and documentation copyright 2018 the [Jive Search Authors](https://github.com/jivesearch/jivesearch/graphs/contributors). Code and docs released under the [Apache License](https://github.com/jivesearch/jivesearch/blob/master/LICENSE).

repository: suryatmodulus/jivesearch

repo_name: suryatmodulus/jivesearch


text:
# Introduction

##### Todays Software

Software is an integral part of our life today. It has been a complete success
story in the second half of the 20th century and it continous in the
21st. Software is indispensable in flight control, aerospace, financial world,
telecommunication, research etc. Now smartphones have pentrated the worlds
population. And the world with aoutonomous software controlled cars is not
very far.

Even with todays technology to develop software, bugs are an integral part of
software. Half of the effort to produce software goes into the construction of
the software and the other half goes into finding (hopefully) most of the bugs
in the software before the user runs into some of the remaining
bugs. Unfortunately some severe accidents have happened because of bugs in the
software. Viruses can exploit security bugs in a software to do their bad
business.

There is a popular saying attributed to Edsger Dijkstra: "If debugging is the
activity to remove bugs from the software then programming must be the
activity to introduce them".

And the name _bug_ gives some false associations. It makes the impression as
if bugs creep secretely into the software while the programmer is not looking
at it.

And since software construction is a terribly complex task it seems to be
inevitable that bugs are within any software system since programmers are
human beings which commit errors when confronted with complex tasks.

In the 1960s the term _software crisis_ had been invented to describe the
problem. Since then science has invested a lot of effort to find methods to
build correct software. The so called _formal methods_ said that it is
possible to write software which is correct by construction.

##### The Start of Formal Methods

Robert Floyd and Tony Hoare did some pioneering work in that
area. [Floyd](bibliography.md#floyd1967) observed that by attaching assertions
to edges of a flow graph he can start to reason about software by logic.

Tony Hoare described in his foundational paper ["The axiomatic basis of
computer programming"](bibliography.md#hoare1969) how a language consisting of
assignment, alternative command and while loops can be given rules which can
be used to prove the correctness of programs written in this language.

There are certainly more authors who proposed similar ideas. But Robert Floyd
and Tony Hoare are today the most cited in that area.

So in academia the idea of writing software which is correct by construction
started to gain some momentum.

Edsger Dijkstra used the foundations of Tony Hoare to invent the so called
_weakest precondition calculus_. He and others started to teach this method to
students who learned to write correct algorithms.

David Gries wrote the text book ["The science of
programming"](bibliography.md#gries1981) describing the method in a manner
that it can be used by undergraduate students. In this textbook he expressed
the idea that the method is so powerful that soon more and more programs will
be written by using the method to prove software correct. But we all know that
this had not happened (at least up to now).

##### Drawbacks of the Early Formal Methods

Tony Hoare in his 1967 paper already mentioned that it might be difficult to
use the method in practice.

> However, program proving, certainly at present, will be difficult even for
  programmers of high caliber; and may be applicable only to quite simple
  program designs.

I.e. proving software to be correct requires some skills in logical reasoning
which are not addressed sufficiently in the formation of software developers.

However Dijkstra and Gries proved that the method is teachable with success
even to undergraduate students.

But there is another serious problem. Software of significant size is not
static. There are frequent changes during the development and the maintenance
process. Any change requires that a correctness proof has to be redone to
prove that no bugs creeped into the software. By doing proofs with paper and
pencil, this is practially impossible or more correctly: requires an enormous
effort to do it.

From that experience we can conclude that formal methods can be used
efficiently only if a programming language is used which allows to express the
operational software and its correctness proofs.

##### The Available Tools

There are many tools available on the market to write correctness proofs for
software. The most prominent tools are _Coq_ and _Isabelle_. Others are
_Idris_, _Agda_, etc.

In Coq it is possible to write functional software and prove correctness
properties about that software. The functions defined in Coq can be exported
to a programming language like Ocaml and then compiled to native machine code.

There are some heroic efforts to use Coq to construct real world software. The
most prominent one is [_Compcert_](http://compcert.inria.fr/) which is a
completely verified C compiler.

This proves the claim that it _is_ possible to write formally verified code by
using todays tools. But there is not yet a widespread use of the tools. Why?

- Using a tool like Coq or Isabelle requires skills and both tools have a
  steep learnig curve. Only very few software developer are able and have
  enough patience to acquire these skills.

- Most of the todays tools use constructive logic which is for many software
  developers counterintuitive.

- You cannot generate compiled code directly from the languages. You have to
  go via some intermediate language. But the data types used e.g. in Coq (like
  natural numbers) cannot be transferred easily to the intermediate language.

- The tools usually only support functional and not imperative
  programs. Generating verified imperative code (which is necessary in some
  cases) requires some other intermediate steps which are not easy to do.

Summary: Using formal methods to generate correct software is possible for
real world software projects. But the price to pay in terms of skill
development and intermediate steps is still too high.

##### The Albatross Project

The Albatross programming language with its compiler and verifier tries to
bridge the remaining gaps and shoots at making verification an everyday task
in software development.

Its goal is to make software verification available for the masses.

The Albatross compiler has an integrated proof engine which lifts the burden
detailed proof steps off the user. The proof engine can do many proof steps
automatically and the developer just has to state the desired
properties. Clearly complex algorithms still require some deep
thinking. However straightforward code should work just out of the box.

The modularity of the language allows to do complicated code and the
corresponding proofs within the implementation part and the user can use the
exported functions and properties in his application code.

There is no intermediate language (at least not visible to the developer) to
compile to. All the glueing of the semantics of the Albatross language and the
semantics of the target language is hidden to the user.

Albatross allows to write functional, imperative and concurrent code within the
same language. Its syntax is similar to mainstream object oriented languages
familiar to todays programmers.

The project is still in its development phase. Therefore not all functionality
is yet available. But the target is to make a programming language which is
general purpose, easy to use and fully verified.

<!--
Local Variables:
mode: outline
coding: iso-latin-1
outline-regexp: "#+"
End:
-->

repository: andyepx/alba-lang-description

repo_name: andyepx/alba-lang-description


text:
Sublime-Red
===========

A Sublime Text package for the Red language [(www.red-lang.org)](http://www.red-lang.org)

An update fork of https://github.com/Oldes/Sublime-Red using sublime_syntax instead of tmLanguage, with build system. Currently a work-in-progress


text:
# DEPRECATED / UP FOR HISTORICAL REASONS ONLY

## Sunblast

Sunblast is a port of Snowman to AngularJS. Instead of a new syntax, you use HTML with special elements, predefined and user-defined.

### FAQ

* What features will be included?*

  I'm writing the engine for a friend and possibly for a project of my own. These features will get priority. Highest priority after getting basic functionality down will be conditional choices based on "qualities".

* I just get `Could not bootstrap sunblast, did you create a sunblastUserModule in code?`*

  You need to create a new Angular module in your custom JS.  If you don't know what to do, just add this line to your custom JS.

    angular.module("sunblastUserModule", []);

repository: solacerg/sunblast

repo_name: solacerg/sunblast


text:
# Coffee Break Bot

A very simple slack bot that reminds you to have a coffee break (at 14:30 Mondays until Fridays).

## Using on Heroku

* [Add config var](https://devcenter.heroku.com/articles/config-vars) for the SLACK_BOT_TOKEN (`export SLACK_BOT_TOKEN=xxxxxxxxx`)
* Deploy: `git push heroku master`
* Test bot: `heroku run python bot.py`
* [Add scheduled task](https://devcenter.heroku.com/articles/scheduler) (using the heroku dahsboard) (you have to do this once to start, and then every time the clock is adjusted from summer to winter time or vice versa)
* Check the logs: `heroku logs`

[What to put in the Procfile](https://github.com/michaelkrukov/heroku-python-script).

repository: NLeSC/slack-bot

repo_name: NLeSC/slack-bot


text:
[![CircleCI](https://circleci.com/gh/giantswarm/k8s-audit-metrics.svg?style=shield)](https://circleci.com/gh/giantswarm/k8s-audit-metrics) [![Go Report Card](https://goreportcard.com/badge/github.com/giantswarm/k8s-audit-metrics)](https://goreportcard.com/report/github.com/giantswarm/k8s-audit-metrics) [![](https://godoc.org/github.com/giantswarm/k8s-audit-metrics?status.svg)](http://godoc.org/github.com/giantswarm/k8s-audit-metrics) [![](https://img.shields.io/docker/pulls/giantswarm/k8s-audit-metrics.svg)](http://hub.docker.com/giantswarm/k8s-audit-metrics)

# k8s-audit-metrics

K8s-audit-metrics is a service that processes Kubernetes apiserver's audit logs and exposes metrics from it.

### Tips & tricks

#### Kubernetes client user-agent

In order to have nicer labels and easier way to distinct different clients, it's good to configure appropriate user-agent header to your k8s client.

[Client-go rest.Config](https://pkg.go.dev/k8s.io/client-go/rest#Config) has a field `UserAgent` that is useful to set to `<component>/<version>`.

Example (from [azure-operator](https://github.com/giantswarm/azure-operator/pull/1221/files)):
```
restConfig.UserAgent = fmt.Sprintf("%s/%s", project.Name(), project.Version())
```

#### Prometheus query to get req/min per component

Grouping metrics by user-agent and computing rate of requests gives a metric for req/min e.g. as follows:
```
sum by (user_agent) (rate(k8s_api_audit_requests_total[5m])*60)
```

## Prerequisites

## Getting Project

Download the latest release: https://github.com/giantswarm/k8s-audit-metrics/releases/latest

Clone the git repository: https://github.com/giantswarm/k8s-audit-metrics.git

Download the latest docker image from here: https://hub.docker.com/r/giantswarm/k8s-audit-metrics/

### How to build

#### Building the standard way

```nohighlight
go build
```

## Contact

- Mailing list: [giantswarm](https://groups.google.com/forum/!forum/giantswarm)
- Bugs: [issues](https://github.com/giantswarm/k8s-audit-metrics/issues)

## Contributing & Reporting Bugs

See [CONTRIBUTING.md](/giantswarm/k8s-audit-metrics/blob/master/CONTRIBUTING.md) for details on submitting patches, the contribution workflow as well as reporting bugs.

For security issues, please see [the security policy](SECURITY.md).

## License

PROJECT is under the Apache 2.0 license. See the [LICENSE](/giantswarm/k8s-audit-metrics/blob/master/LICENSE) file for details.


text:
---
title: SSH With RSA Keys
description: Synology DSM - Allow presistent SSH With RSA Keys. How to configure Synology to use RSA keys for SSH access.
template: comments.html
tags: [synology, dsm, ssh, rsa-keys]
---

# Synology DSM - Allow Presistent SSH With RSA Keys

As a power user, i would like to be able to connect to my Synology DSM vis SSH. The issue is that Synology DSM won't allow you to use SSH with RSA keys out of the box and only allows you to use SSH with password.
In order to allow the use of SSH keys we need to perform the following steps:

## Requirements

I will assume you have already have SSH keys generated, SSH server configured on Synology DSM

- Generated SSH keys
- SSH server configured on Synology DSM

## Allow `User Home` at DSM Level

`User Home` enable to create a personal home folder for each user, except for guest. This will allow as to create user's `.ssh` folder and `authorized_keys` file.

- Log into Synology web UI as an administrator user
- Control Panel -> User & Groups -> Advanced, scroll down to “User Home”
- Check “Enable user home service”, select an appropriate Location (i.e. volume1)
- Click “Apply”

![Synology Control Panel Image][synology-control-panel-image]

## Configure `.ssh` Folder and `authorized_keys` File

Log in to the NAS through SSH with the user you want to add key authorization for.
The following example shows how to add will work for the active user in the SSH session.

First change the permissins of the `users home` folder to 700

```shell
sudo chmod 700 ~
```

Create the `.ssh` folder and set permissions to 700

```shell
mkdir ~/.ssh && chmod 700 ~/.ssh
```

Create the `authorized_keys` file and set permissions to 644

```shell
touch ~/.ssh/authorized_keys && chmod 644 ~/.ssh/authorized_keys
```

!!! success ""

    Synology's DSM SSH server supports RSA and ed25519 keys.

No you need to copy you public keys to `authorized_keys` file, you can do it manually or use the following command:

```shell
echo <public-key-sting> >> ~/.ssh/authorized_keys
```

You can do it automatically by using the following command from a client with the ssh key you want to add:

```shell
ssh-copy-id -i ~/.ssh/id_rsa <user@ip-address>
```

At this point you should be able to connect to Synology DSM via SSH using the key you just added.

<!-- appendices -->

<!-- urls -->

[3os-url]: https://3os.org/ '3os Homepage'

<!-- images -->

[synology-control-panel-image]: /assets/images/fc2ca070-ba36-11ec-a838-2bfdfa0e9d3f.jpg 'Synology Control Panel'

<!--css-->
<style>
  .md-typeset img {
    display: inline;
</style>

<!-- end appendices -->

branch_name: refs/heads/main

gha_language: HTML

gha_license_id: NOASSERTION


text:
# **Details**

I've tryed my best to remove any passwords from the archives and to make sure nothing is infected.
I don't guarantee the *"safeness"* of any of the archives, builders, or anything in this repo, while you should be safe, I recommend using a VM or Sandbox.
Many projects are duplicates or revisions of each other. Many of them may have outdated depedencies.

I'm not responsible for anything you do with this.
**ITS YOUR FAULT**, if you use this for any illegal purpose.

### **Contact Info**

- **discord:** *fun#1337*
- **email:**<EMAIL_ADDRESS>

### **Donate**

**Donations are appreciated. =)**

- **(BTC):** *-*

- **(PayPal):** *-*

### **License**

[![JitPack](https://img.shields.io/badge/license-MIT_License_with_anime_exception-green.svg)](https://github.com/fuwn/net/blob/master/LICENSE)

repository: katalyzzt/net

repo_name: katalyzzt/net


text:
# GitHub Trending (2021-06-12)

![](https://img.shields.io/badge/Swift-New%20686-green?style=flat-square&logo=appveyor)
- [zzanehip/The-OldOS-Project](https://github.com/zzanehip/The-OldOS-Project): Recreating a fully functional version of iOS 4 in SwiftUI.

![](https://img.shields.io/badge/Shell-New%20147-green?style=flat-square&logo=appveyor)
- [PaperMC/Paper](https://github.com/PaperMC/Paper): High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies

![](https://img.shields.io/badge/C-New%20467-green?style=flat-square&logo=appveyor)
- [madMAx43v3r/chia-plotter](https://github.com/madMAx43v3r/chia-plotter):

![](https://img.shields.io/badge/PowerShell-New%20157-green?style=flat-square&logo=appveyor)
- [actions/virtual-environments](https://github.com/actions/virtual-environments): GitHub Actions virtual environments

![](https://img.shields.io/badge/Python-New%2025-green?style=flat-square&logo=appveyor)
- [pytorch/fairseq](https://github.com/pytorch/fairseq): Facebook AI Research Sequence-to-Sequence Toolkit written in Python.

![](https://img.shields.io/badge/TypeScript-New%20160-green?style=flat-square&logo=appveyor)
- [actions/starter-workflows](https://github.com/actions/starter-workflows): Accelerating new GitHub Actions workflows

![](https://img.shields.io/badge/Java-New%2070-green?style=flat-square&logo=appveyor)
- [981011512/--](https://github.com/981011512/--): 停车场系统源码，停车场小程序，智能停车，Parking system，【功能介绍】：①兼容市面上主流的多家相机，理论上兼容所有硬件，可灵活扩展，②相机识别后数据自动上传到云端并记录，校验相机唯一id和硬件序列号，防止非法数据录入，③用户手机查询停车记录详情可自主缴费(支持微信，支付宝，银行接口支付，支持每个停车场指定不同的商户进行收款)，支付后出场在免费时间内会自动抬杆。④支持app上查询附近停车场(导航，可用车位数，停车场费用，优惠券，评分，评论等)，可预约车位。⑤断电断网支持岗亭人员使用app可接管硬件进行停车记录的录入。 【技术架构】：后端开发语言java，框架oauth2+springboot2+dubble，数据库mysql/mongodb/redis，即时通讯底层框架net…

![](https://img.shields.io/badge/C%2B%2B-New%20754-green?style=flat-square&logo=appveyor)
- [chrxh/alien](https://github.com/chrxh/alien): alien is a GPU-accelerated artificial life simulation program.

![](https://img.shields.io/badge/none-New%20170-green?style=flat-square&logo=appveyor)
- [maziarraissi/Applied-Deep-Learning](https://github.com/maziarraissi/Applied-Deep-Learning): Applied Deep Learning

![](https://img.shields.io/badge/none-New%2061-green?style=flat-square&logo=appveyor)
- [yangtingxiao/QuantumultX](https://github.com/yangtingxiao/QuantumultX): 脚本，自用

![](https://img.shields.io/badge/none-New%201-green?style=flat-square&logo=appveyor)
- [jwasham/coding-interview-university](https://github.com/jwasham/coding-interview-university): A complete computer science study plan to become a software engineer.

![](https://img.shields.io/badge/none-New%20613-green?style=flat-square&logo=appveyor)
- [peng-zhihui/XUAN-Bike](https://github.com/peng-zhihui/XUAN-Bike):

![](https://img.shields.io/badge/TypeScript-New%20160-green?style=flat-square&logo=appveyor)
- [microsoft/vscode](https://github.com/microsoft/vscode): Visual Studio Code

![](https://img.shields.io/badge/none-New%20344-green?style=flat-square&logo=appveyor)
- [EbookFoundation/free-programming-books](https://github.com/EbookFoundation/free-programming-books): 📚 Freely available programming books

![](https://img.shields.io/badge/Dart-New%2093-green?style=flat-square&logo=appveyor)
- [liupan1890/aliyunpan](https://github.com/liupan1890/aliyunpan): 阿里云盘小白羊版 阿里云盘PC版

![](https://img.shields.io/badge/none-New%20141-green?style=flat-square&logo=appveyor)
- [florinpop17/app-ideas](https://github.com/florinpop17/app-ideas): A Collection of application ideas which can be used to improve your coding skills.

![](https://img.shields.io/badge/Python-New%2013-green?style=flat-square&logo=appveyor)
- [whittlem/pycryptobot](https://github.com/whittlem/pycryptobot): Python Crypto Bot

![](https://img.shields.io/badge/none-New%20233-green?style=flat-square&logo=appveyor)
- [danistefanovic/build-your-own-x](https://github.com/danistefanovic/build-your-own-x): 🤓 Build your own (insert technology here)

![](https://img.shields.io/badge/JavaScript-New%2064-green?style=flat-square&logo=appveyor)
- [OAI/OpenAPI-Specification](https://github.com/OAI/OpenAPI-Specification): The OpenAPI Specification Repository

![](https://img.shields.io/badge/C%2B%2B-New%2039-green?style=flat-square&logo=appveyor)
- [Air14/HyperHide](https://github.com/Air14/HyperHide): Hypervisor based anti anti debug plugin for x64dbg

![](https://img.shields.io/badge/Jupyter%20Notebook-New%20144-green?style=flat-square&logo=appveyor)
- [Charmve/computer-vision-in-action](https://github.com/Charmve/computer-vision-in-action): 《计算机视觉实战演练：算法与应用》中文电子书、源码、读者交流社区（更新中，可以先 star）

![](https://img.shields.io/badge/JavaScript-New%2041-green?style=flat-square&logo=appveyor)
- [wuzhi04/MyActions](https://github.com/wuzhi04/MyActions):

![](https://img.shields.io/badge/C%2B%2B-New%2050-green?style=flat-square&logo=appveyor)
- [tensorflow/tensorflow](https://github.com/tensorflow/tensorflow): An Open Source Machine Learning Framework for Everyone

![](https://img.shields.io/badge/Python-New%204-green?style=flat-square&logo=appveyor)
- [kubeflow/pipelines](https://github.com/kubeflow/pipelines): Machine Learning Pipelines for Kubeflow

![](https://img.shields.io/badge/Java-New%20149-green?style=flat-square&logo=appveyor)
- [spring-projects/spring-boot](https://github.com/spring-projects/spring-boot): Spring Boot

repository: Hsins/Daily-GitHub-Trending

gha_license_id: MIT

repo_name: Hsins/Daily-GitHub-Trending


text:
## Basics

The Attune API is designed according to REST principles.

The API accepts JSON in request bodies and requires that the content-type: application/json header be specified for all such requests. The API will always respond with an object. Depending on context, resources may be returned as single objects or as arrays of objects, nested within the response object.

The API also facilitates cross-origin resource sharing so that it can be called from a web application.

repository: MicroTekAppDev/api-docs

repo_name: MicroTekAppDev/api-docs


text:
# cookie-recipe
## Author
Nicholas Ngetich
## Description
This is a practice exercise on itendation and spacing of code elements.
### Prerequisites
You need to have git installed
You can install it with the following command in your terminal
`$ sudo apt install git-all`
### Setup
To access this project on your local files, you can clone it using these steps
1. Open your terminal
1. Use this command to clone `$ git clone https://github.com/ngetichnicholas/cookie-recipe.git
1. This will clone the repositoty into your local folder
## Technologies Used
- HTML
### License
 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](/LICENSE)

repository: ngetichnicholas/cookie-recipe

repo_name: ngetichnicholas/cookie-recipe


text:
This import is unused.

## The check reported an import that was actually used!

The check has no known bugs. If it reports an unused import that looks like it
was actually used, try removing it and recompiling. If everything still
compiles, it was unused.

Note that the check can detect some unused imports that `google-java-format`
cannot. The formatter looks at a single file at a time, so `RemoveUnusedImports`
is more accurate in examples like the following:

```java
package a;

import b.Baz; // this is unused!

class Foo extends Bar {
  Baz baz; // this is a.Bar.Baz (from the supertype), *not* b.Baz
}
```

```java
package a;
class Bar {
  class Baz {}
}
```

```java
package b;
class Baz {}
```

repository: PicnicSupermarket/error-prone

gha_language: Java

repo_name: PicnicSupermarket/error-prone


text:
Project-Euler
=============

Personal repository for project Euler solutions (https://projecteuler.net/). I decided to start working on this problem set in order to help me learn and practice F# whilst brushing up on my algorithm/maths skills.

##WARNING##
The source code within this repository is unlikely to be nice clean ideomatic F# (as I'm using this as an excue to learn and practice it). The code quality may improve through the problems, but I don't intend to go back over the problems and clean up the code!

repository: Tom-Kuhn/Project-Euler

repo_name: Tom-Kuhn/Project-Euler


text:
Components to be Shared by DCP Infrastructure Automation Directly via Github
============================================================================

This folder is not included in the dcplib Python package and is a place to centralize files
so that DCP infrastructure can fetch them.

Trufflehog Regex Patterns
-------------------------

`trufflehog_regex_patterns.json` is a set of custom regex patterns for use with trufflehog.

In a CI/CD pipeline, one can use the following script:

    wget -O regex.json https://raw.githubusercontent.com/HumanCellAtlas/dcplib/master/components/trufflehog_regex_patterns.json
    trufflehog --regex --rules regex.json --entropy=False https://github.com/HumanCellAtlas/data-store.git
    rm regex.json

This will check the entire git history of a repository for the patterns inside of `trufflehog_regex_patterns.json`,
where in this case the example repository is: https://github.com/HumanCellAtlas/data-store.git

Notes:
1. `--entropy=False` turns off high entropy string matching, otherwise any uuid seems to trigger it.
2. This regexes.json is largely based off of [truffleHog's default regexes.json](https://github.com/dxa4481/truffleHogRegexes/blob/master/truffleHogRegexes/regexes.json).

For more information on truffleHog: https://github.com/dxa4481/truffleHog/

repository: HumanCellAtlas/dcplib

repo_name: HumanCellAtlas/dcplib


text:
# Contributing to Primer

There are several ways you can contribute to and participate in Primer:

- Participate in discussions
- Submit an issue
- Improve the documentation
- Close issues
- Propose a new component or UI pattern
- Questions and support

Please note that all contributions to Primer need to follow our code of conduct. You can find the code of conduct in the root folder of each [Primer repository](https://github.com/primer).

## Participate in discussions

Discussions about improvements and upcoming work happen mostly in issues and in the #design-system Slack channel (internal to GitHub users).

These are the key repos you should watch if you’re interested in getting involved:

- [Design](https://github.com/primer/design)
- [Primer CSS](https://github.com/primer/css)
- [Primer React](https://github.com/primer/components)
- [Octicons](https://github.com/primer/octicons)
- [Doctocat](https://github.com/primer/doctocat)
- [Design systems](https://github.com/github/design-systems) (internal to GitHub users)

The Design Systems Team holds office hours twice a week and anyone at GitHub is free to join, ask questions and participate in ongoing conversations. The office hours video links are posted in the #design-systems Slack channel right before the meeting starts.

## Submit an issue

If you spot something that doesn’t look right in our design, code or documentation, submit an issue to the relevant repo:

- [Interface guidelines](https://github.com/primer/design)
- [Primer CSS](https://github.com/primer/css)
- [Primer React](https://github.com/primer/components)
- [Octicons](https://github.com/primer/octicons)
- [Doctocat](https://github.com/primer/doctocat)
- [Presentations](https://github.com/primer/presentations)
- [Primer site](https://github.com/primer/primer.style)

If you are unsure where to submit the issue, and you are an internal GitHub user, add it to [design systems](https://github.com/github/design-systems) and the design systems team will triage it accordingly.

**Please remember!** Before submitting an issue, do a quick search to check the same issue hasn’t been submitted yet. If it has, you can participate by commenting with your own examples and ideas.

## Improve the documentation

Documentation is a core part of Primer, and, just as design and code, we’re always trying to make it better and more useful. If you notice something missing, a typo, or have an idea of how the docs can be improved, check if the issue already exists, and, if not, you can do one of the following:

- Submit an issue in the relevant repo
- Submit a pull request with a fix (you can do this directly via the “Edit this page on GitHub” link on the footer of docs pages)

## Close issues

There are issues marked with the label “status: help wanted” across the different Primer repos that we’d love some help with. If you think you can help, add a comment on the issue stating when and (if you know) how you’ll be able to tackle it and we’ll support you throughout.

### Opening a pull request

When working on an issue, don't worry too much about commit frequency or having the perfect commit message. We squash commits down into a single commit when merging pull requests.

Instead, we encourage you to be detailed in your pull request descriptions. Be sure to address what change is being made, why the change is being made, and add links to the relevant issue or any references used.

## Propose a new component or UI pattern

If you'd like to propose a new Primer component, let's talk! The best way to get started is to message the design systems team in Slack so we can verify if the request (or similar) is already being worked on. If you prefer, you can submit an issue in the [design-systems repo](https://github.com/github/design-systems) (internal GitHub users only) with as much detail about the proposal as possible: problem statement, user and product needs, context, timelines, and anything else that will help triage the issue.

_Please note: Currently we can only accept and work on internal GitHub requests for components._

## Questions and support

If you’re GitHub staff, the quickest way to get help is to ask your question in the #design-systems Slack channel. Otherwise, you can send us a message on Twitter [@githubprimer](https://twitter.com/githubprimer).


text:
(tutorials:general-setup)=

# General setup

This project provides _JupyterHub Authenticator classes_. A JupyterHub
authenticator class helps JupyterHub to delegate the task of deciding who a user
is (authentication) and if the user should be granted access to sign in
(authorization).

This section describes general steps to setup a JupyterHub to use one of these
projects' authenticator classes.

1. Decide on an _identity provider_

   As an example, if you want users to login with their GitHub accounts, then
   GitHub is the identity provider.

2. Register an _OAuth2 application_ with the identity provider

   The identity provider needs to allow you to register an OAuth2 application,
   and you can typically search the internet for guides on doing this for the
   identity provider.

   When doing this, you should at some point declare a _redirect url_. This
   should be `https://[your-domain]/hub/oauth_callback` where you replace
   `[your-domain]`.

   After this step, you should have a _client id_, a _client secret_.

   [redirect url]: https://www.oauth.com/oauth2-servers/redirect-uris/

3. Configure JupyterHub to use one compatible authenticator class

   The authenticator class can be the general purpose `GenericOAuthenticator`
   class, or a specialized authenticator class like `GitHubOAuthentator`.

   ```python
   # code for a jupyterhub_config.py file...
   c.JupyterHub.authenticator_class = "github"
   ```

4. Configure the authenticator base class

   Based on the information from step 2, configure the following.

   ```python
   # code for a jupyterhub_config.py file...
   c.OAuthenticator.oauth_callback_url = "https://[your-domain]/hub/oauth_callback"
   c.OAuthenticator.client_id = "[your oauth2 application id]"
   c.OAuthenticator.client_secret = "[your oauth2 application secret]"
   ```

5. Configure the authenticator class further

   By default, no users will be allowed access. At this point you should
   configure what users should be granted access. The OAuthenticator base class
   provides the following config you can read more about in the configuration
   reference.

   - {attr}`.OAuthenticator.allow_all`
   - {attr}`.OAuthenticator.allow_existing_users`
   - {attr}`.OAuthenticator.allowed_users`
   - {attr}`.OAuthenticator.admin_users`

   Your authenticator class may have unique config, so in the end it can look
   something like this:

   ```
   c.JupyterHub.authenticator_class = "github"

   c.OAuthenticator.oauth_callback_url = "https://my-jupyterhub.prg/hub/oauth_callback"
   c.OAuthenticator.client_id = "1234-5678-9012-3456"
   c.OAuthenticator.client_secret = "abcd-edfg-ijkl-mnop"

   c.OAuthenticator.allow_existing_users = True
   c.OAuthenticator.allowed_users = {"github-user-1", "github-user-2"}
   c.OAuthenticator.admin_users = {"github-user-3"}

   c.GitHubOAuthenticator.allowed_organizations = {"github-organization-1"}
   c.GitHubOAuthenticator.scope = ["user:email", "read:org"]
   ```

repository: jupyterhub/oauthenticator

repo_name: jupyterhub/oauthenticator


text:
# Week 7 Notes - Friday

## Sections
- [Intro](#intro)
  - [Notes](#notes)
    - [Passing By Reference vs. Passing By Value](#passing-by-reference-vs-passing-by-value)
    - [Static Variables](#static-variables)
    - [Passing by const-reference](#passing-by-const-reference)

### Intro
Below are the notes from the Friday (10/10) SI session.

Topics discussed:
- Passing By Reference vs. Passing By Value
- Static Variables
- Passing by const-reference

#### Notes
Below are the notes, split into topics.

##### Passing By Reference vs. Passing By Value
General rule of thumb:
- Pass by value when you are passing a small variable (primitive data type) through a function as an argument
- Pass by reference if you need to send a large variable (e.g. a vector of some data type) or want to return more
than one value from a function. If you're moving a large variable but don't want to change its value, call by const-reference.

If you'd like to see the difference between the two, the best thing you can to for yourself is try it out in Visual Studio.
If you go back to the main page for Week 7, go to the top (where the file listing is) and click on
`value_versus_reference_w7.cpp`. Run the code in here through Visual Studio.

##### Static Variables
Although hardly ever used in practice (or at least I never need them), to set a variable as `static` means to have the variable not
lose its value when you leave its scope. With all the previous jargon it might be confusing to understand, however check out the following
example:

```C++
  void print_num_calls()
  {
    static int num_calls = 0;
    num_calls++;
    cout << "Current value of num_calls: " << num_calls << endl;
  }

  int main()
  {
    for(int i = 0; i < 4; ++i)
    {
      print_num_calls();
    }
    return 0;
  }
```

Output:
```
  Current value of num_calls: 1
  Current value of num_calls: 2
  Current value of num_calls: 3
  Current value of num_calls: 4
```

Run the program above in a visual studio project to compare my output with yours.

So the concept of `static` might be easy to understand, however the most funky part (at least for me) is:
```C++
  static int num_calls = 0;
```

You might be thinking "Doesn't `num_calls` get reset to 0 each time?" Short answer: __No__. Why? Because that's how
C++ works with `static` variables. It might be hard to comprehend, however just remind yourself the following:
```
  The initialization statement of a static variable is only called once and is ignored afterwards.
```

So yeah. There aren't many situations that static variables are necessary, but there still exist some. If you're stuck on that
question (from the worksheet), check out my solution on the solutions page.

A problem similar to the program above is in the worksheet for this week.

##### Passing by const-reference
Like mentioned previously: Pass by const-reference when you're moving a big variable as a function argument but don't want to
change the variable itself.

Let's say you have a million integers inside a vector. If you were to pass that vector by-value to a function, the function would
first copy _every_ value first then run the function. That's a lot of data! More specifically:
```
  4 bytes per integer * 1 million integers to copy = 4 million bytes to copy
```

Okay, maybe that's not a lot nowadays (since 4 million bytes is roughly 4 megabytes and most computers nowadays have at least 4 gigabytes of
RAM). The point is the operation (the by-value copying) will take awhile to do. It can get nasty when we start making bigger byte-size objects and
having a lot of them in vectors. Although right now you can't see its effect at this point in time, it'll be very apparent in CS 131 when you start
to work with large data structures.

Example syntax of calling by const-reference:
```C++
  void print_vect(const vector<string>& str_list); //calling vector by const-reference
  int ret_sum(const int list[], int SIZE);         //remember that arrays are automatically called by reference
```

Although you won't be dealing with that many values in a vector in CS 121 (that's more of a CS 131 project), in computer science you
have to expect the worst. For that reason, and to have a [robust](http://www.linfo.org/robust.html) program, you'll want to call
variables that aren't primitive (e.g. not `char`, `int`, `int`, etc.) by reference. Add `const` if you don't want the variable to change.

__NOTE__: You'll learn about it later, but the reason why arrays are automatically called by reference is because they are specialized pointers.
For instance, know how you get a funky value if you print the identifier of a static array instead of each element? That's because you're printing
out the address of the first position of the array (a concept tied to pointers). A similar effect occurs when you call a variable by reference like as
follows:
```C++
  int a = 0;
  cout << &a << endl;
```

The above will print the address location of the variable `a` (located in the stack). The stack is a difficult concept to explain in short
words at this point in our class, so if you want to learn more about that you can check [this page](http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/)
out. It might fly over your head, but (for now) that's okay.

I won't go over how arrays are special pointers until we do so in lecture, but if you want a head-start read it in your book or check out an online
resource such as [here](http://www.cplusplus.com/doc/tutorial/pointers/) or [here](http://www.cprogramming.com/tutorial/lesson6.html).

-------------------------------------------------------------------------------

Copyright © 2014 Joseph Greene<EMAIL_ADDRESS>
Released under [The MIT License] (http://opensource.org/licenses/MIT)
Project located at <https://github.com/joegreene/CS_121_Fall_2014>

path: /Weekly Work/Week 7/FRI_NOTES.md


text:
# sha_hashes
Collection of sha hashes of common passwords.

[![screenshot](https://cloud.githubusercontent.com/assets/552629/26223531/2498c004-3c27-11e7-997f-52fffc9398df.png)](https://lovasoa.github.io/sha_hashes/)

## Organisation of the repository

### Python script
There is a small script provided that hashes passwords and saves the hashes in this repository format.

Create a password file containing one password per line, and run the following from the root of the repository:

```sh
./create_hashes.py < password_file.txt
```

### Hashes

This repo contains the hashes for around one million common passwords.
You can find the password that matches a given hash by looking into `hashes/sha1`.
The file tree is organised so that the first 4 characters of the haxedecimal hash are the first four directories in the file tree
under `/hashes/sha1`.

## How to clone

This repository contains over a million files. You might encounter issues when cloning it on your usual filesystem.

Instead, if you have more than 5GB of RAM, I would recommend to clone it to a temporary file system:

```sh
mkdir -p /tmp/ram
sudo mount -t tmpfs -o size=5G,nr_inodes=2m tmpfs /tmp/ram/
cd /tmp/ram/
git clone --depth 1 git@github.com:lovasoa/sha_hashes.git
```


text:
# Finite Elements

## Problem

The files in this folder apply the FEM (Finite Elements Method) to the Poisson Problem

 - Δ(Κ Δ) = f on Ω

 Κ = 2;

 u(d Ω)=0; Dirichlet Boundary Conditions

The error is calculated using the L2 Norm by comparing to the analytical solution:

1D: u(x)=x(1-x)

2D: u(x,y) =x(1-x)y(1-y)

## General application
This code will also be valid for general problems.


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.18.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.17.0<EMAIL_ADDRESS>(2023-08-01)

**Note:** Version bump only for package @quenty/seatutils

# [1.17.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.16.0<EMAIL_ADDRESS>(2023-07-28)

**Note:** Version bump only for package @quenty/seatutils

# [1.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.15.0<EMAIL_ADDRESS>(2023-07-23)

**Note:** Version bump only for package @quenty/seatutils

# [1.15.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.14.0<EMAIL_ADDRESS>(2023-07-15)

**Note:** Version bump only for package @quenty/seatutils

# [1.14.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.13.0<EMAIL_ADDRESS>(2023-07-10)

**Note:** Version bump only for package @quenty/seatutils

# [1.13.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.12.0<EMAIL_ADDRESS>(2023-06-17)

**Note:** Version bump only for package @quenty/seatutils

# [1.12.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.11.0<EMAIL_ADDRESS>(2023-06-05)

**Note:** Version bump only for package @quenty/seatutils

# [1.11.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.10.0<EMAIL_ADDRESS>(2023-05-26)

**Note:** Version bump only for package @quenty/seatutils

# [1.10.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.9.0<EMAIL_ADDRESS>(2023-05-08)

**Note:** Version bump only for package @quenty/seatutils

# [1.9.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.8.0<EMAIL_ADDRESS>(2023-04-24)

### Bug Fixes

* Fix missing dependencies ([3fbd817](https://github.com/Quenty/NevermoreEngine/commit/3fbd817b1fee45bda1b963b61a6ed22b0db12b82))

### Features

* Add RxSeatUtils.observeOccupantBrio() ([c8cf2d9](https://github.com/Quenty/NevermoreEngine/commit/c8cf2d9caf971c5902419ba19bb13504dcd94fac))

# [1.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.7.1<EMAIL_ADDRESS>(2023-04-10)

**Note:** Version bump only for package @quenty/seatutils

## [1.7.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.7.0<EMAIL_ADDRESS>(2023-04-07)

**Note:** Version bump only for package @quenty/seatutils

# [1.7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.6.0<EMAIL_ADDRESS>(2023-04-06)

**Note:** Version bump only for package @quenty/seatutils

# [1.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.5.0<EMAIL_ADDRESS>(2023-04-03)

**Note:** Version bump only for package @quenty/seatutils

# [1.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.4.0<EMAIL_ADDRESS>(2023-03-31)

**Note:** Version bump only for package @quenty/seatutils

# [1.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.3.0<EMAIL_ADDRESS>(2023-03-31)

**Note:** Version bump only for package @quenty/seatutils

# [1.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.2.0<EMAIL_ADDRESS>(2023-03-05)

**Note:** Version bump only for package @quenty/seatutils

# [1.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.1.0<EMAIL_ADDRESS>(2023-02-27)

**Note:** Version bump only for package @quenty/seatutils

# 1.1.0 (2023-02-21)

### Features

* Add seatutils ([c728672](https://github.com/Quenty/NevermoreEngine/commit/c728672e6313053ae744192219e3b6d0f0e6ea3b))

# v1.1.0 (Tue Feb 21 2023)

#### 🚀 Enhancement

- fix: A variety of small changes [#328](https://github.com/Quenty/NevermoreEngine/pull/328) ([@Quenty](https://github.com/Quenty))
- feat: Add seatutils ([@Quenty](https://github.com/Quenty))

#### Authors: 1

- James Onnen ([@Quenty](https://github.com/Quenty))

repository: Quenty/NevermoreEngine

gha_language: Lua

repo_name: Quenty/NevermoreEngine


text:
# Al&Bee

> Modern tool for user management

Al&Bee lets you keep track of user records in an easy way. It provides
simple-to-adopt interface to use it with joy!

## Getting started
### Prerequisites
You should first install required software to run Al&Bee. These include:
- MySql database server and Apache server (recommend [__XAMPP__](https://www.apachefriends.org/download.html));
- [PHP runtime](https://www.php.net/downloads)
- [Composer](https://getcomposer.org/download/)

### Configuration
Rename file [```.env.example```](./.env.example) to ```.env```. Then change variable values to how you need.
For the most part, you should only change:
- ```DB_HOST``` - ip of MySQL server,
- ```DB_PORT``` - port of MySQL server,
- ```DB_DATABASE``` - name of MySQL database,
- ```DB_USERNAME``` - username of MySQL database,
- ```DB_PASSWORD``` - username's password of MySQL database,
- ```APP_KEY``` - application encryption key, which can be generated using ```php artisan key:generate```,
- ```DB_SEEDER_USER_PASSWORD``` - password of Al&Bee admin.
If you use XAMPP, you can leave ```DB_HOST``` and ```DB_PORT``` to their default values.

### Installation
Clone the project using ```git clone https://github.com/dbelik/Al-Bee.git```.
Install packages via ```npm install``` and ```composer install```.
Create database (in phpMyAdmin, if you use it) with name = ```DB_DATABASE```.
Run ```php artisan migrate``` to run database migations.
Seed the database by running ```php artisan db:seed```.

### Running
Run ```npm run hot``` and ```php artisan serve```. Artisan will output the URL address where the website is running.

### Assignment
The project started in 09.02.2021 and took, approximately, 25 hours to complete.

## License
Al&Bee uses [Apache License 2.0](./LICENSE)

repository: dbelik/Al-Bee

repo_name: dbelik/Al-Bee


text:
---
layout: post
title:  "Using an Event Manager to Decouple your Game in Unity"
description: A Unity event manager that helps to decouple your game in Unity.
permalink: /using-an-event-manager-to-decouple-your-game-in-unity
---

A common way to compose a game scene in Unity is attaching one GameObject to another to share methods and properties. This practice causes a highly coupled architecture that is hard to maintain. Unity does provide a Messaging System but it limits the parameter's type that can be sent. In order to overcome these problems, I created a pure C# **Event Manager** to implement an event-driven architecture in my Unity Pixel Maze game.

 Triggering events allow components to communicate with each other without a hard reference and to compose elaborated game scenes. In fact this Unity Event Manager exercises the essential ingredients of OOP (Object-Oriented Programming): message passing and encapsulation.

"OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things."

  Alan Kay

## How to Set up

In the first game scene, create an empty Unity GameObject named *EventManager* and **attach** the `EventManager.cs` script to it. This script is set to `DontDestroyOnLoad`, i.e., it won't be destroyed when reloading scene.

EventManager.cs

## How to Use

No parameter:

{% highlight javascript %}
EventManager.TriggerEvent("gameOver", null);
{% endhighlight %}

1 parameter:

{% highlight javascript %}
EventManager.TriggerEvent("gamePause", new Dictionary<string, object> { { "pause", true } });
{% endhighlight %}

2 or more parameters:

{% highlight javascript %}
EventManager.TriggerEvent("addReward",
  new Dictionary<string, object> {
    { "name", "candy" },
    { "amount", 5 }
  });
{% endhighlight %}

The `Producer.cs` and `Consumer.cs` classes below show how an event is published and consumed. In this example, when a coin is collected, an `addCoins` event is published with the collected `amount`. A consumer receives the amount of coins collected and update its own coins amount.

Producer.cs

Consumer.cs

extension: markdown

gha_language: CSS


text:
# express-xmlrpc

  xml-rpc server middleware for [express](http://expressjs.com/)
  built on [node](http://nodejs.org)

    'use strict'

    const xmlrpc = require('express-xmlrpc')
    const express = require('express')
    const app = express()

    const port = process.env.PORT || 9999

    app.use(xmlrpc.bodyParser)

    app.post('/', xmlrpc.apiHandler({
      echo: function (req, res) {
        res.send(xmlrpc.serializeResponse(req.body.params[0]))
      }}
    ))

    app.listen(port)

    const client = xmlrpc.createClient({ port: port })
    client.methodCall('echo', [{ data: 9001 }], (error, value) => {
      console.log(`error: '${error}'`)
      console.log(`value: '${JSON.stringify(value)}'`)
    })

## installation

    $ yarn add philetus/express-xmlrpc

## running tests

make sure the dev dependencies are installed

    $ yarn install

run the test

    $ yarn test

## license

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: philetus/express-xmlrpc

repo_name: philetus/express-xmlrpc


text:
# CodesClaimedRatioAnomaly

This alert fires when a realm's predictive modeling for the ratio of `codes
claimed / codes issue` (the percentage of codes claimed) drops by more than one
standard deviation below the rolling 14 day average.

**This alert can have false positives**. There could be legitimate reasons why
the percentage of codes claimed decreases by more than one standard deviation.

## Triage Steps

1.  Identify the realm. The metric will be tagged with the realm ID. You can map
    this ID back to the realm in the system admin console of the verification
    server UI.

1.  Join the realm if you are not already a member.

1.  Inspect the realm stats. Sometimes this alert can fire if there was a public
    holiday or a long weekend. Use your judgement on whether the drop in codes
    claimed is of concern.

1.  Check the status page for the cloud hosting provider to see if there are any
    known issues.

1.  If you determine the drop to be of concern, notify the realm admin. This
    process varies by server operator, so use your internal playbooks for
    identifying and alerting realm admins. Inform the realm admin that you are
    investigating the incident. Ask if they have additional information or
    insights.

1.  Manually issue a code and check that it is properly delivered without error.

1.  Check the server logs for the `server` and `adminapi` components to see if
    there are errors related to code issuing.

1.  If the realm is issuing codes via a third-party SMS provider, check the
    third-party SMS provider's logs to see if the messages are being rejected as
    spam.

    If messages are being rejected, filed a high-priority ticket with the SMS
    provider.


text:
What's new
==========

2.0
---

- HTML respects whitespace from comments.
- Added support for docset publishing.
- Added support for preprocessor delimited class definitions.
- Fixed URL and crossrefs detection when embedded in parenthesis.
- Fixed . path handling for cmd line options.
- Added option for keeping intermediate files.
- Added troubleshooting info to readme.
- Fixed output directories creation.
- Fixed few missing @synthesize sentences.
- Many under the hood fixes and optimizations.

2.0b3
-----

- Bug fix release for documentation set.

2.0b2
-----

- Appledoc version is included in HTML footer.
- Method result can also be specified with @returns.
- Cross reference to index and hierarchy pages.
- Class hierarchy output.
- Clean HTML output.
- Minor fixes and refactorings.

2.0b1
-----

- Custom source code and comments parsing instead of doxygen.
- Embedded template builder instead of XSLT.
- Complete rewrite.

Release Checklist
=================

All low level key components are covered with unit tests, however some higher level components aren't so make sure you check all following tests before releasing a version.

- Compile as release to fix missing @synthesize and similar.
- Make sure all unit tests pass.
- Validate all input paths are parsed.
- Create HTML and validate few pages to see it's ok.
- Create documention set and make sure no warning is emitted by appledoc.
- Install documentation set and make sure it's available in Xcode.

This should provide level of quality big enough to ensure the biggest bugs are caught.

Components covered in unit tests
================================

Model group
-----------

All major components are under unit tests:

- GBStore class
- GBClassData class
- GBCategoryData class
- GBProtocolData class
- GBIvarData class
- GBMethodData class
- GBModelBase class
- GBAdoptedProtocolsProvider class
- GBIvarsProvider class
- GBMethodsProvider class
- GBComment class
- GBParagraphItems class

Not tested: helper/trivial classes, however these are briefly covered by other unit tests, most often from processing group.

Parsing group
-------------

All major components are under unit tests:

- GBTokenizer class
- GBObjectiveCParser class

Not tested: GBParser that parses command line arguments and invokes source code and comments parsing. However this is trivial and should be easily verified manually.

Processing group
----------------

All major components are under unit tests:

- GBProcessor
- GBCommentsProcessor

Generating group
----------------

Only lower level generating components are under unit tests:

- GBTemplateHandler
- GBTemplateVariablesProvider

As this is where parsed data is converted to output, this layer relies heavily on file system. Although it would be possible to unit test it, it seems like too much effort for too little gain IMHO, so only lower level building blocks are tested. This part requires most manual testing.

repository: appmaker/appledoc

path: /Release Notes.markdown

filename: Release Notes.markdown

repo_name: appmaker/appledoc


text:
---
# Documentation: https://wowchemy.com/docs/managing-content/

title: Pattern formation by interacting particles on the surface of a sphere
subtitle: ''
summary: ''
authors:
- G.J. Zarragoicoechea
- A.G. Meyra
- V.A. Kuz
tags: []
categories: []
date: '2009-01-01'
lastmod: 2020-12-15T09:28:04-03:00
featured: false
draft: false

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: ''
  focal_point: ''
  preview_only: false

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
projects: []
publishDate: '2020-12-15T12:28:04.628079Z'
publication_types:
- '2'
abstract: ''
publication: '*Molecular Physics*'
url_pdf: https://www.scopus.com/inward/record.uri?eid=2-s2.0-68249144521&doi=10.1080%2f00268970902886903&partnerID=40&md5=fbc6b34322e4661f33f50238e5357e36
doi: 10.1080/00268970902886903
---


text:
# Snippets
Collection of code snippets from various programming and scripting languages.

## Bash

#### tls_ciphers.sh
A script to test SSL/TLS protocols supported by servers.
This script uses openssl to make connections to the host provided.

#### show_or_hide_files_mac.sh
Script to toggle view files option on Mac OSX.

## Python

#### auto_ssh.py
Automizer script for testing ssh connections.

#### web_ping.py
Script to monitor changes on a webpage by pinging the given web link
every 1 hour(or any interval specified) and determine if HTML page of the
link has been altered since last ping. If a change is detected, an email is
sent to the address provided with changes and HTML content of updated
page.

repository: aditya-a-patil/Snippets

repo_name: aditya-a-patil/Snippets


text:
# julia-docdeploy

## Usage
```yaml
name: Documenter
on:
  push:
    branches: [master]
    tags: [v*]
  pull_request:

jobs:
  Documenter:
    permissions:
      contents: write
    name: Documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: julia-actions/julia-buildpkg@v1
      - uses: julia-actions/julia-docdeploy@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

If you need to build your documentation on a particular Julia version, you can insert

```
      - uses: julia-actions/setup-julia@v1
        with:
          version: nightly               # replace this with whatever version you need
          show-versioninfo: true         # this causes versioninfo to be printed to the action log
```

as the first entry after `steps:`.

### Prefixing the Julia command

In some packages, you may want to prefix the `julia` command with another command, e.g. for running tests of certain graphical libraries with `xvfb-run`.
In that case, you can add an input called `prefix` containing the command that will be inserted to your workflow:

```yaml
      - uses: julia-actions/julia-docdeploy@v1
        with:
          prefix: xvfb-run
```

### Customizing installation of package into docs environment

In some packages, you may want to install the package yourself into the docs environment. For example, if the package is in a subdirectory (but the docs environment is still top-level). In this case, you can pass `install-package: false`.

```yaml
      - uses: julia-actions/julia-docdeploy@v1
        with:
          install-package: false
```

### Setting terminal width

For some doctests, the default terminal width of GitHub Runners is too narrow.
To change this, set the `COLUMNS` environment variable.

```yaml
      - uses: julia-actions/julia-docdeploy@v1
        env:
          COLUMNS: '200'
```

repository: julia-actions/julia-docdeploy

repo_name: julia-actions/julia-docdeploy


text:
# Dynamic test certificate generation

## Background

In order to test certificate-based security scenarios, we generate test certificates for:

* Root Certificate Authority (CA)
* Machine certificate
* Certificate Revocation List (CRL)

This happens using the CertificateGenerator tool, located at `src/System.Private.ServiceModel/tools/CertificateGenerator`

This tool is automatically called on the following occasions:

* Creating a WCF IIS Hosted Service using `SetupWcfIISHostedService.cmd`
* Starting a WCF Self Hosted Service using `StartWCFSelfHostedSvc.cmd`
* Running `RefreshServerCertificates.cmd`

Certificate generation happens using the CertificateGenerator tool, Certificate generation happens only on Windows machines

Upon calling, the CertificateGenerator generates the following certificates:

* Root Certificate
* Client certificate
* Machine certificates
  * localhost
  * machine name
  * machine fully qualified domain name
  * revoked certificate
  * expired certificate
  * with server alt names

The certificate revocation list is published to (by default) C:\wcftest\test.crl, and can be changed via app.config

Certificates expire in 90 days

The CA certificates get installed into the machine trusted certificate store
Machine certificates get installed into the machine My store

## Certificate revocation list

A certificate revocation list is generated every time certificates are generated; the CRL is valid for the duration of the CA certificate.

Each certificate generated has a CRL Distribution Point of _base_address_/Crl - this is automatically set up when run using the scripts above, but if not using the scripts, then the endpoint need to be set up accordingly so that the CRL can be accessed. If this is not set up, certificates may fail to validate due to the CRL being inaccessible

## Certificate validity

The default validity period of certificates generated is 90 days. In order to deal with potential time skew, certificates are valid for five minutes *prior* to the generation time of the certificate.

## Certificate refresh

Certificates must be refreshed at the end of the certificate expiry - there is no provision for extension of the certificate validity date.

`RefreshServerCertificates.cmd` can be set up as a scheduled task to automatically perform these functions

repository: dotnet/wcf

gha_language: C#

repo_name: dotnet/wcf


text:
# Typographic Markdown

Typographic Markdown is a simple library that defines a few [InlineSyntax]
classes for extending the [markdown] package. These produce typographically
correct punctuation characters automatically (according to some heuristics)
while letting you write plain ASCII. It's similar to the original [SmartyPants]
library by John Gruber.

[inlinesyntax]: https://pub.dev/documentation/markdown/latest/markdown/InlineSyntax-class.html
[markdown]: https://pub.dev/packages/markdown
[smartypants]: https://daringfireball.net/projects/smartypants/

The extensions are:

*   **ApostropheSyntax**: Converts plain "'" apostrophe characters to left
    (‘) and right (’) characters as appropriate.

    The parser is as simple and stateless as possible. It only looks at the
    characters surrounding the apostrophe to decide what quote character to use,
    which means its heuristics aren't perfect. It leans towards assuming that
    apostrophes are more likely to be used for contractions than paired
    quotations. So it will do the wrong thing in:

        "He said '1 is the loneliest number.'"

    Here, it guesses that the `'1` is a numeric contraction and produces:

        “He said ’1 is the loneliest number.’”

*   **QuoteSyntax**: Converts plain '"' double quote characters to left
    (“) and right (”) characters as appropriate.

*   **EllipseSyntax**: Converts `...` to an ellipsis (…).

    A Unicode ellipsis character is not the ideal output if the goal is to
    visually match *The Chicago Manual of Style*. CMOS recommends full spaces
    between each dot (`. . .`), which is wider than the ellipsis character in
    most Unicode fonts. A future release of this package may remedy this
    grievous oversight.

*   **EmDashSyntax**: Converts ` -- `, a double hyphen with some kind of
    whitespace on either side to an em dash (—). This is different from
    SmartyPants, which uses a triple-dash for em dashes and double-dash for en
    dashes. I find en dashes are so rare that I would rather use ` -- ` for em
    dashes and write the HTML entity for en dashes explicitly.

repository: munificent/journal

repo_name: munificent/journal


text:
# MaryPopin for Xamarin iOS
This is a Xamarin C# binding on [MaryPopin](https://github.com/Backelite/MaryPopin),
an iOS library for presenting modal like controllers.

This project contains:

- A git submodule to the version of MaryPopin used to create the binding
- A Xcode project to build MaryPopin as a static library
- A Xamarin project to build the binding

The latest dll is directly available [here](https://github.com/Backelite/MaryPopin-Xamarin-iOS/blob/master/Binding/MaryPopin/bin/Release/MaryPopin.dll?raw=true).

It is 32-bits only for the moment but will be 64-bits as soon as Xamarin releases its Unified library in stable stage.

## Usage
Include the dll in your Xamarin iOS project, the Api is available under the MaryPopin namespace.

## Feature request, bug reports
Please report to the [MaryPopin](https://github.com/Backelite/MaryPopin) project if related to the library itself, to this project if related to the binding.

## Documentation
See [MaryPopin](https://github.com/Backelite/MaryPopin).

## Contributing

Contributions for bug fixing or improvements are welcomed. Feel free to submit a pull request.

## License
MaryPopin for Xamarin iOS is available under the MIT license. See the LICENSE file for more info.

repository: Backelite/MaryPopin-Xamarin-iOS

repo_name: Backelite/MaryPopin-Xamarin-iOS


text:
# phase-0-gps-1
gps 2.1

touch - create a file
git add - stage a file/edit, prepare for commit
git commit - actually commit changes with acc. message/notes
git push - to move local files to remote (github)
git status - check commit/branch status for changes
subl - open using sublime (text editor)
cd - change the directory
mkdir - create a dir.
git clone - clone a repo (with URL)
git checkout - change the working branch
ls - list the contents of a dir.
clear - clears the terminal


text:
---
layout: default
title: Calendar Mode
parent: Config Examples
nav_order: 2
---

# Calendar Mode

The second mode of view - calendar mode - Shows the full month calendar with simple events icons or colors, for the most important, infrequent events, like holiday or birthday.
You can change the mode by clicking the card name, or even make it the default view.
To make it work correctly you need to get more events than default 5 - you need to follow instruction [here](/quickstart#Show-more-than-5-events) for this, and setup it for 20-30 events at least.

There are four configurable possibilities for showing events occurring any day:

- day number color - for example "14" will be red for Valentine's Day
- Icon1 - will show any mdi icon under date, like birthday (default: gift icon)
- Icon2 - like above, just any other type of event (default: home icon)
- Icon3 - like above (default: star icon)

If you want to use any calendar's events, you have to add one or more of types:

```yaml
calEventIcon1Filter: bills,waste # only events with those words will be shown
calEventIcon2Filter: cleaning # only events with those words will be shown
entities:
  - entity: calendar.YOUR_CALENDAR_HERE # no type, it won't be shown in calendar mode
  - type: holiday # events from this calendar will be red
    entity: calendar.YOUR_CALENDAR1_HERE
  - type: icon1,icon2 # will show icon1 and icon2, but with filters configured above
    entity: calendar.home_events
  - type: icon3 # icon1 has no filters, show all events from this calendar
    entity: calendar.birthday
```

```yaml
entities:
  - entity: calendar.YOUR_CALENDAR_HERE
    type: holiday # events from this calendar will be red
  - entity: calendar.YOUR_CALENDAR1_HERE
    type: icon2,icon3 # will show icon2 and icon3, but with filters configured below
  - entity: calendar.birthday
    type: icon1 # Icon1 has no filters, show all events from this calendar
  - entity: calendar.YOUR_CALENDAR2_HERE # no type, it won't be shown in calendar mode
calEventIcon1Filter: bills,waste # only events with those words will be shown
calEventIcon2Filter: cleaning # only events with those words will be shown
```

If you set filters (keywords) for any type, it will show an icon only when event summary contains one of keywords. If you don't set any filter, it will show icons for all days with any events.

repository: dwradcliffe/atomic-calendar-revive

repo_name: dwradcliffe/atomic-calendar-revive


text:
# Best-first feature selection for classifications with cross-validation

Script to select the `n` best features for modeling a given dataset,
using a greedy algorithm. It only works for classification problems,
i.e., this script needs a categorical objective field.

The script takes as inputs:
- **dataset-id**: the dataset to use
- **max-n**: the number of maximum features (that is, dataset fields)
to return. It also takes into account the pre-selected features. The
number of features to be returned can be lower due to the early stop.
- **objective-id**: the objective field (target). It needs to be
categorical.
- **options**: the configuration options for the models
- **k-folds**: the number of k-folds to use in the cross-validation
- **pre-selected-fields**: the subset of pre-selected best-first features
that will be used from the beginning in `S` (see algorithm description
below).
- **early-stop-performance**: an early-stop-performance improvement
value (in %) used as a threshold to consider if a new feature has a
better performance compared to previous iterations.
- **max-low-perf-iterations**: the maximum number of consecutive
iterations allowed that may have a lower performance than the
early-stop performance set. It needs to be set as percentage of the
initial number of features in the dataset.

How the greedy algorithm works:
- The algorithm initializes the set of `S` features taking into
account the pre-selected best features from the dataset-id selected as
input. If there are not pre-selected features, `S` will be empty.
- For each iteration:
  - For each feature `f` in the dataset-id selected as input that is not
in `S`, it trains a model with feature set `S + f`. By default, the
algorithm builds decision trees, however you can select another
algorithms and its parametrization by configuring the options. For
example, if you set `{"number_of_models": 40}` ensembles with 40 models
will be trained at each iteration.
  - Then each model built with the feature set `S + f` is evaluated
using k-fold cross-validation.
  - The algorithm greedily selects the feature `f'` with the best
performance using the metric `average_phi` minus the standard deviation
(derived from the cross-validation) to use the worst case as metric of
performance.
  - If the feature `f'` improves the performance of the last
iteration, i.e. if the improvement is higher than the % set as the
early-stop-performance, it is added it to `S`.
  - If the feature `f'` have not improved the performance of the model,
i.e. the improvement is lower than the percentage set as
`early-stop-performance`, after a certain number of iterations (set by
`max-low-perf-iterations`) , the execution will stop.

Script outputs:
- **output-features**: A map with two main keys:
  - selected-fields: Selected features names
  - iterations-info: List of maps with the following information for
    each iteration:
    - phi-score
    - standard deviation
    - (phi - standard deviation) metric
    - features used in the model
- **output-dataset**: the dataset with the selected features.

repository: Belenlr/examples

repo_name: Belenlr/examples


text:
   Template

Shopify Mail Notifications

Blazing-fast templating environment for Shopify mail notifications with Liquid, ✉ MJML + 🌿 Twig. Create responsive emails quickly with less code.

## Table of contents
- [Features](#features)
- [System requirements](#system-requirements)
- [Getting started](#getting-started)
- [Production](#production)
- [Directories](#directories)
- [Documentation](#documentation)
- [Limitations](#limitations)

## Features
- MJML
- Twig
- Liquid
- Yaml
- Webpack
- Webpack-dev-server
- Ready to use shopify mail notification templates

## System requirements
- Node.js
- npm or yarn

## Getting started
Install dependencies and run webpack-dev-server:

### npm

```shell
$ npm install
```

```shell
$ npm run dev
```

### yarn

```shell
$ yarn import # migrate package-lock.json to yarn.lock
$ rm package-lock.json # or delete manually
$ yarn install --force
```

```shell
$ yarn dev
```

### Optional
If the server port is already in use, adjust `devServerPort` in `package.json`

## Production
Generate minified `.liquid` files in `dist/` directory:

### npm

```shell
$ npm run build
```

### yarn

```shell
$ yarn build
```

## Directories
| Directory | Description |
| --- | --- |
| .config | Contains webpack configs. |
| src | Contains webpack's main entry point `main.js` which auto-loads all `.twig` files inside `src/templates/` and all subdirectories. |
| src/assets | Contains images (used only during development). |
| src/components | Contains reusable components. |
| src/data | Contains `.yml` files. The contents are accessible in all `.twig` files. |
| src/data/shopify | Contains `data.yml` file with Shopify dummy data (used during development to populate liquid templates). |
| src/layouts | Contains layouts. |
| src/templates | Contains mail templates. The `index.twig` template is reserved for navigation. |

## Documentation

It's important to understand in which order webpack transforms the code. First, webpack compiles the `.twig` templates, then `MJML` tags are compiled to `html`. If the `build` task is running `liquid` isn't compiled and is written directly to the `dist/` directory as `.liquid` files. If the `dev` task is running: data from `src/data/shopify/` is passed to the liquid code, it's compiled to regular `html` and served via webpack-dev-server.

*Development flow*: `Twig` → `MJML` → `Shopify data` → `Liquid` → `.html files` → `Webpack-dev-server`

*Production flow*: `Twig` → `MJML` → `.liquid files`

### Additional notes
- Data from `src/data/` is available in all `.twig` templates.
- Data from `src/data/shopify/` is available during `liquid` compilation in development.
- If you want to write `liquid` tags instead of `twig` tags, you have to escape them with `{% verbatim %}{% endverbatim %}` [about verbatim](https://twig.symfony.com/doc/2.x/tags/verbatim.html).
- You might get a Parsing error, especially when using the `<` character in `liquid` tags, use `<!-- htmlmin:ignore -->{% if foo < 5 %}<!-- htmlmin:ignore -->` for a fix.
- Some Shopify specific filters might not exist in the liquid compiler. To fix this for development, you can add additional filters to the `filters` section inside `.config/webpack.common.js`.

### Additional docs
- [MJML docs](https://documentation.mjml.io/)
- [Twig docs](https://twig.symfony.com/doc/2.x/)
- [Liquid docs](https://shopify.github.io/liquid/)

## Limitations
- If you change data in files inside `src/data/shopify/`, you have to restart webpack.
- It's not possible to set `shop.email_accent_color` to change it later in Shopify.
- `POS Exchange Receipt` template doesn't work.

repository: iFixit/eu-email-templates

repo_name: iFixit/eu-email-templates