text:
# vue-animations

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

<transition></transition>
On Entering the page:

# On Entering the page
.enter-from {}
.enter-to {}
.enter-active {}

# On Leaving the page
.fade-leave-from{}
.fade-leave-to{}
.fade-leave-active{}


text:
# Django-React Integration

There are many ways of integrating Django and React. At DataMade, our preferred
method is a so-called "hybrid" approach, where Django builds React components into its templates
by using a context variable for props and bundling components with Babel, Browserify, and
`django-compressor`. This allows a developer to opt-in to using React components
in some templates, while still retaining the full expressive power of Django's
templating system.

At a high level, this is how the stack renders a React component for a given
Django view:

1. A user sends a request for a particular route to Django;
2. The route's view passes props to a Django template using a dedicated `props` key in the
   view's context dictionary, and also specifies a React component file to use for
   that view using a `component` attribute;
3. The Django template for the view reads the `props` key from the view's context
   dictionary, santizes its data, and saves it on the global `window` object;
4. `django-compressor` locates `compress` tags in the Django template and uses Babel and
   Browserify to compile the scripts contained within the tags to vanilla JavaScript.
   It also automatically compiles the file containing the React component for the
   view as specified in the `view.component` attribute;
5. The React component uses the `window.props` object to render once the page
   loads in the user's browser.

This guide provides detailed instructions on configuring and developing an
application to use a hybrid Django-React integration.

## Contents

