text:
Third-person camera for Godot (WIP)
-------------------------

Simple third-person camera.
Code is still scattered - tread at your own risk.

Features
--------

- Orbit around target
- Collision detection
- Fade out target when getting too close

Install
-------

-

Usage
-----

-

Todo
----

- Add camera state that locks on target.

Feedback and contributions are welcome!

repository: niklas-berg/Camera-State-Machine

repo_name: niklas-berg/Camera-State-Machine


text:
# Nametag app

Work done as part of my iOs Development for iPhone and iPad class

## Built With

* Swift 4
* Xcode 10

### License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
RLP Fuzzing
===========

This folder uses `go-fuzz` to fuzz our `rlp` package with random data in an attempt to cause a panic.

To use the tool yourself:

- run `make install` to install `go-fuzz` and `go-fuzz-build`
- run `make` (or `make fuzz`) to build an `rlp-fuzz.zip` and run it with `go-fuzz`.

The output will look something like:

```
2020/04/02 16:31:05 workers: 4, corpus: 128 (6m39s ago), crashers: 0, restarts: 1/4799, execs: 3210648 (4951/sec), cover: 244, uptime: 10m48s
2020/04/02 16:31:08 workers: 4, corpus: 128 (6m42s ago), crashers: 0, restarts: 1/4804, execs: 3214498 (4935/sec), cover: 244, uptime: 10m51s
2020/04/02 16:31:11 workers: 4, corpus: 128 (6m45s ago), crashers: 0, restarts: 1/4809, execs: 3217878 (4917/sec), cover: 244, uptime: 10m54s
```

