text:
# section 7 - persistent storage

## introduction

managing storage is a *distinct* problem from managing compute resources

the OpenShift Container Platofrm uses the Kubernetes persistent volume (PV) framework to allow cluster administrators to provision persistent storage for a cluster

developers can use persistent volume claims (PVCs) to request resources without having specific knowledge of the underlying storage infrastructure

in short, PVCs are not specific to a project and are created and used by developers as a means to use a PV

PV resources on their own are not scoped to any single project -- instead they are shared across the entire OpenShift Container Platform cluster and claimed from any project

PVs are resources in the cluster while PVCs are requests for those resources and also act as claim checks to the resource -- the interactions between PVs and PVCs follow this lifecycle

## a. persistent volumes

PVs are defined by a ```PersistentVolume``` API object, which represents a piece of existing, networked storage in the cluster that was provisioned by the cluster administrator

the PV is a resource in the cluster just like a node is a cluster resource

while PVs are volume plug-ins like ```Volumes```, they have a lifecycle independent of any individual pod that uses the PV

### PV specificities

each PV contains a ```spec``` and a ```status```, which is the specification and status of the volume, for example (in the object defintion):

```yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-0001
spec:
  capacity:
    storage: 5Gi
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  <...>
status:
<...>
```

## b. persistent volume claims

PVCs are defined by a ```PersistentVolumeClaim``` API object, which represents a request for storage by a developer

it is similar to a pod in that pods consume node resources and PVCs consume PV resources

for example, pods can request specific levels of resources, such as CPU and memory, while PVCs can request specific storage capacity and access modes -- they can be mounted once ```read-write``` or many times ```read-only```

### PVC specificities

each PVC, like a PV, contain a ```spec``` and a ```status```

see the sample YAML object definition:

```yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myClaim
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: gold
status:
<..>
```

* claims can optionally request a specific storage class by specifying the storage class' name in the ```storageClassName``` attribute
* only PVs of the requested class, ones with the *same* ```storageClassName``` as the PVC, can be bound to the PVC

## c. adding storage to a container

### prerequisites

before we can expand persistent volumes, the ```StorageClass``` must have the ```allowVolumeExpansion``` field set to ```true```

edit the ```StorageClass``` and add the ```allowVolumeExpansion``` attribute

* the following example demonstrates adding this line at the bottom of the ```StorageClass'``` configuration

  ```yaml
  apiVersion: storage.k8s.io/v1
  kind: StorageClass
  <...>
  parameters:
   type: gp2
  reclaimPolicy: Delete
  allowVolumeExpansion: true
  ```

### expanding PVCs with a file system

expanding PVCs based on volume types that need file system resizing is a two-step process; this process involves:

1. expanding volume objects in the cloud provider
2. expanding the file system on the actual node

> note: prior to expanding PVCs, the controlling ```StorageClass``` must have ```allowVolumeExpansion``` set to ```true```

edit the PVC and request a new size by editing ```spec.resources.requests``` in the YAML configuration

for example, the following configuration expands the ```ebs``` PVC to 8Gi

```yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs
spec:
  storageClass: "storageClassWithFlagSet"
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi
```

...once the cloud provider object has finished resizing, the PVC is set to ```FileSystemResizePending```

the following command is used to check the condition of a particular PVC:

```bash
$ oc describe pvc <pvc-name>
```

when the cloud provider has finished resizing, the PVC object will reflect the newly-requested size in ```PersistentVolume.Spec.Capacity```

at this point, you can create or re-create a new pod from the PVC to finish the file system resizing process

> note: once the newly-sized pod is running, the ```FileSystemResizePending``` condition is removed from the PVC

## d. demo

> creating a persistent claim, adding it to a MongoDB Server container app

## e. lab

> deploy SampleApp (data tier) Mongo DB container

branch_name: refs/heads/develop

gha_language: Shell


text:
Team Portfolio Project

This project introduces the talented members of our team during the TTP bootcamp. It also includes our projects so that you can see exactly how we put our skills to use. This portfolio has been created using a bootstrap program from the getbootstrap website. Modifications were made to meet the stylistic vision of the team.

Team Members

Joginder Kaur

Reagan Asubonteng

Britney Wu

Eitan Khiyaev

Cherrise Hatcher

Fakhreddine Chaabani

Janelia Thompsan

Shiven Nayee

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

Start Bootstrap is based on the [Bootstrap](https://getbootstrap.com/) framework created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thorton](https://twitter.com/fat).

Copyright and License

Copyright 2013-2020 Start Bootstrap LLC. Code released under the [MIT](https://github.com/StartBootstrap/startbootstrap-grayscale/blob/gh-pages/LICENSE) license.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
layout: post
title: Command Line - Creating Jekyll Posts
---

GitHub works fine for a CMS, but I'd much rather do my work in my favorite IDE, and if I'm working locally, I may as well make it simple. Here are a couple snippets you might find valuable.

### Get to your directory quickly

Open up your `.bashrc` file and create an alias to get to your posts directory quickly:

```alias blog='cd q:/wamp/ethanclevenger91.github.io/_posts'```

### Create posts

I hate to create a new file for each post manually since it does follow a certain formula, so you can also set up a bash function for this (also in `.bashrc`)

```bash
function njp() {
	mydate=`date +%Y-%m-%d`
	post=${1// /-}
	filename="$mydate-$post.md"
	touch "$filename"
	echo "---
	layout: post
	title: $1
	---" > $filename
	}
```

Let's break that down line-by-line:
1. Define a function. I chose `njp` for "new jekyll post"
2. Get the current date
3. Replace spaces in the post title with hyphens
4. Append that business together to make the file title
5. Create the file
6. Echo some boilerplate into the file, including the post title.

Save this, open a bash prompt and enjoy automation:

```bash
$ blog
User@COM /q/wamp/ethanclevenger91.github.io/_posts (master)
$ njp "Command Line - Creating Jekyll Posts"
```

And the file is created.

gha_language: CSS


text:
# TextEditorCompressor

Console-based text editor that takes in commands to insert, delete, move cursor, etc. Compresses .txt to .cmp through a dictionary to save space and decompresses from .cmp to .txt back.

repository: samuelfu/TextEditorCompressor

repo_name: samuelfu/TextEditorCompressor


text:
# AirBnB
AirBnB Dataset Analysis

Overview

This project uses AirBnB Dataset that contains the following files:
calendar.csv
listings.csv
reviews.csv

Analysis:

The analysis can be found in this blog post:
https://junwuwriting.medium.com/airbnb-data-analysis-be7a491be905

Data Science Questions asked:
1) Are there any price spikes for peak months?
2) What are the most frequented neighborhoods in Seattle
3) Can we predict the price using number_of_reviews and review_score_rating?
4) Are the review comments reflective of the review_score_ratings?

Code:

- AirBnB.ipynb jupyter notebook contains the first part of the analysis that includes the prediction price with linear model and logistic regression.
- AirBnB.py contains the helper functions used for all of the analysis.
- AirBnB_Sentiment.ipynb jupyter notebook contains the sentiment analysis using tf-df and random forest model.

Libraries:

numpy - library used for matrix math
pandas - library used for dataframe handling
re - library used for regular expression
nltk - library used for natural language processing
sklearn - library used for modeling
matplotlib - library used for graphing

All libraries can be installed using: pip install [library]

Acknowledgements:

Sentiment Analysis: First Steps With Python's NLTK library
https://realpython.com/python-nltk-sentiment-analysis/

Tf-IDF Documentation:
https://www.rdocumentation.org/packages/superml/versions/0.5.3/topics/TfIdfVectorizer

Re Documentation:
https://www.w3schools.com/python/python_regex.asp

repository: junwuwriter/AirBnB

branch_name: refs/heads/main

repo_name: junwuwriter/AirBnB


text:
A collection of example SQL queries.

### Fetch creatures at least 15% weak to energy
```sql
SELECT title, energy FROM creatures WHERE energy >= 115 ORDER BY energy DESC LIMIT 5
```

Results:

| title | energy |
| ----- | ------ |
| Lionet (Creature) | 150
| Ice Overlord | 125
| Massive Water Elemental | 125
| Quara Constrictor | 125
| Quara Hydromancer | 125

### Fetch creatures that drop 'crown armor'
```sql
SELECT creatures.title as "creature", chance
FROM creatures, creatures_drops, items
WHERE items.id = creatures_drops.item_id AND creatures.id = creatures_drops.creature_id AND items.name LIKE 'crown armor'
ORDER BY chance DESC
LIMIT 5
```
Results

| creature | chance |
| -------- | ------ |
| The Noxious Spawn | 28.125
| Hellgorak | 18.442
| Horadron | 16.1849
| Thul | 8.333
| Vile Grandmaster | 1.2637

repository: Tschis/tibiawiki-sql

repo_name: Tschis/tibiawiki-sql


text:
# Cylinder Qr Code Retifier Demo Example

------

Gitee:
https://gitee.com/fsfzp888/cylinder_qrcode

This is a demo project using OPENCV to retify QR code on cylinder surface, C++ and android project code are provided. Although I don't think it's useful, it's still a good learning material for OPENCV.

This project try to retify the qr code on cylinder surface, so that normal scanner could recognize the distorted qr code. However, there are still many problems here. I may not fix them in the future.

System: Ubuntu 16.04

Building Step:

```bash
sudo apt install -y qt5-default qtcreator cmake cmake-gui
sudo apt install -y build-essential libgtk2.0-dev libavcodec-dev
sudo apt install -y libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev

cd cylinder_qrcode/opencv
tar -Jxvf opencv-3.4.1.tar.xz -C .
mkdir opencv_build
cd opencv_build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ../opencv-3.4.1

make -j4
sudo make install
```
Then the opencv3 and qt5 would be installed in your system successfully.
After installing the requirements, cd to the source directory to build the source code:
```bash
cd cylinder_qrcode/src
qmake
make
./cylinder
```

You would see the following simple qt GUI now:

