text:
# colorlabels

[![PyPI - Downloads](https://pepy.tech/badge/colorlabels)](https://pepy.tech/count/colorlabels)
[![PyPI - Version](https://img.shields.io/pypi/v/colorlabels.svg)](https://pypi.org/project/colorlabels)
[![PyPI - Format](https://img.shields.io/pypi/format/colorlabels.svg)](https://pypi.org/project/colorlabels)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/colorlabels.svg)](https://pypi.org/project/colorlabels)
[![PyPI - Status](https://img.shields.io/pypi/status/colorlabels.svg)](https://pypi.org/project/colorlabels)
![License](https://img.shields.io/github/license/gousaiyang/colorlabels.svg)

`colorlabels` is a console message display library for Python. Equipped with various kinds of colorful and semantic labels, it is tailored for message display and interaction in automated scripts (e.g. test scripts, installation scripts and hacker tools).

## Demo

```python
import time

import colorlabels as cl

cl.section('Overview of Labels')
cl.success('Good job! All test cases passed!')
cl.warning('Warning! Security update delayed!')
cl.error('Error! Failed to write file!')
cl.info('Server listening on port 8888.')
cl.progress('Downloading package, please wait...')
cl.plain('Nothing interesting.')
choice = cl.question('A new version is present, would you like to update? (Y/N)')

with cl.progress('Downloading...', mode=cl.PROGRESS_SPIN):
    time.sleep(3)

with cl.progress('Downloading ', mode=cl.PROGRESS_DETERMINATE) as p:
    time.sleep(1)
    p.update(0.5, ' 50% (2.5MB/5MB) ETA 1s')
    time.sleep(1)
    p.update(1, ' 100% (5MB/5MB)')
```

## Features

- Various kinds of labels and progress animations. Colorful and semantic.
- Easy to use.
- Customizable.
- Compatible.
  - Works on Unix-like Systems & Windows. (Based on [colorama](https://github.com/tartley/colorama))
  - Works on both Python 2 & 3 (Python 2 may not work well with unicode).

## Installation

Install with pip: `pip install -U colorlabels`

## Documentation

### Concepts

`colorlabels` mimics the famous [Bootstrap](https://getbootstrap.com/) library in Web front-end developing, providing a number of components (called **labels**) to facilitate message display and interaction in automated scripts.

#### Option Layering

In `colorlabels`, most of the configurable options are organized in three layers:

- Default settings
- Runtime global settings (using the module-level function `config()`, apply to the whole running process)
- Per-call settings (setting parameters when calling label printing functions, only apply to this function call)

Runtime global settings can override default settings, and per-call settings can override runtime global settings and default settings.

#### Label

A **label** is a line of message composed of a **header** and its **content**. A header is a **mark** with a pair of brackets.

Here is an anatomy of a label:

When using `colorlabels`, you will be able to customize a label's mark and color settings. However, the default settings should already look nice under most operating systems and terminals with a dark background.

`colorlabels` provides the following kinds of labels with semantic names: `section`, `item`, `success`, `warning`, `error`, `info`, `progress`, `plain`, `question`, `input` and `password`. The `section`, `item`, `success`, `warning`, `error`, `info` and `plain` labels print a message to the console. The `progress` label can alternatively display some animation. The `question`, `input` and `password` labels prompt for user input. Behaviors of all the labels can be demonstrated by running `demo.py`.

#### Mark and Color

**Marks** and **colors** are carefully selected to visually symbolize the semantic meaning of a label, which makes labels pretty and easy for visual grepping.

A mark is a non-empty string to be enclosed in a pair of brackets to comprise a header. By default all marks for labels are composed of only one character, but you can customize them to contain more than one character, or even emojis if you wish to.

If you prefer labels without headers, you can set the `show_header` option to `False` to remove them.

A color is an [ANSI escape sequence](https://en.wikipedia.org/wiki/ANSI_escape_code) representing color in terminal. `colorlabels` utilizes [`colorama`](https://github.com/tartley/colorama) to achieve cross-platform color printing compatibility. By default all colors for labels only contain the classic and ubiquitous 16 colors (code 30-37, 90-97), but you can customize them to include 8-bit colors and 24-bit colors if you wish to.

The **color_span** option specifies the range that color covers in a label. There are four values for `color_span`:

- 0: does not color any part of the label
- 1: colors only the mark
- 2: colors only the header
- 3: colors the whole label (default)

The default marks and colors for different kinds of labels are as follows:

| Label Type | Default Mark |    Default Color    |
|:----------:|:------------:|:-------------------:|
| `section`  |     `#`      | Bright Magenta (95) |
|   `item`   |     `*`      |      No Color       |
| `success`  |     `+`      |  Bright Green (92)  |
| `warning`  |     `!`      | Bright Yellow (93)  |
|  `error`   |     `-`      |   Bright Red (91)   |
|   `info`   |     `i`      |  Bright Cyan (96)   |
| `progress` |     `=`      |  Bright Cyan (96)   |
|  `plain`   |     `*`      |      No Color       |
| `question` |     `?`      |  Bright Cyan (96)   |
|  `input`   |     `>`      |  Bright Cyan (96)   |
| `password` |     `>`      |  Bright Cyan (96)   |

#### The Progress Label

The progress label supports different modes:

|     Progress Mode      |      Animation       | Determinate |
|:----------------------:|:--------------------:|:-----------:|
|   `PROGRESS_STATIC`    |         None         |     N/A     |
|    `PROGRESS_SPIN`     |       Spinning       |     No      |
|   `PROGRESS_EXPAND`    | Expanding Characters |     No      |
|    `PROGRESS_MOVE`     |  Moving Characters   |     No      |
| `PROGRESS_DETERMINATE` |    Progress Bar      |     Yes     |

The static progress label only prints a message without any animation, just like non-progress labels. Non-static progress labels can be classified as **determinate** and **indeterminate**. A determinate progress label has a concrete progress value (**percentage**) associated with it, and user should notify the progress label to update the percentage value (and alternatively other messages about the progress). An indeterminate progress label does not have a concrete percentage value (we cannot estimate the end of the progress), and user should notify the progress label to stop the animation when the progress ends.

For a detailed list of configurable options regarding progress labels, please refer to the corresponding content in the API Reference part of this documentation.

#### TTY mode and non-TTY mode

By default, `colorlabels` will detect whether the standard output is interactive (i.e. connected to a terminal/tty device). If it is not interactive, `colorlabels` will operate in non-TTY mode, where color output and progress animations will be disabled (i.e. no ANSI escape sequence printed, all progress labels become static), to make output parsing easier. However, you can override this behavior by setting the `COLORLABELS_TTY` environment variable. If `COLORLABELS_TTY` is set to one of `'1', 'yes', 'y', 'true', 'on'` (case-insensitive), this will force the use of TTY mode (i.e. treat standard output as interactive and display color output and progress animations as usual); if `COLORLABELS_TTY` is set to one of `'0', 'no', 'n', 'false', 'off'` (case-insensitive), this will force the use of non-TTY mode.

### API Reference

#### Module-level Functions

> **color_code**(color_number)

Generate an ANSI escape sequence with the given color number or description string.

Arguments:

- color_number: required, `any`, color number or description string

Return: `str`, an ANSI escape sequence

> **config**(**kwargs)

Set up runtime global settings.

Arguments:

- section_color: optional, `str`, runtime global settings of color for `section` labels
- item_color: optional, `str`, runtime global settings of color for `item` labels
- success_color: optional, `str`, runtime global settings of color for `success` labels
- warning_color: optional, `str`, runtime global settings of color for `warning` labels
- error_color: optional, `str`, runtime global settings of color for `error` labels
- info_color: optional, `str`, runtime global settings of color for `info` labels
- progress_color: optional, `str`, runtime global settings of color for `progress` labels
- plain_color: optional, `str`, runtime global settings of color for `plain` labels
- question_color: optional, `str`, runtime global settings of color for `question` labels
- input_color: optional, `str`, runtime global settings of color for `input` labels
- password_color: optional, `str`, runtime global settings of color for `password` labels
- section_mark: optional, `str`, runtime global settings of mark for `section` labels
- item_mark: optional, `str`, runtime global settings of mark for `item` labels
- success_mark: optional, `str`, runtime global settings of mark for `success` labels
- warning_mark: optional, `str`, runtime global settings of mark for `warning` labels
- error_mark: optional, `str`, runtime global settings of mark for `error` labels
- info_mark: optional, `str`, runtime global settings of mark for `info` labels
- progress_mark: optional, `str`, runtime global settings of mark for `progress` labels
- plain_mark: optional, `str`, runtime global settings of mark for `plain` labels
- question_mark: optional, `str`, runtime global settings of mark for `question` labels
- input_mark: optional, `str`, runtime global settings of mark for `input` labels
- password_mark: optional, `str`, runtime global settings of mark for `password` labels
- color_span: optional, `int`, runtime global settings of color span, should be in [0, 1, 2, 3]
- show_header: optional, `bool`, runtime global settings of whether to display headers for labels

Return: `None`

> **section**(msg, **kwargs)

Display a `section` label containing the given message.

Arguments:

- msg: required, `any`, the message content to display
- color: optional, `str`, the color for this label
- mark: optional, `str`, the mark for this label
- color_span: optional, `int`, the color span for this label, should be in [0, 1, 2, 3]
- show_header: optional, `bool`, whether to display header for this label

Return: `None`

> **item**(msg, **kwargs)

Display an `item` label containing the given message.

Arguments: The same as `section()`.

Return: `None`

> **success**(msg, **kwargs)

Display a `success` label containing the given message.

Arguments: The same as `section()`.

Return: `None`

> **warning**(msg, **kwargs)

Display a `warning` label containing the given message.

Arguments: The same as `section()`.

Return: `None`

> **error**(msg, **kwargs)

Display an `error` label containing the given message.

Arguments: The same as `section()`.

Return: `None`

> **info**(msg, **kwargs)

Display an `info` label containing the given message.

Arguments: The same as `section()`.

Return: `None`

> **plain**(msg, **kwargs)

Display a `plain` label containing the given message.

Arguments: The same as `section()`.

Return: `None`

> **question**(msg, **kwargs)

Display a `question` label containing the given message and prompt for user input.

Arguments: The same as `section()`.

Return: `str`, the string that user inputs

> **input**(msg, **kwargs)

Display an `input` label containing the given message and prompt for user input.

Arguments: The same as `section()`.

Return: `str`, the string that user inputs

> **password**(msg, **kwargs)

Display a `password` label containing the given message and prompt for user input. The password will not be echoed on the terminal.

Arguments: The same as `section()`.

Return: `str`, the password that user inputs

> **progress**(msg, mode=PROGRESS_STATIC, **kwargs)

Display a `progress` label containing the given message.

Arguments: Accept all arguments for `section()`. In addition:

- mode: optional, should be one of [`PROGRESS_STATIC`, `PROGRESS_SPIN`, `PROGRESS_EXPAND`, `PROGRESS_MOVE`, `PROGRESS_DETERMINATE`]
- For mode `PROGRESS_SPIN`:
  - position: optional, `str`, the position of spinner, should be one of ['mark', 'tail'], default is 'mark'
  - interval: optional, `float`, the refreshing interval (in seconds), default is 0.1
  - erase: optional, `bool`, whether to erase the whole label when animation finished, default is `False`
- For mode `PROGRESS_EXPAND`:
  - char: optional, `char`, the character to expand, default is '.'
  - width: optional, `int`, the maximum width to expand, default is 3
  - interval: optional, `float`, the refreshing interval (in seconds), default is 1
  - erase: optional, `bool`, whether to erase the whole label when animation finished, default is `False`
- For mode `PROGRESS_MOVE`:
  - char: optional, `char`, the character to move, default is '.'
  - num: optional, `int`, the number of characters to move, default is 3
  - width: optional, `int`, the width of range that characters move in, default is 12
  - style: optional, `str`, the style of moving, can be one of:
    - 'loop': when characters hit the boundary, they will appear at the other boundary in the next cycle (default)
    - 'reflect': when characters hit the boundary, they will be reflected back and alter their moving direction
  - interval: optional, `float`, the refreshing interval (in seconds), default is 0.1
  - erase: optional, `bool`, whether to erase the whole label when animation finished, default is `False`
- For mode `PROGRESS_DETERMINATE`:
  - char_done: optional, `char`, the character to represent done percentage, default is '='
  - char_head: optional, `char`, the character to display at the head of the progress bar, default is '>'
  - char_undone: optional, `char`, the character to represent undone percentage, default is ' '
  - width: optional, `int`, the width of the progress bar, default is 40
  - cleanup: optional, `bool`, whether to remove the progress bar when animation finished (original label message will remain), default is `False`
  - erase: optional, `bool`, whether to erase the whole label when animation finished, default is `False`

Return:

- For mode `PROGRESS_STATIC`, return `None`
- For other modes, return a `ProgressLabel` object

> **newline**()

Print an empty line.

Return: `None`

#### `ProgressLabel` Methods

We recommend using context managers (`with` statements) to manage progress labels with animations, as in our demo, which automatically stop the animation and clean up the side effects whether the progress normally ends or some exceptions occur. However, you may still call the `stop()` method if you want to manually stop the animation.

> **stop**()

Stop progress animation. This is automatically called by the `__exit__()` of the context manager, but you can also manually call it if you wish to.

Arguments: None

Return: `None`

> **update**(percent, text='')

Update progress to the given percentage in determinate mode. You can provide additional text to describe current status.

Arguments:

- percent: required, `float`, the percentage of the progress
- text: optional, `str`, additional text to describe current status, will be appended after the progress bar

Return: `None`

repository: gousaiyang/colorlabels

repo_name: gousaiyang/colorlabels


text:
# Cloud Foundry Buildpack Usage CLI Plugin

Cloud Foundry plugin extension to view all buildpacks used in across a Cloud Foundry or in specific organizations and spaces.

## Install

```
$ go get github.com/rahul-kj/cf_buildpacks_usage
$ cf install-plugin $GOPATH/bin/cf_buildpacks_usage
```

## Usage

**SAMPLE OUTPUT**

```
$ cf buildpack-usage

Following is the markdown output

|        ORG |                          SPACE |                    APPLICATION |      STATE |                                                                                BUILDPACK |
|      ----- |                          ----- |                          ----- |      ----- |                                                                                ----- |
|     system |                         system |                apps-manager-js |    STARTED |                                                                                staticfile_buildpack |
|     system |                         system |               app-usage-server |    STARTED |                                                                                ruby_buildpack |
|     system |                         system |                        console |    STARTED |                                                                                ruby_buildpack |
|     system |                         system |            app-usage-scheduler |    STARTED |                                                                                ruby_buildpack |
|     system |                         system |               app-usage-worker |    STARTED |                                                                                ruby_buildpack |
|     system |          notifications-with-ui |               notifications-ui |    STARTED |                                                                                Go |
|     system |                    autoscaling |                      autoscale |    STARTED |                                                                                Go |
```

```
$ cf buildpack-usage --csv

Following is the csv output

ORG,SPACE,APPLICATION,STATE,BUILDPACK
system,system,apps-manager-js,STARTED,staticfile_buildpack
system,system,app-usage-server,STARTED,ruby_buildpack
system,system,console,STARTED,ruby_buildpack
system,system,app-usage-scheduler,STARTED,ruby_buildpack
system,system,app-usage-worker,STARTED,ruby_buildpack
system,notifications-with-ui,notifications-ui,STARTED,Go
system,autoscaling,autoscale,STARTED,Go

```

```
$ cf buildpack-usage --verbose

Following is the csv output

ORG,SPACE,APPLICATION,STATE,INSTANCES,MEMORY,DISK
system,system,apps-manager-js,STARTED,6,64 MB,1024 MB
system,system,app-usage-server,STARTED,1,128 MB,1024 MB
system,system,console,STARTED,6,1024 MB,1024 MB
system,system,app-usage-scheduler,STARTED,1,128 MB,1024 MB
system,system,app-usage-worker,STARTED,1,1024 MB,1024 MB
system,notifications-with-ui,notifications-ui,STARTED,1,64 MB,1024 MB
system,autoscaling,autoscale,STARTED,1,256 MB,1024 MB

```

## Uninstall

```
$ cf uninstall-plugin buildpack-usage
```

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# orx-olive

Provides live coding functionality: updates a running OPENRNDR program when you save your changes.

## usage

make sure that you add the following to your list of dependencies (next to orx-olive)
```
implementation "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.3.31"
```

Then a simple live setup can created as follows:

```kotlin
import org.openrndr.Program
import org.openrndr.application
import org.openrndr.extra.olive.Olive

fun main() = application {
    configure {
        width = 768
        height = 576
    }
    program {
        extend(Olive<Program>())
    }
}
```

The extension will create a template script for you in `src/main/kotlin/live.kts`. You can
edit this to see how the program updates automatically.

## Shade style errors

Recent versions of `orx-olive` automatically set the `org.openrndr.ignoreShadeStyleErrors` property which
makes OPENRNDR ignore errors in the shade style and return the default shader. To get this behaviour in
older versions add `-Dorg.openrndr.ignoreShadeStyleErrors=true` to the JVM arguments.

## Reloadable State

Along with the extension comes a mechanism that allows state to be reloaded from a store on script reload.
This functionality is offered by the `Reloadable` class.

An example `live.kts` in which the reloadable state is used:
```kotlin
@file:Suppress("UNUSED_LAMBDA_EXPRESSION")
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*

{ program: PersistentProgram ->
    program.apply {
        val a = object : Reloadable() {
            var x : Double = 0.0
        }
        a.reload()

        extend {
            // do something with a.x here
        }
    }
}
```

The Reloadable store can be cleared using the `clearReloadables` function.

### Reloadable GPU resources

To store GPU resources or objects that use GPU resources (a.o. `ColorBuffer`, `VertexBuffer`, `Shader`, `BufferTexture`)  in a `Reloadable` object one uses OPENRNDR's
`persistent {}` builder function.

```!kotlin
@file:Suppress("UNUSED_LAMBDA_EXPRESSION")
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*

{ program: PersistentProgram ->
    program.apply {
        val a = object : Reloadable() {
            var image = persistent { loadImage("data/images/pm5544.png" ) }
        }
        a.reload()

        extend {
            drawer.image(a.image)
        }
    }
}
```

Keep in mind that `Reloadable` should only be used for singleton classes.

## Persistent Data
Sometimes you want to keep parts of your application persistent. In the following example
we show how you can prepare the host program to contain a persistent camera device.

```kotlin
import org.openrndr.Program
import org.openrndr.application

class PersistentProgram: Program() {
    lateinit var camera: FFMPEGVideoPlayer
}

fun main() = application{
    program(PersistentProgram()) {
        camera = FFMPEGVideoPlayer.fromDevice()
        camera.start()

        extend(Olive<PersistentProgram>()) {
            script = "src/main/PersistentCamera.Kt"
        }
    }
}
```

The live script `src/main/PersistentCamera.kts` then looks like this:

```kotlin
@file:Suppress("UNUSED_LAMBDA_EXPRESSION")
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*

{ program: PersistentProgram ->
    program.apply {
        extend {
            camera.next()
            drawer.drawStyle.colorMatrix = tint(ColorRGBa.GREEN) * grayscale(0.0, 0.0, 1.0)
            camera.draw(drawer)
        }
    }
}
```
<!-- __demos__ -->
## Demos
### DemoOlive01
[source code](src/demo/kotlin/DemoOlive01.kt)

![DemoOlive01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-olive/images/DemoOlive01Kt.png)

### DemoOliveScriptless01
[source code](src/demo/kotlin/DemoOliveScriptless01.kt)

![DemoOliveScriptless01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-olive/images/DemoOliveScriptless01Kt.png)

repository: openrndr/orx

gha_language: Kotlin

repo_name: openrndr/orx


text:
# pythonista-airplay
#### Demonstration of using two screens via airplay in pythonista
Thanks to [Zrzka](https://github.com/zrzka) for the initial code posted to Pythonista forums showing an HDMI example.
I've added two simple buttons that increment a label on the second screen.

#### To Test
Simply mirror your phone or tablet to an AppleTV connected display and then run `main.py`.

### Demo Video
[![Demo Video](http://img.youtube.com/vi/fjJE5VmXooY/0.jpg)](http://www.youtube.com/watch?v=fjJE5VmXooY)

repository: GitContainer/pythonista-airplay

repo_name: GitContainer/pythonista-airplay


text:
m.Please include your answers to the questions below with your submission, entering into the space below each question
See [Mastering Markdown](https://guides.github.com/features/mastering-markdown/) for github markdown formatting if desired.

*Be sure to take measurements in the "Default" configuration of the profiler to ensure your logging logic is not impacting current/time measurements.*

*Please include screenshots of the profiler window detailing each current measurement captured.  See [Shared document](https://docs.google.com/document/d/1Ro9G2Nsr_ZXDhBYJ6YyF9CPivb--6UjhHRmVhDGySag/edit?usp=sharing) for instructions.*

1. What is the average current per period?
   Answer:16.34uA

Screenshot:
   ![Avg_current_per_period](https://github.com/CU-ECEN-5823/assignment4-lpm-part2-AmoghShrikhande/blob/master/screenshots/assignment-4/Avg_current_per_period.JPG)

2. What is the average current when the Si7021 is Load Power Management OFF?
   Answer:2.12uA

Screenshot:
   ![Avg_current_LPM_Off](https://github.com/CU-ECEN-5823/assignment4-lpm-part2-AmoghShrikhande/blob/master/screenshots/assignment-4/Avg_current_LPM_Off.JPG)

3. What is the average current when the Si7021 is Load Power Management ON?
   Answer:430.58

Screenshot:
   ![Avg_current_LPM_Off](https://github.com/CU-ECEN-5823/assignment4-lpm-part2-AmoghShrikhande/blob/master/screenshots/assignment-4/Avg_current_LPM_On.JPG)

4. How long is the Si7021 Load Power Management ON for 1 temperature reading?
   Answer:

Screenshot:  89.6ms
   ![duration_lpm_on](https://github.com/CU-ECEN-5823/assignment4-lpm-part2-AmoghShrikhande/blob/master/screenshots/assignment-4/duration_lpm_on.JPG)

5. What is the total operating time of your design for assignment 4 in hours assuming a 1000mAh supply?
-> average current per period = 16.34uA.
-> Total operating time = 61199.5104 Hrs

6. How has the power consumption performance of your design changed since the previous assignment?
-> I observed a drop in power consumption in this assignment as compared to the previous one. The reason is that in this assignment we
   are sleeping in EM3 mode for most of the time. Beacause of this, the power consumption and the current consumption will be very less.
   Also we are using interrupts to carry out different functions instead of polling. Therefore the controller is able to sleep for a longer time

7. Describe how you have tested your code to ensure you are sleeping in EM1 mode during I2C transfers.
-> Use of SleepBlockBegin and SleepBlockEnd made me ensure that the sleep is happening in EM1 mode when the I2c transfers are going on. Also it is evident from the graph that we are sleeping in EM1 mode during I2C transfer. We could also conclude the same using breakpoint in the code


text:
This example contains a draft of a new extrusion simulation code.

Now we separate extrusion code into two parts: 1D part that records a trajctory, and a 3D part that does a simulation

We have two 1D parts:

* extrusion_1D_translocator.ipynb   - an old code using "SMCTranslocator" class
* extrusion_1D_newCode.ipynb  - a draft of a new code using pure python

Two 1D simulations are different, use different methodology, and are not intended to be the same.

Old 1D simulation uses CTCFs that capture LEF with some probability and never release it.
New 1D simulation uses CTCFs that capture and release LEF with some probability.
Thus, new 1D simulation is more general than the old 1D code.

What is new for both 1D simulations is that they both simulate 10 copies of a 4000-monomer system.
This is done to speed up simulations: simulations of a 4000-monomer system go not much faster than simulations
of a 40,000 monomer system, but in the latter case we get 10 times more statistics.
It is generally advisable to simulate systems with at least 20,000 monomers to get the most out of the GPU.

3D simulation uses a trajectory recorded by one of the 1D parts (it is saved into folder "trajectory" by either of them)
It then performs a 3D simulation and puts it in the same folder

sample_contactmap.ipynb notebook shows an example of how to generate a contactmap.

gha_language: Python

gha_license_id: MIT


text:
# PhotoGalleryDesktop

Angular is a framework which allows you to create reactive single page application.  It's only one Html file and a bunch of code we got from the server and every change is rendered in the browser. Angular 5 currently is the latest version.

## Demo (please check this link : https://photogallerydesktop.firebaseapp.com)

## Setup

Requirements to use this project:

##### Node.js (https://nodejs.org/en/)

We need  node.js to build our project and to manage dependencies, the packages we use and it also spins up a little development server which will host our app on our local machine making to easy for us to test it.

So make sure to download the lastest version of nodejs year simply dowload it and go from installer should be very straight forward.

In case you're not with the latest version of npm:
```sh
 npm install npm -g
```

###### Once you are done we need to install angular CLI
We simply need node.js because the CLI needs it. Behind the scenes it does some things with it to build our project and to manage our dependencies and the packages we use like the angular framework itself.

why we use CLI and not just import the angular to framework in an existing index HVM  page?

Angular is very futuristic framework and therefore it uses features like typescript which is
a superset  of javascript which needs to be compiled before it runs in the browser so it has some extra steps we have to take into account during development and doing that manually can't really be a pain. That's why the CLI it is really an awesome solution (the CLI also is a great tool for big and very big Angular projects! It allows you to focus on Angular code instead of workflow tasks!)

##### So we will need simply run the following command to global install CLI in your machine (after you install node.js that's important on your machine).
```sh
npm install -g @angular/cli
```
what this will do is it will build all our source code as or uses typescript which needs to be compiled to javascript.

#### Once you clone this repository, run this command on your terminal to install all needed dependencies:
## Install NPM Dependencies

```sh
  npm install
```

Then install this plugin (it depends on Angular CDK for the lightbox feature, you don't need to import anything from the CDK, just make sure that it is installed in the project)
```sh
  npm install --save @angular/cdk ng-gallery
```

## Launching the App
#### After installing the needed dependencies you are done, so what you will see when you launch this app with the commande below:

```sh
  ng serve
```
__________________________________________________________________________________________________________________
![alt tag](https://raw.githubusercontent.com/jesuiselle/PhotoGalleryDesktop/master/src/assets/picture1.PNG?token=AQnl8Tm1Yl78eJmsH-XCxL0qttS-HEtHks5avSCYwA%3D%3D)
__________________________________________________________________________________________________________________

![alt tag](https://raw.githubusercontent.com/jesuiselle/PhotoGalleryDesktop/master/src/assets/picture2.PNG?token=AQnl8ckr025WiGBK_wAr0hCrvOYf_adwks5avSsYwA%3D%3D)

repository: jesuiselle/PhotoGalleryDesktop

repo_name: jesuiselle/PhotoGalleryDesktop


text:
# The Mystery of Loch Ness

This is a silly little scenery that populates MSFS with Loch Ness's most famous
resident.  It pairs well with the Fort Augustus scenery by TheGarner available
at https://flightsim.to/file/131/fort-augustus-airfield.

Nessie herself is imported from a 3d object created by the user "Vanitaem V." at
3D Warehouse.  The usage information says one can "use it for any works you need
to", so it is incorporated here according to that grant.

I would love to make Nessie swim across the lake, so that she was always in a
different location.  However, creating new world scripts is undocumented and my
initial attempts have all been grossly unsuccessful.  Once there are docs or the
SDK is updated to allow this to happen, it will be added.

This package is open source, under the MIT No Attribution license, and the
source, such as it is, is available at Github:

https://github.com/kaosfere/msfs-scenery-nessie

repository: kaosfere/msfs-scenery-nessie

branch_name: refs/heads/main

repo_name: kaosfere/msfs-scenery-nessie


text:
# Message Search Engine (gossipmill)

[![Docker Pulls](https://img.shields.io/docker/pulls/connectedacademy/gossipmill.svg)](https://hub.docker.com/r/connectedacademy/gossipmill/)

Backend application for aggregating and supplying messages from multiple sources given some criteria.

> Designed to be horizontally scaled in tandom with `watercooler`.

## Development

This app depends on:

- Redis
- OrientDB
- Beanstalk

----
This project is part of the [Connected Academy](https://connectedacademy.io) online learning platform developed by [Open Lab](https://openlab.ncl.ac.uk) @ Newcastle University

repository: connectedacademy/gossipmill

repo_name: connectedacademy/gossipmill


text:
Recently a new version of Locust was released so I decided to use this as an excuse to refresh the docker image and show information on how to use it.

    I decided to create a dedicated repository for the project. If you visit https://github.com/karol-brejna-i/docker-locust, you’ll notice that the repo is organized so it can maintain many versions of the image.

### Please, visit https://github.com/karol-brejna-i/docker-locust for the latest version of the docker image.

# Dockerizing Locust experiment
I wanted the image to:
* use Python 3
* use the latest version of Locust
* be as small as possible
* be simple to use
* take Locust scripts by means of mounting a volume

Most of the images found on docker hub was old (1-2 yo) so I decided to give it a try.

This one is based on python:3.6-alpine, installs `locustio` package and required dependencies.
It weighs about 124MB.

# Usage
The image doesn't include locust scripts during build. It assumes, the scripts will be supplied on runtime by mounting a volume (to `/locust` path).

## Building the image
```
docker build -t grubykarol/locust:0.8.1-py3.6 .
```
or (if behind a proxy):
```
docker build --build-arg HTTP_PROXY=$http_proxy --build-arg HTTPS_PROXY=$https_proxy -t grubykarol/locust:0.8.1-py3.6 .
```

## Running the image
The image uses the following environment variables to configure its behavior:

| Variable | Description | Default | Example |
|----------|-------------|---------|---------|
|LOCUST_FILE   | Sets the `--locustfile` option. | locustfile.py | |
|ATTACKED_HOST | The URL to test. Required. | - | http://example.com |
|LOCUST_MODE   | Set the mode to run in. Can be `standalone`, `master` or `slave`. | standalone | master |
|LOCUST_MASTER | Locust master IP or hostname. Required for `slave` mode.| - | <IP_ADDRESS> |
|LOCUST_MASTER_BIND_PORT | Locust master port.


text:
# Modelling notes

## General / principles

Focussed, initially task-specific, incrementally refined.

Using ideas from [Bigraphs](https://en.wikipedia.org/wiki/Bigraph), specifically:
- provileging a place/containment hierarchy
- nodes, which may be typed (by "contols"), having ports
- graph of names connecting ports for non-place relationships

Mapping to Semantic Web ideas.

Aligning with (or at least sympathetic to) Music Ontology and in particular Studio Ontology concepts where possible.

## Initial Entities

- Execution environment, e.g. OS on PC or in VM, plugin hosting environment, browser
- Execution platform, e.g. PC or VM
- Process, e.g. server (in OS), web page/app (in browser), ?patch (in Max), ??plugin (in host)
- File (or document), in execution environment
- ? FileSet (or filesystem or ?namespace?), in execution environment; may be linked to external storage
- Configuration, e.g. experience file (in musicodes), patch file (in Max)

### Execution Platform

Inferred from an agent running within a nested execution environment.

### Execution Environment

Inferred by an agent running (successfully) within that execution environment.

### Process

Implicit in execution of an embedded agent, or reported by the process' execution environment to an agent external to the process (e.g. a general system process monitor).

### File

Reported by embedded agent when explicitly used/accessed by a process, or reported by the execution environment

## IRIs

Agents can generate their own GUIDs dynamically (randomly).

Equality/identity of (e.g.) other entities may be inferred from observations of properties
(e.g. same IP address at same time), or from explicit sharing of information through local
channels, e.g. well-known local file, loopback communication (beware port forwarding and
proxying), local multicast.

repository: cgreenhalgh/music-performance-manager

repo_name: cgreenhalgh/music-performance-manager


text:
# Graphs
Implement your own Graph. The graph should be represented as an adjacency list, and should include the following methods:

AddNode()
Adds a new node to the graph
Takes in the value of that node
Returns the added node

AddEdge()
Adds a new edge between two nodes in the graph
Include the ability to have a “weight”
Takes in the two nodes to be connected by the edge
Both nodes should already be in the Graph

GetNodes()
Returns all of the nodes in the graph as a collection (set, list, or similar)

GetNeighbors()
Returns a collection of edges connected to the given node
Takes in a given node
Include the weight of the connection in the returned collection

Size()
Returns the total number of nodes in the graph

## Approach & Efficiency
space - O(n)
time = O(n)

## API
no Api

## Whiteboard for get_edge
https://docs.google.com/spreadsheets/d/1Jv9K1wUnQTsthVswYUDgmeceRDx7sfJGpuiDv0n_dls/edit?usp=sharing

## Whiteboard for breadth_first
https://docs.google.com/spreadsheets/d/12wIqjrR4r92a9jzx6uq6CEH8KrpB7kiKo0LE2KHlNCk/edit#gid=1577554351

Collaborator == Karlo

https://github.com/samuelclark907/data-structures-and-algorithms/pull/50

gha_language: JavaScript


text:
# ElasticSearch script

Bash script to shrink the number of ElasticSearch shards by
 - Calculating size
 - Create a new index and copy the data with te [_shrink API ](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html)
 - Removes the old index
 - Create an alias to the new index with the old name

The script produces only output based on your configuration. You can execute it yourself (or not 😼 ).

Optimal sizes are based on this blog post https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster

```
./shard_optimalisation.sh [-r] [-d <sqlite3 filename> ] [-o] [-i <index name>]
```


text:
# Maya

A modern commodity pricing user interface

## Getting Started

To build: ```flutter build web```

Start a python server ```python -m http.server 9000```
or ```python -m SimpleHTTPServer 9000```

Navigate to ```http://localhost:9000/build/web/#```

## For integration testing

Need to install ChromeDriver first (version 89, needs to match your Chrome)
and start it ```./chromedriver --port=4444```

Then in the root of your project do
```
flutter drive --driver=test_driver/integration_test.dart --target=test_driver/elec_daily_option_test.dart
```
(not working yet, boo)

repository: thumbert/maya

repo_name: thumbert/maya


text:
# Project roadmap
1. Basic data / entity management.
   This is extremely important as all the later code will depend on this. Still,
   there would be few refactoring / revisions to find optimal structure.
   This should include basic concepts like:
   - Entity groups
   - Component registry, component array
   - Floating entity groups
   - Entity ID
2. Systems
   Step 1 implements an interface to manipulate entities. Using this, we can
   actually manipulate entities - yet, we still need an actor to perform this.
   Systems are actors that do manipulations which are executed every tick.

   ECS frameworks require a facility to filter entities that match the criteria,
   however we lack it in this stage.
   Still, it's possible to perform this task using full scan. Since a proper
   filtering mechanism incurs a lot of complexity, it'd be fine at this stage.

   We also need to specify the order of systems. This can be done by directly
   specifying before / after dependency sets, or by specifying components to
   read / write. However this is not really necessary at this point though -
   just receive a priority number and sort them.
3. Implement a simple game using what we've written so far
   At this stage, it's possible to store the game state / implement game logic
   using what's written so far. To start, a Pong clone would be great. Rendering
   routine is trivial too - we can use 2D canvas.
   After building Pong clone, it should be possible to transform Pong clone to
   Breakout clone.
4. Serialization
   The game should have a state, and the state can and should be serializable.
   We need to convert internal game state, which is composed of component arrays
   and entity groups (column oriented), to 'row oriented format' which is
   composed of arrays of entities, which contain components. The reverse is
   obviously required as well.
5. Family
   Family is a concept / facility to group entity groups that matches certain
   criteria. We've used full scanning to filter out entities - this can be
   optimized using families.

   Family needs to "observe" how entity groups are moving and update its own
   data. This adds quite a bit of complexity - proper testing should be required.
6. Update mechanism
   When a component's data, or an entity group's structure changes, systems must
   be notified of it. Signals / Events are usually used for this, but this will
   cripple the performance as CPU cache wouldn't be efficiently used.
   Instead, we should be able to track whether if an entity group / component
   has changed using some kind of persistent list. There are many possiblites
   for this - for example, bitsets can be used.
   Then, systems should be able to read this list and update changed data.
   Basically, it's a dirty flag for all entities.
7. General purpose indexing
8. Component array strides
9. Entity hierarchy
10. 3D position (LocRotScale)
11. Basic WebGL renderer
12. Animations


text:
# Paylinks

With the paylinks endpoint you can create a new paylink in order to use it in any communication method possible. The response will give you a unique link where the debtor can click on and will get the payment screen.

## HTTP methods

The `post` and `get` methods are available for this endpoint. Where the `post` method is used to create a new paylink and the `get` method is used for retrieving the status of a specific or multiple paylinks.

## Request

### GET

For the get method filters can be applied to get the status of a specific paylink or multiple paylinks. To be sure you always get a unique paylink **always** use the `setMpid()` method. The filtering used with other methods can have multiple results.

The following methods are available:

````php
$paylink->setMpid()
	->setStatusDate()
	->setStatus()
	->setIdBatch()
	->setRrp()
	->setPage()
	->setDetail()
````

| Method | Description |
|--|--|
| `setMpid()` | With this method you can set the unique identifier to filter on. The specified ID must be a valid ID that was used to create the paylink.  |
| `setStatusDate()` | Set a date to filter on. Date format is `Y-m-d`. Other filters applied will be used in order to retrieve te correct results. (Example: when using this method with the `setStatus()` filter only the paylinks that have the specified status on the specified date will be shown. |
| `setStatus()` | Filter on the actuall status of the paylinks. Valid status values are: |
| `setIdBatch()` | When you created paylinks with the `id_batch` parameter filled you can filter them out by using this method where the value is the value used when creating the paylinks. |
| `setRrp()` | Sets the results per page or results per response. Default value is 500, maximum is 1000. |
| `setPage()` | When there are more results then the setted `rrp` (500 or the specified amount) you can retrieve the rest by using this method and use an incremental integer. |
| `setDetail()` | Gives you extra information in the response from the API. |

### Post

The `post` method is used to create a new paylink. The post endpoints can have allot of parameters were some are required to set and some are optional. In order to not have to set every parameter that is optional but must be present you can use the helper method:

````php
use Noxxie\Mailtopay\Endpoints\Endpoint;
use Noxxie\Mailtopay\Helpers\DefaultParameters;

Endpoint::registerDefaultValues('post',  DefaultParameters::postPaylinks());
````

This will register all the parameters that are optional but must be specified in order to get the endpoint to work.  When you want you can also specify your own default parameter values. Just replace `DefaultParameters::postPaylinks()` with your own array. (Beware  the correct parameter names must be specified in order to get it work, no validation what so ever is done when setting the default values).

Below are the absolute minimum methods that must be used in order to get a correct request to the API. Ofcourse you can specify extra parameter values if you want. You can view every settable parameter in the official Mailtopay API documentation.

````php
$pay = new Paylinks;
$pay->setMethod('post')
	->setConcerning('concerning')
	->setLastname('lastname')
	->setDebtornumber('debornumber')
	->setUsername('username')
	->setDueDate('2019-10-22')
	->setInvoices([[
		'invoice_number'  =>  'test',
		'invoice_date'  =>  '2019-10-12',
		'invoice_amount'  =>  '12344',
		'invoice_description'  =>  'test'
    ]])
    ->setReturnUrl('http://example.com/');
````

**Beware** when you use the `setInvoices` option and you only use one invoice a multidimensional array must be used in order to make it work. (array in array :-)).

Some additional methods are `setIdBatch()`, `setCompanyName()`, `setPaymentReference()`, `setModuleIdeal()`, `setModuleCreditCard()`. For every parameter there is a set method defined. See the API documentation of Mailtopay itself for every availible parameter.

## Response

The default `metadata` response methods are availible for this request and can be used for getting extra information regarding the response.

### Get

Available methods for an `get` response.
````php
$result->getMpid();
$result->getIdRequestClient();
$result->getStatusCode();
$result->getStatusDate();
$result->getProvider();
$result->getAccountOwner();
$result->getIban();
$result->getBic();
````

The status of the paylink determines what is filled and what is not filled. A general rule can be, when it is payed `provider`, `account_owner`, `iban` and `bic` are filled otherwise they are empty.

### Post

Available methods for an `post` response are:
````php
$result->getMpid();
$result->getPaylink();
````

The `mpid` is the unique identifier by what the API stored and executed the request. The `paylink` contains the actuall HTTPS link that can be used to pay the created paylink.

## Examples

### Post
````php
use Noxxie\Mailtopay\Endpoints\Paylinks;
use Noxxie\Mailtopay\Client;

$pay = new Paylinks;
$pay->setMethod('post')
	->setConcerning('concerning')
	->setLastname('lastname')
	->setDebtornumber('debornumber')
	->setUsername('username')
	->setDueDate('2019-10-22')
	->setInvoices([[
		'invoice_number'  =>  'test',
		'invoice_date'  =>  '2019-10-31',
		'invoice_amount'  =>  '1234',
		'invoice_description'  =>  'test'
    ]])
    ->setReturnUrl('http://example.com/');

$client = new Client('id', 'passphrase', 'base_uri', $pay);
$response = $client->execute();

// Fetch the paylink url because of the way the response instance works, you can fetch the first result with using the direct function.
// you also could use $response->getResults(); and loop over the results, because of this API endpoint, only one result will be returned.
$response->getPaylink();
````

### Get

````php
use Noxxie\Mailtopay\Endpoints\Paylinks;
use Noxxie\Mailtopay\Client;

$paylink = new Paylinks;
$paylink->setMethod('get')
	->setStatusDate('2019-10-31')
	->setStatus(['900']);

$client = new Client('id', 'passphrase', 'base_uri', $pay);
$response = $client->execute();

if ($response->getResultsCount() > 0) {
	foreach ($response->getResults() as $result) {
		// Retrieve BIC & Ibanm
		echo $result->getBic() . ' - ' . $result->getIban() . "<br />";
	}
} else {
	echo 'No Results found.';
}
````

repository: NoxxieNl/mailtopay-API

gha_language: PHP

repo_name: NoxxieNl/mailtopay-API


text:
---
layout: default
---

# 1995-09-06 - Re: Scientology and police visit XS4ALL Amsterdam

## Header Data

From<EMAIL_ADDRESS>(Mole Rat)

To<EMAIL_ADDRESS>Message Hash: 1710548e2079c89214d69f90b211ed03a7fe15d4d27067e089d2d091805b38f9

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-09-06 05:07:21 UTC

Raw Date: Tue, 5 Sep 95 22:07:21 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Mole Rat)
Date: Tue, 5 Sep 95 22:07:21 PDT
To<EMAIL_ADDRESS>Subject: Re: Scientology and police visit XS4ALL Amsterdam
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

<EMAIL_ADDRESS>writes:
     [ snip ]
 >     Police and members of Scientology church enter offices of XS4ALL
 >     ================================================================
 >
 > Amsterdam - thuesday september 5, 1995.
 >
 > Today at about 14:00, XS4ALL was visited by Mr. S. Braan,
 > bailiff. He was acting on behalf of the Religious
 > Technology Centre, better known as the Scientology Church, or
 > Scientology for short. He was assisted by a local police officer and Mr.
 > Hermans from the 'Nauta-Dutilh' legal firm that represents Scientology
 > in The Netherlands. Also present were two computer experts (Mr. Ootjes
 > and Mr. Van Suchtelen) a locksmith (to enter had we not been present) and
 > two American employees of Scientology, Mr. Weightman and Ms. Jenssen.
     [ snip ]

     This is the second or third time I've seen descriptions of such
     raids where cult (no, I'm not trying to be diplomatic)
     representatives were present and participating.  Is this legal in
     Amsterdam?  How about in the U.S.?  Britain?

     If a police officer has a warrant then I really don't have much
     choice about letting him in.  Am I also under an obligation to
     allow the people who filed for the warrant into my home or
     business?

     Thanks,

     Mole Rat
----------------------------------------------------------------------------
To find out more about the anon service, send mail to<EMAIL_ADDRESS>If you reply to this message, your message WILL be *automatically* anonymized
and you are allocated an anon id. Read the help file to prevent this.
Please report any problems, inappropriate use etc. to<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

+ Return to [September 1995](/archive/1995/09)

+ Return to<EMAIL_ADDRESS>(Mole Rat)](/authors/an253398_at_anon_penet_fi_mole_rat_)"

+ 1995-09-06 (Tue, 5 Sep 95 22:07:21 PDT) - Re: Scientology and police visit XS4ALL Amsterdam -<EMAIL_ADDRESS>(Mole Rat)_


text:
# manager

Manager for Entity/Component/Systems.

## Installing

`component-install entity/manager`

## API

### Manager()

  Manager class.

### Manager.isRoot()<small> =`Boolean`</small>

  Determine whether this is the root manager.

### Manager.createEntity(`c...`:`Object`)<small> =`entity`:`Entity`</small>

  Create an entity of components, and use it.

### Manager.removeEntity(`e`:`Entity`)<small> =`this`:`Manager`</small>

  Remove an entity.

### Manager.removeAllEntities()<small> =`this`:`Manager`</small>

  Remove all entities.

### Manager.applyComponents(`[e]`:`Entity`)

  Apply component data to an entity or all.

### Manager.createManager()<small> =`new_manager`:`Manager`</small>

  Create a child manager and use it.

### Manager.of(`arr`:`Array`)<small> =`entities`:`Set`</small>

  Get all entities using all
  the components in the array.

### Manager.each(`[c...]`:`Object`, `fn`:`Function`)<small> =`this`:`Object`</small>

  Iterate entities of certain components,
  or through all if no component is passed.

### Manager.get(`c`:`Component`)<small> =`Entity`</small>

  Get the first entity matching component.

### Manager.use(`item`:`Entity|Mixed|Manager`, `reuse`:`Boolean`)<small> =`this`:`Manager`</small>

  Use a entity, system or manager.

  When entity:
  - Registers an entity (creating a
    new one or reusing the one passed).

  When system:
  - Registers a system to be used.
    Order matters.

  When manager:
  - Adds the manager to its children.

### Manager.init()<small> =`this`:`Manager`</small>

  Game state switches.

  States:

    init -> ( start - pause - stop ) -> tear
            (---------loop---------)

### Manager.reset()<small> =`this`:`Manager`</small>

  Reset state.

  Executes:

    stop -> tear -> init -> start

### Manager.join(`e`:`Entity`)<small> =`this`:`Manager`</small>

  Join (late) an entity.

  It will try to apply components and systems
  based on the current state.

### Manager.snapshot()<small> =`Array`</small>

  Generate an array snapshot of all entities
  property values.

## License

MIT

repository: legacy-entity/manager

repo_name: legacy-entity/manager


text:
---
layout: post
title:  "Setting up the Blog"
author: Vinish
categories: [ tutorial ]
---

## Wednesday, 04/15

Today, I continued working on setting up the blog. I followed the instructions from this [site.](https://www.foxinfotech.in/2019/12/how-to-create-a-blog-using-github-pages-and-jekyll-with-a-few-clicks.html) I had tried following the instructions from this site last week; however, none of my posts would show up. We later figured out that none of the blog posts were showing up because I was working on a Github project site. So, I began working on a different repository and completed the same steps as before. I chose a theme for my Blog from another website and imported all the files onto my repository.I then deleted all the example posts that were already in the files. Lastly, I began creating my own files for the previous blog posts I had written.

gha_language: HTML


text:
---
id: client
title: Utilities
---

The Auth.js client library makes it easy to interact with sessions from React applications.

#### Example Session Object

```ts
{
  user: {
    name: string
    email: string
    image: string
  },
  expires: Date // This is the expiry of the session, not any of the tokens within the session
}
```

:::tip
The session data returned to the client does not contain sensitive information such as the Session Token or OAuth tokens. It contains a minimal payload that includes enough data needed to display information on a page about the user who is signed in for presentation purposes (e.g name, email, image).

You can use the [session callback](/reference/configuration/auth-config#callbacks) to customize the session object returned to the client if you need to return additional data in the session object.
:::

:::note
The `expires` value is rotated, meaning whenever the session is retrieved from the [REST API](/reference/rest-api), this value will be updated as well, to avoid session expiry.
:::

## getSession()

- Client Side: **Yes**
- Server Side: **No** (See: [`unstable_getServerSession()`](/reference/nextjs/#unstable_getserversession)

Auth.js provides a `getSession()` helper which should be called **client side only** to return the current active session.

On the server side, **this is still available to use**, however, we recommend using `unstable_getServerSession` going forward. The idea behind this is to avoid an additional unnecessary `fetch` call on the server side. For more information, please check out [this issue](https://github.com/nextauthjs/next-auth/issues/1535).

:::note
The `unstable_getServerSession` only has the prefix `unstable_` at the moment, because the API may change in the future. There are no known bugs at the moment and it is safe to use. If you discover any issues, please do report them as a [GitHub Issue](https://github.com/nextauthjs/next-auth/issues) and we will patch them as soon as possible.
:::

This helper is helpful in case you want to read the session outside of the context of React.

When called, `getSession()` will send a request to `/api/auth/session` and returns a promise with a [session object](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/types.ts#L407-L425), or `null` if no session exists.

```js
async function myFunction() {
  const session = await getSession()
  /* ... */
}
```

Read the tutorial [securing pages and API routes](/guides/basics/securing-pages-and-api-routes) to know how to fetch the session in server side calls using `unstable_getServerSession()`.

---

## getCsrfToken()

- Client Side: **Yes**
- Server Side: **Yes**

The `getCsrfToken()` method returns the current Cross Site Request Forgery Token (CSRF Token) required to make POST requests (e.g. for signing in and signing out).

You likely only need to use this if you are not using the built-in `signIn()` and `signOut()` methods.

#### Client Side Example

```js
async function myFunction() {
  const csrfToken = await getCsrfToken()
  /* ... */
}
```

#### Server Side Example

```js
import { getCsrfToken } from "next-auth/react"

export default async (req, res) => {
  const csrfToken = await getCsrfToken({ req })
  /* ... */
  res.end()
}
```

---

## getProviders()

- Client Side: **Yes**
- Server Side: **Yes**

The `getProviders()` method returns the list of providers currently configured for sign in.

It calls `/api/auth/providers` and returns a list of the currently configured authentication providers.

It can be useful if you are creating a dynamic custom sign in page.

---

#### API Route

```jsx title="pages/api/example.js"
import { getProviders } from "next-auth/react"

export default async (req, res) => {
  const providers = await getProviders()
  console.log("Providers", providers)
  res.end()
}
```

:::note
Unlike and `getCsrfToken()`, when calling `getProviders()` server side, you don't need to pass anything, just as calling it client side.
:::

---

## signIn()

- Client Side: **Yes**
- Server Side: No

Using the `signIn()` method ensures the user ends back on the page they started on after completing a sign in flow. It will also handle CSRF Tokens for you automatically when signing in with email.

The `signIn()` method can be called from the client in different ways, as shown below.

### Redirects to sign in page when clicked

```js
import { signIn } from "next-auth/react"

export default () => <button onClick={() => signIn()}>Sign in</button>
```

### Starts OAuth sign-in flow when clicked

By default, when calling the `signIn()` method with no arguments, you will be redirected to the Auth.js sign-in page. If you want to skip that and get redirected to your provider's page immediately, call the `signIn()` method with the provider's `id`.

For example to sign in with Google:

```js
import { signIn } from "next-auth/react"

export default () => (
  <button onClick={() => signIn("google")}>Sign in with Google</button>
)
```

### Starts Email sign-in flow when clicked

When using it with the email flow, pass the target `email` as an option.

```js
import { signIn } from "next-auth/react"

export default ({ email }) => (
  <button onClick={() => signIn("email", { email })}>Sign in with Email</button>
)
```

### Specifying a `callbackUrl`

The `callbackUrl` specifies to which URL the user will be redirected after signing in. Defaults to the page URL the sign-in is initiated from.

You can specify a different `callbackUrl` by specifying it as the second argument of `signIn()`. This works for all providers.

e.g.

- `signIn(undefined, { callbackUrl: '/foo' })`
- `signIn('google', { callbackUrl: 'http://localhost:3000/bar' })`
- `signIn('email', { email, callbackUrl: 'http://localhost:3000/foo' })`

The URL must be considered valid by the [redirect callback handler](/reference/configuration/auth-config#callbacks). By default it requires the URL to be an absolute URL at the same host name, or a relative url starting with a slash. If it does not match it will redirect to the homepage. You can define your own [redirect callback](/guides/basics/callbacks#redirect-callback) to allow other URLs.

### Using the `redirect: false` option

:::note
The redirect option is only available for `credentials` and `email` providers.
:::

In some cases, you might want to deal with the sign in response on the same page and disable the default redirection. For example, if an error occurs (like wrong credentials given by the user), you might want to handle the error on the same page. For that, you can pass `redirect: false` in the second parameter object.

e.g.

- `signIn('credentials', { redirect: false, password: 'password' })`
- `signIn('email', { redirect: false, email<EMAIL_ADDRESS>})`

`signIn` will then return a Promise, that resolves to the following:

```ts
{
  /**
   * Will be different error codes,
   * depending on the type of error.
   */
  error: string | undefined
  /**
   * HTTP status code,
   * hints the kind of error that happened.
   */
  status: number
  /**
   * `true` if the signin was successful
   */
  ok: boolean
  /**
   * `null` if there was an error,
   * otherwise the url the user
   * should have been redirected to.
   */
  url: string | null
}
```

### Additional parameters

It is also possible to pass additional parameters to the `/authorize` endpoint through the third argument of `signIn()`.

See the [Authorization Request OIDC spec](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest) for some ideas. (These are not the only possible ones, all parameters will be forwarded)

e.g.

- `signIn("identity-server4", null, { prompt: "login" })` _always ask the user to re-authenticate_
- `signIn("auth0", null, { login_hint<EMAIL_ADDRESS>})` _hints the e-mail address to the provider_

:::note
You can also set these parameters through [`provider.authorizationParams`](/reference/providers/oauth).
:::

:::note
The following parameters are always overridden server-side: `redirect_uri`, `state`
:::

---

## signOut()

- Client Side: **Yes**
- Server Side: No

In order to logout, use the `signOut()` method to ensure the user ends back on the page they started on after completing the sign out flow. It also handles CSRF tokens for you automatically.

It reloads the page in the browser when complete.

```js
import { signOut } from "next-auth/react"

export default () => <button onClick={() => signOut()}>Sign out</button>
```

### Specifying a `callbackUrl`

As with the `signIn()` function, you can specify a `callbackUrl` parameter by passing it as an option.

e.g. `signOut({ callbackUrl: 'http://localhost:3000/foo' })`

The URL must be considered valid by the [redirect callback handler](/guides/basics/callbacks#redirect-callback). By default, it requires the URL to be an absolute URL at the same host name, or you can also supply a relative URL starting with a slash. If it does not match it will redirect to the homepage. You can define your own [redirect callback](/guides/basics/callbacks#redirect-callback) to allow other URLs.

### Using the `redirect: false` option

If you pass `redirect: false` to `signOut`, the page will not reload. The session will be deleted, and the `useSession` hook is notified, so any indication about the user will be shown as logged out automatically. It can give a very nice experience for the user.

:::tip
If you need to redirect to another page but you want to avoid a page reload, you can try:
`const data = await signOut({redirect: false, callbackUrl: "/foo"})`
where `data.url` is the validated URL you can redirect the user to without any flicker by using Next.js's `useRouter().push(data.url)`
:::

license: ISC

repository: khuezy/next-auth

repo_name: khuezy/next-auth


text:
# kcp
A golang implementation of [skywind3000/kcp](https://github.com/skywind3000/kcp).

## Reference
* A Production-Grade Reliable-UDP Library for golang: [kcp-go](https://github.com/xtaci/kcp-go)
* An annotated kcp in C: [no5ix/kcpsess](https://github.com/no5ix/kcpsess)

## Differ from kcp-go

* `KCP.output` type is changed from function to io.Writer
* `KCP.SetOutput()`


text:
---
layout: page
sidebar: right
subheadline: Leisure & fun
title:  "The PhD Movie"
teaser: "Clear your desk, call in sick and watch „The PHD movie“ (because life is short and PhD is tough)"
breadcrumb: true
tags:
    - post format
categories:
    - YAAC
    - Website
---

### By Ivan Kel

There are two kinds of scientists: The ones who know PhD comics and the ones who have known them for a long time. In any case, you should definitely check out the new PhD Movie. It’s hilarious, and there is much truth in there – you will recognize yourself, your colleagues and your supervisors.  Also, be ready for the second PhD movie coming up next year! (almost 4k supporters on Kickstarter! Whoop! Whoop!).

#### Links:
- PhD Movie website
- Kickstarter page of PhD Movie 2
- Nature movie review

gha_language: CSS


text:
---
title: "Utkarsh Sharma"
designation: "Astronomer, Senior Software Engineer"
images:
 - /images/speakers/utkarsh-sharma.jpg
twitter:
linkedin: https://www.linkedin.com/in/utkarsh-sharma-5791ab8a/
events:
 - 2023
---

Utkarsh Sharma is a seasoned software engineer with over 9 years of experience working in different capacities. He has worked as a Frontend Engineer, and Python Engineer, and held other technical roles in renowned companies like Akamai, Paytm, and Astronomer.

Utkarsh is an expert in building scalable and robust software solutions, especially in the areas of web development, data engineering, and machine learning. He has an excellent track record of designing and implementing complex software projects that have delivered business value.

Currently working as a Sr. software engineer at Astronomer, Utkarsh is focused on building scalable and efficient software solutions. He is passionate about innovation and enjoys exploring new approaches to problem-solving.

Utkarsh holds a Bachelor's degree in Computer Science Engineering. He is passionate about technology and loves to explore the latest trends and advancements in the field. In his free time, he enjoys reading books.

repository: softwareguru/airflowsummit-website

gha_license_id: NOASSERTION

repo_name: softwareguru/airflowsummit-website


text:
# kubectl-unbound-pvc

A small plugin to list Persistent Volume Claims which are not in `Bound` state.

## Prerequisites
* jq

## Installation

* Download the zip for the latest tag, for example:
  ```
  wget https://github.com/ishantanu/kubectl-unbound-pvc/archive/v0.0.1.zip
  ```
* Unzip the downloaded file
  ```
  unzip v0.0.1
  ```
* Move the `kubectl-unbound_pvc` binary from the `kubectl-unbound-pvc-0.0.1/` path and add it to your `$PATH`. For example:
  ```
  mv kubectl-unbound-pvc-0.0.1/kubectl-unbound_pvc /usr/local/bin/
  ```
* Now, you can start using the plugin right away:
  ```
  ❯ kubectl unbound-pvc -l
  NAME                      STATUS
  task-pv-claim             Pending
  task-pv-claim1            Pending
  ```

repository: ishantanu/kubectl-unbound-pvc

repo_name: ishantanu/kubectl-unbound-pvc


text:
# Flux
Flux is an asynchronous, scalable, optionally multi-tenant & distributed and reliable state machine based orchestrator.
Flux can be used to build Workflows and Reactive apps that are stateful.

Flux quick introduction video is available [here](https://www.youtube.com/watch?v=gddh5J2qB3k). Please go through the [wiki](https://github.com/flipkart-incubator/flux/wiki) pages to find out more about flux.

## Releases
| Release | Date | Description |
|:---------------------------------|:--------------|:------------|
| Version 1.2.5                    | Feb 2022      |  Versioned workflows, multiple runtime modes
| Version 1.2.1(stable)(tag 1.2.1) | Oct 2017      |  new features set
| Version 1.2.0(beta)              | Oct 2017      |  new features set
| Version 1.0.1                    | Feb 2017      |  Bug fixes
| Version 1.0                      | Jan 2017      |  Initial stable release

## Changelog
Changelog can be viewed in [CHANGELOG.md](https://github.com/flipkart-incubator/flux/blob/master/CHANGELOG.md) file

## Why Flux
A number of real-world stateful systems like workflows, event-driven reactive apps can be modeled as state machines. Event sources are many -
user actions, messages passed between systems and data changes to business entities. Flux provides a programming model and
client SDK to build event-driven reactive apps. The runtime allows to run multiple state machine instances concurrently.

## Flux Visualization & Monitoring
Flux allows you to monitor real-time execution of all running state machine tasks. Default path for dashboard is http://localhost:9996/admin/dashboard

Additionally, you can also inspect individual state machine execution DAGs and audit data at http://localhost:9999/admin/fsmview

Click [here](https://drive.google.com/file/d/0BxBoQMKaBB04NzRYQXRXdThrNXM/view?usp=sharing) to see how Flux state machine instance graph and audit look like.

## Documentation and Examples
Flux examples are under "examples" module. Each example can be run independently. Flux has very few dependencies and the simplest
examples can be run in under 5 minutes.
Documentation is continuously being added to the Flux [wiki](https://github.com/flipkart-incubator/flux/wiki)

## Getting help
For help regarding usage, or receiving important announcements, subscribe to the Flux users mailing list: http://groups.google.com/group/flux-users
To get involved in the evolution of Flux, subscribe to the Flux interest mailing list: http://groups.google.com/group/flux-interest

## License
Flux is licensed under : The Apache Software License, Version 2.0. Here is a copy of the license (http://www.apache.org/licenses/LICENSE-2.0.txt)

## Building with Flux
The Flux system design is organized into multiple layers to support building, testing, deploying and operating workflows in a shared environment:

![Layers](https://github.com/flipkart-incubator/flux/raw/master/docs/flux-high-level.png)

* UI - Provides for inspecting workflow execution and administration tasks on deployed instances/templates
* API/Modelling - Provides primitives for modelling State machines and reacting to state transitions, complex DAG-like workflows
* Runtime - Multiple variants from single JVM to distributed and isolated runtimes
* Integration - Support for operating the system i.e. Monitoring, Metrics and RPC mechanisms for running isolated runtimes
* Deployment - Providing mechanisms for cluster discovery, work distribution

repository: flipkart-incubator/flux

gha_language: Java

repo_name: flipkart-incubator/flux


text:
---
title: "Updating a Cluster"
menuTitle: "Updating a Cluster"
weight: 13
chapter: true
---

After your cluster has been running for some time you may decide you want to change the cluster's
spec. For instance, you may want to upgrade to a newer release of M3DB or modify the cluster's
config file. The operator can be used to safely rollout such changes so you don't need to do
anything other than add an annotation to enable updates.

The first step in updating a cluster is to update the cluster's `M3DBCluster` CRD with the changes
you want to make. If you manage your cluster via manifests stored in YAML files then this is as
simple as updating the manifest and applying your changes:

```bash
kubectl apply -f example/my-cluster.yaml
```

As a precaution, the operator won't immediately begin updating a cluster after your changes have
been applied. Instead, you'll need to add the following annotation on each `StatefulSet` in the
cluster to indicate to the operator that it is safe to update that `StatefulSet`:

```bash
kubectl annotate statefulset my-cluster-rep0 operator.m3db.io/update=enabled
```

When the operator sees this annotation, it will check if the current state of the `StatefulSet`
differs from its desired state as defined by the `M3DBCluster` CRD. If so, the operator will
update the `StatefulSet` to match its desired state, thereby triggering a rollout of the pods in
the `StatefulSet`. The operator will also remove the `operator.m3db.io/update=enabled` annotation
from the updated `StatefulSet`.

If, on the other hand, the operator finds the update annotation on a `StatefulSet` but it doesn't
need to be updated then the operator will remove the annotation but perform no other actions.
Consequently, once you set the update annotation on a `StatefulSet`, you can watch for the
annotation to be removed from it to know if the operator has seen and checked for an update.

Since M3DB rollouts can take longer periods of time, it's often more convenient to set the
annotation to enable updates on each `StatefulSet` in the cluster at once, and allow the operator
to perform the rollout safely. The operator will update only one `StatefulSet` at a time and then
wait for it to bootstrap and become healthy again before moving onto the next `StatefulSet` in the
cluster so that no two replicas are ever down at the same time.

```bash
kubectl annotate statefulset -l operator.m3db.io/cluster=my-cluster operator.m3db.io/update=enabled
```

gha_language: Go


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

title: "Adding plotter in Virtuoso"
subtitle: "Instructions to add an EPS printer to Cadence Virtuoso"
summary: ""
authors: []
tags: [Virtuoso]
categories: []
date: 2020-01-24T00:34:47+02:00
lastmod: 2020-01-24T00:34:47+02:00
featured: false
draft: false

# 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

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
projects: []
---
This is useful for printing schematics and layouts as an EPS file so that it can be send for review or printed using the available printer. In my particular case, Cadence is running on a Linux server, to which there is no printer available, so I have to somehow print to a file, which can then be converted to pdf.

## Adding the EPS plotter

Create a file named .cdsplotinit in your working directory, and add an EPS printer based on this example:
```
p1|Encapsulated PostScript: \
        :manufacturer=Adobe: \
        :type=epsf: \
        :resolution#300: \
        :maximumPages#1: \
        :paperSize="8x8 inches" 2400 2400: \
        :paperSize="Unlimited" 72000 72000:
```
After restarting the Cadence, there should be a printer name "p1" available.

This text is taken from now kaput link http://collaborate.bu.edu/moin/Cadence/PrintToImage (checked on 3rd Feb 2020).

repository: aloksethi/academic-kickstart

repo_name: aloksethi/academic-kickstart


text:
# [ashmee.github](https://ashmee.github.io)

Simple personal site (in progress)
[ashmee.github.io](https://ashmee.github.io)

## Install

    $ git clone https://github.com/ashmee/ashmee.github.io.git
    $ cd ashmee.github.io
    $ npm install

## Start & watch

    $ npm start

## Simple build for production

    $ npm run build

## Languages & tools

### JavaScript && TypeScript

-   [TypeScript](https://www.typescriptlang.org/) adding types.
-   [React](http://facebook.github.io/react) is used for UI.

### CSS and HTML

-   [HTML5](https://www.w3.org/TR/html52/) markup
-   [scss](https://sass-lang.com/) CSS with superpowers :3

### Code style

-   [Prettier](https://prettier.io/) code formatting
-   [ESLint](https://eslint.org/) find and fix problems in code

### Webpack 5

-   [Webpack](https://webpack.js.org/) bundling in prod and developing via `npm start`and getting automatic refresh in the browser whenever you update a file.

gha_language: TypeScript


text:
# purescript-erl-jsone
JSON library based on [PureScript Argonaut](https://github.com/purescript-contrib/purescript-argonaut) & built on top of [Jsone](https://github.com/sile/jsone) library.

## Usage

Include `purescript-erl-jsone` as purescript dependency and add `jsone` in your OTP app.

repository: purerl/purescript-erl-jsone

repo_name: purerl/purescript-erl-jsone


text:
# Wikipedia article name with language

Userscript by agj. Works on [Wikipedia](https://www.wikipedia.org/).

In the “Languages” list in the left sidebar, each link to the article in other languages displays the name of the article in that language, as well as the language name.

License: [Unlicense](https://unlicense.org/)

license: Unlicense

url: https://raw.githubusercontent.com/agj/agj-userscripts/81ef048dff5aff83c68d7779366554a74cf5ff49/Wikipedia article name with language/README.md

repository: agj/agj-userscripts

repo_name: agj/agj-userscripts


text:
## Changes

### 2014-08-29 Ben Weiner (ben@readingtype.org.uk).

Amends to allow the matchers module to work with Jasmine 2.

The original author who created the matcher and fixtures modules against Jasmine 1 has stated that he does not intend to do further work on the project.

* Renamed toContain matcher to toContainNode

* All specs now pass against Jasmine 2.0.0-rc5. NB I inherited quite a lot of commented out stuff and I have not explored it.

* I've also left in some code in the matchers module that I believe isn't ever executed. That should really go.

repository: readingtype/jasmine-dom

repo_name: readingtype/jasmine-dom


text:
# KAUST GPU HACKATHON 2018

Programming GPU with OpenACC

The introduction talk from Dr Saber Feki can be downloaded [here](material/Hackathon2018_OpenACC.pdf)

1. Connection to IBEX:

```
ssh -X<EMAIL_ADDRESS>```

2. Go to the following location:

```
cd /scratch/dragon/amd/$USER
mkdir gpuhackathon18
cd gpuhackathon18
```

From now on we consider that you are always inside the folder /scratch/dragon/amd/$USER/gpuhackathon18

3. Before you start working on IBEX, load the following modules:

```
module load cuda/9.0.176
module load pgi/17.10
```

4. Compilation

Example:

Serial Laplace:

In case that you plan to use PGI compiler:
```
pgcc -ta=tesla:cc60 -O2 -Minfo=all -o laplace_serial src/laplace_serial.c
```
* -Minfo=all: Informs you about all the messages

Output:
```
main:
     29, Loop not vectorized/parallelized: contains call
     32, Generated an alternate version of the loop
         Generated vector simd code for the loop
         Generated 3 prefetch instructions for the loop
         Generated vector simd code for the loop
         Generated 3 prefetch instructions for the loop
     41, Generated vector simd code for the loop containing reductions
         Generated 2 prefetch instructions for the loop
initialize:
     68, Memory zero idiom, loop replaced by call to __c_mzero8
     73, Generated vector simd code for the loop
         Residual loop unrolled 2 times (completely unrolled)
     78, Generated vector simd code for the loop
         Residual loop unrolled 2 times (completely unrolled)
track_progress:
     90, Loop not vectorized/parallelized: contains call
```

5. Execution

Submission script:
```
#!/bin/bash
#SBATCH --partition=batch
#SBATCH --job-name="test"
#SBATCH --gres=gpu:p100:1
#SBATCH --res=HACKATHON_TEAMS
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=00:10:00
#SBATCH --exclusive
#SBATCH --err=JOB.%j.err
#SBATCH --output=JOB.%j.out
#--------------------------------------------#
module load cuda/9.0.176
module load pgi/17.10
srun -n 1 --hint=nomultithread ./laplace_serial
```

Submit:
```
sbatch submit_laplace_serial.sh
```

Source: [submission_laplace_serial](submit_laplace_serial.sh)

6. Profiling

Compile your code for CPU (remove -acc and -ta from the PGI compilation if they were included)

Execute:
```
sbatch submit_profiling_terminal.sh
```
Source: [submission_profile_terminal](submit_profile_terminal.sh)

Open the output file and see the profiling information.

To use a GUI:
* Use the submission file [submission_profile_file](submit_profile_file.sh)

* Execute:
```
nvvp results.nvprof
```

7. Laplace version with initial OpenACC pragmas

```
pgcc -O2 -ta=tesla:cc60 -acc -Minfo=accel -o laplace_bad_acc src/laplace_bad_acc.c
```
Flags:
* -acc: activates the OpenACC compilation
* -Minfo=accel: Informs you about the accelerators messages

Output:
```
main:
     31, Generating implicit copyout(Temperature[1:1000][1:1000])
         Generating implicit copyin(Temperature_previous[:][:])
     32, Loop is parallelizable
     33, Loop is parallelizable
         Accelerator kernel generated
         Generating Tesla code
         32, #pragma acc loop gang, vector(4) /* blockIdx.y threadIdx.y */
         33, #pragma acc loop gang, vector(32) /* blockIdx.x threadIdx.x */
     41, Generating implicit copy(Temperature_previous[1:1000][1:1000])
         Generating implicit copyin(Temperature[1:1000][1:1000])
     42, Loop is parallelizable
     43, Loop is parallelizable
         Accelerator kernel generated
         Generating Tesla code
         42, #pragma acc loop gang, vector(4) /* blockIdx.y threadIdx.y */
         43, #pragma acc loop gang, vector(32) /* blockIdx.x threadIdx.x */
         44, Generating implicit reduction(max:worst_dt)
```
You can modify the time limit and the number of the tasks, if required.

Use compiler pgf90 for Fotran and pgc++ for C++

Options: -ta=tesla:cc60 -Minfo=all,intensity

* Minfo=all
It will provide all the compiler information (including the acceleration), for example
Loop not vectorized: loop count too small
Loop unrolled 6 times (completely unrolled)

* Minfo=intensity
Provides the intensity of all the loops, intensity is the (Compute operations/Memory Operations), if it is more or equal to 1.0 then we should move this loop to GPUs, otherwise not.

8. Execution

Submission script:
```
#!/bin/bash
#SBATCH --partition=batch
#SBATCH --job-name="test"
#SBATCH --gres=gpu:p100:1
#SBATCH --res=HACKATHON_TEAMX
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=00:10:00
#SBATCH --exclusive
#SBATCH --err=JOB.%j.err
#SBATCH --output=JOB.%j.out
#--------------------------------------------#
module load cuda/9.0.176
module load pgi/17.10
srun -n 1 --hint=nomultithread ./laplace_bad_acc
```

Submit:
```
sbatch submit_laplace_bad_acc.sh
```

Source: [submission_laplace_bad_acc](submit_laplace_bad_acc.sh)

Modify the X according to your team number (1-6)
In the above exampe we want to use one Nvidia P100 card, if you plan to use 2 cards then declare:

```
#SBATCH --gres=gpu:p100:2
```

9. Profiling

Adjust the name of the binary in all job scripts

Execute:
```
sbatch submit_profiling_terminal.sh
```
Source: [submission_profile_terminal](submit_profile_terminal.sh)

Open the output file and see the profiling information.

To use a GUI:
* Use the submission file [submission_profile_file](submit_profile_file.sh)

* Execute:
```
nvvp results.nvprof
```

10. Latest version with optimized OpenACC pragmas

Repeat the previous instructions with file [laplace_final_acc.c](src/laplace_final_acc.c)

# Tips

Use PGI with MPI

```
module load pgi/17.10
module load pgi/17.10_openmpi
```

# Material

[Ibex cheat sheet](material/ibex_flyer.pdf)
[OpenACC web page](https://www.openacc.org)

[OpenACC reference guide](https://www.openacc.org/sites/default/files/inline-files/OpenACC%20API%202.6%20Reference%20Guide.pdf)

[OpenACC programming guide](https://www.openacc.org/sites/default/files/inline-files/OpenACC_Programming_Guide_0.pdf)

[OpenACC getting started guide](http://www.pgroup.com/doc/openacc17_gs.pdf)

[PGI	Compiler guide](http://www.pgroup.com/resources/docs/18.1/pdf/pgi18ug-x86.pdf)

[CUDA	Cuda with C/C++](https://developer.nvidia.com/how-to-cuda-c-cpp)
[Cuda with Fortran](https://developer.nvidia.com/cuda-fortran)

[GPU Libraries	GPUs libraries](https://developer.nvidia.com/how-to-cuda-libraries)

[Matlab and GPU](https://developer.nvidia.com/matlab-cuda)

Deep Neural Networks - Cudnn
Load:
```
module load cudnn
```


text:
# JBoss EAP 7.2 on RHEL 8.0 on Azure VMSS (clustered, multi-VM)

1. [Solution Overview ](#solution-overview)
2. [Template Solution Architecture ](#template-solution-architecture)
3. [Licenses and Costs ](#licenses-and-costs)
4. [Prerequisites](#prerequisites)
5. [Deployment Steps](#deployment-steps)
6. [Deployment Time](#deployment-time)
7. [Post Deployment Steps](#post-deployment-steps)

## Solution Overview

JBoss EAP is an open source platform for highly transactional, web-scale Java applications. EAP combines the familiar and popular Jakarta EE specifications with the latest technologies, like Microprofile, to modernize your applications from traditional Java EE into the new world of DevOps, cloud, containers, and microservices. EAP includes everything needed to build, run, deploy, and manage enterprise Java applications in a variety of environments, including on-premise, virtual environments, and in private, public, and hybrid clouds.

This template creates two JBoss EAP Instances running inside a VNet and each server is in it’s own subnet. Both the servers are added to the backend pool of a Load Balancer.

## Template Solution Architecture

This template creates all of the compute resources to run EAP 7.2 on top of RHEL 8.0 VMs which are added to the backend pool of a Load Banlancer. Following are the resources deployed:

- 2 RHEL 8.0 VMs
- 1 Load balancer
- Virtual Network with 2 subnets
- EAP 7.2 on RHEL 8.0
- Sample application deployed to JBoss EAP 7

Following is the Architecture :

To learn more about JBoss Enterprise Application Platform, check out:
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.2/

## Licenses and Costs

This uses RHEL 8.0 image which is a PAY AS YOU GO image and doesn't require the user to license it, it will be licensed automatically after the instance is launched first time and user will be charged hourly in addition to Microsoft's Linux VM rates.  Click [here](https://azure.microsoft.com/en-gb/pricing/details/virtual-machines/linux/#red-hat) for pricing details.

## Prerequisites

1. Azure Subscription with specified payment method (RHEL 8 is a market place product and requires payment method to be specified in Azure Subscription)

2. To deploy the template, you will need to:

    - Choose an admin user name and password for your VM.

    - Choose a EAP user name and password to enable the EAP manager UI and deployment method.

## Deployment Steps

Build your environment with EAP 7.2 on top of RHEL 8.0 which is added to the backend pool of the Load Balancer on Azure in a few simple steps:
1. Launch the Template by click on Deploy to Azure button.
2. Fill in the following parameter values. Then accept the terms and condition before clicking on Purchase.

    - **Subscription** - Choose the right subscription where you would like to deploy.

    - **Resource Group** - Create a new Resource group or you can select an existing one.

    - **Location** - Choose the right location for your deployment.

    - **Admin Username** - User account name for logging into your RHEL VM.

    - **Admin Password** - User account password for logging into your RHEL VM.

    - **EAP Username** - User name for EAP Console.

    - **EAP Password** - User account password for EAP Console.

    - Leave the rest of the Parameter Value as it is and proceed.

## Deployment Time

The deployment takes approx. 10 minutes to complete.

## Post Deployment Steps

- Once the deployment is successfull, go the VM and copy the Public IP of the VM which is the Public IP of the Load Balancer.
- Open a web browser and go to **http://<PUBLIC_HOSTNAME>** and you should see the web page:

- If you want to access the administration console go to **http://<PUBLIC_HOSTNAME>:9990** and enter the EAP Username and Password:


text:
# What are the node types in ElasticSearch cluster?

However there are only 4 node types - master, data, client and tribe;

- `Master` only nodes take place in updating cluster state as well as master elections. They should never handle query or index loads.
- `Data` only nodes store data that is indexed into Elasticsearch. These can also handle querying and indexing.
- `Client` only nodes are used as load balancers for indexing and searching.
- `Tribe` nodes are akin to cross-cluster client nodes, in that they can query more than one cluster. Think federated search.

Elasticsearch best-practices recommend to separate nodes in three roles:

- Master nodes - intended for clustering management only, no data, no HTTP API
- Client nodes - intended for client usage, no data, with HTTP API
- Data nodes - intended for storing and indexing data, no HTTP API

repository: stakater/til

repo_name: stakater/til


text:
### [CVE-2023-24068](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-24068)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

** DISPUTED ** Signal Desktop before 6.2.0 on Windows, Linux, and macOS allows an attacker to modify conversation attachments within the attachments.noindex directory. Client mechanisms fail to validate modifications of existing cached files, resulting in an attacker's ability to insert malicious code into pre-existing attachments or replace them completely. A threat actor can forward the existing attachment in the corresponding conversation to external groups, and the name and size of the file will not change, allowing the malware to masquerade as another file. NOTE: the vendor disputes the relevance of this finding because the product is not intended to protect against adversaries with this degree of local access.

### POC

#### Reference
- https://johnjhacking.com/blog/cve-2023-24068-cve-2023-24069/

#### Github
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

repo_name: trickest/cve


text:
# Collection of resources in Python

### Hactoberfest-2021 Instructions:

Please edit this file by adding resource(s) you would recommend. Plase add your name, your GitHub username, and #hactoberfest-2021, somewhere above or below the item(s) you have added. For more instructions, please see:
 * hactoberfest_2021_instructions.md
 * issue #2, in "issues" tab, top-menu.

### I. Classes

 * Coursera, Andrew Ng instructor, Deep Learning Specialization
     - https://www.coursera.org/specializations/deep-learning?
       Five classes.  Classes 1 neural networks and 4 convolutional neural networks are foundations.
 * Udemy, Jose Portilla, Python for Data Science and Machine Learning Bootcamp
     - https://www.udemy.com/course/python-for-data-science-and-machine-learning-bootcamp/
 * Fast.AI, Part 1: Practical Deep Learning for Coders, Part 2: Foundations
     - 2020 part 1 course: https://course.fast.ai/
     - 2019 part 2 course: https://course19.fast.ai/part2
 * Hacktoberfest, Global event, October 1st to 31st annually: https://hacktoberfest.digitalocean.com/register
     - Lots of resources to help new users get involved with open source repos on GitHub. Help first timers with Git, GitHub and Pull Requests.

### II. Tutorials

### III. Books

#### III-a. Books for Beginners

 * Introduction to Statistical Learning with Applications in R, James et al.
   Stanford professors, MOOC and video available from Lagunitas.
   Good beginner book on machine learning concepts. Has easy practice questions.
   Don't need to know R.  Many Python versions of code is available from others.

#### III-b. Books for Intermediate ML and DL

 * Python Data Science Handbook, Jake VanderPlas
   Teaches you how to ise main machine learning Python libraties. Not a core concepts book.
   Covers Jupyter Notebook, Numpy, Pandas, Matplotlib, Scikit-Learn, and a little bit of Unix bash commands.
     - github:  https://github.com/jakevdp/PythonDataScienceHandbook

 * Hands on Machine Learning, 2nd ed, Aurélien Géron
     - Early Release pdf:  https://www.knowledgeisle.com/wp-content/uploads/2019/12/2-Aur%C3%A9lien-G%C3%A9ron-Hands-On-Machine-Learning-with-Scikit-Learn-Keras-and-Tensorflow_-Concepts-Tools-and-Techniques-to-Build-Intelligent-Systems-O%E2%80%99Reilly-Media-2019.pdf
     - github:  https://github.com/ageron/handson-ml2

 * Deep Learning with Python, 2nd ed., Fracois Chollet, c 2021 (nov est), Manning Co.
     - https://www.manning.com/books/deep-learning-with-python-second-edition
     - github: https://github.com/fchollet/deep-learning-with-python-notebooks
     - Added by Jennifer Yoon, github: JennEYoon, #hacktoberfest-2021

#### III-c. Books for Foundations

 * Goodfellow et al., Deep Learning
     - link to pdf:  https://www.deeplearningbook.org/front_matter.pdf
     - link to website:  https://www.deeplearningbook.org/

 * Magnus Ekman, NVIDIA Deep Learning Institute, Learning Deep Learning, c 2002, Addison-Wesley publication.
     - https://www.nvidia.com/en-us/training/books/

#### III-d. Related Books in Statistics & Probability, Algorithms, and Python Programming

 * Algorithms Illuminated, books 1, 2, 3, 4, by Tim Roughgarden
    - MOOC class on Coursera.org: https://www.coursera.org/specializations/algorithms
    - YouTube has videos for all 4 parts: https://www.youtube.com/channel/UCcH4Ga14Y4ELFKrEYM1vXCg
    - Added by Jennifer Yoon, github: JennEYoon, #hacktoberfest-2021

 * Statistical Rethinking
   Bayesian statistics.

### IV. Conferences and Events

 * SciPy Conferenc, annual in July
 * PyData Conference, several times a year in different locations.
 * PyCon Conference, annual in June
 * Meetups - get moral support from other learners and build your network.
 * Kaggle Competitions: https://www.kaggle.com/competitions
     - Best for building experience with professional-level deep learning projects.

### V. Tools, Environments

#### V-a. Github
  * Github getting started:  https://docs.github.com/en/get-started/onboarding/getting-started-with-your-github-account
  * Beginner video, Git and GitHub:  https://www.youtube.com/watch?v=RGOj5yH7evk

#### V-b. Markdown formatting

#### V-c. Ubuntu Shell
  * Unix/Linux Command Reference https://files.fosswire.com/2007/08/fwunixref.pdf
     - Added by Brianna Guarino, github user Brirrito

#### V-d. Anaconda Environment

#### V-e. IDE

 * Jupyter Notebook and Lab
 * Spyder
 * VS Code
 * PyCharm

#### V-f. Cloud Servers

 * A. Google Colab - free, GPU and TPU engines available

 * B. Amazon AWS - about 90 cents/hr for GPU xlarge, free non-GPU available

 * C. Binder - free, limit 200 concurrent users, slow with many users.

#### VI. Miscellaneous

 * xkcd comics on programming
 * reddit - programming thread
 * HackerRank - simple coding practice, many languages
 * CodeWars - simple coding practice, many languages
 * StackOverflow - answering newbie questions is very good for firming up one's own learning.  It's also a good practice for debugging and reading other people's code.
 * Cracking the Coding Interview book - uses Java.
   Worked Python solutions available from others.
 * Algoexpert.com - about $80-100 for 1 year, look for sales.

 * Genius Makers, by Cade Metz, c 2021, Dutton publisher.
    - Has interesting story about the early pioneers of deep learning and the story of AlphaGo AI development.
    - https://www.amazon.com/Genius-Makers-Mavericks-Brought-Facebook/dp/1524742678/ref=asc_df_1524742678/?tag=hyprod-20&linkCode=df0&hvadid=459709175715&hvpos=&hvnetw=g&hvrand=11860445820015786195&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9007587&hvtargid=pla-944267914281&psc=1
    - Added by Jennifer Yoon, github: JennEYoon, #hacktoberfest-2021

repository: WomensCodingCircle/ai-deep-learning

repo_name: WomensCodingCircle/ai-deep-learning


text:
# Contributing Guide

## How to contribute?

You can find problems from [Issues](https://github.com/businessmanjs/businessman/issues) or fix other problems.

Basic Pull Request steps:

1. Fork this repository
2. Create your feature branch: `git checkout -b awesome-feature`
3.  Push to the branch: `git push origin awesome-feature`
5. Submit a pull-request

## How to start development?

First as follows:

```
git clone git@github.com:YOUR/businessman.git && cd businessman
npm i
npm run build
```

If you change something:

```
npm run build
```

If there is no problem build succeeds!

## How to run tests?

Run all tests:

```
npm test
```

repository: businessmanjs/businessman

repo_name: businessmanjs/businessman