text:
---
layout: post
title: Customizing Ecto Changesets to Validate Data and Ensure Data Integrity
categories: posts
date: 2016-08-13 11:15:00
summary: Ecto Changesets are a powerful way to validate data before inserting it into the database
---

Ecto changesets help us cast, validate, filter, and manipulate data.
This post will walk through how to leverage Ecto changesets to validate data
before we insert it into the database to ensure data integrity.
For example, let's say that in our app, we can create a user with a name,
but we want to validate the name before we insert it into the database.

Before diving into what Ecto changesets can do to validate our data,
let's first look at a barebones create action in a Phoenix controller and see how
changesets play a role in our controller. Since we only expect the user to enter a name,
the `user_params` will look like `{name: "Michael Jordan"}`.

{% highlight elixir %}
def create(conn, %{"user" => user_params}) do
  changeset = User.changeset(%User{}, user_params)

  case Repo.insert(changeset, conn: conn) do
      {:ok, user} ->
        conn
        |> put_status(:created)
        ...
      {:error, changeset} ->
        conn
        |> put_status(:unprocessable_entity)
        ...
    end
{% endhighlight %}

At a very high level, the code above passes the `user_params` into the changeset and
then tries to insert the changeset into the database. Depending on the changeset,
the insert will either be successful with a  `{:ok, _}` and we return a `200 status`
or the insert will not be successful `{:error, _}` and we return a `422 status`.

Out of the box, the changeset function will simply cast the data to prepare it to be inserted into
the database. This is what a simple changeset function inside the User model looks like:

{% highlight elixir %}
def changeset(model, params \\ :empty) do
  model
  |> cast(params, @required_fields, @optional_fields)
end
{% endhighlight %}

We pass in the `%User{}` as our `model` and `user_params` as our `params`.
We cast the `name` field and the changeset function will return:

{% highlight elixir %}
%Ecto.Changeset{action: nil, changes: %{name: "Michael Jordan"},
constraints: [], errors: [], filters: %{} ...}
{% endhighlight %}

Note how the `constraints` and `errors` are empty! This means the
the changes are valid. We will have to add code to our changeset
so that if the changes are not valid, the changeset will tell us in `constraints` or `errors`.

**Adding A Built-In Constraint**

