text:
# Pattern: API Gateway
## Context
You are building a microservices application. You need to develop multiple versions of the product details user interface:
- HTML5/JS-based UI for desktop and mobile browsers.
- Native Android & iOS clients - interact with server via REST APIs.
In addition, the application must expose REST-based API for use by 3rd party applications.

## Problem
How do the clients of a microservices-based application access the individual services?

# Forces / Constraints
- Microservices typically provide fine-grained APIs, which means that clients need to interact with multiple services to get the needed information.
- Different clients need different data.
- Network performance is different for different types of clients.
- The number of service instances and their locations (host+port) changes dynamically.
- Partitioning into services can change over time and should be hidden from clients.

## Solution
Implement an API gateway that is the single entry point for all clients. The API gateway handles requests in one of two ways. Some requests are simply proxied/routed to the appropriate service. It handles other requests by fanning out to multiple services.

Rather than provide a one-size-fits-all style API, the API gateway can expose a different API for each client. For ex, the Netflix API gateway runs client-specific adapter code that provides each client with an API that's best suited to it's requirements.

The API gateway might also implement security, e.g. verify that the client is authorized to perform the request.

## Resulting Context
**Benefits**:
- Insulates the clients from how the application is partitioned into microservices.
- Insulates the clients from the problem of determining the locations of service instances.
- Provides the optimal API for each client.
- Reduces the number of requests/roundtrips. For ex, the API gateway enables clients to retrieve data from multiple services with a single round-trip. Fewer requests also means less overhead and improves the user experience. An API gateway is essential for mobile applications.
- Simplifies the client by moving logic for calling multiple services from the client to API gateway.

**Drawbacks**:
- Increased complexity - the API gateway is yet another moving part that must be developed, deployed and managed.
- Increased response time due to the additional network hop through the API gateway - however, for most applications the cost of an extra roundtrip is insignificant.

repository: ngtuna/blog-microservices

repo_name: ngtuna/blog-microservices


text:
# Events

The LiteScene system was designed so it is fairly easy to add new features or modify the existing ones.

To accomplish this the system relies mostly in events dispatched at certains points of the execution.
This way is the user wants to intercept the execution flow and add some steps it can be done.

Events are triggered from different elements of the system:

- from the scene (```LS.GlobalScene```): when they are related to the scene (like update, start, etc)
- from the renderer (```LS.Renderer```): when they are related to the rendering
- from the resources manager (```LS.ResourcesManager```): when they are related to the loading of resources
- from the node itself (```LS.SceneNode```): when is events related to this node

This events are triggered in an specific order, it is important to understand that to be able to usem them for your needs.

## Binding Events

In case you want to bind some actions to an event you must bind the callback to that event:

```js
LEvent.bind( LS.GlobalScene, "update", my_update_callback, my_instance );
```

And to unbind:

```js
LEvent.unbind( LS.GlobalScene, "update", my_update_callback, my_instance );
```

As you can see we are passing not only the callback but also the instance as a parameter.
This is important because this way we can unbind it without problem.

Warning: Using tricks like the ```Function.prototype.bind()``` method would create a new callback every time so we wouldnt be able to unbind it from the system again. Avoid to use it when passing callbacks to events.

## Execution Events

Here is a list of events and in which order they are called.
They are all triggered from the current scene (```LS.GlobalScene```):

- "start": when the application starts after loading everything
  - *Main Loop*
    - *Rendering process*
      - "beforeRender"
      - *data is collected from the scene*
      - "afterCollectData": collect all the render data (cameras, render instances, lights)
      - "prepareMaterials": in case you want to edit material properties
      - "renderShadows": to render shadowmaps
      - "afterVisibility": in case we want to cull object according to the main camera
      - "renderReflections": to render realtime reflections to textures
      - "beforeRenderMainPass": after all things set, before we render the scene
      - "enableFrameContext" to enable the render output context
        - *For every camera*
        - "beforeRenderFrame"
        - "enableFrameContext" (on the camera) to enable the render output context
        - *Clear buffer*
        - "beforeRenderScene"
        - "beforeRenderInstances"
        - *the scene instances are rendered*
        - "renderInstances"
        - "renderScreenSpace"
        - "afterRenderInstances"
        - "afterRenderScene"
        - "afterRenderFrame"
      - "showFrameContext": show the frame in the screen
      - "renderGUI": render 2D content
      - "afterRender": after all the scene has been rendered in the screen
   - "beforeUpdate" before the update
  - "update" during the update
  - "afterUpdate"  after the update
- "finish" when the application stops (in the editor)

- "pause" if the editor pauses the execution
- "unpause" if the editor unpauses the execution

license: MIT

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive


