text:
# Eiger
"Eiger" is especially suited for use with larger company websites and blogs. Along with Media Query (CSS) supported multi-device compatibility, logos, headers and banners, and navigation are all easily customizible with built-in Movable Type functions.

## Requirements
This theme requires:

* Movable Type 5.2 or higher

## Key Features
* A default blog header title, replaceable with custom logo image
* A default header background, replaceable with custom background image
* A default favicon, replaceable using the item upload function
* The ability to add specific web pages to site navigation
* The option of customizing og:image thumbnail images
* The ability to customize the number of the most recent blog entries displayed on the front page, with the default being 10 entries
* A default banner and text provided on the right hand side of the top page, replaceable with custom image
* Four pre-installed sample widgets
* Bread crumb navigation (excluding on the home page, error page and search results page)

For more information on using "Eiger", please refer to the manual below:

* [Setting up "Eiger" (English)](http://www.movabletype.org/documentation/mt5/design/themes/eiger.html)
* [Setting up "Eiger" (Japanese)](http://www.movabletype.jp/documentation/mt5/design/themes/eiger.html)

## Installing
1. Unpack the mt-theme-eiger archive.
2. Upload and copy the mt-theme-eiger/themes/eiger folder to your MT's themes folder. ( /path/to/mt/themes )
4. Create a site with "Eiger" theme.

## License
The MIT License (MIT)

## Copyright
The following copyright notice applies to all the files provided in this distribution, including binary files, unless explicitly noted otherwise.

Copyright 2013 Six Apart Ltd.

repository: movabletype/mt-theme-eiger

gha_language: MTML

repo_name: movabletype/mt-theme-eiger


text:
---
#date: "2018-02-25T00:00:00Z"
external_link: ""
image:
  caption:
  focal_point: Smart
#links:
# - icon: graduation-cap
# - url: https://www.some.ox.ac.uk/
slides:
summary:
tags:
- Public Engagement
title: Student Volunteer
url_code: ""
url_pdf: "http://oxhos.org/PDFs/OxHOS_Roadshow_Report_Summer_2019.pdf"
url_slides: ""
url_video: ""
---
Oxford Hands-On Science (OxHOS) is a student-run society based in Oxford. We believe that science is fun and relevant to everyone. We spread our enthusiasm for science to children and their families by taking a range of hands-on experiments into schools and public venues, with helpful undergraduate and post-graduate student volunteers explaining the science behind them. We enourage everyone to be curious and excited about science, using experiments that are interactive, entertaining, and sometimes surprising.

OxHOS was founded in partnership with Cambridge Hands-On Science (CHaOS) who have been running science Roadshows for over 10 years. This means we have lots of experiments covering a broad range of science subjects, and lots of experience in how to run a great event.

The first ever OxHOS Roadshow took place in September 2015, and since then we have taken our interactive experiments on the road to schools and public venues every summer.

license: MIT

repository: ConnorScott-Ox/Professional-Profile

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: ConnorScott-Ox/Professional-Profile


text:
# Expressions

## Grouping

Grouping is syntax sugar for an immediately-called lambda.
The only limitation is the inability for slicing.

A grouping can either be `(@ ...)` or `(#@ ...)`, depending if the stack is to be kept.

```
// Errors, not enough values for an addition
> 1 2 3 $product@ 2 3 $product@ +;

// Prints 12
> (@ 1 2 3 $product@) (@ 2 3 $product@) +;
```

## Equivalent

These expressions are equal:

```
() => (1 2 3)@
(@ 1 2 3)
```

```
() => (1 2 3)#@
(#@ 1 2 3)
```


text:
# Analysis of Algorithms

Discrete Fourier Transform (FTT - Fast Fourier Transform)

## Scientific method

1. Observe
2. Hypothesis
3. Predict
4. Verify
5. Validate

## Empirical Analysis

Run the program for various input sizes and measure running time

1. 3-Sum Problem -

   Given N distinct integers, how many triples sum to exactly zero

   Brute-force uses n^3 time.

   Can be solved in n^2 log N

      1. Sort the N (distinct) numbers

      2. For each pair of numbers a[i] and a[j], binary search for -(a[i] + a[j])

2. 1-Sum problem -

   How many integers are 0 in an array

3. 2-Sum problem

   How many pair integers sum to 0

## Mathematical Model

Cost Model

Tilde notation

Estimating a discrete sum (replace sum with an integral, and use calculus)

1. 3-Sum Problem can be improved -

   - Sort the input array

   - For each pair of number a[i] and a[j], binary search for -(a[i] + a[j])

   - Order of growth is N^2 log N

## Theory of algorithms

1. Best Case
2. Worst Case
3. Average Case

## Amortized Analysis

Amortized analysisis a method of analyzing the costs associated with a data structure that averages the worst operations out over time. Often, a data structure has one particularly costly operation, but it doesn't get performed very often. That data structure shouldn't be labelled a costly structure just because that one operation, that is seldom performed, is costly.

So, amortized analysis is used to average out the costly operations in the worst case. The worst case scenario for a data structure is the absolute worst ordering of operations from a cost perspective. Once that ordering is found, then the operations can be averaged.

There are three main types of amortized analysis:aggregate analysis, theaccounting method, and thepotential method.

<https://brilliant.org/wiki/amortized-analysis>

## Memory

![image](../../media/Analysis-of-Algorithms-image1.jpg)

![image](../../media/Analysis-of-Algorithms-image2.jpg)

![image](../../media/Analysis-of-Algorithms-image3.jpg)

## Typical memory usage summary

Total memory. usage for a data type value

- Primitive type: 4 bytes for int, 8 bytes for double, ...
- Object reference: 8 bytes
- Array: 24 bytes + memory for each array entry
- Object: 16 bytes + memory for each instance variable + 8 bytes if inner class (for pointer to enclosing class)
- Padding: round up to multiple of 8 bytes

### Shallow memory usage: Don't count referenced objects

### Deep memory usage: If array entry or instance variable is a reference, add memory (recursively) for referenced object

## Space--time or time-memory tradeoff (TMTO)

Aspace--timeortime--memory trade-offin[computer science](https://en.wikipedia.org/wiki/Computer_science) is a case where an[algorithm](https://en.wikipedia.org/wiki/Algorithm) or [program](https://en.wikipedia.org/wiki/Computer_program)[trades](https://en.wikipedia.org/wiki/Trade-off) increased space usage with decreased time. Here, spacerefers to the[data storage](https://en.wikipedia.org/wiki/Computer_storage) consumed in performing a given task ([RAM](https://en.wikipedia.org/wiki/Dynamic_random-access_memory), [HDD](https://en.wikipedia.org/wiki/Hard_disk_drive), etc), andtimerefers to the time consumed in performing a given task ([computation](https://en.wikipedia.org/wiki/Time_complexity) time or[response time](https://en.wikipedia.org/wiki/Response_time_(technology))).

The utility of a given space--time tradeoff is affected by related[fixed](https://en.wikipedia.org/wiki/Fixed_cost) and [variable costs](https://en.wikipedia.org/wiki/Variable_costs)(of, e.g., [CPU](https://en.wikipedia.org/wiki/CPU) speed, storage space), and is subject to[diminishing returns](https://en.wikipedia.org/wiki/Diminishing_returns).

<https://en.wikipedia.org/wiki/Space%E2%80%93time_tradeoff>

## Types of tradeoff

## Lookup tables vs. recalculation

A common situation is an algorithm involving a[lookup table](https://en.wikipedia.org/wiki/Lookup_table): an implementation can include the entire table, which reduces computing time, but increases the amount of memory needed, or it can compute table entries as needed, increasing computing time, but reducing memory requirements.

## Compressed vs. uncompressed data

A space--time tradeoff can be applied to the problem of data storage. If data is stored uncompressed, it takes more space but access takes less time than if the data were stored compressed (since compressing the data reduces the amount of space it takes, but it takes time to run the[decompression algorithm](https://en.wikipedia.org/wiki/Data_compression)). Depending on the particular instance of the problem, either way is practical. There are also rare instances where it is possible to directly work with compressed data, such as in the case of compressed[bitmap indices](https://en.wikipedia.org/wiki/Bitmap_index), where it is faster to work with compression than without compression.

## Re-rendering vs. stored images

Storing only the[SVG](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics) source of a[vector image](https://en.wikipedia.org/wiki/Vector_graphics) and rendering it as a[bitmap image](https://en.wikipedia.org/wiki/Bitmap) every time the page is requested would be trading time for space; more time used, but less space. Rendering the image when the page is changed and storing the rendered images would be trading space for time; more space used, but less time. This technique is more generally known as[caching](https://en.wikipedia.org/wiki/Cache_(computing)).

## Smaller code vs. loop unrolling

Larger code size can be traded for higher program speed when applying[loop unrolling](https://en.wikipedia.org/wiki/Loop_unrolling). This technique makes the code longer for each iteration of a loop, but saves the computation time required for jumping back to the beginning of the loop at the end of each iteration.

## Time/memory/data tradeoff attack

Atime/memory/data tradeoff attackis a type of[cryptographic attack](https://en.wikipedia.org/wiki/Cryptanalysis) where an attacker tries to achieve a situation similar to the[space--time tradeoff](https://en.wikipedia.org/wiki/Space%E2%80%93time_tradeoff) but with the additional parameter ofdata, representing the amount of data available to the attacker. An attacker balances or reduces one or two of those parameters in favor of the other one or two. This type of attack is very difficult, so most of the ciphers and encryption schemes in use were not designed to resist it.

<https://en.wikipedia.org/wiki/Time/memory/data_tradeoff_attack>

gha_language: JavaScript

gha_license_id: MIT


text:
### Example: use the custom builder with `docker buildx`

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleContainerTools/skaffold&cloudshell_open_in_editor=README.md&cloudshell_workspace=examples/custom-buildx)

[Docker Buildx](https://github.com/docker/buildx#buildx) is an
experimental feature for building container images for multiple
platforms.  This example shows how `docker buildx` can be used as
a Skaffold _custom builder_ to create container images for the
`linux/arm64` and `linux/amd64` platforms.

#### Before you begin

For this tutorial to work you need to ensure Skaffold and a Kubernetes
cluster are set up.  To learn more about how to set up Skaffold and
a Kubernetes cluster, see the [getting started docs](https://skaffold.dev/docs/getting-started).

Note that this example builds for two different platforms and
requires pushing images to a container registry such as
[Google Artifact Registry](https://cloud.google.com/artifact-registry).

#### Tutorial

This tutorial demonstrates how to use Skaffold's _custom builders_
to build a simple _Hello World_ Go application for `linux/amd64`
and `linux/arm64` using `docker buildx` and deploy it to a Kubernetes
cluster.

##### Step 1: Obtain the example

First, clone the Skaffold [repo](https://github.com/GoogleContainerTools/skaffold)
and navigate to the [`custom-buildx` example](https://github.com/GoogleContainerTools/skaffold/tree/main/examples/custom) for sample code:

```shell
$ git clone https://github.com/GoogleContainerTools/skaffold
$ cd skaffold/examples/custom-buildx
```

##### Step 2: Configure the custom builder

Take a look at the [`skaffold.yaml`](skaffold.yaml), which uses a
_custom builder_
```yaml
  - image: skaffold-examples-buildx
    custom:
      buildCommand: sh buildx.sh
      dependencies:
        paths: ["go.mod", "**.go", "buildx.sh"]
```

Simple build commands can be inlined into the `skaffold.yaml`, but
in this example we have created a separate [`build.sh`](build.sh)
script.  This script uses `docker buildx` to containerize
source code for two platforms, `linux/amd64` and `linux/arm64`.

For more information on configuring a custom builder, see the Skaffold custom
builder [documentation](https://skaffold.dev/docs/how-tos/builders/#custom-build-script-run-locally).
Note that Skaffold builders are different from `docker buildx` builders.

Note that Buildx does not support loading images for multiple platforms
o the Docker Daemon.  So this [`build.sh`](build.sh) only uses Buildx
when pushing an image to a registry.  See the _Cautions_ section below.

##### Step 3: Configure node affinities

Next look at the Kubernetes [pod descriptor](k8s/pod.yaml) and notice
the use of _node affinities_ to instruct Kubernetes to schedule the workload
on nodes running either `linux/arm64` or `linux/amd64`.  It is important
to realize that Kubernetes does not examine the referenced container images
to determine the possible platforms.

##### Step 4: Build and deploy the example

Now, use Skaffold to deploy this application to your Kubernetes cluster:

```shell
$ skaffold run --tail --default-repo <your repo>
```

With this command, Skaffold will build the artifact with `docker buildx`
and deploy the application to Kubernetes.  You should be able to
see *Hello, World from <OS><ARCH>!* printed every second in the Skaffold logs.

We need to use `--default-repo` to push to a repository as the
Docker Daemon does not support loading multi-platform images with
the same name.

#### Cleanup

To clean up your Kubernetes cluster, run:

```shell
$ skaffold delete
```

##### ⚠ Caution ⚠

Using `buildx` to build for multiple platforms has some subtle
interactions with Skaffold's artifact caching.

Skaffold normally caches the artifact after a successful container
image build.  Using the principle that given the same source inputs,
a build should produce the same container image, Skaffold records
an association of the resulting image digest with a hash of the
artifact source.  This is the same principle used followed Docker
and other builders to cache image layers to speed up builds.

In this example, the build script configures Buildx differently
depending on the `$PUSH_IMAGE` flag.

  - When `true`, the result is to be pushed to a registry, and all
    registries support multi-platform images.
  - When `false`, the result is to be loaded to the Docker Daemon.
    Buildx does not support loading multi-platform images to
    the Docker Daemon, and so this example builds a single container
    image for the local platform.

But Skaffold is unaware that the build result differs based on `$PUSH_IMAGE`.
So on a local build (`$PUSH_IMAGE=false`), Skaffold will cache the single-platform image,
and that single-platform image will be used for subsequent deployments _even when pushing
to a remote registry_ providing the source is unchanged.  To avoid
this scenario, disable Skaffold's artifact caching when the result
is to be pushed to a remote registry:

```
skaffold build --cache-artifacts=false
```

##### Considerations with `skaffold dev`

When using `skaffold dev` with a remote cluster, this example causes unnecessary
work as it builds and pushes for multiple platforms on each change.  You could
optimize for this case by using a Docker build through a [command-activated
profile](https://skaffold.dev/docs/environment/profiles/#activation).

repository: GoogleContainerTools/skaffold

branch_name: refs/heads/main

gha_language: Go

repo_name: GoogleContainerTools/skaffold


text:
# User Login

## OAuth

use OAuth, here is a [blog](http://blog.miguelgrinberg.com/post/oauth-authentication-with-flask)

## Configuration

`app/__init__.py`

add `LoginManager()`

## revisiting user model

- `is_authenticated`

In general return `True` unless the user should not be allowed to authenticate for some reason

- `is_active`

`True` unless inactive

- `is_anonymous`

`False` unless for fake users that are not supposed to login

- `get_id`

return a unique identifier for the user, in unicode format.

## User loader callback

loads a user from database

## login view function

- `oid.loginhandler` decorator
- `g`

`g` global is setup by Flask as a place to store and share data during the life
of a request.

- `url_for`

a clean way to obtain the URL for a given view function

- `session`

Once data is stored in the session object it will be available during that request and any future requests made by **the same client**.

- `oid.try_login`

    takes 2 arguments
    + the openid
    + a list of data items that we want from the OpenID provider

## login callback

- `oid.after_login`
- `resp` contains information returned by the OpenID provider
- `before_request`, decorated with this will run before the view function each time a request is received
- `login_required`
    + protect views against non loggedin users by add this decorator
    + need to config in the `__init__.py`, `lm.login_view = 'login'`

## The g.user global

- `before_request`
- `current-user` is set by Flask-login
- setup `g.user = current_user`
- user `g.user` in `index` view

## logout

- `logout_user()`

repository: lefttree/flaskApp

repo_name: lefttree/flaskApp


text:
# Header External Login Module

The _Header External Login Module_ is a JAAS login module for Apache Sling that allows users to log in using a set of
HTTP headers. The intended use case for this login module is to delegate authentication to an upstream system. This
will typically be an SSO solution configured at the web-tier/web server that handles the user authentication and then
proxies the request to Sling. As a practical example, Apache HTTPD, [mod_auth_openidc](https://github.com/zmartzone/mod_auth_openidc) and
[Google's OAuth 2.0 API](https://developers.google.com/identity/protocols/oauth2/openid-connect) were used during the
development of this module. If you are interested in using this module to add OpenID Connect support to your Sling application,
follow the _Prerequisites_ and _Installation_ section below, then refer to [README-OPENIDC.md](README-OPENIDC.md). To use
the Header External Module on its own, continue reading.

## How it Works

This module follows the "Pre-Authentication combined with Login Module Chain" approach described on the
[Apache Jackrabbit](https://jackrabbit.apache.org/oak/docs/security/authentication/preauthentication.html) site.

1. The `HeaderAuthenticationHandler` is responsible for detecting a valid header authentication request and extracting
   the authenticated user name. It accomplishes this by performing some basic sanity checks such as shared key validation and
   extracting the user name from the `REMOTE_USER` (default) request header. It then creates a custom credentials
   instance, `HeaderCredentials`, with the `REMOTE_USER` value set as the user ID. These credentials are then stored
   in a new `AuthenticationInfo` instance. It is important to note, that this module assumes that another upstream system
   has already authenticated the user.

   WARNING: For security, the communication between the client and Sling should be encrypted using HTTPS. Secondly,
   it is recommended that the client be a proxy server (i.e. Apache with mod_proxy) that handles the authentication
   and sends the HTTP headers to Sling. These headers should never be allowed to be sent directly by an end user and
   the headers should never be returned by the proxy back to the end-user. Lastly, network-level ACLs should also be
   implemented to only allow traffic to Sling from the proxy.

2. The standard Jackrabbit Oak Login chain is observed and the module with the highest `JAAS ranking` is called first.
   In our case, this will be the `HeaderExternalLoginModule`.
   The `HeaderExternalLoginModule` is responsible for checking that the Credential object is a `HeaderCredentials` object.
   If it is, the login module sets a "Pre-Authentication Marker" on the shared state to signal ton down stream login modules
   that the user is already authenticated. If this is a new user, a user account is created in the repository using the
   default _Sync Handler_. It should be noted that the `HeaderExternalLoginModule.login()` method always returns
   `false`. This is required to allow other modules in the chain to succeed and process the pre-authentication marker.

## Prerequisites

* Java JDK 11
* Apache Maven 3.5+
* Apache Sling 12 with `oak-auth-external` bundle installed.

**NOTE:** Ensure that you have `oak-auth-extern` version 1.32.0 or greater.

## Installation

1. Deploy the `oak-auth-external` bundle to Sling 9. This is not provided by default in Sling 9.

2. Deploy this project to Sling.

```
$ mvn clean install sling:install
```

## Configuration

1. Log into the [Apache Sling Configuration Console](http://localhost:8080/system/console/configMgr) and create a
   configuration for the _Apache Felix JAAS Configuration Factory_ (`org.apache.felix.jaas.Configuration.factory`).
   The `jaas.ranking` must have a higher number than the other JAAS modules for this module to handle logins.

   * Control Flag (jaas.controlFlag) = `Sufficient`
   * Ranking (jaas.ranking) = `5000`
   * Realm Name (jaas.realmName) = `jackrabbit.oak`
   * Class Name (jaas.classname) = `com.peregrine.sling.auth.header.HeaderExternalLoginModule`
   * Options (jaas.options) = _leave empty_

2. Create a configuration for _Header Authentication Handler Configuration_(`com.peregrine.sling.auth.header.HeaderAuthenticationHandler`).

   * Login Cookie (header.auth.login.cookie) = _leave empty_
   * Remote User Header (header.auth.remote.user.header) = `REMOTE_USER`
   * Shared Secret (header.auth.shared.secret) = `secret`
   * Username Whitelist Pattern (header.auth.username.whitelist) = `^[A-Za-z0-9+_.-]+@(.+)$`
   * User Profile Header Whitelist Pattern (header.auth.user.profile.header.whitelist)= `X-Auth-Header(.+)$`

**Attention**: this is not a factory and the configuration name is the class which is configured.

3. Create a configuration for _Apache Jackrabbit Oak Default Sync Handler_.
   (`org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler`).

   * Sync Handler Name (handler-name) = `default`
   * User auto membership (user.autoMembership) = `all_tenants`
   * User Property Mapping (user.propertyMapping) =
     * `preferences/firstLogin=firstLogin`
   * User Path Prefix (user.pathPrefix) = `tenants`
   * Leave all other defaults as-is.

4. Test a header-based authentication request.

```
curl -s -v -L \
  -H "X-Auth-Header-Shared-Secret: secret" \
  -H "REMOTE_USER<EMAIL_ADDRESS>\
  http://localhost:8080/

```

If successful, you should have a user named<EMAIL_ADDRESS>created under `/home/users/tenants`.

gha_language: Java


text:
| GJK Collision Detection | A* Shortest Path | Projectile Motion |
| ------------- |:-------------:| ------------- |
| ![gjk](gifs/gjk.gif) | ![astar](gifs/astar.gif) | ![projectile](gifs/projectile.gif)

## GJK Collision Detection
Interactive tool for visualizing the Gilbert-Johnson-Keerthi (distance)
algorithm for collision detection.

## A* Shortest Path
Interactive tool for visualizing the A* Shortest Path Finding Algorithm,
which is an informed search algorithm that determines the shortest path
between nodes.

## Projectile Motion
Interactive tool for visualizing 2D Projectile Motion with zero air
resistance and constant acceleration in the vertical direction.

## Dependency
Pygame


text:
# Extra exercise: Replicating a Conda environment in a container

This is an extra exercise. It can not be run in Puhti. You will need  access
to a computer or a virtual machine where you have sudo rights and that has
Singularity 3.x installed.

## Conda
Conda is a usefull tool for installing software with complex dependencies.
It has, however, some problems, especially on systems like Puhti.

The main problems are related to storage: Conda environments can be quite large,
and can have tens of thousands of files. Just 3-4 environments are enough to fill
the basic quota of project's /projapp directory.

Conda environments can also be somewhat sensitive to changes in the base system,
meaning that e.g. updates in Puhti can sometimes break Conda environments,
necessitating a re-install.

Using a Singularity container instead can help with both problems: Singularity
containers are just single file that is typically smaller than the total size
of the Conda environment directory. They are also less sensitive for changes in
host system.

It is relatively easy to replicate an existing Conda environment inside a container.

## Check for ready containers

You should check first if the software package is already avaliable as a Singularity
or a Docker container.

The advantage of a ready container is that they can usually be pulled/converted with
normal user rights in Puhti.

You can find more detailed instructions for converting Docker images in Docs CSC:
[Running existing containers](https://docs.csc.fi/computing/containers/run-existing/)

## Replicating existing Conda environment

If you have an existing Conda environment, you can save `environmet.yml` file and
use it to replicate the environment.

Please note that the `environment.yml` file will only reflect changes to environment
made using conda commands. If you have made any changes directly, you will need to replicate
those changes in the definition file.

Make sure the environment you want to replicate is activated, and give command:
```text
conda env export > environment.yml
```
You can try with one of your own environments, or download an example to use for
this exercise:
```text
wget https://raw.githubusercontent.com/CSCfi/csc-env-eff/master/data/environment.yml
```
In addition to the `environmet.yml` file, you will need a Singularity definition file.

Create a file called `conda_environment.def` with following content (you can copy-paste).
```text
Bootstrap: docker

From: continuumio/miniconda3

%files
    environment.yml

%environment

%post
    ENV_NAME=$(head -1 environment.yml | cut -d' ' -f2)
    echo ". /opt/conda/etc/profile.d/conda.sh" >> $SINGULARITY_ENVIRONMENT
    echo "conda activate $ENV_NAME" >> $SINGULARITY_ENVIRONMENT

    . /opt/conda/etc/profile.d/conda.sh
    conda env create -f environment.yml -p /opt/conda/envs/$ENV_NAME

%runscript
    exec "$@"
```
Make sure files `environment.yml` and `conda_environment.def` are in the
current directory and give command:

```text
sudo singularity build fastx.sif conda_environment.def
```
This will build a Singularity image file called `fastx.sif`.

We can test now that it works:
```text
singularity exec fastx.sif fastq_to_fasta -h
```
The image file could now be transferred and used in Puhti.

## Comparision of installation methods

This particular environment was chosen because it is a "good bad example" on
what effect different installation methods can have.

The software package is a collection of applications written in C++ with
only a few dependencies. Usually similar packages are best installed natively.
In this case, however, the code is quite old, and will not compile with modern
gcc versions without some changes to  source code.

It is available in Bioconda repository, so it is available for install simply with:
```text
conda install fastx_toolkit
```
- Good: Can be done with user rights
- Bad: Using this method you will end up with a directory with a total size of 990 MB
and over 26000 files. The default file number limit for /projappl is 10000 files,
so this single installation already used 25% of that.

Replicating the Conda environment as a container like we did in this exercise is already
better.
- Good: We ended up with a single 813 MB file. The default total file size limit for
/projapp is 50 GB, so this installation only used 1,6%.
- Bad: Can not be done directly in Puhti

In this case there would even better option: Building from a ready container:
```text
singularity build fastx.sif docker://biocontainers/fastx-toolkit:v0.0.14-6-deb_cv1
```
- Good: This can be done with user right in Puhti and you end up with a single 61 MB file.
- Bad: Finding a ready, working container may take some time.

Containers are not a "silver bullet" solution to all installation problems, but they can
be in many cases a preferable alternative for conda.

repository: tdeneke/csc-env-eff

repo_name: tdeneke/csc-env-eff


text:
# Selectors

## Typical Setups

[React function components](https://reactjs.org/docs/components-and-props.html) may read from Redux state using `react-redux`'s [`useSelector` hook](https://react-redux.js.org/api/hooks#useselector).
Consider this simple Redux state shape containing a `title` of type `string`:

```tsx
const initialState = {
  title: "",
};
```

Your state code might declare a `selectTitle` selector to retrieve that title:

```tsx
const selectTitle = (state) => state.title;
```

Your view code might use that selector to render the title:

```tsx
const Heading = () => {
  const title = useSelector(selectTitle);

  return <h1>{title}</h1>;
};
```

## View Testing

You _could_ set up Redux state with a full state tree:

```tsx
const testState = {
  title: "Test Title",
};

// Renders <h1>Test Title</h1>
<Provider store={configureStore()(testState)}>
  <Heading />
</Provider>;
```

So much work!
That testing setup's complexity and resultant pain can easily grow with your application.

It can be useful to separate view and state logic in tests: especially when state is shared across many places.

Instead, `mock-react-redux` can _simplify_ or even _replace_ any Redux interactions.
You have two options:

- Providing a mocked Redux state for your test
- Directly using predefined return values or mock functions for individual selectors

## Mocking State

You can set mock Redux state for the duration of a test.
That state will be provided to selectors called by `useSelector`.

```tsx
mockReactRedux().state({
  title: "Test Title",
});

// Renders <h1>Test Title</h1>
<Heading />;
```

`.state` takes in a single parameter and can only be called once per test:

- `state`: A value to use as the root Redux state for the duration of the test

## Mocking Selectors

### `give`

If your component only uses `useSelector` and directly passes predefined selector functions to it,
you can completely remove its dependency on Redux state with `.give`.
It takes two parameters:

- `selector`: Selector function to mock out return values for
- `returnValue`: Value to return whenever the selector is provided to `useSelector`

The `returnValue` will be directly returned when `useSelector` is called from that `selector`:

```tsx
mockReactRedux().give(selectTitle, "Test Title");

// Renders <h1>Test Title</h1>
<Heading />;
```

### `giveMock`

If you'd like more control over the return values, use `.giveMock` to provide a [Jest mock](https://jestjs.io/docs/en/mock-functions.html).
It takes two parameters:

- `selector`: Selector function to mock out return values for
- `mock`: Jest mock function to call in place of the selector

For example, you might want the selector to return a different value than the first on subsequent calls:

```tsx
mockReactRedux().giveMock(
  selectTitle,
  jest
    .fn()
    .mockReturnValueOnce("First!")
    .mockReturnValueOnce("Second.")
    .mockReturnValue("Other times..."),
);
```

See [Jest's mock functions](https://jestjs.io/docs/en/mock-functions.html) for full documentation.

> See [FAQs](./FAQs.md) for help choosing between these strategies and pracices for mocking selectors.

## Examples

- [Heading](./examples/Heading.test.tsx): Tests for the `Heading` component above
- [Tracking](./examples/Tracking.test.tsx): Component tests that exercise both dispatch and selector logic

repository: njradford/mock-react-redux

repo_name: njradford/mock-react-redux


text:
- Title: Addition of a `JsonConverter` node
- Decision driver: @bglearning
- Start Date: 2023-01-26
- Proposal PR: #3959

# Summary

Right now we don't have a node that can take json files as input to be fed into a pipeline.

Proposal: Add a `JsonConverter` node that takes in a json file, parses it, and generates `Document`s.
It would also support the `jsonl` format with one line corresponding to one document.

# Basic example

```python
from haystack.nodes import JsonConverter

converter = JsonConverter()

# Receive back List[Document]
docs = converter.convert("data_file.json")
```

With the `data_file.json` as a list of json representation of documents:

```json
[
    {
        "content": "...",
        "content_type": "text", "meta": {...}
    },
    {
        "content": [["h1", "h2"], ["val1", "val2"]],
        "content_type": "table", "meta": {...}
    }
]
```

Alternatively, the data can also be `jsonl`.
By default, the converter will try to auto-detect between `json` and `jsonl`.

The main use case would be to be able to include this directly in the YAML specification

```yaml
...

pipelines:
  - name: indexing
    nodes:
      - name: JsonConverter
        inputs: [File]
      - name: Retriever
        inputs: [JsonConverter]
      - name: DocumentStore
        inputs: [Retriever]
```

# Motivation

Users may want to do some processing of the data themselves, persist it somehow, and only then pass it onto a haystack pipeline (for instance, by uploading into the REST API endpoint). Ideally this would happen without the need to create a custom endpoint.

For many such processing, json is a convenient intermediate format as it allows for things like specifying the metadata.

Specifically, one use-case that has come up for a team using haystack: they want to use a PDF parser (for tables) currently not in haystack. As such, they want to handle the parsing themselves outside of haystack, put the parsed result into a json file, and then pass it onto a haystack API endpoint.

Having a `JsonConverter` node would allow users to setup a haystack pipeline to ingest such data without the user having to create a custom node for it.

# Detailed design

The converter would primarily be a wrapper around `Document.from_dict`.

The schema accepted would be the a list of json dictionary of Documents.
So, the following, with `content` being the only compulsory field.

```
[
    {
        "content": str or list[list],
        "content_type": str,
        "meta": dict,
        "id_hash_keys": list,
        "score": float,
        "embedding": array
    },
    ...
]
```

```python
class JsonConverter(BaseConverter):
    def __init__(self, ...):
        ...

    def convert(
        self,
        file_path: Path,
        meta: Optional[Dict[str, str]] = None,
        encoding: Optional[str] = "UTF-8",
        id_hash_keys: Optional[List[str]] = None,
        ...
    ) -> List[Document]:
        if id_hash_keys is None:
            id_hash_keys = self.id_hash_keys

        documents = []
        with open(file_path, encoding=encoding, errors="ignore") as f:
            data = json.load(f)
            for doc_dict in data:
                doc_dict = dict(doc_dict)
                doc_dict['id_hash_keys'] = id_hash_keys
                doc_dict['meta'] = doc_dict.get('meta', dict())

                if meta:
                    doc_dict['meta'].update(meta)

                documents.append(Document.from_dict(doc_dict))

        return documents
```

# Drawbacks

- It would add another node that needs to be maintained and documented.

# Alternatives

- This node could be created as a custom node for the particular application where it is required. But could be better to have it out-of-the-box.
- Design Alternative: Also, provide options to map custom fields to `Document` fields (E.g. {"review": "content"}) which could make this node a bit more flexible and might mean the user doesn't have to do some pre-formatting beforehand. But this can be a future development.

# Adoption strategy

It doesn't introduce a breaking change and wouldn't require changes in existing pipelines.

# How we teach this

It would be good to have this be part of the Guide (perhaps under File Converters).

Could also be mentioned in one of the tutorials. For instance, in the preprocessing tutorial where we say "Haystack expects data to be provided as a list documents in the following dictionary format".

# Unresolved questions

- Should the `content_type` allowed be restricted (e.g. only "text" and "table"). And relatedly, should the name be more specific? E.g. `JsonTableTextConverter` rather than `JsonConverter`. Currently leaning towards no restriction and the `JsonConverter` name.

repository: deepset-ai/haystack

gha_language: Python

repo_name: deepset-ai/haystack


text:
# teedy terraform digitalocean setup

This is a simple example terraform project that sets up a digitalocean droplet and volume at digitalocean for the [teedy dms](https://github.com/sismics/docs) and starts the corresponding docker container.

## How to use it?
Adjust the terraform.tfvars:
* Generate a ssh-key pair without a passphrase and adjust the terraform_public_ssh_key and terraform_private_ssh_key accordingly.
* desktop_public_ssh_key is a key for you to log into the droplet.
* do_token has to be your DigitalOcean access token.
* domain is required for the domain entry, if you don't own a domain remove the corresponding part from the main.tf.
Adjust the nginx.conf to remove tls if desired, else adjust the domain name.
 Remeber to run apt-get dist-upgrade manually afterwards (requires some non-trivial interactions) followed by a system restart.

## What is created at digitalocean?
* One droplet with 1 cpu and 1gb ram droplet with an attached volume.
* A project called teddy to manage the droplet.
* A domain with a A-level dns entry as well as a CNAME alias.
* One ssh public key for terraform and one for the desktop user (possible to be identical).

repository: ngergs/terraform-teedy

repo_name: ngergs/terraform-teedy


text:
Most hallways contain several room scores, this is so that moving through a hallway resets rooms around it and parts of the hallway that are not seen.

For example the back of the F1 hallway is reset if you're in the front, until you get to the connecting section.

This behavior is called a viewpoint: the room has a smaller score-giving area than load area; the latter of which contains other rooms (partially).

To make sure sounds can be heard through viewpoints, make sure to add them to the `#luigis_mansion:get_same_room` list. This list basically means "if room score is A, it can also hear in room B".

A viewpoint can be one-way, for example, the master bedroom loads the balcony, but the balcony does not load the master bedroom.

repository: Medacorp/Luigi-s-Mansion

filename: Multi-room rooms.md

gha_language: mcfunction

repo_name: Medacorp/Luigi-s-Mansion


text:
# /fusebot coin {coin-symbol}

This command gets the current USD value of the specified digital currency on multiple exchanges.

1. Type `/fusebot edit coin`.
2. Click the _edit_ link.
3. Copy and paste the [command.js](command.js) file content into the command.js file in the web editor.
4. Save.
5. Call `/fusebot coin bty` from Slack/Discord.
6. Modify and tinker!

repository: fusebit/fusebot

repo_name: fusebit/fusebot


text:
# javalisp
A simple LISP interpreter implemented in Java.

I wrote this over the course of about three days more or less as an exercise, based off my memory of LISP from before
Java existed.  LISP is so simple a language that once you learn it, you can't really forget it, and the LISP interpreter,
consisting primarily of two mutually recursive functions, `eval` and `apply`, is equally simple.

The parser is a simple recursive descent parser of less tha 200 lines of code, built on top of a Java StringTokenizer.
It handles lists, including dot notation, symbols, integers, strings, and bits of syntactic sugar for things like
`'(A B C)` as a shorthand for `(QUOTE (A B C))`, and similar shorthands for `BACKQUOTE`, `COMMA` and `COMMA_AT`
(primarily used in defining LISP macros). So far the only reason the string type was included was for the `LOAD` function,
which takes the name of a file as a string.

Using maven, the interactive interpreter can be run by running:

`mvn compile`

`mvn exec:exec`

Exit the interactive interpreter by evaluating `NIL` or `()`.

Macro definition is supported.  There's an example of defining `LET` as a macro in the file `let_macro.lisp`.

Files can be loaded with the LOAD function.  Example:

`(LOAD "let_macro.lisp")`

There's a trace facility, which prints arguments and return values for every call to eval or apply,
as well as macro expansion.  Tracing is started and stopped by evaluating `(TRACE)` and `(UNTRACE)`.

license: Unlicense

repository: billvanyo-zz/javalisp

repo_name: billvanyo-zz/javalisp


text:
---
title: Chorus Flower
layout: document
---
## Detail

|Kind|Content|
|---|---|
|Description|Chorus Flower|
|Type|[Plants](Plants)|
|Collecting Tool|[Wooden Pickaxe](Wooden_Pickaxe)|
|Place|The End|
|Production|Grow [Chorus Plant](Chorus_Plant)|

That is the flower at the top of the [Chorus Plant](Chorus_Plant).
It will be resurrected white even if it is brown and withered flowers.

In order to collect, it is necessary to tap the tip flower directly with an pickaxe.
If you hit a branch, flowers disappear, so be careful.

When planting [Chorus Flower](Chorus_Flower) on [End Stone](End_Stone) or branch of [Chorus Plant](Chorus_Plant), plants grow.


text:
---
title: Overview
page_title: Overview
description: Check our "Overview" documentation article for the RadProgressBar {{ site.framework_name }} control.
slug: radprogressbar-overview
tags: overview
published: True
position: 0
CTAControlName: RadProgressBar
---

# {{ site.framework_name }} ProgressBar Overview

Telerik __RadProgressBar__ is an advanced component allowing you to completely convey the progress of various tasks. The control ships with several pre-defined themes and animations.

{% if site.has_cta_panels == true %}
{% include cta-panel-overview.html %}
{% endif %}

![{{ site.framework_name }} RadProgressBar Overview](images/radprogressbar-overview-0.png)

## Key Features

* __Orientation__: Set the orientation of the control to either vertical or horizontal. Read more about this in the [Orientation]({%slug orientation%}) article.

* __Easy range and value configuration__: Configure the behavior of the RadProgressBar control by defining the minimum and maximum value of the range element. You can also define the “step size” incrementing the value.

* __Indeterminate state support__: A mode that displays an animation indicating an unspecified amount of waiting time. Read more about this in the [IsIndeterminate]({%slug isindeterminate%}) article.

>tip Get started with the control with its [Getting Started]({%slug getting_started%}) help article that shows how to use it in a basic scenario.

> Check out the online demo at {% if site.site_name == 'Silverlight' %}[demos.telerik.com](https://demos.telerik.com/silverlight/#ProgressBar/FirstLook){% else %}[demos.telerik.com](https://demos.telerik.com/wpf/){% endif %}

## See Also
 * [Visual Structure]({%slug radprogressbar-structure%})

repository: telerik/xaml-docs

gha_license_id: NOASSERTION

repo_name: telerik/xaml-docs


text:
# SmoothingSplines

[![Build Status](https://github.com/nignatiadis/SmoothingSplines.jl/workflows/CI/badge.svg)](https://github.com/nignatiadis/SmoothingSplines.jl/actions)
[![Coverage](https://codecov.io/gh/nignatiadis/SmoothingSplines.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/nignatiadis/SmoothingSplines.jl)

A Julia package for nonparametric regression with Cubic Smoothing Splines. The initial aim is to provide the same functionality as R's `smooth.spline` function and competitive computational performance. The implementation however is completely independent of the R function and based on the algorithm by Reinsch [1], as described in Chapter 2 of [2].

```julia
using SmoothingSplines
using RDatasets
using Gadfly

cars = dataset("datasets","cars")
X = map(Float64,convert(Array,cars[!,:Speed]))
Y = map(Float64,convert(Array,cars[!,:Dist]))

spl = fit(SmoothingSpline, X, Y, 250.0) # λ=250.0
Ypred = predict(spl) # fitted vector
plot(layer(x=X, y=Y, Geom.point),
	layer(x=X, y=Ypred, Geom.line, 	Theme(default_color=colorant"red")))

predict(spl, 20.0) #prediction at arbitrary point
```

### TODO

* Better docs
* conversion between regularization parameter λ and degrees of freedom
* automatic selection of λ (LOOCV, GCV)
* subsampling of design grid for higher efficiency

**References**

[1] Reinsch, Christian H. "Smoothing by spline functions." Numerische mathematik 10.3 (1967): 177-183.

[2] Green, Peter J., and Bernard W. Silverman. Nonparametric regression and generalized linear models: a roughness penalty approach. CRC Press, 1993.

gha_language: Julia


text:
---
layout: page
title: About
---

*Welcome to Nails for Nickels!*

Just like the banner says, I’ll be showing you how to create fun and easy nail art that’s easy on the wallet. A fair amount of these nails will be themed in some way (expect lots of holiday manicures!), but I’ll also show you how you can create some of the classics at home without breaking the bank at the nail salon!

**The Website:**

While I might put up occasional personal blog posts, this website is dedicated to showing you how to make awesome DIY nail art! The majority of my tutorials will probably be manicures, but I’ll throw in some pedicure tutorials to keep things interesting!

**The Author:**

Hey nail-lovers, the name is Lindsey! I’m a twenty-something lady living in the gorgeous Bay Area, and I think cheap and fun manicures are the bee’s knees. Take a look around, tell your friends, and hit me up with any kudos, questions, concerns, or pics of your own awesome nails!

**Contact:**

[Facebook](https://www.facebook.com/nailsfornickels) *
[Instagram](https://www.instagram.com/thedragonbabe/) *
[Tumblr](http://nailsfornickels.tumblr.com) *
[Twitter](https://twitter.com/TheDragonBabe)

gha_language: CSS


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.19.0](https://github.com/hidoo/gulp-project/compare/v0.18.0...v0.19.0) (2021-06-09)

### Bug Fixes

* **deps:** update dependency get-stream to v6.0.1 ([686e7ed](https://github.com/hidoo/gulp-project/commit/686e7ed63e8064f66af332c459425ab96e84b546))
* **packages:** remove node v10 support ([23ce2ac](https://github.com/hidoo/gulp-project/commit/23ce2ac8fbae0ec0c00254e772d0c83a7b139ad8))

# [0.18.0](https://github.com/hidoo/gulp-project/compare/v0.17.0...v0.18.0) (2021-04-07)

### Bug Fixes

* **deps:** update dependency get-stream to v6 ([2023bd2](https://github.com/hidoo/gulp-project/commit/2023bd20c95d493acd90f358d89aad69ec1a5e46))

# [0.17.0](https://github.com/hidoo/gulp-project/compare/v0.16.0...v0.17.0) (2021-03-31)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.16.0](https://github.com/hidoo/gulp-project/compare/v0.15.0...v0.16.0) (2021-03-30)

### Bug Fixes

* **deps:** update dependency get-stream to v5.2.0 ([d3dd22f](https://github.com/hidoo/gulp-project/commit/d3dd22f707b7d7fe8b0d90595b500ebe0ba4fdf2))
* **deps:** update dependency pixelmatch to v5.2.0 ([7ba8965](https://github.com/hidoo/gulp-project/commit/7ba89657e650206f44c51e7aa08d65b2489763d8))
* **deps:** update dependency pixelmatch to v5.2.1 ([3614eeb](https://github.com/hidoo/gulp-project/commit/3614eebb06c6d7edf158c39fb0f7851c53bdbf7d))
* **deps:** update dependency through2 to v3.0.2 ([d1f5174](https://github.com/hidoo/gulp-project/commit/d1f5174ec68f3a4aecd61352de711643c69f3162))
* **deps:** update dependency through2 to v4 ([a152c88](https://github.com/hidoo/gulp-project/commit/a152c8870b65622b13a91d3897ba68acd90b99dc))
* **deps:** update dependency vinyl to v2.2.1 ([631bd8b](https://github.com/hidoo/gulp-project/commit/631bd8b558b3eb5577854f5ad3e96b8a6e1aed6a))

# [0.15.0](https://github.com/hidoo/gulp-project/compare/v0.14.1...v0.15.0) (2020-03-03)

### Bug Fixes

* **deps:** update dependency ndarray to v1.0.19 ([8ab3ef2](https://github.com/hidoo/gulp-project/commit/8ab3ef2f6fca3149f20442a9ace2778d8251d873))
* **packages:** remove node v8 support ([750671b](https://github.com/hidoo/gulp-project/commit/750671b2df95f8dfe0da1a9bbe8940675cbdd487))

## [0.14.1](https://github.com/hidoo/gulp-project/compare/v0.14.0...v0.14.1) (2019-11-21)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.14.0](https://github.com/hidoo/gulp-project/compare/v0.13.0...v0.14.0) (2019-11-11)

### Bug Fixes

* **deps:** update dependency pixelmatch to v5.1.0 ([d193871](https://github.com/hidoo/gulp-project/commit/d193871ea2b5991ae222690f53d91eedebb20353))

# [0.13.0](https://github.com/hidoo/gulp-project/compare/v0.12.0...v0.13.0) (2019-08-22)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.12.0](https://github.com/hidoo/gulp-project/compare/v0.11.0...v0.12.0) (2019-08-02)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.11.0](https://github.com/hidoo/gulp-project/compare/v0.10.0...v0.11.0) (2019-07-19)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.10.0](https://github.com/hidoo/gulp-project/compare/v0.9.0...v0.10.0) (2019-06-25)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.9.0](https://github.com/hidoo/gulp-project/compare/v0.8.4...v0.9.0) (2019-06-11)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

## [0.8.4](https://github.com/hidoo/gulp-project/compare/v0.8.3...v0.8.4) (2019-04-08)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

## [0.8.3](https://github.com/hidoo/gulp-project/compare/v0.8.2...v0.8.3) (2019-03-26)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

## [0.8.2](https://github.com/hidoo/gulp-project/compare/v0.8.1...v0.8.2) (2019-03-12)

### Bug Fixes

* **package:** update get-stream to version 5.0.0 ([e01fff0](https://github.com/hidoo/gulp-project/commit/e01fff0))

## [0.8.1](https://github.com/hidoo/gulp-project/compare/v0.8.0...v0.8.1) (2019-03-04)

### Bug Fixes

* **package:** update image-size to version 0.7.2 ([87fd117](https://github.com/hidoo/gulp-project/commit/87fd117)), closes [#139](https://github.com/hidoo/gulp-project/issues/139)

# [0.8.0](https://github.com/hidoo/gulp-project/compare/v0.7.0...v0.8.0) (2018-12-14)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.7.0](https://github.com/hidoo/gulp-project/compare/v0.6.2...v0.7.0) (2018-12-10)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

## [0.6.2](https://github.com/hidoo/gulp-project/compare/v0.6.1...v0.6.2) (2018-10-26)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

## [0.6.1](https://github.com/hidoo/gulp-project/compare/v0.6.0...v0.6.1) (2018-10-26)

**Note:** Version bump only for package @hidoo/gulp-plugin-image-placeholder

# [0.6.0](https://github.com/hidoo/gulp-project/compare/v0.5.0...v0.6.0) (2018-10-23)

### Bug Fixes

* **gulp-plugin-image-placeholder:** fix output to same dir as orig file ([f15564e](https://github.com/hidoo/gulp-project/commit/f15564e))

### Features

* **packages:** add plugin that add image of placeholder for gulp ([33e456f](https://github.com/hidoo/gulp-project/commit/33e456f))

repository: hidoo/gulp-project

repo_name: hidoo/gulp-project


text:
##My use for mmdetection##

1.Repost(git clone https://github.com/open-mmlab/mmdetection.git)
2.Mostly,follow the original instruction(mmdetection-master/docs),especially INSTALL.md,GETTING_STARTED.ma,MODEL_ZOO.md.
3.Modified for 2019 fabric defect detection competition(https://tianchi.aliyun.com/competition/entrance/231748/introduction):
(1)use the convertTococo.py to transfer fabric data provided by the competition to coco form.
(2)use the combineJsons.py to combine json files of two ronuds of fabric data.
(3)use the flipAndRotate.py to do data augmentation.
(4)put the fabric data into /root/coco(include json files and images),then run"cd mmdetection-master
mkdir data
ln -s /root/coco/ data"
(5)revise mmdet/dataset/coco.py(note the original coco CLASSES):
CLASSES = ('1', '2', '3', '4', '5', '6',
               '7', '8', '9', '10', '11',
               '12', '13', '14', '15', '16', '17',
               '18', '19', '20')
(6，not necessary)revise mmdet/core/evaluation/class_names.py like this:
def coco_classes():
    return [
        '1', '2', '3', '4', '5', '6',
        '7', '8', '9', '10', '11',
        '12', '13', '14', '15', '16', '17',
        '18', '19', '20'
    ]
(7)revise configs/cascade_rcnn_r101_fpn_1x.py:
[change] data_root if needed
[change] train = dict(type=dataset_type,ann_file=data_root + 'annotations/instances_train2017.json',
img_prefix=data_root + 'train2017/',pipeline=train_pipeline),
[to] train=dict(type=dataset_type,ann_file=data_root + 'annotations/coco_train.json',
img_prefix=data_root + 'defect_Images/',pipeline=train_pipeline)
[change] val = dict(type=dataset_type,ann_file=data_root + 'annotations/instances_val2017.json',img_prefix=data_root + 'val2017/',pipeline=test_pipeline) if needed
[change] num_classes=81 [to] num_classes=21
[change] img_scale=(1333, 800) [to] img_scale=(1223, 500)
[change] imgs_per_gpu=2 [to] imgs_per_gpu=1 if needed
[change] lr=0.02 [to] lr=0.0025 (lr=0.00125*batch_size=0.00125*gpu_num*imgs_per_gpu)
[change] load_from=None [to] load_from = "./checkpoints/cascade_rcnn_r101_fpn_1x_20181129-d64ebac7.pth"
Then under the ubuntu path of "mmdetection-master",excute "python tools/train.py configs/cascade_rcnn_r101_fpn_1x.py".
(8)use demo2_inference.py to predict,remember to changed the path of "config_file""checkpoint_file""test_path".


text:
# Data Structures and Algorithms

See [setup instructions](https://codefellows.github.io/setup-guide/code-301/3-code-challenges), in the Code 301 Setup Guide.

## Repository Quick Tour and Usage

### 301 Code Challenges

Under the `data-structures-and-algorithms` repository, at the top level is a folder called `code-challenges`

Each day, you'll add one new file to this folder to do your work for the day's assigned code challenge

### 401 Data Structures, Code Challenges

|  Challenge     |       link     |
| -------------- | -------------- |
| arrayReverse   | [CC01](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/arrayReverse)       |
|      CC02      | [CC02](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/arrayShift)         |
|      CC03      | [CC03](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/arrayBinarySearch)  |
|   linked list  | [CC05](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/linkedList)         |
| ll-insertions  | [CC06](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/linkedList)         |
|ll-kth-from-end | [CC07](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/linkedList)         |
|    ziplist     | [CC08](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/linkedList/llZip%20)|
|Stack and Queue | [CC10](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/stacksAndQueues)    |
|QueueWithStacks | [CC11](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/QueueWithStacks)    |
|AnimalShelter   | [CC12](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/fifoAnimalShelter)  |
|multiBracketValidation| [CC13](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/multiBracketValidation)  |
|tree| [CC15](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/tree)|
|findMax| [CC16](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/tree)|
|breadth-first| [CC17](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/tree)|
|fizzBuzz| [CC18](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/fizzBuzzTree)|
|insertion sort| [CC26](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/InsertionSort)|
|merge sort| [CC27](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/merge-sort)|
|Quick sort| [CC28](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/quickSort)|
|HashTable| [CC30](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/hashtable)|
|HashTable| [CC30](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/hashtable)|
|repeatedWord | [CC31](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/repeatedWord)|
|treeIntersection | [CC32](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/treeIntersection)|
|left join| [CC33](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/left-join)|
|graph| [CC35](https://github.com/boodah96/data-structures-and-algorithms/tree/main/javascript/challenges-401/graph)|


text:
---
title: React Navigation v5 + React Native Paper = ❤
author: Dawid Urbaniak
author_url: https://twitter.com/trensik
author_title: Paper Team
author_image_url: https://avatars0.githubusercontent.com/u/18584155?s=200&v=4
tags: [tutorial, react-native-paper]
---

This is a guest post by the [React Native Paper](https://reactnativepaper.com/) team. If you like this guide, check out React Native Paper for more!

In this blog post, we'll show you how to build a Twitter clone app using React Navigation v5 and Paper.

## Introduction

The React Navigation v5 comes with many great improvements compared to previous version. It not only provides a cross-platform native Stack, but also the API was redesigned from the ground up to allow things that were never possible before. Thanks to the component-based API, all of the configuration is happening inside the **render method**. This means we can access **props**, **state** and **context** and can **dynamically change configuration** for the navigator.

### What is React Native Paper?

[React Native Paper](https://reactnativepaper.com/) is a UI component library that implements [MD Guidelines](https://material.io/design/).
It allows building beautiful interfaces on Mobile and Web with high-quality cross-platform components.
Furthermore, Paper provides you with a full **theming support**, **accessibility**, **RTL** and it will take care of **platform adaptation**. This means you can focus on building apps with ready to use components instead of reimplementing the boring stuff.

In this guide, we would like to show you how to integrate React Navigation with Paper's components. To show all the details of the integration we've decided to build a clone of Twitter. Of course, the functionalities will be very limited but the navigation part and main screens should look and feel similar.

In the following gif, you can see what is the final version of the app gonna looks like:

## Overview of the App

Since original Twitter is a very complex app, we will build only a part of it. This means we will implement:

- Drawer
- Stack Navigator with two screens: Screen showing bottom navigation and Details of a tweet
- Bottom navigation with 3 tabs: Feed, Notifications, and Messages

I will focus this guide on a React Navigation and React Native Paper integration. It means I won't show you how to build all of the components necessary to create such an app, but you can always check the full implementation in the [github repo](https://github.com/Trancever/twitterClone).

Let's get started!

## Getting started

I assume you already have an [Expo](https://expo.io/) project running locally. If not, make sure to create one. I chose Expo over plain React-Native because it includes most of the dependencies that we need so there is less work to do for us.

Let's install React Native Paper, React Navigation v5 and other required dependencies.

```bash
npm install @react-navigation/native @react-navigation/stack @react-native-community/masked-view @react-navigation/drawer @react-navigation/material-bottom-tabs react-native-paper
```

In the next step we will make sure versions of these libraries are compatible.

```bash
expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context
```

After you run these two commands you should be ready to go. Let's start implementing the app!

## React Navigation and React Native Paper initial setup.

Both these libraries require minimal setup.

In case of React Native Paper, we need to wrap the component tree with a **Provider**. You can do this inside the exported component in the **App.js** file.

```jsx
import React from 'react';
import { Provider as PaperProvider } from 'react-native-paper';
import Main from './src/Main';

export default function App() {
  return (
    <PaperProvider>
      <Main />
    </PaperProvider>
  );
}
```

The **PaperProvider** provides the theme to all the components in the framework. It also acts as a portal to components that need to be rendered at the top level. Check the full [Getting-Started](https://callstack.github.io/react-native-paper/getting-started.html) page for more information.

React Navigation setup looks similar. There is a component called **NavigationContainer** which manages our navigation tree and contains the navigation state. It must wrap all navigator structure. We will render this component in **App.tsx** inside a **PaperProvider**. More information can be found in the official [documentation](/docs/hello-react-navigation).

```jsx
import React from 'react';
import { Provider as PaperProvider } from 'react-native-paper';
import { NavigationContainer } from '@react-navigation/native';
import Main from './src/Main';

export default function App() {
  return (
    <PaperProvider>
      <NavigationContainer>
        <Main />
      </NavigationContainer>
    </PaperProvider>
  );
}
```

## Drawer

In our Twitter clone, we want to implement a Drawer that is available from any screen in the app. This means it has to be a topmost navigator.

In React Navigation v5 there is a common pattern for creating navigators. After importing **createXNavigator** function from the navigator package of your choice you can use **Navigator** and **Screen** components from the value it returns.

So let's create a basic version of a Drawer:

```jsx
import React from 'react';
import { Text, View } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';

const Drawer = createDrawerNavigator();

function DrawerContent() {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text>Drawer content</Text>
    </View>
  );
}

function HomeScreen() {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text>Home Screen</Text>
    </View>
  );
}

export const RootNavigator = () => {
  return (
    <Drawer.Navigator drawerContent={() => <DrawerContent />}>
      <Drawer.Screen name="Home" component={HomeScreen} />
    </Drawer.Navigator>
  );
};
```

That's what we see on a screen:

We can open a drawer with a swipe gesture, it looks very smooth. However, the UI doesn't look very impressive so let's add more content to the drawer to make it look just like in the final version.

We will use:

- **_DrawerContentScrollView_** and **_DrawerItem_** from **_@react-navigation/drawer_**
- **_Avatar_**, **_Text_** and **_Switch_** from **_react-native-paper_**

**DrawerContentScrollView** component makes the drawer vertically scrollable and provides support for devices with notches, so it's highly recommended to use it even for custom drawers.

**Components from React Native Paper** make a clean, material UI.

```jsx
import React from 'react';
import { View, StyleSheet } from 'react-native';
import {
  DrawerItem,
  DrawerContentScrollView,
} from '@react-navigation/drawer';
import {
  useTheme,
  Avatar,
  Title,
  Caption,
  Paragraph,
  Drawer,
  Text,
  TouchableRipple,
  Switch,
} from 'react-native-paper';
import { MaterialCommunityIcons } from '@expo/vector-icons';

export function DrawerContent(props) {
  return (
    <DrawerContentScrollView {...props}>
      <View
        style={
          styles.drawerContent,
        }
      >
        <View style={styles.userInfoSection}>
          <Avatar.Image
            source={{
              uri:
                'https://pbs.twimg.com/profile_images/952545910990495744/b59hSXUd_400x400.jpg',
            }}
            size={50}
          />
          <Title style={styles.title}>Dawid Urbaniak</Title>
          <Caption style={styles.caption}>@trensik</Caption>
          <View style={styles.row}>
            <View style={styles.section}>
              <Paragraph style={[styles.paragraph, styles.caption]}>
                202
              </Paragraph>
              <Caption style={styles.caption}>Following</Caption>
            </View>
            <View style={styles.section}>
              <Paragraph style={[styles.paragraph, styles.caption]}>
                159
              </Paragraph>
              <Caption style={styles.caption}>Followers</Caption>
            </View>
          </View>
        </View>
        <Drawer.Section style={styles.drawerSection}>
          <DrawerItem
            icon={({ color, size }) => (
              <MaterialCommunityIcons
                name="account-outline"
                color={color}
                size={size}
              />
            )}
            label="Profile"
            onPress={() => {}}
          />
          <DrawerItem
            icon={({ color, size }) => (
              <MaterialCommunityIcons name="tune" color={color} size={size} />
            )}
            label="Preferences"
            onPress={() => {}}
          />
          <DrawerItem
            icon={({ color, size }) => (
              <MaterialCommunityIcons
                name="bookmark-outline"
                color={color}
                size={size}
              />
            )}
            label="Bookmarks"
            onPress={() => {}}
          />
        </Drawer.Section>
        <Drawer.Section title="Preferences">
          <TouchableRipple onPress={() => {}}>
            <View style={styles.preference}>
              <Text>Dark Theme</Text>
              <View pointerEvents="none">
                <Switch value={false} />
              </View>
            </View>
          </TouchableRipple>
          <TouchableRipple onPress={() => {}}>
            <View style={styles.preference}>
              <Text>RTL</Text>
              <View pointerEvents="none">
                <Switch value={false} />
              </View>
            </View>
          </TouchableRipple>
        </Drawer.Section>
      </View>
    </DrawerContentScrollView>
  );
}

const styles = StyleSheet.create({
  drawerContent: {
    flex: 1,
  },
  userInfoSection: {
    paddingLeft: 20,
  },
  title: {
    marginTop: 20,
    fontWeight: 'bold',
  },
  caption: {
    fontSize: 14,
    lineHeight: 14,
  },
  row: {
    marginTop: 20,
    flexDirection: 'row',
    alignItems: 'center',
  },
  section: {
    flexDirection: 'row',
    alignItems: 'center',
    marginRight: 15,
  },
  paragraph: {
    fontWeight: 'bold',
    marginRight: 3,
  },
  drawerSection: {
    marginTop: 15,
  },
  preference: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    paddingVertical: 12,
    paddingHorizontal: 16,
  },
});
```

The final version of a drawer looks like this:

## Stack Navigator + Paper's Appbar

Stack Navigator provides a way for an app to transition between screens when each new screen is placed on top of a stack. In case of this Twitter clone, we will use it to transition from a screen displaying a feed of tweets to the screen showing details of a tweet.

React Navigation v5 provides two implementations of a Stack Navigator

- Native Stack
- JS-based Stack

The main difference between them is that JS-based stack re-implements animations and gestures while the native stack navigator relies on the platform primitives for animations and gestures.

In this section, we will integrate React Native Paper [Appbar](https://callstack.github.io/react-native-paper/appbar-header.html) and JS-based Stack Navigator.

As a first step, we will create a minimal version of a Stack:

```jsx
import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';

import { Feed } from './feed';
import { Details } from './details';

export const FeedStack = () => {
  return (
    <Stack.Navigator initialRouteName="Feed">
      <Stack.Screen
        name="Feed"
        component={Feed}
        options={{ headerTitle: 'Twitter' }}
      />
      <Stack.Screen
        name="Details"
        component={Details}
        options={{ headerTitle: 'Tweet' }}
      />
    </Stack.Navigator>
  );
};
```

By default, the stack navigator is configured to have the familiar iOS and Android header. That doesn't suit our needs, because we want to use Paper's Appbar instead.
We can achieve that by passing an `Appbar.Header` component as a `header` in Stack's `screenOptions`. We will also pass a `headerMode` prop with a value of `screen` to have a nice looking fade in/out animation.

```jsx
import React from 'react';
import { TouchableOpacity } from 'react-native';
import { createStackNavigator } from '@react-navigation/stack';
import { Appbar, Avatar } from 'react-native-paper';
import { MaterialCommunityIcons } from '@expo/vector-icons';

import { Feed } from './feed';
import { Details } from './details';

const Header = ({ scene, previous, navigation }) => {
  const { options } = scene.descriptor;
  const title =
    options.headerTitle !== undefined
      ? options.headerTitle
      : options.title !== undefined
      ? options.title
      : scene.route.name;

  return (
    <Appbar.Header theme={{ colors: { primary: theme.colors.surface } }}>
      {previous ? (
        <Appbar.BackAction
          onPress={navigation.pop}
          color={theme.colors.primary}
        />
      ) : (
        <TouchableOpacity
          onPress={() => {
            navigation.openDrawer();
          }}
        >
          <Avatar.Image
            size={40}
            source={{
              uri:
                'https://pbs.twimg.com/profile_images/952545910990495744/b59hSXUd_400x400.jpg',
            }}
          />
        </TouchableOpacity>
      )}
      <Appbar.Content
        title={
          previous ? title : <MaterialCommunityIcons name="twitter" size={40} />
        }
      />
    </Appbar.Header>
  );
};

export const FeedStack = () => {
  return (
    <Stack.Navigator
      initialRouteName="FeedList"
      headerMode="screen"
      screenOptions={{
        header: ({ scene, previous, navigation }) => (
          <Header scene={scene} previous={previous} navigation={navigation} />
        ),
      }}
    >
      <Stack.Screen
        name="Feed"
        component={Feed}
        options={{ headerTitle: 'Twitter' }}
      />
      <Stack.Screen
        name="Details"
        component={Details}
        options={{ headerTitle: 'Tweet' }}
      />
    </Stack.Navigator>
  );
};
```

The Function that we pass to `header` prop has access to 3 properties:

- scene
- previous
- navigation

Thanks to the **scene** property we can access the title of topmost screen on the stack and display it in the header.
**Previous** property tells us if there are any other screens lower on the Stack.

Finally, **navigation** property allows navigating to different screens e.g. opening a Drawer.

The thing that we haven't covered yet and it is very important is how to actually navigate between Stack Navigator screens.
In case of Tab or Drawer Navigator, we get it out of the box. We can swipe to open/close the Drawer or press a tab to change the scene. In Stack, we have to implement it by ourselves.

React Navigation gives us many different ways to navigate, but we will mostly focus on `push` and `pop`. You can access these two methods in **navigation** prop.

As the name suggests `push` method pushes the new screen on the stack and `pop` removes current screen from the stack.

As you can see on a snippet above, we invoke a `navigation.pop` function whenever user presses the back button in header. This means user will be allowed to come back from **Details** to the **Feed** screen.

We still need to implement an option to go from **Feed** to the **Details**. We can do it by invoking `navigation.push('Details')` whenever user presses a Tweet.

```jsx
function onTweetPress() {
  navigation.push('Details');
}
```

The implementation of `Feed` and `Details` components is quite big and complex, that's why I am not gonna post it here. Please make sure to check it out on [github repo](https://github.com/Trancever/twitterClone)

We have covered only the basics of navigating between screens. If you want to learn more details check the official [documentation](/docs/navigating).

Now, let's see what does the app looks like with Stack Navigator and Paper's Appbar.

We still miss the last piece of our navigation flow - **Tab Navigator**. Let's move to the next section where we will take care of it.

## Bottom Navigation

In this section, we will implement a Tab Navigator with 3 tabs and we will make sure this component is now a one of Stack's screen.

We will use a [Bottom Navigation](https://callstack.github.io/react-native-paper/bottom-navigation.html) component from React Native Paper that is exposed via **@react-navigation/material-bottom-tabs** package.

Let's import the **createMaterialBottomTabNavigator** function first.

```jsx
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
```

Then we can get a reference to the Tab.Navigator and Tab.Screen components.

```jsx
const Tab = createMaterialBottomTabNavigator();
```

Now, we are ready to build the actual Bottom Navigation. We will render a `Tab.navigator` and 3 `Tab.Screen` components as children. Each `Tab.Screen` representing a tab.

```jsx
import React from 'react';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';

import { Feed } from './feed';
import { Messages } from './messages';
import { Notifications } from './notifications';

const Tab = createMaterialBottomTabNavigator();

export const BottomTabs = () => {
  return (
    <Tab.Navigator
      initialRouteName="Feed"
      shifting={true}
      sceneAnimationEnabled={false}
    >
      <Tab.Screen
        name="Feed"
        component={Feed}
        options={{
          tabBarIcon: 'home-account',
        }}
      />
      <Tab.Screen
        name="Notifications"
        component={Notifications}
        options={{
          tabBarIcon: 'bell-outline',
        }}
      />
      <Tab.Screen
        name="Messages"
        component={Messages}
        options={{
          tabBarIcon: 'message-text-outline',
        }}
      />
    </Tab.Navigator>
  );
};
```

When we check the screen of the phone now, we will see a nice looking, material bottom navigation. What's more, Stack Navigator integrates nicely with Tab.Navigator and we can still navigate to the tweet `Details` screen.

## FAB and Portal

As it is stated in [Material Design Guidelines](https://material.io/components/buttons-floating-action-button/), the purpose of the FAB button is to give easy access to the main action of the application. Of course, the official Twitter app follows this pattern. Based on the type of screen, it allows creating new tweets or sending direct messages via FAB. It also smoothly animates the icon of the FAB when the user changes the tab and hides the FAB completely on specific screens.

In this section, we are going to implement the very same behaviour in our app. We are going to use a [FAB](https://callstack.github.io/react-native-paper/fab.html) and [Portal](https://callstack.github.io/react-native-paper/portal.html) components from React Native Paper.

`Portal` allows rendering a component at a different place in the parent tree. It means you can use it to render content that should appear above other elements, similar to Modal.

As an initial step, we will render a FAB on all tabs and then we will add additional functionalities.

Let's render a `FAB` and `Portal` in the same component where we render Tabs:

```jsx
import React from 'react';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
import { useTheme, Portal, FAB } from 'react-native-paper';

import { Feed } from './feed';
import { Message } from './message';
import { Notifications } from './notifications';

const Tab = createMaterialBottomTabNavigator();

export const BottomTabs = () => {
  return (
    <React.Fragment>
      <Tab.Navigator
        initialRouteName="Feed"
        backBehavior="initialRoute"
        shifting={true}
        sceneAnimationEnabled={false}
      >
        <Tab.Screen
          name="Feed"
          component={Feed}
          options={{
            tabBarIcon: 'home-account',
          }}
        />
        <Tab.Screen
          name="Notifications"
          component={Notifications}
          options={{
            tabBarIcon: 'bell-outline',
          }}
        />
        <Tab.Screen
          name="Messages"
          component={Message}
          options={{
            tabBarIcon: 'message-text-outline',
          }}
        />
      </Tab.Navigator>
      <Portal>
        <FAB
          icon="feather"
          style={{
            position: 'absolute',
            bottom: 100,
            right: 16,
          }}
        />
      </Portal>
    </React.Fragment>
  );
};
```

With just a few lines of JSX we have a nice looking FAB displayed on all tabs. Let's implement hiding it whenever the user goes to the tweet details screen.

Our current navigation structure should be:

- StackNavigator that has two screens
- The First screen of StackNavigator renders a TabNavigator with 3 tabs
- The Second screen of StckNavigator renders a Tweet details

This means a component that renders TabNavigator is a Stack's screen. Thanks to that, we can use `useIsFocused` hook provided by `@react-navigation/native` and conditionally hide `FAB`.

```jsx
import React from 'react';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
import { useTheme, Portal, FAB } from 'react-native-paper';
import { useIsFocused } from '@react-navigation/native';

import { Feed } from './feed';
import { Message } from './message';
import { Notifications } from './notifications';

const Tab = createMaterialBottomTabNavigator();

export const BottomTabs = () => {
  const isFocused = useIsFocused();

  return (
    <React.Fragment>
      <Tab.Navigator
        initialRouteName="Feed"
        backBehavior="initialRoute"
        shifting={true}
      >
        <Tab.Screen
          name="Feed"
          component={Feed}
          options={{
            tabBarIcon: 'home-account',
          }}
        />
        <Tab.Screen
          name="Notifications"
          component={Notifications}
          options={{
            tabBarIcon: 'bell-outline',
          }}
        />
        <Tab.Screen
          name="Messages"
          component={Message}
          options={{
            tabBarIcon: 'message-text-outline',
          }}
        />
      </Tab.Navigator>
      <Portal>
        <FAB
          visible={isFocused} // show FAB only when this screen is focused
          icon="feather"
          style={{
            position: 'absolute',
            bottom: safeArea.bottom + 65,
            right: 16,
          }}
        />
      </Portal>
    </React.Fragment>
  );
};
```

In the last step we will add ability to show different icon depending on the active tab.

We will take an advantage of our `BottomTabs` component being one of a Stack's screen. It means it has an access to the `route` object that is passed to each screen as a prop. This object contains an information about current screen which means we can access it and conditionally render proper icon. This is not a very common pattern and it can be confusing at first, so make sure to read the whole [guide](/docs/screen-options-resolution) on how to use it and what can be achieved by using it.

```jsx
import React from 'react';
import color from 'color';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
import { Portal, FAB } from 'react-native-paper';
import { useIsFocused } from '@react-navigation/native';

import { Feed } from './feed';
import { Message } from './message';
import { Notifications } from './notifications';

const Tab = createMaterialBottomTabNavigator();

export const BottomTabs = props => {
  // Get a name of current screen
  const routeName = getFocusedRouteNameFromRoute(route) ?? 'Feed';
  const isFocused = useIsFocused();

  let icon = 'feather';

  switch (routeName) {
    case 'Messages':
      icon = 'email-plus-outline';
      break;
    default:
      icon = 'feather';
      break;
  }

  return (
    <React.Fragment>
      <Tab.Navigator initialRouteName="Feed" shifting={true}>
        <Tab.Screen
          name="Feed"
          component={Feed}
          options={{
            tabBarIcon: 'home-account',
            tabBarColor,
          }}
        />
        <Tab.Screen
          name="Notifications"
          component={Notifications}
          options={{
            tabBarIcon: 'bell-outline',
            tabBarColor,
          }}
        />
        <Tab.Screen
          name="Messages"
          component={Message}
          options={{
            tabBarIcon: 'message-text-outline',
            tabBarColor,
          }}
        />
      </Tab.Navigator>
      <Portal>
        <FAB
          visible={isFocused}
          icon={icon}
          style={{
            position: 'absolute',
            bottom: 100,
            right: 16,
          }}
          color="white"
        />
      </Portal>
    </React.Fragment>
  );
};
```

As you can see on the gif, the FAB button works in the same way as in a Twitter app.
What's more, it even animates icon change properly even though we haven't implemented it. That's the behavior we get from React Native Paper's FAB out of the box.

## Theming

Nowadays, supporting the Light/Dark theme is no longer a fancy way to stand out from other apps, but it has become a standard. Happily, both React Navigation v5 and React Native Paper supports theming and in this section I'll guide you through setting it up.

#### React Navigation

React Navigation exports two themes:

- DefaultTheme
- DarkTheme

We can import them from `@react-navigation/native` package and pass to `NavigationContainer` to apply the theme:

```jsx
import React from 'react';
import { NavigationContainer, DarkTheme } from '@react-navigation/native';

export default function App() {
  return (
    <NavigationContainer theme={DarkTheme}>{/* content */}</NavigationContainer>
  );
}
```

#### React Native Paper

React Native Paper similarly to React Navigation also exports two themes:

- DefaultTheme
- DarkTheme

Once we import a theme we can pass it to the Paper's `Provider` component:

```jsx
import * as React from 'react';
import { NavigationContainer, DarkTheme } from '@react-navigation/native';
import {
  DarkTheme as PaperDarkTheme,
  Provider as PaperProvider,
} from 'react-native-paper';

export default function Main() {
  return (
    <PaperProvider theme={PaperDarkTheme}>
      <NavigationContainer theme={DarkTheme}>
        {/* content */}
      </NavigationContainer>
    </PaperProvider>
  );
}
```

#### Combining themes

Since both React Navigation and React Native Paper follows the same pattern for theming and structure of the theme object is very similar, we can combine them into one object:

```jsx
import * as React from 'react';
import {
  NavigationContainer,
  DarkTheme as NavigationDarkTheme,
} from '@react-navigation/native';
import {
  DarkTheme as PaperDarkTheme,
  Provider as PaperProvider,
} from 'react-native-paper';

const CombinedDarkTheme = {
  ...PaperDarkTheme,
  ...NavigationDarkTheme,
  colors: { ...PaperDarkTheme.colors, ...NavigationDarkTheme.colors },
};

export default function Main() {
  return (
    <PaperProvider theme={CombinedDarkTheme}>
      <NavigationContainer theme={CombinedDarkTheme}>
        {/* content */}
      </NavigationContainer>
    </PaperProvider>
  );
}
```

If code for themes merging looks complex, you can use a [deepmerge](https://www.npmjs.com/package/deepmerge) package. It will simplify the implementation significantly.

#### Custom themes

Of course, the built-in themes are not the only themes we can apply. Both libraries allow full customization and you can learn about it in the official documentation ([React Navigation](/docs/themes), [React Native Paper](https://callstack.github.io/react-native-paper/theming.html))

In the last step, I want to show you how to change the theme dynamically. We will implement a switch in a drawer that will allow users choosing light or dark theme.

We need to store information about the currently selected theme somewhere. The local state of the root component sounds reasonable. Also, we will conditionally pass different themes based on the state.

```jsx
import * as React from 'react';
import {
  NavigationContainer,
  DefaultTheme as NavigationDefaultTheme,
  DarkTheme as NavigationDarkTheme,
} from '@react-navigation/native';
import {
  DarkTheme as PaperDarkTheme,
  DefaultTheme as PaperDefaultTheme,
  Provider as PaperProvider,
} from 'react-native-paper';

const CombinedDefaultTheme = {
  ...PaperDefaultTheme,
  ...NavigationDefaultTheme,
};
const CombinedDarkTheme = { ...PaperDarkTheme, ...NavigationDarkTheme };

export default function Main() {
  const [isDarkTheme, setIsDarkTheme] = React.useState(false);

  const theme = isDarkTheme ? CombinedDarkTheme : CombinedDefaultTheme; // Use Light/Dark theme based on a state

  function toggleTheme() {
    // We will pass this function to Drawer and invoke it on theme switch press
    setIsDarkTheme(isDark => !isDark);
  }

  return (
    <PaperProvider theme={theme}>
      <NavigationContainer theme={theme}>{/* content */}</NavigationContainer>
    </PaperProvider>
  );
}
```

As you remember, we already render a Switch in a Drawer, but we haven't implemented any logic when it is pressed. Let's take care of it now:

```jsx
import React from 'react';
import { View } from 'react-native';
import { DrawerContentScrollView } from '@react-navigation/drawer';
import {
  useTheme,
  Avatar,
  Drawer,
  Text,
  TouchableRipple,
  Switch,
} from 'react-native-paper';

export function DrawerContent(props) {
  const paperTheme = useTheme();

  return (
    <DrawerContentScrollView {...props}>
      /* {...other - content} */
      <Drawer.Section title="Preferences">
        <TouchableRipple onPress={props.toggleTheme}>
          <View style={styles.preference}>
            <Text>Dark Theme</Text>
            <View pointerEvents="none">
              <Switch value={theme.dark} />
            </View>
          </View>
        </TouchableRipple>
      </Drawer.Section>
    </DrawerContentScrollView>
  );
}
```

Firstly, we get a current theme using `useTheme` hook from Paper. This means we can check `dark` property on it and pass the correct value to `Switch`.

Secondly, we pass a `toggleTheme` function to `TouchableRipple` to toggle theme whenever user presses a Switch.

You should be able to toggle a switch now and both `Provider` from Paper and `NativeNavigationContainer` from React Navigation will automatically apply correct colors to the components.

## Summary

We all know that UI Component library like Paper can speed up the development, but integrating it with a navigation can be sometimes not very straighforward. I hope I showed you the most important aspects of this process in this guide. After reading this article, using Paper's BottomNavigation, Appbar, Drawer, FAB or Portal alongside with React Navigation shouldn't be a problem for you.

Do you have any questions? Tweet to me [@trensik](https://twitter.com/trensik).

At the end I want to thank [@satya164](https://twitter.com/satya164) and the whole [Callstack](https://callstack.com/) team for their help with the article.


text:
# Changelog

## Version 1.x

* Upgraded [nelmio/alice](https://github.com/nelmio/alice) to the version [2.0.0](https://github.com/nelmio/alice/releases/tag/2.0.0)
* Now uses [`Nelmio\Alice\Fixtures`](https://github.com/nelmio/alice/blob/master/src/Nelmio/Alice/Fixtures.php) and
its loaders instead of custom ones
* Add support for [Doctrine ODM (MongoDB)](http://doctrine-mongodb-odm.readthedocs.org/en/latest/)
* Add support for [Doctrine PHPCR ODM](http://doctrine-phpcr-odm.readthedocs.org/en/latest/)
* Introduced commands:
	* `hautelook_alice:doctrine:fixtures:load`
	* `hautelook_alice:doctrine:mongodb:fixtures:load`
	* `hautelook_alice:doctrine:phpcr:fixtures:load`
* Possibility to load fixtures by environment
* Possibility to load fixtures by bundle
* No longer need to create a data loader to load fixtures
* Removed [DoctrineFixturesBundle](https://github.com/doctrine/DoctrineFixturesBundle) dependency
* Now possible to register [Alice Processors][1]
* Now possible to register [Custom Faker Data Providers][2]
* Enhanced documentation

## Version 0.2

Although a developement version, this version was the last one available for almost a year, hence the mention in the changelog.

* Extends [DoctrineFixturesBundle](https://github.com/doctrine/DoctrineFixturesBundle) to allow data loaders to load yaml fixtures files using [nelmio/alice 1.x](https://github.com/nelmio/alice/tree/1.x)
* Added Solarium loaders for Behat

[Back to the documentation](README.md)

[1]: https://github.com/nelmio/alice#processors
[2]: https://github.com/nelmio/alice#custom-faker-data-providers

repository: ronanguilloux/AliceBundle

gha_language: PHP

repo_name: ronanguilloux/AliceBundle


text:
# node-Hcat
Pipe html into your browser from command line

You should take a look at [scat](https://github.com/hughsk/scat) which pipes javascript into your browser or [bcat](https://github.com/kessler/node-bcat) for a more log piping oriented module

## usage
```
 --port                   set a port for this hcat execution
```
- _An available port between 8080 - 8181 will be automatically picked if --port is not specified_

## example
```
> npm install -g hcat

> echo '<hr>' | hcat

repository: aviramst/node-hcat

repo_name: aviramst/node-hcat


text:
---
layout: update
date: 2023-02-25
title: Visual Studio 2022 image update on February 25, 2023
platform: windows
---

## What's new

* Visual Studio 2022 version 17.5.0
* .NET Core 7.0.200
* Go 1.20.1, 1.19.6, 1.18.10
* Python 3.11.2, 3.10.10
* PowerShell 7.3.2
* NuGet 6.4.0
* Qt 6.4.2
* Doxygen 1.9.6
* CMake 3.25.2
* Flutter 3.7.3
* OpenSSL 1.1.1t, 3.0.8
* Maven 3.9.0
* Chrome 110.0.5481.178
* Breaking change: `C:\cygwin` contains 64-bit installation of Cygwin and `C:\cygwin64` symlinked to `C:\cygwin`.

## Previous worker image

There is a build worker image available from previous deployment. You can use it in case of any issues with the current image:

`Previous Visual Studio 2022`

You can select build worker image in "Build worker image" dropdown on Environment tab of project settings or if you use `appveyor.yml`:

```yaml
image: Previous Visual Studio 2022
```

repository: appveyor/website

gha_language: HTML

repo_name: appveyor/website


text:
# _Calculator App_

#### By _**Katie Pundt, Skylar Brockbank, and Liam Eller**_

#### _A simple calculator app_

## Technologies Used

* _HTML_
* _CSS_
* _JavaScript_
* _Bootstrap_
* _jQuery_

## Description

_A basic calculator app that prompts the user for input and then performs calculations based off of that input._

## Setup/Installation Requirements

* _Navigate to https://github.com/kpundt93/calculator_
* _Click on the green "Code" button and copy the repository URL or click on the copy button_
* _Open the terminal on your desktop_
* _Once in the terminal, use it to navigate to your desktop folder_
* _Once inside your desktop folder, use the command "git clone https://github.com/kpundt93/calculator.git"_
* _After cloning the project, navigate into it using the command "cd portfolio"_
* _Use the command "git remote" to confirm the creation of the new local repository_
* _Open the project with the code editor of your choice_

_Note: when using the commands listed above, do not include the quotation marks. They are used here for readability._

## Known Bugs

* _No known bugs_

## License

_MIT License_

Copyright (c) _2021_ _Katie Pundt, Skylar Brockbank, and Liam Eller _


text:
---
title:  "Weeks of Contribution 2016 - Localization Update"
date:   2016-08-03 01:20:00 +0530
description: Mozilla Tamilnadu Community Localization Event Report
categories: blog
tags: [community]
author: khaleeljageer
---

![Weeks of Contribution Localization]({{ site.url }}/assets/MozillTN_WOC_L10N.jpg)

One of the amazing area of contribution in this year Weeks of Contribution program is localiszation, we have shared our aim, syllabus and the things what we will be doing in one of our previous [post]({{ site.url }}/blog/Weeks-Of-Contribution-2016-L10N/)

We started with hangouts session for our trainers, then trainers trained the contributors under them at college, park and different places. Then start July 1st till July 20th they worked.

We have achieved some amazing things, we have got 40+ new contributors, which is very high in very short span of time, our aim is to keep at least 15+ contributors to actively participate in Localization project and make it as their main aim of contribution.

Contributors have suggested around 5000 suggestions in this 20 days.

The detailed post is available [here](https://jskhaleel.wordpress.com/2016/08/01/weeks-of-contribution-2016-localization-report/)

extension: markdown


text:
# AlchemyCMS Cloudinary Integration

Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline.

* Easily upload images to the cloud.
* Automatically perform smart image resizing, cropping and conversion without installing any complex software.
* Images are seamlessly delivered through a fast CDN, and much much more.

## Usage

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'alchemy_cloudinary', github: 'AlchemyCMS/alchemy_cloudinary'
```

And then execute:

```
$ bundle
```

Or install it yourself as:

```
$ gem install alchemy_cloudinary
```

## Configuration

To use the Cloudinary Ruby on Rails library, you have to configure at least:

* `cloud_name`
* `api_key`
* `api_secret`

Setting the configuration parameters can be done by:

* programmatically in each call to a Cloudinary method
* globally using config/cloudinary.yml configuration file

  > **Warning**: In this case you must **exclude it** from version control system (git, etc). In `.gitignore` you can add `config/cloudinary.yml`

* use a Rails initializer file.

  You can place a file named `cloudinary.rb` in the `config/initializers` folder of your Rails project.

  Here's some sample initializer code:

  ```ruby
  # config/initializer/cloudinary.rb
  Cloudinary.config do |config|
    config.cloud_name = 'sample'
    config.api_key = '874837483274837'
    config.api_secret = 'a676b67565c6767a6767d6767f676fe1'
    config.secure = true
    config.cdn_subdomain = true
  end
  ```

* dynamically configure the `cloud_name`, `api_key`, and `api_secret` by defining the `CLOUDINARY_URL` environment variable.

  The **configuration URL** is available in the Management Console's dashboard of your account.
  When using Cloudinary through a PaaS add-on (e.g., **Heroku**), this environment variable is
  **automatically** defined in your deployment environment.

  Here's a sample value:

  `CLOUDINARY_URL=cloudinary://874837483274837:a676b67565c6767a6767d6767f676fe1@sample`

  > **Note**: If you use more than one configuration option, the order of precedence is:
  `CLOUDINARY_URL` -> `cloud_name` -> `cloudinary.yml`

## Resources

* https://cloudinary.com/documentation/rails_integration
* Sample projects - https://github.com/cloudinary/cloudinary_gem/tree/master/samples
  * Basic Ruby sample.
    Uploading local and remote images to Cloudinary and generating various transformation URLs.
  * Basic Rails sample.
    Uploading local and remote images in a Rails project while embedding various transformed images in a Rails web view.
  * Rails Photo Album.
   A fully working web application.
   It uses CarrierWave to manage images of an album model (database).
   Performs image uploading both from the server side and directly from the browser using a jQuery plugin.
* https://rubygems.org/gems/cloudinary
* https://github.com/cloudinary/cloudinary_gem
* https://cloudinary.com/documentation/rails_image_and_video_upload
* https://cloudinary.com/documentation/rails_image_manipulation

## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

gha_language: Ruby


text:
# Treeflection Command Manual

## Syntax

Must have an action.
May optionally be preceded by any number of accessors

## Access property

Dot notation is used to access the properties of structs and enum structs:

`foo.bar.baz`

## Access value by index/key

Index notation is used to access the properties of Vec, HashMap, tuples and tuple enums

*   `property["key_string"]` select by key
*   `property[0]`            select by index
*   `property[?]`            select based on context
*   `property[*]`            select all

## Actions

Each struct/primitive has its own set of actions available.
However there are some actions that you will find on every type:
*   `:help`        - Use this to find properties and actions a node has.
*   `:set <value>` - set the property to the specified json input
*   `:get`         - display the attribute in json

## Context

The ContextVec struct (and other Context* structs) allow you to set indexes as the context.
When the context accessor '[?]' is used on that struct it accesses the current context.

## Examples

A super simple command to get help for the root node.
`:help`

A command to set an int in a Vec in a struct in another struct in a Hashmap to the value 50 looks like:
`someHashMap["key"].someChild.anotherChild[0]:set 50`

repository: rukai/treeflection

gha_language: Rust

repo_name: rukai/treeflection