text:
# find3 android app

This is the open-source minimal Android app for using with [FIND3](https://github.com/schollz/find3). This app will allow you to use your phone to
perform constant scans of Bluetooth and WiFi signals and levels that can be associated with certain locations in your home to allow internal positioning.

To get started with this app, use Android Studio 3+ and "Import Project" after downloading the Git repository.

# Roadmap

- [x] Get locations for a family after it is typed in, and use those for autocompletion.

# Documentation

https://find3.internalpositioning.com/doc/tracking_your_phone.md

# License

MIT

gha_language: Java


text:
aE2 (Arduino-E2)
=============

A simple Arduino E2 bus library.

## E2Device
This library allows you to communicate with sensor devices using the proprietary E2 bus protocol. This protocol is used by sensors from the manufacturer [E + E Elektronik Ges.m.b.H](https://www.epluse.com) and is quite similar to the I2C bus. It is possible to control devices with two general-purpose I/O pins.

This bit-banging library is based on a similar software by<EMAIL_ADDRESS>hosted at <https://github.com/ubiant/E2>. The key differences are subsumized in the notes below. The original library was  never released.

## Key features

* Clean API
* Sensor identification possible
* No additional dependencies (except Arduino.h)

### Constructor

* `E2Device(int SDA, int SCL)`
Creates a new instance of this class taking numbers of two GPIO pins (for data and clock line, respectively) as parameters.

### Methods (Getters)

* `getTemperature()`
  Returns the temperature reading in °C as float. On error `-300` is returned.

* `getHumidity()`
  Returns the relative humidity in % as float. On error  `-1` is returned.

* `getStatus()`
  Returns the status of the sensor as a byte. On error `0xFF`  is returned.

* `getSensorType()`
  Returns the type designation of the sensor as String. On error `"???"` is returned.

* `getSerialNumber()`
  Returns the serial number of the sensor as String. On error `"???"` is returned.

* `getFirmware()`
  Returns the firmware version of the sensor as String. On error `"???"` is returned.

* `getSensorDescription()`
  Returns a full description of the sensor. This function is a combination of the three preceeding getters.

### Notes

The library was tested with different versions of the E+E EE-07 temperature and humidity sensor. Some methods make use of undocumented calls and my not work with each sensor type.

Support of CO2 sensors and on-sensor memory modification was removed from this version.

### Usage

Consult the provided example which show the use of this class.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
[quickjs-emscripten](../README.md) / [Exports](../modules.md) / Scope

# Class: Scope

Scope helps reduce the burden of manually tracking and disposing of
Lifetimes. See [withScope](Scope.md#withscope). and [withScopeAsync](Scope.md#withscopeasync).

## Implements

- [`Disposable`](../interfaces/Disposable.md)

## Table of contents

### Constructors

- [constructor](Scope.md#constructor)

### Accessors

- [alive](Scope.md#alive)

### Methods

- [dispose](Scope.md#dispose)
- [manage](Scope.md#manage)
- [withScope](Scope.md#withscope)
- [withScopeAsync](Scope.md#withscopeasync)
- [withScopeMaybeAsync](Scope.md#withscopemaybeasync)

## Constructors

### constructor

• **new Scope**()

## Accessors

### alive

• `get` **alive**(): `boolean`

#### Returns

`boolean`

#### Implementation of

[Disposable](../interfaces/Disposable.md).[alive](../interfaces/Disposable.md#alive)

#### Defined in

[ts/lifetime.ts:265](https://github.com/justjake/quickjs-emscripten/blob/main/ts/lifetime.ts#L265)

## Methods

### dispose

▸ **dispose**(): `void`

Dispose of the underlying resources used by this object.

#### Returns

`void`

#### Implementation of

[Disposable](../interfaces/Disposable.md).[dispose](../interfaces/Disposable.md#dispose)

#### Defined in

[ts/lifetime.ts:269](https://github.com/justjake/quickjs-emscripten/blob/main/ts/lifetime.ts#L269)

___

### manage

▸ **manage**<`T`\>(`lifetime`): `T`

Track `lifetime` so that it is disposed when this scope is disposed.

#### Type parameters

| Name | Type |
| :------ | :------ |
| `T` | extends [`Disposable`](../interfaces/Disposable.md) |

#### Parameters

| Name | Type |
| :------ | :------ |
| `lifetime` | `T` |

#### Returns

`T`

#### Defined in

[ts/lifetime.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/ts/lifetime.ts#L260)

___

### withScope

▸ `Static` **withScope**<`R`\>(`block`): `R`

Run `block` with a new Scope instance that will be disposed after the block returns.
Inside `block`, call `scope.manage` on each lifetime you create to have the lifetime
automatically disposed after the block returns.

**`warning`** Do not use with async functions. Instead, use [withScopeAsync](Scope.md#withscopeasync).

#### Type parameters

| Name |
| :------ |
| `R` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `block` | (`scope`: [`Scope`](Scope.md)) => `R` |

#### Returns

`R`

#### Defined in

[ts/lifetime.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/ts/lifetime.ts#L205)

___

### withScopeAsync

▸ `Static` **withScopeAsync**<`R`\>(`block`): `Promise`<`R`\>

Run `block` with a new Scope instance that will be disposed after the
block's returned promise settles. Inside `block`, call `scope.manage` on each
lifetime you create to have the lifetime automatically disposed after the
block returns.

#### Type parameters

| Name |
| :------ |
| `R` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `block` | (`scope`: [`Scope`](Scope.md)) => `Promise`<`R`\> |

#### Returns

`Promise`<`R`\>

#### Defined in

[ts/lifetime.ts:242](https://github.com/justjake/quickjs-emscripten/blob/main/ts/lifetime.ts#L242)

___

### withScopeMaybeAsync

▸ `Static` **withScopeMaybeAsync**<`Return`, `This`, `Yielded`\>(`_this`, `block`): `Return` \| `Promise`<`Return`\>

#### Type parameters

| Name |
| :------ |
| `Return` |
| `This` |
| `Yielded` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `_this` | `This` |
| `block` | `MaybeAsyncBlock`<`Return`, `This`, `Yielded`, [[`Scope`](Scope.md)]\> |

#### Returns

`Return` \| `Promise`<`Return`\>

#### Defined in

[ts/lifetime.ts:218](https://github.com/justjake/quickjs-emscripten/blob/main/ts/lifetime.ts#L218)

repository: justjake/quickjs-emscripten

branch_name: refs/heads/main

gha_language: C

gha_license_id: NOASSERTION

repo_name: justjake/quickjs-emscripten


text:
---
title: "Another correction for Bitcoin, is this the final top?"
categories: [trading, technical-analysis]
tags: [bitcoin]
header:
  teaser: /posts-images/2021-02-28-analysis.png
---

The last post I made we were discussing whether this will be another short bull rally and that the top has been reached. Well, now we know, the bull market
isn't over yet with 95% confidence.

So our goal now is to take advantage of these pitstops to earn some profit selling and then re-buying or what you call shorting/ fading the market.

[You should really trade in your sleep](/copy-my-trades/){: .btn .btn--success}

The end of the #Bitcoin bull cycle usually sees the highest volume, this week is not it. Buyers are probably are in the "panic buy later" mode. pic.twitter.com/sbVPb3LlnZ
— Bitcoin Master (@drei4u) February 26, 2021

Let's talk about triangles and letter "M". Bitcoin loves making triangles and Ms every so often at some price level.

[![bull]({{ site.baseurl }}/posts-images/2021-02-28-letter-M.png "get rich")]({{ site.baseurl }}/posts-images/2021-02-28-letter-M.png)
[![bull]({{ site.baseurl }}/posts-images/2021-02-28-letter-M02.png "get rich")]({{ site.baseurl }}/posts-images/2021-02-28-letter-M02.png)
[![bull]({{ site.baseurl }}/posts-images/2021-02-28-triangles-again.png "get rich")]({{ site.baseurl }}/posts-images/2021-02-28-triangles-again.png)
[![bull]({{ site.baseurl }}/posts-images/2021-02-28-triangles.png "get rich")]({{ site.baseurl }}/posts-images/2021-02-28-triangles.png)

Now study the following chart, this chart will guide you on where the price action will start forming a triangle. Another thing to consider is the dump fib
retracement which I discussed at the last post. Bitcoin bounces to 0.5 to 0.786 levels all the time, that puts the price of $52k to $54k as a target.

[![bull]({{ site.baseurl }}/posts-images/2021-02-28-analysis.png "get rich")]({{ site.baseurl }}/posts-images/2021-02-28-analysis.png)

repository: andreigi/oliodigest

repo_name: andreigi/oliodigest


text:
# Basic Usage

```
Syntax: colorist convert  [input]        [output]       [OPTIONS]
        colorist identify [input]                       [OPTIONS]
        colorist generate                [output.icc]   [OPTIONS]
        colorist generate [image string] [output image] [OPTIONS]
        colorist modify   [input.icc]    [output.icc]   [OPTIONS]
        colorist calc     [image string]                [OPTIONS]

Basic Options:
    -h,--help                : Display this help
    -j,--jobs JOBS           : Number of jobs to use when working. 0 for as many as possible (default)
    -v,--verbose             : Verbose mode.
    --cmm WHICH,--cms WHICH  : Choose Color Management Module/System: auto (default), lcms, colorist (built-in, uses when possible)
    --deflum LUMINANCE       : Choose the default/fallback luminance value in nits when unspecified (default: 80)
    --hlglum LUMINANCE       : Alternative to --deflum, hlglum chooses an appropriate diffuse white for --deflum based on peak HLG lum.
                               (--hlglum and --deflum are mutually exclusive as they are two ways to set the same value.)

Input Options:
    -i,--iccin file.icc      : Override source ICC profile. default is to use embedded profile (if any), or sRGB@deflum
    --frameindex INDEX       : Choose the source frame from an image sequence (AVIF only, defaults to frame 0)

Output Profile Options:
    -o,--iccout file.icc     : Override destination ICC profile. Disables all other output profile options
    -a,--autograde           : Enable automatic color grading of max luminance and gamma (disabled by default)
    -c,--copyright COPYRIGHT : ICC profile copyright string.
    -d,--description DESC    : ICC profile description.
    -g,--gamma GAMMA         : Output gamma (transfer func). 0 for auto (default), "pq" for PQ, "hlg" for HLG, or "source" to force source gamma
    -l,--luminance LUMINANCE : ICC profile max luminance, in nits. "source" to match source lum (default), or "unspecified" not specify
    -p,--primaries PRIMARIES : Color primaries. Use builtin (bt709, bt2020, p3) or in the form: rx,ry,gx,gy,bx,by,wx,wy
    -n,--noprofile           : Do not write the converted image's profile to the output file. (all profile options still impact image conversion)

Output Format Options:
    -b,--bpc BPC             : Output bits-per-channel. 8 - 16, or 0 for auto (default)
    -f,--format FORMAT       : Output format. auto (default), avif, bmp, jpg, jp2, j2k, png, tiff, webp
    -q,--quality QUALITY     : Output quality for supported output formats. (default: 90)
    -r,--rate RATE           : Output rate for for supported output formats. If 0, codec uses -q value above instead. (default: 0)
    -t,--tonemap TM          : Set tonemapping. auto (default), on, or off. Tune with optional comma separated vals: contrast=1.0,clip=1.0,speed=1.0,power=1.0
    --yuv YUVFORMAT          : Choose yuv output format for supported formats. 444 (default), 422, 420, yv12
    --quantizer MIN,MAX      : Choose min and max quantizer values directly instead of using -q (AVIF only, 0-63 range, 0,0 is lossless)
    --tiling ROWS,COLS       : Enable tiling when encoding (AVIF only, 0-6 range, log2 based. Enables 2^ROWS rows and/or 2^COLS cols)
    --codec READ,WRITE       : Specify which internal codec to be used when decoding (AVIF only, auto,auto is default, see libavif version below for choices)
    --speed SPEED            : Specify the quality/speed tradeoff when encoding (AVIF only, [0-10] range. auto = default (let the codec decide), 0=best quality, 10=fastest)

Convert Options:
    --resize w,h,filter      : Resize dst image to WxH. Use optional filter (auto (default), box, triangle, cubic, catmullrom, mitchell, nearest)
    --rotate cwTurns         : Rotate image cwTurns clockwise
    -z,--rect,--crop x,y,w,h : Crop source image to rect (before conversion). x,y,w,h
    --composite FILENAME     : Composite FILENAME on top of input. Must be identical dimensions to input.
    --composite-gamma GAMMA  : When compositing, perform sourceover blend using this gamma (default: 2.2)
    --composite-premultiplied: When compositing, assume composite image's alpha is premultiplied (default: false)
    --composite-tonemap TM   : When compositing, determines if composite image is tonemapped before blend. auto (default), on, or off
    --composite-offset x,y   : When compositing, offsets source image onto destination image
    --hald FILENAME          : Image containing valid Hald CLUT to be used after color conversion
    --stats                  : Enable post-conversion stats (MSE, PSNR, etc)

Identify / Calc Options:
    -z,--rect x,y,w,h        : Pixels to dump. x,y,w,h
    --json                   : Output valid JSON description instead of standard log output

Modify Options:
    -s,--striptags TAG,...   : Strips ICC tags from profile
```

---

# Options

### --cmm, --cms

Choose which color management module to use when performing color math
(`colorist`/`ccmm` or `littlecms`/`lcms`). By default, colorist will try to
use its own internal CMM whenever possible, but will fall back to LittleCMS'
conversion code if the profile contains unsupported tone curves or A2B tags,
etc.

### --deflum, --hlglum

There is no requirement for an ICC profile to contain a `lumi` tag, and in the
case of its absence, colorist must internally supply a default/fallback
luminance in order for any calculations to make sense. Setting `--deflum`
allows the user to specify how bright any profiles without a lumi tag should
be considered to be.

When converting to or from HLG with unspecified luminance (recommended), the
current default luminance value (set with `--deflum`) is used for diffuse
white, which maps to a 75% signal in HLG, and the max luminance is calculated
with it. If you want to choose a max luminance in which to scale absolute
luminance images into HLG, use `--hlglum` and provide the luminance you'd
like a 100% HLG signal to represent (during conversion).

Example: If a display renders diffuse white at 203 nits, it will render a
75% HLG signal at 203 nits, and a 100% HLG signal at 1000 nits. Therefore,
`--hlglum 1000` is synonymous with `--deflum 203`.

### -a, --autograde

Enable automatic color grading. "Grading" is currently a bit overstated, but
the tool's name is "colorist" and it is close enough to one potential goal of
color grading, and leaves room for further enhancements. The general idea is
to choose an "optimal" (read: better) tone curve and max luminance during the
conversion process.

 By default, `convert` will try to use
the bit depth of the source image, and `generate` will choose an 8-bit image.
In either case, choosing an output file format incapable of 16-bit will
automatically force it to 8-bit. Currently, only J2K/JP2 supports bpc (9-15).

### -c, --copyright

Write a copyright into the copyright tag (`cprt`) of the ICC profile of any
output file generated. If not used, the copyright tag will default to whatever
[LittleCMS](http://www.littlecms.com/) uses for its default ("No copyright,
use freely").

### -d, --description

Write a description into the description tag (`desc`) of the ICC profile of
any output file generated. If not used, Colorist will make one up based on the
contents of the ICC profile.

### -f, --format

Force a specific output file format. Most of the time this is not required as
Colorist will infer the format from the output file extension, but if you
wanted to choose a nonstandard output filename, this is the switch for you.

### -g, --gamma

Choose a specific gamma curve for the tone curves in the ICC profile (for all
channels). Similar to `-b`, `convert` will try to use the source image's gamma
by default, and `generate` will use a gamma of 2.4 as it is sRGB's gamma (very
common).

### -h, --help

Show the help/syntax text shown in Basic Usage, and quit.

### -j, --jobs

Choose the number of threads to spawn when performing any operation that has
been multithreaded, such as pixel transformations or automatic grading. By
default, Colorist chooses the number of cores available in the system. Running
`colorist -h` will show how many cores Colorist detects (and will use by
default) after displaying the syntax.

### --json

When using `identify` or `calc`, this will disable all log output and instead
emit a single JSON object output that contains the requested information. If
an error occurs, the JSON will only contain a single key named "error".

### -l, --luminance

Set a max luminance in the lumi tag of the ICC profile, and use this max in
any luminance scaling that needs to be performed. For example, if the source
image's max luminance claims to be 10,000 nits and you specify `-l 300` for
the output luminance, all pixels in the scene will have their luminance scaled
up and either clipped or tonemapped to 300 nits (see `-t`).

Leveraging this option along with `--deflum` should allow for smooth
conversions to and from relative luminance images.

### -p, --primaries

Sets the color primaries for the output ICC profile, in the form
`rx,ry,gx,gy,bx,by,wx,wy`. These values are readily available for any RGB
color space (ex. [Rec
709](https://en.wikipedia.org/wiki/Rec._709#Primary_chromaticities)'s color
space parameters). Specifying this in `convert` will almost certainly cause a
color space conversion to occur.

There are a handful of builtin primaries for convenience:

* `bt709`  - [BT. 709](https://en.wikipedia.org/wiki/Rec._709#Primary_chromaticities)
* `bt2020` - [BT. 2020](https://en.wikipedia.org/wiki/Rec._2020#System_colorimetry)
* `p3`     - [DCI-P3](https://en.wikipedia.org/wiki/DCI-P3#System_colorimetry)

### -n, --noprofile

By default, colorist will try to write an ICC profile to the destination file,
even if it is sRGB. This disables all ICC profile chunk writing.

### -q, --quality

Choose a lossy quality (0-100) for any output file format that supports it
(JPG, JP2 if not using `-2`, WebP). The lower the value, the lower the file
size and quality. For WebP and JP2 (without `-2`), 100 is lossless.

See `--quantizer` for an explanation of how quality is mapped to AVIF encoding.

### -r, --rate

Choose a "rate" for JP2 output compression. This effectively puts a hard
ceiling on the size of the output JP2 file, and can be treated as a divisor on
the input source data. For example, a 3840x2160, 16-bit image is (3840 \* 2160
\* 8 == 66,355,200) bytes in size (~63 MB). Specifying `-2 200` will make the
output file size roughly (66,355,200 / 200 = 331776) bytes, or 324 KB.

The JP2 compressor will do everything it can to blur/ruin your image if you
don't give it enough breathing room, but it *will* hit your requested rate.
Also, be sure to experiment to make sure my math isn't really wrong.

### --resize

Resizes the destination image during conversion. `-r` expects 1-2 numbers,
either comma separated or in the form `WxH`, representing the destination
dimensions. If either of the dimensions is absent, colorist will use the
aspect ratio of the source image to choose an appropriate value for the other
dimension.

A third, optional argument (separated from the dimensions with a comma) can
specify the filter to be used when resizing. This is the list of valid filter
values (explanations here taken directly from [STB library's](https://github.com/nothings/stb/) image_resize):

* `box`          - A trapezoid w/1-pixel wide ramps, same result as box for integer scale ratios
* `triangle`     - On upsampling, produces same results as bilinear texture filtering
* `cubic`        - The cubic b-spline (aka Mitchell-Netrevalli with B=1,C=0), gaussian-esque
* `catmullrom`   - An interpolating cubic spline
* `mitchell`     - Mitchell-Netrevalli filter with B=1/3, C=1/3
* `nearest`      - nearest neighbor (pixel art)

If unspecified or `auto` (default), colorist will use `catmullrom` for scaling
up, and `mitchell` for scaling down.

### -t, --tonemap

Forces tonemapping to be on or off. When scaling from a large luminance range
down to a smaller range, any values that are too bright will not "fit" in the
new range. With tonemapping disabled, those pixels will simply be clipped to
the max value, but any pixels that do fit in the smaller range will be
untouched. With tonemapping enabled, the entire image is subtly darkened to
make room for a a bit of extra granularity in the top of the smaller range,
which is used to distinguish super bright pixels. This spares having large
white blobs of no definition from being in the converted image at the cost
of a bit of darkening.

Automatic grading will automatically turn this off if you allow it to choose a
max luminance, as it will never choose a luminance that will cause a pixel to
clip. Use this switch (`-t off`) to achieve this with a manually specified max
luminance.

### --yuv

Choose yuv output format for supported formats. auto (default), 444, 422, 420, yv12

### --quantizer MIN,MAX

Quantizer Ranges: 0-63

The quality emitted by AVIF encoder is controlled by two quantizer values (a
minimum and maximum). The higher these numbers are, the worse the image
quality will be. For example, choosing [0,0] will create a lossless AVIF, and
choosing [63,63] will encode something that barely looks like the original image.

If this option isn't used, colorist will map the single `-q` quality value to
these, by slowly ramping up the maximum quantizer first as you turn down the
quality from 100, until it caps out at 63 (e.g. Q=99 will have a max quantizer
of 1). The min quantizer will begin to ramp up from 0 in the 60s until it hits
63 right at Q=1, making Q=1 have quantizer settings of [63,63].

Due to how the encoder uses these values, there can be a bit of a plateau in
the Q30-Q50 range, but dual ramp provides a reasonable single dial for
quality. Q100->Q60 has a reasonable descent in quality, and Q30->Q1 really
trashes the image.

Use this option if you want to specify your own min/max quantizers instead.

### --tiling

AVIF only. Enables tiling when encoding, and is log2 based (as these values
are simply passed through to the encoder and it requests it as such).

Example: `--tiling 2,3` will create 4 rows and 8 columns during encoding.

### -v, --verbose

Verbose mode. Ironically, that's it for this one.

### -z, --rect, --crop

When using `identify`, it will dump the basic information about the image such
as the dimensions, bit depth, and embedded ICC profile. By default, it also
dumps the colors of a handful of pixels from the upper left corner. If you
want to choose an alternate rectangle for that pixel information, use this.
Choosing a width and height of 0 will disable pixel dumping during identify
(`-z 0,0,0,0`).

When using `convert`, it will crop the source image (prior to conversion) to
the requested rect.

### --composite, --composite-gamma, --composite-premultiplied, --composite-tonemap

After converting the source image to the destination profile, but before
writing it out to disk, this will read in a second image file and composite it
on top of the image. The composite image is first converted into the same
destination profile, then the two images are blended in a blend-friendly gamma
space (chosen by `--composite-gamma`). By default, the composite image is
assumed to not be premultiplied alpha, but it can be enabled with
`--composite-premultiplied`. If the composite image is a larger luminance range
than the destination profile's max luminance, how tonemapping should behave
can be adjusted with `--composite-tonemap`.

Currently, this command requires that the composite image is the already same
dimensions as the destination (post-conversion/resize) image.

### --hald FILENAME

A Hald CLUT is a 3D color lookup table; effectively a 3D texture (a cube of
colors) laid out correctly in a regular image. Nobody seems to know where the
name "Hald" came from.

When using this option, just before writing to disk, colorist will "look up"
every pixel's final raw value in the Hald and replace it with the interpolated
value sampled from it.

---

# Image Strings

The `generate` command offers a means to create basic test images, using an
"image string" as its input. The general idea of an image string is to
describe a big list of colors along with (optional) image dimensions, and to
spread those colors across the image as evenly as possible. The goal is to be
able to make **simple test images** as *tersely* as possible, but if you're
stubborn enough, you can probably make almost anything.

As a basic reminder, this is the form of the command:

`colorist generate "#ff0000" image.png`

In the above commandline `"#ff0000"` is the image string. Whether or not the
quotes are necessary is up to your shell, but it good practice to use them. It
specifies a single color in the typical web color format used in CSS, one of
many ways to specify a color. Since this is the only information in the image
string, Colorist will count a total of 1 color in the color list, and will
select a 1x1 16-bit image to house this single color. Any of the other options
specified above will inform these decisions, such as making an 8-bit image
with `-b 8`.

Let's add some more information:

`colorist generate "1024x1024,#ff0000" image.png`

Colorist will count a total of 1 color in the color list, and instead of
choosing a 1x1 image to spread the colors across, it'll honor the 1024x1024
dimensions request, so it'll just fill the whole image with red.

*Quick tips:*
* A fourth hex pair is allowed to specify an alpha channel (such as `#ff000080` for a half- transparent red).
* The dimensions request can be anywhere in the comma separated list.

How about a second color?

`colorist generate "1024x1024,#ff0000,#00ff00" image.png`

This creates the same 1024x1024 image, but it shares the pixels evenly across
the two colors (red for the first half, then green). Reordering or adding
colors will continue the pattern.

What if I wanted 75% red and 25% green?

`colorist generate "1024x1024,#ff0000,x3,#00ff00" image.png`

The `x3` in there says to pretend that the previous statement was listed three
times in a row. Colorist will then count a total of *four* colors, and will
spread those four colors across the requested image size.

How about a gradient?

`colorist generate "1024x1024,#ff0000..#000000" image.png`

The `..` syntax creates an interpolation (gradient) between the two colors.
Colorist will count 256 images in the color list, and since there are more
than 256 pixels in the requested image, it will spread those evenly across the
image, creating the gradient.

How about two gradients?

`colorist generate "1024x1024,#ff0000..#000000,#000000..#00ff00" image.png`

Colorist counts 512 colors here, and spreads them accordingly. What if I
wanted my red gradient to take up 75%, and the green one only 25%? Let's try
it.

`colorist generate "1024x1024,#ff0000..#000000,x3,#000000..#00ff00" image.png`

Oops! `x3` is making 3 red-to-black gradients, followed by 1 red-to-black
gradient. I didn't want to *repeat* my gradient, I wanted to *stretch* my
gradient.  We can achieve this specifying the color range, such as:

`colorist generate "1024x1024,#ff0000.768.#000000,#000000..#00ff00" image.png`

How about a vertical gradient? This is where basic rotation comes into play.

`colorist generate "1024x1024,#ff0000..#000000,cw" image.png`

This rotates the image clockwise once after generating it. You can use
multiple `cw` or `ccw` statements if you want, but ultimately their rotations
will all be summed up and potentially cancelled out, and a single rotation
will be performed at the end.

How about some color squares for testing?

`colorist generate "400x100,#ff0000,#00ff00,#0000ff,#ffffff" image.png`

A lot of the trick with using image strings is describing a color count that
corresponds evenly with the pixel count of the requested image dimension. Try
to make the color list's count to be a factor of the pixel count for best
results.

There are many ways to define a color. For example, simply parenthesizing
some numbers works!

`colorist generate "1024x1024,(255,0,0),(0,255,0)" image.png`

This should recreate our red/green image from earlier. How about a gradient?

`colorist generate "1024x1024,(255,0,0)..(0,0,0)" image.png`

Another red/green version:

`colorist generate "1024x1024,rgb(255,0,0)..#000000" image.png`

or

`colorist generate "1024x1024,rgb16(65535,0,0)..#000000" image.png`

All possible color formats:

```
#ffffff                               // 8-bit
(255,0,0)                             // 8-bit
rgb(255,0,0)                          // 8-bit
rgba(255,0,0,255)                     // 8-bit
rgb16(65535,0,0)                      // 16-bit
rgba16(65535,0,0,65535)               // 8-bit
f(1.0,0,0)                            // 32-bit, can't be used in a gradient
float(1.0,0,0)                        // 32-bit, can't be used in a gradient
XYZ(0.385127, 0.716909, 0.0970615)    // 32-bit, can't be used in a gradient
xyY(0.321181, 0.597874, 0.716909)     // 32-bit, can't be used in a gradient
```

---

Still want more? Read the [Cookbook](./Cookbook.md)!

repository: joedrago/colorist

repo_name: joedrago/colorist


text:
# Dockerized Platform Scenarios
The following repository contains the dockerized version of most commonly used platform scenarios.
## Demo scenarios
* [API Manager - IS as Key Manager - SSO setup](apim-is-as-keymanager-sso)
* [API Manager approval workflow with BPS server](apim-bps-approval-workflow)
* [BPS BPMN complex workflow setup](bps-bpmn-complex-workflow)
* [API Manager Analytics setup](apim-analytics)
* [EI - MB - Analytics - setup](ei-mb-analytics)
* [EI Quick Start Guide setup](ei-quick-start-guide)
* [EI Distributed Transactions setup](ei-distributed-transactions)

## How to dockerize your demo
Please refer to the guide on [WSO2 Solution Architecture guide](https://sites.google.com/a/wso2.com/solution-architecture/home/sales-tools/demo-index/containerized-demos/guide).

gha_language: JavaScript


text:
---
date: 2020-03-22 12:18
layout: post
title: Autonomous Ethics
subtitle: Ethics in Self Driven Vehicles
description:  This is a blog post on the ethical framework and feasibility in Self Driven Vehicles (SDVs)
image: /assets/img/uploads/blog_6_image.png
optimized_image: /assets/img/uploads/blog_6_image.png
category: blog
tags:
- Ethics
- Autonomous
- Self-Driving
- Cars
- Vehicles

author: deshanlokuge
---

**_Ethics, Life & Death and Self Driving Vehicles ..._**

> A look at the questioning and convoluted ethical paradigms governing the safety and ethical feasibility of self driven automobiles ...

Few decades back we were head over heels to see and hear about cars that drive themselves, that navigated when the driver fell asleep and performed maneuvers without human supervision. This vision of having self-driven automobiles or commonly known as Self-Driven-Vehicles (SDVs) have now become more than a concept and as we all know, the world has embarked on this new endeavour of giving more autonomy to machines to reduce human effort.

It is not a mystery that self-driving cars have become technologically feasible. The million dollar question now is: are they ethically feasible?

**_What is ethical feasibility in SDVs?_**

Mass usage of self-driving vehicles is only a few steps away and regardless of the respective complexity in mechanics and algorithms, the severity dwells where the vehicle has to take life and death decisions that can lead to unpleasant repercussions.

![blog_6_ethical_dilemma](/assets/img/uploads/blog_6_ethical_dilemma.png)

This is because of the conscious decision making process that is inherent in human nature being a serious gap to be bridged once it comes to the ethical frameworks used in the car's decision-making process.

**_The million dollar question_**

In the scope of an unavoidable accident, what is the effect of different ethical frameworks that govern the decision-making of self-driving cars?

**_What exactly is ethics in autonomous ?_**

When observed in a more simpler sense, the concept of ethics used in autonomous cars is simply the morals and values that humans code into the internal functionality of the car itself. It is a known fact that the single most complex barrier in the world of artificial intelligence and artificial general intelligence as a whole is the paradigm of consciousness.

**How do we code consciousness to a machine?**
Now this is the wider array of ambiguity and convolution reside in transferring 100% of ethical thinking of humans to SDVs. It’s the matter of solving the case of transferring the conscious ethical decision making process of humans to an autonomous vehicle to allow making split second, life and death decisions such as a human would.

![moral_machine](/assets/img/uploads/blog_6_moral_machine.png)

To solve this query of how autonomous vehicles should respond during potentially fatal collisions, numerous engineers, computer scientists and AI experts set out to investigate what human drivers would make in a life and death situation. There are even games built to simulate such scenarios and understand how humans across the world would think and act. The [moral machine](http://moralmachine.mit.edu/) by MIT is one such example. This would on the other hand allow the scientists to gather more data and analyze them to get into a more universal understanding of the way humans think as a whole.

**_Different Ethical Frameworks in use as of now_**

![ethics](/assets/img/uploads/blog_6_ethics.png)

As of now, there are widely used ethical frameworks, not entirely isolated from each other but widely used as an ensemble of each with overlapping areas of interest. The most commonly used base ethical frameworks when it comes to autonomous vehicles can be pointed out as follows:

1.Utilitarianism
2.Deontology
3.Relativism
4.Absolutism (monism)
5.Pluralism

I would not go into detail about these ethical frameworks as of now, but if interested a great paper to wrap the head around the complex structure of ethics and autonomy could be found [here](https://arxiv.org/pdf/1802.04103.pdf).

**_Autonomous driving in real life_**

![Alt Text](https://media.giphy.com/media/V73wK25ZAFZ6/giphy.gif)

Recently, Tesla released [this](https://youtu.be/tlThdr3O5Qo) video in which it stated about having achieved **“Full Self-Driving”**.
However the gravity lies in how safe and feasible the vehicle in tackling the spontaneous driving conditions of a real life road.

In a recent article  under the name, [Every Single Self-Driving Car Accident And Death lists](https://www.ranker.com/list/self-driving-car-accidents/eric-vega), it mentions about nine accidents involving autonomous vehicles out of which four caused fatalities.

The most recent fatality it reported was the one involving a Tesla Model X on March 23, 2018. Where the driver of the car died when it hit a highway barrier.

In a holistic viewpoint, the great leap humans have taken into bringing the world of sci-fi to the real world is commendable and fascinating. But at the same time there lies the question of safety and ethical feasibility as much as the technological feasibility is achieved and applicable.

The question still remains at large and the day of complete autonomy in driving with complete ethical feasibility is yet to be achieved.

Feel free to share your thoughts and comments on this and it will be a fruitful discussion to collectively undertake, without a doubt...

gha_language: HTML


text:
## Welcome to Ubuntu Ready

Ubuntu Ready is a minimal version of Ubuntu rootfs for an ARM embedded system(ARMhf and ARM64). I hope it can help people start embedded Linux development quickly.

## Support devices:
Xilinx Zynq-7000, Zynq UltraScale+ MPSoC, Raspberry Pi 2/3, etc.

## Audience:
embedded linux engineers/developers, hobbies, hacker who already familiar with Linux distributions.

## Download & Installation:

### ARMhf
#### Xilinx Zynq-7000

### ARM64
#### Xilinx UltraScale+ MPSoC

### Raspberry Pi
#### [Raspberry Pi 2, 3 and 4 are fully supported by Canonical](https://ubuntu.com/download/raspberry-pi)

#### [Ubuntu releases](https://wiki.ubuntu.com/Releases)

| Version | Code name | Release date | End of Life date |
| ------ | ------ | ------ | ------ |
| Ubuntu 20.04 LTS | Focal Fossa | April 23, 2020| April 2025 |

## Custom Embedded Linux

* [Buildroot](https://buildroot.org/)

## Support or Contact

Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out.

## Contributing
Contributions to this repository are welcomed.
* [Understanding the GitHub Flow](https://guides.github.com/introduction/flow/)
* [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)

repository: xuminready/UbuntuReady

repo_name: xuminready/UbuntuReady


text:
# Maximum likelihood markov random fields

We are given a dataset D and we want to estimate $\theta$ via [maximum likelihood](maximum_likelihood_learning.md). Since we work with exponential families the maximum likelihood is concave. The log likelihood is:

$$
\frac{1}{|D|} \log p(D;\theta) = \frac{1}{|D|}\sum_{x \in D}\theta^T f(x) - Z(\theta)
$$
Here we have two parts:

1. $\frac{1}{|D|}\sum_{x \in D}\theta^T f(x)$. This is the easy part since it is linear in $\theta$ and we can decompose it.

2. $\log Z(\theta) = \log \sum_x \exp(\theta^T f(x))$. This is hard to optimize, and hard to evaluate.

The gradient of the second parts is:

$$
\nabla_{\theta} \log Z(\theta) = E_{x \sim p}[f(x)]
$$

Computing the expectation requires inference with respect to $p$ which in general is intractable, thus computing the gradient is intractable.

We can compute the hessian of $\log Z(\theta)$:

$$
\nabla^2_{\theta} \log Z(\theta) = E_{x \sim p}[f(x)f(x)^T] - E_{x\sim p}[f(x)]E_{x\sim p}[f(x)]^T = \text{cov}[f(x)]
$$

The covariance matrix is always positive-definite, thus $\log Z(\theta)$ is convex (this is also known from the fact that it is an exponential family).

## Summary
Since computing the gradient is intractable the whole optimization problem is hard, even if it is convex.


text:
# Memory Configuration

The second piece of information required to create a Avatar² script is the specification of
a memory layout. Avatar keeps track of all memory ranges and pushes the resulting
memory mapping that combines all ranges down to the individual targets.

## Memory Range Definition

Adding a memory range is straightforward. Assuming the presence of an Avatar²
object named 'avatar', it's enough to add the following line to create a basic
memory area of size 0x1000 at address 0x40000000:

```python
dummy_range = avatar.add_memory_range(0x40000000, 0x1000)
```

Memory ranges are highly flexible and allow for a variety of additional
keywords during their creation, some of which may be used only by
specific classes of targets. Below is a list of all target-independent
keyword arguments which can be used during the creation of a memory range.

| Keyword      | Description                                                               |
|--------------|---------------------------------------------------------------------------|
| name         | An optional name for the memory range                                     |
| permissions  | The permissions in textual representation. Default: 'rwx'                 |
| file         | Path to a file which holds the initial contents for the memory            |
| forwarded    | Whether memory accesses to the range needs to be forwarded to a specific target |
| forwarded_to | If forwarding is enabled, reference to the target that will handle the memory accesses |
| emulate      | Enable avatars peripheral emulation for the given memory range            |

## Memory Forwarding

One of the core features of Avatar² is the separation between execution and
memory accesses. This yields the capability to forward memory accesses
among different targets. For instance, a firmware image can be executed
inside an emulator, while all memory access can be forwarded to the real
physical device.

The forwarding rules themselves are set up during the configuration of the
memory ranges, by using the forwarded and forwarded_to arguments.
Let's assume we are analyzing in QEMU a physical device that contains memory-mapped peripherals.
An exemplary memory range configuration could look like the following:

```python
mmio = avatar.add_memory_range(0x4000000, 0x10000, name='mmio',
                               permissions='rw-'
                               forwarded=True, forwarded_to=phys_device)
ram  = avatar.add_memory_range(0x2000000, 0x1000000, name='ram',
                               permissions='rw-')
rom  = avatar.add_memory_range(0x0800000, 0x1000000, name='rom',
                               file='./firmware.bin',
                               permissions='r-x')
```

## Qemu-Target Peripheral Emulation Ranges

As QEmu is a full system emulator, it also capable of emulating a large set of peripherals.
Logically, Avatar² can take advantage of this feature
by specifying the _target specific keywords_
'qemu\_name' and 'qemu\_properties' parameters on a memory range.

For instance, a very common device which can be emulated in QEmu
instead of forwarding its I/O accesses to the physical device is a serial
interface, as shown in the example below:

```python

# Properties as required by qemu
serial_qproperties = {'type' : 'serial', 'value': 0, 'name':'chardev'}

serial = avatar.add_memory_range(0x40004c00, 0x100, name='usart',
                                 qemu_name='stm32l1xx-usart',
                                 qemu_properties=serial_qproperties,
                                 permissions='rw-')

# Provide serial I/O via tcp
qemu.additional_args = ["-serial", "tcp::1234,server,nowait"]
```

## Avatar² Peripheral Emulation Ranges

Unfortunately, QEmu does not support all existing peripherals nor will every
Avatar² set-up utilize a Qemu target.
As a result Avatar² allows to specify user-defined peripheral implementations
using the AvatarPeripheral class.

To do so, two steps are required:

1. Create a child class from AvatarPeripheral which defines custom read and
write handler in its \_\_init\_\_ function.
2. Pass a reference of this class to the emulate keyword of a memory range.

The example below provides an implementation of a HelloWorldPeripheral, which
returns another part of the string 'Hello World' upon every read.

```python
from avatar2 import *

class HelloWorldPeripheral(AvatarPeripheral):

    def hw_read(self, offset, size):
        ret = self.hello_world[:size]
        self.hello_world = self.hello_world[size:] + self.hello_world[:size]

        # Convert the return value to an integer (py2/py3-compatible)
        # Python >3.2 could just call int.from_bytes(ret, byteorder='little')
        s2fmt = {1: 'B', 2: 'H', 4: 'I', 8: 'Q')
        ret = struct.unpack('<' + s2fmt[size], ret)[0]

        return ret

    def nop_write(self, offset, size, value):
        return True

    def __init__(self, name, address, size, **kwargs):
        AvatarPeripheral.__init__(self, name, address, size)

        self.hello_world=b'Hello World'

        self.read_handler[0:size] = self.hw_read
        self.write_handler[0:size] = self.nop_write

[...]

hw = avatar.add_memory_range(0x40004c00, 0x100, name='hello_world',
                             emulate=HelloWorldPeripheral, permissions='rw-')
```

gha_language: Python


text:
---
title: Scale
---

In the [Deploy Application](../application) section, we use `cpuscaler` trait as an auto-scaler for the sample application.

## Manuel Scale

You can use scale your application manually by using `scaler` trait.

```shell
$ kubectl vela show scaler
# Properties
+----------+--------------------------------+------+----------+---------+
|   NAME   |          DESCRIPTION           | TYPE | REQUIRED | DEFAULT |
+----------+--------------------------------+------+----------+---------+
| replicas | Specify replicas of workload   | int  | true     |       1 |
+----------+--------------------------------+------+----------+---------+
```

Deploy the application.

```yaml
# sample-manual.yaml
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: website
spec:
  components:
    - name: frontend
      type: webservice
      properties:
        image: nginx
      traits:
        - type: scaler
          properties:
            replicas: 2
        - type: sidecar
          properties:
            name: "sidecar-test"
            image: "fluentd"
    - name: backend
      type: worker
      properties:
        image: busybox
        cmd:
          - sleep
          - '1000'
```

Change and Apply the sample application:

```shell
$ kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/docs/examples/enduser/sample-manual.yaml
application.core.oam.dev/website configured
```

After a while, you can see the underlying deployment of `frontend` component has two replicas now.

```shell
$ kubectl get deploy -l app.oam.dev/name=website
NAME       READY   UP-TO-DATE   AVAILABLE   AGE
backend    1/1     1            1           19h
frontend   2/2     2            2           19h
```

To scale up or scale down, you can just modify the `replicas` field of `scaler` trait and apply the application again.


text:
+++
title = "Getting Started"
menuTitle = "Getting Started"
date = 2021-04-21T07:33:04-05:00
weight = 10
chapter = true
pre = "<b>1. </b>"

+++

In this chapter, we'll cover the prerequisites needed to get started with [Amazon DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html). You'll create DynamoDB tables and use a AWS Cloud9 envrironment to query these tables.

The deployment architecture that you will be building in this lab will look like the below.

![Final Deployment Architecture](/images/hands-on-labs/setup/dynamodb_lab_architecture.png)

repository: aws-samples/amazon-dynamodb-labs

repo_name: aws-samples/amazon-dynamodb-labs


text:
# Annotating images (Optional if you want to annotate your own images)

## CVAT

You can use CVAT (Computer Vision Annotation Tool) to annotate images. CVAT supports a variety of annotation tasks, such as bounding box and segmentation. You can install CVAT on your own desktop (as a docker container) by following the instructions at  https://github.com/openvinotoolkit/cvat/blob/develop/cvat/apps/documentation/installation.md.  Alternatively, you can use the online CVAT for your annotation tasks, by registering an account at https://cvat.org The online CVAT however has the following limitations:

- No more than 10 tasks per user
- Maximum 500MB of data

CVAT supports a variety of annotation format, including COCO, PASCAL VOC, YOLO to name just a few.

For our lab exercise, we will use COCO format as it supports both bounding boxes and segmentation for object detection.

## How to use?

You can watch the following videos on how to use CVAT for annotation:

Bounding Box: https://www.youtube.com/watch?v=OMgQ2JzOAWA

Segmentation: https://www.youtube.com/watch?v=9Fe_GzMLo3E

## Organizing your Dataset

It is good practice to name your image files with a sequence number for easy processing later on, e.g. balloon-1.jpg, balloon-2.jpg, etc.

You should separate your images into train and validation set.  Create two different tasks for training set annotation and validation set annotation.

Once you have finished your annotation, you can either export the annotation file (which is a JSON file) or export the dataset (which includes both the annotation and images).

It is recommended you export as a dataset as the zip file contains the folder structure that we can just copy over to the project folder.


text:
# k-means benchmark

A Futhark implementation of k-means clustering written with
generalized histograms ([kmeans.fut](kmeans.fut)), compared to an
implementation that makes calls to the
[kmcuda](https://github.com/src-d/kmcuda) library
([kmeans-kmcuda.c](kmeans-kmcuda.c)).

The Makefile here should automatically download and compile the kmcuda
library.  Note that kmcuda appears very picky about the NVIDIA compute
architecture, which must match the hardware being used, and specified
at compile time.  You may need to modify the `KMCUDA_CUDA_ARCH`
variable in [Makefile](Makefile) to suit your GPU.

## TL;DR

Run `make` to produce a summary of the runtimes, including a speedup,
corresponding to the entries on Table III.

license: ISC


text:
---
metaTitle: "Entity Framework - Managing entity state"
description: "Setting state Added of a single entity, Setting state Added of an object graph"
---

# Managing entity state

## Setting state Added of a single entity

`EntityState.Added` can be set in two fully equivalent ways:

By setting the state of its entry in the context:

```cs
 context.Entry(entity).State = EntityState.Added;

```

By adding it to a `DbSet` of the context:

```cs
 context.Entities.Add(entity);

```

When calling `SaveChanges`, the entity will be inserted into the database. When it's got an identity column (an auto-set, auto-incrementing primary key), then after `SaveChanges`, the primary key property of the entity will contain the newly generated value, **even when this property already had a value**.

## Setting state Added of an object graph

Setting the state of an **object graph** (a collection of related entities) to `Added` is different than setting a single entity as `Added` (see [this example](http://stackoverflow.com/documentation/entity-framework/5256/managing-entity-state/18713/setting-state-added-of-a-single-entity#t=201608061947239551134)).

In the example, we store planets and their moons:

**Class model**

```cs
public class Planet
{
    public Planet()
    {
        Moons = new HashSet<Moon>();
    }
    public int ID { get; set; }
    public string Name { get; set; }
    public ICollection<Moon> Moons { get; set; }
}

public class Moon
{
    public int ID { get; set; }
    public int PlanetID { get; set; }
    public string Name { get; set; }
}

```

**Context**

```cs
public class PlanetDb : DbContext
{
    public property DbSet<Planet> Planets { get; set; }
}

```

We use an instance of this context to add planets and their moons:

### Example

```cs
var mars = new Planet { Name = "Mars" };
mars.Moons.Add(new Moon { Name = "Phobos" });
mars.Moons.Add(new Moon { Name = "Deimos" });

context.Planets.Add(mars);

Console.WriteLine(context.Entry(mars).State);
Console.WriteLine(context.Entry(mars.Moons.First()).State);

```

Output:

```cs
Added
Added

```

What we see here is that adding a `Planet` also sets the state of a moon to `Added`.

When setting an entity's state to `Added`, all entities in its navigation properties (properties that "navigate" to other entities, like `Planet.Moons`) are also marked as `Added`, **unless they already are attached to the context**.

#### Remarks

Entities in Entity Framework can have various states that are listed by the [System.Data.Entity.EntityState](https://msdn.microsoft.com/en-us/library/system.data.entity.entitystate(v=vs.113).aspx) enumeration. These states are:

```cs
Added
Deleted
Detached
Modified
Unchanged

```

Entity Framework works with POCOs. That means that entities are simple classes that have no properties and methods to manage their own state. Entity state is managed by a context itself, in the `ObjectStateManager`.

This topic covers various ways to set entity state.

repository: haifenghuang/generate

repo_name: haifenghuang/generate


text:
---
layout: post
title: Bulk import YAML pipelines in Azure DevOps
tags: [pipelines]
---
If you import or fork a repository with many YAML pipelines you will soon face this issue...

> How can I import all these pipelines?

Doing it manually would be quite tedious, so you should use the APIs. Or, even better, the Azure DevOps CLI!

Assuming you are going to get a list of paths in a standard format, you can run this simple PowerShell script from a local copy of your Git repository...

```
$pipelines = <your paths/pipelines/names/etc - something to uniquely identify your pipelines>

foreach ($p in $pipelines){
    az pipelines create --name $p --description "Pipeline for $p" --repository <your clone URL> --branch <branch> --folder-path <folder destination for pipelines> --yaml-path <the path where $p is> --skip-run
}
```
As simple as this is, it is quite a valuable script.
Given a source of standard paths or pipeline names (you need to build it as you like), it is going to create new pipelines importing the existing YAML files, sorting them into the destination folders you like in Azure Pipelines and skipping the initial run so you are not going to overwhelm your agent pool.

gha_license_id: MIT


text:
---
layout: page
title: Math Prerequisites
nav_exclude: true
description: The prerequisites for the class.
---
# Math Prerequisities #
#### A. Adhikari ####
{:.no_toc}

## Table of Contents
{: .no_toc .text-delta }

- TOC
{:toc}

**The [course](/textbook) assumes [fluency](/resources/fluency) with all of the math below.** These concepts, results, and methods will be used without explanation. If you've forgotten some of it, please review the relevant materials. The more confident you are with this math content, the faster you will be able to grasp the material of the course.

**Please do the exercises.** They are based on calculations that come up frequently.

Being able to **assess your own work** is an important mathematical skill and will be crucial in this course. If your answer to an exercise below doesn't match the one provided, or if you can't get started on an exercise,

- don't ask for a detailed solution.
- Remember that this is prereq material: you could do this stuff once upon a time. Maybe go back to your own previous class notes if you have them, or review the summaries here again, and examine your answer.
    - Which results did you use, and why?
    - Did you try a simpler version of the problem for which you can check your answer long-hand, for example by writing out all possibilities?
    - Did you draw a diagram?
    - Is your answer too big, or too small? Try to figure out which one, as it can help point out your error. If you can compare the question with another related one, that also can sometimes help explain the difference.
- After going through the above, try the exercise again a couple of times.
- If it still doesn't work out, post on Piazza explaining the reasoning that you used and which of the above steps you took to troubleshoot.

## Chapters 1-9, 12-14 ##

### Basic Counting ###

The number of finite sequences and subsets that can be created out of a finite set of objects:

**Review:** [Notation and Fundamental Properties](http://stat88.org/textbook/content/Chapter_03/00_Random_Counts.html).

Notice the distinction between *sequences* (orderings, or "arrangements in a line") and *subsets* (unordered collections). You have to decide which is appropriate, by looking carefully at the context. In some probability calculations it won't matter which you decide to use, as long as you are consistent in the numerator and denominator of your proportions.

**Exercise BC1:** How many different ways are there to arrange six people

**a)** in a row?

**b)** in a circle?

        Answer BC1

    a) 720

    b) 120

**Exercise BC2:** A committee consists of six women and four men. How many different choices can be made if you want to select

**a)** a Chairperson and an Assistant Chairperson?

**b)** a subcommittee of two people?

**c)** a subcommittee of three men and three women?

    Answer BC2
    a) 90

    b) 45

    c) 80

###  Sums ###
Summation notation will be used throughout the term. For Chapters 1-7 you just need the following.

**Review:** [Terrific notes](http://www.cs.yale.edu/homes/aspnes/pinewiki/attachments/SummationNotation/summation-notation.pdf) by Prof. [James Aspnes](http://www.cs.yale.edu/homes/aspnes/) of Yale's CS department

"Sigma notation" is simply a compact way of making "..." precise when you are adding a bunch of terms. You've known the properties of sums since you started addition and multiplication in elementary school. The notation allows you to express those calculations concisely and precisely when the number of terms is large or when the terms being added are themselves functions.

- Review the definition in the first sentence of the notes.
- Then go to Section 1.4 which has standard notation that we will use.
- You should understand (not just memorize) the first two sums in Section 2.1 on Page 5, and the first two identities in Section 2.2 on Page 6. There's a typo in the second one. It should read

$$
\sum_{i \in S} (x_i + y_i) ~ = ~ \sum_{i \in S} x_i + \sum_{i \in S} y_i.
$$

- Section 2.3 has excellent advice.
- In [Chapter 4](http://prob140.org/textbook/content/Chapter_04/01_Joint_Distributions.html) of the textbook you'll start working with double sums. The main idea is in Section 1.7 on Pages 4-5 of the Prof. Aspnes notes linked above; note the analogy with nested `for` loops. Useful properties are in the latter half of Section 2.2.

**Exercise S1:** Consider the sequence defined by $$c_i =i$$, for $$i=1, 2, \ldots , 10$$. If possible, find $$\sum_{k=1}^{10} c_k$$.  If this is not possible, explain why not.

    Answer S1
    55

**Exercise S2:** Does the expression $$\sum_{n=1}^{10} 2$$ make sense?  If it does, what is its value?

    Answer S2
    20

**Exercise S3:** Let $$\{c\}$$ and $$\{d\}$$ be sequences of real numbers so that

$$
\sum_{i=1}^{100} c_i ~=~ 10 ~~~~\mbox{and} ~~~~~
\sum_{j=1}^{100} d_j ~=~ 20.
$$

**a)** Find the value of $$\displaystyle \sum_{i=1}^{100} (4c_i + 5)$$.

**b)** Find the value of $$\displaystyle \sum_{i=1}^{100} 4c_i ~+~ 5$$.

**c)** Find the value of $$\displaystyle \sum_{i=1}^{100} (4c_i - d_i + 5)$$.

**d)** True or false:

$$
\sum_{i=1}^{100} \sum_{j=1}^{100} (c_i + d_j) ~~=~~
\sum_{i=1}^{100} (c_i + d_i).
$$

If the identity is true, find the common value of the two sides. If it is false, find the values of the two sides.

    Answer S3
    a) 540

    b) 45

    c) 520

    d) False: \(\displaystyle \sum_{i=1}^{100} \sum_{j=1}^{100} (c_i + d_j)= 3000 \neq 30 = \sum_{i=1}^{100} (c_i + d_i)\)

**Exercise S4:** Fill in the blanks:

$$
\sum_{i=1}^n \sum_{j=i}^n a_{ij}  ~ = ~ \sum_{j = \underline{~~~}}^{\underline{~~~}} \sum_{i = \underline{~~~}}^{\underline{~~~}} a_{ij}.
$$

[Hint: It might help to draw a grid of all $$(i,j)$$ pairs for some small value of $$n$$.]

    Answer S4
    \(\displaystyle \sum_{j = 1}^n \sum_{i = 1}^j a_{ij}\)

### Induction ###

Mathematical induction is a method that is sometimes helpful for proving math statements if:

- You have a guessed a math statement for each positive integer $$n$$, where the $$n$$th statement depends on $$n$$, and
- for small $$n$$ (even just $$n=1$$) you can easily show that the statement is true.

**Review:** A [clear set of notes](http://www.math.utah.edu/mathcircle/notes/induction.pdf) from [Tom Davis](https://mathcircle.berkeley.edu/tom-davis) of the Berkeley Math Circle

- Just go through Pages 1 and 2

The method is always the same.

- Prove the base case.
- Assume the induction hypothesis. That is, assume that the statement is true for a generic integer $$n$$.
- Write the statement for $$n+1$$. This is what you have to prove.
- [This is where the bulk of the work comes in.] Somehow write the statement for $$n+1$$ in terms of the statement for $$n$$ (assumed to be true) and the base case (which you have proved), in such a way that a little algebraic or other mathematical messing around show that the statement for $$n+1$$ is true.

**Exercise I1:** Show by induction that for each positive integer $$n$$,

$$
\sum_{i=1}^n i ~ = ~ \frac{n(n+1)}{2}.
$$

    Answer I1
    The key step is \(\displaystyle \sum_{i=1}^{n+1} i = \sum_{i=1}^n i + (n+1)\).

**Exercise I2:** Apply I1 (no induction necessary) to find

$$
\sum_{i=0}^{n-1} i.
$$

This is the form in which the result first appears in the course, in [Chapter 1](http://prob140.org/textbook/content/Chapter_01/05_An_Exponential_Approximation.html) of the textbook.

**Exercise I3:** Use I1 and properties of sums (no induction necessary) to find a simple expression for the sum of the first $$n$$ ***odd*** integers:

$$
\sum_{i=1}^n (2i-1).
$$

**Exercise I4:** As a check, use induction to prove the formula you got in I3.

### The Exponential and Log Functions ###

**NOTE: All $$\log$$s in this class, and in almost all of math, are natural logarithms taken to the base $$e$$.**

You know that $$\log(1) = 0$$. What we're going to need, quite often, is an approximation for the log of a number that is very close to 1. A crude approximation is 0 because the number is close to 1. But we'll use a finer approximation based on the first couple of terms in a related Taylor expansion.

**Review:** [Graphs and Relevant Properties](http://prob140.org/resources/exponential_approximations/). For now, you need the *Limits and Approximations* section but not the *Bounds*. Preferably, you should understand the approximations in relation to the graphs of $$e^x$$ and $$\log(x)$$.

- In [Chapter 1](http://prob140.org/textbook/content/Chapter_01/05_An_Exponential_Approximation.html) you'll need the approximations.
- Starting with [Chapter 6](http://prob140.org/textbook/content/Chapter_06/06_Law_of_Small_Numbers.html#poisson-approximation-to-the-binomial) you'll need the Taylor expansion of $$e^x$$.

**Exercise EL1:** About how big is

**a)** $$\log(1.01)$$?

**b)** $$\log(0.99)$$?

    Answer EL1
    a) \(0.01\)

    b) \(-0.01\)

**Exercise EL2:** Suppose $$0 < p_n < 1$$ for all $$n$$, $$\lim_{n \to \infty} p_n = 0$$, and $$\lim_{n \to \infty} np_n = \mu$$ for some number $$\mu > 0$$. Find  $$\lim_{n \to \infty} (1 - p_n)^n$$.

[Hint: Start by considering the $$\log$$ of $$(1 - p_n)^n$$. Approximate it for large $$n$$, and then invert.]

    Answer EL2
    \(e^{-\mu}\)

**Exercise EL3:** In EL2, $$1 - p_n \to 1$$ as $$n \to \infty$$, and $$1^n = 1$$ for all $$n$$. So why isn't it true that $$(1 - p_n)^n \to 1$$ as $$n \to \infty$$?

    Answer EL3
    For a fixed power \(m\), it's true that \((1 - p_n)^m \to 1\) as \(n \to \infty\). But in the expression \((1 - p_n)^n\) the power \(n\) isn't fixed. It's going to infinity. So the sequence \((1-p_n)^n\) is pulled in opposite directions: \(1-p_n\) is heading for its upper limit of 1, but it's always less than 1 and so raising it to an increasing power \(n\) keeps pulling it downwards.

**Exercise EL4:** Computers can't do infinite sums (though they can get close numerically, and some symbolic math systems can handle many infinite sums). Find simple expressions for the following sums.

**a)** $$\displaystyle \sum_{n=0}^{\infty} \frac{1}{n!}$$

**b)** $$\displaystyle \sum_{i=0}^{\infty} \frac{2^{3i}}{i!}$$

**c)** $$\displaystyle \sum_{k=2}^{\infty} \frac{3^k}{k!}$$

**d)** $$\displaystyle \sum_{i=0}^\infty \frac{2^i}{(i+1)!}$$

    Answer EL4
    a) \(e\)

    b) \(e^8\)

    c) \(e^3 - 4\)

    d) \(\frac{1}{2}(e^2 - 1)\)

### Geometric Series ###

We'll use the infinite series more frequently than the finite one, starting in [Chapter 8](http://prob140.org/textbook/content/Chapter_08/02_Applying_the_Definition.html#geometric) of the textbook. In fact the infinite series is easier to sum (provided you assume it's finite, which it's fine for you to do), and then you can derive the finite series sum from the infinite one, as in the notes linked below.

**Review:** The main results on Page 6 (Section 2.1) of [Prof. Aspnes notes](http://www.cs.yale.edu/homes/aspnes/pinewiki/attachments/SummationNotation/summation-notation.pdf). Understand the derivation of the infinite sum. That way you'll never have to memorize the results.

**Exercise GS1:** Let $$0 < p < 1$$. Let $$\displaystyle S = \sum_{i=0}^{\infty} p^i$$.

**a)** Find $$S$$.

**b)** Replace the $$?$$ with the appropriate factor: $$\displaystyle \sum_{i=3}^{\infty} p^i  = ? \cdot S$$. Hence find $$\displaystyle \sum_{i=3}^{\infty} p^i$$.

**c)** Find $$\displaystyle \sum_{i=0}^{\infty} p^{3i}$$.

    Answer GS1
    a) \(\dfrac{1}{1-p}\)

    b) The factor is \(p^3\) so the sum is \(\dfrac{p^3}{1-p}\)

    c) \(\dfrac{1}{1-p^3}\)

## Chapters 10-11 ##

### Basic Matrix Operations ###

That's all we'll need for these two chapters. Linear algebra will be used more significantly towards the end of the course.

By the time you get to Chapter 10 you will have realized that probability is all about weighted averages. Matrix representation gives us a compact and powerful way to work with these. For example, suppose $$\mathbf{x} = x_1, x_2, \ldots, x_n$$ is a list of numbers and $$\mathbf{w} = w_1, w_2, \ldots, w_n$$ is a list of weights that add up to $$1$$. Then the dot product $$\mathbf{w\cdot x}$$ is the weighted average of $$\mathbf{x}$$ using $$\mathbf{w}$$ as the weights.

**Review:** It is important to visualize the sizes and shapes of the vectors and matrices involved. Prof. [Semyon Dyatlov](http://math.mit.edu/~dyatlov/) of MIT has a [nice summary](http://math.mit.edu/~dyatlov/54summer10/matalg.pdf) of the basic matrix operations, which I believe was written when he taught Math 54 as a graduate student at Berkeley. Notice that he starts with just the sizes, before going into the algebra.

**Exercise MO1:** Let $$\mathbf{A}$$ be $$n \times m$$ and let $$\mathbf{v}$$ be a vector.

Fill in the first blank with either *row* or *column*, and the second with either $$n$$ or $$m$$.

For $$\mathbf{vA}$$ to make sense, $$\mathbf{v}$$ must be a ______ vector of length ______.

    Answer MO1
    row, \(n\)

In the following exercises, assume the conditions of MO1 and that $$\mathbf{vA}$$ makes sense.

**Exercise MO2:** Fill in the first blank with either *row* or *column*, and the second with either $$n$$ or $$m$$.

$$\mathbf{vA}$$ is a ______ vector of length ______.

    Answer MO2
    row, \(m\)

**Notation** for MO3-MO5: Let $$\mathbf{A}(i, j)$$ be the $$(i, j)$$ element of $$\mathbf{A}$$, $$\mathbf{A}(i, *)$$ the $$i$$th row of $$\mathbf{A}$$, and $$\mathbf{A}(*, j)$$ the $$j$$th column of $$\mathbf{A}$$. Let $$\mathbf{v}(j)$$ be the $$j$$th element of $$\mathbf{v}$$.

**Exercise MO3:** Write the $$j$$th element of $$\mathbf{vA}$$ using sigma notation.

    Answer MO3
    \(\displaystyle \sum_{i=1}^n \mathbf{v}(i)\mathbf{A}(i, j)\)

**Exercise MO4:** True or false: The elements of $$\mathbf{vA}$$ are $$\mathbf{v}\cdot\mathbf{A}(*, 1), \mathbf{v}\cdot\mathbf{A}(*, 2), \ldots, \mathbf{v}\cdot\mathbf{A}(*, m)$$.

    Answer MO4
    True

**Exercise MO5:** Now suppose $$\mathbf{A}$$ is $$n \times n$$ for $$n \ge 5$$. Fill in the first blank with the right coordinates and the second with a matrix:

$$\sum_{k = 1}^n \mathbf{A}(2, k)\mathbf{A}(k, 5)$$ is the ______ element of the matrix ______.

    Answer MO5
    \((2, 5)\), \(\mathbf{A}^2\)

## Chapter 15 onwards ##

### Calculus ###

Here are two excellent resources for refreshing your memory.
- Prof. Paulin's [Math 1A](https://math.berkeley.edu/~apaulin/Teaching.html) lectures; click on Complete Course Video Lectures
- An excellent [single variable calculus](https://ocw.mit.edu/courses/18-01-single-variable-calculus-fall-2006/pages/lecture-notes/) course from MIT

Topics worth remembering:
- The [Fundamental Theorem](https://ocw.mit.edu/courses/18-01-single-variable-calculus-fall-2006/resources/lec20/) of calculus, from the MIT course above
- The [derivative of an inverse function](https://ocw.mit.edu/courses/18-01-single-variable-calculus-fall-2006/resources/lec5/), from the same MIT course; a simple result that has a useful application in probability
- A discussion of the [absolute convergence of integrals](https://web.math.princeton.edu/~nelson/104/ImproperIntegrals.pdf) from [Prof. Edward Nelson](https://web.math.princeton.edu/~nelson/) of Princeton
- A [double integral](https://www.youtube.com/watch?v=YP_B0AapU0c) lecture video by [Denis Auroux](http://people.math.harvard.edu/~auroux/); examples are at 19:40 and 28:15

## Chapter 23 onwards ##

### More Linear Algebra ###

Recall the Basic Matrix Operations, above. You will also need the following summaries of properties.

- [Positive definite matrices](http://wwwf.imperial.ac.uk/~das01/MyWeb/M3S3/Handouts/Positive.pdf) by [Prof. David Stephens](http://wwwf.imperial.ac.uk/~das01/MyWeb/index.html) written when he was at Imperial College
- [Dot Products](http://sites.math.washington.edu/~king/coursedir/m445w04/notes/vector/dotproduct.html) by [Prof. James King](https://math.washington.edu/people/james-r-king) of U. Washington at Seattle.

gha_language: SCSS


text:
TRoLE: Taylor Relaxation Of Loop Ensembles
------------------------------------------

The loops are represented as force-free fields with piece-wise constant alpha profiles before onset of linear instability
and with linear alpha profiles after helicity-conserving Taylor relaxation. A loop can also be described by a smooth alpha profile.

This code was used to generate the results presented in two papers.

1. A nanoflare distribution generated by repeated relaxations triggered by kink instability
http://www.aanda.org/index.php?option=com_article&access=standard&Itemid=129&url=/articles/aa/full_html/2010/13/aa14067-10/aa14067-10.html

2. The Flare-Energy Distributions Generated by Kink-Unstable Ensembles of Zero-Net-Current Coronal Loops
http://www.springerlink.com/content/n658784756q61335/

Version 1.0 of the TRoLE code uses the NAG C library, whereas v2.0, the current version, uses the GNU Scientific Library.

The following commands assume that the user is in the trole directory with the source code in ./trole/src.
Also, GNU Scientific Library v1.16 must be installed in the default locations (i.e., /usr/local/lib and /usr/local/include/gsl).

Setting up the TRoLE environment...

source ./env.sh

Compiling TRoLE from within emacs...

emacs makefile &
M-x compile
make -C ./bin/trole

Debugging TRoLE from within emacs...

M-x gdb
gdb --annotate=3 ./bin/trole
run ./data/input/exm.txt

repository: mbareford/trole

repo_name: mbareford/trole


text:
---
#
# Use the widgets beneath and the content will be
# inserted automagically in the webpage. To make
# this work, you have to use › layout: frontpage
#
layout: frontpage
header:
   image_fullwidth: alpr.jpg

widget1:
  title: "SecureDrop"
  url: '/securedrop'
  image: /images/securedroplogo.png
  text: 'SecureDrop is a platform for leaking documents to journalists securely and without compromising sources. LPL has launched Black Rose, our SecureDrop instance. We are the only group running an instance in Chicago and will be assisting journalists in breaking stories.'

widget2:
  title: "Current Projects"
  url: 'https://www.muckrock.com/project/opening-the-chicago-surveillance-fund-25/'
  image: /images/BOCImages.jpg
  text: 'We have a current partnership with MuckRock, the FOIA transparency organization, into the Chicago Police Departments use of 1505 funds. Similar to asset forfeiture, 1505 is a slush fund that CPD maintains, with a large portion of their purchases going into surveillance equipment.'

widget3:
  title: "In the Media"
  image: /images/satellitedish_scaled.jpg
  url: '/media/'
  text: 'Our members have been the media, either talking about our projects or their own involvement in technical issues in Chicago. If you would like to take a look, please click the link!'

callforaction:
  url: /contact/
  text: Get in touch to learn more about LPL ›
  style: alert
permalink: /index.html

---


text:
# Twaweza

Twaweza is a travel and tour guide website. [Frontend]
This project is done solely for the purpose and requirements of the Introduction to web development unit [CUEA](http://www.cuea.edu/) project.

## Getting Started

### Prerequisites

THis is a pure frontend (HTML + CSS + a little bit of javascript) without any functionality whatsoever.
```
1. Web browser
2. git for cloning the project.
```

### Installing

No installation is required.

## Built With

No frameworks were used in this project.

## Contributing

Contributions to this project are accepted.

## Authors

* **Joshua Ondieki**

## License

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

## Acknowledgments

* [Magical Kenya](http://www.magicalkenya.com)
* [Edward Kioko](https://www.linkedin.com/in/edward-kioko-615a1432/)
* Inspirations.

repository: JoshuaOndieki/twaweza

repo_name: JoshuaOndieki/twaweza


text:
---
layout: docs
title: Branches and Tags
---

<!-- markdownlint-disable MD022 MD032 -->
# Branches and Tags
{:.no_toc}

* Comment to trigger ToC generation
{:toc}
<!-- markdownlint-enable MD022 MD032 -->

AppVeyor has built-in multi-branch support.

**Default branch** which can be specified on the General tab of project settings is built whenever a new build is started from *Projects UI*, *schedule* or *API*. When you do a push to the repository AppVeyor will start a new build of the branch in the last commit of the push data.

## White- and blacklisting

All branches are built by default. You can either [manually skip a build](/docs/how-to/filtering-commits/) or setup included/excluded branches on the **General** tab of project settings or in `appveyor.yml`:

To specify the list of allowed branches:

```yaml
branches:
  only:
    - master
    - production
```

To specify the list of branches that must be ignored:

```yaml
branches:
  except:
    - /dev/     # You can use Regular expression to match multiple branch name(s)
    - playground
```

`gh-pages` branch is always excluded unless explicitly added in "only" list.

**Regular expressions** should be surrounded by `/`, otherwise Appveyor will do simple case insensitive string comparison.

Despite the option name, `only` and `except` is applied to tag names too, so the above example using `only` would cause tags not trigger the build. For example to enable builds for a tag version scheme like `v1.0.0` you would need:

```yaml
branches:
  only:
    - master
    - production
    - /v\d+\.\d+\.\d+/
```

## Conditional build configuration

If you use [git flow](http://nvie.com/posts/a-successful-git-branching-model/) you may want to have a different build configuration (e.g. deploying to a different environment) in a feature branch. Changing `appveyor.yml` in a feature branch becomes an issue when you merge it into master overriding `appveyor.yml` and breaking master builds.

To solve this problem AppVeyor allows having multiple per-branch configurations in a single `appveyor.yml`.

Multiple configurations are defined as a list with `branches` section in every item that:

```yaml
# configuration for "master" branch
# build in Release mode and deploy to Azure
-
  branches:
    only:
      - master

  configuration: Release
  deploy:
    provider: AzureCS
    ...

# configuration for all branches starting from "dev-"
# build in Debug mode and deploy locally for testing
-
  branches:
    only:
      - /dev-/

  configuration: Debug
  deploy:
    provider: Local
    ...

# "fall back" configuration for all other branches
# no "branches" section defined
# do not deploy at all
-
  configuration: Debug
```

Unlike white- and blacklisting `branches` section here works like a selector, not a filter. Configuration selection algorithm is the following:

* Check configurations with `branches/only` section defined. If branch is found in configuration's `only` section use this configuration.
* Check configurations with `branches/except` section defined. If branch is NOT found in configuration's `except` section use this configuration.
* Check configurations WITHOUT `branches` section. If such configuration found use it.
* If all previous steps fail build is not run.

## Build on tags (GitHub, BitBucket, GitLab, Gitea)

By default AppVeyor starts a new build on any push to a repository, whether it's a regular commit or a new tag. Repository tagging is frequently used to trigger deployment.

AppVeyor sets `APPVEYOR_REPO_TAG` environment variable to distinguish regular commits from tags - the value is `true` if tag was pushed; otherwise it's `false`. When it's `true` the name of tag is stored in `APPVEYOR_REPO_TAG_NAME`.

You can use `APPVEYOR_REPO_TAG` variable to trigger deployment on tag only, for example:

```yaml
- provider: Environment
  name: production
  on:
    APPVEYOR_REPO_TAG: true
```

However, please note that in the case of an **annotated** tag, `branch` and `APPVEYOR_REPO_TAG` are mutually exclusive. This is because, for a webhook created as a result of an **annotated** tag, there is no practical, reliable way to recognize which branch the tag was created from. Therefore, with this setting, deployment will happen only for the master branch:

```yaml
- provider: Environment
  name: production
  on:
    branch: master # only this will work
    APPVEYOR_REPO_TAG: true # condition will never be evaluated
```

So if you need to deploy on both branch and tag, please create two `provider` sections under `deploy` like this:

```yaml
deploy:
  - provider: Environment
    name: production
    on:
      branch: master

  - provider: Environment
    name: production
    on:
      APPVEYOR_REPO_TAG: true
```

You can disable builds on new tags through UI (General tab of project settings) or in `appveyor.yml`:

```yaml
skip_tags: true
```

## Sharing common configuration between branches

AppVeyor allows sharing common configuration between branches in a single `appveyor.yml`.

There is `for` node with a list of branch-specific configurations **overriding** common configuration defined on the top most level, for example:

```yml

# common configuration for ALL branches
environment:
  MY_VAR1: value-A

init:
- do_something_on_init.cmd

install:
- do_something_on_install.cmd

configuration: Debug

# here we are going to override common configuration
for:

# override settings for `master` branch
-
  branches:
    only:
      - master

  configuration: Release

  deploy:
    provider: FTP
    ...

# override settings for `dev-*` branches
-
  branches:
    only:
      - /dev-/

  environment:
    MY_VAR2: value-B

  deploy:
    provider: Local
    ...
```

In the example above we define `environment`, `init` and `install` sections for all branches as well as stating that default `configuration` is `Debug`.
Then, for `master` branch we override default settings by changing `configuration` to `Release` and adding deployment with `FTP` provider.
For `dev-*` branches we define a second environment variable `MY_VAR2` and enable deployment to `Local` environment.

Configuration merging rules:

* Scalar values such as `image`, `version`, `configuration`, `platform`, etc. defined on branch level override default ones;
* Script sections such `init`, `install`, `before_build`, `test_script`, etc. defined on branch level override default ones;
* Environment variables defined in `environment` sections are merged (new) and overridden (existing);
* Build matrix defined on branch level merges with default one;
* `deploy`, `artifacts`, `notifications` section can be either overridden or extended.

For example, consider the following configuration:

```yaml
artifacts:
- path: bin

deploy:
- provider: Local
  ...

notifications:
- provider: Email
  ...

for:
-
  branches:
    only:
      - master

  artifacts:
  - path: docs

  deploy: off

  notifications:
    provider: Slack
    ...
```

In the example above we do the following:

* For `master` branch we *adding* `docs` folder to artifacts definition, so both `bin` and `docs` folders collected. Both default and branch-specific collections were merged.
* For `master` branch we *disable* any deployment. `off` or `none` on branch-level clears default collection.
* For `master` branch we *replace* all notifications on default level with a single `Slack` notification.

repository: appveyor/website

repo_name: appveyor/website


text:
# sync-sync

sync-sync is an Atom package for managing posts & documents of blog/collaboration services.
It's convenient to use with [s3uploader](https://atom.io/packages/s3uploader).

Currently, you can sync with web services below:

- [Qiita](https://qiita.com)
- [Qiita:Team](https://teams.qiita.com/)
- [esa.io](https://esa.io/)
- [DocBase](https://docbase.io/)
- [WordPress.com](https://wordpress.com/)
- [WordPress.org](https://wordpress.org/)
- [Confluence](https://www.atlassian.com/software/confluence)
- [Backlog](https://backlog.com/)
- [Hatena Blog](http://hatenablog.com/)
- [Blogger](https://www.blogger.com/)
- [Medium](https://medium.com/)

## Features

### Sync whole list

Select a directory in the tree-view and click [Sync-Sync] > [Import/Export] in the context menu.
Then execute [Import].

### Sync each post

Select a synced file in the tree-view and click [Sync-Sync] > [Import/Export] in the context menu.
Then execute [Import].

### Create new post

Select a not-synced file in the tree-view and click [Sync-Sync] > [Import/Export] in the context menu.
Then execute [Export].

### Update post

Select a synced file in the tree-view and click [Sync-Sync] > [Import/Export] in the context menu.
Then execute [Export].

### Rename with syncing state

Select a synced file/directory in the tree-view and click [Sync-Sync] > [Rename with Syncing] in the context menu.

### Delete with syncing state

Select a synced file/directory in the tree-view and click [Sync-Sync] > [Delete with Syncing] in the context menu.

## Usage

See [here](https://tearoom6.github.io/sync-sync/).

## Configuration

Open the package settings ([Sync-Sync] > [Settings]). You can change the configs below:

- [Save secrets info] : You can avoid saving access token in the config file.
- [Keep file path on importing] : You can keep already-synced file path on importing.

## Documents

API references of web services:

- [Qiita/Qiita:Team](https://qiita.com/api/v2/docs)
- [esa.io](https://docs.esa.io/posts/102)
- [DocBase](https://help.docbase.io/posts/45703)
- [WordPress.com](https://developer.wordpress.com/docs/api/)
- [WordPress.org](https://developer.wordpress.org/rest-api/)
- [Confluence (Server)](https://docs.atlassian.com/atlassian-confluence/REST/latest-server)
- [Confluence (Cloud)](https://docs.atlassian.com/atlassian-confluence/REST/latest)
- [Backlog](https://developer.nulab-inc.com/docs/backlog/)
- [Hatena Blog](http://developer.hatena.ne.jp/ja/documents/blog/apis/atom)
- [Blogger](https://developers.google.com/blogger/)
- [Medium](https://github.com/Medium/medium-api-docs)

See also:

- [ドキュメント管理の将来設計](https://qiita.com/tearoom6/items/9518195fcd92bb87b9d0)

branch_name: refs/heads/develop


text:
# csc413-SecondGame

## Student Name : Micaella Morales
## Student ID : 916832064

I made this project using Java version 8 update 171 in NetBeans version 8.2.
To run the game, go to the jar folder and click the jar file. The jar file must be in the same folder as the Resources folder.
To run the game using Netbeans, click new project, which is under the file tab on the upper corner of the Netbeans window.
The category should be in Java, and in the right corner, under the section called projects, click Java project with existing sources. Click Next.
Enter a project name then click next. Click add folder, then choose the folder that contains the Resources folder and the RainbowReef folder, which should be the name of this repo.
Click Next. Lastly, just click finish. RainbowReefGame.java holds the main method in this project. Open that file then go to the run tab in the main menu bar and look for Set Project Configuration in the dropdown.
Click customize. This should bring you to the Project properties and make sure that Run is chosen under the categories. Set the current working directory to this repo folder.
Then just hit the play button to run this game.

Note:
Use the mouse the navigate around the main menu
Use the left and right arrow keys to move Katch (shell)

repository: moralesmicaella/RainbowReef

repo_name: moralesmicaella/RainbowReef


text:
# USAGE
in clientSNFS:

compilation:
	make clean && make

usage:
	./clientSNFS -address <server hostname> -port <port> -mount <directory to mount to>

in serverSNFS

compilation:
	make clean && make

usage:
	./serverSNFS -port <port> -mount <directory to mount to>

# RUNNING TESTS
	cd tests
ON SERVER: (Starts server and mounts(creates if does not exist) to ~/fservertest/)
	./server.sh
ON CLIENT: (Starts client and mounts(creates if does not exist) to /tmp/client16555
	./client.sh

AFTER STARTING SERVER AND CLIENT: (Runs all the tests)
	./runtests.sh
# NOTE
The mount directories must exist *PRIOR* to calling client and/or server!
To create them, use mkdir

repository: SamKG/FUSE-NFS

repo_name: SamKG/FUSE-NFS


text:
# [Covariant equals() method defined for enum](https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html#EQ_DONT_DEFINE_EQUALS_FOR_ENUM)

 This class defines an enumeration, and equality on enumerations are defined
using object identity. Defining a covariant equals method for an enumeration
value is exceptionally bad practice, since it would likely result
in having two different enumeration values that compare as equals using
the covariant enum method, and as not equal when compared normally.
Don't do it.

repository: codacy/codacy-spotbugs

gha_language: Scala

repo_name: codacy/codacy-spotbugs


text:
# simple-api-golang
Basic example of a RESTful API with golang

This example shows a very simple RESTful API developed with Go (golang) in order to show how client requests are received and how they respond to it.

This example is a simple CRUD with data stored in an array.

## Usage
To test this example, download the code or clone it.

``` bash
git clone https://github.com/jeastman19/simple-api-golang.git
```

Then, from the directory where the project was cloned, compile and execute

``` bash
$ cd simple-api-golang
$ go build main.go
$ ./main
```

This will compile and execute the example that you will hear by port 3000

To see it running, you can use Postman.

## Routes

The base URL is http: // localhost: 3000

Method|Endpoint|Purpose
--|--|--
GET|/people|Get all People
GET|/people/{id}|Get a Person
POST|/people|Create a Person
DELETE|/people/{id}|Delete a Person


text:
<br />

![ORPTech Logo](https://orptech.com/images/orptech-logo.png)
---

## Prerequisite
* Docker
* Internet Connection

## Build
```BASH
# The website parameter should point to your own domain.
docker build -t ubuntu-cert --build-arg website=google.com .
```

## Run
```BASH
# Run the container and follow the steps.
docker run -it ubuntu-cert
```

## License
MIT License. Please read LICENSE file for more details.

repository: ArdaKaraderi/docker-certbot

repo_name: ArdaKaraderi/docker-certbot


text:
Reduce functions
================

An important set of table operations tables compute totals and subtotals. In the relational world, these are implemented by combining summary operations (sum, max…) and group by. Data scientists often refer to these as Split-Apply-Combine functions. Tablesaw tables make basic group operations easy.

In this example, we’ll use a Tornado dataset from the NOAA’s Storm Prediction Center with just under 60,000 rows. It contains records of every US tornado from 1950-2014.  Once we’ve loaded the data, computing stats on subgroups is easy.

    Table avgInjuries = table.average("Injuries").by("Scale");

That’s all there is to it. To see the result, we can use the print() method:

    avgInjuries.print();

which produces:

    data/1950-2014_torn.csv summary
    Scale Average Injuries
    -9.0  0.10526315789473685
    0.0   0.028898762530750115
    1.0   0.34711490215755186
    2.0   1.7164844969886113
    3.0   9.266158169409863
    4.0   54.99675850891414
    5.0<PHONE_NUMBER>7971016

In this dataset, missing data are indicated by a scale of -9. A scale of 0 to 5
indicates the size of the storm, with 5 being the largest/most severe.
As you can see, injuries increase dramatically with the more severe storms.

To sum the number of fatalities by state and scale, we would write:

    sumFatalities = table.sum("Fatalities").by("State", "Scale");

which produces:

    data/1950-2014_torn.csv summary
    State Scale Sum Fatalities
    AL    0.0   1.0
    AL    1.0   15.0
    AL    2.0   28.0
    AL    3.0   86.0
    AL    4.0   272.0
    AL    5.0   224.0
    AR    -9.0  1.0
    AR    0.0   0.0
    AR    1.0   5.0

etc.

Since the result returned is also a Table, you can easily perform other operations. For example, to see only storms in Texas and Oklahoma, you could do the following.

    List states = Lists.newArrayList("TX", "OK");
    sumFatalities.selectIf(column("State").isContainedIn(states));

producing:

    data/1950-2014_torn.csv summary
    State Scale Sum Fatalities
    OK    0.0   0.0
    OK    1.0   5.0
    OK    2.0   22.0
    OK    3.0   71.0
    OK    4.0   143.0
    OK    5.0   96.0
    TX    -9.0  0.0
    TX    0.0   2.0
    TX    1.0   21.0
    TX    2.0   40.0
    TX    3.0   88.0
    TX    4.0   219.0
    TX    5.0   174.0

Data: The tornado dataset is from [NOAA's Storm Prediction Center Severe Weather GIS](http://www.spc.noaa.gov/gis/svrgis/).

Code: The code can be found in the BasicGroupby.java example in the Tablesaw repo on Github.

repository: uptonking/tablesaw

repo_name: uptonking/tablesaw


text:
# Wings

Wings allow players to fly. Every wings are an Elytra item worn on the chestplate slot of the inventory. Since it's an item, the `material` option must be specified, but it will be always overridden to `elytra` type. All wings are defined in _wings.yml_ file. Every wing has a `type` that defines how it behaves and what additional settings are available. The types are listed below.

```
wings_name:
  type: [wings type]
  [item specific settings]
  max_health: [positive decimal]
  regeneration: [non-negative decimal]
  [type specific settings]
```

## Wings settings

* `max_health` (**required**) is the health of wings.
* `regeneration` (**required**) is the amount of health regenerated every tick.

## Wing types

Each wing type has a different flight model.

### Simple wings

**`simpleWings`**

These wings have two properties: `aerodynamics` and `liftingforce`. They default to 0 and behave like vanilla Elytra. There's also `max_lift`, which is a limit of lifting force - useful if you want to counter player's weight without making the wings overpowered.

By modifying aerodynamics you modify the air resistance force, which slows you (or accelerates, you can have it positive if you want) the faster you fly. Note that it's added on top of Minecraft's own air resistance.

By modifying lifting force you make your wings better at flying. The faster you fly, the less altitude you will loose due to gravity. This force is countered by weight which pulls you down.

```
wings_name:
  type: simpleWings
  [item specific settings]
  [default wings settings]
  aerodynamics: [decimal]
  liftingforce: [decimal]
  max_lift: [decimal]
```

repository: Tominous/Flier

repo_name: Tominous/Flier