text:
---
speaker: Anirban Basak (Weizmann Institute of Science, Israel)
title: "Invertibility and condition number of sparse random matrices"
date: October 5, 2017
time: 4 pm
venue: LH-1, Mathematics Department
series: "APRG Seminar"
website: https://math.iisc.ac.in/~aprg/index.php?id=seminar17-18
---
I will describe our work that establishes (akin to) von Neumann's
conjecture on condition number, the ratio of the largest and the
smallest singular values, for sparse random matrices. Non-asymptotic
bounds on the extreme singular values of large matrices have numerous
uses in the geometric functional analysis, compressed sensing, and
numerical linear algebra. The condition number often serves as a
measure of stability for matrix algorithms. Based on simulations
von Neumann and his collaborators conjectured that the condition
number of a random square matrix of dimension $n$ is $O(n)$. During
the last decade, this conjecture was proved for dense random matrices.

Sparse matrices are abundant in statistics, neural networks, financial
modeling, electrical engineering, and wireless communications. Results
for sparse random matrices have been unknown and requires completely
new ideas due to the presence of a large number of zeros. We consider
a sparse random matrix with entries of the form $\xi\_{i,j} \delta\_{i,j},
\, i,j=1,\ldots,n$, such that $\xi\_{i,j}$ are i.i.d. with zero mean and
unit variance and $\delta\_{i,j}$ are i.i.d. Ber$(p_n)$, where $p_n
\downarrow 0$ as $n \to \infty$. For $p_n < \frac{\log n}{n}$, this
matrix becomes non-invertible, and hence its condition number equals
infinity, with probability tending to one. In this talk, I will describe
our work showing that the condition number of such sparse matrices (under
certain assumptions on the moments of $\\{\xi\_{i,j}\\}$) is
$O(n^{1+o(1)})$ for all $p_n > \frac{\log n}{n}$, with probability
tending to one, thereby establishing the optimal analogous version of
the von Neumann's conjecture on condition number for sparse random
matrices.

This talk is based on a sequence of joint works with Mark Rudelson.

repository: siddhartha-gadgil/DeptWeb

repo_name: siddhartha-gadgil/DeptWeb


text:
# RxWrapper

