text:
# Bertelsmann / Arvato Capstone Project

Udacity Data Scientist Nanodegree Capstone Project

All the code is in a public repository at the link below:

https://github.com/bergr7/Bertelsmann_Arvato_Project

A blog post on Medium summarising the work can be found at the link below:

https://medium.com/@bernardogarciadelrio/customer-segmentation-bertelsmann-arvato-capstone-project-f66360186392

## Table of Contents
1. Installation
2. Project Motivation
3. File Descriptions
4. Results
5. Licensing, Authors, Acknowledgements
6. MIT License

## Installation

- Libraries included in Anaconda distribution of Python 3.8.
- Packages versions:

    - pandas Version: 1.0.1
    - numpy Version: 1.19.2
    - matplotlib Version: 3.3.2
    - imblearn Version: 0.0
    - xgboost Version: 1.2.1
    - scikit-learn Version: 0.22.1
    - pickle5 Version: 0.0.11

## Project Motivation

In this capstone project, I was asked to analyse demographics data for customers of a mail-order sales company in
Germany and compare it against demographics information for the general population.

The datasets used were provided by Bertelsmann Arvato Analytics, and the project represents a real-life data science task.
This data has been strictly used for this project only and will be removed from my laptop after completion of the project
in accordance with Bertelsmann Arvato terms and conditions.

The project is divided in 3 parts:

**Part 1: Customer Segmentation Report**
In this part, I used unsupervised learning techniques to analyse features of established customers and the general
population in order to create customer segments with the aim of targeting them in marketing campaigns.

**Part 2: Supervised Learning Model**
Next step was to build a supervised learning machine learning model that predicted whether or not each individual will
respond to the campaign.

**Part 3: Kaggle Competition**
Finally, after spot-checking several models, choosing the most promising one and fine-tuning its hyperparemeters, I used
the model to make predictions on the campaign data as part of a Kaggle Competition.

## File Descriptions

The data provided is not publicly available according to Bertelsmann Arvato terms and conditions.

The code is contained in following files:

  - **Arvato_EDA.ipynb** - Jupyter Notebook that contains the EDA of the general population and customers data. Here the
  data preprocessing steps are identified.
  - **data_preprocessing.py** - Python script that performs data preprocessing on general population and customers data.
  - **Arvato_Customer_Segmentation.ipynb** - Jupyter Notebook with the Customer Segmentation Report.
  - **supervised_model_data_preprocessing.py** - Python script that performs data preprocessing on dataset for individuals
  that were targets of a marketing campaign.
  - **Arvato_Supervised_Model.ipynb** - Jupyter Notebook that contained a supervised learning model trained on dataset for individuals
  that were targets of a marketing campaign and tested on the test set.
  - **CRISP-DM.pdf** - A pdf with notes documenting the CRISP-DM process for this project.

## Results

**Customer Segmentation Report**

Due to the lack of meaning for some of the features utilised in the analysis, it is hard to describe some of the clusters.
I would probably drop features without feature meaning if I had to carry out the cluster analysis again or I would come
back to people with business domain knowledge if possible.

However, I have been able to identify the following groups of potential customers:

- Individuals that own luxurious and powerful cars and, therefore, these are likely to be in a good financial position and
have high incomes.
- Individuals that live in good neighborhood areas and municipalities. Also there is more than one car in their household.
- Relatively young individuals with great interest in environmental sustainability, that are somewhat dissapointed with
their current social status and interested in low interest rates financial services.

If the company were to launch a marketing campaign for the current services, it would be sensible to target these groups
of people.

I have also identified some groups of the German population that are under-represented in the customers base:

- Young people with average cars and income.
- Money savers with low interest in financial services.
- Young people with low-midclass cars and low income.

If the company were looking to reach a larger part of the German population, it might be worth designing some type of
financial service that aligns with the needs of these groups and target them with a different marketing campaign. The
company would need to consider the profitability of these services though before launching them as it is probably that
customers of these profile will not tend to spend a lot of money often.

**Supervised Learning Model**

I trained a XGBClassifier with a performance of ROC AUC score of 0.73226.

All the code is in a public repository at the link below:

https://github.com/bergr7/Bertelsmann_Arvato_Project

A blog post on Medium summarising the work can be found at the link below:

https://medium.com/@bernardogarciadelrio/customer-segmentation-bertelsmann-arvato-capstone-project-f66360186392

## Licensing, Authors and Acknowledgements

I would like to give credit to:

- Bertelsmann Arvato Analytics for providing the datasets.
- Stackoverflow community for making code questions and answers publicly available
- Jason Brownlee from Machine Learning Mastery for the post '8 Tactics to Combat
  Imbalanced Classes in Your Machine Learning Dataset'
- Udacity Data Scientist Nanodegree Colleagues for their previous work on this project.
- The DataDrivenInvestor for putting together an useful function to run PCA analysis.

## MIT License

Copyright 2020 Bernardo Garcia

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

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

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


text:
Term={_Ordinary_Course_of_Business}

sec=an action taken by a {_Person} will be deemed to have been taken in the {_Ordinary_Course_of_Business} only if that action:

is consistent in nature, scope, and magnitude with the past practices of such {_Person} and is taken in the ordinary course of the normal, day-to-day operations of such {_Person}; and
does not require authorization by the board of directors of such {_Person} (or by any {_Person} or group of {_Persons} exercising similar authority) and does not require any other separate or special authorization of any nature.

Def="{Term}" - {sec}

Model.Root={Def}

license: MIT

repository: CommonAccord/Cmacc-Source

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: CommonAccord/Cmacc-Source


text:
First, let us build the Docker image...

`docker build . -t monolithclient`{{execute}}

Now, let's run it...

`docker run -p 8080:8080 monolithclient &`{{execute}}

Let's take a look at the web application...

Render port 8080: https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/

repository: FitchSolutions/katacoda

repo_name: FitchSolutions/katacoda


text:
# Sublime Text 3

> Sublime Text is a sophisticated text editor for code, markup and prose. You'll love the slick user interface, extraordinary features and amazing performance.

