text:
---
id: types
title: Types overview
---

    egghead.io lesson 11: More mobx-state-tree Types: map, literal, union, and enumeration

    Hosted on egghead.io

    egghead.io lesson 17: Create Dynamic Types and use Type Composition to Extract Common Functionality

    Hosted on egghead.io

These are the types available in MST. All types can be found in the `types` namespace, e.g. `types.string`.

## Complex types

-   [`types.model(properties, actions)`](/API/#model) Defines a "class like" type with properties and actions to operate on the object.
-   [`types.array(type)`](/API/#array) Declares an array of the specified type.
-   [`types.map(type)`](/API/#map) Declares a map of the specified type.

Note that since MST v3 `types.array` and `types.map` are wrapped in `types.optional` by default, with `[]` and `{}` set as their default values, respectively.

## Primitive types

-   [`types.string`](/API/#const-string)
-   [`types.number`](/API/#const-number)
-   [`types.integer`](/API/#const-integer)
-   [`types.float`](/API/#const-float)
-   [`types.finite`](/API/#const-finite)
-   [`types.boolean`](/API/#const-boolean)
-   [`types.Date`](/API/#const-dateprimitive)
-   [`types.custom`](/API/#custom) creates a custom primitive type. This is useful to define your own types that map a serialized form one-to-one to an immutable object like a Decimal or Date.

## Utility types

-   [`types.union(options?: { dispatcher?: (snapshot) => Type, eager?: boolean }, types...)`](/API/#union) create a union of multiple types. If the correct type cannot be inferred unambiguously from a snapshot, provide a dispatcher function to determine the type. When `eager` flag is set to `true` (default) - the first matching type will be used, if set to `false` the type check will pass only if exactly 1 type matches.
-   [`types.optional(type, defaultValue, optionalValues?)`](/API/#optional) marks a value as being optional (in e.g. a model). If a value is not provided/`undefined` (or set to any of the primitive values passed as an optional `optionalValues` array) the `defaultValue` will be used instead. If `defaultValue` is a function, it will be evaluated. This can be used to generate, for example, IDs or timestamps upon creation.
-   [`types.literal(value)`](/API/#literal) can be used to create a literal type, where the only possible value is specifically that value. This is very powerful in combination with `union`s. E.g. `temperature: types.union(types.literal("hot"), types.literal("cold"))`.
-   [`types.enumeration(name?, options: string[])`](/API/#enumeration) creates an enumeration. This method is a shorthand for a union of string literals. If you are using typescript and want to create a type based on an string enum (e.g. `enum Color { ... }`) then use `types.enumeration<Color>("Color", Object.values(Color))`, where the `"Color"` name argument is optional.
-   [`types.refinement(name?, baseType, (snapshot) => boolean)`](/API/#refinement) creates a type that is more specific than the base type, e.g. `types.refinement(types.string, value => value.length > 5)` to create a type of strings that can only be longer than 5.
-   [`types.maybe(type)`](/API/#maybe) makes a type optional and nullable. The value `undefined` will be used to represent nullability. Shorthand for `types.optional(types.union(type, types.literal(undefined)), undefined)`.
-   [`types.maybeNull(type)`](/API/#maybenull) like `maybe`, but uses `null` to represent the absence of a value.
-   [`types.null`](/API/#const-nulltype) the type of `null`.
-   [`types.undefined`](/API/#const-undefinedtype) the type of `undefined`.
-   [`types.late(() => type)`](/API/#late) can be used to create recursive or circular types, or types that are spread over files in such a way that circular dependencies between files would be an issue otherwise.
-   [`types.frozen(subType? | defaultValue?)`](/API/#frozen) Accepts any kind of serializable value (both primitive and complex), but assumes that the value itself is **immutable** and **serializable**.
    `frozen` can be invoked in a few different ways:
    -   `types.frozen()` - behaves the same as types.frozen in MST 2.
    -   `types.frozen(subType)` - provide a valid MST type and frozen will check if the provided data conforms the snapshot for that type. Note that the type will not actually be instantiated, so it can only be used to check the shape of the data. Adding views or actions to SubType would be pointless.
    -   `types.frozen(someDefaultValue)` - provide a primitive value, object or array, and MST will infer the type from that object, and also make it the default value for the field
    -   (Typescript) `types.frozen<TypeScriptType>(...)` - provide a typescript type, to help in strongly typing the field (design time only)
-   [`types.compose(name?, type1...typeX)`](/API/#compose), creates a new model type by taking a bunch of existing types and combining them into a new one.
-   [`types.reference(targetType)`](/API/#reference) creates a property that is a reference to another item of the given `targetType` somewhere in the same tree. See [references](/concepts/references#references) for more details.
-   [`types.safeReference(targetType)`](/API/#safereference) is like a standard reference, except that it accepts the undefined value by default and automatically sets itself to undefined (when the parent is a model) / removes itself from arrays and maps when the reference it is pointing to gets detached/destroyed. See [references](/concepts/references#references) for more details.
-   [`types.snapshotProcessor(type, processors, name?)`](/API/#snapshotprocessor) runs a pre snapshot / post snapshot processor before/after serializing a given type. Example:
    ```ts
    const Todo1 = types.model({ text: types.string })
    // in the backend the text type must be null when empty
    interface BackendTodo {
        text: string | null
    }
    const Todo2 = types.snapshotProcessor(Todo1, {
        // from snapshot to instance
        preProcessor(sn: BackendTodo) {
            return {
                text: sn.text || "";
            }
        },
        // from instance to snapshot
        postProcessor(sn): BackendTodo {
            return {
                text: !sn.text ? null : sn.text
            }
        }
    })
    ```

## Property types

Property types can only be used as a direct member of a `types.model` type and not further composed (for now).

-   [`types.identifier`](/API/#const-identifier) Only one such member can exist in a `types.model` and should uniquely identify the object. See [identifiers](/concepts/references#identifiers) for more details.
-   [`types.identifierNumber`](/API/#const-identifiernumber) Similar to `types.identifier`. However, during serialization, the identifier value will be parsed from / serialized to a number.

repository: mobxjs/mobx-state-tree

repo_name: mobxjs/mobx-state-tree


text:
# Localizable Controls Kit #

## CONTRIBUTION ##

### How do I get set up? ###

##### Bundler  #####

* clone repo
* install Xcode Command line Tools
* install latest ruby version
* install bundler `[sudo] gem install bundler`
* install gems `bundle` (within project folder)

### How do I use Bundler ###

Instead of using local versions of Cocoapods use:

* `bundle exec pod install`

### How do I open the project ###

* `open LocalizableControlsKit.xcworkspace`

### Who do I talk to? ###

* iOS Engineer

license: MIT

repository: palozinski/LocalizableControlsKit

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: palozinski/LocalizableControlsKit


text:
### 1.0.7

 - adds a `radioClass` property to put any classes you want on the input element
 - adds a `radioId` property to specify an id for the input element, allows
   associating non-wrapping label elements

### 1.0.6

 - Use `hasBlock` internally and remove deprecation warnings from
   accessing the component's `template` property

### 1.0.5

 - Improve IE8 Support

### 1.0.4

 - Fix putting additional classNames on the label

### 1.0.3

 - Put additional classNames on the label

### 1.0.2

 - Add `ember-radio-button` class to the label when used as a block

### 1.0.1

 - Put a `checked` classname on the label element when a block form
   radio-button is checked

### 1.0.0

 - Update to htmlbars
 - Rely on the `change` event, not `click`
 - Only `label` and `input` elements emitted, no more `span`

### 0.1.3

 - Add `required` and `name` bound attributes

### 0.1.2

 - Add `disabled` bound attribute

repository: tunespeak/ember-radio-button

repo_name: tunespeak/ember-radio-button


text:
I have implemented the resizeRegion() function and next-fit and best-fit allocators by extending the source code provided by Dr. Freudenthal. My allocators and test cases can be accessed in the `myAllocator` directory.

The improved resizeRegion() function and next-fit and best-fit allocators are defined inside `myAllocator.c` file. I have also modified `myAllocator.h` header file to implement next-fit allocator and to implement the test cases for resizeRegion() funtion, next-fit allocator and best-fit allocator.

To compile:
```
$ make
````
To clean:
```
$ make clean
```

The test programs for resizeRegion() allocates three regions first, then free the region in the middle using freeRegion() and resize the first region with the deallocated region next to it.
To run the test cases for resizeRegion use :
```
 $ ./myAllocatorTestResize
 $ ./testResize
```
The test programs for next-fit allocator allocates three regions, deallocates the middle region by changing prefix->allocate to 0, sets the last allocated prefix to the middle region, and then allocates another region in the newly allocated region.
To run the test cases for next-fit allocator use :
```
 $ ./myAllocatorTestNF
 $ ./testNF
```
The test programs for best-fit allocator allocates seven regions, then deallocates three "even numbered" regions, then requests to allocate memory such that the best-fit would be the second even numbered region.
To run the test cases for best-fit allocator use :
```
 $ ./myAllocatorTestBF
 $ ./testBF
```


text:
---
layout: single
title:  "Build Your Own: Gel Illumination and Imaging Chamber"
excerpt: "A DIY alternative to commercial gel imaging solutions to reduce exposure to hazardous materials and reduce upfront equipment costs."
category: build
tags: [build, imaging, hardware]
comments: true

toc: true
toc_sticky: true

classes:
 # - text-justify

box:
  - image_path: /assets/images/posts/170702_GelBox_Xray.png
    title: "Gel box X-ray view."
    url: "/assets/images/posts/170702_GelBox_Xray.png"
  - image_path: /assets/images/posts/170702_GelChamber.jpg
    title: "Gel box prototype."
    url: "/assets/images/posts/170702_GelChamber.jpg"

gels:
  - image_path: /assets/images/posts/170702_SampleGel1.jpg
    title: "Zoomed gel view. (Compressed image)"
    url: "/assets/images/posts/170702_SampleGel1.jpg"
  - image_path: /assets/images/posts/170702_SampleGel2.jpg
    title: "Large field-of-view. (Compressed Image)"
    url: "/assets/images/posts/170702_SampleGel2.jpg"
---

**PURPOSE:**
<br>
Provide a DIY alternative to expensive commercial gel imaging solutions. Benefits include exposing operators to fewer hazardous materials, reducing equipment cost and possibly improving image quality. It was initially designed for the Fordyce lab at Stanford in Dec 2014 and was further modified in July 2017 to improve the design of the door.
{: .notice--info}

## Introduction

Traditional DNA gel staining and imaging often includes staining the DNA with ethidium bromide followed by imaging the gel with a UV light source. This is worrisome for a few people who frequently handle these materials due to the known mutagenic activity of the materials and these people are often looking to minimize their exposure when possible. As a result, some labs have transitioned over to using less hazardous stains, such as the Sybr series, and light sources, such as blue LED transilluminators. Here, I provide schematics and a list of parts for constructing a gel imaging station. Feel free to modify the design files to fit your own needs and preferences.

## Gel Chamber

{% include gallery id="box" caption="Gel box design." %}

The imaging chamber itself is assembled with 0.5" acrylic panels held together internally by brackets and is designed to mount a low end Canon DSLR above a Clare Chemical DR89 blue LED transilluminator. The Canon DSLR was chosen due to its ability to be externally viewed and triggered by either either a workbench computer or the operator's laptop. The transilluminator does not necessarily need to be from Clare Chemical, but the system was initially chosen due to its large 25 x 22 cm viewing surface and decent quality. The port on the right panel was designed to be compatible with the power cord for this transilluminator. You can modify this as needed.

The acrylic box has W x L x H dimensions of 14" x 14" x 15.5" without the camera attached. The width and length was chosen to be compatible with the previously identified transilluminator and the height was chosen to provide a large enough field-of-view for the camera. AutoCAD drawings can be downloaded in the [Parts List and Files](#PartsList) section below. STL files may be uploaded at a later date or upon request.

**UPDATE:** The design was updated on 20170702 to improve the door design. Previously, the door had trouble closing due to contact with the workbench and contact with the rightmost threshold. To account for these issues, the top and bottom of the door was trimmed by 2mm and the right edge was trimmed by 3mm. The right edge also received a 45° chamfer.
{: .notice--primary}

Acrylic panels were machined by Kyle Brutschy at [SF Machine Works](http://www.sfmachineworks.com/) with the following specifications:

| Panel | Face  | Quantity | Diameter | Depth | Tapped |
|-------|-------|----------|----------|-------|--------|
| Back  | Inner |   4      |  0.1360"  | 0.25" | 8-32   |
|       |       |   4      |  0.1066" | 0.25" | 6-32   |
| Left  | Inner |   4      |  0.1360"  | 0.25" | 8-32   |
|       |       |   4      |  0.1066" | 0.25" | 6-32   |
| Top   | Inner |   8      |  0.1360"  | 0.25" | 8-32   |
|       | Through |   2      |  0.2010" | Thru | 1/4-20 |
| Right | Inner |   4      |  0.1360"  | 0.25" | 8-32   |
|       |       |   4      |  0.1066" | 0.25" | 6-32   |
|       | Through | 1      | 0.3900"   | Thru  |        |
| Front | Inner |   4      |  0.1360"  | 0.25" | 8-32   |
|       |       |   4      |  0.1066" | 0.25" | 6-32   |
|       | Outer |   4      |  0.1360"  | 0.25" | 8-32   |
| Door  | Outer |   4      |  0.1360"  | 0.25" | 8-32   |
|       | Through |   1      |  0.1770" | Thru |       |

## Gel Imaging

To image the gel, a high pass filter is necessary to block out the blue light. Clare Chemical provides orange filtered glasses and a panel to lay over your gel to view results. This is good for quick viewing, but not necessarily sufficient for imaging. The camera was ultimately outfitted with 58mm Tiffen filters that attach to the lens like most polarized filters so that the gel can be placed onto the transilluminator and imaged quickly with good quality.

To image, Canon has free remote imaging software known as [EOS Utility](https://www.usa.canon.com/internet/portal/us/home/support/self-help-center/eos-utility), which makes viewing, capturing and saving gel images incredibly easy. After the focus has been set and once the software is installed on an imaging workstation or laptop, color correction, exposure and aperture settings can be programmatically adjusted in realtime. It's as easy as clicking the virtual shutter release button to transfer the image to the computer. Its not necessary to use a Canon here, but it was chosen because its software is known to be easy to use for external triggering.

Benefits for using a DSLR include:
* Instant transfer to operator's laptop.
* The 12+ megapixel camera often has a higher resolution than most commercial gel imaging stations.
* The zoom lens can be adjusted for close up images of gel bands or left zoomed out to capture large field-of-view images with an exposure of approximately one second.

{% include gallery id="gels" caption="The gel box allows for small or large field of views" style="text-align: center;" %}

## Parts List and Files

Besides the machined acrylic panels and the [Clare Chemical DR89 Transilluminator](http://www.clarechemical.com/transilluminator.htm) , all of the parts were either acquired from [McMaster-Carr](https://www.mcmaster.com/) or Amazon. For acrylic panels, check with your local machinist or plastics store such as [TAP Plastics](https://www.tapplastics.com/about/locations). For blue LED transilluminators, feel free to use any that can fit within a 13" x 13" space and meet your budget needs.

### Chamber CAD Files

[Download AutoCAD drawings here!](/assets/CAD/170702_GelChamber-Packaged.zip)

### McMaster-Carr Parts

| Name | Part Number | Quantity | Description | Link |
|------|-------------|----------|-------------|------|
| Camera Brace | 15275A66 | 1 | Bracket Galvanized Steel, 1-7/8" & 3-1/2" Length of Sides | [View on McMaster](https://www.mcmaster.com/#15275a66/=18ezdou) |
| Corner Bracket | 1088A31 | 4 | Inside Corner-Reinforcing Bracket, 2" Length of Sides | [View on McMaster](https://www.mcmaster.com/#1088a31/=18eze30) |
| Edge Braces | 1556A41 | 8 | Bracket Galvanized Steel, 1" Length of Sides | [View on McMaster](https://www.mcmaster.com/#1556a41/=18ezee2) |
| Adjustable Friction Hinge | 1791A44 | 2 | Adjustable-Friction Hinge, 200 lb. Capacity, 1-11/16" High Leaf, 1-7/16" Width, Black | [View on McMaster](https://www.mcmaster.com/#1791a44/=18ezemo) |
| Cabinet Door Knob | 11645A11 | 1 | ABS Plastic Pull Knob Black Finish, 1-5/16" Knob Diameter, 1" Projection | [View on McMaster](https://www.mcmaster.com/#11645a11/=18ezex7) |

I don't remember if the door knob fit well on this because it originally came with a 1" wood screw, but it could be usable. It might be worth looking for an alternative knob or screw. Also, things not listed here include:
* A few short 1/4-20 screws to mount the camera to the bracket and the bracket to the top panel.
* 8-32 with 0.25" or shorter depth for corner brackets and door hinges.
* 6-32 with 0.25" or shorter depth for edge braces.
* Black electrical tape to block light from the gap between the panels. The panels we received were slightly smaller than 0.5" (around 0.47").

### Amazon Parts

| Part | Approx $ | Description | Link |
|------|----------|-------------|------|
| Camera | $403   | Canon EOS Rebel T3i Digital SLR Camera with EF-S 18-55mm f/3.5-5.6 IS Lens (discontinued by manufacturer) | [View on Amazon](http://amzn.to/2tVST2y) |
| Filter 1 | $18 | Tiffen 58mm 12 Filter (Yellow) | [View on Amazon](http://amzn.to/2tYXbpE) |
| Filter 2 | $31 | Tiffen 58mm 21 Filter (Orange) | [View on Amazon](http://amzn.to/2tVStJw) |
| AC Adapter (replaces camera battery) | $19 | Kapaxen ACK-E8 AC Power Adapter Supply Kit For Canon EOS Rebel T5i / T4i / T3i / T2i / 700D / ... | [View on Amazon](http://amzn.to/2sCgx0m) |
| Alternative Transilluminator (Not Tested) | $869 | Huanyu Instrument DUT-48 Blue Light Transilluminator wavelength 470nm | [View on Amazon](http://amzn.to/2tZ4Wfn) |

Filter 1 and Filter 2 will stack onto each other and mount to the camera lens. The order for stacking isn't important.

The Amazon links above were provided by the Amazon Services LLC Associates Program, which is an affiliate advertising program that gives this website an opportunity to earn some money while connecting you to products that have been or can be used for completing the project you are viewing. Any money earned will be used for covering costs associated with registering this website or the costs of the projects posted here.

extension: markdown

gha_language: HTML


text:
# utility_cone
This is the first script created with [my library](https://forum.cfx.re/t/library-utility/3695479)

[Showcase](https://streamable.com/bj074q)

Dependencies:
* [Utility](https://forum.cfx.re/t/library-utility/3695479)

branch_name: refs/heads/main


text:
# **Behavioral Cloning**

---

**Behavioral Cloning Project**

The goals / steps of this project are the following:
* Use the simulator to collect data of good driving behavior
* Build, a convolution neural network in Keras that predicts steering angles from images
* Train and validate the model with a training and validation set
* Test that the model successfully drives around track one without leaving the road
* Summarize the results with a written report

[//]: # "Image References"

[tensorboard]: ./examples/tensorboard.png "Model Visualization"
[center_lane]: ./examples/center_lane.jpg "Center Lane"
[before_recover]: ./examples/before_recover.jpg "Recovery Image (before)"
[in_recover]: ./examples/in_recover.jpg "Recovery Image (in)"
[after_recover]: ./examples/after_recover.jpg "Recovery Image (after)"
[spot]: ./examples/spot.png "Spot"
## Rubric Points
### Here I will consider the [rubric points](https://review.udacity.com/#!/rubrics/432/view) individually and describe how I addressed each point in my implementation.

---
### Files Submitted & Code Quality

#### 1. Submission includes all required files and can be used to run the simulator in autonomous mode

My project includes the following files:
* model.py containing the script to create and train the model
* drive.py for driving the car in autonomous mode
* model.h5 containing a trained convolution neural network
* writeup_report.md or writeup_report.pdf summarizing the results

#### 2. Submission includes functional code
Using the Udacity provided simulator and my drive.py file, the car can be driven autonomously around the track by executing
```sh
python drive.py model.h5
```

#### 3. Submission code is usable and readable

The model.py file contains the code for training and saving the convolution neural network. The file shows the pipeline I used for training and validating the model, and it contains comments to explain how the code works.

### Model Architecture and Training Strategy

#### 1. An appropriate model architecture has been employed

My model is listed as follows, which mainly contains three convolutional layers and  three dense layers. The model is adapted from the Nvidia's model in [End to End Learning for Self-Driving Cars](https://arxiv.org/abs/1604.07316). The total number of parameters is 79,371.

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

Layer (type)							Output Shape					Param #

--------

cropping2d_1 (Cropping2D)			(None, 113, 320, 3)				0

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

lambda_1 (Lambda)					(None, 113, 320, 3)				0
_________________________________________________________________
conv2d_1 (Conv2D) 					(None, 28, 79, 16)					1216
_________________________________________________________________
batch_normalization_1				(Batch (None, 28, 79, 16)			64
_________________________________________________________________
conv2d_2 (Conv2D)					(None, 6, 19, 32)					12832
_________________________________________________________________
batch_normalization_2				(Batch (None, 6, 19, 32)			128
_________________________________________________________________
conv2d_3 (Conv2D)					(None, 1, 4, 64)					51264
_________________________________________________________________
batch_normalization_3				(Batch (None, 1, 4, 64)				256
_________________________________________________________________
flatten_1 (Flatten)						(None, 256)						0
_________________________________________________________________
dense_1 (Dense)						(None, 50)						12850
_________________________________________________________________
batch_normalization_4				(Batch (None, 50)					200
_________________________________________________________________
dense_2 (Dense)						(None, 10)						510

------

batch_normalization_5				(Batch (None, 10)					40

-----

dropout_1 (Dropout)					(None, 10)						0

-------

dense_3 (Dense)						(None, 1)						11

---

Total params: 79,371
Trainable params: 79,027
Non-trainable params: 344

-----

#### 2. Attempts to reduce overfitting in the model

To accelerate the training process, I introduced Batch Normalization layers (code line 97, 103, 109, 120, and 124), which also helped reduce overfitting. Besides, I also tried using Batch Normalization and Dropout (code line 125) together, which reduced overfitting further.

The model was trained and validated on different data sets to ensure that the model was not overfitting (code line 54). The model was tested by running it through the simulator and ensuring that the vehicle could stay on the track, as can be seen in track1.mp4 (track 1) and track2.mp4 (track 2).

#### 3. Model parameter tuning

The model used an adam optimizer, so the learning rate was not tuned manually (model.py line 129).

#### 4. Appropriate training data

Training data was chosen to keep the vehicle driving on the road. I used a combination of center lane driving, recovering from the left and right sides of the road.

For details about how I created the training data, see the next section.

### Model Architecture and Training Strategy

#### 1. Solution Design Approach

The overall strategy for deriving a model architecture was to draw intuitions from some existing successful models and adapt them to fit my requirement.

My first step was to use a convolution neural network model similar to the Nvidia's model in "End to End Learning for Self-Driving Cars". I thought this model might be appropriate because hierarchical convolutional layers can draw useful information directly and easily from raw images, and the Nvidia's model has been proven to fit the autonomous driving scenarios.

In order to gauge how well the model was working, I split my image and steering angle data into a training and validation set. I found that my first model had a low mean squared error on the training set but a high mean squared error on the validation set. This implied that the model was overfitting.

To combat the overfitting, I modified the model. Considering the additional need of accelerating the training process, I first deployed Batch Normalization layers. Batch Normalization can also help reduce overfitting. Then I tried several ways to combine Dropout with Batch Normalization. But it performed not as good as expected. This phenomenon may result from variance shift, as indicated in [Understanding the Disharmony between Dropout and Batch Normalization by Variance Shift](https://arxiv.org/abs/1801.05134).

The final step was to run the simulator to see how well the car was driving around track one and two. There were a few spots where the vehicle fell off the track. To improve the driving behavior in these cases, I checked the raw data and decided to gather my own dataset. For details about how I created the training data, see Section "Creation of the Training Set & Training Process".

At the end of the process, the vehicle is able to drive autonomously around the track without leaving the road.

#### 2. Final Model Architecture

The final model architecture is given above.

Here is a visualization of the architecture in Tensorboard.

![alt text][tensorboard]

#### 3. Creation of the Training Set & Training Process

To capture good driving behavior, I first recorded two laps on track one using center lane driving. Here is an example image of center lane driving:

![alt text][center_lane]

Due to errors and disturbance, the car cannot keep exactly at the center of the lane even if the network has been trained pretty well. It can hardly recover  when the car is disturbed from the center. This is because it has never seen such images in training data. Therefore, recovery data should be added into the training data. One way is using left and right cameras with the steering angle corrected. Another way is gathering more data of recovering from the left and right sides. I tried both of the ways.

These images show what a recovery looks like:

![alt text][before_recover]
![alt text][in_recover]
![alt text][after_recover]

Then I repeated this process on track two in order to get more data points.

When testing the trained model in track two, I also found an interesting spot. At this spot, the network mis-recognized the previous lower road as the expansion of current road and produce a steering angle near zero. Thus, I gathered more recovery data at this spot.

![spot][spot]

After the collection process, I had 67,174 number of data points.

I finally randomly shuffled the data set and put 20% of the data into a validation set.

I used this training data for training the model. The validation set helped determine if the model was over or under fitting. The ideal number of epochs was 60 as evidenced by experiments. I used an adam optimizer so that manually training the learning rate wasn't necessary.


text:
# Nginx Receiver

<!-- status autogenerated section -->
| Status        |           |
| ------------- |-----------|
| Stability     | [beta]: metrics   |
| Distributions | [contrib], [observiq], [sumo] |
| Issues        | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fnginx%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fnginx) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fnginx%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fnginx) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner)    | [@djaglowski](https://www.github.com/djaglowski) |

[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[observiq]: https://github.com/observIQ/observiq-otel-collector
[sumo]: https://github.com/SumoLogic/sumologic-otel-collector
<!-- end autogenerated section -->

This receiver can fetch stats from a Nginx instance using the `ngx_http_stub_status_module` module's `status` endpoint.

## Details

## Configuration

### Nginx Module
You must configure NGINX to expose status information by editing the NGINX
configuration.  Please see
[ngx_http_stub_status_module](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html)
for a guide to configuring the NGINX stats module `ngx_http_stub_status_module`.

### Receiver Config

> :information_source: This receiver is in beta and configuration fields are subject to change.

The following settings are required:

- `endpoint` (default: `http://localhost:80/status`): The URL of the nginx status endpoint

The following settings are optional:

- `collection_interval` (default = `10s`): This receiver runs on an interval.
Each time it runs, it queries nginx, creates metrics, and sends them to the
next consumer. The `collection_interval` configuration option tells this
receiver the duration between runs. This value must be a string readable by
Golang's `ParseDuration` function (example: `1h30m`). Valid time units are
`ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
- `initial_delay` (default = `1s`): defines how long this receiver waits before starting.

Example:

```yaml
receivers:
  nginx:
    endpoint: "http://localhost:80/status"
    collection_interval: 10s
```

The full list of settings exposed for this receiver are documented [here](./config.go)
with detailed sample configurations [here](./testdata/config.yaml).

## Feature gate configurations

See the [Collector feature gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md#collector-feature-gates) for an overview of feature gates in the collector.

**ALPHA**: `receiver.nginx.emitCurrentConnectionsAsSum`

The feature gate `receiver.nginx.emitConnectionsCurrentAsSum` once enabled will change the data type of the
`nginx.connections_current` metric from a gauge to a non-monotonic sum.

This feature gate will eventually be enabled by default, and eventually the old implementation will be removed. It aims
to give users time to migrate to the new implementation. The target release for this featuregate to be enabled by default
is 0.80.0.

gha_language: Go


text:
# Track 1: Single View Semantic 3D

An unrectified single-view image is provided for each geographic tile. The objective is to predict semantic labels and above-ground heights (meters).

## Baseline Algorithm
For track 1, JHU/APL trained a U-Net for for image semantic segmentation and single-view depth prediction. These were run in Windows, but the code can just as easily run in Linux with minor edits to the [params.py](unets/params.py) file which specifies folder locations.

Instructions for training and testing image semantic segmentation and single-view depth prediction models are provided in [unets/README.md](unets/README.md)

### Model weights

The model weights are now in a GitHub release zip file for download to avoid having large files in the code repo.

### Quick Run
The following instructions are for running the baseline solution and assumes you have configured an [Anaconda](https://www.anaconda.com/download/) environment with [dev-gpu.yml](../dev-gpu.yml) or [dev-cpu.yml](../dev-cpu.yml).

#### Data layout
Due do the necessary data packaging splits, to run the following algorithms you will need to point [params.py](unets/params.py)'s [TRAIN_DIR](https://github.com/pubgeo/dfc2019/blob/master/track1/unets/params.py#L9) to a folder containing the Track1 AGL, CLS, RGB and MSI tif files found in the Train-Track1-RGB, Train-Track1-MSI-*, and Train-Track1-Truth zip files.
Similarly [params.py](unets/params.py)'s [TEST_DIR](https://github.com/pubgeo/dfc2019/blob/master/track1/unets/params.py#L12) should point to a folder containing MSI and RGB files found in the Validate-Track1 zip files.

#### Running
To train the UNET single view model, modify [params.py](unets/params.py) with your file names and run:
```bash
python ./unets/runBaseline.py train single-view
```

To train train the UNET semantic model, modify [params.py](unets/params.py) with your file names and run:
```bash
python ./unets/runBaseline.py train semantic
```

To test the semantic or single-view models, modify [params.py](unets/params.py) with your file names and run:
```bash
python ./unets/runBaseline.py test semantic
```
or
```bash
python ./unets/runBaseline.py test single-view
```

## Testing Solution
After running tests for the images in the validation set folder, the submission folder should have _CLS and _AGL files suitable for metric evaluation. Since you don't have the reference _CLS and _AGL files for the validation set used for leaderboard testing, you may try running the predictions above on hold-out images and then evaluate the leaderboard metrics on those files.
```bash
python .\metrics\track1.py [submission folder] [truth folder]
```

Here, the truth folder is a folder containing the holdouts, while the submission folder contains your predictions.


text:
MSYS2 launcher
==============

A helper for launching MSYS2 shells. Features blink-less launching and correct taskbar/start pinning.

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

Just `make` and put the .exe and .ini files inside your MSYS2 root. Needs mintty v2.1.6 or newer.

Configuration
-------------

All three default launchers are the same (except for embedded icons and descriptions) and are configured by corresponding .ini files. The .ini file has to be in the same directory as the .exe file and have the same filename (except for the `.exe` -> `.ini` change).

By default, only `MSYSTEM` is set, but options for reducing `PATH` and tweaking `MSYS` are prepared, as well as `CHERE_INVOKING` for the shell to stay in the current working directory (instead of changing to the home directory).

The .ini file contains environment variables, each on a separate line, in the usual `VAR=val` format. Lines starting with `#` are ignored. The values are expanded using the current environment (use Windows `%var%` syntax).


text:
Call Cinnamon Panel Launcher By Number 1.0.1
============================================

Call a panel launcher by number in the Cinnamon desktop environment.

Panel launcher numbering starts at 1.

Setting Up Shortcuts
--------------------

You can set up shorcuts that use this to open panel items using the
"Super key"/"Windows key", like this:
1. Copy the script to `/home/username/bin/`.
   - (Create the bin directory if it does not exist.)
2. Make the script executable.
3. Open Keyboard settings.
4. Add custom shortcuts that follow this format:
   - Name:
     - Call Cinnamon Panel Launcher By Number 1
   - Command:
     - `call-cinnamon-panel-launcher-by-number 1`
   - Keyboard binding:
     - Super+1
   - (Use Super+0 for the 10th item.)

Command-line Usage
------------------

```
call-cinnamon-panel-launcher-by-number <launcher_number>
```
or:
```
call-cinnamon-panel-launcher-by-number (--help | -H | -h | -?)
```
or:
```
call-cinnamon-panel-launcher-by-number (--version | -V | -v)
```

### Options

- `--help, -H, -h, -?`:
  - Print the usage message.
- `--version, -V, -v`:
  - Print version and copyright information.
- `<launcher_number>`:
  - Number of the launcher you want to start. Must be a positive integer.


text:
# Permission

## Description
Represents what can or cannot do an administrator inside a specified organization.

## Properties

Name | Type | Description
------------ | ------------- | -------------
**administratorId** | **String** | Authentication service's administrator unique identifier.
**organizationId** | **Long** | Unique identifier of the organization the administrator is part of.
**orgAuthServerId** | **String** | Administrator unique identifier from the authentication server of the organization.
**mail** | **String** | Administrator's e-mail address.
**permission** | **Integer** | What can or cannot do an organization's administrator. The permission levels are: - Owner: 3 (higher level) - Manager: 2 - Viewer: 1 (lowest level)
**nominatedBy** | **String** | administratorId of the owner administrator who nominated the current administrators. If this field is equal to administratorId then this administrator is the original owner of the organization (i.e. the one whose account was created during the creation of the organization by Stalker administrators).

repository: qb-team/Stalker-Documentazione

gha_language: TeX

repo_name: qb-team/Stalker-Documentazione


text:
---
title: Form
components: Form
api: true
langKey: "en"
---

## API

```
import Form from '@fluent-windows/core/Form'
// or
import { Form } from '@fluent-windows/core'
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| children * | React.ReactElement ∨ React.ReactElement[] |  | The content of the `Form`. |
| prefix | React.ReactChild |  | Content displayed before form. |
| suffix | React.ReactChild |  | Content displayed after form. |
| initialState | object |  | Initialize the displayed data. |
| onSubmit * | (value: object, errors?: object) => void |  | Callback for submit event. |

### Field Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| children * | React.ReactElement |  | The content of the `Field`. |
| onChange | (value: any) => void |  | The callback of the form component content changes. |
| label | string |  | Field label. |
| name * | string |  | Unique identifier of the `Field` component. |
| rules | ValidationRule[] |  | Rules of verification, see below. |

#### ValidationRule

| param | Type | Default | Description |
| --- | --- | --- | --- |
| message | React.ReactNode |  | validation error message. |
| type | React.ReactNode | 'string' | built-in validation type, available options: https://github.com/yiminghe/async-validator#type. |
| required | boolean |  | indicates whether field is required. |
| whitespace | boolean |  | treat required fields that only contain whitespace as errors. |
| len | number |  | validate the exact length of a field. |
| min | number |  | validate the min length of a field. |
| max | number |  | validate the max length of a field. |
| enum | string ∨ string[] |  | validate the value from a list of possible values. |
| pattern | RegExp |  | validate from a regular expression. |
| transform | (value: any) => any |  | transform a value before validation. |
| validator | (rule: any, value: any, callback: any, source?: any, options?: any) => any |  | custom validate function (Note: callback must be called). |

The verification function is based on [async-validator](https://github.com/yiminghe/async-validator).


text:
# generator-oasp

> [Yeoman](http://yeoman.io) generator for AngularJS applications powered by [OASP4JS](https://github.com/oasp/oasp4js).

## Getting Started

### What is Yeoman?

Trick question. It's not a thing.

Not every new computer comes with a Yeoman pre-installed. He lives in the [npm](https://npmjs.org) package repository. You only have to ask for him once, then he packs up and moves into your hard drive. *Make sure you clean up, he likes new and shiny things.*

```bash
npm install -g yo
```

### Yeoman Generators

Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension.

To install generator-oasp from npm, run:

```bash
npm install -g generator-oasp
```

Finally, initiate the generator:

```bash
yo oasp
```

You can review the Yeoman-generated app afterwards: Open up the directory in which you executed the `yo oasp` command to take a look at what was actually scaffolded.

You can also preview your app in the browser: Run a Gulp task to create a local, Node-based http server on [localhost:9000](http://localhost:9000) (or [<IP_ADDRESS>:9000](http://<IP_ADDRESS>:9000) for some configurations) by typing:

```bash
gulp serve
```
Your web browser will launch your newly scaffolded application in a new tab.

### Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.

If you'd like to get to know Yeoman better and meet some of his friends, [Gulp](http://gulpjs.com/) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started).

## License

Apache License 2.0

repository: krzysztof-michalski/generator-oasp

repo_name: krzysztof-michalski/generator-oasp


text:
Light Validation
================

Validation of the light transport simulations and the quantities that are used in the models.

Projects:

 + BirksConstantEffect - Examining the effects of the Birks coefficient on materials and the light yields
 + GS20Calibration - A simulation of GS20 as measured (except using a neutron and gamma gun sources) and the number of optical photons detected and measured
 + PSCalibration - A simulation of PS as measured (except using a neutron and gamma gun sources) and the number of optical photons detected and measured
 + LayeredDetectorCalibration - A simulation of a 4" by 6" slab detector that was fabricated and measured at UTK. This simulation validates the number of optical photons detected and measured.

repository: continandrea/DetectorSim

repo_name: continandrea/DetectorSim


text:
# Service Cutter

The Service Cutter suggests a structured way to service decomposition. There is [a tutorial](https://servicecutter.github.io/) providing you with a functional overview.

This readme focuses on installation and development aspects. A comprehensive documentation of the import format and all coupling criteria can be found in the [wiki](https://github.com/ServiceCutter/ServiceCutter/wiki) of this repository.

The Service Cutter is based on the Bachelor Thesis by [Lukas Kölbener](https://github.com/koelbener) and [Michael Gysel](https://github.com/gysel).
Build status: [![Build Status](https://travis-ci.org/ServiceCutter/ServiceCutter.svg?branch=master)](https://travis-ci.org/ServiceCutter/ServiceCutter)

# Overview

Service Cutter consists of the following components:

* **Editor** - a web application, the graphical user interface of the Service Cutter (based on [JHipster](https://jhipster.github.io/)).
* **Engine** - the RESTful HTTP API offering the core functionality of the service cutter (based on [Spring Boot](http://projects.spring.io/spring-boot/) and [Jersey](https://jersey.java.net/))
* **Samples** - contains three sample systems that can be analyzed with the Service Cutter.
   * A tiny booking system with three entities.
   * The domain model of the DDD sample application "[Cargo Tracker](http://dddsample.sourceforge.net/)"
   * An imaginary trading system one might find in a bank.
* **CC-Cards** - contains the coupling criteria cards as `png` files.

The conference paper ["Service Cutter: A Systematic Approach to Service Decomposition"](https://www.researchgate.net/publication/307873263_Service_Cutter_A_Systematic_Approach_to_Service_Decomposition) features decomposition method, coupling criteria, and tool architecture.

*Update (July 28 2020):* Context Mapper, providing a DSL and tools for domain-driven design, integrates parts of Service Cutter since its version 5.14. See ["Context Map Suggestions with Service Cutter"]( https://contextmapper.org/docs/service-cutter-context-map-suggestions/).

# Build and Run

All source code is released under the terms of the Apache 2.0 license.

> :warning: **This project is no longer maintained.**
> The build is currently broken, and it would require significant effort to update all dependencies.
> Please use our [Docker images](#docker) to test Service Cutter locally.

Prerequisite: JDK 1.8 and Maven is installed and added to the path.

Then run in a command prompt / shell:
```
cd Engine
mvn spring-boot:run -Drun.jvmArguments='-Dserver.port=8090'
```

After some time you should see the following line:

    2015-12-15 20:21:55.811  INFO 2976 --- [           main] c.h.s.EngineServiceAppication            : Started EngineServiceAppication in 9.113 seconds (JVM running for 9.946)

Open http://localhost:8090/engine to verify whether the engine is running correctly. You should see:

```json
{"description":"Engine is up and running."}
```

Now we need to install the JHipster development dependencies:

1. Install Node.js [from the Node.js; tested with LTS](http://nodejs.org/) website.
2. Install Yeoman: `npm install -g yo`
3. Install Bower: `npm install -g bower`
4. Install Grunt: `npm install -g grunt-cli`

And in a second command prompt / shell:
```
cd Editor
mvn spring-boot:run -Drun.jvmArguments='-Dserver.port=8080'
```

Now you should be able to access the Service Cutter using the following URL: [http://localhost:8080](http://localhost:8080)

The editor by default expects the engine to be accessible under [http://localhost:8090](http://localhost:8090). If not, please add the following JVM parameters to the editor:
* `application.links.engine.host=enginehost`
* `application.links.engine.port=1234`

# Development

We recommend using Grunt and Eclipse (including [Spring Tool Suite](https://spring.io/tools)) for development.

Information on how to import a JHipster project into Eclipse can be found in the [JHipster documentation](https://jhipster.github.io/configuring_ide_eclipse.html).

# Deployment

You have two options to run the Service Cutter:

* Use the embedded Tomcat provided by Spring Boot.
* Deploy the `.war` file into a Java application server.

The required setup and dependencies are demonstrated in the provided Docker configuration.

## Docker

The fastest way to run Service Cutter is using Docker and Docker Compose.
Just run `docker-compose up` in the root directory of this repository.

repository: mhafizhasan/ServiceCutter

repo_name: mhafizhasan/ServiceCutter


text:
# kapify/pg

Capistrano tasks for basic configuration and management of PostgreSQL database.

Provides capistrano tasks to:

* create database.yml in `shared` folder and symlink into `config`
* create user and database in postgres

Provides several capistrano variables for easy customization.
Also, for full customization, template of `database.yml` file can be copied to
the application using generator.

## Usage

Add this line to your `deploy.rb`

    require 'kapify/pg'

Next, add role `pg` to the server which has running instance of PostgreSQL.
Address of this server will be automatically used as `pg_host` (see below),
`create_user` and `create_database` tasks will be executed on this server:

```ruby
# for dedicated database server it could look like this:
server "<IP_ADDRESS>", :db, :pg, no_release: true

# for all-in-one server it could look like this:
server "<IP_ADDRESS>", :web, :app, :db, :pg, primary: true
```

Note, that following capistrano variables should be defined in the `deploy.rb` file:

    application
    current_path
    shared_path
    user

You can check that new tasks are available (`cap -T`):

    # create database user for the application
    cap kapify:pg:create_user

    # create database for the application
    cap kapify:pg:create_database

    # generates `database.yml` file in the `shared/config` folder
    cap kapify:pg:setup

    # symlinks `database.yml` from the `shared/config` folder to `current/config` folder
    cap kapify:pg:symlink

There is no need to execute any of these tasks manually.
They will be called automatically on different deploy stages:

* `kapify:pg:create_user`, `kapify:pg:create_database` and `kapify:pg:setup` are hooked to `deploy:setup`
* `kapify:pg:symlink` is hooked to `deploy:finalize_update`

This means that if you run `cap deploy:setup`,
user and database will be created and `database.yml` file will be generated.
And on each deploy, `database.yml` will be automatically linked to current version.

However, if you changed variables or customized templates,
you can run any of these tasks to update configuration.

## Customization

### Using variables

You can customize `database.yml` using capistrano variables:

```ruby
# path to customized templates (see below for details)
# default value: "config/deploy/templates"
set :templates_path, "config/deploy/templates"

# `host` value in `database.yml`
# default value: address of the server, marked with `pg` role
set :pg_host, "localhost"

# `port` value in `database.yml`
# default value: 5432
set :pg_port, "5432"

# `database` value in `database.yml`
# default value: application variable value
set :pg_database, "myapp_production"

# `pool` value in `database.yml`
# default value: 5
set :pg_pool, "5"

# `username` value in `database.yml`
# default value: application variable value
set :pg_user, application

# `password` value in `database.yml`
# default value: will be asked if not set
# setting this value in config file is not recommended
set :pg_password, application

# indicates, it new database should be created on `deploy:setup` or not
# default value: true
set :pg_create_db, true
```

### Template Customization

If you want to change default template, you can generate it using `rails generator`

    rails g kapify:pg

This will copy default template to `config/deploy/templates` directory,
so you can customize them as you like, and capistrano tasks will use this templates instead of default.

You can also provide path, where to generate template:

    rails g kapify:pg config/templates

repository: ivalkeen/kapify

repo_name: ivalkeen/kapify


text:
herokuslugignorehelper
======================

Heroku slugignore helper library and cli written in Python.

Provides a command line utility that should be used on a clean checkout of a git repository.

Command line script usage
-------------------------
Open your shell in the directory where you keep your ``.slugignore``, and run::

	$ herokuslugignorehelper -h

repository: pombredanne/herokuslugignorehelper

repo_name: pombredanne/herokuslugignorehelper


text:
# Paraphaeosphaeria cylindrospora (Wehm.) O.E. Erikss. SPECIES

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
Non-lichenized Pyrenomycetes of Sweden (Lund) 7 (1992)

#### Original name
Pleospora cylindrospora Wehm.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Exch

When no parameter is specified, exchanges the top two elements of the stack. When a parameter is specified and is a user variable, exchanges the top element of the stack with the parameter. When a parameter is specified and is a positive integer, `Exch` will swap the item on the top of the stack with the item that is specified by the offset from the top of the stack in the parameter. If there are not enough items on the stack to accomplish the exchange, a fatal error will occur (to help you debug your code :).

## Parameters

    [user_var | stack_index]

## Example

    Push 1
    Push 2
    Exch
    Pop $0 # = 1
    Push 1
    Push 2
    Push 3
    Exch 2
    Pop $0 # = 1
    StrCpy $0 1
    Push 2
    Exch $0 # = 2
    Pop $1 # = 1

## History

Added in NSIS v1.58

[1]: WriteRegStr.md

license: Zlib

repository: NSIS-Dev/Documentation

gha_language: JavaScript

repo_name: NSIS-Dev/Documentation


text:
---
title: "Configure Telnet and SSH on Cisco Packet Tracer"
layout: post
tag:
- Cisco
- Networking
comments: true
author: nurulfajar
---
To enable telnet or SSH on Cisco router, simply do it with “line vty” command.
lets Configure:

* ### First create topology Network. and set a static IP for PC client, router and switch. See the picture below.

![file.png]({{site.baseurl}}/assets/images/cisco/topology.png)

* ### Go to Router0 console and configure Hostname, Secret password and telnet with “line vty” command.

![file.png]({{site.baseurl}}/assets/images/cisco/router-telnet-config.png)

* "**Enable secret 'your password'**" command for your router password user privileges.
* The “**line vty**” command enable the telnet and the “**0**″ is just let a single line or session to the router.
If you need more session simultaneously, you must type “**line vty 0 10**“, **its mean 11 client can access telnet**.
* The “**logging synchronous**” command stops any message output from splitting your typing.
* The “**exec-timeout**” command just sets the time-out limit on the line from the default to “**10**″ minutes.

* ### Testing Telnet Connectivity.
Let’s test telnet from the admin or client PC. Type telnet <IP_ADDRESS> and press enter, then enter the telnet username & password. Next type enable command and press enter, then type the router password.

![file.png]({{site.baseurl}}/assets/images/cisco/telnet.png)
* Now you are remotely connected to router R1 and you can execute all router commands through telnet command line interface.

* ### SSH Configuration.

![file.png]({{site.baseurl}}/assets/images/cisco/ssh-configuration.png)

* "**line vte 1 3**" <~ this command will set only line 1 to 3 Virtual Teminal Lines can access SSH.
* “**username budi password luhur**” <~ this your username and password for SSH access.
* “**crypto key generate rsa**” command, when ask you “**How many bits in the modulus [512]:**” just type "**1024**″ and press enter. The system will generate 1024 bits keys to secure session lines. You can choose modulus in the range of 360 to 2048.
* **service password-encryption** <~ encrypt your SSH password.

* ### Testing SSH Connectivity
From a client PC, open the command line and type “**ssh -l budi <IP_ADDRESS>**” then press enter.

![file.png]({{site.baseurl}}/assets/images/cisco/ssh.png)

Now we have connected successfully and the connection is secured with Secure Shell.

gha_language: CSS


text:
# Essay-Analyzer
This is a web based application, which identifies the misspelled words which a user might have written while writing an essay.
Thus it can improve the speed and accuracy of writing essays.
This was submitted as a part of the final project for the course ["Inroduction to Computer Science"(CS50)](https://www.edx.org/course/cs50s-introduction-to-computer-science) by HarvardX.
It includes a basic user interface for user sign-up and user login.
For storing the user account information I have used SQLite as the default database.
For the front end I have used HTML, CSS and JINJA (a templating language).
For the back end I have used Python. I have also used a web framework called Flask.
This application is not deployed on any server.
However, I have executed this application on cloud9 (CS50 IDE) webserver and the demo of the same can be found in this [video](https://www.youtube.com/watch?v=zYpJicBOlOU&t=1s).
Any suggestions and improvements are welcomed.

gha_language: Python


text:
# Semantic Segmentation
### Introduction
In this project, I labeled the pixels of a road in images using a Fully Convolutional Network (FCN).

### Setup
#### GPU
I have a Nvidia GTX 1080TI GPU on my system.

#### Development Environment
I use following steps to install develop environment.
 - First I installed CUDA and GPU driver.
 - Then I use a Docker enviroment which name is tensorflow:tensorflow-gpu as my development enviroment.

You can see details [here](./Dockerfile) and running script [here](./run.sh).

#### Frameworks and Packages
I have installed following Frameworks and Packages:
 - [Python 3](https://www.python.org/)
 - [TensorFlow](https://www.tensorflow.org/)
 - [NumPy](http://www.numpy.org/)
 - [SciPy](https://www.scipy.org/)

#### Dataset
Download the [Kitti Road dataset](http://www.cvlibs.net/datasets/kitti/eval_road.php) from [here](http://www.cvlibs.net/download.php?file=data_road.zip).  Extract the dataset in the `data` folder.  This will create the folder `data_road` with all the training a test images.

### Approach

#### Architecture
I use a FCN network with converting a pre-trained VGG-16 network as encoder. The fianl fully-connected layers are replaced by 1-by-1 convolutions. The depth was set equal to the number of desired classes (in this case, two: road and not-road).
Then I use `conv2d_transpose` to upsample the input to the original image size. Skip connections were added to improve perfomance.

You can see these codes in `layers` function in [main.py](./main.py)  (line 61 - line 80).

The architecture is the same as the [FCN paper](https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf).

![arch](./arch.png)

#### Optimizer
I use cross-entropy as loss function and Adam optimizer to minimize the loss.
You can see the detail in `optimize` function.

#### Training
I found that larger batch_size can make higher utilization of GPU.
So, I used following  hyperparameters for training:
  - keep_prob: 0.8
  - learning_rate: 0.0001
  - epochs: 1000
  - batch_size: 32

You can see the detail in `train_nn` function.

#### Results
Loss at first epoch: 5.412
Loss after 1000 iterations: 0.009
On average, the model decreases loss over time.

#### Samples

Belows are some of sample images from the output of FCN, with the segmentation class overlaid upon the original image in green.

![sample1](./sample1.png)
![sample2](./sample2.png)
![sample3](./sample3.png)
![sample4](./sample4.png)
![sample5](./sample5.png)
![sample6](./sample6.png)
![sample7](./sample7.png)
![sample8](./sample8.png)

We can see that the solution that is close to best, would label at least 90% of the road and label no more than 10% of non-road pixels as road, which is over the criteria.

### Possible Improvements:
We can use a deeper model as encoder to replace with VGG-16, like ResNet.

### Submission
1. Ensure you've passed all the unit tests.
2. Ensure you pass all points on [the rubric](https://review.udacity.com/#!/rubrics/989/view).
3. Submit the following in a zip file.
 - `helper.py`
 - `main.py`
 - `project_tests.py`
 - Newest inference images from `runs` folder  (**all images from the most recent run**)

 ### Tips
- The link for the frozen `VGG16` model is hardcoded into `helper.py`.  The model can be found [here](https://s3-us-west-1.amazonaws.com/udacity-selfdrivingcar/vgg.zip)
- The model is not vanilla `VGG16`, but a fully convolutional version, which already contains the 1x1 convolutions to replace the fully connected layers. Please see this [forum post](https://discussions.udacity.com/t/here-is-some-advice-and-clarifications-about-the-semantic-segmentation-project/403100/8?u=subodh.malgonde) for more information.  A summary of additional points, follow.
- The original FCN-8s was trained in stages. The authors later uploaded a version that was trained all at once to their GitHub repo.  The version in the GitHub repo has one important difference: The outputs of pooling layers 3 and 4 are scaled before they are fed into the 1x1 convolutions.  As a result, some students have found that the model learns much better with the scaling layers included. The model may not converge substantially faster, but may reach a higher IoU and accuracy.
- When adding l2-regularization, setting a regularizer in the arguments of the `tf.layers` is not enough. Regularization loss terms must be manually added to your loss function. otherwise regularization is not implemented.

repository: zezhou/CarND-Semantic-Segmentation

repo_name: zezhou/CarND-Semantic-Segmentation


text:
---
output:
  pdf_document:
      latex_engine: xelatex
  html_document: default
---
# **SMART-seq** _Switching Mechanism At the end of the 5′-end of the RNA Transcript_

## Technology

**SMART-seq** uses a mechanism called _Template Switching_ to generate cDNA libraries. It relies on the Retro Transcriptase (RT) of Moloney Murine Leukemia Virus (MMLV) which adds extra _deoxyC’s_ to the template, allowing the annealing of _Template Switching Oligo’s_ (TSO) and the switching of the _RT MMLV_ to the TSO’s. Tagging and fragmentation of cDNA happens at once through _Tagmentation_ to further construct sequencing libraries.

## Application

By reducing the cost per sample and increasing the throughput, numerous applications become possible, for example the isolation of single cells from different regions of a primary tumour to obtain information on cellular heterogeneity.

## Statistics

Some popular methods assume a negative binomial count distribution across biological replicates. However, in single cell data including **SMART-seq2**, excessive zeros are usually observed compared to the bulk RNA, many methods also use zero-inflated negative binomial models.

### References

- Picelli, S., Björklund, Å. K., Faridani, O. R., Sagasser, S., Winberg, G., & Sandberg, R. (2013). [Smart-seq2 for sensitive full-length transcriptome profiling in single cells.](https://www.nature.com/articles/nmeth.2639) Nature methods, 10(11), 1096-1098.
- Picelli, S., Faridani, O. R., Björklund, Å. K., Winberg, G., Sagasser, S., & Sandberg, R. (2014). [Full-length RNA-seq from single cells using Smart-seq2.](https://www.nature.com/articles/nprot.2014.006) Nature protocols, 9(1), 171-181.

---

### Group members

- Anja Estermann: eanja
- Tadas Bareikis: tadasbar
- Xiao Yi: pikkaa215
- Karla Cervantes: KCervaG
- Philipp Niggli: philniggli
- Zhixuan Li: Lillyakasiken

repository: sercagal/material

repo_name: sercagal/material


text:
---
layout: blocks/long_description
title: Content teams - accountability, expertise, escalation
---

A pyramid displays the hierarchy of a content team from leaders to doers and specialists. Accountabilities are adjacent to the roles.

**Leaders:**
- lead with strategy
- champion quality
- build capability
- report on success
- can say ‘no’

**Doers and specialists:**
- use content lifecycle stages
- apply skills to tasks
- follow guides and standards
- design for users
- question and check quality

repository: govau/service-manual

repo_name: govau/service-manual


text:
---
title: 'June 2022: Closing the Winter Sessions'
date: 2022-06-01
permalink: /posts/2022/06/teaching/
tags:
  - teaching
  - Julia
  - PDE
  - optimization
  - optimal control
---
I taught in french the class [MTH8408](https://www.polymtl.ca/programmes/cours/methodes-doptimisation-et-controle-optimal) *Méthodes d'optimisation et contrôle optimal* during the winter session at Polytechnique Montréal on numerical methods for optimization, variational calculus, and optimal control.

The class was a lot of fun, and we had amazing session projets on: local warming, predictive control for wind power, game-theoretic formulation of environmental projects, optimal control of a quadrotor, and machine learning of alpha-decay half-lives.

We also covered Julia programming during the class. To give some pointers, the following resources was used:
- [JuMP](https://jump.dev/JuMP.jl/stable/): model optimization problems
- [NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl/): model optimization problems ([NLPModelsJuMP.jl](https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl/) convert JuMP to NLPModel)
- [PDENLPModels.jl](https://github.com/JuliaSmoothOptimizers/PDENLPModels.jl/): model optimal control and variational calculus
- [JSOSolvers.jl](https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/): algorithms for unconstrained optimization and nonlinear least squares.
- [OptimizationProblems.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/): learn Github workflow, model optimization problem, benchmark.


text:
# Binary Search

Binary search, also called logarithmic search, is a search algorithm that finds and returns the index of a targeted value in a given array.

## Challenge

Write a function called BinarySearch which takes in 2 parameters: a sorted array and the search key. Without utilizing any of the built-in methods available to your language, return the index of the array’s element that is equal to the search key, or -1 if the element does not exist.

## Approach and Efficiency

Time Complexity: O(log n)
> Time complexity is O(log n) due to the nature of binary searching. We're constantly halving the search range whenever we did not "guess" the correct index.

Space Complexity: O(1)
> Space complexity is constant as we're only keeping track of three (additional) variables : Start, End, Mid.

## Solution
![Binary Search](../../assets/BinarySearch.jpg)

repository: Inkh/Data-Structures-and-Algorithms

gha_language: C#

repo_name: Inkh/Data-Structures-and-Algorithms


text:
RestQL-server is a server to run restQL queries, making easy to fetch information from multiple services in the most efficient manner.

## Getting Started

### Installation

You can download the latest binary release on the releases page, clone the repository and [build from source](#building-from-source-code) (requires Clojure) or build a Docker image and [run it as a container](#running-as-a-docker-container).

Java 8 is the only pre-requisite to run restQL-server, making it easy to run and deploy. You may also need MongoDB if you want to store queries and run them later.

### Configuration

In order to use it, you must provide the resources you want to map when starting the server. You can also provide an optional port argument (default running on port 9000).

For example, to map the planets resource from Star Wars API and use port 8080, you should start the server as follows:

```
java -jar -Dmongo-url=mongodb://localhost:27017/restql-server -Dport=8080 -Dplanets=http://swapi.co/api/planets/ restql-server-v1.0.0-standalone.jar
```

The optional configurations currently available are:

+ port: The port restQL-server will be using to run.
+ mongo-url: The MongoDB connection url to store the queries.
+ cache-ttl: The time, in milliseconds, a query string retrieved from the database will be cached.

For more information about resources see [the restQL-core configuration wiki](https://github.com/B2W-BIT/restQL-core/wiki/Configuration#resources).

## Running Queries

Once configured, you can run queries on the server you can send a POST HTTP request to `http://your-server.ip/run-query` with your query on the body.

Example POST Body:

```restql
from planets as allPlanets
```

For more details about the query language and structure see [Query Language wiki](https://github.com/B2W-BIT/restQL-server/wiki/RestQL-Query-Language).

## Building From Source Code

As prerequisites to build restQL-server from source we have:

+ Java 8
+ Leiningen
+ MongoDB (To store and run saved queries)

To run the server using Leinigen: `lein run`

To build the server as a deployable standalone: `lein uberjar` (will generate `restql-server-standalone.jar` under `target/uberjar`)

## Running as a Docker container

### Building Docker image
RestQL-server can also be run as a Docker container.
First, from the root folder, build a Docker image with the command:
```shell
docker build -t restql-server-img .
```

### Running the container
Than run the image as a container with the command:
```shell
docker run -p 9000:9000 -e JAVA_OPTS="-Dmongo-url=mongodb://my-mongo-ip:27017/restql-server -Dplanets=http://swapi.co/api/planets/" restql-server-img
```

You can register your APIs as resources by passing them in `JAVA_OPTS` environment variable, as seen above.
The server default port is 9000 but it can be changed by passing the `PORT` environment variable with the desired port.

The MongoDB instance can also run from a container. If that's the case you can link to it and use its link name as the address:
```shell
docker run -p 27017-27017 --name mongo-docker mongo
docker run --link mongo-docker -p 9000:9000 -e JAVA_OPTS="-Dmongo-url=mongodb://mongo-docker:27017/restql-server -Dplanets=http://swapi.co/api/planets/" restql-server-img
```

## License

Copyright © 2016-2017 B2W Digital

Distributed under the MIT License.

repository: newbare/restQL-server

repo_name: newbare/restQL-server


text:
# Dynamics

We can build dynamical models of robotic manipulators that consider forces and torques acting on the robot, and model gravity and motion of bodies with mass and inertia. Those models can help us to contol manipulators. For example, we can simulate behaviour of our manipulator and find required input torques to perform the desired motion.

In order to model our robot, we can use one of the two methods:

## Euler-Lagrange

Here is a brief description of the method:

![Euler-Lagrange method](../images/euler_lagrange.png)

## Newton-Euler

Here is a brief description of the method:

![Newton-Euler method](../images/newton_euler.png)

## RR Robot model

RR Robot Dynamic model:

![RR Robot dynamic model](../images/rr_robot_model.png)

## RR Robot model simulation

Since we know the differential equation for the RR manipulator, we can simulate RR Robot now. Here is the result of simulation with zero input torques and forces and gravity force:

![RR Robot gravity motion](../images/rr_robot_gravity.gif)

![RR Robot gravity trajectory plot](../images/rr_robot_gravity_qs.png)

## Desired trajectory following

Now we want the manipulator to follow the desired trajectory. First of all, we need to generate it. In order to do that, we firstly create the trajectory in the Cartesian space, and then transform it to the Joint space afterwards. Here is an example of the trajectory following task:

![RR Robot ellipse trajectory motion](../images/rr_robot_trajectory_ellipse.gif)

![RR Robot ellipse trajectory plot](../images/rr_robot_ellipse_qs.png)

![RR Robot ellipse trajectory input](../images/rr_robot_ellipse_us.png)

And here is the result of more complicated trajectory following task:

![RR Robot batman trajectory motion](../images/rr_robot_trajectory_batman.gif)

![RR Robot batman trajectory plot](../images/rr_robot_batman_qs.png)

![RR Robot batman trajectory input](../images/rr_robot_batman_us.png)

repository: sadernalwis/RoboticManipulators

repo_name: sadernalwis/RoboticManipulators


text:
---
title: Editing
category: documentation
authors: beni, dneary, kashyap, rbowen
---

# Editing

For editing pages in this wiki, please use [MediaWiki syntax](https://www.mediawiki.org/wiki/Help:Formatting). In forum posts and comments, you can use [Markdown syntax](//daringfireball.net/projects/markdown/syntax).

More help pages on using MediaWiki are linked on [MediaWiki's help pages](https://meta.wikimedia.org/wiki/Help:Editing#Editing_help), for example:

*   [how to use the editor's toolbar](https://meta.wikimedia.org/wiki/Help:Edit_toolbar)
*   [when to mark an edit as “minor edit”](https://meta.wikimedia.org/wiki/Help:Minor_edit)
*   [answers to some frequently asked questions on editing](https://meta.wikimedia.org/wiki/Help:Editing_FAQ)
*   [some usage examples of MediaWiki's syntax](https://meta.wikimedia.org/wiki/Help:Wikitext_examples).

To post long lines, such as log output or script lines, wrap a block in

         <pre style="white-space: pre; overflow-x: auto; word-wrap: normal">
             ...
         </pre>

The site is set up to use Kramdown, which is a featureful version of
Markdown. It mirrors GitHub's settings and then a few
features on top. You can see the settings in [config.rb](https://github.com/redhat-openstack/website/blob/master/config.rb#L22-L32)

Basically, you get everything from GitHub's configuration, so preview
works, and you can also do special Kramdown stuff, like adding CSS, like
so: {:.foo} (for a class called foo, which can be applied to a block or
inline, based on its position). More info on the [kramdown site](http://kramdown.gettalong.org/syntax.html#attribute-list-definitions)

See also the [Quick reference for simple tables](http://kramdown.gettalong.org/quickref.html#tables) and the [full table docs](http://kramdown.gettalong.org/syntax.html#tables)

<Category:Documentation>

repository: jjasghar/website

repo_name: jjasghar/website


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

## [0.28.0] - 2022-06-12
### Changed
- Support for the new `toml-rb` release (`2.1`);
- Updated dev-dependencies;
- Existing code base was adopted to the new rubocop ruleses;

## [0.27.0] - 2022-01-12
### Changed
- Drop Ruby 2.5 support.
- Fix YAML loading in Psych v4 (#132).

## [0.26.0] - 2021-07-01
### Added
- Support `ERB` in `load_from_json` method;

## [0.25.0] - 2020-09-15
### Added
- Support for **Vault** config provider:
  - realized as a plugin (`Qonfig.plugin(:vault)`);
  - provides `#load_from_vault`, `#expose_vault` methods and works in `#*_yaml`-like manner);
  - depends on `gem vault (>= 0.1)`
- `Qonfig::Settings#[]` behave like `Qonfig::Settings#__dig__`;
- An ability to represent the config hash in dot-notated style (all config keys are represented in dot-notated format):
  - works via `#to_h(dot_style: true)`;
  - `key_transformer:` and `value_transfomer:` options are supported too;

```ruby
class Config << Qonfig::DataSet
  setting :database do
    setting :host, 'localhost'
    setting :port, 6432
  end

  setting :api do
    setting :rest_enabled, true
    setting :rpc_enabled, false
  end
end

Config.new.to_h(dot_style: true)
# =>
{
  'database.host' => 'localhost',
  'database.port' => 6432,
  'api.rest_enabled' => true,
  'api.rpc_enabled' => false,
}
```

## [0.24.1] - 2020-03-10
### Changed
- Enhanced dot-notated key resolving algorithm: now it goes through the all dot-notated key parts
  until it finds the required setting key (or fails with `Qonfig::UnknowSettingKeyError`);

### Fixed
- (**Pretty-Print Plugin**):
  - dot-noted setting keys can not be pretty-printed (they raise `Qonfig::UnknownSettingKeyError`);
  - added `set` and `pp` as preloaded dependencies;

## [0.24.0] - 2019-12-29
### Added
- Support for<EMAIL_ADDRESS>
## [0.23.0] - 2019-12-12
### Added
- Support for `Pathname` file path in `.load_from_json`, `.load_from_yaml`, `.load_from_toml`, `.expose_yaml`, `.expose_json`, `.expose_toml`;

## [0.22.0] - 2019-12-12
### Added
- Support for `Pathname` file path in `.values_file`, `#load_from_file`, `#load_from_yaml`, `#load_from_json` and `#load_from_toml`;

## [0.21.0] - 2019-12-12
### Added
- Brand new type of config objects `Qonfig::Compacted`:
  - represents the compacted config object with setting readers and setting writers only;
  - setting keys are represented as direct instace methods (`#settings` invokation does not need);
  - no any other useful instance-based functionality;
  - full support of `Qonfig::DataSet` DSL commands (`.setting`, `.validate`, `.add_validator`, `.load_from_x`/`.expose_x` and etc);
  - can be instantiated by:
    - by existing config object: `Qonfig::DataSet#compacted` or `Qonfig::Compacted.build_from(config, &configuration)`
    - by direct instantiation: `Qonfig::Compacted.new(settings_values = {}, &configuration)`;
    - by implicit instance building without explicit class definition `Qonfig::Compacted.build(&dsl_commands) # => instance of Qonfig::Compacted`;
- Added `Qonfig::DataSet.build_compacted` method: works in `Qonfig::DataSet.build` manner but returns compacted config object (`Qonfig::Compacted`);
- Added missing `#[]=(key, value)` accessor-method for `Qonfig::DataSet` objects;
- Added support for `do |config|` configuration block in `#load_from_self` / `#load_from_yaml` / `#load_from_json` / `#load_from_toml`
  values-loading methods;
- **Plugins** `pretty_print`:
  - added missing beautification logic for `Qonfig::Settings` objects;
  - added support for `Qonfig::Compacted` beautification;
- `#valid_with?` now supports configuration block (`do |config|`);
- `Import API`: support for predicate methods;

### Changed
- `.load_from_self`: default format was changed from `:yaml` to `:dynamic`;
- `.expose_self`: default format was changed from `:yaml` to `:dynamic`;
- Minor `Qonfig::DataSet` and `Qonfig::Settings::Builder` refactorings;

### Fixed
- Configs without any setting key can not be imported and exported by generic key patterns (`*` and `#`);

## [0.20.0] - 2019-12-01
### Added
- Extended **Validation API**: you can define your own predefined validators via `.define_validator(name, &validation)` directive;
- `re_setting` - a special DSL command method that fully redefines existing settings (redefines existing settings instead of reopening them);

## [0.19.1] - 2019-11-29
### Changed
- Support for Ruby 2.3 has ended.

### Fixed
- Invalid default values for `#export_settings` method attributes (invalid `mappings:` value);

## [0.19.0] - 2019-11-26
### Added
- **FINALY**: support for dot-notation in `#key?`, `#option?`, `#setting?`, `#dig`, `#subset`, `#slice`, `#slice_value`, `[]`;
- `freeze_state!` DSL directive (all your configs becomes frozen after being instantiated immediately);
- Global `Qonfig::FrozenError` error for `frozen`-based exceptions;
- explicit validation of potential setting values:
  - `#valid_with?(configurations = {})` - check that current config instalce will be valid with passed configurations;
  - `.valid_with?(configurations = {})` - check that potential config instancess will be valid with passed configurations;
- `#pretty_print` plugin :) (`Qonfig.plugin(:pretty_print)`);
- `Qonfig.loaded_plugins`/`Qonfig.enabled_plugins` - show loaded plugins;

### Changed
- `Qonfig::FrozenSettingsError` now inherits `Qonfig::FrozenError` type;

## [0.18.1] - 2019-11-05
### Added
- New `yield_all:` attribute for `#deep_each_setting` method (`#deep_each_setting(yield_all: false, &block)`))
  - `yield_all:` means "yield all config objects" (end values and root setting objects those have nested settings) (`false` by default)

### Fixed
- `#keys(all_variants: true)` returns incorrect set of keys when some of keys has name in dot-notated format;

## [0.18.0] - 2019-11-04
### Added
- `#keys` - returns a list of all config keys in dot-notation format;
- `#root_keys` - returns a list of root config keys;
- Inroduce `Import API`:
  - `.import_settings` - DSL method for importing configuration settings (from a config instance) as instance methods of a class;
  - `#export_settings` - config's instance method that exports config settings to an arbitrary object as singelton methods;

## [0.17.0] - 2019-10-30
### Added
- Introduce `strict` validations: `strict: false` option ignores `nil` values and used by default;
- Setting's key existence check methods: `#key?(*key_path)`, `#setting?(*key_path)`, `#option?(*key_path)`;
- `#with(temporary_configurations = {}, &arbitary_code)` - run arbitary code with temporary settings;
- `TOML` plugin: support for TOML version 0.5.0;
- Introduce instance-level file loading methods that specifies a file with setting values for your defined settings:
  - `.values_file` - define a file that will be used during instantiation process;
  - `#load_from_file`, `#load_from_self`, `#load_from_yaml`, `#load_from_json`, `#load_from_toml` (toml plugin) -
    instance methods for loading setting values on your config instance directly from a file;

### Changed
- `Qonfig::DataSet.build` now supports a Qonfig::DataSet-class attribute that should be inherited (`self` is used by default):
  - new signature: `Qonfig::DataSet.build(base_config_klass = self, &config_class_definitions)`;
- Refacored DSL commands: introduce `Qonfig::Commands::Definition` commands and `Qonfig::Commands::Instantiation` commands;
- Updated runtime (`toml-rb` `1` -> `2`) and development dependencies;

## [0.16.0] - 2019-09-13
### Added
- `Qonfig::DataSet.build(&config_klass_definitions)` - build config instance immidietly without `Qonfig::DataSet`-class definition;
- `#subset` - get a subset of config settings represented as a hash;

## [0.15.0] - 2019-09-02
### Added
- `:format`-option for `load_from_self` and `expose_self` commands that identifies which data format
  should be chosen for parsing;

## [0.14.0] - 2019-08-28
### Added
- `expose_json`
  - a command that provides an ability to define config settings by loading them from a json file
    where the concrete settings depends on the chosen environment;
  - works in `expose_yaml` manner;
- `expose_self`
  - a command that provides an ability to define config settings by loading them from the current file
    where `__END__` instruction is defined (concrete settings dependes on the chosen environment);
  - works with `YAML` format;

### Changed
- `Qonfig::Settings::Callbacks` is thread safe now;
- Minor refactorings;

## [0.13.0] - 2019-08-13
### Added
- Iteration over setting keys (`#each_setting { |key, value| }`, `#deep_each_setting { |key, value| }`);
- Brand new `Validation API`;

### Changed
- Actualized development dependencies;

## [0.12.0] - 2019-07-19
### Added
- Support for **TOML** (`.toml`) format
  - realized as a plugin (`Qonfig.plugin(:toml)`);
  - provides `#save_to_toml`, `#load_from_toml`, `#expose_toml` methods and works in `#*_yaml`-like manner);
  - depends on `gem toml-rb (>= 1)`
- Custom `bin/rspec` command:
  - `bin/rspec -n` - run tests without plugin tests;
  - `bin/rspec -w` - run all tests;
- Added more convinient aliases for `Qonfig::DataSet` instances:
  - `#save_to_yaml` => `#dump_to_yaml`;
  - `#save_to_json` => `#dump_to_json`;
  - `#save_to_toml` => `#dump_to_toml`;
### Changed
- Actualized development dependencies;

## [0.11.0] - 2019-05-15
### Added
- `#save_to_json` - save configurations to a json file (uses native `::JSON.generate` under the hood);
- `#save_to_yaml` - save configurations to a yaml file (uses native `::Psych.dump` under the hood);

### Changed
- new `#to_h` signature: `#to_h(key_transformer:, value_transformer:)`
  - `:key_transformer` - proc object used for key pre-processing (`-> (key) { key }` by default);
  - `:value_transformer` - proc object used for value pre-processing (`-> (value) { value }` by default);

## [0.10.0] - 2019-02-26
### Added
- `#slice_value` - get a slice of config options as a hash set and fetch the required value using the given key set;

## [0.9.0] - 2018-11-28
### Added
- `#slice` - get a slice of config options as a hash set (works in a `#dig` manner);

## [0.8.0] - 2018-11-21
### Changed
- `expose_yaml`, `load_from_yaml`, `load_from_json` and `load_from_self` treats empty hash (`{}`)
  as an option with empty hash value (previously treated as a nested setting without options);

## [0.7.0] - 2018-10-20
### Added
- `expose_yaml` - a command that provides an ability to define config settings
  by loading them from a yaml file where the concrete settings depends on the chosen environment;

## [0.6.0] - 2018-08-22
### Added
- `#shared_config` - instance method that provides an access to the class level config
  object from `Qonfig::Configurable` instances;

## [0.5.0] - 2018-07-27
### Added
- `load_from_json`- a command that provides an ability to define config settings
  by loading them from a json file (in `load_from_yaml` manner);

### Changed
- Support for Ruby 2.2 has ended;

## [0.4.0] - 2018-06-24
### Added
- Introduce Plugin Ecosystem (`Qonfig::Plugins`):
  - load plugin: `Qonfig.plugin('plugin_name')` or `Qonfig.plugin(:plugin_name)`;
  - get registered plugins: `Qonfig.plugins #=> array of strings`

## [0.3.0] - 2018-06-13
### Added
- Improved configuration process: `#configure` can take a hash as a configuration `[option key => option]`
  map of values;

### Changed
- `#clear!` causes `Qonfig::FrozenSettingsError` if config object is frozen;

## [0.2.0] - 2018-06-07
### Added
- Instant configuration via block `config = Config.new { |conf| <<your configuration code>> }`;
- `.load_from_env` command - an ability to define config settings by loading them from ENV variable;
- `.load_from_yaml` command - an ability to define config settings by loading them from a yaml file;
- `.load_from_self` command - an ability to load config definitions form the YAML
  instructions written in the file where the config class is defined (`__END__` section);
- `#reload!` - an ability to reload config isntance after any config class changes and updates;
- `#clear!` - an ability to set all options to `nil`;
- `#dig` - an ability to fetch setting values in `Hash#dig` manner
  (fails with `Qonfig::UnknownSettingError` when the required key does not exist);
- Settings as Predicates - an ability to check the boolean nature of the config setting by appending
  the question mark symbol (`?`) at the end of setting name:
  - `nil` and `false` setting values indicates `false`;
  - other setting values indicates `true`;
  - setting roots always returns `true`;
  - examples:
    - `config.settings.database.user # => nil`;
    - `config.settings.database.user? # => false`;
    - `config.settings.database.host # => 'google.com'`;
    - `config.settings.database.host? # => true`;
    - `config.settings.database? # => true (setting with nested option (setting root))`
- Support for ERB instructions in YAML;
- Support for `HashWithIndifferentAccess`-like behaviour;
- `Qonfig::Settings` instance method redefinition protection: the setting key can not
  have a name that matches an any instance method name of `Qonfig::Settings`;
- Added `Qonfig::Configurable` mixin - configuration behaviour for any classes and modules
  and their instances:
  - all `Qonfig`-related features;
  - different class-level and instance-level config objects;
  - working class-level inheritance :);
- Full thread-safe implementation;

### Changed
- Superclass of `Qonfig::FrozenSettingsError` (it was `Qonfig::Error` before):
  - `ruby >= 2.5` - inherited from `::FrozenError`;
  - `ruby < 2.5` - inherited from `::RuntimeError`;
- `.setting` will raise exceptions immediately:
  - `.setting(key, ...) { ... }` - if setting key has incompatible type;
  - `.compose(config_class)`- if composed config class is not a subtype of `Qonfig::DataSet`;

### Fixed
- Recoursive hash representation with deep nested `Qonfig::Settings` values (infinite loop);
- Fixed re-assignment of the options with nested options (losing the nested options
  due to the instance configuration). Now it causes `Qonfig::AmbigousSettingValueError`.

## [0.1.0] - 2018-05-18
- Release :)

gha_language: Ruby


text:
# Jobs

### `cozy.clients.jobs.count(workerType)`

`cozy.clients.jobs.count` returns the number of jobs in the queue for `workerType`.

```javascript
const nb = cozy.client.jobs.count('sendmail')
console.log(`There are ${count} mails waiting to be sent`)
```

### `cozy.clients.jobs.create(workerType, arguments, options)`

`cozy.clients.jobs.create` enqueues a job in the queue for `workerType`.

```javascript
const job = cozy.client.jobs.create('sendmail', {
  mode: 'from',
  to: [
    { name: 'Support', email<EMAIL_ADDRESS>}
  ],
  subject: 'Ask support for cozy-desktop',
  parts: [
    { type: 'text/plain', body: 'Hello, I would like some help' }
  ]
})
```

See [the cozy-stack documentation](https://docs.cozy.io/en/cozy-stack/jobs/#post-jobsqueueworker-type) for more informations

repository: cozy/cozy-client-js

repo_name: cozy/cozy-client-js