text:
[![build-openlane-sky130](https://github.com/secworks/sha256/actions/workflows/ci.yml/badge.svg?branch=master&event=push)](https://github.com/secworks/sha256/actions/workflows/ci.yml)

# sha256 #

## Implementation status ##
The core has been completed for a long time and been used in several
designs in ASICs as well as in FPGAs. The core is considered mature and
ready for use. Minor changes are non-functional cleanups of code.

## Introduction
Hardware implementation of the SHA-256 cryptographic hash function with
support for both SHA-256 and SHA-224. The implementation is written in
Verilog 2001 compliant code. The implementation includes the main core
as well as wrappers that provides interfaces for simple integration.

This is a low area implementation that iterates over the rounds but
there is no sharing of operations such as adders.

The hardware implementation is complemented by a functional model
written in Python.

Note that the core does **NOT** implement padding of final block. The
caller is expected to handle padding.

## Implementation details ##
The sha256 design is divided into the following sections.
- src/rtl - RTL source files
- src/tb  - Testbenches for the RTL files
- src/model/python - Functional model written in python
- doc - documentation (currently not done.)
- toolruns - Where tools are supposed to be run. Includes a Makefile for
building and simulating the design using
[Icarus Verilog](http://iverilog.icarus.com/). There are also targets
for linting the core using [Verilator](http://www.veripool.org/wiki/verilator).

The actual core consists of the following files:
- sha256_core.v - The core itself with wide interfaces.
- sha256_w_mem.v - W message block memory and block expansion logic.
- sha256_k_constants.v - K constants ROM memory.

The top level entity is called sha256_core. This entity has wide
interfaces (512 bit block input, 256 bit digest). In order to make it
usable you probably want to wrap the core with a bus interface.

The provided top level wrapper, sha256.v provides a simple 32-bit memory
like interface. The core (sha256_core) will sample all data inputs when
given the init or next signal. the wrapper contains additional data
registers. This allows you to load a new block while the core is
processing the previous block.

The core supports both sha224 and sha256 modes. The default mode is
sha256. The mode bit is located in the ADDR_CTRL API register and this
means that when writing to this register to start processing a block,
care must be taken to set the mode bit to the intended mode. This means
that old code that for example simply wrote 0x01 to initiate SHA256
processing will now initiate SHA224 processing. Writing 0x05 will
now initiate SHA256 processing.

Regarding SHA224, it is up to the user to only read seven, not eight
words from the digest registers. The core will update the LSW too.

## Streaming interface ##
There is a streaming interface for the core contributed by
[Olof Kindgren](https://github.com/olofk).

- src/interfaces/stream/rtl - RTL source file for wrapped core
- src/interfaces/stream/tb - Testbench for the wrapped core

## AXI4 interface ##

**NOTE** This interface is currently being developed. Expect bugs as this
interface is still under development.

There is now an AXI4 interface for the core contributed by
[Sanjay A Menon](https://github.com/Sanjay-A-Menon). The interface wraps
sha256_core, replacing sha256.v

The interface provides an AXI4-Lite slave interface with added hash
complete interrupt signal. Chip select is implemented via axi_awprot
signal.

- src/interfaces/axi4/rtl - RTL source file for wrapped core
- src/interfaces/axi4/tb  - Testbench for the wrapped core

## FuseSoC Integration
This core is supported by the
[FuseSoC](https://github.com/olofk/fusesoc) core package manager and
build system. Some quick  FuseSoC instructions:

install FuseSoC
~~~
pip install fusesoc
~~~

Create and enter a new workspace
~~~
mkdir workspace && cd workspace
~~~

Register sha256 as a library in the workspace
~~~
fusesoc library add sha256 /path/to/sha256
~~~

...if repo is available locally or...
...to get the upstream repo
~~~
fusesoc library add sha256 https://github.com/secworks/sha256
~~~

To run lint
~~~
fusesoc run --target=lint secworks:crypto:sha256
~~~

Run tb_sha256 testbench
~~~
fusesoc run --target=tb_sha256 secworks:crypto:sha256
~~~

Run with modelsim instead of default tool (icarus)
~~~
fusesoc run --target=tb_sha256 --tool=modelsim secworks:crypto:sha256
~~~

List all targets
~~~
fusesoc core show secworks:crypto:sha256
~~~

## ASIC-results ##
Implementation in 40 nm low power standard cell process.
- Area: 14200 um2
- Combinational cells: 2344.9230
- Non-combinational cells: 2902.4856
- Clock frequency: 250 MHz

## Fpga-results ##

### Altera Cyclone FPGAs ###
Implementation results using Altera Quartus-II 13.1.

**Cyclone IV E**
- EP4CE6F17C6
- 3882 LEs
- 1813 registers
- 74 MHz
- 66 cycles latency

**Cyclone IV GX**
- EP4CGX22CF19C6
- 3773 LEs
- 1813 registers
- 76 MHz
- 66 cycles latency

**Cyclone V**
- 5CGXFC7C7F23C8
- 1469 ALMs
- 1813 registers
- 79 MHz
- 66 cycles latency

### Microchip ###

***IGLOO2***
- Tool: Libero v 12.4
- Device: M2GL090TS-1FG484I
- LUTs: 2811
- SLEs: 1900
- BRAMs: 0
- Fmax: 114 MHz

### Xilinx FPGAs ###
Implementation results using ISE 14.7.

**Spartan-6**
- xc6slx45-3csg324
- 2012 LUTs
- 688 Slices
- 1929 regs
- 70 MHz
- 66 cycles latency

**Artix-7**
- xc7a200t-3fbg484
- 2471 LUTs
- 747 Slices
- 1930 regs
- 108 MHz
- 66 cycles latency

Implementation results using Vivado 2014.4.

**Zynq-7030**
- xc7z030fbg676-1
- 2308 LUTs
- 796 Slices
- 2116 regs
- 116 MHz
- 66 cycles latency

Implementation results using Vivado v.2019.2

Results kindly provided by
[Sanjay-A-Menon](https://github.com/Sanjay-A-Menon). Implemented design
includes the AXI4 wrapper.

**Zynq-7020**
- Device: 7z020clg400-1
- Slice LUTs: 2555
- Slice regs: 2606
- Fmax: 78 MHz
- 66 cycles latency

gha_language: Verilog


text:
---
layout: page
title: Program
---

## Workshop
* Start: Monday June 4th 2018 at 09:30
* Finish: Friday June 8th 2018 at 17:00

### Pad for the workshop

[https://bit.ly/2Je8yPn](https://bit.ly/2Je8yPn)

### Projects

* Create a Binder-Ready GAP Docker image that people can use for their Binder repositories
* Try to use GAP-Jupyter on Microsoft Azure.
* Create a webpage for collecting GAP-Jupyter notebooks
* Try installing the GAP-Jupyter kernel on CoCalc and Nicolas Cloud
* Fix remainig big issues in the GAP-Juptyer kernel, make a release and deposit with GAP for 4.9.2:
    * Syntax error and Warning display
    * error handling (break loop?)
    * Info messages
    * Make sure we support the most recent Jupyter protocol
    * Support for JupyterLab
    * Installation?
    * Better errors/debugging
* Automated testing for Jupyter kernel
* Discussion on vision for teaching with Jupyter and GAP, document that outlines the next steps
* Integrating ThebeLab into GAPDoc HTML Manuals
* Converting GAPDoc into Jupyter Notebooks
* Release Francy

## Detailed Schedule

We will have a stand-up every morning at 9:30am and every afternoon at 4:30pm to lay out
the plans for the day and summarise the achievements respectively.

### Monday

* 10:00: Welcome

* 14:00: Discussion:
    * General perspectives and use cases for GAP in Jupyter
    * Projects for the week
* 16:30: Stand-Up: todays results

### Tuesday

* 09:45: Markus Pfeiffer: Introduction to the GAP-Jupyter kernel
* 11:15: Markus Pfeiffer: Installing the GAP-Jupyter kernel
* 11:45: [Sebastian Gutsche: Basic setup for Binder](https://sebasguts.github.io/GAPDaysBinderTutorial)
* 12:15: [Nicolas M. Thiéry: ThebeLab demo](https://minrk.github.io/thebelab/demo.html)

* 14:00: [Pedro A. García-Sánchez: Experiencing with Jupyter GAP]({{ site.baseurl }}/abstracts/AbstractPedro)
* 14:30: [Nusa Zidaric: FSR - Feedback Shift Registers]({{ site.baseurl}}/abstracts/AbstractNusa.pdf)

### Wednesday

* 09:30: Stand-Up: Agenda for today
* 14:00: [Discussion about use-cases for the GAP kernel](https://hackmd.io/RO7aV1gWRp-8HtL9MOJicQ)
* 16:30: Stand-Up: todays results
* 16:40: GAP Developer Meeting
* 18:00: Workshop dinner (At Forgan's St Andrews)

### Thursday

* 09:30: Stand-Up: Agenda for today
* 16:30: Stand-Up: todays results

### Friday

* 09:30: Stand-Up: Agenda for today
* 16:30: Stand-Up: todays results
* 17:00: Pub

branch_name: refs/heads/gh-pages

gha_language: CSS


text:
---
title: '@proxy'
description:
---

Defines a URL for API Gateway to forward all requests by default. Override with routes in `@http`.

## Syntax

- Stage value of either *testing*, *staging* or *production*
- URL to proxy to

## Example

The following configuration file defines a `@proxy` for production that will handle requests for routes not defined in the `@http` section.

<arc-tab-bar>

<arc-tab label="arc">

arc

```arc
@app
myapp

@http
get /v2/*
post /v2/*

@proxy
testing http://localhost:4000
staging https://qa.example.biz
production https://example.biz
```

</arc-tab>

<arc-tab label="json">

json

```json
{
  "app": "myapp",
  "http": [
    ["get", "/v2/*"],
    ["post", "/v2/*"]
  ],
  "proxy": {
    "testing": "http://localhost:4000",
    "staging": "https://qa.example.biz",
    "production": "https://example.biz"
  }
}
```

</arc-tab>

<arc-tab label="toml">

toml

```toml
app="myapp"

http=[
  ["get", "/v2/*"],
  ["post", "/v2/*"]
]

[proxy]
testing="http://localhost:4000"
staging="https://qa.example.biz"
production="https://example.biz"
```

</arc-tab>

<arc-tab label="yaml">

yaml

```yaml
app: myapp
http:
- get: "/v2/*"
- post: "/v2/*"

proxy:
  testing: http://localhost:4000
  staging: https://qa.example.biz
  production: https://example.biz
```

</arc-tab>

<arc-tab-bar>

With the above Architect file, your new app will respond to all get and post requests to `/v2/*`, and forward along requests to `/v1` to your existing API.

branch_name: refs/heads/main


text:
# CHANGELOG.md

## 2.0.0

- 2023-Jul: 2.0 released
    - Code refactoring
    - Dimension templating removed
    - Automatic dependancy handling
    - CMake find_package
    - Python Binding

## 1.0.0

* 2022-Mar: Adding the reference for the Kronecker K21-2 sampler
* 2021-Dec: Adding Kronecker K21-2 and R2 sample generators
* 2021-Aug: Adding code and documentation for Diaphony
* 2020-Nov: Cleanup in the Generalized L2 Discrepancy code
* 2020-Jan: Bugfix FFTW_INCLUDES headers
* 2020-Jan: More Jittered samplers
* 2019-Nov: Adding Matt Pharr's variant of PMJ02 (faster)
* 2019-Sep: Adding Lloyd's relaxation sampler in 3D (toroidal and non-toroidal) domains using Geogram
* 2019-Aug: Global refactoring of the website
* 2019-Jun: Adding Progressive MultiJittered Samplers (PM,PMJ, PMJ02)

repository: utk-team/utk

gha_license_id: NOASSERTION

repo_name: utk-team/utk


text:
---
breadcrumbs:
- - /blink
  - Blink (Rendering Engine)
- - /blink/launching-features
  - Launching Features
page_name: how-chrome-status-communicates
title: How Chrome Status Communicates with Web Developers
---

Chrome Status is the first level of communication with the web development
community about new web platform and related features. Its audience is not, as
many believe, exclusively Chromium engineers.

# Summary

Provide one or two complete sentences explaining the feature to web developers
followed by one or two sentences explaining either how it helps web developers
or how it improves the web platform. Do this even if it seems obvious to you.

*   Use complete sentences.
*   Exclude returns in the text. They will not be shown in some views.

Tips:

*   Omit needless words. This is from "[The Elements of
            Style](https://www.amazon.com/Elements-Style-Fourth-William-Strunk/dp/020530902X/ref=pd_bxgy_14_img_3?_encoding=UTF8&pd_rd_i=020530902X&pd_rd_r=de87e78e-8526-11e8-914f-9f4b0c666b45&pd_rd_w=mZsdS&pd_rd_wg=bq1yC&pf_rd_i=desktop-dp-sims&pf_rd_m=ATVPDKIKX0DER&pf_rd_p=3914568618330124508&pf_rd_r=KQZKKVTXAZHWAEFD7SR9&pf_rd_s=desktop-dp-sims&pf_rd_t=40701&psc=1&refRID=KQZKKVTXAZHWAEFD7SR9)".
            Most people have words in their writing that can be removed without
            affecting comprehension or meaning.
*   Do not take shortcuts at the cost of clarity. If you cut so many
            words the meaning is obscured, then you have gone too far in
            omitting needless words. This is also from "The Elements of Style."
*   If you absolutely, positively cannot describe your feature in the
            space required, continue the description in the comments box.

# Chromium Status

**Behind a flag**—Applies to one of two conditions.

*   The flag is listed in chrome://flags AND it is disabled by default.
*   The flag is listed in chrome://flags with a value of 'default' and
            is disabled by default somewhere in the compiled code.

Additionally:

*   Origin trials have their own labels.
*   This does NOT apply to Finch or test flags.

**Enabled by default**—Applies to one of three conditions.

*   There is no flag in chrome://flags because the feature is available
            to all users.
*   The flag is listed in chrome://flags AND it is enabled by default.
*   The flag is listed in chrome://flags with a value of 'default' and
            is enabled by default somewhere in the compiled code.

repository: iridium-browser/iridium-browser

repo_name: iridium-browser/iridium-browser


text:
# Apply custom styling

You might want to change the appearance of the dates in your theme. You can style the output using CSS, for example by [including extra css](https://www.mkdocs.org/user-guide/configuration/#extra_css) to your mkdocs site.

The date outputs are always wrapped in `span` elements with the classes `git-revision-date-localized-plugin` and `git-revision-date-localized-plugin-{type}` (where `{type}` is replaced with the `type` option set in the plugin).

Here's an example:

=== "mkdocs.yml"

    ```yaml
    extra_css:
        css/extra.css
    ```

=== "docs/css/extra.css"

    ```css
    .git-revision-date-localized-plugin { color: red; }
    ```


text:
The layout and flow of the menu system. If you make a change to the way the menu system works, please reflect those changes here.

### Main menu

Create game -> Player vs board -> flip board? -> choose color -> engine time limit -> Use clock? -> set up board -> start game

Create game -> player vs player -> flip board?

Create game -> board vs board -> flip board?

Load game -> Select game to load -> set up board -> continue game

Shutdown -> Are you sure?

### Pause Menu

continue game?

save game?

cancel game -> are you sure? -> back to main menu

### Menu behaviour & rules

+ (b) back button goes to previous menu in menu_stack
+ (y) yes button selects option
+ (n) no button selects false for binary-option menu; increments to next option in menu for non-binary menus
+ All binary menus should have `(y/n)` in the prompt to let the user know it is a yes/no question.


text:
---
layout: page
title: "JavaScript dechex function"
comments: true
sharing: true
footer: true
alias:
- /functions/view/dechex:382
- /functions/view/dechex
- /functions/view/382
- /functions/dechex:382
- /functions/382
---
<!-- Generated by Rakefile:build -->
A JavaScript equivalent of PHP's dechex

{% codeblock math/dechex.js lang:js https://raw.github.com/kvz/phpjs/master/functions/math/dechex.js raw on github %}
function dechex(number) {
  //  discuss at: http://phpjs.org/functions/dechex/
  // original by: Philippe Baumann
  // bugfixed by: Onno Marsman
  // improved by: http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript
  //    input by: pilus
  //   example 1: dechex(10);
  //   returns 1: 'a'
  //   example 2: dechex(47);
  //   returns 2: '2f'
  //   example 3: dechex(-1415723993);
  //   returns 3: 'ab9dc427'

  if (number < 0) {
    number = 0xFFFFFFFF + number + 1;
  }
  return parseInt(number, 10)
    .toString(16);
}
{% endcodeblock %}

 - [Raw function on GitHub](https://github.com/kvz/phpjs/blob/master/functions/math/dechex.js)

Please note that php.js uses JavaScript objects as substitutes for PHP arrays, they are
the closest match to this hashtable-like data structure.

Please also note that php.js offers community built functions and goes by the
[McDonald's Theory](https://medium.com/what-i-learned-building/9216e1c9da7d). We'll put online
functions that are far from perfect, in the hopes to spark better contributions.
Do you have one? Then please just:

 - [Edit on GitHub](https://github.com/kvz/phpjs/edit/master/functions/math/dechex.js)

### Other PHP functions in the math extension
{% render_partial _includes/custom/math.html %}

extension: markdown

gha_language: JavaScript


text:
---
layout: page
permalink: /projects/
---

Project 1: Bike Share Optimization
====================
![](/assets/bike-share.png)

**Click here to view the notebook** - In this project, we'll get to build a neural network from scratch to carry out a prediction problem on a real dataset! By building a neural network from the ground up, we'll have a much better understanding of gradient descent, backpropagation, and other concepts that are important to know before we move to higher level tools such as Tensorflow. You'll also get to see how to apply these networks to solve real prediction problems!

Project 2: Image Classification
====================
![](/assets/image-classification.png)

**Click here to view the notebook** - In this project, we'll classify images from the CIFAR-10 dataset. The dataset consists of airplanes, dogs, cats, and other objects. The dataset will need to be preprocessed, then train a convolutional neural network on all the samples. we'll normalize the images, one-hot encode the labels, build a convolutional layer, max pool layer, and fully connected layer. At the end, you'll see their predictions on the sample images.

Project 3: TV-Script-Generation
====================
![](/assets/The-Simpsons.png)

**Click here to view the notebook** - In this project, we'll generate our own Simpsons TV scripts using RNNs. we'll be using part of the Simpsons dataset of scripts from 27 seasons. The Neural Network we'll build will generate a new TV script for a scene at Moe's Tavern.

Project 4: language-translation
====================
![](/assets/translate.jpg)

**Click here to view the notebook** - In this project, we will take a peek into the realm of neural network machine translation. we’ll be training a sequence to sequence model on a dataset of English and French sentences that can translate new sentences from English to French.


text:
---
jupytext:
  text_representation:
    extension: .md
    format_name: myst
    format_version: 0.13
kernelspec:
  display_name: pymc-dev
  language: python
  name: python3
---

# Using ModelBuilder class for deploying PyMC models
:::{post} Feb 22, 2023
:tags: deployment
:category: Advanced
:author: Shashank Kirtania, Thomas Wiecki
:::

+++

## Motivation

+++

Many users face difficulty in deploying their PyMC models to production because deploying/saving/loading a user-created model is not well standardized. One of the reasons behind this is there is no direct way to save or load a model in PyMC like scikit-learn or TensorFlow. The new `ModelBuilder` class is aimed to improve this workflow by providing a scikit-learn inspired API to wrap your PyMC models.

The new `ModelBuilder` class allows users to use methods to `fit()`, `predict()`, `save()`, `load()`. Users can create any model they want, inherit the `ModelBuilder` class, and use predefined methods.

+++

Let's go through the full workflow, starting with a simple linear regression PyMC model as it's usually written. Of course, this model is just a place-holder for your own model.

```{code-cell} ipython3
import arviz as az
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pymc as pm
import xarray as xr

from numpy.random import RandomState

%config InlineBackend.figure_format = 'retina'
RANDOM_SEED = 8927

rng = np.random.default_rng(RANDOM_SEED)
az.style.use("arviz-darkgrid")
```

```{code-cell} ipython3
# Generate data
x = np.linspace(start=0, stop=1, num=100)
y = 0.3 * x + 0.5 + rng.normal(0, 1, len(x))
```

## Standard syntax
Usually a PyMC model will have this form:

```{code-cell} ipython3
with pm.Model() as model:
    # priors
    a = pm.Normal("a", mu=0, sigma=1)
    b = pm.Normal("b", mu=0, sigma=1)
    eps = pm.HalfNormal("eps", 1.0)

    # observed data
    y_model = pm.Normal("y_model", mu=a + b * x, sigma=eps, observed=y)

    # Fitting
    idata = pm.sample()
    idata.extend(pm.sample_prior_predictive())

    # posterior predict
    idata.extend(pm.sample_posterior_predictive(idata))
```

How would we deploy this model? Save the fitted model, load it on an instance, and predict? Not so simple.

`ModelBuilder` is built for this purpose. It is currently part of the  `pymc-experimental` package which we can pip install with `pip install pymc-experimental`. As the name implies, this feature is still experimental and subject to change.

+++

## Model builder class

+++

Let's import the `ModelBuilder` class.

```{code-cell} ipython3
from pymc_experimental.model_builder import ModelBuilder
```

To define our desired model we inherit from the `ModelBuilder` class. There are a couple of methods we need to define.

```{code-cell} ipython3
:tags: []

class LinearModel(ModelBuilder):
    # Give the model a name
    _model_type = "LinearModel"
    # And a version
    version = "0.1"

    def build_model(self, model_config, data=None):
        """
        build_model creates the PyMC model

        Parameters:
        model_config: dictionary
            it is a dictionary with all the parameters that we need in our model example:  a_loc, a_scale, b_loc
        data: Dict[str, Union[np.ndarray, pd.DataFrame, pd.Series]]
            Data we want our model fit on.
        """
        # Note that we do not have to define a with-context

        # Create mutable data containers
        x_data = pm.MutableData("x_data", data["input"].values)
        y_data = pm.MutableData("y_data", data["output"].values)

        # prior parameters
        a_mu_prior = model_config.get("a_mu_prior", 0.0)
        a_sigma_prior = model_config.get("a_sigma_prior", 1.0)
        b_mu_prior = model_config.get("b_mu_prior", 0.0)
        b_sigma_prior = model_config.get("b_sigma_prior", 1.0)
        eps_prior = model_config.get("eps_prior", 1.0)

        # priors
        a = pm.Normal("a", mu=a_mu_prior, sigma=a_sigma_prior)
        b = pm.Normal("b", mu=b_mu_prior, sigma=b_sigma_prior)
        eps = pm.HalfNormal("eps", eps_prior)

        obs = pm.Normal("y", mu=a + b * x_data, sigma=eps, shape=x_data.shape, observed=y_data)

    def _data_setter(self, data: pd.DataFrame):
        """
        _data_setter works as a set_data for the model and updates the data whenever we need to.
        Parameters:
        data: Dict[str, Union[np.ndarray, pd.DataFrame, pd.Series]]
            It is the data we need to update for the model.
        """

        with self.model:
            pm.set_data({"x_data": data["input"].values})
            if "output" in data.columns:
                pm.set_data({"y_data": data["output"].values})

    @classmethod
    def create_sample_input(cls):
        """
        Creates example input and parameters to test the model on.
        This is optional but useful.
        """

        x = np.linspace(start=0, stop=1, num=100)
        y = 0.3 * x + 0.5
        y = y + np.random.normal(0, 1, len(x))
        data = pd.DataFrame({"input": x, "output": y})

        model_config = {
            "a_mu_prior": 0.0,
            "a_sigma_prior": 1.0,
            "b_mu_prior": 0.0,
            "b_sigma_prior": 1.0,
            "eps_prior": 1.0,
        }

        sampler_config = {
            "draws": 1_000,
            "tune": 1_000,
            "chains": 3,
            "target_accept": 0.95,
        }

        return data, model_config, sampler_config
```

Now we can create the `LinearModel` object.

But we need some example data. This is where defining a `create_sample_input()` method as done above is useful. It gives users of your model an easy way to generate data (and configurations) to test your model on.

```{code-cell} ipython3
data, model_config, sampler_config = LinearModel.create_sample_input()
model = LinearModel(model_config, sampler_config, data)
```

After making the object of class `LinearModel` we can fit the model using the `.fit()` method.

+++

## Fitting to data

+++

The `fit()` method takes one argument `data` on which we need to fit the model. The meta-data is saved in the `InferenceData` object where also the trace is stored. These are the fields that are stored:

* `id` : This is a unique id given to a model based on model_config, sample_conifg, version, and model_type. Users can use it to check if the model matches to another model they have defined.
* `model_type` : Model type tells us what kind of model it is. This in this case it outputs **Linear Model**
* `version` : In case you want to improve on models, you can keep track of model by their version. As the version changes the unique hash in the `id` also changes.
* `sample_conifg` : It stores values of the sampler configuration set by user for this particular model.
* `model_config` : It stores values of the model configuration set by user for this particular model.

```{code-cell} ipython3
idata = model.fit()
```

## Saving model to file

+++

After fitting the model, we can probably save it to share the model as a file so one can use it again.
To `save()` or `load()`, we can quickly call methods for respective tasks with the following syntax.

```{code-cell} ipython3
:tags: []

fname = "linear_model_v1.nc"
model.save(fname)
```

This saves a file at the given path, and the name <br>
A NetCDF `.nc` file that stores the inference data of the model.

+++

## Loading a model

+++

Now if we wanted to deploy this model, or just have other people use it to predict data, they need two things:
1. the `LinearModel` class (probably in a .py file)
2. the linear_model_v1.nc file

With these, you can easily load a fitted model in a different environment (e.g. production):

```{code-cell} ipython3
model_2 = LinearModel.load(fname)
```

Note that `load()` is a class-method, we do not need to instantiate the `LinearModel` object.

```{code-cell} ipython3
type(model_2)
```

## Prediction

+++

Next we might want to predict on new data. The `predict()` method allows users to do posterior prediction with the fitted model on new data.

Our first task is to create data on which we need to predict.

```{code-cell} ipython3
x_pred = np.random.uniform(low=1, high=2, size=10)
prediction_data = pd.DataFrame({"input": x_pred})
```

`ModelBuilder` provides two methods for prediction:
1. point estimates (the mean) with `predict()`
2. full posterior prediction (samples) with `predict_posterior()`

```{code-cell} ipython3
pred_mean = model_2.predict(prediction_data)
# samples
pred_samples = model_2.predict_posterior(prediction_data)
```

After using the `predict()`, we can plot our data and see graphically how satisfactory our `LinearModel` is.

```{code-cell} ipython3
fig, ax = plt.subplots(figsize=(7, 7))
posterior = az.extract(idata, num_samples=20)
x_plot = xr.DataArray(np.linspace(1, 2, 100))
y_plot = posterior["b"] * x_plot + posterior["a"]
Line2 = ax.plot(x_plot, y_plot.transpose(), color="C1")
Line1 = ax.plot(x_pred, pred_mean["y"], "x")
ax.set(title="Posterior predictive regression lines", xlabel="x", ylabel="y")
ax.legend(
    handles=[Line1[0], Line2[0]], labels=["predicted average", "inferred regression line"], loc=0
);
```

```{code-cell} ipython3
%load_ext watermark
%watermark -n -u -v -iv -w -p pymc_experimental
```

## Authors
* Authored by Shashank Kirtania and Thomas Wiecki in 2023.

+++

:::{include} ../page_footer.md
:::

repository: pymc-devs/pymc-examples

gha_language: Python

repo_name: pymc-devs/pymc-examples


text:
# 1.0.2 (May 22, 2018)

## Bug fixes / Improvements

* [[`a6942daf3e`](https://github.com/sonarwhal/sonarwhal/commit/a6942daf3e7427b34cf81505a24adc3499708bc3)] - Docs: Fixing wrong rule name in readme (by [`Shyju`](https://github.com/kshyju)).

# 1.0.1 (May 16, 2018)

## Bug fixes / Improvements

* [[`6cde4e948c`](https://github.com/sonarwhal/sonarwhal/commit/6cde4e948cf68eb846e872309ac1fa5c5f2ea304)] - Fix: Package description (by [`Shyju`](https://github.com/kshyju) / see also: [`#1073`](https://github.com/sonarwhal/sonarwhal/issues/1073)).

# 1.0.0 (May 15, 2018)

✨

repository: Munter/sonarwhal

repo_name: Munter/sonarwhal


text:
# Xcode::Install

[![Gem Version](http://img.shields.io/gem/v/xcode-install.svg?style=flat)](http://badge.fury.io/rb/xcode-install) [![Build Status](https://github.com/xcpretty/xcode-install/actions/workflows/ci.yml/badge.svg)](https://github.com/xcpretty/xcode-install/actions)

# This project is being sunset. See the migration guide here: [MIGRATION.md](/MIGRATION.md)

Install and update your Xcodes automatically.

```
$ gem install xcode-install
$ xcversion install 6.3
```

This tool uses the [Downloads for Apple Developer](https://developer.apple.com/download/more/) page.

## Installation

```
$ gem install xcode-install
```

Note: unfortunately, XcodeInstall has a transitive dependency on a gem with native extensions and this is not really fixable at this point in time. If you are installing this on a machine without a working compiler, please use these alternative instructions instead:

```
$ curl -sL -O https://github.com/neonichu/ruby-domain_name/releases/download/v0.5.99999999/domain_name-0.5.99999999.gem
$ gem install domain_name-0.5.99999999.gem
$ gem install --conservative xcode-install
$ rm -f domain_name-0.5.99999999.gem
```

## Usage

XcodeInstall needs environment variables with your credentials to access the Apple Developer
Center, they are stored using the [credentials_manager][1] of [fastlane][2]:

```
XCODE_INSTALL_USER
XCODE_INSTALL_PASSWORD
```

### List

To list available versions:

```
$ xcversion list
6.0.1
6.1
6.1.1
6.2 (installed)
6.3
```

Already installed versions are marked with `(installed)`.
(Use `$ xcversion installed` to only list installed Xcodes with their path).

To update the list of available versions, run:

```
$ xcversion update
```

### Install

To install a certain version, simply:

```
$ xcversion install 8
###########################################################               82.1%
######################################################################## 100.0%
Please authenticate for Xcode installation...

Xcode 8
Build version 6D570
```

This will download and install that version of Xcode. Then you can start it from `/Applications` as usual.
The new version will also be automatically selected for CLI commands (see below).

#### GMs and beta versions

Note: GMs and beta versions usually have special names, e.g.

```
$ xcversion list
7 GM seed
7.1 beta
```

They have to be installed using the full name, e.g. `xcversion install '7 GM seed'`.

#### `.xcode-version`

We recommend the creation of a `.xcode-version` file to explicitly declare and store the Xcode version to be used by your CI environment as well as your team.

```
12.5
```

Read [the proposal](/XCODE_VERSION.md) of `.xcode-version`.

### Select

To see the currently selected version, run
```
$ xcversion selected
```

To select a version as active, run
```
$ xcversion select 8
```

To select a version as active and change the symlink at `/Applications/Xcode`, run
```
$ xcversion select 8 --symlink
```

### Command Line Tools

XcodeInstall can also install Xcode's Command Line Tools by calling `xcversion install-cli-tools`.

### Simulators

XcodeInstall can also manage your local simulators using the `simulators` command.

```
$ xcversion simulators
Xcode 6.4 (/Applications/Xcode-6.4.app)
iOS 7.1 Simulator (installed)
iOS 8.1 Simulator (not installed)
iOS 8.2 Simulator (not installed)
iOS 8.3 Simulator (installed)
Xcode 7.2.1 (/Applications/Xcode-7.2.1.app)
iOS 8.1 Simulator (not installed)
iOS 8.2 Simulator (not installed)
iOS 8.3 Simulator (installed)
iOS 8.4 Simulator (not installed)
iOS 9.0 Simulator (not installed)
iOS 9.1 Simulator (not installed)
tvOS 9.0 Simulator (not installed)
watchOS 2.0 Simulator (installed)
```

To install a simulator, use `--install` and the beginning of a simulator name:

```
$ xcversion simulators --install='iOS 8.4'
###########################################################               82.1%
######################################################################## 100.0%
Please authenticate to install iOS 8.4 Simulator...

Successfully installed iOS 8.4 Simulator
```

## Limitations

Unfortunately, the installation size of Xcodes downloaded will be bigger than when downloading via the Mac App Store, see [#10](/../../issues/10) and feel free to dupe the radar. 📡

XcodeInstall automatically installs additional components so that it is immediately usable from the
commandline. Unfortunately, Xcode will load third-party plugins even in that situation, which leads
to a dialog popping up. Feel free to dupe [the radar][5]. 📡

XcodeInstall normally relies on the Spotlight index to locate installed versions of Xcode. If you use it while
indexing is happening, it might show inaccurate results and it will not be able to see installed
versions on unindexed volumes.

To workaround the Spotlight limitation, XcodeInstall searches `/Applications` folder to locate Xcodes when Spotlight is disabled on the machine, or when Spotlight query for Xcode does not return any results. But it still won't work if your Xcodes are not located under `/Applications` folder.

## Thanks

Thanks to [@neonichu](https://github.com/neonichu), the original (and best) author.

[This][3] downloading script which has been used for some inspiration, also [this][4]
for doing the installation. Additionally, many thanks to everyone who has contributed to this
project, especially [@henrikhodne][6] and [@lacostej][7] for making XcodeInstall C extension free.

## Contributing

1. Fork it ( https://github.com/xcpretty/xcode-install/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

### Running tests

```
bundle exec rake spec
```

### Running code style linter

```
bundle exec rubocop -a
```

## License

This project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file.

> This project and all fastlane tools are in no way affiliated with Apple Inc or Google. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs. All fastlane tools run on your own computer or server, so your credentials or other sensitive information will never leave your own computer. You are responsible for how you use fastlane tools.

[1]: https://github.com/fastlane/fastlane/tree/master/credentials_manager#using-environment-variables
[2]: http://fastlane.tools
[3]: http://atastypixel.com/blog/resuming-adc-downloads-cos-safari-sucks/
[4]: https://github.com/magneticbear/Jenkins_Bootstrap
[5]: http://www.openradar.me/22001810
[6]: https://github.com/henrikhodne
[7]: https://github.com/lacostej

repository: xcpretty/xcode-install

gha_language: Ruby

repo_name: xcpretty/xcode-install


text:
---
layout: default
categories: phishing
title: Real estate agents targeted by Dropbox scam
date: 2021-01-05
description: Criminals deployed a Dropbox Business phishing kit to target mortgage and real estate employees. The kit achieved near-instant results.
image: /images/phish-img-3.jpg
---

### Gone phishing

Sometimes, once a phishing kit is deployed, the criminal gets near-instant returns on their lure[^1], as victims start to click links and access the landing page[^2]. But it's hard to track these instances, because it isn't like criminals will publish their metrics on a regular basis. However, there are times when a criminal makes a mistake and leaves access logs on the compromised domain, which researchers like my self ultimately discover. When we do, the insight these logs offer is immense. Today, I figured I'd post about one example.

### Setting up the attacks

On December 9, 2020, a Dropbox Business phishing kit was uploaded to a domain promoting a vlog channel on YouTube. The domain, prior to this compromise, had a neutral reputation. But at some point the week of the 9th, a malicious actor compromised the domain and installed the phishing kit.

Deployment and initial testing took place at 2:07pm EST. I know this because the first entry in the logs is just random characters for the email address and password, and the logged IP address (Vypr VPN) was the only one recorded as a VPN. The other victim details in the logs were all on business IPs or residential IPs, suggesting they were at the office or working from home at the time the lure reached them.

### The logs and kit

The logs left on the server show that it took just 33 minutes for the first victim to arrive and fall for the scam. It isn't clear what kind of lure was used, or the context behind the lure, but the data in the logs confirm that the kit was targeting mortgage brokers and real estate agents. All of the logged victims worked in this industry, and some of them attempted to access the fake Dropbox Business portal more than once. The phishing kit itself shows that the lure likely included a reference to a PDF file of some kind, as victims were redirected to a benign website hosting a random PDF once the attack concludes. Given the quickness of the attack, it's clear the criminal already had their lure and victim list ready to go.

### The landing page

This is what the landing page looked like:

![Dropbox Business phishing page.][img1]

Once the landing page loads, the kit is looking to target email addresses, passwords, phone numbers, and geographic data such as IP, country of origin, and User-Agent details. The victim first enters their email address and password in order to access the website. Once this is done, the phishing kit will start the attack cycle, and email a copy of the victim's credentials to the criminals responsible for the scam. These credentials are also logged to the server, which is how I discovered them. The victim is then asked for their phone number. If given, that too is emailed to the criminals. After the attack ends, the victim is forwarded to a basic website and a random PDF file.

The email a criminal receives will look like this:

```
-----------{ DROPBOX LOGIN }-----------
Dropbox Email<EMAIL_ADDRESS>Dropbox Pass : JohnnyPassword123!
-----------{ LOGIN INFOS}-----------
IP Address : <IP_ADDRESS>
User Agent : Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
-----------{ DROPBOX }-----------
```

A visual flow of the attack is below.

### Attack overview (visual)
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>

<div class="mermaid">
graph TD
A([Lure Dlivered])
-->|Victim Clicks Link| B{Landing Page Lodaded}
B --> |Victim Uses Login| C(Attack Starts)
C --> D(Credentials Emailed) & E(Credentials Logged to Server)
E -..-> |logs.txt| B
D & E --> F(Victim Asked for Phone Number)
F --> |Victim Shares Number| J(Phone Number Emailed)
J --> G(Attack Ends)
G --> H(Victim Forwarded to PDF)

style C fill:#80bcbf,stroke:#333,stroke-width:4px
style D fill:#bf809c,stroke:#333,stroke-width:4px
style E fill:#bf809c,stroke:#333,stroke-width:4px
style G fill:#80bcbf,stroke:#333,stroke-width:4px
style J fill:#bf809c,stroke:#333,stroke-width:4px
</div>

### Final thoughts

Targeted phishing attacks are rather common, as criminals usually tune their victim lists towards a general theme or topic, and the kits match it. In this case, the targeted victims were all business users, and the lure focused on a routine aspect of their jobs - receiving and sharing documents. Clearly, the attack worked, which is unfortunate. The domain hosting this scam is offline, but the URL is still being flagged by Google Safe Browsing.

---
[^1]: A lure is what entices the victim into accessing the included phishing link. Often this can be an alarming message sent via email or SMS, or a post on social media. The key is that the criminal has created a sense of urgency, alarm, or curiosity in the victim, thus getting them to commit to accessing the link.

[^2]: A landing page is what is displayed when a victim accesses (clicks) the phishing link within a lure.
[img1]:https://steved3.io/images/posts/dropbox_example.png

gha_language: HTML


text:
Converts string, as space separated words, to upper case.

## Arguments
[string:=""] (string): The string to convert.

## Returns
(string): Returns the upper cased string.


text:
BASSctrl
========

[![Build Status](https://jenkins.stammgruppe.eu/buildStatus/icon?job=BASSctrl/master)](https://jenkins.stammgruppe.eu/job/BASSctrl/job/master/)

Webinterface for the [geco/BASS](https://github.com/VSETH-GECO/BASS) project.

## Why
The same reasons its server project has but of course we want to provide our users with
a nice gui and not just the raw api.

To compile the typescript you want to run `ng build -prod` (requires angular-cli) or use the pre-built
version on [Jenkins](https://jenkins.stammgruppe.eu/job/BASSctrl/job/master/).

## Further help
All of this uses the angular-cli, so if any more help is needed use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

repository: VSETH-GECO/BASSctrl

gha_language: TypeScript

repo_name: VSETH-GECO/BASSctrl


text:
# CHANGES to node-pop3

## 0.6.0 (2020-08-10)

- Breaking change: Change named exports `listify` and `stream2String` to
  attach to the default export class to enable `require` to avoid `default`.
- Docs: Document CommonJS usage

## 0.5.1 (2020-07-19)

- npm: Update devDeps (and build)

## 0.5.0 (2020-07-19)

- Breaking enhancement: Add genuine Node exports

## 0.4.0 (2020-07-19)

- Breaking change: Have public RETR stringify stream
- Breaking change: Cause public UIDL to return single item if a message number
  was specified
- Enhancement: Add public methods for LIST, RSET, DELE, STAT, NOOP

## 0.3.0 (2020-07-19)

- Breaking change: Requires Node >= 6
- Enhancement: Added `timeout` option (also to binary)
- Enhancement: Re-export `listify` and `streamtoString`
- Enhancement: If `tls` is set, default port to 995
- Enhancement: Add source maps
- Enhancement: Throw `no-socket` Error in `command` if no socket left
- Enhancement (binary): Change `test` file to a genuine binary (as `pop`)
- Enhancement (binary): Support passing in `--config` file (used also in tests)
- Fix: Add `bad-server-response` error (handle obscure case where server
    doesn't follow spec or gives unknown response)
- Fix: Reject `command` early upon error
- Fix (CLI): For other commands, use `_connect` instead of `connect` to allow
  necessary authentication before practical use
- Fix (CLI): Allow boolean args at any posiiton
- Fix (CLI): Report bad alias (though ignore empty `--` arg)
- Fix (CLI) Avoid including reference to promise being uncaught in reported
  errors; catch any errors ourselves but log error to stderr
- Fix (CLI): Ensure `QUIT` in CLI usage after every other command
- Update: Avoid deprecated `new Buffer` in favor of `Buffer.from`
- Refactoring: Misc. improvements/linting
- Testing: Add Mocha + NYC testing

repository: mario-j/email-exercise

repo_name: mario-j/email-exercise


text:
[![Build Status](https://travis-ci.org/aleXOR2/pytest-pylint-xdist-vcs.svg?branch=master)](https://travis-ci.org/aleXOR2/pytest-pylint-xdist-vcs)
[![Coverage Status](https://coveralls.io/repos/github/aleXOR2/pytest-pylint-xdist-vcs/badge.svg?branch=master)](https://coveralls.io/github/aleXOR2/pytest-pylint-xdist-vcs?branch=master)
[![pypi](https://img.shields.io/pypi/l/pytest-pylint-xdist-vcs.svg)](https://pypi.python.org/pypi/pytest-pylint-xdist-vcs)
[![supported versions](https://img.shields.io/pypi/pyversions/pytest-pylint-xdist-vcs.svg)](https://pypi.python.org/pypi/pytest-pylint-xdist-vcs)

Table of Contents
=================

  * [Description](#description)
      * [Added](#added)
      * [Removed](#removed)
  * [Terminal output example](#terminal-output-example)
  * [Prerequisites](#prerequisites)
  * [Usage examples](#usage-examples)
  * [Embedding into conf files](#embedding-into-conf-files)
  * [Acknowledgements](#acknowledgements)

Description
================

Pytest Plugin for distributed linting with pylint of VCS controlled files.
This project is hypothetically can work with any pytest test parallelization plugin (pytest-parallel?) as it doesn't depend on any xdist specific design.

Differences between [pytest-pylint](https://github.com/carsongee/pytest-pylint.git) and this plug-in:

### Added

- pylint works in single job mode so that to allow parallelization with xdist
- when test result is printed into terminal (with `-v` verbose flag) it contains pylint tag `[pylint]`
- vcs mode enables linting only python files modified / added in the working copy latest revision

   If working copy not found, the linting falls back to "all files linting".

### Removed

- skipping of linted file that was already linted as it duplicates functionality of xdist (`mtimes`  cache recording)
- Python 2 and Pylint 1.x support
- `--pylint-jobs` option as multi processing managed by xdist
- display only particular error codes (option `--pylint-error-types` ) as it is already available via `.pylintrc` **Message Control** section

   See http://pylint.pycqa.org/en/latest/user_guide/message-control.html for detail

Terminal output example
=======================

Verbose output
   ```sh
   $ pytest -v --pylint -m pylint
   [gw0] [ 50%] PASSED tests/test_devices.py[pylint] <- tests/test_devices.py
   [gw0] [ 1000%] FAILED tests/test_environment.py[pylint] <- tests/test_environment.py
   ```

Non-verbose output (only filenames / modules displayed):

```sh
collected 2 items

mymodule/__init__.py[pylint] .                              [ 50%]
mymodule/test_file.py[pylint] F                             [100%]
```

Prerequisites
=============

* Linux OS
* SVN 1.8+ (for svn repo linting)
* Terminal locale set as UTF-8

   Plugin uses terminal locale and assumes that it is set as UTF-8 encoding (en_GB.utf8, pl_pl.utf8, ru_RU.utf8, etc)
* Python 3.5+

Usage examples
============

- this runs pylint for all error messages.

```bash
   py.test --pylint
```

- the same as above but utilizing all available processor cores.

```bash
   py.test --pylint --numprocesses=auto
```

- This would use the pylintrc file at /my/pyrc:

```shell
   py.test --pylint --pylint-rcfile=/my/pyrc
```

- You can restrict your test run to only perform pylint checks by typing:

```shell
    py.test --pylint -m pylint
```

If plugin runs the check of VCS working copy, then you can lint only files changed / added in the last revision

```shell
    py.test --pylint-vcs -m pylint
```

Embedding into conf files
============

You can embed this into setup.cfg:

```ini
[tool:pytest]
addopts= --pylint-vcs
```

or into tox.ini

```ini
[pytest]
addopts = --pylint-vcs
```

Acknowledgements
================

This code is a fork of
[pytest-pylint](https://github.com/carsongee/pytest-pylint.git) 0.14.0


text:
# Openshift and AWS ECR

Using AWS ECR autologin within Openshift.

[Since AWS ECR authentication tokens are valid for 12h](https://aws.amazon.com/blogs/compute/authenticating-amazon-ecr-repositories-for-docker-cli-with-credential-helper/), it's required an autologin system in order to we can pull/push docker images within our Openshift cluster.

## Ansible playbook

Openshift cluster deployments are generally based on Ansible, so it will be easy to add a new playbook.

This playbook will create a cron job in master nodes which generates or updates an specific secret and associate it to the suitable service accounts.

```bash
$ ansible-playbook [--inventory /var/lib/ansible/os-inventory] \
-e "aws_region=<aws_region> aws_access_key_id=<aws_access_key_id> aws_secret_access_key=<aws_secret_access_key>" \
aws-ecr-creds-os.yaml
```
> ``NOTE`` These values are required:  aws_region , aws_access_key_id , aws_secret_access_key


text:
---
# Documentation: https://sourcethemes.com/academic/docs/managing-content/

title: "Identification and characterization of design fires to be used in performance-based fire design of CERN facilities"
authors: [Darko Perović, Patrick Van Hees, Oriol Rios Rubiras, Saverio La Mendola]
date: 2018-06-20T11:30:40+01:00
doi: ""

# Schedule page publish date (NOT publication's date).
publishDate: 2020-02-26T13:02:51+01:00

# Publication type.
# Legend: 0 = Uncategorized; 1 = Conference paper; 2 = Journal article;
# 3 = Preprint / Working Paper; 4 = Report; 5 = Book; 6 = Book section;
# 7 = Thesis; 8 = Patent
publication_types: ["7"]

# Publication name and optional abbreviated publication name.
publication: ""
publication_short: ""

abstract: "CERN operates the most complex particle accelerator facility built until today. As such, it consists of thousands of custom-made components spread both in upper ground facilities and in underground tunnels and caverns. Several different hazards, including fire, are present in these facilities and need to be reduced to a tolerable level; in particular, fire safety often requires the application of a scientific and engineering approach. As it would be impossible addressing each tiny component individually, envelope conservative solutions have to be developed in order to save both financial and time resources.
This thesis is aimed at characterizing and better understanding of the potential fire behaviour of most common combustible items present in CERN’s facilities. After a detailed literature review of fires in electronic cabinets, an Excel calculator for obtaining a design fire in any number of cabinets/racks is developed. As literature for small vehicles in fires is scarce, suggestions on how to address the fires in vehicles used at CERN are given.
Second part of the thesis is dedicated to exploring testing techniques suitable for CERN’s needs with the goal of characterizing smoke produced by the most common cables and insulating oils used at CERN. Particle size distribution is obtained by using DMS500 fast particle analyser (Cambusiton), coupled with cone calorimeter (FTT). Data obtained on smoke particles will in future be used to validate and further improve FDS (Fire Dynamics Simulator) code in terms of addressing this issue. CERN is particularly interested in knowing the smoke particle size distribution that can be expected, as radioactive particles could be carried around, and endanger the whole facility and the surrounding environment."

# Summary. An optional shortened abstract.
summary: ""

tags: [Fire,Design fire,Vehicle fires,DMS 500,fast particulate analyser,Cone Calorimeter,Smoke characterization,Particle size distribution,Shell Diala,Midel,Cables,cable fires,Electrical cabinets,Electrical racks,CERN]
categories: []
featured: true

# Custom links (optional).
#   Uncomment and edit lines below to show custom links.
# links:
# - name: Follow
#   url: https://twitter.com
#   icon_pack: fab
#   icon: twitter

url_pdf:
url_code:
url_dataset:
url_poster:
url_project:
url_slides:
url_source: "https://lup.lub.lu.se/student-papers/search/publication/8951634"
url_video:

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: ""
  focal_point: ""
  preview_only: false

# Associated Projects (optional).
#   Associate this publication with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `internal-project` references `content/project/internal-project/index.md`.
#   Otherwise, set `projects: []`.
projects: []

# Slides (optional).
#   Associate this publication with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides: "example"` references `content/slides/example/index.md`.
#   Otherwise, set `slides: ""`.
slides: ""
---

repository: darkoperovic/academic-kickstart

repo_name: darkoperovic/academic-kickstart


text:
---
status: implemented
title: Distributed tracing for Tasks and Pipelines
creation-date: '2022-09-30'
last-updated: '2023-01-29'
authors:
- '@kmjayadeep'
---

# TEP-0124: Distributed tracing for Tasks and Pipelines

<!-- toc -->
- [Summary](#summary)
- [Motivation](#motivation)
  - [Goals](#goals)
  - [Non-Goals](#non-goals)
  - [Use Cases](#use-cases)
  - [Requirements](#requirements)
- [Proposal](#proposal)
  - [PipelineRun controller](#pipelinerun-controller)
  - [TaskRun controller](#taskrun-controller)
- [Design Details](#design-details)
  - [POC](#poc)
- [Design Evaluation](#design-evaluation)
  - [Risks and Mitigations](#risks-and-mitigations)
  - [Drawbacks](#drawbacks)
- [Alternatives](#alternatives)
- [Implementation Plan](#implementation-plan)
  - [Test Plan](#test-plan)
- [References](#references)
- [Implementation PRs](#implementation-prs)
<!-- /toc -->

## Summary

Instrument Tekton reconciler code using OpenTelemetry and Jaeger.

## Motivation

With distributed tracing, we can track the time taken by each action in the pipeline like reconciling logic, fetching resources, pulling images etc.
This allows the developers to improve the reconciliation logic and also allow end users to monitor and optimize the pipelines.

### Goals

* Implementation of opentelemetry tracing with Jaeger
* Instrumentation of pipelinerun and taskrun reconciliation logic
* Able to visualize pipeline and task reconciliation steps in jaeger

### Non-Goals

* Instrumentation of sidecars and initcontainers
* Support for more tracing backends
* Instrumentation of individual steps in each task
* Adding events to each span to indicate what is happening inside each
  method. This is an improvement task, and it can be done later once the
  basic setup for tracing is in place. The scope of this proposal is
  only to get the plumbing done by covering only the method boundaries.

### Use Cases

Pipeline and Task User:
* I would like to understand the duration of each task in my pipeline so that I can optimize the slow taks to improve the pipeline execution speed

Tekton Developer:
* I would like to understand the duration of each reconciliation step, so that I can optimize the code to improve reconciliation performance
* When the pipelines are failing due to a bug, I would like to understand which reconciliation logic caused the issue so that I can easily fix the problem

### Requirements

* Trace all functions in the PipelineRun controller
* Trace all functions in the TaskRun controller
* Support Jaeger backend
* Propagate traces so that subsequent reconciles of the same resource belong to the same trace
* Propagate traces so that reconciles of a resource owned by a parent resource belong a parent span from the parent resource
* Reconcile of different resources must belong to separate traces

## Proposal

Initialize a tracer provider with jaeger as the backend for each reconciler. The jaeger collector Base URL can be passed as an argument to the controller.

The following snippet shows how a tracing provider is initialized

```go
url := "http://jaeger-collector.jaeger:14268/api/traces"

exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url)))
if err != nil {
  return nil, err
}
tp := tracesdk.NewTracerProvider(
  tracesdk.WithBatcher(exp),
  // Record information about this application in a Resource.
  tracesdk.WithResource(resource.NewWithAttributes(
    semconv.SchemaURL,
    semconv.ServiceNameKey.String("PipelineRunReconciler"),
  )),
)
```

If jaeger collector url is not provided, the operator will continue working as before and tracing will be disabled. TracerProvider will be replaced with a no-op provider which doesn't record any spans in this case.

### PipelineRun controller
A new trace will be initialized in the pipelineRun controller when a new PipelineRun CR is created. The span context will be propogated through the reconciliation methods
to instrument the actions and steps included in the reconciliation logic. The span context will be saved back to the PipelineRun CR as an annotation `tekton/pipelinerun-span-context`. This span context can
be retrieved during the next reconciliation loop for the same CR. This way, we will have a single parent span for the entire reconciliation logic for a single PipelineRun CR. This makes it easy to visualize
the multiple reconciliation steps involved for each PipelineRun.

When a TaskRun is created by the PipelineRun reconciler, the parent span context is passed as an annotation `tekton/taskrun-span-context` so that TaskRun reconciler use the same span as its parent.

### TaskRun controller
TaskRun reconciler retrieves the parent span context propogated by PipelineRun controller. If it is not present (TaskRun is created by user in this case), a new span will be created. It will be used to
instrument the logic similar to PipelineRun controller.
The spancontext should be also made available as environment variables containers (using downward api) running the tasks. So that the task containers can continue the span if it supports it.

## Design Details

The high level flow of a trace is shown in the diagram below

![Jaeger - Design](images/0124-diagram.png "Jaeger - Design")

### POC

A POC was developed to check the feasibility of the implementation. It can be found [here](https://github.com/kmjayadeep/pipeline/tree/opentelemetry-poc)

A trace from PipelineRun looks like the screenshot below.

![Jaeger - PipelineRun](images/0124-jaeger.png "Jaeger - Pipelinerun")

## Design Evaluation

There is no change to API involved. Enabling tracing is completely optional for the end-user. If tracing is disabled or not configured with correct tracing backend URL,
the reconcilers will work as usual. Hence we can consider this as a non-breaking change.

### Risks and Mitigations

We have to make sure not to include any sensitive information as part of
the traces. The scope of this proposal is only to do the plumbing part,
but we need to consider the security aspect when reviewing PRs related
to this in the future.

### Drawbacks

The change involves adding a new attribute to `Reconciler` struct for `PipelineRun` and `TaskRun`. It is required to initialize new tracer providers per reconciler.

## Alternatives

The alternative approach is to directly use Zipkin or Jaeger SDK instead of OpenTelemetry. Using OpenTelemetry makes it easy to switch between providers, without changing the code.

## Implementation Plan

The changes are non-disruptive and doesn't involve changes to any
reconciliation logic. So a single PR is sufficient to include all the
changes mentioned in this proposal.

### Test Plan

There must be unit tests for recording of spans and e2e tests for context propogation through custom resources.

## References

* [Instrument Tekton resources for tracing](https://github.com/tektoncd/pipeline/issues/2814)
* [OpenTelemetry](https://opentelemetry.io/)
* [OpenTelemetry instrumentation in GO](https://opentelemetry.io/docs/instrumentation/go/manual/)
* [Jaeger Tracing](https://www.jaegertracing.io/)

## Implementation PRs

- [[TEP-0124] implement opentelemetry Jaeger tracing](https://github.com/tektoncd/pipeline/pull/5746)

repository: tektoncd/community

repo_name: tektoncd/community


text:
# Compile-time flags

Types, methods and generally any part of your code can be conditionally defined based on some flags available at compile time. These flags are by default read from the hosts [LLVM Target Triple](http://llvm.org/docs/LangRef.html#target-triple), split on `-`. To get the target you can execute `llvm-config --host-target`.

```bash
$ llvm-config --host-target
x86_64-unknown-linux-gnu

# so the flags are: x86_64, unknown, linux, gnu
```

Additionally, if a program is compiled with `--release`, the `release` flag will be set.

You can test these flags with the `flag?` macro method:

```crystal
{% if flag?(:x86_64) %}
  # some specific code for 64 bits platforms
{% else %}
  # some specific code for non-64 bits platforms
{% end %}
```

It returns true or false, so you can use `&&` and `||` just normally:

```crystal
{% if flag?(:linux) && flag?(:x86_64) %}
  # some specific code for linux 64 bits
{% end %}
```

These flags are generally used in C bindings to conditionally define types and functions. For example the very well known `size_t` type is defined like this in Crystal:

```crystal
lib C
  {% if flag?(:x86_64) %}
    alias SizeT = UInt64
  {% else %}
    alias SizeT = UInt32
  {% end %}
end
```

repository: crystal-tr/crystal-book

repo_name: crystal-tr/crystal-book


text:
# react-portfolio

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
## Description
My portfolio made using React
## Table of Contents

* [Installation](#installation)
* [Usage](#usage)
* [Credits](#credits)
* [License](#license)

## Features

This app is a portfolio SPA.

## Installation

Use npm install from the project src directory. Node and react are required to install.

## Contact Me

By<EMAIL_ADDRESS>or by [Github](https://github.com/leot42).

## Usage

To use run the command "npm start" within the project directory.

## License

The MIT License


text:
# Braitenberg Vehicles Genetic Algorithms Simulation of Neural Development (BraGenBrain)

Simulation suite for examining neural development in embodied cognition settings.
The algorithm is based on Genetic Algorithms and hence runs epochs comprised of many agents to find the optimal solution.

This project was started as GSoC '19 project: https://summerofcode.withgoogle.com/projects/#6182628703600640.

## Documentation

In-code documentation of the most important functions is collected in one place in `$rootdir/doc/code`.
Jupyter Notebook describing the most important features and ways to run the simulation is located
at `$rootdir/Documentation.ipynb`.

### Start

The application is a runnable `jar`. It is located in the root folder of the project under the name of `BraGenBrain-{VERSION}-XXX.jar`.
Run it in a usual `Java jar` fashion:

### More information

Scientific background of the project, as well as information about its start and planning, are available at GSoC website
as well as in Gist: .
Furthermore, see files located in `doc\adr` to see more about the technical decisions, that have been undertaken alongside
the development of simulation software.

gha_language: Kotlin


text:
Implement an algorithm that solves the [Tower of Hanoi](https://en.wikipedia.org/wiki/Tower_of_Hanoi) game.

"The game consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape.

The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:

1. Only one disk can be moved at a time.
2. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.
3. No disk may be placed on top of a smaller disk.

How will you represent the pieces of the game? Will your solution be iterative or recursive?

repository: danagilliann/Intro-to-Whiteboarding

repo_name: danagilliann/Intro-to-Whiteboarding


text:
# Audience (User) Metrics

Use this data product to peform:
 - trend analysis on all users, new vs returning users, revenue users
    - apply filter to identify granular trends, go deep in your data
    - segment trends by geo, host, campaign and more
    - segments and filters can be combined
 - Group by analysis for top-n over a period
 - Get engagement and behavioral metrics on users -
 - Get all metrics by rank (ntiles)

Ranking: This data cube has pre-computed daily ranks for users based on the following ranking dimensions:
  - "time spent" => "sd_rank_by_time_spent"
  - "session count" => "sd_rank_by_session_count"
  - "event count" => "sd_rank_by_event_count

> Trend Analysis

- Get daily, weekly, monthly trends for Unique Users, Revenue Users, New vs Returning Users
- Add moving average to understand long-term trends and deviations from the norm
- Analyze new vs returning users trend - determine what percent of users are return users

```
Example: Daily Trend Of Revenue Users With 7 DMA
Users.trend(sqlContext, 30,  movingAverage=Some(7), includeRevenueUsersTrend=true, includeUsersTrend=false)

Example: Revenue Users Breakdown By New And Returning Users
Users.trend(sqlContext, 30, includeNewUsersTrend=true, includeReturningUsersTrend=true, includeUsersTrend=false, filterOn=Some("sd_is_revenue_user"), filterVal=Some(1))
```

> Segmentation And Filtering

- Supply any dimension for segmentation and use the threshold value to limit the output records
- Find trend for a specific segment (for example - revenue users when country is United States or browser is chrome)
- Supply segment name and segment value to filter trends
- To get filter values, run a SQL query

```
Example: Weekly Revenue Users By Campaign (Period - 4 Weeks)
Users.trend(sqlContext, 4, periodType="weekly", segmentBy=Some("campaign_name"), includeRevenueUsersTrend=true, includeUsersTrend=false, topNSegments=5)
```

> Top N (Grouping)

- Over the last month, which cities users come from?
- What browsers paid users like to use?
- Top 10 hosts for new users
- Apply sorting and filtering

```
Example: Top 10 Sources For New And Revenue Users
Users.segment(sqlContext, 15, colList=Seq("sd_is_new_user", "sd_is_revenue_user"), segmentBy=Some("sd_source"), topNSegments=10)
```

> User Engagement Metrics

- Engagements are defined as the key activites users performed with any of the digital assets - web, mobile app or a social interaction:
    - amount of time user spent
    - number of key events fired during the engagment and
    - number of sessions user opened to engage.
- Get enagement metrics for top ranked users, paid users or apply any other filters.

![Image](img/UEM.png?raw=true)

> User Behavior Metrics (UBM)

- Behavior is defined as the actions perforemd while engaging with any of the digital assets - web, mobile app or a social interaction. Examples include:
    - opend a video,
    - read a review,
    - added item to the cart or
    - checked out / purchased an item.
- Get behavior metrics for top ranked users, paid users or apply any other filters
![Image](img/UBM.png?raw=true)

> Extend Analysis Using SQL, Scala Or Python

Flexibility to run Spark SQL and write Scala / Python code against a Spark cluster
- Cube is avaialble to you as dataframe in Scala and as a temporary table in the cluster for SQL access
- Run SQL queries directly against the curated data
- Write your own scala or python code and execute against the spark cluster

```
Run Spark And HIVE SQL
%sql
---desc sd_user_metricsII
--select sd_year, sd_month, sd_day, count(distinct user_id), sum(sd_is_revenue_user), sum(sd_is_new_user) from sd_user_metricsII where dateIsAfterOrEqual(dateTimeFromEpoch(`sd_first_seen_at`),dateTimeFromEpoch(1439510400000)) group by sd_year, sd_month, sd_day
---select concat(sd_year, '-', sd_month, '-', sd_day) as date , count(sd_is_new_user) as all_users from sd_user_metricsII where sd_country_name='United States' group by sd_year, sd_month, sd_day
--- Users, New and Returning
select sd_year, sd_month, sd_day, count(distinct user_id), sum(sd_is_new_user) as nu, sum(CASE when sd_is_new_user=0 then 1 else 0 end) as ru  from sd_user_metricsII group by sd_year, sd_month, sd_day
---select concat(sd_year, '-', sd_month, '-', sd_day) as dimension , count(distinct user_id) as all_users, ROUND(AVG(count(distinct user_id)) OVER(ORDER BY sd_year, sd_month, sd_day ROWS BETWEEN 6 PRECEDING AND CURRENT ROW),2) as moving_average  from sd_user_metricsII where intervalContainsDateTime(intervalFromStr("2015-07-29T00:00:00.000Z/2015-08-06T00:00:00.000Z"),dateTime(`utc_time`)) group by sd_year, sd_month, sd_day
```

```
Scala

import com.github.nscala_time.time.Imports._

import org.apache.spark.sql._
import org.apache.spark.sql.catalyst.analysis.UnresolvedFunction
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.dsl.expressions._

import org.sparklinedata.spark.dateTime.dsl.expressions._
import org.sparklinedata.spark.dateTime.dsl._

// Get engagement metrics for the past 7 days using SQL against a temp table
val inAnalysisPeriodExpr = Users.getPeriodExpr(Users.dateExpr, Users.currentDate, 7)
/*
val inAnalysisPeriodExpr = Users.getPeriodExpr(Users.dateExpr, Users.currentDate, 7)
val sqlSt = date"select concat(sd_year, '-', sd_month, '-', sd_day) as date, round(avg(sd_session_count),2) as average_sessions, round(avg(sd_event_count),2) as average_events, abs(round(avg(sd_time_spent)/1000,2)) as average_time_spent from sd_user_metricsII where $inAnalysisPeriodExpr group by sd_year, sd_month, sd_day"
val sqlResults = sql(sqlSt)
//println(sqlResults.queryExecution.logical)
sqlResults.take(20).foreach(println)
*/

// new vs returning users using spark dataframe functions
/*
val userColExpr =  org.apache.spark.sql.functions.count(new Column("user_id")).alias("Users")
val newUserColExpr =  org.apache.spark.sql.functions.sum(new Column("sd_is_new_user")).alias("New User")
val retUserColExpr = org.apache.spark.sql.functions.sum(org.apache.spark.sql.functions.when(new Column("sd_is_new_user").equalTo(0), 1).otherwise(0)).alias("Returning User")
Users.userMetricsDF.get.groupBy("sd_year", "sd_month", "sd_day").agg(userColExpr, newUserColExpr, retUserColExpr).show()
*/

// using spark expresssion, get time-spent metrics
val expr =  org.apache.spark.sql.catalyst.analysis.UnresolvedFunction("round", Seq(
      org.apache.spark.sql.catalyst.expressions.Abs(
        org.apache.spark.sql.catalyst.expressions.Average(
          org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute("sd_time_spent")
        )
      ),
    Literal(2)))
Users.userMetricsDF.get.where(new Column(inAnalysisPeriodExpr).as("TimeSpent")).groupBy("sd_year", "sd_month", "sd_day").agg(new Column(expr)).show()
```

repository: cubefyre/audience-behavior-apis

gha_language: Scala

repo_name: cubefyre/audience-behavior-apis


text:
---
tag:
- teams
- org
- security
- sso
title: Setting up Idaptive SAML SSO for Bitrise
redirect_from: []
summary: ''
menu:
  organizations:
    weight: 25

---
This guide provides step-by-step instructions on setting up Bitrise as a SAML application on [Idaptive](https://www.idaptive.com/ "https://www.idaptive.com/").

{% include message_box.html type="important" title="SAML SSO with Velocity and Enterprise Build plan" content="Please note that SAML SSO is only available for a Workspace with the [Enterprise Build and Velocity plans](https://www.bitrise.io/pricing).

Since the SAML SSO feature is tied to the above plans, if you decide to downgrade, you will lose this feature. All Workspace members will receive an email about the downgrade and you’ll have two weeks to re-upgrade if you wish to use SAML SSO in your Workspace again.

"%}

## Before you start

* As with other [Workspace management actions](/team-management/organizations/members-organizations/), only the Workspace owner can set up SAML SSO to a Workspace on Bitrise.
* You must be logged into your Admin Portal on [Idaptive](https://www.idaptive.com/) to set up Bitrise as a SAML SSO app and establish the connection between Bitrise and Idaptive. If you are using the **User Portal**, **Switch to** **Admin Portal** by clicking your avatar on Idaptive.

![{{ page.title }}](/img/step1.jpg)

* Your account on Bitrise has a Workspace with the [Velocity plan or Enterprise Build plans](https://www.bitrise.io/pricing). If it doesn’t have a Workspace, go ahead and [create one](/team-management/organizations/creating-org/). Setting up SAML SSO is the same for existing and brand new Workspaces on Bitrise.

## Navigating to the Single Sign-On page of Bitrise

If you are a Workspace owner on Bitrise, you will have to use the **Single Sign-On** tab to set up a SAML SSO connection between your SAML SSO provider and your Bitrise Workspace.

1. On your Bitrise [Dashboard](https://app.bitrise.io/dashboard/builds) click your avatar, then click [**Profile settings**](https://app.bitrise.io/me/profile#/overview) in the dropdown. ![Account selector dropdown](/img/account-settings-dropdown.png)
2. The **Overview** page displays all the Workspaces you’re a member of. Select the Workspace where you wish to set up the SAML SSO connection.![](/img/overview-tab.jpg)
3. On the left menu bar, click the **Single Sign-On** which will take you to the **Enable Single Sign-On** page.![](/img/enablesinglesignon.jpg)
4. Continue with [Getting configuration information from Idaptive](/team-management/organizations/setting-up-idaptive-saml-sso-for-bitrise/#getting-configuration-information-from-idaptive).

## Getting configuration information from Idaptive

 1. Log into Idaptive as an Admin.
 2. Go to **Apps,** then to **Web Apps**. Click the **Add Web Apps** button on the right.![{{ page.title }}](/img/step2.png)
 3. On the **Custom** tab and select **SAML**, and click **Add**. On the **Add Web App** popup hit **Yes**. **Close** the window. You will be automatically directed to the **Settings** page.

    ![{{ page.title }}](/img/step3.png)
 4. Add Bitrise to the **Name** and **Application ID** fields on the **Settings** page and click **Save**.

    ![{{ page.title }}](/img/step-name.jpg)

    ![{{ page.title }}](/img/step4b.jpg)
 5. Click **Trust** on the left menu bar and select the **Manual configuration** under **Identity Provider Configuration**.
 6. Click the **Signing Certificate** dropdown and download the certificate. Open it with a text editor so that you can copy the full content of the certificate. You can also upload the file.

    ![{{ page.title }}](/img/download.jpg)
 7. Insert the content or upload the file itself in the **SAML SSO provider certificate** text box on the **Enable Single Sign-On** page of Bitrise.
 8. Copy the **Single Sign On URL** from the **Trust** page of Idaptive. Insert it on the **SAML SSO provider Single Sing-On URL (SSO URL)** field on the **Enable Single Sign-On** page of Bitrise.
 9. While on the **Single Sign-On page** of Bitrise, copy the **Assertion Consumer Service URL (ACS URL)** URL and click **Configure SSO**.
10. Now let’s head back to Idaptive! Under **Service Provider Configuration** click **Manual Configuration**. Type **Bitrise** in the **SP Entity ID / Issuer / Audience** and paste the **Assertion Consumer Service URL (ACS URL)** from Bitrise to the **Assertion Consumer Service (ACS) URL** on Idaptive.

    ![{{ page.title }}](/img/manual-config.jpg)
11. Scroll down to **NameID Format** and select **emailAddress**. Click **Save**.

    ![{{ page.title }}](/img/name-id.jpg)
12. Go to **Permissions** and click the **Add** button. In the **Select User, Group, or Role** popup, type the user name you want to add to the SAML app. Select it and hit **Add**. Save your changes. This will change the status of your Bitrise SAML app to **Deployed**.

    ![{{ page.title }}](/img/step10.png)
13. Continue with [Authorizing SAML SSO](/team-management/organizations/setting-up-idaptive-saml-sso-for-bitrise/#authorizing-saml-sso).

## Authorizing SAML SSO

Now that the Workspace owner has set up SAML SSO, everyone in the Workspacehas to authorize SAML SSO before logging in to their Workspace via SAML SSO.

1. Make sure you’re logged into Bitrise in the usual way. Use the same browser window to continue.
2. Bitrise sends a verification e-mail to all Workspace members. By clicking the **Log In via SAML SSO** button or using the provided URL, Workspace members can authorize themselves for SAML SSO login. The email also shows the Workspace owner’s email address (in case you would need to contact them.) Click the **Log In via SAML SSO** button or copy-paste the URL to a NEW TAB of the same browser.![](/img/email-samlssso.jpg)
3. You’re directed to Bitrise to **Allow “Workspace name” to sign you in** page.
   * Click **Authorize** if you trust the Workspace to control your Bitrise account sign-in process.
     If you’re already logged in Idaptive, you’ll be automatically taken to your Bitrise Dashboard.
     If you’re not, you’ll be prompted to log into Idaptive, and then taken to your Bitrise Dashboard.
   * Click **Don’t Allow** if the invitation email is from an untrusted source.

     ![SAML SSO in Workspaces](https://devcenter.bitrise.io/img/enable-saml.jpg)

     Note that if you are using a different non-matching email address, you will get the below error message. Make sure you log in with the right email address both on Bitrise, as well as on your SSO provider site.![](/img/noconnectedsamlsso.png)

If all went well, you should be landing on our Bitrise Dashboard.

## What's next?

Learn how you can:

* [Check out Workspace member’s SAML SSO statuses](/team-management/organizations/saml-sso-in-organizations/#checking-saml-sso-statuses-on-bitrise) once the connection is up.
* [Invite new members with SAML SSO.](/team-management/organizations/saml-sso-in-organizations/#inviting-new-workspace-members-with-saml-sso)
* [Enforce SAML SSO login](/team-management/organizations/saml-sso-in-organizations/#enforcing-saml-sso-on-a-workspace) to the Workspace once all Workspace members have authorized their SAML SSO connection to the Workspace.
* [Log into your Workspace](/team-management/organizations/saml-sso-in-organizations/#logging-in-via-saml-sso-with-a-bitrise-account) now that SAML SSO is set up.
* [Disable SAML SSO on a Workspace](/team-management/organizations/saml-sso-in-organizations/#disabling-a-workspaces-saml-sso).

repository: Vinkumaray/devcenter

repo_name: Vinkumaray/devcenter


text:
# Usage

Install the required plugins:

```bash
vagrant plugin install vagrant-windows-update
vagrant plugin install vagrant-reload
```

Then launch the environment:

```bash
vagrant up
```


text:
# iyzipay-node

[![NPM version](https://img.shields.io/npm/v/iyzipay.svg)](https://www.npmjs.com/package/iyzipay)

You can sign up for an iyzico account at [https://iyzico.com](https://iyzico.com)

# Requirements

Node.js v0.10.0 or later

# Installation

`npm install iyzipay`

# Usage

### Initialization

```js
var Iyzipay = require('iyzipay');

var iyzipay = new Iyzipay({
    apiKey: 'your api key',
    secretKey: 'your secret key',
    uri: 'https://sandbox-api.iyzipay.com'
});
```

As you can see, credentials information provided while creating new instance of Iyzipay class.
If you do not provide iyzipay credentials, default values will be fetched from environment variables
by following names.

```js
   IYZIPAY_URI
   IYZIPAY_API_KEY
   IYZIPAY_SECRET_KEY
```

In other words, you can initialize Iyzipay object like following:

```js
var iyzipay = new Iyzipay();
```

### Sample Usage

```js
var Iyzipay = require('iyzipay');

var iyzipay = new Iyzipay({
    apiKey: 'your api key',
    secretKey: 'your secret key',
    uri: 'https://sandbox-api.iyzipay.com'
});

var request = {
    locale: Iyzipay.LOCALE.TR,
    conversationId: '123456789',
    price: '1',
    paidPrice: '1.2',
    currency: Iyzipay.CURRENCY.TRY,
    installment: '1',
    basketId: 'B67832',
    paymentChannel: Iyzipay.PAYMENT_CHANNEL.WEB,
    paymentGroup: Iyzipay.PAYMENT_GROUP.PRODUCT,
    paymentCard: {
        cardHolderName: 'John Doe',
        cardNumber: '5528790000000008',
        expireMonth: '12',
        expireYear: '2030',
        cvc: '123',
        registerCard: '0'
    },
    buyer: {
        id: 'BY789',
        name: 'John',
        surname: 'Doe',
        gsmNumber: '+905350000000',
        email<EMAIL_ADDRESS>        identityNumber: '74300864791',
        lastLoginDate: '2015-10-05 12:43:35',
        registrationDate: '2013-04-21 15:12:09',
        registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
        ip: '<IP_ADDRESS>',
        city: 'Istanbul',
        country: 'Turkey',
        zipCode: '34732'
    },
    shippingAddress: {
        contactName: 'Jane Doe',
        city: 'Istanbul',
        country: 'Turkey',
        address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
        zipCode: '34742'
    },
    billingAddress: {
        contactName: 'Jane Doe',
        city: 'Istanbul',
        country: 'Turkey',
        address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
        zipCode: '34742'
    },
    basketItems: [
        {
            id: 'BI101',
            name: 'Binocular',
            category1: 'Collectibles',
            category2: 'Accessories',
            itemType: Iyzipay.BASKET_ITEM_TYPE.PHYSICAL,
            price: '0.3'
        },
        {
            id: 'BI102',
            name: 'Game code',
            category1: 'Game',
            category2: 'Online Game Items',
            itemType: Iyzipay.BASKET_ITEM_TYPE.VIRTUAL,
            price: '0.5'
        },
        {
            id: 'BI103',
            name: 'Usb',
            category1: 'Electronics',
            category2: 'Usb / Cable',
            itemType: Iyzipay.BASKET_ITEM_TYPE.PHYSICAL,
            price: '0.2'
        }
    ]
};

iyzipay.payment.create(request, function (err, result) {
    console.log(err, result);
    done();
});
```

You can see further examples in `test/samples` folder, and run them by `npm run-script samples`

### Mock test cards

Test cards that can be used to simulate a *successful* payment:

Card Number      | Bank                       | Card Type
-----------      | ----                       | ---------
5890040000000016 | Akbank                     | Master Card (Debit)
5526080000000006 | Akbank                     | Master Card (Credit)
4766620000000001 | Denizbank                  | Visa (Debit)
4603450000000000 | Denizbank                  | Visa (Credit)
4729150000000005 | Denizbank Bonus            | Visa (Credit)
4987490000000002 | Finansbank                 | Visa (Debit)
5311570000000005 | Finansbank                 | Master Card (Credit)
9792020000000001 | Finansbank                 | Troy (Debit)
9792030000000000 | Finansbank                 | Troy (Credit)
5170410000000004 | Garanti Bankası            | Master Card (Debit)
5400360000000003 | Garanti Bankası            | Master Card (Credit)
374427000000003  | Garanti Bankası            | American Express
4475050000000003 | Halkbank                   | Visa (Debit)
5528790000000008 | Halkbank                   | Master Card (Credit)
4059030000000009 | HSBC Bank                  | Visa (Debit)
5504720000000003 | HSBC Bank                  | Master Card (Credit)
5892830000000000 | Türkiye İş Bankası         | Master Card (Debit)
4543590000000006 | Türkiye İş Bankası         | Visa (Credit)
4910050000000006 | Vakıfbank                  | Visa (Debit)
4157920000000002 | Vakıfbank                  | Visa (Credit)
5168880000000002 | Yapı ve Kredi Bankası      | Master Card (Debit)
5451030000000000 | Yapı ve Kredi Bankası      | Master Card (Credit)

*Cross border* test cards:

Card Number      | Country
-----------      | -------
4054180000000007 | Non-Turkish (Debit)
5400010000000004 | Non-Turkish (Credit)

Test cards to get specific *error* codes:

Card Number       | Description
-----------       | -----------
5406670000000009  | Success but cannot be cancelled, refund or post auth
4111111111111129  | Not sufficient funds
4129111111111111  | Do not honour
4128111111111112  | Invalid transaction
4127111111111113  | Lost card
4126111111111114  | Stolen card
4125111111111115  | Expired card
4124111111111116  | Invalid cvc2
4123111111111117  | Not permitted to card holder
4122111111111118  | Not permitted to terminal
4121111111111119  | Fraud suspect
4120111111111110  | Pickup card
4130111111111118  | General error
4131111111111117  | Success but mdStatus is 0
4141111111111115  | Success but mdStatus is 4
4151111111111112  | 3dsecure initialize failed

### Mock APM Accounts

Mock APM Accounts that can be used to simulate a payment with alternative payment method:

Account Holder Name     | Description
-------------------     | -----------
success                 | Succeeded payment after succeeded initialize
fail-after-init         | Failed payment after succeeded initialize
error                   | Failed initialize

# Testing

You need to have [mocha](https://mochajs.org/) installed on your machine in order to run tests.

`npm test`

# Author

Originally by [Huseyin Babal](https://github.com/huseyinbabal) (huseyinbabal88@gmail.com). Now officially maintained by iyzico.

repository: iyzico/iyzipay-node

repo_name: iyzico/iyzipay-node


text:
# TD-W8970
Python library for scraping ADSL connection statistics from TD-W8970 router.

# Installation
`pip install TDW8970`

# Create router object
```python
router = router.Router(username="admin", password="admin")
```
You need to specify:
* Username - your router login (default: admin)
* Password - your router password (default: admin)
* Host - default gateway (default: <IP_ADDRESS>)

# Get data
```python
stats = router.get(timeout=60)
```

You may specify:
* Timeout - in sec (default: 10s)

You may retrieve
* status_code - http status code (200 == OK)
* downstreamCurrRate
* downstreamMaxRate
* upstreamCurrRate
* upstreamMaxRate
* downstreamNoiseMargin
* downstreamAttenuation
* upstreamNoiseMargin
* upstreamAttenuation
* downstreamPower
* upstreamPower


text:
---
type: rule
archivedreason:
title: Do you do a quick test after the TFS 2015 migration finishes?
guid: e23eb370-ccf0-41a7-b795-b52875370898
uri: do-a-quick-test-after-the-upgrade-finishes-tfs2015-migration
created: 2015-08-14T11:31:19.0000000Z
authors:
  - title: Adam Cogan
    url: https://ssw.com.au/people/adam-cogan
related: []
redirects:
- do-you-do-a-quick-test-after-the-upgrade-finishes1

---

After upgrading TFS, you should do a quick [smoke test](http://en.wikipedia.org/wiki/Smoke_testing) to ensure TFS is running as expected.

<!--endintro-->

![Figure: New TFS Title using our existing url](tfs title.png)

1. Navigate to the web access URL for your new TFS server.
2. If it loads correctly, click "Browse all..." to check all your Team Projects were migrated across correctly

In Visual Studio, connect to TFS, then:

3. Do a Get Latest on a project or file
4. Make a change, and ensure you can Check In

gha_language: TSQL


text:
# Disaster-Response-Dashboard
This dashboard has a Machin learning pipeline in background, which analyses a data set of massages and their categories to train and based on this training it can predict the categories for a new massage and display it in the dashboard
### Table of Contents

1. [Installation](#installation)
2. [Project Motivation](#motivation)
3. [File Descriptions](#files)
4. [Results](#results)
5. [Licensing, Authors, and Acknowledgements](#licensing)

## Installation
Stack overflow trend requires:
- Python (>= 3.6)
- the following libraries are needed to run the code:
    - numpy
    - pandas
    - matplotlib
    - seaborn
    - nltk
    - re
    - sklearn (>= 0.20)
    - plotly
    - json
    - flask
## Project Motivation
being able to reliably distinguish the disasters in the emergency and its category is vital to able to properly help the people on time. To be able to do this, is simple but efficient dashboard designed, which is able to be fed with the massage and it gives the categories.

## File Descriptions
This project consists of three main parts:
-	ETL Pipeline:

    This pipeline performs the Extract, Transform, and Load process to prepare the learning data as clean input for the Machine learning process. This data will be saved in a       [SQLite database](https://github.com/mrf919/Disaster-Response-Dashboard/blob/main/data/DisasterResponse.db). This pipeline can be found in [process_data.py](https://github.com/mrf919/Disaster-Response-Dashboard/blob/main/data/process_data.py).
    To perform this task, there are two .csv data needed. The [disaster_categories.csv](https://github.com/mrf919/Disaster-Response-Dashboard/blob/main/data/disaster_categories.csv) and [disaster_messages](https://github.com/mrf919/Disaster-Response-Dashboard/blob/main/data/disaster_messages.csv) which can be replaced with the .csv data having the same format and including similar infomation.

-	ML Pipeline:

    Using the NLTK method and multi-output classification, this pipeline uses the massages to predict their categories. This pipeline can be found in [train_classifier.py](https://github.com/mrf919/Disaster-Response-Dashboard/blob/main/models/train_classifier.py).

-	Flask Web app:

    The flask web app provides the web-based user interface which is connected with the database and pipelines and generate the visualisations. The [master.html](https://github.com/mrf919/Disaster-Response-Dashboard/blob/main/app/templates/master.html) includes the HTML format of the webpage and [go.html](https://github.com/mrf919/Disaster-Response-Dashboard/blob/main/app/templates/go.html) highlights the gategories regarding the searched massege.

## instruction
to run this project, the follosing commands should be executed in the project root directory (please be sure to update the sklearn):

1-  Runing the ETL pipeline:

    python data/process_data.py [messages_filepath] [categories_filepath] [database_filepath]

   [messages_filepath] is the path to the .csv data which contains the "disaster_messages"

   [categories_filepath] is the path to the .csv data which contains the "disaster_categories"

   [database_filepath] is the path to the .db data which contains the which is going to stor the data

2- Runing the ML pipeline:

    python models/train_classifier.py [database_filepath] models/classifier.pkl

   [database_filepath] is again the same path to the .db data which contains the which is going to store the data

3- Starting the web app

    python app/run.py [database_filepath]

   [database_filepath] is again the same path to the .db data which contains the which is going to store the data

4- The connection link:

    env|grep WORK

   (in a new Terminal)

the connection link consists of

    https://SPACEID-3001.SPACEDOMAIN

## Licensing, Authors, Acknowledgements
The findings and the results of the code is available [here](https://www.kaggle.com/haakakak/stack-overflow-developer-surveys-20152020)


text:
# Xerotus belangeri (Mont.) Lloyd, 1923 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycol. Writ. 7: 1227 (1923)

#### Original name
Agaricus belangeri Mont., 1834

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Mycenaceae/Panellus/Panellus belangeri/ Syn. Xerotus belangeri/README.md

repo_name: mdoering/backbone