text:
Please use Python 3.6 or above. Your personal computers can be either in Windows 10 or Ubuntu or OSX.

## Download the dataset
1. Download assignmen2.zip from Blackboard.
2. Upload the assignment2.zip to the google cloud. Use the 'upload' button on jupyter notebook.
3. Unzip assignment2.zip. Copy paste the following command in the google cloud terminal. Make sure to modify ```path_to_gcloud``` appropriately in the following command.
```
unzip path_to_gcloud/assignment2.zip
```
4. Navigate to the 'assignment2' folder
```
cd path_to_gcloud/assignment2/
```
5. Download the CIFAR-10 dataset
```
cd ie590/datasets
bash ./get_datasets.sh
```

## IPython
After you have the CIFAR-10 data, you should start the IPython notebook server from the assignment2 directory, with the ``` jupyter notebook``` command.

## Questions
### 1. Fully-connected Neural Network (20 points)

The IPython notebook `FullyConnectedNets.ipynb` will introduce you to the modular layer design of neural networks, and then you will use those layers to implement fully-connected networks with an arbitrary number of hidden layers. To optimize these models, you will implement several popular update rules (Adam and RMSProp).

### 2. Batch Normalization (30 points)

In the IPython notebook `BatchNormalization.ipynb`, you will implement batch normalization, and use it to train deep fully-connected networks.

### 3. Dropout (10 points)

The IPython notebook `Dropout.ipynb` will help you implement Dropout and explore its effects on model generalization especially to prevent overfitting.

### 4. Convolutional Networks (30 points)

In the IPython Notebook `ConvolutionalNetworks.ipynb` you will implement several new layers that are commonly used in convolutional networks.

### 5. PyTorch / TensorFlow on CIFAR-10 (10 points)

For this last part, you will be working in either TensorFlow or PyTorch, two popular and powerful deep learning frameworks. **You only need to complete ONE of these two notebooks.** No extra credit will be given to students who do both.
Open up either `PyTorch.ipynb` or `TensorFlow.ipynb`. In there, you will learn how these frameworks work. Next, you will train a conv-net of your own design on CIFAR-10 dataset to get the best performance you can. When you created instances on google cloud, pytorch or tensorflow is already installed in your virtual machine.

## General guidelines
1. You can work on this assignment in one of the three platforms:
	1. Locally on your personal computer (it does not need to have a GPU)
	2. Purdue Scholar cluster (requires manual setup of pytorch/tensorflow with GPU)
	3. Google cloud
2. You MUST program in Python 3.6 or above

