text:
# Image-Classifier-Project
## AI Programming with Python Nanodegree-Udacity

## Project: Create an Image Classifier
### Description
Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smartphone app.
To do this, you'd use a deep learning model trained on hundreds of thousands of images as part of the overall application architecture.
A large part of software development in the future will be using these types of models as common parts of applications.
In this project, you'll train an image classifier to recognize different species of flowers. You can imagine using something like this in a phone app that tells you the name of the
flower your camera is looking at. In practice, you'd train this classifier, then export it for use in your application. We'll be using this dataset of 102 flower categories.
When you've completed this project, you'll have an application that can be trained on any set of labelled images. Here your network will be learning about flowers and end up
as a command line application. But, what you do with your new skills depends on your imagination and effort in building a dataset.

### Part 1 - Developing an Image Classifier with Deep Learning
In this first part of the project, I implemened an image classifier with PyTorch.

### Part 2 - Building the command line application
Build a pair of Python scripts that run from the command line to train an image classifier and to predict new images using the trained model.

### Installations
This project requires Python 3.x and the following Python libraries installed:

* Argparse
* Numpy
* Pytorch
* Json
* Pillow
* Seaborn
* Matplotlib

### Files Descriptions
* Image Classifier Project.html:A html version of the project file
* Image Classifier Project.ipynb: A Jupyter notebook contains code to implement an image classifier with PyTorch.
* train.py: Code to train a new deep learning network on a dataset and save the model as a checkpoint.
* predict.py: Code uses a trained network to predict the class for an input image.
* functions_classes.py: Code for functions and classes relating to the model
* functions_utilities: Code for utility functions like loading data and preprocessing images
* Image Classifier Project.ipnb: Instance of the entire code run on a jupyter notebook
* predict_proof.png: Image depicting the accuracy of the model when run from terminal
* screenshot_training_completion.png: Image depicting the completion of the training over the epochs and the corresponding validation and train losses
* cat_to_name.json: File having a dictionary of the numbers mapped to the name of flowers (should be placed in the main directory itself)
* workspace-utils.py: File used to continue running the jupyter notebook for a considerably long time

