text:
# Survival-Analysis-of-Churn
Using techniques developed in the area of Survival Analysis (usually used for drug trials) to predict Telco customer churn.

This is actually a pretty useful idea as customers churning is anologous to patients dying.

### requirements
- pandas
- numpy
- tqdm (optional)
- matplotlib (optional)
- lifelines
- sklearn

### Notes
- This code is my attempt to get a foot hold in this area. As such it is basically a copy of Carl Dawson's [Churn Prediction and Prevention](https://towardsdatascience.com/churn-prediction-and-prevention-in-python-2d454e5fd9a5) artical. All credit for the creation of this code should go to him and his sources.
- It should also be noted that in the real world data is messy, so the data used here, avaliable via [Kaggle's Telco Customer Churn](https://www.kaggle.com/blastchar/telco-customer-churn) website, is only an idealised example. From expereince, data, especially Telco or large company data is messy and a large portion of the development for any project like this is involved in getting good data, especially if it needs to be labelled.

repository: astrobenhart/Survival-Analysis-of-Churn

repo_name: astrobenhart/Survival-Analysis-of-Churn


text:
# Replicate PHP client
This is a framework-agnostic PHP client for [Replicate.com](https://replicate.com/) built on the amazing [Saloon v2](https://docs.saloon.dev/) 🤠 library. Use it to easily interact with machine learning models such as Stable Diffusion right from your PHP application.

[![Latest Version on Packagist](https://img.shields.io/packagist/v/benbjurstrom/replicate-php.svg?style=flat-square)](https://packagist.org/packages/benbjurstrom/replicate-php)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/benbjurstrom/replicate-php/tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/benbjurstrom/replicate-php/actions?query=workflow%3tests+branch%3Amain)

## Table of contents
- [Quick Start](https://github.com/benbjurstrom/replicate-php#-quick-start)
- [Using with Laravel](https://github.com/benbjurstrom/replicate-php#using-with-laravel)
- [Response Data](https://github.com/benbjurstrom/replicate-php#response-data)
- [Webhooks](https://github.com/benbjurstrom/replicate-php#webhooks)
- [Prediction Methods](https://github.com/benbjurstrom/replicate-php#available-prediction-methods)
    - [get](https://github.com/benbjurstrom/replicate-php#get)
    - [list](https://github.com/benbjurstrom/replicate-php#list)
    - [create](https://github.com/benbjurstrom/replicate-php#create)

## 🚀 Quick start

Install with composer.

```bash
composer require benbjurstrom/replicate-php
```
###

Create a new api instance.
```php
use BenBjurstrom\Replicate\Replicate;
...

$api = new Replicate(
    apiToken: $_ENV['REPLICATE_API_TOKEN'],
);
```
###

Then use it to invoke your model (or in replicate terms "create a prediction").
```php
$version = 'db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf';
$input = [
    'model' => 'stable-diffusion-2-1',
    'prompt' => 'a photo of an astronaut riding a horse on mars',
    'negative_prompt' => 'moon, alien, spaceship',
    'width' => 768,
    'height' => 768,
    'num_inference_steps' => 50,
    'guidance_scale' => 7.5,
    'scheduler' => 'DPMSolverMultistep',
    'seed' => null,
];

$data = $api->predictions()->create($version, $input);
$data->id; // yfv4cakjzvh2lexxv7o5qzymqy
```
Note that the input parameters will vary depending on what version (model) you're using. In this example version [db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf](https://replicate.com/stability-ai/stable-diffusion/versions/db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf) is a Stable Diffusion 2.1 model optimized for speed.
###

## Using with Laravel
Begin by adding your credentials to your services config file.
```php
// config/services.php
'replicate' => [
    'api_token' => env('REPLICATE_API_TOKEN'),
],
```
###

Bind the `Replicate` class in a service provider.
```php
// app/Providers/AppServiceProvider.php
public function register()
{
    $this->app->bind(Replicate::class, function () {
        return new Replicate(
            apiToken: config('services.replicate.api_token'),
        );
    });
}
````
###

And use anywhere in your application.
```php
$data = app(Replicate::class)->predictions()->get($id);
```
###

Test your integration using Saloon's amazing [response recording](https://docs.saloon.dev/testing/recording-requests#fixture-path).
```php
use Saloon\Laravel\Saloon; // composer require sammyjo20/saloon-laravel "^2.0"
...
Saloon::fake([
    MockResponse::fixture('getPrediction'),
]);

$id = 'yfv4cakjzvh2lexxv7o5qzymqy';

// The initial request will check if a fixture called "getPrediction"
// exists. Because it doesn't exist yet, the real request will be
// sent and the response will be recorded to tests/Fixtures/Saloon/getPrediction.json.
$data = app(Replicate::class)->predictions()->get($id);

// However, the next time the request is made, the fixture will
// exist, and Saloon will not make the request again.
$data = app(Replicate::class)->predictions()->get($id);
```

## Response Data
All responses are returned as data objects. Detailed information can be found by inspecting the following class properties:

* [PredictionData](https://github.com/benbjurstrom/replicate-php/blob/main/src/Data/PredictionData.php)
* [PredictionsData](https://github.com/benbjurstrom/replicate-php/blob/main/src/Data/PredictionsData.php)

## Webhooks
Replicate allows you to configure a webhook to be called when your prediction is complete. To do so chain `withWebhook($url)` onto your api instance before calling the `create` method. For example:

```php
$api->predictions()->withWebhook('https://www.example.com/webhook')->create($version, $input);
$data->id; // la5xlbbrfzg57ip5jlx6obmm5y
```

## Available Prediction Methods
### get()
Use to get details about an existing prediction. If the prediction has completed the results will be under the output property.
```php
use BenBjurstrom\Replicate\Data\PredictionData;
...
$id = 'la5xlbbrfzg57ip5jlx6obmm5y'
/* @var PredictionData $data */
$data = $api->predictions()->get($id);
$data->output[0]; // https://replicate.delivery/pbxt/6UFOVtl1xCJPAFFiTB2tfveYBNRLhLmJz8yMQAYCOeZSFhOhA/out-0.png
```

### list()
Use to get a cursor paginated list of predictions. Returns an PredictionsData object.
```php
use BenBjurstrom\Replicate\Data\PredictionsData
...

/* @var PredictionsData $data */
$data = $api->predictions()->list(
    cursor: '123', // optional
);

$data->results[0]->id; // la5xlbbrfzg57ip5jlx6obmm5y

```
### create()
Use to create a new prediction (invoke a model). Returns an PredictionData object.
```php
use BenBjurstrom\Replicate\Data\PredictionData;
...
$version = '5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa';
$input = [
    'text' => 'Alice'
];

/* @var PredictionData $data */
$data = $api->predictions()
    ->withWebhook('https://www.example.com/webhook') // optional
    ->create($version, $input);
$data->id; // la5xlbbrfzg57ip5jlx6obmm5y
```

## Credits

- [Ben Bjurstrom](https://github.com/benbjurstrom)
- [All Contributors](../../contributors)

## License

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

license: MIT

repository: benbjurstrom/replicate-php

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: benbjurstrom/replicate-php


text:
---
layout: post
title: 2019 in Review
crumbname: 2019 Annual Review
category: blog
tags: annual-review
breadcrumbs:
  - label: Home
    url: https://search.gov/
  - label: Annual Reviews
    url: https://search.gov/blog/annual-reviews.html
---

Open large version

#### **295,916,305** queries
#### **~2,000 gov** websites
#### **16** top topics
#### **365** days of connecting people with what they need.

## System Highlights

* Added ranking factors to our search algorithm (popularity, freshness)
* Released help documentation about site launches and the indexing process
* Added a sitelimit feature to provide an alternative to Collection search scoping
* Added indexing coverage for javascript pages and other metadata-only files.
* Increased security on user accounts
  * automatic disabling after 90 days of inactivity
  * MFA login through Login.gov
* Upgraded Ruby
* Upgraded Rails
* Upgraded Elasticsearch
* Upgraded jQuery
* Increased server capacity and processing power
* Added query caching on our primary index to improve response time
* Expanded our Elasticsearch system twice

branch_name: refs/heads/master

gha_language: HTML


text:
# notapokedex

A simple react pokedex app for experiments.

## Quickstart

You can test the app at the available URL at the top of this page.

## screenshot

| Home | Details |
|------|---------|
| ![home.png](screenshots/home.png)             | ![details.png](screenshots/details.png) |
| ![bookmarks.png](/screenshots/bookmarks.png)  | ![tweets.png](/screenshots/tweets.png) |

## features

* Browse Pokemons list
* Search a Pokemon by name or by id
* Compare a Pokemon's statistics with all others Pokemons of the same type(s)
* View live tweets about a Pokemon
* Like or dislike a Pokemon
* Dark & Light themes

## development

* Clone the repo with `git clone https://github.com/rootasjey/pokedex`
* Go to the cloned repo with `cd pokedex`
* Install dependencies with `yarn` or `npm install`
* Run the app with `yarn run start` or `npm start`

## 3rd party libraries

* [fontawesome](https://fontawesome.com)
* [graphql-request](https://github.com/prisma/graphql-request)
* [maetrial-ui](https://material-ui.com/)
* [mobx](https://mobx.js.org/index.html)
* [react](http://reactjs.org)
* [react-list](https://github.com/coderiety/react-list#readme)
* [react-tilt](https://github.com/jonathandion/react-tilt)
* [react-router](https://reacttraining.com/react-router/web/guides/quick-start)
* [styled-components](https://www.styled-components.com)
* [typescript](http://typescriptlang.org)

## Licence

MIT Licence

repository: rootasjey/notapokedex

gha_language: TypeScript

gha_license_id: MIT

repo_name: rootasjey/notapokedex


text:
---
author: tintoy
comments: true
date: 2013-04-21 07:33:56+10:00
layout: post
slug: finally-my-app-is-ready-for-preview
title: Finally! My app is ready for preview
wordpress_id: 791
categories:
- Apps
- Fifty Protons
- Zelik
tags:
- announce
- apps
- fifty-protons
- zelik
---

It's hard going when you can only do it in your spare time. Much harder than I originally anticipated.

Perhaps somewhat ironically, it's the kind of thing my app could have helped with :-)
<!-- more -->

My app is called [Zelik](http://zelik-preview.azurewebsites.net/).

Zelik is a tool for _opportunistic project-management_.

  *
		Most project-management methodologies require [timeboxing](http://en.wikipedia.org/wiki/Timeboxing), in one form or another.

  *
		Zelik is different - it doesn't tell you what do to at a particular time; as far as Zelik is concerned, the only important time is **now**.

  *
		Zelik doesn't tell you what to do; it gives you choices.

  *
		If you tell Zelik how much time you have available, it makes suggestions as to where you can best focus your efforts.

Here is an example home screen from an early prototype:
[caption id="attachment_821" align="alignnone" width="300"][![Zelik prototype - "What now?" home page](http://tintoy.snoscillator.net/wp-content/uploads/2013/04/WhatNowPrototype-300x168.png)](http://tintoy.snoscillator.net/wp-content/uploads/2013/04/WhatNowPrototype.png) Zelik prototype - "What now?" home page[/caption]

As you can see from the screenshot, the home page ("What now?") shows you 3 groups of items:

  1.
		Up to _N_ items you have worked on _most_-recently.

  2.
		Up to _N_ items you have worked on _least_-recently.

  3.
		Up to _N_ items that need _refinement_.
		For example, items with no description, projects or task-groups that do not contain any tasks.

The end result of this is that you can enter as much or as little detail as you'd like; if you don't have time, or are not sufficiently familiar with the subject-matter, then don't waste time entering details. You can do that when it's practical to do so.

I have a lot more functionality planned for Zelik, but this is a good start.

Currently, Zelik is a [Windows Store app](http://windows.microsoft.com/en-au/windows-8/apps) (I wanted to focus on functionality, rather than spend too much time learning an unfamiliar platform), but eventually it will be available for Web, Windows Desktop, iOS, and Android clients.

In the next couple of weeks (time permitting), I'll start posting about Zelik's design process, and the types of decisions I had to make (as well as their consequences).

extension: markdown


text:
# Fashion-MNIST-Train Data For YOLO

This software generates Fashion-MNIST-Train Data For YOLO.
(forked from https://github.com/uchidama/MNIST-TrainDataForYOLO, which generates MNIST-Train Data)

# Installation

## Install Keras
This software using Keras.
- [Keras installation instructions](https://github.com/keras-team/keras#installation).

If you want to run without to think keras and backend deeplearning frameworks, enter this command.
```sh
pip install tensorflow
pip install keras
```

## Install Darknet YOLO
```sh
git clone https://github.com/pjreddie/darknet
cd darknet
make
```
- [YOLO: Real-Time Object Detection](https://pjreddie.com/darknet/yolo/).

# How to use
## Generate Fashion-MNIST Train Data
1. generat Fashion-MNIST images and labels.

```sh
python fashion_mnist_to_jpg_and_label.py
```

2. generate train.txt and test.txt
```sh
python generate_train_txt_and_test_txt.py
```

## Training YOLO on Fashion-MNIST

3. Copy files to darknet
```sh
cp cfg/tiny-yolo-fashion-mnist.cfg <darknet_dir>/cfg
cp cfg/voc-fashion-mnist.data <darknet_dir>/cfg
cp data/voc-fashion-mnist.names <darknet_dir>/data
```

4. Modify train and test data path. Edit <darknet_dir>/cfg/voc-fashion-mnist.data
```
train  = <path-to-fashion-mnist-train>/train.txt
valid  = <path-to-fashion-mnist-test>/test.txt
```

5. Download Pretrained Convolutional Weights
```sh
cd <darknet_dir>
wget https://pjreddie.com/media/files/darknet19_448.conv.23
```
6. Make directory to save trained model.
```sh
mkdir backup
```

7. Train The Model
```sh
./darknet detector train cfg/voc-fashion-mnist.data cfg/tiny-yolo-fashion-mnist.cfg darknet19_448.conv.23
```
## Predict Fashion-MNIST test data

```sh
./darknet detector test <data file> <cfg file> <weights> <predict image>
```
ex. command.
```sh
./darknet detector test cfg/voc-fashion-mnist.data cfg/tiny-yolo-fashion-mnist.cfg weights/tiny-yolo-fashion-mnist_500000.weights ~/Fashion-MNIST-TrainDataForYOLO/JPEGImages/60015.jpg
```

## License

[MIT](LICENSE.md)

## Link

[YOLO: Real-Time Object Detection](https://pjreddie.com/darknet/yolo/)


text:
# Blade-Element-Theory
Computation of multirotor UAV rotor forces based on Blade Element Theory

A Matlab script to calculate the thrust and lateral forces (H-force and Y-force) generated by the rigid rotor systems typically used in multirotor UAVs. In this case, the script is filled with numbers characterizing the popular DJI 9450 plastic propeller, part of the DJI E310 propulsion system. The proposed model is based on a combination of Blade Element Theory and blade flapping theory models, the employed references are mentioned within the script.

The results from the proposed model were used for the project illustrated in the following paper:

https://link.springer.com/article/10.1007/s10846-019-00995-2

@article{sartori,

        author = "Daniele Sartori and Wenxian Yu",

        title = "Experimental Characterization of a Propulsion System for Multi-rotor UAVs",

	journal = "Journal of Intelligent \& Robotic Systems",

	year = "2019",

	volume = "96",

	number = "3",

	pages = "529-540",

	month = "February"

}


text:
# oneplace-tag

[![Build Status](https://travis-ci.com/OnePlc/PLC_X_Tag.svg?branch=master)](https://travis-ci.com/OnePlc/PLC_X_Tag)
[![Coverage Status](https://coveralls.io/repos/github/OnePlc/PLC_X_Tag/badge.svg?branch=master)](https://coveralls.io/github/OnePlc/PLC_X_Tag?branch=master)
![Packagist Downloads](https://img.shields.io/packagist/dt/oneplace/oneplace-tag)
![Stable Version](https://img.shields.io/packagist/v/oneplace/oneplace-tag)
![GitHub Release Date](https://img.shields.io/github/release-date/oneplc/plc_x_tag)
![Open Issues](https://img.shields.io/github/issues-raw/oneplc/plc_x_tag)
![Discourse status](https://img.shields.io/discourse/status?server=https%3A%2F%2Fdiscourse.1plc.ch)

## Introduction

This is the Tag Module for onePlace Software Framework based on Laminas Project (former Zend Framework)

With this Module you can create tags of any kind for all oneplace Modules without any coding!
Default tags are "Categories" and "State" - but you can enhance it with any tags you like
for example "Type", "Manufacturer" - whatever you can imagine as a select or multiselect connection.

## Installation

Using composer

```bash
$ composer require oneplace/oneplace-tag
```

## Documentation

Checkout [oneplace-docs](https://docs.1plc.ch/oneplace-tag/)


text:
# Bash

* [Awesome Shell](https://github.com/alebcay/awesome-shell)

## Make sh file [executable](https://help.ubuntu.com/community/Beginners/BashScripting#Scripting)

```
chmod a+x /where/i/saved/it/hello_world.sh   #Gives everyone execute permissions
# OR
chmod 700 /where/i/saved/it/hello_world.sh   #Gives read,write,execute permissions to the Owner
```

## Processes

* ``ps aux | grep firefox`` (find the firefox process)
* ``sudo kill firefox`` (kill the firefox process) ([learn more](http://www.cyberciti.biz/faq/kill-process-in-linux-or-terminate-a-process-in-unix-or-linux-systems/))
* ``sudo kill -9 firefox`` (stronger kill)

## Shutdown

``sudo shutdown -h 18:45``

## Search

* [ack](http://beyondgrep.com/) - fast search in files (for programmers).

license: Unlicense

repository: nikolaygit/webdev

repo_name: nikolaygit/webdev


text:
---
title: "Variorum 0.2.0 Released"
categories: release
---

[Variorum](https://github.com/LLNL/variorum) is a platform-agnostic library exposing monitor and control interfaces for several features in hardware architectures. Its general interfaces provide privileged functionality for monitoring and controlling various hardware-level features of multiple hardware architectures. The latest release includes:

- Support for Nvidia platform -- Volta architecture
- On Intel platforms, translate both power limit time windows
- Integrate Travis and GitLab for CI
- and much more!

Learn more:

- [Variorum v0.2.0 release notes](https://github.com/LLNL/variorum/releases/tag/v0.2.0)
- [Variorum GitHub repo](https://github.com/LLNL/variorum)
- [Variorum documentation](https://variorum.readthedocs.io/en/latest/)

gha_language: JavaScript


text:
# Chatserver example implementation

## Short description
Offers basic functionality for a chat server based on Java Servlet-API. Implementation is REST-like, not 100% mature and just for education purposes. Does only send and receive JSON format data, mapped by Jackson Library.

## Libraries
Uses following libraries:
 * Jackson [Core](https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core/2.10.3), [Annotation](https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotation/2.10.3) and [Databind](https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/2.10.3) in Version 2.10.3
 * Servlet-API from [Apache Tomcat 8.5](https://tomcat.apache.org/download-80.cgi)


text:
## Overview
This is a generated connector from [HubSpot](https://www.hubspot.com/) OpenAPI specification.

These APIs allow you to interact with HubSpot's Marketing Events Extension.

## Prerequisites
Before using this connector in your Ballerina application, complete the following:
* Create a [HubSpot developer](https://developers.hubspot.com/) account
* Obtain tokens
    -  Use [this](https://knowledge.hubspot.com/integrations/how-do-i-get-my-hubspot-api-key?_ga=2.57958890.1140639136.1626730652-1097354510.1626409334) guide to obtain the API keys related to your account.

## Quickstart
To use the HubSpot Marketing connector in your Ballerina application, update the .bal file as follows:

### Step 1 - Import connector
First, import the ballerinax/hubspot.marketing module into the Ballerina project.
```ballerina
import ballerinax/hubspot.marketing;
```

### Step 2 - Create a new connector instance
You can now make the connection configuration using the access token.
```ballerina
marketing:ApiKeysConfig config = {
    apiKeys : {
        hapikey : "<your apiKey>"
    }
};

marketing:Client baseClient = check new Client(clientConfig);
```
### Step 3 - Invoke connector operation

1. Create a marketing event
```ballerina
marketing:MarketingEventCreateRequestParams event = {
    eventName: "<EVENT_NAME>",
    eventOrganizer: "<EVENT_ORGANIZER>",
    customProperties: [],
    externalAccountId: "<EXTERNAL_ACCOUNT_ID>",
    externalEventId: "<EXTERNAL_EVENT_ID>"
};

marketing:MarketingEventDefaultResponse|error bEvent = baseClient->createMarketingEvent(event);

if (bEvent is marketing:MarketingEventDefaultResponse) {
    log:printInfo("Created behavoural event");
} else {
    log:printInfo(msg = bEvent.message());
}
```

2. Use `bal run` command to compile and run the Ballerina program

gha_language: Ballerina


text:
[![Actions Status](https://github.com/lizmat/Tie-Hash/workflows/test/badge.svg)](https://github.com/lizmat/Tie-Hash/actions)

NAME
====

Raku port of Perl's Tie::Hash module

SYNOPSIS
========

    use P5tie;
    use Tie::Hash;

DESCRIPTION
===========

This module tries to mimic the behaviour of Perl's `Tie::Hash` module as closely as possible in the Raku Programming Language.

Tie::Hash is a module intended to be subclassed by classes using the [P5tie](tie()) interface. It provides implementations of the `CLEAR`, `UNTIE` and `DESTROY` methods. It also provides a stub for the `EXISTS` method, but one needs to supply an `EXISTS` method for real `exists` functionality. All other `tie` methods should be provided.

SEE ALSO
========

[P5tie](P5tie), [Tie::StdHash](Tie::StdHash)

AUTHOR
======

Elizabeth Mattijsen<EMAIL_ADDRESS>
Source can be located at: https://github.com/lizmat/Tie-Hash . Comments and Pull Requests are welcome.

COPYRIGHT AND LICENSE
=====================

Copyright 2018, 2019, 2020, 2021 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

repository: lizmat/Tie-Hash

repo_name: lizmat/Tie-Hash


text:
[Home](./index.md) > [puppeteer](./puppeteer.md) > [PageEmittedEvents](./puppeteer.pageemittedevents.md)

## PageEmittedEvents enum

All the events that a page instance may emit.

Signature:

```typescript
export declare const enum PageEmittedEvents
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  Close | "close" | Emitted when the page closes. |
|  Console | "console" | Emitted when JavaScript within the page calls one of console API methods, e.g. console.log or console.dir. Also emitted if the page throws an error or a warning. |
|  Dialog | "dialog" | Emitted when a JavaScript dialog appears, such as alert, prompt, confirm or beforeunload. Puppeteer can respond to the dialog via [Dialog.accept()](./puppeteer.dialog.accept.md) or [Dialog.dismiss()](./puppeteer.dialog.dismiss.md). |
|  DOMContentLoaded | "domcontentloaded" | Emitted when the JavaScript [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched. |
|  Error | "error" | Emitted when the page crashes. Will contain an Error. |
|  FrameAttached | "frameattached" | Emitted when a frame is attached. Will contain a [Frame](./puppeteer.frame.md). |
|  FrameDetached | "framedetached" | Emitted when a frame is detached. Will contain a [Frame](./puppeteer.frame.md). |
|  FrameNavigated | "framenavigated" | Emitted when a frame is navigated to a new URL. Will contain a [Frame](./puppeteer.frame.md). |
|  Load | "load" | Emitted when the JavaScript [load](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched. |
|  Metrics | "metrics" | Emitted when the JavaScript code makes a call to console.timeStamp. For the list of metrics see [page.metrics](./puppeteer.page.metrics.md). |
|  PageError | "pageerror" | Emitted when an uncaught exception happens within the page. Contains an Error. |
|  Popup | "popup" | Emitted when the page opens a new tab or window.Contains a [Page](./puppeteer.page.md) corresponding to the popup window. |
|  Request | "request" | Emitted when a page issues a request and contains a [HTTPRequest](./puppeteer.httprequest.md). |
|  RequestFailed | "requestfailed" | Emitted when a request fails, for example by timing out.Contains a [HTTPRequest](./puppeteer.httprequest.md). |
|  RequestFinished | "requestfinished" | Emitted when a request finishes successfully. Contains a [HTTPRequest](./puppeteer.httprequest.md). |
|  RequestServedFromCache | "requestservedfromcache" | Emitted when a request ended up loading from cache. Contains a [HTTPRequest](./puppeteer.httprequest.md). |
|  Response | "response" | Emitted when a response is received. Contains a [HTTPResponse](./puppeteer.httpresponse.md). |
|  WorkerCreated | "workercreated" | Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the page. |
|  WorkerDestroyed | "workerdestroyed" | Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is destroyed by the page. |

repository: yujiosaka/puppeteer

repo_name: yujiosaka/puppeteer


text:
# [SoCal Challengers Facts](http://alexa.amazon.com/#skills/amzn1.ask.skill.5e2601a9-1e63-41f6-a76e-9b318e3aa275)
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the SoCal Challengers Facts skill, try saying...

* *Alexa, open SoCal Challengers.*

* *Alexa, ask SoCal Challengers for a fact.*

* *Alexa, ask SoCal Challengers for a fact about the club.*

This skill offers facts and information about SoCal Challengers car club.  SoCal Challengers car club is a California State NPO. Tax ID 37-1595191.

Questions or comments?  Contact<EMAIL_ADDRESS>
***

### Skill Details

* **Invocation Name:** socal challengers
* **Category:** null
* **ID:** amzn1.ask.skill.5e2601a9-1e63-41f6-a76e-9b318e3aa275
* **ASIN:** B01N9LTPVB
* **Author:** NoSynAck
* **Release Date:** January 1, 2017 @ 22:49:54
* **In-App Purchasing:** No


text:
# Overview

All the range of services from IaaS, via PaaS to SaaS.
* CPUs, Memory, Disks, Interfaces
* Servers, VM instances
* Clusters, Cluster management
* Serverless, Autoscaling

## Compute services
* Compute engine
* Google Kubernetes Engine
* App Engine
* Cloud Functions

## Interaction with GCP
GCP Console, Cloud SDK, Cloud Shell
GC Client libraries

# Virtual Private Cloud

GCP backbone consists of
* Regions
* Edge point of presence (PoP)
* Networks

## VPC Objects
* Projects
* Networks
  * Default
  * auto mode
  * custom mode
* Subnetworks
* Regions
* Zones
* IP addresses
  * Internal
  * External
  * Range
* VMs
* Routes
* Firewall rules

## Projects, networks, and subnetworks

**Project**
* Associates objects and services with billing
* Contains networks (up to 5) that can be shared/peered (with other projects)

**Network**
* Has no IP address range
* Is global and spans all available regions
* Contains subnetworks
* Is available as default, auto or custom (like in region)

### 3 VPC network types
* Default
  * Every project
  * One subnet for region
  * Default firewall rules
* Auto Mode
  * Default network
  * One subnet per region
  * Regional IP allocation
  * Fixed /20 subnetwork per region
  * Expandable up to /16
* Custom Mode
  * No default subnets created
  * Full control of IP ranges
  * Regional IP allocation
  * Expandable to any RFC 1918 size

**Auto -> Custom one way convertion allowed**

### Expand  subnets without re-creatin instances
* Cannot overlap with other subnets
* Must be inside the RFC 1918 address spaces
* Can expand but not shrink
* Auto mode can be expanded from /20 to /16
* Avoid large subnets

## IP addresses

VMs can have internal and external addresses

### Internal IP
* Allocated from subnet range to VMs by DHCP
* Lease renewed every 24 hours
* VM name + IP is registered with network-scoped DNS

### External
* Assigned from pool (ephemeral)
* Reseved (static)
* Billed when not attached to a running VM
* VM does not know external IP - it is mapped to the internal IP

## DNS resolution

### DNS resolution for internal addresses
FQDN is [nostname].[zone].c.[project-id].internal
Internal DNS resolver as part of Compute Engine (<IP_ADDRESS>) - provides answer for internal and external addresses

### DNS resolution for External addresses
Public DNS records are not published automatically
DNS zones can be hosted using Cloud DNS

### Cloud DNS
100% uptime SLA
UI, CLI, or API

Set alias IP ranges to VM's NIC

## Routes and Firewall

Route table is created when subnet is created. Traffic delivered is it matches firewall rules.
Route tables support VM instance tag. Not tagged records apply to all the instances.

Firewall
* VPC acts like a disrtibuted firewall.
* Rules apply to the network as a whole.
* Connections are allowed or denied on the instance level.
* Firewall rules are stateful.
* Implied deny all ingress and allow all egress. (if no other rules)
* Rules support action deny or allow
* Rules can be mapped to instance level

## Pricing
Ingress - No charge
Egress - same zone, or Google products - free
Egress between zones, same zone ext. IP address, between regions - $0.01 per Gb
Egress other regions - varies
Use GCP Pricing calculator

# Virtual Machines
## GCP compute and processing options
Compute Engine supports any language, usage model IaaS, Server Autoscaling, primary used for General Workloads
Other options
* Kubernetes Engine
* App Engine Standard
* App Engine Flexible
* Cloud Functions

Compute Engine (IaaS)
* vCPUs (cores) and Memory
* Persitent disks: HDD, SSD, and Local SSD
* Networking
* Linux or Windows

## vCPU
* Network throughtput scales at 2Gbps per vCPU
* Theoretical max throughtput of 16Gbps with 8 vCPU
* A vCPU is equal to 1 hardware hyper-thread

## Storage
* Standard (max 64TB) / SSD (max 64TB) / Local SSD (for tmp storage)
* Standard and SSD PDs scale in performance for each GB of space allocated
* Resize disks or migrate instancs with no downtime
IOPs depends on size

## VM lifecycle
* Provisioning
* Staging
* Running <--> Reset
* Stopping
* Terminated
No charge for stopped VM (charged for attached disks and IPs)
Allowed to change machine type, add/remove disks, tags, metadata, static IPs, Can't change an image

## Machine types
* Standard
* High-memory
* High-CPU
* Memory optimized
* Compute-optimized
* Shared-core
* Custom (you specify everything)

## Pricing
* Per-second billing with minimum of 1 minute
* Resource-based pricing
* Disounts
  * Sustained use
  * Committed use
  * Preemptible VM instances
* Recommendation Engine notifies you of underutilized instances
* Free usage limits

### Preemptible
Lower price for interruptible services (up to 80%)
Might be terminated any time (no charge if terminated first 10 minutes, 24 hours max, 30 second terminate warning but not guaranteed)

### Sole-tenant nodes
physically isolated workloads. Useful for complience tasks.

### Shielded VMs offer verifiable integrity
* Secure Boot
* Virtual trusted platform module (vTPM)
* Integrity monitoring
* Required shielded Image

## Images
* Boot loader
* Operating system
* File system structure
* Software
* Customizations

Public or custom images
Images charged per second with 1 min minimum (some exceptions like MSSQL min 10 min and per minute)

Boot disk is durable (can survive VM termination)

### Persistent disks
* attached to a VM through the network interface
* durable
* bootable
* snapshot
* performance scales with size
* Features
  * NDD / SSD
  * Disk resizing
  * RO mode to multiple VM
  * Encryption keys (Google managed, customer managed, customer supplied)

Local SSD survive just reboot
RAM disks - very volatile

Snapshot service can help with migration/changing disk type
You can't shrink disks

## Metadata
Custom metadata
Keys:
startup-script-url
shutdown-script-url

repository: eugenj/global-notes

repo_name: eugenj/global-notes


text:
---
layout: default
title: Running and Debugging
permalink: /rundebug/
nav_order: 5
---
# Running and Debugging

The InterSystems ObjectScript Extension provides support for ObjectScript debugging. It takes advantage of the debugging capabilities built into VS Code, so you may find these VS Code documentation resources useful:

- [Debugging Intro Video](https://code.visualstudio.com/docs/introvideos/debugging)
- [Debugging User Guide](https://code.visualstudio.com/docs/editor/debugging)

Also, InterSystems Learning Services has produced [a short video](https://learning.intersystems.com/course/view.php?id=1795&ssoPass=1) which walks through the steps in this documentation page that you may find useful.

## Debug Configurations

In order to run or debug an ObjectScript class or routine or attach to a running process, you must create a debug configuration. Some other languages default to running the currently active file, but to run ObjectScript, you must specify the routine or ClassMethod to use or the running process to attach to.

Click the run button in the Activity Bar:

![Run button.](../assets/images/run.png "run button")

If no debug configurations are available, you are prompted to create one:

![Create debug configuration.](../assets/images/CreateLaunchConfig.png "create debug configuration")

Clicking the link opens a dialog containing a list of debug environments. Select **ObjectScript Debug**.

![Select debug environment.](../assets/images/debug-environment.png "select debug environment")

Once you have chosen a debug environment, VS Code creates and opens a `launch.json` file containing the following default content:

```json
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "objectscript",
            "request": "launch",
            "name": "XDebug"
        }
    ]
}
```

These attributes are mandatory for any debug configuration:

- **type** - Identifies the type of debugger to use. In this case, `objectscript`, supplied by the InterSystems ObjectScript extension.
- **request** - Identifies the type of action for this launch configuration. Possible values are `launch` and `attach`.
- **name** - An arbitrary name to identify the configuration. This name appears in the Start Debugging drop down list.

In addition, for an **objectscript launch** configuration, you need to supply the attribute **program**, which specifies the routine or ClassMethod to run when launching the debugger, as shown in the following example:

```json
"launch": {
	"version": "0.2.0",
	"configurations": [

		{
			"type": "objectscript",
			"request": "launch",
			"name": "ObjectScript Debug HelloWorld",
			"program": "##class(Test.MyClass).HelloWorld()",
		},
		{
			"type": "objectscript",
			"request": "launch",
			"name": "ObjectScript Debug GoodbyeWorld",
			"program": "##class(Test.MyOtherClass).GoodbyeWorld()",
		},
	]
}
```

For an **objectscript attach** configuration, you may supply the following attributes:

- **processId** - Specifies the ID of process to attach to as a `string` or `number`. Defaults to `"${command:PickProcess}"`, which provides a dropdown list of process ID's to attach to at runtime.
- **system** - Specifies whether to allow attaching to system process. Defaults to `false`.

The following example shows multiple valid **objectscript attach** configurations:

```json
"launch": {
	"version": "0.2.0",
	"configurations": [
		{
			"type": "objectscript",
			"request": "attach",
			"name": "Attach 1",
			"processId": 5678
		},
		{
			"type": "objectscript",
			"request": "attach",
			"name": "Attach 2",
			"system": true
		},
	]
}
```

## Starting a Debugging Session

You can select a debug configuration from the list VS Code provides in the Run and Debug field at the top of the debug side bar:

![Select debug configuration.](../assets/images/select-config.png "select debug configuration")

Clicking on the green arrow runs the currently selected debug configuration.

When starting **objectscript launch** debug session, make sure that the file containing the **program** that you are debugging is open in your editor and is the active tab. VS Code will start a debug session with the server of the file in the active editor (the tab that the user is focused on). This also applies to **objectscript attach** debug sessions.

This extension uses WebSockets to communicate with the InterSystems server during debugging. If you are experiencing issues when trying to start a debugging session, check that the InterSystems server's web server allows WebSocket connections.

Debugging commands and items on the **Run** menu function much as they do for other languages supported by VS Code. For information on VS Code debugging, see the documentation resources listed at the start of this section.

repository: a-boertien/vscode-objectscript

repo_name: a-boertien/vscode-objectscript


text:
# go-chain

[![](https://img.shields.io/badge/godoc-reference-5272B4.svg)](http://godoc.org/github.com/shilangyu/go-chain)
[![](https://goreportcard.com/badge/github.com/shilangyu/go-chain)](https://goreportcard.com/report/github.com/shilangyu/go-chain)
[![](https://github.com/shilangyu/go-chain/workflows/build/badge.svg)](https://github.com/shilangyu/go-chain/actions)

Created as an exercise to understand blockchains

## resources used

- [3b1b: bitcoin](https://www.youtube.com/watch?v=bBC-nXj3Ng4)
- [3b1b: 256b security](youtube.com/watch?v=S9JGmA5_unY)
- [hashing](https://lisk.io/academy/blockchain-basics/how-does-blockchain-work/what-is-hashing)
- many more

repository: shilangyu/go-chain

repo_name: shilangyu/go-chain


text:
**Assignment PS - 2**

**Problem Statement**

The Indian space agency ISRO must deal with budgeting decisions to choose how to optimally divide the budget among its N competing missions. Each mission head has submitted the cost to be incurred and its overall value (or profit) for consideration. The budget available with the agency is 100 crores. They need your help in selecting as many projects
as possible with the budget constraints such that the total value returned is maximized.

For this problem we can assume that there is no dependency of launching one project on the other. If there are multiple solutions with same value, choose the one which results in maximum utilization of budget and selection of missions as well.

**Requirements**
1. Formulate an efficient recursive algorithm using dynamic programming to determine
how to select the missions to be funded and maximize value.
2. Analyse the time complexity of your algorithm.
3. Implement the above problem statement using Python 3.7.

**Approach**
For this problem statement we have selected the Knapsack algorithm using Dynamic Programming.

**Knapsack Algorithm**
Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack. In other words, given two integer arrays val[0..n-1] and wt[0..n-1] which represent values and weights associated with n items respectively. Also given an integer W which represents knapsack capacity, find out the maximum value subset of val[] such that sum of the weights of this subset is smaller than or equal to W. You cannot break an item, either pick the complete item or don’t pick it (0-1 property).

The simplest way to solve the knapsack problem is to consider all subsets of items and calculate the total weight and value of all subsets. Consider the only subsets whose total weight is smaller than W. From all such subsets, pick the maximum value subset.

**_Optimal Sub-structure_:**  To consider all subsets of items, there can be two cases for every item.

1.  **Case 1:**  The item is included in the optimal subset.
2.  **Case 2:**  The item is not included in the optimal set.

**Complexity Analysis:**

-   **Time Complexity:**  O(2^n).
    As there are redundant sub-problems.
-   **Auxiliary Space :** O(1).
    As no extra data structure has been used for storing values.

The redundant sub-problem approach can be solved by using a Dynamic Programming strategy to improve the computation time and computation space requirements.

In the Dynamic programming we will work considering the same cases as mentioned in the recursive approach. In a DP[][] table let’s consider all the possible weights from ‘1’ to ‘W’ as the columns and weights that can be kept as the rows.

The state DP[i][j] will denote maximum value of ‘j-weight’ considering all values from ‘1 to ith’. So if we consider ‘wi’ (weight in ‘ith’ row) we can fill it in all columns which have ‘weight values > wi’. Now two possibilities can take place:

-   Fill ‘wi’ in the given column.
-   Do not fill ‘wi’ in the given column.

Now we have to take a maximum of these two possibilities, formally if we do not fill ‘ith’ weight in ‘jth’ column then DP[i][j] state will be same as DP[i-1][j] but if we fill the weight, DP[i][j] will be equal to the value of ‘wi’+ value of the column weighing ‘j-wi’ in the previous row. So we take the maximum of these two possibilities to fill the current state.

**Complexity Analysis:**

-   **Time Complexity:**  O(N*W).
    where ‘N’ is the number of weight element and ‘W’ is capacity. As for every weight element we traverse through all weight capacities 1<=w<=W.
-   **Auxiliary Space:**  O(N*W).
    The use of 2-D array of size ‘N*W’.

The DP approach can be further optimized by reducing the need for calculating redundant cases. We can solve this problem by simply creating a 2-D array that can store a particular state (n, w) if we get it the first time. Now if we come across the same state (n, w) again instead of calculating it in exponential complexity we can directly return its result stored in the table in constant time. This method gives an edge over the recursive approach in this aspect.

**Complexity Analysis:**

-   **Time Complexity:**  O(N*W).
    As redundant calculations of states are avoided.
-   **Auxiliary Space:**  O(N*W).
    The use of 2D array data structure for storing intermediate states-:A simple solution is to consider all subsets of items and calculate the total weight and value of all subsets. Consider the only subsets whose total weight is smaller than W. From all such subsets, pick the maximum value subset.


text:
# threejs-procedural-animal

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

An experiment in procedural animal generation using threejs.

## Usage

[![NPM](https://nodei.co/npm/threejs-procedural-animal.png)](https://nodei.co/npm/threejs-procedural-animal/)

## License

MIT, see [LICENSE.md](http://github.com/bunnybones1/threejs-procedural-animal/blob/master/LICENSE.md) for details.

repository: mcanthony/threejs-procedural-animal

repo_name: mcanthony/threejs-procedural-animal


text:
---
layout: default
img: tar
caption: Life skills
title: Bash Cheat Sheet
active_tab:
release_date:
due_date:
---

{% capture this_year %}{{'now' | date: '%Y'}}{% endcapture %}
{% capture due_year %}{{page.due_date | date: '%Y'}}{% endcapture %}
{% if this_year != due_year %}
{% endif %}

Bash: Greatest Hits
=============================================================

Copied from [Ellie Pavlick's](https://cs.brown.edu/people/epavlick/) favorite [bash commands](http://crowdsourcing-class.org/bash-commands.html) for basic data processing/exploration

#### Where am I??
{% highlight tcsh %}
$ ls # list all the files in this directory
$ ls some/directory # list all the files in some/directory
$ pwd # print the directory where you are currently working ("print working directory")
$ cd some/directory # go to some/directory ("change directory")
$ cd ~/ # take me home ("change directories to the user's home directory")
$ mkdir new_directory # create a new diretory called new_directory ("make directory")
$ rm file.txt # remove file.txt (be careful, it will be gone for good).
$ rm -r directory # remove directory and all the files within it (again, gone for good).
{% endhighlight %}

#### What the $#@! are these files?
{% highlight tcsh %}
$ ls -lah file.txt #print the size of file.txt in bytes (also the date it was created)
$ wc -l file.txt #print the number of lines in file.txt
$ file file.txt #print the type of the file (e.g. is it a text file? compressed archive?)
$ head file.txt #print the first 10 lines of file.txt
$ head -NUM file.txt #print the first NUM lines of file.txt (e.g. head -3 prints first 3 lines)
$ tail -NUM file.txt #print the last NUM lines of file.txt (e.g. tail -3 prints last 3 lines)
$ cat file.txt #print the entire contents of file.txt
$ tar -xzvf file.tar.gz #unzip a tar archived file
$ tar -czvf files.tar.gz files/ #create a tar archived file containing the contents of the directory files/
{% endhighlight %}

#### Exploring and reorganizing file contents
{% highlight tcsh %}
$ sort file.txt # sort the lines in file.txt (by default, alphabetically and ascending)
$ sort -r file.txt # sort the lines in file.txt in reverse order
$ sort -nr file.txt # sort the lines in file.txt numerically and in reverse order
$ uniq file.txt # remove duplicate lines (only works if you use "sort" first)
$ uniq -c file.txt # print out unique lines and the number of times each one occurs
$ cut -f 1 file.txt # print the first column of the file.txt (assumes columns are tab-separated)
$ cut -f 1 -d ',' file.csv # print the first column of file.csv, split on comma instead of tab
$ grep "phrase" file.txt # print out lines in file.txt that contain the string "phrase"
$ grep -i "phrase" file.txt # same as above, but ignoring case
$ grep -v "phrase" file.txt # print out lines in file.txt that don't contain the string "phrase"
$ shuf file.txt # shuffle the lines in file.txt
{% endhighlight %}

#### Gettin' fancy
Bash commands are connecting via "pipes", which means the input of one command is the output of the previous command. We use the | character to "pipe" one command's output into another. Below are some useful examples.
{% highlight tcsh %}
$ cat file.txt | sort | uniq | wc -l # how many unique lines are in this file
$ cat file.txt | sort | uniq -c | sort -nr # print out the unique lines in file.txt, with the most frequent line and its count at the top
$ cat file.txt | grep "phrase" | wc -l # how many lines in this file contain the phrase "phrase"
$ cat file.txt | sort | uniq -c | sort -nr | head -100 | shuf | head -10 # take a random sample of 10 of the top 100 most frequent lines
{% endhighlight %}
Bash can also write to files! This makes a life a lot easier than dragging your cursor, copying large chunks of text from the terminal window. File Output Redirection can be done using the  >  or  >>  operators.
{% highlight tcsh %}
$ grep "Hello" file.txt > output.txt # Stores every line containing "Hello" in file.txt in a new file output.txt
$ cat file.txt | sort | uniq -c | sort -nr > output.txt # stores the unique lines of file.txt, with the most frequent line and its count at the top, in output.txt. Overwrites the old contents of output.txt (Careful!)
$ cat output.txt | wc -l >> output.txt # Appends the line count of output.txt to the end of output.txt
{% endhighlight %}

#### Downloading Files
To download the contents of any URL (whether it be a file, HTML page or even a picture), there's a very useful command on Mac and Linux.
{% highlight tcsh %}
$ wget https://www.gutenberg.org/files/10/10-0.txt # Downloads the entire English King James Bible from Project Gutenberg (used in Linx)
{% endhighlight %}
{% highlight tcsh %}
$ curl -O https://www.gutenberg.org/files/10/10-0.txt # Downloads the entire English King James Bible from Project Gutenberg (used in Mac)
{% endhighlight %}


text:
# CommitLinter

This repository uses a commit linter that is installed via npm.
The chosen solution is: [git-commit-msg-linter](https://www.npmjs.com/package/git-commit-msg-linter).

To use it you have to install it via `npm install`.
It forces better commit messages by enforcing rules based on the commit rules of Angular.

You can find mor einformation about it [here](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format).

gha_language: C#


text:
# Arthritis

**Arthritis** is the swelling and tenderness of one or more of your joints. The main symptoms of arthritis are joint pain and stiffness, which typically worsen with age. The most common types of arthritis are _osteoarthritis and rheumatoid arthritis._

Osteoarthritis causes cartilage — the hard, slippery tissue that covers the ends of bones where they form a joint — to break down. Rheumatoid arthritis is a disease in which the immune system attacks the joints, beginning with the lining of joints.

Uric acid crystals, which form when there's too much uric acid in your blood, can cause gout. Infections or underlying disease, such as psoriasis or lupus, can cause other types of arthritis.

## Diagnosis

During the physical exam, your doctor will check your joints for swelling, redness and warmth. He or she will also want to see how well you can move your joints.

Depending on the type of arthritis suspected, your doctor may suggest some of the following tests.
**Laboratory tests**

The analysis of different types of body fluids can help pinpoint the type of arthritis you may have. Fluids commonly analyzed include blood, urine and joint fluid. To obtain a sample of your joint fluid, your doctor will cleanse and numb the area before inserting a needle in your joint space to withdraw some fluid.
**Imaging**

These types of tests can detect problems within your joint that may be causing your symptoms. Examples include:

    1. **X-rays**. Using low levels of radiation to visualize bone, X-rays can show cartilage loss, bone damage and bone spurs. X-rays may not reveal early arthritic damage, but they are often used to track progression of the disease.
    2. **Computerized tomography (CT)**. CT scanners take X-rays from many different angles and combine the information to create cross-sectional views of internal structures. CTs can visualize both bone and the surrounding soft tissues.
    3. **Magnetic resonance imaging (MRI)**. Combining radio waves with a strong magnetic field, MRI can produce more-detailed cross-sectional images of soft tissues such as cartilage, tendons and ligaments.
    4. **Ultrasound**. This technology uses high-frequency sound waves to image soft tissues, cartilage and fluid-containing structures near the joints (bursae). Ultrasound is also used to guide needle placement for joint aspirations and injections.

 ## **How is arthritis treated?**

The main goal of treatment is to reduce the amount of pain you’re experiencing and prevent additional damage to the joints. You’ll learn what works best for you in terms of controlling pain. Some people find heating pads and ice packs to be soothing. Others use mobility assistance devices, like canes or walkers, to help take pressure off sore joints.

Improving your joint function is also important. Your doctor may prescribe you a combination of treatment methods to achieve the best results.

**Medication**

A number of different types of medication treat arthritis:

    1. **Analgesics**, such as hydrocodone (Vicodin) or acetaminophen (Tylenol), are effective for pain management, but don’t help decrease inflammation.
    2. **Nonsteroidal anti-inflammatory drugs (NSAIDs)**, such as ibuprofen (Advil) and salicylates, help control pain and inflammation. Salicylates can thin the blood, so they should be used very cautiously with additional blood thinning medications.
    3. **Menthol or capsaicin creams** block the transmission of pain signals from your joints.
    4. **Immunosuppressants** like prednisone or cortisone help reduce inflammation.

If you have Rheumatoid Arthritis, your doctor may put you on corticosteroids or disease-modifying antirheumatic drugs (DMARDs), which suppress your immune system. There are also many medications to treat OA available over the counter or by prescription.

**Surgery**

Surgery to replace your joint with an artificial one may be an option. This form of surgery is most commonly performed to replace hips and knees.

If your arthritis is most severe in your fingers or wrists, your doctor may perform a joint fusion. In this procedure, the ends of your bones are locked together until they heal and become one.
**Physical therapy**

Physical therapy involving exercises that help strengthen the muscles around the affected joint is a core component of arthritis treatment.
What lifestyle changes can help people with arthritis?

Weight loss and maintaining a healthy weight reduce the risk of developing OA and can reduce symptoms if you already have it.

Eating a healthy diet is important for weight loss. Choosing a diet with lots of antioxidants, such as fresh fruits, vegetables, and herbs, can help reduce inflammation. Other inflammation-reducing foods include fish and nuts.

Foods to minimize or avoid if you have arthritis include fried foods, processed foods, dairy products, and high intakes of meat.

Some research also suggests that gluten antibodies may be present in people with RA. A gluten-free diet may improve symptoms and disease progression. A 2015 study also recommends a gluten-free diet for all people who receive a diagnosis of undifferentiated connective tissue disease.

Regular exercise will keep your joints flexible. Swimming is often a good form of exercise for people with arthritis because it doesn’t put pressure on your joints the way running and walking do. Staying active is important, but you should also be sure to rest when you need to and avoid overexerting yourself.

repository: RikilG/Medical-Expert-System

repo_name: RikilG/Medical-Expert-System


text:
+++
title="Channel - Go Live Event"
weight = 210
+++

# ChannelGoLiveEvent

## Description

The ChannelGoLiveEvent is triggered when a monitored channel goes live.

## Dependencies

Requires the specific channels to be registered with the TwitchClient Helper. See [TwitchClientHelper](../twitch4j/client-helper)

## Examples

### Example 1

```java
eventManager.onEvent(ChannelGoLiveEvent.class).subscribe(event -> {
	System.out.println("[" + event.getChannel().getName() + "] went live with title " + event.getTitle() + " on game " + event.getGameId() + "!");
});
```

gha_language: Java


text:
---
tags: programming
layout: post
title: "New OI/SPOPS, why no CJAN?"
---

Finally got latest versions out. SPOPS 0.53
was a week ago, then a helpful developer pointed out a bug
which was promptly fixed by 0.54. OpenInteract
1.35 has a very extensive Changelog,
particularly when you consider that most of the interesting
stuff happens in the packages, each of which has their own
log.

Now that it's released, I need to upgrade a site running
(IIRC)
1.2 to 1.35. It will be a little difficult but hopefully not
too bad. It will be a chance to create a 'common upgrade
experience' type of log, altho I don't know how many people
actually upgrade.

In general, I don't hear much from people using
OpenInteract. This could be a good thing -- I put a
lot of effort into making installation easy, so maybe
people just understand it and are working merrily away -- or
a bad thing -- they try it for a bit, don't get immediate
gratification and throw it on the scrap heap. General
feedback is nice every once in a while :-)

Java stuff is going ok. I still get frustrated when easy
things aren't easy, but that's just java. I'm trying to keep
the attitude that Java is something I want to get very good
at -- at least somewhere around my current Perl proficiency.

An idle thought -- why hasn't someone taken the CPAN tools and just created
a CJAN from them? Clearly some of the items are different --
there's no standard for building/testing as in Perl, but at
least it gives you a powerful
registration/browsing/mirroring/distribution system. There's
always the canard that the tools should be written in the
language they're dealing with. My answer to this is: let's
get it working, then you and the other language purists can
get right on that for version 2 :-)

Java is in a much different area from Perl in this
respect -- Sun acts as a central authority (for APIs, code,
etc.) where Perl has none. Hackers abhor a vacuum, so it got
filled. It's hard to get motivated to fill something that's
already got something (however small) there.

(Originally posted elsewhere)

gha_language: CSS


text:
# lazy_computations_research

List of different lazy evaluation c++ libraries:

* https://github.com/xtensor-stack/xtensor
* https://github.com/jscheiny/Streams
* https://github.com/SaadAttieh/lazyCode
* https://github.com/MarcDirven/cpp-lazy
* https://github.com/tirimatangi/Lazy
* https://github.com/cwzx/lazy-iterators
* https://github.com/citybound-old/lzy
* https://github.com/hirthwork/lazy
* https://github.com/minamiyama1994/Lazy
* https://github.com/randrewy/Streams
* https://github.com/twentylemon/flow

Need to remember, that I want to join reactive programming with a lazy evaluation. So I work not with steam processing, but with a set of completly performed operations on the value.


text:
---
layout: single
classes: wide
title: Research
author_profile: true
permalink: /research/
header:
  overlay_image: /assets/images/denali.jpeg
feature_row1:
  - image_path: /assets/images/Core.png
    alt: "Soil core collection."
    title: "Antibiotic Resistance in Alaskan Soil Bacteria"
    excerpt: "The global spread of antibiotic resistance in pathogenic bacteria is a crisis at the forefront of public health today. Many of the antibiotics used clinically are derived from secondary metabolites produced by soil microbes implicating soils as a reservoir of both antibiotic producing and resistant bacteria. In the arctic climate change and soil disturbances, like wildfires, augment permafrost thaw which changes the physical and chemical properties of overlying active layer soils. These changes shift microbial communities in return shifting the abundance and types of antibiotic resistance genes comprising the resistome. In this research I use genomics to examine how disturbance induced thaw affects the resistome of Alaskan soil communities."
    url: "/research/antibioticresistance"
    btn_class: "btn--primary"
    btn_label: "Learn more"
feature_row2:
  - image_path: /assets/images/Research_Pic.jpg
    alt: "Preparing a MinION flow cell for DNA sequencing."
    title: "Advancing Microbial Sciences"
    excerpt: "With massive advancments in next-generation sequencing capabilities, biological sciences are shifting towards a big data approach. I am interested in how we can use these technologies through the lens of genomics to shape the way we approach one health, epidemiology, and microbial sciences."
    url: "/research/genomics"
    btn_class: "btn--primary"
    btn_label: "Learn more"
feature_row3:
  - image_path: /assets/images/permafrost.jpg
    alt: "Thawing permafrost on the edge of a cliff face."
    title: "One Health In a Changing World"
    excerpt: "Disease outbreaks over the past century have recurrently threatened global public health, animal health and biodiversity conservation. The zoonoses such as SARS, Ebola, Zika, swine and avian flu highlight the link between animal and human health.  It is increasingly apparent that a one health approach to science that takes into account human, animal and ecological health will be increasingly important for understanding how anthropogenic activities including globalization, climate change, land use change and urbanization will lead to the emergence of novel diseases."
    url: "/research/onehealth"
    btn_class: "btn--primary"
    btn_label: "Learn more"
---

My current research interests revolve around how we can address the intersectionality of environmental, animal, and human health through the lens of genomics and data science.  Below are overviews of various aspects of my current work.

{% include feature_row id="feature_row1" type="left" %}

{% include feature_row id="feature_row2" type="left" %}

{% include feature_row id="feature_row3" type="left" %}


text:
# responsive-filenames
📚📲 _"Easy CSS Breakpoints"_

[![Build Status](https://travis-ci.org/nymag/responsive-filenames.svg)](https://travis-ci.org/nymag/responsive-filenames)
[![Code Climate](https://codeclimate.com/github/nymag/responsive-filenames/badges/gpa.svg)](https://codeclimate.com/github/nymag/responsive-filenames)

This module allows you to easily delineate media query breakpoints by file name. For example, say we have five files:

```
all.css
print.css
0-600.css
600-1024.css
1024+.css
```

With responsive-filenames, you can write css in these files without worrying about cascading across media queries. The print stylesheet will be wrapped in `@media print`, and the various viewport stylesheets get wrapped in media queries based on their file name (hence `responsive-filenames`). A stylesheet called `0-600.css` will look like:

```css
@media screen and (min-width: 0px) and (max-width: 599.99px) {
  /* styles */
}
```

You can specify any viewport size, and even have overlapping viewports. For example, you can have a combined mobile and tablet stylesheet, and some separate tablet fixes:

```
0-1024.css
600-1024.css
```

# Install

```
npm install --save responsive-filenames
```

If you want to use it in your terminal, you can also install it globally.

# Usage

## Command line

```bash
responsive-filenames input1.css [input2.css ...] [options]
```

You can pass multiple files or glob patterns into responsive-filenames. These are all valid:

```bash
responsive-filenames path/to/file1.css
responsive-filenames css/*.css
responsive-filenames css/*.css otherstyles/**
```

By default the compiled css will output to stdout. You can also pass `-o filename` (or `--output filename`) to write it to a file.

## In Node

```js
var rfn = require('responsive-filenames');

rfn('css/*.css', function (err, css) {
  if (!err) {
    // do something with the compiled css!
  }
});
```

### Flexible file arguments

responsive-filenames is very flexible about the arguments you pass in. You can give it a glob or an array of globs, or even multiple file arguments. These are all valid:

```js
var callback = function (err, css) {
  if (!err) {
    // do something with the compiled css!
  }
};

rfn('path/to/file1.css', callback);
rfn(['path/to/file1.css', 'path/to/file2.css'], callback);
rfn('css/*.css', callback);
rfn('css/*.css', 'otherstyles/**', callback);
```

**NOTE:** The order of the files/globs you pass in is preserved, but globs themselves (usually) rely on filename order. [Read more about globbing](https://www.npmjs.com/package/glob#glob-primer).

### But what about promises?

This module's async function follows node best practices, so you can easily promisify it with a library like [bluebird](https://github.com/petkaantonov/bluebird)

```js
var Promise = require('bluebird'),
  rfn = Promise.promisify(require('responsive-filenames'));

rfn('css/*.css')
  .then(function (css) {
    // do something with the compiled css!
  })
  .catch(function (e) {
    // oh noes!
  });
```

## In Gulp (and other build tools)

If you pass a stream into responsive-filenames, it'll compile each file individually and output them as another stream.

```js
var rfn = require('responsive-filenames');

gulp.src('**/*.css')
  .pipe(rfn())
  .pipe(concat())
  .pipe(cssmin())
  .pipe(gulp.dest('compiled.css'));
```

repository: nymag/responsive-filenames

repo_name: nymag/responsive-filenames


text:
# SIPrefix
## Introduction
SIPrefix converts numbers between varied orders of magnitude and SI prefix based magnitudes.

Large or small numbers can be scaled to between 10⁰ and 10³ with a corresponding SI prefix. Scaled numbers with an SI prefix can be converted back to the full magnitude representation.

These functions allow for improved visualization of large or small numbers, and enable easy use of numbers with SI prefixes in calculations.

To use SIPrefix, clone the repository and import the module:
```python
from siprefix import siprefix
```

## Usage
SIPrefix only uses SI prefixes that are separated by 3 orders of magnitude, including:

Y, Z, E, P, T, G, M, k, (base), c, m, µ, n, p, f, a, z, y

Hecto- (h), deca- (da), deci- (d), centi- (c), and any non-SI prefixes are not used in SIPrefix.

### Value Scaling
Scales input value to within 10⁰ and 10³ with a corresponding SI prefix. (Scaling can exceed 10³ if input is beyond range of SI prefix magnitudes)

```python
siprefix.scale(value, combined=True)
```

#### Base Order Input
The `value` parameter can be a `float`, `int`, `Decimal`, or `str` type.

The function will output a `str` with the scaled number and prefix separated by a space.

If the `combined` argument is set to `False`, the function will output a tuple containing a `float` of the scaled number and a `str` of the prefix.

```python
# float
siprefix.scale(0.5)
# '500.0 m'

# int
siprefix.scale(9000)
# '9.0 k'

# Decimal
siprefix.scale(Decimal(42))
# '42.0'

# str
siprefix.scale('0.0000000000004')
# '400.0 f'

# Tuple output
siprefix.scale(0.5, False)
# (500.0, 'm')
```

#### Non-Base Order Input
Use of non-base order input requires the value and prefix to be combined into a single `str` type. The value and prefix are not required to be separated by a space.

```python
# Prefix space
siprefix.scale('0.00005 P')
# '50.0 G'

# No prefix space
siprefix.scale('0.00005P')
# '50.0 G'

# Tuple output
siprefix.scale('0.00005 P', False)
# (50.0, 'G')
```

### Value Expansion
Expands input value with SI prefix to full scale representation.

```python
siprefix.expand(value)
```

The `value` parameter should be a `str` type to include an associated SI prefix. The prefix can directly follow the number without a space. The function will not expand any values if the parameter is a `float`, `int`, or `Decimal` type.

The function will output a `float` of the expanded number.

```python
siprefix.expand('500 m')
# 0.5

siprefix.expand('9 k')
# 9000.0

siprefix.expand('400.0 f')
# 4e-13
```

### Considerations
Sorting of values should be done prior to scaling as magnitude differences will not be handled correctly in the output `str` type.

The tuple output option is included to allow for easier formatting of the output values.

SIPrefix does not handle units at all. There are other packages capable of this functionality (see Resources section below).

Inclusion of units in some cases will lead to errors due to overlap with SI prefixes. For instance, including the 'meter' abbreviation 'm' as input will cause incorrect scaling/expansion due to treating the unit as the 'milli' prefix.

If units are required, they can be removed from the input value and appended after scaling/expansion.

## Resources
- [SIPrefix GitLab](https://gitlab.com/varjas/siprefix)
- [SIPrefix GitHub](https://github.com/varjas/siprefix)
- [SIPrefix JavaScript GitLab](https://gitlab.com/varjas/siprefixjs)
- [SIPrefix JavaScript GitHub](https://github.com/varjas/siprefixjs)
- [Magnitude Library](https://github.com/juanre/magnitude)
- [Metric prefix - Wikipedia](https://wikipedia.org/wiki/Metric_prefix)

## License
Code released under the [MIT License](LICENSE.md).

repository: varjas/siprefix

repo_name: varjas/siprefix


text:
Crystal Website
===============
Powered by [Jekyll](https://jekyllrb.com/)

## Development setup

- Checkout the repository
- Check the Ruby version in `.travis.yml` and make sure you're using it
- Run `bundle install`
- Start the server with `bundle exec jekyll serve`
- Open a broswer in `localhost:4000`

or to build without starting it: `bundle exec jekyll build`

### Troubleshooting

#### `An error occurred while installing libv8 (<IP_ADDRESS>)`

```
gem install therubyracer -v '0.12.2'
gem install libv8 -v '<IP_ADDRESS>' -- --with-system-v8
```

Then retry from the `bundle install` step.

## Thanks!

As always, thanks to the community who contributes to Crystal and its infrastructure and projects.

## License

Crystal is licensed under the Apache License, Version 2.0

repository: Fryguy/crystal-website

branch_name: refs/heads/unstable

repo_name: Fryguy/crystal-website


text:
---
title: "PhysioUnicaDB: a dataset of EEG and ECG simultaneously acquired"
publication_types:
  - "2"
authors:
  - admin
  - Matteo Fraschini
  - Andrea Casanova
  - Aniello Castiglione
  - Gianni Fenu
doi: 10.1016/j.patrec.2017.12.017
publication: Pattern Recognition Letters Volume 126, 1 September 2019, Pages 119-122
abstract: "Most of the application involving the study of EEG
  (Electroencephalogram) and ECG (Electrocardiogram) are focused on their
  usefulness from a medical point of view. In the last decade, these signals
  have been extensively studied also from other perspectives, like biometric
  recognition, sleep disorder analysis and brain computer interface
  applications. Although many datasets are publicly available, none of them
  gathers both EEG and ECG signal simultaneously. This lack carries the
  researchers to look for some workaround for analyzing aspects such as the
  removal of artifacts from the EEG or the data fusion of EEG and ECG. In the
  following work the dataset PhysioUnicaDB is presented; it consists of 22
  acquisition from healthy subjects, in which the EEG and ECG signals are
  simultaneously acquired. The data are not filtered, so leaving the data as raw
  as possible. "
draft: false
featured: false
links:
 - name: Science Direct
   url: https://www.sciencedirect.com/science/article/pii/S0167865517304634

url_pdf: ''
url_code: ''
url_dataset: 'https://www.dropbox.com/sh/whkuvpsxb4f26nk/AAAK1CjEPvp56NJ-SqV9-yEJa?dl=0'
url_poster: ''
url_project: ''
url_slides: ''
url_source: ''
url_video: ''
image:
  filename: featured
  focal_point: Smart
  preview_only: false
date: 2019-09-10T16:03:00.000Z
---


text:
# Spring Boot 2 + Angular 10: User Registration and Login using JWT Authentication, OAuth2 Social Login with Facebook, Google, LinkedIn, and Github using Spring Security 5 and Two Factor Authentication (2FA)

[Creating Backend - Spring REST API - Part 1](https://www.javachinna.com/spring-boot-angular-two-factor-authentication/)

[Creating Backend - Spring REST API - Part 2](https://www.javachinna.com/2020/10/23/spring-boot-angular-10-user-registration-oauth2-social-login-part-2/)

[Creating Angular 10 Client Application - Part 3](https://www.javachinna.com/2020/10/28/spring-boot-angular-10-user-registration-oauth2-social-login-part-3/)

[Secure Spring Boot Angular Application with Two Factor Authentication](https://www.javachinna.com/spring-boot-angular-two-factor-authentication/)


text:
# TsungEx

- https://github.com/processone/tsung
- http://tsung.erlang-projects.org/user_manual/

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:

  1. Add tsung_ex to your list of dependencies in `mix.exs`:

        def deps do
          [{:tsung_ex, "~> 0.0.1"}]
        end


text:
# Modeling of 2019–20 coronavirus pandemic data

- Application of the model to a few countries data, see [model.ipynb](https://github.com/egorsobolev/covid19/blob/master/model.ipynb)
- Comparision of the pandemic develompent in a few countries, see [countries.ipynb](https://github.com/egorsobolev/covid19/blob/master/countries.ipynb)

## Model

We applied [Gompertz curve](https://en.wikipedia.org/wiki/Gompertz_function) to model COVID-19 pandemic data:

$$f\left(t\right) = a\mathrm{e}^{-b\mathrm{e}^{-ct}}$$

where
- $a$ is an asymptote, since $\lim_{t \rightarrow \inf} a\mathrm{e}^{-b\mathrm{e}^{-ct}} = a\mathrm{e}^{0}=a$
- $b$ sets the displacement along the x-axis (translates the graph to the left or right).
- $c$ sets the growth rate (y scaling)

The rate of growth:

$$r=\frac{f'(t)}{f(t)}=bc\mathrm{e}^{-ct}$$


text:
# Daily Prebuilt: Vue demo

## Requirements

To use this demo, you will first need to [create a Daily account](https://dashboard.daily.co/signup). You will need your Daily API key, which can be found on the [Developers](https://dashboard.daily.co/developers) page, if you want to create new rooms through the demo UI.

You can use existing Daily rooms in the demo by pasting the room URL into the input. The room URL should be in this format to be valid: `https://domain-name.daily.co/room-name`, with `daily-domain` changed to your domain, and `room-name` changed to the name of the existing room you would like to use.

---

## Running locally

To run this demo locally:

1. Install dependencies `npm install`
2. Start dev server `npm run serve`
3. Then open your browser and go to http://localhost:8080

OR...

## Running using Netlify CLI

If you want access to the Daily REST API (using the proxy as specified in `netlify.toml`) as well as a more robust local dev environment, please do the following in this project's directory:

1. Deploy to your Netlify account

   [![Deploy with Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/daily-demos/vue-daily-prebuilt)

   Note: You'll need your [Daily API key](https://dashboard.daily.co/developers) handy for this step.

2. Install the Netlify CLI `npm i -g netlify-cli`
3. Login to your account `netlify login`
4. Rename `sample.env` to `.env` and add your API key
5. Start the dev server `netlify dev`

> Note: If the API proxy isn't working locally you may need to run `netlify build` first. This will put API key in the `netlify.toml` file, so make sure you don't commit this change.

### Compile and minify for production

```
npm run build
```

### Lint and fix files

```
npm run lint
```

---

## Related blog posts/tutorials

Lean more about this demo with our [Vue+Daily Prebuilt tutorial](https://www.daily.co/blog/build-a-video-chat-app-with-vue-and-daily-prebuilt/) on the [Daily blog](https://www.daily.co/blog/).

repository: samsonnegash/vue-daily-prebuilt

repo_name: samsonnegash/vue-daily-prebuilt


text:
### [CVE-2019-11739](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11739)
![](https://img.shields.io/static/v1?label=Product&message=Thunderbird&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3C%2068.1%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Covert%20Content%20Attack%20on%20S%2FMIME%20encryption%20using%20a%20crafted%20multipart%2Falternative%20message&color=brighgreen)

### Description

Encrypted S/MIME parts in a crafted multipart/alternative message can leak plaintext when included in a a HTML reply/forward. This vulnerability affects Thunderbird < 68.1 and Thunderbird < 60.9.

### POC

#### Reference
- https://bugzilla.mozilla.org/show_bug.cgi?id=1571481
- https://www.mozilla.org/security/advisories/mfsa2019-29/

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
# Soul Work Soul Mate

SoulMate is designed to help Soul Work Coffee customers identify coffees they will enjoy.

## Technologies & libraries used:
* React
* MongoDB
* Mongoose
* Express.js
* Axios
* Shopify API
* Materialize

A live version of the app can be viewed [here](https://dashboard.heroku.com/apps/soulwork-soulmate).

repository: whitbrooks/SoulMate

repo_name: whitbrooks/SoulMate


text:
# How to integrate 3DS with Checkout API

In this documentation you will find all the necessary information to carry out the integration with 3DS with Checkout API. For more information on how this type of authentication works, see [3DS 2.0](/developers/en/docs/checkout-api/how-tos/improve-payment-approval/3ds).

> NOTE
>
> Important
>
> To integrate with 3DS, certain requirements must be met. Before moving on to the next steps, review the [Prerequisites](/developers/en/docs/checkout-api/prerequisites) section and make sure that all are met.

## Integrate with 3DS

3DS authentication can be done through two different flows: **with or without Challenge**, which are additional steps that the buyer must complete to ensure their identity. The decision to include or exclude the Challenge depends on the card issuer and the risk profile of the transaction being performed.

> Also learn about the integrations via [Checkout Bricks,](/developers/en/docs/checkout-bricks/how-tos/integrate-3ds) a modular, secure and customizable payment method that automates several of the processes described below.

For **low-risk transactions**, the information sent at checkout is sufficient and the additional Challenge steps are not necessary. However, **for cases of high fraud risk**, the Challenge is necessary to **verify the buyer's identity**, which increases card transaction conversion.

Below are the steps to integrate with 3DS.

1. Use the Mercado Pago [SDK JS](https://www.mercadopago.com.br/developers/en/docs/sdks-library/client-side/mp-js-v2) at checkout to generate the [credit card token](/developers/en/docs/checkout-api/integration-configuration/card/integrate-via-cardform).
2. Next, send the **checkout data** along with the **card token** to the backend.
3. After that, make a request to create a new payment with the received data. The `three_d_secure_mode` attribute needs to be sent with one of the following values:
    1. `not_supported`: 3DS must not be used (this is the default value).
    2. `optional`: 3DS may or may not be required, depending on the risk profile of the transaction.

[[[
```curl

curl --location --request POST 'https://api.mercadopago.com/v1/payments' \
--header 'Authorization: <ENV_ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payer": {
        "email": "<BUYER_EMAIL>"
    },
    "additional_info": {
        "items": [
            {
                "quantity": <ITEM_QUANTITY>,
                "category_id": <CATEGORY_ID>,
                "title": <ITEM_TITLE>,
                "unit_price": <TRANSACTION_AMOUNT>
            }
        ]
    },
    "payment_method_id": <PAYMENT_METHOD_ID>,
    "marketplace": "NONE",
    "installments": <INSTALLLMENTS_NUMBER>,
    "transaction_amount": <TRANSACTION_AMOUNT>,
    "description": "<DESCRIPTION>",
    "token": "CARD_TOKEN",
    "three_d_secure_mode": "optional",
    "capture": true,
    "binary_mode": false
}'
```
```java
MercadoPagoConfig.setAccessToken("<ENV_ACCESS_TOKEN>");
    PaymentClient client = new PaymentClient();
    PaymentCreateRequest createRequest =
        PaymentCreateRequest.builder()
            .transactionAmount(new BigDecimal(<TRANSACTION_AMOUNT>))
            .token("<CARD_TOKEN>")
            .description("<DESCRIPTION>")
            .installments(<INSTALLLMENTS_NUMBER>)
            .paymentMethodId("<PAYMENT_METHOD_ID>")
            .payer(
               PaymentPayerRequest.builder()
                 .email("<BUYER_EMAIL>")
                 .build()
            )
            .threeDSecureMode("optional")
            .build();
    client.create(createRequest);
```
```csharp
using MercadoPago.Config;
using MercadoPago.Client.Payment;
using MercadoPago.Resource.Payment;
MercadoPagoConfig.AccessToken = "<ENV_ACCESS_TOKEN>";
var request = new PaymentCreateRequest
{
    TransactionAmount = <TRANSACTION_AMOUNT>,
    Token = "<CARD_TOKEN>",
    Description = "<DESCRIPTION>",
    Installments = <INSTALLLMENTS_NUMBER>,
    Payer = new PaymentPayerRequest
    {
        Email = "<BUYER_EMAIL>",
    },
    ThreeDSecureMode = "optional",
};
var client = new PaymentClient();
Payment payment = await client.CreateAsync(request);
```
```php

<?php
  MercadoPago\SDK::setAccessToken("<ENV_ACCESS_TOKEN>");
  $payment = new MercadoPago\Payment();
  $payment->transaction_amount = <TRANSACTION_AMOUNT>;
  $payment->token = "CARD_TOKEN";
  $payment->description = "<DESCRIPTION>";
  $payment->installments = <INSTALLLMENTS_NUMBER>;
  $payment->payer = array(
        "email" => "<BUYER_EMAIL>"
    );
  $payment->three_d_secure_mode = "optional";
  $payment->save();
?>
```
```node

var mercadopago = require('mercadopago');
mercadopago.configurations.setAccessToken(config.access_token);
var payment_data = {
  transaction_amount: <TRANSACTION_AMOUNT>,
  token: '<CARD_TOKEN>',
  description: '<DESCRIPTION>',
  installments: <INSTALLLMENTS_NUMBER>,
  payer: {
    email: '<BUYER_EMAIL>'
  },
  three_d_secure_mode: 'optional'
};
mercadopago.payment.create(payment_data).then(function (data) {
  console.log(data);
});
```
```ruby

require 'mercadopago'
sdk = Mercadopago::SDK.new('<ENV_ACCESS_TOKEN>')
payment_request = {
  token: '<CARD_TOKEN>',
  installments: <INSTALLLMENTS_NUMBER>,
  transaction_amount: <TRANSACTION_AMOUNT>,
  description: '<DESCRIPTION>',
  payer: {
    email: '<BUYER_EMAIL>',
  },
  three_d_secure_mode: 'optional'
}
payment_response = sdk.payment.create(payment_request)
payment = payment_response[:response]
```
```python
import mercadopago
sdk = mercadopago.SDK("<ENV_ACCESS_TOKEN>")
payment_data = {
    "transaction_amount": <TRANSACTION_AMOUNT>,
    "token": "<CARD_TOKEN>",
    "description": "<DESCRIPTION>",
    "installments": <INSTALLLMENTS_NUMBER>,
    "payer": {
        "email": "<BUYER_EMAIL>",
    },
    "three_d_secure_mode": "optional"
}
payment_response = sdk.payment().create(payment_data)
payment = payment_response["response"]
```
]]]

If the Challenge flow is not required, the payment `status` field will have a value of `approved` and it will not be necessary to display it, so it is possible to proceed with the application flow.

For cases where the Challenge is necessary, the status will show the value `pending`, and the `status_detail` will be `pending_challenge`.

> NOTE
>
> Important
>
> In the latter case, the response will show a payment attribute called `three_ds_info` with the fields `external_resource_url`, which contains the Challenge URL, and `creq`, a Challenge request identifier. It will be necessary to display the Challenge and treat its result with the following steps.

### Response overview (information omitted)

[[[
```Json

{
    "id":<PHONE_NUMBER>5,
    ...
    "status": "pending",
    "status_detail": "pending_challenge",
    ...
    "three_ds_info":
    {
        "external_resource_url": "https://acs-public.tp.mastercard.com/api/v1/browser_Challenges",
        "creq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImJmYTVhZjI0LTliMzAtNGY1Yi05MzQwLWJkZTc1ZjExMGM1MCIsImFjc1RyYW5zSUQiOiI3MDAwYTI2YS1jYWQ1LTQ2NjQtOTM0OC01YmRlZjUwM2JlOWYiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDQiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIn0"
    },
    "owner": null
}

```
]]]

4. To **display the Challenge**, you need to generate an iframe (min height: 500px, min width: 600px) containing a form with `method post`, `action` containing the URL obtained in the field `external_resource_url`, and a hidden input with the value returned in `creq`. Then, you must post the form below to start the Challenge.

[[[
```javascript

function doChallenge(payment) {
  try {
    const {
      status,
      status_detail,
      three_ds_info: { creq, external_resource_url },
    } = payment;
    if (status === "pending" && status_detail === "pending_challenge") {
      var iframe = document.createElement("iframe");
      iframe.name = "myframe";
      iframe.id = "myframe";
      iframe.height = "500px";
      iframe.width = "600px";
      document.body.appendChild(iframe);

      var idocument = iframe.contentWindow.document;

      var myform = idocument.createElement("form");
      myform.name = "myform";
      myform.setAttribute("target", "myframe");
      myform.setAttribute("method", "post");
      myform.setAttribute("action", external_resource_url);

      var hiddenField = idocument.createElement("input");
      hiddenField.setAttribute("type", "hidden");
      hiddenField.setAttribute("name", "creq");
      hiddenField.setAttribute("value", creq);
      myform.appendChild(hiddenField);
      iframe.appendChild(myform);

      myform.submit();
    }
  } catch (error) {
    console.log(error);
    alert("Error doing challenge, try again later.");
  }
}

```
]]]

When the Challenge is completed, the payment status will be updated to `approved` if the authentication is successful, and `rejected` if it is not. In situations where authentication is not performed, the payment remains `pending`. This update is not immediate and may take a few moments.

> NOTE
>
> Important
>
> When the Challenge is initiated, the user has about 5 minutes to complete it. If it is not completed, the bank will decline the transaction and Mercado Pago will consider the payment cancelled. While the user doesn't complete the Challenge, the payment will remain as `pending_challenge`.

See the section below for more details on how to check the status of each transaction.

## Check transaction status

To find out the result of each transaction, there are three options:

* **Notifications**: A notification of the payment status change will be received through Webhooks and the buyer must be redirected to a screen indicating that the transaction was successful. Check the [Webhooks](/developers/en/docs/checkout-api/additional-content/your-integrations/notifications/webhooks)  section and learn how to set it up.
* **Payments API**: It will be necessary to make a [Payments](developers/en/reference/payments/_payments/post) pooling and if the status changes, redirect the buyer to a confirmation screen.
* **Treat the iframe event (recommended)**: Keep in mind that the event only indicates that the Challenge has ended and not that the payment has reached a final status, as the update is not immediate and may take a few moments. Make a request to [Payments](/developers/en/reference/payments/_payments/post) and if the status changes, redirect the buyer to a screen indicating that the transaction was successful.

To **treat the iframe event**, follow the steps below.

### Perform implementation

Use the following JavaScript code to implement and request the event that indicates that the Challenge has ended, so it is possible to redirect the client to the confirmation screen.

[[[
```javascript

window.addEventListener("message", (e) => {
     if (e.data.status === "COMPLETE") {
         window.open("congrats.html");
     }
});

```
]]]

### Search payment status

The following Javascript indicates how to search for the updated payment status and display it on the confirmation screen.

[[[
```javascript

document.addEventListener("DOMContentLoaded", async function (e) {
 heat();
});

async function init() {
 const id = localStorage.getItem("paymentId");

 try {
   const response = await fetch("/get_payment/" + id, {
     method: "GET",
   });
   const result = await response.json();
   if (result.status != 200) throw new Error("error getting payment");
   document.getElementById("congrats-div").innerHTML =
     "Pagamento " + result.data.id + " -> Status: " + result.data.status;
 } catch (error) {
   alert("Unexpected error\n" + JSON.stringify(error));
 }
}

```
]]]

> NOTE
>
> Important
>
> If the payment is still `pending` after the Challenge timeout, it will be necessary to redirect the buyer to a screen informing that the payment has expired and that a new one needs to be created (the update is not immediate, it may take some moments).

After following these steps, your integration is ready to authenticate transactions with 3DS.

## Possible payment statuses

A transaction with 3DS can return different statuses depending on the type of authentication performed (with or without Challenge). In a payment **without Challenge**, the transaction status will be directly `approved` or `rejected`.

In a payment **with Challenge**, the transaction will have a `pending` status and the authentication process with the bank will be initiated. Only after this step, the final status will be displayed.

See below the table with the possible statuses and their respective descriptions.

| Status     | Status_detail                 | Description                                                      |
|------------|-------------------------------|------------------------------------------------------------------|
| "approved" | "accredited"                  | Transaction approved without authentication.                     |
| "rejected" | -                            | Transaction rejected without authentication. To check the reasons, please refer to the standard [list of status details](https://mercadopago.com.br/developers/en/docs/checkout-api/response-handling/collection-results).                     |
| "pending"  | "pending_challenge"           | Transaction pending authentication or Challenge timeout. |
| "rejected" | "cc_rejected_3ds_challenge"   | Transaction rejected due to Challenge failure.                 |

## Integration test

To facilitate the validation of 3DS payments, we have created a sandbox testing environment. This environment returns fictional results that are only used for simulating and validating the implementation.

> WARNING
>
> Remember to use the test credentials for your application.

To test payments in a sandbox environment, specific cards should be used to test the implementation of the Challenge with both success and failure flows, as shown in the table below:

| Card        | Flow                    | Number              | Security Code | Expiration Date |
|-------------|-------------------------|---------------------|----------------|-----------------|
| Mastercard  | Successful Challenge    | 5483 9281 6457 4623 | 123            | 11/25           |
| Mastercard  | Unauthorized Challenge | 5361 9568 0611 7557 | 123            | 11/25           |

The steps to create the payment remain the same. If you have any doubts about how to create card payments, please refer to the [documentation on Cards](https://www.mercadopago.com.br/developers/en/docs/checkout-api/integration-configuration/card/integrate-via-cardform).

> NOTE
>
> To ensure that the payment is created with 3DS, remember to include the three_d_secure_mode attribute with the value optional.

[[[
```curl
curl -X POST \
   -H 'accept: application/json' \
   -H 'content-type: application/json' \
   -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
   'https://api.mercadopago.com/v1/payments' \
   -d '{
         "transaction_amount": 100,
         "token": "CARD_TOKEN",
         "description": "Blue shirt",
         "installments": 1,
         "payment_method_id": "master",
         "issuer_id": 310,
         "payer": {
           "email": "PAYER_EMAIL"
         },
         "three_d_secure_mode": "optional"
   }'
```
```php
<?php
   require_once 'vendor/autoload.php';

   MercadoPago\SDK::setAccessToken("YOUR_ACCESS_TOKEN");

   $payment = new MercadoPago\Payment();
   $payment->transaction_amount = (float)$_POST['transactionAmount'];
   $payment->token = $_POST['token'];
   $payment->description = $_POST['description'];
   $payment->installments = (int)$_POST['installments'];
   $payment->payment_method_id = $_POST['paymentMethodId'];
   $payment->issuer_id = (int)$_POST['issuer'];

   $payer = new MercadoPago\Payer();
   $payer->email = $_POST['email'];
   $payer->identification = array(
       "type" => $_POST['identificationType'],
       "number" => $_POST['identificationNumber']
   );
   $payment->payer = $payer;
   $payment->three_d_secure_mode = "optional";

   $payment->save();

   $response = array(
       'status' => $payment->status,
       'status_detail' => $payment->status_detail,
       'id' => $payment->id
   );
   echo json_encode($response);
?>
```
```node
var mercadopago = require('mercadopago');
mercadopago.configurations.setAccessToken("YOUR_ACCESS_TOKEN");

Var payment = req.body;
var payment_data = {
  transaction_amount: payment.transactionAmount,
  description: payment.description,
  token: payment.cardToken,
  installments: payment.installments,
  payment_method_id: payment.paymentMethodId,
  issuer_id: payment.issuer,
  payer: {
    email: payment.email
    identification: {
      type: payment.identificationType,
      number: payment.identificationNumber
    }
  },
  three_d_secure_mode: "optional"
};

mercadopago.payment.create(payment).then(function (data) {
  console.log(data.response);
}).catch(function (error) {
  console.log(error);
});
```
```java
PaymentClient client = new PaymentClient();

PaymentCreateRequest paymentCreateRequest =
   PaymentCreateRequest.builder()
       .transactionAmount(request.getTransactionAmount())
       .token(request.getToken())
       .description(request.getDescription())
       .installments(request.getInstallments())
       .paymentMethodId(request.getPaymentMethodId())
       .payer(
           PaymentPayerRequest.builder()
               .email(request.getPayer().getEmail())
               .firstName(request.getPayer().getFirstName())
               .identification(
                   IdentificationRequest.builder()
                       .type(request.getPayer().getIdentification().getType())
                       .number(request.getPayer().getIdentification().getNumber())
                       .build())
               .build())
       .threeDSecureMode("optional")
       .build();

client.create(paymentCreateRequest);
```
```ruby
require 'mercadopago'
sdk = Mercadopago::SDK.new('YOUR_ACCESS_TOKEN')

payment_data = {
 transaction_amount: params[:transactionAmount].to_f,
 token: params[:token],
 description: params[:description],
 installments: params[:installments].to_i,
 payment_method_id: params[:paymentMethodId],
 payer: {
   email: params[:email],
   identification: {
     type: params[:identificationType],
     number: params[:identificationNumber]
   }
 three_d_secure_mode: "optional",
 }
}

payment_response = sdk.payment.create(payment_data)
payment = payment_response[:response]

puts payment
```
```csharp
using System;
using MercadoPago.Client.Common;
using MercadoPago.Client.Payment;
using MercadoPago.Config;
using MercadoPago.Resource.Payment;

MercadoPagoConfig.AccessToken = "YOUR_ACCESS_TOKEN";

var paymentRequest = new PaymentCreateRequest
{
   TransactionAmount = decimal.Parse(Request["transactionAmount"]),
   Token = Request["token"],
   Description = Request["description"],
   Installments = int.Parse(Request["installments"]),
   PaymentMethodId = Request["paymentMethodId"],
   Payer = new PaymentPayerRequest
   {
       Email = Request["email"],
       Identification = new IdentificationRequest
       {
           Type = Request["identificationType"],
           Number = Request["identificationNumber"],
       },
   },
ThreeDSecureMode = "optional",
};

var client = new PaymentClient();
Payment payment = await client.CreateAsync(paymentRequest);

Console.WriteLine(payment.Status);

```
```python
import mercadopago
sdk = mercadopago.SDK("ACCESS_TOKEN")

payment_data = {
   "transaction_amount": float(request.POST.get("transaction_amount")),
   "token": request.POST.get("token"),
   "description": request.POST.get("description"),
   "installments": int(request.POST.get("installments")),
   "payment_method_id": request.POST.get("payment_method_id"),
   "payer": {
       "email": request.POST.get("email"),
       "identification": {
           "type": request.POST.get("type"),
           "number": request.POST.get("number")
       }
   }
   "three_d_secure_mode": "optional"
}

payment_response = sdk.payment().create(payment_data)
payment = payment_response["response"]

print(payment)
```
]]]

### Challenge

In both the success and failure flows, the Challenge, which is a screen similar to the one shown below, should be displayed within the iframe:

![Challenge](/images/api/sandbox.png)

The provided verification code is for illustrative purposes only. To complete the test flow, simply click the **Confirm** button. After completing this action, follow the detailed instructions in the **Verify Transaction Status** section to determine when the Challenge has been completed and how to check for payment updates.

repository: mercadopago/devsite-docs

branch_name: refs/heads/development

repo_name: mercadopago/devsite-docs