- [Installation](#installation)
- [Usage](#usage)
    - [Create a static JSX file for your React component](#create-a-static-jsx-file-for-your-react-component)
    - [Define a view with a path to your component](#define-a-view-with-a-path-to-your-component)
    - [Add a `props` key to your view context dictionary](#add-a-props-key-to-your-view-context-dictionary)
    - [Create a Django template for your React component](#create-a-django-template-for-your-react-component)
        - [Define a React root element](#define-a-react-root-element)
        - [Set React props and root element on the `window` object](#set-react-props-and-root-element-on-the-window-object)
        - [Bundle and load your component with `django-compressor`](#bundle-and-load-your-component-with-django-compressor)
        - [Putting it all together](#putting-it-all-together)
- [Project fit considerations](#project-fit-considerations)
- [Further reading](#further-reading)

## Installation

Setting up a hybrid Django-React application requires installing a number of
Node packages, including Babel, Babelify, and Browserify, and then installing
and configuring `django-compressor` to use these packages to bundle your
React components. To set up your application for a Django-React integration,
start by following our documentation for [installing
`django-compressor`](django-compressor.md).

**Note**: If you're using our [`new-django-app` Cookiecutter template](/docker/templates/)
to create your app, these installation steps will already be taken care of for you
and you can skip ahead to [Usage](#usage).

## Usage

Once your Django app is configured to bundle React components with `django-compressor`,
you can bundle React components into your Django templates.

Here are the steps for adding a React component to a template. The examples included
in these steps are taken from the [`django-react-templates`
repo](https://github.com/datamade/django-react-templates), which serves as a
reference for this pattern.

### Create a static JSX file for your React component

In a dedicated static file directory, something like `static/js/pages`, create
a file representing your React component.

As an example, here's a simple component `index.js` that displays the name of a user:

```jsx
import React from 'react'
import ReactDOM from 'react-dom'

const Home = (props) => (
  <>
    <div className="container-fluid mb-1 jumbotron">
      <div className="row">
        <div className="col-sm-10 offset-sm-1">
          <h1 className="mb-3">Django-React Integration</h1>
        </div>
      </div>
    </div>
    <div className="container">
      <div className="row pt-5 pb-4 text-center">
        <p>Welcome, {props.user}!</p>
      </div>
    </div>
  </>
)

ReactDOM.render(
  React.createElement(Home, window.props),
  window.reactMount,
)
```

Note that the component needs to be rendered with the `ReactDOM.render()` method,
and should use the `window.props` object as its props. Later on when we define the
Django template for this component, we'll make sure to save our props to this variable.

### Define a view with a path to your component

Define a Django view that includes a `component` attribute with a staticfile
path to the component you've defined, as well as the typical `template_name`
attribute representing the path to a Django template. The combination of these
two attributes will allow us to render the component in the view's template.

```python
class Home(TemplateView):
    title = 'Home'
    template_name = 'my_new_app/index.html'
    component = 'js/pages/index.js'  # Staticfile path to your component code
```

### Add a `props` key to your view context dictionary

In the context dictionary for your view, add a `props` key representing the props
that you want to pass into your React component. If you're using class-based views,
you can update your context dictionary using the `get_context_data()` method.

```python
class Home(TemplateView):
    title = 'Home'
    template_name = 'example_app/index.html'
    component = 'js/pages/index.js'  # Staticfile path to your component code

    def get_context_data(self, *args, **kwargs):
        context = super().get_context_data(*args, **kwargs)
        context['props'] = {'user': 'foobar'}  # Set React props here
        return context
```

### Create a Django template for your React component

In order to render the React component we just defined, we need a Django template
that can mark the component for bundling. Save this template to the path
defined in your `template_name` view attribute.

There are a few key components to this template. We'll consider them one by one.

#### Define a React root element

The template needs to have an element that React can use as a root to mount
your component. For a better user experience, make sure to embed a loading animation
like a spinner in this element so the user can see that your component is rendering.

As an example, a simple root element might look like this:

```html
<div id="App">
  <!-- Contents get replaced by mounted React.Component -->
  <div class="text-center">
    <i class="fa fa-lg fa-spinner fa-spin"></i><br><br>
    <i class="pending">Loading components...</i><br><br>
  </div>
</div>
```

#### Set React props and root element on the `window` object

In order to make your props and root element available to your React component, add
a simple script to the end of your template to set them on the global `window`
object.

```html
{{ props|json_script:"props" }}  // Serialize and safely sanitize the props
<script type="text/javascript">
  window.props = JSON.parse(document.getElementById('props').textContent)
  window.reactMount = document.getElementById('App')
</script>
```

#### Bundle and load your component with `django-compressor`

Finally, use the `compress` template tag provided by `django-compressor` to bundle
and load your component as an external script. Since we set a `component` attribute on
our `View` class in the section ["Define a view with a path to your
component"](#define-a-view-with-a-path-to-your-component) above, we can make use of the
fact that Django automatically exposes a `view` variable in template context to
access the path to our component using the variable `view.component`.

```html
{% load compress %}
{% compress js %}
  <!-- The text/jsx type will trigger the COMPRESS_RECOMPILERS command specific to React -->
  <script type="text/jsx" src="{% static view.component %}"></script>
{% endcompress %}
```

#### Putting it all together

With all of these components included, your template will look something like
this:

```html
{% extends "example_app/base.html" %}
{% load static %}

{% block title %}{{ view.title }}{% endblock %}

{% block body %}
<div id="App">
  <!-- Contents get replaced by mounted React.Component -->
  <div class="text-center">
    <i class="fa fa-lg fa-spinner fa-spin"></i><br><br>
    <i class="pending">Loading components...</i><br><br>
  </div>
</div>
{% endblock %}

{% block extra_js %}
{% load compress %}
{{ props|json_script:"props" }}
<script type="text/javascript">
  window.props = JSON.parse(document.getElementById('props').textContent)
  window.reactMount = document.getElementById('App')
</script>
{% compress js %}
  <script type="text/jsx" src="{% static view.component %}"></script>
  <script type="module" src="{% static 'js/base.js' %}"></script>
{% endcompress %}
{% endblock %}
```

Once you add your view to your app's URL patterns, you should be able to
reload your app and view your rendered React component.

## Project fit considerations

Not all projects will be a good fit for the hybrid approach to Django-React integration.
Projects that are a **good fit** will have the following characteristics:

- A small, distinct set of pages that require a **high degree of interactivity**, in the context of
  a larger app that is more straightforward (e.g. a data-management app with an interactive
  data-driven map or dashboard)
- Some degree of flexibility about **how fast the interactive pages load**, since hybrid
  Django-React apps cannot be rendered on the server and so will have a brief extra loading
  animation (e.g. a map that can load under a spinner animation)
- Sufficient backend functionality that **a static app is not feasible** (e.g. an app
  that requires user management)

If your app does not have these characteristics, but a high degree of interactivity
is still required, talk to a lead developer to discuss your options. There may
be a way of factoring out certain portions of your app and deploying them as
standalone [Gatsby apps](/gatsby).

## Further reading

This approach is heavily inspired by Nick Sweeting's blog post
[How to build a frontend without making a Single-Page
App](https://hackernoon.com/reconciling-djangos-mvc-templates-with-react-components-3aa986cf510a).
If you'd like to get a better sense of the logic behind this pattern we strongly
reccommend reading the post.

For more background on the research that led us to adopt this approach, see
[the corresponding R&D issue](https://github.com/datamade/how-to/issues/66).

license: MIT

repository: datamade/how-to

branch_name: refs/heads/main

extension: md

gha_language: Python

gha_license_id: MIT

license_type: permissive

repo_name: datamade/how-to


text:
# async-optional

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

- [About](#about)
- [Installation](#installation)
- [Usage](#usage)
- [AsyncOptional notes](#asyncoptional-notes)
- [Further reading](#further-reading)
- [Changelog](https://github.com/treble-snake/async-optional/releases)
- [License](#license)

## About

This library implements generic value container with fluent API to help you write
cleaner code in more unconditional way and get rid of endless null-checks.
It's very similar to Java Optional class and provides some safe navigation abilities.
And, most important thing — it works with Promises.

Inspired by [Java Optional](https://docs.oracle.com/javase/9/docs/api/java/util/Optional.html)
and [Optional.js](https://github.com/JasonStorey/Optional.js) implementation.

Compare these examples:

* conditional style
```js
function getUserData() {
  const user = getUser();
  if (user === null || !user.isActive) {
    return null;
  }

  Object.assign(user, { friends: getFriends(user) });

  return user;
}

const userData = getUserData();
if (userData !== null) {
  respond(userData)
} else {
  respondNotFound();
}
```

* unconditional style
```js
function getUserData() {
  return Optional.with(getUser())
    .filter(user => user.isActive)
    .map(user => Object.assign(user, { friends: getFriends(user) }))
}

getUserData()
  .either(respond)
  .or(respondNotFound);
```

Of course, [Optional.js](https://github.com/JasonStorey/Optional.js) can do
all of this. But now you can use `AsyncOptional` and work with asynchronous
values and callbacks and just add couple of fancy `await`s (or use `then/catch`
if you have to).

Just like that:
```js
function getUserData() {
  // let's say getUser() returns Promise
  return AsyncOptional.with(getUser())
    .filter(user => user.isActive)
    .map(async (user) => Object.assign(user, {friends: await getFriends(user)}))
}

await getUserData()
  .either(respond)
  .or(respondNotFound);
```

Other than fact, that AsyncOptional works with Promises
(so can take arguments and return values regarding),
[Optional](https://github.com/treble-snake/async-optional/blob/master/docs/APIDOC.md#Optional)
and [AsyncOptional](https://github.com/treble-snake/async-optional/blob/master/docs/APIDOC.md#AsyncOptional)
APIs are identical.

## Installation
```
npm install async-optional
```

```js
const {AsyncOptional, Optional} = require('async-optional');
```

Supports Node.js 6 or newer.

## Usage
There are some usage examples of AsyncOptional. Case for Optional will be
the same except no `await` needed.

### Create it
There are 3 ways of creating an Optional instance:
```js
// directly via construtor
const instance = new AsyncOptional(getSomeNullableData());

// via .with() method, accepting empty (`null` and `undefined`) values
const instance = AsyncOptional.with(getSomeNullableData());

// via .withEnsured method, rejecting empty (`null` and `undefined`) values
const instance = AsyncOptional.withEnsured(getSomeNonNullableData());

// all these getSome...() methods could return Promise
```

And if you have a need of explicitly creating an empty optional, you can use `.empty()` method:
```js
const instance = AsyncOptional.empty();
```

### Transform it

Then you can do a bunch of transformations with you data via fluent API:
```js
const instance = AsyncOptional.with(getSomeData())
   // value to use if current is empty
  .orUse(42)
  // function to generate new value if current is empty
  .orCompute(() => { return produceSomeValue(42); })
  // function to get new optional if current value is empty
  .orFlatCompute(() => AsyncOptional.with(getAnotherData()))
  // take property with name `foo` from current data
  .take('foo')
  // change the value somehow
  .map(value => value + getDiff(value))
  // modify it more, using another AsyncOptional
  .flatMap(value => AsyncOptional.with(maybeGetData(value)))
  // check if it's valid
  .filter(value => value > 10)
  // and modify it further
  .map(value => Object.assign({}, someBase, {value}));
```

All callbacks can be asynchronous (returning Promise) and are lazy-executed,
meaning that if current value is empty, none of `take()`, `map()`, `flatMap()` and `filter()`
callback will be executed.
And vise versa, if current value is present, `orCompute()` and `orFlatCompute()`
callbacks won't run.

### Use it

And finally, you can do something with resulting data (or without it).
There are 2 ways (in general) of doing that.

#### Cool way
Preferred way is using abilities provided by fluent API and staying cool and unconditional.

And the coolest among them is using either/or pair (if you need to react on both
presence and absence of the value):
```js
await AsyncOptional.with(getSomeData())
  // ... do some transofrmations and then:
  .either(value => respond(value))
  .or(() => respondNotFound());

```

If you need to react only on one of the events, you can do it too:
```js
await AsyncOptional.with(getSomeData())
  .ifPresent(doSomething);

await AsyncOptional.with(getSomeData())
  .ifAbsent(screamInPanic);

```

Bonus (for fans of the approach) — you can pass both callbacks at once:
```js
await AsyncOptional.with(getSomeData())
  .eitherOr(
    value => respond(value),
    () => respondNotFound() // 2nd argument can be omitted, btw
  );
```

#### Another way

It's kinda violation of the whole zen, but still can be the case. You can
check presence of your value and get it unwrapped to use for some purpose.
```js
const instance = AsyncOptional.with(getSomeData());

if (await instance.hasValue()) {
  doSomethingWithValue(await instance.get());
} else {
  // some action on absence of value
}

// or just react on absence
if (await instance.isEmpty()) {
  printSomeError();
}
```

Once again, this is not the recommended way to do it.

## AsyncOptional notes
### Performance tips
Using Promises comes with a price — `AsyncOptional` works slower than `Optional`.
So if you don't need any async values or callbacks — better use `Optional`.

Also, if you have both sync and async callbacks, putting async ones as late
in the chain as you can might give you a slight performance boost. E.g.:
```js
// this is slower
await AsyncOptional.with(42)
  .map(async (value) => value + (await getModifier()))
  .map(value => value - 2)
  .map(value => value + 4)
  .map(value => value + 8)
  .either(print)
  .or(logError);

// this is faster
await AsyncOptional.with(42)
  .map(value => value - 2)
  .map(value => value + 4)
  .map(value => value + 8)
  .map(async (value) => value + (await getModifier()))
  .either(print)
  .or(logError);
```

### Error handling
AsyncOptional respects fail fast principle. When the value is not Promise-like,
it will throw an error as soon as it can, not waiting for `.then()` or `.catch()`
or `await`:
```js
const instance = AsyncOptional.with(42)
  .map(value => { throw new Error('Fail fast!') })
  // you'll get the Error there, further code won't execute
  .filter(predicate());
```

But with async values we can't fail until Promise is resolved, so:
```js
const asyncAtOnce = AsyncOptional.with(Promise.resolve(42))
  .map(value => { throw new Error('Fail on promise') })
  .filter(() => false);

const asyncByCallback = AsyncOptional.with(42)
  .filter(async (value) => value > (await Promise.resolve(1)))
  .map(value => { throw new Error('Fail on promise') });

// still no error

try {
  await asyncAtOnce.get();
} catch (e) {
  // and now you got it
  console.warn(e);
  // => Error: Fail on promise
}

// or this way
asyncByCallback
  .get()
  .catch(e => {
    console.warn(e);
    // => Error: Fail on promise
  });
```

## Further reading
Here is complete [API doc](https://github.com/treble-snake/async-optional/blob/master/docs/APIDOC.md).

## License

MIT License

repository: treble-snake/async-optional

branch_name: refs/heads/master

gha_language: JavaScript

repo_name: treble-snake/async-optional


text:
# Aussie Shopper Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.2
- A QOL release mostly involving required library updates to address security issues and associated changes.
- Some modifications to the main page and configuration to address issues in the hosted version.

## 1.0.1

- Define license for the entire project. This is released under the MIT license.

## 1.0.0

- Release version 1 for public consumption

repository: alaasalman/aussieshopper

repo_name: alaasalman/aussieshopper


text:
# Flip A Coin

A skill for opsdroid to perform flipping a coin.

## Setting Up

First we must create an opsdroid skill directory. This can be anywhere on your filesystem, we just need to remember
where for later. For this example we will make a new folder in `~/opsdroid/skills`.

```shell
$ mkdir -p ~/opsdroid/skills/flip-coin
```

## The skill

Then inside this folder we need to create a file called  `__init__.py` and import the following packages:

```python
from opsdroid.skill import Skill
from opsdroid.matchers import match_regex

import random
```

Second, create a class for the skill:

```python
class CoinSkill(Skill):
    @match_regex('flip a coin')
    async def flip_a_coin(self, message):
        if random.randint(0, 1):
            response = "Heads"
        else:
            response = "Tails"

        await message.respond("{}".format(response))

```

## Configuration

Third, open you 'configuration.yaml' file. You can do this automatically with the `opsdroid config edit` command.

Then add the following to the skills section.

```yaml
skills:
  flip-a-coin:
  path: ~/opsdroid/skills/flip-coin
```

Now save your configuration and reload opsdroid.

For more examples of skills you can build with opsdroid checkout our [examples section](../examples/index.md).

repository: opsdroid/opsdroid

repo_name: opsdroid/opsdroid


text:
no_breadcrumb:true

# Customizing RingCentral Embeddable Voice for HubSpot

Developers are free to customize their RingCentral integration with Hubspot by forking the project on github:

```bash
$ git clone https://github.com/ringcentral/hubspot-embeddable-ringcentral-phone.git
$ cd hubspot-embeddable-ringcentral-phone
$ npm i
```

## Create Your Apps

### RingCentral

On RingCentral you will need to create an application with your developer console. To create the app quickly, click the button below:

Create RingCentral App

### HubSpot

You will need to also create an application within HubSpot:

1. Visit [https://developers.hubspot.com/](https://developers.hubspot.com/).

2. Sign-up as necessary, and click "Create application."

3. Give your app a name, and select "Private."

4. You will be directed to a listing of your apps.

5. Edit the app you just created.

6. Under Scopes, select "Basic OAuth functionality."

7. Under "Read from and write to my" select "Contacts."

8. Click "Save."

## Edit config.js

You will need to create your config file using the template provided:

```bash
$ cp config.sample.js config.js
```

Look for the following section, and enter in your RingCentral Client ID, and set the server to the proper environment:

```json
//// ringcentral config
ringCentralConfigs: {
  // your ringCentral app's Client ID
  // clientID: 'aaaaaaaseWivhrrGgggVeCrw',

  // your ringCentral app's Auth Server URL
  // appServer: 'https://platform.devtest.ringcentral.com'
},
```

Finally, fill out the configuration information for your HubSpot application. Look for the following section and fill out accordingly (you should only need to provide your Client ID and Secret):

```json
thirdPartyConfigs: {
  // hubspot app client ID, required
  // get it from your hubspot app, https://app.hubspot.com/developer
  clientIDHS: ,
  // hubspot app client Secret,
  clientSecretHS: ,
  // hubspot app auth server, not required
  // appServerHS: 'https://app.hubspot.com',
  // hubspot app api server, not required
  // apiServerHS: 'https://app.hubspot.com',
  // hubspot app redirect uri, not required
  // appRedirectHS: 'https://zxdong262.github.io/hubspot-embeddable-ringcentral-phone/app/redirect.html',
  // show call log sync desc form or not
  // showCallLogSyncForm: true
},
```

## Start Up

You are ready to start up your app.

```bash
$ npm start
```

## Customize Your Integration

To customize your integration, edit the many `.js` files in the `src` directory. As you edit, webpack will rebuild automatically.

## Install Your Extension

1. Open your [Chrome extension page](chrome://extensions/).

2. Turn on "Developer mode" in the upper right hand corner if it is turned off.

3. Click "Load unpacked."

4. Select the `hubspot-embeddable-ringcentral-phone/dist` folder, and click "Select."


text:
# Concrete5 Module
[![Latest Version on Packagist](https://img.shields.io/packagist/v/xanweb/c5-module.svg?style=flat-square)](https://packagist.org/packages/xanweb/c5-module)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

## Installation

Include library to your composer.json
```bash
composer require xanweb/c5-module
```

gha_language: PHP


text:
# Command Over UI

> ./programName

Makesure, you have `commands.html` and `.htaccess`

### Listen at port 80

Over here I have build a code, that will help you define your commands that you want to run.

Note:
commands that are allowed to the user, who is running this code only will get executed, as as per my initial test, you can't use `;` to run multiple commands.

## Features:
- Password protected using .htaccess file.
- Commands can be composed at the `commands.html`
- The file need to be at the same place.

### Example of `commands.html`

```
<!DOCTYPE html>
<html>
<body>

<h1>The button value attribute</h1>

<!--
Note: Get is not safe, use post method.
Either order is good.
<form action="/dnsCheck" method="post">
<form method="post" action="/dnsCheck">
-->

<form method="post" action="/">
<br>
<p>
Commands to run on the hosted server:
<br>
<button name="command" type="submit" value="ls">ls</button>
<button name="command" type="submit" value="pwd">pwd</button>
<button name="command" type="submit" value="uptime">uptime</button>
<button name="command" type="submit" value="ps -ef">ps -ef</button>
</p>
</form>

</body>
</html>
```

Over here the example commands are:

```
<button name="command" type="submit" value="ls">ls</button>
<button name="command" type="submit" value="pwd">pwd</button>
<button name="command" type="submit" value="uptime">uptime</button>
<button name="command" type="submit" value="ps -ef">ps -ef</button>
```

If you want to add or remove the command: just add the same. You can also create different sessions:

```
<button name="command" type="submit" value="ls">ls</button>
<button name="command" type="submit" value="pwd">pwd</button>
<button name="command" type="submit" value="uptime">uptime</button>
<button name="command" type="submit" value="ps -ef">ps -ef</button>

<button name="command" type="submit" value="foo">foo</button>
<button name="command" type="submit" value="your_command_or_script">your_command_script</button>
```

Note:

Make sure, your script are in the executable path or you might like to provide the same in the correct place/location.

##  Password protected using .htaccess file.

This program expect the standard .htaccess file, which you can create as:

When creating for the first time.
> htpasswd -c .htpasswd amitmund

If you want to add a new user
> htpasswd .htpasswd userFoo

To update the password
> htpasswd .htpasswd userFoo
And give the new password.

if you want, feel free to learn more details on .htpasswd

## Todo:
Make it SSL based and with JWT.

### PS
Its not perfect, but help you in your regular works.

### ngrok

If you want:
>ngrok http 80

repository: Amitmund/golang

repo_name: Amitmund/golang


text:
HiiCart - Django Shopping Cart
===============================

A simple shopping cart implementation with support for PayPal,
Google Checkout, Amazon Payments, Authorize.net, and Braintree.

Installation and Setup
----------------------

Installation is as easy as installing with `easy_install` or `pip` and
adding the appropriate settings for the gateways you want to use.  Please see
the documentation in hiicart/settings.py for more details about the settings
available.

Once set up, create LineItem and HiiCart objects to submit payments:

    def foo():
        cart = HiiCart.objects.create()
        LineItem.objects.create(
            cart=cart, description="foo", name="bar",
            quantity=1, sku="12345", thankyou="thanks!",
            unit_price=9.99)
        return cart.submit("google")

This returns an object containing the redirect URL for you user.

Logging
--------

Older versions of HiiCart used to have logging configurable through the
`HIICART_SETTINGS` object's `LOG` and `LOG_LEVEL` keys.  This has been removed
in favor of using [Django's built-in logging configuration](https://docs.djangoproject.com/en/dev/topics/logging/#an-example)
or manual configuration of the "hiicart" logger elsewhere in application code.

To maintain the same configuration as old versions of HiiCart, use something
similar to the following in your `settings.py`:

```python
LOGGING = {
    ...
    "formatters": {
        ...
        "hiicart": {
            "format": "%(asctime)s [%(levelname)-8s] %(name)s - %(message)s",
        },
    },
    "handlers": {
        ...
        "hiicart": {
            "class": "logging.handlers.RotatingFileHandler",
            "filename": ...,
            "formatter": "hiicart",
            "maxBytes": 5242880,
            "backupCount": 10,
            "encoding": "utf-8",
        },
    },
    "loggers": {
        ...
        "hiicart": {
            "handlers": ["hiicart"],
            "level": "DEBUG",
        },
    },
}
```

HiiCart will aggressively log events and IPN requests to this log in at the INFO
level and errors at the ERROR level.

Testing
-------

HiiCart is testable via Django's test runner.  To run the tests, simply run

```
python manage.py test hiicart
```

Some tests might not run without valid gateway configuration, which you can
add to a `local_settings.py` file if running the tests from a hiicart checkout
or to your regular settings if running from your django project.

Example App
-----------

An example app is included that shows very generally how to get everything set
up and working. Right now it really needs a lot of work, but is functional for
the most basic case.

repository: hiidef/hiicart

repo_name: hiidef/hiicart


text:
Just a quick guide in case you want to build those from source.

This assumes you have appropriate tools installed (cmake, build toolchains, Visual Studio, NDK for Android)
and that you start in the root directory for Native (where CMakeLists.txt is locaed)

BUILD FOR WINDOWS:
1) Run cmake -G "Visual Studio 15 2017 Win64" -B build_win
2) Open the generated solution in Visual Studio and build (or use appropriate commandline tools)

BUILD FOR LINUX:
1) mkdir build_linux
2) cd build_linux
3) cmake ../
4) make

BUILD FOR ANDROID (needs NDK)
1) ndk-build

Mikktspace.NET wrapper Written by Frooxius for NeosVR (www.neosvr.com)


text:
Sample razwiki usage
=====================================

To run this, just install mongo, create a database, say "razwiki" with a user and populate a single page, say Admin:Hello.

Pass the following properties on startup:

- rk.mongohost  =localhost
- rk.mongodb    =wikireactor
- rk.mongouser  =mongousername
- rk.mongopass  =mongopassword

Then point a browser to the following url: http://localhost:9000/wiki/Admin:Hello

Detailed build instructions
====================

Install mongodb

Start mongodb

Create a database

Install SCala

Install Play

Install sbt

Clone this repository

Code to look at
====================

app/Global.scala to see how to initialize the wiki engine (persistence and parser).
conf/routes to see the basic routes

repository: yuhangwang/wikireactor

repo_name: yuhangwang/wikireactor


text:
---
layout: post
title: "Modifying the PyABM source code"
description: "How to modify the installed PyABM source code using a pip editable install"
category: articles
tags: [python, pyabm]
modified: 2014-03-19
comments: true
share: true
---

## Modifying the latest release of PyABM
If you plan on making any changes to the PyABM source code, you can use a
[pip](http://www.pip-installer.org) ["editable
install"](http://www.pip-installer.org/en/latest/reference/pip_install.html?highlight=editable%20install#editable-installs) to
install PyABM in your local user folder so that you can edit the source code in
place without having to rebuild and reinstall the PyABM package every time you
make a change. To use this feature, first install pip, then open a command
window and type:

{% highlight sh %}
sudo pip install -e pyabm
{% endhighlight %}

in a command prompt in Linux, or

{% highlight sh %}
    pip install -e pyabm
{% endhighlight %}

on Windows. This will install the latest release of PyABM as an editable
install so that you can `import pyabm` from any python window or script, and
have the module imported from your own version of the source code (which will
be in a folder named something like `C:\users\azvoleff\src\pyabm` (on Windows) or
`/home/azvoleff/src/pyabm` (on Linux).

## Modifying the development version of PyABM
There are several ways to end up with an editable version of the current
development version of PyABM. If you have git installed on your system you can
use a pip editable install to download the latest version of PyABM from github
for you, and install it in an editable mode. If you do not have git you use
[distribute](http://packages.python.org/distribute/), which offers a
["development
mode"](http://packages.python.org/distribute/setuptools.html#development-mode).
With both approaches, the end result is having the development version of PyABM
installed in such a way that any changes you make to the code take effect
immediately.

If you have git installed on your system, you can use pip to clone and install
the development version of PyABM from github by typing:

{% highlight sh %}
    sudo pip install -e git+https://github.com/azvoleff/pyabm.git#egg=pyabm
{% endhighlight %}

in a command prompt in Linux, or

{% highlight sh %}
    pip install -e git+https://github.com/azvoleff/pyabm.git#egg=pyabm
{% endhighlight %}

on Windows. An advantage of cloning PyABM from github is that you can easily
update your copy of PyABM to include the latest changes by navigating to the
main PyABM folder and typing

{% highlight sh %}
    git pull
{% endhighlight %}

to pull the latest version of the PyABM source code from git and (depending on
your settings in git) merge any upstream changes with your local edits.

If you do not have git installed, download the latest development source of
PyABM as a [zip file](https://github.com/azvoleff/pyabm/archive/master.zip).
After downloading the PyABM source code, navigate to the main PyABM folder (the
one with setup.py) and type:

{% highlight sh %}
    python setup.py develop
{% endhighlight %}

This will install a development version of PyABM and setup your system so that
you can `import pyabm` from your Python interpreter from your Python scripts.


text:
Sublime Remote Open
===================

A Sublime Text 2/3 plugin that allow you to open files in a running sublime text instance from a remote machine.
Usually requires a shared directory of some kind.

If you have a machine on which you are running Sublime Text 2 or 3 and it shares common directories with another machine.
Such as a samba mounted drive or a network drive for instance.

If you get tired of working on the remote machine and then having to switch back to sublime and navigate to the files you want to open. You can use this plugin to open the files in the Sublime Text on the first machine with a command on the other machine.

## Alternatives

This is similar to the [rmate](http://canadian-fury.com/2012/06/26/using-textmate-2-s-rmate-with-sublime-text-2/) plugin. Except that *rmate* uses ssh to get the file you are working on. *Remote Open* relies on the remote directory structure being mounted locally. I think that the advantage of the local mounting allows you to take advantage of Sublime Text 3's Project Indexing because all files from a directory structure can be accessed by Sublime and indexed for quick navigation with the *Go To Symbol* short cuts.

## Installation

### Package Control

You can install this plugin using the fantastic Sublime Package Control Plugin.

You can find information and instructions on installing it here:
[http://wbond.net/sublime_packages/package_control](http://wbond.net/sublime_packages/package_control)

Once you have it installed.

Open the Command palette in your Sublime Text with:

On Linux and Windows:

    control + shift + p

On OSX:

    super + shift + p

From the palette, select:

    Package Control: Install Package

Wait for another palette to appear, which will list all available plugins, select:

    RemoteOpen

### Git

Clone this repository into your Sublime Text *Packages* directory.

    git clone https://github.com/sligodave/sublime_remote_open.git RemoteOpen

## Configuration

* Open the settings file and configure as needed.

    Packages/User/RemoteOpen.sublime-settings

To find the *Packages* directory, from the Command Palette, select:

    Preferences: Browse Packages

```
{
	// Whether or not the plugin prints information to the python command
	"debug": false,
	// The host at which the server should listen. E.g. 192.186.0.X
	"host": "localhost",
	// The port at which the server should listen
	"port": 25252,
	// Remote to local path mappings.

	// I.e. Where you have mapped the remote locations too locally.
	"path_maps": {
		// "/REMOTE/PATH/BASE": "/LOCAL/PATH/BASE"
		// "/home/username/work": "G:/"
		// "/home/username_remote/work": "/home/username_local/maps/remote_home_dir/work"
	},
	// Should the server open all files in a directory when one is sent
	"open_directory_contents": true,
	// Should the server open all files recursively in a directories sub structure.
	// Requires "open_directories" to be
	"open_directory_recursively": true,
	// runs the listening server when sublime starts.
	"listen_on_startup": true
}
```

_The above are the defaults._

* Place the contents of the *remote_machine* directory onto your remote machine.
* Place the contents into a location on your $PATH so it will be found.
* Ensure that the *subl_remote_open* file is executable.
* Open the *subl_remote_open|subl_remote_open.bat* file and append the *address* and *port* that you give your server above to the python command in this file.
* The *subl_remote_open|subl_remote_open.bat* file expects that "python" is available in your $PATH. If it isn't, update the file with the path to the python executable too.

For example (linux/osx but windows is similar):

    python ${DIR}/subl_remote_open.py localhost 25252 "$@"

becomes:

    python ${DIR}/subl_remote_open.py 192.168.0.X 25252 "$@"

## Usage

### Server

To start the server in your Sublime Text so that it will listen for remote requests.
From the *Go To Anything* Palette:

	Remote Open: Start Listening

To stop the server.
From the *Go To Anything* Palette:

	Remote Open: Stop Listening

*NOTE:*
You can also set the server to start automatically when Sublime Starts using the "listen_on_startup" setting.

### Client / Remote Open command

With Sublime Text open and the Remote Open server listening on your local machine.
Run the supplied *subl_remote_open* commmand on your remote machine, passing it a file to open.

    subl_remote_open FILE_TO_OPEN.EXT

The command and accompanying python will take care of the paths etc from here and
send the request to the server to open the file on the local machine.

You can specify a line number to open the file at also by using the ':' standard.
E.g.

    subl_remote_open FILE_TO_OPEN.EXT:45

Will open the file with the cursor on line 45.

## Troubleshooting

I've had not problems so far but I'll add things here as they come up.

Off hand, if you are having trouble connecting to the listening Sublime Text from your remote machine. Check to make sure that the firewall on your local machine where the Sublime Text is running allows the connection you are trying to make.

*Remote machine can no longer see server*

I did a major overhaul of the code to use a much saner threading server, in doing so I renamed the "address" setting to "host".
So you can fix this problem by updating your RemoteOpen.sublime-settings file.

## To Do

Nothing right now, send on suggestions.

## Issues / Suggestions:

Send on any suggestions or issues.

## Copyright and license
Copyright 2013 David Higgins

[MIT License](LICENSE)


text:
EpiData
=====================================
EpiData is an IoT Data Science Platform. It integrates IoT and Data Science capabilities in a lightweight and open-source framework. The EpiData platform enables development and deployment of machine learning and deep learning algorithms for smarter industrial solutions including energy management, smart manufacturing and building automation.

You can find out more about EpiData at https://epidata.io.

Installation and Launch
------------------------
- Docker Container:
The epidata-community docker image is available as a stand-alone package with all code and required components. To build and start a docker container, simply execute the command shown below (replacing 'epidata123' with a custom token):
    - docker run -p 443:443 -it -e token=epidata123 epidataio/epidata-community:0.11.0

    Below are other useful docker commands:
    - Pull the docker image:
        - docker pull epidataio/epidata-community:0.11.0
    - List all docker containers:
        - docker ps -a
    - Stop a docker container:
        - docker stop <container_id>
    - Start a stopped docker container:
        - docker start <container_id>
    - Start epidata application on a running docker container:
        - docker exec -it <container_id> ./epidata-start.sh -p 443:443

- Installation Scripts:
One can also set up EpiData platform by following the installation and launch scripts available in epidata-install repository. We recommend cloning epidata-community repository to epidata folder within ubuntu user's home directory (/home/ubuntu).

Configuration
--------------
- Authentication:
Access to EpiData platform is managed via tokens and OAuth 2 authorization (with GitHub). The configuration settings for tokens are available in play/conf/application.conf, and OAuth 2 are available in play/conf/securesocial.conf. Authenticated users can be added to the system manually via Cassandra's CQL commands.

- Measurement Class:
EpiData platform can be configured to operate on 'sensor measurement' or 'automated test' data. To enable sensor measurement data, play's application.conf must set measurement-class to sensor_measurement. In addition, spark's spark-defaults.conf must set spark.epidata.measurementClass to sensor_measurement. To enable automated test data, play's application.conf must set measurement-class to automated_test. In addition, spark's spark-defaults.conf must set spark.epidata.measurementClass to automated_test.

Usage
------
After launch, EpiData platform is ready to ingest and process sensor data. To access ingestion scripts and Jupyter Notebook tutorial, you can visit https://<epidata_url>, where epidata_url is the url for the server hosting EpiData platform.

Resources
----------
EpiData community-edition is managed via this GitHub repository site. For enterprise support and services, please contact the EpiData Team via https://epidata.io.

repository: epidataio/epidata-community

repo_name: epidataio/epidata-community


text:
# Rearrange Array Elements
Rearrange Array Elements so as to form two number such that their sum is maximum. Return these two numbers. You can assume that all array elements are in the range [0, 9]. The number of digits in both the numbers cannot differ by more than 1. You're not allowed to use any sorting function that Python provides, and the expected time complexity is `O(nlog(n))`.

for e.g. `[1, 2, 3, 4, 5]`

The expected answer would be `[531, 42]`. Another expected answer can be [542, 31]. In scenarios such as these when there are more than one possible answers, return any one.

Here is some boilerplate code and test cases to start with:

```python
def rearrange_digits(input_list):
    """
    Rearrange Array Elements so as to form two number such that their sum is maximum.

    Args:
       input_list(list): Input List
    Returns:
       (int),(int): Two maximum sums
    """
    pass

def test_function(test_case):
    output = rearrange_digits(test_case[0])
    solution = test_case[1]
    if sum(output) == sum(solution):
        print("Pass")
    else:
        print("Fail")

test_function([[1, 2, 3, 4, 5], [542, 31]])
test_case = [[4, 6, 2, 5, 9, 8], [964, 852]]

```

repository: vaxherra/algorithmic-problems

repo_name: vaxherra/algorithmic-problems


text:
# Cloud4RPi Client Library for [Arduino](https://www.arduino.cc/) Framework

[![Build Status](https://travis-ci.org/cloud4rpi/cloud4rpi-esp-arduino.svg?branch=master)](https://travis-ci.org/cloud4rpi/cloud4rpi-esp-arduino)

The package provides a client library that simplifies connecting Internet-enabled Arduino devices to the Cloud4RPi service.

Supported hardware:

- [ESP8266](https://en.wikipedia.org/wiki/ESP8266) boards (like [NodeMCU Dev Kit](http://www.nodemcu.com/index_en.html#fr_54747661d775ef1a3600009e) and others).
- [ESP32](https://en.wikipedia.org/wiki/ESP32) boards (like [ESP32-DevKitC](https://www.espressif.com/en/products/hardware/esp32-devkitc/overview) and others).

Supported ecosystems:

- [PlatformIO](http://platformio.org/platformio-ide)
- [Arduino IDE](https://www.arduino.cc/en/main/software)

The further instructions depend on your preferred ecosystem.

## PlatformIO

The [Cloud4RPi library](http://platformio.org/lib/show/2045/cloud4rpi-esp-arduino) is published in the [PlatformIO Registry](http://platformio.org/lib). Follow the instructions below to start a new Cloud4RPi-enabled project:

1. Create a new PlatformIO project for your board as described in the PlatformIO documentation ([Visual Studio Code](http://docs.platformio.org/en/latest/ide/vscode.html#id3), [Atom](http://docs.platformio.org/en/latest/ide/atom.html#setting-up-the-project))
2. Open your `platformio.ini` and add the following lines to the end:

   ```
   lib_deps =
       cloud4rpi-esp-arduino

   build_flags=
   ; Required for PubSub library
       -D MQTT_MAX_PACKET_SIZE=1024
       -D MQTT_MAX_TRANSFER_SIZE=128
   ; Enables the verbose output to Serial
       -D CLOUD4RPI_DEBUG=1
   ```

3. Save the `platformio.ini` file and open the `src\main.cpp` file.
4. Copy-paste the [sample code](https://github.com/cloud4rpi/cloud4rpi-esp-arduino/blob/master/examples/control/control.ino).
5. [Log in to your Cloud4RPi account](https://cloud4rpi.io/signin) or [create a new one](https://cloud4rpi.io/register).
6. Copy [your device](https://cloud4rpi.io/devices)'s **Device Token**. You can create a device on the [Devices](https://cloud4rpi.io/devices) page and copy its **Device Token** if you do not have one.
7. Replace the `__YOUR_DEVICE_TOKEN__` string with your device token.
8. Replace the `__SSID__` and `__PASSWORD__` strings with your Wi-Fi network data.
9. If the `LED_BUILTIN` constant is not defined in your board's library, change this constant to the LED's pin number (for example, `2`).
10. Hit the `Build` button and wait until the compilation is completed.
11. Hit the `Upload` button.
12. If the upload fails, try to start the board in the flashing mode (connect the power supply with the GPIO0 pin connected to GND) and try uploading again.
13. Once flashing is complete, open `Serial Monitor` to monitor the device's status.
14. Notice that the device on the [Devices page](https://cloud4rpi.io/devices) went online and started sending data.
15. Go to the [Control Panels](https://cloud4rpi.io/control-panels/) page and add a new control panel.
16. Add a new **Switch** widget and bind it to the `LED On` variable.
17. Add a new **Text** widget and bind it to the `State` variable. Configure different colors for the **"IDLE"**, **"RING"** and **"BOOM!"** strings.
18. Add a new **Slider** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
19. Add a new **Gauge** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.

## Arduino

1. Open **Arduino** and select your board in the **Tools** | **Board** menu. Add [ESP8266](https://github.com/esp8266/Arduino#installing-with-boards-manager) or [ESP32](https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md) support if it is not added yet.
2. Install the Cloud4RPi library from the **Library Manager**. To do this, open the **Sketch** | **Include Library** | **Manage Libraries** menu, enter `cloud4rpi` into the search field and install the **cloud4rpi-esp-arduino** package.
3. Install the dependencies: **ArduinoJson** and **PubSubClient** libraries.
4. Configure the installed libraries:
   1. Open the `%HOMEPATH%\Documents\Arduino\libraries\PubSubClient\src\PubSubClient.h` (`~/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.h` on Mac) file with any text editor (for instance, [VS Code](https://code.visualstudio.com)).
   2. Add the following define directives at the beginning:
      ```c
      #define MQTT_MAX_PACKET_SIZE 1024
      #define MQTT_MAX_TRANSFER_SIZE 128
      ```
   3. [Optional] Open the `%HOMEPATH%\Documents\Arduino\libraries\cloud4rpi-esp-arduino\src\Cloud4RPi.h` (`~/Documents/Arduino/libraries/cloud4rpi-esp-arduino/src/Cloud4RPi.h` on Mac) file and add the `#define CLOUD4RPI_DEBUG 1` line at the beginning to enable verbose output.
5. Use the **File** | **Examples** | **cloud4rpi-esp-arduino** menu item to open the sample code. Restart Arduino IDE if this item does not appear.
6. Select the **ESP32 Dev Module** board in **Tools** menu.
7. [Log in to your Cloud4RPi account](https://cloud4rpi.io/signin) or [create a new one](https://cloud4rpi.io/register).
8. Copy [your device](https://cloud4rpi.io/devices)'s **Device Token**. You can create a device on the [Devices](https://cloud4rpi.io/devices) page and copy its **Device Token** if you do not have one.
9. Replace the `__YOUR_DEVICE_TOKEN__` string with your device token.
10. Replace the `__SSID__` and `__PASSWORD__` strings with your Wi-Fi network data.
11. If the `LED_BUILTIN` constant is not defined in your board's library, change this constant to the LED's pin number (for example, `2`).
12. Hit the `Build` button and wait until the compilation is completed.
13. Hit the `Upload` button.
14. If the upload fails, try to start the board in the flashing mode (connect the power supply with the GPIO0 pin connected to GND) and try uploading again.
15. Once flashing is complete, open `Serial Monitor` to monitor the device's status.
16. Notice that the device on the [Devices page](https://cloud4rpi.io/devices) went online and started sending data.
17. Go to the [Control Panels](https://cloud4rpi.io/control-panels/) page and add a new control panel.
18. Add a new **Switch** widget and bind it to the `LED On` variable.
19. Add a new **Text** widget and bind it to the `State` variable. Configure different colors for the **"IDLE"**, **"RING"** and **"BOOM!"** strings.
20. Add a new **Slider** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
21. Add a new **Gauge** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.

## See Also

- [Library and Examples for ESP8266 with MicroPython](https://github.com/cloud4rpi/cloud4rpi-esp8266-micropython)
- [Examples for Raspberry Pi](https://github.com/cloud4rpi/cloud4rpi-raspberrypi-python)
- [Examples for Next Thing Co. C.H.I.P.](https://github.com/cloud4rpi/cloud4rpi-chip-python)
- [Examples for Onion Omega2](https://github.com/cloud4rpi/cloud4rpi-omega2-python)
- [Documentation Repository](https://github.com/cloud4rpi/docs)


text:
# RandGenCPP
A Pseudo-random Number Generator Class in C++

This class implements a pseudo-random number generator (PRNG), and a number of
class member functions providing useful probability distribuions. The core PRNG
algorithm adopted here is xorshift1024*.

This algorithm is described here: http://xorshift.di.unimi.it/

xorshift1024* uses an internal state which is 1024 bits and has a maximal period
of (2 ^ 1024 - 1). It is a fast and high-quality PRNG, which passes the BigCrush
test in U01 test suite. It is studied and evaluated in this paper:

Sebastiano Vigna, "An experimental exploration of Marsaglia's xorshift generators,
scrambled" (2014). http://arxiv.org/abs/1402.6246v4

A RandGen object is seeded once only when a 'RandGen' it is constructed. If multiple
'RandGen' objects are instantiated in a program, they can have a different seed and
hence can produce a different pseudo-random number stream.

repository: saiedhk/RandGenCPP

repo_name: saiedhk/RandGenCPP


text:
# Ecobee (Connect) and Ecobee Device Handlers Change Log

Notable changes to this project will be documented in this file.

This project is in a pre-1.0 state. This means that its APIs and behavior are subject to breaking changes without deprecation notices. However, all due efforts will be made to warn the user. Until 1.0, version numbers will follow a [Semver][]-ish `0.y.z` format, where `y` is incremented when new features or breaking changes are introduced, and `z` is incremented for lesser changes or bug fixes.

## [Beta][] (Ongoing)
* Follow the link to see the comparison between the stable release and the beta branch (`StrykerSKS-enhanced-ecobee`)

## [Alpha][] (Ongoing)
* Follow the link to see the comparison between the stable release and the beta branch (`StrykerSKS-enhanced-ecobee`)
* **NOTE: This is my active development branch. Things on this branch are very likely to break at random times. Provided for informational purposes only!**

## [0.9.0-RC6][] (2016-02-01) **(Beta Release)**
### General Changes
* 3 changed files with 876 additions and 467 deletions (To be updated)
* Introduction of support for Child SmartApps! First SmartApp is `ecobee Routines` for using SmartThings Modes (Routines) to control the modes (and other settings) on the Ecobee Thermostats
* More hooks to be defensive against the SmartThings platform stability issues (e.g. Scheduled Events)

### SmartApp Changes
#### **NEW** ecobee Routines Child SmartApp
* Control your Ecobee Thermostats based on SmartThings Modes/Routines
* Support for multiple instances for running different options at different modes
* Support for controlling the following options per instance:
  * Multiple SmartThings Modes
  * Multiple Thermostats
  * Select Ecobee Program to run (Away, Home, Sleep or Resume Program) (NOTE: Custom programs are on the wish list for a future release)
  * Select Fan Mode (Optional)
  * Can also be run at Sunrise and/or Sunset event (Optional)
  * Toggle to temporarily disable the Handler so you don't have to delete it when you want it off temporarily

#### Ecobee (Connect)
* Complete overhaul of the Ecobee (Connect) User Interface to make it easier to manage and to allow for the introduction of the Child SmartApps
* Switched from using `atomicState` to just `state` to reduce overhead
* Using helper functions to build JSON bodies for API requests. This should spead up adding new features over time
* Added checks to make sure the customer Device Handlers are installed before proceeding with setup
* Added a `Debug Dashboard` so that various state variables and functions can be performed right from within the SmartApp. No need to go the IDE just to check things!
* Added some watchdog capabilities to improve reliability of Scheduled Events
* Updated the fan mode handling to not disrupt the existing running event (hold) or program, only changes the fan settings now
* Set several helper function to `private` so as to not pollute the exposed interfaces
* Thermostats can now also be exposed as individual Remote Sensors so that the actual temperature at the Thermostat can be used for HA

### Device Handler Changes
* [Thermostat] Faster response in User Interface (send events immediately when a change is made in app)
* [Thermostat] Defaulting back to the thermostat `multiAttributeTile` with the release of the 2.0.8 phone apps (Needs Android testing!)

## [0.8.0][] (2016-01-28)
*  4 changed files with 469 additions and 932 deletions
*  Support for `setThermostatFanMode` handling to set the fan modes
*  Fan Modes Implemented:
 *  "on", "off", "auto": full support
 *  "circulate": Partially implemented, currently just calls `auto()`
*  Added a button for changing the fan between "auto" and "on" on the Thermostat Tile
*  Continued code refactoring
*  Changed holdType labels to "Until I Change" and "Until Next Program" to better align with the Ecobee terms

## [0.7.5][] (2016-01-25)

### General Changes
* First tagged release
* Added support for different debug levels. This should make it easier to thin out the logs to see real errors instead of all the trace information
* Total of 3 changed files with 889 additions and 454 deletions

### SmartApp Changes
* Added support for Comfort Settings
* Tweeks to the handling for API connection errors in an attempt to recover a connection
* Fixes for handling an offline Remote Sensor (due to range, battery, etc)
* Refactoring of code to simplify maintenance (this will be an ongoing process for the next several releases)
* Added support for Ecobee Events to read the current state. This means we can now show status for Manual and Automatic "Holds" that are running including `Smart Home` and `Smart Away`
* Clear the waittime between polls immediately after making changes to the settings. This allows the `refresh` button to be more responsive.

### Device Handler Changes
* [Thermostat] Added support for Comfort Settings (programs). Adds the following new commands (can be invoked by other SmartApps):
  * setThermostatProgram(program, holdType)
  * home()
  * sleep()
  * away()
* [Thermostat] Added the corresponding Tiles to support manipulating and viewing the Comfort Settings. (NOTE: UI elements are likely to change in the future once the overall development stabalizes)
* [Remote Sensor] Added state for an offline sensor. Marks the `motion` tile to indicate the failure

## [0.6.0][] (2016-01-15)
* Checkpoint from previous commits to use as baseline
* Click the release number to see all of the changes made to this branch up until this date

[Semver]: http://semver.org
[0.9.0-RC6]: https://github.com/StrykerSKS/SmartThingsPublic/compare/StrykerSKS:v0.9.0-RC6...StrykerSKS:v0.8.0
[0.8.0]: https://github.com/StrykerSKS/SmartThingsPublic/compare/StrykerSKS:v0.7.5...StrykerSKS:v0.8.0
[0.7.5]: https://github.com/StrykerSKS/SmartThingsPublic/compare/302bb77d7237132caaa5281b64d4bfbf4420f7cf...StrykerSKS:v0.7.5
[0.6.0]: https://github.com/StrykerSKS/SmartThingsPublic/compare/master...StrykerSKS:302bb77d7237132caaa5281b64d4bfbf4420f7cf

[Development]: https://github.com/StrykerSKS/SmartThingsPublic/compare/StrykerSKS:v0.8.0...HEAD
[Beta]: https://github.com/StrykerSKS/SmartThingsPublic/compare/StrykerSKS:HEAD...StrykerSKS-enhanced-ecobeedevice
[Alpha]: https://github.com/StrykerSKS/SmartThingsPublic/compare/StrykerSKS:HEAD...StrykerSKS-development

repository: twsmit/SmartThingsPublic

repo_name: twsmit/SmartThingsPublic


text:
### Problem definition
Given a string, find the length of the longest substring without repeating characters.

### Examples
* Given "abcabcbb", the answer is "abc", which the length is 3.
* Given "bbbbb", the answer is "b", with the length of 1.
* Given "pwwkew", the answer is "wke", with the length of 3. Note that the answer must be a substring, "pwke" is a subsequence and not a substring.

### Solution analysis
Solution1:

The simplest way of solving this is the brute force way. We simply consider all substrings of s one by one, and pick up the one that has the longest length and contains all unique values.

To find all the substrings:
```python
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        print s[i]..s[j]
a
ab
abc
abca
abcab
abcabc
abcabcb
abcabcbb...
```

This solution is very simple and straight forward, but it also has a big time complexity, the Big O is O(n^3). If you take a close look of the substrings, you can see that we are doing a lot of duplcation checks. For example, "abca", "abcab", "abcabc", ... before we check "abcabc", we already checked "abca" and "abcab" and already know that they both are not the answers, so "abcabc" check is unnecessary. Therefore, we introduce the "sliding window" approach.

Solution2:

"Sliding window". This is an abstract concept commonly used in array/string problems. A window is a range of elements in the array/string which usually defined by the start and end indices. i.e [i, j) (left-closed, right-open). A sliding window is a window "slides" its two boundries to the certain direction. For example, if we slide [i, j) to the right by 1 element, then it becomes [i+1, j+1).

Our new solution can use this "sliding window" straetegy. We use hashset to store the characters in the current window. Then we slide the index j to the right. If it is not in the Hashset, we slide j further. Keep doing so until s[j] is already in the hashset. At this point, we found the maximum size of substrings without duplicate.

repository: tonylixu/devops

repo_name: tonylixu/devops


text:
# Raspberry Pi Installations

Raspberry Pi's are a great platform for installing SuperAlgos as a production trading bot, but this only recommended for live trading with minimal UI use.

## Installation guide

### Requirements

1. Follow the developer instructions on the (main readme)[https://github.com/Superalgos/Superalgos#small_orange_diamond-installation-for-developers-and-contributors] except for installing chrome, you don't want this clogging up your pi as we're going to use remote access anyway!
2. When installing node on the pi it is usually easier to install with [nvm](https://github.com/nvm-sh/nvm).
2. Now you can run `node platform minMemo noBrowser` and you should see some successfull output in your command line.
3. Open a browser on a different machine connected to your network and navigate your pi's address with port 34248 to start the UI. For me this is http://<IP_ADDRESS>:34248

### Optional requirements

- A Webserver for reverse proxy I will cover (NGINX)[https://www.nginx.com/resources/wiki/start/topics/tutorials/install/] here as an example
- Process manager I will cover (PM2)[https://pm2.keymetrics.io/docs/usage/quick-start/] here as an example

#### NGINX

If you don't want to remember the port number then you can setup a reverse proxy, having followed the NGINX install guide you can edit the file */etc/nginx/sites-enabled/default* and add a new location of your choice

```conf
server {
    ...
    location /superalgos/ {
        proxy_pass http://localhost:34248/;
    }
}
```
Save the file and restart nginx `sudo service nginx restart`.

This will now allow you to navigate to the url instead of the port.

#### PM2

PM2 is a node based process manager. Using this will mean you run Superalgos permanently on the pi without having it bound to your terminal window. My prefered way to set this up is with the *ecosystem.config.js* file in my home directory which can be used to hold many different process configurations.

```Javascript
module.exports = {
  apps : [{
    name   : "sa", //A process name of your choice
    script : "platform.js", //The start script
    args: "minMemo noBrowser", //Process arguments needed for optimal pi ioperation
    cwd: "/home/pi/trading/Superalgos/" //Directory to execute the process in -- this is where the node_modules folder needs to be
  }]
}
```

With this setup you can now start and stop the process at will. A word of warning, if you're making code changes or merging in *upstream* updates then you will need to restart the app `pm2 restart sa`. You can also tail view the logs `pm2 logs sa`

repository: Superalgos/Superalgos

repo_name: Superalgos/Superalgos


text:
### Report V

Writing a report and archiving it is all well and good, but what would be really amazing is if we could visualise history with plots and charts. So let's do that now.

![image](https://cloud.githubusercontent.com/assets/2152766/12515462/626c08a6-c120-11e5-8036-74b0a6e6f96b.png)

For this example, I'll be using [pygal](http://pygal.org/) so go ahead and install this if you would like to follow along. Reusing `ArchiveValidators` from the previous example, let's make some history.

```python
import os
import random
import datetime
import pyblish.api

class FlipCoin(pyblish.api.ContextPlugin):
  def process(self, context):
    if random.random() > 0.5:
        raise Exception("Failed")

class ArchiveValidation(pyblish.api.ContextPlugin):
  ...

pyblishOpi.register_plugin(FlipCoin)
pyblish.api.register_plugin(ArchiveValidation)

import pyblish.util
pyblish.util.publish()
```

Run this at least 10 times so we have enough reports to work with. Next we will retrieve the last 10 publishes and draw a graph representing which time was successful and which was not.

Here is the graph-drawing source code.

```python
import os
import pygal

input_path = os.path.join(os.path.expanduser("~"), "logs")
output_path = os.path.join(input_path, "graph.svg")

results = list()
for fname in os.listdir(input_path)[-10:]:
    abspath = os.path.join(input_path, fname)
    with open(abspath) as f:
        lines = f.readlines()[2:]  # Top two are headers
        results.append([fname, any(line.startswith("0") for line in lines)])

chart = pygal.StackedLine(fill=True,
                          interpolate='cubic',
                          style=pygal.style.LightSolarizedStyle)

chart.title = 'Successful publishes over time'
chart.x_labels = [str(results.index(r)) for r in results]
chart.add("Publish", [r[1] for r in results])
chart.render_to_file(output_path)

```

Putting it all together, here is the final source code.

```python
import os
import random
import datetime

import pygal
import pyblish.api

class FlipCoin(pyblish.api.ContextPlugin):
  def process(self, context):
    if random.random() > 0.5:
        raise Exception("Failed")

class ArchiveValidation(pyblish.api.ContextPlugin):
  # Run after all validators have finished
  order = pyblish.api.ValidatorOrder + 0.1

  def process(self, context):
    formatted_results = self.format_results(context)

    # Compute output directory
    date = datetime.datetime.today().strftime("%Y%m%d-%H%M%S")
    output_dir = os.path.join(os.path.expanduser("~"), "logs")
    output_path = os.path.join(output_dir, date + ".txt")

    # Write to disk
    if not os.path.exists(output_dir):
      os.makedirs(output_dir)

    with open(output_path, "w") as f:
      # E.g. c:\users\marcus\Documents\logs\20150612-110000.txt
      f.write(formatted_results)

    # Print rather than log, as this plug-in
    # won't be included in the results.
    print("Outputted to: %s" % output_dir)
    context.data["archiveDir"] = output_dir

  def format_results(self, context):
    header = "{:<10}{:<40} -> {}".format("Success", "Plug-in", "Instance")
    result = "{success:<10}{plugin.__name__:<40} -> {instance}"
    error = "{:<10}+-- EXCEPTION: {:<70}"
    record = "{:<10}+-- {level}: {message:<70}"

    results = list()
    for r in context.data["results"]:
      # Format summary
      results.append(result.format(**r))

      # Format log records
      for lr in r["records"]:
        results.append(record.format("", level=lr.levelname, message=lr.message))

      # Format exception (if any)
      if r["error"]:
        results.append(error.format("", r["error"]))

    report = """
{header}
{line}
{results}
    """

    return report.format(
      header=header,
      results="\n".join(results),
      line="-" * 70)

class PlotArchive(pyblish.api.ContextPlugin):
    # Run after archival
    order = pyblish.api.ValidatorOrder + 0.2

    def process(self, context):
        input_path = context.data["archiveDir"]
        output_path = os.path.join(input_path, "graph.svg")

        results = list()
        for fname in os.listdir(input_path)[-10:]:
            abspath = os.path.join(input_path, fname)
            with open(abspath) as f:
                lines = f.readlines()[2:]  # Top two are headers
                results.append([fname, any(line.startswith("0") for line in lines)])

        chart = pygal.StackedLine(fill=True,
                                  interpolate='cubic',
                                  style=pygal.style.LightSolarizedStyle)

        chart.title = 'Successful publishes over time'
        chart.x_labels = [str(results.index(r)) for r in results]
        chart.add("Publish", [r[1] for r in results])
        chart.render_to_file(output_path)

pyblish.api.register_plugin(FlipCoin)
pyblish.api.register_plugin(ArchiveValidation)
pyblish.api.register_plugin(PlotArchive)

import pyblish.util
pyblish.util.publish()
# Outputted to: C:\Users\marcus\logs
```

Now, for every publish, results are archived and the graph updated. Go ahead, publish a few times and keep on refreshing your browser whilst looking at the graph. Animation is an exercise left to the reader.

repository: pyblish/pyblish-by-example

gha_language: CSS

repo_name: pyblish/pyblish-by-example


text:
title: ComicFury/Flickwit
url: "/comics/ComicFury_Flickwit.html"
---
Dosage comic ComicFury/Flickwit
-----------------------------------------

Description	What's to know? A ragtag bunch of adventurers are embroiled in an Illithid's nefarious plot, and have to fight their way through hordes of monsters, escape the dungeon and save the local peasantry before the lot of them get vaporised in a dimensional cataclysm. You know-- the usual fare. Thrills, spills and fun for the whole family! Warning: Art quality varies wildly.

Website	http://flickwit.thecomicseries.com/

Genre	Other

Language	English

Adult content	no

Status	ok on 11.04.2013

Votes	0

Back to the [comic list](../comic-index.html).

repository: dromaludaire/dosage

repo_name: dromaludaire/dosage


text:
# Project Euler

This repository contains my old (from 2014) and new [Project Euler](https://projecteuler.net/) solutions. I may converted some of the old C++ codes to Python3.

I have deliberately refrained from using header files for certain common pieces (e.g., detecting primes) for two main reasons: I want the solutions to be standalone. The second reason is that this gives me the freedom to tweak them and use the most suitable version for the problem.

# Project Euler Solution Submissions

I use a short Python code (see [project_euler_stats.ipynb](https://github.com/sedihub/project_euler/blob/master/project_euler_stats.ipynb) notebook) to extract the latest solution statistics from the [website](https://projecteuler.net/archives) of Project Euler. Here is the plot of the statistics. Note that the y axis is in the log scale.

![Project Euler solutions statistics](https://github.com/sedihub/project_euler/blob/master/.images/solutions_stats.png?raw=true)


text:
# SynonymCreator

SynonymCreator is used to generate synonym dictionaries for Bokmål and Nynorsk. It consists of two scripts,

`translate_wiki.sh`
and
`create_synonym.sh`

The scripts have some none-trival dependencies. As an alternative to installing Java, Scala, SBT and [Apertium](https://www.apertium.org/index.eng.html),
the scripts may be executed as a Docker image.

A docker image can be built with:

    docker build -t <image-name> .

# WikiExtractor

WikiExtractor extracts the articles from the Bokmål and Nynorsk Wikipedia, and creates parallel corpora of the two data sets. The output from
WikiExtractor is lines with Json objects of the format:

```
{
"original":         the original Wikipedia article,
 "translation":     the translated version of the article,
 "fromLanguage":    the language of the original article, nb (Bokmål) or nn (Nynorsk),
 "toLanguage":      the language to which the article has been translated, nb (Bokmål) or nn (Nynorsk)
}
```

It can be invoked with `translate_wiki.sh [--trans] ([--nndump]) ([--nbdump])`. `--trans` is the output file. `--nndump` or  `--nbdump` defines
local gzipped versions of the Wikipedia dump for Bokmål and Nynorsk in the [cirrussearch-content](https://dumps.wikimedia.org/other/cirrussearch/current/) format.
If a local file is not provided, the script will download the latest available dump.

The script may be executed within the docker image with:

    docker run -v /tmp/dockertmp:/data <image-name> bash -l -c /synonymcreator/translate_wiki.sh --trans /data/trans.full.docker.txt

This assumes that the directory `/tmp/dockertmp` exists, and the translated parallel corpora will be written to this directory.

NB: It may take several hours to extract a translation of the full Wikipedia dumps.

# SynonymMapper

SynonymMapper takes as input a Nynorsk/Bokmål parallel corpus of the same format as is produced by **WikiExtractor**. It can be invoked with
 ` create_synonyms.sh [--trans] [--output] ([--reduction])`, where `--trans` is the input file, and `--output` is the output synonym dictionary. The optional
parameter `--reduction` assumes a language, either `nb` (Bokmål) or `nn` (Nynorsk). When the reduction flag is used, all synonyms will be mapped to a canonical
form, either in Nynorsk or Bokmål:

Synonoms with a Nynorsk canonical form:

    sportsbegivenheter,sportshendelser => sportshendingar
    dramaene => dramaa
    høydesyke => høgdesjuke
    skipsregistrene => skipsregistera

If the reduction flag is not used, all synonyms will be listed without mapping to a main form.

    sportsbegivenheter,sportshendelser,sportshendingar
    dramaene,dramaa
    høydesyke,høgdesjuke
    skipsregistrene,skipsregistera

The script may be executed within the docker image with:

    docker run -v /tmp/dockertmp:/data <image-name> bash -l -c "/synonymcreator/create_synonyms.sh --trans /data/trans.full.docker.txt --output /data/output.expansion.txt"
    docker run -v /tmp/dockertmp:/data <image-name> bash -l -c "/synonymcreator/create_synonyms.sh --trans /data/trans.full.docker.txt --reduction nn --output /data/output.reduction.nn.txt"

repository: munikum/samnorsk

repo_name: munikum/samnorsk


text:
# binstruct

Automatically generate safe byte (de)serialize code for you at compile-time.

## Example

```rust
#[derive(Copy, Clone, BinEncode, PartialEq)]
#[binstruct(enum_repr(u8))]
enum GameStatus {
  #[binstruct(value = 1)]
  Pending,
  #[binstruct(value = 2)]
  Started,
}

#[derive(BinEncode, BinDecode)]
struct Slot {
  player_id: u8,
}

#[derive(BinEncode, BinDecode)]
struct Player {
  id: u8,
  name: CString,
}

#[derive(BinEncode, BinDecode)]
struct Game {
  #[binstruct(eq = 0xF7)]
  magic: u8,
  version: u8,
  name: CString,
  num_players: u8,
  #[binstruct(repeat = "num_players")]
  players: Vec<Player>,
  slots: [Slot; 24],
  #[binstruct(condition = "version == 2")]
  v2_field: Option<u8>,
}
```

will generate

```rust
#[binstruct(enum_repr(u8))]
enum GameStatus {
    #[binstruct(value = 1)]
    Pending,
    #[binstruct(value = 2)]
    Started,
}

impl binstruct::serialize::BinEncode for GameStatus {
    fn encode<T: binstruct::serialize::BufMut>(&self, buf: &mut T) {
        <u8 as binstruct::serialize::BinEncode>::encode(&u8::from(*self), buf);
    }
}
impl From<GameStatus> for u8 {
    fn from(v: GameStatus) -> u8 {
        match v {
            GameStatus::Pending => 1,
            GameStatus::Started => 2,
        }
    }
}

struct Slot {
    player_id: u8,
}

impl binstruct::serialize::BinEncode for Slot {
    fn encode<T: binstruct::serialize::BufMut>(&self, buf: &mut T) {
        <u8 as binstruct::serialize::BinEncode>::encode(&self.player_id, buf);
    }
}

impl binstruct::serialize::BinDecode for Slot {
    const MIN_SIZE: usize = <u8 as binstruct::serialize::BinDecode>::MIN_SIZE;
    const FIXED_SIZE: bool = <u8 as binstruct::serialize::BinDecode>::FIXED_SIZE;
    fn decode<T: binstruct::serialize::Buf>(
        buf: &mut T,
    ) -> Result<Self, binstruct::serialize::BinDecodeError> {
        if buf.remaining() < Self::MIN_SIZE {
            return Err(binstruct::serialize::BinDecodeError::incomplete());
        }
        let player_id = { <u8 as binstruct::serialize::BinDecode>::decode(buf)? };
        Ok(Self { player_id })
    }
}

struct Player {
    id: u8,
    name: CString,
}

impl binstruct::serialize::BinEncode for Player {
    fn encode<T: binstruct::serialize::BufMut>(&self, buf: &mut T) {
        <u8 as binstruct::serialize::BinEncode>::encode(&self.id, buf);
        <CString as binstruct::serialize::BinEncode>::encode(&self.name, buf);
    }
}

impl binstruct::serialize::BinDecode for Player {
    const MIN_SIZE: usize = <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
        + <CString as binstruct::serialize::BinDecode>::MIN_SIZE;
    const FIXED_SIZE: bool = <u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
        && <CString as binstruct::serialize::BinDecode>::FIXED_SIZE;
    fn decode<T: binstruct::serialize::Buf>(
        buf: &mut T,
    ) -> Result<Self, binstruct::serialize::BinDecodeError> {
        if buf.remaining() < Self::MIN_SIZE {
            return Err(binstruct::serialize::BinDecodeError::incomplete());
        }
        let id = { <u8 as binstruct::serialize::BinDecode>::decode(buf)? };
        let name = {
            if <CString as binstruct::serialize::BinDecode>::MIN_SIZE > 0
                && !<u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
            {
                if buf.remaining() < <CString as binstruct::serialize::BinDecode>::MIN_SIZE {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
            }
            <CString as binstruct::serialize::BinDecode>::decode(buf)?
        };
        Ok(Self { id, name })
    }
}

struct Game {
    #[binstruct(eq = 0xF7)]
    magic: u8,
    version: u8,
    name: CString,
    num_players: u8,
    #[binstruct(repeat = "num_players")]
    players: Vec<Player>,
    slots: [Slot; 24],
    #[binstruct(condition = "version == 2")]
    v2_field: Option<u8>,
}

impl binstruct::serialize::BinEncode for Game {
    fn encode<T: binstruct::serialize::BufMut>(&self, buf: &mut T) {
        <u8 as binstruct::serialize::BinEncode>::encode(&self.magic, buf);
        <u8 as binstruct::serialize::BinEncode>::encode(&self.version, buf);
        <CString as binstruct::serialize::BinEncode>::encode(&self.name, buf);
        <u8 as binstruct::serialize::BinEncode>::encode(&self.num_players, buf);
        <Vec<Player> as binstruct::serialize::BinEncode>::encode(&self.players, buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[0usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[1usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[2usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[3usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[4usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[5usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[6usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[7usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[8usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[9usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[10usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[11usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[12usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[13usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[14usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[15usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[16usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[17usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[18usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[19usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[20usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[21usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[22usize], buf);
        <Slot as binstruct::serialize::BinEncode>::encode(&self.slots[23usize], buf);
        if self.version == 2 {
            if let Some(ref v2_field) = self.v2_field {
                <u8 as binstruct::serialize::BinEncode>::encode(v2_field, buf);
            }
        }
    }
}

impl binstruct::serialize::BinDecode for Game {
    const MIN_SIZE: usize = <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
        + <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
        + <CString as binstruct::serialize::BinDecode>::MIN_SIZE
        + <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
        + 0
        + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24))
        + 0;
    const FIXED_SIZE: bool = <u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
        && <u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
        && <CString as binstruct::serialize::BinDecode>::FIXED_SIZE
        && <u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
        && false
        && <Slot as binstruct::serialize::BinDecode>::FIXED_SIZE
        && false;
    fn decode<T: binstruct::serialize::Buf>(
        buf: &mut T,
    ) -> Result<Self, binstruct::serialize::BinDecodeError> {
        if buf.remaining() < Self::MIN_SIZE {
            return Err(binstruct::serialize::BinDecodeError::incomplete());
        }
        let magic = { <u8 as binstruct::serialize::BinDecode>::decode(buf)? };
        if magic != 0xF7 {
            return Err(binstruct::serialize::BinDecodeError::failure({
                let res = ::alloc::fmt::format(::core::fmt::Arguments::new_v1(
                    &[
                        "unexpected value for field `",
                        "`, expected `",
                        "`, got `",
                        "`",
                    ],
                    &match (&"magic", &0xF7, &magic) {
                        (arg0, arg1, arg2) => [
                            ::core::fmt::ArgumentV1::new(arg0, ::core::fmt::Display::fmt),
                            ::core::fmt::ArgumentV1::new(arg1, ::core::fmt::Debug::fmt),
                            ::core::fmt::ArgumentV1::new(arg2, ::core::fmt::Debug::fmt),
                        ],
                    },
                ));
                res
            }));
        }
        let version = {
            if <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                + <CString as binstruct::serialize::BinDecode>::MIN_SIZE
                + <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                + 0
                + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24))
                + 0
                > 0
                && !<u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
            {
                if buf.remaining()
                    < <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                        + <CString as binstruct::serialize::BinDecode>::MIN_SIZE
                        + <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                        + 0
                        + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24))
                        + 0
                {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
            }
            <u8 as binstruct::serialize::BinDecode>::decode(buf)?
        };
        let name = {
            if <CString as binstruct::serialize::BinDecode>::MIN_SIZE
                + <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                + 0
                + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24))
                + 0
                > 0
                && !<u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
            {
                if buf.remaining()
                    < <CString as binstruct::serialize::BinDecode>::MIN_SIZE
                        + <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                        + 0
                        + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24))
                        + 0
                {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
            }
            <CString as binstruct::serialize::BinDecode>::decode(buf)?
        };
        let num_players = {
            if <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                + 0
                + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24))
                + 0
                > 0
                && !<CString as binstruct::serialize::BinDecode>::FIXED_SIZE
            {
                if buf.remaining()
                    < <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                        + 0
                        + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24))
                        + 0
                {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
            }
            <u8 as binstruct::serialize::BinDecode>::decode(buf)?
        };
        let players = {
            if 0 + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24)) + 0 > 0
                && !<u8 as binstruct::serialize::BinDecode>::FIXED_SIZE
            {
                if buf.remaining()
                    < 0 + (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24)) + 0
                {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
            }
            binstruct::serialize::BinBufExt::get_repeated(buf, (num_players) as usize)?
        };
        let slots = {
            if (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24)) + 0 > 0 && !false {
                if buf.remaining()
                    < (<Slot as binstruct::serialize::BinDecode>::MIN_SIZE * (24)) + 0
                {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
            }
            [
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
                <Slot as binstruct::serialize::BinDecode>::decode(buf)?,
            ]
        };
        let v2_field = {
            if 0 > 0 && !<Slot as binstruct::serialize::BinDecode>::FIXED_SIZE {
                if buf.remaining() < 0 {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
            }
            if version == 2 {
                if <u8 as binstruct::serialize::BinDecode>::MIN_SIZE > 0
                    && buf.remaining() < <u8 as binstruct::serialize::BinDecode>::MIN_SIZE
                {
                    return Err(binstruct::serialize::BinDecodeError::incomplete());
                }
                Some(<u8 as binstruct::serialize::BinDecode>::decode(buf)?)
            } else {
                None
            }
        };
        Ok(Self {
            magic,
            version,
            name,
            num_players,
            players,
            slots,
            v2_field,
        })
    }
}
```

repository: fluxxu/binstruct

repo_name: fluxxu/binstruct


text:
ChangeLog
=========

3.0.1 (2023-06-09)
------------------

* #89: Call static assert functions with self:: (tests only) (@phil-davis)
* #90: Implement phpstan strict rules and fix edge cases for paths that have "0" (@phil-davis)
* #91: Use newer GitHub workflow action versions (CI only) (@phil-davis)
* #93: Minor cs-fixer change (@phil-davis)

3.0.0 (2022-09-26)
------------------

* #82: Add empty host and leading slash to Windows file paths (@peterpostmann @phil-davis)

2.3.3 (2023-06-09)
------------------

* #89: Call static assert functions with self:: (tests only) (@phil-davis)
* #90: Implement phpstan strict rules and fix edge cases for paths that have "0" (@phil-davis)
* #91: Use newer GitHub workflow action versions (CI only) (@phil-davis)
* #93: Minor cs-fixer change (@phil-davis)

2.3.2 (2022-09-19)
------------------

* #83: Revert Windows file paths change (was PR 71). See issue 81 (@phil-davis)

2.3.1 (2022-08-30)
------------------

* #77: Add PHP 8.2 to CI - confirms that the code is working with PHP 8.2 (@phil-davis)
* #78: Raise phpstan to level 8  (@phil-davis)
* #79: Specify detailed return type of parse() (@phil-davis)

2.3.0 (2022-08-17)
------------------

* #74: Minimum PHP 7.4 - drops PHP 7.1 7.2 and 7.3 and adds more type declarations (@phil-davis)

2.2.4 (2022-09-19)
------------------

* #83: Revert Windows file paths change (was PR 71). See issue 81 (@phil-davis)

2.2.3 (2022-08-17)
------------------

* #71: Add empty host and trailing slash to Windows file paths (@peterpostmann @phil-davis)
* #70: Update .gitattributes (@cedric-anne)

2.2.2 (2021-11-04)
------------------

* #69: fix issue with missing slash in URI parse (@41i-6h0rb4n1 @phil-davis)

2.2.1 (2020-10-03)
------------------

* #57: Added Support for PHP 8.0 (@phil-davis)
* #51 #52 #53 #54: Update CI and unit test scripts (@phil-davis)

2.2.0 (2020-01-31)
------------------

* #45: Added Support for PHP 7.4 (@phil-davis, @staabm)
* #47: Dropped Support for PHP 7.0 (@phil-davis)
* #49: Updated the testsuite for phpunit8 (@phil-davis)
* #46: Added phpstan coverage (@phil-davis)

2.1.3 (2019-09-05)
------------------

* #43: allows the path to be 0

2.1.2 (2019-06-25)
------------------

* #39: Some PHPDoc improvements.
* PHPStan support.
* Adopted the symfony php-cs-fixer standard.
* Now testing against PHP 7.2 and 7.3.

2.1.1 (2017-02-20)
------------------

* #15: Don't throw an error when resolving a URI which path component is
  empty.
* #16: Correctly parse urls that are only a fragment `#`.

2.1.0 (2016-12-06)
------------------

* Now throwing `InvalidUriException` if a uri passed to the `parse` function
  is invalid or could not be parsed.
* #11: Fix support for URIs that start with a triple slash. PHP's `parse_uri()`
  doesn't support them, so we now have a pure-php fallback in case it fails.
* #9: Fix support for relative URI's that have a non-uri encoded colon `:` in
  them.

2.0.1 (2016-10-27)
------------------

* #10: Correctly support `file://` URIs in the build() method. (@yuloh)

2.0.0 (2016-10-06)
-----------------

* Requires PHP 7.
* Added type-hints where relevant.

1.2.1 (2017-02-20)
------------------

* #16: Correctly parse urls that are only a fragment `#`.

1.2.0 (2016-12-06)
------------------

* Now throwing `InvalidUriException` if a uri passed to the `parse` function
  is invalid or could not be parsed.
* #11: Fix support for URIs that start with a triple slash. PHP's `parse_uri()`
  doesn't support them, so we now have a pure-php fallback in case it fails.
* #9: Fix support for relative URI's that have a non-uri encoded colon `:` in
  them.

1.1.1 (2016-10-27)
------------------

* #10: Correctly support file:// URIs in the build() method. (@yuloh)

1.1.0 (2016-03-07)
------------------

* #6: PHP's `parse_url()` corrupts strings if they contain certain
  non ascii-characters such as Chinese or Hebrew. sabre/uri's `parse()`
  function now percent-encodes these characters beforehand.

1.0.1 (2015-04-28)
------------------

* #4: Using php-cs-fixer to automatically enforce coding standards.
* #5: Resolving to and building `mailto:` urls were not correctly handled.

1.0.0 (2015-01-27)
------------------

* Added a `normalize` function.
* Added a `buildUri` function.
* Fixed a bug in the `resolve` when only a new fragment is specified.

San José, CalConnect XXXII release!

0.0.1 (2014-11-17)
------------------

* First version!
* Source was lifted from sabre/http package.
* Provides a `resolve` and a `split` function.
* Requires PHP 5.4.8 and up.

repository: sabre-io/uri

repo_name: sabre-io/uri


text:
Realtime Vehicle Tracking from Spatiotemporal Updates
=================

In this repository is a basic html file which allows for consumption from realtime spatiotemporal updates from one of [Ably Hub's](https://www.ably.com/hub) vehicle position sources.

It makes use of Mapbox for rendering the data, and [Ably's JS client library](https://www.github.com/ably/ably-js) for connecting to Ably. The spatiotemporal data sent from Ably is then interpolated on the client.

To use this, simply replace the `ABLY_API_KEY` and `MAPBOX_API_KEY` with the keys from [Ably](https://www.ably.com/accounts/any/apps/any/app_keys) and [Mapbox](https://docs.mapbox.com/help/getting-started/access-tokens/) respectively. Load the html page in a browser and you're good to go!

Currently this does not have adaptive channel subscriptions based on current zoom/position on the map, but you can adjust what product and channel you're listening to.

repository: ably-labs/mapbox-gtfs

repo_name: ably-labs/mapbox-gtfs


text:
---
layout: default
title: Monetization
title_prefix: KorGE
fa-icon: fa-dollar-sign
priority: 100
children: /korge/monetization/
---

In order to monetize your game, KorGE provices some out of the box plugins to do so:

{% include toc.html context="/korge/monetization/" %}

You can also create or use any of your own multiplatform libraries.
Or [create a korge-plugin](/korge/plugin/) if that library require configuring things like the `AndroidManifest.xml` file.


text:
# BitcoinMiner

Mine Bitcoin (pBTC) with EOS CPU / NET Resources and an EOS wallet compatible with ScatterJS.  https://meet.one/ and https://www.tokenpocket.pro/ work fine and https://get-scatter.com/ may too, but newer versions have been found to be buggy.

https://bloks.io/rex?tab=rent
This is a good tool to have after you've created a wallet.  You can rent eos direct to your cpu if you want to mine with more than you own. Renting and mining has risk, mining with EOS you own doesn't.

http://btcminer.one redirects to this github site.
https://soveos.github.io/BitcoinMiner/

Also you can find new version here at
https://imnif.github.io


text:
# Jupyter notebook to generate IEEE papers

## Introduction

This is a simple template to demonstrate how fully formatted IEEE papers can directly be generated from Jupyter notebooks. Although not very sophisticated, it shows how most common requirements (e.g. title block, abstract, citations, section numbering & referencing, equations, equation numbering & referencing, figure numbering & referencing, etc) can be easily met.

## Quick start

To use this for your own papers, fork or clone this repository and edit the Jupyter notebook `paper.ipynb` and references `references.bib`. To generate the pdf version, simply open a terminal in the folder and type `make`. If everything goes well, you should have a `paper.pdf` generated in the folder.

If you need a single-column version for review, simply edit the metadata in the notebook and add `"options": "journal,onecolumn"` entry to the `latex_metadata` section.

## Dependencies

You will certainly need the following installed:

- Python 3
- Jupyter notebook
- LaTeX

The example template has the following additional dependencies:

- `arlpy`
- `selenium`
- `pillow`
- `phantomjs`

These allow high quality `bokeh` plots to be included in your paper. However, feel free to use `matplotlib` instead, if you prefer.

## Credits

The `ieee.tplx` template is adapted from work by [Julius Schulz and Alexander Schlaich](https://github.com/schlaicha/jupyter-publication-scripts).

repository: nourabassi/semester-project

repo_name: nourabassi/semester-project


text:
CS540-HW4
=========

Spam Classification with a Naïve Bayes Classifier

One of the famous applications of naïve Bayes classifiers is in spam filtering for e-mail. Can this machine
learning method be effective in classifying shorter documents, namely SMS messages (text messages) as well?
You are about to find out.
Your task is to implement a naïve Bayes classifier to identify “SPAM” from “HAM”. The data set you have
been provided, in the file sms.txt consists of 5,580 text messages that have been labeled as either “SPAM” or
“HAM”. If you open up the file, you will see that the first word per line is the label while the remainder of the
line is the text message.