![main](https://gitee.com/uploads/images/2018/0321/221444_59a3f48e_1256822.png "main.png")

Click Browse to select qr code picture in cylinder_qrcode/datas, and press run, then the result may be:

![res](https://gitee.com/uploads/images/2018/0321/221454_72fa7309_1256822.png "res.png")

The result picture may not seen to be great sometimes, so you may need to change the following parameters
to get better result:

> * Blur Block Size
> * Thresh Block Size
> * Thresh Block Delta

Detail documentation could be found in:
https://gitee.com/fsfzp888/cylinder_qrcode/tree/master/docs


text:
---
# Display name
name: Eva Ahbe

# Order of appearance
weight: 13

# Username (this should match the folder name)
authors:
- eva-ahbe

# Is this the primary user of the site?
superuser: false

# Role/position
role: PhD Researcher

# Organizations/Affiliations
organizations:
- name: Automatic Control Laboratory
  url: "https://control.ee.ethz.ch/"
- name: Department of Information Technology and Electrical Engineering
  url: "https://ee.ethz.ch/"
- name: ETH Zurich
  url: "https://ethz.ch/en.html"

# Short bio (displayed in user profile at end of posts)
bio: Interested in modeling and periodic control of dynamically uncertain systems.

interests:
- Modelling, simulation, and control
- Stability Verification
- Robust Control

education:
  courses:
  - course: MSc in Physics
    institution: University of Heidelberg
    year: 2015
  - course: BSc in Physics
    institution: University of Heidelberg
    year: 2013

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/widgets/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "#contact" for contact widget.
social:
- icon: envelope
  icon_pack: fas
  link<EMAIL_ADDRESS># For a direct email link, use<EMAIL_ADDRESS>- icon: linkedin
  icon_pack: fab
  link: https://www.linkedin.com/in/eva-ahbe-017080103/
- icon: researchgate
  icon_pack: ai
  link: https://www.researchgate.net/profile/Eva_Ahbe
- icon: github
  icon_pack: fab
  link: https://github.com/evaahbe
# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
# - icon: cv
#   icon_pack: ai
#   link: files/cv.pdf

# Enter email to display Gravatar (if Gravatar enabled in Config)
email: ""

# Organizational groups that you belong to (for People widget)
#   Set this to `[]` or comment out if you are not using People widget.
user_groups:
- Researchers

# (1) One sentence about your function (for academic staff) and then another sentence about your role(s) within the training network
# (2) Research interests, achievements, and personal interests (mainly for researchers)
---

Eva Ahbe is Marie-Skłodowska-Curie Fellow at ETH Zurich, working with Prof. [Roy Smith](/authors/roy-smith/). Her PhD research is about [modeling and periodic control of dynamically uncertain airfoils](/project/esr13/), for which she has developed an open source tool for [airborne wind energy trajectory analysis](https://github.com/evaahbe/AWE_tool/). Her master studies included a 12 months research period at the [Carnegie Institution for Science](https://carnegiescience.edu/) at Stanford, CA, USA.


text:
# PureScript-Bingsu

Cool query building library for [Node-SQLite3](https://github.com/justinwoo/purescript-node-sqlite3).

![](https://upload.wikimedia.org/wikipedia/commons/7/75/Patbingsu.jpg)

## Usage

See the tests.

```purs
someAff = void $ B.queryDB db insert { name: "apples", count: 3 }
  where
    insert
         = B.literal "insert into mytable values ("
      <<>> B.param (B.Param :: _ "name" String)
      <<>> B.literal ","
      <<>> B.param (B.Param :: _ "count" Int)
      <<>> B.literal ")"
```

repository: justinwoo/purescript-bingsu

repo_name: justinwoo/purescript-bingsu


text:
# PnP Core SDK - Azure Function with Managed Identity Sample

This solution demonstrates how to build Azure function that connects to a SPO site using:

- System-Managed Identity, when running in Azure and
- Azure Ad application (App Registration) during local development.

The Authentication Provider is selected based on the presence of the `MSI_SECRET` token, which is only available if Managed Identity is enabled.

When the function is executed in Azure, it uses custom _ManagedIdentityTokenProvider_ authentication provider, which invokes `Azure.Identity.ManagedIdentityCredential` class to attempt authentication using a managed identity that has been assigned to the Azure Function.

For local development, certificate-based authentication with _X509CertificateAuthenticationProvider_ is required.
> App-only authentication against SharePoint Online requires certificate based authentication for calling the "classic" SharePoint REST/CSOM APIs. The SharePoint Graph calls can work with clientid+secret, but since PnP Core SDK requires both type of APIs (as not all features are exposed via the Graph APIs) you need to use certificate based auth.

This solution follows the principle of least privilege, by using `Sites.Selected` application permissions for Graph and SharePoint APIs, and `Read`/`Write`/`FullControl` permissions granted to a specific SPO site.
> Always choose minimum required permissions.

## Source code

> [!Note]
> This sample was authored by [Kinga Kazala](https://github.com/kkazala) 💪🥇.

You can find the sample source code here: [/samples/Demo.AzFunction.ManagedIdentity](https://github.com/pnp/pnpcore/tree/dev/samples/Demo.AzFunction.ManagedIdentity)

> [!Note]
> This sample was created with [Visual Studio Code](https://code.visualstudio.com/) using [.NET 6.0](https://dotnet.microsoft.com/) and has been created as an [Azure Function v4](https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp?tabs=in-process) running [in-process](https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library?tabs=v2%2Ccmd).

## Sample configuration

> [!Note]
> For the sample setup, you will need to have a recent version of [PnP.PowerShell](https://pnp.github.io/powershell/) installed on your machine.

### Create and configure the Azure AD applications

The Azure Function must have System-Managed Identity enabled. Before you execute the next steps, make sure you [enable System-Managed Identity](https://learn.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=portal%2Chttp#add-a-system-assigned-identity).

The configuration script:

- Creates a new App Registration with a name `{$appName}-LocalDev` and generates a new self-signed certificate
- Grants `Sites.Selected` API Permissions to the `{$appName}` Managed Identity and the `{$appName}-LocalDev` Azure AD application
- Grants permissions defined in `Permissions` parameter to the `{$appName}` Managed Identity and the `{$appName}-LocalDev` Azure AD application
- saves the site and tenant information, client id and the certificate thumbprint to the `local.settings.json` configuration file.

```json
{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "SiteUrl": "",
    "TenantId": "[TENANT ID]",
    "ClientId": "[CLIENT ID]",
    "CertificateThumbPrint": "[CERTIFICATE THUMBPRINT]",
    "WEBSITE_LOAD_CERTIFICATES": "[CERTIFICATE THUMBPRINT]"
  }
}
```

> [!Important]
> Currently, you cannot **manually** grant API Permissions to the System-Managed Identity

Execute the [Configure.ps1](https://github.com/pnp/pnpcore/tree/dev/samples/Demo.AzFunction.ManagedIdentity/Tools/Configure.ps1), defining the `Permissions` level that your application requires.

This sample requires `FullControl` permissions because it creates a new list.
> [!Note]
>You may decide to only grant `Write` permissions to see the REST errors once the code reaches method requiring FullControl permissions.
>
> ![access denied](docs-images/accessdenied.png)

```bash
.\Configure.ps1 -SiteUrl $siteUrl -TenantId $tenantId -AzureADAppName $appName -Permissions FullControl -CertificatePwd ""
```

> [!Important]
>
> - To consent to the application permissions, make sure you are an Azure AD admin or a global admin in your tenant

## Run the sample locally

> [!Note]
> Before you get started, make sure to [configure your environment](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp?tabs=in-process#configure-your-environment).

To test your code locally, follow the [Run the function locally](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp?tabs=in-process#run-the-function-locally) procedure.

Observe the output printed to the **Terminal**. It will confirm you are running your code locally ("_Local DEV using cert auth_"), authenticate to the SharePoint site and attempt to execute functions requiring Read, Write and FullControl permissions.

In case you only granted `Write` permissions to the app, you will see an error message when the function attempts to create a new list.
> ![terminal output error](docs-images/terminalError.png)

If you granted `FullControl` permissions, all the steps will be completed successfully.
> ![terminal output success](docs-images/terminalOK.png)

## Deploy the sample to Azure

### Create Azure Function App

Go to the [Azure Portal](https://portal.azure.com/) and create a new Function App (consumption plan) using following settings:

- Publish: **Code**
- Runtime stack: **.NET**
- Version: **6**
- Region: pick the region that works best for you
- Plan type: **Consumption (Serverless)**

Click **Review + create**, verify the settings and click **Create**. Now your function is provisioned in Azure.

### Configure the Function App

Once the Function App has been created navigate to **Settings** -> **Configuration** and add the following **Application setting**:

Name | Value
-----|------
SiteUrl | the Url of your SPO site, e.g. <https://contoso.sharepoint.com/sites/subsiteName>

Click **Save** to persist the changes.

> [!Note]
> You don't need `TenantId`, `ClientId`, `CertificateThumbPrint` or `WEBSITE_LOAD_CERTIFICATES` application settings when using Managed Identity authentication.

Under **Function runtime settings** verify the Runtime version is set to **~4**.

### Deploy the Function App code from Visual Studio

To deploy the project to Azure:

- [Sign to Azure](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp?tabs=in-process#sign-in-to-azure)
- [Deploy the project to Azure](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp?tabs=in-process#deploy-the-project-to-azure)

### Test your Function App in Azure

Test the function in Azure using the [run the function in Azure](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp) procedure.

repository: pnp/pnpcore

branch_name: refs/heads/dev

gha_language: C#

gha_license_id: MIT

repo_name: pnp/pnpcore


text:
## General

This is my high school graduation project

## Official Documentation

Coming soon

## Security Vulnerabilities

If you discover a security vulnerability within project, please open a issue. All security vulnerabilities will be promptly addressed.

## License

The project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

repository: teosz/scoala-altfel

repo_name: teosz/scoala-altfel


text:
# Contributing to CipherX

Welcome! CipherX is a community project that aims to work for a wide range of Python users and codebases. If you're trying CipherX on your Python code, your experience and what you can contribute are important to the project's success.

## Code of Conduct

Everyone participating in the CipherX community, and in particular our issue tracker and pull requests, is expected to treat other people with respect and more generally to follow the guidelines articulated in the [Python Community Code of Conduct](https://www.python.org/psf/conduct/).

## Non-code contributions

Even if you don't feel ready or able to contribute code, you can still help out. There are always things that can be improved on the documentation (even just proof reading, or telling us if a section isn't clear enough). Maybe you can propose general examples for the documentation?

## Reporting bugs and issues

If you've run into behaviour in CipherX that you don't understand, or you're having trouble working out a good way to apply it to your code, or you've found a bug or would like a feature it doesn't have, we want to hear from you!

Our forum for discussion is the project's [GitHub issue tracker](https://github.com/aceking007/CipherX/issues). This is the right place to start a discussion of any of the above or most any other topic concerning the project.

## Submitting Code

Even more excellent than a good bug report is a fix for a bug, or the implementation of a much needed new feature. *We'd love to have your contributions*.

If your new feature will be a lot of work, we recommend talking to us early -- [see below](#preparing-changes).

We use the usual GitHub pull-request flow, which may be familiar to you if you've contributed to other projects on GitHub. For the mechanics, see [GitHub's own documentation](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests).

## Preparing Changes

Before you begin: if your change will be a significant amount of work to write, we highly recommend starting by opening an issue laying out what you want to do. That lets a conversation happen early in case other contributors disagree with what you'd like to do or have ideas that will help you do it.

The best pull requests are focused, clearly describe what they're for and why they're correct, and contain tests for whatever changes they make to the code's behaviour. As a bonus these are easiest for someone to review, which helps your pull request get merged quickly! Standard advice about good pull requests for open-source projects applies.

Also, do not squash your commits after you have submitted a pull request, as this erases context during review. We will squash commits when the pull request is merged.

## Coding Conventions

Follow the coding conventions specified in [PEP 8](https://www.python.org/dev/peps/pep-0008/) and [PEP 257](https://www.python.org/dev/peps/pep-0257/). The important highlights are:
- Classes should be AllFirstLetterUppercase style.
- Functions should be in lowecase_separated_by_underscores style.
- Variables are either in lowecase_separated_by_underscores or lowercasemungedtogether style, depending on your preferences and the length of the variable.
- _single_leading_underscores to indicate internal functions or classes that shouldn't be called directly by a user.
- Tabs are bad. Most people in the Python community now dislike tabs and instead prefer using 4 spaces for indentation. Most editors can help you take care of this.
- Documentation is important, use the PEP 257 as a guide for adding docstrings in appropriate places.
- Modules, classes and function documentation should start with a one line description. This must end with a period.
- Additionally, you should add tests for any code that you write using the pytest module.

Here's an example of a module along with the proper documentation:

```python
"""This is a one line description of the module followed with a period.

More information about the module and its goals and usage.
"""

class MyClass:
    """One line description fo the class followed by a period.

    More information about the class -- its purpose, usage, and implementation.
    """

    def my_function(self, spam):
      """A terse description of my function followed with a period.

      A longer description with all kinds of additional goodies. This may include information about what the function does, along with what parameters it will be passed and what it returns. You know, information so people know how to use the function.
      """

      # the code...
```

## Core Developer Guidelines

Core developers should follow these rules when processing pull requests:
- Always wait for tests to pass before merging PRs (tests using GitHub workflows, if any).
- Additionally, carry out the tests for the PRs using `coverage` and `pytest` modules.
- Use "[Squash and merge](https://github.blog/2016-04-01-squash-your-commits/)" to merge PRs.
- Delete branches for merged PRs (by core devs pushing to the main repo).
- Edit the final commit message before merging to conform to the following style (we wish to have a clean `git log` output):
  - When merging a multi-commit PR make sure that the commit message doesn't contain the local history from the committer and the review history from the PR. Edit the message to only describe the end state of the PR.
  - Make sure there is a single newline at the end of the commit message. This way there is a single empty line between commits in `git log` output.
  - Split lines as needed so that the maximum line length of the commit message is under 80 characters, including the subject line.
  - Capitalize the subject and each paragraph.
  - Make sure that the subject of the commit message has no trailing dot.
  - If the PR fixes an issue, make sure something like "Fixes #xxx" occurs in the body of the message (not in the subject).
  - The subject should start with one of the following tags
    - `feat` - Addition of a new feature
    - `fix` - Bug fixes
    - `perf` - Performance improvements
    - `refactor` - Code refactorization
    - `doc` - Improvements or revisions in documentation
    - `chore` - A side job that needed to be done
    A subject line for the commit should look like this:
    `feat: Added Feature X` or `chore: Initial commit`
  - Use markdown for formatting

## Issue-tracker conventions

We aim to reply to all new issues promptly. We'll assign a milestone to help us track which issues we intend to get to when, and may apply labels to carry some other information. Here's what our milestones and labels mean.

### Task priority and sizing

We use GitHub "labels" ([see our list](https://github.com/aceking007/CipherX/labels)) to roughly order what we want to do soon and less soon. There's two dimensions taken into account: **priority** (does it matter to our users) and **size** (how long will it take to complete).

Bugs that aren't a huge deal but do matter to users and don't seem like a lot of work to fix generally will be dealt with sooner; things that will take longer may go further out.

WE are trying to keep the backlog at a manageable size, an issue that is unlikely to be acted upon in foreseeable future is going to be respectfully closed. This doesn't mean the issue is not important, but rather reflects the limits of the team.

The **question** label is for issue threads where a user is asking a question but it isn't yet clear that it represents something to actually change. We use the issue tracker as the preferred venue for such questions, even when they aren't literally issues, to keep down the number of distinct discussion venues anyone needs to track. These might evolve into a bug or feature request.

Issues **without a priority or size** haven't been triaged. We aim to triage all new issues promptly, but there maybe some issues that we haven't yet reviewed since adopting these conventions.

### Other labels

- **needs discussion**: This issue needs agreement on some kind of design before it makes sense to implement it, and it either doesn't yet have a design or doesn't yet have agreement on one.
- **feature, bug, crash, refactoring, documentation**: These classify the user-facing impact of the change. Specifically "refactoring" means there should be no user-facing effect.
- **topic**: labels group issues touching a similar aspect of the project, for example PEP 484 compatibility, a specific command-line option or dependency.

### References and Sources for the document:
- [mypy Contribution Guidelines](https://github.com/python/mypy/blob/master/CONTRIBUTING.md)
- [Contributing to Biopython](https://biopython.org/wiki/Contributing)

repository: arpit-omprakash/CipherX

repo_name: arpit-omprakash/CipherX


text:
##Cygnite PHP Framework
-----------------------------------
[![Build Status](https://travis-ci.org/cygnite/framework.svg)](https://travis-ci.org/cygnite/framework)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cygnite/framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![HHVM Status](http://hhvm.h4cc.de/badge/cygnite/framework.svg)](http://hhvm.h4cc.de/package/cygnite/framework)
[![Latest Stable Version](https://poser.pugx.org/cygnite/framework/v/stable.svg)](https://packagist.org/packages/cygnite/framework) [![Total Downloads](https://poser.pugx.org/cygnite/framework/downloads.svg)](https://packagist.org/packages/cygnite/framework) [![Latest Unstable Version](https://poser.pugx.org/cygnite/framework/v/unstable.svg)](https://packagist.org/packages/cygnite/framework) [![License](https://poser.pugx.org/cygnite/framework/license.svg)](https://packagist.org/packages/cygnite/framework)

Cygnite Framework it's just a small footprint to give you the creative experience of developing a web application.
Cygnite is beautifully crafted to make your job simple and better without being worried about performance.

You will find several eye catching features into Cygnite Framework.

##Requirements
-----------------------

The following versions of PHP are supported by this version.

- PHP 7.0 and above
- HHVM

### Key Features -
-----------------------

1. Powered By Composer.
2. Zero Configuration.
3. Powerful Craft Console On Top Of Symfony Console. Creating CRUD, Forms, Commands, Migrations and lot more Is Just Easy.
4. Cyrus Lightweight ORM.
5. As Simple For Begginer As Well As For Advance Developers.
6. RESTFul Routing, Events, Controllers Helps You To Build Powerful API.
7. Powerful IoC Container, HTTP Requests/Responses, Middlewares, Events, Bootstrappers, Services, Tracy Exception Handler etc.
8. Integrated Third Party Payment Gateway, Social Authentication Libraries (Omnipay, Stripe, SocialOAuth etc.)
9. Use Plain PHP Layout or Twig Template Engine.
10. Use Classic Controllers, Service Controllers or HMVC Modules For Building Modular Application.

###Contributing To Cygnite Framework
---------------------------------------------------

Contribute on the development or its documentation, learn, get help and help others, find, report bugs, send us your feedback, send your wishlist for new features, write and send us patches for Cygnite Framework.

You can contribute into cygnite development different ways. Read more in official website-

http://www.cygniteframework.com/

###License
--------------

The Cygnite Framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

repository: cygnite/framework

gha_language: PHP

repo_name: cygnite/framework


text:
# SPE-GUI
Project files for DATX05 MPCSN, a master thesis project spring 2021.

A GUI for application design and performance reporting of data streaming applications.

Currently it supports the [Liebre](https://github.com/vincenzo-gulisano/Liebre) and [Apache Flink](https://github.com/apache/flink) SPEs.

## How to run
#### IntelliJ
Open as a Maven project in IntelliJ and run `Main.java`

#### JAR
Run the `GUI.jar` file located at `/out/artifacts/GUI_jar/`.
Note that the two smartgraph files need to be in the same directory as the JAR file.

## Screenshots
Designing a streaming application (& code generation):

![Designing a streaming application](/images/gui-2.png)

Visualising the code of a streaming application:

![Visualising the code of a streaming application](/images/gui-4.png)

Live statistics for Liebre:

![Live statistics for Liebre](/images/gui-3-2.png)

Metrics from Graphite:

![Metrics from Graphite](/images/gui-graphite.png)


text:
# Migrate a SQL Database Using PowerShell

Warning: this code is provided on a best effort basis and is not in any way officially supported or sanctioned by Cohesity. The code is intentionally kept simple to retain value as example code. The code in this repository is provided as-is and the author accepts no liability for damages resulting from its use.

This script initiates, syncs, finalizes or lists SQL database migrations.

## Download the script

Run these commands from PowerShell to download the script(s) into your current directory

```powershell
# Download Commands
$scriptName = 'migrateSQLDB'
$repoURL = 'https://raw.githubusercontent.com/bseltz-cohesity/scripts/master'
(Invoke-WebRequest -UseBasicParsing -Uri "$repoUrl/sql/$scriptName/$scriptName.ps1").content | Out-File "$scriptName.ps1"; (Get-Content "$scriptName.ps1") | Set-Content "$scriptName.ps1"
(Invoke-WebRequest -UseBasicParsing -Uri "$repoUrl/powershell/cohesity-api/cohesity-api.ps1").content | Out-File cohesity-api.ps1; (Get-Content cohesity-api.ps1) | Set-Content cohesity-api.ps1
# End Download Commands
```

## Components

* migrateSQLDB.ps1: the main powershell script
* cohesity-api.ps1: the Cohesity REST API helper module

## Operating Modes

The script will list, initialize, sync or finalize migrations.

## List Mode

To list existing migrations in progress (On Hold or Running):

```powershell
./migrateSQLDB.ps1 -vip mycluster `
                   -username myuser `
                   -domain mydomain.net
```

To list existing migrations (including completed migrations):

```powershell
./migrateSQLDB.ps1 -vip mycluster `
                   -username myuser `
                   -domain mydomain.net `
                   -showAll `
                   -daysBack 7
```

To list existing migrations for a specific source database:

```powershell
./migrateSQLDB.ps1 -vip mycluster `
                   -username myuser `
                   -domain mydomain.net `
                   -sourceServer sqlserver1 `
                   -sourceDB MSSQLSERVER/mydb `
                   -showAll `
                   -daysBack 7
```

## Init Mode

To initiate a new migration:

```powershell
./migrateSQLDB.ps1 -vip mycluster `
                   -username myuser `
                   -domain mydomain.net `
                   -sourceServer sqlserver1 `
                   -sourceDB MSSQLSERVER/mydb `
                   -targetServer sqlsserver2 `
                   -targetDB mydb2 `
                   -mdfFolder c:\sqldata
```

## Sync Mode

To sync all existing migration(s):

```powershell
./migrateSQLDB.ps1 -vip mycluster `
                   -username myuser `
                   -domain mydomain.net `
                   -sync
```

Or you can filter on name, id or filter:

```powershell
./migrateSQLDB.ps1 -vip mycluster `
                   -username myuser `
                   -domain mydomain.net `
                   -sync `
                   -id -id<PHONE_NUMBER>64119:1631181117066:180265
```

## Finalize Mode

To finalize existing migration(s):

```powershell
./migrateSQLDB.ps1 -vip mycluster `
                   -username myuser `
                   -domain mydomain.net `
                   -finalize `
                   -id -id<PHONE_NUMBER>64119:1631181117066:180265
```

## Authentication Parameters

* -vip: (optional) name or IP of Cohesity cluster (defaults to helios.cohesity.com)
* -username: (optional) name of user to connect to Cohesity (defaults to helios)
* -domain: (optional) your AD domain (defaults to local)
* -useApiKey: (optional) use API key for authentication
* -password: (optional) will use cached password or will be prompted
* -noPrompt: (optional) do not prompt for password
* -tenant: (optional) organization to impersonate
* -mcm: (optional) connect through MCM
* -mfaCode: (optional) TOTP MFA code
* -emailMfaCode: (optional) send MFA code via email
* -clusterName: (optional) cluster to connect to when connecting through Helios or MCM

## Mode Parameters

If none are used, the script will be in list mode.

* -init: (optional) initialize a new migration
* -sync: (optional) perform manual sync now
* -finalize: (optional) finalize migration(s)
* -cancel: (optional) cancel migration(s)

## Filter Parameters for sync finalize or list modes

* -showAll: (optional) show completed tasks (only show in process migrations by default)
* -daysBack: (optional) days back to show for -showAll (default is 7)
* -name: (optional) only show/sync/finalize migration task with this name
* -filter: (optional) only show/sync/finalize migration tasks matching this string
* -id: (optional) only show/sync/finalize migration task matching this id
* -returnTaskIds: (optional) return resulting list of task IDs and exit
* -sourceServer: (optional) filter on -sourceServer and -sourceDB
* -sourceInstance: (optional) filter on -sourceInstance
* -sourceDB: (optional) one or more source DBs to filter on -sourceServer and -sourceDB (comma separated)
* -sourceDBList: (optional) text file of source DBs to filter on -sourceServer and -sourceDB (one per line)
* -targetServer: (optional) filter on -sourceServer and -sourceDB
* -targetDB: (optional) filter on -targetServer and -targetDB

## Init Mode Parameters

* -sourceServer: (required for init) Server name (or AAG name) where the database was backed up
* -sourceDB: (required for init) Original database name
* -sourceInstance: (optional) specify source instance name
* -targetServer: (required for init) Server name to migrate to
* -targetInstance: (optional) Instance name to restore to (defaults to MSSQLSERVER)
* -targetDB: (optional) New database name (defaults to same as sourceDB)
* -mdfFolder: (optional) Location to place the primary data file (e.g. C:\SQLData)
* -showPaths: (optional) show data/log file paths and exit
* -useSourcePaths: (optional) use same paths to restore to target server
* -ldfFolder: (optional) Location to place the log files (defaults to same as mdfFolder)
* -ndfFolders: (optional) Locations to place various ndf files (see below)
* -keepCdc: (optional) Keep change data capture during restore (default is false)
* -noRecovery: (optional) Restore the DB with NORECOVER option (default is to recover)
* -manualSync: (optional) Use manual sync mode (use auto sync by default)

## Multiple Folders for Secondary NDF Files

```powershell
-ndfFolders @{ '.*DataFile1.ndf' = 'E:\SQLData'; '.*DataFile2.ndf' = 'F:\SQLData'; }
```

repository: bseltz-cohesity/scripts

gha_language: PowerShell

repo_name: bseltz-cohesity/scripts


text:
## KikDogeWallet
#### Dogecoin Wallet for Kik Messenger.

[Learn about Dogecoin here](http://www.dogecoin.com/)

![Doge](http://dogecoin.com/img/dogecoin-300.png)

#### Use
1. Install [Kik Messenger](http://kik.com) on your smartphone if you haven't yet
2. Log in/register a username
3. Open the sidebar and search `Dogecoin Wallet`
4. Tap the Dogecoin Wallet link that appears

```
    wow                     rich shibe
                  much wallet                send to friends!
         very coin                 spend wisely wow
```
(If that doesn't work then open the sidebar and navigate to `https://kikdogewallet.herokuapp.com`)

#### Install
1. Make sure you have [MongoDB](mongodb.org) and [NodeJS](nodejs.org) installed.
2. Clone repo
`git clone git@github.com:mitchellvanderhoeff/kikdogewallet.git`
3. Run `npm install`, `bower install` and `npm install gulp -g`
4. Run `gulp dev`
5. Navigate to `http://localhost:9000` with a browser

This will run a debug server that doesn't check Kik authentication. You can log in to the database by running `mongo` and then

```
> use dogewallet
> show collections
```
For example, you might want to increase the test account's balance by an amount to test sending and receiving. For that, run the following command in the Mongo shell:

```
> db.Wallets.update({ "username" : "eltestador" }, { "$inc" : { "balance" : <amount> } })
```

Consult the MongoDB docs for info on how to query and update the database more.

repository: mitchellvanderhoeff/kikdogewallet

repo_name: mitchellvanderhoeff/kikdogewallet


text:
Archetype Modern Starter
========================

[![Build Status](https://travis-ci.org/coder168/archetype-modern-starter.svg?branch=master)](https://travis-ci.org/coder168/archetype-modern-starter)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.coder168/archetype-modern-starter.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.coder168%22%20AND%20a:%22archetype-modern-starter%22)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

What is it
----------

This maven archetype is used to generate modern java standalone application project.

* [project homepage](https://github.com/coder168/archetype-modern-starter)
* [apache license 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)
* [issue tracking](https://github.com/coder168/archetype-modern-starter/issues)

The generated project uses the following technologies:

* java 8
* maven 3.5.x
* log4j 2.11.1
* junit 4.12

How to use
----------

Under the command line, type the following command:
   > mvn archetype:generate -Dfilter=archetype-modern-starter

or
   > mvn archetype:generate -Dfilter=io.github.coder168:

and then follows the given instructions.

How to install into local repository
------------------------------------

If you want to install the latest version(SNAPSHOT) into your local repository:

1. clone the archetype project
2. under project directory, type the following command:
   > mvn clean install


text:
# Presentation 4 - Ajax File Uploads
An introduction on how to perform Ajax file uploads, and an example of how easy it is in AngularJS.
## Points to discuss
* Requirements
	* File, FileList, and FileReader ('filereader' in modernizr)
	* XML HTTP Request 2 ('xhr2' in modernizr, or look for 'window.FormData')
* Getting the files
	* 'change' event from file inputs: event.target.files
	* Drag'n'Drop: event.originalEvent.dataTransfer.files
		* Remember event.preventDefault() and event.stopPropagation()
* Uploading the files
	* $http({data: file, header: {"Content-Type": file.type, "X-Filename": file.name}})

## Links
* [MDN - Using files from web applications](https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications)
* [Modernizr - filereader test source](https://github.com/Modernizr/Modernizr/blob/master/feature-detects/file/api.js)
* [Modernizr - xhr2 test source](https://github.com/Modernizr/Modernizr/blob/master/feature-detects/network/xhr2.js)

repository: rolaveric/AngularPresentations

repo_name: rolaveric/AngularPresentations


text:
# MySoftphoneApp
MySoftphoneAppAlpha

Basic softphone solution that implement calls, conferences, instant messaging and presence indication.
The app works with Mizu VoIP Service and MS SQL Server.
The app uses PJSUA2 library and opus codec library for implementing VoIP.
The business logic was written in Qt/C++, the GUI was written in QML.

Its just test version of the app so its need to fix.

Authentification:

![Farmers Market Finder Demo](demo/authentification.gif)

Calling:

![Farmers Market Finder Demo](demo/make-call.gif)

Making conference:

![Farmers Market Finder Demo](demo/make-conference.gif)

license: Unlicense


text:
# Description
Docker containers can be interesting to look around in.
You can save containers to a tar archive and then extract the layers and metadata files from them.
Note that exported containers look a little different from images that have been saved to an archive.

## Run instructions

Run an alpine container

    docker run -it --name=alpinetest -e tmpvar=test alpine sh

Note that you can see the environment variable that you set in the run command.

    echo $tmpvar

See the other environment variables with `env`

Export the running container to an archive

    docker export -o alpine.tar alpinetest

Now extract the contents of the archive and look around.

    mkdir tmp
    cd tmp
    tar xvf ../alpine.tar

Notice that you do not see the metadata files that are present in a image that has been saved to an archive.

repository: StivenHerreraSierra/docker-exercises

repo_name: StivenHerreraSierra/docker-exercises


text:
---
layout: default
title: Fetching Your Data
parent: The Way
nav_order: 1
has_toc: true
---

# Fetching Your Data
{: .no_toc }

There are a number of places you may have to fetch data from to get them onto a cluster filesystem. We will briefly cover best practices for the methods we've used before. Additions will be made as we gain more experience.

## Between Clusters Or Local Disks

The best option for moving a large amount of data between clusters is to use the `scp` command. Remember that this process must remain open and running in your terminal, so it might be useful to do this in a fresh terminal window or use `&` at the end of your command. You could also use [`screen`](https://www.geeksforgeeks.org/screen-command-in-linux-with-examples/) to set up a non-terminating terminal.

As mentioned in our general [PMACS documentation](/docs/pmacs), you should scp *into* a node called `transfer`. That would look like this:

```
## my username is ttapera
scp -r path/to/your/data ttapera@transfer.pmacs.upenn.edu:/path/on/pmacs
```

An alternative to `scp` is `rsync`, but that tends to have [more happening under the hood](https://stackoverflow.com/questions/20244585/how-does-scp-differ-from-rsync).

## Flywheel

On Flywheel, your data may already be in BIDS. In this case we recommend using Flywheel's export function `fw export bids`, or the export function provided by [`fw-heudiconv`](https://fw-heudiconv.readthedocs.io/en/latest/). We built the export function into `fw-heudiconv` because we wanted to have more flexibility in what BIDS data we could grab, including data that's not yet supported in the official BIDS spec. Admittedly though, downloading all of `fw-heudiconv` a lot of overhead for just the export function.

```
# with fw export bids
fw export bids <DESTINATION_DIRECTORY> --project <PROJECT_NAME> --subject <SUBJECT_FILTER>

# with fw-heudiconv
fw-heudiconv-export --project <PROJECT_NAME> --subject <SUBJECTS_FILTER> --session <SESSION_FILTER> --folders <LIST_OF_BIDS_FOLDERS>
```

Try `fw-heudiconv-export -h` for more info.

## Globus

[Globus](https://www.globus.org/) is a research data management platform whose best feature is data transfer and sharing. It's surprisingly easy to use and gets the job done with minimal setup. The data sharing concept revolves around setting virtual *endpoints* that data can be shared to and from. Endpoints can be thought of conceptually as mounts, where you can give outbound network access to a certain directory on your machine or cluster, and by sharing the URL of your endpoint, someone can access your directory through the internet or network cluster.

Currently, the best way to use Globus is either through your local disk or on PMACs (recommended). We're still awaiting CUBIC authorization. The general docs for globus are located [here](https://docs.globus.org/how-to/), but for posterity, here are the best instructions:

On a local disk:

1. Log in to Globus with your UPenn organization account -- [https://docs.globus.org/how-to/get-started/](https://docs.globus.org/how-to/get-started/) -- and try out the tutorial for sharing between two test endpoints on Globus' system
2. Download and install [Globus Connect Personal](https://www.globus.org/globus-connect-personal); this service will manage the endpoint on your local machine
3. Download and install the [CLI](https://docs.globus.org/cli/) with pip -- remember to use conda environments! This service will allow you to manage the Globus session when it's running
4. [Login with the CLI](https://docs.globus.org/cli/quickstart/) and transfer your data either through the CLI commands or by visiting the file manager (which you saw in step 1). If someone has shared a Globus endpoint with your account, you'll have access to it in "Endpoints".

On PMACs:

0. Make sure you have access to the PULSE Secure VPN -- [remote.pmacs.upenn.edu](remote.pmacs.upenn.edu)

1. Log in to PMACs' dedicated node for Globus functionality:

```
# first ssh into sciget for network access
ssh -y<EMAIL_ADDRESS>
# then from sciget, log onto the globus node
ssh -y<EMAIL_ADDRESS>```

2. Globus Connect Personal should be available. As above, use it to initialize an endpoint on a directory of your choice on PMACs. Specifically, you should run it as below so that it opens a GUI for logging in with an auto-generated token:

```
# this command will return a URL you can open in any browser and a token you can use to sign in
globusconnect -start &
```

3. Using a new or existing conda environment (see [here](https://pennlinc.github.io/docs/pmacs#logging-in-to-pmacs-lpc) for how to activate conda on PMACs), install the [CLI](https://docs.globus.org/cli/) using `pip` and login with `globus login`.

4. Visit [https://docs.globus.org/how-to/get-started/](https://docs.globus.org/how-to/get-started/) to access the File Manager, as in the Local Disk instructions, to start transferring data.


text:
# Changes

**v0.5.2**
   - deprecated in favor of "guestissuer" as part of Webex Teams rebrand
   - check https://github.com/ObjectIsAdvantag/guestissuer

**v0.5.1**
   - making the duration of the JWT Token more explicit
   - added explanations to add a Permanent Guest to an existing space

**v0.5**
   - updating documentation to reflect Webex Teams rebrand

repository: ObjectIsAdvantag/sparkguest

repo_name: ObjectIsAdvantag/sparkguest


text:
Linked from `org/tetragen/Tetragen.kt`

# Specifying an Environment
Because of problems relating to the Bukkit API*, Tetragen now requires that an Environment ID is specified for each world being generated. This guide will show you how to add an Environment ID when registering worlds.

Mostly when you create a world, you'll register the world generator like this:
```yml
# If you actually try this with Tetragen, IT WILL NOT WORK!
generator: TetragenPlugin
```
However, we can give additional information about how the generate the world by giving an Environment ID, which is added to the end of the generator name.
Now, we'll do this:
```yml
# This will work
generator: TetragenPlugin:NORMAL
```
Creating a world using a world management plugin will look something like this
`/mv create sample NORMAL -g TetragenPlugin:NORMAL`

There are 3 Environment IDs that Tetragen Supports:
- NORMAL
- NETHER
- END

So this is also valid:
```yml
# This will generate a Nether-type world
generator: TetragenPlugin:NETHER
```
and this, too:
`/mv create sample END -g TetragenPlugin:END`

Hopefully this helps you. If you have any problems, contact me through Discord or Github

*Namely, `Bukkit.getWorld()` always returns `null` when starting up, which prevents me from creating world-specific generators.

repository: Ansere/Tetragen

extension: markdown

repo_name: Ansere/Tetragen


text:
[banner](http://skyglobal.github.io/banner/)
========================

> Please take a look at the [demo page](http://skyglobal.github.io/banner/)

## Quick-Start

Include the banner assets in your project either as **Static Resources**

```html
<link rel="stylesheet" href="http://web-toolkit.global.sky.com/components/banner/0.1.0/styles/banner.min.css" />
<script type="text/javascript" src="http://web-toolkit.global.sky.com/components/banner/0.1.0/scripts/banner.min.js"></script>
```

or alternatively, **Via Bower**

 * Run: `bower install --save-dev bskyb-banner`
 * Include Sass: `@import 'bower_components/bskyb-banner/src/styles/banner';`
 * Include JS: `var banner = require('../../bower_components/bskyb-banner/src/scripts/banner');`

#### Dependencies

If you need IE8 support, please also use:

 * [polyfill](https://github.com/skyglobal/polyfill)

## Contribution

Components depends on collaboration between developers. Contributions of any size are actively encouraged.

To see how to build this component locally, read the [contribution guidelines](CONTRIBUTING.md).

## Browser Support

 * IE9 +
 * Safari 5 +
 * Latest Firefox
 * Latest Chrome
 * Latest Mobile Safari
 * Latest Mobile Chrome

repository: skyglobal/banner

repo_name: skyglobal/banner


text:
# Jeremiah 24 General Notes
## Special concepts in this chapter

### The exiles are blessed and the others punished

God will bless the people who were taken away into Babylon but punish the people left in the land because they still did not repent and turn to him. (See: [[../bible/kt/bless]] and [[../bible/kt/repent]])

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
Quarkus Kafka quick start
========================
To see how to use this code example follow the [quick start](../../quarkus).

## Additional information on this code example

This code example is based the [code example from Quarkus](https://github.com/quarkusio/quarkus-quickstarts/blob/main/kafka-quickstart)

This project illustrates how you can interact with Apache Kafka using MicroProfile Reactive Messaging.

repository: EricWittmann/app-services-guides

repo_name: EricWittmann/app-services-guides


text:
# Python Bytes 99
Sponsored by DigitalOcean: [**pythonbytes.fm/digitalocean**](https://pythonbytes.fm/digitalocean)

**Brian #1:** [**parse**](https://pypi.org/project/parse/)

- “*parse() is the opposite of format()**”*
- `regex` not required for parsing strings.
- Provides these functionalities: export `parse()`, `search()`, `findall()`, and `with_pattern()`

```
    >>> parse("It's {}, I love it!", "It's spam, I love it!")
    <Result ('spam',) {}>
    >>> search('Age: {:d}\n', 'Name: Rufus\nAge: 42\nColor: red\n')
    <Result (42,) {}>
    >>> ''.join(r.fixed[0] for r in findall(">{}<", "<p>the <b>bold</b> text</p>"))
    'the bold text'
```

- Can also compile for repeated use.

**Michael #2:** [**fman Build System**](https://build-system.fman.io/#features)

- FBS lets you create GUI apps for Windows, Mac and Linux
- via Michael Herrmann
- Build Python GUIs, with Qt – in minutes
- Write a desktop application with PyQt or Qt for Python.
- Use fbs to package and deploy it on Windows, Mac and Linux.
- Avoid months of painful work with the proven solutions provided by fbs.
- Easy Packaging: Unlike other solutions, fbs makes packaging easy. Create installers for your app in seconds and distribute them to your users – on Windows, Mac and Linux!
- Open Source: fbs's source code is available on GitHub. You can use it for free in open source projects licensed under the GPL. Commercial licenses are also offered.
	- Free under the GPL. If that's too restrictive, a commercial license is 250 Euros once.
	- PyQt's licensing is similar (GPL/Commercial). A license for it is € 450 ([source](https://www.riverbankcomputing.com/commercial/buy)).
- Came from fman, a dual-pane file manager for Mac, Windows and Linux

**Brian #3:** [**fastjsonschema**](https://horejsek.github.io/python-fastjsonschema/)

- Validate JSON against a schema, quickly.

[](https://blog.horejsek.com/fastjsonschema/)

**Michael #4:** [**IPython 7.0, Async REPL**](https://blog.jupyter.org/ipython-7-0-async-repl-a35ce050f7f7)

- via [Nick Spirit](https://twitter.com/Spirix3)
- Article by [Matthias Bussonnier](https://blog.jupyter.org/@mbussonn?source=post_header_lockup)
- We are pleased to announce the release of [IPython 7.0, the powerful Python interactive shell](https://ipython.readthedocs.io/) that goes above and beyond the default Python REPL with advanced tab completion, syntactic coloration, and more.
- Not having to support Python 2 allowed us to make full use of new Python 3 features and bring never before seen capability in a Python Console, see the [Python 3 Statement.](https://python3statement.org/)
- One of the core features we focused on for this release is the ability to (ab)use the *async* and *await* syntax available in Python 3.5+.
- TL;DR: You can now use *async*/*await* at the top level in the IPython terminal and in the notebook, it should — in most of the cases — “just work”.
- The only thing you need to remember is: If it is an async function you need to await it.

**Brian #5:** [**molten**](https://moltenframework.com)

**Michael #6:** [**A Python love letter**](https://www.reddit.com/r/Python/comments/8ndhel/dear_python_where_have_you_been_all_my_life/)

- Dear Python, where have you been all my life? (reddit thread)
- I am NOT a developer. But, I've tinkered with programming (in BASIC, Visual Basic, Perl, now Python) when needed over the years
- I decided that I needed to script something, and hoped that learning how to do it in Python was going to take me significantly less time than doing it manually - with the benefit of future timesavings. No, I didn't go from 0 to production in a day. But if my coworkers will leave me alone, I might be in production by the end of the day tomorrow.
- What I'm working on today isn't super complex —  But putting together what I've done so far has just been a complete joy.
- Overall it feels natural, intuitive, and relatively easy to understand and write the code for the basic things I'm doing - I haven't had this much fun doing stuff with code since the days fooling around with BASIC in my teens.
- Feedback / comments
	- Welcome to the club. I came up on c++; my job highly trained me in C and assembly but every project I touch I think, wait, "we can do 95% this in python". And we do.
	- I used to have a chip on my shoulder. I wanted to do things the hard way to truly understand them. I went with C++. … I learned that doing things the smart way was better than doing things the hard way and didn't interfere with learning.
	- I felt the exact same way I finally decided to learn it. It's like a breath of fresh air. Sadly there are few things in my life that made me feel like this, Python and Bitcoin both give me the same levels of enjoyment. … I've used Java, Groovy, Scala, Objective-C, C, C++, C#, Perl and Javascript in a professional capacity over the years and nothing feels as natural to me as Python does. The developers truly deserve any donations they get for making it. …
	- I taught myself Python a little over 3 years ago and I quickly went from not being programmer to being a programmer. … However the real popularity of Python comes from the depth and quality of 3rd party libraries and how easy they are to install.

**Extra:**

- [**Brian: Power Mode II**](https://plugins.jetbrains.com/plugin/8251-power-mode-ii)

gha_language: Python


text:
# Husky Altair theme

[![badge](https://img.shields.io/badge/GitHub-husky--altair--theme-blue.svg?logo=github)](https://github.com/deppen8/husky-altair-theme)

This project defines `husky_theme`, a theme for Altair charts based on the [University of Washington branding guidelines](http://www.washington.edu/brand/graphic-elements/). That said, it is NOT an official product of the University of Washington. Check it out some examples on Binder without downloading or installing anything.

[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/deppen8/husky-altair-theme/master?filepath=husky_theme_examples.ipynb)

The theme was built with inspiration from Sergio Sánchez's excellent blog post: [Consistently Beautiful Visualizations with Altair Themes](https://towardsdatascience.com/consistently-beautiful-visualizations-with-altair-themes-c7f9f889602).

## Examples

Below are a few examples using the `husky_theme` to reproduce examples from the [Altair Example Gallery](https://altair-viz.github.io/gallery/index.html).

The `husky_theme.ipynb` notebook contains a more complete series of examples. In a few cases, I have slightly altered the code from the Altair docs. These are noted along with the example. You can play around with the examples yourself by launching the notebook in Binder.

[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/deppen8/husky-altair-theme/master?filepath=husky_theme_examples.ipynb)

![simple_scatter](../assets/images/husky_theme/simple_scatter.png)

![simple_bar](../assets/images/husky_theme/simple_bar.png)

![simple_histogram](../assets/images/husky_theme/simple_histogram.png)

![simple_stacked_area](../assets/images/husky_theme/simple_stacked_area.png)

![multi_line](../assets/images/husky_theme/multi_line.png)

![candlestick](../assets/images/husky_theme/candlestick.png)

gha_language: JavaScript

gha_license_id: NOASSERTION


text:
---
layout: post
title: "android butterknife injection"
description: ""
category: "android"
---

ref: Butterknife

Butterknife is used to inject views into layout files. However the setup was a bit of a struggle. The following worked for me:

>
	* Add the below in your project build.gradle:

	dependencies {

        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }

	* Add the below in your app build.gradle:

	apply plugin: 'android-apt'

	dependencies {

    compile 'com.jakewharton:butterknife:8.0.1'
    apt 'com.jakewharton:butterknife-compiler:8.0.1'

	}

	* Add the below plugin for easy use of butterknife with Android Studio:

	File->Settings->Plugin->Browse Repositories->Android Butterknife Zelezny

	* Example:

	 @BindView(R.id.input_email)
    EditText _emailText;

	In OnCreateView:   ButterKnife.bind(this);

And you are good to go!


text:
---
id: complex-structures
title: Complex Structures
hide_table_of_contents: true
---

This example demonstrates how to handle [Complex Structures](../getting-started/complex-structures) in React Cool Form.

<iframe src="https://codesandbox.io/embed/rcf-complex-structures-4x4n1?fontsize=14&hidenavigation=1&theme=dark"
  style={{ width: "100%", height: "500px", border: "0", borderRadius: "4px",  overflow: "hidden" }}
  title="RCF - Complex Structures"
  allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

repository: nilscorver/react-cool-form

repo_name: nilscorver/react-cool-form


text:
# Base100

PHP implementation of base100 algorithm based on Go implementation by stek29: <https://github.com/stek29/base100>

To learn more about base100, please check <https://github.com/AdamNiederer/base100>


text:
[![Build Status](https://travis-ci.org/luke-biel/bts.svg?branch=master)](https://travis-ci.org/luke-biel/bts)

# bts

Command line utility to create simple file snippets available to be instantiated at any time in future

It allows to **register** and **spawn** snippets at will

## Installation
`cargo install bts`

## Usage
### NEW
Instantiate copy of an existing snippet

`bts new SOURCE [DESTINATION] [-w/--with-parent] [-m/--max-depth _]`

#### **SOURCE**
- is snippet name.

It's good idea to remember that for the time being snippets are stored in directories.
Therefore nesting is allowed and advised.
For example,
`config/mysql`, `config/psql`, `config/sqlite` are good examples of template names
and
`config_mysql`, `config_psql`, `config_sqlite` are, while correct, discouraged.
But hey, these are your snippets. Consider it only to be an advice.

#### **DESTINATION**
- is target folder name

Place where you want to instantiate a snippet. By default `pwd` is used.

#### **WITH-PARENT**
- defines whether folder should be spawned preserving snippet name

This means that `bts basic/template01 -w` will spawn files in `./basic/template01/` instead of `.`

#### **MAX-DEPTH**
- how deep the copy should go

Copies snippet only until given depth is reached in directory tree.
For example,
```
basic/template01/
                |- file.txt
                |-/ subdir

bts new basic/template01 -m 1
```
will produce only file.txt in current directory.
This parameter accepts numbers in range 0..255, default value is 32.

### Register
Create new snippet from files

`bts register TEMPLATE_NAME SOURCE [-a/--append] [-m/--max-depth]`

#### **TEMPLATE_NAME**
- is snippet name

It clears previous snippets stored at given namespace, so calling `bts basic .` will also remove `basic/template01`.

#### **SOURCE**
- is a path to snippet files

When **SOURCE** is a file, this file will be stored at snippet namespace.
When **SOURCE** is a directory, all contents of that directory will be stored at snippet namespace.

#### **APPEND**
- defines whether we want to append to existing snippet

This allows to create snippet only from selected files in directory.

#### **MAX-DEPTH**
- defines how deep should `bts` search for files when creating a snippet.

Accepts numbers between 0 and 255, default value is 32.

## Contribution
I may accept new features, but that will only happen if I can see that it's useful.
It's better to create issue at github before attempting to implement something.
Bug fixes are always welcome.
You can look into `.travis.yml` for build steps, but tldr is that I will merge only features that pass
`cargo clippy --all-targets --all-features -- -D warnings`
and
`cargo fmt --all -- --check`

## TBD
* provide GUI for the app (?)
* default snippets (sample rust projects etc.)
* pass-through for selected applications (eg. `bts spawn cargo/bin` calls `cargo new --bin`)

License: MIT

repository: luke-biel/bts

gha_language: Rust

repo_name: luke-biel/bts


text:
---
title: Hunua Falls loop
date: 2018-06-09
publishdate: 2018-06-16
author: Chris Scott
image: 005_cosseys-reservoir.jpg
latitude: -37.066546
longitude: 175.089436
tags:
  - trail run
categories:
  - Activities
resources:
  - src: 002_cosseys-gorge-track.jpg
    title: Cosseys Gorge Track
  - src: 001_hunua-falls-distance.jpg
    title: Hunua Falls from the bridge
  - src: 006_massey-track.jpg
    title: Massey Track
  - src: 003_pool-cosseys-track.jpg
    title: Pool along Cosseys Gorge Track
  - src: 008_hunua-falls-close.jpg
    title: Hunua Falls up close
  - src: 004_junction.jpg
    title: Junction
  - src: 005_cosseys-reservoir.jpg
    title: Cosseys Reservoir from the lookout
  - src: 007_hunua-falls.jpg
    title: Hunua Falls
---

With Gemma sleeping after a night shift I decided it would be best to get out of the house and headed down to the Hunua Ranges for the first time.
Starting from Hunua Falls, I did a loop around Cosseys Gorge track and Massey track.
It was a popular spot, with a full car park and lots of people, at least around the waterfall area.
After passing through the Kauri dieback cleaning station I headed out on the Cosseys Gorge track, doing the loop in a clockwise direction.
Near the beginning, there was a little stream crossing, followed by a nice run beside a river and a gentle climb up towards the reservoir.

{{< photo src="003_pool-cosseys-track.jpg" title="Along Cosseys Gorge track" >}}

There was a nice flat section alongside the reservoir and dam before the steady climb up Massey track started.
Part way up the climb there was a lookout with a good view back towards the reservoir.

{{< photo src="005_cosseys-reservoir.jpg" title="Cosseys reservoir" >}}

The trail, which was really good quality all the way around, eventually started to head back down towards the falls.
On the way to the waterfall, I stopped off at the upper lookout, where you could just see the falls through a gap in the trees.

{{< photo src="007_hunua-falls.jpg" title="Hunua Falls" >}}

The waterfall was pretty impressive up close and, as you can see, there was quite a lot of water going over.

{{< youtube eY0WuqfFigs >}}

{{< map gpx="hunua-falls-loop.gpx" >}}


text:
---
layout: post
title: "Snoopy NG on the Pi2"
date: 2015-02-12 19:22
comments: true
categories:
- wifi
- snoopy
- snoopi
- snoopyng
---

I've said it many times over in the talks I've given both at conferences and during meetings, the devices we carry betray a wealth of information about us without us even knowing.

Projects like Jassegar leverage this to masquerade as trusted wifi networks, and yet these issues remain.

And worse still are present in other standards beyond WiFi.

Enter [Snoopy-NG](https://www.sensepost.com/blog/11042.html), this is a suite of tools mostly authored in python which orchestrate the passive collection of the data our wireless devices are constantly screaming out into the Ether.

If you've ever spoken to me at a conference or on site, chances are you've seen my "bag of toys"; the reasons for this are for demonstration purposes.

There's nothing I've found more powerful than giving a practical demonstration of an issue; be it process or security issues at fault (Please consider this the next time you raise a bug on a project's tracker, and provide as much detail as you can screencasts are very useful).

So in this train of thought; following the announcement of [RasPi2](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/), it was time to add another tool / toy to the arsenal.

And so went the "rehashing" of some of the older tools, cases etc...

{% img https://blog.oneiroi.co.uk/images/pi2_atheros_peli_case.jpg %}
{% img https://blog.oneiroi.co.uk/images/peli_usb_power_mod.jpg %}
{% img https://blog.oneiroi.co.uk/images/peli_18000maH.jpg %}

This was not without its issues however, seems if you try to draw more power than the Pi2 can provide it leads to some odd behaviour.

{% img https://blog.oneiroi.co.uk/images/arch_pi2_issues.jpg %}
{% img https://blog.oneiroi.co.uk/images/arch_pi2_issues-2.jpg %}
{% img https://blog.oneiroi.co.uk/images/raspbian_pi2_issues.jpg %}

I took to the [Raspi forums](https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=99530) though the discussion appears to yield nothing but "you've got PSU problems".

In the end the Atheros WiFi is now using a USB-Y adapter (hence the two use A cables attaching to the battery pack), as I've little time to waste on the debate of what a "non crappy" PSU is despite giving complete examples of all types of power supplies used in the diagnosis of the issues at hand, which appear to have been ignored.

Now running on Raspbian a git clone of [Snoopy-ng](https://github.com/sensepost/snoopy-ng) was taken, depedencies installed and some modifications to /etc/rc.local to have snoopy-ng run at startup, and we've got a fully functional "drone unit", though currently reliant on the old "blinken lights" to produce confidence in the running of Snoopy (the WiFi LED will blink in approx 30 second intervals whilst in monitor mode).

{% gist c3b7429768b979280590 rc.local %}
{% gist c3b7429768b979280590 start %}

Currently this has had some 24hrs of stable data collection, with the only interuptions to uptime being the change between wall socket and battery power when moving around.

I would really be intrested in seeing a USB battery pack which can also take a "trickle charge" to aid in mobility, sort of a mini UPS if you will.

What's next? maybe the [USB Armory](https://www.crowdsupply.com/inverse-path/usb-armory) which looks quiet promissing; I'm also looking to add [BadUSB](https://github.com/adamcaudill/Psychson), [HackRF](https://greatscottgadgets.com/hackrf/) to the "bag of toys".

I've also been looking at SDR [on and off](https://twitter.com/icleus/status/529585357437014018), particuarly instrested in the [POCSAG Pager network](https://en.wikipedia.org/wiki/POCSAG) which seems to be another clear text protocol, aswell as 802.15.4 (Xbee / Zigbee) which appears to be making itself into traffic controll systems and is again completely open.

Why you may ask would these things make it into the "bag of toys"?

I reffer back to my previous point of practical examples, unless you can demonstrably show people why something is insecure / broken they have little interest / time / money in fixing the issue at hand, if you want results far better to show someone the problem and work with them on the fix.

A.K.A. Providing a Proof of Concept

branch_name: refs/heads/octopress


text:
# Unsupervised Deep Tracking, UDT

1. Introduction
2. Settings
3. Implementation

## 1. Introduction

There is the [paper](https://arxiv.org/abs/1904.01828), UDT. and the original open source of this paper is here
~~~
C/C++ version (Original) : https://github.com/594422814/UDT
Python(pytorch) version  : https://github.com/594422814/UDT_pytorch
~~~

From this repository, I modified [UDT_pytorch](https://github.com/594422814/UDT_pytorch)

And ,there is a his citation;
```
@inproceedings{Wang_2019_Unsupervised,
    title={Unsupervised Deep Tracking},
    author={Wang, Ning and Song, Yibing and Ma, Chao and Zhou, Wengang and Liu, Wei and Li, Houqiang},
    booktitle={The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    year={2019}
}

@article{wang17dcfnet,
    Author = {Qiang Wang, Jin Gao, Junliang Xing, Mengdan Zhang, Weiming Hu},
    Title = {DCFNet: Discriminant Correlation Filters Network for Visual Tracking},
    Journal = {arXiv preprint arXiv:1704.04057},
    Year = {2017}
}
```

## 2. Settings
1. System Environments
	~~~
	Ubuntu == 18.04
	Cuda == 10.1
	Cudnn == 7.6.5
	Python == 3.6.5
	~~~
2. Python Library
	~~~
	torch == 1.4.0
	torchvision == 0.5.0
	numpy == 1.18.1
	opencv-contrib-python == <IP_ADDRESS>
	~~~
## 3. Implementation
1. You can just run this file ```UDT.py```

	```
	$ python3 UDT.py
	```

	If the camera recognized in computer, this file will be operated well.

2. You can change the argument options ```--input_sources```

	1. Web Camera (USB Camera)

		Use ```--input_source /dev/video0```, ```--input_source 0```

		Also, you can use ```--input_sourcve=/dev/video0```, ```--input_source=0```

		```shell
		$ python3 UDT.py --input_source /dev/video0
		```

	2. Other Video Source

		Use ```--input_source {your files} ``` or ```--input_source={your_files}```/

		```shell
		$ python3 UDT.py --input_source bag.avi
		```


text:
# Contributing to Adama

[Adama Platform](http://www.adama-platform.com) is an exciting paradigm shift, and we are happy to have contributions.

## Code of Conduct

[Adama Platform](http://www.adama-platform.com) has embraced a simplified [code of conduct](CODE_OF_CONDUCT.md) that we expect everyone to follow.

## Get Involved

There are many ways to contribute to Adama. However, as an ideal requirement, you should be familiar with Adama and have used it in a meaningful way.
Hopefully, you aim to contribute as you may have run into a wall with the platform as it has limits and awkwardness.

### Join discord
The ['#contrib' channel in the Adama discord](https://discord.gg/zRYYgKkGKg) is the primary place for real-time communication.

## Development philosophy and the mono-repo
Adama doesn't leverage branches, and once a diff has been integrated then it will be heading to production.
This is why Adama requires excellent unit test coverage, so every diff must have excellent code coverage.

## Open work via issues and the roadmap.

### Issues

TODO: create issue template

### Bugs

TODO: link to issues, policy around one bug and one issue, if fixing a bug then make sure there is an issue

## Proposals

## Development

### Your machine

TODO

### build.py

TODO

### Running locally

TODO

## Licensing

By contributing to Adama, you agree that your contributions will be licensed under its MIT license and copyright will be assigned to Jeffrey M. Barber.
The build.py script will apply the standard source header on all Java files.

### Contributor License Agreement (CLA)

Contributing to Adama requires you need to submit a CLA for any pull request to be accepted.

TODO: Link to a form for people to sign

repository: mathgladiator/adama-lang

gha_language: Java

repo_name: mathgladiator/adama-lang


text:
Do you hate pressing one one extra button to autofill information? Then we've got something for you.

### How to Use:

Once installed, you'll see a new icon in the upper right of your browser. Go to the news story you want to submit and click the new icon. A new Palace Beast submit page tab will open and autofill with the url, headline and image url.

Want to include some summary text too? Highlight the paragraphs you want to include first, then click the button. Anything you highlighted will be copied in to the summary field.

repository: machallboyd/bo-knows-submission

repo_name: machallboyd/bo-knows-submission


text:
# Thesis-Genetic-Algorithm
---

## Introduction:

The idea that some biological processes might operate on quantum mechanical laws has been
around for about a century. Recent studies in the past few decades have indicated a possible link between some biological
processes and Quantum Physics. Quantum mechanical processes are believed to be the
working force underlying some biological processes like Photosynthesis, charge transfer in DNA
and Cellular Respiration. The impressive navigational ability of the migratory birds like the
Robin are also shown to be derived from quantum mechanical processes undergoing in the
bird’s retina. Experiments with European Robins have showed that the navigational ability of the bird is
dependent on the local geomagnetic field. Avian magnetoreception is the ability of migratory birds to sense the geomagnetic field for navigation. This mechanism of sensing the geomagnetic field is called as the ‘Avian Compass’.

A bird’s retina is believed to contain photoreceptor pigments (like cryptochrome), aligned along the curvature of the retina, with
varying molecular axis directions. When light is incident on the retina, electron transfer takes
place between adjacent pigments in the retina. This polarization leads to the formation of
radical pairs (pair of charged molecules) with each molecule having an electron with unpaired
spin. Under the influence of the geomagnetic field, the spins undergo either singlet or triplet
transitions. The radical pairs formed are short-lived (lifetime of order of microseconds) and
recombine to form singlet chemical product and triplet chemical product based on their spin
states. The coherence time is estimated to be in the order of microseconds. The amount of the
chemical product formed varies along the curvature of the retina and is dependent on the
geomagnetic field and the molecular axis orientation. This information of the varying chemical
product in the bird’s retina is transferred to the bird’s brain and it processes the information to
correlate with the geomagnetic field. Thus, the profile of the local geomagnetic field is
transferred to the bird’s brain in the form of profile of varying amount of chemicals formed.
This process has a coherence time of the order of microseconds. This results in the bird getting
a sense of direction repeatedly.

A quantum mechanical model is proposed for this avian compass. The spin of the electron is coupled with the spin of its nucleus and the spin of the other
electron in the radical pair. A study has shown that the spin of one of the electrons in the
radical pair is effectively uncoupled from that of any other particle and is only dependent on
the geomagnetic field. The sensitivity of this avian compass is calculated as the difference of the singlet
product yield between the ends of the field of vision of the bird. The higher the sensitivity,
better is the navigational ability. This sensitivity is dependent on variables like the hyperfine
tensor, the recombination rate of radical pairs and the initial state of the system.
The Hamiltonian of this model assumes the hyperfine tensor components and other elements like the initial state of the spins and the recombination rate.
This project aims to optimize the sensitivity of this Avian compass with respect to the components of the hyperfine tensor by using Genetic algorithm.

Since the hyperfine tensor has 3 components, traditional optimization algorithms would be inefficient and may give the wrong answer. Genetic
algorithms are used for this purpose. They generate random solution space, calculate the
sensitivity for each one of the possible solutions, choose the most promising solutions as the
next solution space. This procedure is repeated as many times as required to reach a tentative
solution. Genetic algorithms imitate the nature’s process of evolution, by making constant
improvements over many generations. They may not provide the best possible solution, but
they provide many good solutions for the problem

---

## Genetic Algorithm:

Genetic algorithms are optimization algorithms used for optimizing functions with multiple
variables. They are different than traditional approach to optimization which involves varying
the value of the variables linearly, moving in one direction, generating data for the entire range
and then finding the global maximum (minimum). For functions having more than 2 variables, it
becomes a time consuming and computationally expensive task when using traditional
algorithms. Genetic algorithms work in a different manner by generating random sets of
possible solution values which span across the entire permitted range, and then moving
towards the more promising solutions and disregarding the solutions which are farther away
from the optimum value.

Genetic algorithms are inspired from the natural evolution process. In nature, in every
generation of a species, the part of the population with better survival traits have a higher
tendency to mate and higher chance of passing their traits to the next generation. Therefore,
every generation is on average better than the previous generation. Genetic algorithms use this
principle to move towards the optimum solution generation by generation. Genetic algorithms
do not necessarily always give the best possible solution, but they provide a small number of
good solutions.

The terminology used in genetic algorithms is explained below -

**Population**: The solution space at any given point of time

**Phenotype**: Population in real world solution space

**Genotype**: Population in computational space

**Chromosome**: An element of the population

**Gene**: An element position in the chromosome

**Allele**: Possible value a gene can take

**Generation**: each stage of population

**Fitness Function**: function to be optimized

![Genetic Algo flowchart](/flow.png)

---

### Encoding

The encoding of our current sensitivity optimization problem is as follows -

**Fitness function**: Sensitivity (Δs)
**Variables**: Components of the Hyperfine tensor (Ax, Ay, Az)
**Population**: Variable (usually taken 10^5)
**Phenotype**: Range of each variable is of the order of 10 5 to 10 8
**Genotype**: Binary representation of each variable
**Chromosome**: 30 bytes long character string (10 bytes for each variable)
**Allele**: Character ‘0’ or ‘1’

---

### Crossover Mutation

Crossover functions are analogous to mating in natural evolution. They allow chromosomes
with higher fitness function values to mate and produce children which have a higher chance of
giving a higher fitness value. Crossover takes place between two chromosome of the same
population. When the genotype is binary representation, there are multiple ways of
implementing the crossover function like,

- One-point crossover: The binary string is broken down at a fixed point and the one half
of a chromosome is swapped with the corresponding half portion of the second
chromosome.

- Two-point crossover: The binary string is divided at 2 points in the string and the
portions at the end are swapped with corresponding portions of the second string.

- Uniform crossover: Each child is formed gene by gene by taking the corresponding gene
from one of the parents. The probability for a particular gene to be taken from a parent
is 50%.

---

### Mutation Function

In natural evolution, mutation takes place with low probability in a generation. Its purpose is to
introduce diversity in the population with the hope of that diversity leading to a better breed
with higher survival chances. Mutation in genetic algorithms works in the same way and serves
the same purpose i.e. introducing diversity. The probability of mutation happening in a
generation is usually kept low at around 1-5% so as to not steer the population away from the
optimum solution’s path. When the genotype is binary, mutation can be implemented as-

- Bit flip operation: Randomly flip the bits of random chromosomes in a population
- Bit swap: Swap the bits on random positions in a chromosome

---

### Survival Selection

This step involves choosing the parts of the population to promote to the next generation and
the parts to discard entirely. This step has a major effect on the performance of the genetic
algorithm. Selection of chromosomes can be done in two ways: Age-based selection or Fitness-
based selection methods. In age-based selection method, the number of generations for which
a chromosome has been in the population is the deciding factor. If it is greater than a fixed
number, then it discarded. In fitness based selection, higher the fitness value higher is the
chance of being promoted to the next generation. Fitness based selection methods consist of
probabilistic methods like Roulette-wheel selection method or tournament selection method.

---

### Termination Condition

Termination condition can be when a fixed value of the objective is reached or a fixed number
of generations have passed or the current population size is lower than a certain number or
there is no or little improvement in the solutions generated over the past few generations

---

## Problem specific conditions

Choosing the appropriate function to use for crossover, mutation, survival selection, etc.
is all based on the specific details of the problem. There is a lot of flexibility in implementing the
functions mentioned above. The functions should be tailored to the problem. The more
problem-specific knowledge is fed into the algorithm, the better it performs and sooner it
converges to the optimum solution. Effective implementation of genetic algorithms is all about
balancing the diversity in the population with problem-specific knowledge. If the diversity is
kept low, the algorithm has a high chance of converging at the nearest local optimum.
Crossover and mutation help in maintaining diversity in the population.

For this particular problem of optimizing sensitivity, I am using two-point crossover
function applied for each variable individually. The mutation function is a bit flip function which
has a 5-10% probability of occurring in a generation. For the survival selection function, I tried
many methods like roulette wheel selection method and tournament selection method. The
lack of problem specific knowledge in this case, led to failure of these methods to converge at a
point. Therefore, I choose to select top 40% of the population with highest fitness value and
bottom 10% of the population (with lowest fitness value) for the next generation and discarded
the 50% of the population left. The bottom 10% was kept to maintain diversity. Thus, the
population is reduced to half its number after every generation. This led to a steady increase in
the average fitness value of each generation and the algorithm converged to a point. The
termination condition was kept at when the population size was reduced to less than 10.

---

## Implementation

The C++ library linear algebra ['Eigen'](http://eigen.tuxfamily.org/index.php?title=Main_Page) has been used for calculation of the eigenvalues and eigenvectors of the Hamiltonian. Eigen library is useful for performing large matrix operations.

The GCC compiler (version 4.4 or higher) is required for compilation. The command used for compilation is,

`g++ -std=c++11 main.cpp -o output_filename`

The results are stored in ‘output.txt’ in the same folder as the main.cpp file. To plot the
Sensitivity vs. Theta plot compile and run the ‘phi_vs_theta.cpp’ file in the same manner as
above. Enter the values of (Ax, Ay, Az) obtained in output.txt as input. The output of this
program is stored in ‘phiS.txt’.

‘gnuplot’ software has been used to plot all the graphs. The file ‘printGraphs.p’ has the code to
plot the two kind graphs. To plot the graphs, open gnuplot, navigate to the correct directory
and simply run the command,

`load ‘printGraphs.p’`

---

## Results

The following Fitness vs. Generation number plots for different values of K show the average
fitness moving towards the maximum fitness in each generation.
In more than 25 tests, the maximum fitness was reached was about ~ 5.6.

![K = 1.5e05](/K=1.5e05.png)

![K = 3.5e05](/K=3.5e05.png)

Multiple combination of values of (Ax, Ay, Az) give fitness in the range of 5.2-5.7. Some of them
are – (1.2e06, 1.2e06, 510000), (5.72e06, 5.72e06, 540000), (9.88e06, 9.88e06, 26000),
(10.04e06, 10.04e06, 26000), etc. The common pattern in all the solutions is that of,
(Ax=Ay >Az). This falls into the disk-shaped hyperfine parameter regime.

The following plots are for Singlet product yield vs. Theta. They show a steadily increasing
function for different values of K.

![PhiS K = 2e05](/PhiS_K=2e05.png)

![PhiS K = 3.5e05](/PhiS_K=3.5e05.png)

The values of the variables (Ax, Ay, Az) discovered for the maximum sensitivity help in describing the
characteristics of the nuclear part of the molecules which form radical pairs. Nature improves the
biological mechanisms generation after generation, by estimating the optimal sensitivity and hyperfine
parameters we get closer to the actual working of the avian compass. Also, research is ongoing to create
a geomagnetic sensor which can detect its location on Earth based on the local geomagnetic field using
similar mechanism. The optimized values calculated can be used for maximizing the sensitivity of the
artificial compass. Future scope of work includes the study of the effects of recombination rate and the
initial state on the sensitivity of the avian compass.

---


text:
# Noughts and crosses game

![](screenshot.png)

Command-line noughts and crosses game, written in Rust. Play by entering a board position (a1 - c3) and win by getting three in a row (horizontal, vertical or diagonal).

## Usage
- You will need [Rust and cargo installed](https://www.rust-lang.org/en-US/) (tested with v1.16)
- `cargo run`

## Overview
Based on Redux architecture - state is stored in the store (`store.rs`), and is immutable. Any changes are requested via a reducer method which returns a new version of the state in the store. For further details see Redux and [this great Rust tutorial](http://fredrik.anderzon.se/2016/05/10/rust-for-node-developers-part-1-introduction/).

repository: whostolemyhat/learning-projects

repo_name: whostolemyhat/learning-projects


text:
# Changelog

All notable changes to oneplace-event will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.7

### Added

### Changed

## [1.0.6] - 2021-04-01

### Added
- Calendars can now be removed
- Events can now be removed

### Changed
- Install Script Update

## [1.0.5] - 2021-03-30

### Added

- Calendar ICS Import
- Forms to manage existing Calendars

### Changed

- Removed all unnecessary Calendar Modal Form Fields to cleanup form
- prepared views for upcoming oneplace-core 1.0.34 card templates by [@praesidiarius](https://github.com/OnePlc/PLC_X_Core/issues/35)

### Fixed

- German Translation

## [1.0.4] - 2020-03-17

### Added

- Image Upload for Events

### Fixed

- Quicksearch now working
- Some Calendar Forms where still attached to events

## [1.0.3] - 2020-03-17

### Added

- New Field Types

### Changed

- Form Improvements


text:
# Releasing

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.

This document is licensed under [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).

When using the name 'version' we mean the versioning scheme described in [VERSIONING.md](VERSIONING.md)

## Introduction

This document is to describe the release pipeline, which is taking the result of the artifacts created according to [BUILDING.md](BUILDING.md) and publish a release to the various release targets for the project.

We propose:
 - a set of release targets that are allowable
 - a pipeline for handling the release folder's artifacts

It is NOT the purpose of this document to describe how a project might create a build, NOR is it describing a strcture in which projects MUST write build artifacts to. It is describing the structure of the releases themselves.

## Release Pipeline

### Create a build from current branch

Process is outlined in [BUILDING.md](BUILDING.md)

1. Clean the build directory
2. run: `bin/build.{target}.{ext}`

### Bump the version of the project

Projects SHOULD automated the version bump following [CONVENTIONAL_COMMITS.md](CONVENTIONAL_COMMITS.md).

### Generate Changelog

Projects SHOULD use generated changelogs from following [CONVENTIONAL_COMMITS.md](CONVENTIONAL_COMMITS.md).

### Commit the bump + changelog update

A project MUST generate a commit with the changes.

### Tag the commit with the bumped version

A project MUST be tagged with the semantic versioning scheme from [VERSIONING.md](VERSIONING.md).

### Sign the releases.

 - MUST be a pgp signature
 - MUST be the same pgp key as is registered with Github
 - MUST be a detached ascii-armored (.asc) signature
 - All files in the build folder MUST have an associated signature file

### Push changelog & version bump

### Run Release Targets

For each of the desired release targets, prepare and push the release.

#### Example Release Targets

1. Github
2. Docker Hub

## Resources

- [semantic-release](https://github.com/semantic-release/semantic-release)
- [Conventional Commits](https://conventionalcommits.org/

repository: open-rpc/spec

repo_name: open-rpc/spec


text:
---
layout: post
title:  "Node tools appendix"
date:   2021-04-24 18:45:40 -0500
categories: software reference
author: Ali Abid

---

npm is like a grocery store, for javascript libraries, but you can find older versions of cereal boxes
<!-- excerpt-end -->

npm in the linux context is a package manager for the JavaScript programming language.  It is accessed via the the aptly named command "npm".

npx is  another tool/binary that lets you run code built with Node.js that has been published through the npm registry.  it

nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.

nvm is a version manager for node.js - in case there was a need to manage multiple node.js versions on a single OS, this being especially useful when a local environment's node.js version differs from what is supplied in a managed(read: cloud) environment.

gha_language: SCSS