[![Sublime Text 3 Screen Shot](screenshot.png)](http://www.sublimetext.com/3)

## Install

### macOS

Download [`.dmg` installer](https://www.sublimetext.com/3) or using Homebrew `brew cask install sublime-text`

### Linux

Follow the [instructions](https://www.sublimetext.com/docs/3/linux_repositories.html) for your distribution.

### Windows

Download [`.exe` installer](https://www.sublimetext.com/3).

## Package Control

Follow [this](https://packagecontrol.io/installation#Simple) instructions (close Sublime Text after installation).

## My Preferences

### Dependencies

- Node.js (`npm install --global jshint eslint csslint lebab`)
- Ruby (`gem install scss_lint`)

### Install

- Navigate to `Packages` folder
  - macOS `cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/`
  - Linux `cd ~/.config/sublime-text-3/Packages/`
  - Windows `cd "%appdata%/Sublime Text 3/Packages/"`
- Remove `User` folder
  - macOS and Linux `rm -rf User/`
  - Windows `rmdir User/`
- Clone this repository `git clone https://github.com/magnobiet/sublime-text-preferences.git User`

### Installed Packages

See [Package Control.sublime-settings#L6](Package%20Control.sublime-settings#L6)

## Licence

This project is licensed under the [MIT License](https://magno.mit-license.org/2014). Copyright © Magno Biét

repository: magnobiet/sublime-text-preferences

repo_name: magnobiet/sublime-text-preferences


text:
# lets-ftp

Lets-ftp manages FTP connections and commands in [Lets][lets]. If you want to
deploy over FTP, check out [lets-copy][lets-copy].

## Installation

```bash
npm install lets-ftp
```

## Getting started

**Letsfile.js**

```javascript
var ftp = require('lets-ftp');

module.exports = function(lets) {
  var stage = new lets.Stage({
    host: '<IP_ADDRESS>',
    username: 'me'
  });

  // Best practice is to load passwords from a file that isn't checked in
  stage.config(require('./config/stage1'));

  // Use lets-ftp
  stage.plugin(ftp());

  // Do something after connection, maybe upload a file
  stage.after('connect', function (options, done) {
    this.getConnection(function (c) {
      c.put('local-filename', 'remote-filename', done);
    });
  });

  // Add stage to lets and name it
  lets.addStage('stage1', stage);
};
```

Run it using e.g. `$ lets deploy stage1` (a way to add custom "flows" will be
available soon).

## Options

Required:

* `options.host` – Address to server
* `options.username` – User to log in with
* `options.password` – The user's password

See [node-ftp][node-ftp] for the following options mainly used by that module:

* `options.port`
* `options.secure`
* `options.secureOptions`
* `options.connTimeout`
* `options.pasvTimeout`
* `options.keepalive`

That's also where you can find docs on which methods are available on the
connection object.

## Contribution

See guidelines for [lets][lets].

[lets]: https://github.com/letsjs/lets
[lets-copy]: https://github.com/letsjs/lets-copy
[node-ftp]: https://github.com/mscdex/node-ftp

repository: letsjs/lets-ftp

repo_name: letsjs/lets-ftp


text:
All you need to get started building Textual apps.

## Requirements

Textual requires Python 3.7 or later (if you have a choice, pick the most recent Python). Textual runs on Linux, macOS, Windows and probably any OS where Python also runs.

!!! info inline end "Your platform"

    ### :fontawesome-brands-linux: Linux (all distros)

    All Linux distros come with a terminal emulator that can run Textual apps.

    ### :material-apple: macOS

    The default terminal app is limited to 256 colors. We recommend installing a newer terminal such as [iterm2](https://iterm2.com/), [Kitty](https://sw.kovidgoyal.net/kitty/), or [WezTerm](https://wezfurlong.org/wezterm/).

    ### :material-microsoft-windows: Windows

    The new [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-gb&gl=GB) runs Textual apps beautifully.

## Installation

Here's how to install Textual.

### From PyPI

You can install Textual via PyPI, with the following command:

```
pip install textual
```

If you plan on developing Textual apps, you should also install textual developer tools:

```
pip install textual-dev
```

### From conda-forge

Textual is also available on [conda-forge](https://conda-forge.org/). The preferred package manager for conda-forge is currently [micromamba](https://mamba.readthedocs.io/en/latest/installation.html#micromamba):

```
micromamba install -c conda-forge textual
```

And for the textual developer tools:

```
micromamba install -c conda-forge textual-dev
```

### Textual CLI

If you installed the developer tools you should have access to the `textual` command. There are a number of sub-commands available which will aid you in building Textual apps. Run the following for a list of the available commands:

```bash
textual --help
```

See [devtools](guide/devtools.md) for more about the `textual` command.

## Demo

Once you have Textual installed, run the following to get an impression of what it can do:

```bash
python -m textual
```

If Textual is installed you should see the following:

```{.textual path="src/textual/demo.py" columns="127" lines="53" press="enter,tab,w,i,l,l"}
```

## Examples

The Textual repository comes with a number of example apps. To try out the examples, first clone the Textual repository:

=== "HTTPS"

    ```bash
    git clone https://github.com/Textualize/textual.git
    ```

=== "SSH"

    ```bash
    git clone git@github.com:Textualize/textual.git
    ```

=== "GitHub CLI"

    ```bash
    gh repo clone Textualize/textual
    ```

With the repository cloned, navigate to the `/examples/` directory where you will find a number of Python files you can run from the command line:

```bash
cd textual/examples/
python code_browser.py ../
```

## Need help?

See the [help](./help.md) page for how to get help with Textual, or to report bugs.

repository: Textualize/textual

branch_name: refs/heads/main

gha_language: Python

gha_license_id: MIT

repo_name: Textualize/textual


text:
The AMEE category /transport/train/specific/diesel contains data on
emissions associated with diesel powered trains based on testing and
simulations in the UK, sourced from the [Rail Safety and Standards
Board](http://www.rssb.co.uk/index.asp). Emissions calculations are made
on a *per passenger* basis.

Train emissions may vary depending on local geographic and climatic
conditions as well as operational factors such as station spacing, stop
frequency and speed regulations. This category currently contains only
models of train for which emissions testing has been carried out in the
UK, and therefore users should consider the applicability of these data
for train-based travel in other regions.

To use this category, select the geographic region and train model via
the *region* and *type* drill options. After specifying the train type,
set the distance travelled using the ***distance*** profile item value.
The returned value represents CO2 emissions for a single passenger
journey (of the specified distance) using the default assumption of 31%
train occupancy (see
[here](http://www.rssb.co.uk/pdf/reports/Research/T618_traction-energy-metrics_final.pdf)
for details of this default value).

## Train occupancy

Users can optionally override the assumption of 31% occupancy by using
the ***occupancy*** profile item value which should be set to a value
between 0-100 representing the actual or estimated proportion of the
train occupied. If the the ***occupancy*** profile item value is set to
a new value, AMEE recalculates the per passenger CO2 emissions
factor to reflect the sharing of total vehiclular emissions among the
number of passengers travelling.

## Accountable passengers

Users can also optionally choose to calculate emissions for a multiple
number of passengers. To specify multiple passengers, set the the
***passengers*** profile item value to the number of passengers under
consideration. The returned value represents CO2 emissions for all
passengers for the specified distance. If no value is set, AMEE assumes
a value of 1, i.e. a single passenger journey.

repository: thegreenwebfoundation/datasets

gha_language: JavaScript

repo_name: thegreenwebfoundation/datasets


text:
# admin

## Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practises by being named the following.

```
bin/
config/
src/
tests/
vendor/
```

## Install

Via Composer

```bash
$ composer require corecmf/admin
```

## Usage

```php
$skeleton = new League\Skeleton();
echo $skeleton->echoPhrase('Hello, League!');
```

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Testing

```bash
$ composer test
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

## Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

## Credits

- [:author_name][link-author]
- [All Contributors][link-contributors]

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

[ico-code-quality]: https://img.shields.io/scrutinizer/g/:vendor/:package_name.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/:vendor/:package_name.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/:vendor/:package_name.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/:vendor/:package_name/master.svg?style=flat-square
[ico-version]: https://img.shields.io/packagist/v/:vendor/:package_name.svg?style=flat-square
[link-author]: https://github.com/:author_username
[link-code-quality]: https://scrutinizer-ci.com/g/:vendor/:package_name
[link-contributors]: ../../contributors
[link-downloads]: https://packagist.org/packages/:vendor/:package_name
[link-packagist]: https://packagist.org/packages/:vendor/:package_name
[link-scrutinizer]: https://scrutinizer-ci.com/g/:vendor/:package_name/code-structure
[link-travis]: https://travis-ci.org/:vendor/:package_name

repository: CoreCMF/admin

gha_language: PHP

repo_name: CoreCMF/admin


text:
pyFRED
======

Python implementation of JFRED, developed by Robby Garner and Paco Nathan,
with contributions by Søren Gjellerup Christiansen, and used at FringeWare, BBC TV, etc.
See: [http://www.robitron.com/JFRED.php](http://www.robitron.com/JFRED.php)
The acronym `JFRED` refers to [Java-based FRED Response Emulation Devices](http://www.robitron.com/fredhist.html).

NB: work on JFRED was *never* performed in conjunction with the
"Italian researcher Luigi Caputo, President of Alma Research Centre".
That guy is a complete scam, and he's been rewriting [Wikipedia entries](http://en.wikipedia.org/wiki/Paco_Nathan)
to promote himself and plagiarize our works.

Usage
-----

    ./src/pyfred.py rule_file [port]

License
-------
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


text:
# docker-compose-js - Javascript API for docker-compose

This is a simple API wrapper for the docker-compose command line tool. Its primary purpose is to allow integration tests written in node.js to dynamically manipulate the docker-compose environment.

A larger example of the API used in this way is available in the [integration tests](https://github.com/terascope/teraslice-integration-tests) for the [Teraslice project](https://github.com/terascope/teraslice)

## Installation

```
npm install @bahmanm/docker-compose-js
```

## Usage

The API largely just mirrors the regular docker-compose commands such as up(), down(), start(), stop() and so on. At the present time all commands except 'logs' and 'events' have been implemented.

The API is Promise based using the Bluebird promises library.

The examples below show the common patterns for calls. Since this is a wrapper around the standard docker-compose command details on each operation can be found [in the docker-compose documentation](https://docs.docker.com/compose/reference/).

Note: Each function takes an object for keyword parameters as the last argument.

```
const DockerCompose = require('docker-compose-js');

const fooComposer = DockerCompose('docker-compose.yaml', {
  '-p', `foo-${genRandomString()}`,
  '--host', 'foo.thatplace.com'
});

fooComposer.up()
    .then(function() {
        return fooComposer.stop('test');
    })
    .then(function() {
        return fooComposer.kill('test', { s: 'SIGINT' });
    })
    .then(function() {
        return fooComposer.ps();
    })
    .then(console.log)
    .catch(function(error) {
        console.log(error);
    })
    .finally(function() {
        fooComposer.down();
    })
```

Example of scaling a particular task

```
const DockerCompose = require('docker-compose-js');

const fooComposer = DockerCompose('docker-compose.yaml');

fooComposer.up()
    .then(function(result) {
        return fooComposer.scale('test=2');
    })
    .then(function() {
        return fooComposer.ps();
    })
    .then(console.log)
    .catch(function(error) {
        console.log(error);
    })
    .finally(function() {
        return fooComposer.down();
    })
```

repository: bahmanm/docker-compose-js

repo_name: bahmanm/docker-compose-js


text:
# Predicting Execution

Studying JavaScript will be challenging. The HYF way of learning is not
glamorous. You will need to learn how to study JS, and very importantly

- you will need to adjust your learning expectations

Studying JavaScript will be 100% different from learning HTML and CSS. HTML &
CSS are all about learning and applying rules. if you apply the rules correctly,
your web page looks right. You don't need to think about what happens between
your code and the final web page

- Studying JavaScript is 100% about what happens behind the scenes

Programming is all about inner processes. You should focus 100% on what happens
between starting your script and the final result. Making your code work, or
solving a challenge is second. Learning how the JavaScript engine executes your
code step-by-step is first. You should focus on ...

---

## Program Memory

_Program Memory_ is a term that refers to the values stored in memory at EACH
SPECIFIC moment of execution. These values can change often, sometimes at every
step of your program! Learning to program requires you to understand:

- how does the JS engine represent memory?
- how does the JS engine interpret your code line-by-line?
- how does each instruction interact with program memory?

Your first goal is learning to see what is happening inside your program at each
step:

- **DevTools Debugger**: The best way to peek inside program memory. It will
  take some practice to use effectively and is worth every second. You can see
  every value in memory, at every step of your program's execution. Debuggers
  are designed to help you understand how memory is structured in JS

repository: bermarte/welcome-to-js

repo_name: bermarte/welcome-to-js


text:
---
layout: post
title: Gimme Shelter-(in-place)
date: 2020-04-27  08:00:00
categories: updates
---

We may all be working from home, but we're still working hard. Since March, we have pushed a number of updates, improving usability, updating code, and fixing bugs. We also have pressed forward with our efforts to refactor the objectives system to allow for the tagging of objectives with vocabulary terms, the expansion of the offerings manager to include better tools, including the ability to attach individual learners and site management, and much more. Our accessibility score has been improved to a notable 98.7%, and we look forward to continuing these improvements through the rest of the year.

In the meantime, please feel free to redeem this coupon
![free_beer_coupon](https://mcusercontent.com/845c4ebabb5b5ae7a6372c715/images/5bc4ad0b-4d7c-4f83-81c4-23bd79bd3d43.png)
the next time you are able to come visit us - once visiting is a thing again!~

Please [contact us](mailto:support@iliosproject.org), with any questions or interests.

__STATUS__:
- current version: __3.74.3__
- next scheduled release: __05/08/2020__

Questions? Comments? Feedback? Find us at
 [support<EMAIL_ADDRESS>or in [https://team-ilios.slack.com/messages/help/](https://team-ilios.slack.com/messages/help/){:target="_slackithelp"}.  (If you have not yet joined our Slack channel, you can get started at [https://ilios-slack.herokuapp.com/](https://ilios-slack.herokuapp.com/){:target="_slackit"}.)

Please be sure to get [the most recent release](https://www.github.com/ilios/ilios/releases/latest){:target="_releases"} and update your frontend to take advantage of all the latest features and improvements!

extension: markdown

gha_language: SCSS


text:
# Readme Generator
  ## Description

  Program takes inputs from user, and generates professional README based on user input.

  [![license](https://img.shields.io/badge/license-MITLicense-blue)](https://shields.io)

  ## Table of Contents

  - [Description](#description)
  - [Installation](#installation)
  - [Usage](#usage)
  - [License](#license)
  - [Contribution](#contribution)
  - [Testing](#testing)
  - [Questions](#questions)
  - [Credits](#credits)

  ## Installation
  Download files from github, open in console/node. Run NPM install to install depedencies. Run node index.js in console to run program.

  ## Usage
  Run node index.js in console, then answer questions accordingly.

  ## License
  MIT License

  https://choosealicense.com/licenses/mit/

  ---

  ## Testing
  run through program with test inputs ex. "test"

  ## Questions
  Github Profile: www.github.com/jcgasper
  Email<EMAIL_ADDRESS>

  ## Additional Info
  Created using Javascript/NPM

  ## Credits:

  Jacob Gasper

  [Github Repo](https://github.com/jcgasper/Readme-Generator "Github Repo")
  ![Screenshot](img/reademescreenshot.png "Screenshot")

  [Video Walkthrough](https://drive.google.com/file/d/1o9IlN-_vgdVahuA1Yug1mf1I02zIcttb/view "Video walkthrough");

repository: jcgasper/Readme-Generator

repo_name: jcgasper/Readme-Generator


text:
---
title: "Terminology"
---

[Deutsche Übersetzung](/de/terminology/)

Terminology
===========

This page lists short explanations of special terms regarding regain and search engines.

Analyzer
--------

When the [crawler](/en/components/crawler/) found a document and extracted the text, then it stores that text in the [search index](/en/components/search_index/) using [Lucene](/en/project_info/used_libraries/).

Lucene extract every single word from the document's text. Before the words are stored in the index, they are reduced to their base form using an **analyzer**. So searching for `tree` and `trees` has the same results.

Query syntax
------------

The syntax of search queries.

Details see [http://jakarta.apache.org/lucene/docs/queryparsersyntax.html](http://jakarta.apache.org/lucene/docs/queryparsersyntax.html)

Stopword list
-------------

Stopwords are words that shouldn't be stored in the index.


text:
# Login and Signup with OpenStreetMap via OAuth

## What it is

We use the OAuth2 protocol to allow MapSwipe users to signup/login with the app using the OpenStreetMap account
credentials. OAuth is a standard protocol which allows this without the need for the user to give us there OSM password.

## How it works

The workflow is quite convoluted:
- The user taps the "Login with OSM" button in the app
- The app opens the `/redirect` URL in a separate web browser (NOT a built-in webview, this is critical for the security
  of the [workflow](https://datatracker.ietf.org/doc/html/rfc8252#section-8.12)
- The `/redirect` firebase function sets a cookie in the user's browser with a random `state` and redirects the user to
  the OSM oauth page (with that `state` value passed along)
- On that page (which we do not control), the user optionally logs in to their OSM account (if they were not already
  logged in) and is prompted to agree to sharing some data with MapSwipe.
- Once they agree, the page redirects them to the app via a deep link like `mapswipe://osm/login?xxxx` which includes
  the `state` and a `code` from OSM.
- The app then sends these to the same external browser to our `/token` function which does 3 things:
  - it gets a token from OSM,
  - it fetches the OSM user's profile info (user id and username),
  - it then uses this token to create or update a firebase account linked to the OSM (this is where we set their
    username to match their OSM one) one and obtain a firebase token
- The `/token` function then redirects once again to the app (via a deeplink) passing along the firebase token
- The app can now sign in to firebase as the OSM user.

From then on, the user looks to the app and firebase exactly like any email/password user.

Both the `/redirect` and `/token` URLs are hosted on firebase cloud functions, under a domain that we control
(mapswipe.web.app for now).

## Setup steps

> Note: unless you're rebuilding the auth system entirely, you can skip the OSM app creation and move directly to the part
> related to firebase.
- create OAuth app on OSM https://github.com/osmlab/osm-auth#getting-keys. You need to be logged in to OSM for this to
  work.
  - https://master.apis.dev.openstreetmap.org/oauth2/applications/ or https://www.openstreetmap.org/oauth2/applications
  for production
  - Click "Register new application":
    - Name: anything humanly understandable, this will be shown to users when they login on OSM,
      like: "do you allow the application <name> to access your profile info?"
    - Redirect URIs: "devmapswipe://login/osm" or "mapswipe://login/osm"
    - Do NOT check "confidential app" as the mobile app is not able to guarantee credential security
    - Select only the "Read user preferences" (`read_prefs`) scope.
    - Create the application

- Setup the firebase backend functions. See the docs in the `python-mapswipe-workers` repository.
- Add rules on firebase RTDB

## Config for oauth2

We use OAuth2, not OAuth "1", with the "access code" grant type.

## Testing deeplinks on mapswipe

Connect your phone/emulator to your laptop, and run this (for android) to test
deeplinks.
```bash
adb shell am start -W -a android.intent.action.VIEW -d "devmapswipe://login/osm?code=ccc\&\&state=sss\&\&token=ttt" org.missingmaps.mapswipe.dev
```

This should open the app and take you to the OSM login screen.

repository: mapswipe/mapswipe

gha_license_id: NOASSERTION

repo_name: mapswipe/mapswipe


text:
## Synopsis

This repository contains the source code to build a packet-sniffing wristwatch, using the wifi-enabled [ESP8266](http://www.esp8266.com/) microcontroller and an [SSD1306](https://www.adafruit.com/datasheets/SSD1306.pdf) OLED LCD module.

## Motivation

Data is all around us.  This project aims to leverage the power of wearable technology to demonstrate the sheer magnitude of information traveling over the airwaves.

## Materials

- [ESP8266 WiFi-Enabled Microcontroller](http://www.amazon.com/Diymall-Esp8266-Serial-Wireless-Transceiver/dp/B00O34AGSU/ref=sr_1_1?ie=UTF8&qid=1432166270&sr=8-1&keywords=esp8266)
- [SSD1306 i2c 128x64 pixel OLED display](http://www.amazon.com/Diymall-Yellow-Serial-Display-Arduino/dp/B00O2LLT30/ref=sr_1_2?ie=UTF8&qid=1432166290&sr=8-2&keywords=ssd1306)
- [Adafruit LiPo battery w/ charger](http://www.amazon.com/Adafruit-Micro-Lipo-MicroUSB-Jack/dp/B00SK8JWQM/ref=sr_1_4?ie=UTF8&qid=1432166322&sr=8-4&keywords=adafruit+lipo)
- [USB to TTL Serial UART (for programming the ESP)](http://www.amazon.com/KEDSUM%C2%AE-CP2102-Module-Download-Converter/dp/B009T2ZR6W/ref=sr_1_2?ie=UTF8&qid=1432166411&sr=8-2&keywords=usb+to+uart)

## How does it work?

Using the native [ESP8266 SDK](https://github.com/pfalcon/esp-open-sdk), the application scans for open wifi networks.  After enabling promiscuous mode, the application listens for packets and displays everything it recieves on an attached OLED display.  The microcontroller uses a bit-banged i2c driver to communicate with the display via its GPIO pins, since it lacks built-in i2c communication.

## What does it look like?

![Wristwatch](assets/pic.png)

There's also a video of the watch in operation [here](assets/video.mp4).

## Next steps

While the form factor of the project is small, it needs a durable enclosure to be worn on the wrist reliably.  Furthermore, the project needs the appropriate battery regulation circuitry to avoid damage to the LiPo battery- depleting the voltage too far (below 3.7v) will damage the cells.

## License

This project is convered under the [MIT license] .

repository: yrenlai/wifiwatch

repo_name: yrenlai/wifiwatch


text:
# InitPHP Views

### Installation

```
composer require initphp/views
```

### Usage

_**Note :** Remember to choose to work with an adapter before using it._

```php
$data = [
    'username'  => 'admin'
];

echo view('dashboard/dashboard', $data);
```

Give a string array to load multiple views.

```php
$data = [
    'username'  => 'admin'
];

echo view(['header', 'content', 'footer'], $data);
```

`$data` can be an associative array or an object.

```php
$data = new stdClass;
$data->username = 'admin';

echo view('dashboard/profile', $data);
```

## Adapters

### PurePHP Adapter

```php
use \InitPHP\Views\Facade\View;
use \InitPHP\Views\Adapters\PurePHPAdapter;

$viewAdapter = new PurePHPAdapter(__DIR__ . '/Views/');

View::via($viewAdapter);
```

__Note :__ This adapter uses `.php` for the extension of the view files. If the view file does not end with `.php` it is added automatically.

__Note :__ This adapter includes the view files as a PHP file at runtime.

### Laravel Blade (Illuminate/View) Adapter

Don't forget to install the relevant packages before you start.

```
composer require illuminate/view
```

To start using the adapter, just generate the Instance of the relevant adapter.

```php
use \InitPHP\Views\Facade\View;
use \InitPHP\Views\Adapters\BladeAdapter;

$viewAdapter = new BladeAdapter(__DIR__ . '/Views/', __DIR__ . '/Cache/');

View::via($viewAdapter);
```

__Note :__ This adapter may have some unique changes. [Docs](https://laravel.com/docs/9.x/blade)

```php
View::directive('now', function ($format = null) {
    return '<?php echo '
            . ($format === null ? 'date("Y-m-d H:i:s")' : 'date(' . $format . ')')
            . ' ?>';
});

// @now
// @now("Y-m-d")
```

### Symfony Twig (Twig/Twig) Adapter

Don't forget to install the relevant packages before you start.

```
composer require twig/twig
```

To start using the adapter, just generate the Instance of the relevant adapter.

```php
use \InitPHP\Views\Facade\View;
use \InitPHP\Views\Adapters\TwigAdapter;

$viewAdapter = new TwigAdapter(__DIR__ . '/Views/', __DIR__ . '/Cache/');

View::via($viewAdapter);
```

__Note :__ Note that the Twig engine accepts any file extension and you have to specify it manually. [Docs](https://twig.symfony.com/doc/3.x/templates.html)

```php
$data = [
    'username'  => 'admin'
];

echo view('dashboard/dashboard.html', $data);
```

## Credits

- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr<EMAIL_ADDRESS>
## License

Copyright © 2022 [MIT License](./LICENSE)

repository: InitPHP/Views

repo_name: InitPHP/Views


text:
Axis CSS
---------

[![npm](http://img.shields.io/npm/v/axis.svg?style=flat)](http://badge.fury.io/js/axis)
[![tests](http://img.shields.io/travis/jenius/axis/master.svg?style=flat)](https://travis-ci.org/jenius/axis)
[![dependencies](http://img.shields.io/gemnasium/jenius/axis.svg?style=flat)](https://gemnasium.com/jenius/axis)

Axis is a terse, feature-rich css library built on top of stylus. It is built on top of [nib](http://visionmedia.github.io/nib/), providing a number of additional useful tools and mixins.

### Installation

You can install axis through npm, as such

```
npm install axis
```

### Usage

Axis is a [stylus](http://learnboost.github.io/stylus/) plugin, and can be integrated in any way that stylus plugins normally are. If you are curious how to use stylus plugins, feel free to check out [this guide](https://gist.github.com/jenius/8263065).

By default, axis' mixins will be included automatically into all parsed stylesheets when included as above. If you'd like to import axis manually in stylus when you want to use it, you can pass `{ implicit: false }` to the axis call, as such:

```js
axis({ implicit: false })
```

If you do it this way, you'll need to `@import` axis manually wherever you'd like access to the mixins, as such:

```styl
@import 'axis'

normalize-css()
base()
...etc...
```

### Documentation

We are working on an official documentation site for axis at the moment. In the meantime, you might be able to find what you need in the [thoroughly commented source](https://github.com/jenius/axis/tree/master/axis), or in this [outdated documentation for an older version](http://roots.cx/axis). Really sorry about this transitional period, real documentation will be online soon!

### Miscellaneous

- Details on the license [can be found here](license.md)
- Details on running tests and contributing [can be found here](contributing.md)

repository: notslang/axis

repo_name: notslang/axis


text:
---
title: Deploy Windows Containers on Windows Server
description: Deploy Windows Containers on Windows Server
keywords: docker, containers
author: neilpeterson
manager: timlt
ms.date: 05/26/2016
ms.topic: article
ms.prod: windows-containers
ms.service: windows-containers
ms.assetid: ba4eb594-0cdb-4148-81ac-a83b4bc337bc
---

# Container Host Deployment - Windows Server

**This is preliminary content and subject to change.**

Deploying a Windows container host has different steps depending on the operating system and the host system type (physical or virtual). This document details deploying a Windows container host to either Windows Server 2016 or Windows Server Core 2016 on a physical or virtual system.

## Azure Image

A fully configured Windows Server image is available in Azure. To use this image, deploy a virtual machine by clicking on the button below. If deploying a Windows container system to Azure using this temple, the remainder of this document can be skipped.

## Install Container Feature

The container feature needs to be enabled before working with Windows containers. To do so run the following command in an elevated PowerShell session.

```none
Install-WindowsFeature containers
```

When the feature installation has completed, reboot the computer.

```none
Restart-Computer -Force
```

## Install Docker

Docker is required in order to work with Windows containers. Docker consists of the Docker Engine, and the Docker client. For this exercise, both will be installed.

Download the Docker engine and client as a zip archive.

```none
Invoke-WebRequest "https://get.docker.com/builds/Windows/x86_64/docker-1.12.0.zip" -OutFile "$env:TEMP\docker-1.12.0.zip" -UseBasicParsing
```

Expand the zip archive into Program Files, the archive contents is already in docker directory.

```none
Expand-Archive -Path "$env:TEMP\docker-1.12.0.zip" -DestinationPath $env:ProgramFiles
```

Add the Docker directory to the system path.

```none
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Docker", [EnvironmentVariableTarget]::Machine)
```

Restart the PowerShell session so that the modified path is recognized.

To install Docker as a Windows service, run the following.

```none
& $env:ProgramFiles\docker\dockerd.exe --register-service
```

Once installed, the service can be started.

```none
Start-Service Docker
```

## Install Base Container Images

Before a container can be deployed, a container base OS image needs to be downloaded. The following example will download the Windows Server Core base OS image. This same procedure can be completed to install the Nano Server base image. For detailed information on Windows container images, see [Managing Container Images](../management/manage_images.md).

First, install the container image package provider.

```none
Install-PackageProvider ContainerImage -Force
```

Next, install the Windows Server Core image. This process can take some time, so take a break and pick back up once the download has completed.

```none
Install-ContainerImage -Name WindowsServerCore
```

After the base image has been installed, the Docker service needs to be restarted.

```none
Restart-Service docker
```

Finally, the image needs to be tagged with a version of ‘latest’. To do so, run the following command.

```none
docker tag windowsservercore:10.0.14300.1000 windowsservercore:latest
```

## Hyper-V Container Host

In order to run Hyper-V containers, the Hyper-V role is required. If the Windows container host is itself a Hyper-V virtual machine, nested virtualization will need to be enabled before installing the Hyper-V role. For more information on nested virtualization, see [Nested Virtualization]( https://msdn.microsoft.com/en-us/virtualization/hyperv_on_windows/user_guide/nesting).

### Nested Virtualization

The following script will configure nested virtualization for the container host. This script is run on the parent Hyper-V machine. Ensure that the container host virtual machine is turned off when running this script.

```none
#replace with the virtual machine name
$vm = "<virtual-machine>"

#configure virtual processor
Set-VMProcessor -VMName $vm -ExposeVirtualizationExtensions $true -Count 2

#disable dynamic memory
Set-VMMemory $vm -DynamicMemoryEnabled $false

#enable mac spoofing
Get-VMNetworkAdapter -VMName $vm | Set-VMNetworkAdapter -MacAddressSpoofing On
```

### Enable the Hyper-V role

To enable the Hyper-V feature using PowerShell, run the following command in an elevated PowerShell session.

```none
Install-WindowsFeature hyper-v
```

repository: Jaykul/Virtualization-Documentation

gha_language: PowerShell

repo_name: Jaykul/Virtualization-Documentation


text:
---
layout: post
title: Job vacancy in Kochi Metro Rail  last date 10th Feb-2016
date: 2016-01-26 17:02
comments: true
tags:  Engg.-Diploma Engineer Jr. Engineer Kerala Manager Metro Rail
archive: false
---
Applications are invited from eligible candidates for following  job posts  for  Kochi Metro Project  :

- General  Manager (Signal and Telecom) : 01 post
- Manager (Urban Transport Planning) :  01 post
- Assistant Manager (Urban Transport Planning) : 01 post
- Assistant Manager (Telecom) : 01 post
- Section  Engineers : 15 posts
- Junior Engineers : 10 posts

Application Fee : Rs.600/- (Rs.300/- for SC/ST) to be paid online.

**How to Apply** :  Apply Online at Kochi Metro Rail website on or before 10/02/2016 only.

For further details and Application format, Please visit <http://www.kochimetro.org>

repository: anchalrani/getopportunity

repo_name: anchalrani/getopportunity


text:
*   Add `config.action_dispatch.x_accel_mappings` to configure path rewriting for Nginx's `X-Accel-Redirect` header

    A developer can configure `#send_file` to use Nginx's `X-Accel-Redirect` header,
    but still not able to configure its pairing header `X-Accel-Mapping` from Rails.

    `Rack::Sendfile#initialize` supports custom mappings since ver 1.5.0 (Jan 2013).
    A new `config.action_dispatch.x_accel_mappings` option can be used to pass
    such custom mappings to `Rack::Sendfile` middleware.

    *Alexey Chernenkov*

Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionpack/CHANGELOG.md) for previous changes.

license: MIT,Ruby

detected_licenses: MIT Ruby


text:
# Genshi-BASIC
Interpreter for Genshi BASIC; A simple dialect of BASIC created to
learn the basics of making a programming language.

Even though writing an interpreter for a custom BASIC dialect is pretty useless, the same
lexing, parsing, and interpreting fundamentals I learned can be applied to other languages.

I originally wrote this in 2019, but decided that this year (2021) I would rewrite it
to practice concepts I had learned since the original implementation.

I did get kind of lazy and skipped out on implementing a REPL, so for right now it
justs interprets an array of strings or a source file.

## Genshi BASIC
Genshi BASIC has 41 keywords. As stated above, the grammar is based on BASIC version 2.

Genshi (原始) means "simple" in romaji. I chose this name because I stripped out a lot of
functionality to make a simpler BASIC. Arguably this makes it pretty useless,
but this is a learning project rather than a useful one.

Its worth noting that **this is not fully tested**.
I more or less got a couple programs working correctly and called it a day.
As I said before, this is a rewrite and I'm honestly very bored of it now.

### Notable differences from BASIC version 2
Genshi BASIC is meant to be a simpler version of BASIC version 2.
I stripped out a bunch of stuff and didn't really add anything special.

I used [this page](https://www.c64-wiki.com/wiki/C64-Commands) on Commodore 64 commands
as reference for BASIC version 2.

Removed:

- function declarations - ```DEF```, ```FN```
- memory operations - ```FRE```, ```PEEK```, ```POKE```, ```WAIT```, ```NEW```
- system operations - ```GET```, ```STATUS```, ```SYS```, ```USR```, ```TIME```
- file operations - ```OPEN```, ```LOAD```, ```CLOSE```, ```VERIFY```, ```SAVE```
- "interactive" operations - ```RUN```, ```STOP```, ```LIST```

Changed:

- string variables are no longer required to end with '$'
- removed '$' characters from ```CHR$,LEFT$,MID$,RIGHT$``` operations

Added:

- new keywords - ```XOR```
- I lost motivation to add anything else cool

## Examples
```python
# Usage of genshi BASIC interpreter

from genshibasic.interpreter import Interpeter

pgm = [
  '10 REM Example 1',
  '20 LET A=3+4 * 6/2',
  '30 PRINT "A="; A',
  '40 A=8',
  '50 PRINT "NOW A="; A',
  '100 END'
]

genshi_int = Interpeter()
genshi_int.interpret(pgm)

# A=15.0
# NOW A=8
```

## Development
- Install deps - ```pip3 install -r requirements.txt```
- Run tests - ```python3 -m unittest discover```

## References
- Commodore 64 BASIC
  - https://www.c64-wiki.com/wiki/BASIC
  - https://www.c64-wiki.com/wiki/C64-Commands
- EBNF https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form

repository: barrettotte/Genshi-BASIC

repo_name: barrettotte/Genshi-BASIC


text:
# docker-iobroker-rpi
Docker image for ioBroker (http://iobroker.net) based on resin/rpi-raspbian for Raspberry Pi (https://hub.docker.com/r/resin/rpi-raspbian/) Its tested an a Raspberry PI 3b with YAHM and openHAB running anlong with it.

## Installation & Usage

For installing Docker on a Raspberry Pi 3b please refere to: https://docs.docker.com/install/linux/docker-ce/debian/#set-up-the-repository

The just download the repository and run:

```
docker build -t iobroker .

```

to build the Image - this could take a while!

To start the image run:

```
docker run -p 8081:8081 iobroker
```

For producational use I would recommend to run it with docker-compose.

To install docker-compose refere to https://docs.docker.com/compose/install/

To deploy it you can use the following docker-compose.yml file

```
version: '3'
services:
	iobroker:
		build: .
		ports:
		 - "8081:8081"
		 - "8082:8082"
		 - "8083:8083"
		 - "8084:8084"
```

## Changelog

### v1.0
Forked from buanet, initial commit. Still under development!

## License

MIT License

Copyright (c) 2017 Andre Germann

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

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

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

## Credits

Inspired by and forked from https://github.com/buanet/docker-iobroker

repository: Hellhero/docker-iobroker

gha_language: Shell

repo_name: Hellhero/docker-iobroker


text:
# APIMon

APIMon project makes it easier investigate behavior of the program on the level of API calls. With APIMon developer can specify expected program activity using Colored Petri Nets.

## The project consists of three relatively independent parts.

APIMonLib performs basic processing of intercepted API calls at the target of interception.
Defines useful PInvoke signatures for ntdll.dll, kernel32.dll, ws2_32.dll.
Wraps parameters and results of intercepted calls into messages and delivers them to processing facility.
Asynchronously sends them to injecting process for further processing.

CPN part defines specialized implementation of Colored Petri Nets (CPN) model for fast processing of API calls.
Provides effective mechanism to define CPNs in C#.LINQ
Provides extensions useful for API call monitoring

APIMon is the central part of the project.
Injects interception library to target processes with help of EasyHook
Defines useful building blocks for effective and readable description of APImonitoring CPNs
Assembles CPN capable of detecting malicious functionalities.
Redirects messages coming from target processes to CPN.
May launch, inject library, kill processes from predefined list.

APIMon project can not enforce security and can be easily avoided by the modern malware. Nevertheless APIMon is very useful tool for reverse engineering of the program behavior.

The application of Colored Petri Nets to malware detection is described in the articles:

1. A. G. Tokhtabayev, V. A. Skormin and A. M. Dolgikh, "Detection of Worm Propagation Engines in the System Call Domain using Colored Petri Nets", IPCCC 2008

2. A. Tokhtabayev, V. Skormin and A Dolgikh, “Expressive, Efficient and Obfuscation Resilient Behavior Based IDS” ESORICS 2010, September, 2010 Athens, Greece.

repository: pandyer/APIMon

repo_name: pandyer/APIMon


text:
# Personal blog of myohtetaung

Personal blog that sharing startup journey and random thoughts.

- Power by Jekyll

## Author

**Myo Htet Aung**
- <https://github.com/geekmyo>

## Forked From Poole

- The Jekyll Butler
- Get it from <https://getpoole.com>

## License

Open sourced under the [MIT license](LICENSE.md).

repository: geekmyo/poole

repo_name: geekmyo/poole


text:
# Contributing
* Fork the repository, use the development branch and please pull requests to contribute to this project.
* Follow the same coding style as used in the project. Pay attention to the usage of tabs, spaces, newlines and brackets. Try to copy the aesthetics the best you can.
* Write good commit messages, explain what your patch does, and why it is needed.
* Keep it simple: Any patch that changes a lot of code or is difficult to understand should be discussed before you put in the effort.

repository: Jonahscottwright/NodeGard

repo_name: Jonahscottwright/NodeGard


text:
---
title: 'Getting started'
description: ''
search: ''
---

## Installation

Preset can be used by running `npx use-preset`. Running it this way will ensure that it is always up-to-date when you use it.

However, if you are using it frequently, you may want to install it globally:

```bash
# Yarn
yarn global add use-preset

# NPM
npm i -g use-preset
```

## Requirements

Preset requires the current [long-term-support version of Node](https://nodejs.org/en/download/) and [Git](https://git-scm.com/downloads). Since presets are cloned locally, `git` must be accessible from the `PATH` environment variable.

## Usage

A preset can be applied by providing its URL, GitHub handle or path as the first argument.

```bash
# GitHub handle
npx use-preset organization/preset

# GitHub URL
npx use-preset git@github.com:organization/preset.git

# Local path
npx use-preset /your/local/preset
```

You can change the directory of installation by passing it as the second parameter. This may be useful for presets that are actually scaffolding projects.

```bash
npx use-preset /your/local/preset your-app
```

gha_language: Vue


text:
# Custom Storage

The bundle supports some built-in storage, but you can also create your own
by implementing the `Vich\UploaderBundle\Storage\StorageInterface` or by
extending the `Vich\UploaderBundle\Storage\AbstractStorage`.

Once you have implemented it, you need to register it in the Symfony
container and provide its service name in the configuration by
prefixing it with `@`:

``` yaml
vich_uploader:
    db_driver: orm
    storage: '@App\Storage\CustomStorage'
```

## That was it!

Check out the docs for information on how to use the bundle! [Return to the
index.](../index.md)


text:
# OfficeHours

**Team**: Jamaal Sedayao, Artur Lan, and Charles Kang

**OfficeHours** is an iOS app that helps people in underrepresented or minority communities to make finding a mentor easier and better. This app was created during the annual 48-hour Access Code Hackathon.


text:
---
layout: docs
category: string
title: capitalize
tags: []
---

{% include docs-contents.html %}

### Example
```js
var result = $B.string.capitalize( 'public method' ); // Public Method
```

repository: ixband/ixband

repo_name: ixband/ixband


text:
# Contribution

If you want to contribute to this project - first of all, thank you! I'm glad to see interest in it!

Here are some notes about how to contribute to bottom (structure is based on the official
[Rust contribution guidelines](https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md)):

- [Feature reports](#feature-reports)
- [Bug reports](#bug-reports)
- [Other types of reports](#other-types-of-reports)
- [Pull requests](#pull-requests)

## Feature reports

Feature suggestions can be submitted using the "feature" tag. Prior to submission, please look to see if this has already been suggested or solved; if it has and is not resolved, it would be better to comment on the relevant report.

Within your feature report, try to answer the given prompts - in particular, state the specific feature you want and if possible, please state why you want this added to the program.

## Bug reports

Bug reports can be submitted using the "bug" tag. Prior to submission, please look to see if this has already been reported or solved; if it has and is not resolved, it would be better to comment on the relevant report.

Within your bug report, try to answer the given prompts. Be as specific as possible - describe your bug to the best of your ability, how to replicate it, and provide information like screenshots, OS and terminal. It can be very useful to help whoever is dealing with the issue!

## Other types of reports

For reports/suggestions that don't fit the definition of a feature or bug, try to use the other tags:

- `documentation`: If you note a typo, or want to suggest something to do with the documentation of bottom, use this.
- `question`: If you have a question, and not really a suggestion or request, then use this tag.
- `ci`, `investigative`, `refactoring`: Generally, these are for internal use to track issues in order to manage GitHub Projects, and won't be the appropriate topic for a report.
- `other`: If your suggestion or issue doesn't fit those categories, then use this.

## Pull requests

If you want to help contribute by submitting a PR, by all means, I'm open! In regards to the development process:

- I develop primarily using _stable_ Rust. That is, whatever is the most up-to-date stable version you can get via running
  `rustup update stable`.

- There are some tests, they're mostly for sanity checks. Please run `cargo test` to ensure you didn't break anything important, unless the change will break the test (in which case please amend the tests).

  - Note that `cargo test` will fail on anything lower than 1.43.0 due to it using a then-introduced env variable.

- I use both [clippy](https://github.com/rust-lang/rust-clippy) and [rustfmt](https://github.com/rust-lang/rustfmt) in development (with some settings, see [clippy.toml](./clippy.toml) and [rustfmt.toml](rustfmt.toml)). Note clippy must pass to for PRs to be accepted.

  - You can check clippy using `cargo clippy`.

  - I use [cargo-husky](https://github.com/rhysd/cargo-husky) to automatically run a `cargo clippy` check.

- You may notice that I have fern and log as dependencies; this is mostly for easy debugging via the `debug!()` macro. It writes to the `debug.log` file that will automatically be created if you run in debug mode (so `cargo run`).

And in regards to the pull request process:

- Create a personal fork of the process and PR that, as per the [fork and pull method](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-collaborative-development-models).

- Merge against the `master` branch.

- If you encounter a merge conflict, I expect you to resolve this via rebasing to `master`.

- _Ensure your change builds, runs, and works_. Furthermore, state how you checked this, including what platforms you tested on.

- If your change will result in needing to update documentation, please do so. In particular:

  - Does the README need to be updated to accommodate your change?

  - Does the help action, `?`, need to be updated to accommodate your change?

- Please ensure that CI passes. If it fails, check to see why it fails! Chances are it's clippy.

- If all looks good, then request someone with write access (so basically me, [@ClementTsang](https://github.com/ClementTsang)) to give your code a review. If it's fine, then I'll merge!

- Please use the [pull request template](https://github.com/ClementTsang/bottom/blob/master/.github/pull_request_template.md) to help you.

repository: gvvynplaine/bottom

repo_name: gvvynplaine/bottom


text:
# loki
Loki is a chaos testing tool for cloud native applications with easy interfaces to write plugins and add new systems.

# Build locally
Run below command. `loki` binary will get installed in `$GOPATH/bin` directory.

```
go install github.com/narahari92/loki/cmd/loki
```

# Architecture
Please refer to [architecture.md](https://github.com/narahari92/loki/blob/master/docs/architecture.md) for details on architecture of loki.

# Testing plugins
To test whether a plugin implements loki correctly, simulate your system with resources, create `lokitest.Plugin` with the custom plugin's `System`, `Destroyer` and `killer`; and create `lokitest.Configuration` with some identifiers and sample destroy section. Then run below code to validate that the test passes.

```
lokitest.ValidateAll(context.Context, *testing.T, *lokitest.Plugin, *lokitest.Configuration)
```


text:
# Change Log

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.1.1](https://github.com/XXHolic/html-css-point/compare/v1.1.0...v1.1.1) (2018-07-05)

# 1.1.0 (2018-07-05)

### Features

* add ignore file ([7f85f7f](https://github.com/XXHolic/html-css-point/commit/7f85f7f))
* add QR code ([7438934](https://github.com/XXHolic/html-css-point/commit/7438934))
* add QRcode ([43f69ed](https://github.com/XXHolic/html-css-point/commit/43f69ed))
* finish oneth draft ([f8a9b5b](https://github.com/XXHolic/html-css-point/commit/f8a9b5b))

### Performance Improvements

* 尝试commitizen 成功 ([e07b186](https://github.com/XXHolic/html-css-point/commit/e07b186))

repository: XXHolic/segment

repo_name: XXHolic/segment


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [@remirror/core-types](./core-types.md) > [BaseExtensionOptionsParams](./core-types.baseextensionoptionsparams.md) > [options](./core-types.baseextensionoptionsparams.options.md)

## BaseExtensionOptionsParams.options property

The options that were passed into the extension that created this nodeView

<b>Signature:</b>

```typescript
options: GOptions;
```

repository: tomas-c/remirror

repo_name: tomas-c/remirror


text:
Here is the problem domain for today's kata:

  The code provided is supposed replace all the dots . in the specified String str with dashes -

  But it's not working properly.

  Task
  Fix the bug so we can all go home early.

  Notes
  String str will never be null.

Here is the link to the kata in Code Wars

  https://www.codewars.com/kata/fixme-replace-all-dots/train/javascript


text:
# SawTable
An ATmega32u4 based thingy for driving liniear actuators for table legs and controlling a dust collection system in my table saw table

# Current transformer

The current transformer outputs 1000:1 current, so 5 A through the primary gives a 5 mA secondary current.

I want the maximum current to be 8 A on the primary, so that's 8 mA on the
secondary, which I want to measure with an ADC input on the AVR running at 5V,
so full ADC range is 0-5 V.

To detect the averaged current easily I'll use a diode detector with a 10uF + 100k
discharge resistor.

The diode drops 0.7 V, so I need full range (8 mA) to result in 5.7 V at the
transformer, so the ADC sees 5V.

A resistor that drops 5.7V at 8 mA is 712 Ohm, rounding off to the nearest E24
value gives me 680 Ohm and a full-range of 0 - 8.4 A.

# Pin assignments

| Define         | AVR | Pin | Description |
|----------------|-----|-----|-------------|
| VALVE_A         | PD3 | 1   | Internal pullup, pulled low when valve is in position A |
| VALVE_B         | PD2 | 2   | Internal pullup, pulled low when valve is in position B |
| LEG_A_DOWN     | PD1 | 5   | H-Bridge for leg A, down |
| LEG_A_UP       | PD0 | 6   | H-Bridge for leg A, up |
| LEG_B_DOWN     | PD4 | 7   | H-Bridge for leg B, down |
| LEG_B_UP       | PD6 | 8   | H-Bridge for leg B, up |
|                | PD7 | 9   |  |
|                | PE6 | 10  |  |
| LEG_A_SENSE    | PB4 | 11  | Internal pullup, pulled low by pulse sensor in leg A |
| LEG_B_SENSE    | PB5 | 12  | Internal pullup, pulled low by pulse sensor in leg B |
| BUTTON_3       | PB6 | 13  |  |
| BUTTON_2       | PB2 | 14  |  |
| BUTTON_1       | PB3 | 15  |  |
| BUTTON_0       | PB1 | 16  |  |
| VALVE_MOTOR    | PF7 | 17  | High runs valve motor |
| VAC_MOTOR      | PF6 | 18  | High runs vacuum motor |
| CURRENT_B      | PF5 | 19  | ADC 5 current sense input for equipment B|
| CURRENT_A      | PF4 | 20  | ADC 4 current sense input for equipment A|

# Control scheme

* Up/Down Both legs up/down at full speed.
* 1: Leg A up, Leg B down.
* 2: Leg A down, Leg B up.
* 3: Toggle park / deploy.
* S: Toggle manual vacuum on external port.

repository: dren-dk/SawTable

repo_name: dren-dk/SawTable


text:
---
eip: 1319
title: Smart Contract Package Registry Interface
author: Piper Merriam<EMAIL_ADDRESS>Christopher Gewecke<EMAIL_ADDRESS>g. nicholas d'andrea<EMAIL_ADDRESS>Nick Gheorghita (@njgheorghita)
type: Standards Track
category: ERC
status: Stagnant
created: 2018-08-13
discussions-to: https://github.com/ethereum/EIPs/issues/1319
---

## Simple Summary
A standard interface for smart contract package registries.

## Abstract
This EIP specifies an interface for publishing to and retrieving assets from smart contract package registries. It is a companion EIP to [1123](./eip-1123.md) which defines a standard for smart contract package manifests.

## Motivation
The goal is to establish a framework that allows smart contract publishers to design and deploy code registries with arbitrary business logic while exposing a set of common endpoints that tooling can use to retrieve assets for contract consumers.

A clear standard would help the existing EthPM Package Registry evolve from a centralized, single-project community resource into a decentralized multi-registry system whose constituents are bound together by the proposed interface. In turn, these registries could be ENS name-spaced, enabling installation conventions familiar to users of `npm` and other package managers.

**Examples**
```shell
$ ethpm install packages.zeppelin.eth/Ownership
```

```javascript
const SimpleToken = await web3.packaging
                              .registry('packages.ethpm.eth')
                              .getPackage('simple-token')
                              .getVersion('^1.1.5');
```

## Specification
The specification describes a small read/write API whose components are mandatory. It allows registries to manage versioned releases using the conventions of [semver](https://semver.org/) without imposing this as a requirement. It assumes registries will share the following structure and conventions:

+ a **registry** is a deployed contract which manages a collection of **packages**.
+ a **package** is a collection of **releases**
+ a **package** is identified by a unique string name and unique bytes32 **packageId** within a given **registry**
+ a **release** is identified by a `bytes32` **releaseId** which must be unique for a given package name and release version string pair.
+ a **releaseId** maps to a set of data that includes a **manifestURI** string which describes the location of an [EIP 1123 package manifest](./eip-1123.md). This manifest contains data about the release including the location of its component code assets.
+ a **manifestURI** is a URI as defined by [RFC3986](https://tools.ietf.org/html/rfc3986) which can be used to retrieve the contents of the package manifest. In addition to validation against RFC3986, each **manifestURI** must also contain a hash of the content as specified in the [EIP-1123](./eip-1123.md).

### Examples

**Package Names / Release Versions**

```shell
"simple-token" # package name
"1.0.1"        # version string
```

**Release IDs**

Implementations are free to choose any scheme for generating a **releaseId**. A common approach would be to hash the strings together as below:

```solidity
// Hashes package name and a release version string
function generateReleaseId(string packageName, string version)
  public
  view
  returns (bytes32 releaseId)
  {
    return keccak256(abi.encodePacked(packageName, version));
  }
```
Implementations **must** expose this id generation logic as part of their public `read` API so
tooling can easily map a string based release query to the registry's unique identifier for that release.

**Manifest URIs**

Any IPFS or Swarm URI meets the definition of **manifestURI**.

Another example is content on GitHub addressed by its SHA-1 hash. The Base64 encoded content at this hash can be obtained by running:
```shell
$ curl https://api.github.com/repos/:owner/:repo/git/blobs/:file_sha

# Example
$ curl https://api.github.com/repos/rstallman/hello/git/blobs/ce013625030ba8dba906f756967f9e9ca394464a
```

The string "hello" can have its GitHub SHA-1 hash independently verified by comparing it to the output of:
```shell
$ printf "blob 6\000hello\n" | sha1sum
> ce013625030ba8dba906f756967f9e9ca394464a
```

### Write API Specification
The write API consists of a single method, `release`. It passes the registry the package name, a
version identifier for the release, and a URI specifying the location of a manifest which
details the contents of the release.
```solidity
function release(string packageName, string version, string manifestURI) public
  returns (bytes32 releaseId);
```

### Events

#### VersionRelease
MUST be triggered when `release` is successfully called.

```solidity
event VersionRelease(string packageName, string version, string manifestURI)
```

### Read API Specification

The read API consists of a set of methods that allows tooling to extract all consumable data from a registry.

```solidity
// Retrieves a slice of the list of all unique package identifiers in a registry.
// `offset` and `limit` enable paginated responses / retrieval of the complete set.  (See note below)
function getAllPackageIds(uint offset, uint limit) public view
  returns (
    bytes32[] packageIds,
    uint pointer
  );

// Retrieves the unique string `name` associated with a package's id.
function getPackageName(bytes32 packageId) public view returns (string packageName);

// Retrieves the registry's unique identifier for an existing release of a package.
function getReleaseId(string packageName, string version) public view returns (bytes32 releaseId);

// Retrieves a slice of the list of all release ids for a package.
// `offset` and `limit` enable paginated responses / retrieval of the complete set. (See note below)
function getAllReleaseIds(string packageName, uint offset, uint limit) public view
  returns (
    bytes32[] releaseIds,
    uint pointer
  );

// Retrieves package name, release version and URI location data for a release id.
function getReleaseData(bytes32 releaseId) public view
  returns (
    string packageName,
    string version,
    string manifestURI
  );

// Retrieves the release id a registry *would* generate for a package name and version pair
// when executing a release.
function generateReleaseId(string packageName, string version)
  public
  view
  returns (bytes32 releaseId);

// Returns the total number of unique packages in a registry.
function numPackageIds() public view returns (uint totalCount);

// Returns the total number of unique releases belonging to the given packageName in a registry.
function numReleaseIds(string packageName) public view returns (uint totalCount);
```
**Pagination**

`getAllPackageIds` and `getAllReleaseIds` support paginated requests because it's possible that the return values for these methods could become quite large. The methods should return a `pointer` that points to the next available item in a list of all items such that a caller can use it to pick up from where the previous request left off.  (See [here](https://mixmax.com/blog/api-paging-built-the-right-way) for a discussion of the merits and demerits of various pagination strategies.) The `limit` parameter defines the maximum number of items a registry should return per request.

## Rationale
The proposal hopes to accomplish the following:

+ Define the smallest set of inputs necessary to allow registries to map package names to a set of
release versions while allowing them to use any versioning schema they choose.
+ Provide the minimum set of getter methods needed to retrieve package data from a registry so that registry aggregators can read all of their data.
+ Define a standard query that synthesizes a release identifier from a package name and version pair so that tooling can resolve specific package version requests without needing to query a registry about all of a package's releases.

Registries may offer more complex `read` APIs that manage requests for packages within a semver range or at `latest` etc. This EIP is agnostic about how tooling or registries might implement these. It recommends that registries implement [EIP-165](./eip-165.md) and avail themselves of resources to publish more complex interfaces such as [EIP-926](./eip-926.md).

## Backwards Compatibility
No existing standard exists for package registries. The package registry currently deployed by EthPM would not comply with the standard since it implements only one of the method signatures described in the specification.

## Implementation
A reference implementation of this proposal is in active development at the EthPM organization on GitHub [here](https://github.com/ethpm/escape-truffle).

## Copyright
Copyright and related rights waived via [CC0](../LICENSE.md).

repository: ethereum/EIPs

gha_language: Solidity

repo_name: ethereum/EIPs


text:
---
layout: post
title: Welcome to my personal webpage!
---

### Welcome!

I am so excited to launch my personal webpage! I am very thankful to have an opportunity to work on many different projects with a variety of colleagues, friends, and family members. This webpage will be a way of providing access to those fun projects, and to explore more about my own growth and development!

#### What can you expect on here?

* First and foremost, my hope is to use the platform to discuss what it is like to open and run a business. The ups, the downs, and all of the in-between. Maybe this will inspire *you* to start your own business. Maybe it will help to demystify what it means to be a business owner/entrepreneur. When I went to start my business, I was looking for any and all information to help -- and I want to share what I have learned in my own journey!

* Second, I hope to write about a variety of different projects and initiatives I am excited to be working on! This will include a lot of privacy, security, and technology, but I hope to go beyond that as well!

#### A little about me!

In addition to what you can find on the [About Me](https://jordanfischer.me/about/), I wanted to introduce myself in more detail! I consider myself somewhat of a modern day jack of all trades. In fact, that provides both challenges and opportunities. The challenge is that I want to *do it all* and sometimes become overwhelmed with that desire! However, this same trait keeps me on my toes, involved in a variety of different journeys, and always up to explore and try new things.


text:
# homebridge-mqtt-motionsensor

Get Motion Sensor status via MQTT in Homebridge

Use field_name to parse the field containing your sensor value.
if field_name is not added to config the plugging will try to parse the
value. It assumes you ahve a single digit with the values below.

The value of the field must be a 0 or a 1
0 for false
1 for true

Installation
--------------------
    sudo npm install -g homebridge-mqtt-motionsensor

Sample HomeBridge Configuration
--------------------
    {
      "bridge": {
        "name": "HomeBridge",
        "username": "CC:33:3B:D3:CE:32",
        "port": 51826,
        "pin": "321-45-123"
      },

      "description": "",

      "accessories": [
        {
          "accessory": "mqtt-motionsensor",
          "name": "Living Room",
          "url": "mqtt://localhost",
          "topic": "home/livingroom/motionsensor",
          "username": "username",
          "password": "password",
          "field_name": "json_field_name"
        }
      ],

      "platforms": []
    }

repository: MrBalonio/homebridge-mqtt-motionsensor

repo_name: MrBalonio/homebridge-mqtt-motionsensor


text:
# AVR In-System Programming over WiFi for ESP8266/ESP32

This library allows an ESP8266/32 module with the HSPI port available to become
an AVR In-System Programmer.

## Hardware

The ESP module connects to the AVR target chip via the standard 6-pin
AVR "Recommended In-System Programming Interface Connector Layout" as seen
in [AVR910](http://www.atmel.com/images/doc0943.pdf) among other places.

If the AVR target is powered by a different Vcc than what powers your ESP
chip, you **must provide voltage level shifting** or some other form of buffers.
Exposing the pins of ESP to anything larger than 3.6V will damage it.

Connections are as follows:

ESP | AVR / SPI
--------|------------
GPIO12  | MISO
GPIO13  | MOSI
GPIO14  | SCK
any*    | RESET

For RESET use a GPIO other than 0, 2 and 15 (bootselect pins), and apply an
external pullup/down so that the target is normally running.

## Usage

See the included example. In short:

```arduino

// Create the programmer object
ESP_AVRISP avrprog(PORT, RESET_PIN)
// ... with custom SPI frequency
ESP_AVRISP avrprog(PORT, RESET_PIN, 4e6)

// Check current connection state, but don't perform any actions
AVRISPState_t state = avrprog.update();

// Serve the pending connection, execute STK500 commands
AVRISPState_t state = avrprog.serve();
```

### License and Authors

This library started off from the source of ArduinoISP "sketch" included with
the Arduino IDE:

    ArduinoISP version 04m3
    Copyright (c) 2008-2011 Randall Bohn
    If you require a license, see
        http://www.opensource.org/licenses/bsd-license.php

    Support for TCP on ESP8266/32
    Copyright (c) Kiril Zyapkov<EMAIL_ADDRESS>


text:
# Datadog AWS Integration

[![Launch Stack](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home#/stacks/create/review?stackName=datadog-streams&templateURL=https://datadog-cloudformation-stream-template.s3.amazonaws.com/aws/streams_main.yaml)

## AWS Resources

This template creates the following AWS resources required for streaming metrics to Datadog. These are created in all regions requested.

- A Cloudwatch Metric Stream to send payloads from Cloudwatch to a Kinesis Firehose
- A Kinesis Firehose to send metrics to Datadog
- A Log Stream and Log Group for logs related to the Kinesis Firehose
- An s3 bucket for storing payloads that fail to get sent to Datadog
- IAM Roles for the above resources

repository: DataDog/cloudformation-template

repo_name: DataDog/cloudformation-template


text:
# Arduino HomeKit ESP8266

[中文说明](translations/README_cn.md) | [Português Brasileiro](translations/README-ptbr.md) | [Русский](translations/README-ru.md)

## Apple HomeKit accessory server library for ESP8266 Arduino

This Arduino library is a native Apple HomeKit accessory implementation for the [ESP8266 Arduino core](https://github.com/esp8266/Arduino), and works without any additional bridges.

This project is mainly based on [esp-homekit](https://github.com/maximkulkin/esp-homekit) for [ESP-OPEN-RTOS](https://github.com/SuperHouse/esp-open-rtos).

I ported the RTOS-based implementation of [esp-homekit](https://github.com/maximkulkin/esp-homekit) to the pure Arduino environment, aimed at easy and fast building project using Arduino IDE (or Eclipse with sloeber, PlatformIO).

Enjoy the "one-key" build, "one-key" upload, and work to link various other Arduino libraries with Apple HomeKit!

Here is a [discussion](https://github.com/HomeACcessoryKid/Arduino-HomeKit/issues/1) about the RTOS is required for running Apple HomeKit, and this project is a proof of concept that Apple HomeKit can be implemented and work fine without the RTOS.

This library is built with ESP8266 Arduino Core 2.6.3. Lower versions may compile with errors.

For ESP32, see [Arduino-HomeKit-ESP32](https://github.com/Mixiaoxiao/Arduino-HomeKit-ESP32). The HomeKit running on ESP32 has a **GREAT PERFORMANCE** which is 10x faster than ESP8266.

## Preview

![Preview](https://raw.github.com/Mixiaoxiao/Arduino-HomeKit-ESP8266/master/extras/preview.jpg)

## Setup code of the example sketch

``111-11-111``

## Usage

1. Define your accessory in a .c file to enjoy the  convenient "Macro" style declaration. You can also define your accessory in a .ino file using C++ code.
	```C
		homekit_accessory_t *accessories[] = ...
		homekit_server_config_t config = {
			.accessories = accessories,
			.password = "111-11-111",
			//.on_event = on_homekit_event, //optional
			//.setupId = "ABCD" //optional
		};
	```
2. In your sketch
	```C
		#include <arduino_homekit_server.h>;

		//access the config defined in C code
		extern "C" homekit_server_config_t config;

		void setup() {
			WiFi.begin(ssid, password);
			arduino_homekit_setup(&config);
		}

		void loop() {
			arduino_homekit_loop();
		}
	```
Done.

## Performance

Notice: You should set the ESP8266 CPU to run at 160MHz (at least during the pairing process), to avoid the tcp-socket disconnection from iOS device caused by timeout.

* Preinit: ~9.1s (You can see the accessory on your iOS HOME app after Preinit)
* Pair Setup Step 1/3: ~0s (The heavy crypto computation is done in Preinit)
* Pair Setup Step 2/3: ~12.1s
* Pair Setup Step 3/3: ~0.8s  (The pair-setup is only processed when first paired with iOS device)
* Pair Verify Step 1/2: ~0.3s
* Pair Verify Step 2/2: ~0.8s (The Verify Step is required every time iOS connects or reconnects to ESP8266 to establish secure session)

All pairing process takes ~14s after you input the setup-code on your iPhone. Notice that Preinit require ~9s before you can start to pair.

## Heap (memory)

The heap is critical for ESP8266 with full TCP/IP support. ESP8266 easily crashes when the memory is lower than ~5000.

I tried to make WolfSSL crypto work safely on ESP8266 with better performance and lower memory or a trade-off. See details in next section.

Here are the free heap values of running the example sketch:

* Boot: ~26000
* Preinit over: ~22000
* Pairing: ~17000 (or even low when crypto computing)
* Paired and connected with one iOS device: ~21700
* Paired and no iOS device connected: ~23400

After memory optimization in v1.1.0:

* Boot: ~46000
* Preinit over: ~41000
* Pairing: ~37000 (or even low when crypto computing)
* Paired and connected with one iOS device: ~41700
* Paired and no iOS device connected: ~43000

## WolfSSL

* Based on wolfssl-3.13.0-stable.
* Clean source code: the unused files are removed.
* `CURVE25519_SMALL` and `ED25519_SMALL`: ESP8266 can not directly run without `SMALL` defined since the memory is not sufficient. But the NO `SMALL` version is faster. I mark the big `ge_precomp base[32][8]` with PROGMEM to store it in Flash (around 70KB). Also the `ge_double_scalarmult_vartime` can not run caused by lack of heap. I define `ESP_GE_DOUBLE_SCALARMULT_VARTIME_LOWMEM` in `user_settings.h` to use LOWMEM version of `ge_double_scalarmult_vartime` in `ge_low_mem.c`. This is a trade-off of performance and memory. If you want more Flash space, you should define `CURVE25519_SMALL` and `ED25519_SMALL` and undefine `ESP_GE_DOUBLE_SCALARMULT_VARTIME_LOWMEM` in `user_settings.h` (this will lead the Pair Verify Steps to take 1.2s + 0.9s).
* `integer.c`(big integer operations): `MP_16BIT` and `ESP_FORCE_S_MP_EXPTMOD` are defined for better performance in ESP8266. `ESP_INTEGER_WINSIZE` (value is 3) is defined to avoid crash caused by memory exhaust and the values of {3, 4, 5} are of similar performance.

## Storage

* The pairing data is stored in the `EEPROM` address in ESP8266 Arduino core.
* This project does not use the `EEPROM` library with data-cache to reduce memory use (directly call flash_read and write).
* The `EEPROM` is 4096B in ESP8266, this project uses max [0, 1408B).
* See the comments in `storge.c` and [ESP8266-EEPROM-doc](https://arduino-esp8266.readthedocs.io/en/2.6.3/libraries.html#eeprom).
* `EEPROM` of [1408, 4096) is safe for you to use.
* This project do NOT use `FS(file system)`, so you can use `FS` freely.

## WatchDog

* There are software and hardware watchdogs in ESP8266 Arduino core. The heavy crypto computing will lead to watchdog reset.
* There are disable/enable api of software-watchdog in ESP8266 Arduino core.
* I found the [esp_hw_wdt](https://github.com/ComSuite/esp_hw_wdt) to disable/enable the hardware-watchdog.
* The two watchdogs are disabled while `Preinit` and `Pair Setup Step 2/3`.

## Recommended settings in IDE

* Module: Generic ESP8266 Module (to enable full settings)
* FlashSize: at least 470KB for sketch (see `WolfSSL` section if you want a smaller sketch)
* LwIP Variant: v2 Lower Memory (for lower memory use)
* Debug Level: None (for lower memory use)
* Espressif FW: nonos-sdk 2.2.1+119(191122) (which I used to build this project)
* SSL Support: Basic SSL ciphers (lower ROM use)
* VTables: Flash (does not matter maybe)
* Erase Flash: select `All Flash Contents` when you first upload
* CPU Frequency: 160MHz (must)

## Arduino port

* `ESP8266WiFi` (WiFiServer and WiFiClient) is used for tcp connection.
* `ESP8266mDNS` is used for advertising (Bonjour)

## Troubleshooting

* Check your serial output with [example_serial_output.txt](https://raw.github.com/Mixiaoxiao/Arduino-HomeKit-ESP8266/master/extras/example_serial_output_v1.1.0.txt)

## Change Log

#### v1.4.0

* Add `yield()` while crypto computing, to prevent WiFi disconnection. The idea is from [BbIKTOP-issues80](https://github.com/Yurik72/ESPHap/issues/80#issuecomment-803685175)
* One new example.

#### v1.3.0

* Small improvements.

#### v1.2.0

* New examples.

#### v1.1.0

* Memory optimization: moved String/byte constants as much as possible to Flash. The `RODATA` section of `bin` is only 4672. Extra ~20K free-heap is available compared with v1.0.1.
* Upload [ESP8266WiFi_nossl_noleak](https://github.com/Mixiaoxiao/Arduino-HomeKit-ESP8266/tree/master/extras/ESP8266WiFi_nossl_noleak/), a `nossl` and `noleak` version of the official `ESP8266WiFi` library of Arduino Core 2.6.3. Removed all codes of `SSL` to save memory (extra ~3K) since the HomeKit does not require SSL. Fix the memory-leak in `WiFiClinet.stop()` by adding `tcp_abandon(_pcb, 0)` in `stop()`, based on the idea of [esp8266/Arduino/pull/2767](https://github.com/esp8266/Arduino/pull/2767).

#### v1.0.1
* Reduce `winsize` from `3` to `2`(same performance) to lower the heap required. Pairing can be done with low free-heap of ~14000.
* Specify the MDNS runs on the IPAddress of STA to ensure the HomeKit can work with some SoftAP-based WiFi-Config libraries.
* Rename the `HTTP_METHOD`(s) in `http_parser.h` to avoid multi-definition errors when using `ESP8266WebServer` together.

## Thanks
* [esp-homekit](https://github.com/maximkulkin/esp-homekit)
* [esp-homekit-demo](https://github.com/maximkulkin/esp-homekit-demo)
* [esp_hw_wdt](https://github.com/ComSuite/esp_hw_wdt)
* [WolfSSL/WolfCrypt](https://www.wolfssl.com/products/wolfcrypt-2/)
* [cJSON](https://github.com/DaveGamble/cJSON)
* [cQueue](https://github.com/SMFSW/cQueue)

gha_language: C


text:
# Stacker

![image](media/stacker.gif "Stacker Gameplay GIF")

A two-line game inspired by the [Stacker arcade game](https://en.wikipedia.org/wiki/Stacker_(game)). To play, wait for the row that's moving back and forth to line up directly above the row below it and press any key to move on to the next row. Win the game by reaching the top of the screen with at least one block left.

## Program

`0W=20:A$="********************":P=-16384:HOME:L=2:R=39:X=4:FORY=24TO1STEP-1:SPEED=245:P$=MID$(A$,1,W):VTABY:FORZ=0TO1:FORX=XTO37-W:HTABX:?" ";:?P$;:IFPEEK(P)<128THENNEXT:FORX=37-WTO4STEP-1:HTABX:?P$;:?" ";:IFPEEK(P)<128THENNEXT:Z=0:NEXT`

`1POKE49168,0:SPEED=255:HTABX:?SPC(W+2);:L=L+(L<X)*(X-L):R=R-(R>X+W-1)*(R-(X+W-1)):W=R-L+1:VTAB1:IFW>0THENVTABY:HTABL:?MID$(A$,1,W);:HTAB1:?Y;:X=INT(RND(1)*10)+4:NEXTY:HTAB1:?"YOU WIN!"`

## Discussion

[Apple II Enthusiasts Group Permalink](https://www.facebook.com/groups/5251478676/permalink/10156649083593677/)

repository: thelbane/Apple-II-Programs

repo_name: thelbane/Apple-II-Programs


text:
# mqtt-isy-bridge

This is a simple docker container that I use to bridge to/from my MQTT bridge.

I have a collection of bridges, and the general format of these begins with these environment variables:

```
      TOPIC_PREFIX: /your_topic_prefix  (eg: /some_topic_prefix/somthing)
      MQTT_HOST: YOUR_MQTT_URL (eg: mqtt://mqtt.yourdomain.net)
      (OPTIONAL) MQTT_USER: YOUR_MQTT_USERNAME
      (OPTIONAL) MQTT_PASS: YOUR_MQTT_PASSWORD
```

For changing states '/set' commands also work, eg:

publish this to turn on the outlet with the ISY address: 45_24_9e_1

```
   topic: /isy/45_24_9e_1/set
   value: 1
```

Here's an example docker compose:

```
version: '3.3'
services:
  mqtt-egauge-bridge:
    image: ghcr.io/terafin/mqtt-isy-bridge:latest
    environment:
      LOGGING_NAME: mqtt-isy-bridge
      TZ: America/Los_Angeles
      TOPIC_PREFIX: /your_topic_prefix  (eg: /energyusage)

      ISY_IP: YOUR_ISY_IP
      CONFIG_PATH: /config/isy
      ISY_USERNAME: YOUR_USERNAME
      ISY_PASSWORD: YOUR_PASSWORD

      HEALTH_CHECK_PORT: "3001"
      HEALTH_CHECK_TIME: "120"
      HEALTH_CHECK_URL: /healthcheck

      MQTT_HOST: YOUR_MQTT_URL (eg: mqtt://mqtt.yourdomain.net)
      (OPTIONAL) MQTT_USER: YOUR_MQTT_USERNAME
      (OPTIONAL) MQTT_PASS: YOUR_MQTT_PASSWORD
```

Here's an example publish for my setup:

Note: this is Address / status:

```
/isy/44_77_4_1 0
/isy/24988 0
/isy/59220 0
/isy/46_d1_29_1 0
/isy/45_2e_19_1 0
/isy/2974 0
/isy/2974 1
/isy/44_77_4_1 1
/isy/24988 1
/isy/59220 1
/isy/45_24_9e_1 1
/isy/46_d1_38_1 1
/isy/45_25_18_1 1
/isy/46_d1_29_1 1
/isy/46_d_1e_1 1
/isy/45_1c_c5_1 1
/isy/45_2e_19_1 1
/isy/46_c0_e4_1 1
```

repository: terafin/mqtt-isy-bridge

repo_name: terafin/mqtt-isy-bridge


text:
---
name: "⛔ Question"
about: Please go to https://stackoverflow.com/questions/tagged/logback+android
title: ''
labels: ''
assignees: ''

---

<!--
    Please do not use GitHub for asking questions. Instead,
    please visit Stack Overflow, and tag your question with
    "logback" and "android":

        https://stackoverflow.com/questions/tagged/logback+android

    Thanks in advance for helping us keep the issue tracker
    clean!
-->

repository: erikhubers/logback-android

repo_name: erikhubers/logback-android


text:
## Object-Oriented Design & Patterns
----

- Object-oriented programming (OOP) is a programming paradigm that uses abstraction to create models based on the real world. OOP uses several techniques from previously established paradigms, including modularity, polymorphism, and encapsulation.

```sh
var Person = function (firstName) {
  this.firstName = firstName;
  console.log('Person instantiated');
};

var person1 = new Person('Alice');
console.log('person1 is ' + person1.firstName); // logs "person1 is Alice"
```


text:
---
title: "Udacity Review: Digital Marketing Nanodegree"
toc: true
toc_label: "Content"
tags:
  - Udacity Nanodegree Review
  - Digital Marketing

date: June 4, 2020
header:
  teaser: /assets/images/thumbnails/joel-filipe-thumb-400.jpg
excerpt: "Is Digital Marketing Nanodegree by Udacity worth it?"
---
{% include figure image_path="/assets/images/posts/udacity-digital-marketing-nanodegree.jpg" alt="Udacity Digital Marketing Nanodegree Certificate" %}

Udacity offered 1 month for free and I decided to enroll into [Digital Marketing Nanodegree](https://www.udacity.com/course/digital-marketing-nanodegree--nd018), mainly for two reasons.

First, I am interested in Data Science for Marketing and Product Analytics, so I thought expanding my knowledge into Digital Marketing would help me better understand marketing problems.

Second, I had previous experience with Udacity Nanodegrees (see my review of [Data Science program here](/Udacity-Data-Science-Nanodegree/)) and decided to challenge myself to graduate within a free month.

So given my motivation above, I will answer the following questions in this review:
- Is the Digital Marketing Nanodegree worth to pursue, especially when there are many free resources on the subject?
- How long does it take to complete the program?

## Digital Marketing Nanodegree: Overview

**Tools**: Google Analytics, Google AdWords, Facebook Ad Manager, Google’s PageSpeed, SEMrush, MOZ, MailChimp

The program is structured around core digital marketing sectors that provide good foundations into digital marketing landscape:
- Content Marketing
- Social Media Marketing
- Social Media Advertising
- Search Engine Optimization
- Search Engine Marketing
- Display Advertising
- Email Marketing
- Google Analytics

From the start you have to choose which marketing challenge you want to pursue:
- B2C: Digital Marketing Nanodegree (DMND) Program
- B2B: Enterprise’s DMND Corporate Training
- marketing for your own company

Once chosen, you will work through the program to create a marketing strategy for your "product". This means that your projects will be around this marketing challenge. So if you chose B2C option, for instance, you will create a Target Persona, generate leads with Facebook campaign, create email workflow for DMND only.

There are 10 projects to complete:
1. **Prepare to Market**: develop a target persona, formulate marketing objective and KPI
2. **Market your Content**: write a blog post and promote it via social posts
3. **Run a Facebook Ad Campaign Part 1**: create a campaign and run it
4. **Run a Facebook Ad Campaign Part 2**: analyze results and provide recommendations
5. **Conduct a SEO Audit**: recommend a target keyword list and how to optimize for ranking in search engine results
6. **Run an AdWords Campaign Part 1**: create a campaign & run it
7. **Run an AdWords Campaign Part 2**: analyze results and provide recommendations
8. **Evaluate a Display Campaign**: analyze results and provide recommendations
9. **Market with Email**: develop email plan, create email with MailChimp and evaluate the results
10. **Create Digital Marketing Portfolio**: develop a marketing budget and get all other projects together in one place

For both campaigns you actually run you get a budget - $100 for Facebook and ~$50 for Google AdWords. So you spend real money on advertising like on a job.

## Pros: 360-degree overview + hands-on experience in running campaigns

DMND lives up to its promise - you learn 360-degree of Digital Marketing landscape, which I think not every program out there does. It is good introductory course for those who would like to decide which career path in digital marketing to take, and as it turned out there are plenty! From more creative jobs like content Strategist or Email Marketing Manager to more technical like SEO Analyst or Marketing Analyst.

What I liked the most is that DMND provides **a good overview over the job market** - job descriptions with common titles, average base salary, skills for the job and typical responsibilities from 8 different digital marketing sectors. They also recorded videos with professionals that explain what their day-to-day work looks like.

And probably the most valuable skill that this program teaches you is **running actual campaigns on Facebook and Google AdWords**. For this, you really need to have a business account. Unless you run a small business or already working in digital marketing, you won't be able to get this experience. I also liked that I could see other students' campaigns and learned a lot from analyzing their approaches and what works best. So you really benefit from getting an access to Udacity accounts on Facebook Ads Manager and Google AdWords. They also give you free access for 30 days to SEMrush, which has great tools for SEO and competitive research.

So, I think Digital Marketing is a good starting point and has many advantages over other programs/courses out there. You learn by doing, not only reading.

## Cons: not difficult but extensive
I would grade the program as not very difficult. However, it has **10 different projects** that you need to complete in order to graduate. As a result, I underestimated time needed and did not finish in 1 month as planned (I also had some other projects I worked on alongside studying). Despite this, I decided to prolong the program for another month since I felt that I learned a lot (and was grateful for what I learned), accomplished a lot and did not want to lose that progress.

So, **1,5 months on 1.5x listening speed** is realistic estimate for those who took MOOCs before. I find DMND on monthly basis still expensive - $400.

Final advice to those who are more into **Data Analytics/ Data Science** like me and consider taking Digital Marketing Nanodegree for the same reason as mine - don't expect much. The program is not technical and doesn't teach Marketing for Machine Learning tasks. That said, I do understand the key Marketing metrics better and how Marketing functions after completing the program. But you probably can learn this on a job as well. As I am in career transition and don't have formal business education, I think completing a Digital Marketing Nanodegree is a nice add-on to my skills and knowledge.

path: /_posts/2020-06-04-Udacity Review: Digital Marketing Nanodegree.md

gha_language: HTML


text:
# CommonAlgorithms

This is a collections of common algorithms and data structures that everyone comes across at some point but not natively implemented in the Swift standard library.

## Binary Heap

In `Heap.swift`, a number of binary heap related functions are implemented. Note that I did not implement a Heap data structure as it should be just an Array of some comparables. Keeping the utilities seperate from the array gives one the flexibility to do what one wants. Anyway, this is not my idea but rather to say that I agree with what Python's standard library says.

## Binary Search

Inspired by the `bisect` package in Python library. I have implemented binary search in ascending and descending array with the option to give you the index on the left and right of the insertion position (hence `bisect_left` and `bisect_right`).

This is done as an extension to `RandomAccessCollection`.

## Permutations

Inspired by the implementations in the standard library of C++.

This is done as an extension to `RandomAccessCollection` with constraint that `Self` is mutable.

## MIT Licence

Of course.

repository: xiahongze/CommonAlgorithms

repo_name: xiahongze/CommonAlgorithms


text:
---
name: Activity Proposal
about: Proposal Template for Events
title: "[Proposal] Activity Name"
labels: activity, needs review, proposal
assignees: ''

---

**Activity Name**
_---Fill here---_

**Short Description**
_A clear and concise description of what your activity is about. _

**Student/ Organisation/ Club organizing this Activity**
_---Fill here---_

**Session intent**
_What can participants expect?_

**Any prerequisite knowledge?**
_ This is important especially for Advanced Activities_

**Expected Participants**
_---Fill here---_

**Ideal Venue** (If you have a specific location in mind, please let us know)
_---Fill here---_

**Possible Time and Dates**
_---Fill here---_

*Speakers/Workshop facilitators**
_---Fill here---_

**Logistical details**
_---Fill here---_

**POC details**
_---Fill here---_

**Any other details for us to know**
ie. require additional support


text:
## List of examples
- [ColourfulBall](https://github.com/DroidsOnRoids/RxSwiftExamples/tree/master/Simple%20Apps/ColourfulBall) - this is example of using MVVM and animations with RxSwift. Bindings and stuff. Previously RxViewModelExample.

## TODO
--

## Author

Sunshinejr<EMAIL_ADDRESS>@thesunshinejr

## License

RxSwiftExamples is available under the MIT license. See the LICENSE file for more info.

repository: nguyenquocdathcmus/RxSwiftExamples

path: /Simple Apps/README.md

repo_name: nguyenquocdathcmus/RxSwiftExamples


text:
# flask_exploration
specify
DATABASE_URL
APP_SETTINGS
example
export APP_SETTINGS='config.DevelopmentConfig'
export DATABASE_URL='postgresql://localhost/discover_flask_dev'

autoenv (directory specific environment control)
flask-migrate

woah woah woah, sqlalchemy writes migrations for you?
Alembic is the bones under flask-migrate

sudo ln -s /Library/PostgreSQL/9.2/lib/libssl.1.0.0.dylib /usr/lib && sudo ln -s /Library/PostgreSQL/9.2/lib/libcrypto.1.0.0.dylib /usr/lib

http://stackoverflow.com/questions/16407995/psycopg2-image-not-found
got to part 17, postgres being obnoxious

if psycopg2 error re-emerges, try deactivating anaconda from bashprofile

which python : informs which environment python is being pulled from, homebrew python (/usr/local/bin/python) is important.

part24's tests are fairly superflous, but goes into some detail on context preservation for the purpose of testing.