Let's say that we want to add a constraint that the name needs to be unique. We cannot
have two users with the same name because that will be confusing. Luckily, Ecto has
[built in constraint](https://hexdocs.pm/ecto/Ecto.Changeset.html)
that we can take advantage of.

Below, we are adding a unique constraint on the name field into the changeset:

{% highlight elixir %}
def changeset(model, params \\ :empty) do
  model
  |> cast(params, @required_fields, @optional_fields)
  |> unique_constraint(:name)
end
{% endhighlight %}

And if we now try to insert a new user with the name `Michael Jordan`, the changeset
will look like this:

{% highlight elixir %}
%Ecto.Changeset{action: nil, changes: %{name: "some content"},
 constraints: [%{constraint: "users_name_index", field: :name,
    message: "has already been taken", type: :unique}], .. }
{% endhighlight %}

Aha! The changeset now includes `constraints: [%{constraint: "users_name_index", field: :name,
message: "has already been taken", type: :unique}`. Now, when we do `Repo.insert(changeset, conn: conn)`,
it will not insert the data and instead will return `{:error, _}`.

**Adding a Custom Constraint**

We can also build our own validations if the ones that Ecto provides out of the box
are insufficient. For example, let's say that we want to validate the uniqueness of
all names, but for some reason, we do not want to validate the uniquess of name if the name is `Michael Jordan`.
We are okay with as many users as possible with the name `Michael Jordan`, but only `Michael Jordan`
(I know, a silly example :smile:).

{% highlight elixir %}
def changeset(model, params \\ :empty) do
  model
  |> cast(params, @required_fields, @optional_fields)
  |> special_unique_name_validation
end

defp special_unique_name_validation(changeset) do
  new_name = get_field(changeset, :name)

  cond do
    new_name == "Michael Jordan" ->
      changeset
    true ->
      changeset
      |> unique_constraint(:name)
  end
end
{% endhighlight %}

In the above example, we include a new private function `special_validate_unique_name`
in the changeset and pass the changeset into it. Inside the function, we get the name from the changeset
and see if the name is `Michael Jordan`. If the name is `Michael Jordan`, then we do
nothing and pass the changeset through. If the name is not `Michael Jordan`, we take
the changeset and add a unique constraint to it for the name.

{% highlight elixir %}
%Ecto.Changeset{action: nil, changes: %{name: "Lebron James"}, constraints: [],
 errors: [name: "has already been taken."]
{% endhighlight %}

It works!

**Adding a Validation**

We have only been looking at constraints, but we can also add built in and custom
validations to our changeset. For example, let's say that we also want to make sure
that our name field does not go above 20 characters. We can add Ecto's built in
`validate_length` validation.

{% highlight elixir %}
def changeset(model, params \\ :empty) do
  model
  |> cast(params, @required_fields, @optional_fields)
  |> validate_length(:name, max: 20)
  |> special_unique_name_validation
end
{% endhighlight %}

Trying to insert a user with a name longer than 20 characters with the changeset function
will yield the following changeset:

{% highlight elixir %}
%Ecto.Changeset{action: nil, changes: %{name: "This is a super long name"}, constraints: [],
 errors: [name: {"should be at most %{count} character(s)", [count: 20]}] .. }
{% endhighlight %}

Just like when the changesets includes `constraints`, when the changeset includes
`errors` and we do `Repo.insert(changeset, conn: conn)`, it will not insert the data and instead will return `{:error, _}`.


text:
Dragon's Ingot
==============
Dragon's Ingot source code, immature engine.

Introduction:
-------------
[Dragon's Ingot](http://dragonsingot.com/) is an indie 3D action game. The game is in early development.
This open source project is just a technic showcase.

Features:
---------
* Command-Line Build ([cl.exe](https://msdn.microsoft.com/en-us/library/9s7c9wdw.aspx)).
* The fundamental 3D rendering technique is derived from
the [DirectX 11 book](http://www.amazon.com/dp/1936420228/) by Frank Luna.
* No visualization scene editor.
* The platform only supports Microsoft Windows.
* Little document support.
* Single core optimization.
* Mixing game data and engine code directly. (Very high coupling)

Compile Environment:
--------------------
Win 10
Visual Studio 2017 (require Desktop development for C++)
Windows SDK for Windows 10
DirectX SDK (June 2010)

Runtime Environment:
--------------------
Win 7.1 / Win 8.x / Win 10
DirectX End-User Runtimes (June 2010)
Visual C++ Redistributable for Visual Studio 2017
Update KB2670838 (Windows 7.1 situation)
DirectX 11 capable GPU
1024X768 minimum display resolution
DirectX 9.0c compliant sound card

Dependent .Lib Files for compiling:
---------------------
Those files should be in VC++ Library Directories,
notice corresponding x64/x86, Debug/Release version.
The .lib files you can get from each corresponding project.
* **DirectXTK.lib**: [DirectX Tool Kit](https://github.com/Microsoft/DirectXTK) (April 24, 2017)
* **DirectXTKAudioDX.lib**: [DirectX Tool Kit](https://github.com/Microsoft/DirectXTK)  (April 24, 2017)
* **Effects11.lib**: [Effects for Direct3D 11](https://github.com/Microsoft/FX11) (March 10, 2017), Debug version please rename.
* **lua.lib**: [Lua](https://www.lua.org/) 5.3.4
* **XInput1_3.lib**: Its orgin name is XInput.lib, from
[DirectX SDK (June 2010)](https://www.microsoft.com/en-us/download/details.aspx?id=6812)
* **X3DAudio.lib**: [DirectX SDK (June 2010)](https://www.microsoft.com/en-us/download/details.aspx?id=6812)
* **XAPOFX.lib**: [DirectX SDK (June 2010)](https://www.microsoft.com/en-us/download/details.aspx?id=6812)

How to Compile:
---------------
In sample\ folder, every subfolder include a signle sample.
The compile option see bat_tool\1.bat.
* **init_d3d**: A basic window draw empty.
* **m3dtob3m**: Command line tool, convert text .m3d model file to binary .b3m file.
Those two types both can be read by engine.
* **simple_scene**: A very simple scene draw 4 basic geometrics.
[(Screen Capture)](https://github.com/endrollex/imm_engine/tree/master/sample/simple_scene/simple_scene.png)

Runtime Folder Tree:
--------------------
See sample\simple_scene\, represents following tree.

	 |--ast_media
	 |--ast_model
	 |--ast_shader
	 |--ast_texture
	 |--script
         |--library
	     |--scene_common
	     |--scene00
	     |--text_en

Asset Tools:
------------
* **[immature Blender export](https://github.com/endrollex/imm_blender_export)**:
Export Blender model data to .m3d file format for immature engine.
* **[m3dtob3m.exe](https://github.com/endrollex/imm_engine/tree/master/sample/m3dtob3m)**:
Convert .m3d file to binary .b3m file.
Notice .b3m file corresponding x64/x86 version.
* **CSV based scene data**:
Unfortunately, this engine has not a scene editor let you can "drag and drop".
You must write a game object by handwriting, this limits the complexity of a scene.

Copyright and License:
----------------------
* Copyright 2015-2017 Huang Yiting (http://endrollex.com)
* immature engine is distributed under the the terms of the BSD license.
* immature engine's work not include the code in folders of suffix "_3rd_party".
* The complete game Dragon's Ingot is proprietary and retains intellectual property rights.

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
section: cli
title: axiom login
---

```bash
axiom login
```

Asks you for a passphrase and tells you your corresponding public key.

Most commands, if you aren't already logged in, will just ask you to
log in. So you usually don't need to run this explicitly.

There is no associated "username" with your passphrase. The passphrase
is all you need to gain access to the user account. The string username
in the Axiom system is just the public key associated with your
keypair. So your passphrase by itself should be a very unique phrase.

The CLI stores its configuration information in
`~/.axiom/config.json`. The `login` command will populate that file,
and subsequent commands will use the information in that file. You
should keep this file secure, just like you would with your SSH keys.

If you regret logging in, you can use [axiom
logout](#docs-cli-axiom-logout) to log back out.

license: MIT

gha_language: CSS

gha_license_id: MIT


text:
---
layout: post
title: "Double-sided probing by map of Asplund's distances using Logarithmic Image Processing in the framework of Mathematical Morphology"
date: 2018-01-25 07:57:28
categories: arXiv_CV
tags: arXiv_CV
author: Guillaume Noyel (IPRI, SIGPH@iPRI), Michel Jourlin (LHC, IPRI)
mathjax: true
---

* content
{:toc}

##### Abstract
We establish the link between Mathematical Morphology and the map of Asplund's distances between a probe and a grey scale function, using the Logarithmic Image Processing scalar multiplication. We demonstrate that the map is the logarithm of the ratio between a dilation and an erosion of the function by a structuring function: the probe. The dilations and erosions are mappings from the lattice of the images into the lattice of the positive functions. Using a flat structuring element, the expression of the map of Asplund's distances can be simplified with a dilation and an erosion of the image; these mappings stays in the lattice of the images. We illustrate our approach by an example of pattern matching with a non-flat structuring function.

##### Abstract (translated by Google)
我们使用对数图像处理标量乘法建立了数学形态学与探针和灰度函数之间的Asplund距离图之间的联系。我们证明该映射是函数的膨胀和侵蚀之间的比率的对数，其由结构函数构成：探针。膨胀和糜烂是从图像的格子到正函数的格子的映射。使用平坦的结构元素，Asplund距离图的表达可以通过图像的膨胀和侵蚀来简化;这些映射停留在图像的格子中。我们用一个非平坦结构函数的模式匹配来举例说明我们的方法。

##### URL
[http://arxiv.org/abs/1701.08092](http://arxiv.org/abs/1701.08092)

##### PDF
[http://arxiv.org/pdf/1701.08092](http://arxiv.org/pdf/1701.08092)


text:
# pencil_backend_assignment
A repository hosting code for Pencil's backend take home assignment

## Notes
1. The problem specifies to load data from Google Sheets into a Mongo database. It doesn't specify if I should use an API to grab the document and parse it, then load it into the database over the network or if I should parse a locally-downloaded (offline) copy. So, I'll implement it first using the local way. Once the parsing works and the database is loaded I'll implement the online (Google Sheet's API) method using some library.
1. The queried topic specifies the root of the topic subtree, each node of which has associated questions considered in the return. Thus, having a tree structure in the database will be absolutely crucial. Note that this is a k-ary tree. For each topic in the subtree we need to set of questions (a set `union` in math-speak). Though not required, for testing purposes it would be great to have this be ordered. I'll add an optional query parameter (`&ordered=<true|false>`) which take the resultant set and sort in `log(n)` time.
1. For each topic in the tree we need the array of questions associated with it.
1. We will be iterating through questions, and appending each question to the `question` array of a given topic. So, it's crucial that we index the topics.
1. Initial proposed schema for topics:

        {
            "topic": `some special topic string`, // indexed!
            questions: [1,5,8,21,58,101],
            subtopics: [`special subtopic 1`, `special subtopic 2`, ...],
        }
1. I'm starting to parse the `Topics` table. It's structure will be important for querying performance. Notably, I don't think Mongo has support for nested indices. So, a naive tree-like scheme would be a bad one for the `topics` db.

        {
        "1a": [
            {
            "1a->2a": [
                "1a->2a->3a",
                "1a->2a->3b"
            ]
            },
            {
            "1a->2b": [
                "1a->2b->3a",
                "2a->2b->3b"
            ]
            }
        ],
        "1b": [
            {
            "1b->2a": [
                "1b->2a->3a"
            ]
            },
            {
            "1b->2b": [
                "1b->2b->3a"
            ]
            }
        ]
        }

A much better structure works like a fan-out linked list, where each level is asssociated with an array of sub-levels, and so on:

    {
    {
        "1a":[
            "1a->2a",
            "1a->2b"
        ]
    },
    {
        "1b":[
            "1b->2a",
            "1b->2b"
        ]
    },
    {
        "1a->2a":[
            "1a->2a->3a",
            "1a->2a->3b"
        ]
    },
    {
        "1a->2b":[
            "1a->2b->3a",
            "2a->2b->3b"
        ]
    },
    {
        "1b->2a":[
            "1b->2a->3a"
        ]
    },
    {
        "1b->2b":[
            "1b->2b->3a"
        ]
    }
    ]

There's a slight increase in storage space because now we're repeating the topic name at least twice. One to indicate which parent/s owns/own it, and another to indicate what its children are. But, compression should take care of that. Also, we could always have a lookup table from topic-name:topic-id, where each new topic receives a new unique identifier (`incrementing integer`).

So, this is the data structure/schema we'll use for the `topics` database. Then, when someone queries for a particular question, we can easily follow the subtree to obtain all other questions. The questions will be stored in this database in a simple way. As we go through the list of all questions to build our database, we'll identify which topic that question is associated with. Then, we'll append that question number to the `questions` array of the associated topic. So, the final schema, including this, looks like:

        {
        "1a":{
            "children":[
                "1a->2a",
                "1a->2b"
            ],
            "questions":[
                1,
                10,
                24,
                52
            ]
        },
        "1b":{
            "children":[
                "1b->2a",
                "1b->2b"
            ],
            "questions":[
                5,
                20,
                72,
                96
            ]
        },
        "1a->2a":{
            "children":[
                "1a->2a->3a",
                "1a->2a->3b"
            ],
            "questions":[
                2,
                18,
                50,
                80
            ]
        },
        "1a->2b":{
            "children":[
                "1a->2b->3a",
                "2a->2b->3b"
            ],
            "questions":[
                12,
                17,
                21,
                60
            ]
        },
        "1b->2a":{
            "children":[
                "1b->2a->3a"
            ],
            "questions":[
                52,
                55
            ]
        },
        "1b->2b":{
            "children":[
                "1b->2b->3a"
            ],
            "questions":[
                13,
                19,
                22
            ]
        }
        }

So, the order of operations will be to build the `topics` database and then generate the questions array based on the "tree" in that table.

branch_name: refs/heads/main


text:
# ADB SMS Sender

## Dependencies

ADB tools(Already connected to your phone with `adb connect`)

bash environment

Nexus 6P(Only tested on my phone, you must change the tap coordinate by yourself)

## Usage

```bash
bash send.sh template.txt sample.csv
```

Please write your template to `template.txt`, and replace the name with "${MACRO1}" and "${MACRO2}".

Please write the name and phone number to `sample.csv`. Every line have three parameters: PhoneNumber MACRO1 MACRO2

Follow my sample.

## Warning

This script may cost you a large amount of money!

repository: qzwlecr/adb-sms-sender

repo_name: qzwlecr/adb-sms-sender


text:
vtkRenderWindowInteractor - handle render window
interaction including picking and frame rate control.

### Description

vtkRenderWindowInteractor provides an interaction
mechanism for mouse/key/time events. It handles routing of mouse/key/timer
messages to vtkInteractorObserver and its subclasses. vtkRenderWindowInteractor
also provides controls for picking, rendering frame rate.

vtkRenderWindowInteractor serves to hold user preferences and route messages to
vtkInteractorStyle. Callbacks are available for many events. Platform
specific subclasses should provide methods for manipulating timers,
TerminateApp, and an event loop if required via
Initialize/Start/Enable/Disable.

### Caveats
vtkRenderWindowInteractor routes events through VTK's command/observer
design pattern. That is, when vtkRenderWindowInteractor (actually, one of
its subclasses) sees an event, it translates it into
a VTK event using the InvokeEvent() method. Afterward, any vtkInteractorObservers
registered for that event are expected to respond appropriately.

gha_language: HTML


text:
# Just One Web App - SoPra Group 13

This project started as part of the SoPra course. We wanted to create a web application for the
popular board game Just One. The goal of the project is to allow people all over the world to play with each other.
additionally we wanted to create a competitive environment. To achieve that we implemented a automated scoring system
that uses NLP to check the validity of clues and a JPA database to store all scores of every player over all played
games. The scores of all players are ranked on a public leaderboard. If a group wants more players they can add bots
to the game. The bots use NLP to give either good or bad clues.

## How to setup and run this Project

For your local development environment you'll need Node.js >= 8.10. You can download it [here](https://nodejs.org). All other dependencies including React get installed with:

### `npm install`

This has to be done before starting the application for the first time (only once).

### `npm run dev`

Runs the app in the development mode.

Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.

You will also see any lint errors in the console (use Google Chrome!).

### `npm run test`

Launches the test runner in the interactive watch mode.

See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.

It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

## Getting started with React

Read and go through those Tutorials, It will make your life easier!

- Read the React [Docs](https://reactjs.org/docs/getting-started.html)
- Get an Understanding of [CSS](http://localhost:3000) and [HTML](https://www.w3schools.com/html/html_intro.asp)!
- Learn Unity [Docs](https://docs.unity3d.com/Manual/index.html)!

There are three main external dependencies that you should look at:

- [react-unity-webgl](https://www.npmjs.com/package/react-unity-webgl) It lets unity communicate through react the framework

- [styled-components](https://www.styled-components.com/docs)
  It removes the mapping between components and styles (i.e. external css files).

## Illustrations/UI Flow

As usual every user can create an account with and log in with its user name
and password. After the login to the dashboard you can create your own lobby and set it
on public or private. On the tab "Public Lobbies" you can join public lobbies, which are not
in the game yet or join a private lobby through a four ciphers password.

![All Lobies](Img/Lobbies.png)

Important: There is no feature to communicate the four ciphers of a private lobby. Either
communicate orally or by third party tool.

Setup: It needs at least 3 players to join the game. One game contains a deck with 13 cards,
therefore at most 13 topics.

![In a Lobby](Img/Lobby.png)

As lobby creator/admin you can add/kick bots and kick players. An admin can only leave a lobby,
if you are the last player in the lobby. Player and bots have different behaviour. By "Join into Game"
you enter the game "Just One". Unity can take time to load all components and waits for all players until
all players has loaded. Please be patient.

Important: Don't switch or close the tab. In that case you left the game and it is over.

When the game begins, you are either a guesser or clue giver:
Clue giver votes one topic of five and gives a clue related to the topic within 30s for
the guesser.
The guesser(/active player) waits for the clues. At this point there are three outcomes:
- guess the word; if it's correct, points will be calculated related to the amount of time
- guess the word; if it's wrong, then there will be no points and the current card and also
 an additional card will be discarded
- skip this round; there will be no points and only this current topic will be discarded

![Dashboard with Leaderboard](Img/Dashboard.png)

The application contains some features:
- ranking system; visualized by the picture and rank name, depending on the current score
- leaderboard
- editing profile (avatar choice, username)
- a short game description
- chat feature in the lobby

## Road Map
Possible features to enhance UX:
- add chat to the game
- additional language settings
- rejoin session after disconnect
- guest mode for spectactors

## Contributing
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

#### Pull Request Process
1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
2. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](https://semver.org/).
4.You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
Code of Conduct
#### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

#### Our Standards
Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
#### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

#### Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

#### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at<EMAIL_ADDRESS>All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

#### Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/

## Authors
Simon Padua (IsaacTheII)

Chris Aeberhard (niddhog)

Thanh Huynh (Tharoxes)

Ivan Allinckx   (iallin)

Marc Kramer (Makram95)

## Acknowledgement

Art for Dashboard

Published: Literal Lemon (https://steamcommunity.com/id/LiteralLemon)
![night city wallpaper 4k](https://steamuserimages-a.akamaihd.net/ugc/959733232046545325/316D147A964EFF85A1170A889052D46F7D92945E/)

Pixel Art for Unity Game

Artist: Colletior (https://steamcommunity.com/id/colletior)
![loading screen](https://steamuserimages-a.akamaihd.net/ugc/1020572650861906095/163EE0850ABF95553316D39354C28C13B2514A33/)

Artist: Akito One (https://steamcommunity.com/id/akito_one)
![Background](https://steamuserimages-a.akamaihd.net/ugc/2438013375536940927/D370DBF7BFC83ED36F783F08A598FFF3E71A1D61/)

## License
Copyright (c) [2020] [Sopra Group13]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

>Thanks to Lucas Pelloni and PurpleBooth for the templates

gha_language: C#


text:
---
hrs_structure:
  division: '5'
  volume: '14'
  title: '37'
  chapter: '708'
  section: 708-817
type: hrs_section
tags:
  - Crime
  - Criminal Proceeding
menu:
  hrs:
    identifier: HRS_0708-0817
    parent: HRS0708
    name: 708-817 Burglary of a dwelling during an emergency period
weight: 22085
title: Burglary of a dwelling during an emergency period
full_title: 708-817 Burglary of a dwelling during an emergency period
---
**§708-817** **Burglary of a dwelling during an emergency period.** (1) A person commits the offense of burglary of a dwelling if, during an emergency period proclaimed by the governor or mayor pursuant to chapter 127A and within the area covered by the emergency period, the person:

(a) Intentionally enters or remains unlawfully in a dwelling with intent to commit therein a crime against a person or against property rights; and

(b) Recklessly disregards a risk that the building is the dwelling of another, and the building is such a dwelling at the time.

(2) Burglary of a dwelling during an emergency period is a class A felony. [L 2006, c 116, pt of §3, am L 2014, c 111, §17]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# SerialCommands
An Arduino library to tokenize and parse commands received over a serial port.

Inspired by (original version):
https://github.com/scogswell/ArduinoSerialCommand

Forked from https://github.com/ppedro74/Arduino-SerialCommands
as it may have been abandoned (no new commits and pull requests have been
pending for many months)

This library is for handling text commands over a serial port.

Goals:
* Small footprint
* No dynamic memory allocation
* Stream class's Serial Ports
* Multiple Serial Ports callback methods
* Custom Command termination default is `CR & LF`
* Custom Arguments Delimeter default is `SPACE`
* Optional _OneKey_ commands that are single characters without the need for
    additional command termination

## SerialCommand object

SerialCommand creates a binding between a const string token with a callback function.

Note:
SerialCommand is used in a Linked List. Do not share SerialCommand objects between SerialCommands.

```c++
#include <SerialCommands.h>

void cmd_hello(SerialCommands* sender)
{
	//Do not use Serial.Print!
	//Use sender->GetSerial this allows sharing the callback method with multiple Serial Ports
	sender->GetSerial()->println("HELLO from arduino!");
}

SerialCommand cmd_hello_("hello", cmd_hello);
```

### OneKey commands

When sending commands from a keyboard, it is often useful to be able to use
single keypresses to perform a specific action, like adjusting a motor speed up
or down, for example.

To make any command a _OneKey_ command, instantiate the command with a **single
character** command string, and add `true` as a third argument:

```c++
SerialCommand cmd_faster("+", cmd_faster, true);
SerialCommand cmd_slower("-", cmd_slower, true);
```

The `cmd_faster` and `cmd_slower` command functions has the same signature as
for multiple character commands, except that arguments are not allowed for
_OneKey_ commands (they don't make sense), so calling `sender->Next()` is not
supported.

_OneKey_ commands are only active when they come in as the _first_ character,
either on startup, or after processing a previous command. In other words, if
another command string contains a `+` like `set+go` for example, the command
callback for the one key `+` command will not be called when `set+go` is
entered, and the `set+go` command callback will be called as expected.

Any multi character command that _starts_ with the same character as a one key
command, will however never be activated as the one key command will always
consume the single character command first, i.e:

Multi char command: `up`
OneKey command: `u`

The `up` command will never be executed since the `u` will be consumed by the
one key command first, which leaves the `p` as the remainder for the command
which will not match (unless of course there *is* in fact a `p` one key or multi char
command).

## SerialCommands object

SerialCommands is the main object creates a binding between a Serial Port and a list of SerialCommand

```c++
#include <SerialCommands.h>

//Create a 32 bytes static buffer to be used exclusive by SerialCommands object.
//The size should accomodate command token, arguments, termination sequence and string delimeter \0 char.
char serial_command_buffer_[32];

//Creates SerialCommands object attached to Serial
//working buffer = serial_command_buffer_
//command delimeter: Cr & Lf
//argument delimeter: SPACE
SerialCommands serial_commands_(&Serial, serial_command_buffer_, sizeof(serial_command_buffer_), "\r\n", " ");
```

### Arduino setup

```c++
void setup()
{
	Serial.begin(57600);
	serial_commands_.AddCommand(&cmd_hello);
}
```
### Default handler

```c++
void cmd_unrecognized(SerialCommands* sender, const char* cmd)
{
	sender->GetSerial()->print("ERROR: Unrecognized command [");
	sender->GetSerial()->print(cmd);
	sender->GetSerial()->println("]");
}
void setup()
{
	serial_commands_.SetDefaultHandler(&cmd_unrecognized);
}
```
### Arduino loop

```c++
void loop()
{
	serial_commands_.ReadSerial();
}
```

### Multiple Serial Ports
```c++
#include <SerialCommands.h>

char serial_commands_0_buffer_[32];
SerialCommands serial_commands_0_(&Serial, serial_commands_0_buffer_, sizeof(serial_commands_0_buffer_));

char serial_commands_1_buffer_[32];
SerialCommands serial_commands_1_(&Serial1, serial_commands_1_buffer_, sizeof(serial_commands_1_buffer_));

void cmd_hello(SerialCommands* sender)
{
	sender->GetSerial()->println("HELLO from arduino!");
}

void cmd_unrecognized(SerialCommands* sender, const char* cmd)
{
	sender->GetSerial()->print("ERROR: Unrecognized command [");
	sender->GetSerial()->print(cmd);
	sender->GetSerial()->println("]");
}

SerialCommand cmd_hello_0_("hello", cmd_hello);
SerialCommand cmd_hello_1_("hello", cmd_hello);

void setup()
{
    Serial.begin(57600);
	serial_commands_0_.AddCommand(&cmd_hello_0_);
	serial_commands_0_.SetDefaultHandler(&cmd_hello);

    Serial1.begin(57600);
	serial_commands_1_.AddCommand(&cmd_hello_1_);
	serial_commands_1_.SetDefaultHandler(&cmd_hello);
}

void loop()
{
	serial_commands_0_.ReadSerial();
	serial_commands_1_.ReadSerial();
}
```

repository: jrouvier/Arduino-SerialCommands

repo_name: jrouvier/Arduino-SerialCommands


text:
# svg

**New Version at [vscode-svg2](https://github.com/lishu/vscode-svg2)**

A Powerful SVG Language Support Extension.
Almost all the features you need to handle SVG.

## Features

### SVG Elements Auto Completion.

![feature 1](images/f1.png)

### SVG Attributes Auto Completion.

![feature 2](images/f2.png)

### Document Symbol with SVG Element [id].

![feature 3](images/f3.png)

### SVG Preview

![feature 4](images/f4.png)

> Tip: All Completion list is context, will not show all items.

### Rename Tag Name or Id Reference.

Cursor in Tag Name or Id Attribute or url(#id) Hit F2(Windows) Key, Rename it!

### In Id Reference Click Goto id="" element.

Hot Ctrl Key and Move mouse to a url(#id), That it!

### SVG Format Support
Formatting support using SVGO, which can prettify SVGs and sort tag attributes.
SVGO works as a group of plugins that can be activated or desactivated (which is default for most in this extension).
Information on the plugins can be found [here](https://www.npmjs.com/package/svgo).

### Minify SVG with SVGO

Open the **Command Palette** (`⇧⌘P` on Mac and `Ctrl+Shift+P` on Win/Linux) and run `Minify SVG`. This will reduce the filesize significantly by removing all unnecessary code from the image.

## Contributors

* [Laurent Tréguier](https://github.com/LaurentTreguier) for sharing SVG formatting features
* [Björn Ganslandt](https://github.com/Ansimorph) for sharing Minify SVG features
* [Amelia Bellamy-Royds](https://github.com/AmeliaBR) for Add the xmlns and xmlns:xlink attributes
* [Evan Demaris](https://github.com/evandemaris)
* [Trevor Burnham](https://github.com/TrevorBurnham)
* [Philipp Kief](https://github.com/PKief)

## Known Issues

SVG Version 2.0 is not included.

## Update History

### 0.1.6
* A small amount of BUG fixes.

### 0.1.5
* Pretty SVG now set indent use editor tabSize setting.
* Update all package for Security.

### 0.1.4
* FIX Preview Zoom Reset.

### 0.1.3
* Add Zoom to Preview.
* Add Background Switch to Preview.

### 0.1.2
* Add 'xlink:href' attribute.

### 0.1.1
* Fix The contents of the document are emptied when the format fails.

### 0.1.0
* Add `Pretty SVG` command.
* Add Experimental Setting `svg.disableFormatOnSave`.

### 0.0.9
* Add `Minify SVG` command.

### 0.0.8
* Change Format SVGO Options.

### 0.0.7
* Fix some debug time warning.
* Change Preview use 'Transparent' background.

### 0.0.6
* Add Formatting support using SVGO.

### 0.0.5
* Add url(#id) Definition Provider.

### 0.0.4
* Add New Rename Provider.

### 0.0.3
* New Hover Info Support.
* Improve Completion list in paint show color keywords.
* Improve Completion list work like snipple (For base sharp). Required vscode >=1.8 .
* The `svg.completion.showDeprecated` Configuration item is actived, will not show deprecated item in completion list by default(`false`).

### 0.0.2

* Improve Preview.
* Improve Id Symbol show `[tag]#[id]` and fix a bug.

### 0.0.1

* Initial release.

-----------------------------------------------------------------------------------------------------------
## For more information

* [MDN SVG Reference](https://developer.mozilla.org/en-US/docs/Web/SVG)

**Enjoy!**

## Donations
Welcome [Support this project](Donations.md).


text:
# lab-02-repository
# Time Estimate

| First Task  |     Display images           |
|---------|----------------------------------|
|Start time | 2:00 pm |
| End Time | 4:00 pm |
|Estimated Time | 2 hours |
| Actual Time | 4:00 hours |

| Second Task  |     Style the application         |
|---------|----------------------------------|
|Start time | 5:00 pm |
| End Time | 6:00 pm |
|Estimated Time | 2 hours |
| Actual Time | 1 hours |

| Third Task  |     Filter images          |
|---------|----------------------------------|
|Start time | 6:00 pm |
| End Time | 9:00 pm |
|Estimated Time | 2 hours |
| Actual Time | 3 hours and we are not finished |

>we worked on filtering image from 2:00 pm to 4:00 pm

# lab-03-repository
# Time Estimate

| First Task  |    Pagination         |
|---------|----------------------------------|
|Start time | 4:30 pm |
| End Time | 7:00 pm |
|Estimated Time | 2 hours |
| Actual Time | 2:30 hours |

| Second Task  |     Templating         |
|---------|----------------------------------|
|Start time | 7:00 pm |
| End Time | 7:30 pm |
|Estimated Time | 1 hours |
| Actual Time | 1 hours |

| Third Task  |     Styling with Flexbox        |
|---------|----------------------------------|
|Start time | 7:30 pm |
| End Time | 9:00 pm |
|Estimated Time | 2 hours |
| Actual Time | 1:30 hours and we are not finished |

| Forth Task  |    Sort the images    |
|---------|----------------------------------|
|Start time | 9:00 pm |
| End Time | 10:00 pm |
|Estimated Time | 2 hours |
| Actual Time | 1 hours and we are not finished |

gha_language: JavaScript


text:
+++
title = "Scrollytelling"
# publish date
date = 2020-01-23T11:50:11-05:00
# whether or not the post is a draft
draft = true
#  Short description of the document (limit to 150 characters)
# This content *may* be used as a part of search engine results.
description = ''
+++

- idea
  - tell a story using data in a Scrollytelling format
- resources
  - [mike bostock how to scroll](https://bost.ocks.org/mike/scroll/)
  - [jim vallandingham so you want to build a scroller](https://vallandingham.me/scroller.html)
  - [jim vallandingham examples](http://vallandingham.me/scroll_talk/examples/)
  - [jim vallandingham talk](https://vallandingham.me/think_you_can_scroll.html)
  - [Adam Pearce Site](https://roadtolarissa.com/)
  - [Graph Scroll js](https://1wheel.github.io/graph-scroll/)

repository: lukesmurray/victor-hugo

repo_name: lukesmurray/victor-hugo


text:
## A prototype for distributed training with PyTorch.

### Note
This repo will not be maintained.

### Features

With this framework, you get:

* High extensibility: customize your algorithm for any purpose.
* High-efficiency distributed training, validation, evaluation, feature extraction.

### Requirements

* PyTorch >= 0.4.1
* Others:

    ```sh
    pip install -r requirements.txt
    ```

### Usage

* For example, train Cifar-10 with resnet20 in 14 minutes, get 92.59% accuracy.

    ```sh
    cd dist-framework
    mkdir data
    cd data
    wget https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz
    tar -xf cifar-10-python.tar.gz
    cd ..
    sh experiments/classification/Cifar/resnet20/train.sh # train, don't forget to open tensorboard for visualization
    sh experiments/classification/Cifar/resnet20/resume.sh $ITER # resume from iteration $ITER
    sh experiments/classification/Cifar/resnet20/validate.sh $ITER # offline validation
    sh experiments/classification/Cifar/resnet20/evaluate.sh $ITER # offline evaluation
    sh experiments/classification/Cifar/resnet20/extract.sh $ITER # feature extraction
    ```

### Extensibility

* You need to write your own Dataset in `dataset.py` and your algorithm under `models` (refer to `models/classification.py`), and design your config file. That't it!

### Note

* Please use `sh scripts/kill.sh` to kill.

repository: XiaohangZhan/dist-framework

repo_name: XiaohangZhan/dist-framework


text:
# TODO

- [ ] Fix run away tracking of feeds
    This is a sort of 'memory leaks' such that when ephemeral nodes join they
create a feed even if they don't append / emit any events. This is not as
concerning as it is expected with the naive implementation we've done so far.
These feeds could emit just one event and then would 'need' to be stored to
maintain the multifeed entries they contributed. The problem is that these nodes
could use in memory storage and hence have a new public key for their feed each
time they spin up. If this happens 1000+ times, it can use a ton of memory on
a single node. I've done a test that resulted in `this.core.feeds().length ===
999` with each being ~4Mb of memory. And that was one node.

license: ISC

repository: lejeunerenard/kappa-core-event-bus

repo_name: lejeunerenard/kappa-core-event-bus


text:
# Query Builder Dump

![Screenshot of code](https://pbs.twimg.com/media/DPZ96-zXUAEbs3L.jpg:large)

``` php
array:3 [
  "bindings" => array:6 [
    "select" => []
    "join" => []
    "where" => array:1 [
      0 => Illuminate\Support\Carbon {#736
        +"date": "2017-11-24 15:10:26.000000"
        +"timezone_type": 3
        +"timezone": "UTC"
      }
    ]
    "having" => []
    "order" => []
    "union" => []
  ]
  "sql" => "select * from `prizes` where `comment_id` is null and `release_at` < ? order by `release_at` asc"
  "raw" => "select * from `prizes` where `comment_id` is null and `release_at` < '2017-11-24 15:10:26' order by `release_at` asc"
]
```

[![Latest Version on Packagist](https://img.shields.io/packagist/v/morrislaptop/laravel-query-builder-dump.svg?style=flat-square)](https://packagist.org/packages/morrislaptop/laravel-query-builder-dump)
[![Build Status](https://img.shields.io/travis/morrislaptop/laravel-query-builder-dump/master.svg?style=flat-square)](https://travis-ci.org/morrislaptop/laravel-query-builder-dump)
[![Quality Score](https://img.shields.io/scrutinizer/g/morrislaptop/laravel-query-builder-dump.svg?style=flat-square)](https://scrutinizer-ci.com/g/morrislaptop/laravel-query-builder-dump)
[![Total Downloads](https://img.shields.io/packagist/dt/morrislaptop/laravel-query-builder-dump.svg?style=flat-square)](https://packagist.org/packages/morrislaptop/laravel-query-builder-dump)

This repository contains a dump method for the query builder, allowing you to dump your query inline. Similar to `$collection->dump();`

## Installation

You can pull in the package via composer:

``` bash
composer require morrislaptop/laravel-query-builder-dump --dev
```

The package will automatically register itself.

## Usage

Simply call dump anywhere when constructing your query.

```php
$users = DB::table('users')
           ->select('name', 'email as user_email')
           ->join('contacts', 'users.id', '=', 'contacts.user_id')
           ->union($first)
           ->dump()
           ->where('something', 'true')
           ->orWhere('name', 'John')
           ->orderBy('name', 'desc')
           ->groupBy('account_id')
           ->dump()
           ->offset(10)
           ->limit(5)
           ->having('account_id', '>', 100)
           ->get();
```

## Testing

``` bash
$ composer test
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

If you discover any security related issues, please email<EMAIL_ADDRESS>instead of using the issue tracker.

## Credits

- [Freek Van der Herten](https://github.com/freekmurze)
- [Sebastian De Deyne](https://github.com/sebastiandedeyne)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: daanbonke/laravel-query-builder-dump

repo_name: daanbonke/laravel-query-builder-dump


text:
Employee Database Tool

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

  ## Description
   This program is used to make querys to a database named workforce_db to view all employees, add employees, view roles, view job titles and also create and update roles, titles and employee responsibilites. It is a command line interface that runs with nodejs

   ## Table of Contents
   - [Description](#description)
   - [Installation](#installation)
   - [Usage](#usage)
   - [License](#license)
   - [Contributing](#contributing)
   - [Tests](#tests)
   - [Questions](#questions)

   ## Installation
   run "nmp i" in terminal to install all required packages then run "node program.js to run"

   ## Usage
   To showcase MYSQL, Inquirer and database managment.

   https://user-images.githubusercontent.com/87740245/139321325-864f53f6-ca08-40ef-bf06-92966f7183bb.mp4

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

   This application is covered by  the MIT license.

   ## Contributors
   Zachary Moore

   ## Tests
   Did not create any tests, ran through all functions. In the future would like to add validation to user input fields.

   ## Questions
   Questions or concerns? Feel free to reach out to me:

   Link to Github: [zmoore371](https://github.com/zmoore371)

   Email me with any questions<EMAIL_ADDRESS>/>


text:
Shopping list
=============

The total budget should be under $100, probably closer to $50 if you buy from
AliExpress.

Test gear (some is required)
----------------------------

You'll need either a multimeter or an oscilloscope depending on your budget.
Multimeters start at about [$5 on
AliExpress](https://www.aliexpress.com/item/New-arrive-Backlight-Digital-LCD-Multimeter-Voltmeter-Ammeter-AC-DC-OHM-Volt-Tester-Test-Current/32652332147.html).
Those are admittedly dodgy, but the dodginess is mostly around high-voltage
protection and this is a low-voltage project. Just put a label on it that says
"don't use this on mains voltage". (Note: I haven't used this specific meter,
but if I were looking for one I'd give it a try.)

Oscilloscopes give you a lot more debugging detail. [Dave Jones
says](https://www.youtube.com/watch?v=rTPhuRQBmLQ) you can get one for about $50
on ebay; in my experience you should plan to spend closer to $100. Used analog
scopes are great: accurate and robust. I'd stay away from the micro
digital-scope kits because they might miss voltage spikes or be unable to handle
the ~60V output.

Power unit supplies
-------------------

- 1x [USB power
  meter](https://www.aliexpress.com/item/USB-Digital-Power-Meter-Tester-battery-capacity-tester-Current-Voltage-Monitor-DC-5A-9V-Voltage-Power/32888681113.html):
  $2. Always use this and keep an eye on the current. Idle should be around 0.02
  amps.

- 2x [Arduino
  Uno](https://www.aliexpress.com/item/high-quality-One-set-UNO-R3-CH340G-MEGA328P-for-Arduino-UNO-R3-USB-CABLE-ATMEGA328P-AU/32810623079.html):
  $3 each. You technically only need one, but I recommend having a spare. It's
  easy to nuke one if you hook it up wrong.

- 1x [Arduino prototyping
  shield](https://www.aliexpress.com/item/MEGA-Proto-Prototype-Shield-V3-0-170pts-Breadboard-for-arduino-mega/32493176287.html),
  the Uno size: $2.

- 1x or 2x [L298N driver
  chip](https://www.aliexpress.com/item/2PCS-L298N-ZIP15-L298-ZIP-new-and-original-IC-In-Stock/32876742145.html):
  $1 each. One of these chips will handle two output channels.

- 1x [boost converter
  module](https://www.aliexpress.com/item/1PCS-XL6009-Boost-Converter-Step-Up-Adjustable-15W-5-32V-to-5-50V-DC-DC-Power/32807346491.html):
  $1.

- 1x [volume
  knob](https://www.aliexpress.com/item/5pcs-WH148-B1K-B2K-B5K-B10K-B20K-B50K-B100K-B500K-3Pin-15mm-Shaft-Amplifier-Dual-Stereo/32846573934.html):
  $1 for five; I use 10K but any value offered will probably work.

- [Hookup wire](https://www.amazon.com/dp/B00KAE3NTQ/) if you don't already have
  some. Nothing special, it just needs to be solid core and small enough to fit
  into breadboard holes. About 20AWG is fine.

- [Assorted
  resistors](https://www.aliexpress.com/item/600PCS-Component-Kit-1-1-4W-Resistor-Pack-Used-Colored-Ring-Resistance-10-ohms-1M-ohm/32475181535.html):
  $2.50 for more resistors than you will ever use in your lifetime.

- [Assorted 50V ceramic
  capacitors](https://www.aliexpress.com/item/20PF-105-1UF-50V-18ValuesX10pcs-180pcs-Mono-Monolithic-Capacitors-Monolithic-Ceramic-Capacitor-Assortment-Kit/32304343347.html):
  $1.50, also for more than you'll ever use. The important things are that the
  capacitors are (1) *not* electrolytic, and (2) rated above the boost converter
  voltage. 50V ceramic capacitors will do it.

- [Assorted
  transistors](https://www.aliexpress.com/item/BC337-BC327-2N2222-2N2907-2N3904-2N3906-S8050-S8550-A1015-C1815-Transistor-Assortment-Kit-10value-200PCS-Transistors/32787376478.html):
  $3. You really just need a 2N3904 or similar NPN transistor, but it's good to
  have extras in case you destroy one.

Electrode supplies
------------------

- [Alligator
  clips](https://www.aliexpress.com/item/Brand-New-10pcs-Alligator-Clips-Electrical-DIY-Test-Leads-Alligator-Double-ended-Crocodile-Clips-Roach-Clip/32813105214.html):
  $1.50 for more than you'll need.

- [24AWG bare copper
  wire](https://www.amazon.com/Bare-Copper-Bright-Diameter-Length/dp/B000IJU1ZW):
  $20 for years' worth. The wire gauge is a matter of preference; I use 22AWG,
  which is about right in terms of flexibility. I found 18AWG too stiff.

repository: RempeBC/estim-arduino

repo_name: RempeBC/estim-arduino


text:
# JourneyMonitor

## About the service

At http://journeymonitor.com, the project provides a software-as-a-service that allows users to upload Selenium
test scripts which are executed regularly and alert users if a test run resulted in an error. It also provides
ridiculously detailed performance metrics for each test run.

Think of it as a cloud-based cron for you Selenium tests.

## About the project

The full source code that powers the JourneyMonitor service is publicly available on GitHub. We would love to see
others joining the development effort.

### Nomenclature

The architecture of the JourneyMonitor service is modularized on different levels.

On the highest level, there are currently four modules, which are called *Systems*:

- **[INFRA](https://github.com/journeymonitor/infra)** provides the Puppet and Docker Compose code that is used to set
  up development and production environments for the applications of the other systems
- **[CONTROL](https://github.com/journeymonitor/control)** contains a Symfony2 application and Scala applications
  which together power the web frontend at http://journeymonitor.com
- **[MONITOR](https://github.com/journeymonitor/monitor)** contains a plain PHP application with Bash script additions
  that does the actual heavy-lifting of running the testcases against a Firefox/Selenium setup and collecting the
  results
- **[ANALYZE](https://github.com/journeymonitor/anaylze)** contains, among others, a Scala/Spark application which
  extracts interesting metrics from the testcase runs

All four systems form the fully featured JourneyMonitor service. The independence of the systems is *high*:
They do not share code, and they do not share data. Each system has a technological stack that best fits its
needs. The code for each system lives in its own repository. With this approach, JourneyMonitor follows the idea
of *Self-contained Systems*, as described at [scs-architecture.org](http://scs-architecture.org).

Systems can be further modularized. At this level, modules are called *Applications*. For example, the *ANALYZE*
system currently contains two applications: *importer* takes care of consuming and persisting testresults from the
*MONITOR* system, and the *spark* application then operates on this data in order to calculate statistics.

As systems don't share data, they need to exchange data. This happens via RESTful interfaces on top of HTTP. In
this sense, applications can provide *RESTful APIs*, but this is not part of the modularization.

Of course, applications are modularized, too. This, however, is implementation-specific (packages, classes, etc.).

Thus, the following modularization hierarchy is practiced:

                                The complete service
                                       |
                                       |
                                       | consists of multiple Systems
                                       |
                                       |
                        |--------------|--------------|
                    a System       a System       a System
                        |
                        |
                        | consists of one or more Applications
                        |
                        |
        |---------------|---------------|
      an Application  an Application  an Application

### The Big Pictures

#### Systems diagram with data flow

                                       User
                                        +
                                        | interacts
                                        | with
                                        | Control
                                  +-----v-----+
              +-------------------+           |
              |                   |  CONTROL  <--------------+
              |    +-------------->           |              |reads
              |    | reads        +-----------+              |statistics
        reads |    | testresults  - manages                  |from
    testcases |    | from           testcases                |Analyze
         from |    | Monitor      - views                    |
      Control |    |                testresults              |
             +v----+-----+        * Symfony2           +-----+-----+
             |           |        * sqlite3            |           |
             |  MONITOR  |                             |  ANALYZE  |
             |           +----------------------------->           |
             +-----------+              reads          +-----------+
             - executes                 testresults    - generates
               testcases                from             statistics
             - collects                 Monitor          from
               testresults                               testresults
             * Plain PHP                               * Spark
             * sqlite3                                 * Scala
             * selenese-runner                         * Cassandra
             * browsermob-proxy
                                      +-----------+
                                      |           |
                                      |   INFRA   |
                                      |           |
                                      +-----------+
                                      - manages
                                        setup and
                                        configuration
                                        of systems
                                      * Puppet
                                      * Docker Compose

repository: journeymonitor/infra

repo_name: journeymonitor/infra


text:
_All credit for developing this test suite goes to @bitcoinhodler_
# Testing Proof Wallet

This directory contains tests for the developers of Proof Wallet to
ensure high quality and backward compatibility.

# Running Tests

## Running all tests
```
$ make
```

## Running one test
```
$ make t/create-wallet.test
```
Note there is no actual file by that name.

## Measuring code coverage
```
$ make COVERAGE=1; firefox coverage-report/index.html
```

# Writing Tests

1. Create a `t/foo.run` bash script; make sure it is `chmod +x`.

2. Create a matching `t/foo.golden` file; `touch t/foo.golden` is
   sufficient to start

3. Run the test using `make t/foo.test`; it will fail since it doesn't
   match golden

4. Manually check `t/foo.out` to ensure desired output

5. `mv t/foo.{out,golden}`

6. Ensure test passes now

7. Commit!

# Test Catalog

## Tests for `create-wallet`

| Filename | Coverage goal |
| -------- | ------------- |
| `create-wallet.run` | Basic flow |
| `create-wallet.input-checks.run` | Input validation |

## Tests for importing BIP39 mnemonic
| Test case                 | Coverage goal |
| --------------------------|  ------------- |
| `mnemonic-length-24-happy.run`        | Import 24 word mnemonic successfully |
| `mnemonic-length-12-happy.run`        | Import 12 word mnemonic successfully |
| `mnemonic-unsupported-length.run`        | Fail when mnemonic isn't 12 or 24 words long |
| `mnemonic-invalid.run`        | Fail when mnemonic is invalid |

## Tests for importing descriptor keys
| Test case                 | Coverage goal |
| --------------------------|  ------------- |
| `descriptor-valid.run`        | Import various valid output descriptors successfully |
| `descriptor-invalid-fingerprint-length.run`        | Fail when fingerprint is incorrect length |
| `descriptor-invalid-fingerprint-chars.run`        | Fail when fingerprint contains non-hex characters |
| `descriptor-missing-fingerprint.run`        | Fail when no fingerprint is present |
| `descriptor-no-xpub.run`        | Fail when no xpub is present |
| `descriptor-path-invalid-char.run`        | Fail when the path contains invalid characters |
| `descriptor-path-leading-zeros.run`        | Fail when any path index contains leading zeros |
| `descriptor-xpub-invalid.run`        | Fail when xpub is invalid |
| `descriptor-duplicate-fingerprints.run`        | Fail when importing the same fingerprint more than once |
| `descriptor-duplicate-xpubs.run`        | Fail when importing the same xpub more than once |

## Tests for deposits (`view-addresses`)
| Test case                 | Coverage goal |
| --------------------------|  ------------- |
| `view-addresses.run`        | Basic flow; use all available commands to explore addresses |
| `view-addresses.trust-xpubs.run`        | Basic flow for viewing addresses with only the xpubs |
| `view-addresses.no-matching-xpub.run`        | Fail when no xpub matches the mnemonic's xpub |

## Tests for withdrawls (`sign-psbt`)

| Test case                 | Coverage goal |
| --------------------------| ------------- |
| `sign-psbt.run`        | Basic flow; sign a psbt with 1 change address |
| `sign-psbt.private-file.run`        | Sign a psbt but load the mnemonic from a text file |
| `sign-psbt.no-matching-xpub.run`        | Fail when no xpub matches the mnemonic's xpub |
| `sign-psbt.invalid-psbt.run`        | Fail when psbt is invalid |
| `sign-psbt.input-non-witness-utxo-missing.run`        | Fail when `PSBT_IN_NON_WITNESS_UTXO` is missing  |
| `sign-psbt.input-witness-utxo-missing.run`        | Fail when `PSBT_IN_NON_WITNESS_UTXO` is missing  |
| `sign-psbt.input-bip32-metadata-missing.run`        | Fail when `PSBT_IN_BIP32_DERIVATION` is missing |
| `sign-psbt.input-bip32-metadata-wrong.run`        | Fail when `PSBT_IN_BIP32_DERIVATION` fingerprints don't match ours |
| `sign-psbt.input-bip32-metadata-extra.run`        | Fail when `PSBT_IN_BIP32_DERIVATION` contains an extra fingerprint |
| `sign-psbt.input-scriptPubKey-type-wrong.run`        | Fail when an input's scriptPubKey type isn't correct |
| `sign-psbt.input-witness-script-missing.run`        | Fail when `PSBT_IN_WITNESS_SCRIPT` is missing |
| `sign-psbt.input-witness-script-hash-no-match.run`        | Fail when the SHA256 of `PSBT_IN_WITNESS_SCRIPT` doesn't match the `PSBT_IN_WITNESS_UTXO` scriptPubKey |
| `sign-psbt.input-bip32-paths-dont-match.run`        | Fail when at least 1 `PSBT_IN_BIP32_DERIVATION` path (hardened) doesn't match ours |
| `sign-psbt.input-different-unhardened-paths.run`        | Fail when at least 1 `PSBT_IN_BIP32_DERIVATION` path (unhardened) doesn't match ours |
| `sign-psbt.input-unsupported-bip32-path.run`        | Fail when an input's bip32 path (unhardened part) is not supported |
| `sign-psbt.input-unexpected-derived-address.run`        | Fail when the input address derived from the bip32 paths doesn't match the witness_utxo's scriptPubKey |
| `sign-psbt.input-unsupported-sighash.run`        | Fail when an input specifies a sighash type that is not 'ALL' |
| `sign-psbt.output-different-bip32-paths.run`        | Fail when there are multiple bip32 derivation paths for one change output |
| `sign-psbt.output-unsupported-bip32-path.run`        | Fail when a change output's bip32 path is not supported |
| `sign-psbt.output-bip32-metadata-wrong.run`        | Fail when `PSBT_OUT_BIP32_DERIVATION` fingerprints don't match ours |
| `sign-psbt.output-bip32-paths-dont-match.run`        | Fail when at least 1 `PSBT_OUT_BIP32_DERIVATION` path (hardened) doesn't match ours |
| `sign-psbt.output-unexpected-derived-address.run`        | Fail when a change output address derived from the bip32 paths doesn't match the Tx's scriptPubKey |
| `sign-psbt.output-witness-script-missing.run`        | Fail when `PSBT_OUT_WITNESS_SCRIPT` is missing |
| `sign-psbt.output-witness-script-hash-no-match.run`        | Fail when the hash of a change output's witness script doesn't match the Tx output's scriptPubKey |
| `sign-psbt.no-change-outputs.run`        | Display a warning when there are no identifiable change outputs in the psbt |

## Tests for other miscellaneous

| Filename | Coverage goal |
| -------- | ------------- |
| `entropy.run` | Entropy subcommand |
| `safety-check-fails.run` | Failed safety checks |
| `m-too-large.run` | Fail when m is greater than n |
| `m-too-small.run` | Fail when m is less than 1 |
| `n-too-large.run` | Fail when n is greater than 15 |
| `n-too-small.run` | Fail when n is less than 2 |

repository: wielandgmeiner/proof-wallet

repo_name: wielandgmeiner/proof-wallet


text:
# QQ-S Maintenance

Maintaining your printer is mission critical if you want to keep your printer in peak shape, be it print quality, noise level, ...
It's easy to do this, just a couple of minutes every few weeks.

## Lubrication

Applying proper lubrication to metallic contact surfaces is always beneficial to the parts health. Be sure to apply grease to the tower rods, and the fisheye bearings regurarly.
You can use:
  * White lithium grease (much like what's included)
    * Easy to apply
    * Creates dark gray/black gunk because of the graphite impregrantion of the bushings in the carriages
  * General purpose mineral oil
    * Easy to spread, but requires more frequent application

::: tip
While applying lubrication, cover the bed paper towels to prevent unnecessary bed cleaning.
:::

::: tip
While the lubrication will work itself in between the parts, moving around the effector by hand will help you to determine if enough lubrication was applied. (You should feel it move more freely after a couple of moves)
:::

## Hotend

Hotend maintenance is probably the easiest (or atleast accessible) thing to do.  You
You only need to look out for a couple of things:
 * If you're using "standard" brass nozzles and abrasive filament (glow in the dark PLA, wood PLA, ...), the nozzle will wear out, change it frequently of switch to another nozzle material
 * Cleaning the nozzle regurarly will help in attaining the proper squish as already laid down filament will less likely stick to the nozzle.
 You can do this with a fine, metallic brush.

### Changing the nozzle

Prusa 3D has got a nice video on how to do this: [https://www.youtube.com/watch?v=txt6sxV6X88](https://www.youtube.com/watch?v=txt6sxV6X88)
Don't get bothered about the printer being different, the general hotend assembly is the same.

::: tip
It's always a good idea to tighten the nozzle first, then unscrew it a full turn, push down the PTFE tube and tighten it again.
This way, you'll have the PTFE tube snug against the nozzle and will prevent leaking.
:::

## Bed

Keeping the bed clean of dust and grease is the keystone of having your prints stay in one place.
You can use:
 * Isopropyl Alcohol a.k.a. rubbing alcohol to clean the glass after every print
 * For nasty things, use dishwashing liquid

## Belts

### How to tighten?

They are tightened by turning the thumb nuts at the top of the printer.

### How much to tighten?

They should be tight enough that there is some tension to keep the two sides of
the belt from touching each other in the middle with light finger pressure.
They should NOT be tight as guitar strings! This causes belt damage!
You can also checkout the relevant [Calbiraton section](/guide/calibration.md#proper-belt-tensioning)

### How to tighten if the nuts are already bottomed out?

In this case:
 1. check your belts for damage,
 2. If not damaged, you'll need to shorten the belts by a couple of teeth.

For relevant steps, see the [replacement method](/guide/#how-to-replace-the-belts).

### What are the belts? How long are they?

They are 6mm GT2 belts, and each is approximately 148 cm for the QQ-S (Pro).

:::tip
Don't use steel core belts as they will damage the idlers/drive gear as they are made from aluminium.
:::

### How to replace the belts?

First, loosen the nuts at the top. Then remove the metal side covers.
On the carriage, remove the 4 screws on the back to remove the back cover plate.
The ends of the belt can then slide out from the holder.
Motor mounts can bend: (older models had aluminum brackets instead of steel)

- The motor mounts can bend if the belts were over tightened.
- This can cause damage to the motor pulleys, belts, as well as printing problems.
- If they are bent, you can straighten them out using brute force.
- You should consider adding motor blocks to prevent the mounts from tilting.
  See <https://www.tinkercad.com/things/6hsckUHrPAz>


text:
# Apartment::Activejob

ActiveJob support for Apartment

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'apartment-activejob'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install apartment-activejob

## Usage

Create a new initialization file active_job.rb in your project with the contents

```ruby
class ActiveJob::Base
  include Apartment::ActiveJob
end
```

You will need to restart your rails server for this to take effect.

## Contributing

1. Fork it ( https://github.com/[my-github-username]/apartment-activejob/fork )
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 a new Pull Request

repository: rails-on-services/apartment-activejob

gha_language: Ruby

repo_name: rails-on-services/apartment-activejob


text:
# CSS Sorter

[![Build status](https://ci.appveyor.com/api/projects/status/qpgnlho3cps0f7qs?svg=true)](https://ci.appveyor.com/project/madskristensen/csssortervs)

Download this extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CSSSorter)
or get the [CI build](http://vsixgallery.com/extension/87534672-5a41-4ea1-a145-17f1a8f5502a/).

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

Sort CSS properties easily for better readibility and GZIP compression

See the [change log](CHANGELOG.md) for changes and road map.

## Features

- Sorts CSS properties
- Uses [CSS Declaration Sorter](https://github.com/ben-eb/css-declaration-sorter) node module under the hood
- How it works

### Sort properties
This extension calls the [CSS Declaration Sorter](https://github.com/ben-eb/css-declaration-sorter) node module behind the scenes to perform the property sorting.

Invoke the command from the context menu in the CSS editor.

![Context Menu](art/context-menu.png)

#### Example

This input:

![Input](art/input.png)

Becomes turns into this after sorting with the SMACSS sorting mode:

![Output](art/output.png)

### How it works
The first time a .css file is opened in Visual Studio after installing this extension, the [css-declaration-sorter](https://github.com/ben-eb/css-declaration-sorter) npm package is being installed into *%LocalAppData%\Temp\CSS Sorter*. It can take up to a minute but usually not more. You have to be online for it to install.

When the npm package has been installed, the context menu button lights up in the CSS editor. When the button is clicked, a process is being started that calls the npm package using Node.js.

So make sure to have Node.js installed or the latest ASP.NET Web Development Tools for Visual Studio which includes Node.js.

## Contribute
Check out the [contribution guidelines](.github/CONTRIBUTING.md)
if you want to contribute to this project.

For cloning and building this project yourself, make sure
to install the
[Extensibility Tools 2015](https://visualstudiogallery.msdn.microsoft.com/ab39a092-1343-46e2-b0f1-6a3f91155aa6)
extension for Visual Studio which enables some features
used by this project.

## License
[Apache 2.0](LICENSE)

repository: iFredOS/CssSorterVS

gha_license_id: NOASSERTION

repo_name: iFredOS/CssSorterVS


text:
# is-template-object polyfill

<!-- This verbiage required per https://github.com/es-shims/es-shim-api#how-to-denote-compliance.
     Do not modify without consulting those docs. -->

This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES5-supported environment and complies with the [spec](https://github.com/tc39/proposal-array-is-template-object).

<!-- End required verbiage -->

Supports: >= ES2015<br>
Requires receiver: false

[![Build Status](https://travis-ci.com/mikesamuel/is-template-object.svg?branch=master)](https://travis-ci.com/mikesamuel/is-template-object)
[![Dependencies Status](https://david-dm.org/mikesamuel/is-template-object/status.svg)](https://david-dm.org/mikesamuel/is-template-object)
[![npm](https://img.shields.io/npm/v/is-template-object.svg)](https://www.npmjs.com/package/is-template-object)
[![Coverage Status](https://coveralls.io/repos/github/mikesamuel/is-template-object/badge.svg?branch=master)](https://coveralls.io/github/mikesamuel/is-template-object?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/github/mikesamuel/is-template-object/badge.svg?targetFile=package.json)](https://snyk.io/test/github/mikesamuel/is-template-object?targetFile=package.json)

The shim installs `Array.isTemplateObject`, a function that returns true for the first argument
passed to a tag function from a [tagged template literal][].

See the [spec explainer][] for detailed semantics, and use cases.

## Usage

```js
const { isTemplateObject } = require('is-template-object');

// Here's a use of a tagged template literal.
let y =  tag`rawText ${ expr } rawText`
// This tagged template literal calls tag like
//    tag(['rawText ', ' rawText'], expr)
// but the array it passes is a special array called a template object.

// Define a function that we can use with tagged templates.
function tag(templateObject, expr) {
  // Sometimes the tag function would like to know if it got a template object.

  if (// True if templateObject contains strings from a literal instead of
      // strings from a trusted author instead of strings that might be
      // controlled by an attacker
      isTemplateObject(templateObject)
      // and the template object came from this realm.
      && templateObject instanceof Array) {

    // Do something that treats the strings in templateObject as content
    // from a trusted author, but which treats expr as possibly
    // attacker-controlled.
  } else {
    // Do not trust templateObject's content or maybe treat as a non-tag call.
  }
}

// We don't know whether `x` and `y` came from an attacker or from a trusted source.
// tag does not to take the trusting path.
tag([ x, y ], expr);
```

[tagged template literal]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates
[spec explainer]: https://github.com/tc39/proposal-array-is-template-object

repository: mikesamuel/is-template-object

repo_name: mikesamuel/is-template-object


text:
### Velvet Production Observations

Contents:
* [Velvet Measurements](#Velvet-Measurements)

#### Velvet Measurements

Record of velvet production measurements[1](#f1).

Attribute | Data Type | Notes
:-------- | :-------- | :----
Velvet ID | String | Velvet identification tag.
Velvet Antler Measured | Enumeration | Left, Right, Combined.
Velvet Weight | Float | Total velvet weight in kg;
Velvet Circumference | Float | The lesser measurement of the circumference of the beam measured on the clear beam: immediately above the trez tyne; and midway between the top of the stick and the top of the inside cut; in cms.
Velvet Top Length | Float | Measured between top of the stick and bottom of the fork where the trez meets the beam; in cms.
Velvet Overall Length | Float | Measured from the top of the stick to the top of the inside cut; in cms.
Velvet Category | Enumeration | See [Velvet Category](#Velvet-Category).
Velvet Grade | Enumeration | See [Velvet Grade](#Velvet-Grade). SA, A, B, C, D, E, OG1, OG2, OG3, RG, HV, HA, SP, TW, Dam, Manufacturing.

##### Velvet Category

Velvet Category is used in the Velvet Measurements observation in the Velvet Production category.

Valid values for Velvet Category |
:------------------------------- |
Super A|
Short|
Medium|
Long Top|
Overgrown|
Regrowth|
Hard Velvet|
Hard Antler|
Spiker|
Taiwan|
Damaged|
Manufacturing|

##### Velvet Grade

Velvet Grade is used in the Velvet Measurements observation in the Velvet Production category.

Valid values for Velvet Grade |
:---------------------------- |
SA|
A|
B|
C|
D|
E|
OG1|
OG2|
OG3|
RG|
HV|
HA|
SP|
TW|
Dam|
Manufacturing|

##### Footnotes

1 [New Zealand Industry Agreed Velvet Grading Guidelines](https://www.deernz.org/sites/dinz/files/Red%20Grading%20Poster%20FINISHED.pdf), Deer Industry New Zealand, September 2013. [↩](#DINZ)

repository: Datalinker-Org/Farm-Data-Standards

repo_name: Datalinker-Org/Farm-Data-Standards


text:
---
title: Commands
page_title: Commands
description: Check our "Commands" documentation article for RadListView for UWP control.
slug: radlistview-commands
tags: radlistview,listview,commands
published: True
position:
---

# Commands

The command design-pattern is very important and widely used in the XAML and MVVM world. **RadListView** strictly follows these best practices and provides an intuitive and easy-to-use set of APIs that allow different aspects of the **RadListView** control’s behavior to be handled and/or completely overridden.

**RadListView** exposes a **Commands** collection that allows you to register custom commands with each control’s instance through the **RadListView.Commands** property:

- **Commands**: Gets the collection with all the custom commands registered with the CommandService. Custom commands have higher priority than the built-in (default) ones.

## Command Types

There are two types of commands:

- **ListViewCommand**: All the default commands within RadListView derive from the base ListViewCommand. Think of this command as a UI-related command as it operates over the RadListView instance that owns the command.
- **ListViewUserCommand**: This specific command type provides the abstraction of the UI-related commands (that all the built-in commands are) over a stateless and UI-agnostic generic command implementation. The command exposes the following properties:
  - **Id**: Gets or sets the CommandId member this command is associated with.
  - **Command**: Gets or sets the generic ICommand implementation that may come from the ViewModel.
  - **EnableDefaultCommand**: Gets or sets a value indicating whether the default (built-in) UI command associated with the specified Id will be executed. The default value is True.

### CommandId Enumeration

All the predefined commands within a RadListView instance are identified by a member of the **CommandId** enumeration. This is actually the key that relates a command instance to a particular action/routine within the owning list view. In order to register a custom command within a RadListView instance you may either inherit the **ListViewCommand** class and override its CanExecute and Execute methods or instantiate a **ListViewUserCommand** instance and set its Command property. In both cases you need to set the Id property of the new command so that it can be properly associated with the desired action/event. Following are the members of the CommandId enumerations:

- **LoadMoreData**: A command associated with requesting and loading more data when available.
- **ItemTap**: A command associated with the Tap event that occurs over an item.
- **ItemDragStarting**: A command associated with the starting a drag action on an item.
- **ItemReorderComplete**: A command associated with the completion of a item reorder action on an item.
- **ItemSwiping**: A command associated with the swiping action on an item.
- **ItemSwipeActionComplete**: A command associated with the completion of a item swipe action on an item.
- **ItemActionTap**: A command associated with the Tap event that occurs on an action item.
- **RefreshRequested**: A command associated with requesting an update with the pull to refresh control.

## Examples

### Using the ListViewCommand class

This example demonstrates how to use the ListViewCommand class to create a command that overrides the default one.

	<telerikDataControls:RadListView>
	    <telerikDataControls:RadListView.Commands>
	        <local:CustomItemTapCommand/>
	    </telerikDataControls:RadListView.Commands>
	</telerikDataControls:RadListView>

	public class CustomItemTapCommand : ListViewCommand
	{
	    public CustomItemTapCommand()
	    {
	        this.Id = CommandId.ItemTap;
	    }

	    public override bool CanExecute(object parameter)
	    {
	        return true;
	    }

	    public override void Execute(object parameter)
	    {
	        var tapContext = parameter as ItemTapContext;
	        var item = tapContext.Item;
	        // add your logic here

	        // execute the default command:
	        this.Owner.CommandService.ExecuteDefaultCommand(this.Id, parameter);
	    }
	}

### Using the ListViewUserCommand class

The following example demonstrates how to create ListViewUserCommand which is bound to a command from a view model. We will use the item tap command and execute our custom action instead of the default one.

First, we have to define a view model as a static resource:

 	<Page.Resources>
        <local:ViewModel x:Key="viewModel"/>
    </Page.Resources>

Here is the definition of the RadListView in XAML:

	<telerikDataControls:RadListView IncrementalLoadingMode="Explicit" DataContext="{StaticResource viewModel}" ItemsSource="{Binding Items}">
	    <telerikDataControls:RadListView.Commands>
	        <telerikListViewCommands:ListViewUserCommand Id="ItemTap" EnableDefaultCommand="False" Command="{Binding ItemTapCommand, Source={StaticResource viewModel}}"/>
	    </telerikDataControls:RadListView.Commands>
	    <telerikDataControls:RadListView.ItemTemplate>
	        <DataTemplate>
	            <TextBlock Text="{Binding Text}"/>
	        </DataTemplate>
	    </telerikDataControls:RadListView.ItemTemplate>
	</telerikDataControls:RadListView>

Where:

	xmlns:telerikDataControls="using:Telerik.UI.Xaml.Controls.Data"
	xmlns:telerikListViewCommands="using:Telerik.UI.Xaml.Controls.Data.ListView.Commands"

And here are the view model, data item and custom command classes:

	public class ViewModel
	{
	    public ViewModel()
	    {
	        this.Items = this.GetItems();
	        this.ItemTapCommand = new ItemTapCommand();
	    }

	    public ItemTapCommand ItemTapCommand { get; set; }

	    public ObservableCollection<Item> Items { get; set; }

	    private ObservableCollection<Item> GetItems()
	    {
	        var items = new ObservableCollection<Item>();
	        for (var i = 0; i < 3; i++)
	        {
	            items.Add(new Item { Text = "item " + i });
	        }

	        return items;
	    }
	}

	public class Item
	{
	    public string Text { get; set; }
	}

	public class ItemTapCommand : ICommand
	{
	    public bool CanExecute(object parameter)
	    {
	        return true;
	    }

	    public event EventHandler CanExecuteChanged;

	    public void Execute(object parameter)
	    {
	        var itemInfo = parameter as ItemTapContext;
	        var item = itemInfo.Item as Item;
			// add your logic here
	    }
	}

repository: telerik/uwp-docs

repo_name: telerik/uwp-docs


text:
# Brot Box Engine
![Build Status](https://www.travis-ci.com/Brotcrunsher/BrotBoxEngine.svg?branch=master)

A C++ prototyping engine that is striving for an easy to use API, hiding all the dirty details so that you don't have to care.

#### Used technology

* [C++](https://isocpp.org/)
* [CMake](https://cmake.org/)
* [Vulkan](https://vulkan.lunarg.com/)
* [GLFW](https://www.glfw.org/)
* [stb_image](https://github.com/nothings/stb/blob/master/stb_image.h)
* [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h)
* [Dear ImGui](https://github.com/ocornut/imgui)
* [Google Test](https://github.com/google/googletest)
* [Travis CI](https://travis-ci.com/)
* [Box2D](https://box2d.org/)
* [PortAudio](http://www.portaudio.com/)
* [minimp3](https://github.com/lieff/minimp3)
* [libcurl](https://curl.se/libcurl/)

## Quick Start

There are a lot of examples in the repository. Have a look at [ExampleSnake](https://github.com/Brotcrunsher/BrotBoxEngine/tree/master/ExampleSnake) for a first start. To create build files for your local machine you have to download and install [CMake](https://cmake.org/) and the [Vulkan SDK](https://vulkan.lunarg.com/). Then, while being in the main directory of the repository, execute the following commands in a terminal:

    mkdir Build
    cd Build
    cmake ..

After that, build files like Solution Files (on Windows) are created. To build the projects you can either use your favorite IDE or directly interact with CMake using the following command while you are in the Build directory:

    cmake --build . --target ExampleSnake

This will build an executable that you may run.

## FAQ

### Would you recommend using the Brot Box Engine to create a game right now?
*No.* The Brot Box Engine is still in a very, very early state. The API is changing rapidly, without warning, without changelogs and without backwards compatibility.

### Can I contribute to the Brot Box Engine?
*Yes.* Feel free to open merge requests! They are always welcome, even if you are a beginner. In such a case you get information about what can be improved, and you can learn from it. Don't be shy, just go for it!

### Which compilers are supported?
The project is regularly build with Microsoft Visual Studio Version 16.5.4 (with its default MSVC) as well as GCC Version 8.4.0. Other versions of said compilers probably also work as long as they have full C++17 support. Completely different compilers like clang are untested, though it's quite possible that they work as well. Feel free to try and let me know.

## Other Resources

[This](https://github.com/Brotcrunsher/BrotBoxEngineExampleExternal) shows you how you can set up an external project that uses the Brot Box Engine. The repository itself is tiny, but it's CMake code downloads and integrates the Brot Box Engine in an easy to use way.

repository: ZGeng/BrotBoxEngine

repo_name: ZGeng/BrotBoxEngine


text:
# Usage

Create a `.env.local` file with the following

```text
CF_TOKEN=<cloudflare token>
CF_ACCOUNT_ID=<cloudflare account id>
NFT_STORAGE_TOKEN=<nft.storage token>
CLUSTER_TOKEN=<ipfs cluster token>
```

Put the LevelDB folder inside this folder with the name `nft-meta` and run the cli

```bash
node cli.js
```


text:
---
date: 2020-12-28T01:50:00.000Z
layout: post
title: Semantic Image Synthesis with Spatially-Adaptive Normalization
subtitle:
description:
image: https://res.cloudinary.com/dfnkx5mr1/image/upload/v1609604451/post_img/14bdcdd0-4aff-11e9-bbbd-8ff0d03ba4ac_j80pqf.gif
optimized_image: https://res.cloudinary.com/dfnkx5mr1/image/upload/c_limit,h_200,w_380/v1609604451/post_img/14bdcdd0-4aff-11e9-bbbd-8ff0d03ba4ac_j80pqf.gif
category: Deep Learning
tags:
  - Deep Learning
author: Jongbeom-Won
---

### Video
<iframe width="560" height="315" src="https://www.youtube.com/embed/R4i7EdLO_Yo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

### References
[Semantic Image Synthesis with Spatially-Adaptive Normalization](https://arxiv.org/abs/1903.07291)


text:
Chatty App
==========

A minimal and light dev environment for ReactJS.

### Final Product

![Screenshot of chattyApp with 2 people](https://raw.githubusercontent.com/alfred529/chattyApp/master/docs/chattyApp_2people.png)

![Screenshot of chattyApp all alone](https://raw.githubusercontent.com/alfred529/chattyApp/master/docs/chattyApp_allalone.png)

![Screenshot of chattyApp party](https://raw.githubusercontent.com/alfred529/chattyApp/master/docs/chattyApp_party.png)

### Usage

Clone the ChattyApp (and the chattyServer), and create your own git repo.
ChattyServer can be found at: https://github.com/alfred529/chattyServer

```
git clone git@github.com:alfred529/chattyApp.git
cd chattyApp
git remote rm origin
git remote add origin [YOUR NEW REPOSITORY]
# Manually update your package.json file
```

Install the dependencies and start the server.

```
npm install
npm start
open http://localhost:3000
```

### Static Files

You can store static files like images, fonts, etc in the `build` folder.

For example, if you copy a file called my_image.png into the build folder you can access it using `http://localhost:3000/build/my_image.png`.

### Linting

This Chatty App project includes React ESLint configuration.

```
npm run lint
```

### Dependencies

* react "15.4.2",
* react-dom "15.4.2"
* babel-core "6.23.1"
* babel-loader "6.3.1"
* babel-preset-es2015 "6.22.0"
* babel-preset-react "6.23.0"
* babel-preset-stage-0 "6.22.0"
* css-loader "0.26.1"
* eslint "3.15.0"
* eslint-plugin-react "6.9.0"
* node-sass "4.5.0"
* sass-loader "6.0.0"
* sockjs-client "^1.1.2"
* style-loader "0.13.1"
* webpack "2.2.1"
* webpack-dev-server "2.3.0"