### Data
You can download the data used in this project from [here](http://www.robots.ox.ac.uk/~vgg/data/flowers/102/index.html).
Save the data in a directory named data_dir='flowers'
                                   train_dir = data_dir + '/train'
                                   valid_dir = data_dir + '/valid'
                                   test_dir = data_dir + '/test'

Running codes
To train a new network on a data set with train.py:

Basic usage: python train.py data_directory
### Options:
* Set directory to save checkpoints: python train.py data_dir --save_dir save_directory
* Choose architecture: python train.py data_dir --arch "vgg13"
* Set hyperparameters: python train.py data_dir --learning_rate 0.01 --hidden_units 512 --epochs 20
* Use GPU for training: python train.py data_dir --gpu
* To predict flower name from an image with predict.py:

Basic usage: python predict.py /path/to/image checkpoint
### Options:
Return top K most likely classes: python predict.py input checkpoint --top_k 3
Use a mapping of categories to real names: python predict.py input checkpoint --category_names cat_to_name.json
Use GPU for inference: python predict.py input checkpoint --gpu

### Running the Code:
Directly open the Image Classifier Project.ipynb and run the cells and follow along

### Author:
Jash Jain [linkedin](https://www.linkedin.com/in/jash-jain-bb659a132)

### License
This project is licensed under the MIT License - see the LICENSE.md file for details.


text:
[![Netlify Status](https://api.netlify.com/api/v1/badges/b4aa4a04-e097-4067-87ec-9a6681335673/deploy-status)](https://app.netlify.com/sites/svelte-tailwindcss-storybook/deploys) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind?ref=badge_shield)

# A starter template for Svelte, TailwindCSS and Storybook

![Svelte + TailwindCSS + Storybook Starter Template](starter-template.jpg)

> Visit this website to see the outcome: [Svelte + TailwindCSS + Storybook](https://svelte-tailwindcss-storybook.netlify.com)

```bash
// Quickstart

npx degit jerriclynsjohn/svelte-storybook-tailwind my-svelte-project
cd my-svelte-project

yarn
yarn dev
yarn stories
```

Svelte and TailwindCSS is an awesome combination for Frontend development, but sometimes the setup seems a bit non intuitive, especially when trying to try out this awesome combination. When integrating Storybook, which is another awesome tool for UI Component development and documentation, there is no obvious place to get how it's done. This repo was made to address just that!

> You can easily start your project with this template, instead of wasting time figuring out configurations for each integration.

## What do you get in this repo

![Storybook UI](Storybook-alert-modern.PNG)

1. A fully functional Svelte + TailwindCSS integration with side-by-side implementation of independent Storybook
2. Storybook with 5 essential Addons
3. Storybook populated with basic examples of Svelte + TailwindCSS

### Addons

- Accessibility Addon

![Accessibility Addon](storybook-accessibility-addon.PNG)

- Accessibility Addon - Colorblindness Emulation

![Accessibility Addon - Colorblindness Emulation](storybook-accessibility-addon-colorblindness-emulation.PNG)

- Actions Addon

![Actions Addon](storybook-actions-addon.PNG)

- Notes Addon

![Notes Addon](storybook-Documentation-Component.PNG)

- Source Addon

![Source Addon](storybook-storycode-addon.PNG)

- Viewport Addon

![Source Addon](storybook-viewport-addon.PNG)

## Svelte + TailwindCSS + Storybook

[Storybook](https://storybook.js.org/) is an open source tool for developing JavaScript UI
components in isolation

[Svelte](https://svelte.dev/) is a component framework that allows you to write highly-efficient,
imperative code, that surgically updates the DOM to maintain performance.

[TailwindCSS](https://tailwindcss.com) is a highly customizable, low-level CSS framework that gives
you all of the building blocks you need to build bespoke designs without any annoying opinionated
styles you have to fight to override.

## Steps to build

1. Clone this repo `git clone https://github.com/jerriclynsjohn/svelte-storybook-tailwind.git`
2. Go to the directory `cd svelte-storybook-tailwind`
3. Install dependencies `yarn`
4. To develop your Svelte App: `yarn dev`
5. To develop UI components independent of your app: `yarn stories`

### Documentations

1. Svelte - [API](https://svelte.dev/docs) and [Tutorial](https://svelte.dev/tutorial/)
2. TailwindCSS - [Docs](https://tailwindcss.com/docs) and [Tutorial](https://tailwindcss.com/screencasts/)
3. Storybook - [Docs](https://storybook.js.org/docs/basics/introduction/) and [Tutorial](https://www.learnstorybook.com/intro-to-storybook/svelte/en/get-started/)

## Steps to build it all by yourself and some tips [Warning: It's lengthy]

### Instantiate Svelte App

- Start the template file using `npx degit sveltejs/template svelte-storybook-tailwind`
- Go to the directory `cd svelte-storybook-tailwind`
- Install dependencies `yarn`
- Try run the svelte app `yarn dev`

### Add Tailwind into the project

- Install dependencies:
   `yarn add -D tailwindcss @fullhuman/postcss-purgecss autoprefixer postcss  postcss-import svelte-preprocess`
- Change the rollup config as shown:

```javascript
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import postcss from 'rollup-plugin-postcss';
import autoPreprocess from 'svelte-preprocess';

const production = !process.env.ROLLUP_WATCH;

export default {
    input: 'src/main.js',
    output: {
        sourcemap: true,
        format: 'iife',
        name: 'app',
        file: 'public/bundle.js',
    },
    plugins: [
        svelte({
            preprocess: autoPreprocess({
                postcss: true,
            }),
            // enable run-time checks when not in production
            dev: !production,
            // we'll extract any component CSS out into
            // a separate file — better for performance
            css: css => {
                css.write('public/bundle.css');
            },
        }),
        postcss({
            extract: 'public/utils.css',
        }),

        // If you have external dependencies installed from
        // npm, you'll most likely need these plugins. In
        // some cases you'll need additional configuration —
        // consult the documentation for details:
        // https://github.com/rollup/rollup-plugin-commonjs
        resolve({
            browser: true,
            dedupe: importee => importee === 'svelte' || importee.startsWith('svelte/'),
        }),
        commonjs(),

        // Watch the `public` directory and refresh the
        // browser on changes when not in production
        !production && livereload('public'),

        // If we're building for production (npm run build
        // instead of npm run dev), minify
        production && terser(),
    ],
    watch: {
        clearScreen: false,
    },
};
```

- Add tailwind config using the command `npx tailwind init`

- Add PostCSS config `./postcss.config.js` as follows:

```javascript
const production = !process.env.ROLLUP_WATCH;
const purgecss = require('@fullhuman/postcss-purgecss');

module.exports = {
    plugins: [
        require('postcss-import')(),
        require('tailwindcss'),
        require('autoprefixer'),
        production &&
            purgecss({
                content: ['./**/*.html', './**/*.svelte'],
                defaultExtractor: content => {
                    const regExp = new RegExp(/[A-Za-z0-9-_:/]+/g);

                    const matchedTokens = [];

                    let match = regExp.exec(content);
                    // To make sure that you do not lose any tailwind classes used in class directive.
                    // https://github.com/tailwindcss/discuss/issues/254#issuecomment-517918397
                    while (match) {
                        if (match[0].startsWith('class:')) {
                            matchedTokens.push(match[0].substring(6));
                        } else {
                            matchedTokens.push(match[0]);
                        }

                        match = regExp.exec(content);
                    }

                    return matchedTokens;
                },
            }),
    ],
};
```

- Build the project with some TailwindCSS utilities `yarn dev`

### Add Storybook into the Svelte Project

- Add Storybook dependencies `yarn add -D @storybook/svelte`
- Add 5 commonly used Storybook [Addons](https://storybook.js.org/addons/):

  - [Source](https://github.com/storybookjs/storybook/tree/master/addons/storysource):
      `yarn add -D @storybook/addon-storysource`
  - [Actions](https://github.com/storybookjs/storybook/tree/master/addons/actions):
      `yarn add -D @storybook/addon-actions`
  - [Notes](https://github.com/storybookjs/storybook/tree/master/addons/notes):
      `yarn add -D @storybook/addon-notes`
  - [Viewport](https://github.com/storybookjs/storybook/tree/master/addons/viewport):
      `yarn add -D @storybook/addon-viewport`
  - [Accessibility](https://github.com/storybookjs/storybook/tree/master/addons/a11y):
      `yarn add @storybook/addon-a11y --dev`
- Create an addon file at the root `.storybook/addons.js` with the following content and keep
   adding additional addons in this file.

```javascript
import '@storybook/addon-storysource/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-notes/register';
import '@storybook/addon-viewport/register';
import '@storybook/addon-a11y/register';
```

- Create a config file at the root `.storybook/config.js` with the following content:

```javascript
import { configure, addParameters, addDecorator } from '@storybook/svelte';
import { withA11y } from '@storybook/addon-a11y';

// automatically import all files ending in *.stories.js
const req = require.context('../storybook/stories', true, /\.stories\.js$/);
function loadStories() {
    req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
addDecorator(withA11y);
addParameters({ viewport: { viewports: newViewports } });
```

- Add tailwind configs in the `webpack.config.js` under `.storybook` and also accommodate for Source addon:

```javascript
const path = require('path');

module.exports = ({ config, mode }) => {
    config.module.rules.push(
        {
            test: /\.css$/,
            loaders: [
                {
                    loader: 'postcss-loader',
                    options: {
                        sourceMap: true,
                        config: {
                            path: './.storybook/',
                        },
                    },
                },
            ],

            include: path.resolve(__dirname, '../storybook/'),
        },
        //This is the new block for the addon
        {
            test: /\.stories\.js?$/,
            loaders: [require.resolve('@storybook/addon-storysource/loader')],
            include: [path.resolve(__dirname, '../storybook')],
            enforce: 'pre',
        },
    );

    return config;
};
```

- Create the `postcss.config.js` under `.storybook`:

```javascript
var tailwindcss = require('tailwindcss');

module.exports = {
    plugins: [
        require('postcss-import')(),
        tailwindcss('./tailwind.config.js'),
        require('autoprefixer'),
    ],
};
```

- Make sure you have babel and svelte-loader dependencies
   `yarn add -D babel-loader @babel/core svelte-loader`
- Add npm script in your `package.json`

```bash
{
    "scripts": {
        // Rest of the scripts
        "stories": "start-storybook",
        "build-stories": "build-storybook"
    }
}
```

- Add a utils.css file under `storybook/css/` and make sure you `import 'utils.css'` in your
   `stories.js` files:

```css
/* Import Tailwind as Global Utils */

@import 'tailwindcss/base';

@import 'tailwindcss/components';

@import 'tailwindcss/utilities';
```

- Write your Svelte component in `storybook\components` and yes you can use your regular `.svelte`
   file. The only thing is that you cant use templates in a story yet, not supported, but yes you
   can compose other components together. For the starter pack lets just create a clickable button.

```html
<script>
    import { createEventDispatcher } from 'svelte';
    export let text = '';
    const dispatch = createEventDispatcher();
    function onClick(event) {
      dispatch('click', event);
    }
</script>

<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
        on:click={onClick}>
  {text}
</button>
```

- Write your stories in `storybook/stories` and you can name any number of story file with
   `<anything>.stories.js`, for the starter package we can create stories of `Button` with the
   readme notes at `<anything>.stories.md`. Note: reference the css here to make sure that tailwind
   is called by postcss:

```javascript
import '../../css/utils.css';

import { storiesOf } from '@storybook/svelte';
import ButtonSimple from '../../components/buttons/button-simple.svelte';
import markdownNotes from './buttons.stories.md';

storiesOf('Buttons | Buttons', module)
    //Simple Button
    .add(
        'Simple',
        () => ({
            Component: ButtonSimple,
            props: { text: 'Button' },
            on: {
                click: action('I am logging in the actions tab too'),
            },
        }),
        { notes: { markdown: markdownNotes } },
    )
```

- Write your own Documentation for the Component which will `<anything>.stories.md` :

```md
# Buttons

_Examples of building buttons with Tailwind CSS._

---

Tailwind doesn't include pre-designed button styles out of the box, but they're easy to build using
existing utilities.

Here are a few examples to help you get an idea of how to build components like this using Tailwind.
```

- Run your storyboard `yarn stories` and you'll see this:

![Storybook UI](storybook-ui.PNG)

You can add more addons and play around with them.

That's a wrap!

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind?ref=badge_large)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# FOA_SP_RPRG_ALM_Clustering
A  subspace pursuit method based on Fast Optimization Algorithm for clustering

MATLAB implementations of low-rank representation

## Citing

Cite "Fast optimization algorithm on Riemannian manifolds and Its application in low-rank Learning" by Haoran Chen, Yanfeng Sun, Junbin Gao and Yongli Hu.

Please lso provide a direct link to this webpage somewhere in your paper (https://github.com/Haoran2014/https://github.com/Haoran2014/FOA_SP_RPRG_ALM_Clustering/)

@ARTICLE{ChenSunGaoHu2015,
author = {H. Chen and Y. Sun and J. Gao and Y. Hu},
title = {Fast optimization algorithm on Riemannian manifolds and Its application in low-rank Learning},
journal = {arXiv preprint arXiv:1512.01927},
year = {2015},
}

## Acknowledgement

 The research project is supported by the Australian Research Council (ARC) through the grant DP140102270 and also partially supported by National Natural Science Foundation of China under Grant No. 61390510, 61133003, 61370119, 61171169 and 61227004.

## Included Libraries

- [Manopt_1.0.7][1]
- [NCut][2]

[1]: http://www.manopt.org
[2]: http://www.cis.upenn.edu/~jshi/software/


text:
<!---
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->
# PHOENIX  queryserver-6.0.0 Release Notes

These release notes cover new developer and user-facing incompatibilities, important issues, features, and major improvements.

---

* [PHOENIX-6488](https://issues.apache.org/jira/browse/PHOENIX-6488) | *Major* | **Bump Avatica version to 1.18.0 in queryserver**

Avatica version  has been update to 1.18.0

---

* [PHOENIX-6473](https://issues.apache.org/jira/browse/PHOENIX-6473) | *Major* | **Add Hadoop JMXServlet as /jmx endpoint**

New HTTP endpoint is available at \<pqs\_url\>/jmx to expose all read-only JMX values in JSON format.

---

* [PHOENIX-5446](https://issues.apache.org/jira/browse/PHOENIX-5446) | *Major* | **Support Protobuf shaded clients (thin + thick)**

**WARNING: No release note provided for this change.**

---

* [PHOENIX-5772](https://issues.apache.org/jira/browse/PHOENIX-5772) | *Major* | **Streamline the kerberos logic in thin client java code**

The java thin client library has been refactored. It no longer includes Hadoop libraries, and uses the Java SE Kerberos implementation directly.

The sqlline library has also been removed from the thin client JAR.

The standalone sqlline JAR is now included in the lib/ directory, and is now added to the classpath by the sqlline-thin.py script.

Some default parameters that were picked up from hbase-site.xml by the java thin client are now also handled by sqlline-thin.py

repository: apache/phoenix-queryserver

gha_language: Python

repo_name: apache/phoenix-queryserver


text:
---
layout: ontology_detail
id: hao
contact:
  email<EMAIL_ADDRESS>  label: Matt Yoder
tracker: https://github.com/hymao/hao/issues
license:
  url: https://creativecommons.org/publicdomain/zero/1.0/
  label: CC-0
description: A structured controlled vocabulary of the anatomy of the Hymenoptera (bees, wasps, and ants)
domain: anatomy
homepage: http://hymao.org
products:
  - id: hao.owl
  - id: hao.obo
  - id: hao/depictions.owl
taxon:
  id: NCBITaxon:7399
  label: Hymenoptera
title: Hymenoptera Anatomy Ontology
build:
  checkout: git clone https://github.com/hymao/hao.git
  system: git
activity_status: active
---

A structured controlled vocabulary of the anatomy of the Hymenoptera (bees, wasps, and ants)

gha_license_id: NOASSERTION


text:
# Docker Friendly

_Cloister_ is being developed with the drop-in support of [_Docker_](https://www.docker.com/). Distributed _Erlang_ is a charm to work with unless your _DevOps_ team is engaged in containerizing the whole universe. They usually have many cryptic arguments full of words you as an old-school software engineer would barely understand, and sooner or later you are faced with a fact that now we run everything in a dockerized environment, which means no one can guarantee your application has an IP/DNS, or would not have automatically restarted depending on the current moon phase.

I am exaggerating a bit, but this is it: you cannot prepare the release hardcoding longnames in `vm.args` and/or `env.sh` anymore. You should be ready to handle spontaneous restarts of containers (and therefore your _ErlangVM_ instances) gracefully. And you are probably still in a need to test it locally, as well as in containerized environment.

That is where `cloister` might step into to help. It takes care about the cluster handling, based on either the list of node names (IP/DNS, old school,) or a service name exposed by docker. It uses [`Application.start_phase/3`](https://hexdocs.pm/elixir/Application.html?#c:start_phase/3) to ensure the cluster is started _before_ letting the boot process to continue. It also provides a callback when the topology of the cluster changes (new node added, node shut down, etc.)

## Dev Environment, no Docker

All one needs to start playing with `cloister` is to add a dependency to `mix.exs` file and put some config:

```elixir
config :cloister,
  otp_app: :cloister_test,
  sentry<EMAIL_ADDRESS><EMAIL_ADDRESS>  consensus: 1
```

That config would instruct _Cloister_ to use `:cloister_test` as the main _OTP_ app _and_ the name of the [`HashRing`](https://github.com/bitwalker/libring) behind. It would expect nodes<EMAIL_ADDRESS>and<EMAIL_ADDRESS>to exist and it’ll try to connect to them, but as soon as it sees itself, and `consensus` parameter is set to `1`, it won’t worry about others and report the successful cluster assembly.

![:nonode@nohost startup](assets/cloister-nonode-startup.png)

---

## Test Environment, no Docker

To test the distributed environment outside of _Docker_, one might use [`test_cluster_task`](https://github.com/am-kantox/test_cluster_task) package that effectively starts the distributed environment before running tests. To use it, simply add `{:test_cluster_task, "~> 0.3"}` to the dependencies list of your application and use `mix test.cluster` _or_ set the alias in `mix.exs` project:

```elixir
def project do
  [
    ...,
    aliases: [test: ["test.cluster"]]
  ]
end
```

<EMAIL_ADDRESS>startup](assets/cloister-test-startup.png)

---

## Releases for Docker Environment

OK, now it’s time to add _Docker_ to the equation. _Cloister_ is smart enough to distinguish the list of node vs. the service name when passed to `:sentry` config option. When it’s an atom, _Cloister_ will shut down the `:net_kernel` application and restart it in distributed mode. For that to work, one must explicitly specify `export RELEASE_DISTRIBUTION=none` in `rel/env.sh.eex` file for releases.

Our config would now look like:

```elixir
config :cloister,
  otp_app: :cloister_test,
  sentry: :"cloister_test.local",
  consensus: 3
```

Here, `:"cloister_test.local"` is the name of service to be used for nodes discovery _and_ at least three nodes up would be expected for it to pass the _warming_ phase. The application startup chain would be blocked until at least three nodes are up and connected.

We would also need a `Dockerfile` which is the typical one, built from `elixir:$ELIXIR_VERSION` and with `epmd -d` _explicitly started_ before the application itself. Also we’d need `docker-compose.yml`, declaring the service like below.

```yaml
version: '3.1'

services:
  cloister_test:
    build: .
    networks:
      local:
        aliases:
          - cloister_test.local
    environment:
      - CLOISTER_TEST_CLUSTER_ADDRESS=cloister_test.local

networks:
  local:
    driver: bridge
```

Once done, one might build the composed image and start it with three instances of the application:

```sh
docker-compose build
docker-compose up --scale cloister_test=3 --remove-orphans
```

After some debug info, it’d spit out:

<EMAIL_ADDRESS>startup](assets/cloister-docker-startup.png)

All three instances are up and connected, ready to perform their work.

---

## Tips and Tweaks

_Cloister_ relies mainly on configuration because it’s started as a separate application _before_ the main _OTP_ application that uses it and relies on startup phases to block until the consensus is reached. For the very fine tuning, one might put `:cloister` into `:included_applications` _and_ embed `Cloister.Manager` manually into the supervision tree. See `Cloister.Application.start_phase/3` for the inspiration on how to wait till consensus is reached.

Also, one might start and manage `HashRing` on their own by setting `:ring` option in `config`. _Cloister_ would expect the ring to be started and handled by the consumer application.

The whole configuration is described on [_Configuration_](configuration.html) page.

repository: am-kantox/cloister

gha_language: Elixir

gha_license_id: MIT

repo_name: am-kantox/cloister


text:
# Garage Management system

A garage system where one can log in choose the garage branch (location), choose services, duration and the system will prompt customer when the service is over. System will also prompt customer when the service has started to be offered.

## Demo
Here is a working live demo :  ####

## Mobile support
The Garage-system-group is compatible with devices of all sizes and all OS's, and consistent improvements are being made.

## [Usage](####)
### Development

Want to contribute? Awesome!
To fix a bug or enhance an existing module, follow these steps:
- Fork the repo
- Create a new branch (`git checkout -b improve-feature`)
- Make the appropriate changes in the files
- Add changes to reflect the changes made
- Commit your changes (`git commit -am 'Improve feature'`)
- Push to the branch (`git push origin improve-feature`)
- Create a Pull Request

## Built with

- [HTML](https://www.w3schools.com/html/) - HTML tutorial.
- [CSS](https://www.w3schools.com/css/) - css tutorial.
- [Javascript](https://www.w3schools.com/js/) - javascrit tutorial.

## Author
- Medad Orowe
- Duncan Njoroge

## License
[MIT](https://github.com/medad8/Garage-ms/blob/master/LICENSE.md)

 © [Medad Orowe](https://github.com/medad8)

gha_language: HTML


text:
# Hello World

{% hint style="success" %}
**Note**: The final code for this example can be found on Github: [hello-world](https://github.com/wasmerio/docs.wasmer.io/tree/master/integrations/js/wasi/browser/examples/hello-world).
{% endhint %}

In this introductory example, we will develop a Browser-based application that uses the following call chain.

`JavaScript` --> `WebAssembly` --> `Native "OS" function`

In this case, we will invoke the a simple WASI module that does nothing more than writing `hello world` to standard out.

{% hint style="info" %}
#### Under the Hood

The Wasm module calls the native "OS" function `fd_write` that writes data to a particular file descriptor \(hence `fd` in the function name\)
{% endhint %}

However, interaction with file descriptors such as "standard in" and "standard out" is not normally possible for a WebAssembly module, since this type of functionality belongs to the underlying "OS". Therefore, we must make use of the following two packages:

| Package Name | Description |
| :--- | :--- |
| `@wasmer/wasi` | A set of JavaScript polyfills to bridge the gap between the black-box world of a WebAssembly module and functionality available in the host environment |
| `@wasmer/wasmfs` | Provide access to a sand-boxed filesystem with which `@wasmer/wasi` can interact |

{% hint style="warning" %}
#### Reminder

The term "OS" used above is in quotes because in this particular case, the native function called by our WebAssembly module that writes to standard out, belongs to the JavaScript runtime, and not the actual underlying operating system.
{% endhint %}

This example will be bundled and served by [Parcel](https://parceljs.org/) and run in the browser.

## Setup Instructions

### Prerequisites

Make sure [Parcel](https://parceljs.org/) has been installed and is available from the command line

```bash
$ npm install -g parcel
```

> #### Mac users
>
> Before the installation of Parcel will work on a Mac, you must first install the [Xcode Command Line Tools](https://developer.apple.com/download/more/?=for%20Xcode)

### Step-By-Step Guide

1. Change into some development directory

   ```bash
    $ cd <some_development_directory>
   ```

2. Create and then change into a new project directory, then run `npm init`

   ```bash
    $ mkdir wasmer-js-hello-world
    $ cd wasmer-js-hello-word
    $ npm init
   ```

   After answering all the questions from `npm init`, you will have a configured `package.json` file.

3. For the purposes of testing, we need to install both the `parcel-bundler` and `parcel-plugin-static-files-copy` packages.

   These packages allow `parcel` to serve our Wasm files as static assets:

   ```bash
    npm install --save-dev parcel-bundler parcel-plugin-static-files-copy
   ```

   This command both installs the required packages and updates the `devDependencies` section of your `package.json` file.

4. Create a bare-bones `index.html` file that contains nothing more than the request to load the JavaScript file `index.js`:

   ```markup
    <html>
    <body>
      <script src="./index.js"></script>
    </body>
    </html>
   ```

5. Create the file `index.js` and add the following single line of code:

   ```javascript
    console.log('I am working')
   ```

6. Let's test that the basic file structure of our project is correct:

   ```bash
    $ parcel index.html
    Server running at http://localhost:1234
    ✨  Built in 1.15s.
   ```

   Point your browser to [`http://localhost:1234`](http://localhost:1234) and you should see a blank page.

   Open your browser's Developer Tools and look at the JavaScript console. Here, you should see `"I am working"`, which means everything is working!

7. Now that the basic file structure of our project has been set up correctly, we must next declare the use of packages `@wasmer/wasi` and `@wasmer/wasmfs`.

   To install these packages as runtime dependencies to our project, run the following command:

   ```bash
   $ npm install --save @wasmer/wasi @wasmer/wasmfs
   ```

8. Create a new directory called `static`

   ```bash
    $ mkdir static
   ```

9. Download the WebAssembly module [`helloworld.wasm`](https://github.com/wasmerio/docs.wasmer.io/raw/master/integrations/shared/wat/wasi/helloworld.wasm) and store it in this directory
10. Now we need to change the contents of `index.js` to implement the required functionality.

    > #### Code Sample
    >
    > Seeing as this is demo code, it uses meaningful variable names and contains additional explanatory comments — features that are often sadly missing from production code...
    >
    > Please take some time to read and understand these comments as they explain how the functionality has been constructed.
    >
    > Also, please read the comment explaining the use of `@wasmer/wasm-transformer`; we will cover this very important detail in a later example.

    ```javascript
    import { WASI } from '@wasmer/wasi'
    import browserBindings from '@wasmer/wasi/lib/bindings/browser'
    import { WasmFs } from '@wasmer/wasmfs'

    const wasmFilePath = '/helloworld.wasm'  // Path to our WASI module
    const echoStr      = 'Hello World!'    // Text string to echo

    // Instantiate new WASI and WasmFs Instances
    // IMPORTANT:
    // Instantiating WasmFs is only needed when running in a browser.
       As long as `parcel` is still running, after saving `index.js`, your browser should automatically refresh and you should see `Standard Output: Hello World!` appear both on the browser screen and in the JavaScript console.

{% hint style="info" %}
If you want to run the examples from the docs codebase directly, you can also do:

```bash
git clone https://github.com/wasmerio/docs.wasmer.io.git
cd docs.wasmer.io/integrations/js/wasi/browser/examples/hello-world
npm run dev
```
{% endhint %}

Next, let's take a look at transforming WASI modules that require transformations.


text:
# Redux Example

| HTML File | Description |
| ---- | ---- |
| [Redux store from scratch](index-native.html) | Redux store from scratch |
| [Redux store with library](index-redux.html) | Redux library |
| [index-react.html](index-react.html) | Redux with React UI |
| [index-async.html](index-async.html) | Redux with external data |
| [index-context.html](index-context.html) | Redux with React Context |
| [index-react-redux.html](index-react-redux.html) | React Redux library |

repository: VikramRaghava/react-nd

repo_name: VikramRaghava/react-nd


text:
Please remember the / Bitte beachte die [Contribution Guidelines](https://github.com/FUB-HCC/20-SWP-CodingOpenness/blob/master/CONTRIBUTION.md) :heart:

## What does this PR do?

-

<!-- Concise description of what this PR achieves, including any context. -->

## Recommendations for testing

<!-- Tips for testing this PR, or anything you want to bring special attention to. -->

## Links to relevant issues or information

Closes

<!-- Link to relevant issues, comments, etc. -->


text:
---
name: 💥 Proposal
about: Propose a non-trivial change
labels: 'proposal, needs triage'
---

## 💥 Proposal

(A clear and concise description of what the proposal is.)

### Have you read the [Contributing Guidelines on issues](https://github.com/i18n-components/i18n-components/blob/main/CONTRIBUTING.md#reporting-new-issues)?

(Write your answer here.)

branch_name: refs/heads/main

gha_language: TypeScript


text:
# Review Wiki

Wiki service in Go from [https://golang.org/doc/articles/wiki/](https://golang.org/doc/articles/wiki/), aims to be review service.

```
$curl localhost:8080
Hi there, I love !

$curl localhost:8080/something
Hi there, I love something!
```

### GET /view/{title}/

Try open up from *browser*.

Renders an article with the title and contents. 302 if none exists. Reads from a file on local named {title}.txt

### GET /edit/{title}/

Try open up from *browser*.

Renders an article in edit mode. Create if none exists.

### GET /save/{title}/

Try open up from *browser*.

Saves an article.

repository: Junyong-Suh/review-wiki-go

gha_language: Go

repo_name: Junyong-Suh/review-wiki-go


text:
---
title: "Now"
date: "2020-11-25"
---

# What I'm doing now.

(This is a [nowpage](https://nownownow.com/about), copied from [Derek Sivers](https://sive.rs/now))

## Life

I'm still living in Detroit. Elizabeth and I ~~are expecting around Christmas time :) ~~ just gave birth to a baby girl on December 30th, 2020.

## Career

I'm coding, studying, every day. I have several interviews lined up with big tech companies. I'll need to keep grinding Leetcode. I'll take a couple months off for Parternity, but looking to start a new role around March '21.

I'm also starting taking core CS courses at the local college. I'm completing CS2 and Data Structures this semester.

## Projects

The foreseable future will be videography (for family) and my real state saas app. I'll vlog and document my process. The [InkDrop App developer Takuya](https://blog.inkdrop.info/how-ive-attracted-the-first-500-paid-users-for-my-saas-that-costs-5-mo-7a5b94b8e820) is a big inspiration in aesthetics and product philosophy.

repository: ralphplumley/rp-gatsby-site

repo_name: ralphplumley/rp-gatsby-site


text:
# Kubernetes Chart and Manifests

The chart files and kubernetes manifests are generated from the templates present in `/kubernetes/templates/chart/`.

Any required changes should be made in the templates and not in these files.

repository: stakater/GitWebhookProxy

repo_name: stakater/GitWebhookProxy


text:
# apache-git-http-backend

The apache-git-http-backend docker image serves as receiver in git replication
from a Gerrit to a Gerrit replica.

## Content

* base image
* Apache webserver
* Apache configurations for http
* git (via base image) and git-deamon for git-http-backend
* `tools/create_repo.sh`: cgi script to enable remote creation of new git
 repository over http.
* `tools/start`: start script, configures and starts Apache
 webserver

## Setup and Configuration

* install Apache webserver, additional Apache tools and git daemon
* configure Apache
* install cgi script
* map volumes

## Start

* start Apache git-http backend via start script `/var/tools/start`


text:
# Electrodynamic Simulations of an Ensemble of Charged Particles

This is a script written in [Julia](https://github.com/JuliaLang/julia) for simulating an ensemble of charged particles using manifest covariant equations of motion.

## Physical Parameters

At the moment the simulation does not take into account electromagnetic field emissions due to charge change in velocity.

To set the physical paramters, please manually modify the following codeblock found in [electrodynamic-sims.jl](https://github.com/toma-vlad/electrodynamic-simulations/blob/main/electrodynamic-sims.jl).

```julia
const N = 25_000 # number of particles, for each ring, 4N for radius averaging
const c = 137.036 # speed of light
const ω = 0.057; const T₀ = 2π/ω # angular frequency, period
const k = ω*c # wavevector
const λ = c*T₀ # wavelength
const w₀ = 75 * λ # is the waist radius
const a₀ = 2.; const AA = a₀*c # (qA₀)/(mc) = a₀
const w = 10.; const τ = w/ω; # temporal pulse decay time given in terms of number of oscilations and frequency
const n = 5 # number of periods to integrate before and after pulse collides with particles
const π₀ = a₀*c # in atomic units, a₀mc has units of linear momentum and sets the scale for linear momentum transfered to the particle, not that m = 1 for our particles
const maxR = 3w₀ # maximum radius for distributing praticles
```
The fields are provided by [LaserTypes.jl](https://github.com/SebastianM-C/LaserTypes.jl), using analytical formulas and returned as the Faraday tensor .

## Integrating the Equations of Motion
The script loops over all provided laser configurations. For each type, using tabulated minima (or a decay of at least 1/100 from peak), initial conditions overlaying regions of interests will be generated.

In the figure below, the intensity of a Laguerre-Gauss mode with right-handed transverse circular polarization, radial number `p = 2` and `m = -1` is shown

Given this field pattern, the zone of interest are the 3 high intensity rings. For each zone `N` initial conditions will be generated.
```julia
R0 = [UniformAnnulus(w₀*p.roots[j], w₀*p.roots[j+1])[1] for i in 1:N]
```
All particles start with `z = 0` i.e., in a XY-plane circle, around the origin.

Next we integrate the equations of motion using  [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), namely

```julia
M = solve(eprob, Vern9(), EnsembleThreads(), abstol=1e-9, reltol=1e-9,
    saveat = (τf-τi)/time_samples, trajectories = 4N)
```
and through `M` we have access to the 4-position, the 4-velocity, the [angular/boost momentum tensor](https://en.wikipedia.org/wiki/Relativistic_angular_momentum#4d_Angular_momentum_as_a_bivector) at every time step, for every particle. Our `output_func` returns for each particle a list at at regular time samples in the form of the function `Mμν(v)`.
```julia
function Mμν(v)
    x⁰, x¹, x², x³, u⁰, u¹, u², u³ = v
    Lx = x²*u³ - x³*u²
    Ly = x³*u¹ - x¹*u³
    Lz = x¹*u² - x²*u¹
    # Nx = x¹*u⁰ - x⁰*u¹
    # Ny = x²*u⁰ - x⁰*u²
    # Nz = x³*u⁰ - x⁰*u³
    L² = Lx^2 + Ly^2 + Lz^2
    # N² = Nx^2 + Ny^2 + Nz^2
    #the physical quantities are m* [1,2,3] , m^2*[4], m/c* [5,6,7] , m^2/c^2*[8],
    return (Lx = Lx, Ly = Ly, Lz = Lz, L² = L², #Nx = Nx, Ny = Ny, Nz = Nz, N² = N²,
            x⁰ = x⁰, x¹ = x¹, x² = x², x³ = x³, u⁰ = u⁰, u¹ = u¹, u² = u², u³ = u³)
end
```

## Statistics

Since we are dealing with a statistical ensemble, we look for collective behaviour through means. There are two kinds of means done in this script.

- Time-wise: the relevant quantities are averaged using [ThreadsX.jl](https://github.com/tkf/ThreadsX.jl)
```julia
function Particle_Avg(M,J)
    [ThreadsX.sum(getproperty(M[i][t], J)
    for i in 1:N)/N for t in 1:time_samples+1]
end
```
- Radius-wise (in the transverse plane): the relevant quantities get averaged over equidistant rings in the XY plane for their initial coordinates. The averaging is sped up by sorting the initial conditions according to `ρ`.
```julia
RHO = [UniformAnnulus(0,maxR) for i in 1:4N]
RHOVec = VectorOfArray(RHO)
idx = sortperm(RHO, lt=(x,y)->x[2]<y[2])
R1 = RHOVec[1,:][idx]
```

## Plots

In order to facilitate pretty graphics, trial and error lead to a solution utilizing [Serialization.jl](https://github.com/JuliaLang/julia/tree/master/stdlib/Serialization). This way, all plot objects will be saved, grouped in `plot_data` lists for each `sim_name` and saved as is in binary form (without file ending).
```julia
serialize("$(sim_name)", plot_data)
```

They can then be reloaded and modified using the usual [Plots.jl](https://github.com/JuliaPlots/Plots.jl), just use
```julia
myplots = deserialize("name")
```
and modify the plot elements as you would a regular plot.

## field_plots.jl

This file contains the code used to generate some useful plots which give information about the fields we study. For example azimuthally mediated electromagnetic field energy for Laguerre-Gauss mode `p = 2` and `m = 2`:

Here, the tabulated roots are used to highlight the separated regions where the initial conditions are genereated in [electrodynamic-sims.jl](https://github.com/toma-vlad/electrodynamic-simulations/blob/main/electrodynamic-sims.jl).

repository: toma-vlad/electrodynamic-simulations

gha_language: Julia

repo_name: toma-vlad/electrodynamic-simulations


text:
# Proliferate
Proliferate dynamically generates executable launcher files that are used to start child process and provides a means to communicate with the processes over named pipes. This way the code that runs in your main process can live in the same assembly as the code that runs in the child process (no need to add another project to your solution for the child EXE).
Available on [NuGet](http://nuget.org/packages/Proliferate)
### Features:
* Uses Reflection.Emit to dynamically generate a tiny executable file for launching a child process (don't worry this only takes ~20ms).
* Using raw Named Pipes means a little bit faster startup time than using WCF (Windows Communication Foundation).
* Child process shuts down when signaled to do so by parent or when it stops receiving pings.
* Provides ability to directly write to/read from a stream or to send strings.
* Allows for sending serializable objects (using BinaryFormatter internally).
* Supports multiple simultaneous connections.
* Can optionally use Async/Await style asynchronous code in the request handler of the child process.
* No dependency on System.ServiceModel.

### Limitations
* Cannot be ported to .NET Core because saving dynamic assemblies isn't currently supported: https://github.com/dotnet/corefx/issues/4491
* Errors in the child process are not propagated to the parent process (the way they would be in WCF when includeExceptionDetailInFaults is enabled).
* BinaryFormatter isn't as good as [Wire](https://github.com/akkadotnet/Wire) or [MS Bond](https://github.com/Microsoft/bond), but using it doesn't require any extra library dependencies.

### Serialized Message Example
Also refer to the Proliferate.Example project.
```csharp
    class Program
    {
        static void Main(string[] args)
        {
            var childProcessMainMethod = typeof(ChildProcess).GetMethod("Start");
            var exePath = ExecutableGenerator.Instance.GenerateExecutable(childProcessMainMethod,
                ExecutableType.Default, "Launcher");
            var proc = System.Diagnostics.Process.Start(exePath, "MyPipeNameHere");

            var client = new Proliferate.ProliferateClient("MyPipeNameHere");
            using (var cancelTokenSource = new System.Threading.CancellationTokenSource())
            {
                using (var messenger = client.GetMessenger<DataTransferObj, DataTransferObj>())
                {
                    var response = messenger.SendRequest(new DataTransferObj() { Message = "Hi" });
                }
            }
            client.SendShutdown();
        }
    }

    [Serializable]
    public class DataTransferObj
    {
        public string Message;
    }

    public class ChildProcess
    {
        public static void Start(string[] args)
        {
            var pipeNamePrefix = args[0];
            var handler = Proliferate.RequestHandlerFactory.
                FromTaskReturning<DataTransferObj, DataTransferObj>(TestHandler);
            var server = new Proliferate.ProliferateServer(handler, 1, pipeNamePrefix);
            var cancelTokenSrc = new System.Threading.CancellationTokenSource();
            server.Run(cancelTokenSrc.Token);
        }
        private static async Task<DataTransferObj> TestHandler(DataTransferObj requestMsg)
        {
            await Task.Delay(1); //Simulate some task
            Console.WriteLine("Child process finished handling a request.");
            return requestMsg;
        }
    }
```

repository: CoderNate/Proliferate

repo_name: CoderNate/Proliferate


text:
Americans for Representation Bylaws
==========================================

1 Name and Purpose
=====================

The Name of this organization shall be the Americans for Representation (USA4R), a not-for-profit organization. The purpose of  USA4R is to empower ordinary people through community organization. The objective of the USA4R is to represent its members' interests in order to enact political, social, and economic change. The USA4R shall be cooperatively run by its members using democratic principles.

2 Membership
================

Membership is available for anyone who wishes to apply, pay monthly dues, and abide by the Constitution and bylaws.
The USA4R shall have one (1) class of membership.

2.1 Membership contract
----------------
Every applicant for membership shall sign a membership contract.

2.2 Membership Expectations
----------------------------
Members are required to vote on a delegate.
Members are expected to volunteer at least 10 hours per year, either with the USA4R or other organizations working to advance USA4R's vision of the future.
Members are expected to vote in every possible local, county, state, primary, and federal election.
Any member expectation may be waived due to hardship.
Members are expected to either attend every meeting, or delegate their authority to another member for a meeting.

2.3 Membership Dues
----------------------------
Members are expected to pay monthly dues of at least $5 per month.
The cost of the membership may be changed once a year using the Voting Procedure for Proposals in Section 4.
Dues may be waived due to financial hardship.

2.4 Removal of Members
----------------------------
Any member has the right to resign from USA4R.

Membership may be terminated using the voting procedure for resolutions.
Membership may be terminated due to failure to pay membership dues.

The member must be given 15 days prior notice of the expulsion, suspension, or termination and the reasons therefor, and the member shall have an opportunity to be heard, orally or in writing, no less than 5 days before the effective date of the expulsion, suspension, or termination by a person or body authorized to decide that the proposed expulsion, termination, or suspension not take place.

3 Delegates
============
Delegates shall be elected by members in order to represent members at formal meetings.
Any member may become a delegate.
Delegate voting power shall be equal to the amount of members' voting power which has been delegated to them.
Members may split delegation to more than one delegate.
Members may delegate voting power to them self.
Delegation may be temporarily revoked when a member wishes to personally vote at a meeting and temporarily become a delegate.
No delegate may accumulate more than 33% of total voting power of the members.

3.1 Vote Power
------------------
Each member shall have 1 vote power for each meeting held.
Vote power may be subdivided into fractional voting power.
Vote power may be transferred by the member to a delegate.

4 Meetings
============
Regular meetings shall be held at least once per month.
All delegates are eligible to attend and vote in meetings.
Delegates shall receive at least 5 days advance notice of meetings.
Meetings shall be used to evaluate and enact proposals.

4.1 Proposals
----------------------------
Proposals & Resolutions can be made to direct activities of the USA4R and the USA4R staff.
Delegates may directly vote on meeting proposals.
Non-members may vote in meetings if allowed by a 90% rating vote of delegates.

4.2 Electronic Participation
----------------------------
Delegates not physically present at a meeting may participate using electronic communication and deemed present in person. Meetings may be held using solely electronic communication.

4.3 Voting Procedure
----------------------------
Proposals shall be voted on by delegates using scored voting.
A total rating of at least 9 out of 10 (90%) is required for immediate passage of a resolution.
If a rating less than 90% is achieved, multiple additional re-votes are required for passage, using the procedure below in this section.

The speed of passage shall be determined through the accumulated ratings of the proposal polled across multiple votes of the proposal. A proposal shall be adopted when proposal distance exceeds 1.0. At least 6 days must pass from the last vote in order to re-vote on a proposal.
Proposal distance is defined by the sum of all passage-speeds for each vote and revote of a proposal.
Proposal distance shall be set to zero if a proposal score falls below 51% for a vote.
Passage speeds are determined from the table below.
A proposal or amended proposal may be immediately revoted on to replace the last proposal rating.

| Minimum Rating | Passage Time | Passage Speed |
|----------------|--------------|---------------|
| (%)            | (# sessions) | (1/session)   |
| 90             | 1            | 1.0000        |
| 85             | 2            | 0.5000        |
| 81             | 3            | 0.3334        |
| 78             | 4            | 0.2500        |
| 74             | 5            | 0.2000        |
| 70             | 6            | 0.1667        |
| 66             | 7            | 0.1429        |
| 62             | 8            | 0.1250        |
| 57             | 9            | 0.1112        |
| 51             | 10           | 0.1000        |

4.4 Bylaw Amendments
----------------------------
The bylaws shall be amended using the Section 4 Voting Procedure. However at least **30 days** must pass from the last vote in order to revote on a bylaw amendment. An amendment shall also require one additional re-vote for passage, requiring at least 2 votes.

4.5 Proposal Amendments
------------------------
A proposal may be amended, without affecting the proposal's passage distance, if the amendment achieves a higher rating than all previous ratings of the proposal. Otherwise, the proposal amendment must be considered a separate proposal starting at zero proposal distance.

4.6 Quorum
----------------------------
Quorum shall be established by attendance of at least 50% of total delegated voting power.

5 Officers and Staff
============
Staff may be hired/fired, and officers may be elected, through the voting procedure. Any member of the organization is eligible to hold any office.
All staff shall be members of the organization.

6 Committees
============
Informal committees may be set up.

7 Coercion
==========
Coercion made against other members shall result in immediate loss of voting power, delegation power, and membership suspension, to be reinstated only by vote as stipulated in Section 4 --  Meetings. Coercion against other members is grounds for termination following Section 2.4 -- Removal of Members.


text:
# stream-kafka

## KafkaStreamFactory

This stream ingests Spans form a Kafka topic advertised by Zookeeper,
using Spark Kafka libraries.

Kafka messages should contain a list of spans in json or TBinaryProtocol
big-endian encoding. Details on message encode is available [here](https://github.com/openzipkin/zipkin/blob/master/zipkin-collector/kafka/README.md#encoding-spans-into-kafka-messages)

## Usage

While the `KafkaStreamFactory` can be used directly through the provided
builder interface, most users will likely find more value in the Spring
Boot autoconfiguraton module.  Additional information for using the
module can be found [here](../../autoconfigure/stream-kafka).

repository: vpiduri/zipkin-sparkstreaming

repo_name: vpiduri/zipkin-sparkstreaming


text:
## Jackson serialization treat empty string value as null

The unit test `should return response with one value empty` fails, but it was expected to pass
because mock return an empty string for `value2`.

Mock response:

```
{
    "value1": "11111",
    "value2": ""
}
```


text:
# steak
Do you suffer from a lack of motivation? Have you ever had tasks to complete that you just didn't feel like working on? steak is a productivity tool that will help you stay personally and financially accountable for goals that you set.

### Overview
steak is a stake-based TODO list dApp that works like any other TODO list. However, users must stake some asset along with the goal/task that they are creating. As these goals/tasks are completed, funds are reimbursed back to the user.

### Idea/Motivation
##### Example
  - Alice sets a goal "Essay #1" to be completed in 2 weeks and stakes 1 ETH
  - Alice's 1 ETH is locked up for the 2 week period while she works on her essay
  - After 2 weeks, Alice finishes her essay and submits it to a validator to verify that it is completed. After validation, Alice's original stake is reimbursed to her.
  - If Alice doesn't complete her essay, her original 1 ETH stake is slashed and "donated" to a reward pool

##### Further Extensions
 - Reward users for completing tasks early (using "reward pool" from people who didn't complete their tasks)
 - Incrementally slash funds if tasks are completed late (lowers severity of not completing tasks, not all or nothing)
 - Incentivize validators to verify honestly
 - Incentivize users by not only reimbursing funds but also rewarding them with "interest" on top of completing task
 - Allow other parties to "bet" on outcome (Gnosis?)

### Project Design
##### Smart Contracts
steak will have 2 main smart contracts that interact with each other:
 - User Contract: handles normal user functionality (task creation, asset staking, payout)
 - Validator Contract: handles verification for tasks that have been completed

##### Frontend
Looking into using React (maybe?) or doing something simple in HTML/JS

##### Additional Components
IPFS, Gnosis (maybe?), oracalize (maybe?)

repository: mrbrianhobo/final-project

repo_name: mrbrianhobo/final-project


text:
---
path: /blog/20210312-magazine-blt-graph-vol63
date: 2021-03-12T16:16:53.538Z
title: "[Photos] Magazine B.L.T Graph Vol.63"
author: Chr0balord
description: Magazine B.L.T Graph Vol.63 (Umezawa Minami Cover)
tags:
  - Photos
  - Nogizaka46
  - Hinatazaka46
image: https://i.ibb.co/fNhDp95/cover.jpg
label: Google Drive
url: https://drive.google.com/drive/folders/1iQbxh8Kjwpa-CHw5kSkXQDI5SvSEzJkL?usp=sharing
---
# Format

* JPG

# Information

Artist : Umezawa Minami, Sakaguchi Tamami (Nogizaka46) & Yamaguchi Haruyo (Hinatazaka46)

Magazine : B.L.T Graph Vo.63\
Release Date : 27 January 2021

**Don't spread the Google Drive link without permission, if you want to share. Just share the article link. Thank You!**

repository: dendense/himitsu

gha_language: JavaScript

repo_name: dendense/himitsu


text:
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Issue template:

```markdown
# Name (issue type with meaningful name)
[FEATURE/BUG/QUESTION] xyz

# Description
_ Please describe your issue here _

# Why
_ Please explain why this issue is important to the project _
```

Please note we have a [code of conduct](./CONDUCT.md), please follow it in all your interactions with the project.

---

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
   build.
2. Update the README.md with details of changes to the interface, this includes new environment
   variables, exposed ports, useful file locations and container parameters.
3. Rebase your branch so that you only have one commit left in the repository. This helps us keep a clear
   git history, allowing us to clearly see what has been done very quickly.
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
   do not have permission to do that, you may request the second reviewer to merge it for you.

**Failure to go by these 4 simple rules will result in your pull request being rejected.**

repository: anthonygauthier/blazin

repo_name: anthonygauthier/blazin


text:
# archive-fusionvm

This is a zsh script for macOS Catalina and VMware Fusion
that suspends and archives a folder of VMs to dmg.

## Installation

    brew install nreilingh/tap/archive-fusionvm

## Usage

    archive_fusionvm path/to/folder/containing/.vmwarevm_files/ desired/output_file.dmg

## Contributing

This code has unit tests! Get ZUnit with

    brew install zunit-zsh/zunit/zunit

and then run `zunit` in the project directory to test.

repository: NReilingh/archive-fusionvm

gha_language: Shell

repo_name: NReilingh/archive-fusionvm


text:
# #77i3 - transplant tools defined in dotfiles

|**Issue**||
|---|---|
|Status|end<!-- any of "new", "in progress", "end" http://redmine.jp/tech_note/issue_statuses/ -->|
|Priority|Normal<!-- "high" or "normal" or "low"-->|
|Assignee|owner<!-- your name -->|
|Category|<!-- optional -->|
|Target version|0.1<!-- optional, any of git tags recommended -->|
|Start date|2018-03-03|
|Due date|2018-03-31|
|% Done|100%|
|worked|7hours|

## Description

targets are vm, crap, icol, ggr, zeller

### design

* single file ( for each )
* this repo should be saved right under `~/Documents/`
* define in .zshrc or any dotfile like
  * `alias icol='sh ~/Documents/happy-scripts/icol.sh`

## Related to

|**ID**|**Subject**|
|---|---|
|#itk1||<!--OTHER_ISSUE;;-->

## History

ok, closed

---

almost done. tools given in Description are now available.
Waiting & seeing for any bug

---
*this document has been generated & accessed from computer program, named "icol"*


text:
---
title: Lone Wolf Theme
github: 'https://github.com/manid2/lone-wolf-theme/'
demo: 'https://manid2.github.io/lone-wolf-theme/'
author: Mani Kumar
date: 2020-08-23T18:13:04.000Z
github_branch: master
ssg:
  - Jekyll
cms:
  - No Cms
css:
  - Bootstrap
archetype:
  - Blog
  - Personal
  - Portfolio
description: A simple bootstrap based jekyll theme.
stale: false
---

Lone Wolf Theme is a simple bootstrap based jekyll theme.
It is infamous for abstracting away the frontend code using [Bootstrap 4][bs4]
and [Bootswatch wrappers][bootswatch] to help us focus on the **content** and
the **functions**.

## Features

- Has 4 unique layouts `home`, `page`, `post` and `archive` posts.
- Bootstrap based theme enhanced further with the Bootswatch wrappers.
- Uses animate.css for animations.
- Uses font awesome 5 for icons.
- Optimized for search engines using [Jekyll Seo Tag][jst] gem.

For more info checkout github repository [manid2/lone-wolf-theme][lwt_git_repo].

Also visit the live [demo][lwt_live_demo] site for the theme.

<!-- External links -->
[jekyll]: https://jekyllrb.com/
[bs4]: https://getbootstrap.com/
[bootswatch]: https://bootswatch.com/
[jst]: https://github.com/jekyll/jekyll-seo-tag
[lwt_git_repo]: https://github.com/manid2/lone-wolf-theme/
[lwt_live_demo]: https://manid2.github.io/lone-wolf-theme/

repository: styxlab/jamstackthemes

repo_name: styxlab/jamstackthemes


text:
# NestedDecodable
An extension to decode nested model of any depth with a keyPath.

It means you can do these:
```swift
let decoder = JSONDecoder()
let post1 = try decoder.decode(Post.self, from: data, keyPath: "post")
let post2 = try decoder.decode(Post.self, from: data, keyPath: "nested.post")
let post3 = try decoder.decode(Post.self, from: data, keyPath: "nested.post.embedded_post")
```
with this JSON data:
```swift
{
    "post": {
        "title": "Hello",
        "detail": "My post, hello!",
        "likes": 20
    },
    "nested": {
        "post": {
            "title": "What is this",
            "detail": "The nest seems to work",
            "likes": 14,
            "embedded_post": {
                "title": "Embedded Post",
                "detail": "Embedded post also work",
                "likes": 100
            }
        }
    }
}
```
and the `Post` model:
```swift
struct Post: Decodable {
    let title: String
    let detail: String
    let likes: Int
}
```

## Installation
Just drag `NestedDecodable.swift` to your project.

repository: aunnnn/NestedDecodable

repo_name: aunnnn/NestedDecodable


text:
# google colab
_jupyter notebook stored in google-drive_

* [google-aihub](https://aihub.cloud.google.com/s?category=notebook)
* build-in library of code-snippets
* Free access to GPUs -> really?
* [PyDrive](https://gsuitedevs.github.io/PyDrive/docs/build/html/index.html) ?
* [empty trash](https://webapps.stackexchange.com/questions/110315/trash-with-80-thousand-files-empty-trash-doesnt-work)

    Colab notebooks allow you to combine executable code and rich text in a single document, along with images, HTML, LaTeX and more

    Long running python processes can be interrupted. Run the following cell and select Runtime -> Interrupt execution (hotkey: Cmd/Ctrl-M I) to stop execution.

install dependecies

     you can use !pip install or !apt-get install

    %%bash
    pip install fastBPE regex requests sacremoses subword_nmt

### google-drive

mount google-drive locally

    google-drive-ocamlfuse ~/googledrive
    fusermount -u ~/googledrive # unmount

mount drive in colab-notebook

    from google.colab import drive
    drive.mount('/content/drive')
    !ln -s /content/drive/My\ Drive /mydrive
    !echo /mydrive

sync files with rclone
    rclone sync -P --exclude .git/** --exclude .idea/** --exclude build/** --exclude *.pyc --max-size 100k $HOME/code/NLP/TOOLS/fairseq remote:fairseq

repository: dertilo/natural-language-processing

repo_name: dertilo/natural-language-processing


text:
# Changelog

## [0.2.0] - 2018-12-29

### Changed

- Restore `android` and `iphone` to `latest` in `pullRequest` list ([`cd84b92`](https://github.com/airtap/browsers/commit/cd84b92)) ([**@vweevers**](https://github.com/vweevers))

## [0.1.0] - 2018-12-29

### Changed

- Upgrade `standard` from `^11.0.0` to `12.0.0` ([#11](https://github.com/airtap/browsers/issues/11)) ([**@ralphtheninja**](https://github.com/ralphtheninja))

### Added

- Add `hallmark` devDependency ([`36fff04`](https://github.com/airtap/browsers/commit/36fff04)) ([**@vweevers**](https://github.com/vweevers))

### Removed

- Remove IE 9 and 10 ([`c75b3b8`](https://github.com/airtap/browsers/commit/c75b3b8)) ([**@vweevers**](https://github.com/vweevers))

## [0.0.2] - 2018-05-25

### Added

- Add node 10 to Travis ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Add Greenkeeper ([**@ralphtheninja**](https://github.com/ralphtheninja))

### Removed

- Remove node 4 from Travis ([**@ralphtheninja**](https://github.com/ralphtheninja))

## [0.0.1] - 2018-02-16

First release :seedling:. Forked from [`browzers`](https://github.com/algolia/browzers), so this changelog entry lists the differences from `browzers`.

### Added

- Add `standard` ([**@vweevers**](https://github.com/vweevers))
- Add `LICENSE` file ([**@vweevers**](https://github.com/vweevers))
- Test `.name`, `.version` and `.platform` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Add badges, usage, install and license to readme ([**@vweevers**](https://github.com/vweevers))
- Add `CHANGELOG.md` ([**@vweevers**](https://github.com/vweevers))

### Changed

- Rename package and update repository URLs ([**@vweevers**](https://github.com/vweevers))
- Remove the need for Babel ([**@vweevers**](https://github.com/vweevers))
- Update `.travis.yml` with node 4, 6, 8 and 9 ([**@vweevers**](https://github.com/vweevers))
- Change IE8 to IE9 ([**@vweevers**](https://github.com/vweevers))
- Temporarily change Android latest (failing on Sauce Labs) to 6.0 ([**@vweevers**](https://github.com/vweevers))

### Fixed

- Gitignore `npm-debug.log` and `yarn.lock` ([**@vweevers**](https://github.com/vweevers))

### Removed

- Remove `eslint` (replaced by `standard`) ([**@vweevers**](https://github.com/vweevers))
- Remove `.npmignore` (only there for Babel) ([**@vweevers**](https://github.com/vweevers))
- Remove `HISTORY.md` (replaced by `CHANGELOG.md`) ([**@vweevers**](https://github.com/vweevers))

[0.2.0]: https://github.com/airtap/browsers/compare/v0.1.0...v0.2.0

[0.1.0]: https://github.com/airtap/browsers/compare/v0.0.2...v0.1.0

[0.0.2]: https://github.com/airtap/browsers/compare/v0.0.1...v0.0.2

[0.0.1]: https://github.com/airtap/browsers/compare/v0.0.0...v0.0.1

repository: airtap/browsers

repo_name: airtap/browsers


text:
The goal is to automate building armhf (armv7) compatible Docker images. These images can be used for dev, build, test, and deploy to ensure a consistent user experience.  The most common development, cloud, and build machines currently run x86-64 architecture hardware.  This complicates working on software targeted at embedded arm platforms. With modern kernels that support binfmt misc and the right combination of qemu-XXX-static binary one can run arbitrary format Docker images on arbitrary host hardware.

This solution combines:

* Host kernel support for binfmt misc
* qemu-arm-static
* Docker armhf images

## Configure Host

There are a many articles out there on configuring binfmt / qemu / chroot to run ARM binaries, images, etc.  Here are two common approaches.

### The Clean Way

Assuming a newer Ubuntu or Debian system you can just install the necessary pacakges.

    apt-get update && apt-get install -y --no-install-recommends \
            qemu-user-static \
            binfmt-support
    update-binfmts --enable qemu-arm
    update-binfmts --display qemu-arm

If everything looks good, skip ahead past the next section down to *Test Host Setup*.

### The Dirty Way

If you want to keep it slim or manually configure everything this would be another approach.

Grab a host compatible qemu-arm-static binary and put it in place.

    sudo curl -o /usr/bin/qemu-arm-static http://ubergarm.com/dre/qemu-arm-static
    sudo chmod a+x /usr/bin/qemu-arm-static

Install binfmt module support if not already built into kernel.

    grep BINFMT /usr/src/linux-headers-$(uname -r)/.config || zcat /proc/config.gz | grep BINFMT
    sudo modprobe binfmt_misc
    lsmod | grep BINFMT

Register qemu-arm

    mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
    echo ':qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register

### Test Host Setup

Confirm that the host is setup correctly to run an arm binary.

    qemu-arm-static -version
    curl -O http://ubergarm.com/dre/hello-world-arm
    chmod a+x hello-world-arm
    file hello-world-arm
    qemu-arm-static hello-world-arm
    ./hello-world-arm

If all that looks good e.g. "Hello world!" both times then try Docker.

    docker pull ioft/armhf-ubuntu:trusty
    docker run --rm -it -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static ioft/armhf-ubuntu:trusty uname -a

You should get something like:

    Linux 27393a16e4f8 3.13.0-68-generic #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 armv7l armv7l armv7l GNU/Linux

as compared to the host `uname -a`:

    Linux qemu-test 3.13.0-68-generic #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

## NOTE

Not all arm images have an x86-64 qemu-arm-static sitting around in /usr/bin already. If it isn't there, just volume mount the file from the host into place in the container as shown above. Until `docker build -v` works, I've gone ahead and created a base image which only adds qemu-arm-static to an otherwise ARM Docker Image to support Dockerfile's and building Docker Images from an x86.

    $ docker run --rm -it ubergarm/armhf-ubuntu:trusty file /usr/bin/qemu-arm-static

## Conclusion

There you have it!  Run, build, test, and dev ARM Docker Images right on your x86-64 host machine.  Next up: bringing Continuous Integration to the embedded arm world!

## Plug

I tested all of the above commands for just a few cents on a fresh clean [DigitalOcean](https://www.digitalocean.com/?refcode=e1f614cb2907) VPS. Use that referral link to get $10 credit if you want so try it out yourself.  If you keep using it, they'll eventually give me $25 credit. Thanks. Plug complete.

## References
[ioft/armhf-ubuntu](https://hub.docker.com/r/ioft/armhf-ubuntu/)

[ubergarm/armhf-ubuntu](https://hub.docker.com/r/ubergarm/armhf-ubuntu/)


text:
# Server

## Description

The `server` node defines configuration for the gateway daemon front-end.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**protocols** | **list[str]** | Specifies the protocols which will be supported by the server.| [optional]
**client\_ip\_rules** | **list[str]** | The rules which define whether a client is allowed to connect to this server.| [optional]
**ssl** | [**ServerSsl**](ServerSsl.md) |  | [optional]
**failover** | [**ServerFailover**](ServerFailover.md) |  | [optional]
**session** | [**ServerSession**](ServerSession.md) |  | [optional]
**worker\_threads** | **float** | The number of configured worker threads specifies the number of concurrent incoming requests that can be serviced by this gateway instance. Choosing the optimal number depends on the quantity and type of traffic on your network. Modifying this value should be done carefully to ensure optimal performance.  | [optional] [default to 100]
**http2** | **bool** | A boolean which indicates whether or not to enable support for HTTP/2 clients. HTTP/2 supports a reduced set of cipher suites. The minimum cipher is `TLS\_ECDHE\_RSA\_WITH\_AES\_128\_GCM\_SHA256` which should be added to the `server/ssl/ciphers[]` entry.  | [optional] [default to True]
**websocket** | [**ServerWebsocket**](ServerWebsocket.md) |  | [optional]
**local\_pages** | [**ServerLocalPages**](ServerLocalPages.md) |  | [optional]
**management\_pages** | [**ServerManagementPages**](ServerManagementPages.md) |  | [optional]
**error\_pages** | [**ServerErrorPages**](ServerErrorPages.md) |  | [optional]
**public\_assets** | [**ServerPublicAssets**](ServerPublicAssets.md) |  | [optional]
**enabled\_languages** | **list[str]** | The language(s) which will be permitted when the application gateway generates error and management response pages.| [optional]
**credential\_service\_cache** | [**ServerCredentialServiceCache**](ServerCredentialServiceCache.md) |  | [optional]
**local\_applications** | [**ServerLocalApplications**](ServerLocalApplications.md) |  | [optional]
**rate\_limiting** | [**ServerRateLimiting**](ServerRateLimiting.md) |  | [optional]
**content\_security\_policy** | **str** | Specifies whether or not the gateway will use the default content security policy.  The default policy inserts the following HTTP headers into all responses:  header | value -------|------- x-frame-options | DENY x-xss-protection | 1 content-security-policy | default-src 'self'; frame-ancestors 'self'; form-action 'self'; x-content-type-options | nosniff   | [optional] [default to 'default']
**response\_headers** | [**list[ServerResponseHeaders]**](ServerResponseHeaders.md) | This entry can be used to set HTTP headers which are always present in all responses which are returned to clients.| [optional]

[[Back to README]](../README.md)


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

### Description

Apache Groovy provides extension methods to aid with creating temporary directories. Prior to this fix, Groovy's implementation of those extension methods was using a now superseded Java JDK method call that is potentially not secure on some operating systems in some contexts. Users not using the extension methods mentioned in the advisory are not affected, but may wish to read the advisory for further details. Versions Affected: 2.0 to 2.4.20, 2.5.0 to 2.5.13, 3.0.0 to 3.0.6, and 4.0.0-alpha-1. Fixed in versions 2.4.21, 2.5.14, 3.0.7, 4.0.0-alpha-2.

### POC

#### Reference
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.oracle.com/security-alerts/cpuApr2021.html
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujan2021.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://www.oracle.com/security-alerts/cpuoct2021.html

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
## fp-java-homework
This project provides a starter template for the java homework assignments for CSCI-EE88A

The project requires Java 11+, gradle-6.0 . Project is shipped with gradle wrapper . So you should just be able to use ./gradlew
inside this direcory

## Install JDK11
 - You can cd into tools directory `cd tools`
 - run `.install-jdk.sh`
 - This should download jdk 11 on to your local machine .
 - Note: the above install command will print JAVA_HOME path that can be used in IDE tools to setup the JDK for your projects;
 - export this variable in your shell so that gradle would use this JDK from the command line:
 `export JAVA_HOME=<value_from_the_script>`

### Getting started
 Use the following commands to get started with your project

 - Compile: `./gradlew build`
 - create eclipse project files -> `./gradlew cleanEclipe eclipse`
 - create idea project files -> `./gradlew cleanIdea idea`
 - Run tests: `./gradlew test`
 - Create an archive of this project with just source code and gradle script  -> `./gradlew clean assemble srcZip`

### License
Copyright 2020, Harvard Extension School CSCIE88A

Licensed under the Apache License, Version 2.0.


text:
# tekton-cel

- Introduce a new CRD named `VariableStore` to record variables. These variables will be treat as `context` when calulate new CEL expression.

```
apiVersion: custom.tekton.dev/v1alpha1
kind: VariableStore
metadata:
  name: example
  namespace: default
spec:
  vars:
  - name: job_priority
    value: high
  - name: alert_enable
    value: yes
```

User could create `VariableStore` previously with some default variables, for example: log_level, time_out .etc

- Introduce a custom controller based on [custom task](https://github.com/tektoncd/community/blob/main/teps/0002-custom-tasks.md)
There are two cased when calculate CEL expression:
1. Without context (when express or condition)
```
apiVersion: tekton.dev/v1alpha1
kind: Run
metadata:
  generateName: celrun-is-red-
spec:
  ref:
    apiVersion: cel.tekton.dev/v1alpha1
    kind: CEL
  params:
    - name: red
      value: "{'blue': '0x000080', 'red': '0xFF0000'}['red']"
    - name: blue
      value: "{'blue': '0x000080', 'red': '0xFF0000'}['blue']"
    - name: is-red
      value: "{'blue': '0x000080', 'red': '0xFF0000'}['red'] == '0xFF0000'"
    - name: is-blue
      value: "{'blue': '0x000080', 'red': '0xFF0000'}['blue'] == '0xFF0000'"
```
2. With context (`user expression`)
```
apiVersion: tekton.dev/v1alpha1
kind: Run
metadata:
  generateName: celrun-with-context-
spec:
  ref:
    apiVersion: custom.tekton.dev/v1alpha1
    kind: VariableStore
    name: example
  params:
    - name: job_severity
      value: "job_priority in ['high', 'normal'] ? 'Sev-1' : 'Sev-2'"
    - name: types
      value: "type(job_severity)"
    - name: alert_enable
      value: "false"
```
See the `job_severity` leverage `job_priority` which in a context variable in `VariableStore`;
The `types` leverage calculate result of `job_severity`;
`alert_enable` try to reset the variables in `VariableStore`.

After calculate the expression in `params` will be display in the `Result` of the `Run`:
```
spec:
  params:
  - name: job_severity
    value: 'job_priority in [''high'', ''normal''] ? ''Sev-1'' : ''Sev-2'''
  - name: types
    value: type(job_severity)
  - name: alert_enable
    value: "false"
  ref:
    apiVersion: custom.tekton.dev/v1alpha1
    kind: VariableStore
    name: example
  serviceAccountName: default
status:
  completionTime: "2021-04-09T00:48:21Z"
  conditions:
  - lastTransitionTime: "2021-04-09T00:48:21Z"
    message: CEL expressions were evaluated successfully
    reason: EvaluationSuccess
    status: "True"
    type: Succeeded
  extraFields: null
  observedGeneration: 1
  results:
  - name: job_severity
    value: Sev-1
  - name: types
    value: string
  - name: alert_enable
    value: "false"
  startTime: "2021-04-09T00:48:21Z"
  ```

  And the new calculated variables will be record to `VariableStore`:
```
apiVersion: custom.tekton.dev/v1alpha1
kind: VariableStore
metadata:
  name: example
  namespace: default
spec:
  vars:
  - name: job_priority
    value: high
  - name: alert_enable
    value: "false"
  - name: job_severity
    value: Sev-1
  - name: types
    value: string
```

repository: vincent-pli/cel-tekton

repo_name: vincent-pli/cel-tekton


text:
---
layout: default
title: C Projects
nav_order: 4
---

# C Projects
{: .no_toc }

These are some projects written in C.
{: .fs-6 .fw-300 }

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}

---

## sc_open
Please refer to the **Semiconductor Manufacturing Related Projects** for a description of this project.
{: .fs-5 .fw-300 }

Find it here https://github.com/dkaip/sc_open.
{: .fs-5 .fw-300 }


text:
# ROSI Registry

display and manage metadata of open scientometric data sources

https://labs.tib.eu/rosi/

## Features

* overview of all data sources in a interactive, searchable table
* detailed view of a data source
* form view to add new or edit an existing data source

## Installation and usage

1. clone this repo
2. run npm install
3. edit config.json
4. change schemas for your needs

## Built With

* [jQuery](https://jquery.com/) - basic javascript library
* [alpacajs](http://alpacajs.org) - js form generator library
* [datatables](https://www.datatables.net/) - js table generator library

repository: TIBHannover/rosi-registry

repo_name: TIBHannover/rosi-registry


text:
### Introduction

Rearrange a set of numbers into one pile and in sequence, largest to smallest by
shifting two or three numbers from top of one pile to another. A rather hard
puzzle, needs considerable visual thinking.

### Puzzle

![](../img/pileup_help1.gif)

### Solution

![](../img/pileup_help2.gif)

### How to Play

-   Create a new puzzle with 3, 4,5 or 6 piles
-   Move mouse at the top of a pile down two or three numbers and left click
-   Move mouse to the pile that you want the highlighted numbers to move to. No
    need to drag.
-   A line linking source and target piles will be shown
-   Left click again, the numbers highlighted will be shifted to the top of the
    target pile
-   Continue shifting top two or three numbers from one pile to another
-   Puzzle is solved when all numbers are in one pile with the largest number at
    the bottom and number 1 at top

### Program Features

-   Create puzzles with 3, 4, 5 or 6 piles
-   Set display colour schemes
-   Select fontname and size
-   Select grid display type
-   Let computer show you a solution

### About PileUp

This program is free for personal use only. Cannot use or distribute this
program or game concept for commercial purposes.

repository: asimihsan/mindgames-webpage

repo_name: asimihsan/mindgames-webpage


text:
# ActiveMaterial

An ActiveAdmin skin based on Google's Material Design.

<img src="http://i.imgur.com/kDkGzYe.png">

## Installation

- `npm install --save active_material` or `yarn add active_material`
- Add `@import "active_material/src/stylesheets/active_material.scss";` to your CSS style file (eg `app/javascript/packs/active_admin.scss`). *Note:* this requires that your build system supports compiling SCSS
- Add `import "active_material"` to your JS file (eg `app/javascript/packs/active_admin.js`)

## Upgrading from v1 to v2

This activeadmin theme is entirely JS and CSS, and there is no custom ruby code. Therefore, since v2, active_material has been converted from a ruby gem to an npm package. As part of this process, sprockets is also no longer supported.

To upgrade from v1 to v2, follow these steps:
1. Follow the instructions above for "installation" to add the npm version
2. Remove references to active_material in `app/assets/stylesheets/active_admin.scss`. Any customizations should be moved over to wherever the new scss import is.
3. Remove references to active_material in `app/assets/javascripts/active_admin.js`.
4. Remove the `gem 'active_material'` from your Gemfile (and run `bundle install` to update Gemfile.lock)


text:
# schematics-02

![Schematics Service](images/schematics-02.png?raw=true "Always use Schematics!")

The following variables are defined for this configuration

- myparm ... this is the string used for the hello message
- myparm_sensitive ... a sensitive variable such as password
- sleeptime ... time the provisioning 'waits'


text:
---
layout: post
title: Recognizing bad code
---
# Recognizing bad code

As Venkat Subramaniam says in [this great talk](https://www.youtube.com/watch?v=llGgO74uXMI):

> Recognizing bad code is easier than writing good one. And I'm very good at recognizing bad code.

I'm adding my bit to that, which is:

> Recognizing bad code is easier than writing good one, that's why code reviews work.


text:
---
metaTitle: "JavsScript - Web Cryptography API"
description: "Creating digests (e.g. SHA-256), Cryptographically random data, Generating RSA key pair and converting to PEM format, Converting PEM key pair to CryptoKey"
---

# Web Cryptography API

## Creating digests (e.g. SHA-256)

```js
// Convert string to ArrayBuffer. This step is only necessary if you wish to hash a string, not if you aready got an ArrayBuffer such as an Uint8Array.
var input = new TextEncoder('utf-8').encode('Hello world!');

// Calculate the SHA-256 digest
crypto.subtle.digest('SHA-256', input)
// Wait for completion
.then(function(digest) {
  // digest is an ArrayBuffer. There are multiple ways to proceed.

  // If you want to display the digest as a hexadecimal string, this will work:
  var view = new DataView(digest);
  var hexstr = '';
  for(var i = 0; i < view.byteLength; i++) {
    var b = view.getUint8(i);
    hexstr += '0123456789abcdef'[(b & 0xf0) >> 4];
    hexstr += '0123456789abcdef'[(b & 0x0f)];
  }
  console.log(hexstr);

  // Otherwise, you can simply create an Uint8Array from the buffer:
  var digestAsArray = new Uint8Array(digest);
  console.log(digestAsArray);
})
// Catch errors
.catch(function(err) {
  console.error(err);
});

```

The current draft suggests to provide at least `SHA-1`, `SHA-256`, `SHA-384` and `SHA-512`, but this is no strict requirement and subject to change. However, the SHA family can still be considered a good choice as it will likely be supported in all major browsers.

## Cryptographically random data

```js
// Create an array with a fixed size and type.
var array = new Uint8Array(5);

// Generate cryptographically random values
crypto.getRandomValues(array);

// Print the array to the console
console.log(array);

```

[`crypto.getRandomValues(array)`](https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues) can be used with instances of the following classes (described further in [Binary Data](http://stackoverflow.com/documentation/javascript/417/binary-data#t=201607192101507088285)) and will generate values from the given ranges (both ends inclusive):

- `Int8Array`: -27 to 27-1
- `Uint8Array`: 0 to 28-1
- `Int16Array`: -215 to 215-1
- `Uint16Array`: 0 to 216-1
- `Int32Array`: -231 to 231-1
- `Uint32Array`: 0 to 231-1

## Generating RSA key pair and converting to PEM format

In this example you will learn how to generate RSA-OAEP key pair and how to convert private key from this key pair to base64 so you can use it with OpenSSL etc. Please note that this process can also be used for public key you just have to use prefix and suffix below:

```js
-----BEGIN PUBLIC KEY-----
-----END PUBLIC KEY-----

```

NOTE: This example is fully tested in these browsers: Chrome, Firefox, Opera, Vivaldi

```js
function arrayBufferToBase64(arrayBuffer) {
    var byteArray = new Uint8Array(arrayBuffer);
    var byteString = '';
    for(var i=0; i < byteArray.byteLength; i++) {
        byteString += String.fromCharCode(byteArray[i]);
    }
    var b64 = window.btoa(byteString);

    return b64;
}

function addNewLines(str) {
    var finalString = '';
    while(str.length > 0) {
        finalString += str.substring(0, 64) + '\n';
        str = str.substring(64);
    }

    return finalString;
}

function toPem(privateKey) {
    var b64 = addNewLines(arrayBufferToBase64(privateKey));
    var pem = "<REDACTED_PRIVATE_KEY>";

    return pem;
}

// Let's generate the key pair first
window.crypto.subtle.generateKey(
    {
        name: "RSA-OAEP",
        modulusLength: 2048, // can be 1024, 2048 or 4096
        publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
        hash: {name: "SHA-256"} // or SHA-512
    },
    true,
    ["encrypt", "decrypt"]
).then(function(keyPair) {
    /* now when the key pair is generated we are going
       to export it from the keypair object in pkcs8
    */
    window.crypto.subtle.exportKey(
        "pkcs8",
        keyPair.privateKey
    ).then(function(exportedPrivateKey) {
        // converting exported private key to PEM format
        var pem = toPem(exportedPrivateKey);
        console.log(pem);
    }).catch(function(err) {
        console.log(err);
    });
});

```

That's it! Now you have a fully working and compatiable RSA-OAEP Private Key in PEM format which you can use whereever you want. Enjoy!

## Converting PEM key pair to CryptoKey

So, have you ever wondered how to use your PEM RSA key pair that was generated by OpenSSL in Web Cryptography API? If the answers is yes. Great! You are going to find out.

NOTE: This process can also be used for public key, you only need to change prefix and suffix to:

```js
-----BEGIN PUBLIC KEY-----
-----END PUBLIC KEY-----

```

This example assumes that you have your RSA key pair generated in PEM.

```js
function removeLines(str) {
    return str.replace("\n", "");
}

function base64ToArrayBuffer(b64) {
    var byteString = window.atob(b64);
    var byteArray = new Uint8Array(byteString.length);
    for(var i=0; i < byteString.length; i++) {
        byteArray[i] = byteString.charCodeAt(i);
    }

    return byteArray;
}

function pemToArrayBuffer(pem) {
    var b64Lines = removeLines(pem);
    var b64Prefix = b64Lines.replace('<REDACTED_PRIVATE_KEY>', '');

    return base64ToArrayBuffer(b64Final);
}

window.crypto.subtle.importKey(
    "pkcs8",
    pemToArrayBuffer(yourprivatekey),
    {
        name: "RSA-OAEP",
        hash: {name: "SHA-256"} // or SHA-512
    },
    true,
    ["decrypt"]
).then(function(importedPrivateKey) {
    console.log(importedPrivateKey);
}).catch(function(err) {
    console.log(err);
});

```

And now you're done! You can use your imported key in WebCrypto API.

#### Remarks

The WebCrypto APIs are usually only available on "secure" origins, meaning that the document must have been loaded over HTTPS or from the local machine (from `localhost`, `file:`, or a browser extension).

These APIs are specified by [the W3C Web Cryptography API Candidate Recommendation](https://www.w3.org/TR/WebCryptoAPI/).

repository: haifenghuang/generate

repo_name: haifenghuang/generate


text:
# MongoDB Express Boilerplate

This is a boilerplate for the mongodb and express tandem; made with RESTful patterns.

## Directory

The directory structure is rather simplistic. It contains the `/app/` folder which contains
most of server source, and a `/tests/` folder for test suites

### /app

Server files are contained here.

#### /app/models

This directory contains the models that are

#### /app/routes

Routes are router files that define the API

#### /app/services

Services do all the work for the API are defined here

### /tests

Contains all the test suites for the API

## App Setup and environment file

First off install the app basic dependencies by:

    $ npm install

Create a file named `.env`, within the directory,
You can then edit that with a text editor you like:

    # Default Local Environment
    APP_PORT=80
    DB_HOST=localhost
    DB_PORT=27017
    DB_NAME=sample

You can go ahead and change the values as needed. By default this should work
on your local environment.

## Setup Mongodb

We need to create a repo file first:

	sudo vim /etc/yum.repos.d/mongodb-org-3.6.repo

Then append the following:

	[mongodb-org-3.6]
	name=MongoDB Repository
	baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.6/x86_64/
	gpgcheck=1
	enabled=1
	gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

Then install mongodb latest via:

	sudo yum install -y mongodb-org

We can then start the mongod service via:

	sudo service mongod start

TO ensure it gets restarted on reboot:

	sudo chkconfig mongod on

## Running the app

You can then run the server by hitting

    $ npm start

this is equivalent to running the server script

    $ node server.js

### Running tests

To run tests, simply invoke:

    npm test

This is a shortcut to using mocha:

    mocha tests/**/*.js --reporter spec --timeout 30000

### Running the App

When `server.js` is run, this will expose the API; you can start navigating by visiting on your browser:

    http://localhost/user

## License

MIT License

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

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

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

repository: LPS-RESULT/mongodb-express-boilerplate

repo_name: LPS-RESULT/mongodb-express-boilerplate