text:
# sbt-json

<!-- TOC -->

- [Overview](#overview)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Why use sbt-json?](#why-use-sbt-json)
- [Settings](#settings)
- [Examples](#example)
- [Settings in depth](#settings-in-depth)
- [Code generation features](#code-generation-features)
- [Tasks](#tasks)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)

<!-- /TOC -->

## Overview

sbt-json is an sbt plugin that generates Scala case classes for easy, statically typed, and implicit access of JSON data e.g. from API responses.

The plugin makes it possible to access JSON documents in a statically typed way including auto-completion. It takes a sample JSON document as input (either from a file or a URL) and generates Scala types that can be used to read data with the same structure.

sbt-json integrates very well with the [play-json library](https://github.com/playframework/play-json) as it can also generate play-json formats for implicit conversion of a `JsValue` to its Scala representation. (see [example](https://github.com/battermann/sbt-json/blob/master/README.md#play-json))

sbt-json also works with [circe](https://circe.github.io/circe/) for many JSON schemas as circe automatically derives the necessary type classes for the generated types. (see [example](https://github.com/battermann/sbt-json/blob/master/README.md#circe))

Supporting the generation of implicit encoders and decoders for different JSON libraries other than play-json is planned for future versions.

## Prerequisites

0.13.5 <= sbt version

## Installation

Install the plugin according to the [sbt documentation](http://www.scala-sbt.org/0.13/docs/Using-Plugins.html).

### Edit `project/plugins.sbt`

    addSbtPlugin("com.github.battermann" % "sbt-json" % "0.5.0")

### Edit `build.sbt`

Edit the `build.sbt` file to enable the plugin and to generate case class sources whenever the compile task is executed:

    enablePlugins(SbtJsonPlugin)

#### Optional JSON library

If you want to use play-json e.g. add:

    libraryDependencies += "com.typesafe.play" %% "play-json" % "2.6.0"

## Usage

After a successful installation place one or more `.json` files containing sample JSON documents in the directory `src/main/resources/json/`.

By default only the case classes will be generated. To generate play-json formats, add `jsonInterpreter := plainCaseClasses.withPlayJsonFormats` to your `build.sbt` file and reload sbt.

On compile, case classes will be generated in `target/scala-{version}/src_managed/compiled_json/jsonmodels/{name}` where `name` will be the name of the corresponding `.json` file.

To use the generated models, import `jsonmodels.{name}._` in your application code. You can now map a JSON document that has the same schema as the sample JSON document (e.g. from an API response) to the generated models. This can be done implicitly e.g. with circe or with play-json (see examples below).

## Why use sbt-json?

sbt-json supports easy, statically typed and implicit access to JSON data with minimal overhead and minimal boiler-plate.

There are other online tools (e.g. [http://json2caseclass.cleverapps.io](http://json2caseclass.cleverapps.io) or [http://transform.now.sh/json-to-scala-case-class](https://transform.now.sh/json-to-scala-case-class)) that allow pasting a JSON string to generate Scala case classes which you can copy and paste back into your solution. But with sbt-json, once installed, you don't need an external tool. Moreover, the workflow of adding a new JSON schema involves less steps and the generated case classes do not need to be maintained.

Additionally sbt-json handles a lot of edge cases that will cause problems when using the available online tools. For example:

* Optional object fields will be recognized automatically for an array of a given objects
* Derived class names will be unique
* Scala reserved words will be avoided

Another advantage of sbt-json is the optional generation of play-json formats that otherwise you would have to write manually.

## Settings

| name     | default | description |
| -------- | ------- | ----------- |
| jsonInterpreter | `plainCaseClasses`    | Combinator that specifies which interpreter to use. (`plainCaseClasses` can be combined with `withPlayJsonFormats`: `plainCaseClasses.withPlayJsonFormats `) |
| jsValueFilter     | `allJsValues`    | Combinator that specifies which JSON values should be in-/excluded for analyzation. (`allJsValues` can be combined with `exceptEmptyArrays` and `exceptNullValues`. Example: `allJsValues.exceptEmptyArrays` |
| jsonSourcesDirectory  | `src/main/resources/json` | Path containing the `.json` files to analyze. |
| jsonUrls  | `Nil` | List of urls that serve JSON data to be analyzed. |
| jsonOptionals | `Nil` | Specify which fields should be optional, e.g. `jsonOptionals := Seq(OptionalField("<package_name>", "<class_name>", "<field_name>"))` |
| packageNameForJsonModels | `jsonmodels` | Package name for the generated case classes. |

## Example

### play-json

If you want to analyze JSON data form `https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US` and ignore empty arrays, add the following lines to the `build.sbt` file:

    jsonInterpreter := plainCaseClasses.withPlayJsonFormats
    jsonUrls += "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US"
    jsValueFilter := allJsValues.exceptEmptyArrays

Then use play-json to read the JSON data:

    import play.api.libs.json.Json
    import jsonmodels.hpimagearchive._

    val json = Source.fromURL("https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US").mkString
    val imageArchive = Json.parse(json).as[HPImageArchive]
    println(imageArchive.images.head.url)

### circe

sbt-json also works with [circe](https://circe.github.io/circe/) for many JSON schemas as circe automatically derives the necessary type classes for the generated types.

In the `buld.sbt` add the circe dependencies:

    val circeVersion = "0.8.0"

    libraryDependencies ++= Seq(
      "io.circe" %% "circe-core",
      "io.circe" %% "circe-generic",
      "io.circe" %% "circe-parser"
    ).map(_ % circeVersion)

Now add a file or URL with the JSON sample, e.g.:

    jsonUrls += "https://api.coindesk.com/v1/bpi/currentprice.json"

Use circe to decode the JSON data:

    import io.circe.generic.auto._
    import io.circe.parser._
    import jsonmodels.currentprice._

    val url = "https://api.coindesk.com/v1/bpi/currentprice.json"
    val rawJson = scala.io.Source.fromURL(url).mkString
    val currentPriceOrError = decode[Currentprice](rawJson)
    val output = currentPriceOrError fold (
      err => err.getMessage,
      currentPrice => {
        val info = currentPrice.bpi.EUR.description
        val priceInEuro = currentPrice.bpi.EUR.rate_float
        val date = currentPrice.time.updated
        s"Current Bitcoin price ($info): $priceInEuro (timestamp: $date)"
      }
    )

    println(output)

## Settings in depth

### jsonInterpreter

With the `jsonInterpreter` setting additional generation features can be configured.

Besides generating the case classes, we can specify to generate [play-json formats](https://www.playframework.com/documentation/2.6.x/ScalaJsonCombinators#Format) for implicit conversion.

The interpreters can be set like this in the `build.sbt` file (which is the default):

    jsonInterpreter := plainCaseClasses

or if play-json-formats should be generated:

    jsonInterpreter := plainCaseClasses.withPlayJsonFormats

### jsValueFilter

By default the code generation will fail if the JSON sample contains empty arrays or null values. This follows the fail fast paradigm because some type information might be missing.

To change this behavior you can set `jsValueFilter` to ignore empty arrays or null values. The type of this setting is `type JsValueFilter = JsValue => Boolean` and there are two combinators available as well as a convenient syntax (implicit classes).

Configure this setting to ignore empty arrays:

    jsValueFilter := allJsValues.exceptEmptyArrays

Ignore null values:

    jsValueFilter := allJsValues.exceptNullValues

Ignore empty arrays as well as null values:

    jsValueFilter := allJsValues.exceptEmptyArrays.exceptNullValues

### jsonSourcesDirectory

By default all files with a `.json` extension in the directory `src/main/resources/json` will be analyzed. To change the directory set `jsonSourcesDirectory` of type `jva.io.File` to the desired value, e.g.:

    jsonSourcesDirectory := baseDirectory.value / "json"

### jsonUrls

`jsonUrls` is a sequence of strings that represent URLs that serve JSON documents to be analyzed. Add a new URL like this:

    jsonUrls += "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US"

### jsonOptionals

If the JSON documents contain optional fields, they have to be explicitly marked as such. To do this, add a value of type `OptionalField` containing the package name, class name, and field name to the `jsonOptionals` setting.

#### Example

Place a file `fbpost.json` containng a JSON document of a facebook post inside the json-sources directory:

    {
        "id":"339880699398622_241628669274112",
        "created_time":"2012-06-19T07:51:06+0000",
        "message":"great information for Linux fan ;-)",
        "full_picture":"https:\/\/scontent.xx.fbcdn.net\/v\/t31.0-8\/s720x720\/177827_10151014484731203_401775304_o.jpg?oh=69db574b81ebe6bfe97a4077b6806775&oe=5A25DA17"
    }

You can inspect the result of the code generation by running the sbt-json task `printJsonModels`:

    [info] /** MACHINE-GENERATED CODE. DO NOT EDIT DIRECTLY */
    [info] package jsonmodels.fbpost
    [info]
    [info] case class Fbpost(
    [info]   id: String,
    [info]   created_time: String,
    [info]   message: String,
    [info]   full_picture: String
    [info] )
    [info]
    [info] object Fbpost {
    [info]   import play.api.libs.json.Json
    [info]
    [info]   implicit val formatFbpost = Json.format[Fbpost]
    [info] }

Here the type of the `message` field is `String`. However, some facebook posts do not contain a message field. Implicit decoding of a JSON document like this will fail:

    {
        "id":"339880699398622_371821532871205",
        "created_time":"2012-06-19T07:57:54+0000",
        "full_picture":"https:\/\/scontent.xx.fbcdn.net\/v\/t31.0-8\/s720x720\/469692_371821072871251_145095902_o.jpg?oh=8a1be9485002e2d25dbe396a8f1fe176&oe=5A2F45F8"
    }

To fix this, the field has to be marked as optional. Add the following line to the `build.sbt` file:

    jsonOptionals += OptionalField("fbpost", "Fbpost", "message")

Run `reload` in the sbt console and inspect the generated code again with `printJsonModels`. The `message` field is now of type `Option[String]`:

    [info] /** MACHINE-GENERATED CODE. DO NOT EDIT DIRECTLY */
    [info] package jsonmodels.fbpost
    [info]
    [info] case class Fbpost(
    [info]   id: String,
    [info]   created_time: String,
    [info]   message: Option[String],
    [info]   full_picture: String
    [info] )
    [info]
    [info] object Fbpost {
    [info]   import play.api.libs.json.Json
    [info]
    [info]   implicit val formatFbpost = Json.format[Fbpost]
    [info] }

## Code generation features

### Unification of array types of similar JSON objects

If the JSON objects of an array are not consistent, the generator will unify the type by making all fields optional that are not shared by all objects.

#### Example

The fields `message` and `full_picture` of the generated case class will be optional for this sample JSON document:

    {
        "posts":{
            "data":[
            {
                "id":"339880699398622_185311264930535",
                "created_time":"2012-06-06T08:31:09+0000"
            }
            {
                "id":"339880699398622_347136625339696",
                "created_time":"2012-05-10T06:42:49+0000",
                "message":"Functional Programming and Android Game Development, a Happy Couple"
            },
            {
                "id":"339880699398622_403676613005660",
                "created_time":"2012-05-09T21:24:31+0000",
                "message":"an HTML5 version of the popular Cut the Rope  game with 25 levels is now available online for free\nhttp:\/\/www.cuttherope.ie\/",
                "full_picture":"https:\/\/external.xx.fbcdn.net\/safe_image.php?d=AQC2A2jO1N9RhI2g&url=http\u00253A\u00252F\u00252Fwww.cuttherope.ie\u00252Ffb.png&_nc_hash=AQClKYpmQtwavvP0"
            }
            ],
        "id":"339880699398622"
    }

Generated case classes:

    /** MACHINE-GENERATED CODE. DO NOT EDIT DIRECTLY */
    package jsonmodels.facebook

    case class Facebook(
        posts: Posts,
        id: String
    )

    case class Posts(
        data: Seq[Data]
    )

    case class Data(
        id: String,
        created_time: String,
        full_picture: Option[String],
        message: Option[String]
    )

### Ensure unique names

The generator will search for equal class names which can not be defined within the same scope and append ascending numbers starting with 1.

#### Example

Consider this JSON document:

    {
        "value1": {
            "foo": { "value": 42 }
        },
        "value2": {
            "foo": { "value": "some string" }
        }
    }

The fields of the objects `value1` and `value2` have the same name (`foo`) but different types. Therefore the generated class names will be `Foo` and `Foo1`:

    case class Equalnames(
        value1: Value1,
        value2: Value2
    )

    case class Value1(
        foo: Foo
    )

    case class Foo(
        value: Double
    )

    case class Value2(
        foo: Foo1
    )

    case class Foo1(
        value: String
    )

### Avoid Scala reserved words and type names

The generator tries to avoid Scala reserved words and type names by appending the suffix `Model` to a class name that is a potential candidate to clash. E.g. `case class List()` will become `case class ListModel()`, or `case class MyClass(this: String)` will become ``case class MyClass(`this`: String)``. (This feature is not yet fully tested and there is still no guaranty that there won't be any clashes.)

### Unify type with exact same structure

If an objects schema has the exact same structure as a schema that was found before, it will be substituted by that schema.

    {
        "geometry": {
            "location": {
                "lat": 37.42291810,
                "lng": -122.08542120
            },
            "viewport": {
                "northeast": {
                    "lat": 37.42426708029149,
                    "lng": -122.0840722197085
                },
                "southwest": {
                    "lat": 37.42156911970850,
                    "lng": -122.0867701802915
                }
            }
        }
    }

Note that there are no case classes `Northeast` and `Southwest` generated. Instead the type of the fields will be declared as `Location`:

    case class Geo(
        geometry: Geometry
    )

    case class Geometry(
        location: Location,
        viewport: Viewport
    )

    case class Location(
        lat: Double,
        lng: Double
    )

    case class Viewport(
        northeast: Location,
        southwest: Location
    )

## Tasks

| name     | description |
| -------- | ----------- |
| printJsonModels | Prints the generated case classes to the console. |
| generateJsonModels | Creates source files containing the generates case classes. |

## Troubleshooting

### Why is the generated code ignored by IntelliJ?

If the generated code is ignored by the compiler, in the **Project** tool window include the folder `target/scala-{version}/src_managed` by selecting **Mark Directory as | Generated Source Root** through the context menu, as described [here](https://www.jetbrains.com/help/idea/configuring-content-roots.html#d85322e277).

## Contributing

Contributions are very welcome and highly appreciated. You can contribute by sending pull request, by reporting bugs and feature requests [here](https://github.com/battermann/sbt-json/issues), or by giving feedback and suggestions for improvement.

repository: battermann/sbt-json

gha_language: Scala

repo_name: battermann/sbt-json


text:
# Weather APP

### Getting started
Date started 23 Feb 2019 14:30 Moscow Time

### TODO
- Split into microservices(weather service, city service, Zuul, eureka ) 2-3days
- Run it on K8S cluster on GCP :: 0.5– 1 day (almost done: some problem w/ load balancer on GCP ingress )
- Add CI/CD :: 0.5–1 day

#Dev plan
## Stage 1

1. System design(several type of design)
    - API
    - Structure
    - Deployment
    - Flow...
2. Implements API layer
    5. Register city(Existing), Storing in database
        - Controller
        - Model
        - DTO
        - Repository
        - Service
        - Tests
        - Other services like checking if city exists
    6. Get city weather
        - Controller
        - Service - Stage1: external Call API
        -  Repository
        -  Models
        -  DTO
3. Error handling check

## Stage 2

1. API Layer
    1. City Weather
        1. Add Caching to external requests results: 5 minutes cache
        2. New API call should return data from cache if it is there

## 	Stage 3

1. Return last weather for all cities in db (Pageable?)
2. Unregister city
    1. Delete all information about city and it's weather  db, cache
3. XML/JSON depends on header

## Stage 4

1. Add scheduling in background for updating caches for all cities with actual info
2. Store weather in DB??(already stored on 1st stage?)

## STage 5

1. Dockerize

not forget

1. Javadoc
2. tests
3. Spring + Hibernate or JPA

Resource

   POST \
create

   GET \
read

   PUT

update

   DELETE

   /cities

   create a new city/ register

   ––

   –––

   /cities/{id}

   ––

   Get weather

   ––

   delete city with all weather info

   /cities?

repository: baimurzin/myweatherapp

branch_name: refs/heads/master

extension: md

gha_language: Java

license_type: permissive

repo_name: baimurzin/myweatherapp


text:
# Backstretch::Rails

A rails asset pipeline packaged version of jQuery Backstretch v2.0.4 this gem will follow the version number of the backstretch distribution.

## Installation

Add this line to your application's Gemfile:

    gem 'backstretch-rails'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install backstretch-rails

## Usage

    //= require 'jquery.backstretch'

## Acknowledgements

* Backstretch by srobbin https://github.com/srobbin/jquery-backstretch which is a terrific library
* Font awesome rails package by bokmann: https://github.com/bokmann/font-awesome-rails used as a template

## Contributing

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

license: MIT

repository: matse/backstretch-rails

repo_name: matse/backstretch-rails


text:
# Server

A Flask-driven RESTful API.

---

## Table Of Contents

- [Tecnologies Used](#Technologies-Used)
- [Getting Started](#Getting-Started)
  - [Instalation](#Installation)
  - [Configuration](#Configuration)
- [How To Use](#How-To-Use)
  - [Compile And Run](#Compile-And-Run)
  - [API Documentation](#API-Documentation)

---

## Technologies Used

- [Python](https://www.python.org) - A programming language that lets you work quickly and integrate systems more effectively.
- [Flask](https://flask.palletsprojects.com/en/1.1.x/) - A Python microframework based on the Pocoo projects, Werkzeug and Jinja2.
- [MySQL](https://www.mysql.com) - A freely available open source Relational Database Management System that uses Structured Query Language (SQL).
- [JSON Web Tokens](https://jwt.io) (JWT) - An open, industry standard RFC 7519 method for representing claims securely between two parties.
- [OMDb API](http://www.omdbapi.com) - A RESTful web service to obtain movies and TV series information.

---

## Getting Started

### Installation

- Ensure that you have the latest versions of Python3 and MySQL globally installed in your computer.

> If you are running macOS, make sure to set Python3 and pip3 as default.

- To install all dependencies go to `/Utils` and run the following command:
```
pip install -r requirements.txt
```

### Configuration

The server is configured via the `configs.py` file. Create this file in `/Utils` with the following syntax:

```
# OMDb API
OMDB_API_URL = 'http://www.omdbapi.com/'
OMDB_API_KEY = 'your-OMDb-key'

# MySQL Database
DB_USERNAME = 'your-MySQL-username'
DB_PASSWORD = 'your-MySQL-user-password'
DB_NAME = 'your-MySQL-database-name'

# JWT Authentication
JWT_SECRET_KEY = 'your-JWT-secret-key'
JWT_ALGORITHM = 'your-preferred-JWT-algorithm'
```
> To generate a JWT secret key go to `/Utils` and run the following command:
```
python secretKey.py
```
---

## How To Use

### Compile And Run

To start the server simply run the following command:
```
sh start.sh
```

### API Documentation

   Create an account

   ```
   POST http://<IP_ADDRESS>:5000/CreateAccount
   Authorization: None
   Content-Type: application/json
   Accept: text/html
   Accept-Charset: charset=utf-8
   ```

   Body fields:

   | Field | Type | Description |
   |-------|------|-------------|
   | username | string | Account username |
   | email | string | Account email |
   | password1 | string | Account password (first entry) |
   | password2 | string | Account password (second entry) |

   Login

  ```
  POST http://<IP_ADDRESS>:5000/Login
  Authorization: None
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | email | string | Account email |
  | password | string | Account password |

   Change Password

  ```
  POST http://<IP_ADDRESS>:5000/ChangePassword
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | old_password | string | Account password |
  | new_password1 | string | Account new password (first entry) |
  | new_password2 | string | Account new password (second entry) |

   Search Series

  ```
  POST http://<IP_ADDRESS>:5000/SearchSeries
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | search | string | Series title |

   Get Series

  ```
  POST http://<IP_ADDRESS>:5000/GetSeries
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | imdbID | string | Series IMDb id |

   Add Series

  ```
  POST http://<IP_ADDRESS>:5000/AddSeries
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | imdbID | string | Series IMDb id |

   Remove Series

  ```
  POST http://<IP_ADDRESS>:5000/Remove
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | imdbID | string | Series IMDb id |

   Update Series Status

  ```
  POST http://<IP_ADDRESS>:5000/UpdateSeriesStatus
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Valid Options | Description |
  |-------|------|---------------|-------------|
  | imdbID | string | | Series IMDb id |
  | status | string | Watching, Rewatching, Completed, Plan To Watch | Series updated status |

   Check Episode

  ```
  POST http://<IP_ADDRESS>:5000/CheckEpisode
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | imdbID | string | Series IMDb id |

   Update Episodes

  ```
  POST http://<IP_ADDRESS>:5000/UpdateEpisodes
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Description |
  |-------|------|-------------|
  | imdbID | string | Series IMDb id |
  | updated_episode | integer | Last episode seen |
  | updated_season | integer | Season of the last episode seen |

   Rate Series

  ```
  POST http://<IP_ADDRESS>:5000/RateSeries
  Authorization: Bearer Token
  Content-Type: application/json
  Accept: text/html
  Accept-Charset: charset=utf-8
  ```

  Body fields:

  | Field | Type | Valid Options | Description |
  |-------|------|---------------|-------------|
  | imdbID | string | | Series IMDb id |
  | rating | integer | 1, 2, 3, 4, 5 | Series rating |

> Please note that for each request all fields are required.

   Errors

  This server uses conventional HTTP response codes to indicate the success or failure of an API request.
  - Codes in the 2xx range indicate success
  - Codes in the 4xx range indicate an error that failed given the information provided
  - Codes in the 5xx range indicate an error with the server

  | Status Code | Meaning | Description |
  |-------------|---------|-------------|
  | 200 | OK | Everything worked as expected. |
  | 400 | Bad Request | The request was unacceptable, often due to missing a required parameter. |
  | 401 | Unauthorized | The request requires user authentication. |
  | 500 | Internal Server Error | The server encountered an unexpected condition which prevented it from fulfilling the request. |
  | 502 | Bad Gateway | The server received an invalid response from the OMDb API. |

repository: Gonkalos/TVtracker

branch_name: refs/heads/main

repo_name: Gonkalos/TVtracker


text:
---
published: true
title: 'The Center of the Pixel is (0.5, 0.5)'
publisehd: true
tags: image opengl raytracing float
---
> Pixel centers at (0.5, 0.5) is the convention adopted by all major graphics APIs (OpenGL, DirectX, Vulkan, Metal). That’s because it makes the math, especially around image scaling, becomes a lot simpler. - [HN](https://news.ycombinator.com/item?id=23498294)

One common mistake is to not think in floating point coordinates all the way through. E.g. a rectangle that covers a single pixel should have coordinates like (100.0,100.0)-(101.0,101.0), NOT involving a 0.5 offset. You almost never offset anything by 0.5 in this convention. 1 pixel wide lines are an exception, but only because then the edges of the line are exactly at pixel boundaries.

- [The Center of the Pixel is (0.5,0.5)](http://www.realtimerendering.com/blog/the-center-of-the-pixel-is-0-50-5/)


text:
% umoci(1) # umoci - umoci modifies Open Container images
% Aleksa Sarai
% SEPTEMBER 2018
# NAME
umoci - umoci modifies Open Container images

# SYNOPSIS
**umoci**
[**--help**|**-h**]
[**--version**|**-v**]
[**--log**={*debug*|*info*|*warn*|*error*|*fatal*}]
[**--verbose**]
*command* [*args*]

# DESCRIPTION
**umoci** is a tool that allows for high-level modification of an OCI image
layout and its tagged images. While **umoci** attempts to abstract the OCI
image specification specifics, it is recommended that users of this tool read
through [the specification][1] to make sure they understand the rough idea.

**umoci** is unique in that it is, at the time of writing, the first tool to
allow for arbitrary modification of an OCI image in a high-level fashion (where
all of the different blobs in an OCI image are all managed by **umoci** when
doing a high-level operation such as **umoci-repack**(1)).

# GLOBAL OPTIONS

**--help, -h**
  Print usage statement.

**--version, -v**
  Print the version.

**--cpu-profile**=*filename*
  Generate a CPU profile during umoci's execution and save it to *filename*.
  This file is stored in [Go's pprof][2] format and can be analysed using *go
  tool pprof* or similar tools.

**--log**={*debug*|*info*|*warn*|*error*|*fatal*}
  Set the logging level. The default is "warn".

**--verbose**
  Alias for **--log=info**.

# COMMANDS

**init**
  Create a new OCI layout. See **umoci-init**(1) for more detailed usage
  information.

**new**
  Creates a blank tagged OCI image. See **umoci-new**(1) for more detailed
  usage information.

**unpack**
  Unpacks a tagged image into an OCI runtime bundle. See **umoci-unpack**(1)
  for more detailed usage information.

**repack**
  Repacks an OCI runtime bundle into a tagged image. See **umoci-repack**(1)
  for more detailed usage information.

**config**
  Modifies the image configuration of an OCI image. See **umoci-config**(1) for
  more detailed usage information.

**stat**
  Displays status information of an image manifest. See **umoci-stat**(1) for
  more detailed usage information.

**tag**
  Creates a new tag in an OCI image. See **umoci-tag**(1) for more detailed
  usage information.

**remove, rm**
  Removes a tag from an OCI image. See **umoci-remove**(1) for more detailed
  usage information.

**list, ls**
  Lists the set of tags in an OCI image. See **umoci-list**(1) for more
  detailed usage information.

**gc**
  Garbage collects all unreferenced OCI image blobs. See **umoci-gc**(1) for
  more detailed usage information.

# SEE ALSO
**umoci-init**(1),
**umoci-new**(1),
**umoci-unpack**(1),
**umoci-repack**(1),
**umoci-config**(1),
**umoci-stat**(1),
**umoci-tag**(1),
**umoci-remove**(1),
**umoci-list**(1),
**umoci-gc**(1),
**skopeo**(1)

[1]: https://github.com/opencontainers/image-spec
[2]: https://golang.org/pkg/runtime/pprof/

repository: opencontainers/umoci

gha_language: Go

repo_name: opencontainers/umoci


text:
Kubeflow Pipelines CLI
----------------------

## Installation

This assumes that Go is installed on your machine.
```
export GO111MODULE=on
go get -u github.com/kubeflow/pipelines/backend/src/cmd/ml
```

## Usage

Ensure kubectl is pointed to the right cluster and context.
```
$ ml
This is the command line interface to manipulate pipelines.

Usage:
  ml [command]

Available Commands:
  experiment  Manages experiments
  help        Help about any command
  job         Manages jobs
  pipeline    Manage pipelines
  run         Manage runs
```

### List Pipelines in the cluster

```
$ ml pipeline list -n kubeflow
```

repository: alibaba/pipelines

repo_name: alibaba/pipelines


text:
# Project Aletheia

## NM391 The Ones n Zeros

# Public

This folder contains:

- IMAGE FOLDER comprises of all images being used in the website specifically in header.js,index.ejs and upload.ejs

- STYLESHEETS FOLDER has:

| FILE NAME | DESCRIPTION |
| --- | --- |
| NAV.CSS | Stylesheet for our entire web document |
| load.js | Javascript file for the load bar implemented in upload.ejs |


text:
# EXPRIMUS

re-use your express routes with your websocket server.
define them once, use them everywhere.

## Install
```
npm install --save exprimus express engine.io cookie-parser express-session
```

In details:

first, install exprimus
```
npm install --save exprimus
```

install express
```
npm install express
```
note that express is not mandatory; you could use exprimus as a pure socket router, without express.

Then, get a real-time framework, for example, engine.io
```
npm install --save engine.io
```
(for more info, head to [Primus](https://github.com/primus/primus), which Exprimus uses internally)

if you want to share sessions with express, you'll have to get express-session and cookie-parser:
```
npm install --save cookie-parser express-session
```

## Usage:

```javascript
var express = require('express')
,   Exprimus = require('exprimus')
;

var app = express()
,   pApp = Exprimus(app)
;
pApp.set('transformer','engine.io'); //or whatever engine you're using
```

Then, add `<script src="/primus/primus.js">` to your template, while testing. Later, you can use `pApp.save(path)` to save the file somewhere.

From thereon, use pApp instead of app to define routes:
```javascript
pApp.get('/data/:id',function(req,res,next){
    var id = req.param('id');
    if(req.isSocket){ // this is a primus request
        res.send({title:id});
    }
    else{ // this is a normal request
        res.render('somepage',{title:id});
    }
})
```

You can use `get`, `put`, `delete`, `post`, and `use`, as normal.

From the client, you would do:
```javascript
var primus = new Primus();
primus.write('/data/123');
//or
primus.write({url:'/data/123'});
//or
primus.write({url:'/data/123',method:'post'}); //method defaults to get

primus.on('data',function(data){
    console.log(data)
});
```

## Partial Renders

If you want partial renders on the server side, you'll have to do a few things:

First, edit your layout, and make it conditional:
```jade
if (!skipLayout)
    doctype html
    html
        head
            script(src="/primus/primus.js")
        body
            block content
else
    block content
```

Primus augments the locals with a `skipLayout` property; that way, you do not have to render the layout when serving a real-time request.

Then, use pApp instead or app to set the views settings:
```javascript
pApp.set('views', path.join(__dirname,'views'));
pApp.set('view engine', 'jade');
```

Then just use res.render as normal:

```javascript
pApp.get('/',function(req,res){
    res.render('index',{title:'home'}); // will work for primus and express requests
});
```

on the client, the rendered template will be received in a property called `render`:
```javascript
primus.on('data',function(data){
    if(typeof data !== 'string'){
        if(data.render){data = data.render;}
        else{data = '<pre>'+JSON.stringify(data)+'</pre>';}
    }
    document.getElementById('something').innerHTML = data;
});
```

## Session persistence

```javascript
pApp.set('secret','shhh, very secret');
pApp.set('store',new pApp.session.MemoryStore());
pApp.session();
```

Provided you have installed `cookie-parser` and `express-session`.

## Example:

checkout the example:

- `git clone https://github.com/xananax/exprimus.git`
- `cd exprimus/example && npm install`
- `npm start`

## Stable?

More or less. As long as you stick to the example and you don't have exotic needs, it should work.

## License

MIT

repository: Xananax/exprimus

repo_name: Xananax/exprimus


text:
---
layout: docs
title: "PureConfig"
---

# PureConfig

`libraryDependencies += "com.avast" %% "sst-pureconfig" % "@VERSION@"`

This subproject allows you to load your application's configuration file into a case class. It uses [PureConfig](https://pureconfig.github.io)
library to do so which uses [Lightbend Config](https://github.com/lightbend/config) which means that your application's configuration
will be in [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md) format.

Loading of configuration is side-effectful so it is wrapped in `F` which is `Sync`. This module also tweaks the error messages a little.

```scala mdoc:silent
import com.avast.sst.pureconfig.PureConfigModule
import pureconfig.ConfigReader
import pureconfig.generic.semiauto.deriveReader
import zio.interop.catz._
import zio.Task

final case class ServerConfiguration(listenAddress: String, listenPort: Int)

implicit val serverConfigurationReader: ConfigReader[ServerConfiguration] = deriveReader

val maybeConfiguration = PureConfigModule.make[Task, ServerConfiguration]
```

Look for `sst-*-pureconfig` subprojects to get `implicit` instances of `ConfigReader` for specific libraries, e.g.:

```scala mdoc:silent
import com.avast.sst.http4s.server.pureconfig.implicits._
```

The default `*.pureconfig.implicits._` import contains the default naming convention for PureConfig which is `kebab-case`
for the configuration file and `camelCase` for the case class field names. You can either choose a different naming convention by different
import (e.g. `*.pureconfig.implicits.CamelCase`) or you can [create your own](https://pureconfig.github.io/docs/overriding-behavior-for-case-classes.html#field-mappings)
and `extend` the `ConfigReaders` `trait`.

repository: sideeffffect/scala-server-toolkit

gha_license_id: MIT

repo_name: sideeffffect/scala-server-toolkit


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

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.4.4] - 2018-12-03

### Added
- Add `download` command in Makefile

### Updated
- Update max version's PrestaShop supported: PS <IP_ADDRESS>
- Update dependecies squizlabs/php_codesniffer from 3.3.1 => 3.3.2

## [3.4.3] - 2018-09-12

### Added
- Compliancy message

### Updated
- Update translations

### Fixed
- Fix bug versions compliancy

## [3.4.2] - 2018-08-23

### Updated
- Update dependencies guzzle/guzzle from 5.3.2 => 5.3.3
- Update README file with [mailtrap.io](https://mailtrap.io/)
- Update format name logfile, it is: \[dev|prod\]_YYYYMMDD_placetopayment.log
- Update commands in Makefile
- Update max version's PrestaShop supported: PS <IP_ADDRESS>

### Fixed
- Fix translations in: `es` and `gb` locales
- Fix bug getting order by cart id, fail if order not exist

### Removed
- Stock re-inject option setup in PS 1.6, deprecated in PS 1.5

## [3.4.0] - 2018-07-25

### Added
- Add payment method selector to restrict in redirection page
- Add currency validator before request PlacetoPay

### Updated
- Change alerts, now are show in top of page
- Save errorCode in log database as objectId and updated error codes
- Improve logs when connection to service failed
- Show more configuration in sonda request

## [3.3.0] - 2018-07-19

### Added
- Exception and any others errors are visible from PS back-office System Logs
- Added object type in errors save in logs prestashop

### Updated
- Minimum version support now is PS <IP_ADDRESS>
- Change PaymentLogger::log function
- Update error code, catalog table create

## [3.2.7] - 2018-07-17

### Updated
- Simple fix path applied, improve support
- Not overwrite default country in docker installation
- Allow installation in default country (gb)

### Fixed
- Fix cs
- Fix log path in PS >= <IP_ADDRESS>
- Fix guzzle in PS >= <IP_ADDRESS>, downgrade from 6.3.3 to 5.3.2

## [3.2.6] - 2018-07-13

### Fixed
- Fix message error (in database) on failed transaction, before it is not was updated
- Fix translations, index error in files

### Updated
- Update dependencies dnetix/redirection from 0.4.3 => 0.4.5 (Add extra currencies)
- Added code sniffer validations

## [3.2.5] - 2018-05-15

### Fixed
- Fix return page, now it depends of status payment

## [3.2.4] - 2018-04-27

### Added
- Allowed set a Custom Connection URL to connect to payment service in PlacetoPay

### Fixed
- Fix bug in Windows System with Apache Server installed (Separator)
- Fix bug in English translations files
- Fix bug on update status, add validation to request object

### Updated
- Update message trace on development and improve code type hint and vars name
- Remove translations not used
- Update dependencies to stable versions, thus:
    psr/http-message (1.0.1)
    guzzlehttp/psr7 (1.4.2)
    guzzlehttp/promises (v1.3.1)
    guzzlehttp/guzzle (6.3.3)
    dnetix/redirection (0.4.3)

## [3.1.0] - 2018-03-11

### Added
- Add makefile with docker
- Add validation in notification to signature
- Add extra security, to show setup is necesary send last 5 characteres of login to show data
- Add skipResult setup to skip last screen in payment process on payment
- Add Placetopay brand in PS >= 1.7 in payment options form
- Add validation to execute sonda process, from browser not is available, only CLI

### Fixed
- Fix bug in way to get URL base
- Fix bug when transaction not is approved not update reason and reaso…
- Fix bug updating description in payments rejected (error in bd)
- Fix bug in value assigned of stock reinject on update
- Fix errors when module is re-install, catch error generate by rename columns
- Fix error when module is executed but it is not installed yet (from sonda process)
- Fix bug in installation on PS <IP_ADDRESS>, logo.png was change path
- Fix Skip class when some are not found in PS 1.7 loader

### Updated
- Update dependency redirection from 0.4.1 to 0.4.2
- Update dependencies guzzle from 6.2 to 6.3
- Update message trace on development
- Update translation changing Place to Pay -> PlacetoPay

### Created
- Create CONTRIBUTING.md
- Create LICENSE

## [3.0.2] - 2018-01-10

### Fixed
- Fix bug in notification process, column name error

## [3.0.1] - 2017-12-13

### Fixed
- Fix bug in utf8 translations in spanish in some installations in Prestashop < 1.7

## [3.0.0] - 2017-12-06

### Added
- Add compatibility with Prestashop >= 1.7

## [2.6.4] - 2017-12-01

### Fixed
- Fixed bug in Windows Server Systems

repository: freddiegar/prestashop-gateway

gha_language: PHP

repo_name: freddiegar/prestashop-gateway


text:
```
THRASHER - A HEAVY-METAL MUSIC PLAYER FOR VIM

                                                                 ,'
                                                              .c0:
                                                            .dNX'
                                             ..           ,kMM0.
                                            'KX'       .cKMMMd.
                                           :WMMWl.   .oNMMMWc
                                         .xMMMMMM0.,kWMMMMN,
                                        .KMMMMMMMMMMMMMMM0.
                                       ;NMMMMMMMMMMMMMMMx.
                                     .oMMMMMMXMMMMMMMMWl
                                    .0MMMMWk' cWMMMMMN,
                                   ,NMMMXl.    ,NMMMK.
                                  oMMMO;.       .0Mk.
                                .OMWd.           .;
                               'XKc.
                              ck,
                             ..
```

[U+1F5F2](http://unicode-table.com/en/1F5F2/)

## What the heck?

Currently this project is in an experimental state,
but it is beginning to be actually usable (for me at least).
At the moment, Thrasher only works with iTunes on Mac OS X.
The idea is, of course, to support controlling other players as well.

If you're brave (curious) enough to give this project a try,
I'd love to hear back from you. *Let me know what you think.*

Thanks. You rock!

## Using

**Basic usage**

To bring up Thrasher's interface, type `<leader>m`.

Personally, I have mapped `<leader>` to `,`, which makes this key combination
very easy to type (on an English keyboard).  You can easily
[change the default](#configuration) though.

The interface may take a moment to appear for the first time,
because it is caching track information in the background.
Following invocations should then be instantaneous.

You can then start typing to search for tracks matching your input.

Thrasher allows searching by `artist`, `album` or `track` name, and also
lets you look for tracks with `any` of these properties matching your query.
To switch between search modes, press `ctrl-v` (`<c-v>`).

You can scroll through the list of found tracks, using `<c-j>` to go down and
`<c-k>` to move up.

Hit `<enter>` to play the selected song!

To close, hit `<esc>` or `<c-c>`.

**Advanced**

Inputting (prompt focus)

- type to search (letters, numbers, spaces…)
- `<c-h>` moves the cursor left
- `<c-l>` moves the cursor right
- `<c-e>` jumps to the very end of your input
- `<c-a>` places the prompt cursor at the start
- `<bs>`  deletes the preceding character
- `<del>` deletes the current character
- `<c-w>` deletes the word in front of the cursor
- `<c-u>` deletes your entire search input

Navigation

- `<c-j>` moves the track selection down
- `<c-k>` moves the track selection up

Search modes

- `<c-v>` switch between search modes (`any`/`artist`/`album`/`track`)

Player control

- `<c-g>` toggles between play and pause
- `<c-f>` skips forward to the next track
- `<c-b>` lets you return to the previous track

Focus

- `<s-tab>` switches between prompt and window focus

The prompt controls for entering queries are explained above.
Thrasher will launch with prompt focus by default.

With window focus you can navigate the result list more easily,
using standard vim navigation mappings. Hit `<cr>` to play the selection,
`<esc>` to close or `<s-tab>` to switch back to prompt focus.

The player controls and search mode mappings are available both with
prompt and window focus.

**Further documentation**

To open the vim documentation, run `:help thrasher`.

## Installing

**[Pathogen](https://github.com/tpope/vim-pathogen)**

`git clone https://github.com/pmeinhardt/thrasher.git ~/.vim/bundle`

Remember to run `:helptags` to generate the help tags.

**[Vundle](https://github.com/VundleVim/Vundle.vim)**

`Plugin 'pmeinhardt/thrasher'`

**[Plug](https://github.com/junegunn/vim-plug)**

`Plug 'pmeinhardt/thrasher'`

## Configuration

You can change the default key mapping for invoking Thrasher,
simply by adding `let g:thrashermap = "…"` to your `.vimrc` file.

Make sure to add these options before executing `pathogen#infect()`,
calling `vundle#end()` or `plug#end()` – i.e. before loading the plugin.

## Contributing

There are many ways in which you could contribute: Through code, by creating
pull-requests, but mainly by just providing me with feedback and
your thoughts on what to improve.

## Thanks

This project boldly steals some user interface ideas from the very useful
[ctrlp](https://github.com/ctrlpvim/ctrlp.vim),
a vim plugin which has been making my vim a lot more fun.

repository: pmeinhardt/thrasher

gha_language: Vim script

repo_name: pmeinhardt/thrasher


text:
# Team-Profile-Generator

## Description
This application would be used to help generate a roster of employees for a project.

## Installation
If all the files are kept in a single fold and the user installs jest and inquirer the user should be able to build an employee team with a manager, engineers and interns.

## Usage
The usage was to continue building our skills wit node.js and using the terminal. The we also had to use the following resources: [jest](https://jestjs.io/) for running the provided tests, and [inquirer](https://www.npmjs.com/package/inquirer) for collecting input from the user.

## Credit
I created this project from the outline given to us by our Triology Education Services instructor. I also took code from my old homework, inclasss activities. My instructor and TAs also  gave me guidance while working on thsi project. I had additional help from my tutors Isabel Arcones and Andy Gikling.

## Contributing
I built this application with the help from my instructor and TAs from Triology. I also had addditoinal help from my classmates and tutors.

## Challenges
I had issues with my for loop and using inquirer. The for loop was running while I was trying to answer the questions about job title. The loop would continue to run before I could answer the questions. I was not able to fix this issue. Because of this "bug" I was not able to finish the homework in time.

## Live Site
 https://ptrckbrown94.github.io/Team-Profile-Generator/

## Screenshots
![image]()
![image]()
![image]()

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

gha_language: JavaScript


text:
---
title: "Photos, 2017"
date: 2017-11-27
Tags: [journal]
excerpt: "Photos taken in 2017."
---

Photos taken during the year using an RX100 and a TG5.

![2017_India_Rx100_01](/images/photograph/2017_India_Rx100_01.png "2017_India_Rx100_01"){:.align-center}
![2017_India_Rx100_02](/images/photograph/2017_India_Rx100_02.png "2017_India_Rx100_02"){:.align-center}
![2017_India_Rx100_03](/images/photograph/2017_India_Rx100_03.png "2017_India_Rx100_03"){:.align-center}
![2017_India_Rx100_04](/images/photograph/2017_India_Rx100_04.png "2017_India_Rx100_04"){:.align-center}
![2017_India_Rx100_05](/images/photograph/2017_India_Rx100_05.png "2017_India_Rx100_05"){:.align-center}
![2017_India_Rx100_06](/images/photograph/2017_India_Rx100_06.png "2017_India_Rx100_06"){:.align-center}
![2017_India_Rx100_07](/images/photograph/2017_India_Rx100_07.png "2017_India_Rx100_07"){:.align-center}
![2017_India_Rx100_08](/images/photograph/2017_India_Rx100_08.png "2017_India_Rx100_08"){:.align-center}
![2017_India_Rx100_09](/images/photograph/2017_India_Rx100_09.png "2017_India_Rx100_09"){:.align-center}
![2017_India_Rx100_10](/images/photograph/2017_India_Rx100_10.png "2017_India_Rx100_10"){:.align-center}
![2017_India_Rx100_11](/images/photograph/2017_India_Rx100_11.png "2017_India_Rx100_11"){:.align-center}
![2017_Shetland_TG5_01](/images/photograph/2017_Shetland_TG5_01.png "2017_Shetland_TG5_01"){:.align-center}
![2017_Shetland_TG5_02](/images/photograph/2017_Shetland_TG5_02.png "2017_Shetland_TG5_02"){:.align-center}
![2017_Shetland_TG5_03](/images/photograph/2017_Shetland_TG5_03.png "2017_Shetland_TG5_03"){:.align-center}
![2017_Shetland_TG5_04](/images/photograph/2017_Shetland_TG5_04.png "2017_Shetland_TG5_04"){:.align-center}
![2017_Shetland_TG5_05](/images/photograph/2017_Shetland_TG5_05.png "2017_Shetland_TG5_05"){:.align-center}
![2017_Shetland_TG5_06](/images/photograph/2017_Shetland_TG5_06.png "2017_Shetland_TG5_06"){:.align-center}
![2017_Shetland_TG5_07](/images/photograph/2017_Shetland_TG5_07.png "2017_Shetland_TG5_07"){:.align-center}
![2017_Shetland_TG5_08](/images/photograph/2017_Shetland_TG5_08.png "2017_Shetland_TG5_08"){:.align-center}
![2017_Shetland_TG5_09](/images/photograph/2017_Shetland_TG5_09.png "2017_Shetland_TG5_09"){:.align-center}
![Bali_2017_Large_01](/images/photograph/Bali_2017_Large_01.png "Bali_2017_Large_01"){:.align-center}
![Bali_2017_Large_02](/images/photograph/Bali_2017_Large_02.png "Bali_2017_Large_02"){:.align-center}
![Bali_2017_Large_03](/images/photograph/Bali_2017_Large_03.png "Bali_2017_Large_03"){:.align-center}
![Bali_2017_Large_05](/images/photograph/Bali_2017_Large_05.png "Bali_2017_Large_05"){:.align-center}
![Bali_2017_Large_06](/images/photograph/Bali_2017_Large_06.png "Bali_2017_Large_06"){:.align-center}
![Bali_2017_Large_07](/images/photograph/Bali_2017_Large_07.png "Bali_2017_Large_07"){:.align-center}
![Bali_2017_Large_09](/images/photograph/Bali_2017_Large_09.png "Bali_2017_Large_09"){:.align-center}
![Bali_2017_Large_10](/images/photograph/Bali_2017_Large_10.png "Bali_2017_Large_10"){:.align-center}


text:
# Botium Logic Hook for Perfecto Reporting

[![NPM](https://nodei.co/npm/botium-logichook-perfectoreporting.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/botium-logichook-perfectoreporting/)

[![Codeship Status for codeforequity-at/botium-logichook-perfectoreporting](https://app.codeship.com/projects/dba9c0e0-6f7b-0138-9604-12801435fc46/status?branch=master)](https://app.codeship.com/projects/395107)
[![npm version](https://badge.fury.io/js/botium-logichook-perfectoreporting.svg)](https://badge.fury.io/js/botium-logichook-perfectoreporting)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()

This [Botium](https://www.botium.ai) extension attaches itself to the [Botium Webdriver Connector](https://github.com/codeforequity-at/botium-connector-webdriverio) and uses the [Perfecto Reporting SDK](https://github.com/PerfectoCode/reporting-node-sdk) to write Botium test information to the [PERFECTO SMART REPORTING AND ANALYTICS](https://www.perfecto.io/platform/analytics-reporting) Dashboard.

__Did you read the [Botium in a Nutshell](https://medium.com/@floriantreml/botium-in-a-nutshell-part-1-overview-f8d0ceaf8fb4) articles ? Be warned, without prior knowledge of Botium you won't be able to properly use this library!__

## Using with Botium Core / Botium CLI / Botium Bindings

Install the extension:

    > npm install botium-logichook-perfectoreporting

Register this extension in _botium.json_:

```
{
  "botium": {
    "Capabilities": {
      ...
      "LOGIC_HOOKS": [
        {
          "ref": "PERFECTO-REPORTING",
          "src": "botium-logichook-perfectoreporting",
          "global": true
        }
      ]
      ...
    }
  }
}
```

## Using with Botium Box

It is already part of Botium Box. You have to enable it in the [Registered Components View](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/2293815/Botium+Asserters).


text:
## How to Run the Program to Generate Data

```shell
# Check out the code from git hub
git clone git@github.com:izzymsft/DataStreamGenerator.git

# Navigate to code root folder
cd DataStreamGenerator/DataGeneratorConsole

# Fetch all the dependencies if necessary
dotnet restore

# Check if the compilation works
dotnet build

# Compile and run the code to generate the messages
dotnet run
```

## Modifying and Configuring the Program

You should edit the Program.cs script in the Main() method to indicate the number of rounds you want to generate.

Each round will generate data for 15 patients and broadcast them to all applicable event hubs.

You also need an appsettings.json file similar to this one with your connection string and event hub names

```json

{
    "Logging": {
      "LogLevel": {
        "Default": "Warning"
      }
    },
    "ConnectionStrings": {
        "EventHubConnection": "Endpoint=sb://pat093495.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=2prP9whtKJKmC8zo5lv/HcSitrV2GGi2ID5OrDnpYeY=",
        "EVHCalifornia": "California",
        "EVHFlorida": "Florida",
        "EVHWashington": "Washington",
        "EVHTexas": "Texas",
        "EVHAlabama": "Alabama",
        "EVHKansas": "Kansas",
        "EVHVirginia": "Virginia"
    }
  }

```

repository: izzymsft/DataStreamGenerator

gha_language: C#

repo_name: izzymsft/DataStreamGenerator


text:
<!--Copyright 2023 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Stable Diffusion pipelines

Stable Diffusion is a text-to-image latent diffusion model created by the researchers and engineers from [CompVis](https://github.com/CompVis), [Stability AI](https://stability.ai/) and [LAION](https://laion.ai/). Latent diffusion applies the diffusion process over a lower dimensional latent space to reduce memory and compute complexity. This specific type of diffusion model was proposed in [High-Resolution Image Synthesis with Latent Diffusion Models](https://huggingface.co/papers/2112.10752) by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer.

Stable Diffusion is trained on 512x512 images from a subset of the LAION-5B dataset. This model uses a frozen CLIP ViT-L/14 text encoder to condition the model on text prompts. With its 860M UNet and 123M text encoder, the model is relatively lightweight and can run on consumer GPUs.

For more details about how Stable Diffusion works and how it differs from the base latent diffusion model, take a look at the Stability AI [announcement](https://stability.ai/blog/stable-diffusion-announcement) and our own [blog post](https://huggingface.co/blog/stable_diffusion#how-does-stable-diffusion-work) for more technical details.

You can find the original codebase for Stable Diffusion v1.0 at [CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion) and Stable Diffusion v2.0 at [Stability-AI/stablediffusion](https://github.com/Stability-AI/stablediffusion) as well as their original scripts for various tasks. Additional official checkpoints for the different Stable Diffusion versions and tasks can be found on the [CompVis](https://huggingface.co/CompVis), [Runway](https://huggingface.co/runwayml), and [Stability AI](https://huggingface.co/stabilityai) Hub organizations. Explore these organizations to find the best checkpoint for your use-case!

 These tips are applicable to all Stable Diffusion pipelines.

### Explore tradeoff between speed and quality

[`StableDiffusionPipeline`] uses the [`PNDMScheduler`] by default, but 🤗 Diffusers provides many other schedulers (some of which are faster or output better quality) that are compatible. For example, if you want to use the [`EulerDiscreteScheduler`] instead of the default:

```py
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler

pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)

# or
euler_scheduler = EulerDiscreteScheduler.from_pretrained("CompVis/stable-diffusion-v1-4", subfolder="scheduler")
pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", scheduler=euler_scheduler)
```

### Reuse pipeline components to save memory

To save memory and use the same components across multiple pipelines, use the `.components` method to avoid loading weights into RAM more than once.

```py
from diffusers import (
    StableDiffusionPipeline,
    StableDiffusionImg2ImgPipeline,
    StableDiffusionInpaintPipeline,
)

text2img = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
inpaint = StableDiffusionInpaintPipeline(**text2img.components)

# now you can use text2img(...), img2img(...), inpaint(...) just like the call methods of each respective pipeline
```

repository: huggingface/diffusers

gha_language: Python

repo_name: huggingface/diffusers


text:
# Creating and Managing ZFS-based Lustre file systems

[**Online Help Table of Contents**](IML_Help_TOC.md)

Integrated Manager for Lustre software is able to create and manage Lustre file systems that are based on OpenZFS object storage device (OSD) volumes. The software installs the necessary packages, formats Lustre targets from ZFS pools, and creates the high-availability software framework for managing availability for Lustre + ZFS servers.  The following topics are covered:

- [Create a ZFS-based Lustre file system](#8.1)
- [Importing and exporting ZFS pools in a shared-storage high-availability cluster](#8.2)
- [Removing a ZFS-based Lustre file system](#8.3)
- [Destroy an individual zpool](#8.4)
- [Destroy all of the ZFS pools in a shared-storage](#8.5)

## Create a ZFS-based Lustre file system

The procedures in this section assume that you have first assembled and configured the physical hardware: servers, storage devices, network interfaces, etc., and installed Integrated Manager for Lustre software as instructed in the *Integrated Manager for Lustre software Installation Guide*.

To create and manage an OpenZFS-based Lustre file system that is highly-available and managed by Integrated Manager for Lustre software, perform these steps:

1. Add all of the physical servers that will comprise your ZFS-based Lustre file system. To do this, perform the steps in [Add one or more HA servers](Creating_new_lustre_fs_3_0.md/#3.4). Add each server as a *Managed Storage Server*.

    **Note:**  Steps 2 and 3 below are performed automatically by Integrated Manager for Lustre software and do not need to be performed.  They are included here for topic coverage only. Continue with Step 4.

1. Having added the servers, you now need to ensure that the server hostids are set before creating any zpools. Each server requires a unique hostid to be configured. Setting the hostid on each server will allow ZFS to apply an attribute on each zpool indicating which host currently has the pool imported. This provides some protection in ZFS against multiple simultaneous imports of zpools when the storage is connected to more than one server. To set the hostid, run the `genhostid` command on each host and reboot. In the document *Lustre Installation and Configuration using Integrated Manager for Lustre software and OpenZFS*, see the section *Protecting File System Volumes from Concurrent Access* for more information.

1. As a further protection against “double-importing” ZFS pools, and to prevent conflicts with the Pacemaker resource management software, disable the ZFS Systemd target by entering the following command:

	```
	systemctl disable zfs.target
	```

    This will stop the operating system from attempting to auto-import ZFS storage pools during system boot. Disabling the ZFS target affects all ZFS storage pools, including any that are not being used for Lustre.

1. ZFS pool configuration is executed directly on each of the Lustre server HA pairs using the command line tools supplied with the ZFS software. The storage devices for each ZFS pool must be connected to, and accessible from, each Lustre server in the HA pair. For each ZFS pool, it is easiest to nominate a primary server and use that host to create the zpool. Log into each primary host and use this zpool command to create each storage pool.  The general syntax for creating a zpool is as follows:

	```
	zpool create [-f] -O canmount=off \
	-O mountpoint=none \
	[ -o <option> ] \
	-o cachefile=none \
	-o failmode=panic \
	<zpool name> <zpool specification>
	```
    ZFS is highly configurable and there are a wide range of optional parameters that can be applied to a ZFS pool, to improve performance or to modify functionality. The most important of these are as follows:
    - `cachefile=none`: ZFS uses the cachefile to identify pools it can automatically import, but this does not make consideration for shared storage cluster environments. To prevent a ZFS pool from being added to the default cachefile and automatically imported at system boot, it is essential that all ZFS pools that are held on shared storage have the cachefile set to the special value “none”. This, in conjunction with setting the hostid provides a lightweight impediment against double-importing the pool.
    - `failmode=panic`: zpools should have the "failmode" parameter set to "panic". This will cause a host that has lost connectivity to the underlying storage devices, or has experienced too many device failures, to shut down immediately. The node is thus prevented from issuing undesired writes to a zpool after catastrophic failures, including host disconnection from the zpool. When ZFS pools are operating within an HA cluster framework, panicking a node will also trigger a failover event in the cluster, allowing the zpools to be imported to a standby node, and services to continue operation.
    - `ashift`: used to override ZFS auto-detection of the physical vdev storage sector size. Advanced format drives are known to cause issues by incorrectly reporting the native sector size. Setting the ashift property forces ZFS to use a specific sector size, and can yield improved performance. The value of ashift is an exponent to power of 2. Typically used to set 4KB sector size, (ashift=12).

    In addition to zpool properties, there are also properties that can be applied to the ZFS datasets in a pool.  ZFS dataset properties are set in the zpool command using a capital letter -O, rather than the lower case letter -o flag used for the cachefile and ashift settings. The -O flag is used to set properties to the root file system data set in the pool, rather than for properties of the pool itself. The following ZFS dataset properties are of particular importance:

    - `canmount=off`: prevent the dataset from being mounted using the standard zfs mount command. Essential for Lustre OSDs, which must be mounted and unmounted using the `mount.lustre` (or `mount -t lustre`) command.
    - `recordsize`: this sets a suggested block size for the file system. The block size cannot exceed this value. The default value, 128KB, is fine for MGT and MDT OSDs. For OSTs, where large block IO is the dominant workload, set the recordsize=1M, which is the maximum currently allowed in ZFS on Linux version 0.6.5. Future versions of ZFS are expected to be able to further increase this value.
    - `mountpoint=none`: in monitored mode, the management software requires that ZfsDatasets have the following property values to prevent undesired automatic mounting.

    For more details, refer to the section ZFS OSDs, in the guide titled Lustre Installation and Configuration using Integrated Manager for Lustre software and OpenZFS, as well as the system man pages for zfs(8) and zpool(8).

    Following are three examples of typical pool configurations, one each for MGT, MDT and OST respectively:

  - ZFS pool for MGT (typically a simple mirror):

	```
	zpool create -O canmount=off \
	-O mountpoint=none \
	-o cachefile=none \
	-o failmode=panic \
	mgspool mirror <dev A> <dev B>
  	```

  - ZFS pool for MDT (typically a stripe of mirrors to maximize performance):

	```
	zpool create -O canmount=off \
	-O mountpoint=none \
	-o cachefile=none \
	-o failmode=panic \
	<fsname>-mdt<n>pool \
	mirror <dev A> <dev B> [ mirror <dev C> <dev D> ] ...
	```

	**Note:** The naming convention for the pool name is intended to reflect the Lustre file system name (\<fsname\>) and the MDT index number (\<n\> usually 0, unless DNE is used). The number of mirrors used for the MDT depends on the requirements of the installation and can be scaled up accordingly.

   - ZFS pool for OST (typically a RAIDZ2 pool, balancing reliability against optimal capacity):

		```
		zpool create -O canmount=off \
		-O recordsize=1M \
		-O mountpoint=none \
		-o failmode=panic \
		-o cachefile=none \
		[ -o ashift=12 ] \
		<fsname>-ost<n>pool \
		raidz2 <dev A> <dev B> \
		<dev C> <dev D>  <dev E> <dev F> ...
		```

**Note:** See the document *Lustre Installation and Configuration using Integrated Manager for Lustre software and OpenZFS* for descriptions of the ashift and recordsize properties. RAIDZ2 is the preferred vdev configuration for OSTs, and we recommend an arrangement of at least 11 disks (9+2) per RAIDZ2 vdev for best performance. The pool naming convention is based on the Lustre file system name and OST index number, starting at 0 (zero).

   The remainder of this procedure is performed at the Integrated Manager for Lustre software GUI.
1. For high-availability, configure your servers as primary and fail-over servers for each zpool.  Perform the steps in [Configure primary and fail-over servers](Creating_new_lustre_fs_3_0.md/#3.5).
1. If you are using power distribution units (PDUs) for power control, then for each server, perform the steps in [Add power distribution units](Creating_new_lustre_fs_3_0.md/#3.6).  Then perform the steps in [Assign PDU outlets to servers](Creating_new_lustre_fs_3_0.md/#3.7) for each server.
1. If you are using Baseboard Management Controllers (BMCs) for power control, then perform the steps in [Assign BMCs to servers](Creating_new_lustre_fs_3_0.md/#3.8) for each server.
1. Perform the steps in [Create the new Lustre file system](Creating_new_lustre_fs_3_0.md/#3.0), using the zpools you created in step 4 above as object storage targets (volumes), rather than direct block devices.  Each ZFS pool that you created will appear as a target, with the Type identified as a **ZfsPool**.

[Top of page](#8.0)

## Importing and exporting ZFS pools in a shared-storage high-availability cluster

ZFS file system datasets are always members of a pool, and the pool must be imported to a host before any action can be taken to alter its content. In a shared-storage, high-availability cluster, some pools may be imported on different hosts. This is a common and recommended practice that balances distribution of Lustre OSDs equitably across the HA cluster nodes.

One must always manage ZFS pools and their contents from the host where the pool is imported, but it is easy to overlook and miss ZFS pools that are exported. Use the combined output of ```zpool list``` and ```zpool import``` to gain a complete list of all storage pools available to a host, and import any pools that require administration.

1. List the currently imported ZFS pools:
	```
	zpool list
	```
2. If any of the pools that are expected to be on this host are missing, it may be that the pools have been exported, or are imported on a different host. Use the ```zpool import``` command to identify these pools. For example:

	```
	[root@rh7z-oss1 ~]# zpool import
   pool: demo-ost0pool
     id:<PHONE_NUMBER>3776112603
     state: ONLINE
     action: The pool can be imported using its name or numeric identifier.
     config:

	demo-ost0pool  ONLINE
	  raidz2-0  ONLINE
	    sda     ONLINE
	    sdb     ONLINE
	    sdc     ONLINE
	    sdd     ONLINE
	    sde     ONLINE
	    sdf     ONLINE

   pool: demo-ost1pool
     id:<PHONE_NUMBER>44251623
     state: ONLINE
     status: The pool was last accessed by another system.
     action: The pool can be imported using its name or numeric identifier
     and the '-f' flag.
   see: http://zfsonlinux.org/msg/ZFS-8000-EY
   config:

	demo-ost1pool                             ONLINE
	  raidz2-0                                ONLINE
	    scsi-0QEMU_QEMU_HARDDISK_IEELOST0001  ONLINE
	    scsi-0QEMU_QEMU_HARDDISK_IEELOST0007  ONLINE
	    scsi-0QEMU_QEMU_HARDDISK_IEELOST0011  ONLINE
	    scsi-0QEMU_QEMU_HARDDISK_IEELOST0010  ONLINE
	    scsi-0QEMU_QEMU_HARDDISK_IEELOST0009  ONLINE
	    scsi-0QEMU_QEMU_HARDDISK_IEELOST0008  ONLINE
	```
In the example, there are two exported pools. Note that the second pool in the list has a status attribute that is not displayed in the first pool, and that the action attribute indicates that the pool can only be imported by force (indicated by the `-f` flag). This means that the pool has been imported on a different host. Do not import pools that are in this condition unless it can be absolutely determined that the other host is offline or does not have this pool running (this is commonly the case when a server crashes or loses power in an unclean shutdown).
1. Use the ```zpool import``` command, along with the pool name, to import a pool onto the host:
	```
	zpool import [-f] <pool name>
	```
	For example:
	```
	[root@rh7z-oss1 ~]# zpool import demo-ost0pool
	```
	A simple approach to discovering all of the pools for all of the nodes in an HA cluster, is to run ```partprobe``` on each host. Zpools do not have to be exported or imported for this approach to work.

[Top of page](#8.0)

## Removing a ZFS-based Lustre file system

When removing a Lustre file system, the Integrated Manager for Lustre software does not destroy the data content held on Lustre OSDs. This allows the operator an opportunity to recover data from the OSDs if the file system was removed from IML accidentally. As a consequence, after the file system is removed from the manager, the OSD volumes may need to be cleaned up as a separate operation before they are ready to be re-used.

LDISKFS volumes do not require any special treatment; they can simply be reformatted, either by hand or by re-adding the volumes into a new Lustre file system via  Integrated Manager for Lustre software. The manager software will detect the pre-existing Lustre data, and ask the user to confirm that the volume is to be re-used.
ZFS OSDs require some additional work. ZFS OSDs are file system datasets inside zpools. After a file system is removed using Integrated Manager for Lustre software, any ZFS OSDs from that file system will still be present in the ZFS storage pools (zpools), and cannot be re-used directly. To reuse the storage in a zpool, the existing OSD datasets must first be removed, using the zfs destroy command.  This is described in these sections:

- [Destroy an individual zpool](#8.4)
- Destroy all of the ZFS pools in a shared-storage high-availability cluster

[Top of page](#8.0)

## Destroy an individual zpool

Perform the following steps.

1. Run the zpool list command to display a list of zpools currently imported on the host.

1. If a pool is missing from the output, it may be imported on a different host or it may be in the exported state. Use the zpool import command to identify ZFS pools  that have been created, but are not imported on the current host:
	```
	zpool import
	```
If a zpool has a status field that says the pool was last accessed by another system, this pool may still be active on a different host connected to the same shared storage. The output will include fields similar to the following:
```
...
status: The pool was last accessed by another system.
action: The pool can be imported using its name or numeric identifier
and the '-f' flag.
...
```
Don't force an import of a pool in this state unless you are certain that the other host is offline. If possible, either export the zpool from the other host so that it can be imported, or log into the other host to perform the required work.
1. If necessary, use the zpool import command, along with the pool name, to import a pool onto the host:
```
zpool import <pool name>
```
1.  Confirm that the pool has been removed with zpool list.

[Top of page](#8.0)

## Destroy all of the ZFS pools in a shared-storage

Perform the following steps.

1. Log into each server in the cluster framework that is connected to the same shared storage and export all of the ZFS pools:
```
zpool export –a
```
1. On one host, import all of the zpools:
```
zpool import –a
```
1. List the zpools:
```
zpool list
```
1. For each pool, run the zpool destroy command:
```
zpool destroy [-f] <pool name>
```
The `-f` flag will force the destruction of the pool, unmounting any active datasets that may be present.

[Top of page](#8.0)

license: OpenSSL,MIT

repository: nixuser/Online-Help

detected_licenses: OpenSSL MIT

repo_name: nixuser/Online-Help


text:
## fastrandom

(This code is for research purposes.)

Fast random number generation in Go. We use a division-less range function
to get a "fast" shuffle in Go.

```bash
$ go get github.com/dgryski/go-pcgr
$ go version
go version go1.7beta2 linux/amd64
$ go test -bench=.
testing: warning: no tests to run
BenchmarkStandardShuffleWithGo1000-2                                50000         30628 ns/op
BenchmarkStandardShuffleWithPCGWithDivision1000_dgryski-2          200000          9016 ns/op
BenchmarkStandardShuffleWithPCGButNoDivision1000_dgryski-2         300000          5066 ns/op
PASS
ok      _/home/dlemire/CVS/github/fastrandom    5.293s
```

Further reading:
http://lemire.me/blog/2016/06/30/fast-random-shuffling/

repository: lemire/fastrandom

repo_name: lemire/fastrandom


text:
## Install

`ckan-cloud-operator-env` is used to install and manage CKAN Cloud operator environments on your local PC

**Prerequisites:**

* `.kube-config` file with permissions to the relevant cluster

Install latest ckan-cloud-operator-env

```
curl -s https://raw.githubusercontent.com/datopian/ckan-cloud-operator/master/ckan-cloud-operator-env.sh \
| sudo tee /usr/local/bin/ckan-cloud-operator-env >/dev/null && sudo chmod +x /usr/local/bin/ckan-cloud-operator-env
```

Add an environment (sudo is required to install the executable)

```
sudo ckan-cloud-operator-env add <ENVIRONMENT_NAME> <PATH_TO_KUBECONFIG_FILE>
```

Verify conection to the cluster and installed operator version (may take a while on first run or after upgrade of operator version)

```
ckan-cloud-operator cluster info
```

**Important** Re-run the add command and cluster info to verify compatible version is installed.

## Usage

Use the CLI help messages for the reference documentation and usage examples.

```
ckan-cloud-operator --help
ckan-cloud-operator deis-instance --help
.
.
```

You can use bash completion inside this shell

```
ckan-cloud-operator <TAB><TAB>
```

## Managing multiple environments

ckan-cloud-operator-env supports managing multiple environments

Add environments using `ckan-cloud-operator-env add <ENVIRONMENT_NAME> <PATH_TO_KUBECONFIG_FILE>`

Each environment is accessible using executable `ckan-cloud-operator-<ENVIRONMENT_NAME>`

Activating an environment sets the `ckan-cloud-operator` executable to use to the relevant environment executable

```
ckan-cloud-operator-env activate <ENVIRONMENT_NAME>
```

## Run ckan-cloud-operator locally

Ensure you have `kubectl` and `gcloud` binaries, authenticated to the relevant gcloud account / kubernetes cluster.

See the required system dependencies: [environment.yaml](environment.yaml)

You can [Install miniconda3](https://conda.io/miniconda.html), then create the environment using: `conda env create -f environment.yaml`

Activate the conda environment using `conda activate ckan-cloud-operator`

Install the Python package:

```
python3 -m pip install -e .
```

Authenticate the gcloud CLI to the relevant account:

```
ckan-cloud-operator activate-gcloud-auth
```

Run ckan-cloud-operator without arguments to get a help message:

```
ckan-cloud-operator
```

Enable Bash completion

```
eval "$(ckan-cloud-operator bash-completion)"
```

## Using Jupyter Lab

Jupyter Lab can be used to run bulk operations or aggregate data from ckan-cloud-operator

You should run ckan-cloud-operator locally and run the following from the activated ckan-cloud-operator environment

Install jupyterlab

```
python3 -m pip install jupyterlab
```

Run jupyterlab

```
jupyter lab
```

Open notebooks from the `notebooks` directory

## Run tests
If you already have `ckan-cloud-operator` executable in your PATH, you could run test suite with `ckan-cloud-operator test` command.

The other way to run test suite is `coverage run -m unittest discover`.

repository: datopian/ckan-cloud-operator

repo_name: datopian/ckan-cloud-operator


text:
# Tutorial 06 - Raspbootin64

We are now at a point where we have a running serial connection, but for each
new feature we want to try, we still have to write and exchange the SD card
every time.

As this tends to get very annoying and also to avoid potential SD card damage,
we create a kernel8.img that will load the real kernel8.img over serial.

This tutorial is a rewrite of the well known serial boot loader
[raspbootin][bootin] in 64-bit. We only provide one part of the loader, the
kernel receiver, which runs on the RPi. For the other part, the sender, which
runs on your PC, we will rely on the original [raspbootcom][bootcom] utility.

[bootin]:(https://github.com/mrvn/raspbootin)
[bootcom]:(https://github.com/mrvn/raspbootin/blob/master/raspbootcom/raspbootcom.cc)

For convenience, it is already packaged in our `raspi3-utils` docker
container. So if you are running a Linux host, it will be as easy as calling
another Makefile target. It will be included starting with the next tutorial,
`07_abstraction`. You can invoke it with

```bash
make raspboot
```

If you want to use it with earlier versions of this tutorial, here is a bash
command to invoke it:

```bash
docker run -it --rm \
           --privileged -v /dev/:/dev/ \
           -v $PWD:/work -w /work \
           raspi3-utils \
           raspbootcom /dev/ttyUSB0 kernel8.img
```

In any case, if your USB device is enumerated differently, adapt accordingly.

If you want to send kernels from a Windows machine, I suggest to take a look at
John Cronin's rewrite, [raspbootin-server][w32] which can be compiled for the
Win32 API. Even more, [@milanvidakovic](https://github.com/milanvidakovic) was
so kind to share a [Java version][java] of the kernel sender with you.

[w32]:(https://github.com/jncronin/rpi-boot/blob/master/raspbootin-server.c)
[java]:(https://github.com/milanvidakovic/Raspbootin64Client)

## Chain Loading

In order to load the new kernel to the same address, we have to move ourself out
of the way. It's called `chain loading`: One code loads the next code to the
same position in memory, therefore the latter thinks it was loaded by the
firmware. To implement that, we use a different linking address this time, and
since the GPU loads us to `0x80_000` regardless, we have to copy our code to
that link address. When we're done, the memory at `0x80_000` is free to use. You
can check that with:

```sh
$ cargo nm -- kernel8 | grep reset
000000000007ffc0 T reset
```

We also should minimize the size of the loader, since it will be overwritten by
the newly loaded code anyway. By removing `Uart::puts()` and other functions,
we've managed to shrink the loader's size to 1024 bytes.

## boot_cores.S

First, we have to save the arguments in registers passed by the
firmware. Second, we added a loop to relocate our code to the address it should
have been loaded to. And last, since rustc generates RIP-relative jumps, we must
adjust the branch instruction to jump to the relocated Rust code.

## Linker and Boot Code

We use a different linking address this time. We calculate our code's size to
know how many bytes we have to copy.

Additionally, we can remove the `bss section` entirely, since our loader does
not use any static variables.

## main.rs

We print 'RBIN64', receive the new kernel over serial and save it at the memory
address where the start.elf would have been loaded it. When finished, we restore
the arguments and jump to the new kernel using an absolute address.


text:
# forms-angular
## Probably the most opinionated framework in the world

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/forms-angular/forms-angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://travis-ci.org/forms-angular/forms-angular.png?branch=master)](https://travis-ci.org/forms-angular/forms-angular)
[![Dependency Status](https://david-dm.org/forms-angular/forms-angular.png)](https://david-dm.org/forms-angular/forms-angular.png)

See the documentation at http://www.forms-angular.org

## Installation of forms-angular
Recommended: use yeoman generator.

Alternative: you can install both front-end and back-end modules:
````
npm install --save forms-angular
bower install --save forms-angular
````

## For developers of forms-angular
````
npm install -g tsd
tsd update -so
````
Prepare a new release:
````
gulp all
````


text:
Javabytes
=====================================

Welcome to Javabytes, a disassembler for your java code. Inspired by a project by Matt Godbold called [GCC Explorer](https://github.com/mattgodbolt/gcc-explorer).
Enter some arbitrary java code and this application will do a few things:

1. Generate a random class to hold your code.
2. Put all of the code you entered into a public static void test() method.

This is done solely out of convenience so that you don't have to write boilerplate code everytime.

Currently only supports [OpenJDK8](http://openjdk.java.net/projects/jdk8/)

The demo site can be found [here](http://javabytes.io/).

repository: luoshengsheng/javabytes

repo_name: luoshengsheng/javabytes


text:
## BinarySearch
Binary search in a sorted 1D 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.

### Example
[4,8,15,16,23,42], 15  => 15

[11,22,33,44,55,66,77], 90 => -1

## Solution
![Reverse image](/Assets/Binary_search.JPG)

## Testing
![Reverse image](/Assets/Binary-Search-Test.JPG)

## Resources and Links
401 -.NET students

Adam Granquist

Stack overflow

src_encoding: MacCentralEurope


text:
# Code refactorings for VisualStudio

- [Invert assignment direction](#invert-assignment-direction)
- [Generate mapping](#generate-mapping)
- [Rename variable after type/expression](#rename-variable-after-typeexpression)
- [Introduce parameter object](#introduce-parameter-object)
- [MediatR add RequestHandler and Request](#mediatr-add-requesthandler-and-request)
- [Convert to full WPF property](#convert-to-full-wpf-property)
- [Encapsulate field for WPF](#encapsulate-field-wpf)
- [Copy paste with conversion](#copypaste-with-case-conversion)

## Invert assignment direction

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.InvertAssignmentDirection?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.InvertAssignmentDirection)

Visual Studio code refactoring that allows swapping arguments around the equal sign in an assignment statement. It works on single or many selected assignment statements at once.

## Generate mapping

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.GenerateMapping?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.GenerateMapping)

Visual Studio code refactoring that generates mapping code, between method input parameters and method return type. If any of them is void, "this" is used instead. Design time AutoMapper alternative.

What can be generated:

- mapping method
- copy constructor
- memento method get state
- memento method set state
- deconstruct method

General rules:

- mapping is available only for methods/constructors with an empty body
- mapping can be done for more than one input parameter
- for the left side of the assignment considered are all writable fields and properties
- for the right side of the assignment considered are all readable fields and properties
- for the assignment of mutable reference type, a "new" instance is always created
- recursive mapping is not, and will not be supported
- mapping to tuples is supported
- mapping to positional records is supported

## Rename variable after type/expression

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.RenameVariableAfterType?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.RenameVariableAfterType)

Visual Studio code refactoring that changes a variable name, to an auto-generated name from the variable type or expression used in the assignment, e.g. "Foo x =" => "Foo foo ="

- a simple heuristic, not AI based (yet)
- works on a single or many variables at once
- works on a single method parameter

## Introduce parameter object

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.IntroduceParameterObject?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.IntroduceParameterObject)

Visual Studio implementation of code refactoring [Introduce Parameter Object](https://refactoring.com/catalog/introduceParameterObject.html) from Martin Fowler's book "Refactoring, Improving the Design of Existing Code".

##### Limitations
- it does not support generic type parameters
- updating method body is done syntactically, not semantically, it means they may appear conflicts if a method parameter shares the same name with something else

## MediatR add RequestHandler and Request

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.MediatRAddRequestHandlerAndRequest?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.MediatRAddRequestHandlerAndRequest)

Visual Studio code refactoring that adds Command class which implements [MediatR](https://github.com/jbogard/MediatR) IRequest<> interface and handler class which implements [MediatR](https://github.com/jbogard/MediatR) IRequestHandler<> interface.
It only creates empty boilerplate code required by MediatR based on the selected method name and return type.

##### Limitations
- does not support generic type parameters

##### Changelog

version 1.5
- RequestHandler can also be generated from an existing Request class

## Convert to full WPF Property

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.ConvertToFullWPFProperty?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.ConvertToFullWPFProperty)

Visual Studio code refactoring that replaces an auto-property with full property implementation that consists invocation of OnPropertyChanged in a setter. It can convert many auto-properties at once.

## Encapsulate field (WPF)

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.EncapsulateFieldForWPF?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.EncapsulateFieldForWPF)

Visual Studio code refactoring that creates full property implementation with an invocation of OnPropertyChanged in a setter for a selected set of backing fields.

## Copy/Paste with case conversion

[![download](https://img.shields.io/visual-studio-marketplace/v/NeVeS.CopyPasteWithConversion?label=download&style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=NeVeS.CopyPasteWithConversion)

Visual Studio extension that adds two commands to the text editor context menu that do case conversion before copy/paste.

Two kinds of conversion are available:
- Copy as sentence case (also splits selected text to separate words)
- PasteAsPascalCase

repository: NeVeSpl/CodeRefactoringsForVisualStudio

repo_name: NeVeSpl/CodeRefactoringsForVisualStudio


text:
---
package_name: "mac-symbols"
package_title: "Mac Symbols"
package_desc: "Display common Mac symbols like ⌘ and ⌥"
package_version: "0.1.1"
package_author: "Lifesign"
package_original_repo: "https://github.com/lifesign/espanso-mac-symbols"
package_repo: "https://github.com/federico-terzi/espanso-hub-core"
is_core: true
---
A simple package to display common Mac symbols like ⌘ and ⌥, More details below

### Installation

Install the package with:

```
espanso install mac-symbols
espanso restart
```

### Usage
This package replaces the following keywords with the associated mac symbols while you’re typing:

| Keyword | Replaced |
| --- | --- |
| `:cmd` | ⌘ |
| `:shift` | ⇧ |
| `:ctrl` | ⌃ |
| `:alt` | ⌥ |
| `:left` | ← |
| `:right` | → |
| `:up` | ↑ |
| `:down` | ↓ |
| `:caps_lock` | ⇪ |
| `:esc` | ⎋ |
| `:eject` | ⏏ |
| `:return` | ↵ |
| `:enter` | ⌅ |
| `:tab` | ⇥ |
| `:backtab` | ⇤ |
| `:pgup` | ⇞ |
| `:pgdown` | ⇟ |
| `:home` | ↖ |
| `:end` | ↘ |
| `:space` | ␣ |
| `:del` | ⌫ |
| `:fdel` | ⌦  |

repository: federico-terzi/espanso-hub

repo_name: federico-terzi/espanso-hub


text:
---
title: "Deploy to VM via FTP"
description: "Deploying a PHP application to a VM using FTP"
group: example-catalog
sub_group: cd-examples
redirect_from:
  - /docs/yaml-examples/examples/transferring-php-ftp/
  - /docs/learn-by-example/java/spring-mvc-jdbc-template/
toc: true
---

## Prerequisites

- A [Codefresh account]- A [Codefresh account]({{site.baseurl}}/docs/administration/account-user-management/create-codefresh-account/)
- A remote machine with an FTP server and SSH setup (ensure that your FTP directory, I.e., `/srv/ftp/pub` has the proper write permissions for the FTP user).

>Note that as you may already know, FTP is extremely insecure as it relies on plain-text passwords and usernames, making data very vulnerable to sniffing.  A more secure solution would be to use SFTP or SCP.

## Example PHP project

The example project can be found on [GitHub](https://github.com/codefresh-contrib/ftp-php-app){:target="\_blank"}.  The application is a simple PHP application that displays an example timer.

{% include image.html
lightbox="true"
file="/images/examples/php-file-transfer/test-environment.png"
url="/images/examples/php-file-transfer/test-environment.png"
alt="Example PHP Application"
caption="Example PHP Application"
max-width="90%"
%}

## Create the pipeline

Our pipeline includes four stages:

- A stage for cloning
- A stage for packaging
- A stage for transferring files

{% include image.html
lightbox="true"
file="/images/examples/php-file-transfer/pipeline.png"
url="/images/examples/php-file-transfer/pipeline.png"
alt="Codefresh UI Pipeline View"
caption="Codefresh UI Pipeline View"
max-width="90%"
%}

Here is the entire pipeline:

`codefresh.yml`
{% highlight yaml %}
{% raw %}
# More examples of Codefresh YAML can be found at
# https://codefresh.io/docs/docs/example-catalog/

version: "1.0"
# Stages can help you organize your steps in stages
stages:
  - "clone"
  - "install"
  - "transfer"
steps:
  clone:
    title: "Cloning main repository..."
    type: "git-clone"
    arguments:
      repo: "codefresh-contrib/ftp-php-app"
      git: "github"
    stage: "clone"
  install_dependencies:
    title: "Collecting Php dependencies..."
    type: "freestyle"
    working_directory: "./ftp-php-app"
    arguments:
      image: "composer:1.9.3"
      commands:
        - "composer install --ignore-platform-reqs --no-interaction --no-plugins --no-scripts --prefer-dist"
    stage: "install"
  ftp_transfer:
    title: "Transferring application to VM via ftp..."
    type: "freestyle"
    working_directory: "./ftp-php-app"
    arguments:
      image: "dockito/lftp-client:latest"
      environment:
        - USER=<USER>
        - PASSWORD=<PASSWORD>
        - HOST=<HOST>
        - PUB_FTP_DIR=<PATH/TO/DIR>
      commands:
        - lftp -e "set ftp:use-site-utime2 false; mirror -x ^\.git/$ -X flat-logo.png -p -R ftp-php-ap $PUB_FTP_DIR/ftp-php-app; exit" -u $USER,$PASSWORD $HOST
    stage: "transfer"
{% endraw %}
{% endhighlight %}

This pipeline does the following:

1. Clones the main repository through a [Git-clone step]({{site.baseurl}}/docs/pipelines/steps/git-clone/).
2. Installs the necessary PHP dependencies for our application through a [freestyle step]({{site.baseurl}}/docs/pipelines/steps/freestyle/).
3. Transfers our application via FTP through another freestyle step. Note that you will need to change the environment variables to your respective values, either in the YAML itself (above), or through the pipeline settings:

{% include image.html
lightbox="true"
file="/images/examples/php-file-transfer/variables.png"
url="/images/examples/php-file-transfer/variables.png"
alt="Codefresh Environment Variables"
caption="Codefresh Environment Variables"
max-width="90%"
%}

## Related articles
[CD pipeline examples]({{site.baseurl}}/docs/example-catalog/examples/#cd-examples)
[Codefresh YAML for pipeline definitions]({{site.baseurl}}/docs/pipelines/what-is-the-codefresh-yaml/)
[Creating pipelines]({{site.baseurl}}/docs/pipelines/pipelines/)
[How Codefresh pipelines work]({{site.baseurl}}/docs/pipelines/introduction-to-codefresh-pipelines/)

gha_language: SCSS


text:
consul-backdown
===============

Pipe-able backup tool for Consul's K/V.

HOW DO I USE IT?
----------------

First, install it with:

    go get github.com/ghostbar/consul-backdown

Or just go to the [releases](https://github.com/ghostbar/consul-backdown/releases)
page and download the binary for your system.

Then, just run it like:

    $GOPATH/bin/consul-backdown backup > my-kv-backup.txt

More help can be found on `$GOPATH/bin/consul-backdown --help`.

HOW IS THIS DIFFERENT TO CONSUL-BACKUP?
---------------------------------------

There's another older tool,
[kailunshi/consul-backup](https://github.com/kailunshi/consul-backup) that may
work pretty well for you. Go and try it. This tool is actually based on that.

So why build this?:

- The code is not very well written, not even correctly formatted with gofmt.
- It's not pipe-able.
- It's not fully configurable.
- Author is not responsive to pull-requests (reason why I did not sent my
  improvements over there in the first time but instead wrote this).
- No binary releases.

AUTHOR AND LICENSE
------------------

© 2016, Jose-Luis Rivas<EMAIL_ADDRESS>
This software is licensed under the MIT terms, a copy of the license can be
found in the `LICENSE` file in this repository.

repository: ghostbar/consul-backdown

repo_name: ghostbar/consul-backdown


text:
# DataGrip-GeoJSON-extractor
A extractor for DataGrip to export geojson file by sql query directly.
```sql
SELECT row_to_json(fc)
FROM (SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features
      FROM (SELECT 'Feature'                      As type
                 , ST_AsGeoJSON(lg.geom, 4)::json As geometry
                 , row_to_json((SELECT l
                                FROM (SELECT loc_id, loc_name) As l
          ))                                      As properties
            FROM locations As lg) As f) As fc;
```

repository: wandergis/DataGrip-GeoJSON-extractor

repo_name: wandergis/DataGrip-GeoJSON-extractor


text:
# Stardew-Mods

## Custom Quest Expiration
Change the Daily Quest expiration (make it never expire, expire after 5 days, etc)

## TillableGround
Make any tile tillable (so you can use your hoe on it)

## Better Junimos
Allow your junimos (from junimo huts) to automatically plant seeds, fertilize, and much more!

### *BetterJunimosApi*

GetJunimoHutMaxRadius() // int: max radius

GetJunimoHutMaxJunimos() // int: max junimos

GetWereJunimosPaidToday() // bool: did the user pay the junimos today

repository: SanSoares/smapi-mod-dump

repo_name: SanSoares/smapi-mod-dump


text:
This is the class for the PlayerObject, this can be any PlayerObject.

Since PlayerObject can be any player, this means that some functions will be called while on the menu, or as the second player.

Here are the known addresses:

```cpp
PlayerObject::pushButton = base + 0x1F4E40

PlayerObject::releaseButton = base + 0x1F4F70

PlayerObject::playDeathEffect = base + 0x2EFBE0

PlayerObject::playerDestroyed = base + 0x1EFAA0

PlayerObject::flipGravity = base + 0x1F59D0

PlayerObject::toggleFlyMode = base + 0x1F5E40

PlayerObject::toggleBirdMode = base + 0x1F6050

PlayerObject::toggleRollMode = base + 0x1F68E0

PlayerObject::toggleDartMode = base + 0x1F62C0

PlayerObject::toggleRobotMode = base + 0x1F6A10

PlayerObject::toggleSpiderMode = base + 0x1F94D1

PlayerObject::updateTimeMod = base + 0x1F94E0

PlayerObject::togglePlayerScale = base + 0x1F9640

PlayerObject::setFlipX = base + 0x1fa690

PlayerObject::setFlipY = base + 0x1fa740

PlayerObject::resetObject = base + 0x1eecd0

PlayerObject::getRealPosition = base + 0x1f7e20

PlayerObject::getOrientedBox = base + 0x1f95d0

PlayerObject::fadeOutStreak2 = base + 0x1F9110

PlayerObject::toggleGhostEffect = base + 0x1F8930

float PlayerObject.x = PlayerObject + 0x34

float PlayerObject.y = PlayerObject + 0x38

double PlayerObject.y_acceleration = PlayerObject + 0x628

float PlayerObject.hitbox_rotation = PlayerObject + 0x20

float PlayerObject.sprite_rotation = PlayerObject + 0x24

CCNodeRGBA PlayerObject.wave_trail = PlayerObject + 0x514
```