[![Core](https://api.bintray.com/packages/quanturium/maven/rxwrapper/images/download.svg) ](https://bintray.com/quanturium/maven/rxwrapper/_latestVersion)
[![Build Status](https://travis-ci.org/quanturium/RxWrapper.svg?branch=master)](https://travis-ci.org/quanturium/RxWrapper)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/quanturium/RxWrapper/blob/master/LICENSE.txt)

This library allows you to pass an object from onSubscribe to onEvent() / onDispose() without interfering with your Single/Maybe/Completable stream.

This can be really useful if you have a reactive database and want to bundle calls within a SQLite transaction:

```java

Completable completable = Completable.concatArray(query1, query2, query3)
				.compose(new WrapperCompletableTransformer<>(new WrapperCompletableCallback<TransactionWrapper>() {
					@Override
					public Integer onSubscribe() {
						TransactionWrapper tw = new TransactionWrapper(db);
						tw.start();
						return tw;
					}

					@Override
					public void onEvent(String s, Throwable e, TransactionWrapper tw) {
						if(e == null)
							tw.markSuccessful();
						tw.end();
					}

					@Override
					public void onDispose(TransactionWrapper tw) {
						tw.end();
					}
				}));

public static class TransactionWrapper extends AtomicReference<BriteDatabase.Transaction> {

		private final BriteDatabase database;

		public TransactionWrapper(BriteDatabase database) {
			this.database = database;
		}

		public void start() {
			set(database.newTransaction());
			Timber.i("Transaction started %s", get().toString());
		}

		public void markSuccessful() {
			get().markSuccessful();
			Timber.i("Transaction successful %s", get().toString());
			end();
		}

		public void end() {
			BriteDatabase.Transaction transaction = getAndSet(null);
			if (transaction != null) {
				transaction.end();
				Timber.i("Transaction end %s", transaction.toString());
			}
		}
	}
```

## License
    Copyright (c) 2018 Arnaud Frugier

    Licensed 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.

repository: quanturium/RxWrapper

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: quanturium/RxWrapper


text:
# mazebattles.com

Built a site using Node.js and Socket.io where users race against each other to solve mazes generated using's Prim's Minimum Spanning Tree Algorithm. Uses the Breadth-First Search (BFS) Algorithm to solve mazes. Features a single player and one-on-one mode.

![Gameplay](/public/img/screenshot.png)

![Gameplay 2](/public/img/screenshot2.png)

![Gameplay 3](/public/img/screenshot3.png)

## Installation

Navigate your CLI to the project folder, and execute the following command

```bash
node server.js
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

license: MIT


text:
# socket-vue-chat

Simple Chat Using Socket.io and Vue JS NodeJS ExpressJs.

### ScreenShot

![Chat Screen](src/assets/screen.png)

### Installing

run these command in terminal.

For FrontEnd, Go to Root Directory

```
npm install
npm run serve

```
For Server, Go to Server directory

```
npm install
node server.js

```

## Author

* **Abijit Biswas** - [abijitb](https://github.com/abijitb)

## License

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

repository: abijitb/socket-vue-chat

repo_name: abijitb/socket-vue-chat


text:
[shark-graph](../../index.md) / [shark](../index.md) / [HprofHeapGraph](index.md) / [context](./context.md)

# context

`val context: `[`GraphContext`](../-graph-context/index.md)

Overrides [HeapGraph.context](../-heap-graph/context.md)

In memory store that can be used to store objects this [HeapGraph](../-heap-graph/index.md) instance.

repository: Pvredev/leakcanary

repo_name: Pvredev/leakcanary


text:
# Kubernetes Vendor Optimized Profiles

Vendor optimized profiles are approved in [Istio RFC: Kubernetes Vendor Optimized Profiles](https://docs.google.com/document/d/1N_yC9vi4Jt3auMLLSOkavQb6qgbJKr-Mp4kUL3GOmEc/edit#heading=h.xw1gqgyqs5b)

## Add your vendor optimized profile

If you wish to add a Kubernetes optimized profile, please join the Environments
WG meeting with your two lead maintainers for the profile. The working group
will provide further instructions. Additionally, please read the RFC requirements.

## Vendor optimized profiles

| K8s Platform         | Vendor        | Lead Maintainer | Lead Maintainer  |
| -------------------- | ------------- | --------------- | ---------------- |
| OpenShift            | Red Hat / IBM | @jwendell       | @irisdingbj      |
| Upstream Kubernetes  | Istio         | Env WG          | discuss.istio.io |

repository: phenixblue/istio

repo_name: phenixblue/istio


text:
# Welcome to pyBIS!

pyBIS is a Python module for interacting with openBIS. pyBIS is designed to be most useful in a [Jupyter Notebook](https://jupyter.org) or IPython environment, especially if you are developing Python scripts for automatisation. Jupyter Notebooks offer some sort of IDE for openBIS, supporting TAB completition and immediate data checks, making the life of a researcher hopefully easier.

## Dependencies and Requirements
- pyBIS relies the openBIS API v3
- openBIS version 16.05.2 or newer is required
- 19.06.5 or later is recommended
- pyBIS uses Python 3.6 or newer and the Pandas module

## Installation

```
pip install --upgrade pybis
```
That command will download install pyBIS and all its dependencies. If pyBIS is already installed, it will be upgraded to the latest version.

If you haven't done yet, install Jupyter and/or Jupyter Lab (the next Generation of Jupyter):
```
pip install jupyter
pip install jupyterlab
```

# General Usage

### TAB completition and other hints in Jupyter / IPython

* in a Jupyter Notebook  or IPython environment, pybis helps you to enter the commands
* After every dot `.` you might hit the `TAB` key in order to look at the available commands.
* if you are unsure what parameters to add to a , add a question mark right after the method and hit `SHIFT+ENTER`
* Jupyter will then look up the signature of the method and show some helpful docstring

### Checking input

* When working with properties of entities, they might use a **controlled vocabulary** or are of a specific **property type**.
* Add an underscore `_` character right after the property and hit `SHIFT+ENTER` to show the valid values
* When a property only acceps a controlled vocabulary, you will be shown the valid terms in a nicely formatted table
* if you try to assign an **invalid value** to a property, you'll receive an error immediately

### Glossary

* **spaces:** used for authorisation eg. to separate two working groups. If you have permissions in a space, you can see everything which in that space, but not necessarily in another space (unless you have the permission).
* **projects:** a space consists of many projects.
* **experiments / collections:** a projects contain many experiments. Experiments can have *properties*
* **samples / objects:** an experiment contains many samples. Samples can have *properties*
* **dataSet:** a dataSet which contains the actual *data files*, either pyhiscal (stored in openBIS dataStore) or linked
* **attributes:** every entity above contains a number of attributes. They are the same accross all instances of openBIS and independent of their type.
* **properties:** Additional specific key-value pairs, available for these entities:
   * experiments
   * samples
   * dataSets

  every single instance of an entity must be of a specific **entity type** (see below). The type defines the set of properties.
* **experiment type / collection type:** a type for experiments which specifies its properties
* **sample type / object type:** a type for samples / objects which specifies its properties
* **dataSet type:** a type for dataSets which specifies its properties
* **property type:** a single property, as defined in the entity types above. It can be of a classic data type (e.g. INTEGER, VARCHAR, BOOLEAN) or its values can be controlled (CONTROLLEDVOCABULARY).
* **plugin:** a script written in [Jython](https://www.jython.org) which allows to check property values in a even more detailed fashion

# connect to OpenBIS

## login

In an **interactive session** e.g. inside a Jupyter notebook, you can use `getpass` to enter your password safely:

```
from pybis import Openbis
o = Openbis('https://example.com')
o = Openbis('example.com')          # https:// is assumed

import getpass
password = getpass.getpass()

o.login('username', password, save_token=True)   # save the session token in ~/.pybis/example.com.token
```

In a **script** you would rather use two **environment variables** to provide username and password:

```
from pybis import Openbis
o = Openbis(os.environ['OPENBIS_HOST'])

o.login(os.environ['OPENBIS_USERNAME'], os.environ['OPENBIS_PASSWORD'])
```

### Verify certificate

By default, your SSL-Certification is being verified. If you have a test-instance with a self-signed certificate, you'll need to turn off this verification explicitly:

```python
from pybis import Openbis
o = Openbis('https://test-openbis-instance.com', verify_certificates=False)
```

### Check session token, logout()

Check whether your session, i.e. the **session token** is still valid and log out:

```python
print(f"Session is active: {o.is_session_active()} and token is {o.token}")
o.logout()
print(f"Session is active: {o.is_session_active()"}
```

### Caching

With `pyBIS 1.17.0`, a lot of caching has been introduced to improve the speed of object lookups that do not change often. If you encounter any problems, you can turn it off like this:

```python
o = Openbis('https://example.com', use_cache=False)

# or later in the script
o.use_cache = False
o.clear_cache()
o.clear_cache('sampleType')
```

## Mount openBIS dataStore server

### Prerequisites: FUSE / SSHFS

Mounting an openBIS dataStore server requires FUSE / SSHFS to be installed (requires root privileges). The mounting itself requires no root privileges.

**Mac OS X**

Follow the installation instructions on
https://osxfuse.github.io

**Unix Cent OS 7**

```
$ sudo yum install epel-release
$ sudo yum --enablerepo=epel -y install fuse-sshfs
$ user="$(whoami)"
$ usermod -a -G fuse "$user"
```
After the installation, an `sshfs` command should be available.

### Mount dataStore server with pyBIS

Because the mount/unmount procedure differs from platform to platform, pyBIS offers two simple methods:

```
o.mount()
o.mount(username, password, hostname, mountpoint, volname)
o.is_mounted()
o.unmount()
o.get_mountpoint()
```
Currently, mounting is supported for Linux and Mac OS X only.

All attributes, if not provided, are re-used by a previous login() command. If no mountpoint is provided, the default mounpoint will be `~/hostname`. If this directory does not exist, it will be created. The directory must be empty before mounting.

# Masterdata
OpenBIS stores quite a lot of meta-data along with your dataSets. The collection of data that describes this meta-data (i.e. meta-meta-data) is called masterdata. It consists of:

* sample types
* dataSet types
* material types
* experiment types
* property types
* vocabularies
* vocabulary terms
* plugins (jython scripts that allow complex data checks)
* tags
* semantic annotations

## browse masterdata

```
sample_types = o.get_sample_types()  # get a list of sample types
sample_types.df                      # DataFrame object
st = o.get_sample_types()[3]         # get 4th element of that list
st = o.get_sample_type('YEAST')
st.code
st.generatedCodePrefix
st.attrs.all()                       # get all attributes as a dict
st.get_validationPlugin()            # returns a plugin object

st.get_property_assignments()        # show the list of properties
                                     # for that sample type
o.get_material_types()
o.get_dataset_types()
o.get_experiment_types()
o.get_collection_types()

o.get_property_types()
pt = o.get_property_type('BARCODE_COMPLEXITY_CHECKER')
pt.attrs.all()

o.get_plugins()
pl = o.get_plugin('Diff_time')
pl.script  # the Jython script that processes this property

o.get_vocabularies()
o.get_vocabulary('BACTERIAL_ANTIBIOTIC_RESISTANCE')
o.get_terms(vocabulary='STORAGE')
o.get_tags()
```

## create property types

**Samples** (objects), **experiments** (collections) and **dataSets** contain type-specific **properties**. When you create a new sample, experiment or datasSet of a given type, the set of properties is well defined. Also, the values of these properties are being type-checked.

The first step in creating a new entity type is to create a so called **property type**:

```
pt = o.new_property_type(
    code        = 'MY_NEW_PROPERTY_TYPE',
    label       = 'yet another property type',
    description = 'my first property',
    dataType    = 'VARCHAR',
)

pt_int = o.new_property_type(
    code        = '$DEFAULT_OBJECT_TYPE',
    label       = 'default object type for ELN-LIMS',
    dataType    = 'VARCHAR',
    managedInternally = True,
)

pt_voc = o.new_property_type(
    code        = 'MY_CONTROLLED_VOCABULARY',
    label       = 'label me',
    description = 'give me a description',
    dataType    = 'CONTROLLEDVOCABULARY',
    vocabulary  = 'STORAGE',
)
```

The `dataType` attribute can contain any of these values:

* `INTEGER`
* `VARCHAR`
* `MULTILINE_VARCHAR`
* `REAL`
* `TIMESTAMP`
* `BOOLEAN`
* `HYPERLINK`
* `XML`
* `CONTROLLEDVOCABULARY`
* `MATERIAL`

When choosing `CONTROLLEDVOCABULARY`, you must specify a `vocabulary` attribute (see example). Likewise, when choosing `MATERIAL`, a `materialType` attribute must be provided. PropertyTypes that start with a \$ are by definition `managedInternally` and therefore this attribute must be set to True.

## create sample types / object types

The second step (after creating a property type, see above) is to create the **sample type**. The new name for **sample** is **object**. You can use both methods interchangeably:

* `new_sample_type()` == `new_object_type()`

```
sample_type = o.new_sample_type(
    code                = 'my_own_sample_type',  # mandatory
    generatedCodePrefix = 'S',                   # mandatory
    description         = '',
    autoGeneratedCode   = True,
    subcodeUnique       = False,
    listable            = True,
    showContainer       = False,
    showParents         = True,
    showParentMetadata  = False,
    validationPlugin    = 'Has_Parents'          # see plugins below
)
sample_type.save()
```

## assign and revoke properties to sample type / object type

The third step, after saving the sample type, is to **assign or revoke properties** to the newly created sample type. This assignment procedure applies to all entity types (dataset type, experiment type).

```
sample_type.assign_property(
	prop                 = 'diff_time',           # mandatory
	section              = '',
	ordinal              = 5,
	mandatory            = True,
	initialValueForExistingEntities = 'initial value'
	showInEditView       = True,
	showRawValueInForms  = True
)
sample_type.revoke_property('diff_time')
sample_type.get_property_assignments()
```

## create a dataset type

The second step (after creating a **property type**, see above) is to create the **dataset type**. The third step is to **assign or revoke the properties** to the newly created dataset type.

```
dataset_type = o.new_dataset_type(
    code                = 'my_dataset_type',       # mandatory
    description         = None,
    mainDataSetPattern  = None,
    mainDataSetPath     = None,
    disallowDeletion    = False,
    validationPlugin    = None,
)
dataset_type.save()
dataset_type.assign_property('property_name')
dataset_type.revoke_property('property_name')
dataset_type.get_property_assignments()
```

## create an experiment type / collection type

The second step (after creating a **property type**, see above) is to create the **experiment type**.

The new name for **experiment** is **collection**. You can use both methods interchangeably:

* `new_experiment_type()` == `new_collection_type()`

```
experiment_type = o.new_experiment_type(
    code,
    description      = None,
    validationPlugin = None,
)
experiment_type.save()
experiment_type.assign_property('property_name')
experiment_type.revoke_property('property_name')
experiment_type.get_property_assignments()
```

## create material types

Materials and material types are deprecated in newer versions of openBIS.

```
material_type = o.new_material_type(
    code,
    description=None,
    validationPlugin=None,
)
material_type.save()
material_type.assign_property('property_name')
material_type.revoke_property('property_name')
material_type.get_property_assignments()

```

## create plugins

Plugins are Jython scripts that can accomplish more complex data-checks than ordinary types and vocabularies can achieve. They are assigned to entity types (dataset type, sample type etc). [Documentation and examples can be found here](https://wiki-bsse.ethz.ch/display/openBISDoc/Properties+Handled+By+Scripts)

```
pl = o.new_plugin(
    name       ='my_new_entry_validation_plugin',
    pluginType ='ENTITY_VALIDATION',       # or 'DYNAMIC_PROPERTY' or 'MANAGED_PROPERTY',
    entityKind = None,                     # or 'SAMPLE', 'MATERIAL', 'EXPERIMENT', 'DATA_SET'
    script     = 'def calculate(): pass'   # a JYTHON script
)
pl.save()
```

## Users, Groups and RoleAssignments

Users can only login into the openBIS system when:
* they are present in the authentication system (e.g. LDAP)
* the username/password is correct
* the user's mail address needs is present
* the user is already added to the openBIS user list (see below)
* the user is assigned a role which allows a login, either directly assigned or indirectly assigned via a group membership

```
o.get_groups()
group = o.new_group(code='group_name', description='...')
group = o.get_group('group_name')
group.save()
group.assign_role(role='ADMIN', space='DEFAULT')
group.get_roles()
group.revoke_role(role='ADMIN', space='DEFAULT')

group.add_members(['admin'])
group.get_members()
group.del_members(['admin'])
group.delete()

o.get_persons()
person = o.new_person(userId='username')
person.space = 'USER_SPACE'
person.save()
# person.delete() is currently not possible.

person.assign_role(role='ADMIN', space='MY_SPACE')
person.assign_role(role='OBSERVER')
person.get_roles()
person.revoke_role(role='ADMIN', space='MY_SPACE')
person.revoke_role(role='OBSERVER')

o.get_role_assignments()
o.get_role_assignments(space='MY_SPACE')
o.get_role_assignments(group='MY_GROUP')
ra = o.get_role_assignment(techId)
ra.delete()
```

## Spaces

Spaces are fundamental way in openBIS to divide access between groups. Within a space, data can be easily shared. Between spaces, people need to be given specific access rights (see section above). The structure in openBIS is as follows:

* space
    * project
        * experiment / collection
            * sample / object
                * dataset

```
space = o.new_space(code='space_name', description='')
space.save()
o.get_spaces(
    start_with = 0,                   # start_with and count
    count      = 10,                  # enable paging
)
space = o.get_space('MY_SPACE')

# get individual attributes
space.code
space.description
space.registrator
space.registrationDate
space.modifier
space.modificationDate

# set individual attribute
# most of the attributes above are set automatically and cannot be modified.
space.description = '...'

# get all attributes as a dictionary
space.attrs.all()

space.delete('reason for deletion')
```

## Projects

Projects live within spaces and usually contain experiments (aka collections):

* space
    * project
        * experiment / collection
            * sample / object
                * dataset

```
project = o.new_project(
    space       = space,
    code        = 'project_name',
    description = 'some project description'
)
project = space.new_project(
	code         = 'project_code',
	description  = 'project description'
)
project.save()

o.get_projects(
    space       = 'MY_SPACE',         # show only projects in MY_SPACE
    start_with  = 0,                  # start_with and count
    count       = 10,                 # enable paging
)
o.get_projects(space='MY_SPACE')
space.get_projects()

project.get_experiments()

project.get_attachments()             # deprecated, as attachments are not compatible with ELN-LIMS.
                                      # Attachments are an old concept and should not be used anymore.
p.add_attachment(                     # deprecated, see above
    fileName='testfile',
     description= 'another file',
     title= 'one more attachment'
)
project.download_attachments()        # deprecated, see above

# get individual attributes
project.code
project.description

# set individual attribute
project.description = '...'

# get all attributes as a dictionary
project.attrs.all()

project.freeze = True
project.freezeForExperiments = True
project.freezeForSamples = True
```

## Experiments / Collections

Experiments live within projects:

* space
    * project
        * experiment / collection
            * sample / object
                * dataset

The new name for **experiment** is **collection**. You can use boths names interchangeably:

* `get_experiment()`  = `get_collection()`
* `new_experiment()`  = `new_collection()`
* `get_experiments()` = `get_collections()`

### create a new experiment

```
exp = o.new_experiment
    type='DEFAULT_EXPERIMENT',
    space='MY_SPACE',
    project='YEASTS'
)
exp.save()
```

### search for experiments

```
experiments = o.get_experiments(
    project       = 'YEASTS',
    space         = 'MY_SPACE',
    type          = 'DEFAULT_EXPERIMENT',
    tags          = '*',
    finished_flag = False,
    props         = ['name', 'finished_flag']
)
experiments = project.get_experiments()
experiment = experiments[0]        # get first experiment of result list
experiment = experiment
for experiment in experiments:     # iterate over search results
    print(experiment.props.all())
dataframe = experiments.df         # get Pandas DataFrame of result list

exp = o.get_experiment('/MY_SPACE/MY_PROJECT/MY_EXPERIMENT')
```

### Experiment attributes

```
exp.attrs.all()                    # returns all attributes as a dict

exp.attrs.tags = ['some', 'tags']
exp.tags = ['some', 'tags']        # same thing
exp.save()

exp.code
exp.description
exp.registrator
...

exp.project = 'my_project'
exp.space   = 'my_space'
exp.freeze = True
exp.freezeForDataSets = True
exp.freezeForSamples = True

exp.save()                         # needed to save/update the changed attributes and properties
```

### Experiment properties

**Getting properties**

```
experiment.props == ds.p                  # you can use either .props or .p to access the properties
experiment.p                              # in Jupyter: show all properties in a nice table
experiment.p()                            # get all properties as a dict
experiment.props.all()                    # get all properties as a dict
experiment.p('prop1','prop2')             # get some properties as a dict
experiment.p.get('$name')                 # get the value of a property
experiment.p['property']                  # get the value of a property
```

**Setting properties**

```
experiment.experiment = 'first_exp'       # assign sample to an experiment
experiment.project = 'my_project'         # assign sample to a project

experiment.p. + TAB                       # in Jupyter/IPython: show list of available properties
experiment.p.my_property_ + TAB           # in Jupyter/IPython: show datatype or controlled vocabulary
experiment.p['my_property']= "value"      # set the value of a property
experiment.p.set('my_property, 'value')   # set the value of a property
experiment.p.my_property = "some value"   # set the value of a property
experiment.p.set({'my_property':'value'}) # set the values of some properties
experiment.set_props({ key: value })      # set the values of some properties

experiment.save()                         # needed to save/update the changed attributes and properties
```

## Samples / Objects

Samples usually live within experiments/collections:

* space
    * project
        * experiment / collection
            * sample / object
                * dataset

The new name for **sample** is **object**. You can use boths names interchangeably:

* `get_sample()`  = `get_object()`
* `new_sample()`  = `new_object()`
* `get_samples()` = `get_objects()`

etc.

```
sample = o.new_sample(
    type       = 'YEAST',
    space      = 'MY_SPACE',
    experiment = '/MY_SPACE/MY_PROJECT/EXPERIMENT_1',
    parents    = [parent_sample, '/MY_SPACE/YEA66'],
    children   = [child_sample],
    props      = {"name": "some name", "description": "something interesting"}
)
sample = space.new_sample( type='YEAST' )
sample.save()

sample = o.get_sample('/MY_SPACE/MY_SAMPLE_CODE')
sample = o.get_sample('20170518112808649-52')
samples= o.get_samples(type='UNKNOWN')    # search for samples, see below

# get individual attributes
sample.space
sample.code
sample.permId
sample.identifier
sample.type  # once the sample type is defined, you cannot modify it

# set attribute
sample.space = 'MY_OTHER_SPACE'

sample.experiment    # a sample can belong to one experiment only
sample.experiment = '/MY_SPACE/MY_PROJECT/MY_EXPERIMENT'

sample.project
sample.project = '/MY_SPACE/MY_PROJECT'  # only works if project samples are
enabled

sample.tags
sample.tags = ['guten_tag', 'zahl_tag' ]

sample.attrs.all()                    # returns all attributes as a dict
sample.props.all()                    # returns all properties as a dict

sample.get_attachments()              # deprecated, as attachments are not compatible with ELN-LIMS.
                                      # Attachments are an old concept and should not be used anymore.
sample.download_attachments()         # deprecated, see above
sample.add_attachment('testfile.xls') # deprecated, see above

sample.delete('deleted for some reason')
```

## create/update/delete many samples in a transaction

Creating a single sample takes some time. If you need to create many samples, you might want to create them in one transaction. This will transfer all your sample data at once. The Upside of this is the **gain in speed**. The downside: this is a **all-or-nothing** operation, which means, either all samples will be registered or none (if any error occurs).

**create many samples in one transaction**

```
trans = o.new_transaction()
for i in range (0, 100):
    sample = o.new_sample(...)
    trans.add(sample)

trans.commit()
```

**update many samples in one transaction**

```
trans = o.new_transaction()
for sample in o.get_samples(count=100):
    sample.prop.some_property = 'different value'
    trans.add(sample)

trans.commit()
```

**delete many samples in one transaction**

```
trans = o.new_transaction()
for sample in o.get_samples(count=100):
    sample.mark_to_be_deleted()
    trans.add(sample)

trans.reason('go what has to go')
trans.commit()
```
**Note:** You can use the `mark_to_be_deleted()`, `unmark_to_be_deleted()` and `is_marked_to_be_deleted()` methods to set and read the internal flag.

### parents, children, components and container

```
sample.get_parents()
sample.set_parents(['/MY_SPACE/PARENT_SAMPLE_NAME')
sample.add_parents('/MY_SPACE/PARENT_SAMPLE_NAME')
sample.del_parents('/MY_SPACE/PARENT_SAMPLE_NAME')

sample.get_children()
sample.set_children('/MY_SPACE/CHILD_SAMPLE_NAME')
sample.add_children('/MY_SPACE/CHILD_SAMPLE_NAME')
sample.del_children('/MY_SPACE/CHILD_SAMPLE_NAME')

# A Sample may belong to another Sample, which acts as a container.
# As opposed to DataSets, a Sample may only belong to one container.
sample.container    # returns a sample object
sample.container = '/MY_SPACE/CONTAINER_SAMPLE_NAME'   # watch out, this will change the identifier of the sample to:
                                                       # /MY_SPACE/CONTAINER_SAMPLE_NAME:SAMPLE_NAME
sample.container = ''                                  # this will remove the container.

# A Sample may contain other Samples, in order to act like a container (see above)
# caveat: containers are NOT compatible with ELN-LIMS
# The Sample-objects inside that Sample are called «components» or «contained Samples»
# You may also use the xxx_contained() functions, which are just aliases.
sample.get_components()
sample.set_components('/MY_SPACE/COMPONENT_NAME')
sample.add_components('/MY_SPACE/COMPONENT_NAME')
sample.del_components('/MY_SPACE/COMPONENT_NAME')
```

### sample tags

```
sample.get_tags()
sample.set_tags('tag1')
sample.add_tags(['tag2','tag3'])
sample.del_tags('tag1')
```

### Sample attributes and properties

**Getting properties**

```
sample.attrs.all()                    # returns all attributes as a dict
sample.attribute_name                 # return the attribute value

sample.props == ds.p                  # you can use either .props or .p to access the properties
sample.p                              # in Jupyter: show all properties in a nice table
sample.p()                            # get all properties as a dict
sample.props.all()                    # get all properties as a dict
sample.p('prop1','prop2')             # get some properties as a dict
sample.p.get('$name')                 # get the value of a property
sample.p['property']                  # get the value of a property
```

**Setting properties**

```
sample.experiment = 'first_exp'       # assign sample to an experiment
sample.project = 'my_project'         # assign sample to a project

sample.p. + TAB                       # in Jupyter/IPython: show list of available properties
sample.p.my_property_ + TAB           # in Jupyter/IPython: show datatype or controlled vocabulary
sample.p['my_property']= "value"      # set the value of a property
sample.p.set('my_property, 'value')   # set the value of a property
sample.p.my_property = "some value"   # set the value of a property
sample.p.set({'my_property':'value'}) # set the values of some properties
sample.set_props({ key: value })      # set the values of some properties

sample.save()                         # needed to save/update the attributes and properties
```

### search for samples / objects

The result of a search is always list, even when no items are found. The `.df` attribute returns
the Pandas dataFrame of the results.

```
samples = o.get_samples(
    space      ='MY_SPACE',
    type       ='YEAST',
    tags       =['*'],                # only sample with existing tags
    start_with = 0,                   # start_with and count
    count      = 10,                  # enable paging
    where = {
        "$SOME.WEIRD-PROP": "hello"   # only receive samples where properties match
    }

    registrationDate = "2020-01-01",  # date format: YYYY-MM-DD
    modificationDate = "<2020-12-31", # use > or < to search for specified date and later / earlier
    attrs=[                           # show these attributes in the dataFrame
        'sample.code',
        'registrator.email',
        'type.generatedCodePrefix'
    ],
    parent_property = 'value',        # search in a parent's property
    child_property  = 'value',        # search in a child's property
    container_property = 'value'      # search in a container's property
    parent = '/MY_SPACE/PARENT_SAMPLE', # sample has this as its parent
    parent = '*',                     # sample has at least one parent
    child  = '/MY_SPACE/CHILD_SAMPLE',
    child  = '*',                     # sample has at least one child
    container = 'MY_SPACE/CONTAINER',
    container = '*'                   # sample lives in a container
    props=['$NAME', 'MATING_TYPE']    # show these properties in the result
)

sample = samples[9]                   # get the 10th sample
                                      # of the search results
sample = samples['/SPACE/AABC']       # same, fetched by identifier
for sample in samples:                # iterate over the
   print(sample.code)                 # search results

samples.df                            # returns a Pandas DataFrame object

samples = o.get_samples(props="*")    # retrieve all properties of all samples
```

### freezing samples

```
sample.freeze = True
sample.freezeForComponents = True
sample.freezeForChildren = True
sample.freezeForParents = True
sample.freezeForDataSets = True
```

## Datasets

Datasets are by all means the most important openBIS entity. The actual files are stored as datasets; all other openBIS entities mainly are necessary to annotate and to structure the data:

* space
    * project
        * experiment / collection
            * sample / object
                * dataset

### working with existing dataSets

**search for datasets**

This example does the following

* search for all datasets of type `SCANS`, retrieve the first 10 entries
* print out all properties
* print the list of all files in this dataset
* download the dataset

```
datasets = sample.get_datasets(type='SCANS', start_with=0, count=10)
for dataset in datasets:
    print(dataset.props())
    print(dataset.file_list)
    dataset.download()
dataset = datasets[0]
```

**More dataset functions:**

```
ds = o.get_dataset('20160719143426517-259')
ds.get_parents()
ds.get_children()
ds.sample
ds.experiment
ds.physicalData
ds.status                         # AVAILABLE   LOCKED   ARCHIVED
                                  # ARCHIVE_PENDING   UNARCHIVE_PENDING
                                  # BACKUP_PENDING
ds.archive()                      # archives a dataset, i.e. moves it to a slower but cheaper diskspace (tape).
                                  # archived datasets cannot be downloaded, they need to be unarchived first.
                                  # This is an asynchronous process,
                                  # check ds.status regularly until the dataset becomes 'ARCHIVED'
ds.unarchive()                    # this starts an asynchronous process which gets the dataset from the tape.
                                  # Check ds.status regularly until it becomes 'AVAILABLE'

ds.attrs.all()                    # returns all attributes as a dict
ds.props.all()                    # returns all properties as a dict

ds.add_attachment()               # Deprecated. Attachments usually contain meta-data
ds.get_attachments()              # about the dataSet, not the data itself.
ds.download_attachments()         # Deprecated, as attachments are not compatible with ELN-LIMS.
                                  # Attachments are an old concept and should not be used anymore.
```

### download dataSets

```
o.download_prefix                  # used for download() and symlink() method.
                                   # Is set to data/hostname by default, but can be changed.
ds.get_files(start_folder="/")     # get file list as Pandas dataFrame
ds.file_list                       # get file list as array
ds.file_links                      # file list as a dict containing direct https links

ds.download()                      # simply download all files to data/hostname/permId/
ds.download(
	destination = 'my_data',        # download files to folder my_data/
	create_default_folders = False, # ignore the /original/DEFAULT folders made by openBIS
	wait_until_finished = False,    # download in background, continue immediately
	workers = 10                    # 10 downloads parallel (default)
)
ds.download_path                   # returns the relative path (destination) of the files after a ds.download()
ds.is_physical()                   # TRUE if dataset is physically
```

### link dataSets

Instead of downloading a dataSet, you can create a symbolic link to a dataSet in the openBIS dataStore. To do that, the openBIS dataStore needs to be mounted first (see mount method above). **Note:** Symbolic links and the mount() feature currently do not work with Windows.

```
o.download_prefix                  # used for download() and symlink() method.
                                   # Is set to data/hostname by default, but can be changed.
ds.symlink()                       # creates a symlink for this dataset: data/hostname/permId
                                   # tries to mount openBIS instance
                                   # in case it is not mounted yet
ds.symlink(
   target_dir = 'data/dataset_1/', # default target_dir is: data/hostname/permId
   replace_if_symlink_exists=True
)
ds.is_symlink()
```

### dataSet attributes and properties

**Getting properties**

```
ds.attrs.all()                    # returns all attributes as a dict
ds.attribute_name                 # return the attribute value

ds.props == ds.p                  # you can use either .props or .p to access the properties
ds.p                              # in Jupyter: show all properties in a nice table
ds.p()                            # get all properties as a dict
ds.props.all()                    # get all properties as a dict
ds.p('prop1','prop2')             # get some properties as a dict
ds.p.get('$name')                 # get the value of a property
ds.p['property']                  # get the value of a property
```

**Setting properties**

```
ds.experiment = 'first_exp'       # assign dataset to an experiment
ds.sample = 'my_sample'           # assign dataset to a sample

ds.p. + TAB                       # in Jupyter/IPython: show list of available properties
ds.p.my_property_ + TAB           # in Jupyter/IPython: show datatype or controlled vocabulary
ds.p['my_property']= "value"      # set the value of a property
ds.p.set('my_property, 'value')   # set the value of a property
ds.p.my_property = "some value"   # set the value of a property
ds.p.set({'my_property':'value'}) # set the values of some properties
ds.set_props({ key: value })      # set the values of some properties
```

### search for dataSets

* The result of a search is always list, even when no items are found
* The `.df` attribute returns the Pandas dataFrame of the results

```
datasets = o.get_datasets(
    type  ='MY_DATASET_TYPE',
    **{ "SOME.WEIRD:PROP": "value"},  # property name contains a dot or a
                                      # colon: cannot be passed as an argument
    start_with = 0,                   # start_with and count
    count      = 10,                  # enable paging
    registrationDate = "2020-01-01",  # date format: YYYY-MM-DD
    modificationDate = "<2020-12-31", # use > or < to search for specified date and later / earlier
    parent_property = 'value',        # search in a parent's property
    child_property  = 'value',        # search in a child's property
    container_property = 'value'      # search in a container's property
    parent = '/MY_SPACE/PARENT_DS',   # has this dataset as its parent
    parent = '*',                     # has at least one parent dataset
    child  = '/MY_SPACE/CHILD_DS',
    child  = '*',                     # has at least one child dataset
    container = 'MY_SPACE/CONTAINER_DS',
    container = '*',                  # belongs to a container dataset
    attrs=[                           # show these attributes in the dataFrame
        'sample.code',
        'registrator.email',
        'type.generatedCodePrefix'
    ],
    props=['$NAME', 'MATING_TYPE']    # show these properties in the result
)
datasets = o.get_datasets(props="*")  # retrieve all properties of all dataSets
dataset = datasets[0]                 # get the first dataset in the search result
for dataset in datasets:              # iterate over the datasets
    ...
df = datasets.df                      # returns a Pandas dataFrame object of the search results
```

In some cases, you might want to retrieve precisely certain datasets. This can be achieved by
methods chaining (but be aware, it might not be very performant):

```
datasets = o.get_experiments(project='YEASTS')\
			 .get_samples(type='FLY')\
			 .get_datasets(
					type='ANALYZED_DATA',
					props=['MY_PROPERTY'],
					MY_PROPERTY='some analyzed data'
		 	 )
```
* another example:
```
datasets = o.get_experiment('/MY_NEW_SPACE/MY_PROJECT/MY_EXPERIMENT4')\
           .get_samples(type='UNKNOWN')\
           .get_parents()\
           .get_datasets(type='RAW_DATA')
```

### freeze dataSets
* once a dataSet has been frozen, it cannot be changed by anyone anymore
* so be careful!

```
ds.freeze = True
ds.freezeForChildren = True
ds.freezeForParents = True
ds.freezeForComponents = True
ds.freezeForContainers = True
ds.save()
```

### create a new dataSet

```
ds_new = o.new_dataset(
    type       = 'ANALYZED_DATA',
    experiment = '/SPACE/PROJECT/EXP1',
    sample     = '/SPACE/SAMP1',
    files      = ['my_analyzed_data.dat'],
    props      = {'name': 'some good name', 'description': '...' }
)
ds_new.save()
```

### create dataSet with zipfile

DataSet containing one zipfile which will be unzipped in openBIS:

```python
ds_new = o.new_dataset(
    type       = 'RAW_DATA',
    sample     = '/SPACE/SAMP1',
    zipfile    = 'my_zipped_folder.zip',
)
ds_new.save()
```

### create dataSet with mixed content

* mixed content means: folders and files are provided
* a relative specified folder (and all its content) will end up in the root, while keeping its structure
   * `../measurements/` --> `/measurements/`
   * `some/folder/somewhere/` --> `/somewhere/`
* relative files will also end up in the root
   * `my_file.txt` --> `/my_file.txt`
   * `../somwhere/else/my_other_file.txt` --> `/my_other_file.txt`
   * `some/folder/file.txt` --> `/file.txt`
* useful if DataSet contains files and folders
* the content of the folder will be zipped (on-the-fly) and uploaded to openBIS
* openBIS will keep the folder structure intact
* relative path will be shortened to its basename. For example:

| local                      | openBIS    |
|----------------------------|------------|
| `../../myData/`            | `myData/`  |
| `some/experiment/results/` | `results/` |

```
ds_new = o.new_dataset(
    type       = 'RAW_DATA',
    sample     = '/SPACE/SAMP1',
    files     = ['../measurements/', 'my_analyis.ipynb', 'results/']
)
ds_new.save()
```

### create dataSet container

A DataSet of kind=CONTAINER contains other DataSets, but no files:

```
ds_new = o.new_dataset(
    type       = 'ANALYZED_DATA',
    experiment = '/SPACE/PROJECT/EXP1',
    sample     = '/SPACE/SAMP1',
    kind       = 'CONTAINER',
    props      = {'name': 'some good name', 'description': '...' }
)
ds_new.save()
```

### get, set, add and remove parent datasets

```
dataset.get_parents()
dataset.set_parents(['20170115220259155-412'])
dataset.add_parents(['20170115220259155-412'])
dataset.del_parents(['20170115220259155-412'])
```

#### get, set, add and remove child datasets

```
dataset.get_children()
dataset.set_children(['20170115220259155-412'])
dataset.add_children(['20170115220259155-412'])
dataset.del_children(['20170115220259155-412'])
```

### dataSet containers

* A DataSet may belong to other DataSets, which must be of kind=CONTAINER
* As opposed to Samples, DataSets may belong (contained) to more than one DataSet-container
* caveat: containers are NOT compatible with ELN-LIMS

```
dataset.get_containers()
dataset.set_containers(['20170115220259155-412'])
dataset.add_containers(['20170115220259155-412'])
dataset.del_containers(['20170115220259155-412'])
```

* a DataSet of kind=CONTAINER may contain other DataSets, to act like a folder (see above)
* the DataSet-objects inside that DataSet are called components or contained DataSets
* you may also use the xxx_contained() functions, which are just aliases.
* caveat: components are NOT compatible with ELN-LIMS

```
dataset.get_components()
dataset.set_components(['20170115220259155-412'])
dataset.add_components(['20170115220259155-412'])
dataset.del_components(['20170115220259155-412'])
```

## Semantic Annotations

create semantic annotation for sample type 'UNKNOWN':

```

sa = o.new_semantic_annotation(
	entityType = 'UNKNOWN',
	predicateOntologyId = 'po_id',
	predicateOntologyVersion = 'po_version',
	predicateAccessionId = 'pa_id',
	descriptorOntologyId = 'do_id',
	descriptorOntologyVersion = 'do_version',
	descriptorAccessionId = 'da_id'
)
sa.save()
```

Create semantic annotation for property type (predicate and descriptor values omitted for brevity)

```
sa = o.new_semantic_annotation(propertyType = 'DESCRIPTION', ...)
sa.save()
```

**Create** semantic annotation for sample property assignment (predicate and descriptor values omitted for brevity)

```
sa = o.new_semantic_annotation(
	entityType = 'UNKNOWN',
	propertyType = 'DESCRIPTION',
	...
)
sa.save()
```

**Create** a semantic annotation directly from a sample type. Will also create sample property assignment annotations when propertyType is given:

```
st = o.get_sample_type("ORDER")
st.new_semantic_annotation(...)
```

**Get all** semantic annotations

```
o.get_semantic_annotations()
```

**Get** semantic annotation by perm id

```
sa = o.get_semantic_annotation("20171015135637955-30")
```

**Update** semantic annotation

```
sa.predicateOntologyId = 'new_po_id'
sa.descriptorOntologyId = 'new_do_id'
sa.save()
```

**Delete** semantic annotation

```
sa.delete('reason')
```

## Tags
```
new_tag = o.new_tag(
	code        = 'my_tag',
	description = 'some descriptive text'
)
new_tag.description = 'some new description'
new_tag.save()
o.get_tags()
o.get_tag('/username/TAG_Name')
o.get_tag('TAG_Name')

tag.get_experiments()
tag.get_samples()
tag.get_owner()   # returns a person object
tag.delete('why?')
```

## Vocabulary and VocabularyTerms

An entity such as Sample (Object), Experiment (Collection), Material or DataSet can be of a specific *entity type*:

* Sample Type (Object Type)
* Experiment Type (Collection Type)
* DataSet Type
* Material Type

Every type defines which **Properties** may be defined. Properties act like **Attributes**, but they are type-specific. Properties can contain all sorts of information, such as free text, XML, Hyperlink, Boolean and also **Controlled Vocabulary**. Such a Controlled Vocabulary consists of many **VocabularyTerms**. These terms are used to only allow certain values entered in a Property field.

So for example, you want to add a property called **Animal** to a Sample and you want to control which terms are entered in this Property field. For this you need to do a couple of steps:

1. create a new vocabulary *AnimalVocabulary*
2. add terms to that vocabulary: *Cat, Dog, Mouse*
3. create a new PropertyType (e.g. *Animal*) of DataType *CONTROLLEDVOCABULARY* and assign the *AnimalVocabulary* to it
4. create a new SampleType (e.g. *Pet*) and *assign* the created PropertyType to that Sample type.
5. If you now create a new Sample of type *Pet* you will be able to add a property *Animal* to it which only accepts the terms *Cat, Dog* or *Mouse*.

**create new Vocabulary with three VocabularyTerms**

```
voc = o.new_vocabulary(
    code = 'BBB',
    description = 'description of vocabulary aaa',
    urlTemplate = 'https://ethz.ch',
    terms = [
        { "code": 'term_code1', "label": "term_label1", "description": "term_description1"},
        { "code": 'term_code2', "label": "term_label2", "description": "term_description2"},
        { "code": 'term_code3', "label": "term_label3", "description": "term_description3"}
    ]
)
voc.save()

voc.vocabulary = 'description of vocabulary BBB'
voc.chosenFromList = True
voc.save() # update
```

**create additional VocabularyTerms**

```
term = o.new_term(
	code='TERM_CODE_XXX',
	vocabularyCode='BBB',
	label='here comes a label',
	description='here might appear a meaningful description'
)
term.save()
```

**update VocabularyTerms**

To change the ordinal of a term, it has to be moved either to the top with the `.move_to_top()` method or after another term using the `.move_after_term('TERM_BEFORE')` method.

```
voc = o.get_vocabulary('STORAGE')
term = voc.get_terms()['RT']
term.label = "Room Temperature"
term.official = True
term.move_to_top()
term.move_after_term('-40')
term.save()
term.delete()
```

repository: kykrueger/openbis

gha_language: Java

repo_name: kykrueger/openbis


text:
# GraphicsCard

Graphics Card present in a server.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**card_id** | **int** | It shows the id of graphics card.   | [optional] [readonly]
**device_id** | **int** | It shows the device id of grphics card.   | [optional] [readonly]
**expander_slot** | **str** | It shows the expander slot inforamtion for the card.   | [optional] [readonly]
**firmware_version** | **str** | It shows current firmware version of graphics card.   | [optional] [readonly]
**mode** | **str** | It shows the current mode of graphics card.   | [optional] [readonly]
**num_gpus** | **str** | It shows number of controllers under each card.   | [optional]
**oper_state** | **str** | It shows the current operational state of graphics card.   | [optional] [readonly]
**pci_address** | **str** | It shows the pci address of graphics card.   | [optional] [readonly]
**pci_address_list** | **str** | This list contains the pci address of all controllers for corresponding card.   | [optional] [readonly]
**pci_slot** | **str** | It shows the pci slot name for grapchics card.    | [optional] [readonly]
**compute_board** | [**ComputeBoard**](.md) |  | [optional]
**graphics_controllers** | [**list[GraphicsController]**](GraphicsController.md) | A reference to a graphicsController resource. When the $expand query parameter is specified, the referenced resource is returned inline. It shows the controllers under each graphics card.  | [optional] [readonly]
**registered_device** | [**AssetDeviceRegistration**](.md) |  | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: CiscoUcs/intersight-python

gha_language: Python

repo_name: CiscoUcs/intersight-python


text:
# Pong

Pong is a mythical arcade game.
The goal of the game is to score goal against an opponent.

## How to play ?

To play at Pong, you muste have several ways :

* You can go on [itch.io](https://kero76.itch.io/pong) to play with the latest version release on [itch.io](https://itch.io/).
* Compile yourself the game thanks to Haxe lib (version 3.4.5 or more).

### Commands

* Player one (Red racket)
    * Z or W to move up.
    * S to move down.
* Player two (Right Racket)
    * P to move up
    * M or SEMICOLON to move down.
* Score menu
    * Press Enter to start new round.
* Main / Option menu
    * Use left click to interact with buttons.

## How to Contribute ?

To contribute at Pong, you must read the CONTRIBUTING(CONTRIBUTING.md) file
and respect all rules on it.

## Assets

### Sounds

You can listen and download all sounds assets on [freesound.org](https://freesound.org/).
All sounds are convert into .ogg file.

- [select.ogg](https://freesound.org/people/sharesynth/sounds/344508/)
- [racket.ogg](https://freesound.org/people/NoiseCollector/sounds/4391/)
- [ball.ogg](https://freesound.org/people/NoiseCollector/sounds/4359/)

### Images

You can find and download all images assets from all website specified below.

- [button.png](https://raw.githubusercontent.com/HaxeFlixel/flixel-demos/master/Tutorials/TurnBasedRPG/assets/images/button.png)

## Changelog

* Pong v0.2-SNAPSHOT - Release March 23, 2018
* Pong v0.1-SNAPSHOT - Release March 01, 2018

## License

This project is under [MIT licence](https://opensource.org/licenses/MIT).

## Authors

* Nicolas GILLE<EMAIL_ADDRESS>    * Developer
    * Tester


text:
# github-explorer-react-native

This is a demo React Native app for exploring trending and most popular GitHub repositories.

Features:
- iOS and Android builds
- Relay Modern integration with GitHub GraphQL API
- React Navigation with platform specific UI idioms
- UI Automation testing with Appium

![](./assets/ios-screencast.gif) ![](./assets/android-screencast.gif)

## Getting Started
1. Complete the React Native Getting Started guide for **iOS** and **Android**:
  - <http://facebook.github.io/react-native/docs/getting-started.html>
2. Install `yarn`. This is an optional step, you can substitute `yarn` for `npm` in the instructions that follow.
  - <https://yarnpkg.com/en/docs/install>
3. Generate an OAuth token to access the GitHub GraphQL API
  - <https://developer.github.com/early-access/graphql/guides/accessing-graphql/#generating-an-oauth-token>
4. Clone repo and install dependencies:
```
git clone https://github.com/johnwakley/github-explorer-react-native && cd github-explorer-react-native
yarn install
```
5. In the `.env` and `.env.production` files located at the root of the project, substitute text, `REPLACE_WITH_YOUR_ACCESS_TOKEN`, with the OAuth token created in step 3.
6. From the project root,
- Run the app on the iOS simulator:
  - `react-native run-ios`
- For the Android build, first, launch the emulator configured in Step 1, then run:
  - `react-native run-android`

## Running Unit Tests
```
yarn test
```
Flow static analysis and JS Standard linting are performed before unit and snapshot tests are run.

## Running Integration Tests
[Appium](http://appium.io/) is used to drive automated UI tests for the iOS and Android builds.

### Getting Started
1. Install Appium:
```
npm install -g appium  # get appium
npm install wd         # get appium clien
```

2. The appium tests are written in python and use the python appium client library, which also needs to be installed:
```
pip install Appium-Python-Client
pip install pytest
```

3. Ensure this script: `e2e/appium_bootstrap.sh`, has execute permissions. It does the following:
- Creates a release Android app build
- Starts the Android emulator. The script is currently configured to start the emulator named: `Nexus_5X_API_25_x86`. Replace, if neccessary, with the name of the emulator you created in the React Native Getting Started guide
- Starts the Appium server
- Runs the Android UI Automator tests defined in `e2e/android_tests.py`
- Creates an iOS build using Fastlane
- Runs the iOS UI Automation tests defined in `e2e/ios_tests.py`
- Reports test results
- Completes by stopping the Appium server and device emulator and simulators.

4. Before running the appium tests, you will need to generate a keystore file that is used to create a signed APK. Instructions can be found here: [Generating Signed APK](http://facebook.github.io/react-native/docs/signed-apk-android.html)
  - Replace the following section of `android/app/build.gradle`, with the details of your own keystore:
```
storeFile file("github-explorer.keystore")
storePassword getPassword("github-explorer-apk-keystore")
keyAlias "github-explorer-key"
keyPassword getPassword("github-explorer-apk-key")
```

5. Finally, you can now run the appium tests:
```
yarn test:system
```

## Further Reading
To learn more about the libraries used in this project, check out these links:

- [React Native](http://facebook.github.io/react-native/)
- [GraphQL](http://graphql.org/)
- [Relay](https://facebook.github.io/relay/)
- [GitHub GraphQL API](https://developer.github.com/early-access/graphql/)
- [React Navigation](https://reactnavigation.org/)
- [Appium](http://appium.io/)

repository: johnwakley/github-explorer-react-native

repo_name: johnwakley/github-explorer-react-native


text:
Website Monitor
===============

Lightweight Node.js command line tool for website monitoring.

[![Build Status](https://travis-ci.org/nyjt/website-monitor.png)](https://travis-ci.org/nyjt/website-monitor)

[![Code Climate](https://codeclimate.com/github/nyjt/website-monitor.png)](https://codeclimate.com/github/nyjt/website-monitor)

## How to install it

```bash
npm install website-monitor
```

## How to use it

### Plain text output

Use log method to check http status of websites.

You can pass one URL as string:
```js
var monitor = require('website-monitor');

monitor.log('http://google.com');
```

Or more as array:

```js
var monitor = require('website-monitor');

var urls = [
  'http://google.com',
  'http://yahoo.com',
  'http://flickr.com',
  'http://resize-links.com',
  'http://www.google.com/not-found'
];

monitor.log(urls);
```

This will produce this output:

```
SUCCESS 200 http://resize-links.com
SUCCESS 200 http://google.com
SUCCESS 200 http://yahoo.com
SUCCESS 200 http://flickr.com
ERROR   404 http://www.google.com/not-found
```

Check the ./examples/ directory for more example.

The typical usage of log method when you call it from a bash script and grep for ERROR word,
after it you can do some more action ex. start the webserver if stoped or send email alert.

### HTML output

From the 1.2.0 version website monitor can produce html output.
The typical use case of this feature is the redirection the HTML output in .html file using cronjob as often as you want.
NginX or any other webserver can server this static file very fast.
This is pretty good reporting tool and you don't need to query any database to check the actual status of websites.

So it is pretty easy to use.

Let be the content of website_status_html_generator.js is this:

```
var monitor = require('website-monitor');

var urls = [
  'http://google.com',
  'http://yahoo.com',
  'http://flickr.com',
  'http://resize-links.com'
];

monitor.log(urls);
```

You can use this file from command line or crontab.

from command line:
```
node website_status_html_generator.js
```

Or you can run it from crontab every 5 minutes and it regenerates the status HTML file:

```
*/5 * * * * node /home/myuser/website-monitor-scripts/website_status_html_generator.js >/var/www/status.example.com/index.html
```

Of course you need to change the path.

repository: nyjt/website-monitor

gha_language: JavaScript

repo_name: nyjt/website-monitor


text:
---
layout: post
title: Cross Validation
category: eecs545
---
## Applications of ML
Two approaches: you can go bottom up or top down. Bottom up is for research and new methods while top down is more for applications.

## Bias Variance Tradeoff
Variance is how much does the model fit, bias is how well a model fits the data on average. We can view bias as "accuracy" and variance as "precision". Our expected loss is bias^2 + variance + noise. This is a brilliant decomposition: the expected error is **exactly** these three terms and we can prove it.

This nature of bias and variance means that we generally must choose a tradeoff between the two. Because noise is always present, we have to pick between these parameters. Usually we can find a minima of these terms (especially because bias is squared). In these cases, we usually find that the minimum of the test squared error occurs at this minimum. We find a good balance between the two via cross-validation.

## Cross Validation
Generally the best way to cross validate is to use a train, validation, and test set to avoid overfitting the hyperparameters to the dataset you have. Cross validation is fairly basic - k-Fold or however many folds you want. Leave one out is the same as k-fold if k is n.


text:
# CoreCMS SPA application

## Project setup
```
vagrant up
```

### Compiles and hot-reloads for development
```
vagrant ssh
cd /vagrant
sudo npm run serve //sudo here, because its need privilegies for serving on port 80
Local url: spa.corecms.test
```

### Compiles and minifies for production
```
npm run build
```
### Compiles and minifies for staging
```
 npm run build -- --mode staging
```
### Run your tests
```
npm run test
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

### Reference

* [Vuetifyjs](https://vuetifyjs.com/)
* [Vue](https://vuejs.org/index.html/)
* [ECharts](http://echarts.baidu.com/option.html)
* [Stylus](http://stylus-lang.com/)

repository: SarloAkrobata/corecms-spa

gha_language: Vue

gha_license_id: MIT

repo_name: SarloAkrobata/corecms-spa


text:
---
layout: post
title:  "A personal challenge"
date:   2021-06-15 11:07:11 +0530
category: mentoring
---

Oitee is convinced that he can learn Computer Science basics as a part-time activity. I
decided to help him with this endeavour. Being from a non-technical background, his
knowledge of Computer Science is limited to high school HelloWorlds. It is both a huge
responsibility and honour for me to be part of his journey. My paramount goal is to ensure
the gets a _good enough_ guidance to venture into this field. The weight of being able to
show the right path is heavy, but it is worth trying.

Here's what I have in mind (it is probably going to change). I have created the following
broad headings of what I think are the most useful areas to spend time on.

1. CS fundamentals
   * Computer Architecture
   * Networking
   * Operating Systems
   * Databases
   * Basics of a compiler
2. Programming
   * Javascript basics from [FreeCodeCamp](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/#claim-cert-block)
   * Data structures
   * Algorithms
   * Problem solving (something like [Leetcode](http://leetcode.com))
   * Functional languages / OOP
3. Tooling workflows
   * Linux CLI
   * Git
   * Visual Studio Code
4. Web Development (after 1)
   * Server / Client
   * Web scale, components, technologies

I pondered a lot on which language and IDE to suggest for him to learn. Eventually I concluded
that Javascript and VS Code seem to be the most ubiquitous combination there is for web
development. [Lambda School](https://lambdaschool.com/courses/full-stack-web-development)
also seems to be favouring Javascript.

The list above is biased on what I think I am good enough to guide with. Much to the same
reason, there is no mention of machine learning or frontend technologies like CSS,
although a bit of that might be necessary.

At the end of six months from now, based on the progress, my objective is for him to be
ready for applying to coding bootcamps like [Recurse Centre](https://www.recurse.com). If
not that, then with some more work, a candidate for applying to junior engineering
positions, like I did back in 2015 -- only better than what I was back then.

In an effort to prove to myself that I could take on this long and ardous (and eventually
rewarding) journey, I hope to publish regular posts here about the progress I am making as
a guide, so stay tuned and if you're reading this, wish me luck!

repository: mourjo/blog

gha_language: HTML

repo_name: mourjo/blog


text:
---
layout: default
---

# 1993-10-19 - (fwd) Australians dump DES (from RISKS)

## Header Data

From<EMAIL_ADDRESS>(Paul Ferguson x2044)

To<EMAIL_ADDRESS>Message Hash: 08648c57a84d7bf117f7ef365c6a8f78be1147f197b134b588c06b9dd649a9e6

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-10-19 17:07:31 UTC

Raw Date: Tue, 19 Oct 93 10:07:31 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Paul Ferguson x2044)
Date: Tue, 19 Oct 93 10:07:31 PDT
To<EMAIL_ADDRESS>Subject: (fwd) Australians dump DES (from RISKS)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

Can anyone provide ant detailed information on 'Seneca'?

Forwarded message:

> From<EMAIL_ADDRESS>(Darrell Long)
> Newsgroups: sci.crypt
> Subject: Australians dump DES (from RISKS)
> Date: 19 Oct 1993 03:11:34 GMT
> Organization: University of California, Santa Cruz (CE/CIS Boards)
> Lines: 32
> Distribution: world
> Message-ID<EMAIL_ADDRESS>> NNTP-Posting-Host: sequoia.cse.ucsc.edu
>
> Date: Mon, 18 Oct 1993 17:14:08 +1000
> From<EMAIL_ADDRESS>(Kevin Burfitt)
> Subject: Australian government to replace DES
>
> Here is something I found in an Australian computer magazine, which
> sounded like something for the Risks Forum...
>
> Quoted from "PCWEEK October 20, 1993"
>
>   The Australian Government has secretly developed its own data
>   encryption firmware and algorithm, killing its dependence on the
>   US DES (Data Encryption Standard) Algorithm.
>
>   Called Seneca, the firmware element was developed as a joint project
>   of the Defence Science and Technology Organisation (DSTO) in Adelaide
>   and the Defense Signals Directorate (DSD) in Canberra.
>
>   [...]
>
>   "It is a symmetric encryption technology like DES, but can operate
>   at very high speeds" said the source. Seneca's original specifications
>   included a throughput of 2Mbps, but testing had achieved rates of
>   20Mbps.
>
> Isn't part of the security with DES its slowness, which implies that this
> new encryption method will be inherently risky because of its speed ?
>
> Kevin Burfitt
>
><EMAIL_ADDRESS>(Kevin Burfitt) Compuserve:  100240,2002
> Torps Productions: torps.apana.org.au    BBS +61-3-818-0986  FidoNet:
> 3:635/574
>

_____________________________________________________________________________
Paul Ferguson
Mindbank Consulting Group<EMAIL_ADDRESS>
Fairfax, Virginia  USA<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Paul Ferguson x2044)](/authors/ferguson_at_icm1_icp_net_paul_ferguson_x2044_)"

+ 1993-10-19 (Tue, 19 Oct 93 10:07:31 PDT) - (fwd) Australians dump DES (from RISKS) -<EMAIL_ADDRESS>(Paul Ferguson x2044)_


text:
# ESA5000_Dashboard

## ESA 5000 Protocol

Here are a few messages from the Dashboard:

Message type | Header | Lenght | Destinaiton | Type | Command | Payload              | Checksum
 ----------- | ------ | ------ | ----------- | ---- | ------- | -------------------- | -------
Standby      | 55 AA  | 07     | 25          | 60   | 05      | 04 2B 2B 00 00       | 14 FF
Full Throttle| 55 AA  | 07     | 25          | 60   | 05      | 04 C5 2B 00 00       | 79 FE
Light On     | 55 AA  | 09     | 27          | 63   | 07      | 06 2B 2B 00 00 00 04 | 04 FF

- It appears that the second and third value of the Payload are throttle and brake, ranging from 2B to C5 respectively.
- Lenght, Destination, Type and the Command seem to change when we also pass the Light On message. Perhaps the different Destination, Type and Command point to a different buffer/decoder on the controller, which is able to handle the additional payload bytes
- As for the checksum: "we take the sum all of the previous bytes together except 0x55 & 0xAA. We then preform a XOR operation with 0xFFFF. The resulting value contains ck1 & ck0, respectively."

Here are the responses from the controller:

Message Type          | Header | Lenght | Destination | Type | Command | Payload                    | Checksum
--------------------- | ------ | ------ | ----------- | ---- | ------- | -------------------------- | --------
Standby               | 55 AA  | 0B     | 28          | 6D   | 09      | 00 07 00 00 00 00 00 00 64 | EB FE
Eco                   | 55 AA  | 0B     | 28          | 6D   | 09      | 02 07 00 00 00 00 00 00 64 | AB FE
Full Throttle & Light | 55 AA  | 0B     | 28          | 6D   | 09      | 00 07 01 00 E7 03 00 00 64 | 9A FE

- The controller is only answering every 2-3 times after the dashboard has sent some data
- Eco Mode is mentioned in the first byte of the payload
- Light is mentioned in the third byte
- The current speed is indicated in the fith and sixth byte, ranging from 00 00 (0km/h) to E7 03 (20km/h)
- The current battery is indicated in the last byte in percentage, 64 equals 100%

## Differences to the M365
- No communicative BMS, the ESA has a passive BMS
- Protocoll is more or less identical to the MiniRobot system

## Things to do
- [ ] Get a dump from the purple MiniRobot Dashboard, which has bluetooth connectivity
- [ ] Make a prototype test board to poke comms


text:
# Experimentums website sources

## Development

Setup development server using:

```
npm install http-server -g
```

Go to the `src` directory and run development server:

```
http-server -c-1 --log-ip
```


text:
---
title: Nested Collections
date: 2021-04-15
slug: nested-collections
---

## What are you going to learn?

* Understand how to read and manipulate nested collections
* Perform operations on nested data collections

Before jumping into the lesson, you may want to read the [arrays](/arrays) and [hash](/hashes) content.
## Arrays in Arrays

As we move forward with software, you may find that data collections start to become a little bit more complex, whether the ones we
create or third-party.

Take this simple example, and try to answer the following:

```ruby
nested_collection = [["burguer", "pizza", "hot dog"], ["coke", "water", "beer"]]
```

* What would the method `count` on `nested_collection` return?
* How would you access the `pizza` element?
* How would you add another set of data?

## Hash in Arrays

```ruby
heroes = [{name: "Iron Man"}, {name: "Hulk"}]
```

* What would the method `count` on `heroes` return?
* How would you access the `Hulk` element?
* How would you change `"Iron Man"` to `"Black Widow"`?

## Hash with Arrays

```ruby
chinese_food_box = {
  base: ["rice", "wheat noodles", "egg noodles"],
  protein: ["fish", "shrimp", "beef", "chicken"],
  toppings: ["onion", "brocoli", "peanuts", "carrot", "potato"],
  sauce: ["teriyaki", "spicy", "cilantro", "soy sauce"]
}
```

* What would the method `count` on `chinese_food_box` return?
* How would you add a `extras` key-pair to the `chinese_food_box` collection?
* How would you access the `peanuts` element?
* How would you add another topping?

## Hash with Hash

```ruby
pokemons = {
  pikachu: { level: 32, attacks: ["thundershock", "thunder punch", "surf"] },
  charizard: { level: 54, attacks: ["dragon claw", "blast burn", "firespin"] },
  gengar: { level: 42, attacks: ["shadow claw", "sludge bomb", "shadow ball"] },
}
```

* What would the method `count` on `pokemons` return?
* How would you add an `attribute` key-pair to each pokemon element?
* How would you access the `charizard` element attacks?
* How would you add another another attack for any pokemon?

 You can find it [here](https://github.com/kurenn/ruby-exercises)

You can finde them under `/ruby-exercises/Module1/nested-collections`.

## Additional Resources

+ [Ruby Docs](https://www.ruby-doc.org/)
+ [TryRuby: Learn programming with Ruby](https://ruby.github.io/TryRuby/)
+ [Icalia Labs Internal Ruby Guides](https://github.com/IcaliaLabs/guides/tree/master/stack/ruby)

repository: ferIcalia/ruby-dojo

repo_name: ferIcalia/ruby-dojo


text:
ProjectGroetenUitNederland
==========================

Played a little roll in a nation wide Traveling photo exposition 'Nieuwe Groeten Uit Nederland' (New Greetings From The Netherlands). One of my photo's was used to illustrate the 'air castle'.

I'm an avid admirer of the Enschedese School of art's (http://goo.gl/xs1fMv). In short it's was a group of artist that made art that was send via the post. I do a lot with the concept "post" in my photograpy.

This was an exposition organized by the FOAM (http://www.foam.org), ANP (http://www.anp.nl/about-us/) and the Nationaal Historisch Museum (NHM) (The National Historical Museum, I know it's unbelievable, but it doesn't exist anymore in the Netherlands).

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/1.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/2.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/3.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/4.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/5.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/6.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/7.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/8.jpg)

![alt tag](https://github.com/DeRaafMedia/ProjectNieuweGroetenUit/blob/master/9.jpg)

repository: DeRaafMedia/ProjectNieuweGroetenUit

repo_name: DeRaafMedia/ProjectNieuweGroetenUit


text:
# How to submit conformance results

## The tests

The standard set of conformance tests is currently those defined by the
`[Conformance]` tag in the
[kubernetes e2e](https://github.com/kubernetes/kubernetes/tree/master/test/e2e)
suite.

## Running

The standard tool for running these tests is
[Sonobuoy](https://github.com/vmware-tanzu/sonobuoy).  Sonobuoy is
regularly built and kept up to date to execute against all
currently supported versions of kubernetes.

Download a [binary release](https://github.com/vmware-tanzu/sonobuoy/releases) of the CLI, or build it yourself by running:

```
go get -u -v github.com/vmware-tanzu/sonobuoy
```

Deploy a Sonobuoy pod to your cluster with:

```
sonobuoy run --mode=certified-conformance
```

**NOTES:**
 - The `--mode=certified-conformance` flag is required for certification runs since Kubernetes v1.16 (and Sonobuoy v0.16). Without this flag, tests which may be disruptive to your other workloads may be skipped. A valid certification run may not skip any conformance tests. If you're setting the test focus/skip values manually, certification runs require `E2E_FOCUS=\[Conformance\]` and no value for `E2E_SKIP`.

 - You can run the command synchronously by adding the flag `--wait` but be aware that running the conformance tests can take an hour or more.

 - There was an issue with versions v0.53.0 and v0.53.1. Details can be found in the Sonobuoy [docs](https://sonobuoy.io/docs/v0.53.1/issue1388/) on how to avoid or work around the issue.

View actively running pods:

```
sonobuoy status
```

To inspect the logs:

```
sonobuoy logs
```

Once `sonobuoy status` shows the run as `completed`, copy the output directory from the main Sonobuoy pod to a local directory:

```
outfile=$(sonobuoy retrieve)
```

This copies a single `.tar.gz` snapshot from the Sonobuoy pod into your local
`.` directory. Extract the contents into `./results` with:

```
mkdir ./results; tar xzf $outfile -C ./results
```

**NOTE:** The two files required for submission are located in the tarball under **plugins/e2e/results/global/{e2e.log,junit_01.xml}**.

To clean up Kubernetes objects created by Sonobuoy, run:

```
sonobuoy delete
```

## Uploading

Prepare a PR to
[https://github.com/cncf/k8s-conformance](https://github.com/cncf/k8s-conformance).
Here are [directions](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork) to
prepare a pull request from a fork.
In the descriptions below, `X.Y` refers to the kubernetes major and minor
version, and `$dir` is a short subdirectory name to hold the results for your
product.  Examples would be `gke` or `openshift`.

Description: `Conformance results for vX.Y/$dir`

### Contents of the PR

For simplicity you can submit the tarball or extract the relevant information from the tarball to compose your submission.

If submitting test results for multiple versions, submit a PR for each product, ie. one PR for vX.Y results and a second PR for vX.Z

```
vX.Y/$dir/README.md: A script or human-readable description of how to reproduce
your results.
vX.Y/$dir/sonobuoy.tar.gz: Raw output from sonobuoy. (optional)
vX.Y/$dir/e2e.log: Test log output (from Sonobuoy).
vX.Y/$dir/junit_01.xml: Machine-readable test log (from Sonobuoy).
vX.Y/$dir/PRODUCT.yaml: See below.
```

#### PRODUCT.yaml

This file describes your product. It is YAML formatted with the following root-level fields. Please fill in as appropriate.

| Field                   | Description                                                                                |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `vendor`                | Name of the legal entity that is certifying. This entity must have a signed participation form on file with the CNCF                                                                                |
| `name`                  | Name of the product being certified.                                                                                |
| `version`               | The version of the product being certified (not the version of Kubernetes it runs).                                                                                |
| `website_url`           | URL to the product information website                                                                                |
| `repo_url`              | If your product is open source, this field is necessary to point to the primary GitHub repo containing the source. It's OK if this is a mirror. OPTIONAL                                                                                |
| `documentation_url`     | URL to the product documentation                                                                                |
| `product_logo_url`      | URL to the product's logo, (must be in SVG, AI or EPS format -- not a PNG -- and include the product name). OPTIONAL. If not supplied, we'll use your company logo. Please see logo [guidelines](https://github.com/cncf/landscape#logos) |
| `type`                  | Is your product a distribution, hosted platform, or installer (see [definitions](https://github.com/cncf/k8s-conformance/blob/master/faq.md#what-is-a-distribution-and-what-is-a-platform))                                               |
| `description`           | One sentence description of your offering                                                                                |
| `contact_email_address` | An email address which can be used to contact maintainers regarding the product submitted and updates to the submission process                                                                                |

Examples below are for a fictional Kubernetes implementation called _Turbo
Encabulator_ produced by a company named _Yoyodyne_.

```yaml
vendor: Yoyodyne
name: Turbo Encabulator
version: v1.7.4
website_url: https://yoyo.dyne/turbo-encabulator
repo_url: https://github.com/yoyo.dyne/turbo-encabulator
documentation_url: https://yoyo.dyne/turbo-encabulator/docs
product_logo_url: https://yoyo.dyne/assets/turbo-encabulator.svg
type: distribution
description: "The Yoyodyne Turbo Encabulator is a superb Kubernetes distribution for all of your Encabulating needs."
contact_email_address<EMAIL_ADDRESS>```

### Requirements

| No. | Scenario                                                                         | Updated Fail message                                                                                | Fail           | Pass                                                                                | Comments                                                                                |
|-----|----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| 1   | PR title is not empty                                                            | it seems that there is no title set                                                                                | not-verifiable |                                                                                | No further explanation needed                                                                                |
| 2   | submission contains all required files                                           | there seems to be some required files missing (https://github.com/cncf/k8s-conformance/blob/master/instructions.md#contents-of-the-pr)                                                                                | not-verifiable |                                                                                | All the necessary files for the submission are present                                                                             |
| 3   | submission has files in structure of releaseversion/productname/                 | the submission file directory does not seem to match the Kubernetes release version in the files                                                                                | not-verifiable |                                                                                | Files are submitted to a unique directory for the specific product under a Kubernetes release version                              |
| 4   | submission is only one product                                                   | the submission seems to contain files of multiple Kubernetes release versions or products. Each Kubernetes release version and products should be submitted in a separate PRs                                                                     | not-verifiable |                                                                                | No further explanation needed                                                                                |
| 5   | submission release version in title matches release version in folder structure  | the title of the submission does not seem to contain a Kubernetes release version that matches the release version in the submitted files                                                                                | not-verifiable |                                                                                | The Kubernetes release version in the title of the PR should match the release version file directory to which the PR is submitted |
| 6   | the PRODUCT.yaml metadata contains all required fields                           | it appears that the PRODUCT.yaml file does not contain all the required fields (https://github.com/cncf/k8s-conformance/blob/master/instructions.md#productyaml)                                                                                | not-verifiable |                                                                                | The PRODUCT.yaml contain all required fields                                                                                |
| 7   | the URL and email fields in the PRODUCT.yaml are valid                           | it appears that fields(s) in the PRODUCT.yaml aren't correctly formatted                                                                                | not-verifiable |                                                                                | One or more URL keys in the PRODUCT.yaml are not valid formatted URLs                                                              |
| 8   | the URL fields in the PRODUCT.yaml resolve to their specified data types         | URL field 'FIELD' in PRODUCT.yaml resolving content type 'CONTENT_TYPE' must be (REQUIRED_CONTENT_TYPE)", field (https://github.com/cncf/k8s-conformance/blob/master/instructions.md#productyaml)                                                 | not-verifiable |                                                                                | The URLs are resolving to the correct content                                                                                |
| 9   | title of product submission contains Kubernetes release version and product name | the submission title is missing either a Kubernetes release version (v1.xx) or product name                                                                                | not-verifiable |                                                                                | Checking the PR title format                                                                                |
| 10  | the submission release version is a supported version of Kubernetes              | the Kubenetes release version in this pull request does not qualify for conformance submission anymore (https://github.com/cncf/k8s-conformance/blob/master/terms-conditions/Certified_Kubernetes_Terms.md#qualifying-offerings-and-self-testing) | not-verifiable |                                                                                | Only the curre[nt release version and two version prior is supported for conformance certification                                 |
| 11  | all required conformance tests in the junit_01.xml are present                   | it appears that some tests are missing from the product submission                                                                                | not-verifiable | tests-verified-+KubernetesReleaseVersion                                                       |                                                                                |
| 12  | all tests pass in e2e.log                                                        | it appears that some tests failed in the product submission                                                                                | not-verifiable | no-failed-tests-+KubernetesReleaseVersion                                                      |                                                                                |
| 13  | there is only one commit                                                         | it appears that there is not exactly one commit. Please rebase and squash with `git rebase -i HEAD` (https://git-scm.com/docs/git-rebase)                                                                                | not-verifiable |                                                                                | squash your commits and rebase                                                                                |
|     |                                                                                |                                                                                |                |                                                                                |                                                                                |
|     | All requirements ($NUMBER) have passed for the submission!                       |                                                                                | not-verifiable | - release-+KubernetesReleaseVersion, release-documents-checked, conformance-product-submission | The step will add the release+version & release-documents-checked labels once all $NUMBER check have passed                        |

## Amendment for Private Review

If you need a private review for an unreleased product, please email a zip file containing what you would otherwise submit
as a pull request to<EMAIL_ADDRESS>We'll review and confirm that you are ready to be Certified Kubernetes
as soon as you open the pull request. We can then often arrange to accept your pull request soon after you make it, at which point you become Certified Kubernetes.

## Review

A reviewer will shortly comment on and/or accept your pull request, following this [process](reviewing.md).
If you don't see a response within 3 business days, please contact<EMAIL_ADDRESS>
## Example Script

Combining the steps provided here, the process looks like this:

```
$ k8s_version=vX.Y
$ prod_name=example

$ go get -u -v github.com/vmware-tanzu/sonobuoy

$ sonobuoy run --mode=certified-conformance --wait
$ outfile=$(sonobuoy retrieve)
$ mkdir ./results; tar xzf $outfile -C ./results

$ mkdir -p ./${k8s_version}/${prod_name}
$ cp ./results/plugins/e2e/results/global/* ./${k8s_version}/${prod_name}/

$ cat << EOF > ./${k8s_version}/${prod_name}/PRODUCT.yaml
vendor: Yoyodyne
name: Turbo Encabulator
version: v1.7.4
website_url: https://yoyo.dyne/turbo-encabulator
repo_url: https://github.com/yoyo.dyne/turbo-encabulator
documentation_url: https://yoyo.dyne/turbo-encabulator/docs
product_logo_url: https://yoyo.dyne/assets/turbo-encabulator.svg
type: distribution
description: 'The Yoyodyne Turbo Encabulator is a superb Kubernetes distribution for all of your Encabulating needs.'
EOF
```

## Issues

If you have problems certifying that you feel are an issue with the conformance
program itself (and not just your own implementation), you can file an issue in
the [repository](https://github.com/cncf/k8s-conformance). Questions and
comments can also be sent to the working group's
[mailing list and slack channel](README-WG.md).
[SIG Architecture](https://github.com/kubernetes/community/tree/master/sig-architecture)
is the change controller of the conformance definition. We track a
[list of issue resolutions](https://github.com/cncf/k8s-conformance/issues/27) with SIG Architecture.


text:
## 源码

```
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public protocol PreviewProvider : _PreviewProvider {

    /// The type of the previews variable.
    associatedtype Previews : View

    /// Generates a collection of previews.
    ///
    /// Example:
    ///
    ///     struct MyPreviews : PreviewProvider {
    ///         static var previews: some View {
    ///             return Group {
    ///                 GreetingView("Hello"),
    ///                 GreetingView("Guten Tag"),
    ///
    ///                 ForEach(otherGreetings, id: \.self) {
    ///                     GreetingView($0)
    ///                 }
    ///             }
    ///             .previewDevice("iPhone X")
    ///         }
    ///     }
    static var previews: Self.Previews { get }

    /// Returns which platform to run the provider on.
    ///
    /// When `nil`, Xcode infers the platform based on the file the
    /// `PreviewProvider` is defined in. This should only be provided when the
    /// file is in targets that support multiple platforms.
    static var platform: PreviewPlatform? { get }
}
```

还有有多扩展属性和方法!!

## 概述

A type that produces view previews in Xcode.

Xcode statically discovers types that conform to the `PreviewProvider` protocol in your app, and generates previews for each provider it discovers.

* `static var previews: Self.Previews { get }`
* `static var platform: PreviewPlatform? { get }`

---

## PreviewPlatform

```
/// OS platform for running a preview on.
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public enum PreviewPlatform {

    case iOS

    case macOS

    case tvOS

    case watchOS

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: PreviewPlatform, b: PreviewPlatform) -> Bool

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    public var hashValue: Int { get }

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: Never call `finalize()` on `hasher`. Doing so may become a
    ///   compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)
}
```

repository: huandev/books

repo_name: huandev/books