## Working on google cloud
* Follow the [instructions](https://github.com/cs231n/gcloud/) here to setup the google cloud.
* Install requirements.txt on the command line
```
pip3 install --user -r requirements.txt
```

## Submission instructions
* Create the PDF reports of the following ipython notebooks on jupyter: `FullyConnectedNets.ipynb`, `BatchNormalization.ipynb`, `Dropout.ipynb`, `ConvolutionalNetworks.ipynb` and `PyTorch.ipynb` or `TensorFlow.ipynb`.
* Save the PDF reports in `assignment2/ie590` folder.
* Run the following on the terminal to create a zip file of your solutions.
```
zip -r assignment2_firstname_lastname.zip . -x "*.git*" "*ie590/datasets*" ".env/*"
```
* Submit the `assignment2_firstname_lastname.zip` on the Blackboard.

gha_language: Jupyter Notebook


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

## Nice to meet you!

Let's stay in touch. You can find me on [GitHub](https://github.com/eyzhao) or [Twitter](https://twitter.com/zhaoez). Tweeting at me or DM'ing is the best way to get ahold of me. You can also try emailing me at [eric@zhao.science](mailto:eric@zhao.science).

## I'm basically a professional gene hacker

I'm an incoming **resident doctor** at the University of Toronto, specializing in [Radiation Oncology](https://www.radonc.utoronto.ca/). That means I am learning to be an effective cancer doctor, with a focus on treating cancer with radiation. I grew up in a few different cities, but mostly in [Vancouver, BC](https://vancouver.ca/).

**I love health, and I love data**. So I especially love studying how we can use data to improve health.  I'm basically a gene hacker - I use data science to uncover new knowledge about the human cancer genome. See my full CV and list of publications [here](/cv).

My **PhD research** happened at the illustrious [Michael Smith Genome Sciences Centre](http://bcgsc.ca/) in beautiful British Columbia, Canada. I investigated how cancers (fail to) repair their DNA, and how that could improve cancer treatment. For details, see [this academic paper](https://www.ncbi.nlm.nih.gov/pubmed/29246904) or [this news feature](http://www.aacr.org/Newsroom/Pages/News-Release-Detail.aspx?ItemID=1138#.Wr8vvojwbic). I am an alumnus of the [UBC MD/PhD program](http://mdprogram.med.ubc.ca/mdphd/).

When I'm not seeing patients or [keeping up with the scientific literature](/scientific-literature), you'll find me tinkering with graphic design, [playing music](/piano), biking around the city, listening to podcasts, shooting photos, and many more things I feel obligated to do as a west coast millenial.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
## Contributing to Knockout (TKO)

🎉 Thanks for taking the time to contribute!

When thinking of contributing, the most important thing is to use your best judgement.

Knockout is maintained by volunteers whose time is limited, so the more you can do up front, the faster something will get analyzed and fixed.

This project adheres to the [Contributor Covenant code of conduct](/CODE_OF_CONDUCT.md). By participating, you are agreeing to uphold this code.

## How to Contribute

Have a look on [StackOverflow](https://stackoverflow.com), in the source, on gitter.im, and in the documentation, to see if someone else has already reported the issue.

Second, include as many details as possible. Good details likely include:

1. Use a clear, descriptive **title**.
2. Note the platform, browser, and library **versions**.
3. Describe the exact **steps** to reproduce the problem – not necessarily just what you did but how you did it.
4. Provide a specific **example**, preferably on a Javascript sandbox like jsFiddle, jsBin, or CodePen.
5. Describe the **problem observed**.
6. Explain the **expected results**.

If the issue is an enhancement, consider also including:

1. Explain why it would be **useful**.
2. List **other applications** that have the enhancement.

## Pull Requests

A good pull request might include:

1. Thoughtfully worded, well-structured tests in the `spec/` folder that pass for all supported browsers
2. Inline documentation
3. Commit messages that follow the style (from [Atom](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages)):

* Use the present tense ("Add feature" not "Added feature")
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
* Limit the first line to 72 characters or less
* Reference issues and pull requests liberally
* When only changing documentation, include `[ci skip]` in the commit description
* Consider starting the commit message with an applicable emoji:
    * :art: `:art:` when improving the format/structure of the code
    * :racehorse: `:racehorse:` when improving performance
    * :non-potable_water: `:non-potable_water:` when plugging memory leaks
    * :memo: `:memo:` when writing docs
    * :penguin: `:penguin:` when fixing something on Linux
    * :apple: `:apple:` when fixing something on Mac OS
    * :checkered_flag: `:checkered_flag:` when fixing something on Windows
    * :bug: `:bug:` when fixing a bug
    * :fire: `:fire:` when removing code or files
    * :green_heart: `:green_heart:` when fixing the CI build
    * :white_check_mark: `:white_check_mark:` when adding tests
    * :lock: `:lock:` when dealing with security
    * :arrow_up: `:arrow_up:` when upgrading dependencies
    * :arrow_down: `:arrow_down:` when downgrading dependencies
    * :shirt: `:shirt:` when removing linter warnings

## Style

Do your best to mimic the local style.

repository: codenamejason/tko

repo_name: codenamejason/tko


text:
# Python Machine Learning 2nd Edition
Python Machine Learning 2nd Edition by Sebastian Raschka, Packt Publishing Ltd. 2017

Code Repository: https://github.com/rasbt/python-machine-learning-book-2nd-edition

Code License: MIT License

## Material for "Python Machine Learning 2nd Edition" Workshop

### Chapter 6 - Learning Best Practices for Model Evaluation and Hyperparameter Tuning
Book Content - https://github.com/rasbt/python-machine-learning-book-3rd-edition/tree/master/ch06

Kaggle Kernel - https://www.kaggle.com/sameerabalay/wids-20200224-pythonml-chapter6

### Chapter 7 - Combining Different Models for Ensemble Learning
Materials Chapter 7: https://github.com/rasbt/python-machine-learning-book-3rd-edition/tree/master/ch07

Slides: Chapter 7:https://docs.google.com/presentation/d/11vdJlhpK_Oco3q4TfaQOSqoaUt43KVv7cW6F8Th9wu0/edit?usp=sharing

Kaggle Kernels: Chapter 7: https://www.kaggle.com/ajmably/wids-20200224-pythonml-chapter7

repository: nishamathi/python-ml-workshops

repo_name: nishamathi/python-ml-workshops


text:
# What is vpnfailsafe ?

`vpnfailsafe` prevents a VPN user's ISP-assigned IP address from being exposed
on the internet, both while the VPN connection is active and when it goes down.

`vpnfailsafe` doesn't affect traffic to/from private networks, or disrupt existing
firewall rules beyond its intended function.

# How does it work ?

`vpnfailsafe` ensures that all traffic to/from the internet goes through the VPN.
It is meant to be executed by OpenVPN when the tunnel is established (--up), or
torn down (--down).

On --up:
* All configured VPN server domains are resolved and saved in /etc/hosts.
* Routes are set up, so that all traffic to the internet goes over the tunnel.
  The original default route is preserved and two more specific ones are added
  (mimicking --redirect-gateway def1) + routes to all configured VPN servers
  are added.
* /etc/resolv.conf is updated, so only the DNS pushed by the VPN server is used.
* iptables rules are inserted at the beginning of INPUT, OUTPUT and FORWARD
  chains to ensure that the only traffic to/from the internet is between the
  VPN client and the VPN server.

On --down:
* The /etc/hosts entries for VPN servers remain in place, so the VPN connection
  can be re-established without allowing traffic to DNS servers outside the VPN.
* Previously added routes are removed.
* Previous /etc/resolv.conf is restored.
* Firewall rules remain in place, allowing only the re-establishment of the vpn
  tunnel.

# How do I install/use it ?

Save vpnfailsafe.sh in /etc/openvpn, make it executable and add the
following lines to /etc/openvpn/\<your_provider\>.conf:

```
script-security 2
up /etc/openvpn/vpnfailsafe.sh
down /etc/openvpn/vpnfailsafe.sh
```

That's it.

Since `vpnfailsafe` contains the functionality of the popular
update-resolv-conf.sh script, the two don't need to be combined.

A complete configuration example is included as example.conf.

Arch Linux users may choose to install the
[vpnfailsafe-git](https://aur.archlinux.org/packages/vpnfailsafe-git/) package
from AUR instead.

If you want to use --user/--group to drop root priveleges, or otherwise run as
an unprivileged user, prepare for an uphill battle. OpenVPN will not make it
easy and the changes to get full functionality as non-root are likely to be
invasive. Perhaps a working example will be added in the future.

# What are the requirements/assumptions/limitations ?

Dependencies are minimal (listed in the PKGBUILD file). One assumption is that
the VPN server will push at least one DNS to the client.

`vpnfailsafe` has been tested on Linux, with both tun and tap devices, in all
topologies supported by OpenVPN.

There is no ipv6 support.

"RTNETLINK answers: File exists" errors can be ignored safely. They appear when
OpenVPN tries to set up a route, that's already been created by `vpnfailsafe`.
Adding the "route-noexec" option will tell OpenVPN to leave routing to
`vpnfailsafe` and prevent those errors from appearing.

The /etc/hosts entries may eventually become stale and require removal. Because
some VPN providers assign hundreds of IPs to their VPN server domains and
return different subsets of that pool in subsequent queries, updating these
entries automatically becomes very problematic. It makes determining whether a
previously valid IP is still valid impossible, so automated updates would
require constantly changing hosts entries, routes and firewall rules and almost
always to no benefit. In the interest of keeping this script small and simple,
such updates are now considered out of scope, unless github issues show popular
demand for the feature.

# How do I restore my system to the state from before running vpnfailsafe ?

`vpnfailsafe` will revert all changes when the tunnel is closed, except for the
firewall rules. You can restore those using the init script that set the
iptables rules on boot, or by otherwise removing the VPNFAILSAFE_INPUT,
VPNFAILSAFE_OUTPUT and VPNFAILSAFE_FORWARD chains.

Also, the entries in /etc/hosts for the VPN servers might get stale and require
removal.

# Will vpnfailsafe protect me against DNS leaks ?

Yes. See "How does it work ?" for more details.

That being said, if your life, job, or whatever you care about depend on your
IP not leaking, consider that this script has been tested by only a handful of
people. YMMV.

# Will vpnfailsafe protect me against all forms of IP leaks ?

No. Application level leaks can still happen, via protocols like WebRTC, or
BitTorrent. The user can also announce their identity to the world and no
script will stop them.

# Do I still need to configure a firewall ?

Yes. `vpnfailsafe` limits what kind of traffic is allowed, but only to achieve
its goals. Otherwise everything is passed through to pre-existing firewall
rules.

# Aren't there already scripts that do all that ?

One would think so, but then one would be wrong.

What is out there are mostly "applications", with non-optional GUIs and
thousands of lines of code behind them, often VPN-provider specific.

repository: david-gudeman/vpnfailsafe

repo_name: david-gudeman/vpnfailsafe


text:
# Garmin Health API integration

## Setup local environment

1. Create an OAuth2 project in Open Humans for this app at `https://www.openhumans.org/direct-sharing/oauth2-setup/`. Set `REDIRECT_URL`: `http://<IP_ADDRESS>:5000/`.

2. Copy `env.example` to `.env`. Edit `CLIENT_ID` and `CLIENT_SECRET` using the values provided in the information page for this project you just created on Open Humans website

3. Install Heroku's command line client: `https://devcenter.heroku.com/categories/command-line`

5. Install dependencies and migrate the database:

```
pipenv install
pipenv run python manage.py migrate
pipenv run python manage.py collectstatic
```

6. Run `heroku local`

7. Change the code and commit the changes to git.

8. Push the changes to production: `git push heroku master`.

7. Optionally: Test the synchronisation of Garmin data to our endpoints locally. Careful! This will break the synchronisation of data on production.

   a. Forward your port, e.g. `ssh -R 5000:localhost:5000 MY_SERVER`. You will have to configure your web server to forward the request to the correct port. For example, in nginx you would add the
   configuration:

   ```
   location /garmin-endpoint/ {
       proxy_pass http://localhost:5000;
   }
   ```

   b. Test the connection:

   ```
   curl -v https://MY_SERVER/garmin-endpoint/dailies/ --data '{"dailies":[]}'
   ```

   c. Configure the endpoints at `https://apis.garmin.com/tools/login`.

repository: gedankenstuecke/oh-garmin-integration

repo_name: gedankenstuecke/oh-garmin-integration


text:
# Kendo UI Core React Webpack & ES6 Boilerplate

Uses Kendo UI for React Core via npm plus Webpack and ES6 (i.e. Babel).

This setup involves using webpack and several loaders to transform JSX/ES 2015 to ES5 code. By using webpack JavaScript modules can be loaded using [ES 2015 module format](https://github.com/lukehoban/es6features#modules) (commonJS behind the scenes), properly transformed, then bundled.

### Prerequisites

First, install or update [Node.js & npm](https://nodejs.org/).

Once you have Node.js/npm working open a terminal and install [webpack](https://www.npmjs.com/package/webpack) and [browsersync](https://www.browsersync.io/) globally by running (might have to [sudo](https://support.apple.com/en-us/HT202035)):

```
$ npm install webpack browser-sync -g
```

### Installing

Download a [ZIP](https://github.com/kendo-labs/kendo-ui-boilerplates/archive/master.zip) of this [repository](https://github.com/kendo-labs/kendo-ui-boilerplates) (i.e. kendo-ui-boilerplates).

Or, if you have GIT installed you can Git clone this [repository](https://github.com/kendo-labs/kendo-ui-boilerplates).

SSH:

```
$ git clone git@github.com:kendo-labs/kendo-ui-boilerplates.git
```

https:

```
$ git clone https://github.com/kendo-labs/kendo-ui-boilerplates.git
```

Select the boilerplate you'd like to use from the directory you just downloaded/cloned and `cd` into that directory from a terminal.

Then run the following commands from the directory of the boilerplate you selected:

```
$ npm install
```

This will install the required [npm](https://www.npmjs.com/) packages.

### Running server

From the root of the boilerplate directory open a command prompt and run the following npm command

```
> npm run webpack
```

Next, open another new command prompt and run the following npm command

```
> npm run server
```

Both of these commands will continue to run while developing.

Browser Sync should have open a browser running the `index.html` file and `app.js` file at [http://localhost:4000](http://localhost:4000). Both webpack and Browser Sync have been configured to re-run when changes are made.

## Instead of downloading anything from Github, optionally, you can setup this boilerplate by following the seven steps below:

### Step 1: Verify Node.js and npm then install global packages

In this step make sure you have installed or have the most recent stable version of [Node.js and npm](https://nodejs.org/en/). Then run the following command to install [webpack](https://www.npmjs.com/package/webpack) and [browser-sync](https://www.browsersync.io/)  globally.

```
> npm install webpack browser-sync -g
```

You may need to use "sudo" to install the packages globally.

### Step 2: Create project directory and files

On your local file system create a directory with the following sub-directories and files.

```
├── build
├── index.html
├── package.json
├── src
│   ├── app.js
│   ├── app.css
│   └── math.js
└── webpack.config.js
```

Open the `package.json` file and place the following empty JSON object inside of it:

```
{}
```

### Step 3: Install npm devdependencies and dependencies

Open a command prompt from the root of the directory you created in step 2. Then run the following npm commands:

```
> npm install babel-core babel-loader babel-preset-es2015 babel-preset-react babel-preset-stage-0 browser-sync css-loader extract-text-webpack-plugin style-loader webpack --save-dev
```

Next run:

```
> npm install react react-dom @telerik/kendo-react-buttons --save
```

Running these two commands will install the necessary npm packages for this setup. The project directory `node_modules` folder should now contain the following npm packages:

```
├── build
├── index.html
├── node_modules
│   ├── @telerik
│   ├── babel-core
│   ├── babel-loader
│   ├── babel-preset-es2015
│   ├── babel-preset-react
│   ├── babel-preset-stage-0
│   ├── browser-sync
│   ├── css-loader
│   ├── extract-text-webpack-plugin
│   ├── react
│   ├── react-dom
│   ├── style-loader
│   └── webpack
├── package.json
├── src
│   ├── app.js
│   ├── app.css
│   └── math.js
└── webpack.config.js
```

### Step 4: Update app.js, app.css, math.js, and index.html

Open `app.js` and add the following to the file:

```
import React from 'react';
import ReactDOM from 'react-dom';
import * as KendoReactButtons from '@telerik/kendo-react-buttons';
import<EMAIL_ADDRESS>import { square, diag } from './math.js';
import './app.css';

console.log(square(11)); // 121
console.log(diag(4, 3)); // 5

class ButtonContainer extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			disabled: false
		};
	}
	onClick = () => {
		this.setState({ disabled: !this.state.disabled });
	}
	render() {
		return (
			<div>
				<KendoReactButtons.Button onClick={this.onClick}>Button 1</KendoReactButtons.Button>
				<KendoReactButtons.Button disabled={this.state.disabled}>Button 2</KendoReactButtons.Button>
			</div>
		);
	}
}

ReactDOM.render(
	<div>
		<p>Button</p>
		<KendoReactButtons.Button>Button test</KendoReactButtons.Button>
		<p>Disabled Button</p>
		<KendoReactButtons.Button disabled>Button</KendoReactButtons.Button>
		<p>Primary Button</p>
		<KendoReactButtons.Button primary>Primary Button</KendoReactButtons.Button>
		<p>Button with icon</p>
		<KendoReactButtons.Button icon="refresh">Refresh</KendoReactButtons.Button>
		<p>Button with icon (imageUrl)</p>
		<KendoReactButtons.Button imageUrl="http://demos.telerik.com/kendo-ui/content/shared/icons/sports/snowboarding.png">Snowboarding</KendoReactButtons.Button>
		<p>Button with a custom icon (iconClass) [FontAwesome icon]</p>
		<KendoReactButtons.Button iconClass="fa fa-key fa-fw">FontAwesome icon</KendoReactButtons.Button>
		<p>Toggleable Button</p>
		<KendoReactButtons.Button togglable>Togglable button</KendoReactButtons.Button>
		<p>onClick event handler</p>
		<ButtonContainer />
	</div>,
	document.getElementById('app')
);
```

Open `app.css` and add the following to the file:

```
body{
	margin:50px;
}
```

Open math.js and add the following to the file:

```
export const sqrt = Math.sqrt;

export function square(x) {
    return x * x;
}
export function diag(x, y) {
    return sqrt(square(x) + square(y));
}
```

Open `index.html` and add the following to the file:

```
<!DOCTYPE html>
<html>
    <head>
		<title>webpack</title>
		 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
		<link rel="stylesheet" type="text/css" href="./build/style.css">
    </head>
<body>
    <div id="app"></div>
	<script src="./build/appBundle.js"></script>
</body>
</html>
```

### Step 5: Update webpack.config.js

Open webpack.config.js and add the following to the file:

```
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
	entry: ['./src/app.js'],
	output: {
		path: path.resolve(__dirname, 'build'),
		filename: 'appBundle.js'
	},
	module: {
		loaders: [{
			test: /\.css$/,
			loader: ExtractTextPlugin.extract("style-loader", "css-loader")
		}, {
			loader: 'babel-loader',
			exclude: /node_modules/,
			test: /\.js$/,
			query: {
				presets: ['es2015', 'react', 'stage-0'],
			},
		}]
	},
	plugins: [
		new ExtractTextPlugin("style.css", {
			allChunks: true
		})
	]
};
```

### Step 6: Update package.json

Open the package.json file which should look something like this:

```
{
  "devDependencies": {
    "babel-core": "^6.8.0",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-0": "^6.5.0",
    "browser-sync": "^2.12.7",
    "css-loader": "^0.23.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.0"
  },
  "dependencies": {
    "@telerik/kendo-react-buttons": "^0.1.0",
    "react": "^15.0.2",
    "react-dom": "^15.0.2"
  }
}
```

Add the following scripts configurations to the `package.json` file.

```
{
  "scripts": {
    "webpack": "webpack --watch",
    "server": "browser-sync --port 4000 start --server --files \"**/*.html\" \"build/**/*.css\" \"build/**/*.js\" "
  },
  "devDependencies": {
    "babel-core": "^6.8.0",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-0": "^6.5.0",
    "browser-sync": "^2.12.7",
    "css-loader": "^0.23.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.0"
  },
  "dependencies": {
    "@telerik/kendo-react-buttons": "^0.1.0",
    "react": "^15.0.2",
    "react-dom": "^15.0.2"
  }
}
```

### Step 7: Run webpack and server

From the root of the setup directory open a command prompt and run the following npm command

```
> npm run webpack
```

Next, open another new command prompt and run the following npm command

```
> npm run server
```

Both of these commands will continue to run while developing.

If you followed all the steps correctly Browser Sync should have open a browser running the `index.html` file and `app.js` file at [http://localhost:4000](http://localhost:4000). Both webpack and Browser Sync have been configured to re-run when changes are made.


text:
## 1. 源码

```
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct Image : Equatable {

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (lhs: Image, rhs: Image) -> Bool
}

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Image {

    /// Creates a labeled image usable as content for controls.
    ///
    /// - Parameters:
    ///     - name: the name of the image resource to lookup, as well as
    ///       the localization key with which to label the image.
    ///     - bundle: the bundle to search for the image resource and
    ///       localization content. If `nil`, uses the main `Bundle`.
    ///       Defaults to `nil`.
    public init(_ name: String, bundle: Bundle? = nil)

    /// Creates a labeled image usable as content for controls, with an custom
    /// specified label.
    ///
    /// - Parameters:
    ///     - name: the name of the image resource to lookup
    ///     - bundle: the bundle to search for the image resource.
    ///       If `nil`, uses the main `Bundle`. Defaults to `nil`.
    ///     - label: The label associated with the image. The label is used for
    ///       things like accessibility.
    public init(_ name: String, bundle: Bundle? = nil, label: Text)

    /// Creates an unlabeled, decorative image.
    ///
    /// - Parameters:
    ///   - name: the name of the image resource to lookup
    ///   - bundle: the bundle to search for the image resource. If `nil`, uses
    ///     the main `Bundle`. Defaults to `nil`.
    ///
    /// This image will be specifically ignored for accessibility purposes.
    public init(decorative name: String, bundle: Bundle? = nil)

    @available(OSX, unavailable)
    public init(systemName: String)
}
```

## 2. 使用

repository: huandev/books

repo_name: huandev/books


text:
SpineTunes is a SoundCloud music player built on the Backbone.js Framework.

![SpineTunes Screenshot](/screenshot.png)

The App is build upon the Slim PHP REST framework, in case I decide to add more features that require it.

## License ##
I am releasing this code under the MIT license. SoundCloud images are property of SoundCloud.com and are therefore subject to different licensing.

repository: traviswimer/SpineTunes

repo_name: traviswimer/SpineTunes


text:
## Flight Trip Builder

Flight Trip Builder is a simple API for building flights trip based on simple request from user.
The project is built using Laravel framework.

## Installation
Run ```composer install```

Copy .env.example into your .env file with ```cp .env.example .env```

Run ```php artisan key:generate``` to generate Laravel encryption key.

Check the .env file, change the DB config to the your local DB config.

Run ```php artisan migrate``` to migrate database.

Run ```php artisan db:seed``` to add sample data to the tables.

Run ```php artisan serve```, by default, ```http://<IP_ADDRESS>:8000/``` should be up and running !!!

## How to test the API.

For simplicity purpose, the sample datas provide 3 airports from Montreal, Toronto and Vancouver respectively in the `airports` table. 2 airlines: `Air Canada` and `Air Transat` are provided in the `airlines` table.

24 flights with routes from and to : `Montreal<->Toronto`, `Toronto<->Vancouver`, `Montreal<->Vancouver`, from both 2 airlines, with two schedule hour `07:00` and `15:00` are created.

The real physical distance fact is ignored, These airports are considered as 3 points: A, B and C. (meaning there will be flight options from Montreal to Vancouver and then to Toronto if user want to arrive from Montreal to Toronto).

Open your favorite API client to test, mine is Postman ! Add these parameters:
```
{
    "departure_airport": "YUL",
    "arrival_airport": "YTZ",
    "departure_date": "2021-02-01",
    "return_date": "2021-02-20",
    "trip_type": "round-trip",
    "sort_by": "price",
    "sort_order": "asc",
    "preferred_airline": "Air Canada"
}

```
Optional Parameters are: `sort_by`, `sort_order` and `preferred_airline`. `return_date` is not required as long as the `trip_type` value is `one-way`.

Example of test url: ```http://<IP_ADDRESS>:8000/api/search_routes?departure_airport=YUL&arrival_airport=YTZ&departure_date=2021-02-01&return_date=2021-02-20&trip_type=round-trip```

** Remember to set your `Content-Type` Header to `application/json` !

** Feel free to fork.
## Author
Vinh Truong
https://github.com/vinhtruong94

## License

Code released under the [MIT license](https://opensource.org/licenses/MIT).


text:
# ros straightline

## what is this?

modifies keyboard teleop script. make barnacle move forward, regardless of user input key.

## why modify teleop?

learn how to hijack motor controls but posting commands to 'cmd_vel_mux/input/teleop' topic, which will be read by kobuki base. once we know how to control movement through a script and not through manual, we can move on to other automation.

## how?

### step 1: create ros package
always create ros package through catkin.
```
cd ~/catkin_ws/src
catkin_create_pkg ros_straightline std_msgs rospy
```

### step 2: create python script
```
cd cd ros_straightline
mkdir scripts # good practice to keep python scripts in a separate folder
touch straightline.py # dont forget to include #!/usr/bin/env python
chmod -x straightline.py # make it executable
```

### step 3: make & source
need to make, even for python executables.
```
cd ~catkin_ws
catkin_make
source ./devel/setup.bash
```

### step 4: execute
* from terminal 1, do `roslaunch turtlebot_bringup minimal.launch`
* from terminal 2, do `rosrun ros_straightline straightline.py`


text:
## What changed with this PR:

<!-- Quick summary of what is the purpose of this PR -->

## Example

```java
// Input

// Output

```

## Relative issues or prs:

<!--
Please also reference the issue number in a commit message to [automatically close the related Github issue](https://help.github.com/articles/closing-issues-via-commit-messages/)
-->

repository: jhipster/prettier-java

branch_name: refs/heads/main

gha_language: Java

repo_name: jhipster/prettier-java


text:
---
identifier: MIR:00000312
name: TreeBASE
description: TreeBASE is a relational database designed to manage and explore information on phylogenetic relationships. It includes phylogenetic trees and data matrices, together with information about the relevant publication, taxa, morphological and sequence-based characters, and published analyses. Data in TreeBASE are exposed to the public if they are used in a publication that is in press or published in a peer-reviewed scientific journal, etc.
prefix: treebase
pattern: ^TB[1,2]?:[A-Z][a-z]?\d+$
prefixed: 0
local_id: TB2:S1000
resources:
 - identifier: MIR:00100395
   accessurl: http://purl.org/phylo/treebase/phylows/study/${lid}?format=html
   keyword: Out of Anatolia: Longitudina
   description: TreeBASE (hosted at National Evolutionary Synthesis Center)
   homepage: http://treebase.org/
   institution: Phyloinformatics Research Foundation, Durham, North Carolina
   location: USA
   official: false
---

repository: cmungall/registry

repo_name: cmungall/registry


text:
---
title: 'View Me First: The Crockford Clips'
id: 205
categories:
  - Review
date: 2007-03-06 06:00:00
tags:
 - Ajax
---

Sure, "The JavaScript Programming Language" and "Advanced JavaScript" are dull titles, but [the videos clips](http://developer.yahoo.com/yui/theater/) are anything but. Speaking with an insider's perspective, Yahoo! JavaScript Architect Douglas Crockford first explains why "Javascript is the world's most misunderstood language" and then steps quickly through the whys, wherefores, and howtos of the web's best friend. Crockford invented the notion of using JSON as an Ajax payload, and the videos reflect his innovative and pragmatic view of JavaScript as a strange but powerful programming language.

If you are just learning JavaScript, view these clips first. If you think you know JavaScript, view these clips now, and find out what the language really can do.

The "Crockford Clips" are from three live teaching sessions covering JavaScript, the DOM, and Advanced JavaScript. Viewing all three sets (in that order) is well worth the time, if only for Crockford's insider asides on the politics-err-process of language and browser development.

Some key takeaways from all three sessions:

*   Learn to like loose typing
*   Learn to love objects as containers
*   Think prototypes, not classes
*   There are six values; everything else is an object
*   Be wary of uncommon arithmetic
*   NaN is a perplexing value (and toxic!)
*   Globals are evil

*   Use a platform library
*   Be correct, be common, be standard
*   The wrong people are writing our standards

*   Globals are still evil
*   Prefer power constructors
*   Work with the grain
*   Native JavaScript patterns create elegant reuse
*   Debuggers work, use one
*   Local variables are cheap, use them.
*   Minify and gzip, but do not obsuficate
*   JSON rocks!
Hint: Save yourself some pausing. Download the slides first, and click along on a second monitor or laptop. And before commenting on slide 63, read the other reviews :)


text:
# BazaarRealmClient

A Rust DLL that handles making requests to the
[`BazaarRealmAPI`](https://github.com/thallada/BazaarRealmAPI) web server for
the [`BazaarRealmPlugin`](https://github.com/thallada/BazaarRealmPlugin),
part of the Bazaar Realm Skyrim mod.

It uses [`reqwest`](https://crates.io/crates/reqwest) to make requests to the
API, deserializes the data with [serde](https://crates.io/crates/serde), and
saves the responses to files in the Skyrim data directory to use as a local
cache when the API server is unavailable.

[cbindgen](https://crates.io/crates/cbindgen) automatically generates the
header file needed for the `BazaarRealmPlugin` (written in C++) to call into
this DLL.

Related projects:

- [`BazaarRealmAPI`](https://github.com/thallada/BazaarRealmAPI): API server
  for the mod that stores all shop data and what this client talks to
- [`BazaarRealmPlugin`](https://github.com/thallada/BazaarRealmPlugin): SKSE
  plugin for the mod that modifies data within the Skyrim game engine and calls
  the methods in this client
- [`BazaarRealmMod`](https://github.com/thallada/BazaarRealmMod): Papyrus
  scripts, ESP plugin, and all other resources for the mod

repository: thallada/BazaarRealmClient

repo_name: thallada/BazaarRealmClient


text:
# Products Admin
Simple universal admin app for sales team.

## Description

Admin app on pure Javascript

## Installing

### Clone
Clone this repo to your local machine using ```git clone https://github.com/olivervaz/products-admin.git```.

### Setup
For update and install all required packages use ```npm install```

### Executing program

* Start develop server with ```npm run develop```
* Start production server with ```npm run build```

## Version History

* 1.0.0
    * Initial Release

## Acknowledgments

Inspiration, etc.
* https://course-js.javascript.ru/

repository: olivervaz/products-admin

gha_language: JavaScript

gha_license_id: MIT

repo_name: olivervaz/products-admin


text:
# vayumalinyabot Bot

## About

This is a Bot for the Telegram instant messaging service that sends you air quality data retrieved from openaq.org.
It answers when you send it your current location or the name of a place that you want to know about.

## Get started

This bots runs in Telegram. If you just want to try it out go to t.me/vayumalinyabot.
If you want to run the bot on your own server download the code and run the `npm start` task.
You will have to set up the following environment variables to make it run properly:

`APP_URL` public url where your server can be reached

`GOOGLE_GEOCODING_API_KEY` an api key for the google geocoding api (it might actually run without it but you will be restricted to a small number of calls per minute)

`TELEGRAM_TOKEN` the api token of your telegram bot.

## Tech

This bot runs as a minimalistic node.js server that receives the Telegram messages send to it as POST requests.
If a location is sent, it simply looks up the latest data for the given coordinates in a 25 km radius.
If an address is sent, it fist calls the Google Maps Geocoding API (https://developers.google.com/maps/documentation/geocoding) to get the coordinates for the address.
The bot returns only data more recent than 3 days and preferres measurements close to the given coordinates.

repository: gopavasanth/vayumalinyabot

repo_name: gopavasanth/vayumalinyabot


text:
# Marvel app: Platzi master project

This repo is the result of a one week project from platzi master.

## Getting Started

These instructions will give you a copy of the project up and running on
your local machine for development and testing purposes.

### Prerequisites

You must have installed node.js in your computer, see the  link for more info on how to get started with node.
- [Node.js](https://nodejs.org/en/)

### Installing

Once you make sure that you have node.js installed globally in your computer the next step is to either clone this repository to you computer or to download the project.

Up next you'll need to use preferred command console and make sure that you are on the right folder (That would be the main folder of the project the one that has this readme file in it)

Now we are ready.

firstly run the next command

    npm install

this will install the dependencies from the package.json

After we are done installing dependencies we'll need to create a file called '.env'

    touch .env

Then will write in this file our database connection and if we wish to we could also tell the app in which port to run but that is optional.
Check out the 'env.example' file so that you get a better idea on how to configurate your own file

Finally we can run this command

    npm run dev
If we wish to run the server with a developer configuration.

Or alternatively use this command

    npm start

Additionally  yo can run

    npm test

Just to see if everything is running as expected.

# Backend/API endpoints

Backend made with Express.

## Users

### Create a user

**method**: POST

**route**: /api/user/register

**body**:

```json
{
	"username": String,
    "email": String,
    "password" String
}
```
**Posible errors**:

**400**

if any of the three elements is missing or the info doesn't match the regex

**409**

If the username or email is already in use.

In case that something goes wrong with te data base and you user was not created then you'll get the following message:
"There was a problem creating your user"

**Success**:

**Status code**: 201

```json
{
	"Message": "User created"
}
```

### Loggin a user

**method**: POST

**route**: /api/user/login

**body**:

```json
{
	"username": String,
    "password" String
}
```
**Posible errors**:

**400**

if any of the two elements is missing or the info doesn't match the regex

**409**

If there is not an account with the username that was given.

If the password doesn't match the one that is linked to the username

**Success**:

**Status code**: 200

```json
{
	"jwt": String
}
```

### Get one user's favorite comics

**method**: GET

**route**: /api/user/favorites

**Athorization Bearer Token**: jwt

**Posible errors**:

**400**

if you don't have a bearer token

**401**

If your bearer token has expired

**409**

This shouldn't since there is no reason for the token to be modifed but:

If the id of the user is incorrect you'll get "User not found"

**Success**:

**Status code**: 200

```json
{
	"favorites": List[
        {
        "title": String,
        "description": String,
        "image": String,
        "publish": String,
        "coverArtist": String,
        "penciler": String,
        "writer": String
        },
    ]
}
```

### Add comics to a user's favorite comics

**method**: POST

**route**: /api/user/favorites

**Athorization Bearer Token**: jwt

**Body**:
```json

{
    "fav":[
        "title": String,
        "description": String,
        "image": String,
        "publish": String,
        "coverArtist": String,
        "penciler": String,
        "writer": String
    ]
}
```

**Posible errors**:

**400**

if you don't have a bearer token

**401**

If your bearer token has expired

**409**

If one of the comics that you are trying to add has the same title as one that is already in your list of favorites

This shouldn't since there is no reason for the token to be modifed but:

If the id of the user is incorrect you'll get "User not found"

**Succes**:

**Status code**: 200

```json
{
	"Message": "Comic added to user"
}
```

### Remove comics to a user's favorite comics

**method**: DELETE

**route**: /api/user/favorites

**Athorization Bearer Token**: jwt

**Body**:
```json

{
    "fav":[
        {
        "title": String,
        "description": String,
        "image": String,
        "publish": String,
        "coverArtist": String,
        "penciler": String,
        "writer": String
        }

    ]
}
```

**Posible errors**:

**400**

if you don't have a bearer token

**401**

If your bearer token has expired

**409**

If the comic list that is supposed to be removed is empty

If one of the comics that you are trying to add has the same title as one that is already in your list of favorites

This shouldn't since there is no reason for the token to be modifed but:

If the id of the user is incorrect you'll get "User not found"

**Succes**:

**Status code**: 200

```json
{
	"Message": "Comic removed"
}
```

## auth

### Both loggin and Sign up

**method**: GET

**route**: /api/auth/google

**Success**: **Redirect to**: /api/auth/register

**Status code**: 200

```json
{
	"jwt": String
}
```

## comics

### Get comics of a given hero

**method**: GET

**route**: /api/comics/

**Athorization Bearer Token**: jwt

**Param**: heroname = String, numberComics = Number, offset = Number default: 0

**Posible errors**:

**400**

if you don't have a bearer token

**401**

If your bearer token has expired

**409**

If the name of the hero you gave doesn't match any on marvel's api

**Success**

**Status code**: 200

```json
{
    "heroInfo":
        {
            "heroName": String,
            "heroDescription": String,
            "heroImage": String
        },

    "comicsArray": List[
                {
            "title": String,
            "description": String,
            "image": String,
            "publish": String,
            "coverArtist": String,
            "penciler": String,
            "writer": String
            },
    ],
    "offset": Number
}
```

### Get random comics

**method**: GET

**route**: /api/comics/randoms

**Athorization Bearer Token**: jwt

**Param**: numberComics = number of comics that you want to get

**Status code**: 200

```json
{
    "comicsArray": List[
                {
            "title": String,
            "description": String,
            "image": String,
            "publish": String,
            "coverArtist": String,
            "penciler": String,
            "writer": String
            },
        ]
}
```

# Author

  - **Jorge Alberto Delgadilo Alonso**


text:
---
layout: default
---

# 1996-11-17 - Re: MSIE 128 Bit

## Header Data

From: Alex de Joode<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: a009a8f7155f012e516d5cf16cfee5223a6edd8f473622763adc8dcbb8cab0d3

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-11-17 19:07:56 UTC

Raw Date: Sun, 17 Nov 1996 11:07:56 -0800 (PST)

## Raw message

```
{% raw  %}From: Alex de Joode<EMAIL_ADDRESS>Date: Sun, 17 Nov 1996 11:07:56 -0800 (PST)
To<EMAIL_ADDRESS>Subject: Re: MSIE 128 Bit
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Dr.Dimitri Vulis KOTM<EMAIL_ADDRESS>wrote:

: Steve Shelby<EMAIL_ADDRESS>writes:
: >
: > Microsoft has a 128 bit version of their Explorer available.
: >
: > You have to jump through a few hoops, but they have it.

: How about maiking available on a European mirror site with no questions asked?

ftp.replay.com/pub/replay/pub/incoming/0-microsoft/ has one 128 bit version.

--
 Alex de Joode		    http://www.replay.com/people/adejoode
 I have a linux emulator for Win95: it's called "loadlin" ... *g*

{% endraw %}
```

## Thread

+ Return to [November 1996](/archive/1996/11)

+ Return to "[Alex de Joode <usura@replay.com>](/authors/alex_de_joode_usura_at_replay_com_)"

+ 1996-11-17 (Sun, 17 Nov 1996 11:07:56 -0800 (PST)) - Re: MSIE 128 Bit - _Alex de Joode<EMAIL_ADDRESS>


text:
# From the book:

Functions help you abstract away complex operations, but they also help you build reusable components.

Create a program that determines the complexity of a given password based on these rules:

* A very weak password contains only numbers and is fewer than eight characters.
* A weak password contains only letters and is fewer than eight characters.
* A strong password contains letters and at least one number and is at least eight characters.
* A very strong password contains letters, numbers, and special characters and is at least eight characters.

**Example Output**

The password '12345' is a very weak password.
The password 'abcdef' is a weak password.
The password 'abc123xyz' is a strong password.
The password '1337h@xor!' is a very strong password.

<br />

For more "**Constraint**" and "**Challenges**".
Check the book:
"Exercises for Programmers: 57 Challenges to Develop Your Coding Skills"
https://pragprog.com/book/bhwb/exercises-for-programmers


text:
# IAP module.

This module provides the GCP resources related to setting up [IAP](https://cloud.google.com/iap). IAP restrict access to applications. IAP can be used to protect both internal facing and internal facing applications.

This module sets the IAP allowlist at the project level. This means that applications protected using the OAuth client created from this module will have the same allowlist, specified by the input web_user_members.

## Usage

```tf
module "dc_iap" {
  source                   =  "../../modules/iap"

  project_id               = "my-project-id"
  brand_support_email      = "my-brand-support-email"
  web_user_members         = [ "user1@domain", "user2@domain" ... ]
}
```

Note: Change the source path if the caller module is not from a particular example in the examples folder.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| brand\_support\_email | Who to contact for issues related to installed applications. | `string` | n/a | yes |
| web\_user\_members | A list of users allowlisted for applications controlled using IAP. | `List[string]` | `website-ksa` | no |
| project\_id | GCP project id where the DC applications will be running in.| `string` | n/a | yes |

repository: shifucun/website

gha_language: TypeScript

repo_name: shifucun/website


text:
# chromatism-syntax-converter
Work in progress attempt to convert highlight.js syntax definitions to [Chromatism](https://github.com/anviking/Chromatism)

## FAQ
### Is this working?
No.
### Have I created something in this language before?
Basically, no.
### Is this a good idea?
In the long turn - no. Currently - maybe. If this can be done good enough for all languages without too much effort it's defenitly worth it.
## How much is it not working?
Currently this is extracting comment and keyword expressions from every highlight.js language, converts them slightly and prints pseudo-code (that wouldn't compile without some modifications).

repository: Anviking/chromatism-syntax-converter

repo_name: Anviking/chromatism-syntax-converter


text:
# Angular Service Workers - Progressive Web Applications (PWA)

Progressive Web Applications (PWA) allow a web application to behave more like a native application.  PWA support caches the entire application locally, allowing the application to run even when the network is unavailable, as well as improving startup performance.  Angular nativly supports PWA using service workers.  Angular maintains the application manifest and downloads the full application in the background after the home page is ready, and when changes exist, switches to the new version at next startup.

Progressive Web Applications (PWA) and Service Workers are not specific to Angular and supported across all modern major browsers, but for the purpose of this document, we will only be discussing how to implement this capability into an Angular application.

## Steps

1. Add a Service Worker to the project

```cmd
ng add @angular/pwa --project <project-name>
```

2. Service Workers do not support ```ng serve``` and must be tested using a production build and an HTTP server.  If you do not have an http server globally installed, it is recommended to install the following one shown below:

```cmd
npm install -g http-server
```

3. Build and run the production project for testing the new Service Worker capabilities

    * ```<project-name>``` is only needed if your project is in a subfolder under ```dist/```

```cmd
ng build --prod
http-server -p 8080 -c-1 dist/<project-name>
```

4. Launch the browser, open its debugging tools, and go to the network tab.  Entering the website's URL, while watching the network tab should show the Service Worker loading all the applicatiuon's files locally.

5. After the initial load is complete, refreshing the application using ```F5``` should show the application now reloading from the Service Worker local files rather than the network.  For this process, the Service Workers looks at the application manifest to determine if any files have changed.  A file will be served from its local copy anytime that file has not changed, or the network is unavailable.

6. The network tab should have an option for switching between online and offline.  Changing this setting to offline and refreshing the application should show the application continuing to function with the network unavailable.

It is up to the application to determine how to handle remote API calls or access to other remote systems when the network is offline.  The browser exposes a variable named ```window.navigator.onLine``` for the status of network connectivity.  It is best to wrap this variable in an event listner to be notified whenever its status changes.  The following is a simple service to wrap this variable in a BehaviorSubject for easier event notification.  This server is available as an NPM package named ```angular-connectivity```

```js
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable()
export class ConnectivityService {

    private isConnected = new BehaviorSubject<boolean>(!!window.navigator.onLine);
    isConnected$ = this.isConnected.asObservable();

    constructor() {
        window.addEventListener('online', () => {
            this.isConnected.next(!!window.navigator.onLine);
            console.log('Internet connection established');
        });
        window.addEventListener('offline', () => {
            this.isConnected.next(!!window.navigator.onLine);
            console.log('Internet connection lost');
        });
    }

}
```

Leveraging the ```angular-connectivity``` in combination with conditionals like *ngIf allows for making UI or logic decisions based on connectivity.  For example, certian menu items can be hidden or disabled when network connectivity is not available.  Similarly, data changes could be saved locally when connectivity is not available, and later sent to a remote API when network connectivity is re-established.  Both of these examples can be seen in the demo application named ```angular-template``` located here [https://github.com/PaulGilchrist/angular-template](https://github.com/PaulGilchrist/angular-template)

## References

* [Service Workers - Practical Guided Introduction (several examples)](https://blog.angular-university.io/service-workers/)
* [Getting Started with Service Workers](https://angular.io/guide/service-worker-getting-started)
* [Angular Service Worker - Step-By-Step Guide for turning your Application into a PWA](https://blog.angular-university.io/angular-service-worker/)
* [Angular Service Worker Introduction](https://angular.io/guide/service-worker-intro)
* [Service Worker Communication](https://angular.io/guide/service-worker-communications)
* [Service Worker in Production](https://angular.io/guide/service-worker-devops)

repository: PaulGilchrist/documents

repo_name: PaulGilchrist/documents


text:
# HUST_Solfege

**HUST_Solfege** is a public solfege dataset for solfege assessment, you can also use this dataset for solfege onset detection or note transcription.

------------------------------------------------------------------------------
**HUST_Solfege** contains 103 audios  including 73 self-built solfege recordings and 30 singing recordings from [MARG](http://marg.snu.ac.kr/automatic-music-transcription/?doing_wp_cron=1554862378.4888939857482910156250).

Among these recordings are 31 male recordings, 35 female recordings and 37 juvenile  recordings. All of the audios are stored as monophonic, 44100Hz sampling rate and 16-bits wav files. Each audio includes  a complete piece of music corresponding to a provided music score.

The statistics of HUST-Solfege is below.

Solfege type|Number of recordings|Number of onset
---|---|---
Male|31|1444
Female|35|1532
Juvenile|37|2092
**TOTAL**|**103**|**5110**

This dataset includes three files in repository: 1) *wav*, 2) *onset&pitch* and 3) *alignment*.

The description of wav files is stated above. All the audios are compressed in ZIP format.

The *onset&pitch* contains the notations for onset and actual pitch of each recording. The notations for offset **haven't** been done yet, please ignore the offset part, it will be completed in future work.
The format of txt in *onset&pitch* is below.

onset|offset|pitch
---|---|---
...|...|...

Note: The 30 recordings from *MARG* are just for onset detection. Pitch notations are not done for MARG recordings.

The *alignment* contains 30 txt file for alignment relationship between actual pitch and score note.
The statistics of the test set is also available in *statistics_of_testset.txt*.
Note: Test recordings are randomly selected from 73 solfege recordings.


text:
* What is the difference between classes and IDs in CSS?

  Classes can be assigned to multiple elements and also elements can have more than one class.  Id's must be unique, therefore can only be assigned to one element.

repository: kjng/interview-questions

repo_name: kjng/interview-questions


text:
# Amazon-Quiz
Amazon Quiz Answers development code
Code to develop AI based engine to get daily answrs to amazon Quiz. implementatiojn on [Amazon Quiz Answers](https://expertdealz.com/amazon-quiz-answers/)

The Amazon quiz answers updates everyday at 8 AM.
Visit [Amazon Quiz](https://expertdealz.com/) to get the latest Quiz Answers.
Thanks.

repository: expertdealz/Amazon-Quiz

repo_name: expertdealz/Amazon-Quiz


text:
# Texas boy recovering from dog mauling after multiple surgeries: reports

Published at: **2019-11-01T09:30:32+00:00**

Author: **Dom Calicchio**

Original: [Fox News](https://www.foxnews.com/health/texas-boy-recovering-from-dog-mauling-after-7-surgeries-reports)

A 9-year-old Texas boy has been cleared to go home Friday after undergoing multiple surgeries following a dog attack, according to reports.
This week Austyn Clanton of Beaumont told a reporter what was happening in the moments leading up to the mauling.
“Me and my big brother were fighting,” Austyn told Houston’s KPRC-TV. “The American bulldog jumped on me. He started biting and scratching.”

          MICHIGAN BOY, 4, FATALLY MAULED BY 60-POUND PIT BULL: POLICE

According to Austyn, the dog, named Mattis, was trying to protect his older brother, Trystan.
"Mattis was trying to protect Trystan and Mattis attacked me," he told Houston's FOX 26. "I got in the house but he still wouldn't get off."

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# BLOG-APP
## Created by : Ephraim Murimi
This is a flask application that allows users to create and post their BLOGS.

## Setup Requrements
* Github
* Flask
* Python
* Web browser

## Instructions
* Clone the repo to your computer.
* Open your terminal and navigate to the project directory.
* Run chmod a+x start.sh
* Run ./start.sh
* Follow navigation directions provided.

## Development and modifications
* To make advancements/modifications, follow these steps:

* Fork the repository
* Create a new branch (git checkout -b improve-feature)
* Make the appropriate changes in the files
* Add changes made
* Commit your changes.
* Push to the branch

## Technologies Used
* Pythonv3.8
* Flask
* Bootstrap
* HTML
* CSS
This project was built using Pythonv3.8

## License
Copyright © 2021. [MIT] (https://choosealicense.com/licenses/mit/)


text:
---
layout: post
title: "Parallel processing"
published: false
categories: [python]
---

### pool.map - multiple arguments

### List of lists
`pool.map` accepts only a list of single parameters as input. Multiple parameters can be passed to pool by a list of parameter-lists, or by setting some parameters constant using partial.

```python
import multiprocessing
import numpy as np

data_pairs = [ [3,5], [4,3], [7,3], [1,6] ]

# define what to do with each data pair ( p=[3,5] ), example: calculate product
def myfunc(p):
    product_of_list = np.prod(p)
    return product_of_list

if __name__ == '__main__':
    pool = multiprocessing.Pool(processes=4)
    result_list = pool.map(myfunc, data_pairs)
    print(result_list)

[15, 12, 21, 6]
```

### using partial()
`partial` can be used to set constant values to all arguments which are not changed during parallel processing, such that only the first argument remains for iterating.

```python
import multiprocessing
from functools import partial

data_list = [1, 2, 3, 4]

def prod_xy(x,y):
    return x * y

def parallel_runs(data_list):
    pool = multiprocessing.Pool(processes=4)
    prod_x=partial(prod_xy, y=10) # prod_x has only one argument x (y is fixed to 10)
    result_list = pool.map(prod_x, data_list)
    print(result_list)

if __name__ == '__main__':
    parallel_runs(data_list)

[10, 20, 30, 40]
```

[1]: https://sites.google.com/site/python3tutorial/multiprocessing_map " Parallel processing"

[2]: https://stackoverflow.com/questions/25553919/passing-multiple-parameters-to-pool-map-function-in-python "Passing multiple parameters to pool.map()"

[3]: https://sites.google.com/site/python3tutorial/multiprocessing_map/multiprocessing_partial_function_multiple_arguments "pool.map - multiple arguments"

gha_language: HTML


text:
# Service Generator
Generates a service with Node, packaged and composed with Docker

## Setup

    npm install -g yo gulp

Clone the generator then run:

    npm link

## Sequence
1. Create a blank repo on github, clone to local system.
2. Run `yo service`
3. Commit and push.

repository: hharnisc/generate-service

repo_name: hharnisc/generate-service


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

### Description

HashiCorp Consul Enterprise before 1.8.17, 1.9.x before 1.9.11, and 1.10.x before 1.10.4 has Incorrect Access Control. An ACL token (with the default operator:write permissions) in one namespace can be used for unintended privilege escalation in a different namespace.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/nelsondurairaj/CVE-2021-41805

repository: trickest/cve

repo_name: trickest/cve


text:
# Lesson 4: Functions and arrays

## Table of Contents

- [Lesson 4: Functions and arrays](#lesson-4-functions-and-arrays)
  - [Table of Contents](#table-of-contents)
  - [Coming Soon](#coming-soon)
  - [Objective 1: How do you even function](#objective-1-how-do-you-even-function)
  - [Objective 2: Function arguments](#objective-2-function-arguments)
  - [Objective 3: In splendid array](#objective-3-in-splendid-array)
  - [Objective 4: Accessing arrays](#objective-4-accessing-arrays)
  - [Objective 5: Array built-in functions](#objective-5-array-built-in-functions)

## Coming Soon

Lesson 4 is coming soon, watch this space!
## Objective 1: How do you even function

## Objective 2: Function arguments

## Objective 3: In splendid array

## Objective 4: Accessing arrays

## Objective 5: Array built-in functions

repository: CozmoCyke/twilioquest-resources

repo_name: CozmoCyke/twilioquest-resources


text:
[com.coinzgame.theoxo.coinz](../index.md) / [BankCoinsFromWalletThenInboxTest](index.md) / [setUpDatabase](.)

# setUpDatabase

`fun setUpDatabase(): Unit`

Set up the database entry for the test user before running the test so that it is repeatable.
Specifically this sets the user to have a "fresh" bank account and 30 valid coins in
their wallet, plus a message with 5 coins in it in their inbox.
This requires that a user with email<EMAIL_ADDRESS>and
password "testtest111" is registered in the authentication service.

repository: theoxo/CoinzAndroidGame

repo_name: theoxo/CoinzAndroidGame


text:
# Test Case R2
Test Data:
```
test_user = User(
<EMAIL_ADDRESS>
name='test_frontend',
password=generate_password_hash('test_frontend')
)
```
```
test_user_false1 = User(
<EMAIL_ADDRESS>
name='test_frontend',
password=generate_password_hash('incorrect_password')
)
```
## [GET]
#### Test Case R2.1 - If the user has logged in, redirect back to the user profile page

Mocking:

 -  Mock backend.get_user to return a test_user instance

Actions:

 -  open /logout (to invalidate any logged-in sessions that may exist)
 -  open /login
 -  enter test_user's email into element  `#email`
 -  enter test_user's password into element  `#password`
 -  click element  `input[type="submit"]`
 -  open /login again
 -  validate that current page contains  `#welcome-header`  element
#### Test Case R2.2 - otherwise, show the user registration page
Mocking:

 -  Mock backend.get_user to return a test_user instance

Actions:

 - open /logout (to invalidate any logged-in sessions that may exist)
 - open /register
 - validate that current page contains`#button-register`
#### Test Case R2.3 - the registration page shows a registration form requesting: email, user name, password, password2
Actions:

-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
-  validate that current page contains  `#email`  element
- validate that current page contains  `#name`  element
-  validate that current page contains  `#password`  element
- validate that current page contains  `#password2`  element
## [POST]
#### Test Case R2.4 - The registration form can be submitted as a POST request to the current URL (/register)
Mocking:

-  Mock backend.get_user to return a test_user instance

Actions:

-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
-  validate that current page contains  `#email`  element
-  validate that current page contains  `#name`  element
-  validate that current page contains  `#password`  element
-  validate that current page contains  `#password2`  element
-  enter test_user's email into element  `#email`
- enter test_user's username into element  `#name`
-  enter test_user's password into element  `#password`
- enter test_user's password into element  `#password2`
-  validate that current page contains  `#register`  button
-  validate that  `#register`  button points to `/register`
#### Test Case R2.5 - Email, password, password2 all have to satisfy the same requirements as defined in R1
Mocking:

-  Mock backend.get_user to return a test_user instance

Actions:
 -  open /logout (to invalidate any logged-in sessions that may exist)
 -  open /register
##### Check that fields are not empty:
Actions:
 -  enter test_user's email into element  `#email`
  -  enter test_user's username into element  `#name`
 -  enter test_user's password into element  `#password`
 -   enter test_user's password into element  `#password2`
 - click element  `input[type="register"]`
 -  validate that current page contains  `#welcome-header`  element

##### Check that email follows addr-spec defined in RFC 5322:
Actions:
 -  enter test_user's email into element  `#email`
 - validate that the `#email` element meets regex `"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)"`
 ##### Check if password and password2 have minimum length 6, at least one upper case, at least one lower case, and at least one special character:
 Actions:
- enter test_user's email into `#email`
- enter `abc` into element `#password` and `password2`
-  validate that the `#error_message` shows `Password not long enough`
-  enter test_user's email into `#email`
-  enter `abcd123!` into element `#password` and `password2`
-  validate that the `#error_message` shows `Password needs a capital letter`
-  enter test_user's email into `#email`
-  enter `ABCD123!` into element `#password` and `password2`
-  validate that the `#error_message` shows `Password needs a lowercase letter`
-  enter test_user's email into `#email`
-  enter `Abcd123` into element `#password` and `password2`
-  validate that the `#error_message` shows `Password needs a special character`

 #### Test Case R2.6 - Password and password2 have to be exactly the same
 Mocking:

-  Mock backend.get_user to return a test_user instance
Actions:

-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
- enter test_user's email into element  `#email`
-   enter test_user's name into element  `#name`
 -  enter test_user's password into element  `#password`
 - enter a different password into element  `#password2`
 - click element  `input[type="register"]`
 - validate that current page contains `button-register`
 - validate that current page displays error message `passwords do not match`

 #### Test Case R2.7 - User name has to be non-empty, alphanumeric-only, and space allowed only if it is not the first or the last character.
Mocking:

-  Mock backend.get_user to return a test_user instance

Actions:

-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
- enter test_user's name into element  `#name`
- enter ` ` name into element `#name`
- validate that the `#error-message` shows `Please fill out this field`
-  enter test_user's name into element  `#name`
-  enter `John!` name into element `#name`
- validate that the `#error-message` shows `Name cannot contain special characters`
-  enter test_user's name into element  `#name`
-  enter `   John   ` name into element `#name`
- validate that the `#error-message` shows `Name cannot contain spaces at beginning or end`

 #### Test Case R2.8 - User name has to be longer than 2 characters and less than 20 characters.

Mocking:

-  Mock backend.get_user to return a test_user instance

Actions:

-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
- enter test_user's name into element  `#name`
- enter `a` name into element `#name`
- validate that the `#error-message` shows `Name must be more than 2 characters`
- enter test_user's name into element  `#name`
- enter `abcdefghijklmnopqrstuv` name into element `#name`
- validate that the `#error-message` shows `Name must be less than 20 characters`

#### Test Case R2.10 - For any formatting errors, redirect back to /login and show message '{} format is incorrect.'.format(the_corresponding_attribute)
#### Positive:
Actions:

-  open /logout (to invalidate any logged-in sessions that may exist)
- open /register
-  enter test_user's email into element  `#email`
-  enter test_user's name into element  `#name`
- enter test_user's password into element  `#password`
 - enter test_user's password into element  `#password2`
 - click element  `input[type="register"]`
 -  validate that current page contains  `#welcome-header`  element

#### Negative:
Actions:
-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
- enter test_user's email into element  `#email`
-  enter test_user's name into element  `#name`
- enter test_user's password into element  `#password`
 - enter test_user's password into element  `#password2`
- open /login
- validate that error message `'{} format is incorrect.'.format(the_corresponding_attribute)` is displayed

#### Test Case R2.11 - If the email already exists, show message 'this email has been ALREADY used'
Mocking:

-  Mock backend.get_user to return a test_user instance

Actions:
-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
- enter test_user's email into element  `#email`
- validate that `#error-message` shows `this email has been ALREADY used`

#### Test Case R2.12 - If no error regarding the inputs following the rules above, create a new user, set the balance to 5000, and go back to the /login page
Mocking:

-  Mock backend.get_user to return a test_user instance

Actions:
-  open /logout (to invalidate any logged-in sessions that may exist)
-  open /register
-  open /
- validate `balance-element` == 5000
- open /login


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

title: Chirality in a quaternionic representation of the genetic code
subtitle: ''
summary: ''
authors:
- Manuel
- Ramiro
- Vericat
tags: []
categories: []
date: '2016-01-01'
lastmod: 2020-12-15T09:27:59-03:00
featured: false
draft: false

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: ''
  focal_point: ''
  preview_only: false

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
projects: []
publishDate: '2020-12-15T12:27:59.288932Z'
publication_types:
- '2'
abstract: ''
publication: '*BioSystems*'
url_pdf: https://www.scopus.com/inward/record.uri?eid=2-s2.0-84995685603&doi=10.1016%2fj.biosystems.2016.06.003&partnerID=40&md5=da137bdb6201ac073ef469823e86cd7c
doi: 10.1016/j.biosystems.2016.06.003
---