text:
---
layout: page-fullwidth
title: "Configuring RPi"
subheadline: "How to use RasPilot"
teaser: "The documentation is a work in progress..."
permalink: "/configuring_rpi/"
header: no
---

For detailed instructions of using Raspberry Pi, please visit the official documentation of Raspberry Pi Foundation.

[https://www.raspberrypi.org/documentation/](https://www.raspberrypi.org/documentation/)

##Writing an (Linux) image to the SD card
Default Raspbian kernel is compiled with PREEMPT option which has a serious latency on interrupt calling. To ensure the ardupilot task to be executed within low latency time, we patched the Raspbian kernel with [Real-Time patch](https://rt.wiki.kernel.org). Please download the latest Linux image in the Download Page [here](/downloads/).

Then follow the installing-image instruction on Raspberry Pi Foundation page.

* [Linux](https://www.raspberrypi.org/documentation/installation/installing-images/linux.md)
* [Mac OS](https://www.raspberrypi.org/documentation/installation/installing-images/mac.md)
* [Windows](https://www.raspberrypi.org/documentation/installation/installing-images/windows.md)

##Access from Ethernet cable
Raspberry Pi B+ / 2B has a Ethernet port. Connect it to your router with a Ethernet cable. The Raspberry Pi can get IP address automatically. And you could look up the device "raspilot" in the router setting page.

##Access from USB WiFi dongle
To setup the WiFi router you want to connect, edit /etc/wpa_supplicant/wpa_supplicant.conf on the SD card in Raspberry Pi console, or in a Linux environment on PC. Add the following lines to the end of the file (replace "yourssid" & "yourpasskey" to fit your WiFi environment).

~~~
network={
  ssid="yourssid"
  psk="yourpasskey"
  key_mgmt=WPA-PSK
}
~~~

Please read the [INSTRUCTIONS](https://www.raspberrypi.org/documentation/configuration/wireless/README.md) on Raspberry Pi Foundation pages for more information.

##Remote access to Raspberry Pi
The serial port on Raspberry Pi 40pin connector is used for getting GPS data, so you can not access console from that.

It is recommended to access Raspberry Pi via [SSH](https://www.raspberrypi.org/documentation/remote-access/ssh/README.md).

Please read the [INSTRUCTIONS](https://www.raspberrypi.org/documentation/remote-access/) on Raspberry Pi Foundation pages for more information.


text:
# How to install R and RStudio

### RStudio

- http://www.rstudio.com/products/rstudio/download/

### R

- https://cran.r-project.org/

### Install packages

1. Open RStudio
2. click on "Packages" in the bottom right panel
3. click on "install"
4. type "tidyverse" into the box
5. Click install and wait for it to finish

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Sonatype

Contains all the tasks which use the Sonatype Nexus Lifecycle CLI.

## Tasks

This is a description of all the tasks, along with parameters, and installation instructions.

- Neuxs Lifecycle Scan Task (nexus-lifecycle-scan.yml)

----

### Neuxs Lifecycle Scan Task (nexus-lifecycle-scan.yml)

Invokes a Nexus Lifecycle scan

#### Install Task

```shell
kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/exus-lifecycle-scan/0.1/raw
```

#### Parameters

The CLI has it's own default parameters.  This task inherets the default parameters for the CLI.  To learn more about the default parameters, visit the CLI documentation at [Nexus IQ CLI Docs](https://hub.docker.com/r/sonatype/nexus-iq-cli).

name                        | description                                                                                | required  | default
---------                   | -------------------------------------------                                                                   | --------  | -------
SERVER_URL                  | URL to the IQ Server that will evaluate policies                                                              |     x     |
AUTHENTICATION              | Authentication credentials to use for the IQ Server                                                           |     x     |
APPLICATION_ID              | Public ID of the application on the IQ Server                                                                 |     x     |
STAGE                       | The stage to run analysis against. Accepted values: [develop, build, stage-release, release, operate]         |     x     | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
RESULT_FILE                 | Path to a JSON file where the results of the policy evaluation will be stored in a machine-readable format.   |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
REPORT_FORMAT               | The format of the HTML evaluation report. Accepted values: [summary, enhanced]                                |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
FAIL_ON_POLICY_WARNINGS     | Fail on policy evaluation warnings                                                                            |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
IGNORE_SYSTEM_ERRORS        | Ignore system errors (IO, network, server, etc).                                                              |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
PROXY                       | Proxy to use                                                                                |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
PROXY_USER                  | Credentials to use for the proxy                                                                              |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
DEBUG                       | Enable debug logs. WARNING: This may expose sensitive information in the log.                                 |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
HELP                        | Show the help screen                                                                                |           | [See CLI Default](https://hub.docker.com/r/sonatype/nexus-iq-cli)
TARGETS                     | Scan targets                                                                                |     x     |

----

repository: tektoncd/catalog

branch_name: refs/heads/main

gha_language: Shell

repo_name: tektoncd/catalog


text:
---
date: 2022-08-31
layout: rafaga
rafagas:
- desc: The municipal map of Catalonia with the number of swimming pools per 100 inhabitants,
    which varies from 5000 inhabitants per swimming pool in l'Hospitalet de Llobregat
    to a swimming pool for every two inhabitants in Begur
  keyw: pools
  lang: CA
  link: https://www.elcritic.cat/dades/el-mapa-de-la-catalunya-de-les-piscines-136404
  microlink:
    desc: Qui té accés a refrescar-se en plena onada de calor? Consulta aquí quantes
      piscines hi ha en cada municipi de Catalunya
    image: https://s3.eu-west-1.amazonaws.com/elcritic.cat/wp-content/uploads/2022/07/15153225/piscina-vilanova-1200x630.jpg
    logo: https://www.elcritic.cat/app/themes/critic/dist/images/icons/apple-touch-icon_eb9d2305.png
    title: El mapa de la Catalunya de les piscines
- desc: A practical guide to financial support for open source projects that provides
    a comprehensive list of all the ways people are paid to work for the community
  keyw: foss
  link: https://github.com/nayafia/lemonade-stand
  microlink:
    desc: 'A handy guide to financial support for open source - GitHub - nayafia/lemonade-stand:
      A handy guide to financial support for open source'
    image: https://opengraph.githubassets.com/2c188e8aed6c89b641712a17a3c0f07a6f26dd85255295d84a2ce61ec64f1bbb/nayafia/lemonade-stand
    logo: https://github.com/fluidicon.png
    title: 'GitHub - nayafia/lemonade-stand: A handy guide to financial support for
      open source'
- desc: 'Impact of climate change on Arctic sea ice, represented by two parameters:
    sea ice extent and seawater ice concentration at the end of the summer period
    in September, developed by @Romainsologne'
  keyw: climate
  lang: FR
  link: https://pbs.twimg.com/media/Fa52HOwXEAEWgly?format=jpg&name=4096x4096
  microlink:
    image: https://pbs.twimg.com/media/Fa52HOwXEAEWgly?format=jpg&name=4096x4096
    logo: https://pbs.twimg.com/favicon.ico
    title: Fa52HOwXEAEWgly (4096×2896)
rid: 1889
---

repository: geoinquiets/rafagas

branch_name: refs/heads/gh-pages

gha_language: SCSS

gha_license_id: NOASSERTION

repo_name: geoinquiets/rafagas


text:
# scVAE: Single-cell variational auto-encoders #

scVAE is a command-line tool for modelling single-cell transcript counts using variational auto-encoders.

Install scVAE using pip for Python 3.6 and 3.7:

	$ python3 -m pip install scvae

scVAE can then be used to train a variational auto-encoder on a data set of single-cell transcript counts:

	$ scvae train transcript_counts.tsv

And the resulting model can be evaluated on the same data set:

	$ scvae evaluate transcript_counts.tsv

For more details, see the [documentation][], which include a user guide and a short tutorial.

[documentation]: https://scvae.readthedocs.io

repository: dpaysan/scvae

repo_name: dpaysan/scvae


text:
# Ram

The Ram has the following properties

- Similar to register module
- Has 32 addresses
- Every address points to a store of 16 bits
- Total size is 512 bits or 64 bytes

It has these inputs

- Clock
- Write enable
- Address
- Data

It has these outputs

- Data

repository: Mikevin/fpga-practice

repo_name: Mikevin/fpga-practice


text:
---
layout: kanji
v4: 1781
v6: 1920
kanji: 査
keyword: investigate
elements: investigate, tree, wood, shelf, my bookshelves
strokes: 9
image: E69FBB
on-yomi: サ
permalink: /rtk/査/
prev: 阻
next: 助
---

1) [dingomick] 11-3-2007(286): A whole team of cops is sent to investigate how a tree could grow on top of a shelf with no soil or water.

2) [zazen666] 9-10-2007(86): The result of the inverstigation of the missing Trees? Why, most of them had become shelfs!

3) [Hujis] 2-5-2009(43): Police suspected that some wooden shelves had come from illigaly lumbered timber in the Amazon. They launched an investigation in to the matter. "Trees are more important than shelves and therefore should be placed on top" A spokesman for the police said in an interview.

 Time to investigate.

5) [Tzadeck] 19-8-2009(5): I have a little potted tree sitting on my shelf, and I found a note in it that said "You will die in 3 days." So, naturally I try to figure out who put it there! Dave Chappelle did a comedy special way back (1997) where he does an impression of a white guy in a horror movie with just one line, 'I'd better investigate!' That would be me in this situation.


text:
# python_utilities

A small collection of useful workflow utilities written in python.

## csv_parser

Tool for properly formatting csv supplied by client with incorrect formatting

## aws_cred_watcher

A tool for updating credentials in a Laravel .env when a file changes. In concert with a Chrome extension that downloads SAML credentials for AWS on login, this keeps the env credentials up to date with the most recent session.


text:
xml-format.el
=============

This is an Emacs package to make it easy to [reformat](https://github.com/purcell/reformatter.el) XML files using the [xmllint](http://xmlsoft.org/xmllint.html) utility. `xmllint` is is part of [libxml2](http://xmlsoft.org/), and available from most software repositories, e.g. `apt install libxml2-utils` on Debian/Ubuntu.

Installation
------------

Install the [xml-format Melpa package](https://melpa.org/#/xml-format) using `M-x package-install`, or via [use-package](https://github.com/jwiegley/use-package):

``` elisp
(use-package xml-format
  :demand t
  :after nxml-mode)
```

Usage
-----

Use one of these commands via `M-x` or bind them to a key:

- `xml-format-on-save-mode`

  Automatically reformat the buffer on save.

- `xml-format-buffer`

  Reformat the current buffer.

- `xml-format-region`

  Reformat the current region.

Configuration
-------------

This package deliberately has minimal configuration. Use `M-x customize-group RET xml-format` or change these variables in your `init.el`:

- `xml-format-xmllint-executable`
- `xml-format-xmllint-args`

License
-------

BSD-3-clause. Copyright © 2019 wouter bolsterlee.

Credits
-------

wouter bolsterlee. wbolster.

https://github.com/wbolster on github. star my repos. fork them. and so on.

https://twitter.com/wbolster on twitter. follow me. or say hi.

repository: emacsmirror/xml-format

repo_name: emacsmirror/xml-format


text:
# Quick Start

## Install cli

Install via [yarn](https://yarnpkg.com) `antdsite-cli`

```bash
yarn global add antdsite-cli
```

or install via [npm](https://docs.npmjs.com/cli/install.html)

```bash
npm install antdsite-cli -g
```

##Create an initial project using cli

Use `cli` to initialize a default initial project

```Celebration
Antdsite my-docs
```

Initialize in an existing project

```Celebration
Antdsite ./-force
```

After the initialization is complete, switch to the initialized directory and run the website.

```Celebration
Yarn start
# 或
Start with npm
```

Visit the default address `localhost:8000` to see the effect page

## Project Structure

After initialization you will see the following directory:

```bash{numberLines:true}
├── .antdsite
    ├── config.js # antdsite configuration file
├── docs # store the document directory
    ├── guide
        ├── introduction.md
        ├── page-collapsed.md
        ├── group-1-item.md
        ├── group-2-item.md
    ├── README.MD
├── src # is mainly used to store 404 pages, put under src/pages because only this directory can be recognized by gatsby
    ├── pages
        ├── 404.js
        ├── 404.css
├── static # Used to store some static files of the website, which can be directly accessed: eg: www.xxx.com/favicon.png
    ├── favicon.png # Used to store website logo
├── package.json # mainly contains devDependencies dependencies: antdsite and gatsby
├── gatsby-config.js # gatsby configuration file, configured, no need to change.
```

Let's briefly explain the configuration file of the initialization project:

```js
module.exports = {
  // Website title, you can not set, the default is the directory name of the document
  title: 'my-docs',
  // Site description, used to generate a description of the seo search and home page.
  description: 'My first antdsite app',
  // Generally shown on the front page and top left corner
  logo: '/favicon.png',
  // The text at the bottom of the home page supports html format
  footer: 'MIT Licensed | Copyright © 2019-present Yi(Yves) Wang',
  // Each element in the format is [tagName, {/* element attribute, which will be attached to the generated element as it is. */}, /* child node */]
  // some elements that will be inserted into the head of the site when the site is generated,
  head: [['link', { rel: 'icon', href: '/favicon.png' }]],
  themeConfig: {
    // The website header link can be set to important and will be displayed in red.
    nav: [
      {
        text: 'Guide',
        link: '/guide'
      },
      {
        text: 'GitHub',
        link: 'https://github.com/YvesCoding/antdsite',
        important: true
      }
    ],
    sidebar: {
      // Note the point.
      // The set property name must be the file/directory that exists in your document directory (default is docs)
      // The physical path of the antdsite lookup file is: docs (the document directory you set) + the key name in the sidebar
      // For example, the physical path corresponding to /guide/ below is docs/guide/
      '/guide/': [
        // Corresponding physical path: docs/guide/introduction.md
        // Since the frontmatter setting home is true, the access path does not have introduction, direct /guide/
        'introduction',
        {
          title: 'page-collapsed',
          children: ['page-collapsed']
        },
        {
          title: 'page-group-exapmle',
          // The secondary menu is collapsed by default, and false is set to default expansion.
          collapsable: false,
          children: [
            // You can set a deeper menu and support up to two layers.
            // See the effect after running the initialization project
            {
              // Set the level 3 menu title
              title: 'group-1',
              // Corresponding physical path: docs/guide/group-1-item.md
              children: ['group-1-item']
            },
            {
              title: 'group-2',
              // Corresponding physical path: docs/guide/group-2-item.md
              children: ['group-2-item']
            }
          ]
        }
      ]
    }
  }
};
```

Relevant information:

- For detailed configuration file description, please refer to: [Configuration section](../config)

- If you want to customize the head, foot, or home page, etc., please refer to [custom theme](theme)

## Screenshots

import ImgWidthBase from '@components/ImgWidthBase'

<ImgWidthBase url="screenshot.png" width={700}/>

<ImgWidthBase url="screenshot-1.png" width={700}/>

<ImgWidthBase url="screenshot-mobile.png" width={330}  />

<ImgWidthBase url="screenshot-mobile-1.png" width={330}/>

<ImgWidthBase url="screenshot-mobile-2.png" width={300}/>

<ImgWidthBase url="screenshot-mobile-3.png" width={300}/>

repository: Lucianing/antdsite

repo_name: Lucianing/antdsite


text:
### Consistency

***

This infobox indicates if the selected gene is consistently altered in mice and humans. If this is
true, the rank is displayed. The better the displayed rank (from low to high) the stronger the gene is consistently altered in human and mice.

repository: saezlab/liver-disease-atlas-app

gha_language: R

gha_license_id: MIT

repo_name: saezlab/liver-disease-atlas-app


text:
#### Overview

The `core-avr-io` library provides various objects and abstractions that are useful for IO on AVR.

##### AvrStream

`AvrStream` is the interface for reading and writing bytes. The naming convention is to avoid naming collisions with various standard library streams.

##### MemoryStream

When the need arises to manipulate a fixed size memory buffer, `MemoryStream` provides a reliable implementation. We provide thorough testing in the `test/` directory.

##### EEPROMStream

The EEPROMStream is one of the more complicated implementations. It covers up the morass of dealing with EEPROM through the `DataFlash` library. Paging is taken care of behind the scenes.

repository: enklu/commons-avr

repo_name: enklu/commons-avr


text:
# How to use?

1. Duplicate security.yml from security.yml.sample
2. Write your asp account's id and password in security.yml

For example

```yml
a8:
  id:
  password:
felmat:
  id: mc-chinju
  password: abcd1234567890
access_trade:
  id:
  password:

...
```

3. Execute following commands

```
$ bundle install
$ bundle exec ruby main.rb
```

4. Output `data.csv` file!

gha_language: Ruby


text:
# TREE

I did some data structures in last year

## Challenge

the challenge is to make breadthFirstTraversal in tree data structures

## Approach & Efficiency

we use while loop in the childes cause we push to the array and want to check from its empty
space -> O(n)
time -> Θ(n)

### UML

![tree](../../assets/tree.png)


text:
[![Coverage Status](https://coveralls.io/repos/github/armory/go-yaml-tools/badge.svg?branch=master)](https://coveralls.io/github/armory/go-yaml-tools?branch=master)

## Go implementation of this library:

https://github.com/armory-io/yaml-tools/blob/master/yamltools/resolver.py

## How To Use This Package

The main package is the `spring` package.

The only exposed function is:

```
func LoadProperties(propNames []string, configDir string, envKeyPairs []string) (map[string]interface{}, error)
```

For example if you want to load the following files:

* `spinnaker.yml`
* `spinnaker-local.yml`
* `gate-local.yml`
* `gate-armory.yml`

For `propNames` you would give

```
["spinnaker", "gate"]
```

and you'll need to make sure your `envKeyPairs` has the following key pair as one of it's
variables
```
SPRING_PROFILES_ACTIVE="armory,local"
```

The `configDir` is where the configuration files live, typically `/opt/spinnaker/config` for Spinnaker files.

repository: armory/go-yaml-tools

gha_language: Go

repo_name: armory/go-yaml-tools


text:
# Tutorial

Below is a quick tutorial to help get you started. Note that we assume you have [Julia](https://julialang.org/) installed and configured already.

## Getting Makie
Enter the package manager by typing `]` into the Repl. You should see `pkg>`.
```julia
add Makie
```

## Getting the development version of Makie
Run the following commands in the package manager:
```julia
add Makie#master AbstractPlotting#master GLMakie#master
```

The first use of Makie might take a little bit of time, due to precompilation.

## Set the `Scene`

The `Scene` object holds everything in a plot, and you can initialize it like so:

```julia
scene = Scene()
```

Note that before you put anything in the scene, it will be blank!

## Getting help

The user-facing functions of Makie are pretty well documented, so you can usually use the help mode in the REPL, or your editor of choice. If you countinue to have issues, see [Getting Help](@ref).

## Basic plotting

Below are some examples of basic plots to help you get oriented.

You can put your mouse in the plot window and scroll to zoom. **Right click and drag** lets you pan around the scene, and **left click and drag** lets you do selection zoom (in 2D plots), or orbit around the scene (in 3D plots).

Many of these examples also work in 3D.

It is worth noting initally that if you run a Makie.jl example and nothing shows up, you likely need to do `display(scene)` to render the example on screen.

### Scatter plot

@example_database("Tutorial simple scatter")

@example_database("Tutorial markersize")

### Line plot

@example_database("Tutorial simple line")

### Adding a title

@example_database("Tutorial title")

### Adding to a scene

@example_database("Tutorial adding to a scene")

### Removing from a scene

@example_database("Tutorial removing from a scene")

### Adjusting scene limits

@example_database("Tutorial adjusting scene limits")

You can also use the convenience functions [`xlims!`](@ref), [`ylims!`](@ref) and [`zlims!`](@ref).

### Basic theming

@example_database("Tutorial basic theming")

### Statistical plotting

`Makie` has a lot of support for statistical plots through `StatsMakie.jl`.
See the [StatsMakie Tutorial](@ref) section for more information on this.

## Controlling display programmatically

`Scene`s will only display by default in global scope.  To make a Scene display when it's defined in a local scope,
like a function or a module, you can call `display(scene)`, which will automatically display it in the best available
display.
You can force display to the backend's preferred window by calling `display(AbstractPlotting.PlotDisplay(), scene)`.

## Saving plots

Makie overloads the `FileIO` interface, so it is simple to save Scenes as images.

## Static plots

To save a `scene` as an image, you can just write e.g.:

```julia
Makie.save("plot.png", scene)
Makie.save("plot.jpg", scene)
```
where `scene` is the scene handle.

See [Output](@ref) for more information.

## Animations

See the [Animation](@ref) section, as well as the [Interaction](@ref) section.

## More examples

See the [Example Gallery](http://juliaplots.org/MakieReferenceImages/gallery/index.html).


text:
#Setting Up CAS to Use a Database

This is the second tutorial on my CAS and secure coding series.  It will take you through a more complex CAS set up to a database and show how to fix and correct certain common web application problems.

Step One:  Set up MySQl database.
Download MySQL.  Currently for windows go to https://dev.mysql.com/downloads/windows/installer/.  Download the mysql-installer-web-community-<IP_ADDRESS>.msi.  Run the installer.  On the screen where you set up your root account go ahead and add another account with DBAdmin rights.  This account is catAdmin / catPass.

Step Two:  Create your databases.
From the commandline client:

	CREATE DATABASE insecureCat;
	Use insecureCat;

	CREATE TABLE `catlovers` (
		 `cat_name` varchar(45) NOT NULL,
  		`email` varchar(45) NOT NULL,
  		`uname` varchar(45) NOT NULL,
  		`pass` varchar(45) NOT NULL,
  		`regdate` date NOT NULL,
		`securityQuestion` varchar(45) NOT NULL,
  		`answer` varchar(45) NOT NULL,
  		PRIMARY KEY  (`email`)
	);

	CREATE TABLE `catcomments` (
		`id` int(10) unsigned NOT NULL auto_increment,
		`uname` varchar(45) NOT NULL,
		`writtenBy` varchar(45) NOT NULL,
		`comment` varchar(128) NOT NULL,
		PRIMARY KEY  (`id`)
	);

	CREATE TABLE `catphotos` (
		`uname` varchar(45) NOT NULL,
		`private` varchar(1) NOT NULL,
		`public` varchar(1) NOT NULL,
  		PRIMARY KEY  (`uname`)
	);

Step Three:  Modify CAS Client from tutorial 1 to use this database.
Modify your cas pom to include:

	<dependency>
		<groupId>org.jasig.cas</groupId>
		<artifactId>cas-server-support-jdbc</artifactId>
		<version>${cas.version}</version>
	</dependency>
	<dependency>
		<groupId>c3p0</groupId>
		<artifactId>c3p0</artifactId>
		<version><IP_ADDRESS></version>
	</dependency>
	<dependency>
        	<groupId>mysql</groupId>
        	<artifactId>mysql-connector-java</artifactId>
        	<version>5.1.26</version>
    	</dependency>

Modify the deployConfigContext.xml
Add the following beans:

	<bean id="passwordEncoder"
      		class="org.jasig.cas.authentication.handler.PlainTextPasswordEncoder" />

	<bean id="dbAuthHandler"
      		class="org.jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler"
      		p:dataSource-ref="dataSource"
      		p:passwordEncoder-ref="passwordEncoder"
      		p:tableUsers="catlovers"
      		p:fieldUser="uname"
      		p:fieldPassword="pass" />

	<bean id="dataSource"
		class="com.mchange.v2.c3p0.ComboPooledDataSource"
		p:driverClass="${database.driverClass}"
		p:jdbcUrl="${database.url}"
		p:user="${database.user}"
		p:password="${database.password}"
		p:initialPoolSize="${database.pool.minSize}"
		p:minPoolSize="${database.pool.minSize}"
		p:maxPoolSize="${database.pool.maxSize}"
		p:maxIdleTimeExcessConnections="${database.pool.maxIdleTime}"
		p:checkoutTimeout="${database.pool.maxWait}"
		p:acquireIncrement="${database.pool.acquireIncrement}"
		p:acquireRetryAttempts="${database.pool.acquireRetryAttempts}"
		p:acquireRetryDelay="${database.pool.acquireRetryDelay}"
		p:idleConnectionTestPeriod="${database.pool.idleConnectionTestPeriod}"
		p:preferredTestQuery="${database.pool.connectionHealthQuery}" />

Change the authenticationManager to point to the dbAuthHandler

    <bean id="authenticationManager" class="org.jasig.cas.authentication.PolicyBasedAuthenticationManager">
        <constructor-arg>
            <map>
                <!--
                   | IMPORTANT
                   | Every handler requires a unique name.
                   | If more than one instance of the same handler class is configured, you must explicitly
                   | set its name to something other than its default name (typically the simple class name).
                   -->
                <entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" />
                <entry key-ref="dbAuthHandler" value-ref="primaryPrincipalResolver" />
            </map>
        </constructor-arg>

Copy the cas.properties from a target to src.  Add the following to the bottom:

     # == Basic database connection pool configuration ==
    database.driverClass=com.mysql.jdbc.Driver
    database.url=jdbc:mysql://localhost:3306/insecureCat
    database.user=catAdmin
    database.password=catPass
    database.pool.minSize=6
    database.pool.maxSize=18

    # Maximum amount of time to wait in ms for a connection to become
    # available when the pool is exhausted
    database.pool.maxWait=10000

    # Amount of time in seconds after which idle connections
    # in excess of minimum size are pruned.
    database.pool.maxIdleTime=120

    # Number of connections to obtain on pool exhaustion condition.
    # The maximum pool size is always respected when acquiring
    # new connections.
    database.pool.acquireIncrement=6

    # == Connection testing settings ==

    # Period in s at which a health query will be issued on idle
    # connections to determine connection liveliness.
    database.pool.idleConnectionTestPeriod=30

    # Query executed periodically to test health
    database.pool.connectionHealthQuery=select 1

    # == Database recovery settings ==

    # Number of times to retry acquiring a _new_ connection
    # when an error is encountered during acquisition.
    database.pool.acquireRetryAttempts=5

    # Amount of time in ms to wait between successive aquire retry attempts.
    database.pool.acquireRetryDelay=2000

Now you are ready to start the OWASP top 10 tutorials.  CAS-tutorials 3 and 4 are part of one of the OWASP top 10 tutorials.

repository: securitymagick/CAS-tutorials

repo_name: securitymagick/CAS-tutorials


text:
# user-service
A simple and basic user microservice. Created using ExpressJs and tested using assert, mocha and supertest.

The target of this project was to get a deeper understanding of the microservice architecture as well as other concepts related to a distributed environment hosted in the cloud.

The microservice is implemented using the following patterns:
- Event Sourcing
- Command Query Responsibility Segregation
- Onion architecture

## Onion architecture

This pattern is used for maintain business logic from infrastructure logic as indipendent as possibile. This leads to having a big easiness in mocking injected dependencies in each module of the business and infrastructure logic and simplifies unit and integration testing code.

It allowed also to develop this project "infrastructure independent": changing the actual implementation of the event store and the event broker it's very easy to switch from an infrastructure to another (from cloud to local, from one cloud provider to another) while preserving each piece of the business and infrastructure logic intact.

## Event Store

As event-driven data management, Event sourcing was the best fit. It's atomicy of storing and publishing events and the possibility to implement temporal queries made it a good choice.

For testing purposes, the microservice relies on an in-memory mocked event store database (you can find it under `user-service/lib/eventSourcing/eventStore/db`).

For production purposes, it relies on Amazon DynamoDB or any other event store that implements the following [interface](https://github.com/Danver97/user-service/blob/master/lib/eventSourcing/eventStore/index.js).

On AWS the event are published using triggers on DynamoDB Streams which invokes an AWS Lambda function that publishes the event to an AWS SNS topic that is resposible to deliver the event to all the subscribed AWS SQS queues (tipically 1 queue for each microservice of the system).

Event sourcing leads to **CQRS** to implement queries.

## Setup

```
npm install
npm test
npm start
```

## News

**Update 03/11/2018: Introduced support for AWS**

Introduced support for AWS. Under `/lib/AWS` it's possible to find a module used for create the AWS infrastructure used as Event Store and Event Broker for an event sourcing platform. The purpose for this module is to ensure that every AWS service is configured properly before starting accepting requests.

A big part of the entire project is still under development. In particular everything about events replay and event aggregates' projections aren't implemented yet. For now, the main design is:
- Replay events from the event store (on AWS: DynamoDB) (this stage is optional if the projection is "up to date")
- Enqueue them in an event broker (on AWS: SQS)
- Poll the event broker and make events deduplication & idempotency checks before applying them on the projection.


text:
# Code challenge 18:

## Fizz-Buzz-Tree
<!-- Description of the challenge -->
- To Write a function called fizz buzz tree that will accept a k-tree as a value and will check each node inside the tree wether is divisible by 3 or is divisible by 5,or  is divisible by 3 and 5, or  is not divisible by 3 or 5,and will return a return a result depending on these conditions

### Whiteboard Process
<!-- Embedded whiteboard image -->

![image](/images/fizzBuzz.png)

### Approach & Efficiency
<!-- What approach did you take? Discuss Why. What is the Big O space/time for this approach? -->
- test result:
![image](/images/fizzbuzz-test.PNG)

- Big O
   - Time <--- O(1)
   - Space <----- O(1)

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

- Pull request
[PR](https://github.com/Razan-am/data-structures-and-algorithms/pull/45/)

- Action:
[action](https://github.com/Razan-am/data-structures-and-algorithms/runs/3486645228?check_suite_focus=true)


text:
---
layout:     post
title:      "The Hash Table data structure"
subtitle:   "#data-structures series"
date:       2016-01-12 21:11:19
author:     "Benoit VALLON"
header-img: "/img/2016-01-12-the-hash-table-data-structure/post-the-hash-table-data-structure.jpg"
comments:   true
categories: data-structures-in-javascript
tags:       [algorithms, data-structures, hash-table]
---

{% include_relative data-structures-series/about-the-series.md %}

# The Hash Table data structure

## Definition

> A Hash Table (Hash Map) is a data structure used to implement an associative array, a structure that can map keys to values. A Hash Table uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be found.
**From [Wikipedia](https://en.wikipedia.org/wiki/Hash_table)**

Hash Tables are considered the more efficient data structure for lookup and for this reason, they are widely used.

## Complexity

Average ||||
--- | --- | --- | ---
Access|Search|Insertion|Deletion
- | O(1) | O(1) | O(1)

To get a full overview of the time and space complexity of the Hash Table data structure, have a look to this excellent [Big O cheat sheet](http://bigocheatsheet.com/).

## The code

Because my `calculateHash` function is overly simple (mod of the key length) I need to be sure that I am able to save more than one value for every hash. As a consequence I am storing another object for every hash in my Hash Table.

A better example would have had a `calculateHash` function that returns only one possible hash for every key. I could have done that with a simple JavaScript `Object` (the hash being the same as the key) but the specificity of the Hash Table data structure is to have this special `calculateHash` function.

{% include_relative data-structures-series/hash-table.md %}


text:
---
layout: post
title: "Heathrow consultation 'a shambles'"
permalink: /archives/2019/08/frp-heathrow-consultation-a-shambles.html
commentfile: 2019-08-28-frp-heathrow-consultation-a-shambles
category: news
date: 2019-08-28 15:06:22
image: "/assets/images/2019/FRP-heathrow-2019-thumb.jpg"
excerpt: |
    Conservation charity Friends of Richmond Park (FRP) has assessed Heathrow's final public consultation (closing 13th Sept) prior to applying for permission to build the 3rd runway.  FRP believes the consultation's treatment of Richmond Park is "a shambles."
---

Conservation charity Friends of Richmond Park (FRP) has assessed Heathrow's final public consultation (closing 13th Sept) prior to applying for permission to build the 3rd runway.  FRP believes the consultation's treatment of Richmond Park is "a shambles" concluding:

- The Park is only partially covered
- Where it is covered some of results are not credible
- The approach and methodology are biased against large open spaces such as the Park
- No regard is given to the Park's importance as a place of respite and relaxation for Londoners
- No regard is given to the Park as London's largest National Nature Reserve, a refuge for abundant wildlife.

Ron Crompton, Chair of FRP says:

> "Richmond Park is important for all Londoners as an escape from the noise and bustle of the city attracting 5.5 million visitors a year, almost the same as the British Museum. So you would think it would be regarded with the status it warrants by Heathrow.

> Yet the consultation's environmental report barely discusses it. It's left out in places where it should be covered, in other places it gets passing reference and in many cases the material presented is inadequate. Heathrow must undertake a proper environmental assessment."

After spending weeks reviewing some 8,900 pages of Heathrow's consultation, FRP have produced [their report responding to it](/assets/images/2019/FRP-report-on-heathrow-and-richmond-park.pdf).

For example, Heathrow plans for 47 arriving aircraft/hour and a big increase in departing aircraft, all at high noise levels (67-86dB) directly over the Park. Yet they conclude the end result to be an increase in noise of less than 3 dB (on the Park's 30dB ambient level).

> Heathrow have achieved this ludicrously low figure by flattening out average noise over the day rather than the reality of frequent peaks of noise adversely affecting wildlife and Park users", says Crompton.

> The Park is mentioned specifically as having 'relative tranquillity' but the impact of the proposals is, they claim, expected to be negligible/slight -  extraordinary when the proposals are for noisy flights over the quietest place in London.

> For aircraft emissions Richmond Park is only considered for stag beetles, when emissions will have a much bigger effect on the Park's veteran trees and acid grassland".

Crompton concludes:

> "This is absurd. Richmond Park is probably London's most important place for wildlife and public wellbeing, yet they have only done a half-baked environmental assessment and concluded that their new flight paths - low and loud directly over the Park for the first time - will have negligible effect.

> We're calling for a full Environmental Impact Assessment (EIA) of Richmond Park to be done for the planning enquiry next year, so that the Inspector has all the information he or she needs to make a considered decision"

With Heathrow's consultation closing on 13th Sept, FRP calls on the millions of Londoners who visit and love the Park's tranquillity to object and, like us, demand Heathrow conduct a full environmental and social impact.

-- from a Friends of Richmond Pa press release - 31 August 2019

repository: pmahnke/stmgrts

gha_language: HTML

repo_name: pmahnke/stmgrts


text:
# httpmock [![Build Status](https://github.com/jarcoal/httpmock/workflows/Build/badge.svg?branch=v1)](https://github.com/jarcoal/httpmock/actions?query=workflow%3ABuild) [![Coverage Status](https://coveralls.io/repos/github/jarcoal/httpmock/badge.svg?branch=v1)](https://coveralls.io/github/jarcoal/httpmock?branch=v1) [![GoDoc](https://godoc.org/github.com/jarcoal/httpmock?status.svg)](https://godoc.org/github.com/jarcoal/httpmock) [![Version](https://img.shields.io/github/tag/jarcoal/httpmock.svg)](https://github.com/jarcoal/httpmock/releases) [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go/#testing)

Easy mocking of http responses from external resources.

## Install

Currently supports Go 1.13 to 1.21 and is regularly tested against tip.

`v1` branch has to be used instead of `master`.

In your go files, simply use:
```go
import "github.com/jarcoal/httpmock"
```

Then next `go mod tidy` or `go test` invocation will automatically
populate your `go.mod` with the latest httpmock release, now
[![Version](https://img.shields.io/github/tag/jarcoal/httpmock.svg)](https://github.com/jarcoal/httpmock/releases).

## Usage

### Simple Example:
```go
func TestFetchArticles(t *testing.T) {
  httpmock.Activate()
  defer httpmock.DeactivateAndReset()

  // Exact URL match
  httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles",
    httpmock.NewStringResponder(200, `[{"id": 1, "name": "My Great Article"}]`))

  // Regexp match (could use httpmock.RegisterRegexpResponder instead)
  httpmock.RegisterResponder("GET", `=~^https://api\.mybiz\.com/articles/id/\d+\z`,
    httpmock.NewStringResponder(200, `{"id": 1, "name": "My Great Article"}`))

  // do stuff that makes a request to articles
  ...

  // get count info
  httpmock.GetTotalCallCount()

  // get the amount of calls for the registered responder
  info := httpmock.GetCallCountInfo()
  info["GET https://api.mybiz.com/articles"] // number of GET calls made to https://api.mybiz.com/articles
  info["GET https://api.mybiz.com/articles/id/12"] // number of GET calls made to https://api.mybiz.com/articles/id/12
  info[`GET =~^https://api\.mybiz\.com/articles/id/\d+\z`] // number of GET calls made to https://api.mybiz.com/articles/id/<any-number>
}
```

### Advanced Example:
```go
func TestFetchArticles(t *testing.T) {
  httpmock.Activate()
  defer httpmock.DeactivateAndReset()

  // our database of articles
  articles := make([]map[string]interface{}, 0)

  // mock to list out the articles
  httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles",
    func(req *http.Request) (*http.Response, error) {
      resp, err := httpmock.NewJsonResponse(200, articles)
      if err != nil {
        return httpmock.NewStringResponse(500, ""), nil
      }
      return resp, nil
    })

  // return an article related to the request with the help of regexp submatch (\d+)
  httpmock.RegisterResponder("GET", `=~^https://api\.mybiz\.com/articles/id/(\d+)\z`,
    func(req *http.Request) (*http.Response, error) {
      // Get ID from request
      id := httpmock.MustGetSubmatchAsUint(req, 1) // 1=first regexp submatch
      return httpmock.NewJsonResponse(200, map[string]interface{}{
        "id":   id,
        "name": "My Great Article",
      })
    })

  // mock to add a new article
  httpmock.RegisterResponder("POST", "https://api.mybiz.com/articles",
    func(req *http.Request) (*http.Response, error) {
      article := make(map[string]interface{})
      if err := json.NewDecoder(req.Body).Decode(&article); err != nil {
        return httpmock.NewStringResponse(400, ""), nil
      }

      articles = append(articles, article)

      resp, err := httpmock.NewJsonResponse(200, article)
      if err != nil {
        return httpmock.NewStringResponse(500, ""), nil
      }
      return resp, nil
    })

  // mock to add a specific article, send a Bad Request response
  // when the request body contains `"type":"toy"`
  httpmock.RegisterMatcherResponder("POST", "https://api.mybiz.com/articles",
    httpmock.BodyContainsString(`"type":"toy"`),
    httpmock.NewStringResponder(400, `{"reason":"Invalid article type"}`))

  // do stuff that adds and checks articles
}
```

### Algorithm

When `GET http://example.tld/some/path?b=12&a=foo&a=bar` request is
caught, all standard responders are checked against the following URL
or paths, the first match stops the search:

1. `http://example.tld/some/path?b=12&a=foo&a=bar` (original URL)
1. `http://example.tld/some/path?a=bar&a=foo&b=12` (sorted query params)
1. `http://example.tld/some/path` (without query params)
1. `/some/path?b=12&a=foo&a=bar` (original URL without scheme and host)
1. `/some/path?a=bar&a=foo&b=12` (same, but sorted query params)
1. `/some/path` (path only)

If no standard responder matched, the regexp responders are checked,
in the same order, the first match stops the search.

### [go-testdeep](https://go-testdeep.zetta.rocks/) + [tdsuite](https://pkg.go.dev/github.com/maxatome/go-testdeep/helpers/tdsuite) example:
```go
// article_test.go

import (
  "testing"

  "github.com/jarcoal/httpmock"
  "github.com/maxatome/go-testdeep/helpers/tdsuite"
  "github.com/maxatome/go-testdeep/td"
)

type MySuite struct{}

func (s *MySuite) Setup(t *td.T) error {
  // block all HTTP requests
  httpmock.Activate()
  return nil
}

func (s *MySuite) PostTest(t *td.T, testName string) error {
  // remove any mocks after each test
  httpmock.Reset()
  return nil
}

func (s *MySuite) Destroy(t *td.T) error {
  httpmock.DeactivateAndReset()
  return nil
}

func TestMySuite(t *testing.T) {
  tdsuite.Run(t, &MySuite{})
}

func (s *MySuite) TestArticles(assert, require *td.T) {
  httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles.json",
    httpmock.NewStringResponder(200, `[{"id": 1, "name": "My Great Article"}]`))

  // do stuff that makes a request to articles.json
}
```

### [Ginkgo](https://onsi.github.io/ginkgo/) example:
```go
// article_suite_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
)
// ...
var _ = BeforeSuite(func() {
  // block all HTTP requests
  httpmock.Activate()
})

var _ = BeforeEach(func() {
  // remove any mocks
  httpmock.Reset()
})

var _ = AfterSuite(func() {
  httpmock.DeactivateAndReset()
})

// article_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
)

var _ = Describe("Articles", func() {
  It("returns a list of articles", func() {
    httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles.json",
      httpmock.NewStringResponder(200, `[{"id": 1, "name": "My Great Article"}]`))

    // do stuff that makes a request to articles.json
  })
})
```

### [Ginkgo](https://onsi.github.io/ginkgo/) + [Resty](https://github.com/go-resty/resty) Example:
```go
// article_suite_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
  "github.com/go-resty/resty"
)
// ...
var _ = BeforeSuite(func() {
  // block all HTTP requests
  httpmock.ActivateNonDefault(resty.DefaultClient.GetClient())
})

var _ = BeforeEach(func() {
  // remove any mocks
  httpmock.Reset()
})

var _ = AfterSuite(func() {
  httpmock.DeactivateAndReset()
})

// article_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
  "github.com/go-resty/resty"
)

var _ = Describe("Articles", func() {
  It("returns a list of articles", func() {
    fixture := `{"status":{"message": "Your message", "code": 200}}`
    responder := httpmock.NewStringResponder(200, fixture)
    fakeUrl := "https://api.mybiz.com/articles.json"
    httpmock.RegisterResponder("GET", fakeUrl, responder)

    // fetch the article into struct
    articleObject := &models.Article{}
    _, err := resty.R().SetResult(articleObject).Get(fakeUrl)

    // do stuff with the article object ...
  })
})
```

repository: jarcoal/httpmock

repo_name: jarcoal/httpmock


text:
# haunted-heist
Haunted Heist is a fun mini text-based game created using C++ and Xcode!

This project is inspired from a very popular text-based game from the 80s named Zork. All gameplay of Haunted Heist is console based.

Haunted Heist is a pair project with me and my classmates & friend Alvin. The objective of this project is to practice our skills of coding in C++, which includes the implementation of advanced concepts such as inheritance and pointers.

# The Story
You are standing outside a dark & creepy house that's rumored to be haunted.
Your goal is to navigate the house and steal the treasure hidden in the house, probably protected by ghosts?

Do not be afraid, as you came prepared! You have your very own specially designed vacuum machine and some batteries to protect yourself, along with a backpack to store stuff!

# Valid Commands
1. go - go in that direction (north, south, east, west, up, down)
2. look - observe your surroundings
3. check - check objects
4. open - open objects ('open bag' to view inventory)
5. take - pick up items
6. use - use items in your bag
7. map - opens up the house map (if you have one!)
8. life - show your current life level
9. quit/exit - exit the game


text:
---
layout: default
---

# 1996-07-13 - Can't block caller ID in Massachusetts? (fwd)

## Header Data

From<EMAIL_ADDRESS>(Charles Gimon)

To<EMAIL_ADDRESS>Message Hash: 7aa1efd154367ed2c000d7b44296ba8277a0e128911efba40b08d7bea90146d4

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-07-13 06:06:19 UTC

Raw Date: Sat, 13 Jul 1996 14:06:19 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Charles Gimon)
Date: Sat, 13 Jul 1996 14:06:19 +0800
To<EMAIL_ADDRESS>Subject: Can't block caller ID in Massachusetts? (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Forwarded message:
> From: David Mazieres<EMAIL_ADDRESS>> To<EMAIL_ADDRESS>> Subject: Can't block caller ID in Massachusetts?
>
> My last phone bill said that Nynex is now giving out people's names in
> addidtion to their phone numbers over caller-id.  I therefore called
> Nynex and told them to block caller-id on my phone line.
>
> They said no problem, but...  They said nothing I can do will block it
> when I call 800 numbers.  "The people with 800 numbers have special
> software, and there is nothing you can do to block your identity when
> calling them.  Not even *67."
>
> Wow.  Maybe I'm not paranoid enough, but I never expected this.  I can
> never again call an 800 number anonymously to get information about
> something unless I go out to a pay phone.  What an incredible
> inconvenience, and how truly depressing.
>

This has been true for years. On 800 numbers, the receiver gets ANI, not
CID. Check newsgroups like alt.dcom.telecom, comp.dcom.telecom, etc.:
there's always somebody talking about CID and ANI.

In the back of my mind, I remember hearing about an anonymizer for
800-number calls. Maybe at WilTel. Check the search engine of your choice.

Personally, I like Caller ID, because it gives individuals a service
that formerly only governments and corporations could get.

<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

+ Return to [July 1996](/archive/1996/07)

+ Return to<EMAIL_ADDRESS>(Charles Gimon)](/authors/gimonca_at_skypoint_com_charles_gimon_)"

+ 1996-07-13 (Sat, 13 Jul 1996 14:06:19 +0800) - Can't block caller ID in Massachusetts? (fwd) -<EMAIL_ADDRESS>(Charles Gimon)_


text:
# Docker

## Images

This repository contains my **Docker Image** used in development and production environments.

Based on community images and official images

- [Exim4 SMTP](https://github.com/Jni75/docker/tree/master/images/exim4-smtp)
- [MariaDB](https://github.com/Jni75/docker/tree/master/images/mariadb)
- [Pure-FTPd](https://github.com/Jni75/docker/tree/master/images/pure-ftpd)
- [Traefik](https://github.com/Jni75/docker/tree/master/images/traefik)

## Tips

See [Tips readme file](https://github.com/Jni75/docker/tree/master/tips) for Docker Tips


text:
![PRL: We Can Prove It](https://pbs.twimg.com/media/Ch1klO6U4AAlj62.jpg)

(image courtesy of [@tranngocma](http://twitter.com/tranngocma))

### What is RedPRL?

*RedPRL* is the People's Refinement Logic, a next-generation homage
to [Nuprl](http://www.nuprl.org); RedPRL was preceeded by
[JonPRL](http://www.github.com/jonsterling/jonprl), written by Jon Sterling,
Danny Gratzer and Vincent Rahli.

The purpose of RedPRL is to consolidate several advances in refinement logics,
including:

- a multi-sorted version of abstract binding trees
- support for nominal abstraction and unguessable atoms
- a dependent version of the LCF apparatus to support refinement rules
  whose premises depend on each other's evidence

### Literature and background on RedPRL

RedPRL is a proof assistant for Nominal Multi-Sorted Computational Type Theory,
whose semantics are defined in Sterling & Morrison's
[Type Refinements for the Working Class](https://github.com/jonsterling/type-refinements-for-the-working-class). The syntactic framework is described in
[Syntax and Semantics of Abstract Binding Trees](https://github.com/jonsterling/syntax-and-semantics-of-abts),
also by Sterling & Morrison.

### What is this repository?

This is the repository for the nascent development of RedPRL. RedPRL is an
experiment which is constantly changing; we do not yet have strong
documentation, but we have an IRC channel on Freenode (#redprl) where we
encourage anyone to ask any question, no matter how silly it may seem.

### How do I build it?

First, fetch all submodules. If you are cloning for the first time, use

    git clone --recursive git@github.com:RedPRL/sml-redprl.git

If you have already cloned, then be sure to make sure all submodules are up to date,
as follows:

    git submodule update --init --recursive

Next, make sure that you have the [MLton compiler](http://mlton.org/) for Standard
ML installed. Then, simply run

    ./script/mlton.sh

Then, a binary will be placed in `./bin/redprl`, which you may run as
follows

    ./bin/redprl my-development.prl

repository: syohex/sml-redprl

repo_name: syohex/sml-redprl


text:
# flatiron-role-call
A JavaScript project

## How to create your first pull Request
- Fork this project
- Clone your fork to your computer
- Set up the cloned repository in your working environment
- Create a branch with your name:
    ```
    git checkout -b firstName-lastName
    ```
- In src/main.js look at the provided examples and write your function
- Add your function call at the bottom of the file
- Save all changes
- Add/Commit your changes
- Change back to master branch
- Merge your named branch into Master branch
- Push your changes
- Delete your named branch
  ```
  git branch -d firstName-lastName
  ```
- Go to the original project on github (not your fork) and open a  new pullrequest
- Hit create pull request
- If everything is green, hit create pull request again.

repository: cjbrock/flatiron-role-call

repo_name: cjbrock/flatiron-role-call


text:
# GAUSS-53600 -- GAUSS-53699

GAUSS-53600: "CA password must contain at least eight characters."

SQLSTATE: None

Description:Internal system error.

Solution:Contact technical support.

GAUSS-53601: "CA password cannot contain %s."

SQLSTATE: None

Description:Internal system error.

Solution:Contact technical support.

GAUSS-53602: "CA password is too simple."

SQLSTATE: None

Description:Internal system error.

Solution:Contact technical support.


text:
# Simple

1. check if java and javac commands in terminal are working fine.

2. run `javac Simple.java` it produces Simple.class as output

3. run `java Simple` and you can find an incredible message printed on terminal.

## Resources

- It is a tutorial follow of [this](https://www.javatpoint.com/simple-program-of-java) page

repository: Megha-KC/javalets

repo_name: Megha-KC/javalets


text:
---
layout: post
title:  "Riverside Leisure Area"
date:   2018-04-24 10:18:04 +0000
categories: [outdoors, kent, park]
tag: Gravesend
permalink:
excerpt: Gravesends' Riverside leisure area has a lot to offer those willing to explore a little.  There is an old fort with many artillary batteries still in place, the oldest building in Gravesend, 2 play parks, a skate park, fishing pond, outdoors gym, cafe and toilets.

images:
 - url: https://justaddapicnic.com/images/kent/outdoors/gravesend-riverside/riverside2.jpg
   alt: Military fort and gun batteries at Riverside leisure area
   title: Gravesend Riverside Leisure Area
---

## What's there?
There is a lot to see and do here at the Riverside Leisure Area.   To the left of the park entrance you will find New Tavern Fort and gardens which also encompasses the oldest building in Gravesend; [Milton Chantry](/indoors/kent/museum/2018/04/23/milton-chantry.html), which can be enjoyed for free.

The main park has a large fishing lake with fountain, and the first of the children's play areas can be found close to the lake.  This park is aimed at older children with complex climbing structures and a spinning swing.  Next to the Promenade Cafe there is another play park aimed at much younger children with a lovely climbing frame with slides and some swings. There are several large patches of grass along the river embankment, perfect for picnics.  To the western end of the river promenade you will find a large outdoor gym, multi-use games area and low climbing wall.  There is also a shady, wild area with another pool and bridge to be enjoyed away from the main park.

There are several benches located around the park, a few with tables, but it is worth bringing your own picnic blanket so you can sit where you find a spot to enjoy.  There is a large toilet block next to the Promenade Cafe, by the river.  Parking is pay and display.

### New Tavern Fort
[New Tavern Fort](http://www.discovergravesham.co.uk/gravesend/new-tavern-fort.html) is an 18th Century military fort that was put in place to compliment the older Tilbury Fort, on the Essex coast, to protect the River Thames and London from marauding ships making their way up the river.  It has many of the artillary batteries still in place, from cannons to anti-aircraft guns.  The gardens and emplacements can be explored for free.  You can pay to walk around the tunnels within the fort, and discover more of the history, on weekends between April - Septemeber see the [Discover Gravesham Website](http://www.discovergravesham.co.uk/gravesend/new-tavern-fort.html) for more details.

[Gravesham Council Website](https://www.gravesham.gov.uk/home/community-and-leisure/parks-and-play-areas/riverside-leisure-area?utm_content=buffer04034&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer)

#### Close by
[Milton Chantry](/indoors/kent/museum/2018/04/24/milton-chantry.html), the oldest building in Gravesend, is now a free museum documenting some of the history of the building and the area.

Gravesend town centre is a short walk from the park.

## Gallery

### How to find it...

Milton Pl, Gravesend DA12 2BT

### What to take

There are lots of large green spaces here to enjoy ball games.

The pavements are quite wide and flat, perfect for cycling, skate boarding and rollerskating.

extension: markdown


text:
---
layout: post
title:  Testing multi-threaded asynchronous code in Java
intro: Test operates in one thread. The code under test runs in other threads, which your test knows nothing about. So how do you test multi-threaded code?
meta: A test operates in one thread. The code under test runs in other threads, which your test knows nothing about. So how do you test multi-threaded code?
date:   2018-06-08 11:15:00 +0100
---

A test operates in one thread. The code under test runs in other threads, which your test knows nothing about.

So how do you test multi-threaded code?

I'll show you how I did that to test my multi-client [Java echo server](https://github.com/laurentqro/echoServer).

Here is my server code:

```java
// src/main/java/EchoServer.java

public class EchoServer {
  private ServerSocket serverSocket;

  EchoServer(ServerSocket serverSocket) {
    this.serverSocket = serverSocket;
    this.executor = Executors.newFixedThreadPool(2);
  }

  public void start() {
    while(true) {
      listenForClients();
    }
  }

  private void listenForClients() {
    Socket socket = serverSocket.accept();
    executor.execute(new EchoServerThread(socket));
  }
}
```

Initially, I set off to make all my code run in the same thread. If it's all in the same thread, it should be easy to test, right?

Let's use dependency injection to enable our test to replace the multi-thread executor with a single-thread one:

```java
// src/main/java/EchoServer.java

public class EchoServer {
  private ServerSocket serverSocket;
  private Executor executor;

  EchoServer(ServerSocket serverSocket, Executor executor) {
    this.serverSocket = serverSocket;
    this.executor = executor;
  }

  public void start() {
    while(true) {
      listenForClients();
    }
  }

  private void listenForClients() {
    Socket socket = serverSocket.accept();
    executor.execute(new EchoServerThread(socket));
  }
}
```

In the test, let's inject the single-thread executor:

```java
// src/test/java/EchoServerTest.java
public class EchoServerTest {
  @Test
  public void broadcastsToAllClients() {
    // set up fake server socket
    // create three clients

    Executor singleThreadExecutor = Executors.newSingleThreadExecutor();
    EchoServer echoServer = new EchoServer(fakeServerSocket, singleThreadExecutor));

    echoServer.listenForClients();
    echoServer.listenForClients();
    echoServer.listenForClients();

    String expected = "hello from client 1\nhello from client 2\nhello from client 3";

    assertEquals(expected, client1.getSocket().getOutputStream().toString().trim());
  }
```

Let's run the test ...

```
  // System OUT: Accepting client ...
  // System OUT: Accepted client.

  // System OUT: Accepting client ...
  // System OUT: Accepted client.

  // System OUT: Accepting client ...
  // System OUT: Accepted client.

    org.junit.ComparisonFailure

    [stacktrace]

  // System OUT: Accepted client on thread: pool-2-thread-1

    Process finished with exit code 255
```

... and **fail**.

Do you notice anything weird?

The last call to `System.out` occured _after_ the test assertion failed.

The test ran in the `main` thread, the code in another. The test completely ignored it and completed before it had a chance to finish execution.

### Wait a second

Let's make the test wait for the thread to finish running:

```java
// src/test/java/EchoServerTest.java

public class EchoServerTest {
  @Test
  public void broadcastsToAllClients() {
    // set up fake server socket
    // create three clients

    Executor singleThreadExecutor = Executors.newSingleThreadExecutor();
    EchoServer echoServer = new EchoServer(fakeServerSocket, singleThreadExecutor));

    echoServer.listenForClients();
    echoServer.listenForClients();
    echoServer.listenForClients();

    Thread.sleep(1000);

    String expected = "hello from client 1\nhello from client 2\nhello from client 3";

    assertEquals(expected, client1.getSocket().getOutputStream().toString().trim());
  }
```

```java
  Accepting ...
  Accepted.

  Accepting ...
  Accepted.

  Accepting ...
  Accepted.

  Accepted client on thread: pool-2-thread-1
  Number of clients connected: 1

  Accepted client on thread: pool-2-thread-1
  Number of clients connected: 2

  Accepted client on thread: pool-2-thread-1
  Number of clients connected: 3

  Tests passed: 1 of 1 test
```

Ok so our test passed, but making our test wait for an arbitrary 1000ms (`Thread.sleep(1000)`) is an antipattern. We don't want to make our test suite slower. Quite the opposite.

### Asynchronous code, synchronous test

One key learning tidbit here for me was that even if you get your test to run your code in a single thread rather than multiple ones, your test and your code still run in two different threads that are totally oblivious to each other.

The solution here is to get rid off all asynchronicity and run everything in the main thread.

We can replace

`Executor executor = Executors.newSingleThreadExecutor();`

with

`Executor executor = new SynchronousExecutor();`

where `SynchronousExecutor` overrides the `Executor` class' `execute` method to run any `Runnable` object synchronously:

```java
public class SynchronousExecutor implements Executor {
  @Override public void execute(Runnable runnable) {
      runnable.run();
  }
}
```

The test still passes!

Key takeaway of the week: _Make asynchronous code run synchronously in your test_.


text:
Perseus/CockroachDB is a set of scripts to investigate responsiveness of a CockroachDB cluster when its node is separated from the peers.

The scripts measure an impact from a client's perspective by opening a connection to every node of the cluster, incrementing a value per each of them and dumping the statistics every second.

All scripts are dockerized so it's painless to reproduce the results.

## Output

A summary of `logs/client1.log` (v1.1.3):

<pre>#legend: time|roach1|roach2|roach3|roach1:err|roach2:err|roach3:err
1	60	72	59	0	0	0	2018/01/08 05:31:33
2	59	69	67	0	0	0	2018/01/08 05:31:34
...
29	70	100	62	0	0	0	2018/01/08 05:32:01
30	63	87	68	0	0	0	2018/01/08 05:32:02
# isolating roach2
# isolated roach2
31	37	46	35	0	0	0	2018/01/08 05:32:03
32	0	0	0	0	0	0	2018/01/08 05:32:04
...
38	0	0	0	0	0	0	2018/01/08 05:32:10
39	0	0	178	0	0	1	2018/01/08 05:32:11
40	0	0	206	0	0	0	2018/01/08 05:32:12
...
57	0	0	192	0	0	0	2018/01/08 05:32:29
58	86	0	133	0	0	0	2018/01/08 05:32:30
...
88	102	0	133	0	0	0	2018/01/08 05:33:00
89	102	0	135	0	0	0	2018/01/08 05:33:01
# rejoining roach2
# rejoined roach2
90	99	0	120	0	0	0	2018/01/08 05:33:02
...
93	91	0	122	0	0	0	2018/01/08 05:33:05
94	67	0	87	0	0	0	2018/01/08 05:33:06
95	0	0	0	0	0	0	2018/01/08 05:33:07
...
101	0	0	0	0	0	0	2018/01/08 05:33:13
102	10	0	1	0	0	0	2018/01/08 05:33:14
103	66	62	81	0	1	0	2018/01/08 05:33:15
104	73	70	80	0	0	0	2018/01/08 05:33:16</pre>

The first column is the number of second since the begining of the experiment, the following three columns represent the number of increments per each node of the cluster per second, the next triplet is number of errors per second and the last is time.

The all zero row means that all connections hang.

## How to use Perseus?

Clone this repository:

    git clone https://github.com/rystsov/perseus.git

Switch to CockroachDB folder:

    cd perseus/cockroachdb

Run the cockroachdb cluster (3 nodes):

    docker-compose up

Open new tab, build and run a client's container

    ./build-client.sh && ./run-client1.sh

You'll see an output similar to `logs/client1.log` but without isolating/rejoin markers (the log still has them).

Then use the `./isolate.sh roach1` to isolate `roach1` (you can use `roach2`, `roach3` too). To rejoin `roach1` to the cluster use  `./rejoin.sh roach1`

repository: ahmetmircik/perseus

repo_name: ahmetmircik/perseus


text:
## STARTING OFF:

Make sure you have npm installed.

Install dependencies:
```
$ npm install
```

Run:
```
$ npm run compile
```

## CONCEPTS:

webpack code splitting

Outputs two files/chunks:

* `output.js` is the entry chunk and contains
  * the module system
  * chunk loading logic
  * the entry point `example.js`
  * module `a`
  * module `b`
* `1.js` is an additional chunk (on demand loaded) and contains
  * module `c`
  * module `d`

You can see that chunks are loaded via JSONP.

## RESOURCES:

* https://github.com/davidwparker/programmingtil-webpack/tree/master/0008-code-splitting
* http://webpack.github.io/docs/code-splitting.html
* https://github.com/webpack/webpack/tree/master/examples/code-splitting

repository: markristjans/programmingtil-webpack

repo_name: markristjans/programmingtil-webpack


text:
Datawarehouse
=============
This repo contains useful functions to build a Datawarehouse.

All functions work with Microsoft SQL Server. Other SQL dialects like MySQL, Oracle SQL etc. has not been tested.

Functions
---------
### Generic Functions
* `[dbo].[DateList]` - generate a date list
* `[dbo].[IntList]` - generate a integer list
* `[dbo].[SplitString]` - split a string with a split char

### Job Schedling
* `[dbo].[sp_async_execute]` - a procedure to create a async execution via the SQL Agent

### Development
* `[dbo].[get_crossdatabase_dependencies]` - a proceudure to get all cross database dependencies

### Security
* a script to get all permissions

Additional othere Moduls unter other licenses
---------------------------------------------
* [SQL#](http://www.sqlsharp.com/features/) - over 320 functions and procedures

Contribute
----------
Feel free to send a pull request with functions you wanna see here.

License
-------
I deliver this repository under the [MIT license](LICENSE). Nevertheless, some SQL scripts and functions have been copied from external sources which have been shared publicly on several websites. These scripts are remarked at the top of the files. These might be covered under another license - please request the author of this scripts for future information.

repository: lw-schick/DWH

repo_name: lw-schick/DWH


text:
nxppy
=====
nxppy is a *very* simple Python wrapper for interfacing with the excellent [NXP EXPLORE-NFC shield](http://uk.farnell.com/nxp-explore-nfc) for the [Raspberry Pi](http://www.raspberrypi.org/).  It takes NXP's Reader Library and provides a thin layer for detecting a Mifare RFID tag, reading its UID (unique identifier), and reading/writing data from/to the user area.

This was based very heavily on NXP's card_polling example code.  The example code was only reorganized to be more conducive as an interface.  NXP still retains full copyright and ownership of the example code.  All files in this repository are distributed under the MIT license.

Compatibility
=====
Tested with both Python 2.7 (as installed on Raspberry Pi) and with a manually compiled version of Python 3.4.

Requirements
=====
The NXP-EXPLORE card relies on SPI being enabled.  Please enable SPI using raspi-config prior to installing nxppy.

Installation
=====
nxppy is available from pypi.  First, install pip if you don't have it already:

```
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
```

Then simply run:

```
sudo pip install nxppy
```

Installation will take some time as it automatically pulls down and builds NeardAL, WiringPi, and the NXP Reader Library from souce.

Source
=====
To install from source, use distutils:

```
sudo apt-get install python-setuptools
sudo python setup.py build install
```

Usage
=====
Currently, the module supports only Mifare cards:

```python
import nxppy

mifare = nxppy.Mifare()

# Select the first available tag and return the UID
uid = mifare.select()

# Read 16 bytes starting from block 10
# (each block is 4 bytes, so technically this reads blocks 10-13)
block10bytes = mifare.read_block(10)

# Write a single block of 4 bytes
mifare.write_block(10, b'abcd')
```

Polling example, equivalent to NXP's card_polling example:

```python
import nxppy
import time

mifare = nxppy.Mifare()

# Print card UIDs as they are detected
while True:
    try:
        uid = mifare.select()
        print(uid)
    except nxppy.SelectError:
        # SelectError is raised if no card is in the field.
        pass

    time.sleep(1)
```

Feedback
=====
I welcome your feedback and pull requests!  This project started as a necessity for my own Raspberry Pi development, but I'm hoping others will find it useful as a way to quickly bootstrap NFC-based projects.  Enjoy!

repository: GeorgN/nxppy

repo_name: GeorgN/nxppy


text:
# SD_Times

[![FLUTTER](https://img.shields.io/static/v1?label=flutter&message=1.22.1&color=blue)](https://shields.io/)
[![DART](https://img.shields.io/static/v1?label=dart&message=2.11.0&color=success)](https://shields.io/)
[![License](https://img.shields.io/badge/license-MIT-black.svg)](https://shields.io/)

Software Development Times is a cross-platform mobile app consisting of news in the interest of developers.

## Technologies Used

* Programming Language: `Dart with flutter as the framework`
* API used: `Hacker News API`
* As Database: `Sqlite`

#### App Installation - [Get APK](https://drive.google.com/file/d/1wBy__RFOkYltBjbF5IUgNRTMRMpAiYKv/view?usp=sharing)

## Guidelines to setup
1. Clone the repository
    ```
    git clone https://github.com/Mayank0255/SD-Times.git

    gh repo clone Mayank0255/SD-Times (for GitHub CLI)

    cd SD-Times
    ```
2. Run the app
    ```
    flutter run
    ```

## DEMO:

#### IMAGES

gha_language: Dart


text:
# CirclePackingClock

This is an animation written in the Processing language. It uses a circle packing algorithm to approximate the digits of a clock.

![](clock.gif)

The basic idea of this is that we are drawing each letter with a white font on a black background in a backbuffer and then we can check
if a circle is "inside" or "outside" the shape by checking the brightness of the corresponding pixel in that backbuffer.

```processing
  public boolean touchesShape(int[] shape, int shapeW) {
    int top =    shape[floor(x - r) + floor(y)     * shapeW];
    int bottom = shape[floor(x + r) + floor(y)     * shapeW];
    int left =   shape[floor(x)     + floor(y - r) * shapeW];
    int right =  shape[floor(x)     + floor(y + r) * shapeW];

    return
      brightness(left) < 30 ||
      brightness(right) < 30 ||
      brightness(top) < 30 ||
      brightness(bottom) < 30;
  }
```
We keep a list of `Symbol` objects, one for each digit (8 for a clock, including the colons). Each `Symbol` is responsible for handling the circles that draw them and
the backbuffer that define its edges.

```processing
  private PGraphics pg;

  public void setText(char c) {
    if(this.c != c) {
      circles.clear();
      growingCircles.clear();
      pg.beginDraw();
      pg.background(0);
      pg.textFont(font);
      pg.stroke(255);
      pg.text(c, 0, pg.height - pg.textDescent());
      pg.endDraw();
      allowedPoints.clear();
      for(int x = 0 ; x < pg.width ; x++) {
        for(int y = 0 ; y < pg.height ; y++) {
          if(brightness(pg.pixels[x + y * pg.width]) != 0) {
            allowedPoints.add(new PVector(x, y));
          }
        }
      }
      targetCircles = (int)(allowedPoints.size() * CIRCLE_DENSITY);
    }
    this.c = c;
  }
```

Each digit starts with a few random circles of radius 1 and each frame, if the circle does not touch another circle, the edge of the screen or the edge of the digit shape
(in strict mode) we grow the radius by one. We add a few new circles each frame to keep things interesting.

```processing
  public void draw() {
    for(Circle c : circles) {
      c.draw();
    }
  }

  public void update() {
    if(circles.size() < targetCircles) {
      for(int i = 0 ; i < CIRCLES_PER_FRAME ; i ++) {
        addNewCircles();
      }
    }
    growCircles();
  }
```

We try to optimize things by keeping a list of "allowed points" - basically the number of points inside the letter shape and if at one point one of the points is found to be
inside a circle, we remove it from the list so that we don't have to check it again.

```processing
  public void addNewCircles() {
    while(!allowedPoints.isEmpty()) {
      PVector p = allowedPoints.remove((int)random(allowedPoints.size()));
      boolean found = false;
      for(Circle c : circles) {
        if(c.containsPoint(p.x, p.y)) {
          found = true;
          break;
        }
      }
      if(found) {
        continue;
      }
      Circle c = new Circle(p.x, p.y);
      circles.add(c);
      growingCircles.add(c);
      return;
    }
  }
```

repository: acristescu/CirclePackingClock

repo_name: acristescu/CirclePackingClock


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

### Description

In Apache Ignite 2.3 or earlier, the serialization mechanism does not have a list of classes allowed for serialization/deserialization, which makes it possible to run arbitrary code when 3-rd party vulnerable classes are present in Ignite classpath. The vulnerability can be exploited if the one sends a specially prepared form of a serialized object to one of the deserialization endpoints of some Ignite components - discovery SPI, Ignite persistence, Memcached endpoint, socket steamer.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet
- https://github.com/PalindromeLabs/Java-Deserialization-CVEs
- https://github.com/mishmashclone/GrrrDog-Java-Deserialization-Cheat-Sheet

repository: trickest/cve

repo_name: trickest/cve


text:
# Examples
Currently this repo holds examples on component development for goarrg.com.
There are OpenGL and Vulkan hello world examples, a Vulkan fallback to OpenGL example, and an audio example.

Currently the examples support running on Ubuntu or Windows, 386 or amd64. However the Vulkan examples require amd64.
## Dependencies
### Global
| OS | Dependencies |
| -- | -- |
| Ubuntu | sudo apt-get install build-essential cmake libxext-dev libpulse-dev |
| Windows | mingw-w64, cmake |
### Graphics API Specific
| OS | Folder Prefix | Dependencies |
| -- | -- | -- |
| Ubuntu | gl | sudo apt-get install libglu1-mesa-dev mesa-common-dev |
| Ubuntu_amd64 | vk | Vulkan SDK |
| Windows_amd64 | vk | Vulkan SDK |

**For `vkgl` prefix, you need both vk and gl dependencies.**

## Setup
Once all the dependencies are installed, assuming the current directory is the examples repo, you just need to:

go run goarrg.com/cmd/goarrg install sdl2 -vv

### Vulkan
To run the Vulkan examples, after installing the SDK, assuming the current directory is the examples repo, you also need to run:

go run goarrg.com/cmd/goarrg install vulkan -vv

## Running
To run the examples, excluding the `shared` folder, cd to the folder and run:

go run goarrg.com/cmd/goarrg run -vv

repository: goarrg/examples

repo_name: goarrg/examples


text:
# UnifyID PushAuth Sample Project

This project holds the sample of how to integrate PushAuth into your iOS app. To run this sample, you need to:

1. Set up project's push notification
2. Set up UnifyID API and SDK key
3. Create a PushAuth session

## 1. Set up project's push notification

UnifyID's iOS PushAuth implementation relies on [Apple's Push Notification](https://developer.apple.com/notifications/). This feature is not available in iOS Simulators, hence you need an iOS device. Update the project's Signing and Capabilities configuration to use your team and app bundle ID:

![The Signing and Capabilities part of the PushAuthSample project.](readme_images/signing-and-capabilities.png)

Make sure your application bundle ID has Push Notification capabilities activated.

## 2. Set up UnifyID API and SDK key

Create a project in [UnifyID developer dashboard](https://dashboard.unify.id/account/sign-in). Follow [this guide](https://developer.unify.id/docs/get-started/) on how to make one.

Upload an APNS Production & Sandbox certificate, normally in a format of a `*.p12 ` file. On first upload, choose whether you will utilize the Sandbox or Production push notifications.

![The upload certificate part in the UnifyID dashboard](readme_images/unifyid-dashboard-apns-choice.png)

To run the project directly from Xcode (debug or development builds), choose **development**. To distribute it via Adhoc builds / Testflight / AppStore, choose **production**.

## 3. Create a PushAuth session

You should have a project ready in the UnifyID dashboard. Create an API key and SDK key for your project. Copy the API key value and store it somewhere safe, since it will be given only once.

![The dialog where the system provides your API key value. Press the "copy" button and store it somewhere safe.](readme_images/dashboard-api-key-dialog.png)

Creating the SDK key require similar steps, but it will be provided in the dashboard page after its creation.

Run the app to your iPhone. Input your SDK key along with a "user" string to configure it properly. Send a PushAuth request through your macOS Terminal using this `curl` command:

```
curl -H 'accept: application/json' \
-H "x-api-key: $UNIFYID_API_KEY" \
--data '{
"notification":{
  "title":"A Test Push Notification",
  "subtitle":"Lovingly sent from CURL",
  "body":"It even has a body!"
},
"user":"<session_user>"}' \
--request POST https://api.dev.unify.id/v1/push/sessions
```

The `UNIFYID_API_KEY` represents the API key you have created. The `<session_user>` represents the "user" string value you inputted in the app.

## Copyright

This project is MIT licensed. Please read the [LICENSE](LICENSE) file for further details.

Copyright © 2020 UnifyID, Inc. All rights reserved.

repository: UnifyID/pushauth-sample-app-ios-reg

repo_name: UnifyID/pushauth-sample-app-ios-reg


text:
#  ruby_Backblaze

## Features
-Automatically compiled using gzip if the file to upload is a folder that is already archived.

-Prevents backups from running while the files are being written to and vice a versa.

## Installation and Setup

1) Clone or download this file from github

2) Set up your Backblaze account and create your bucket(s) using their web interface.

3) Manually install the gem "Foreman"

4) Open the main folder (named "ruby_backblaze/") and run "bundle install"

5)  Rename sample.env to ".env", and fill in the environment variables there using the information provided by your backblaze b2 dashboard

## Usage

Open the main folder (named "ruby_backblaze/") and run "foreman run ruby backup_script_template.rb"

**TODO**
Figure out a way to run multiple threads to upload larger files faster.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests.

## Notes on my implementation

Decided not to use credentials_file method given by backblaze gem, but instead using .env

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RyanQuey/ruby_backblaze. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.

# Released under MIT License

Copyright (c) 2020 Ryan Quey.

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

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

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


text:
# Atari800 Benchmarks

![bench](https://raw.githubusercontent.com/pedromagician/Atari800-benchmarks/main/pic/screenshot.png)

#### _TEST A:_
Atari Basic: 584 = 11.68s\
Turbo Basic: 562 = 11.24s\
Atari Basic compiled I: 504 = 10,08s\
Atari Basic compiled F: 522 = 10,44s\
Turbo Basic compiled: 549 = 10.98s\
Action!: 522 = 10.44s

#### _TEST B:_
Atari Basic: 550 = 11s\
Turbo Basic: 230 = 4.6s\
Atari Basic compiled I: 44 = 0.88s\
Atari Basic compiled F: 171 = 3.42s\
Turbo Basic compiled: 80 = 1.6s\
Action!: 5 = 0.1s

#### _TEST C:_
Atari Basic: 734 = 14.68s\
Turbo Basic: 327 = 6.54s\
Atari Basic compiled I: 54 = 1.08s\
Atari Basic compiled F: 225 = 4.5s\
Turbo Basic compiled: 132 = 2.64s\
Action!: 5 = 0.1s

#### _TEST D:_
Atari Basic: 3670 = 73.4s\
Turbo Basic: 1485 = 29.7s\
Atari Basic compiled I: 216 = 4.32s\
Atari Basic compiled F: 1985 = 39.7s\
Turbo Basic compiled: 468 = 9.36s\
Action!: 167 = 3.34s

#### _TEST E:_
Atari Basic: 16003 = 320.06s\
Turbo Basic: 6744 = 134.88s\
Atari Basic compiled I: 950 = 19s\
Atari Basic compiled F: 4660 = 93.2s\
Turbo Basic compiled: 1906 = 38.12s\
Action!: 76 = 1.52s

#### _TEST F:_
Atari Basic: 3089 = 61.78s\
Turbo Basic: 923 = 18.46s\
Atari Basic compiled I: 178 = 3.56s\
Atari Basic compiled F: 1868 = 37.36s\
Turbo Basic compiled: 353 = 7.06s\
Action!: 26 = 0.52s\
Action! cheat: 5 = 0.1s

#### _TEST G:_
Atari Basic: 853 = 17,06s\
Turbo Basic: 336 = 6.72s\
Atari Basic compiled I: 57 = 1.14s\
Atari Basic compiled F: 415 = 8.3s\
Turbo Basic compiled: 145 = 2.9s\
Action!: 22 = 0.44s

#### _TEST H:_
Atari Basic: 4698 = 93.96s\
Turbo Basic: 2288 = 45.76s\
Atari Basic compiled I: 479 = 9.58s\
Atari Basic compiled F: 1312 = 26.24s\
Turbo Basic compiled: 592 = 11.84s\
Action!: 146 = 2.92s


text:
# Challenge 05: Build and push Docker image to container registry - Coach's Guide

[< Previous Solution](./Solution-04.md) - **[Home](./README.md)** - [Next Solution >](./Solution-06.md)

## Notes & Guidance

- See solution, in solutions folder for GitHub Action Workflow file.

## Solution
- [Navigate to Solution for Challenge 05](./Solution/Solution-05/Solution05.yml)

repository: gfilicetti/WhatTheHack

repo_name: gfilicetti/WhatTheHack


text:
# venue-webapp

---

## Quick Start

```sh
# Install dependencies
npm install

# Start the app
npm run start

# in browser, visit http://localhost:3000
# to STOP, Ctrl+C in Terminal
```

---

## Technologies & Frameworks

- [Create React App](https://facebook.github.io/create-react-app/)
- [React.js](https://reactjs.org/)
- [React Awesome Reveal](https://react-awesome-reveal.morello.dev/)
- [React Scroll](https://github.com/fisshy/react-scroll)
- [React Slick](https://react-slick.neostack.com/)
- [Material UI](https://material-ui.com/)

repository: adamdubey/venue-webapp

gha_language: JavaScript

repo_name: adamdubey/venue-webapp


text:
participant-mining
==================

Two Python 3 scripts for extracting open profiles of all participants of an event on Facebook or Vkontakte

The Facebook script uses the Facepy library. Get it [here](https://github.com/jgorset/facepy) or with
```pip3 install facepy```. It also needs an Access Token, which is available at
https://developers.facebook.com/tools/explorer (it should be obtained again for the next session). The Access Token goes into line 17. Facebook event ids go into the list ```facebook_events``` on line 19.

The Vkontakte script takes a list of type string of event_ids, which should be names or ids
(event4534523 -> '4534523').

Both scripts produce .txt report files in the working directory.

repository: macleginn/participant-mining

repo_name: macleginn/participant-mining


text:
# Custom Lockable Contract (CustomLockable.sol)

View Source: [contracts/CustomLockable.sol](../contracts/CustomLockable.sol)

**↗ Extends: [CustomAdmin](CustomAdmin.md)**
**↘ Derived Contracts: [TokenBase](TokenBase.md)**

**CustomLockable**

This contract enables Cyber Security Ecosystem Token admins
to lock tokens on an individual-wallet basis.
When tokens are locked for specific wallet,
they cannot transfer their balances
until the end of their locking period.
Furthermore, this feature is created to specifically
lock bounty, advisory, and team tokens
for a set period of time.
This feature once turned off cannot be switched on back again.

## Contract Members
**Constants & Variables**

```js
mapping(address => uint256) public lockingList;
bool public canLock;

```

**Events**

```js
event TokenLocked(address indexed _address, uint256  _releaseDate);
event TokenUnlocked(address indexed _address);
event LockingDisabled();
```

## Modifiers

- [revertIfLocked](#revertiflocked)

### revertIfLocked

Reverts this transfer if the wallet is in the locking list.

```js
modifier revertIfLocked(address _wallet) internal
```

**Arguments**

| Name        | Type           | Description  |
| ------------- |------------- | -----|
| _wallet | address |  |

## Functions

- [isLocked(address _wallet)](#islocked)
- [addLock(address _address, uint256 _releaseDate)](#addlock)
- [addManyLocks(address[] _accounts, uint256 _releaseDate)](#addmanylocks)
- [removeManyLocks(address[] _accounts)](#removemanylocks)
- [disableLocking()](#disablelocking)

### isLocked

Checks if a wallet is locked for transfers.

```js
function isLocked(address _wallet) public view
returns(bool)
```

**Arguments**

| Name        | Type           | Description  |
| ------------- |------------- | -----|
| _wallet | address |  |

### addLock

Adds the specified address to the locking list.

```js
function addLock(address _address, uint256 _releaseDate) external nonpayable onlyAdmin
returns(bool)
```

**Arguments**

| Name        | Type           | Description  |
| ------------- |------------- | -----|
| _address | address | The address to add to the locking list. |
| _releaseDate | uint256 | The date when the tokens become avaiable for transfer. |

### addManyLocks

Adds multiple addresses to the locking list.

```js
function addManyLocks(address[] _accounts, uint256 _releaseDate) external nonpayable onlyAdmin
returns(bool)
```

**Arguments**

| Name        | Type           | Description  |
| ------------- |------------- | -----|
| _accounts | address[] | The wallet addresses to add to the locking list. |
| _releaseDate | uint256 | The date when the tokens become avaiable for transfer. |

### removeManyLocks

Removes multiple addresses from the locking list.

```js
function removeManyLocks(address[] _accounts) external nonpayable onlyAdmin
returns(bool)
```

**Arguments**

| Name        | Type           | Description  |
| ------------- |------------- | -----|
| _accounts | address[] | The wallet addresses to unlock. |

### disableLocking

Once locking feature is disable, it cannot be
truned back on thenceforth.

```js
function disableLocking() external nonpayable onlyAdmin
returns(bool)
```

**Arguments**

| Name        | Type           | Description  |
| ------------- |------------- | -----|

## Contracts

* [BasicToken](BasicToken.md)
* [BulkTransfer](BulkTransfer.md)
* [BurnableToken](BurnableToken.md)
* [CustomAdmin](CustomAdmin.md)
* [CustomLockable](CustomLockable.md)
* [CustomOwnable](CustomOwnable.md)
* [CustomPausable](CustomPausable.md)
* [CYBRToken](CYBRToken.md)
* [ERC20](ERC20.md)
* [ERC20Basic](ERC20Basic.md)
* [ERC20Mock](ERC20Mock.md)
* [ForceEther](ForceEther.md)
* [Migrations](Migrations.md)
* [Ownable](Ownable.md)
* [Reclaimable](Reclaimable.md)
* [SafeERC20](SafeERC20.md)
* [SafeMath](SafeMath.md)
* [StandardToken](StandardToken.md)
* [TokenBase](TokenBase.md)
* [TransferState](TransferState.md)

repository: CYBRToken/CYBRToken

gha_language: Solidity

repo_name: CYBRToken/CYBRToken


text:
---
title: "Scheduling Tasks in Airflow"
description: "Overview of the Airflow scheduler"
date: 2018-05-21T00:00:00.000Z
slug: "scheduling-tasks"
heroImagePath: "https://assets.astronomer.io/website/img/guides/SchedulingTasksinAirflow_preview.png"
tags: ["Building DAGs", "Scheduling Tasks", "Airflow"]
---

The Airflow scheduler monitors all tasks and all DAGs to ensure that everything is executed according to schedule. The Airflow scheduler, the heart of the application, "heartbeats" the DAGs folder every couple of seconds to inspect tasks for whether or not they can be triggered.

However, actually scheduling these task can be tricky, as much of it is driven by cron syntax and the scheduler tends to "schedule everything".

## Dag Runs

A DAG Run is an object representing an instantiation **of the DAG in time**.

Each DAG may or may not have a schedule, which informs how DAG Runs are created. schedule_interval is defined as a DAG arguments, and receives a cron expression as a `str`, or a `datetime.timedelta` object.

Alternatively, you can also use one of these cron “preset”:
https://airflow.apache.org/scheduler.html

## Key Scheduling Parameters

A DAG's schedule is defined by:

**start_date**: This is the `execution_date` for the first DAG run.

**end_date**: The date the DAG should stop running, usually set as none.

**execution_timeout**: The maximum time a task should be able to run - the task will fail if it runs for more than this time.

**retries**: The number of retries performed before the task fails

**retry_delay**: The delay between retries.

## Scheduling When Testing

Suppose you are testing a DAG on **4/30/18** that should be scheduled to run daily going forward:

```py
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta

default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': datetime(2018, 1, 1),
    'email_on_failure': False,
    'email_on_retry': False,
    'retries': 1,
    'retry_delay': timedelta(minutes=5),
}

dag = DAG('example_dag_one',
            schedule_interval='@daily',
            default_args=default_args)

t1 = BashOperator(
    task_id='print_date1',
    bash_command='sleep 2m',
    dag=dag)

t2 = BashOperator(
    task_id='print_date2',
    bash_command='sleep 2m',
    dag=dag)

t3 = BashOperator(
    task_id='print_date3',
    bash_command='sleep 2m',
    dag=dag)

t2.set_upstream(t1)
t3.set_upstream(t2)
```

When the scheduler taps this DAG, it will generate a DAG run for each day from the `start_date` to 4/30/18, and then for each day going forward:

![](https://assets.astronomer.io/website/img/guides/ucg_scheduling.png)

In this example DAG it won't really cause many problems, but if this DAG were hitting an external system (e.g. making API calls, querying a database, etc.) it could get problematic.

**Note**: Based on your Airflow configurations, it will only generate a DAG few runs at a time.

This can be avoided by setting `catchup=False` (by default, it is set to `True`), which tells the scheduler not to have the DAG runs "catch up" to the current date.

https://airflow.apache.org/scheduler.html#backfill-and-catchup

```py
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta

default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': datetime(2018, 1, 1),
    'email_on_failure': False,
    'email_on_retry': False,
    'retries': 1,
    'retry_delay': timedelta(minutes=5),
}

dag = DAG('example_dag_one',
            schedule_interval='@daily',
            catchup=False,
            default_args=default_args)

t1 = BashOperator(
    task_id='print_date1',
    bash_command='sleep 2m',
    dag=dag)

t2 = BashOperator(
    task_id='print_date2',
    bash_command='sleep 2m',
    dag=dag)

t3 = BashOperator(
    task_id='print_date3',
    bash_command='sleep 2m',
    dag=dag)

t2.set_upstream(t1)
t3.set_upstream(t2)
```

This DAG only gets one DAG run scheduled once on 4/30 due to the catchup parameter:

![](https://assets.astronomer.io/website/img/guides/ucg_scheduling_catchup.png)

### Using catchup effectively

The `catchup` parameter can be dangerous (use up all your API calls, put a large load on your database,  etc.), but it can also be used effectively.

Suppose you are backfilling data from the last year (or a set of ranges) from Google Analytics or from some external source into a data warehouse.

Instead of running one big API call, `catchup=True` along with a `schedule_interval` set to `'@daily'` will have Airflow schedule them separately into daily API calls.

With the right file templating - you can get each day's file in a separate fille:

```py
"""
This is an excerpt from an internal Google Analytics dag

It will generate a separate API request, file in S3, and load into redshift
(the data will be appended for each table for each day) for each day's request
from the start_date until today's date.

This way, if you find yourself needing to load the data into another table, you can just
run the load tasks instead of making the entire request again.
"""

execution_date = '{{ execution_date }}'
next_execution_date = '{{ next_execution_date }}'

view_id = '120725274'  # External Traffic
# view_id = '120726983' # Desktop

COPY_PARAMS = ["COMPUPDATE OFF",
               "STATUPDATE OFF",
               "JSON 'auto'",
               "TIMEFORMAT 'auto'"
               "TRUNCATECOLUMNS",
               "region as 'us-east-1'"]

...

default_args = {
    'start_date': datetime(2018, 4, 24),
    'email'<EMAIL_ADDRESS>    'email_on_failure': True,
    'email_on_retry': False,
    'retries': 0,
}
dag = DAG(
    'a_core_reporting_test_v4',
    schedule_interval='@daily',
    default_args=default_args,
    catchup=True #Set catchup to True
)
with dag:

    start = DummyOperator(task_id='start')
    for pipeline in pipelines:
        google_analytics = GoogleAnalyticsReportingToS3Operator(
            task_id='ga_reporting_{endpoint}_to_s3'.format(
                endpoint=pipeline['name']),
            google_analytics_conn_id=google_analytics_conn_id,
            view_id=view_id,
            since=execution_date,
            until=next_execution_date,
            sampling_level='LARGE',
            filters=pipeline['filtersExpression'],
            dimensions=pipeline['dimensions'],
            metrics=pipeline['metrics'],
            page_size=5000,
            include_empty_rows=True,
            s3_conn_id=s3_conn_id,
            s3_bucket=s3_bucket,
            s3_key='ga_reporting_{endpoint}_{time_string}'.format(
                endpoint=pipeline['name'], time_string=time_string)
        )

        s3_to_redshift = S3ToRedshiftOperator(
            task_id='ga_reporting_{endpoint}_to_redshift'.format(
                endpoint=pipeline['name']),
            redshift_conn_id=redshift_conn_id,
            redshift_schema='ucg_test_google_analytics',
            table='{0}'.format(pipeline['name']),
            s3_conn_id=s3_conn_id,
            s3_bucket=s3_bucket,
            s3_key='ga_reporting_{endpoint}_{time_string}'.format(
                endpoint=pipeline['name'], time_string=time_string),
            copy_params=COPY_PARAMS,
            origin_schema=pipeline['schema'],
            schema_location='local',
            # Set the load_type to  append!
            load_type='append')

        start >> google_analytics >> s3_to_redshift
```

![](https://assets.astronomer.io/website/img/guides/ucg_ga_ga_scheduled.png)

**Note:** Your GA service account may only be bound to a limited number of concurrent connections.

Deploying a DAG with `catchup=True` can fit a use case, but consider using additional scheduling paramters for added safety.

`depends_on_past`: When set to `True`, task instance will run chronologically sequentially, relying on the previously scheduled task instance to suceed before executing.

This will ensure sequential data loads, but may also stop progress if a job is left to run unmonitored.

`wait_for_downstream`: A stronger version of `depends_on_past` that is extended to a DAG level instead of a task level. The entire DAG will need to run successfully for the next DAG run to start.

repository: endast/airflow-guides

repo_name: endast/airflow-guides


text:
# [Graphits.dev](https://graphits.dev/)

[Graphi.ts](https://github.com/MoreSaltMoreLemon/graphi.ts) is the collaboration of [Ethan Roberts](https://www.linkedin.com/in/eroberts-me/) and [Ezra Schwepker](https://www.linkedin.com/in/ezra-schwepker/).

We initially wanted to just play around with making an SVG graph to go along with a weather api project we had worked on, however the graph quickly evolved into its own project as we dove down the rabbit hole of making our own HTML canvas graphing tool.

While there's a lot more that can be done with it, we had a great time making the accompanying documentation website and hope you get a kick out of it too.


text:
This happens to the best of us, and fortunately, Git has a magic time machine, or rather, a log of every event that happened in the git repo.

To use this:
- `git reflog` will list the history of git commands that have been invoked in the repository.
- To reset to a point in the history, do `git reset HEAD@{index}` where index is the number inside the {} in the reflog. Usually starts from 0.

repository: amithmkini/common-git-issues

repo_name: amithmkini/common-git-issues