text:
# Integrate Watson IoT with HERE Tracking for real-time IoT device management and tracking

With the [Watson IoT Platform](https://internetofthings.ibmcloud.com/) and [HERE Tracking](https://developer.here.com/products/tracking) you can plan and monitor the safe and timely delivery of goods and supplies (e.g., food, medicine, livestock, etc.) in real-time.

Learn how to develop an IoT application with the Watson IoT Platform and [Node-RED](https://nodered.org/) that will gather data received from IoT sensors (e.g. vehicle GPS, edge devices, etc.). The geolocation data can then be integrated with HERE Tracking for route planning, geofencing, and visualization.

IBM Watson IoT service provides a platform that lets you manage, communicate with, and consume data from connected devices and gateways.

Node-RED is an open source visual programming tool that offers a browser-based flow editor for wiring together devices, APIs, and online services.

HERE Tracking is a location platform that makes it quick and easy to track your devices indoor and outdoor, see traces on a map, create geofences and get custom notifications.

# Learning Objective

In this tutorial, you will learn how to:

- Create an IoT application on IBM Cloud using Node-RED and Watson IoT
- Add and manage IoT devices with the Watson IoT Platform
- Integrate location awareness using cloud-to-cloud connection with HERE Tracking
- Add and manage virtual devices with HERE Tracking
- Send data from Watson IoT to HERE Tracking using Node-RED

To keep the focus primarily on the platforms and tools and not hardware or specific IoT devices, sample data will be coming from a simulator instead of an actual device.

# Prerequisites

- Clone the [GitHub repository](https://github.com/ibm/wiotp-here-tutorial) for this tutorial
- Register for an [IBM Cloud](https://cloud.ibm.com/registration) account
- Register for a [HERE](https://developer.here.com/ref/IBM_starterkit_WatsonIoT?create=Freemium-Basic) account
- (for simulating data) Laptop/workstation with [Node.js installed](https://developer.ibm.com/tutorials/learn-nodejs-installing-node-nvm-and-vscode/)

# Steps

1. [Create an Internet of Things Platform application](#create-an-internet-of-things-platform-application)
1. [Add an IoT Device Type and Device to Watson IoT](#add-an-iot-device-type-and-device-to-watson-iot)
1. [Simulate IoT data](#simulate-iot-data)
1. [Set up HERE Tracking](#set-up-here-tracking)
1. [Add a Virtual Device to HERE Tracking](#add-a-virtual-device-to-here-tracking)
1. [Route Watson IoT messages to HERE Tracking](#route-watson-iot-messages-to-here-tracking)
1. [Test the integration](#test-the-integration)

## Create an Internet of Things Platform application

The first step is to create an IoT application on IBM Cloud using the IBM Watson IoT Platform service and the Node-RED App Starter Kit.

Follow the instructions in [this tutorial](https://developer.ibm.com/tutorials/how-to-create-an-internet-of-things-platform-starter-application/) to provision a Node-RED App and Watson IoT Platform service.

## Add an IoT Device Type and Device to Watson IoT

After completing the previous step, you will have a Node-RED Starter Kit application connected to the IBM Watson IoT Platform. You can now proceed to adding a device to Watson IoT.

From your browser, access the [IBM Watson IoT Platform service created in the first step](https://internetofthings.ibmcloud.com/). Be sure to select your org:

![Select ORG](img/01-select-org.png)

#### Add a Device Type in the IBM Watson IoT Platform service

1. From the sidebar, select **Devices**
1. In the _Devices_ page, select the **Device Types** tab
1. Click **Add Device Type** to open the _Add Type_ form
1. Select **Device** for the _Type_
1. Enter a unique _Name_ for the device type (e.g., `wiotp-device-type-01`)
1. Click **Next**
1. Click **Finish**

#### Add a Device in the IBM Watson IoT Platform service

1. From the sidebar, select **Devices**
1. In the _Devices_ page, select the **Browse** tab
1. Click **Add Device** to open the _Add Device_ form
1. For _Device Type_, select the device type created earlier (e.g., `wiotp-device-type-01`)
1. Enter a unique _Device ID_ for the device (e.g., `wiotp-device-01`)
1. Click **Next**
1. Click **Next** on the _Device Information_ screen
1. Enter an optional **Authentication Token** or leave blank to be assigned a generated token
1. Click **Next** on the _Security_ screen
1. Click **Finish**

    Make note of the `Organization ID` and also the `Authentication Token` for the device.

    > **Note**: You will not be able to retrieve the `Authentication Token` later. This will be different from the service `Authentication Token` you will create in the below step.

#### Generate an API Key

1. From the sidebar, select **Apps**
1. In the _App_ page, select the **Browse** tab
1. Click **Generate API Key** to open the _Generate API Key_ form
1. (optional) Enter a _Description_ for the key
1. (optional) Enable and set a date for _API Key Expires_
1. Click **Next**
1. Select **Standard Application** for the _Role_
1. Click **Generate Key**

    Make note of the `API Key` and also the `Authentication Token` for the Watson IoT Platform service.

    > **Note**: You will not be able to retrieve the `Authentication Token` later. This will be different from the device `Authentication Token` you created in the above step.

1. Click **Close**

## Simulate IoT data

The tutorial provides some sample data and a basic simulator to send the data to the IoT platform. This can provide quick and easy testing of your set up.

#### View recent messages

1. From your browser

    1. Go back into the IBM Watson IoT Platform dashboard
    1. In the sidebar, select **Devices**
    1. In the _Devices_ page, select the **Browse** tab
    1. In the Devices list table, click the **→** button for your device

        ![Select device](img/02-device-detail.png)

    1. In the _Device Drilldown_ page, click on **Recent Events**

        Recent events/messages received by the device can be viewed in this section

#### Send messages using the simulator

To configure and run the simulator application

1. Go into the `simulator` directory of the cloned repo
1. Copy the `.env.example` file in the `simulator` directory, and create a new file named `.env`
1. Edit the newly created `.env` file and update the environment variables with values noted in the earlier steps:

    - `WIOTP_ORG_ID`: set to the Organization ID of your Watson IoT Platform service
    - `WIOTP_TYPE_ID`: set to the Name of your device type (e.g., `wiotp-device-type-01`)
    - `WIOTP_DEVICE_ID`: set to the Device ID of your device (e.g., `wiotp-device-01`)
    - `WIOTP_AUTH_TOKEN`: set to the Authentication Token of your device (not the service Authentication Token)

1. From a terminal:

    1. Go into the `simulator` directory of the cloned repo
    1. Install the dependencies: `npm install`
    1. Run the command: `node device-simulator.js sample-data/sample-data.json`

        The simulator will connect to your instance of Watson IoT Platform and the contents of the `sample-data/sample-data.json` file will be sent (mimicking possible data coming from a device).

After a few seconds, you should be able to see the messages show up in the device's _Recent Events_ table. Seeing these messages should confirm your set up is correct.

## Set up HERE Tracking

1. Sign in to the [HERE Tracking Admin Portal](https://admin.tracking.here.com/)
1. If you do not already have one, create a project in the Admin Portal: https://developer.here.com/documentation/tracking/dev_guide/topics/projects.html

    1. Click the **Create new project** button
    1. Enter a **Project name** in the _Create new project_ form
    1. Click the _I agree to the Developer Service Terms_ checkbox
    1. Click the **Create** button

        ![here create project](img/03-create-project.png)

         After a few seconds your project will be ready.

1. Click on the **App IDs** tab
1. Click on the **View App ID** button for the _Cloud-to-Cloud Connector_

    Make note of the `APP ID`.

## Add a Virtual Device to HERE Tracking

HERE Tracking is hardware-agnostic and can be used by any device that produces conforming telemetry. For devices that cannot make direct connections to HERE Tracking or do not provide proper telemetry data, [cloud-to-cloud connectivity](https://developer.here.com/documentation/tracking/dev_guide/topics/cloud-to-cloud-connection.html) is available.

In this tutorial, we will a set up cloud-to-cloud connection from IBM Cloud to HERE Tracking so messages received by Watson IoT platform can be converted into the proper format and sent to HERE Tracking.

For cloud-to-cloud connectivity, a virtual device is defined and registered. The hardware device would send its data to an external service (in the case, the Watson IoT Platform service), the data is properly formatted and forwarded to HERE Tracking (using the virtual device credentials).

#### Create a virtual device and obtain a license

From a terminal:

1.

    Make note of the `accessToken` returned in the response

1. Request a license for a virtual device by running:

    ```
    curl -X POST \
      https://tracking.api.here.com/registry/v2/<app_id>/devices?autoclaim=true \
      -H 'Authorization: Bearer <access_token>' \
      -H 'Content-Type: application/json' \
      -d '{ "devices": [ { "id": "<device_id>" } ] }'
    ```

    Replace `<app_id>` in the URL with your HERE Tracking project _Cloud-to-Cloud Connector_ **APP ID** obtained earlier in HERE Admin Portal. Replace `<access_token>` in the _Authorization_ header with the HERE API `accessToken` obtained in the previous step and replace `<device_id>` with the ID of your device created earlier (e.g., `wiotp-device-01`) in Watson IoT Platform.

    Make note of the `jobId` returned in the response.

1. Get the license from the job results by calling:

    ```
    curl -X GET \
      'https://tracking.api.here.com/registry/v2/<job_id>/results' \
      -H 'Authorization: Bearer <access_token>' \
      -H 'Content-Type: application/json'
    ```

    Replace `<job_id>` in the URL with the `jobId` obtained in the previous response. Replace `<access_token>` in the _Authorization_ header with the HERE API `accessToken` obtained earlier.

    Make note of the `deviceId` returned in the response.

#### View and configure the virtual device

1. Log in to the [HERE Tracking Workspace](https://app.tracking.here.com/workspace)
1. In the sidebar, select **Devices**
1. In the _Devices_ panel, select the newly registered device (i.e., `undefined`)
1. In the _Device details_ panel, click **Options** > **Edit device details**
1. Enter a _Name_ (e.g., `here-device-01`) for the device
1. Click **Save setup**
1. In the _Device details_ panel, in the _Report Location_ section, click **EDIT**
1. Set how you want the data reported in the Workspace dashboard. For example:

    ![Device report](img/04-device-report.png)

1. Click **Save**

Your HERE Tracking virtual device is now ready to start receiving messages and the report will update according to its _Report Location_ settings.

## Route Watson IoT messages to HERE Tracking

To forward the messages received by Watson IoT to HERE Tracking you will use Node-RED. The Node-RED application will be notified of events received by the Watson IoT Platform, convert the data to conform to HERE Tracking, and then send the updated data to HERE Tracking.

#### Add credentials node

1. Launch and access your Node-RED application provisioned in the beginning
1. Click the _Menu_ button in the top right
1. Click **Manage palette**
1. In the _User Settings_ panel, select the **Palette** tab
1. Select the **Install** tab
1. Search for `node-red-contrib-credentials`
1. Click the **install** button of for the `node-red-contrib-credentials` in the results
1. Click **Install** in the warning dialog
1. Click **Close** to close the _User Settings_ panel

#### Import the Node-RED flow

1. From the Node-RED editor, click the _Menu_ button in the top right
1. Click **Import**
1. In the _Import nodes_ dialog, select the **Clipboard** tab
1. Click the **select a file to import** button, then browse and open the `flow/wiotp-to-here-flows.json` file in the cloned repo
1. For _Import to_, select **new flow**
1. Click **Import**

The Node-RED flows should get loaded into your Node-RED editor.

#### Configure & deploy the Node-RED flows

1. In the _WIoTP to HERE Tracking_ flow, double click the **IBM IoT** node
1. In the _Edit ibmiot in node_ panel, update the fields accordingly:

    ![ibmiot node](img/05-ibmiot-node.png)

1. Click the Edit icon for the _API Key_ field and update the credentials:

    1. Enter a _Name_ (e.g., `WIoTP credentials`) for the credentials
    1. Enter the **API Key** and **API Token** you generated earlier for the Watson IoT Platform service
    1. For _Server-Name_, enter **`<org_id>.messaging.internetofthings.ibmcloud.com`** replacing `<org_id>` with your Watson IoT Platform service `Organization ID`
    1. Click **Update**

1. Click **Done**

1. Double click the **Set Credentials** node:

    1. Update the `HERE_ACCOUNT_EMAIL` and `HERE_ACCOUNT_PASSWORD` values with your specific HERE account credentials
    1. Update the `HERE_APP_ID` value to your HERE Tracking project _Cloud-to-Cloud Connector_ **APP ID** obtained earlier in HERE Admin Portal

        ![credentials node](img/06-creds-node.png)

    1. Click **Done**

1. Click the **Deploy** button in the top right to deploy the flows on IBM Cloud

## Test the integration

With the Watson IoT Platform service set up, the HERE Tracking configured, and the Node-RED flows deployed, you are ready to test and run the integration.

From a terminal, run the device simulator:

```
$ node device-simulator.js sample-data/boston-cambridge.json
```

If you look at the Node-RED editor, you should see in the _Debug_ sidebar responses from HERE Tracking after each message is sent. If everything is properly configured, the `statusCode` in the responses should be **200**.

In the [HERE Tracking Workspace page](https://app.tracking.here.com/workspace) for your virtual device, you should see the location of the device on the map. The location and map should update periodically depending on your report setting.

At this point, you should be able to add rules or geofencing information for your device in HERE Tracking and receive the appropriate notifications.

![here tracking geofence](img/07-here-geofence.png)

You may also replace the `sample-data/sample-data.json` file with other files containing sample data you wish to send.

> **Note**: You can generate your own sample data file to test by running the `generate-sample-data.js`. For example,
>  ```
>  node generate-sample-data.js -o "boston, ma" -d "cambridge, ma"
>  ```
> Run `node generate-sample-data.js --help` for available options and usage information.
>
> To run the script you'll need a HERE Location Services API key. Follow the instructions outlined in the [HERE Developer Portal](https://developer.here.com/sign-up) to [obtain a JavaScript API key](https://developer.here.com/documentation/authentication/dev_guide/topics/api-key-credentials.html). Then update the `HERE_API_KEY` variable in `.env` with your assigned API Key.

# Summary

Congratulations! You have now created a Node-RED and Watson IoT Platform application hosted in the IBM Cloud and integrated with HERE Tracking for location awareness.

In this tutorial, you learned how to provision the Watson IoT Platform service, create a Node-RED application, and configure cloud-to-cloud connectivity with HERE Tracking.

The integration between Watson IoT and HERE Tracking not only allows you to manage, plan, and monitor your IoT devices, but also incorporate geolocation information for real-time tracking, geofencing, and notification.

# Related links

- [Node-RED](https://nodered.org/)
- [IBM Watson IoT Platform](https://cloud.ibm.com/docs/IoT)
- [Create an Internet of Things Platform Starter application](https://developer.ibm.com/tutorials/how-to-create-an-internet-of-things-platform-starter-application/)
- [IBM Watson IoT Platform Javascript SDK](https://github.com/ibm-watson-iot/iot-nodejs)
- [HERE Tracking](https://app.tracking.here.com/)
- [Introducing HERE Tracking](https://developer.here.com/blog/introducing-here-tracking)
- [HERE Tracking Developer Guide](https://developer.here.com/documentation/tracking/dev_guide/index.html)
- [HERE Flexible Polyline encoding](https://github.com/heremaps/flexible-polyline)

repository: paritoshg/wiotp-here-tutorial

repo_name: paritoshg/wiotp-here-tutorial


text:
# Babel and `@next/font` conflict

#### Why This Error Occurred

You have tried to use `@next/font` with a custom babel config. When your application has a custom babel config you opt-out of the Next.js Compiler which is required to use `@next/font`.

#### Possible Ways to Fix It

- Remove your custom babel config and use the Next.js Compiler

### Useful Links

- [Next.js Compiler](https://nextjs.org/docs/advanced-features/compiler)
- [Customizing Babel Config](https://nextjs.org/docs/advanced-features/customizing-babel-config)

license: MIT

branch_name: refs/heads/canary

extension: md

gha_license_id: MIT

license_type: permissive


text:
---
layout: post
title: "Set up Jekyll"
description: "Quick set up for Jekyll in Windows"
category: Computer Science
tags: ['jekyll']
---
{% include JB/setup %}
Set up Jekyll in Linux is much more easier, but anyway in Windows:

Quick start at [Here](http://jekyllbootstrap.com/usage/jekyll-quick-start.html)
To run portable version of Jekyll localhost on Windows, follow [this](http://www.madhur.co.in/blog/2013/07/20/buildportablejekyll.html)
Or if you got the ruby environment, follow [this](http://www.madhur.co.in/blog/2011/09/01/runningjekyllwindows.html)

Recommend to run porttable version, unless you want to go through the installation ordeal as me

branch_name: refs/heads/master


text:
# Events

Events in opsdroid represent things that happen on the services that opsdroid connects to.
They are both sent and received by the connectors.

All events are a subclass of the base `Event` class. Each event also defines its own set of attributes which are specific to that type of event.

### `Event`

The base `Event` class has the following attributes and methods.

```eval_rst
.. autoclass:: opsdroid.events.Event
   :members:
```
Note: For the sake of flexibility, Opsdroid only supports a single user on any given event. If you use Slack's (or any other chat platforms supported by Opsdroid that have the possibility of a single event corresponding to multiple users) API call to invite users to a channel, the API call takes a list of users as the input. In that case, you need to create multiple 'single-user' events instead of trying to create one 'multi-user' event. If concerned about the performance, the Skill can call the API directly rather than emitting multiple events.

### `OpsdroidStarted`

The `OpsdroidStarted` event is triggered once Opsdroid's loader has completed.
Skills can respond to this in order to perform startup actions which require connectors, databases, etc. to be available first.

```eval_rst
.. autoclass:: opsdroid.events.OpsdroidStarted
   :members:
   :inherited-members:
```

### `Message`

The `Message` object is the most common event type, it represents textual events, and has the following attributes in addition to the base `Event` attributes.

```eval_rst
.. autoclass:: opsdroid.events.Message
   :members:
   :inherited-members:
```

### `Typing`

An event to represent a typing indication.

```eval_rst
.. autoclass:: opsdroid.events.Typing
   :members:
   :inherited-members:
```

### `Reaction`

A reaction to a message, normally an emoji or a string representing one.

```eval_rst
.. autoclass:: opsdroid.events.Reaction
   :members:
   :inherited-members:
```

### `File`

A file event. All files should be representable as bytes. A `File` can be constructed using either a url or a `bytes` object, if a url is specified the `File.file_bytes` property will retrieve the url and store the response as `bytes`.

```eval_rst
.. autoclass:: opsdroid.events.File
   :members:
   :inherited-members:
```

### `Image`

The `Image` event is a subclass of `File`, so in the same way `File` can an `Image` can be either a url or bytes, but should always be representable as `bytes`.

```eval_rst
.. autoclass:: opsdroid.events.Image
   :members:
   :inherited-members:
```

### `Video`

The `Video` event is a subclass of `File`, so in the same way `File` can an `Video` can be either a url or bytes, but should always be representable as `bytes`.

```eval_rst
.. autoclass:: opsdroid.events.Video
   :members:
   :inherited-members:
```

repository: opsdroid/opsdroid

gha_language: Python

repo_name: opsdroid/opsdroid


text:
# html5-canvas-paint-application
HTML5 Canvas Paint Application

#Click Here for [demo](https://razzul.github.io/html5-canvas-paint-application/canvas.html)
![alt tag](https://raw.githubusercontent.com/razzul/html5-canvas-paint-application/master/razzul-html5-canvas-paint-application.png)
![alt tag](https://raw.githubusercontent.com/razzul/html5-canvas-paint-application/master/razzul-html5-canvas-paint-application2.png)


text:
---
layout: default
title: StereoKitApp.System
description: This structure contains information about the current system and its capabilites. There's a lot of different MR devices, so it's nice to have code for systems with particular characteristics!
---
# [StereoKitApp]({{site.url}}/Pages/Reference/StereoKitApp.html).System

## Description
This structure contains information about the current system and its capabilites. There's a
lot of different MR devices, so it's nice to have code for systems with particular characteristics!

repository: jjhartmann/StereoKit

repo_name: jjhartmann/StereoKit


text:
# JRock-Paper-Scissor

A console Rock Paper Scissor program writen in Java.
In this game the user should choose between rock paper and
Scissor, and the computer will generate a random number between
0 and 2 which will represent Rock, paper or Scissor.

## Prerequisites

You only have to install java and a set properly the java path.

## Compile && Run

In order to keep this simple we will compile the project from the command line:
```
javac App.java
```
To run it just call java
```
java App
```

repository: seniorglez/JRock-Paper-Scissor

branch_name: refs/heads/main

repo_name: seniorglez/JRock-Paper-Scissor


text:
# webpack-copyfiles-plugin

Copies files from the source directory to the target directory.  Can optionally clean directories and rename the target directory using a hash of the contents of the directory after copying, and then replace occurrences of a replacement string in the source with the hash value.

The plugin is multi-compiler aware, so if the same instance of the plugin is used for multiple compiler runs, then the files are copied only once, and cleaned directories are deleted only once.

## Install

```bash
npm i -D webpack-copyfiles-plugin
```
## Usage

```javascript
// webpack.config.js
var CopyFilesPlugin = require('webpack-copyfiles-plugin');

module.exports = {
  // ... snip ...
  plugins: [
		new CopyFilesPlugin({
		  sourceRoot: path.join(__dirname, "sources"),
		  targetRoot: path.join(__dirname, "dist", "temp"),
		  files: require('./NonModuleFiles'),
		  renameTargetDir: true,
		  dirHashVarName: '__dirhash__',
		  cleanDirs: [path.join(__dirname, "dist")]
		});
  ],
  // ... snip ...
}
```
## Options

#### sourceRoot

The root directory containing the source files to copy.  This option is required.  It can be a string or an array.  If it is an array, then the `files` option must be an array consisting of the same number of elements.

#### targetRoot

The target directory to copy the source files to.  This option is required.

#### files

Array of file/directory names to copy.  Directories are specified with a trailing `/`.  Relative path names are relative to `sourceRoot`.  If `sourceRoot` is an array, then this option must be an array of arrays containing the same number of top level elements as `sourceRoot`.

#### renameTargetDir

If true, the last path component of `targetRoot` will be renamed using a hash of the directory's contents.

#### dirHashVarName

If specified and `renameTargetDir` is true, then occurrences of the specified string in the source modules processed by webpack will be replaced with the hash of the directory contents as a string.

#### cleanDirs

Specifies an array of directory names to remove prior to copying the files.  `targetRoot` is always cleaned and therefore does not need to be specified here.

repository: DerWikinger/defects

repo_name: DerWikinger/defects


text:
---
name: Default pull request
about: Contribute to our project
title: ''
labels: ''
assignees: ''

---

## ☕ Purpose

A brief summary about the purpose of this PR.

## 🧐 Checklist

- [x] A feature that will work with this PR
- [ ] A feature that I'm still working on

## 🐞 Testing

A brief description about how the reviewer can test my PR.

~~~shell
# don't forget to insert cli commands
~~~

## 🍩 Further details

Anything that the reviewer should know before approving it.

## 🔗 Related PRs

This PR is related to some other PRs in different services, they are:
* [`project#PR_NUMBER`](https://)

repository: quintoandar/python-chain

repo_name: quintoandar/python-chain


text:
---
layout: default
---

# 1996-12-02 - Re: Announcement: Very Good Privacy

## Header Data

From: "Mark Rosen"<EMAIL_ADDRESS>To: "David E. Smith"<EMAIL_ADDRESS>Message Hash: dfab001e5cc7672ffd685f435e6ae5701bb0fe33f8306151a64848af790cd7c2

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-12-02 07:55:31 UTC

Raw Date: Sun, 1 Dec 1996 23:55:31 -0800 (PST)

## Raw message

```
{% raw  %}From: "Mark Rosen"<EMAIL_ADDRESS>Date: Sun, 1 Dec 1996 23:55:31 -0800 (PST)
To: "David E. Smith"<EMAIL_ADDRESS>Subject: Re: Announcement: Very Good Privacy
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

> > What puzzles me is that he included two cyphers that are _extremely_
> >  easy to
> > break, the vignere cypher and the ascii cypher. Why include these? And
> >  what
> > is his new permutation of RC4 and DES?
> >
>
> Concur.  Also, let's see: only available for Win95/NT, no sources
> available, and cyphers that are known to be weak - and that can
> be used without any warnings whatsoever - anyone else watching
> their Snake-Oil-O-Meter get pegged?
	The plus side of the Vigenere and ASCII ciphers is that they are fast. For
example, on a friend's machine, I can get 1.7mb/s using ASCII while NewDES,
the fastest "secure" algorithm, runs at a only 600k/s. Documentation of
each algorithm with an explanation of its security is provided in the help
file. As for snake-oil, this is a genuine product. I am trying to compete
with Puffer 2.0, which costs like $25-$30; $5 is certainly less than that.
As soon as I get the money to buy the needed compiler, I'll make a port to
the Mac, and a port to Windows 3.1 should surface in a few days.

> Give us some source code, port it to XWindows, and then maybe
> we'll talk.
	I'm working on installing Linux on my machine and will be working on an X
port. I'll keep you posted. BTW, I personally really enjoy using VGP and
have encrypted all of my source code and other archived things like that.

Mark Rosen
FireSoft - http://www.geocities.com/SiliconValley/Pines/2690
Mark Eats AOL - http://www.geocities.com/TimesSquare/6660/

{% endraw %}
```

## Thread

+ Return to [December 1996](/archive/1996/12)

+ Return to "["Mark Rosen" <mrosen@peganet.com>](/authors/mark_rosen_mrosen_at_peganet_com_)"

+ 1996-12-02 (Sun, 1 Dec 1996 23:55:31 -0800 (PST)) - Re: Announcement: Very Good Privacy - _"Mark Rosen"<EMAIL_ADDRESS>


text:
# create ElasticSearch indices

(based on [stream2es](https://github.com/elastic/stream2es))

Example Usage:

	cat example.json | ./index-json-docs.sh my-testing-index

input.json format:
- One json document per line
- If id is not provided uses automatically generated ids

	{"id":"testid", "text":"def"}
	{"text":"cdf"}
	{"text":"abc", "numeric_field": 1}

See index-json-docs.sh for index settings.
Currently uses analyzer english, bm25 similarity, 'page' type and default field 'text'
NOTE: Index is replaced (deleted) on script start.

------

## Indices needed for full pipeline

- wiki

	python ../python/wiki2json.py --by-paragraph ../tmp/simplewiki/AA/wiki_00 | ./index-json-docs.sh simplewiki-english-bm25-wiki2json-byparagraph
	python ../python/wiki2json.py --by-paragraph ../tmp/enwiki/AA/wiki_00 | ./index-json-docs.sh enwiki-english-bm25-wiki2json-byparagraph
	python ../python/wiki2json.py --by-paragraph ../tmp/enwikibooks/AA/wiki_00 | ./index-json-docs.sh enwikibooks-english-bm25-wiki2json-byparagraph

- ck12

	cat ../tmp/ck12.txt | ./index-json-docs.sh ck12-english-bm25
	cat ../tmp/ck12_lessons.txt | ./index-json-docs.sh ck12_lessons-english-bm25

- books

	cat ../tmp/books.txt | ./index-json-docs.sh books-english-bm25

- quizlet

	cat ../tmp/quizlet.json | ./index-json-docs.sh quizlet-english-bm25
	cat ../tmp/quizlet_20160126.json | ./index-json-docs.sh quizlet_20160126-english-bm25


text:
# template-Qt
Template for a typical Qt (Widget) project

## Purpose
Create a Qt Widget template to be used as a starting point for projects with the qmake build system. It is wise to separate the source code, application, test cases, images, etc. into distinct directories.

## Directory structure
- **root** directory
   - README.md: this file
   - LICENSE: this repository is available under the very permissive MIT license
   - .gitignore: files to be excluded by git
   - template-Qt.pro: main project file, manages the projects in the subdirectories
   - defaults.pri: common settings for all projects
- **src** directory
   - src.pro: create a library from the source files
   - mainwindow.h: default header file (for a simple window)
   - mainwindow.cpp: default source file (for a simple window)
   - mainwindow.ui: default Designer UI file (for a simple window)
- **app** directory
   - app.pro: create an executable (GUI) using the compiled library from **/src**
   - main.cpp: initializes the GUI
- **tests** directory
   - tests.pro: sets up a non-Qt console application (which is more suitable for automated tests)
   - main.cpp: replace this dummy file with your own test code

## Origin
The directory structure and the majority of the qmake settings are taken from https://github.com/ComputationalPhysics/qtcreator-project-structure (see the related blog post: https://dragly.org/2015/11/24/getting-started-with-unit-tests-in-qt-creator-with-catch/).

repository: CsatiZoltan/template-Qt

repo_name: CsatiZoltan/template-Qt


text:
# wavenet_experiment

Playing with a quick reimplementation of ibab's wavenet.  You may want to
have a look at the readme in [ibab's repo](https://github.com/ibab/tensorflow-wavenet)

- requirements:
  - Tensorflow 1.0
  - [librosa](https://github.com/librosa/librosa) for audio.

- Training:  wn_trainer.py
- Generation: wn_generate.py

Training corpus:
   [VCTK corpus](http://homepages.inf.ed.ac.uk/jyamagis/page3/page58/page58.html) (around 10.4GB, [Alternative host](http://www.udialogue.org/download/cstr-vctk-corpus.html))

with VCTK and the default parameters, one epoch of training is about 34000
steps.  You will need to wait an epoch or two before you can expect to see
anything reasonable in generation.

To run this:

```sh
$ ./wn_trainer.py -l {logdir} -o {checkpoint-file}
```

then after training a while:

```sh
$ ./wn_generate.py -p {params file} -i {checkpoint-file-#####} -n {n-samples} -o {out.wav}
```
The default parameters work for me on an 8Gb NVidia GTX-1070.
With these defaults, it takes ~1.0 seconds per minibatch in training
when using an audio chunk of 50000 samples (half of ibab's default.)
CPU-only generation runs at about 150 samples per second on my
Core i-5 6600K.  You will probably want to train a minimum of 100000
steps, which will take at least a day unless you have a better GPU card.

If you have a card with smaller memory, you can run with a smaller
audio chunk size.  I carry context correctly across chunks, so there
should be no impact on modeling accuracy.  It does change the effective
batch-size used for derivatives, so you may need to adjust the
learning rate.

Many parameters must be changed using a parameter file.  Use "-p *params_file*".
I include an example *params.txt* file.  It is executable Python.  You will
need to suppy a parameter file for generation.  Generally you should
use the same one that you used in training.

### Advantages over the ibab setup

- Simpler code. Generation is the same code as training.
- Batch normalization is an option.
- either one-hot or scalar input features, both in generation and training.
  - scalar input seems to produce better results
- You can train looking more than one sample into the future.
- I get better accuracy and faster convergence, at least last time I compared.
- You can use N-point à trous convolutions in generation.
- Last I checked, ibab's setup changes the audio chunk size with different
  batches.  Doing this slows things down dramatically.  Because I carry
  context across chunks I can use constant chunk sizes without overlap.

There are of course some disadvantages too.

Here is an output sample: [sample_output.wav](http://github.com/cbquillen/wavenet_experiment/blob/master/sample_output.wav)


text:
---
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: ''
labels: bug, help wanted
assignees: ''

---

### Before reporting a bug:
First, please search [previous issues](https://github.com/asteroid-team/asteroid/issues)
and [the FAQ](https://asteroid-team.github.io/asteroid/faq.html) and be sure this hasn't
been answered elsewhere.

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

### To Reproduce
<!-- Ideally attach a minimal code sample to reproduce the bug.
Minimal means having the shortest code but still preserving the bug. -->

Steps to reproduce the behavior (code sample and stack trace):

### Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

### Environment

#### Package versions

Run `asteroid-versions` and paste the output here:

```
Paste here
```

Alternatively, if you cannot install Asteroid or have an old version that doesn't have the `asteroid-versions` script,
please output the output of:

```
pip freeze | egrep -i 'pytorch|torch|asteroid'
```

#### Additional info

Additional info (environment, custom script, etc...)

repository: asteroid-team/asteroid

repo_name: asteroid-team/asteroid


text:
# Heaven [![Build Status](https://travis-ci.org/atmos/heaven.png?branch=master)](https://travis-ci.org/atmos/heaven)

Heaven is an API that integrates with GitHub's [Deployment API][1]. It receives [deployment events][5] from GitHub and pushes code to your servers.

Heaven currently supports [Capistrano][15], [Fabric][10], and [Heroku][22] deployments. It also has a notification system for broadcasting  [deployment status events][6] to chat services(e.g. [Campfire][7], [Hipchat][8], [SlackHQ][9], and [Flowdock][21]).  It can be hosted on Heroku for a few dollars a month.

# Documentation

* [Overview](/doc/overview.md)
* [Installation](/doc/installation.md)
* [Deployment Providers](/doc/providers.md)
* [Deployment Notifications](/doc/notifications.md)
* [Environment Locking](/doc/locking.md)

# Launch on Heroku

[![Launch on Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

[1]: http://developer.github.com/v3/repos/deployments/
[2]: https://github.com/blog/1778-webhooks-level-up
[3]: https://github.com/resque/resque
[4]: https://gist.github.com/
[5]: https://developer.github.com/v3/repos/deployments/#create-a-deployment
[6]: https://developer.github.com/v3/repos/deployments/#create-a-deployment-status
[7]: https://campfirenow.com/
[8]: https://www.hipchat.com/
[9]: https://slack.com/
[10]: http://www.fabfile.org/
[11]: http://www.getchef.com/
[12]: http://puppetlabs.com/
[13]: https://devcenter.heroku.com/articles/build-and-release-using-the-api
[14]: https://developer.github.com/v3/repos/contents/#get-archive-link
[15]: http://capistranorb.com/
[16]: https://github.com/settings/applications
[17]: https://devcenter.heroku.com/articles/oauth#direct-authorization
[18]: https://www.phusionpassenger.com/
[19]: https://devcenter.heroku.com/articles/releases
[20]: https://github.com/atmos/hubot-deploy
[21]: https://www.flowdock.com/
[22]: https://www.heroku.com

repository: smartlyio/heaven

branch_name: refs/heads/smartly

gha_language: Ruby

repo_name: smartlyio/heaven


text:
---
  indexable: false
---

# Wallet Connect

- [Configure the application for Wallet](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-config-application)
- [Request Permits to the Payer](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-payer-permissions)
- [Link payer access token to the device used](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-link-payer-token-to-device)
- [Device web](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-device-web)
- [Device Native Mobile](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-device-native-mobile)
- [Capturing Payments](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-process-payments)
- [Deferred capture](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-authorized-capture)
- [Binary payment](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-binary-mode)
- [Get an existing payment](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-get-wallet-payment)
- [Payment Refund](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-refund)
- [Cancel a payment](https://www.mercadopago[FAKER][URL][DOMAIN]/developers/en/guides/online-payments/advanced-payments/wallet-cancel)

repository: MacaPecha/devsite-docs

branch_name: refs/heads/development

repo_name: MacaPecha/devsite-docs


text:
# spring-boot-autoconfigure
[![Build Status](https://travis-ci.org/arhs/spring-boot-autoconfigure.svg)](https://travis-ci.org/arhs/spring-boot-autoconfigure) for Travis CI passing

Auto-configuration classes for a [Spring Boot](http://projects.spring.io/spring-boot/) project.

## Usage
Add the following dependency to your **pom.xml** file:

```xml
<dependency>
    <groupId>com.arhs.spring.boot.autoconfigure</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
```

The following auto-configurations are included so far:
* [Jongo](http://jongo.org/)
* [Twilio](https://www.twilio.com)

### Twilio auto-configuration

To use the Twilio auto-configuration, you must annotate your field with the **Autowired** annotation and add the configuration of your properties file. Here's an example:

In the file that contains an instance of the class:
```java
class HomeController {
    @Autowired
    private TwilioService twilioService;
}
```

In the properties file (located in the **resources** directory):
```yml
twilio:
  accountSID: MY_ACCOUNT_SID
  authToken: MY_AUTHENTICATION_TOKEN
```

### Jongo auto-configuration
In the file that contains an instance of the class:
```java
class HomeController {
    @Autowired
    private Jongo jongo;
}
```

Configuration of the Jongo auto-configuration in the application.yml file:
```yml
spring:
  data:
     mongodb:
        database: MY_DATABASE_NAME
```

## Copyright and license

> The MIT License (MIT)
>
> Copyright (c) 2015 ARHS Developments SA
>
> 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.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 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: arhs/spring-boot-autoconfigure

repo_name: arhs/spring-boot-autoconfigure


text:
# URLhaus monitor

[![Build Status](https://travis-ci.org/ninoseki/urlhaus_monitor.svg?branch=master)](https://travis-ci.org/ninoseki/urlhaus_monitor)
[![Coverage Status](https://coveralls.io/repos/github/ninoseki/urlhaus_monitor/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/urlhaus_monitor?branch=master)

A monitoring tool for [URLhaus](https://urlhaus.abuse.ch/) feeds.

## Features

- URLhaus feeds lookup by AS number, country code and TLD.
- Slack notification.
- Caching.

## Installation

```bash
gem install urlhaus_monitor
```

## Usage

```bash
$ urlhaus_monitor
Commands:
  urlhaus_monitor help [COMMAND]               # Describe available commands or one specific command
  urlhaus_monitor lookup_by_asn [ASN]          # lookup by a given asn
  urlhaus_monitor lookup_by_country [COUNTRY]  # lookup by a given country code
  urlhaus_monitor lookup_by_tld [TLD]          # lookup by a given tld
```

## Configuration

### Slack

Please set the following environmental variables for enabling Slack notification.

- `SLACK_WEBHOOK_URL`: A Slack webhook URL.
- `SLACK_CHANNEL_NAME`: A Slask channel name which will be notified.

## Screenshots

```bash
urlhaus_monitor lookup_by_tld jp
```

![image](./screenshots/example.png)

## License

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


text:
---
description: >-

---

# Mycroft for Plasma

This is a general installation and user guide for Plasma Mycroft on the [KDE Plasma Desktop platform](https://www.kde.org/plasma-desktop).

## Getting started

### Distribution packages

Check your Linux distribution for `mycroft-core` and `plasma-mycroft` packages.

### KDE Neon git unstable

_NOTE: KDE Neon only provides `plasma-mycroft` packages for the [Git Unstable Edition](https://neon.kde.org/download). This installation method requires that `mycroft-core` be installed in your home folder following the [guide here](https://mycroft.ai/documentation/linux/)_.

``` sudo apt install plasma-mycroft ```

## Mycroft for Plasma installer

|Supported Distributions|
|---|
|Debian Testing|
|KDE Neon Xenial, Bionic|
|Kubuntu 17.10, 18.04|
|Fedora 27, 28|

Download The Latest Installer AppImage From: https://github.com/AIIX/mycroft-installer/releases

_NOTE: This installer also provides support for installing `mycroft-core` and `plasma-mycroft` on Arm64 and ArmHF architecture._

### Mycroft for Plasma installer scripts

Installation scripts are available at https://github.com/MycroftAI/installers

### Mycroft for Plasma manual installation

_NOTE: This installation method requires `mycroft-core` to be installed in your home folder following the [guide available here](https://mycroft.ai/documentation/linux/).

```
git clone https://anongit.kde.org/plasma-mycroft.git
cd plasma-mycroft
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_LIBDIR=lib -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
make
sudo make install
sudo chmod +x /usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/startservice.sh
sudo chmod +x /usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/stopservice.sh
sudo chmod +x /usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/pkgstartservice.sh
sudo chmod +x /usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/pkgstopservice.sh

```

## The Mycroft for Plasma interface

![Plasma Mycroft Screenshot](https://mycroft.ai/wp-content/uploads/2018/06/plasmoid-gs1.png)

## Troubleshooting Mycroft for Plasma

### Debugging connection errors

Follow these steps to debug connection errors.

* First, check that your `mycroft-core` location is correctly set in your Mycroft for Plasma settings. By default, Mycroft for Plasma searches for `mycroft-core` in your `$HOME` path - ie. `/home/$USER/mycroft-core`.
* Next, check if `mycroft-core` is able to start manually using the `debug` console - `./start-mycroft.sh debug`
* Next, check to see if your firewall is blocking incoming connections to the `mycroft-core` websocket address. By default, `mycroft-core` listens on port 8181.
* Next, check the `mycroft-bus.log` file to see if there are any errors blocking your connection. [See here for more information on the location of log files on Linux](https://mycroft.ai/documentation/troubleshooting/#linux).
* Next, check to see if the Mycroft for Plasma start and stop scripts have 'execute' filesystem permissions. They are located at:

* `/usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/startservice.sh` (start)
* `/usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/stopservice.sh` (stop)

## The visual display

The Mycroft for Plasma desktop `enclosure` provides Skill Authors with a visual display platform to showcase **Skill** results and data in the form of interactive visual cards that can be created by the Skill Authors using popular UI/UX technologies such as `html` and `QML`.

### HTML-based visual Skill generation

#### Wikipedia Skill HTML Example

First, create a `html` folder inside your **Skill** folder. Next, we map the path to the folder.

```{.XML}
class WikipediaSkill(MycroftSkill):
def __init__(self):
....
self.html_index = dirname(__file__) + '/html/' # Location where the html files will be generated
self.css_index = dirname(__file__) + '/html/wiki.css'# Location of your main.css file
```

Next, we create a `__genwebview()` function. This function is used to generate the `html` page within the **Skill**.

```
{.XML}
def __genwebview(self, sm, imagemain, title):
simg = imagemain # Image url received from wikipedia api
smry = sm.encode('utf-8') # Summary received from wikipedia api encoded to utf8
stitle = title.encode('utf-8') # Article title encoded to utf8
fname = self.html_index + stitle + 'wikiresult.html' # Path of html folder location + name of html file that will be generated
scss = self.css_index # Path of your main css file which you have manually created
f = open(fname,'w')
wrapper = """
<div id="imgPlace">
<h1><strong>{2}</strong></h1>
</div>
<div id="wikisummary">
<p id="paratext">{3}</p>

</div>
""".format(scss, simg,
stitle, smry) # The wrapper is where you define your basic html layout for the skill
and using the format function pass variables to the html that will be used at
the time of generation. Writing complex JS and CSS in the wrapper should be
avoided and should be placed in the HTML folder as external files. Example JS
inclusion would have a self.js_index which could be passed to  insidef.write(wrapper) f.close()
```

Next, we call the `__genwebview(self)` function from `handle_intent()`.

```
{.XML}
def handle_intent(self, message):
try:
....
sm = wiki.summary(results[0],sentences = 20); # Summary to be sent to
__genwebvie(self) func spage = wiki.page(title); # Article title to be sent to
__genwebvie(self) func imagemain = spage.images[1] # Page Image to be sent to
__genwebvie(self) func self.__genwebview(sm, imagemain, title) # Calling the function to generate the HTML page after data is
available
....
```

Next, we send the URL to the `enclosure` for handling via the `self_enclosure.ws.emit()` function.

```
{.XML}
# Requires import: from mycroft.messagebus.message import Message
def handle_intent(self, message):
try:
....
self.__genwebview(sm, imagemain, title)
self.enclosure.ws.emit(Message("data", {'desktop': {'url': self.html_index + title + 'wikiresult.html'}})) # This function emits metadata and url of generated html over websockets to
the desktop clients. This can include extra meta data also apart from URL like for example weather data variables. This function can be called before or after self.speak(summary) depending on where you like to position your webview
self.speak(summary)
....
# Format for desktop enclosure: self.enclosure.emit(Message{“data”, {“desktop”: {‘ any’: ‘any data’}}))
```

#### CSS file

The CSS file should be manually generated by the Skill Author.

```
{.XML}
html, body { margin: 0; padding: 0 } # Important to include in your css to avoid whitespace borders

# CSS for your view should be responsive, Fixed sizes and non responsive layouts will break on different screen sizes.
```

## QML based visual Skill generation

### Wikipedia Skill QML Example

First, create a `qml` folder inside your **Skill** folder and then map the path to the folder.

```
{.XML}

class WikipediaSkill(MycroftSkill):
def __init__(self):
....
self.qml_index = dirname(__file__) + '/qml/' # Location where the qml files will be generated
```

Next, create a `__genvisualobjecttemplate()` function. This function is used to generate the QML visual object within the **Skill**.

```
{.XML}
def __genvisualobjecttemplate(self, sm, imagemain, title):
simg = imagemain # Image url received from wikipedia api
smry = sm.encode('utf-8') # Summary received from wikipedia api encoded to utf8
stitle = title.encode('utf-8') # Article title encoded to utf8
fname = self.visualobject_index + stitle + "Wikiresult.qml" # Path of QML folder location + name of QML file that will be generated
f = open(fname,'w')
wrapper = """import QtQuick 2.9 # All import libs and dependencies can be installed using the Requirements.sh file distributed with the skills
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3

Rectangle {{ # As we are building the qml code write into the python function we need to use double brackets for all QML objects to escape characters
id: bgRect
width: 500; height: 100
color: "#222"

Rectangle {{
id: mainRect
anchors.fill: parent
color: "#222"

Image {{
id: mainTopImage
anchors.top: parent.top
source: "{0}"
height: parent.height
width: parent.width
}}
}}
}}""".format(simg)

""".format(scss, simg, stitle, smry)
f.write(wrapper) # The wrapper is where you define your basic QM layout for the skill
f.close()
```

Next, call the `__genvisualobjecttemplate(self)` function from the `handle_intent()` function.

```
{.XML}
def handle_intent(self, message):
try:
....
sm = wiki.summary(results[0],sentences = 20); #Summary to be sent to __genwebvie(self) func
spage = wiki.page(title); #Article title to be sent to __genwebvie(self) func
imagemain = spage.images[1] #Page Image to be sent to __genwebvie(self) func
self.__genbvisualobjecttemplate(sm, imagemain, title) # Calling the function to generate the QML page after data is available
....

```

Next, send the QML file location to the `enclosure` for handling via the `self_enclosure.ws.emit()` function.

```
{.XML}
#Requires import: from mycroft.messagebus.message import Message

def handle_intent(self, message):
try:
....
self.enclosure.ws.emit(Message("visualObject", {'desktop': {'url': self.visualobject_index + title + 'Wikiresult.qml'}}))
# This function emits the visual object and qml location to the loader functiion in the mycroft plasmoid. This function can be called before or after self.speak(summary) depending on where you like to position your qml visualobject
self.speak(summary)
....
```

## Mycroft for Plasma native visual Skill

The Mycroft for Plasma `enclosure` also provides Skill Authors the ability to natively implement visual design for their **Skill** by providing a simple Object to the plasmoid.

First, create a custom visual object, and emit it to the plasmoid.

```
def handle_intent(self, message):
....
self.enclosure.ws.emit(Message("yourCustomObjectName", {'desktop': {'Your Custom Data Objects'}}))
....
```

Once added to your **Skill**, you can reach out to the Mycroft for Plasma maintainer to discuss the design and implementation of your **Skill**. The best way to do this is to join the [Desktop Channel on Mycroft Chat](https://chat.mycroft.ai/community/channels/desktop).


text:
## Gender & Ethnicity

A simple API to classify the gender and race/ ethnicity of a person given their full name. The API will return gender as female and male, and ethnicity as black, hispanic, asian, arab, native american, pacific islander or white.

## useful

Test for free how our API can determine missing diversity data like gender, race/ ethnicity, veteran status and age based on a person's full name and résumé.

CREDITS : https://diversitydata.io/?ref=public-apis

repository: habereet/awesomeScripts

repo_name: habereet/awesomeScripts


text:
# Non-Convex Progressive GDA

This repository contains the scripts used to run the progressive GDA experiments in the submission. This repository was build off of the Pytorch GAN Zoo (https://github.com/facebookresearch/pytorch_GAN_zoo) toolbox, and general information about this code base is also provided in 'README_proggan.md'. This file includes information regarding the requirements, configuring the datasets used and so on.

To reproduce the Progressive GDA experiments, one can run:

python train.py PGAN -c config_celeba_cropped_fr_alpha05_LQ.json -d $dir

where 'dir' is the results directory. The config given above replicates the settings used in the paper, though in the config file the pathDB variable must be specified to point to the directory of the CelebA dataset. To run evaluation, and generate additional images from the trained networks, one can run:

python eval.py visualization -n default -m PGAN -d $dir

where 'default' refers to the name of training. After evaluation, to perform histogram matching and FID calculation, one can run:

python models/eval/fid_hist_match.py --dir $dir

These commands are given together in the file "run_training.sh".

There are several parameters that are currently hardcoded, such as the generator regularization. In addition, because we demean the data before training and add it back in evaluation, means at each resolution are needed to be stored and are provided in our repository.

repository: ardasahiner/ProCoGAN

path: /Progressive GDA [Baseline]/README.md

repo_name: ardasahiner/ProCoGAN


text:
---
title: "How to Work with Nullable Types in C#"
date: "2021-01-29"
coverImage: "coverimage.jpg"
author: "Hemant Manwani"
tags: ["C#","Nullable"]
description: "Nullable is a term in C# that allows an extra value null to be owned by a form. We will learn in this article how to work with Nullable types in C#."
---

In C#, We have majorly two types of data types *Value* and *Reference* type. We can not assign a null value directly to the Value data type. In this case, C# 2.0 provides us the Nullable types to assign a value data type to null.

## What is Nullable types?

As described above, The Nullable types used to assign the null value to the value data type. That means we can assign a null value directly to a variable of the value data type. We can declare null value using `Nullable<T>` where `T` is a type like an int, float, bool, etc.

Nullable types represent the Null value as well the actual range of that data type. Like the **int** data type can hold the value from `-2147483648` to `2147483647` but a **Nullable int** can hold the value `null` and range from `-2147483648` to `2147483647`

## How to declare Nullable types

There are two ways to declare Nullable types.

```c#
Nullable<int> example;
```
OR

```c#
int? Example;
```

## Properties of Nullable types

Nullable types have two properties.
1. HasValue
2. Value

**HasValue**: This property returns a bool value based on that if the Nullable variable has some value or not. If the variable has some value, then it will return true; otherwise, it will return false if it doesn’t have value or it’s null.

```c#
Nullable<int> a = null;
Console.WriteLine(a.HasValue); // Print False
Nullable<int> b = 9;
Console.WriteLine(b.HasValue); // Print True
```

**Value**: This property gives the value of the Nullable type variable. If the variable has some value, it will return the value; else, it will give the runtime `InvalidOperationException` [exception when the variable](https://www.loginradius.com/blog/async/exception_handling_in_csharp/) value is null.

```c#
Nullable<int> a = null;
Console.WriteLine(a.Value); // Gives run time exception of type 'InvalidOperationException'
```

```c#
Nullable<int> b = 9;
Console.WriteLine(b.Value); // Print 9
```

## Method of Nullable types

**GetValueOrDefault()**: This method returns the actually assigned value of the Nullable type variable if the value is not null, and if the variable value is null, then it will give the default value of that data type. Here is the example code

```c#
Nullable<int> a = 9;
Console.WriteLine(a.GetValueOrDefault()); // Returns 9
```

```c#
Nullable<int> a = null;
Console.WriteLine(a.GetValueOrDefault()); // Returns 0
```

## Rules of using Nullable types:

To use the Nullable type as a local variable, it should be declared first; it will give a compile-time error. This rule is similar to the value data type.

```c#
int? b;
Console.WriteLine(b.Value); //Compile time error 'use of unassigned local variable b'
```

If the Nullable variable is a property in a class and after that, if we are accessing that Nullable variable, then it will not give any error because, in the class variable, it is declared as `null` automatically.

```c#
class Test
{
     public int? B;
}
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(new Test().B); // No compile time error
    }
}
```

## null coalescing operator (??)

We can not assign the Nullable type variable value to the non-nullable type variable directly. As in the example below, if we try to assign the value, it will give the compile-time error.

```c#
int? a = 10;
int b = a;//Compile time error `Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)`
```

**Note**: We can use compare operators `==` and `!=` operator with Nullable type variables and non Nullable type variables.

For the Nullable variable, we can use the null coalescing operator (??) to check if the variable value is `null` or not. Then we can assign the non-nullable type variable value according to that. This operator can be used when we are unsure that at run time if that Nullable variable's value is changed according to our logic or not. Here is an example of that

```c#
int? a=null;
int b=a?? 10;
Console.WriteLine(b);  // Prints 10
```
In the above example, if the variable a value is null,, it will assign the value 10 to b variable. In that case, b is assigned with value 10, and the printed value will be 10.

## Conclusion

In this article, We have discussed the Nullable types, and it's properties and methods. The main advantage of using the Nullable types is that we can store the Null value in a column of a database using this type. If you want to learn more about C# here is an article written by me on [How to Use Enum in C#](https://www.loginradius.com/blog/async/enum-csharp/)

repository: iamdarshshah/engineering-portal

repo_name: iamdarshshah/engineering-portal


text:
# WJScript
A general-purpose scripting language implemented in C#.

## What is WJScript?
WJScript is a [.NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) library which makes a general-purpose text script interpreter available in your .NET projects.

One key goal of WJScript is that it is intended to be error-proof. In other words: a script should always run without throwing any exceptions that could interrupt the calling code.

Of course, a script may not do what it was intended to do, if there are syntax or logic errors in the source. But no matter what happens, the goal is that running the script should not cause problems for the code that calls it.

In order to help implement this desired behavior, WJScript is an unusual language in some respects. For instance, all operations are legal on and between all types, and have well-defined results.

Does your script add a boolean and a number, and divide the result by a string? Well, that isn't likely to generate very helpful results ... but it *will* compile, and run without errors!

The current version of WJScript is run under the hood by the Roslyn script engine, and as such is actually C#, but by making use of my [UniversalVariable library](https://github.com/WilStead/UniversalVariable) the syntax and behavior can seem quite different. Take this example:
```c#
let x = 42;
x["newProp"] = "Hello, ";
let y = x["newProp"] + "World!";
x = false || y;
return x; // "Hello, World!"
```

## How do I get this?
Available as a [NuGet package](https://www.nuget.org/packages/WJScriptParser).

## Can I contribute?
Yes! [Pull requests](https://help.github.com/articles/about-pull-requests/) are welcome for bug fixes and/or new features.

Please add unit tests for any new feature.

## Help! It's not working!
Feel free to submit an [Issue](https://help.github.com/articles/about-issues/) if something isn't working right. Please refer to the [project wiki](https://github.com/WilStead/WJScript/wiki), as well as the [wiki for UniversalVariable](https://github.com/WilStead/UniversalVariable/wiki) to verify that your trouble is due to an actual bug, and not simply a design limitation of the libraries.

repository: WilStead/WJScript

repo_name: WilStead/WJScript


text:
# mail-attac - Cracking encrypted Mail Attachements Passwords based on the mailtext

On the mailserver a service filters for the mailtext and encrypted archive files.

From the mailtext a wordlist is extracted and a hash is generated from the paswort protected archive file.

Then the hash of the archive file will be compared to the wordlists hash values trying to crack the password.

The idea is to prevent Social Engineering attacks with encrypted malicous archive files which aren't detected by other services.

## State of Development

This project is still in development and isn't bug free nor fully working. Feel free to test and
please report any issues or ideas.

## Used Third-Party Services

-   [Mail-in-a-Box](https://github.com/mail-in-a-box/mailinabox) for a quick and simple setup
-   [Rspamd](https://github.com/rspamd/rspamd) as spamfilter to call an external service from
-   [olefy](https://github.com/HeinleinSupport/olefy) as architecture for our own service listening on the TCP port
-   [wwwordlist](https://github.com/Zarcolio/wwwordlist) to generate a wordlist from the mailtext
-   [johntheripper](https://github.com/openwall/john) to crack the password with the wordlist

## How it works

In `rspamd/local.d/external_services.conf` we define the mime filtering and the TCP socket that olefy listens on.

When the MTA (in our case Mail-in-a-Box uses Postfix) sends mail and smtp data over the milter protocol to the Rspamd proxy, the data is transmitted to our service that analyzes the data.

If the data is the mail body (plain/html) wwwordlist will generate a wordlist, if the data is the encrypted archive file the service will call an archive-function from john to generate the hash and try to crack the password by calling johntheripper with the hash and wordlist.

If the password is cracked successfully the service could then return the decrypted archive file to Rspamd which could analyze it on malware. This last step is not implemented yet as we are clueless on how to pass the decrypted files back to Rspamd so we left it up to the user to decide what to do after the password has been cracked.

Demo:
[![asciicast](https://asciinema.org/a/muxhHlRDHWk9QOdEvZxN3UF6H.svg)](https://asciinema.org/a/muxhHlRDHWk9QOdEvZxN3UF6H)

For further information and installation instructions visit the [wiki](https://github.com/DanielWidmayer/mail-attac/wiki)

# License

MIT-License

repository: DanielWidmayer/mail-attac

repo_name: DanielWidmayer/mail-attac


text:
# director
A simple reverse proxy that forwards HTTP requests to multiple backends
for purposes of testing and benchmarking changes to existing services.

Basically, director just forwards the incoming HTTP request to a given
'primary' endpoint while in the background replays that request to multiple
'secondary' endpoints.

Primarily this enables the usecase for code changes to existing services
be deployed to new endpoints without affecting the production traffic
due to bugs/performance issues with the new code base.

It also reports the following metrics for every HTTP request handled and
for both primary and secondary endpoints:
1. Response times
2. Number of successes
3. Number of failures (only network failures)

## Getting started
The easiest way to get director is to use one of the pre-built release binaries
which are available for OSX and Linux, from the [release page](https://github.com/KalyanAkella/director/releases).

Upon downloading to a certain folder, director can be launched as:

```bash
$ director -configFile <path_to_config_yml_file>
```

A sample configuration file (sample_config.yml) is included in the root of this repo.

## Building
If you instead prefer to build director locally, here are the steps:
1. Ensure you have GoLang version 1.13+ installed
2. Checkout the repo
3. Execute `make build` or `make test build`
4. Launch director from `./bin/director -configFile <path_to_config_yml_file>`

repository: KalyanAkella/director

repo_name: KalyanAkella/director


text:
# StopInstance {#StopInstance .reference}

Stops an ECS instance.

## Description {#section_tcm_s4m_xdb .section}

-   You can only stop an instance in **Running**\(`Running`\) status.
-   The instance becomes **Stopping** \(`Stopping`\) after a successful API request, and the instance becomes **Stopped** \(`Stopped`\) after it is stopped successfully.
-   You can force an instance to stop, and the force stop operation is same as the power failure. The temporary files and data in the instance may be lost.
-   If the specified instance is [locked](reseller.en-US/API Reference/Appendix/API behavior when an instance is locked for security reasons.md#), and the `OperationLocks` of the instance indicates `LockReason: security`, you cannot stop the instance.
-   If a [local disk](../../../../reseller.en-US/Product Introduction/Block storage/Local disks.md#) is configured in an instance from the [I1 type family](../../../../reseller.en-US/Product Introduction/Instance type families.md#i1), the request parameter `ConfirmStop` is required. The interface can only be called successfully when the parameter ConfirmStop is set to `True`.
-   For an instance from the I1 type family that has a local disk configured, after it is stopped, the data of the local disk is cleared. We recommend that you implement data redundancy at the application layer to guarantee the data availability.
-   This API automatically ignores the parameter `ConfirmStop` for all of the instance types except the instance of I1 type family.
-   After you enable the feature of **[No fees for stopped instances](../../../../reseller.en-US/Pricing/No fees for stopped instances (VPC-Connected).md#)** for a VPC instance, you can set `StoppedMode=KeepCharging` to disable the feature, you are billed after the instance is stopped,  and its resource and Internet IP address are reserved.

## Request parameters { .section}

|Name|Type|Required|Description|
|:---|:---|:-------|:----------|
|Action|String|Yes|The name of this interface. Value: StopInstance.|
|InstanceId|String|Yes|The specified instance ID.|
|ForceStop|String|No|Whether to force shutdown upon device restart. Value range:-   true: Force the instance to shut down.
-   false: The instance shuts down normally.

Default value: false.|
|ConfirmStop|Boolean|No|Whether to stop an I1 ECS instance or not.  A required parameter for I1 type family instance, it only takes effect when the instance is of I1 type family. Optional values:-   true
-   false

Default value: false.|
|StoppedMode|String|No|Whether a VPC ECS instance is billed after it is stopped or not. Optional value: KeepCharging.After you enable the feature of **[No fees for stopped instances for a VPC instance](../../../../reseller.en-US/Pricing/No fees for stopped instances (VPC-Connected).md#)**, you can set `StoppedMode=KeepCharging` to disable the feature, the ECS instance will be billed after it is stopped, and its resource and Internet IP address are reserved.

|

## Response parameters {#section_edm_s4m_xdb .section}

All parameters are common response parameters. For more information, see [Common parameters](reseller.en-US/API Reference/Getting started/Common parameters.md#commonResponseParameters).

## Examples { .section}

**Request example**

```
https://ecs.aliyuncs.com/?Action=StopInstance
&InstanceId=i-instance1
&<Common Request Parameters>
```

**Response example**

 **XML format**

```
<StopInstanceResponse>
    <RequestId>1C488B66-B819-4D14-8711-C4EAAA13AC01</RequestId>
</StopInstanceResponse>
```

 **JSON format **

```
{
    "RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01"
}
```

## Error codes { .section}

|Error code|Error message|HTTP status code|Meaning|
|:---------|:------------|:---------------|:------|
|DiskError|IncorrectDiskStatus|403|The specified ForceStop is invalid, the parameter is not in the enumerated range.|
|InstanceLockedForSecurity|The specified operation is denied as your instance is locked for security reasons.|403|The resource is currently locked down and the operation is denied.|
|IncorrectInstanceStatus|The current status of the resource does not support this operation.|403|The current status of the resource does not support the operation.|
|InstanceType.ParameterMismatch|The input parameter ConfirmStop must be true when an instance have localstorage.|403|The instance is locked for security reasons.|
|InvalidInstanceId.NotFound|The specified InstanceId does not exist.|404|The specified InstanceId does not exist.|

repository: qmutz/ecs

repo_name: qmutz/ecs


text:
The Hack Oregon PostGIS Geocoder
================

## Setup

1.  Bring up the PostGIS container: `cd
    data-science-pet-containers/containers; docker-compose -f
    postgis.yml up -d --build`
2.  `cd data-science-pet-containers/examples/geocoding`

## Generating the database

Type `./run-from-linux.bash`. This will

1.  Copy the geocoder population scripts to `containers_postgis_1`.
2.  Run the geocoder population scripts. This takes some time.
3.  Copy the finished database backup and archive of the TIGER
    shapefiles back to `data-science-pet-containers/containers/Raw`.

## Blacklisting warning

If you run this process often enough, the Census Bureau will blacklist
you and you’ll get `403 Forbidden` errors trying to download the
shapefiles. So the first time you run this, assuming success, make sure
you keep backups of the result file `geocoder.backup` and the downloaded
shapefiles `tiger.zip`.

## Using the geocoder

1.  Connect to the database:

      - Inside the Docker network: host=`postgis`, port=5432,
        user=dbsuper, password=<POSTGRES_PASSWORD>
      - From the Docker host: host=`localhost`, port=5439, user=dbsuper,
        password=<POSTGRES_PASSWORD>

    where `<POSTGRES_PASSWORD>` is the value you set for that variable
    when you built `containers_postgis_1`.

2.  Run the following SQL. You can use this as a model for
    single-address geocoding.

        SELECT
          g.rating As r,
          ST_X(geomout) As lon,
          ST_Y(geomout) As lat,
          pprint_addy(addy) As paddress
        FROM
          geocode(
            '329 NE Couch St, Portland, OR 97232'
          ) As g;
        SELECT
          pprint_addy(addy),
          st_astext(geomout),
          rating
        FROM
          geocode_intersection(
            'Grand Ave', 'Couch St', 'OR', 'Portland'
          );

### Bulk geocoding

See the example at <https://postgis.net/docs/Geocode.html>.

## The host-side script

``` bash
#! /bin/bash

echo "Copying the code to the container"
docker cp geocoder_scripts containers_postgis_1:/usr/local/src/
docker exec -u root containers_postgis_1 \
  chown -R postgres:postgres /usr/local/src/geocoder_scripts
docker exec -u root containers_postgis_1 \
  chmod +x /usr/local/src/geocoder_scripts/create-geocoder-database.bash
echo "Populating the database - will take some time!"
echo ""
echo ""
docker exec -u postgres -w /usr/local/src/geocoder_scripts containers_postgis_1 \
  /usr/local/src/geocoder_scripts/create-geocoder-database.bash
echo "Retriving database backup"
docker cp containers_postgis_1:/gisdata/geocoder.backup ../../containers/Raw
echo "Retriving shapefile archive"
docker cp containers_postgis_1:/gisdata/tiger.zip ../../containers/Raw
echo "Retriving database population scripts"
docker cp containers_postgis_1:/gisdata/nation.bash ../../containers/Raw
docker cp containers_postgis_1:/gisdata/oregon.bash ../../containers/Raw
```

repository: hackoregon/data-science-pet-containers

gha_language: HTML

repo_name: hackoregon/data-science-pet-containers


text:
# Changelog

## 2.2.0

### Enhancements

- [#200: add attribute usage for ValidatedNotNullAttribute](https://github.com/adamralph/liteguard/pull/200)

## 2.1.0

### Enhancements

- [#187: Add DebuggerNonUserCode](https://github.com/adamralph/liteguard/pull/187)

## 2.0.1

### Fixed bugs

- [#150: Source package files no longer marked as auto-generated](https://github.com/adamralph/liteguard/issues/150)

## 2.0.0

### Other

- [#145: **[BREAKING]** Target .NET Standard 1.0 and .NET Standard 2.0 only](https://github.com/adamralph/liteguard/issues/145)
- [#146: **[BREAKING]** Target SDK style projects only in source package](https://github.com/adamralph/liteguard/issues/146)

## 1.1.0

### Enhancements

- [#137: Mark as auto generated to avoid StyleCop violations](https://github.com/adamralph/liteguard/issues/137)

## 1.0.0

### Enhancements

- [#125: **[BREAKING]** Support .NET Platform Standard 1.0](https://github.com/adamralph/liteguard/issues/125)

## 0.11.0

### Enhancements

- [#106: Limit lines to 120 chars](https://github.com/adamralph/liteguard/issues/106)

## 0.10.0

### Enhancements

- [#94: Support for portable libraries for universal apps (Profile32)](https://github.com/adamralph/liteguard/issues/94)

### Fixed bugs

- [#93: Does not compile for Windows Phone 8.1 projects](https://github.com/adamralph/liteguard/issues/93)

## 0.9.0

### Enhancements

- [#81: **[BREAKING]** Add support for Windows Phone 8.1, Xamarin.Android 1.0 and Xamarin.iOS 1.0](https://github.com/adamralph/liteguard/issues/81)

### Fixed bugs

- [#86: Win8 target does not work](https://github.com/adamralph/liteguard/issues/86)

## 0.8.1

### Enhancements

- [#73: Change source code package to install as a development dependency](https://github.com/adamralph/liteguard/issues/73)

## 0.8.0

## 0.7.0

### Enhancements

- [#41: Address code analysis violations in source code package](https://github.com/adamralph/liteguard/issues/41)

## 0.6.0

### Enhancements

- [#9: Add Portable Class Library to NuGet packages](https://github.com/adamralph/liteguard/issues/9)

## 0.5.0

### Enhancements

- [#5: Add source code package](https://github.com/adamralph/liteguard/issues/5)

## 0.4.0

### Enhancements

- [#2: add clauses with unrestricted type parameters](https://github.com/adamralph/liteguard/issues/2)

repository: adamralph/liteguard

gha_language: C#

repo_name: adamralph/liteguard


text:
# Storage assumptions

## Method

- Reviewed disk usage in postgres database and backup after running env-canada and noon-forecast cronjob.
- Reviewed current database backup files to establish compression ratio.

## Assumptions

- Optimization by a factor of 10 on env-canada job should be feasable.
- Compression ratio for backup will remain consistent.
- Forecast data has very little room for optimization.

Refer to storage_assumptions spreadsheet for further assumptions and details of calculations.

## Scenario 1 : current

Assuming no changes to the application and how it is run as of 2020 August 11.

- Storage: Run out of space in 28.5 years, sufficient storage available.
- Backup: Run out of space in 0.5 years. Require at least 11 GB, ideally 42 GB.

## Scenario 2 : projected

Assuming no changes in how data is stored, adding additional fields and adding the high resolution regional model.

- Storage: Run out of space in 0.8 years. Required 1.2TB.
- Backup: Run out of space in 0.0 years. Require at least 669GB, ideally 1.4TB.

## Scenario 3 - projected, with optimizations

Assuming adding additional fields but optimizing by rolling up values (e.g. storing percentiles, interpolated values and getting rid of raw data) would result in optimizing by a factor of 10.

- Storage: Run out of space in 8.1 years, sufficient storage available.
- Backup: Run out of space in 0.1 years. Require at least 68GB, ideally 149GB.

repository: bcgov/wps

repo_name: bcgov/wps


text:
# Portfolio Dashboard
Visualize value and returns over time in a stock portfolio

## To run

Setup:
```bash
source .envrc
pip install -r requirements.txt

PORTDASH_CONF=config_filename.yaml flask db init
PORTDASH_CONF=config_filename.yaml flask db migrate -m 'init'
PORTDASH_CONF=config_filename.yaml flask db upgrade
```

See `migrations/alembic.ini` for logger settings.

Next, fill the database. Start by seeding from your config file.
```bash
python portdash/apis/seeding.py -c config_filename.yaml
```

Read CSVs of transactions and update quotes from Alpha Vantage
```bash
python portdash/acemoney.py -c config_filename.yaml --quotes
```

Run!
```bash
PORTDASH_CONF=sample_config.yaml flask run
```

repository: stephen-hoover/portdash

repo_name: stephen-hoover/portdash


text:
# Numerical Methods
A collection of numerical routines (mostly built for various classes)

Includes:
- Differential equation solvers
- Quadrature methods
- Function interpolation

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/alienbrett/numerical-eqs-collection/HEAD)

To run locally, the package has to be installed, so I recommend using a virtualenv.

```bash
$ cd numerical-eqs-collection
$ virtualenv venv
$ source venv/bin/activate
$ pip install -e .
$ jupyter # to spin up an instance that can run the notebook files
```
The package will then be importable under numerical_eqs

Alternatively, I recommend using binder to evaluate the code, so you won't need any setup on your end.

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/alienbrett/numerical-eqs-collection/HEAD)

repository: alienbrett/numerical-eqs-collection

repo_name: alienbrett/numerical-eqs-collection


text:
# Brapi.io PHP Client

[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Helabs/brapi-php/badges/quality-score.png?s=f6f377c47317eda2b2c6b9a6cef907d9e4b74171)](https://scrutinizer-ci.com/g/Helabs/brapi-php/)
[![Build Status](https://travis-ci.org/Helabs/brapi-php.png)](https://travis-ci.org/Helabs/brapi-php)
[![Latest Stable Version](https://poser.pugx.org/helabs/brapi/v/stable.png)](https://packagist.org/packages/helabs/brapi)
[![Dependency Status](https://www.versioneye.com/user/projects/52f5e714ec1375fd0b0000c8/badge.png)](https://www.versioneye.com/user/projects/52f5e714ec1375fd0b0000c8)

PHP package to interact with the brapi.io APIs

## Installation

Add this line to your `composer.json`:

```json
{
  "require": {
    "helabs/brapi": "dev-master"
  }
}
```

And then install it:

```shell
$ composer install
```

## Usage

### Initializing the client

You will need to have your account's access_token to be able to interact with the API. You also need to set an 'User-Agent' to identify your application.

```php
<?php
$access_token = 'your-access-token'
$user_agent = 'Your Application Name (youremail@provider.com)'

$Brapi = new \Brapi\Client($access_token, $user_agent);
```

### Zipcodes

You can search for zipcodes by using the `#zipcode` method on the client. This method will return an instance of `\Brapi\Zipcode` so you can use it like a plain object.

```php
<?php
$zipcode = $Brapi->zipcode('20071003');

// Now you have all the information you need:
$zipcode->address // Presidente Vargas
$zipcode->address_type // Avenida
$zipcode->city // Rio de Janeiro
$zipcode->city_ibge_code // 3304557
$zipcode->neighborhood // Centro
$zipcode->state // RJ
$zipcode->zipcode // 20071003
```

## Versioning

Brapi.io PHP Client follow the [Semantic Versioning](http://semver.org/).

## Issues

If you have problems, please create a [Github Issue](https://github.com/Helabs/brapi-php/issues).

## Contributing

Please see [CONTRIBUTING.md](https://github.com/Helabs/brapi-php/blob/master/CONTRIBUTING.md) for details.

## Maintainers

- [Thiago Belem](https://github.com/TiuTalk)

## Release

TODO

## Credits

Brapi.io PHP Client is maintained and funded by [HE:labs](http://helabs.com.br/en/opensource/).
Thank you to all the [contributors](https://github.com/Helabs/brapi-php/graphs/contributors).

repository: rafaelp/brapi-php

repo_name: rafaelp/brapi-php


text:
Task(s)
-------

According to environmental resources, we are approaching the _Sixth Mass Extinction Event_ ([source][1], [source][2], [source][3], [source][4], [source][5], [source][6],) within the next 20-150 years (depending on source). Based on this information, complete the following task:

__Individually__ contact someone at an environmental group that is outside the Mississauga area (yes, you are required to email/phone/etc. someone and must provide proof of contact).  From this contact, gather information about what they are doing to help the environment in relation to technological waste (e-waste).

Using this information, and any information you have researched on your own, create an __opinion__ piece regarding whether you believe the group is doing enough to help sustain the environment for the next 100 years.  Your opinion piece can be in the form of:

* a blog-like article (website, Markdown document, etc (excluding Word/Pages)), __or__
* a podcast __or__
* a video news piece

No matter which method you choose, you will have to:

* Cite your sources using either APA, MLA, or Chicago format
* Justify your opinion

### Criteria
If you are creating a __written__ piece, you are to follow these criteria:

* No longer than 800 words.
* Include a descriptive title for your article

If you are creating an __audio__ piece, you are to follow these criteria:

* No shorter than 2 minutes, and no longer than 5 minutes.

If you are creating a __video__ piece, you are to follow these criteria:

* No shorter than 2 minutes, and no longer than 5 minutes.
* Imagery to justify your opinion.

Submissables/Due Date(s)
------------------
Your file(s) are due by 3pm on Friday, March 31st, 2017 (long timeline, high expectations)

Rubric(s)
------------------

Your mark will be calculated as follows: __Mark = R * C__ where R is the value of the rubric, and C is whether you followed the criteria above.

Your opinion piece must include clear solutions to the rubric items below.

| Expectation                              | R    | 1    | 2    | 3    | 4    |
| ---------------------------------------- | ---- | ---- | ---- | ---- | ---- |
| **D1 - assess strategies and initiatives that promote environmental stewardship with respect to e-waste for the foreseeable future** |      |      |      |      |      |
| D1.2 - identify measures that help reduce the impact of computers on the environment |      |      |      |      |      |
| D1.4 - identify governmental agencies or communities partners that provide resources and guidance for environmental stewardship |      |      |      |      |      |

[1]: http://time.com/3035872/sixth-great-extinction/	"Time.com - Sixth Great Extinction"
[2]: https://www.theguardian.com/environment/radical-conservation/2015/oct/20/the-four-horsemen-of-the-sixth-mass-extinction	"The Guardian - 4 Horseman"
[3]: https://www.msn.com/en-au/news/world/what-the-%E2%80%98sixth-extinction%E2%80%99-will-look-like-in-the-oceans-the-largest-species-die-off-first/ar-BBwaQh0?li=AAgfYrC	"MSN - Ocean Extinction"
[4]: http://www.msn.com/en-gb/news/world/earth-faces-sixth-%E2%80%98great-extinction%E2%80%99-with-41percent-of-amphibians-set-to-go-the-way-of-the-dodo/ar-BBgMjJ9	"MSN - 41% of Amphibians"
[5]: http://www.cnn.com/2016/10/27/opinions/sutter-wwf-sixth-extinction/index.html	"WWF - Sixth Extinction"
[6]: http://www.natureworldnews.com/articles/15921/20150802/without-doubt-sixth-mass-extinction-event-occurring.htm	"Nature World News - Sixth Mass Extinction Event"

repository: mrseidel-classes/archives

path: /ICS3U/ICS3U-2016-2017S/Assignments/04 - Environmental Stewardship/README.md

repo_name: mrseidel-classes/archives


text:
# Thumbsnag [![Build Status](https://travis-ci.org/gstjohn/Thumbsnag.svg?branch=master)](https://travis-ci.org/gstjohn/Thumbsnag)

Thumbsnag crawls an HTML document and finds imagery that best represents the given page.

## Example

```php
use Thumbsnag\FastImageAnalyzer;
use Thumbsnag\Thumbsnag;
use Thumbsnag\UrlDocument;

$url = 'http://simplegifts.co';
$html = file_get_contents($url);

$document = new DOMDocument();
$document->loadHTML($html);

$analyzer = new FastImageAnalyzer(new FastImage());

$thumbsnag = Thumbsnag::load(new UrlDocument($doc, $url), $analyzer);
$images = $thumbsnag->process();
```

After inspection, `$images` will return something like:

```bash
Array
(
  [1] => Thumbsnag\Image Object
  (
    [url:Thumbsnag\Image:private] => http://simplegifts.co/image1.jpg
    [height:Thumbsnag\Image:private] => 565
    [width:Thumbsnag\Image:private] => 849
  )

  [2] => Thumbsnag\Image Object
  (
    [url:Thumbsnag\Image:private] => http://simplegifts.co/image2.png
    [height:Thumbsnag\Image:private] => 450
    [width:Thumbsnag\Image:private] => 1162
  )
)
```

## Configuration

### Step 1: Install

Pull the package in through Composer.

```js
"require": {
  "gstjohn/thumbsnag": "~1.0"
}
```

### Step 2: Configure (as necessary)

Thumbsnag::load() takes an array as its third parameter which overrides the default config. Available configuration options are:

+ **min_area (default: 5000)**

  This option represents the minimum pixel area (width x height) required in order to be included in the result set.

+ **ratio_threshold (default: 3.0)**

  This option represents the maximum ratio of width-to-height allowed in order to be included in the result set.

+ **filename_filters (default: "sprite", "blank", and "spacer")**

  This option represents an array of words that must not be in the image file name in order to be included in the result set.

## Credits

+ [How to Find the Image That Best Represents a Web Page](https://tech.shareaholic.com/2012/11/02/how-to-find-the-image-that-best-respresents-a-web-page/)
+ [Crawlsane](https://github.com/michaelmcmillan/Crawlsane)

# License

Thumbsnag is open-sourced software licensed under the [MIT license](https://raw.githubusercontent.com/gstjohn/Thumbsnag/master/LICENSE).

repository: gstjohn/Thumbsnag

gha_language: PHP

repo_name: gstjohn/Thumbsnag


text:
# dissimilarity-index
Scraped data on black-white dissimilarity for places in the United States. The data are from CensusScope, which is created by the Social Science Data Analysis Network, and based on 2000 Census numbers.

The data are in `res/`, sorted by state. Asterisks on the city names means that there are fewer than 1000 people of a race, so the dissimilarity index might be meaningless.

repository: xaelleone/dissimilarity-index

repo_name: xaelleone/dissimilarity-index


text:
## `is_solved` Code

### Step 1: Set-Up

We need to designate `is_solved(self)` with a `@property` decorator:

```python
@property
def is_solved(self):
    solved = True
```

### Step 2: Iteration

We set up iteration through each cell:

```python
	for row in self:
    	for cell in row:
```

### Step 3: Handling Visibility and Mines

If there exists one cell that is not visible and is not a mine, then the game has not been solved.

```python
        if (cell.is_visible or cell.is_mine):
            continue
        else:
            solved = False
	return solved
```
### Step 4: Solution

Here is the full solution:

```python
@property
def is_solved(self):
    solved = True
    for row in self:
    	for cell in row:
            if (cell.is_visible or cell.is_mine):
            	continue
       		else:
            	solved = False
	return solved
```

### Step 5: Compact Solution

Here is an alterative, more compact solution using the `all` keyword:

```python
@property
def is_solved(self):
    return all((cell.is_visible or cell.is_mine) for row in self for cell in row)
```

repository: vvennela/curriculum

repo_name: vvennela/curriculum


text:
---
layout: post
title: Understand why CSS has no effect with the Inactive CSS rules indicator in Firefox DevTools
date: '2020-05-12 12:00:00'
published: true
excerpt_separator: <!--more-->
summary: Firefox DevTools has an awesome feature that will gray out CSS declarations that have no effect, provide tips on what is wrong, suggest ways to fix it, and provide a helpful link for more information.
image: /assets/images/2020/2020-05-12-thumbnail.png
---

{% include eggheadPlayer.html src="https://egghead.io/lessons/css-understand-why-css-has-no-effect-with-the-inactive-css-rules-indicator-in-firefox-devtools" %}

Have you ever found yourself at a loss in your browser's DevTools trying to figure out why a certain CSS declaration does not seem to work appropriately? You are not alone! Also, DevTools are getting much better too.

## Firefox DevTools

![](../assets/images/2020/2020-05-12-screenshot.png)

As of Firefox 70, there is an awesome new feature called [Inactive CSS](https://hacks.mozilla.org/2019/10/firefox-70-a-bountiful-release-for-all/#developertools) that will gray out CSS declarations that have no effect, provide tips on what is wrong, suggest ways to fix it, and provide a helpful link for more information.

<!--more-->

## Play Around

You can watch the video above to see various scenarios where the new feature can be handy. Feel free to open up Firefox and play around with the [sample website](https://codesandbox.io/s/firefox-css-inactive-example-1k2rc?file=/index.css) that I use in the video.

## Conclusion

I'm so excited about these investments in DevTools. I think this will help many developers better understand CSS. I look forward to additional changes in our tooling to help teach us while we are building.

gha_language: JavaScript

gha_license_id: NOASSERTION


text:
This repository will implement the classic deep reinforcement learning algorithms. The aim of this repository is to provide clear code for people to learn the deep reinforcement learning algorithm.

In the future, more algorithms will be added and the existing codes will also be maintained.

![demo](figures/demo.gif)
## Requirements

- tensorflow 1.6
- tensorboardX
- gym 0.10
- pytorch 0.4

## Installation
1. install the pytorch
```bash
plase go to official webisite to install it: https://pytorch.org/

Recommend use Anaconda Virtual Environment to manage your packages

```
2. install openai-baselines (**the openai-baselines update so quickly, please use the older version as blow, will solve in the future.**)
```bash
# clone the openai baselines
git clone https://github.com/openai/baselines.git
cd baselines
git checkout 366f486
pip install -e .

```

## DQN

Here I uploaded two DQN models, training Cartpole and mountaincar.

### Tips for MountainCar-v0

This is very sparse for MountainCar-v0, it is 0 at the beginning, only when the top of the mountain is 1, there is a reward. This leads to the fact that if the sample to the top of the mountain is not taken during training, basically the train will not come out. So you can change the reward, for example, to change to the current position of the Car is positively related. Of course, there is a more advanced approach to inverse reinforcement learning (using GAN).

![value_loss](Char1%20DQN/DQN/pic/value_loss.jpg)
![step](Char1%20DQN/DQN/pic/finish_episode.jpg)
This is value loss for DQN, We can see that the loss increaded to 1e13 however, the network work well. This is because the training is going on, the target_net and act_net are very different, so the calculated loss becomes very large. The previous loss was small because the reward was very sparse, resulting in a small update of the two networks.

## Policy Gradient

Use the following command to run a saved model

```
python Run_Model.py
```

Use the following command to train model

```
pytorch_MountainCar-v0.py
```

> policyNet.pkl

This is a model that I have trained.

## Actor-Critic

This is an algorithmic framework, and the classic REINFORCE method is stored under Actor-Critic.

## PPO

Proximal-Policy-Optimization

## A2C

Advantage Policy Gradient, an paper in 2017 pointed out that the difference in performance between A2C and A3C is not obvious.

## A3C

A common reproduction

## Alphago zero

I will reproduce AlphagoZero in wargame.

### Timeline

- 2018/11/01 gives the Resnet15Dense1 version, which has poor convergence, but the winning rate can reach 85%.
- 2018/11/12 Gives the Resnet12Dense3 version, which is the first convergence and stable trend, with a winning percentage of 92%.
- 2018/11/13 The Resnet12Dense3-v2 version is given. This version is very stable and the winning rate is gradually increasing. Performance to be observed
- 2018/11/15 After 3 days of training, Wargame AI is given - the version of Gou Chen, the hit rate is stable at over 90%.
- 2018/11/16 The rate of Chen Chen wins 96%.

## Papers Related to the Deep Reinforcement Learning
[1] [A Brief Survey of Deep Reinforcement Learning](https://arxiv.org/abs/1708.05866)
[2] [The Beta Policy for Continuous Control Reinforcement Learning](https://www.ri.cmu.edu/wp-content/uploads/2017/06/thesis-Chou.pdf)
[3] [Playing Atari with Deep Reinforcement Learning](https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf)
[4] [Deep Reinforcement Learning with Double Q-learning](https://arxiv.org/abs/1509.06461)
[5] [Dueling Network Architectures for Deep Reinforcement Learning](https://arxiv.org/abs/1511.06581)
[6] [Continuous control with deep reinforcement learning](https://arxiv.org/abs/1509.02971)
[7] [Continuous Deep Q-Learning with Model-based Acceleration](https://arxiv.org/abs/1603.00748)
[8] [Asynchronous Methods for Deep Reinforcement Learning](https://arxiv.org/abs/1602.01783)
[9] [Trust Region Policy Optimization](https://arxiv.org/abs/1502.05477)
[10] [Proximal Policy Optimization Algorithms](https://arxiv.org/abs/1707.06347)
[11] [Scalable trust-region method for deep reinforcement learning using Kronecker-factored approximation](https://arxiv.org/abs/1708.05144)

## TO DO
- DDPG
- ACER
- TRPO
- DPPO

# Best RL courses
- David Silver's course [link](http://www0.cs.ucl.ac.uk/staff/d.silver/web/Teaching.html)
- Berkeley deep RL [link](http://rll.berkeley.edu/deeprlcourse/)
- Practical RL [link](https://github.com/yandexdataschool/Practical_RL)
- Deep Reinforcement Learning by Hung-yi Lee [link](https://www.youtube.com/playlist?list=PLJV_el3uVTsODxQFgzMzPLa16h6B8kWM_)


text:
# shpritz
Distance-triggered water sprayer. Works great for keeping cats from scrathcing coats.
This repo accompanies my talk at Maker Faire Bay Area 2018.

* For a pure-NodeJS version, as presented in the main part of the talk, go ahead to shpritz-node.
* For The Python implementation, you will need to run the python code AND the code in node-dashboard

You'll also find here:
* The Arduino Sketch
* The Fritzing file
* The presentation's slides.

## Installning JavaScript projects
There are 2 JavaScript projects here: shpritz-node, and node-dashboard. Before running a project, its packages need to be installed.
CD into that project (let's say shpritz-node) and use npm to install the packages:
```bash
cd shpritz-node
npm install
```
and then run.

## Running a project
The JavaScript dashboard does not require sudo privileges. It can be run like this:
```bash
npm start
```
Projects that need access to the serial port do need sudo privileges:
```bash
sudo npm start
```
for shpritz-node, or
```bash
sudo python spritz.py
```
## Contact
Having issues? drop me a line: eyal {dot} person {dot} shahar (at) gmail {dot} com

repository: persones/shpritz

repo_name: persones/shpritz


text:
# 0x10c

This repository (will) contain my ideas, code, and utilities for working on [notch's DCPU-16](https://en.wikipedia.org/wiki/0x10c).

At the moment, the highlights are syntax highlighting for Sublime Text 2, TextMate, etc under support; and my first pass at a cooperative threading library under threads.

Pull requests are welcome!

## References

* [DCPU-16 Specification](https://web.archive.org/web/20120509184912/http://0x10c.com/doc/dcpu-16.txt)
* [www.0x10c.com](https://web.archive.org/web/20120507221934/http://www.0x10c.com/)