text:
Title: Real-time Mapping with SignalR and Event Hubs
Date: 2015-08-18 10:20
Author: noodlefrenzy
Category: Software
Tags: .NET, C#, EventHub, Geo, WebSockets
Slug: real-time-mapping-with-signalr-and-event-hubs
Status: published

One of my recent projects had to do with watching people moving around
the city - not in a creepy stalker way, but trying to get some sense of
where people congregated and general walking traffic flow. As anyone who
has dealt with large data, especially large geo data can tell you -
visualization is everything. Somehow looking at a screen full of
lat/long coordinates and timestamps just doesn't tell you a story like
seeing things play out on the
map.

[![route\_animation]({filename}/images/route_animation.gif)]({filename}/images/route_animation.gif)

So what if you have large amounts of geo data coming in from different
users, say via a high-scale queuing mechanism like Event Hubs? What if
you want to display that to anyone who wants to see it, in
near-real-time? I decided to use [Leaflet](http://leafletjs.com/)(a
great open-source JS mapping package ([book](http://amzn.to/1J4LHxd)))
and [SignalR](http://signalr.net/)(a great open-source
[WebSockets](http://amzn.to/1J4LKZW)package for ASP.Net
([book](http://amzn.to/1HLx29i))) to make that happen. As always, I've
released all of my code [on
GitHub](https://github.com/noodlefrenzy/asp-mappy), and I'll walk you
through the steps needed to make this scenario happen.

Mapping with Leaflet.js
-----------------------

Let's start at the front - how can I show a map on the screen? There are
a ton of libraries out there - for apps, full desktop applications, and
websites. Let's assume we're going to be building a website, and want a
Javascript solution. Even there, we have many options - from our own
Bing Maps to Google Maps or even MapQuest. However, I like
[Leaflet.js](http://leafletjs.com/) for a few reasons - first, they have
an easy to use and [well](http://leafletjs.com/reference.html)
[documented](http://leafletjs.com/examples.html)API; second, they can
work with a variety of different tile-sets, so you can develop on
OpenMaps and then later swap your look-and-feel for a more Bing Maps
style with a one line code change.

Integrating Leaflet into your code is as simple as including their CSS
and Javascript, which I've done via their CDN links:

```html
<head>
...
    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
...
</head>
<body>
...
    <script src="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
...
</body>
```

I chose to put it into `_Layout.cshtml` since this was the crux of my
site. To use Leaflet, I picked a center-point and zoom level for my map,
added a well-named `div`, picked a size for it, and created a map:

```html
// from site.css:
#map { height: 500px; }

// from _Home.cshtml:
<!-- ko with: home -->
<div class="container">
    <h2>Mappy</h2>
</div>
<div class="container">
        ...
        <div class="col-md-8">
            <div id="map"></div>
        </div>
    </div>
</div>
<!-- /ko -->

// from Index.cshtml:
<script>
    var centerLat = @ViewBag.CenterLatitude;
    var centerLon = @ViewBag.CenterLongitude;
    var zoom = 13;
    var map = L.map('map').setView([centerLat, centerLon], zoom);
    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
        attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>[…]',
        maxZoom: 18,
        id<EMAIL_ADDRESS>        accessToken<EMAIL_ADDRESS>    }).addTo(map);
...
```

Note the highlighted lines where I pull constants from the ViewBag -
this allows me to factor out my maps app ID and access token, as well as
the center-point for my map.

Real-time Geo Data with SignalR
-------------------------------

#### SignalR Server-Side

Integrating SignalR isn't much more difficult than Leaflet.js, but it
has to integrate at two different layers of the stack since it's the
bridge between them. Including it in your ASP.Net application is done as
you would expect - Install the `Microsoft.AspNet.SignalR` NuGet package.
Once that's installed you'll need to decide how you want to use it
to send data from server to clients - I've used [SignalR
Hubs](http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client)in
this example, as it allowed me to create different hubs for different
purposes (although I'm only using one in this example code).

Creating a Hub is as simple as creating a class inheriting from the
appropriate `Hub` class and implementing a few methods. Behind the
scenes it creates the appropriate proxies and lets you do your client
wiring from there. The server-side needs to get the hub context instance
and then use that to send data to clients, while the hub uses its
internal Clients.All dynamic collection to deliver that data. I use a
simple static method on my Hub to allow server-side code to find the hub
context from the global connection, making calling code trivial to
implement. As a result, the Hub code looks like:

```csharp
public class RouteHub : Hub
{
    public RouteHub()
    {
    }

    public static IHubContext Hub()
    {
        return GlobalHost.ConnectionManager.GetHubContext<RouteHub>();
    }

    public static void Send(IHubContext hub, string userId, float lat, float lon)
    {
        hub.Clients.All.newPoint(userId, lat, lon);
    }

    public void Send(string userId, float lat, float lon)
    {
        Clients.All.newPoint(userId, lat, lon);
    }
}
```

Note the `Clients.All.newPoint()` call - newPoint is a `dynamic` method
which gets wired into the created proxy and passed through to the
client, as you'll see below. Calling the hub from the server is as easy
as:

```csharp
RouteHub.Send(RouteHub.Hub(), pt.UserID, (float)pt.Latitude, (float)pt.Longitude)
```

One thing to notice is that I'm casting the `doubles` I have internally
for lat/lon into `floats` when passing them down the wire. SignalR seems
to have trouble passing `doubles` through to Javascript - possibly
because the language doesn't support them - limiting it to `floats`
fixes the problem. Now that we have the hub created, we just need to
start SignalR itself when we start up our website - we do this in the
Startup.cs code with the addition of a single line:

```csharp
public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.MapSignalR();
    }
}
```

#### Wiring the SignalR Client

Now that we have a server which can send us data, we need to wire up the
client to receive it. Wiring SignalR in the client requires
three modifications. First - include the hubs, allowing the client code
to talk to the proxies. Second - create a handler to process
incoming messages from the hub you're listening to. Finally - start
listening. This is actually a pretty small chunk of code, as you can see
here:

```html
<script src="~/Scripts/jquery.signalR-2.2.0.min.js"></script>
<script src="~/signalr/hubs"></script>
<script>
    $(function () {
        var routeHub = $.connection.routeHub;
        routeHub.client.newPoint = function (userid, lat, lon) {
            // Do something exciting!
        };

        $.connection.hub.start().done(function () {
        });
    });
</script>
```

Note the reappearance of the `newPoint` method - this must correspond
with the dynamic method you're calling from within the Hub above (via
`Clients.All`).

Geo Data and Event Hub
----------------------

So now I have a client-server connection, and a map. Let's see if I
can't send some data to that map! Since I'm planning on having hundreds
or thousands of users sending me geo data, and I'm going to want to use
this geo data for more than just mapping, [Event
Hubs](http://azure.microsoft.com/en-us/services/event-hubs/) seems like
a natural mechanism to decouple the senders from the receivers. The one
caveat with writing a receiver for Event Hubs is that they have to
manage their own state (context) so they can pick up where they left
off. I'll be using the Azure-provided `EventProcessorHost` library to do
that work for me - it stores offset data for each partition in Azure
Blob storage and uses blob leases for ad-hoc load balancing, so is quite
a useful little piece of code, and is simple to set up. You just NuGet
install Microsoft.Azure.ServiceBus.EventProcessorHost, and then
implement and instantiate your event processor. I've chosen to
use/assume JSON serialization via Newtonsoft's Json.NET, and my data
payload class looks like:

```csharp
public class RoutePointEH : IRoutePoint
{
    public double Latitude { get; set; }
    public double Longitude { get; set; }
    public string UserID { get; set; }
    public DateTime MeasurementTime { get; set; }
    public DateTime Timestamp { get; set; }
}
```

(I'll come back to the reason for the `IRoutePoint` interface), while
the resulting EventProcessor looks like:

```csharp
public class RoutePointProcessorFactory : IEventProcessorFactory
{
    public RoutePointProcessorFactory(Action<IRoutePoint> onItem)
    {
        this.onItemCB = onItem;
    }

    public IEventProcessor CreateEventProcessor(PartitionContext context)
    {
        return new RoutePointProcessor(this.onItemCB);
    }

    private Action<IRoutePoint> onItemCB;
}

public class RoutePointProcessor : IEventProcessor
{
    public RoutePointProcessor(Action<IRoutePoint> onItem)
    {
        this.onItemCB = onItem;
    }

    private Action<IRoutePoint> onItemCB;

    public Task CloseAsync(PartitionContext context, CloseReason reason)
    {
        return Task.FromResult(false);
    }

    public Task OpenAsync(PartitionContext context)
    {
        return Task.FromResult(false);
    }

    public async Task ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> messages)
    {
        foreach (var message in messages)
        {
            var routeItem = AzureUtilities.DeserializeMessage<RoutePointEH>(message);
            this.onItemCB(routeItem);
            if (this.ShouldCheckpoint())
                await context.CheckpointAsync();
        }
    }
}
```

and is created and registered using a simple utility method:

```csharp
public static async Task<EventProcessorHost> AttachProcessorForHub(
    string processorName,
    string serviceBusConnectionString,
    string offsetStorageConnectionString,
    string eventHubName,
    string consumerGroupName,
    IEventProcessorFactory processorFactory)
{
    var eventProcessorHost = new EventProcessorHost(processorName, eventHubName, consumerGroupName, serviceBusConnectionString, offsetStorageConnectionString);
    await eventProcessorHost.RegisterEventProcessorFactoryAsync(processorFactory);

    return eventProcessorHost;
}
```

Note that it creates the generic EventProcessorHost class with the Event
Hub details, and then hands it a factory to create processors for each
partition. Each partition processor then is responsible for saving its
own checkpoint at an interval of its choosing (factored into the
unshown `ShouldCheckpoint` method).

I then create an additional wrapper class as a "point source" which
takes in a callback for what to do when new points come in and wires
everything up, allowing me to factor out all of the code for pulling
configuration values and creating the factory/processor, and even
letting me swap out Event Hubs for other "point sources" like
canned/random data or even Azure Table Storage (see [the
repo](https://github.com/noodlefrenzy/asp-mappy/blob/master/MappyData/RoutePointSource.cs)
for details).

```csharp
public class EventHubRoutePointSource
{
    public EventHubRoutePointSource(Action<IRoutePoint> onNewPoint)
    {
        this._onPoint = onNewPoint;
    }

    public async Task StartAsync()
    {
        var ehConnStr = ...;
        var storageConnStr = ...;
        var eventHubName = ...;
        var consumerGroup = ...;

        var factory = new RoutePointProcessorFactory(this._onPoint);

        await AzureUtilities.AttachProcessorForHub("mappy", ehConnStr, storageConnStr, eventHubName, consumerGroup, factory);
    }

    private Action<IRoutePoint> _onPoint;
}
```

Wiring It All Together
----------------------

Now that I have all of the pieces, how do I wire it all together? First,
in `Global.asax.cs` we add a single line to start our chosen "point
source" and drive its incoming data into our SignalR hub:

```csharp
RoutePointSourceFactory.StartAsync(AzureUtilities.FromConfiguration("RoutePointSource"),
    pt => RouteHub.Send(RouteHub.Hub(), pt.UserID, (float)pt.Latitude, (float)pt.Longitude));
```

Then in our client's "do something exciting!" section, we wire it up to
write this incoming geo data onto our map, with each user getting its
own path layer (a polyline) and "walking man" marker at the front.

```js
var paths = {};
var pathMarkers = {};

$(function () {
    var iconUri = '/Content/Sports-Walking-icon-white.png';
    var endIcon = L.icon({ iconSize: [38, 38], iconAnchor: [12, 12], iconUrl: iconUri });

    var routeHub = $.connection.routeHub;
    routeHub.client.newPoint = function (userid, lat, lon) {
        if (paths[userid]) {
            paths[userid].addLatLng([lat, lon]);
            if (pathMarkers[userid]) map.removeLayer(pathMarkers[userid]);
            pathMarkers[userid] = L.marker([lat, lon], { icon: endIcon }).addTo(map);
        } else {
            paths[userid] = L.polyline([[lat, lon]], { color: 'red', weight: 5 }).addTo(map);
            pathMarkers[userid] = L.marker([lat, lon], { icon: endIcon }).addTo(map);
        }
    };

    $.connection.hub.start().done(function () {
    });
});
```

What Next?
----------

If you've been following along in the repo, you'll notice that the code
above is different than what is up there - that's simply due to space
constraints, this post is already in TL;DR territory and any more
features would only make that worse. The main differences between what's
here and what's in [the repo](https://github.com/noodlefrenzy/asp-mappy)
are:

-   I've factored out the "point source" into three distinct sources -
    an Event Hub source as outlined here, an Azure Table Storage source,
    and a "Random" source with initial points pulled from a neighborhood
    around the center and then a random walk from there.
-   I've integrated the
    fantastic [Chroma.js](https://github.com/gka/chroma.js/) to ensure
    each path gets a unique random yet pleasing color, and made an LRU
    to limit the total number of paths I show on-screen.
-   I've integrated the remarkably easy-to-use
    [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat) to add a
    heatmap layer for each user, showing how individuals walk and where
    there "hot spots" might be.
-   I've created a simple CLI program to drive random data into the
    Event Hub, allowing easy testing.

I hope I've showed you that getting a mapping web application up and
running is actually pretty easy, and integrating near-real-time data can
be done with little code using Event Hubs and SignalR. As always, my
code is [up on GitHub](https://github.com/noodlefrenzy/asp-mappy)and is
MIT license, so do with it what you will. Let me know via comments,
twitter, or GitHub issues if you have any feedback - I'd love to hear
it.

repository: noodlefrenzy/IntelligentArtifice

gha_language: Makefile

repo_name: noodlefrenzy/IntelligentArtifice


text:
# target-mysql :rocket: :boom:

A [singer.io](https://www.singer.io/) target implementation for MySQL. Because some of us still have to deal with a MySQL data warehouse.

**Under active development like there's no code a barely a roadmap for now**

## Roadmap

- [ ] MySQL connection from config file setup
- [ ] Record message handling
  - [ ] Assert JSON structure
  - [ ] Assert `"schema"` field maps internal known schemas structure
  - [ ] Insert SQL statements
- [ ] Schema message handling
  - [ ] Assert JSON structure
  - [ ] Create table if not exists SQL statements
- [ ] State message handling
  - [ ] Assert JSON structure
  - [ ] Emit state to stdout

license: MIT

repository: czardien/target-mysql

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: czardien/target-mysql


text:
Subschema Native Dev Support
===
This package provides native dev support to react native applications,
it basically provides a thin wrapper around [haul](), to make it easier to use
in subschema applications.

## Bugs
* When developing with haul you may not be able to debug [see](https://github.com/callstack-io/haul/pull/148). should
fix the issue.

repository: subschema/subschema-devel

gha_language: JavaScript

gha_license_id: MIT

repo_name: subschema/subschema-devel


text:
---
layout: post
title:  "Draw Your Hand in 3D - Optical Illusion"
categories: [ Arts and Crafts, Science ]
image: assets/images/posts/3d-hand.png
featured: false
---

Create your own optical illusion by drawing your hand in "3D"!

You'll need:
* Paper
* Markers

Watch this video to see how:

{% include youtube.html id='YNEXzvnD7mI' %}

repository: kevinconroy/virtualcampout

repo_name: kevinconroy/virtualcampout


text:
# Styled Components Starter 💅

_for [Heroku](https://www.heroku.com/) deployment_

## Overview

This is a simple starter to get you up and running with Styled Components. This is intended to provide:

* a lightweight Webpack config (for development and production)
* configuration for theming and fetching fonts from a CDN
* helpful tooling for development workflow
  * Test setup with Jest and Enzyme
  * ESLint / Stylelint
* Heroku-ready deployment setup

## Up & Running

Install dependencies:

```
$ yarn install
```

Fire up a development server:

```
$ yarn dev
```

Once the server is running, you can visit `http://localhost:8080/`

## Linting

```
$ npm i -g eslint eslint-watch
```

or if you need permissions:

```
$ sudo npm i -g eslint eslint-watch
```

To run the linter once:

```
$ yarn lint
```

To run the watch task:

```
$ yarn lint:watch
```

## Testing

An initial test suite has been setup with two tests (one passing and one intentionally failing).
We're using Jest and Enzyme for our test setup. The basic test setup lives in `./__tests__`.
The main configuration for Jest lives at the bottom of `package.json`. I've also added a few
handy scripts, which I've listed below. Jest also gives us a test coverage tool for free, so I've added that too. The setup is at the bottom of `package.json`. Everything is set to 90% coverage, but your welcome to update that to whatever you'd like.

To run the tests once:

```
$ yarn test
```

To run the watch script (for only relevant test files)

```
$ yarn test:watch
```

To run the watch script (for all test files)

```
$ yarn test:watchAll
```

To view the coverage report:

```
$ yarn test:coverage:report
```

## Review

If you'd like to run the linter and tests at once (this is a nice check before pushing to Github or deploys), you can run:

```
$ yarn review
```

## Production Build

To build your production assets and run the server:

```
$ yarn start
```

## Changelog

Looking for a particular version? View the [Changelog](CHANGELOG.mb)

## Contributing

I am thankful for any contributions made by the community. By contributing you agree to abide by the Code of Conduct in the [Contributing Guidelines](.github/CONTRIBUTING.md)

## License

[MIT](LICENSE)

## DEPLOYING TO HEROKU

This app is set up for deployment to Heroku!

_This assumes you have already have a Heroku account and have the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) installed_

```
$ heroku login
$ heroku create -a name-of-your-app
$ git push heroku master
$ heroku open
```

Heroku will follow the `build` command in your `package.json` and compile assets with `webpack.prod.config.js`. It runs the Express web server in `server.js`.

If you're unfamiliar with Heroku deployment (or just need a refresher), they have a really great walkthrough [here](https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction).

repository: alanbsmith/styled-components-starter

repo_name: alanbsmith/styled-components-starter


text:
## Sample application using the Lightweight AppDynamics IoT Java SDK
Goal: Instrument a sample IoT application using the AppDynamics IoT Java SDK to report Device Information, Custom Business Events, Network Request Events(HTTPS), and Error Events to the AppDynamics Controller UI.

## Step 1: Get AppDynamics Account
If you don't have an AppDynamics Account, create a free account [here](https://www.appdynamics.com/free-trial/)

## Step 2: An IoT Application
Create a **Connected Devices App**

 * Click **User Experience** from the top navigation bar.
 * Select the **Connected Devices** tab.
 * Click **Get Started**.
 * From the **Create Application** dialog, select **Create an Application** using the Getting Started Wizard.
 * Click **OK**.
 * For step one of the Getting Started Wizard - Connected Devices page, enter a name for your IoT app.
 * Click Continue.
 * From step two, select **Java SDK** to report IoT data
 * Copy the values for the **App Key** and the **Collector URL**. You'll be using **both** to report IoT data.

  [See](https://docs.appdynamics.com/display/PRO44/Set+Up+and+Access+IoT+Monitoring#SetUpandAccessIoTMonitoring-iot-app-key) for more details

## Step 3: Get the SDK
Download the AppDynamics IoT SDK jar **appd-iot-sdk-4.4.x.jar** file from [download.appdynamics.com](https://download.appdynamics.com/download/)

## Step 4: Get the Sample App
* Clone this repository

* Import the project as a Gradle Project in your favorite IDE

* Edit the source file SampleIoTJavaTest.java with your APP-KEY and Collector URL.
* Add the jar file downloaded in Step 2 (**appd-iot-sdk-4.4.x.jar**) as a third party library.

Compile and run the sample app.

## Step 5: View Instrumentation Data
Instrumentation Data should show up on the AppDynamics Dashboard under the app created in **Step 2** under
**User Experience->Connected Devices Panel**

## Step 6: Docs 'n' stuff
For more details check out the [official documentation](https://docs.appdynamics.com/display/PRO44/IoT+Monitoring).
Javadocs can be viewed [here](https://docs.appdynamics.com/javadocs/iot-java-sdk/4.4/latest/)

## Finally -
Are you looking to instrument a C++ IoT app? Checkout the sample app [here](https://github.com/Appdynamics/iot-cpp-sample-app).

repository: zhouyaoji/iot-java-sdk-sample-apps

repo_name: zhouyaoji/iot-java-sdk-sample-apps


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

title: Grand Challenges of Hydrologic Modeling for Food-Energy-Water Nexus Security
  in High Mountain Asia
subtitle: ''
summary: ''
authors:
- Shruti K. Mishra
- Summer Rupper
- Sarah Kapnick
- Kimberly Casey
- Hoi Ga Chan
- Enrico Ciraci'
- Umesh Haritashya
- John Hayse
- Jeffrey S. Kargel
- Rijan B. Kayastha
- Nir Y. Krakauer
- Sujay V. Kumar
- Richard B. Lammers
- Viviana Maggioni
- Steven A. Margulis
- Mathew Olson
- Batuhan Osmanoglu
- Yun Qian
- Sasha McLarty
- Karl Rittger
- David R. Rounce
- David Shean
- Isabella Velicogna
- Thomas D. Veselka
- Anthony Arendt
tags: []
categories: []
date: '2021-01-01'
lastmod: 2022-10-03T19:28:50-04:00
featured: false
draft: false

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

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
projects: []
publishDate: '2022-12-05T20:14:09.297525Z'
publication_types:
- '2'
abstract: Climate-influenced changes in hydrology affect water-food-energy security
  that may impact up to two billion people downstream of the High Mountain Asia (HMA)
  region. Changes in water supply affect energy, industry, transportation, and ecosystems
  (agriculture, fisheries) and as a result, also affect the region's social, environmental,
  and economic fabrics. Sustaining the highly interconnected food-energy-water nexus
  (FEWN) will be a fundamental and increasing challenge under a changing climate regime.
  High variability in topography and distribution of glaciated and snow-covered areas
  in the HMA region, and scarcity of high resolution (in-situ) data make it difficult
  to model and project climate change impacts on individual watersheds. We lack basic
  understanding of the spatial and temporal variations in climate, surface impurities
  in snow and ice such as black carbon and dust that alter surface albedo, and glacier
  mass balance and dynamics. These knowledge gaps create challenges in predicting
  where and when the impact of changes in river flow will be the most significant
  economically and ecologically. In response to these challenges, the United States
  National Aeronautics and Space Administration (NASA) established the High Mountain
  Asia Team (HiMAT) in 2016 to conduct research to address knowledge gaps. This paper
  summarizes some of the advances HiMAT made over the past 5 years, highlights the
  scientific challenges in improving our understanding of the hydrology of the HMA
  region, and introduces an integrated assessment framework to assess the impacts
  of climate changes on the FEWN for the HMA region. The framework, developed under
  a NASA HMA project, links climate models, hydrology, hydropower, fish biology, and
  economic analysis. The framework could be applied to develop scientific understanding
  of spatio-temporal variability in water availability and the resultant downstream
  impacts on the FEWN to support water resource management under a changing climate
  regime.
publication: '*Frontiers in Water*'
url_pdf: https://www.frontiersin.org/articles/10.3389/frwa.2021.728156
---

repository: highmountainasia/himat-website

gha_language: TeX

repo_name: highmountainasia/himat-website


text:
# redux-thunk-crud

redux-thunk-crud is a library that seeks to eliminate the boilerplate of writing highly repetitive reducers and action creators for simple RESTful API CRUD actions, using redux-thunk to handle asynchronous API calls. It's made of:

`CrudActionCreators` - a class encapsulating CRUD action creators for a single endpoint

`createCrudReducers` - a higher-order function that creates a reducer for a given CrudActionCreators instance

`fetchAdapter`       - CrudActionCreators takes an adapter which provides the ability to make API calls. This adapter implements API calls using Fetch API and is included in order to provide a default and make the library testable without adding a dependency

[![npm version](https://badge.fury.io/js/redux-thunk-crud.svg)](http://badge.fury.io/js/redux-thunk-crud)

## Installation

```sh
npm install --save redux-thunk-crud
```

You will also need Redux, which is a peer dependency, so if you don't already have it:

```sh
npm install --save redux
```

## Basic usage

The parts of the library are available as named exports:

```js
import {createCrudReducers, CrudActionCreators} from 'redux-thunk-crud';
```

`fetchAdapter` is also available as a named export but in most cases shouldn't be used directly.

The first step is to instantiate an object containing action creators for an endpoint, since this also generates action types:

```js
const someThingsActionCreators = new CrudActionCreators('https://jsonplaceholder.typicode.com/posts', 'SOME_THING');
```

SOME_THING is the suffix for action types which will be generated, for example REQUEST_SOME_THINGS, DELETE_SOME_THINGS, etc. A full set of action types is available in someThingsActionCreators.actionTypes

Next, we create the reducer:

```js
const someThingsReducer = createCrudReducers(someThingsActionCreators, methods, resetAllDataActionType, mergeDataChanges, initialDataState);
```

Which can simply be feed to `combineReducers` or directly to `createStore` just like any other reducer.

The parameters are:

**someThingsActionCreator** - crud action creators that reducer will handle

**methods** - methods you want to use, default is 'CRUD'. If you want to use read only, you can pass 'R', etc

**resetAllDataActionType** - action type for which created crud reducers will reset state to initial, default is 'RESET_ALL_DATA'. Pay attention that you are not already using action type of same name in your app
**mergeDataChanges** - whether to merge save data on reducer after save, or remove after delete. Defaults to false
**initialDataState** - initial state for data, defaults to empty array

## Action creators

The action creators constructor has the following signature:

```js
new CrudActionCreators(url, actionTypesSuffix, settings = {})
```

The parameters are:

**url** - url for the endpoint

**actionTypesSuffix** - a suffix to append to the generic preffies in order to generate action types, should match the name of the resource, in singular, for easier debugging

**settings** - other optional settings, described in the following table:

| Property         | Type    | Default | Description |
| ------------ | ------- | ------- | ----------- |
| **adapter** | function | fetchAdapter | A thunk action creator used to make an API call according to the given parameters. Custom adapters may be supplied and are documented below. |
| **primaryKey** | string | 'id' | Property of the resource used as primary key. |
| **actionTypesSuffixPlural** | string | undefined | Action types suffix to use when plural is needed. If undefined will be generated by appending 'S' to the singular suffix provided as constructor argument. |
| **json** | boolean | false | Whether to encode request body as json. This is passed on to the adapter which should encode the data and set appropriate headers. |
| **headers** | array of strings | [] | Headers to add to the request. Content type headers for json requests should be set automatically by the adapter. |
| **getters** | object | {} | Object that should contain functions used to get data included into dispatched actions from the data received from the API for GET requests. Possible keys are getList and getOne. Both will be passed the response received from the API. |
| **responseType** | json | undefined | Expected type of response from the API. Passed on to the adapter. The default is undefined to let the adapter use its own default.|

Normally only the following thunk action creators should be used directly:

| Method         | Type    | Description | Arguments |
| ------------ | ------- | ----------- | ----------- |
| **fetchList(params)** | R | Makes a GET request to fetch the list of resources. | **params** - object - optional search parameters |
| **fetchOne(id)** | R | Makes a GET request to fetch a single resource. | **id** - any primitive - primary key of the resource to fetch, appended to the endpoint url |
| **save(data,id,method)** | C/U | Makes a request to create or update a resource. If no method is specified it will make POST to create and PUT to update. | **data** - object - object representing the resource to create or new values for the update
 **id** - any primitive - optional primary key of the resource to update, appended to the url if provided
 **method** - string - optional method to override the default behavior, if not specified POST will be assumed if id is undefined and PUT if id is provided. |
| **delete(id)** | D | Makes a DELETE request to delete a resource. | **id** - any primitive - primary key of the resource to delete, appended to the endpoint url |

## Adapters

The library abstracts away API calls by using an adapter function provided to the constructor as argument. The default adapter implements API calls using Fetch API in order to provide a default that works for testing without adding a higher-level library as dependency. In a real scenario, you will probably want to write your own adapter which implements the calls using your favorite XMLHttpRequest library. An adapter is a thunk creator which should take the same config object as the included fetchAdapter and return a thunk, a function that takes redux's dispatch() function as an argument and returns a promise. Adapter config object has the following properties:

| Property | Type | Description |
| ------------ | ------- | ----------- |
| **requestAction** | function | Action creator dispatched just before the API call is made. |
| **successAction** | function | Action creator dispatched when the API call returns a non-error response. |
| **failureAction** | function | Action creator dispatched when the API call returns an error response. |
| **method** | string | HTTP method for the API call. |
| **url** | string | URL of the endpoint to make the request to. |
| **params** | object | Params for the API call, sent either as query string or request body. |
| **json** | boolean | Whether to encode params as json and add content type header if request body is sent. |
| **headers** | array | Additional headers to add to the request. |
| **responseType** | string | Type of data expected as response. |

Any of the config properties may be omitted and handling undefined properties is left to the implementation of the adapter. It's usually a good idea to not dispatch actions when an action creator is not defined for example.

## Enhancing and Customizing

If you need more than the standard CRUD action, writing additional action creators as separate functions is the most straightforward way to implement them. If those actions are repetitive, CrudActionCreators can be extended to add new action creators or override the existing ones.

The reducer can be enhanced to handle additional action types by passing it through a higher order reducer.

## Contributing

We are happy to take contributions in form of issues and PRs, but please keep in mind that this is supposed to be a minimal CRUD library. There's a lot of API weirdness in the world but there's no intent to support every little quirk every API developer thought was a good idea to implement. To handle those in your own project, please refer to the Enhancing and Customizing section above. For anything else, please feel free to open an issue or PR and we will be happy to address it as soon as possible.

When making a PR, please make sure you are running prettier and tests as a pre-commit hook and not forcing commits without those. Also please add tests for any bigger change that is not covered by existing tests.

repository: gogoair/redux-thunk-crud

repo_name: gogoair/redux-thunk-crud


text:
# CharlockHolmes

Character encoding detecting library for Ruby using [ICU](http://site.icu-project.org/)

## Usage

First you'll need to require it

``` ruby
require 'charlock_holmes'
```

## Encoding detection

``` ruby
contents = File.read('test.xml')
detection = CharlockHolmes::EncodingDetector.detect(contents)
# => {:encoding => 'UTF-8', :confidence => 100, :type => :text}

# optionally there will be a :language key as well, but
# that's mostly only returned for legacy encodings like ISO-8859-1
```

NOTE: `CharlockHolmes::EncodingDetector.detect` will return `nil` if it was unable to find an encoding.

For binary content, `:type` will be set to `:binary`

Though it's more efficient to reuse once detector instance:

``` ruby
detector = CharlockHolmes::EncodingDetector.new

detection1 = detector.detect(File.read('test.xml'))
detection2 = detector.detect(File.read('test2.json'))

# and so on...
```

### String monkey patch

Alternatively, you can just use the `detect_encoding` method on the `String` class

``` ruby
require 'charlock_holmes/string'

contents = File.read('test.xml')

detection = contents.detect_encoding
```

### Ruby 1.9 specific

NOTE: This method only exists on Ruby 1.9+

If you want to use this library to detect and set the encoding flag on strings, you can use the `detect_encoding!` method on the `String` class

``` ruby
require 'charlock_holmes/string'

contents = File.read('test.xml')

# this will detect and set the encoding of `contents`, then return self
contents.detect_encoding!
```

## Transcoding

Being able to detect the encoding of some arbitrary content is nice, but what you probably want is to be able to transcode that content into an encoding your application is using.

``` ruby
content = File.read('test2.txt')
detection = CharlockHolmes::EncodingDetector.detect(content)
utf8_encoded_content = CharlockHolmes::Converter.convert content, detection[:encoding], 'UTF-8'
```

The first parameter is the content to transcode, the second is the source encoding (the encoding the content is assumed to be in), and the third parameter is the destination encoding.

## Installing

If the traditional `gem install charlock_holmes` doesn't work, you may need to specify the path to
your installation of ICU using the `--with-icu-dir` option during the gem install or by configuring Bundler to
pass those arguments to Gem:

Configure Bundler to always use the correct arguments when installing:

    bundle config build.charlock_holmes --with-icu-dir=/path/to/installed/icu4c

Using Gem to install directly without Bundler:

    gem install charlock_holmes -- --with-icu-dir=/path/to/installed/icu4c

### Homebrew

If you're installing on Mac OS X then using [Homebrew](http://mxcl.github.com/homebrew/) is
the easiest way to install ICU.

However, be warned; it is a Keg-Only (see [homedir issue #167](https://github.com/mxcl/homebrew/issues/167)
for more info) install meaning RubyGems won't find it when installing without specifying `--with-icu-dir`

To install ICU with Homebrew:

    brew install icu4c

Configure Bundler to always use the correct arguments when installing:

    bundle config build.charlock_holmes --with-icu-dir=/usr/local/opt/icu4c

Using Gem to install directly without Bundler:

    gem install charlock_holmes -- --with-icu-dir=/usr/local/opt/icu4c


text:
# University Registrar

##### _Join Statements practice for Epicodus, 1 September 2015_

#### By **Kallen Millner & Molly Waggett**

## Description

This app allows a user to view students and courses in a university registrar. From the 'View Students' page, the user may add a new student or view details about a particular student, including name, enrollment date, and courses they're registered for, by clicking on their name. The user may also edit or delete a student. The 'View Courses' page is similar - the user may add a new course or view details about a particular course, including name, course number, and enrolled students. The user may also edit or delete a course.

## Setup

* Set up the database in PostgreSQL by running the following commands in your terminal:
```
  psql
  CREATE DATABASE registrar;
  \c registrar;
  CREATE TABLE students (id serial PRIMARY KEY, name varchar, enrollment_year int, enrollment_month int, enrollment_day int);
  CREATE TABLE courses (id serial PRIMARY KEY, name varchar, course_number varchar);
  CREATE TABLE students_courses (id serial PRIMARY KEY, student_id int, course_id int);

```
* If you wish to run tests, create a test database:
```
  CREATE DATABASE registrar_test WITH TEMPLATE registrar;
```
* Clone this repository.
* Using the command line, navigate to the top level of the cloned directory.
* Make sure you have gradle installed.
* Go!

## Technologies Used

* Java
* PostgreSQL
* Spark
* Velocity
* Gradle
* JUnit
* FluentLenium

### Legal

Copyright (c) 2015 **Kallen Millner & Molly Waggett**

This software is licensed under the MIT license.

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

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

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


text:
+++
author = "Bandra info Staff Writer"
categories = ["bandra reclamation", "CATERING", "FOOD/BEV"]
date = 2013-05-08T13:23:35Z
description = ""
draft = false
image = "__GHOST_URL__/content/images/wordpress/2013/05/copper-2.jpg"
slug = "delectable-indian-cuisine-by-copper-haandi"
tags = ["bandra reclamation", "CATERING", "FOOD/BEV"]
title = "Delectable Indian Cuisine by Copper Haandi"

+++

When you think of “Delectable Indian Cuisine” the name Copper Haandi follows.

The taste of Indian Cuisine varies from extremely mild to spicy, and is often associated with a distinctive aroma complimented with the taste of ground and whole spices.

Known for its diversity in food, cuisines differ considerably from each other and are prepared with natively available spices, herbs, meat, vegetables and fruits.

Copper Haandi takes pride in exquisitely introducing a range of divergent Indian cuisine; with its signature touch of unparalleled execution of artistic methods. Copper Haandi believes in ‘Projection of Perfection’ and that’s precisely why perfection is emphasized at every level of performance, from commencement-to-accomplishment.

Copper Haandi sets the highest standards, which includes the usage of the most Finest and Freshest ingredients in all of its preparations. Meat is tender, fresh & most importantly HALAAL.

Oil is of prime importance, and it is made sure that Refined Sunflower Oil (0% Cholesterol) is used while cooking. The Herbs and Spices (Masalas) used are specially customized for these unrivalled dishes and are of Export Standard. And that is precisely why the final serving is remarkably unique and distinctly unmatched.

Copper Haandi takes pleasure in executing all catering requirements:

Grand Wedding Affair

Formal Luncheon

 Conference

Business meeting

Private party

Lunch/Dinner Home party

Grand Banquet/Buffet

Services offered include:

Complete planning & execution of your event customized as per your requirement.

Pre-event Menu & Quantity consultation.

Complete Cuisine samples presented before any event, on request (event-minimum 100 people)

Meat is Strictly HALAAL.

Special offers for festive seasons.

Copper Haandi makes sure your occasion is catered to; with grandeur and precision. So whether its 10 people or more than 10000, small gatherings or grand gala affairs, the operational methods and quality is always standard & consistent, customized to suit your requirements.

EVENTS & EXHIBITIONS

Copper Haandi recently ventured into the Events & Exhibition Segment post associating itself with Pinnacle Hospitality Solutions.

Copper Haandi puts its best to ensure that every preparation bears the IQEQ Stamp of Impeccable Quality and Enormous Quantity so that every preparation results in, not just mere satisfaction, but leaves an indelible mark of the best food your taste buds have ever been subject to.

Copper Haandi looks forward to continue tempting guests to indulge in its sumptuous delicacies.

[box]

Copper Haandi,

24, Anand Sagar,

Bandra Reclamation,

Bandra (West),

Mumbai 400050

Ph: +91-<PHONE_NUMBER>

Email:

<a href="mailto:contact<EMAIL_ADDRESS>
<a href="mailto:copperhaandi<EMAIL_ADDRESS>
Website: https://copperhaandi.com/

[/box]


text:
### W.A.R.

Simple global turn-based strategy for desktop browsers made by me.

#### Requirements

Any decent modern desktop browser (not freaking Internet Explorer).
If any problems occur, please contact me via email (nefedov.alexander91@yandex.ru).

branch_name: refs/heads/gh-pages


text:
[![Build Status](https://travis-ci.org/livingbio/django-template.svg?branch=master)](https://travis-ci.org/livingbio/django-template)

# Evaluation of Chinese Segmenters

Evaluate four Chinese segmenters: [jieba](https://github.com/fxsjy/jieba), jieba with pre-defined dictionary, 大師's dictionary-based segmenter, [Stanford segmenter](http://nlp.stanford.edu/software/segmenter.shtml).

### Setting Virtualenv

At first, you should make sure you have [virtualenv](http://www.virtualenv.org/) installed.

    cd news_scraper
    virtualenv venv
    source venv/bin/activate
    pip install -r requirements.txt

### Setting up local environment variables

Settings are stored in environment variables via [django-environ](http://django-environ.readthedocs.org/en/latest/). The quickiest way to start is to copy and rename `local.sample.env` into `local.env`:

    cp src/news_scraper/settings/local.sample.env src/news_scraper/settings/local.env

Then edit the SECRET_KEY in local.env file, replace `q+#ae^hxgz7o*lvdatnsu76365uwmspc$(vac%9(b8gck-(l^z` into any [Django Secret Key](http://www.miniwebtool.com/django-secret-key-generator/), for example:

    SECRET_KEY=twvg)o_=u&@6^*cbi9nfswwh=(&hd$bhxh9iq&h-kn-pff0&&3

### Run web server

After that, just cd to `src` folder:

    cd src

And run migrate and http server:

    python manage.py migrate
    python manage.py runserver

### Scrape news for evaluation

It takes about 10 minutes to scrape news from LTN news.

    cd src
    scrapy crawl news.ltn.com.tw

### Evaluate segmenters

    python manage.py eval_segmenter


text:
# Exercise 6 - SVM
For the first data set, a *linear kernel* is enough, but the second set requires the use of *gaussian kernels*. Similarly, the *SVM* for the third data set is trained using *gaussian kernels* by minimising the
cost of the classifier with regards to the parameters `C` and `sigma` on the *cross-validation* set.

The aim of the exercise is to filter spam email by using an *SVM*. Thus, the feature vector is composed
of those words selected form a *vocabulary* of frequently used spam words which appear in the current
email. The *SVM* is particularly accurate for this kind of task: `98.5%`.

repository: teodutu/Machine-Learning

repo_name: teodutu/Machine-Learning


text:
# frontline

Frontline Live Homepage

## Build step

Install less

    npm i -g less

Run compile step from within `docs` folder

    lessc style.less style.css

Initially - commit `style.css` and push to deploy.

TODO - consider taking a step down to use plain old CSS for simplicity, maintainability,
transferability.

## Dotnet core app

The `Frontline.sln` and `Frontline` config and C# code aim to provide a live-reload dev
environment.

Similar setup on MacOSX/Linux without dotnet install - change directory into the `docs` folder
then run:

    python -m http.server

to serve the static files on http://localhost:8000 and

    watch lessc style.less style.css

to continually rebuild the stylesheets while developing.

## Ushahidi API

Core open data platform is an Ushahidi instance: https://frontlinehelp.ushahidi.io

API docs are at https://docs.ushahidi.com/platform-developer-documentation/tech-stack/api-documentation

Main call to get geolocated data:
https://frontlinehelp.api.ushahidi.io/api/v3/posts/geojson

Each item from Main Url provides id to put in:
https://frontlinehelp.api.ushahidi.io/api/v3/posts/[id]

e.g.
https://frontlinehelp.api.ushahidi.io/api/v3/posts/68
https://frontlinehelp.api.ushahidi.io/api/v3/posts/65

The forms (surveys) correspond to different submission types (PPE request, supplied...)
https://frontlinehelp.api.ushahidi.io/api/v3/forms/[id]

Then images data needs a subsequent API call:
https://frontlinehelp.api.ushahidi.io/api/v3/media/[id]

Giving us data to form url to get actual image:
https://74ddb495e3f187ded630-0b4c691ea14dad11384ab079da46af4f.ssl.cf2.rackcdn.com/frontlinehelp.api.ushahidi.io/5/e/5e7de59df239a-screenshot%202020-03-27%20at%2011.37.24.png

repository: cboche/frontline

repo_name: cboche/frontline


text:
# Documentation for Seldon Core

This directory contains the sources (`.md` and `.rst` files) for the
documentation. The main index page is defined in `source/index.rst`.
The Sphinx options and plugins are found in the `source/conf.py` file.
The documentation is generated in full by calling `make html`.

## Requirements

To build the documentation, first we need to install Python requirements:

```bash
make install-dev
```

### Install pandoc

We also need `pandoc` for parsing Jupyter notebooks, the easiest way
to install this is using conda:

`conda install -c conda-forge pandoc=1.19`

## Usage

To build the docs locally, you can run:

```bash
make html
```

The resulting documentation is located in the `_build` directory with
`_build/html/index.html` marking the homepage.

### Live edit

During development, is useful to have the docs server running in the background
and watching for changes on the docs.
This can be done by running:

```bash
make livehtml-fast
```

## Sphinx extensions and plugins

We use various Sphinx extensions and plugins to build the documentation:

 * [m2r2](https://github.com/crossnox/m2r2) - to handle both `.rst` and `.md`
 * [sphinx.ext.napoleon](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html) - support extracting Numpy style doctrings for API doc generation
 * [sphinx_autodoc_typehints](https://github.com/agronholm/sphinx-autodoc-typehints) - support parsing of typehints for API doc generation
 * [sphinxcontrib.apidoc](https://github.com/sphinx-contrib/apidoc) - automatic running of [sphinx-apidoc](https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html) during the build to document API
 * [nbsphinx](https://nbsphinx.readthedocs.io) - parsing Jupyter notebooks to generate static documentation
 * [nbsphinx_link](https://nbsphinx-link.readthedocs.io) - support linking to notebooks outside of Sphinx source directory via `.nblink` files

The full list of plugins and their options can be found in `source/conf.py`.

## Tips & Tricks

### Linking to markdown outside of `doc/source`

Referencing documents outside of `doc/source` tree does not work out of the box but there
is an easy workaround:

1. Create a simple `rst` file including `include` or `mdinclude` directive, e.g. see [this](source/reference/integration_sagemaker_link.rst) link referenced [here](source/reference/images.md)

        .. mdinclude:: ../../../integrations/sagemaker/README.md

2. Reference this file instead of included one

### Linking to notebooks outside of `doc/source`

To reference notebooks which sit outside of the `doc` folder, you will need to
create an `*.nblink` file which links to it.
You can check the
[`source/examples/seldon_core_setup.nblink`](source/examples/seldon_core_setup.nblink)
file as an example.

Note that some notebooks may link to other resources, like images, which
usually sit relative to their folder (e.g. in a local `images/` folder).
These files also need to be referenced, so that they get linked correctly in
the final output.
We can specify these files using the `extra-media` key in the `*.nblink` file.
You can check the
[`source/examples/graph-metadata.nblink`](source/examples/seldon_core_setup.nblink)
file as an example.

The complete workaround would look like:

1. Create a simple `nblink` file pointing to the notebook:

   ```json
   {
     "path": "../../../notebooks/example-1/our-notebook.ipynb"
   }
   ```

2. (Optional) Add any extra resources (e.g. images) that the notebook links to:

   ```json
   {
     "path": "../../../notebooks/example-1/our-notebook.ipynb",
     "extra-media": ["../../../notebooks/example-1/images"]
   }
   ```

3. Reference this file instead of the included one.

repository: SeldonIO/seldon-core

gha_language: HTML

repo_name: SeldonIO/seldon-core


text:
# Biphenyl TorsionDriveDataset

### Description

Resubmission of `OpenFF Substituted Phenyl Set 1`, in response to metadata not being [stored in the places we need](https://github.com/openforcefield/qca-dataset-submission/pull/140#issuecomment-705675738) to use the dataset for MM reliably.

Description from original dataset below:

> - The original molecules were provided by Chris Bayly
> - The scripts and data to generate `phenyl_set_inputs.json` is [here](https://github.com/choderalab/fragmenter_data/blob/master/phenyl_benchmark/generate_torsiondrive_inputs.py)
> - Theory: OpenFF high-throughput standard QC reference
> - Additional Properties: Computes and saves Wiberg bond-orders

### General Information

- Date: 2020.11.09
- Class: OpenFF TorsionDriveDataset
- Purpose:
- Collection: TorsionDriveDataset
- Name: OpenFF Substituted Phenyl Set 1 v2.0
- Number of unique molecules: 155
- Number of torsiondrives: 156
- Submitter: David Dotson

### QCSubmit generation pipeline

Extracting original molecules, conformers, and CMILES information; generating QCSubmit dataset:

- `Submission Preparation.ipynb`: This notebook shows how the Optimization dataset was prepared from the input files.

### QCSubmit Manifest

- `biphenyls_set_input.json`: original v1 submission molecules
- `phenyl_set_torsiondrive_inputs.json`: original v1 submission molecules
- `Submission Preparation.ipynb`: Dataset creation notebook with details on decisions made for submission.
- `molecules.pdf`: A pdf file containing molecule 2D structures, with driven torsions highlighted.
- `molecules.smi`: SMILES for every molecule in the submission.
- `dataset.json`: QCSubmit dataset submitted to QCArchive

### Metadata

- elements: {'Br', 'C', 'Cl', 'F', 'H', 'I', 'N', 'O'}
- unique molecules: 155
- number of torsiondrives: 156
- scf properties:
    - `dipole`
    - `quadrupole`
    - `wiberg_lowdin_indices`
    - `mayer_indices`
- qc spec
    - name: default
      method: B3LYP-D3BJ
      basis: DZVP
      program: psi4

## Supplemental compute specs

- scf properties:
    - `dipole`
    - `quadrupole`
    - `wiberg_lowdin_indices`
    - `mayer_indices`
- qc spec
    - name: openff-1.0.0
      method: openff-1.0.0
      basis: smirnoff
      program: openmm
    - name: openff-1.2.1
      method: openff-1.2.1
      basis: smirnoff
      program: openmm
    - name: openff-1.3.0
      method: openff-1.3.0
      basis: smirnoff
      program: openmm
    - name: gaff-2.11
      method: gaff-2.11
      basis: antechamber
      program: openmm

repository: openforcefield/qca-dataset-submission

gha_language: Jupyter Notebook

repo_name: openforcefield/qca-dataset-submission


text:
---
layout: archive
permalink: /
title: "About"
author_profile: true
redirect_from:
  - /about/
  - /about.html
header:
  overlay_image: ../images/image_dark-space-black-moon.jpg
  overlay_filter: 0.1 # same as adding an opacity of 0.5 to a black background
---

## Bio

I am assistant professor at Florida State University and FRIB Bridge with the Facility for Rare Isotope Beams (FRIB) at Michigan State University (MSU). My research interests cover the study of open quantum systems, many-body physics, low-energy nuclear structure and reactions, as well as many other related topics. I completed my PhD in 2014 at the University of Caen, France, while doing research at the Grand Accélérateur National d'Ions Lourds (GANIL) under the supervision of Prof. M. Płoszajczak.

[//]: # (## Interests)

[//]: # (![Research interests](../images/research_interests.png))


text:
[![NPM version](https://badge.fury.io/js/fine.png)](http://badge.fury.io/js/fine)
[![Build Status](https://secure.travis-ci.org/vesln/fine.png)](http://travis-ci.org/vesln/fine)
[![Coverage Status](https://coveralls.io/repos/vesln/fine/badge.png?branch=master)](https://coveralls.io/r/vesln/fine?branch=master)
[![Code Climate](https://codeclimate.com/github/vesln/fine.png)](https://codeclimate.com/github/vesln/fine)

# Important Notice

I'm no longer actively maintaining this project. If you are interested supporting it - [ping me on twitter](https://twitter.com/vesln).
The only thing that I will ask you is to not change the API drastically. If you are planning on doing that - better start a brand new project.

If you want me to transfer you only the name on npm, I'd be happy to only if the project **does not have any downloads on npm lately**. In case it's being
downloaded, there are people that depend on it and might step up and start maintaining, so I will not transfer it to you, regardless if you want to release
a new major version etc.

If you have any other questions, let me know.

Thanks!

Veselin

# Fine

## Synopsis

Tiny, recursive and synchronous file finder utility.

## Features

- Recursive file finder
- Filter by extension
- Ignore list
- Synchronous
- Windows support

## Description

The module is optimized for finding specific files in a given directory tree.
I needed something that could allow me to easily accomplish the following:

```
$ ./bin/awesome ~/Code/npm/ --ignore ~/Code/npm/test --ignore ~/Code/npm/examples
```

In this particular case we are interested in all .js files in the npm
directory tree, but not in test, nor in examples.

## Usage

```js
var fine = require('fine');
var files = fine('/tmp');
```

#### Return files with given extension(s)

```js
fine('/tmp', { ext: '.js' });
```

```js
fine('/tmp', { ext: ['.js', '.coffee'] });
```

#### Ignore list

```js
fine('/tmp/', { ignore: '/tmp/secret' });
```

```js
fine('/tmp/', { ignore: ['/tmp/secret', '/tmp/fbi.js', '/tmp/bad.js'] });
```

## Installation

```bash
$ npm install fine
```

## Tests

### Running the tests

```bash
$ npm install
$ make test
```

### Test coverage

```bash
$ make test-cov
```

### JSHint

```bash
$ make jshint
```

## Similar projects

- [node-glob](https://github.com/isaacs/node-glob)
- [shelljs](https://github.com/arturadib/shelljs)

## Support the author

Do you like this project? Star the repository, spread the word - it really helps. You may want to follow
me on [Twitter](https://twitter.com/vesln) and
[GitHub](https://github.com/vesln). Thanks!

## License

**MIT License**

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

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

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

repository: vesln/fine

repo_name: vesln/fine


text:
# Ada Beans
A [Java Bean](https://en.wikipedia.org/wiki/JavaBean)(http://en.wikipedia.org/wiki/JavaBean) is an object that
allows to access its properties through getters and setters. Java Beans
rely on the use of Java introspection to discover the [Java Bean](https://en.wikipedia.org/wiki/JavaBean) object properties.

An Ada Bean has some similarities with the [Java Bean](https://en.wikipedia.org/wiki/JavaBean) as it tries to expose
an object through a set of common interfaces.  Since Ada does not have introspection,
some developer work is necessary. The Ada Bean framework consists of:

  * An `Object` concrete type that allows to hold any data type such
  as boolean, integer, floats, strings, dates and Ada bean objects.
  * A `Bean` interface that exposes a `Get_Value` and `Set_Value`
  operation through which the object properties can be obtained and modified.
  * A `Method_Bean` interface that exposes a set of method bindings
  that gives access to the methods provided by the Ada Bean object.

The benefit of Ada beans comes when you need to get a value or invoke
a method on an object but you don't know at compile time the object or method.
That step being done later through some external configuration or presentation file.

The Ada Bean framework is the basis for the implementation of
[Ada Server Faces](https://gitlab.com/stcarrez/ada-asf) and [Ada EL](https://gitlab.com/stcarrez/ada-el).  It allows the presentation layer to
access information provided by Ada beans.

To use the packages described here, use the following GNAT project:

```Ada
with "utilada_base";
```

## Objects
The `Util.Beans.Objects` package provides a data type to manage entities of different types
by using the same abstraction.  The `Object` type allows to hold various values of different
types.

An `Object` can hold one of the following values:

  * a boolean,
  * a long long integer,
  * a date,
  * a string,
  * a wide wide string,
  * an array of objects,
  * a generic data bean,
  * a map of objects,
  * a vector of object

Several operations are provided to convert a value into an `Object`.

```Ada
with Util.Beans.Objects;
  Value : Util.Beans.Objects.Object
     := Util.Beans.Objects.To_Object (String '("something"));
  Value := Value + To_Object (String '("12"));
  Value := Value - To_Object (Integer (3));

```

The package provides various operations to check, convert and use the `Object`
type.

| Name      | Description                              |
| --------- | ---------------------------------------- |
| Is_Empty  | Returns true if the object is the empty string or empty list |
| Is_Null   | Returns true if the object does not contain any value |
| Is_Array  | Returns true if the object is an array |
| Get_Type  | Get the type of the object |
| To_String | Converts the object to a string |
| To_Wide_Wide_String | Convert to a wide wide string |
| To_Unbounded_String | Convert to an unbounded string |
| To_Boolean | Convert to a boolean |
| To_Integer | Convert to an integer |
| To_Long_Integer | Convert to a long integer |
| To_Long_Long_Integer | Convert to a long long integer |
| To_Float   | Convert to a float |
| To_Long_Float | Convert to a long float |
| To_Long_Long_Float | Convert to a long long float |
| To_Duration  | Convert to a duration |
| To_Bean | Convert to an access to the Read_Only_Bean'Class |

Conversion to a time or enumeration is provided by specific packages.

The support for enumeration is made by the generic package
`Util.Beans.Objects.Enums` which must be instantiated with the enumeration
type.  Example of instantiation:

```Ada
 with Util.Beans.Objects.Enum;
 ...
    type Color_Type is (GREEN, BLUE, RED, BROWN);
    package Color_Enum is
       new Util.Beans.Objects.Enum (Color_Type);
```

Then, two functions are available to convert the enum value into an `Object`
or convert back the `Object` in the enum value:

```Ada
 Color : Object := Color_Enum.To_Object (BLUE);
 C : Color_Type := Color_Enum.To_Value (Color);
```

## Object maps
The `Util.Beans.Objects.Maps` package provides a map of objects with a `String`
as key.  This allows to associated names to objects.
To create an instance of the map, it is possible to use the `Create` function
as follows:

```Ada
with Util.Beans.Objects.Maps;
...
   Person : Util.Beans.Objects.Object := Util.Beans.Objects.Maps.Create;
```

Then, it becomes possible to populate the map with objects by using
the `Set_Value` procedure as follows:

```Ada
Util.Beans.Objects.Set_Value (Person, "name",
                              To_Object (Name));
Util.Beans.Objects.Set_Value (Person, "last_name",
                              To_Object (Last_Name));
Util.Beans.Objects.Set_Value (Person, "age",
                              To_Object (Age));
```

Getting a value from the map is done by using the `Get_Value` function:

```Ada
Name : Util.Beans.Objects.Object := Get_Value (Person, "name");
```

It is also possible to iterate over the values of the map by using
the `Iterate` procedure or by using the iterator support provided by
the `Util.Beans.Objects.Iterators` package.

## Object vectors
The `Util.Beans.Objects.Vectors` package provides a vector of objects.
To create an instance of the vector, it is possible to use the `Create` function
as follows:

```Ada
with Util.Beans.Objects.Vectors;
...
   List : Util.Beans.Objects.Object := Util.Beans.Objects.Vectors.Create;
```

## Datasets
The `Datasets` package implements the `Dataset` list bean which
defines a set of objects organized in rows and columns.  The `Dataset`
implements the `List_Bean` interface and allows to iterate over its rows.
Each row defines a `Bean` instance and allows to access each column value.
Each column is associated with a unique name.  The row `Bean` allows to
get or set the column by using the column name.

```Ada
 with Util.Beans.Objects.Datasets;
 ...
    Set : Util.Beans.Objects.Datasets.Dataset_Access
        := new Util.Beans.Objects.Datasets.Dataset;
```

After creation of the dataset instance, the first step is to define
the columns that composed the list.  This is done by using the `Add_Column`
procedure:

```Ada
 Set.Add_Column ("name");
 Set.Add_Column ("email");
 Set.Add_Column ("age");
```

To populate the dataset, the package only provide the `Append` procedure
which adds a new row and calls a procedure whose job is to fill the columns
of the new row.  The procedure gets the row as an array of `Object`:

```Ada
 procedure Fill (Row : in out Util.Beans.Objects.Object_Array) is
 begin
    Row (Row'First) := To_Object (String '("Yoda"));
    Row (Row'First + 1) := To_Object (String '("Yoda@Dagobah"));
    Row (Row'First + 2) := To_Object (Integer (900));
 end Fill;
 Set.Append (Fill'Access);

```

The dataset instance is converted to an `Object` by using the `To_Object`
function.  Note that the default behavior of `To_Object` is to take
the ownership of the object and hence it will be released automatically.

```Ada
 List : Util.Beans.Objects.Object
    := Util.Beans.Objects.To_Object (Set);
```

## Object iterator
Iterators are provided by the `Util.Beans.Objects.Iterators` package.
The iterator instance is created by using either the `First` or `Last`
function on the object to iterate.

```Ada
with Util.Beans.Objects.Iterators;
...
   Iter : Util.Beans.Objects.Iterators.Iterator
      := Util.Beans.Objects.Iterators.First (Object);
```

The iterator is used in conjunction with its `Has_Element` function
and either its `Next` or `Previous` procedure.  The current element
is obtained by using the `Element` function.  When the object being
iterated is a map, a key can be associated with the element and
is obtained by the `Key` function.

```Ada
while Util.Beans.Objects.Iterators.Has_Element (Iter) loop
   declare
      Item : Object := Util.Beans.Objects.Iterators.Element (Iter);
      Key  : String := Util.Beans.Objects.Iterators.Key (Iter);
   begin
      ...
      Util.Beans.Objects.Iterators.Next (Iter);
   end;
end loop;
```

## Bean Interface
An Ada Bean is an object which implements the `Util.Beans.Basic.Readonly_Bean` or the
`Util.Beans.Basic.Bean` interface.  By implementing these interface, the object provides
a behavior that is close to the Java Beans: a getter and a setter operation are available.

repository: stcarrez/ada-util

gha_language: Ada

repo_name: stcarrez/ada-util


text:
---
title: Stdio
---

The object `stdio` is available from everywhere. *This will change in the
future. [Interacting with STDIO is IO and will be
isolated.](https://github.com/moonglum/halunke/issues/4)*

## `puts`

Prints the object to stdout. To determine how to represent the object, it will
send the `to_string` message to the object, expecting a string.

**Example:**

```
(stdio puts "Hello World")
(stdio puts 5.2)
(stdio puts @["a" 2 "b" 3])
(stdio puts ["a" "b"])
(stdio puts true)
(stdio puts false)
```

This will output:

```
Hello World
5.2
a 2
b 3
a
b
true
false
```

## `examine`

Prints the object to stdout for debugging. To determine how to represent the
object, it will send the `inspect` message to the object, expecting a string.

**Example:**

```
(stdio examine "Hello World")
(stdio examine 5.2)
(stdio examine @["a" 2 "b" 3])
(stdio examine ["a" "b"])
(stdio examine true)
(stdio examine false)
```

This will output:

```
"Hello World"
5.2
@["a" 2 "b" 3]
["a" "b"]
true
false
```

repository: moonglum/halunke

gha_language: Ruby

repo_name: moonglum/halunke


text:
---
layout: page
title: Chronic Healers
subtitle: Social Good!!!!
---

Our Team Name is Chronic Healers

- We want to analyse time series chronic patient data.
- We wish to generate something useful to help millions who are suffering.

What else do you need?

### Why is This Project Required?
Many people experience suffering chronic diseases and symptoms throughout their life. Chronic
symptoms usually need persistent management and keeping track of, since there is usually no
certain cure for them. Patients usually go through a long period of treatment with different
medications and remedies while tracking the effect.
Analysing and interpreting the relationships between symptoms, treatments, and the
environmental factors to find meaningful patterns can help doctors better understand the nature
of these diseases and better help the patients managing the symptoms.


text:
## Last Week's Accomplishments
Last week, Cameron and I were able to get the loop of Text Transformation, Link
Analysis, and Crawler up and running. These three components are the major back
end loop that scrapes the web and handles the links. Now, as Cameron works to
optimize that loop, I will start to get familiar with the other loop of
Indexing, and Ranking.

## This Week's Plan
This week I plan on becoming familiar with the other loop of the Indexing and
Ranking components. I hope to have them up and running by the end of next week.

## Anything Blocking?
Nope.

## Notes

repository: scfite/rcos-status-updates

repo_name: scfite/rcos-status-updates


text:
# Learning

* [The Zig Programming Language Documentation][documentation] is a great overview of all of the language features that Zig provides to those who use it.
* [Awesome Zig][awesome-zig] is a good collection of Zig projects made by various people. The collection features projects involving well developed Zig code.
* [Zig Launch][zig-launch] is a assortment of Zig examples that demonstrates very specific Zig features.
* [ZigLearn][zig-learn] is an excellent primer that explains the language features that Zig has to offer.
* [Zig SHOWTIME][zig-showtime] is a livestreamed show where members of the Zig community share code and ideas.

[awesome-zig]: https://github.com/nrdmn/awesome-zig
[documentation]: https://ziglang.org/documentation/master/
[zig-launch]: https://ziglaunch.org/
[zig-learn]: https://ziglearn.org/
[zig-showtime]: https://zig.show/

repository: kotp/zig

branch_name: refs/heads/main

repo_name: kotp/zig


text:
# Netdata Configuration

Configuration files are placed in `/etc/netdata`.

## Netdata Daemon

The daemon configuration file is read from `/etc/netdata/netdata.conf`.

In this file you can configure all aspects of netdata. Netdata provides configuration settings for plugins and charts found when started. You can find all these settings, with their default values, by accessing the URL `https://netdata.server.hostname:19999/netdata.conf`. For example check the configuration file of [netdata.firehol.org](http://netdata.firehol.org/netdata.conf).

The configuration file has sections stated with `[section]`. There will be the following sections:

1. `[global]` for global netdata daemon options
2. `[plugins]` for controlling which plugins the netdata will use
3. `[plugin:NAME]` one such section for each plugin enabled
4. `[CHART_NAME]` once such section for each chart defined

The configuration file is a `name = value` dictionary. Netdata will not complain if you set options unknown to it. When you check the running configuration by accessing the URL `/netdata.conf` on your netdata server, netdata will add a comment on settings it does not currently use.

### [global] section options

setting | default | info
:------:|:-------:|:----
hostname|auto-detected|The hostname of the computer running netdata.
history|3600|The number of entries the netdata daemon will by default keep in memory for each chart dimension. This setting can also be configured per chart. Check **[[Memory Requirements]]** for more information.
config directory|`/etc/netdata`|The directory configuration files are kept.
plugins directory|`/usr/libexec/netdata/plugins.d`|The directory plugin programs are kept. This setting supports multiple directories, space separated. If any directory path contains spaces, enclose it in single or double quotes.
web files directory|`/usr/share/netdata/web`|The directory the web static files are kept.
cache directory|`/var/cache/netdata`|The directory the memory database will be stored if and when netdata exits. Netdata will re-read the database when it will start again, to continue from the same point.
log directory|`/var/log/netdata`|The directory the log files are kept. Check **[[Log Files]]** for more information.
host access prefix|*empty*|This is used in docker environments where /proc, /sys, etc have to be accessed via another path. You may also have to set SYS_PTRACE capability on the docker for this work. Check [issue 43](https://github.com/firehol/netdata/issues/43).
debug flags|0x00000000|Bitmap of debug options to enable. For more information check **[[Tracing Options]]**.
memory deduplication (ksm)|yes|When set to `yes`, netdata will offer its in-memory round robin database to kernel same page merging (KSM) for deduplication. For more information check **[[Memory Deduplication - Kernel Same Page Merging - KSM]]**
debug log|`/var/log/netdata/debug.log`|The filename to save debug information. This file will not be created is debugging is not enabled. You can also set it to `syslog` to send the debug messages to syslog, or `none` to disable this log. For more information check **[[Tracing Options]]**.
error log|`/var/log/netdata/error.log`|The filename to save error messages for netdata daemon and all plugins (`stderr` is sent here for all netdata programs, including the plugins). You can also set it to `syslog` to send the errors to syslog, or `none` to disable this log.
access log|`/var/log/netdata/access.log`|The filename to save the log of web clients accessing netdata charts. You can also set it to `syslog` to send the access log to syslog, or `none` to disable this log.
memory mode|save|When set to `save` netdata will save its round robin database on exit and load it on startup. When set to `map` the cache files will be updated in real time (check `man mmap` - do not set this on systems with heavy load or slow disks - the disks will continuously sync the in-memory database of netdata). When set to `ram` the round robin database will be temporary and it will be lost when netdata exits.
update every|1|The frequency in seconds, for data collection. For more information see **[[Performance]]**.
run as user|`netdata`|The user netdata will run as.
web files owner|`netdata`|The user that owns the web static files. Netdata will refuse to serve a file that is not owned by this user, even if it has read access to that file. If the user given is not found, netdata will only serve files owned by user given in `run as user`.
http port listen backlog|100|The port backlog. Check `man 2 listen`.
default port|19999|The default port to listen for web clients.
bind to|`*`|The IP address and port to listen to. This is a space separated list of IPv4 or IPv6 address and ports. The default will bind to all IP addresses. Example: `bind to = <IP_ADDRESS>:19999 <IP_ADDRESS>:19998 [::1]:19999`.
disconnect idle web clients after seconds|60|The time in seconds to disconnect web clients after being totally idle.
enable web responses gzip compression|yes|When set to `yes`, netdata web responses will be GZIP compressed, if the web client accepts such responses.

##### netdata process priority

By default, netdata runs with the `idle` process scheduler, which assigns CPU resources to netdata, only when the system has such resources to spare.

The following `netdata.conf` settings control this:

```
[global]
    process scheduling policy = idle
    process scheduling priority = 0
    process nice level = 19
```

The policies supported by netdata are `idle` (the netdata default), `other` (also as `nice`), `batch`, `rr`, `fifo`. netdata also recognizes `keep` and `none` to keep the current settings without changing them.

For `other`, `nice` and `batch`, the setting `process nice level = 19` is activated to configure the nice level of netdata. Nice gets values -20 (highest) to 19 (lowest).

For `rr` and `fifo`, the setting `process scheduling priority = 0` is activated to configure the priority of the relative scheduling policy. Priority gets values 1 (lowest) to 99 (highest).

For the details of each scheduler, see `man sched_setscheduler` and `man sched`.

When netdata is running under systemd, it can only lower its priority (the default is `other` with `nice level = 0`). If you want to make netdata to get more CPU than that, you will need to set in `netdata.conf`:

```
[global]
    process scheduling policy = keep
```

and edit `/etc/systemd/system/netdata.service` and add:

```
CPUSchedulingPolicy=other | batch | idle | fifo | rr
CPUSchedulingPriority=99
Nice=-10
```

### [plugins] section options

In this section there will be a boolean (`yes`/`no`) option for each plugin. Additionally, there will be the following options:

setting | default | info
:------:|:-------:|:----
checks|no|This is a debugging plugin for the internal latency of netdata.
enable running new plugins|yes|When set to `yes`, netdata will enable plugins not configured specifically for them. Setting this to `no` will disable all plugins you have not set to `yes` explicitly.
check for new plugins every|60|The time in seconds to check for new plugins in the plugins directory. This allows having other applications dynamically creating plugins for netdata.

## Netdata Plugins

The configuration options for plugins appear in sections following the pattern `[plugin:NAME]`.

### Internal Plugins

Most internal plugins will provide additional options. Check **[[Internal Plugins]]** for more information.

### External Plugins

External plugins will have only 2 options at `netdata.conf`:

setting | default | info
:------:|:-------:|:----
update every|the value of `[global].update every` setting|The frequency in seconds the plugin should collect values. For more information check **[[Performance]]**.
command options|*empty*|Additional command line options to pass to the plugin.

External plugins that need additional configuration may support a dedicated file in `/etc/netdata`. Check their documentation.

---

## A note about netdata.conf

This config file is not needed by default. You can just touch it (to be empty) to get rid of the error message displayed when missing.

The whole idea came up when I was evaluating the documentation involved in maintaining a complex configuration system. My intention was to give configuration options for everything imaginable. But then, documenting all these options would require a tremendous amount of time, users would have to search through endless pages for the option they need, etc.

I concluded then that **configuring software like that is a waste for time and effort**. Of course there must be plenty of configuration options, but the implementation itself should require a lot less effort for both the devs and the users.

So, I did this:

1. No configuration is required to run netdata
2. There are plenty of options to tweak
3. There is minimal documentation (or no at all)

### Why this works?

The configuration file is a `name = value` dictionary with `[sections]`. Write whatever you like there as long as it follows this simple format.

Netdata loads this dictionary and then when the code needs a value from it, it just looks up the `name` in the dictionary at the proper `section`. In all places, in the code, there are both the `names` and their `default values`, so if something is not found in the configuration file, the default is used. The lookup is made using B-Trees and hashes (no string comparisons), so they are super fast. Also the `names` of the settings can be `my super duper setting that once set to yes, will turn the world upside down = no` - so goodbye to most of the documentation involved.

Next, netdata can generate a valid configuration for the user to edit. No need to remember anything. Just get the configuration from the server (`/netdata.conf` on your netdata server), edit it and save it.

Last, what about options you believe you have set, but you misspelled? When you get the configuration file from the server, there will be a comment above all `name = value` pairs the server does not use. So you know that whatever you wrote there, is not used.

### limiting access to netdata.conf

netdata v1.9+ limit by default access to `http://your.netdata.ip:19999/netdata.conf` to private IP addresses. This is controlled by this settings:

```
[web]
	allow netdata.conf from = localhost fd* 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
```

The IPs listed are all the private IPv4 addresses, including link local IPv6 addresses.

> Keep in mind that connections to netdata API ports are filtered by `[web].allow connections from`. So, IPs allowed by `[web].allow netdata.conf from` should also be allowed by `[web].allow connection from`.

## netdata simple patterns

Unix prefers regular expressions. But they are just too hard, too cryptic to use, write and understand.

So, netdata supports **simple patterns**. Simple patterns are a space separated list of words, that can have `*` as a wildcard. Each world may use any number of `*`. Simple patterns allow **negative** matches by prefixing a word with `!`.

So, `pattern = !*bad* *` will match anything, except all those that contain the word `bad`.

Simple patterns are quite powerful: `pattern = *foobar* !foo* !*bar *` matches everything containing `foobar` and except from strings that start with `foo` or end with `bar`, everything else.

You can use the netdata command line to check simple patterns, like this:

```sh
# netdata -W simple-pattern '*foobar* !foo* !*bar *' 'hello world'
RESULT: MATCHED - pattern '*foobar* !foo* !*bar *' matches 'hello world'

# netdata -W simple-pattern '*foobar* !foo* !*bar *' 'hello world bar'
RESULT: NOT MATCHED - pattern '*foobar* !foo* !*bar *' does not match 'hello world bar'

# netdata -W simple-pattern '*foobar* !foo* !*bar *' 'hello world foobar'
RESULT: MATCHED - pattern '*foobar* !foo* !*bar *' matches 'hello world foobar'
```

netdata stops processing to the first positive or negative match (left to right). If it is not matched by either positive or negative patterns, it is denied at the end.

## Applying changes

After `netdata.conf` has been modified, netdata needs to be restarted for changes to apply:

```bash
sudo service netdata restart
```

If the above does not work, try the following:

```bash
sudo killall netdata; sleep 10; sudo netdata
```

Please note that your data history will be lost if you have modified `history` parameter in section `[global]`.

repository: Seteco/Somorrostro

repo_name: Seteco/Somorrostro


text:
## Run the app

```bash
python tests/dashbio_demos/dash-manhattan-plot/app.py
```
Then navigate to `localhost:8050` in your web browser.

## Usage

There are 2 tabs in this app: About and Graph.

The About tab contains a general overview of the Manhattan Plot component.

In Graph tab you can specify threshold value and suggestive line.

## Documentation

Learn more about using Manhattan Plot with interactive examples in the
[Dash Bio docs](https://dash.plotly.com/dash-bio/manhattanplot).

## Manhattan Plot Properties Reference

- **dataframe** (dataframe; required): A pandas dataframe which must contain at least the following three columns: - the chromosome number - genomic base-pair position - a numeric quantity to plot such as a p-value or zscore

- **chrm** (string; default 'CHR'): A string denoting the column name for the chromosome. This column must be float or integer. Minimum number of chromosomes required is 1. If you have X, Y, or MT chromosomes, be sure to renumber these 23, 24, 25, etc.

- **bp** (string; default 'BP'): A string denoting the column name for the chromosomal position.

- **p** (string; default 'P'): A string denoting the column name for the float quantity to be plotted on the y-axis. This column must be numeric. It does not have to be a p-value. It can be any numeric quantity such as peak heights, Bayes factors, test statistics. If it is not a p-value, make sure to set logp = False.

- **snp** (string; default 'SNP'): A string denoting the column name for the SNP names (e.g., rs number). More generally, this column could be anything that identifies each point being plotted. For example, in an Epigenomewide association study (EWAS), this could be the probe name or cg number. This column should be a character. This argument is optional, however it is necessary to specify it if you want to highlight points on the plot, using the highlight argument in the figure method.

- **gene** (string; default 'GENE'): A string denoting the column name for the GENE names. This column could be a string or a float. More generally, it could be any annotation information that you want to include in the plot.

- **annotation** (string; optional): A string denoting the column to use as annotations. This column could be a string or a float. It could be any annotation information that you want to include in the plot (e.g., zscore, effect size, minor allele frequency).

- **logp** (bool; optional): If True, the -log10 of the p-value is plotted. It isn't very useful to plot raw p-values; however, plotting the raw value could be useful for other genome-wide plots (e.g., peak heights, Bayes factors, test statistics, other "scores", etc.)

- **title** (string; default 'Manhattan Plot'): The title of the graph.

- **showgrid** (bool; default true): Boolean indicating whether gridlines should be shown.

- **xlabel** (string; optional): Label of the x axis.

- **ylabel** (string; default '-log10(p)'): Label of the y axis.

- **point_size** (number; default 5): Size of the points of the Scatter plot.

- **showlegend** (bool; default true): Boolean indicating whether legends should be shown.

- **col** (string; optional): A string representing the color of the points of the scatter plot. Can be in any color format accepted by plotly.graph_objects.

- **suggestiveline_value** (bool | float; default 8): A value which must be either False to deactivate the option, or a numerical value corresponding to the p-value at which the line should be drawn. The line has no influence on the data points.

- **suggestiveline_color** (string; default 'grey'): Color of the suggestive line.

- **suggestiveline_width** (number; default 2): Width of the suggestive line.

- **genomewideline_value** (bool | float; default -log10(5e-8)): A boolean which must be either False to deactivate the option, or a numerical value corresponding to the p-value above which the data points are considered significant.

- **genomewideline_color** (string; default 'red'): Color of the genome-wide line. Can be in any color format accepted by plotly.graph_objects.

- **genomewideline_width** (number; default 1): Width of the genome-wide line.

- **highlight** (bool; default True): turning on/off the highlighting of data points considered significant.

- **highlight_color** (string; default 'red'): Color of the data points highlighted because they are significant. Can be in any color format accepted by plotly.graph_objects.

repository: plotly/dash-bio

gha_language: Python

repo_name: plotly/dash-bio


text:
---
title: Screen Orientation
description: Manage screen orientation settings in your Capacitor app
contributors:
  - mlynch
slug: /guides/screen-orientation
---

## Screen Orientation in your Capacitor App

Many apps work well in portrait and landscape device orientations. However, many don't, and there are good reasons to require an app to function solely or occasionally in one mode or the other.

## Global Orientation Settings

To set a global setting for orientation in your Capacitor app, you'll set the configuration value necessary for the platform you're targeting.

### iOS Configuration

iOS allows for different screen orientations to be supported on iPhones and iPads. To limit the allowed orientations for iOS, open Xcode and open the `Info.plist` file. Find the following keys: `Supported interface orientation` and `Supported interface orientation (iPad)`. Using these values, specify the different orientations you would like supported for iPhones and for iPads.

If editting the `Info.plist` file directly look for the following keys: `UISupportedInterfaceOrientations` and `UISupportedInterfaceOrientations~ipad`. For example, the following settings will limit the orientation to right-side-up `Portrait` on iPhones and either of the `Landscape` orientations on iPads:

```
  <key>UISupportedInterfaceOrientations</key>
  <array>
    <string>UIInterfaceOrientationPortrait</string>
  </array>
  <key>UISupportedInterfaceOrientations~ipad</key>
  <array>
    <string>UIInterfaceOrientationLandscapeRight</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
  </array>
```

### Android Configuration

On Android, orientation can be set by modifying the `AndroidManifest.xml` and setting `android:screenOrientation` on the `<activity>` entry for your main app activity. See the [Android Manifest Documentation](https://developer.android.com/guide/topics/manifest/activity-element#screen) for details on the possible entries.

## Dynamic Orientation Settings

Many apps need to support multiple orientations, with the ability to lock orientations occasionally depending on the content.

Capacitor supports this through the `cordova-plugin-screen-orientation` plugin:

```shell
npm install cordova-plugin-screen-orientation
npx cap update
```

Then, use the `lock` and `unlock` methods available on `window.screen.orientation`:

```typescript
window.screen.orientation.lock('portrait');
window.screen.orientation.lock('landscape');

// To unlock orientation which will default back to the global setting:
window.screen.orientation.unlock();
```

See the [Orientation Plugin Docs](https://cordova.apache.org/docs/v3/en/latest/reference/cordova-plugin-screen-orientation/) for the full range of possible orientation values and configuration options.

### iPad Orientation Lock

By default, an iPad allows Multitasking and its orientation cannot be locked. If you need to lock orientation on an iPad set the option `Requires Full Screen` to `YES` by adding the following to `Info.plist`:

```
	<key>UIRequiresFullScreen</key>
	<true/>
```

repository: ionic-jp/capacitor-docs

repo_name: ionic-jp/capacitor-docs


text:
# toolbox
A set of useful scripts

## See also

- [Powertools](https://github.com/seanthegeek/powertools/) - A set of useful PowerShell scripts

repository: seanthegeek/toolbox

repo_name: seanthegeek/toolbox


text:
# Enabling Hardware PWM on Raspberry Pi

If you want to use the hardware PWM capabilities of your Raspberry Pi, you will need to activate this feature. And if you want to run your code without elevated root privileged to access them, then, you'll as well need to make couple of modifications. This tutorial is her to help you activating the PWM and making sure you'll get the right permissions.

## Basic Hardware PWM code

The most simplest code you can build to use hardware PWM is the following:

```csharp
using System;
using System.Device.Pwm;

namespace TestTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello PWM!");
            var pwm = PwmChannel.Create(0, 0, 400, 0.5);
            pwm.Start();
            Console.ReadKey();
        }
    }
}
```

In this case ```PwmChannel.Create(0, 0, 400, 0.5)``` will create a hardware PWM chip 0 and PWM channel 0 with a frequency of 400 Hz and a duty time of 50%.

When you run the code, if you attached a simple led and a resistor on the physical pin 32, logical 12, you will see a led that will be half bright compare to the same led plugged on a 3.3V pin.

If you get an error message like this one, it means the hardware PWM has not been properly enabled:

```text
Hello PWM!
Unhandled exception. System.ArgumentException: The chip number 0 is invalid or is not enabled.
   at System.Device.Pwm.Channels.UnixPwmChannel.Validate()
   at System.Device.Pwm.Channels.UnixPwmChannel..ctor(Int32 chip, Int32 channel, Int32 frequency, Double dutyCycle)
   at System.Device.Pwm.PwmChannel.Create(Int32 chip, Int32 channel, Int32 frequency, Double dutyCyclePercentage)
   at TestTest.Program.Main(String[] args) in C:\tmp\TestTest\TestTest\Program.cs:line 12
Aborted
```

If you get an error message like the following one, it means that you don't have the permission, see the specific section below for this as well:

```text
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/sys/class/pwm/pwmchip0/export' is denied.
 ---> System.IO.IOException: Permission denied
```

## Enabling hardware PWM

In order to have the hardware PWM activated on the Raspberry Pi, you'll have to edit the /boot/config.txt file and add an overlay.

Main Raspberry Pi kernel documentation gives 2 possibilities. Either a [single channel](https://github.com/raspberrypi/linux/blob/04c8e47067d4873c584395e5cb260b4f170a99ea/arch/arm/boot/dts/overlays/README#L925), either a [dual channel](https://github.com/raspberrypi/linux/blob/04c8e47067d4873c584395e5cb260b4f170a99ea/arch/arm/boot/dts/overlays/README#L944).

Here are the possible options for each PWM channel:

| PWM | GPIO | Function | Alt | Exposed |
| --- | --- | --- | --- | --- |
| PWM0 | 12 | 4 | Alt0 | Yes |
| PWM0 | 18 | 2 | Alt5 | Yes |
| PWM0 | 40 | 4 | Alt0 | No |
| PWM0 | 52 | 5 | Alt1 | No |
| PWM1 | 13 | 4 | Alt0 | Yes |
| PWM1 | 19 | 2 | Alt5 | Yes |
| PWM1 | 41 | 4 | Alt0 | No |
| PWM1 | 45 | 4 | Alt0 | No |
| PWM1 | 53 | 5 | Alt1 | No |

Only accessible pin from this list on the Raspberry Pi pin out are GPIO 12, 18, 13 and 19. The other GPIO are not exposed.

### Activating only 1 channel

We have then 4 options for the exposed GPIO pins:

| PWM | GPIO | Function | Alt | dtoverlay |
| --- | --- | --- | --- | --- |
| PWM0 | 12 | 4 | Alt0 | dtoverlay=pwm,pin=12,func=4 |
| PWM0 | 18 | 2 | Alt5 | dtoverlay=pwm,pin=18,func=2 |
| PWM1 | 13 | 4 | Alt0 | dtoverlay=pwm,pin=13,func=4 |
| PWM1 | 19 | 2 | Alt5 | dtoverlay=pwm,pin=19,func=2 |

Edit the /boot/config.txt file and add the dtoverlay line in the file. You need root privileges for this:

```bash
sudo nano /boot/config.txt
```

Save the file with `ctrl + x` then `Y` then `enter`

Then reboot:

```bash
sudo reboot
```

You are all setup, the basic example should now work with the PWM and channel you have selected.

### Activating 2 channels

| PWM0 | PWM0 GPIO | PWM0 Function | PWM0 Alt |  PWM1 | PWM1 GPIO | PWM1 Function | PWM1 Alt | dtoverlay |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| PWM0 | 12 | 4 | Alt0 | PWM1 | 13 | 4 | Alt0 | dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4 |
| PWM0 | 18 | 2 | Alt5 | PWM1 | 13 | 4 | Alt0 | dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4 |
| PWM0 | 12 | 4 | Alt0 | PWM1 | 19 | 2 | Alt5 | dtoverlay=pwm-2chan,pin=12,func=4,pin2=19,func2=2 |
| PWM0 | 18 | 2 | Alt5 | PWM1 | 19 | 2 | Alt5 | dtoverlay=pwm-2chan,pin=18,func=2,pin2=19,func2=2 |

Edit the /boot/config.txt file and add the dtoverlay line in the file. You need root privileges for this:

```bash
sudo nano /boot/config.txt
```

Save the file with `ctrl + x` then `Y` then `enter`

Then reboot:

```bash
sudo reboot
```

You are all setup, the basic example should now work with the PWM and channel you have selected.

## Solving permission issues

When running the basic code, you may have a lack of permissions:

```text
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/sys/class/pwm/pwmchip0/export' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamWriter..ctor(String path)
   at System.IO.File.WriteAllText(String path, String contents)
   at System.Device.Pwm.Channels.UnixPwmChannel.Open()
   at System.Device.Pwm.Channels.UnixPwmChannel..ctor(Int32 chip, Int32 channel, Int32 frequency, Double dutyCycle)
   at System.Device.Pwm.PwmChannel.Create(Int32 chip, Int32 channel, Int32 frequency, Double dutyCyclePercentage)
   at TestTest.Program.Main(String[] args) in C:\tmp\TestTest\TestTest\Program.cs:line 12
Aborted
```

You have 2 options: running the code with root privileges or adding your user to the pwm group.

### Running code with root privileges

This is straight forward, you have to use ```sudo``` to run your application. Let's say your application is names ```yourapplication```, once in the same directory as your application, it will then be:

```bash
sudo ./yourapplication
```

### Adding your user to the right permission group

If you're running, or just upgraded to a version published after August 2020, this should be already done.
You will have to create a [specific group in udev](https://raspberrypi.stackexchange.com/questions/66890/accessing-pwm-module-without-root-permissions).

```bash
sudo nano /etc/udev/rules.d/99-com.rules
```

Add the following lines:

```text
SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\
        chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\
        chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\
'"
```

Save the file with `ctrl + x` then `Y` then `enter`

Then reboot:

```bash
sudo reboot
```

You are all setup, the basic example should now work with the PWM and channel you have selected.

repository: dotnet/iot

gha_language: C#

repo_name: dotnet/iot