The details are explained on the [`go-fuzz homepage`](https://github.com/dvyukov/go-fuzz), but the two main fields:

- `corpus` is the size of input data.  If you look in the `corpus/` folder, you will see some "hand-made" data I seed it with, as well
  as data auto-generated by `go-fuzz` when it found interesting test data.  Each file is single input sample.  `go-fuzz` may create new
  `corpus` files during a run, feel free to include those in a PR if they prove useful.
- `crashers` is the number of test inputs that caused a panic.  Keep an eye on it as sometimes `go-fuzz` will find a series of related
  panics that it doesn't recognize as related, and the number may quickly balloon.  The easiest way to use these crash outputs is to add
  them to the `TestFuzzCrashers` test in `rlp/fuzz_test.go` (and then hopefully submit a PR which causes the test to pass!).

The fuzz test itself is implemented in `fuzz.go`, and simply decodes and re-encodes the input data, and panics if reencoding fails.

repository: INFURA/go-ethlibs

gha_language: Go

gha_license_id: MIT

repo_name: INFURA/go-ethlibs


text:
---
layout: post
published: true
mathjax: true
featured: false
comments: false
title: Boltzmann Machines
description: An introduction to Boltzmann machines, Restricted Boltzmann machines, contrastive divergence and deep belief networks
categories:
  - python
  - machine-learning
---

This article tries to explain Boltzmann machines, RBMs, DBN, a little bit about energy models
and contains a python example which shows how a generative model can be trained with contrastive divergence.

## Boltzmann Machines

I have explained Binary Hopfield Networks in my last post.
They had three main problems:

- Bad efficiency
- Spurious states
- No possibility of "escaping" the wrong attractor region

Hinton and Sejnowski worked with a probabilistic graphical model which they called **Boltzmann machine** (prev. Harmonium).
The main differences:

- Every unit can have a unique bias
- The weighted sum that is calculated by each hidden unit has no threshold but a sigmoid activation function
  (the activation function is interpreted as the probability of the unit being active)
- Due to the stochasticity of the process a particle on the energy function can leave a local minimum

Generally speaking: A Boltzmann machine is a **stochastic recurrent neural network** with visible and hidden units. It is an undirected graph without self-connections.

![boltz1.jpg](/images/boltz2/boltz1.jpg)

The structure of the net is generally not constrained and therefore sampling and learning become a big problem.

The hidden units are denoted with $$h_i$$ and the visible units with $$v_i$$.
Both of these units are written as $$s_i$$.

As mentioned above, every unit can either be active (1) or deactivated (0).
Additional to the Hopfield Update rule we add a bias $$b_i$$ and the sigmoid function:

$$z_i = b_i + \sum_{j}{s_j \cdot w_{ij}}$$,       $$p(s_i=1) = \sigma(z_i) = \frac{1}{1+e^{-z_i}}$$

$$w_ij$$ is the weight of the connection between i and j and vice versa (for i!=j).

### Energy

Therefore we can write the energy of the network as:

$$ E = -\sum_{i<j}{s_i \cdot w_{ij} \cdot} - \sum_{i} b_i \cdot s_i $$

This is different from the Hopfield Networks because of the bias. Although the weights are undirected, two connected units do not have to have the same bias.

What is the probability p(v) of a given state v?
We defer the single probability of state to the energy function and divide it by all possible values of the Energy function:

$$p(v) = \frac{e^{-E(v)}}{\sum_{u}{e^{-E(u)}}} = \frac{e^{-E(v)}}{Z}$$

(Z is the partition function)

### Entropy and the Boltzmann distribution

If you measure the microscopic state of a thermodynamic system whose thermodynamic state is determined by a constant average energy, and only a constant average energy,

∑𝑖𝑝𝑖𝐸𝑖=⟨𝐸⟩

and you measure it many times, waiting between measurements long times in order to remove temporal correlations between them, then the set of measurements will follows the Boltzmann distribution

𝑝𝑖=𝑒−𝐸𝑖/𝑇∑𝑗𝑒−𝐸𝑗/𝑇

where 𝐸𝑖
is the energy of the i-th microscopic state, 𝑇 is the temperature and 𝑝𝑖

is the probability for each of the measurements to result in i-th microscopic state.

Notoriously, the Boltzmann distribution is the one you obtain if you maximize the entropy of the system

𝑆=−∑𝑖𝑝𝑖log2𝑝𝑖

as a function of the distribution 𝑝𝑖
subject to the set of thermodynamic constraints defining the thermodynamic state of the system, which in our case it is a constant average energy, only. This happens to be that way because, among all the microscopic states the system can possibly be, if you force the system to be in a specific thermodynamic state, then, you impose restrictions onto the set of microscopic states that the system can actually reach and with which probability (the 𝑝𝑖). This is the reason for which the thermodynamic state gives you some information about which are going to be your measurements about the microscopic states of the system. In other words, the entropy quantifies how much extra information you need, in average, to determine which is the microscopic state of the system at the time of your measurements, given that you only know its thermodynamic state.

source: [quora](https://www.quora.com/What-is-free-energy)

### Heat

The more you know about the state of system, the more you can take advantage of it in order to extract energy from it. For example, if a rock is falling from the sky, you can extract energy from it if you know where it is going to fall. The more you know about how and where the rock is falling, the more energy you will be able to extract from the event. In a sort of analogy, knowing that a rock is falling from the sky is like knowing the macroscopic state. On the other hand, knowing where it is going to fall is like knowing the microscopic state.

Following the previous idea, you can only extract energy from a thermodynamic system from what you know of its microscopic state, which in the present context, it is the thermodynamic state. You can think of heat as energy contained in the system that you cannot extract from it because you ignore the precise microscopic state of the system at the moment where you want to extract the energy.

source: [quora](https://www.quora.com/What-is-free-energy)

### Free energy

What is **free energy**? A thermodynamic quantity equivalent to the capacity of a system to do work.

The free-energy is then, in an average sense, the amount of energy contained in the system, i.e. it is total energy 𝑈=⟨𝐸⟩ minus the energy you cannot extract 𝑇𝑆 due to the remaining uncertainty or ignorance you have about which is its precise microscopic state the system is given that you only know about it its thermodynamic state.

This is free energy according to Helmholtz:
**Hemholtz free energy (U - TS)**

There is also **Gibbs free energy** defined as

$ G = U + PV - TS = H - TS $

in which U is internal energy, P is pressure, V is volume, T is absolute temperature, S is entropy, and H is enthalpy.

It measures the usefulness or process-initiating work obtainable from a system at a constant temperature and pressure.  If it is a chemical system, a reaction that lowers G occurs spontaneously.

source: [quora](https://www.quora.com/What-is-free-energy)

### Where the sigmoid comes from

see [wikipedia](https://en.wikipedia.org/wiki/Boltzmann_machine)

The difference of energies of two states is

$$ \Delta E_i = E_\text{i=off} - E_\text{i=on} $$

Substituting the energy of each state with its relative probability according to the Boltzmann factor (the property of a Boltzmann distribution that the energy of a state is proportional to the negative log probability of that state) gives:

$$ \Delta E_i = -k_B\,T\ln(p_\text{i=off}) - (-k_B\,T\ln(p_\text{i=on})) $$

where $$k_B$$ is Boltzmann's constant and is absorbed into the artificial notion of temperature $$T$$. We then rearrange terms and consider that the probabilities of the unit being on and off must sum to one:

$$\frac{\Delta E_i}{T} = \ln(p_\text{i=on}) - \ln(p_\text{i=off})$$
$$\frac{\Delta E_i}{T} = \ln(p_\text{i=on}) - \ln(1 - p_\text{i=on})$$
$$\frac{\Delta E_i}{T} = \ln\left(\frac{p_\text{i=on}}{1 - p_\text{i=on}}\right)$$
$$-\frac{\Delta E_i}{T} = \ln\left(\frac{1 - p_\text{i=on}}{p_\text{i=on}}\right)$$
$$-\frac{\Delta E_i}{T} = \ln\left(\frac{1}{p_\text{i=on}} - 1\right)$$
$$\exp\left(-\frac{\Delta E_i}{T}\right) = \frac{1}{p_\text{i=on}} - 1$$

Solving for $$p_\text{i=on}$$, the probability that the $$i$$-th unit is on gives:

$$p_\text{i=on} = \frac{1}{1+\exp(-\frac{\Delta E_i}{T})}$$

where $$T$$ is referred to as the temperature of the system. This relation is the source of the logistic function found in probability expressions in variants of the Boltzmann machine.

Altering the factor T makes the logistic function wider or steeper.

### Convergence

As with the Hopfield Nets the network shall converge to a stable state but "with a little bit of random".
This randomness is expressed by the steepness of the sigmoid function:

![sigmoid.jpg](/images/boltz2/sigmoid.jpg)

This steepness can be thought of as the learning rate of sgd. So we initially choose it large and then we let it become smaller so it can converge into a small region.

This is related to a method called simulated annealing. The size of the learning rate is called temperature and its getting colder with every step. The temperature determines the steepness in our example. The following image is taken from wikipedia to illustrate this process:

![/images/Hill_Climbing_with_Simulated_Annealing.gif](/images/boltz2/Hill_Climbing_with_Simulated_Annealing.gif)

If the temperature is fixed and after enough unit updates the system only depends on the energy
we say that it reached its **thermal equilibrium**.

## Restricted Boltzmann Machines

In order to cope with some of the problems the model had to be restricted to a bipartite graph called
the **Restricted** Boltzmann Machine.
The two cores of the bipartite graph are the visible and the hidden units.

It was proven in 2010 by Long and Servedio that Z is intractable for both machines.

![rbm1.jpg](/images/boltz2/rbm1.jpg)

### Energy

$$ E(h,v) = -\sum_{h_i}{\sum_{v_j}{w_{ij} h_i v_j}} - \sum_{h_i}{h_i b_i} - \sum_{v_j}{v_j b_j}$$

The probability of a visible unit v can be calculated easier:

$$p(v_j|H) = \sigma(b_j + \sum_{h_i}{w_{ij} h_i} )$$

And vice versa for a hidden unit:

$$ p(h_i|V) = \sigma (b_i + \sum_{v_j}{w_{ij} v_j} )$$

The free energy in a RBM can be calculated and one might use it to tell something about the "potential energy" we still have when we converged to an equilibrium. It can be used to determine if a RBM is overfitting.

### Learning with Contrastive Divergence

Source: [Youtube](https://www.youtube.com/watch?v=UcAWwySuUZM)

The idea is to pick a data vector and set it as visible units.
Now because the graph is bipartite we can update all hidden units at the same time and vice versa with the visible units until the units of the RBM reached thermal equilibrium.
This is a Markov Chain Monte Carlo method particularly Gibbs sampling.

The weight update becomes: $$\Delta w_{ij} = \epsilon ( <v_i h_j>^0 - <v_i h_j>^{\infty} )$$

This is a "fight" between what the memory wants (the state in the thermal equilibrium $$<v_i h_j>^{\infty}$$) and the data $$<v_i h_j>^0$$. In the beginning the memory is random therefore we don't want to make too many steps into its direction. If we don't wait until the thermal equilibrium is reached but rather use the "wrong" gradient the method is called **Contrastive divergence**.

The longer the training continues the more iterations of contrastive divergence learning are used. In the beginning it is one and then we increase it.

### Example of CD

The following python snippet visualizes as training with CD on MNIST.

```python
import matplotlib.pyplot as plt
import sklearn
import numpy as np

from scipy.stats import logistic
from sklearn.datasets import load_digits

digits = load_digits()

plt.gray()
```

    <Figure size 432x288 with 0 Axes>

```python
mask = digits.target == 3
threes = digits.images[mask]
```

```python
# Init
h = np.random.normal(0, 1, 25)
# bias
b1 = np.random.normal(0, 1, 64)
b2 = np.random.normal(0, 1, 25)
# from x to h
W = np.random.normal(0, 1, [64, 25])

# parameter
lr = 0.01
iterations = 100
contrastive_divergence_steps = 50

# debug
print_every_nth = 100

# contrastive divergence CD-50

# train on the first 8 threes
for x in threes[:8]:
    for iteration in range(iterations):
        v = x.flatten() / np.max(x)

        p_of_h = logistic.cdf(W.T.dot(v) + b2)
        positive_phase = np.dot(v[:, np.newaxis], p_of_h[:, np.newaxis].T)

        for i in range(contrastive_divergence_steps):
            # plt.matshow(v.reshape([8,8]))

            # calculate p(h|v)
            p_of_h = logistic.cdf(W.T.dot(v) + b2)

            # sample p(h|v)
            h = p_of_h

            # calculate p(h|v)
            p_of_v = logistic.cdf(W.dot(h) + b1)

            # sample p(h|v)
            v = p_of_v

        if iteration % print_every_nth == 0:
            plt.matshow(v.reshape([8,8]))
            plt.show()
            print(iteration, " size of W: ", np.sqrt(np.sum(W**2)))

        negative_phase = np.dot(v[:, np.newaxis], p_of_h[:, np.newaxis].T)

        update = positive_phase - negative_phase

        W += lr * update

```

![png](/images/boltz2/output_3_0.png)

    0  size of W:  39.924335666308195

![png](/images/boltz2/output_3_2.png)

    0  size of W:  39.17467666748022

![png](/images/boltz2/output_3_4.png)

    0  size of W:  38.97155882317313

![png](/images/boltz2/output_3_6.png)

    0  size of W:  38.944982809345895

![png](/images/boltz2/output_3_8.png)

    0  size of W:  38.80202589068636

![png](/images/boltz2/output_3_10.png)

    0  size of W:  38.74259814116064

![png](/images/boltz2/output_3_12.png)

    0  size of W:  38.6967212149249

![png](/images/boltz2/output_3_14.png)

    0  size of W:  38.74791680409241

This model of a three could already be used for dichotomizing threes and not-threes.

In the code I wrote something about a positive and a negative "phase" (or gradient).
In the case of a correct sample the positive gradient increases the likelihood of the data whereas the negative gradient increases the likelihood of all others (which means that it decreases the likelihood of the current point).

There are discussions whether the latter might be something like "unlearning" what humans do when they dream.

## Deep Belief Networks

Imagine we stacked another RBM on top of our hidden layer. We would treat the hidden units as visible and do the same training layer by layer (**Greedy Layer-wise training**). The RBMs are not really connected for the training. Once the first layer is ready we don't train it anymore. This yields a **Deep Belief Network** which is something that Geoffrey Hinton has been working on for quite some time.

In contrast to the Hopfield Net and the Boltzmann Machine is a Belief Net a directed probabilistic graphical model.
For this reason are the first models **Markov Random Fields** (MRF) and the Belief Net a **Bayesian Net**.
The MRFs are coupled with Energy-based models because symmetric weights are an important property to converge.
Directed graphs have the intention to model causal relationships and not only correlations.

The advantage of this "stacking" is to build hierarchical features. Although neural networks with two hidden layers are in theory already a general function approximator depth introduces a valuable inductive bias especially when coupled with a convolution. What I mean with that is that there are hierarchical patterns which can be uncovered easily when we assume locality and increasing complexity.

A Belief Net is:

- A directed acyclic graph
- typically sparsely connected (this is a prerequisite for some smart algorithms to work)
- every variable could be observed or hidden ("visible effects" and "hidden stochastic causes")
- First target: Infer the state of unobserved variables
- Second target: "Learning": Adapt the interactions between nodes in the graph in order to maximize the likelihood

Sampling the leaf nodes is easy but sampling the posterior is hard.
**Why is this interesting?** In supervised learning we assume that all our training samples were sampled from the data manifold. Why can't we just use the training data as samples from the posterior?

Unfortunately I have a technical answer only. For Variational Autoencoders (VAE). We assume that there are some hidden causes which we will never observe but we want to make them explicit and in the case of VAE even use them to control the generation of images or robotic hands.

An intuitively understandable reason for why sampling this posterior is difficult can be given by the concept of **Explaining-Away**. Explaining-Away is basically a pattern of reasoning where one cause of an effect explains that effect entirely thereby reducing (need not eliminate) the need to verify other alternative causes.

A quote from a [quora answer](https://www.quora.com/What-is-an-intuitive-explanation-of-the-explaining-away-problem-in-directed-graphical-models):

> Imagine an 'observation' 'Ob', say "you scored 100/100 in Math". It could have had two (for the sake of simplicity) causes, viz 'C1' - 'the question-paper was too easy' and 'C2' - 'you are too smart'. Now, 'Ob' could be because of either of those two causes (or both) i.e. you scored 100/100 because either the question-paper was way too easy or you're just too smart or both. Confirmation of one cause, say 'C1' i.e. 'paper was too easy' doesn't provide any evidence for the other alternate cause 'C2' ('you are too smart').
But, in a probabilistic scheme of reasoning, confirmation of the first reasoning 'C1' ('paper was easy') SHOULD REDUCE the probability of the other cause ('you are smart') even though both can be true simultaneously. This is called "Explaining Away". I mean to say if I know that you scored 100/100 and also know that the paper was way too easy, I tend to assume you're not very very smart even if you actually are.

The variational approach that was kicked-off by the **Wake-Sleep Algorithm** just does not use an unbiased sample from the posterior but a more or less similar distribution.
With this approximation we can make maximum likelihood. So it seems like we perform the same two steps as in **Expectation Maximization**.

There is a lot more to read and write about this topic but it feels like I am drifting to variational methods, therefore I am going end here and leave the rest for the next time.

[A Practical Guide to Training Restricted Boltzmann Machines](http://www.cs.toronto.edu/~hinton/absps/guideTR.pdf)


text:
## Reports Endpoint User Guide

The `/reports` endpoint is the primary endpoint for reporting requests. In order to provide maximum flexibility, many configuration options are available for requests.

### Overview
Using the Adobe Analytics UI can help an analyst or digital marketer answer some key questions. Sometimes though, it makes more sense to _automate_ reporting for executive dashboards, custom reporting platforms, or tight Experience Cloud integrations. The Analytics API strives to make these things possible.

It uses the same reporting API as the Analysis Workspace UI within Adobe Analytics.

### Best Practices
* Multiple smaller requests are preferred and often perform better than a single large request
* Request data once and cache it
* Don't poll for new data faster than a 30 minute interval
* Pull historical data and increment it regularly instead of requesting the entire data set

Discouraged Practices:

* Requesting as much data as possible in a single request
* Requesting one year of data at day granularity everyday - just request the new day and merge it
* Driving a web page with a site performance widget by making an API request every time the web page is loaded
* Requesting a full year of day-level data every day to get a rolling 12-month window

### Time Series Data
Time Series reports are the simplest report that the API can produce. They simply include information about the performance of a metric (or metrics) over a period of time.

Here is a simple 'Page Views' request:
```json
{
   "rsid":"adbedocrsid",
   "globalFilters":[
      {
            "type":"dateRange",
            "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
      }
   ],
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"dateRange",
            "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
         }
      ]
   },
   "dimension":"variables/daterangeday",
   "settings":{
      "dimensionSort":"asc"
   }
}
```

This report can be run with a `curl` command on the commandline:
```bash
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer [ACCESSTOKEN]" -d '[REQUESTJSON]' "https://analytics.adobe.io/reports?locale=en_US"
```

This request is doing a few things:

* Requesting the Page Views metric for the report suite `adbedocrsid`
* From Dec. 31, 2017 00:00:00.000 - Jan. 06, 2018 23:59:59.999 (using the report suite timezone)
* Using `variables/daterangeday` granularity (there are seven days in this time period, so I'll expect seven numbers)
* Sort by ascending date (i.e., oldest to newest)

Example response:
```json
{
   "totalPages":1,
   "firstPage":true,
   "lastPage":false,
   "numberOfElements":7,
   "number":0,
   "totalElements":7,
   "columns":{
      "dimension":{
         "id":"variables/daterangeday",
         "type":"time"
      },
      "columnIds":[
         "0"
      ]
   },
   "rows":[
      {
         "itemId":"1171131",
         "value":"Dec 31, 2017",
         "data":[
            794.0
         ]
      },
      {
         "itemId":"1180001",
         "value":"Jan 1, 2018",
         "data":[
            16558.0
         ]
      },
      {
         "itemId":"1180002",
         "value":"Jan 2, 2018",
         "data":[
            17381.0
         ]
      },
      {
         "itemId":"1180003",
         "value":"Jan 3, 2018",
         "data":[
            17384.0
         ]
      },
      {
         "itemId":"1180004",
         "value":"Jan 4, 2018",
         "data":[
            17442.0
         ]
      },
      {
         "itemId":"1180005",
         "value":"Jan 5, 2018",
         "data":[
            17417.0
         ]
      },
      {
         "itemId":"1180006",
         "value":"Jan 6, 2018",
         "data":[
            17334.0
         ]
      }
   ],
   "summaryData":{
      "totals":[
         104310.0
      ]
   }
}
```

The JSON response is made up of a few sections:

* The `rows` section contains each report record. In the above example, we see seven rows, each with a `value` and `data` array.
* The `value` property contains the dimension value. Since we're requesting a page views total by day, the value of each row will contain a date identifier for the day. For time series data, this identifier will change based on the granularity. For example, if we requested `variables/daterangemonth` instead, each value would contain a month/year identifier.
* The `data` property contains a list of metric counts for each metric requested. Since only one metric was requested, we only have a single total in each row.
* The `summaryData` section contains a total of the metrics in the current report.

A few handy changes:
* Set `dimension` to `variables/daterageday` for day granularity
* Change the `id` property in the `metrics` section to `metrics/visits` to request visits instead

#### Pagination
If we wanted to paginate the results, we would need to add a `limit` and `page` parameter to the `settings` object:

```json
{
   "rsid":"adbedocrsid",
   "globalFilters":[
      {
         "type":"dateRange",
         "dateRange":"2017-12-31T00:00:00.000/2018-01-31T23:59:59.999"
      }
   ],
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"dateRange",
            "dateRange":"2017-12-31T00:00:00.000/2018-01-31T23:59:59.999"
         }
      ]
   },
   "dimension":"variables/daterangeday",
   "settings":{
      "dimensionSort":"asc",
      "limit":"10",
      "page":"2"
   }
}
```

#### Anomaly Detection

The API can also produce information about anomalies that occur in a metric for a given time period. This is the same information provided in the UI and is provided by building a model based on historical performance and calculating confidence bands for expected performance. In other words, if the metric value is within the upper and lower bound of the confidence bands, that value is within observed historical norms.

While this information is available from the 1.4 API, a notable difference is the new inclusion of hour-based granularity. This can be very useful for building alerting tools or dashboards.
```json
{
   "rsid":"adbedocrsid",
   "globalFilters":[
      {
         "type":"dateRange",
         "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
      }
   ],
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"dateRange",
            "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
         }
      ]
   },
   "dimension":"variables/daterangeday",
   "settings":{
      "dimensionSort":"asc",
      "includeAnomalyDetection":true
   }
}
```

Example Response:

```json
{
   "totalPages":1,
   "firstPage":true,
   "lastPage":false,
   "numberOfElements":7,
   "number":0,
   "totalElements":7,
   "columns":{
      "dimension":{
         "id":"variables/daterangeday",
         "type":"time"
      },
      "columnIds":[
         "0"
      ]
   },
   "rows":[
      {
         "itemId":"1171131",
         "value":"Dec 31, 2017",
         "data":[
            794.0
         ],
         "dataExpected":[
            17395.648628666
         ],
         "dataUpperBound":[
            17462.569820465
         ],
         "dataLowerBound":[
            17328.727436868
         ],
         "dataAnomalyDetected":[
            true
         ]
      },
      {
         "itemId":"1180001",
         "value":"Jan 1, 2018",
         "data":[
            16558.0
         ],
         "dataExpected":[
            17374.697042688
         ],
         "dataUpperBound":[
            17444.125385086
         ],
         "dataLowerBound":[
            17305.26870029
         ],
         "dataAnomalyDetected":[
            true
         ]
      },
      ...SNIP...
   ],
   "summaryData":{
      "totals":[
         104310.0
      ]
   }
}
```

Let's look at one of these records:
```json
      {
         "itemId":"1180004",
         "value":"Jan 4, 2018",
         "data":[
            17442.0
         ],
         "dataExpected":[
            17367.596716078
         ],
         "dataUpperBound":[
            17438.041586498
         ],
         "dataLowerBound":[
            17297.151845658
         ],
         "dataAnomalyDetected":[
            true
         ]
      },
```

There are four properties:

* `dataExpected` - The calculated expected value for the metric
* `dataUpperBound` - The upper limit of the confidence band
* `dataLowerBound` - The lower limit of the confidence band
* `dataAnomalyDetected` - An indicator of whether the metric value is outside of the confidence bands.

### Calculated Metrics

### Trended and Ranked Requests
The above overtime examples could be seen as a 'Ranked' report, in that the `dimension` that was used was the date. With that in mind, let's try replacing the `dimension` with something else.
```json
{
   "rsid":"adbedocrsid",
   "globalFilters":[
      {
         "type":"dateRange",
         "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
      }
   ],
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"dateRange",
            "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
         }
      ]
   },
   "dimension":"variables/evar1",
   "settings":{
      "dimensionSort":"asc",
      "limit":5
   }
}
```

Here, I'm requesting `evar1`. In this example, the evar is simply storing a numeric ID for a campaign. Here is the example output:
```json
{
   "totalPages":8,
   "firstPage":true,
   "lastPage":false,
   "numberOfElements":5,
   "number":0,
   "totalElements":40,
   "columns":{
      "dimension":{
         "id":"variables/evar1",
         "type":"string"
      },
      "columnIds":[
         "0"
      ]
   },
   "rows":[
      {
         "itemId":"0",
         "value":"Unspecified",
         "data":[
            11560.0
         ]
      },
      {
         "itemId":"219343969",
         "value":"15",
         "data":[
            524.0
         ]
      },
      {
         "itemId":"349230650",
         "value":"7",
         "data":[
            4420.0
         ]
      },
      {
         "itemId":"511036305",
         "value":"11",
         "data":[
            1631.0
         ]
      },
      {
         "itemId":"743855946",
         "value":"10",
         "data":[
            2032.0
         ]
      }
   ],
   "summaryData":{
      "totals":[
         104310.0
      ]
   }
}
```

Let's look in detail at one of the records returned:
```json
{
   "itemId":"743855946",
   "value":"10",
   "data":[
      2032.0
   ]
},
```

* `itemId` - This is the unique ID associated with this particular value - in this case, campaign "10".
* `value` - This contains the value of the evar.
* `data` - This is an array of counts - one for each metric requested.

#### Filters
In the above example, only the top 5 records were requested and there were 8 pages worth of data available -- only 40 records. What if there were thousands of records, and only a handful were being reported on? Filters can be used to only include those few valuable values in the report.

For the next example, let's only request data for campaigns "10" and "11" by using their itemIds.
```json
{
   "rsid":"adbedocrsid",
   "globalFilters":[
      {
         "type":"dateRange",
         "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
      }
   ],
   "search":{
      "itemIds":[743855946,511036305]
   },
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"dateRange",
            "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
         }
      ]
   },
   "dimension":"variables/evar1",
   "settings":{
      "dimensionSort":"asc",
      "limit":5
   }
}
```

Example response:
```json
{
   "totalPages":1,
   "firstPage":true,
   "lastPage":true,
   "numberOfElements":2,
   "number":0,
   "totalElements":2,
   "columns":{
      "dimension":{
         "id":"variables/evar1",
         "type":"string"
      },
      "columnIds":[
         "0"
      ]
   },
   "rows":[
      {
         "itemId":"511036305",
         "value":"11",
         "data":[
            1631.0
         ]
      },
      {
         "itemId":"743855946",
         "value":"10",
         "data":[
            2032.0
         ]
      }
   ],
   "summaryData":{
      "totals":[
         104310.0
      ]
   }
}
```

The search parameter allows many parameters:

* `itemId` - A single ID to include in the report
* `itemIds` - A list of itemIds to include in the report (shown in the example)
* `excludeItemIds` - A list of itemIds to exclude in the report
* `clause` - A search clause to use when filtering dimensions
* `includeSearchTotal` - Includes a special element called 'searchTotals' in the response that contains the total of the filtered items. The default is false.

##### Clause
The search `clause` parameter provides a very powerful tool for filtering data.

* Uses boolean operators `AND`, `OR`, and `NOT`
* Uses operators `MATCH`, `CONTAINS`, `BEGINS-WITH`, `ENDS-WITH`
* Group conditions using parenthesis
* Strings are contained in single quotes.
* Searches are case-insensitive
* If no operator is specified, a 'contains' match is performed
* Valid operators are 'match' and 'contains'
* Glob expressions are evaluated. If a literal `*` is needed, use `\*`

Example Clause Statements:
* Only include results that match the string 'home page': `MATCH 'home page'`
* Include pages that don't contain 'home page': `NOT CONTAINS 'home page'`
* Include pages that don't contain 'home page' or 'about us', but do contain 'contact us': `(NOT CONTAINS 'home page' OR NOT CONTAINS 'about us') AND (CONTAINS 'contact us')`
* Include pages that contain 'home page' or start with 'landing': `CONTAINS 'home page' OR BEGINS-WITH 'landing'`

#### Applying a Segment
You can include a segment in your report by adding it to the `globalFilters` property.
```json
   ...
   "globalFilters":[
      {
         "type":"dateRange",
         "dateRange":"2014-06-01T00:00/2014-06-21T00:00"
      },
      {
         "type":"segment",
         "segmentId":"53adb46be4b0a2a175bf38c4"
      }
   ],
   ...
```

#### Breakdown Requests
Breakdowns in the API can be useful when you want to see the cross-product of values from two different dimensions. For example -- see a report containing a list of the top "Internal Search Terms" used by visitors who saw campaign "10".

To request a breakdown report, you'll use the `metricsFilters` and `dimension` parameters to request the additional dimension. In the below example, `evar1` is the marketing campaign and `evar2` is the "Internal Search Terms".
```json
{
   "rsid":"adbedocrsid",
   "globalFilters":[
      {
         "type":"dateRange",
         "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
      }
   ],
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"breakdown",
            "dateRange":"evar1",
            "itemId":"743855946"
         }
      ]
   },
   "dimension":"variables/evar2",
   "settings":{
      "dimensionSort":"asc",
      "limit":5
   }
}
```

Example Response:
```json
{
      "totalPages":2,
      "firstPage":true,
      "lastPage":false,
      "numberOfElements":5,
      "number":0,
      "totalElements":7,
      "columns":{
         "dimension":{
            "id":"variables/evar2",
            "type":"string"
         },
         "columnIds":[
            "0"
         ]
      },
      "rows":[
         {
            "itemId":"1132341824",
            "value":"red t-shirt",
            "data":[
               1515.0
            ]
         },
         {
            "itemId":"2400044733",
            "value":"digital watches",
            "data":[
               1.0
            ]
         },
         {
            "itemId":"3351316813",
            "value":"sport socks",
            "data":[
               11.0
            ]
         },
         {
            "itemId":"3440395251",
            "value":"gps watch",
            "data":[
               95.0
            ]
         },
         {
            "itemId":"3614317595",
            "value":"running shoes",
            "data":[
               16.0
            ]
         }
      ],
      "summaryData":{
         "totals":[
            2032.0
         ]
      }
   }
```


text:
It's advised that during development [DEVirion](#using-devirion) is used and when the plugin is ready production that this library is either installed [by Poggit](#installing-with-poggit) or installed [by hand](#manually-installing-into-a-plugin-phar).

## Using DEVirion

DEVirion allows your plugin to use Remark.

1. Install `Remark.phar` from this project's [Github Releases](https://github.com/Swift-Strider/Remark/releases/).
1. Place `Remark.phar` into your server's `virions` folder, which is next to the `plugins` folder.
1. If not already downloaded, get DEVirion from [Poggit](https://poggit.pmmp.io/p/DEVirion/).

## Installing with Poggit

Plugins that are built on poggit and use virions should declare there dependencies in `.poggit.yml`. To use Remark add an entry like this.
```yml
projects:
  my-pugin-project:
    path: ""
    libs:
      - src: Swift-Strider/Remark/Remark
        version: ^3.3.0
        epitope: .random
```

## Manually Installing into a Plugin Phar

Install `Remark.phar` from this project's [Github Releases](https://github.com/Swift-Strider/Remark/releases/).

If you haven't already, build your plugin into a phar file. This example script assumes you're in your plugin's directory and that the files/directories `plugin.yml`, `src`, and `resources` exist. The following works on both `Windows 10 (Powershell)` and `Ubuntu`.
```sh
wget https://raw.githubusercontent.com/pmmp/DevTools/master/src/ConsoleScript.php -O ConsoleScript.php
php -dphar.readonly=0 ConsoleScript.php --make src,resources,plugin.yml --relative . --out plugin.phar
```

Next you will "infect" your plugin's `.phar` file, embedding the Remark library inside of your plugin.
```sh
php -dphar.readonly=0 Remark.phar plugin.phar
```

repository: Swift-Strider/Remark

branch_name: refs/heads/main

gha_language: PHP

repo_name: Swift-Strider/Remark


text:
# Customized-Word2Vec
This repository contains additional features, extended to the traditional Word2Vec library, launched in 2013.
This project was part of a larger project that involved sentimental analysis and sarcasm detection. The project details have been added in the repo-description section.

Directly clone the repository and start using it. The details of how the files are named and strored is given below:-

-> The model made using 3 options - **Skipgram model, Common Bag of Words, Negative Sampling.**

-> You can change the following model parameters:
* Window Size
* Vector Size
* Learning Rate
* Sub-sampling
* number of epochs you want to train for.

-> Optimizer used is SGD.

-> Other that the main code ipynb, entire training corpus and testing corpus (numpy array) of reuters dataset <b>(can be downloaded directly from [here]())</b>, I have included an example directory where I have applied my code base.

For more information, please refer to the project report uploaded.

---
## The Example folder contains :

-> The folder contains numpy array of training and testing datasets

-> The folder also contains a pickle file containing the dictionary:
   key - Word (string format)
   values - onehot encoding (numpy array)

-> Naming Convention of the weight1 files are :

../Window_{window size}/{choice of model}/{learning rate}_{vector size}weight_numpy.npy

These, weight vectors must be dot producted with the onehot vectors to get the actual embeddings in
the format given : W'X { W - Weight ; X - Onehot Vector}


text:
Micro-sites require zero-configuration, a blog is easily started with one of the sample themes, but you can always grow with your needs and create arbitrarily complex sites with Qgoda.

## Multi-Language

Qgoda offers multi-lingualism for free:

- Template translation based on [GNU gettext](https://www.gnu.org/software/gettext/).
- Built-in I18N-aware links and listings
- File-based translation facilities, _or_
- Complete website translation based on PO-files [see GNU gettext](https://www.gnu.org/software/gettext/)

## Arbitrary Taxonomies

Tags, categories, languages, sections, ... it's up to you.

## Language and Platform Agnostic

You can extend Qgoda in Perl, Python, Ruby, Java, other languages may follow.

Development web server or build system is completely up to you. The Qgoda default themes are based on [Webpack](https://webpack.js.org/) but go with Makefiles, shell scripts, ant or Maven if [NodeJS](https://nodejs.org/) is not your comfort zone.

## The Ideal Project Portal

The [Qgoda website](http://www.qgoda.net/) is an open-source, multi-lingual portal site for the open source project Qgoda, containing a [landing page](http://www.qgoda.net/), a [multi-lingual blog](http://www.qgoda.net/en/news/), and [extensive software documentation](http://www.qgoda.net/en/docs/). Qgoda is the ideal software for your open source project or community.

## Pronunciation

It is pronounced "yagoda" and it means strawberry in Bulgarian and other Slavic languages. The cyrillic letter "ya" is commonly transcribed as "q" because it resembles the original cyrillic letter "я".

## Getting Started

After [installing Qgoda](http://www.qgoda.net/en/docs/installation/) or getting the [Docker image](https://github.com/gflohr/qgoda#user-content-run-qgoda-in-docker-container) going, try one of the following inside an empty(!) directory of your choice:

- `qgoda init gflohr/essential`: a complete blog without any styling
- `qgoda init gflohr/default`: same as above but with development web server, webpack, ...
- `qgoda init gflohr/multilang`: same as above but multi-lingual
- `qgoda init gflohr/minimal`: if all of the above is just too much and you want to control everything yourself


text:
[![Build Status](https://travis-ci.org/Sage-Bionetworks/synapseAnnotations.svg?branch=master)](https://travis-ci.org/Sage-Bionetworks/synapseAnnotations)

> Use our [Annotation UI](https://shiny.synapse.org/users/nsanati/annotationUI/) application to easily view and search our existing annotation definitions:
>

# Introduction

Sage Bionetworks derived standards for annotating content in Synapse. This provide a mechanism for defining, managing, and implementing controlled vocabularies when annotating content in Synapse. The standards here are developed for Sage Bionetworks supported communities and consortiums by the [Sage Bionetworks Synapse Annotations working group](https://www.synapse.org/annotation) but are available for any other use.

# Annotation definitions

This repository contains schemas that define the things we want to annotate as well as the controlled values that may be used. You can think of these as 'columns' of a table, each with a limited set of values that can occur in each column.

Our schema definitions are stored here in [Synapse Table Schema](http://docs.synapse.org/articles/tables.html) format. A schema is a list of [`Column Model`s](http://docs.synapse.org/rest/org/sagebionetworks/repo/model/table/ColumnModel.html) in JSON format. Using this format allows us to use them in a straightforward manner with other features of Synapse, including [file views](http://docs.synapse.org/articles/fileviews.html) and [tables](http://docs.synapse.org/articles/tables.html).

Column types are required, and the valid types can be found [here](http://docs.synapse.org/rest/org/sagebionetworks/repo/model/table/ColumnType.html).

# Organization

All schema definitions can be found in the [synapseAnnotations/data/](synapseAnnotations/data/) folder. There are three high level schemas: [experimental data](synapseAnnotations/data/experimentalData.json), [tool](synapseAnnotations/data/tool.json), and [analysis](synapseAnnotations/data/analysis.json).

Schemas for specific communities and consortia are also defined, such as for the [neurodegenerative diseases consortiums](synapseAnnotations/data/neuro.json), [cancer consortiums](synapseAnnotations/data/cancer.json), and specific group such as (but not limited to) [Project GENIE](synapseAnnotations/data/genie.json).

# Development

This section discusses the steps for developing on this repository. See the [CONTRIBUTING.md](CONTRIBUTING.md) document for more information on how to contribute annotations to this project.

## Proposing changes

1. Make changes on your feature branch.
1. Request and complete a review from someone on the team.
1. When review is completed, note it to be reviewed and merged at the weekly meeting.
1. Finalize merge into the `develop` branch.
1. Update the version and make a versioned release (with assistance from @teslajoy)

# Release Versioning Annotations
Releases are made through Github tags and are available on the [Releases](https://github.com/Sage-Bionetworks/synapseAnnotations/releases) page.

The release version structure **vX.X.X** follows [semantic versioning](http://semver.org/) guidelines. New releases are made using the following rules:

Major version increments by:
1. Changes in data structure (ex. yaml to json or json to mongodb)
2. Changes to existing keys
3. Changes to existing values

Minor version increments by:
1. Adding keys
2. Adding values

Patch version increments by:
1. Errors or corrections that don't break the API

To optimize usability, the release tags should be placed on two required and one optional locations:
1. A Synapse Project annotation as a single value defined by the key **`annotationReleaseVersion`**.
1. The Shiny application [Annotation UI](https://github.com/Sage-Bionetworks/annotationUI)'s **title**
1. OPTIONAL: Documented in a Synapse Project wiki.

## Update `CHANGELOG.md` and release notes

After drafting a release, use this [Ruby package](https://github.com/skywinder/github-changelog-generator) to auto-generate a `CHANGELOG.md` locally that can be committed to the repository. It requires a [Github Personal Access Token](https://github.com/settings/tokens). The token should have all `repo` scope permissions. Generate a key and save the string that GitHub provides as an env variable in bash: `export CHANGELOG_GITHUB_TOKEN=<your_token_here>`.

The steps to create a release are as follows:

1. Merge the develop branch into master and push to GitHub
1. Run the [changelog generator](https://github.com/github-changelog-generator/github-changelog-generator)
   1. If you haven't already, install the changelog generator `gem install github_changelog_generator`
   1. From within the synapseAnnotations directory on your machine, run `github_changelog_generator -u Sage-Bionetworks -p synapseAnnotations --future-release X.X.X` (replacing `X.X.X` with the new version number)
1. Commit the new CHANGELOG.md directly to master and push to GitHub.
1. Create a new release on Github using the web interface. Both the tag version and release title should be "vX.X.X".
1. Copy the new section of CHANGELOG.md to release notes section of the new release.
1. Merge the master branch into develop and push to GitHub.

Generally, you will next want to update the [Synapse table](https://www.synapse.org/#!Synapse:syn10242922) that describes the annotations and powers the [AnnotationUI](https://shinypro.synapse.org/users/nsanati/annotationUI/):

1. Run the script `update_annotations_table.R`

Additional information about the release process can be found in [issue 392](https://github.com/Sage-Bionetworks/synapseAnnotations/issues/392)


text:
# Letsencrypt::Dns01

## Usage

make core.rb(below).and add `00 1 * * * nsd ruby core.rb` to your corntab file
```
  Letsencrypt::Dns01::BIND9.new({
    name: 'example.com',
    zonefile: '/etc/nsd/example.com.zone',
    nameserver: [ '<IP_ADDRESS>' ],
    domains: [
      'example.com',
      'www.example.com'
    ],
    authkey: '/acme/authkey/example.com.pem',
    certdir: '/acme/example.com',
    logfile: '/var/log/letsencrypt_example.com.log',
    commands: [
       'service nsd restart',
       #'nginx -s reload',
    ],
    endpoint: 'https://acme-staging.api.letsencrypt.org',
    mail<EMAIL_ADDRESS>  }).update()
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/nak1114/letsencrypt-dns01.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
# frabble

inspirational credit:
=====================
https://medium.com/javascript-in-plain-english/build-an-8-puzzle-game-with-pure-javascript-efe424bc252a

how to change apache document root to /koushik/tesseract/frabble (from /var/www/html):
=======================================================================================
1. Change /etc/apache2/sites-available/000-default.conf --> Update value of "DocumentRoot" to "/koushik/tesseract/frabble"

2. Change /etc/apache2/apache2.conf, search for "Directory" --> there will be a few sections, append this at the end:

<Directory /koushik/tesseract/>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
</Directory>

3. sudo service apache2 restart

repository: kbxkb-games/frabble

repo_name: kbxkb-games/frabble


text:
---
layout: docs
title: VirtualMachine
permalink: /docs/workloads/controllers/virtualmachine.html
navbar_active: Docs
order: 10
---

# VirtualMachine

An _VirtualMachine_  provides additional management capabilities to a
VirtualMachineInstance inside the cluster. That includes:

 * ABI stability
 * Start/stop/restart capabilities on the controller level
 * Offline configuration change with propagation on VirtualMachineInstance recreation
 * Ensure that the VirtualMachineInstance is running if it should be running

It focuses on a 1:1 relationship between the controller instance and a virtual
machine instance. In many ways it is very similar to a
[StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)
with `spec.replica` set to `1`.

## How to use a VirtualMachine

A VirtualMachine will make sure that a VirtualMachineInstance object with an
identical name will be present in the cluster, if `spec.running` is set to
`true`. Further it will make sure that a VirtualMachineInstance will be removed from
the cluster if `spec.running` is set to `false`.

### Starting and stopping

After creating a VirtualMachine it can be switched on or off like this:

```bash
# Start the virtual machine:
virtctl start myvm

# Stop the virtual machine:
virtctl stop myvm
```

`kubectl` can be used too:

```bash
# Start the virtual machine:
kubectl patch virtualmachine myvm --type merge -p \
    '{"spec":{"running":true}}'

# Stop the virtual machine:
kubectl patch virtualmachine myvm --type merge -p \
    '{"spec":{"running":false}}'
```

### Controller status

Once a VirtualMachineInstance is created, its state will be tracked via
`status.created` and `status.ready`. If a VirtualMachineInstance exists in the cluster,
`status.created` will equal to `true`. If the VirtualMachineInstance is also ready,
`status.ready` will equal `true` too.

If a VirtualMachineInstance reaches a final state but the `spec.running` equals `true`,
the VirtualMachine controller will set `status.ready` to `false` and
re-create the VirtualMachineInstance.

### Restarting

A VirtualMachineInstance restart can be triggered by deleting the VirtualMachineInstance. This
will also propagate configuration changes from the template in the
VirtualMachine:

```bash
# Restart the virtual machine (you delete the instance!):
kubectl delete virtualmachineinstance myvm
```

### Fencing considerations

A VirtualMachine will never restart or re-create a VirtualMachineInstance until
the current instance of the VirtualMachineInstance is deleted from the cluster.

### Exposing as a Service
A VirtualMachine can be exposed as a service. The actual service will be available once the VirtualMachineInstance starts without additional interaction.

For example, exposing SSH port (22) as a `ClusterIP` service using `virtctl` after the OfflineVirtualMAchine was created, but before it started:

```bash
$ virtctl expose virtualmachine vmi-ephemeral --name vmiservice --port 27017 --target-port 22
```

All service exposure options that apply to a VirtualMachineInstance apply to a VirtualMachine. See [Exposing VirtualMachineInstance](http://www.kubevirt.io/user-guide/#/workloads/virtual-machines/expose-service) for more details.

## When to use a VirtualMachine

### When ABI stability is required between restarts

A _VirtualMachine_ makes sure that VirtualMachineInstance ABI configurations
are consistent between restarts. A classical example are licenses which are
bound to the firmware UUID of a virtual machine. The _VirtualMachine_
makes sure that the UUID will always stay the same without the user having to
take care of it.

One of the main benefits is that a user can still make use of defaulting logic,
although a stable ABI is needed.

### When config updates should be picked up on the next restart

If the VirtualMachineInstance configuration should be modifyable inside the cluster and
these changes should be picked up on the next VirtualMachineInstance restart. This
means that no hotplug is involved.

### When you want to let the cluster manage your individual VirtualMachineInstance

Kubernetes as a declarative system can help you to manage the VirtualMachineInstance.

You tell it that you want this VirtualMachineInstance with your application running,
the VirtualMachine will try to make sure it stays running.

> **Note**: The current believe is that if it is defined that the
> VirtualMachineInstance should be running, it should be running. This is different to
> many classical virtualization platforms, where VMs stay down if they were
> switched off. Restart policies may be added if needed. Please provide your
> use-case if you need this!

## Example

```yaml
apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachine
metadata:
  creationTimestamp: null
  labels:
    kubevirt.io/vm: vm-cirros
  name: vm-cirros
spec:
  running: false
  template:
    metadata:
      creationTimestamp: null
      labels:
        kubevirt.io/vm: vm-cirros
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: registrydisk
            volumeName: registryvolume
          - disk:
              bus: virtio
            name: cloudinitdisk
            volumeName: cloudinitvolume
        machine:
          type: ""
        resources:
          requests:
            memory: 64M
      terminationGracePeriodSeconds: 0
      volumes:
      - name: registryvolume
        registryDisk:
          image: kubevirt/cirros-registry-disk-demo:latest
      - cloudInitNoCloud:
          userDataBase64: IyEvYmluL3NoCgplY2hvICdwcmludGVkIGZyb20gY2xvdWQtaW5pdCB1c2VyZGF0YScK
        name: cloudinitvolume
```

Saving this manifest into `vm.yaml` and submitting it to Kubernetes will
create the controller instance:

```bash
$ kubectl create -f vm.yaml
virtualmachine "vm-cirros" created
```

Since `spec.running` is set to `false`, no vmi will be created:

```bash
$ kubectl get vmis
No resources found.
```

Let's start the VirtualMachine:

```bash
$ virtctl start omv vm-cirros
```

As expected, a VirtualMachineInstance called `vm-cirros` got created:

```yaml
$ kubectl describe vm vm-cirros
Name:         vm-cirros
Namespace:    default
Labels:       kubevirt.io/vm=vm-cirros
Annotations:  <none>
API Version:  kubevirt.io/v1alpha2
Kind:         VirtualMachine
Metadata:
  Cluster Name:
  Creation Timestamp:  2018-04-30T09:25:08Z
  Generation:          0
  Resource Version:    6418
  Self Link:           /apis/kubevirt.io/v1alpha2/namespaces/default/virtualmachines/vm-cirros
  UID:                 60043358-4c58-11e8-8653-525500d15501
Spec:
  Running:  true
  Template:
    Metadata:
      Creation Timestamp:  <nil>
      Labels:
        Kubevirt . Io / Ovmi:  vm-cirros
    Spec:
      Domain:
        Devices:
          Disks:
            Disk:
              Bus:        virtio
            Name:         registrydisk
            Volume Name:  registryvolume
            Disk:
              Bus:        virtio
            Name:         cloudinitdisk
            Volume Name:  cloudinitvolume
        Machine:
          Type:
        Resources:
          Requests:
            Memory:                      64M
      Termination Grace Period Seconds:  0
      Volumes:
        Name:  registryvolume
        Registry Disk:
          Image:  kubevirt/cirros-registry-disk-demo:latest
        Cloud Init No Cloud:
          User Data Base 64:  IyEvYmluL3NoCgplY2hvICdwcmludGVkIGZyb20gY2xvdWQtaW5pdCB1c2VyZGF0YScK
        Name:                 cloudinitvolume
Status:
  Created:  true
  Ready:    true
Events:
  Type    Reason            Age   From                              Message
  ----    ------            ----  ----                              -------
  Normal  SuccessfulCreate  15s   virtualmachine-controller  Created virtual machine: vm-cirros
```

### kubectl commandline interactions

Whenever you want to manipulate the VirtualMachine through the
commandline you can use the kubectl command.


text:
# NickMOO
[![Build Status](https://travis-ci.org/nvella/nickmoo.svg?branch=master)](https://travis-ci.org/nvella/nickmoo) [![Coverage Status](https://coveralls.io/repos/nvella/nickmoo/badge.svg?branch=master&service=github)](https://coveralls.io/github/nvella/nickmoo?branch=master)

NickMOO in it's simplest terms is an online text game where a major gameplay element is reprogramming and adding content to the game while you are playing it. This is historically known as MOO (MUD-Object-Oriented), which is a descendant of the MUD genre. In terms of originality, NickMOO doesn't introduce any new concepts to the MOO genre, it's simply my interpretation and implementation of the genre. Because of this, NickMOO is incompatible with all current MOO implementations, most notably LambdaMOO.

NickMOO is built with NodeJS and MongoDB.

## Project status

- [x] TCP server
- [x] Connection management
- [x] <s>Welcome message</s> *made redundant*
- [x] NML
 - [x] Script Parser
 - [x] VM
- [x] Objects (MObject)
 - [x] Javascript->DB mapping
- [ ] SubVMs and verbcall execution (in progress)
- [ ] Native (call-into-js) verbs
- [ ] Connection-MObj pairing
- [ ] NML stdlib
 - [ ] IO
 - [ ] etc etc
- [ ] Documentation

*to be expanded*

## NML

At the core of any MOO is an in-game scripting language and at the core of NickMOO is a custom language called NML, or the NickMOO Language.
NML is used for player control and in-game scripting, it is a very informal language where most structure is optional.

For example, to send a message to the chat, a player could write

    say Hello World!

but if they were writing a script and wanted to implement more structure, they could write;

    say('Hello World!')

Documentation for NML is in the works.

## Contributing

I wouldn't say the project is in a state quite yet where it's ready for contributions. If you see something that can be improved, submit a pull request anyway. Once the server can actually start I'll begin to make an effort to improve contribution documentation.

repository: nvella/nickmoo

gha_language: JavaScript

repo_name: nvella/nickmoo


text:
aws-tools
=========

This are all the tools you need to manage your AWS public cloud from the command line.

Make sure to modify the **JAVA_HOME** variable before using it. It's actually hardcoded for OSX Mountain Lion.

I'll try to keep the tools up to date. If not, feel free to Contribute ;)

Assumptions
============
For this repository I assume that you already have this directory tree.

~/.ec2
   |---- aws-credential-ES
   |---- cert-ES.pem
   |---- pk-ES.pem

### File Description

* aws-credential-ES: AWS Credentials as shown in aws-credential.template [AWS CREDENTIALS] [CREDENTIALS]
* cert-ES.pem: Cert x.509 Amazon certificate [AWS CREDENTIALS] [CREDENTIALS] Download it and Rename.
* pk-ES.pem: PK x.509 Amazon certificate [AWS CREDENTIALS] [CREDENTIALS] Download it and Rename.

Setup
======

* Clone the repository into your ~/.ec2/aws-tools directory
* Modify your .bashrc or .bash_profile adding this lines

if [ -f ~/.ec2/aws-tools/.bash_aws ]; then
    . ~/.ec2/aws-tools/.bash_aws
fi

Contributing
============
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Command Line Tool URL's
========================
[Autoscaling](http://aws.amazon.com/developertools/2535)

[Cloudwatch](http://aws.amazon.com/developertools/2534)

[EC2 AMI](http://aws.amazon.com/developertools/368)

[EC2 API](http://aws.amazon.com/developertools/351)

[ElasticBeanstalk](http://aws.amazon.com/code/6752709412171743)

[Elastic load Balancing](http://aws.amazon.com/developertools/2536)

[IAM](http://aws.amazon.com/developertools/AWS-Identity-and-Access-Management/4143)

[RDS](http://aws.amazon.com/developertools/2928)

LICENSE:
========
Copyright (c) 2007-2009 RightScale, Inc.

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.

[CREDENTIALS]: https://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key

repository: gburiticato/aws-tools

repo_name: gburiticato/aws-tools


text:
# OTGanttChartKit
====

OTGanttChartKit is gantt chart framework for iOS. This framework use easily like UITableView.

## Description

OTGanttChartKit has color and size adjust functions.
You can show your original gantt chart.

## Demo
To be prepared.
Coming soon...

## Usage
To be prepared.
Coming soon...

## Install

To be prepared.
Coming soon...

## Licence

[MIT](https://github.com/PKPK-Carnage/OTGanttChartKit/blob/master/LICENSE)

## Author

[PKPK-Carnage](https://github.com/PKPK-Carnage)

repository: carabina/OTGanttChartKit

repo_name: carabina/OTGanttChartKit


text:
# Cylindrical color spaces

Many of the color spaces also have their cylindrical equivalents (sometimes also called "polar" equivalents). A cylindrical color space usually consists of three channels:

- Lightness channel, often denoted as "L"
- Chroma (also chrominance or colourfulness) channel, often denoted as "C"
- Hue channel, often denoted as "h"

The lightness and chroma channels have different ranges depending on the color space (some use 0 to 100, some use 0 to 1, etc.)

The hue channel is specified in degrees, and has values from 0° to 360°.

## Color spaces with cylindrical equivalents

These are some of the color spaces that are built-in and have cylindrical equivalent:

- [Lab and corresponding LCHab](spaces-lab.md)
- [Luv and corresponding LCHuv](spaces-luv.md)
- [Jzazbz and corresponding JzCzhz](spaces-jzazbz.md)

## Helper formulas

If you want to experiment with cylindrical representations, you can explore the formulas available on the `CylindricalFormulas` static helper class.

It provides methods like:

- `GetSaturation` that computes saturation from chroma and lightness.
- `GetChroma` that computes chroma from saturation and lightness.
- `ConvertToLCh` that can convert a vector with lightness and two color channels into lightness, chroma, hue vector.
- `ConvertFromLCh` that can convert a vector with lightness, chroma, and hue into and a vector with lightness and two color channels.

## Related links

- https://en.wikipedia.org/wiki/Chrominance
- https://en.wikipedia.org/wiki/Lightness
- https://en.wikipedia.org/wiki/Luma_(video)
- https://en.wikipedia.org/wiki/List_of_color_spaces_and_their_uses#Cylindrical_transformations

repository: tompazourek/Colourful

gha_language: C#

repo_name: tompazourek/Colourful


text:
## Strange Forest Libraries

[![Build Status](https://travis-ci.org/mcekovic/sf-libs.svg?branch=master)](https://travis-ci.org/mcekovic/sf-libs)
[![Download](https://img.shields.io/bintray/v/mcekovic/artifacts/sf-libs.svg)](https://bintray.com/mcekovic/artifacts/sf-libs/_latestVersion)
[![Dependencies](https://img.shields.io/versioneye/d/user/projects/5798cba574848d00341d9c9a.svg?maxAge=604800)](https://www.versioneye.com/user/projects/5798cba574848d00341d9c9a)

Strange Forrest Libraries is set of small useful Java libraries:
* SF Utils - Set of utilities for caching, concurrency, pooling, XML DOM decorator...
* SF DB - Connection pool, transactions, database gateway with declarative API and SQL templates.
* SF Aspects - Transactions, exception handling, tracing and retries aspects.
* SF ORM - Lightweight ORM library with support for domain remoting.

repository: mcekovic/sf-libs

gha_language: Java

repo_name: mcekovic/sf-libs


text:
# Hyperbolic Deep Neural Networks: A Survey

```
@article{hdnn_corr21,
author    = {Wei Peng and Tuomas Varanka and Abdelrahman Mostafa and Henglin Shi and Guoying Zhao},
title     = {Hyperbolic Deep Neural Networks: A Survey},
journal   = {Computing Research Repository (CoRR)},
volume    = {abs/2101.04562},
year      = {2021}
}
```

links
- [arXiv](https://arxiv.org/abs/2101.04562)

gha_language: Jupyter Notebook


text:
# Build for deployment

## Overview

> **Note:**
>
> The easiest way to deploy TiDB is to use the official binary package directly, see [Binary Deployment](../op-guide/binary-deployment.md).**

If you want to build the TiDB project, deploy the binaries to other machines and run them, you can follow this guide.

Check the [supported platforms](./requirements.md#supported-platforms) and [prerequisites](./requirements.md#prerequisites) first.

## Building and installing TiDB components

You can use the [build script](../scripts/build.sh) to build and install TiDB components in the `bin` directory.

You can use the [update script](../scripts/update.sh) to update all the TiDB components to the latest version.

repository: oraluben/docs

repo_name: oraluben/docs


text:
---
layout: page
title: About
permalink: /about/
---

I love that moment when it makes sense; that is, when the analysis
uncovers patterns and relationships from amongst the noise and piles
of data files. As a data scientist that worked in marine physics and
astrophysics, I have amassed substantial experience in wrangling,
analyzing, visualizing, and interpreting data. How can I help your
organization bring meaning to your data to solve business challenges?

I've been analyzing astrophysical and oceanographic data for 20 years,
and I am training at BrainStation to work as a data scientist. A
science background is good but it doesn't get you far without knowing
the modern data stack!

In my most recent job at RBR Ltd, an ambitious oceanographic
instrumentation company, I transitioned from a siloed university
researcher to a more collaborative task-oriented worker. I learned how
to adapt to short lead times, to rapid project scope changes, and to
balancing multiple projects. I mastered Matlab, and was a daily user
of Atlassian’s productivity software (Bitbucket, Jira and
Confluence). I was the “Team Lead” of a small group of scientists
within the R&D department, and I was responsible for aligning our
projects with the company’s strategic objectives. My projects required
close collaboration with divisions outside of R&D: I collaborated with
engineering, sales and marketing, software, and service.

### More Information

Oh, and cycling.

### Contact me

[Email<EMAIL_ADDRESS>


text:
# Flappy Bird (using Pygame)

We started with an interactive implementation of the game, removed the player controls, then built an AI "player" that learned how to play over time.  Mine actually got pretty good by the end.

## Choices Made

I chose to represent a state as the combination of the height of the pipe gap, the Y-height of the bird and the X-distance to the pipe.  In order to make my algorithm more efficient and limit the possible number of states, I made sure to use integers instead of floating-point decimals for these representations, since we don't want that kind of precision.  An additional change that I made was to evaluate the state on every 20 game ticks, which further limits the number of states and allows feedback about bad states (with a large negative reward) to propagate backward much more quickly.  The further I limited the possible number of states, the faster the bird learned.

## Training Time

Without varying the height of the pipes, the bird could be trained in around 40 games played, allowing it to get through over a hundred sets of pipes fairly quickly.  To make it more efficient, I would play with limiting the X-distance to the pipe in order to further limit the number of possible states.

## How to train the bird

N/A (I didn't have time to implement this part).  However, the game is sped up to play 5X the normal rate, so it does learn to play very quickly.

## Resources Used

- I discussed the project with some friends in a chat room for the class.  The only real help that I gained from here was advice on how to speed up the rate as which the bird plays the game.

repository: alexlafroscia/class-projects

repo_name: alexlafroscia/class-projects


text:
---
title: "Se7en (1995) Tamil Dubbed HD"
date: "2020-08-28"
---

## Se7en (1995) | Dubhoodtamil

![](https://1.bp.blogspot.com/-__P-vEH7SH0/X0i_3aM0rXI/AAAAAAAACNs/Liph0UptVuAZze5DBpl7ifluNNcf2okkwCNcBGAsYHQ/w326-h512/MV5BOTUwODM5MTctZjczMi00OTk4LTg3NWUtNmVhMTAzNTNjYjcyXkEyXkFqcGdeQXVyNjU0OTQ0OTY{7c91919003b18fbfe18f8d0a8715b92cf9e57c9a8b9d318e5deae4019927ce00}2540._V1_.jpg)

Movie : Se7en (1995)

Director : David Fincher

Starring : Morgan Freeman, Andrew Kevin Walker, Brad Pitt

Genres : Crime, Drama, Mystery

Quality : BDRip

Language: Tamil

Rating : 8.6/10

Synopsis: Two detectives, a rookie and a veteran, hunt a serial killer who uses the seven deadly sins as his motives.

## **Click Below To Download Movie**

**[Download 330MB](https://oncehelp.com/seven-1)**

**[Download 460MB](https://oncehelp.com/seven-2)**

By Dubhoodtamil


text:
# Bootstrap4 XXL (and XXXL)

XXL (media min width 1900px) and XXXL (media min width 3000px) grid definition for Bootstrap.

For XXXL (larger than 3000px media, it defines also semi-column classes : col-xxxl-1-5, col-xxxl-2-5 ... col-xxxl-11-5.

## Getting Started

Clone in your path and include css file.

Use col-xxl-1, p-xxl-2 ... as you need.

### Prerequisites

Boostrap 4

## Deployment

Clone in your path and include css file.

[comment]: <> (## Versioning)
[comment]: <> (We use SemVer-http://semver.org/ for versioning. For the versions available, see the tags on this repository-https://github.com/your/project/tags.)

## Authors

See the list of [contributors](https://github.com/hugocvx/bootstrap.xxl/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* Boostrap authors


text:
![License](https://img.shields.io/badge/license-MIT-blue)
# Workout Tracker (wrktTrckr)
## Description
This is a workout tracker application. You can create new workouts, whether cardio or resistance based, and mark as completed when finished with created workout.
## Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [License](#license)
* [Contributing](#contributing)
* [Tests](#tests)
* [Contact](#contact)
## Installation
To install necessary dependencies, run the following command:
```
npm install (i) should be run to install the needed dependancies of express, mongoose, and morgan
```
## Usage

## License
This project is licensed under the terms of the MIT license.
## Contributing
If you have any questions or care to contribute to this repository, please contact me at the following:
```
Run "npm start" to initialize the program.
```
## Contact
You may contact me at<EMAIL_ADDRESS>if you have questions or contributions. You can fork my work at [khannadk](https://github.com/khannadk).

repository: khannadk/wooorkout

repo_name: khannadk/wooorkout


text:
---
title: "View Spec"
url: view-spec
toc: true
disableSidebar: true
---
<!--
 - Licensed to the Apache Software Foundation (ASF) under one or more
 - contributor license agreements.  See the NOTICE file distributed with
 - this work for additional information regarding copyright ownership.
 - The ASF licenses this file to You under the Apache License, Version 2.0
 - (the "License"); you may not use this file except in compliance with
 - the License.  You may obtain a copy of the License at
 -
 -   http://www.apache.org/licenses/LICENSE-2.0
 -
 - Unless required by applicable law or agreed to in writing, software
 - distributed under the License is distributed on an "AS IS" BASIS,
 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 - See the License for the specific language governing permissions and
 - limitations under the License.
 -->

# Iceberg View Spec

## Background and Motivation

Most compute engines (e.g. Trino and Apache Spark) support views. A view is a logical table that can be referenced by future queries. Views do not contain any data. Instead, the query stored by the view is executed every time the view is referenced by another query.

Each compute engine stores the metadata of the view in its proprietary format in the metastore of choice. Thus, views created from one engine can not be read or altered easily from another engine even when engines share the metastore as well as the storage system. This document standardizes the view metadata for ease of sharing the views across engines.

## Goals

* A common metadata format for view metadata, similar to how Iceberg supports a common table format for tables.
* The view metadata format specification
  * Includes storage format as well as APIs to write/read the metadata.
  * Supports versioning of views to track how a view evolved over time.

## Overview

View metadata storage mirrors how Iceberg table metadata is stored and retrieved. View metadata is maintained in metadata files. All changes to view state create a new view metadata file and completely replace the old metadata using an atomic swap. Like Iceberg tables, this atomic swap is delegated to the metastore that tracks tables and/or views by name. The view metadata file tracks the view schema, custom properties, current and past versions, as well as other metadata.
Each metadata file is self-sufficient. It contains the history of the last few operations performed on the view and can be used to roll back the view to a previous version.

### Metadata Location

An atomic swap of one view metadata file for another provides the basis for making atomic changes. Readers use the version of the view that was current when they loaded the view metadata and are not affected by changes until they refresh and pick up a new metadata location.

Writers create view metadata files optimistically, assuming that the current metadata location will not be changed before the writer’s commit. Once a writer has created an update, it commits by swapping the view's metadata file pointer from the base location to the new location.

## Specification

### Terms

* **Schema** -- Names and types of fields in a view.
* **Version** -- The state of a view at some point in time.

### View Metadata

The view version metadata file has the following fields:

| Required/Optional | Field Name | Description |
|-------------------|------------|-------------|
| Required | format-version | An integer version number for the view format. Currently, this must be 1. Implementations must throw an exception if the view's version is higher than the supported version. |
| Required | location | The view's base location. This is used to determine where to store manifest files and view metadata files. |
| Required | current-version-id | Current version of the view. Set to ‘1’ when the view is first created. |
| Optional | properties | A string to string map of view properties. This is used for metadata such as "comment" and for settings that affect view maintenance. This is not intended to be used for arbitrary metadata. |
| Required | versions | An array of structs describing the last known versions of the view. Controlled by the table property: “version.history.num-entries”. See section [Versions](#versions). |
| Required | version-log | A list of timestamp and version ID pairs that encodes changes to the current version for the view. Each time the current-version-id is changed, a new entry should be added with the last-updated-ms and the new current-version-id. |
| Optional | schemas | A list of schemas, the same as the ‘schemas’ field from Iceberg table spec. |
| Optional | current-schema-id | ID of the current schema of the view |

#### Versions

Field "versions" is an array of structs with the following fields:

| Required/Optional | Field Name | Description |
|-------------------|------------|-------------|
| Required | version-id | Monotonically increasing id indicating the version of the view. Starts with 1. |
| Required | timestamp-ms | Timestamp expressed in ms since epoch at which the version of the view was created. |
| Required | summary | A string map summarizes the version changes, including `operation`, described in [Summary](#summary). |
| Required | representations | A list of "representations" as described in [Representations](#representations). |

#### Version Log

Field “version-log” is an array of structs that describe when each version was considered "current". Creation time is different and is stored in each version's metadata. This allows you to reconstruct what someone would have seen at some point in time. If the view has been updated and rolled back, this will show it. The struct has the following fields:

| Required/Optional | Field Name | Description |
|-------------------|------------|-------------|
| Required | timestamp-ms | The timestamp when the referenced version was made the current version |
| Required | version-id | Version id of the view  |

#### Summary

Field “summary” is a string map with the following keys. Only `operation` is required. Engines may store additional key-value pairs in this map.

| Required/Optional | Key | Value |
|-------------------|-----|-------|
| Required | operation | A string value indicating the view operation that caused this metadata to be created. Allowed values are “create” and “replace”. |
| Optional | engine-version | A string value indicating the version of the engine that performed the operation |

#### Representations

Each representation is stored as an object with only one common field "type".
The rest of the fields are interpreted based on the type.
There is only one type of representation defined in the spec.

##### Original View Definition in SQL

This type of representation stores the original view definition in SQL and its SQL dialect.

| Required/Optional | Field Name | Description |
|-------------------|------------|-------------|
| Required | type | A string indicating the type of representation. It is set to "sql" for this type. |
| Required | sql | A string representing the original view definition in SQL |
| Required | dialect | A string specifying the dialect of the ‘sql’ field. It can be used by the engines to detect the SQL dialect. |
| Optional | schema-id | ID of the view's schema when the version was created |
| Optional | default-catalog | A string specifying the catalog to use when the table or view references in the view definition do not contain an explicit catalog. |
| Optional | default-namespace | The namespace to use when the table or view references in the view definition do not contain an explicit namespace. Since the namespace may contain multiple parts, it is serialized as a list of strings. |
| Optional | field-aliases | A list of strings of field aliases optionally specified in the create view statement. The list should have the same length as the schema's top level fields. See the example below. |
| Optional | field-docs | A list of strings of field comments optionally specified in the create view statement. The list should have the same length as the schema's top level fields. See the example below. |

For `CREATE VIEW v (alias_name COMMENT 'docs', alias_name2, ...) AS SELECT col1, col2, ...`,
the field aliases are 'alias_name', 'alias_name2', and etc., and the field docs are 'docs', null, and etc.

## Appendix A: An Example

The JSON metadata file format is described using an example below.

Imagine the following sequence of operations:

* `CREATE TABLE base_tab(c1 int, c2 varchar);`
* `INSERT INTO base_tab VALUES (1,’one’), (2,’two’);`
* `CREATE VIEW common_view AS SELECT * FROM base_tab;`
* `CREATE OR REPLACE VIEW common_view AS SELECT count(*) AS my_cnt FROM base_tab;`

The metadata JSON file created at the end of step 3 looks as follows. The file path looks like:
`s3://my_company/my/warehouse/anorwood.db/common_view`

The path is intentionally similar to the path for iceberg tables and contains a ‘metadata’ directory. (`METASTORE_WAREHOUSE_DIR/<dbname>.db/<viewname>/metadata`)

The metadata directory contains View Version Metadata files. The text after '=>' symbols describes the fields.
```
{
  "format-version" : 1, => JSON format. Will change as format evolves.
  "location" : "s3n://my_company/my/warehouse/anorwood.db/common_view",
  "current-version-id" : 1, => current / latest version of the view. ‘1’ here since this metadata was created when the view was created.
  "properties" : {  => shows properties of the view
    "comment" : "View captures all the data from the table" => View comment
  },
  "versions" : [ { => Last few versions of the view.
    "version-id" : 1,
    "parent-version-id" : -1,
    "timestamp-ms" :<PHONE_NUMBER>292,
    "summary" : {
      "operation" : "create", => View operation that caused this metadata to be created
      "engineVersion" : "presto-350", => Version of the engine that performed the operation (create / replace)
    },
    "representations" : [ { => SQL metadata of the view
      "type" : "sql",
      "sql" : "SELECT *\nFROM\n  base_tab\n", => original view SQL
      "dialect" : "presto",
      "schema-id" : 1,
      "default-catalog" : "iceberg",
      "default-namespace" : [ "anorwood" ]
    } ],
  } ],
  "version-log" : [ { => Log of the created versions
    "timestamp-ms" :<PHONE_NUMBER>292,
    "version-id" : 1
  } ],
  "schemas": [ { => Schema of the view expressed in Iceberg types
    "schema-id": 1,
    "type" : "struct",
    "fields" : [ {
      "id" : 0,
      "name" : "c1",
      "required" : false,
      "type" : "int",
      "doc" : "" => Column comment
    }, {
      "id" : 1,
      "name" : "c2",
      "required" : false,
      "type" : "string",
      "doc" : ""
    } ]
  } ],
  "current-schema-id": 1
}
```

The Iceberg / view library creates a new metadata JSON file every time the view undergoes a DDL change. This way the history of how the view evolved can be maintained. Following metadata JSON file was created at the end of Step 4.

```
{
  "format-version" : 1,
  "location" : "s3n://my_company/my/warehouse/anorwood.db/common_view",
  "current-version-id" : 2,
  "properties" : {  => shows properties of the view
    "comment" : "View captures count of the data from the table"
  },
  "versions" : [ {
    "version-id" : 1,
    "parent-version-id" : -1,
    "timestamp-ms" :<PHONE_NUMBER>292,
    "summary" : {
      "operation" : "create",
      "engineVersion" : "presto-350",
    },
    "representations" : [ {
      "type" : "sql",
      "sql" : "SELECT *\nFROM\n  base_tab\n",
      "dialect" : "presto",
      "schema-id" : 1,
      "default-catalog" : "iceberg",
      "default-namespace" : [ "anorwood" ]
    } ],
    "properties" : { }
  }, {
    "version-id" : 2,
    "parent-version-id" : 1, => Version 2 was created on top of version 1, making parent-version-id 1
    "timestamp-ms" :<PHONE_NUMBER>265,
    "summary" : {
      "operation" : "replace", => The ‘replace’ operation caused this latest version creation
      "engineVersion" : "spark-2.4.4",
    },
    "representations" : [ {
      "type" : "sql",
      "sql" : "SELECT \"count\"(*) my_cnt\nFROM\n  base_tab\n", => Note the updated text from the ‘replace’ view statement
      "dialect" : "spark",
      "schema-id" : 2,
      "default-catalog" : "iceberg",
      "default-namespace" : [ "anorwood" ]
    },
  } ],
  "version-log" : [ {
    "timestamp-ms" :<PHONE_NUMBER>292,
    "version-id" : 1
  }, {
    "timestamp-ms" :<PHONE_NUMBER>265,
    "version-id" : 2
  } ],
  "schemas": [ { => Schema of the view expressed in Iceberg types
    "schema-id": 1,
    "type" : "struct",
    "fields" : [ {
      "id" : 0,
      "name" : "c1",
      "required" : false,
      "type" : "int",
      "doc" : "" => Column comment
    }, {
      "id" : 1,
      "name" : "c2",
      "required" : false,
      "type" : "string",
      "doc" : ""
    } ]
  }, { => Schema change is reflected here
    "schema-id": 2,
    "type" : "struct",
    "fields" : [ {
      "id" : 0,
      "name" : "my_cnt",
      "required" : false,
      "type" : "long",
      "doc" : ""
    } ]
  } ],
  "current-schema-id": 2
}
```

repository: rdblue/iceberg

repo_name: rdblue/iceberg


text:
---
layout: default
---

# 1995-10-20 - Re: 50 attacks on Netscape - please send the check

## Header Data

From: Ray Cromwell<EMAIL_ADDRESS>To<EMAIL_ADDRESS>(Chip Morningstar)

Message Hash: 8ad98a720779781b7f3094da191fd96464dbbdac323d6d08964dd99c4e42198e

Message ID<EMAIL_ADDRESS>Reply To: \<9510190047.AA14597@ communities.com\>

UTC Datetime: 1995-10-20 19:19:49 UTC

Raw Date: Fri, 20 Oct 95 12:19:49 PDT

## Raw message

```
{% raw  %}From: Ray Cromwell<EMAIL_ADDRESS>Date: Fri, 20 Oct 95 12:19:49 PDT
To<EMAIL_ADDRESS>(Chip Morningstar)
Subject: Re: 50 attacks on Netscape - please send the check
In-Reply-To: <9510190047.AA14597@ communities.com>
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

>
><EMAIL_ADDRESS>(Dr. Frederick B. Cohen) writes:
> >50 Attacks: a.k.a. Why Not to Run Hot Java in your netscape (or other) browser:
> > ... (drivel elided)
>
> This fellow seems to be systematically (if not deliberately) ignorant
> about these things.

  I'm frequently seeing this same behavior by lots of people on
this list and it's sad. There are people making claims about
HotJava/Java that are obviously bogus if you even read the white paper,
looked at the source code, or programmed a "Hello World" applet.
The Java papers are an easy read.   If you want to know about the
implementation, read the source. At least criticize specifics about
the implementation rather than speculating what they are and then
proceeding to claim to have found a security hole in the implementation.
I'm even more surprised when I see someone with a Phd acting like
this.

-Ray

{% endraw %}
```

## Thread

+ Return to [October 1995](/archive/1995/10)

+ Return to<EMAIL_ADDRESS>(Chip Morningstar)](/authors/chip_at_communities_com_chip_morningstar_)"
+ Return to "[Ray Cromwell <rjc@clark.net>](/authors/ray_cromwell_rjc_at_clark_net_)"
+ Return to "[Simon Spero <ses@tipper.oit.unc.edu>](/authors/simon_spero_ses_at_tipper_oit_unc_edu_)"

+ 1995-10-19 (Wed, 18 Oct 95 17:42:29 PDT) - [Re:  50 attacks on Netscape - please send the check](/archive/1995/10/afbc41b78cad151de289568d063c76e37f2eafa28089f34fb70de3a3cda57ed3) -<EMAIL_ADDRESS>(Chip Morningstar)_
  + 1995-10-20 (Fri, 20 Oct 95 12:19:49 PDT) - Re: 50 attacks on Netscape - please send the check - _Ray Cromwell<EMAIL_ADDRESS>    + 1995-10-21 (Fri, 20 Oct 95 21:56:18 PDT) - [Java good for security? (was: 50 ways...)](/archive/1995/10/20d5438fe2db8aaa9080c4a8a42215d68c36099461b77cb59a0d724aaf3952e2) - _Simon Spero<EMAIL_ADDRESS>


text:
---
layout: post
title: Server Upgrade Notification
author:
lang: en
data: 2018-08-08
post_id: 49
id: 49
ref: ad
time:
---

Dear Bitpie users:

Due to the recent surge in the number of users, the visits to some regions have been slow. In order to bring you a more convenient and comfortable experience, we need to upgrade the server hardware. You will not be able to send, receive, and trade during updating from 13:00 to 14:00 (UTC+8).

Please wait patiently，thank you for your understanding and support.

Bitpie team<br/>
August 08, 2018


text:
---
layout: post
title: "Fixed Points Of Random Permutations"
description: ""
category:
tags: []
---
{% include JB/setup %}
A *permutation* $$\sigma$$ of $$[1, n]$$ is a bijective function from $$[1, n]$$ to $$[1, n]$$. There are $$n!$$ different permutations of $$[1, n]$$, a random permutation is a random variable that can take as value any permutation with probability $$1/n!$$.

$$i$$ is a *fixed point* for permutation $$\sigma$$ if $$\sigma(i) = i$$. Three interesting questions concerning fixed points of a random permutation are:

1. What is the expected number of fixed points for a random permutation of $$[1, n]$$ ?
2. What is the probability for a random permutation of $$[1, n]$$ not to have any fixed point ?
3. What is the probability for a random permutation of $$[1, n]$$ to have $$k$$ fixed points ?

In the following let $$f(\sigma)$$ be the number of fixed point of $$\sigma$$ and let $$\sigma$$ be a random permutation.

### Expected Number of Fixed Points

Let us start with the definition of $$f$$. Linearity of the expected value makes solving this problem easy.

$$\mathbb E\left[f(\sigma)\right] = \mathbb E\left[\sum_{i=1}^n \mathbb 1_{\sigma(i) = i}\right] = \sum_{i=1}^n \mathbb E\left[1_{\sigma(i)=i}\right]$$

For each i, the probability for i to be a fixed point of $$\sigma$$ is the probability for $$\sigma(i)$$ to be equal to $$i$$ hence is equal to $$1/n$$.
Using this we obtain $$\mathbb E\left[f(\sigma)\right] = 1$$.

### Probability to Have No Fixed Point

A permutation with no fixed point is called a *derangement*. Let $$D_n$$ be the number of such derangements of $$[1, n]$$.

Consider a derangement $$\sigma$$ of $$[1, n]$$ with n greater than or equal to 2. There are $$n-1$$ possible choices for $$\sigma(1)$$. Then there are two distinct cases to consider:

- If $$\sigma(\sigma(1)) = 1$$ then $$\sigma$$ is a derangement over the set $$[1, n]$$ where both $$1$$ and $$\sigma(1)$$ has been removed. There are $$D_{n-2}$$ such derangements.
- If $$\sigma(\sigma(1)) \neq 1$$ then consider the function $$\sigma'$$ of $$[2, n]$$ such that $$\sigma'(k) = \sigma(k)$$ if $$\sigma(k) \neq 1$$ and $$\sigma'(k) = \sigma(1)$$ otherwise. Then $$\sigma'$$ is a permutation of $$[2, n]$$ and is a derangement, there are $$D_{n-1}$$ such derangements.

This gives us that $$D_n = (n-1)(D_{n-2} + D_{n-1})$$. It is worth noting that this recurrence relation is also satisfied by the factorial function, however $$1! = 1$$ whereas $$D_1 = 0$$. We can recombine this second-order recurrence relation in order to obtain a first-order recurrence relation as follows:

$$D_n - nD_{n-1} = (n-1)D_{n-2} - D_{n-1} = ... = (-1)^n (D_2 - D_1) = (-1)^n(1 - 0)$$

Hence we have that $$D_n = nD_{n-1} + (-1)^n$$. By dividing both side of the equations by $$n!$$ we obtain:

$$\frac{D_n}{n!} = \frac{D_{n-1}}{(n-1)!} + \frac{(-1)^n}{n!} = \sum_{k=0}^n \frac{(-1)^k}{k!}$$

The probability for a random permutation to be a derangement is $$D_n/n! = \sum_{k=0}^n (-1)^k/k!$$. When $$n$$ goes to infinity, this probability goes to $$1/e$$.

### Probability to Have k Fixed Points

This can be deduced from the probability for a permutation not to have fixed points. The number of permutations with k fixed points can be obtained by choosing these k points among n and noticing that the permutation is a derangement over the $$n-k$$ other points. Hence this number is $${n \choose k} D_{n-k}$$

The probability is then:

$$\mathbb P\left[ f(\sigma) = k \right] = \frac{ {n \choose k} (n-k)!\sum_{i=0}^{n-k} (-1)^i/i!}{n!} = \frac{\sum_{i=0}^{n-k} (-1)^i/i!}{k!}$$


text:
# Demo

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Description
a markdown command line interface for creating README files

## Table of Contents

  * [Description](#description)
  * [Installation](#installation)
  * [Usage](#usage)
  * [License](#license)
  * [Contributing](#contributing)
  * [Tests](#tests)
  * [Questions](#questions)

## Installation Intructions
node and inquirer

## Usage Information
npm i node and inquirer

## License
    This project has been created under the MIT license.

## Contribution Guidelines
make a pull request to contribute

## Test Instructions
no tests at this time

## GitHub Username
amo02008

## Questions
Please email me with any questions at adrienne.osorio@gmail.com


text:
# What is `dlist`?

dlist is a `pandas`-like API for working with lists of dictionaries.

```python
from dlist import dlist

# initialize from a list of dicts
dl = dlist([ { 'a': 1 }, { 'a': 2, 'b': 'cat' } ])

# positional indexing is list-like
dl[0] # {'a': 1}
dl[:2] # { 'a': 1 }, { 'a': 2, 'b': 'cat' }

# access keys as attributes or string keys
dl.a # [ 1, 2 ]
dl('a') # ditto

# make masks via all the normal operators
dl('b') == 'cat' # [ False, True ]

# caseless comparison, since that's nice
dl('b').caseless_eq('CAT') # [ False, True ]
dl('b').isin([ 1, 'CAT'], case=False) # [ False, True ]

# access things that don't exist (possibly a bad idea, but fun)
dl.c # [ None, None ]

# mildly fancy indexing
dl[dl.a >= 2] # dlist([ { 'a': 2, 'b': 'cat' } ])

# assignment from a properly-sized sequence
dl.c = [ True, set([1,2]) ] # dlist([ { 'a': 1, 'c': True }, { 'a': 2, 'b': 'cat', 'c': {1, 2} } ])

# assignment from a non-sequence
dl.d = 4 # dlist([ { 'a': 1, 'c': True, 'd': 4 }, { 'a': 2, 'b': 'cat', 'c': {1, 2}, 'd': 4 } ])

# create a new attribute
dl.e = [ '1', 2 ] # dlist([{ ..., 'e': '1' }, { ..., 'e': 2 } ])

# extend
dl += [ { 'f': 5 } ] # dlist([ {...}, {...}, { 'f': 5 } ]

# subtract using masks
dl -= (dl.a >= 2)
```

## Why didn't you just use `pandas`?

`pandas` wants to aggressively type everything.  I like the flexibility of dictionaries.  I suppose I could `dtype=object` and get most of this, but that felt icky.

## Why didn't you just use `<mongo/sqlite/tinydb/some-other-thing>`?

Sure, something like this probably already exists.  Also, maybe it's not even a good idea.  But it was fun to make.

repository: dyf/dlist

repo_name: dyf/dlist


text:
@name(appraise)
@author(Ryan Sandor Richards)

# Command: appraise
Usage: `appraise [item-name]`

The appraise command allows players to find out how much a shop will pay to
buy an item in their character's inventory. Shops generally buy at much lower
than market rate, so cavet empor!

See also: `help shop`, `help sell`


text:
---
title: 'How to collect DNS requests log on AdGuard Pro?'
taxonomy:
    category:
        - docs
---

Sometimes we need to troubleshoot something that we can't reproduce on our side. In that case we usually need a log - and this article tells how to obtain a DNS requests log on AdGuard Pro for iOS.

So, if you need to collect DNS requests log, do the following:

1. Open AdGuard main screen, choose 'AdGuard DNS' item and tap on it.

2. Make sure AdGuard DNS is enabled.

3. Enable DNS requests log.

4. Reproduce the problem. NOTE: notice the time when the problem was reproduced.

5. Go back to AdGuard DNS settings and disable the DNS requests log.

6. Go back to the main AdGuard screen and tap on 'Send Bug Report'.

7. In the message body mention the exact time when the problem was reproduced.

8. That's it, now we will receive the log and, hopefully, fix the problem soon.

repository: TheHasagi/AdguardKnowledgeBase

gha_language: CSS

repo_name: TheHasagi/AdguardKnowledgeBase