text:
gago is a framework written in Go for running genetic algorithms

# Introduction

In a nutshell, a [genetic algorithm](https://www.wikiwand.com/en/Genetic_algorithm) (GA) solves an optimization problem by doing the following:

1. Generate random solutions.
2. Evaluate the solutions.
3. Sort the solutions according to their evaluation score.
4. Apply genetic operators following a model.
5. Repeat from step 2 until satisfied.

Genetic algorithms can be applied to many problems, the only variable being the problem itself. Indeed, the underlying structure does not have to change between problems. With this in mind, `gago` has been built to be applicable to many problems without having to re-write boilerplate code.

The following flowchart shows the steps the algorithms takes. As can be seen only the search for the best individual and the migration can't be parallelized.

This description is voluntarily vague as to how the genetic operators are applied. It's important to understand that there isn't a single way of applying genetic algorithms. For example some people believe that crossover is useless and use mutation for generating new individuals. Genetic operators are applied following a *model*, a fact that is often omitted in introductions to genetic algorithms.

## Terminology

## Philosophy

> TLDR: gago gives you the freedom to tweak every single part of a genetic algorithm.

## Usage

The following code shows a basic usage of `gago`.

```go
package main

import (
	"fmt"
	"math"

	"github.com/MaxHalford/gago/presets"
)

// Sphere function minimum is 0 reached in (0, ..., 0).
// Any search domain is fine.
func sphere(X []float64) float64 {
	sum := 0.0
	for _, x := range X {
		sum += math.Pow(x, 2)
	}
	return sum
}

func main() {
	// Instantiate a GA with 2 variables and the fitness function
	var ga = presets.Float(2, sphere)
	ga.Initialize()
	// Enhancement
	for i := 0; i < 10; i++ {
		ga.Enhance()
	}
	// Display the best obtained solution
	fmt.Printf("The best obtained solution is %f\n", ga.Best.Fitness)
}
```

The user has a function `Sphere` he wishes to minimize. He initiates a predefined set of parameters `presets.Float(2, sphere)`. Finally the user orders `gago` to find an appropriate solution with `ga.Enhance()`. By convention `gago` will try to **minimize** the fitness function. If instead you want to maximize a function `f(x)`, you can minimize `-f(x)`.

The nice thing thing is that the GA only requires a function and a number of variables, hence it can be used for minimizing any function as long the function outputs a floating point number (`float64` in Go). Because Go is a statically typed language and doesn't provide explicit generic types, the input type of the function has be handled. This is done using interfaces and is [documented further down](#using-different-types).

## Features

- Possibility to run many populations in parallel.
- Custom genetic operators are easy to implement, as described in the [contribution document](docs/CONTRIBUTING.md).
- Possibility to apply genetic operators under custom models.
- A modular approach makes it easy to switch GA parameters.
- Speciation operators to cluster individuals into similar groups, providing more efficient crossovers.

## Suggestions

- Please post suggestions/issues in GitHub's issues section.
- Check out the [contribution documentation](CONTRIBUTING.md) if you want to want to participate to `gago`.
- You can use the [reddit thread](https://www.reddit.com/r/golang/comments/43oi5j/gago_a_parallel_genetic_algorithm_with_go/) or my [email<EMAIL_ADDRESS>for comments/enquiries.

# Documentation

Don't forget to also check out [godoc](https://godoc.org/github.com/MaxHalford/gago) for a full list of accessible variables.

## Parameters

To modify the behavior off the GA, you can change the `gago.GA` struct before running `ga.Initialize`. You can either instantiate a new `gago.GA` or use a predefined one from the `configuration.go` file.

| Variable in the code   | Type                      | Description                                                      |
|------------------------|---------------------------|------------------------------------------------------------------|
| `NbPopulations`              | `int`                     | Number of Populations in the GA                               |
| `NbIndividuals`        | `int`                     | Number of individuals in each population                              |
| `Initializer` (struct) | `Initializer` (interface) | Method for initializing a new individual                        |
| `Model` (struct)    | `Model` (interface)    | Model for applying genetic operators |
| `Migrator` (struct)    | `Migrator` (interface)    | Method for exchanging individuals between the populations             |
| `MigFrequency`     | `int`     | Migration frequency                      |

The `gago.GA` struct also contains a `Best` variable which is of type `Individual`, it represents the best individual overall. The `Populations` variable is a slice containing each GA in the GA. The populations are sorted at each generation so that the first individual in each GA is the best individual for that specific GA.

`gago` is designed to be flexible. You can change every parameter of the algorithm as long as you implement functions that use the correct types as input/output. A good way to start is to look into the source code and see how the methods are implemented, I've made an effort to comment each and every one of them. If you want to add a new generic operator (initializer, selector, crossover, mutator, migrator), then you can simply copy and paste an existing method into your code and change the logic as you see fit. All that matters is that you correctly implement the existing interfaces.

If you wish to not use certain genetic operators, you can set them to `nil`. This is available for the `Mutator` and the `Migrator` (the other ones are part of the minimum requirements). Each operator contains an explanatory description that can be consulted in the [documentation](https://godoc.org/github.com/MaxHalford/gago).

## Using different types

Some genetic operators target a specific type, these ones are suffixed with the name of the type (`F` for `float64`, `S` for `string`). The ones that don't have suffixes work with any types, which is down to the way they are implemented.

You should think of `gago` as a framework for implementing your problems, and not as an all in one solution. It's quite easy to implement custom operators for exotic problems, for example the [TSP problem](examples/tsp/).

The only requirement for solving a problem is that the problem itself can be modeled as a function that returns a floating point value. Because Go is statically typed, you have to provide a [wrapper for the function](fitness.go) and make sure that the genetic operators make sense for your problem. The reasoning behing `gago` makes more sense once you start looking at the examples.

## Presets

For conveniency `gago` includes a set of [presets](presets/). For the while these serve the purpose of exemplifying possible configurations. Later on these could include state of the art sets of parameters based on battle testing on common problems. For examples it could be useful to tuning a preset for solving TSP problems.

## Advice

- Wrap multiple mutators into a single `Mutator` `struct` if you wish to apply multiple mutators, for an example see the [TSP preset](presets/tsp.go).
- Don't hesitate to add more populations if you have a multi-core machine, the overhead is very small.
- Consider the fact that most of the computation is for evaluating the fitness function.
- Increasing the number of selected parents (`NbParents`) during selection usually increases the convergence rate (which is not necessarily good, but is sometimes desired).
- Increasing the number of individuals per population (`NbIndividuals`) adds variety to the genetic algorithm, however it is more costly.
- You can access the GA's `duration` attribute or implement your own stopwatch to enhance the GA for a fixed duration.

## Examples

- Check out the [examples/minimization/](examples/math-functions/) folder for basic examples. Test functions were found [here](http://www.sfu.ca/~ssurjano/optimization.html).
- [examples/plot-fitness/](examples/plot-fitness/) is an example of plotting the fitness per generation with [gonum/plot](https://github.com/gonum/plot).
- [examples/curve-fitting/](examples/curve-fitting/) is an attempt to fit a set of points with non-linear polynomial function.
- [examples/tsp/](examples/tsp/) contain examples of solving the Traveling Salesman Problem.

repository: tomzhang/gago

repo_name: tomzhang/gago


text:
# Cross build icu4c for Android

This document shows how to cross-compile icu4c for Android (I use it to perform `multi-language words segmentation` in SQLite3), please read [the documentation](http://site.icu-project.org/home) to get more details about `icu`.

The directory **icu** contains the source code of icu4c (version 58.2.0), you can replace it with the version you want.

The directory **build** contains the build results, **build/host** is for host building, and **build/android/*[arch]*** contains the target build results for Android, *[arch]* is the target abi-architecture you want to build.

Currently only support linux* and darwin* OS.

# How to use

Just run the following commands:

```sh
$ chmod +x build_icu
$ ./build_icu <TARGET_ARCH>
```

**TARGET_ARCH** is the target abi-architecture you want to build, you can specify it with `arm` that corresponding to `armabi-v7a` or `arm64` that corresponding to `arm64-v8a`, the default is `arm`.

After all works done, you can find the libraries in the directory **build/andorid/[arch]/lib**.

Run `./build_icu -h` or `./build_icu --help` to show usages, and run `./build_icu -c` or `./build_icu --clean` to clear all build files.

# License

This project is under the [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)

```
Copyright 2018 Nano Michael

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

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

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

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
Snake JS with NLP
========
This is fork of the Snake JS repository with AWS LEX features.

Author and License
-----------
Originally Snake JS is written by [Didrik Nordström][2]. It is MIT licensed. Make sure to [follow the project on github][3].

[1]: http://en.wikipedia.org/wiki/Snake_(video_game)
[2]: http://betamos.se/
[3]: http://github.com/betamos/Snake-JS
[4]: http://betamos.se/bloggen/spela-snake-med-html5

license: MIT

repository: AntonyBaasan/Snake-JS-Fork

repo_name: AntonyBaasan/Snake-JS-Fork


text:
# QueryBuilder

QueryBuilder is a tool made to create and format SQL schemas based on their datatypes, though basic sanitization is
included in this library, you should use the driver's sanitizer when available.

This library provides an interface that allows Schema types to be translated into their best fitting database-specific
SQL datatypes and formatting.


text:
Properties store and manage data inside your Livewire components. They are defined as public properties on component classes and can be accessed and modified on both the server and client-side.

## Initializing properties

You can set initial values for properties within your component's `mount()` method.

Consider the following example:

```php
<?php

namespace App\Livewire;

use Illuminate\Support\Facades\Auth;
use Livewire\Component;

class TodoList extends Component
{
    public $todos = [];

    public $todo = '';

    public function mount()
    {
        $this->todos = Auth::user()->todos; // [tl! highlight]
    }

    // ...
}
```

In this example, we've defined an empty `todos` array and initialized it with existing todos from the authenticated user. Now, when the component renders for the first time, all the existing todos in the database are shown to the user.

## Bulk assignment

Sometimes initializing many properties in the `mount()` method can feel verbose. To help with this, Livewire provides a convenient way to assign multiple properties at once via the `fill()` method. By passing an associative array of property names and their respective values, you can set several properties simultaneously and cut down on repetitive lines of code in `mount()`.

For example:

```php
<?php

namespace App\Livewire;

use Livewire\Component;
use App\Models\Post;

class UpdatePost extends Component
{
    public $post;

    public $title;

    public $description;

    public function mount(Post $post)
    {
        $this->post = $post;

        $this->fill( // [tl! highlight]
            $post->only('title', 'description'), // [tl! highlight]
        ); // [tl! highlight]
    }

    // ...
}
```

Because `$post->only(...)` returns an associative array of model attributes and values based on the names you pass into it, the `$title` and `$description` properties will be initially set to the `title` and `description` of the `$post` model from the database without having to set each one individually.

## Data binding

Livewire supports two-way data binding through the `wire:model` HTML attribute. This allows you to easily synchronize data between component properties and HTML inputs, keeping your user interface and component state in sync.

Let's use the `wire:model` directive to bind the `$todo` property in a `TodoList` component to a basic input element:

```php
<?php

namespace App\Livewire;

use Livewire\Component;

class TodoList extends Component
{
    public $todos = [];

    public $todo = '';

    public function add()
    {
        $this->todos[] = $this->todo;

        $this->todo = '';
    }

    // ...
}
```

```blade
<div>
    <input type="text" wire:model="todo" placeholder="Todo..."> <!-- [tl! highlight] -->

    <button wire:click="add">Add Todo</button>

    <ul>
        @foreach ($todos as $todo)
            <li>{{ $todo }}</li>
        @endforeach
    </ul>
</div>
```

In the above example, the text input's value will synchronize with the `$todo` property on the server when the "Add Todo" button is clicked.

This is just scratching the surface of `wire:model`. For deeper information on data binding, check out our [documentation on forms](/docs/forms).

## Resetting properties

Sometimes, you may need to reset your properties back to their initial state after an action is performed by the user. In these cases, Livewire provides a `reset()` method that accepts one or more property names and resets their values to their initial state.

In the example below, we can avoid code duplication by using `$this->reset()` to reset the `todo` field after the "Add Todo" button is clicked:

```php
<?php

namespace App\Livewire;

use Livewire\Component;

class ManageTodos extends Component
{
    public $todos = [];

    public $todo = '';

    public function addTodo()
    {
        $this->todos[] = $this->todo;

        $this->reset('todo'); // [tl! highlight]
    }

    // ...
}
```

In the above example, after a user clicks "Add Todo", the input field holding the todo that has just been added will clear, allowing the user to write a new todo.

> [!warning] `reset()` won't work on values set in `mount()`
> `reset()` will reset a property to its state before the `mount()` method was called. If you initialized the property in `mount()` to a different value, you will need to reset the property manually.

## Supported property types

Livewire supports a limited set of property types because of its unique approach to managing component data between server requests.

Each property in a Livewire component is serialized or "dehydrated" into JSON between requests, then "hydrated" from JSON back into PHP for the next request.

This two-way conversion process has certain limitations, restricting the types of properties Livewire can work with.

### Primitive types

Livewire supports primitive types such as strings, integers, etc. These types can be easily converted to and from JSON, making them ideal for use as properties in Livewire components.

Livewire supports the following primitive property types: `Array`, `String`, `Integer`, `Float`, `Boolean`, and `Null`.

```php
class TodoList extends Component
{
    public $todos = []; // Array

    public $todo = ''; // String

    public $maxTodos = 10; // Integer

    public $showTodos = false; // Boolean

    public $todoFilter; // Null
}
```

### Common PHP types

In addition to primitive types, Livewire supports common PHP object types used in Laravel applications. However, it's important to note that these types will be _dehydrated_ into JSON and _hydrated_ back to PHP on each request. This means that the property may not preserve run-time values such as closures. Also, information about the object such as class names may be exposed to JavaScript.

Supported PHP types:
| Type | Full Class Name |
|------|-----------------|
| Collection | `Illuminate\Support\Collection` |
| Eloquent Collection | `Illuminate\Database\Eloquent\Collection` |
| Model | `Illuminate\Database\Model` |
| DateTime | `DateTime` |
| Carbon | `Carbon\Carbon` |
| Stringable | `Illuminate\Support\Stringable` |

Here's a quick example of setting properties as these various types:

```php
public function mount()
{
    $this->todos = collect([]); // Collection

    $this->todos = Todos::all(); // Eloquent Collection

    $this->todo = Todos::first(); // Model

    $this->date = new DateTime('now'); // DateTime

    $this->date = new Carbon('now'); // Carbon

    $this->todo = str(''); // Stringable
}
```

### Supporting custom types

Livewire allows your application to support custom types through two powerful mechanisms:

* Wireables
* Synthesizers

Wireables are simple and easy to use for most applications, so we'll explore them below. If you're an advanced user or package author wanting more flexibility, [Synthesizers are the way to go](/docs/synthesizers).

#### Wireables

Wireables are any class in your application that implements the `Wireable` interface.

For example, let's imagine you have a `Customer` object in your application that contains the primary data about a customer:

```php
class Customer
{
    protected $name;
    protected $age;

    public function __construct($name, $age)
    {
        $this->name = $name;
        $this->age = $age;
    }
}
```

Attempting to set an instance of this class to a Livewire component property will result in an error telling you that the `Customer` property type isn't supported:

```php
class ShowCustomer extends Component
{
    public Customer $customer;

    public function mount()
    {
        $this->customer = new Customer('Caleb', 29);
    }
}
```

However, you can solve this by implementing the `Wireable` interface and adding a `toLivewire()` and `fromLivewire()` method to your class. These methods tell Livewire how to turn properties of this type into JSON and back again:

```php
use Livewire\Wireable;

class Customer implements Wireable
{
    protected $name;
    protected $age;

    public function __construct($name, $age)
    {
        $this->name = $name;
        $this->age = $age;
    }

    public function toLivewire()
    {
        return [
            'name' => $this->name,
            'age' => $this->age,
        ];
    }

    public static function fromLivewire($data)
    {
        $name = $data['name'];
        $age = $data['age'];

        return new static($name, $age);
    }
}
```

Now you can freely set `Customer` objects on your Livewire components and Livewire will know how to convert these objects into JSON and back into PHP.

As mentioned earlier, if you want to support types more globally and powerfully, Livewire offers Synthesizers, its advanced internal mechanism for handling different property types. [Learn more about Synthesizers](/docs/synthesizers).

## Accessing properties from JavaScript

Because Livewire properties are also available in the browser via JavaScript, you can access and manipulate their JavaScript representations from [AlpineJS](https://alpinejs.dev/).

Alpine is a lightweight JavaScript library that is included with Livewire. Alpine provides a way to build lightweight interactions into your Livewire components without making full server roundtrips.

Internally, Livewire's frontend is built on top of Alpine. In fact, every Livewire component is actually an Alpine component under-the-hood. This means that you can freely utilize Alpine inside your Livewire components.

The rest of this page assumes a basic familiarity with Alpine. If you're unfamiliar with Alpine, [take a look at the Alpine documentation](https://alpinejs.dev/docs).

### Accessing properties

Livewire exposes a magic `$wire` object to Alpine. You can access the `$wire` object from any Alpine expression inside your Livewire component.

The `$wire` object can be treated like a JavaScript version of your Livewire component. It has all the same properties and methods as the PHP version of your component, but also contains a few dedicated methods to perform specific functions in your template.

For example, we can use `$wire` to show a live character count of the `todo` input field:

```blade
<div>
    <input type="text" wire:model="todo">

    Todo character length: <h2 x-text="$wire.todo.length"></h2>
</div>
```

As the user types in the field, the character length of the current todo being written will be shown and live-updated on the page, all without sending a network request to the server.

If you prefer, you can use the more explicit `.get()` method to accomplish the same thing:

```blade
<div>
    <input type="text" wire:model="todo">

    Todo character length: <h2 x-text="$wire.get('todo').length"></h2>
</div>
```

### Manipulating properties

Similarly, you can manipulate your Livewire component properties in JavaScript using `$wire`.

For example, let's add a "Clear" button to the `TodoList` component to allow the user to reset the input field using only JavaScript:

```blade
<div>
    <input type="text" wire:model="todo">

    <button x-on:click="$wire.todo = ''">Clear</button>
</div>
```

After the user clicks "Clear", the input will be reset to an empty string, without sending a network request to the server.

On the subsequent request, the server-side value of `$todo` will be updated and synchronized.

If you prefer, you can also use the more explicit `.set()` method for setting properties client-side. However, you should note that using `.set()` by default immediately triggers a network request and synchronizes the state with the server. If that is desired, then this is an excellent API:

```blade
<button x-on:click="$wire.set('todo', '')">Clear</button>
```

In order to update the property without sending a network request to the server, you can pass a third bool parameter. This will defer the network request and on a subsequent request, the state will be synchronized on the server-side:
```blade
<button x-on:click="$wire.set('todo', '', false)">Clear</button>
```

## Security concerns

While Livewire properties are a powerful feature, there are a few security considerations that you should be aware of before using them.

In short, always treat public properties as user input — as if they were request input from a traditional endpoint. In light of this, it's essential to validate and authorize properties before persisting them to a database — just like you would do when working with request input in a controller.

### Don't trust property values

To demonstrate how neglecting to authorize and validate properties can introduce security holes in your application, the following `UpdatePost` component is vulnerable to attack:

```php
<?php

namespace App\Livewire;

use Livewire\Component;
use App\Models\Post;

class UpdatePost extends Component
{
    public $id;
    public $title;
    public $content;

    public function mount(Post $post)
    {
        $this->id = $post->id;
        $this->title = $post->title;
        $this->content = $post->content;
    }

    public function update()
    {
        $post = Post::findOrFail($this->id);

        $post->update([
            'title' => $this->title,
            'content' => $this->content,
        ]);

        session()->flash('message', 'Post updated successfully!');
    }

    public function render()
    {
        return view('livewire.update-post');
    }
}
```

```blade
<form wire:submit="update">
    <input type="text" wire:model="title">
    <input type="text" wire:model="content">

    <button type="submit">Update</button>
</form>
```

At first glance, this component may look completely fine. But, let's walk through how an attacker could use the component to do unauthorized things in your application.

Because we are storing the `id` of the post as a public property on the component, it can be manipulated on the client just the same as the `title` and `content` properties.

It doesn't matter that we didn't write an input with `wire:model="id"`. A malicious user can easily change the view to the following using their browser DevTools:

```blade
<form wire:submit="update">
    <input type="text" wire:model="id"> <!-- [tl! highlight] -->
    <input type="text" wire:model="title">
    <input type="text" wire:model="content">

    <button type="submit">Update</button>
</form>
```

Now the malicious user can update the `id` input to the ID of a different post model. When the form is submitted and `update()` is called, `Post::findOrFail()` will return and update a post the user is not the owner of.

To prevent this kind of attack, we can use one or both of the following strategies:

* Authorize the input
* Lock the property from updates

#### Authorizing the input

Because `$id` can be manipulated client-side with something like `wire:model`, just like in a controller, we can use [Laravel's authorization](https://laravel.com/docs/authorization) to make sure the current user can update the post:

```php
public function update()
{
    $post = Post::findOrFail($this->id);

    $this->authorize('update', $post); // [tl! highlight]

    $post->update(...);
}
```

If a malicious user mutates the `$id` property, the added authorization will catch it and throw an error.

#### Locking the property

Livewire also allows you to "lock" properties in order to prevent properties from being modified on the client-side. You can "lock" a property from client-side manipulation using the `#[Locked]` attribute:

```php
use Livewire\Attributes\Locked;
use Livewire\Component;

class UpdatePost extends Component
{
    #[Locked] // [tl! highlight]
    public $id;

    // ...
}
```

Now, if a user tries to modify `$id` on the front end, an error will be thrown.

By using `#[Locked]`, you can assume this property has not been manipulated anywhere outside your component's class.

For more information on locking properties, [consult the Locked properties documentation](/docs/locked).

#### Eloquent models and locking

When an Eloquent model is assigned to a Livewire component property, Livewire will automatically lock the property and ensure the ID isn't changed, so that you are safe from these kinds of attacks:

```php
<?php

namespace App\Livewire;

use Livewire\Component;
use App\Models\Post;

class UpdatePost extends Component
{
    public Post $post; // [tl! highlight]
    public $title;
    public $content;

    public function mount(Post $post)
    {
        $this->post = $post;
        $this->title = $post->title;
        $this->content = $post->content;
    }

    public function update()
    {
        $this->post->update([
            'title' => $this->title,
            'content' => $this->content,
        ]);

        session()->flash('message', 'Post updated successfully!');
    }

    public function render()
    {
        return view('livewire.update-post');
    }
}
```

### Properties expose system information to the browser

Another essential thing to remember is that Livewire properties are serialized or "dehydrated" before they are sent to the browser. This means that their values are converted to a format that can be sent over the wire and understood by JavaScript. This format can expose information about your application to the browser, including the names and class names of your properties.

For example, suppose you have a Livewire component that defines a public property named `$post`. This property contains an instance of a `Post` model from your database. In this case, the dehydrated value of this property sent over the wire might look something like this:

```json
{
    "type": "model",
    "class": "App\Models\Post",
    "key": 1,
    "relationships": [].
}
```

As you can see, the dehydrated value of the `$post` property includes the class name of the model (`App\Models\Post`) as well as the ID and any relationships that have been eager-loaded.

If you don't want to expose the class name of the model, you can use Laravel's "morphMap" functionality from a service provider to assign an alias to a model class name:

```php
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Relations\Relation;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Relation::morphMap([
            'post' => 'App\Models\Post',
        ]);
    }
}
```

Now, when the Eloquent model is "dehydrated" (serialized), the original class name won't be exposed, only the "post" alias:

```json
{
    "type": "model",
    "class": "App\Models\Post", // [tl! remove]
    "class": "post", // [tl! add]
    "key": 1,
    "relationships": [].
}
```

### Eloquent constraints aren't preserved between requests

Typically, Livewire is able to preserve and recreate server-side properties between requests; however, there are certain scenarios where preserving values are impossible between requests.

For example, when storing Eloquent collections as Livewire properties, additional query constraints like `select(...)` will not be re-applied on subsequent requests.

To demonstrate, consider the following `ShowTodos` component with a `select()` constraint applied to the `Todos` Eloquent collection:

```php
<?php

namespace App\Livewire;

use Illuminate\Support\Facades\Auth;
use Livewire\Component;

class ShowTodos extends Component
{
    public $todos;

    public function mount()
    {
        $this->todos = Auth::user()
            ->todos()
            ->select(['title', 'content']) // [tl! highlight]
            ->get();
    }

    public function render()
    {
        return view('livewire.show-todos');
    }
}
```

When this component is initially loaded, the `$todos` property will be set to an Eloquent collection of the user's todos; however, only the `title` and `content` fields of each row in the database will have been queried and loaded into each of the models.

When Livewire _hydrates_ the JSON of this property back into PHP on a subsequent request, the select constraint will have been lost.

To ensure the integrity of Eloquent queries, we recommend that you use [computed properties](/docs/computed-properties) instead of properties.

Computed properties are methods in your component marked with the `#[Computed]` attribute. They can be accessed as a dynamic property that isn't stored as part of the component's state but is instead evaluated on-the-fly.

Here's the above example re-written using a computed property:

```php
<?php

namespace App\Livewire;

use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Computed;
use Livewire\Component;

class ShowTodos extends Component
{
    #[Computed] // [tl! highlight]
    public function todos()
    {
        return Auth::user()
            ->todos()
            ->select(['title', 'content'])
            ->get();
    }

    public function render()
    {
        return view('livewire.show-todos');
    }
}
```

Here's how you would access these _todos_ from the Blade view:

```blade
<ul>
    @foreach ($this->todos as $todo)
        <li>{{ $todo }}</li>
    @endforeach
</ul>
```

Notice, inside your views, you can only access computed properties on the `$this` object like so: `$this->todos`.

You can also access `$todos` from inside your class. For example, if you had a `markAllAsComplete()` action:

```php
<?php

namespace App\Livewire;

use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Computed;
use Livewire\Component;

class ShowTodos extends Component
{
    #[Computed]
    public function todos()
    {
        return Auth::user()
            ->todos()
            ->select(['title', 'content'])
            ->get();
    }

    public function markAllComplete() // [tl! highlight:3]
    {
        $this->todos->each->complete();
    }

    public function render()
    {
        return view('livewire.show-todos');
    }
}
```

You might wonder, why not just call `$this->todos()` as a method directly where you need to? Why use `#[Computed]` in the first place?

The reason is that computed properties have a performance advantage, since they are automatically cached after their first usage during a single request. This means you can freely access `$this->todos` within your component and be assured that the actual method will only be called once, so that you don't run an expensive query multiple times in the same request.

For more information, [visit the computed properties documentation](/docs/computed-properties).

repository: livewire/livewire

branch_name: refs/heads/main

gha_language: PHP

gha_license_id: MIT

repo_name: livewire/livewire


text:
# Contributing

Bug fixes and other contributions via pull request greatly welcomed!

This library relies on [goyacc](https://godoc.org/golang.org/x/tools/cmd/goyacc) and
[golex](https://godoc.org/modernc.org/golex) for parsing and evaluating datemath grammar.

To install, run:

* `go get golang.org/x/tools/cmd/goyacc modernc.org/golex`

After modifying either the `datemath.l` or `datemath.y` you can rerun `go generate`.

When in doubt on semantics of the library, [Elasticsearch's
implementation](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/common-options.html#date-math) should be
considered the canonical specification.

repository: vchain-us-mgmt/grafana

repo_name: vchain-us-mgmt/grafana


text:
# Random Node

Implement a binary tree class from scratch, which supports the following methods: insert, find, delete, and random. Where random returns a node from the tree uniformly at random.

repository: mcculleydj/rosetta-code

repo_name: mcculleydj/rosetta-code


text:
# _Ping Pong_

#### _Code Review Week 3, 08.18.2017_

#### By _**Mark Helt**_

## Description

_This webpage takes a number inputted by the user and displays a text version of the game Ping Pong on the page the length of the number inputted._

## Specs
| **Specification**                                     | **Input** | **Output**  |
|-------------------------------------------------------|-----------|-------------|
| Count to a specific number                            | 3         | [1, 2, 3]   |
| Numbers divisible by 3 are replaced with "ping"       | 3         | "ping"      |
| Numbers divisible by 5 are replaced with "pong"       | 5         | "pong"      |
| Numbers divisible by 15 are replaced with "ping-pong" | 15        | "ping-pong" |

## Setup

* _Open Web Browser._
* _type https://heltmm.github.io/ping-pong into url bar._
* _Or click this link: [Ping Pong](https://heltmm.github.io/ping-pong)_

## Known Bugs

_None_

## Support and contact details

_If you have any technical issues please contact me at_
<EMAIL_ADDRESS>
## Technologies Used

_HTML, CSS, Bootstrap, javascript, jquery_

### License

*This software is licensed under the MIT license.*

Copyright (c) 2016 **_Mark Helt_**

repository: heltmm/ping-pong

repo_name: heltmm/ping-pong


text:
# FUZZ-IEEE COMPETITION ON EXPLAINABLE ENERGY PREDICTION

This repository contains the experiments we performed for IEEE CIS Technical Challenge 2021 to compute the monthly energy consumption of 3248 homes, and explain the generated predictions.

# Instructions for Execution

Before executing the run_arima_catboost.sh command, make sure to download the below
files from: https://drive.google.com/drive/folders/12yNLdFA-PD7QUjCy2kthFWpSac8EU3B4?usp=sharing

1) Make sure the below files are available at the execution path.

* df_train.feather
* weekday_mean_season_imputed.csv
* df_test.feather
* all_temp_boostrap_median.cs

2) Run "./run_catboost.sh" bash script from the project base directory


text:
EASTER UPDATE
=================

Challenge is still incomplete. However, I have added a couple of tests for _game over_ when ```after 20 rolls, extra roll is not achieved``` and when ```after 21 rolls.extra roll is achieved```. Although the app now raises an error when player tries to knock down more than 10 pins, the incorrect number is **still added** to  ```this.rolls``` array. I also wrote a test for when player tries to take the score over 10 (e.g. roll 5 and then roll 6); the test passes, however, as per other test above, the wrong number of pin is **still added** to the ```this.rolls``` array.

I am yet to find a solution to these two issues. I have a feeling that the error for taking the score over 10 should be part of ```Game.prototype.roll``` instead of being part of ```Game.prototype.score```.

With regards to the interface, I am still having issues with _NaN_ values. By running the debugger, I noticed that the functions defined in ```Game.prototype.score``` (```isCheating()```, ```isStrike()```, ```isSpare()```, ```getStrikeScore()```, ```getSpareScore()``` and ```getNormalScore```) have a _ReferenceError: ...not defined_. Perhaps this could be something related to _NaN_?

Need to investigate further.

Bowling Challenge - INCOMPLETE
=================

```
As a bowling player,
So that I can record my score during a game,
I want to be able to record my score on a scorecard.

As a bowling player,
So that I can enter my score correctly,
I want to be able to see the possible number of pins left.

As a bowling player,
So that I can see strikes (X) and spares (/) displayed in the correct form,
I want those symbols to replace numbers and be shown on my scorecards, when applicable.

As a bowling player,
So that the score is accurate,
I want to see the total of a frame only after strikes and spare bonuses have been calculated.

As a bowling player,
So that I can start a new game,
I want to be able to play again.
```

Reflections
----
Despite the vast amount of research (and exercising) carried out over the week, this challenge proved that I still find JavaScript rather daunting. I tried to develop the task following [Robert C. Martin's presentation](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata) and a [YouTube tutorial](https://www.youtube.com/watch?v=-qA_MjNmpVU). I feel like I didn't really achieve much. Even if the few tests I wrote are passing, I believe there is something wrong in the code (e.g. _NaN_ messages when `console.log`ing `score()`. Hopefully, there will be some time during the week to discuss my concerns with classmates and coaches, to eventually try and improve the code next weekend.

Some positivity
----
- I am becoming more confident with writing user stories and modelling diagrams.
- Despite the complexity behind the score calculation, I will always enjoy playing bowling.

Resources
----
I have been fiddling with [this CSS style](http://jsfiddle.net/subskybox/Lk46gjkL/)

repository: antcin/bowling-challenge

repo_name: antcin/bowling-challenge


text:
# Description

Installs [PostGIS](http://postgis.refractions.net/).

## Platforms:

Tested on:

* Ubuntu 12.04

## Recipes:

* `default.rb` - Downloads, builds, and installs PostGIS from source. Adds a `template\_postgis` database template to your existing PostgreSQL installation.

## Attributes

* `node['postgis']['version']` - the version of PostGIS to use (default: "2.0.2").
* `node['postgis']['sql_folder']` - the directory where PostGIS installs its SQL files, somewhere inside `` `pg_config --sharedir`/contrib`` (default: "postgis-2.0").
* `node['postgis']['template_name']` - the name of the PostGIS template database to create (default: "template\_postgis").

Usage
=====

First, you'll need the [LIBXML2](https://github.com/tomlinton/chef-libxml2) [GEOS](https://github.com/pjungwir/chef-geos), [GDAL](https://github.com/pjungwir/chef-gdal), and [PROJ](https://github.com/pjungwir/chef-proj) cookbooks.
Then, put something like this in your node file:

    "geos": {
      "version": "3.3.6"
    },

    "gdal": {
      "version": "1.9.2"
    },

    "proj": {
      "version": "4.8.0"
    },

    "postgis": {
      "version": "2.0.2"
    },

    "run_list": [
      // ...
      "recipe[libxml2]",
      "recipe[geos]",
      "recipe[gdal]",
      "recipe[proj]",
      "recipe[postgresql::server]",
      "recipe[postgis]"
      // ...
    ]

You'll also need to install PostgreSQL itself before PostGIS, but I assume you've already got a cookbook for that or will have no trouble finding/writing one. This PostGIS cookbook won't do it for you. Note that if you installed Postgres using [the Opscode cookbook](https://github.com/opscode-cookbooks/postgresql) on Ubuntu, you'll need to do this somewhere before the postgis recipe:

    package 'postgresql-server-dev-9.1'

Or you can set the `node['postgresql']['server']['packages']` attribute to include that package.

Author
======

Author:: Paul A. Jungwirth<EMAIL_ADDRESS>
Some code taken from [Osiloke Harold Emoekpere](https://github.com/osiloke/chef-postgis).

License
=======

Copyright:: 2013, Illuminated Computing Inc.

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

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

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

repository: BNOTIONS/chef-postgis

repo_name: BNOTIONS/chef-postgis


text:
## Creating a Service Level Objective (SLO)

> ⚠ If the Katacoda Editor interface does not show the `datadog_slo.tf` file, please click the <i class="fa fa-sync"></i> Refresh button.

---

Let's create a Service Level Objective (SLO) using our synthetics check we just set up.

Please check out the Terraform code for the Datadog SLO:

> `datadog_slo.tf`{{open}}

We are going to shoot to have four nines of availability (ex. 99.99% uptime) which is about 4.38 minutes of downtime allowed each month.

Please plan and apply, accordingly.

`terraform plan -out="step10.tfplan"`{{execute}}

`terraform apply "step10.tfplan"`{{execute}}

Let's have a look at this in the list of [Datadog SLOs](https://app.datadoghq.com/slo).

repository: ksatirli/katacoda-scenarios

gha_language: HCL

repo_name: ksatirli/katacoda-scenarios


text:
# demo-adonis
Throwaway-project that I used to learn AdonisJS. It's a simple back-end service that models employees belonging to a department.

It uses MariaDB in a Docker container. It can be started by `scripts/mariadb.sh` after changing `.env.example` to `.env`.

Useful shell commands:

| Use | Command |
|-----|---------|
| Run migrations | `node ace migration:run` |
| Run seeders | `node ace db:seed` |
| Run tests | `node -r @adonisjs/assembler/build/register japaFile.ts` |
| Run development server | `node ace serve --watch` |
| Compile for production | `node ace build --production` |

IntelliJ run configurations are available for the above commands.

license: Unlicense

repository: achimett/demo-adonis

repo_name: achimett/demo-adonis


text:
---
url: /support
---

# Support Options

## Public Forum

Auth0 offers support for __all__ subscribers. All customers, even on free accounts, can use our public [discussion forum](https://ask.auth0.com) to search existing questions and receive support from our engineers if their question has not already been asked.

## Support Center

Additionally, paid subscribers can create a private ticket via [Support Center](https://support.auth0.com). All account administrators will be able to view and add comments to Support Center tickets. Support Center can be accessed by clicking on the **Get Support** link on the [dashboard](${manage_url}).

[Learn more about creating tickets with Support Center](/support/tickets)

### Ticket Response Times

Ticket response times will vary based on your support plan (shown below).  Note that customers on non-paying trial or free subscriptions are not eligible for a support plan and should utilize the discussion forum. Non-paying customers may still raise a private ticket via the Support Center however there is no support response SLA and tickets will be answered on a best effort basis after prioritization of paying subscribers' tickets, generally resulting in a 2-5+ business day response.

       Developer Support Plan
       Standard Support Plan (legacy**)
       Platinum Support Plan
       Premiere Support Plan

      Ticket Prioritization
      Lowest
      Standard
      High
      Prioritized

       Support Hours
       Standard: M-F 7am-7pm (local timezone) / Critical Outage: M-F 7am-pm (PST)
       Standard: M-F 7am-7pm (local timezone) / Critical Outage: M-F 7am-pm (local timezone)
       Standard: M-F 7am-7pm (local timezone) / Critical Outage: 24x7x365
       Standard: M-F 7am-7pm (local timezone) / Critical Outage: 24x7x365

      First Response Time Target
      2-5+ Business Days
      2 Business Days
      Standard: 4 business hours / Critical Outage: 1 hour
      Standard: 1 business hours / Critical Outage: 1 hour

      Subsequent Response Time Target
      Best Effort after paid subscriptions
      Standard: 16 business hours / Critical Outage: ongoing within support hours
      Standard: 8 business hours / Critical Outage: ongoing within support hours
      Standard: 4 business hours / Critical Outage: ongoing within support hours

      Discussion Forum
      Yes
      Yes
      Yes
      Yes

      Ticketed Support
      Limited - Best effort
      Yes
      Yes
      Yes

      Ticket Response Channels
      Support forum, Support Center
      Support forum, Support Center
      Support forum, Support Center, chat, web conference
      Support forum, Support Center, chat, web conference

      Onboarding Experience
      Self-service in app and email
      Self-service in app and email
      Sprint Onboarding
      Sprint Premier Onboarding

      Ongoing Customer Success Engagement
      none
      none
      Customer Success Team
      Allocated Success Manager

### Ticket Severity

Standard: Defined as an Auth0 issue impacting your live or in-production systems or your ability to progress to production where:

- Business processes and functions are degraded;
- A group or groups of users are impacted;
- There is a reasonable workaround;
- Application is not yet in live, production status.

Critical: Defined as an Auth0 issue severely impacting your live or in-production systems where:

- Major business processes and functions are stopped for all or most users;
- Majority of users are significantly impacted, for example: unable to log in;
- There is no workaround;
- Application is in live, production status.

Critical Production issues should always be reported via the Support Center for fastest response.

Every effort will be made to respond sooner than the times listed above. However, some types of problems such as development issues that require us to install software to duplicate a problem, may take time due to the research and work required.

If you have specific support requirements or are interested in the __Platinum Support__ or __Premiere Support__ option, please [contact sales](https://auth0.com/?contact=true).

repository: PaulBuilds/docs

repo_name: PaulBuilds/docs


text:
---
bodyclass: docs
headline: C# Quick Start
layout: docs
sidenav: doc-side-quickstart-nav.html
type: markdown
---

C# Quickstart

This guide gets you started with gRPC in C# with a simple
working example.

## Before you begin

### Prerequisites

Whether you're using Windows, OS X, or Linux, you can follow this
example by using either an IDE and its build tools,
or by using the the .NET Core SDK command line tools.

First, make sure you have installed the
[gRPC C# prerequisites](https://github.com/grpc/grpc/blob/{{ site.data.config.grpc_release_tag }}/src/csharp/README.md#prerequisites).
You will also need Git to download the sample code.

## Download the example

You'll need a local copy of the example code to work through this quickstart.
Download the example code from our GitHub repository (the following command
clones the entire repository, but you just need the examples for this quickstart
and other tutorials):

```sh
$ # Clone the repository to get the example code:
$ git clone -b {{ site.data.config.grpc_release_tag }} https://github.com/grpc/grpc
$ cd grpc
```

This document will walk you through the "Hello World" example.
The projects and source files can be found in the `examples/csharp/Helloworld` directory.

The example in this walkthrough already adds the necessary
dependencies for you (Grpc, Grpc.Tools and Google.Protobuf NuGet packages).

## Build the example

### Using Visual Studio (or Visual Studio for Mac)
* Open the solution `Greeter.sln` with Visual Studio
* Build the solution

### Using .NET Core SDK from the command line
From the `examples/csharp/Helloworld` directory:

```
> dotnet build Greeter.sln
```

*NOTE: If you want to use gRPC C# from a project that uses the old-style .csproj files (supported by Visual Studio 2013, 2015 and older versions of Mono), please refer to the
[Greeter using legacy .csproj](https://github.com/grpc/grpc/blob/{{ site.data.config.grpc_release_tag }}/examples/csharp/HelloworldLegacyCsproj/README.md) example.*

## Run a gRPC application

From the `examples/csharp/Helloworld` directory:

* Run the server

```
> cd GreeterServer
> dotnet run -f netcoreapp2.1
```

* In another terminal, run the client

```
> cd GreeterClient
> dotnet run -f netcoreapp2.1
```

Congratulations! You've just run a client-server application with gRPC.

## Update a gRPC service

Now let's look at how to update the application with an extra method on the
server for the client to call. Our gRPC service is defined using protocol
buffers; you can find out lots more about how to define a service in a `.proto`
file in [gRPC Basics: C#][]. For now all you need to know is that both the
server and the client "stub" have a `SayHello` RPC method that takes a
`HelloRequest` parameter from the client and returns a `HelloResponse` from the
server, and that this method is defined like this:

```
// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}
```

Let's update this so that the `Greeter` service has two methods. Edit
`examples/protos/helloworld.proto` and update it with a new `SayHelloAgain`
method, with the same request and response types:

```
// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply) {}
  // Sends another greeting
  rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}
```

(Don't forget to save the file!)

## Generate gRPC code

Next we need to update the gRPC code used by our application to use the new service definition.

The `Grpc.Tools` NuGet package contains the protoc and protobuf C# plugin binaries you will need to generate the code.

### Obtaining the Grpc.Tools NuGet package

This example project already depends on the `Grpc.Tools.{{ site.data.config.grpc_release_tag | remove_first: "v" }}` NuGet package
and the package will be downloaded to your local NuGet cache as soon as you restore the nuget packages by clicking "Restore NuGet Packages" in Visual Studio or running `dotnet restore RouteGuide.sln` from the `examples/csharp/RouteGuide` directory.

### Commands to generate the gRPC code
Note that you may have to change the `platform_architecture` directory names (e.g. windows_x86, linux_x64) in the commands below based on your environment.

From the `examples/csharp/Helloworld` directory:

**Windows**

```
@rem Local nuget cache on Windows is located in %UserProfile%\.nuget\packages
> %UserProfile%\.nuget\packages\grpc.tools\{{ site.data.config.grpc_release_tag | remove_first: "v" }}\tools\windows_x86\protoc.exe -I../../protos --csharp_out Greeter --grpc_out Greeter ../../protos/helloworld.proto --plugin=protoc-gen-grpc=%UserProfile%\.nuget\packages\grpc.tools\{{ site.data.config.grpc_release_tag | remove_first: "v" }}\tools\windows_x86\grpc_csharp_plugin.exe
```

**Linux (or OS X by using macosx_x64 directory)**
Note:
protoc-gen-grpc plugin requires fullpath of "grpc_csharp_plugin" executable instead of short form with "~" symbol. Make sure to change <HOME_FOLDER phrase in below command according to your local machine.

```
# Local nuget cache on Linux and Mac is located in ~/.nuget/packages
$ ~/.nuget/packages/grpc.tools/{{ site.data.config.grpc_release_tag | remove_first: "v" }}/tools/linux_x64/protoc -I../../protos --csharp_out Greeter --grpc_out Greeter ../../protos/helloworld.proto --plugin=protoc-gen-grpc=${HOME}/.nuget/packages/grpc.tools/{{ site.data.config.grpc_release_tag | remove_first: "v" }}/tools/linux_x64/grpc_csharp_plugin
```

Running the appropriate command for your OS regenerates the following files in
the directory:

* Greeter/Helloworld.cs contains all the protocol buffer code to populate,
  serialize, and retrieve our request and response message types
* Greeter/HelloworldGrpc.cs provides generated client and server classes,
  including:
    * an abstract class Greeter.GreeterBase to inherit from when defining
      Greeter service implementations
    * a class Greeter.GreeterClient that can be used to access remote Greeter
      instances

## Update and run the application

We now have new generated server and client code, but we still need to implement
and call the new method in the human-written parts of our example application.

### Update the server

With the `Greeter.sln` open in your IDE, open `GreeterServer/Program.cs`.
Implement the new method by editing the GreeterImpl class like this:

```
class GreeterImpl : Greeter.GreeterBase
{
    // Server side handler of the SayHello RPC
    public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
    {
        return Task.FromResult(new HelloReply { Message = "Hello " + request.Name });
    }

    // Server side handler for the SayHelloAgain RPC
    public override Task<HelloReply> SayHelloAgain(HelloRequest request, ServerCallContext context)
    {
        return Task.FromResult(new HelloReply { Message = "Hello again " + request.Name });
    }
}
```

### Update the client

With the same `Greeter.sln` open in your IDE, open `GreeterClient/Program.cs`.
Call the new method like this:

```
public static void Main(string[] args)
{
    Channel channel = new Channel("<IP_ADDRESS>:50051", ChannelCredentials.Insecure);

    var client = new Greeter.GreeterClient(channel);
    String user = "you";

    var reply = client.SayHello(new HelloRequest { Name = user });
    Console.WriteLine("Greeting: " + reply.Message);

    var secondReply = client.SayHelloAgain(new HelloRequest { Name = user });
    Console.WriteLine("Greeting: " + secondReply.Message);

    channel.ShutdownAsync().Wait();
    Console.WriteLine("Press any key to exit...");
    Console.ReadKey();
}
```

### Rebuild the modified example

Rebuild the newly modified example just like we first built the original
example by running `dotnet build Greeter.sln`.

### Run!

Just like we did before, from the `examples/csharp/Helloworld` directory:

* Run the server

```
> cd GreeterServer
> dotnet run -f netcoreapp2.1
```

* In another terminal, run the client

```
> cd GreeterClient
> dotnet run -f netcoreapp2.1
```

## What's next

- Read a full explanation of how gRPC works in [What is gRPC?](../guides/)
  and [gRPC Concepts](../guides/concepts.html)
- Work through a more detailed tutorial in [gRPC Basics: C#][]
- Explore the gRPC C# core API in its [reference
  documentation](/grpc/csharp/api/Grpc.Core.html)

[helloworld.proto]:../protos/helloworld.proto
[gRPC Basics: C#]:../tutorials/basic/csharp.html


text:
# clld-glottologfamily-plugin

[clld](https://github.com/clld/clld) plugin, adding language families from
[Glottolog](http://glottolog.org) to a *clld* app to allow for better navigation and
visualization.

[![Build Status](https://github.com/clld/clld-glottologfamily-plugin/workflows/tests/badge.svg)](https://github.com/clld/clld-glottologfamily-plugin/actions?query=workflow%3Atests)
[![codecov.io](http://codecov.io/github/clld/clld-glottologfamily-plugin/coverage.svg?branch=master)](http://codecov.io/github/clld/clld-glottologfamily-plugin?branch=master)
[![PyPI](https://img.shields.io/pypi/v/clld-glottologfamily-plugin.svg)](https://pypi.python.org/pypi/clld-glottologfamily-plugin)

## Usage

To equip a `Language` model with a family relation, the model should inherit from
`clld_glottologfamily_plugin.models.HasFamilyMixin`. This relation can be populated upon
database initialization calling `clld_glottologfamily_plugin.util.load_families`.

The families assigned in this way have an associated icon which can be used as map marker.
To make this easier, a custom `IMapMarker` may inherit from
`clld_glottologfamily_plugin.util.LanguageByFamilyMapMarker`.

Associated `DataTable` columns suitable for tables listing `Language` objects can be
used as follows:

```python
from clld.web.datatables.language import Languages
from clld_glottologfamily_plugin.datatables import FamilyCol, MacroareaCol
from clld_glottologfamily_plugin.models import Family

from models import CustomLanguage

class LanguagesWithFamily(Languages):
    def base_query(self, query):
        return query.outerjoin(Family)  # note: isolates will have no related family!

    def col_defs(self):
        res = Languages.col_defs(self)
        res.append(MacroareaCol(self, 'macroarea', language_cls=CustomLanguage))
        res.append(FamilyCol(self, 'family', language_cls=CustomLanguage))
        return res
```

### Assigning families

1. Family information is retrieved from Glottolog, based on the `id` attribute of a
language. This will only work if `id` is either a glottocode or an ISO 639-3 code.

2. If no related family is found, `None` will be assigned - rather than a dummy *isolates*
family or individual one-member families derived from the language.

repository: clld/clld-glottologfamily-plugin

gha_language: Python

repo_name: clld/clld-glottologfamily-plugin


text:
This is a python script to check the current PNR status in Indian Railways using INDRAIL API

# running the script
install the required modules

open the terminal in same directory and run

  ```
   pip install -r requirements.txt
  ```

after that run the script and enter the pnr no. when prompted to get the details

# Note
if the script doesn't work pls check if you have entered your API key which can be generated by

visiting the website
# https://indianrailapi.com/

create your account and generate your api key and replace it in the script

repository: goodgodth/Automation-scripts

repo_name: goodgodth/Automation-scripts


text:
# BoilerplateMVP
MVP boilerplate code to start a project. It has all required base classes and codes with dependency injection

## Library Used
* Dagger (Dependency Injection)
* RxJava and RxAndroid
* OkHttp
* Data Binding
* Retrofit
* Room Database
* Stetho
* Gson

repository: sub-rat/BoilerplateMVP

repo_name: sub-rat/BoilerplateMVP


text:
# Note
In case anyone finds this - this is nowhere near ready to use as a demo.

# Raspberry Pi Nodejs GPIO Control
Ubuntu Core 18 ships with the ability to allow a fully confied (`confinement: strict`) snap to control the GPIO pins of Raspberry Pi 2/3 devices. This is accomplished with a set of snapd interfaces.

This snap establishes connections to these interfaces, and allows one to execute commands that interact with these pins through Nodejs scripts.

## Ubuntu Core 18 Setup
Set up Ubuntu Core 18 on your raspberry pi [https://www.ubuntu.com/download/iot/raspberry-pi-2-3](https://www.ubuntu.com/download/iot/raspberry-pi-2-3)

## Interface Management & Connections
This snap's connection to the GPIO interface is accomplished with the `snap connect` command. [See documentation](https://docs.snapcraft.io/interface-management/6154).
```
snap connect <snap>:<plug interface> <snap>:<slot interface>
```

# Installation
This will walk you through installing this snap on a Raspberry Pi running Ubuntu Core 18 with test commands to demonstrate that it is working correctly.

_See here for [instructions to install Ubuntu Core 18 on Raspberry Pi](https://www.ubuntu.com/download/iot/raspberry-pi-2-3)._

## Test On A Multipass Virtual Machine
This can be helpful for testing on MacOS since it's not as straight forward as testing your snap on Ubuntu.

Create a Linux virtual machine for testing snaps
```
multipass launch -n testvm
```

Copy the .snap file to the virtual machine
```
multipass copy-files *.snap testvm:
```

Connect to the virtual machine
```
multipass shell testvm
```

Install the snap inside the virtual machine
```
sudo snap install --dangerous *.snap
```

Confirm the snap is installed by listing your installed snaps
```
snap list
```

Perform a curl command inside the virtual machine - this will return output from the nodejs script
```
raspberry-pi-node-gpio
```

Exit the virtual machine
```
exit
```

## Other Helpful Commands
Copy a directory containing a snap project to a remote destination via ssh (for remote building, since we can't build armhf on an amd64 system)
```
scp -i <key_location> -r <source_directory> <username>@<ip_address>:<remote_directory>
```

Example
```
scp -i ~/Documents/ssh_keys/raspberrypi/raspberrypi -r ~/repos/snaps/raspberry-pi-node-gpio mdrideout@<IP_ADDRESS>:build-snap
```

Check on service status
```
systemctl status snap.<snap_name>.<app_or_service_name>.service
```
Example:
```
systemctl status snap.raspberry-pi-node-gpio.init-scripts.service
```

Other Dump Data
```
journalctl -xe
```

repository: mdrideout/raspberry-pi-node-gpio

repo_name: mdrideout/raspberry-pi-node-gpio


text:
---
layout: posts
title:  "Best practices"
categories: [git]
tags: [git]
---

Be a good developer, follow the guideline.

## Commit early and often

Git only takes full responsibility for your data when you commit.    Additionally, having periodic checkpoints means
that you can understand how you broke something.

People resist this out of some sense that this is ugly, limits
`git-bisect`ion functionality, is confusing to observers, and might
lead to accusations of stupidity.  Well, I'm here to tell you that
resisting this is ignorant.  *Commit Early And Often*.  If, after you
are done, you want to pretend to the outside world that your work
sprung complete from your mind into the repository in utter perfection
with each concept fully thought out and divided into individual
concept-commits, well git supports that: see Sausage Making below.
However, don't let tomorrow's beauty stop you from performing
continuous commits today.

Personally, I commit early and often and then let the sausage making
be seen by all except in the most formal of circumstances.  Just look
at the history of this gist!

## Don't panic

As long as you have committed your work (or in many cases even added
it with `git add`) your work will not be lost for at least two weeks
unless you really work at it (run commands which manually purge it).

When attempting to find your lost commits, first make *sure* you will
not lose any current work.  You should commit or stash your current
work before performing any recovery efforts which might destroy your
current work.  After finding the commits you can reset, rebase,
cherry-pick, merge, or otherwise do what is necessary to get the
commit history and work tree you desire.

There are three places where "lost" changes can be hiding. They might be
in the reflog (`git log -g`), they might be in lost&found (`git fsck
--unreachable`), or they might have been stashed (`git stash list`).

* reflog

    The reflog is where you should look first and by default.  It
    shows you each commit which modified the git repository.  You can
    use it to find the commit name (SHA-1) of the state of the
    repository before (and after) you typed that command.  While you
    are free to go through the reflog manually, you can also visualize
    the repository using the following command (Look for dots without
    children and without green labels):

```bash
    gitk --all --date-order $(git log -g --pretty=%H)
```

* Lost and found

    Commits or other git data which are no longer reachable though any
    reference name (branch, tag, etc) are called "dangling" and may be
    found using fsck.  There are legitimate reasons why objects may be
    dangling through standard actions and normally over 99% of them are
    entirely uninteresting for this reason.

    * Dangling Commit

    These are the most likely candidates for finding lost data.  This can happen due to resets and rebases and are
    normal. `git show SHA` will let you inspect them.

    The following command helps you visualize these dangling
    commits. Look for dots without children and without green labels.

```bash
    gitk --all --date-order $(git fsck --no-reflog | grep "dangling commit" | awk '{print $3;}')
```

* Dangling Blob

A dangling blob is a file which was not attached to a commit. This
is often caused by `git add`s which were superceded before commit
or merge conflicts. Inspect these files with

```bash
    git show SHA
```

* Dangling Tree

A dangling tree is a directory tree of files that was not attached
to a commit. These are rarely interesting, and often caused by
merge conflicts. Inspect these files with `git ls-tree -r SHA`

* Stashes

    Finally, you may have stashed the data instead of committing it and
    then forgotten about it.  You can use the `git stash list` command
    or inspect them visually using:

```bash
    gitk --all --date-order $(git stash list | awk -F: '{print $1};')
```

* Misplaced

    Another option is that your commit is not lost.  Perhaps the
    commit was just made on a different branch from what you remember.
    Using `git log -Sfoo --all` and `gitk --all --date-order` to try
    and hunt for your commits on known branches.

* Look elsewhere

    Finally, you should check your backups, testing copies, ask the other
    people who have a copy of the repo, and look in other repos.

## Useful commit messages

Creating insightful and descriptive commit messages is one of the best
things you can do for others who use the repository.  It lets people
quickly understand changes without having to read code.  When doing
history archeology to answer some question, good commit messages
likewise become very important.

The normal git rule of using the first line to provide a short (72
character) summary of the change is also very good.  Looking at the
output of `gitk` or `git log --oneline` might help you understand why.

 In fact, if you try git shortlog, instead
  of git log, you will see a long list of commit messages, consisting
  of the id of the commit, and the summary only.

* Limit the subject line to 50 characters and Wrap the body at 72 characters.

> Commits should be as fine-grained and focused as possible, it is
  not the place to be verbose. [read more...](https://medium.com/@preslavrachev/what-s-with-the-50-72-rule-8a906f61f09c)

* Capitalize the subject line.
* Do not end the subject line with a period.
* Use [imperative mood](https://en.wikipedia.org/wiki/Imperative_mood) in the subject line.

> Rather than writing messages that say what a committer has done.
  It's better to consider these messages as the instructions for what
  is going to be done after the commit is applied on the repository.
  [read more...](https://news.ycombinator.com/item?id=2079612)

* Use the body to explain **what** and **why** as opposed to **how**.

## Keeping up to date

This section has some overlap with workflow.  Exactly how and when you
update your branches and repositories is very much associated with the
desired workflow.  Also I will note that not everyone agrees with
these ideas (but they should!)

* Pulling with --rebase

Whenever I pull, under most circumstances I `git pull --rebase`. This
is because I like to see a linear history (my commit came after all
commits that were pushed before it, instead of being developed in
parallel).  It makes history visualization much simpler and `git
bisect` easier to see and understand.

Some people argue against this because the non-final commits may lose
whatever testing those non-final commits might have had since the
deltas would be applied to a new base.  This in turn might make
git-bisect's job harder since some commits might refer to broken
trees, but really this is only relevant to people who want to hide the
sausage making.  Of course to really hide the sausage making you
should still rebase (and test the intermediate commits, if any).

* Rebasing (when possible)

Whenever I have a private branch which I want to update, I use rebase
(for the same reasons as above).  History is clean and simple.
However, if you share this branch with other people, rebasing is
rewriting public history and should/must be avoided.  You may only
rebase commits that no-one else has seen (which is why `git pull
--rebase` is safe).

* Merging without speeding

`git merge` has the concept of fast-forwarding, or realizing that the
code you are trying to merge in is identical to the result of the code
after the merge.  Thus instead of doing work, creating new commits,
etc, git simply changes the branch pointers (fast forwards them) and
calls it good.

This is good when doing `git pull` but not so good when doing `git
merge` with a non-@{u} (upstream) branch.  The reason this is not good
is because it loses information.  Specifically it loses track of which
branch is the first parent and which is not.  If you don't ever want
to look back into history, then it does not matter.  However, if you
might want to say "which branch was this commit originally committed
onto," if you use fast-forwarding that question is impossible to
answer since git will pick one branch or the other (the first parent
or second parent) as the one which both branches activities were
performed on and the other (original) parent's branch will be
anonymous.  There are typically worse things in the world, but you
lose information that is not recoverable in any other way by a
repository observer and in my book that is bad.  Use `git merge
--no-ff`


text:
# mycorrhiza_tree_diversity

This repository contains the custom code to replicate the analyses published in Carteron Alexis, Vellend Mark and Laliberté Etienne. Mycorrhizal dominance reduces local tree species diversity across US forests. Preprint: https://doi.org/10.1101/2<IP_ADDRESS>7902. Published article: https://doi.org/10.1038/s41559-021-01634-6.

For this study, we used publicly available data from the U.S. Department of Agriculture Forest Service, known as the Forest Inventory and Analysis (FIA) program. Data can be accessed from https://apps.fs.usda.gov/fia/datamart/CSV/datamart_csv.html. For more information see https://www.fia.fs.fed.us/library/database-documentation/index.php.
Mycorrhizal types for each tree species was determined using a published database available at https://doi.org/10.4231/R76D5R7S.

The scripts are ordered in this way:
- `import.R` (for accessing the data)
- `manipulation.R` (for processing the data)
- `modeling.R` (for modeling)
- `null_model.R` (for the null model approach)
- `figure.R` (for the figures)

In this repository, there are in addition the `README.md` (this file) and `sessionInfo.md` for more information about R, package and OS versions.


text:
<!-- paginate: true -->

# Notes

TO DO

- Add interaction instructions for console
- Finish part 4

---

## 3rd-party Libraries

This extension uses [Disconnect Tracking Services list](https://github.com/disconnectme/disconnect-tracking-protection) and the following libraries:

```
https://github.com/juliangarnier/anime/blob/3.2.0/lib/anime.min.js
https://github.com/jquery/jquery/releases/tag/3.6.0
https://github.com/cure53/DOMPurify/releases/tag/2.3.4
```
<small>^These are the official release URLs for Firefox Addon review</small>

## CHANGELOG

2022-Jan-08
- Remove Google Analytics
- Adds DOMPurify https://github.com/cure53/DOMPurify
- Updates libraries

repository: sneakaway-studio/explode-the-web

gha_language: HTML

repo_name: sneakaway-studio/explode-the-web


text:
# Contribution and Maintenance notes

## Contributing

Pull Requests and issue reports are very welcome!

If you are unsure whether something would make a good contribution (or you aren't sure how to
tackle something), feel free to either open an issue to solicit feedback or chat with us at
[`#nrf-rs:matrix.org`]. This is preferred over opening a big PR that might then not get merged.

If a Pull Request has not been reviewed for a long time, feel free to ping the maintainers.

## Release process

In order to release a new version of the PACs, the following steps need to be performed:

* **Changelog**: Update [the changelog](./CHANGELOG.md) to list all notable changes under the `Unreleased`
  section.
  * You can use GitHub's "compare" feature to view all commits added since the last release. Go to
    <https://github.com/nrf-rs/nrf-pacs/releases/>, select the latest release, and click the link
    "N commits to master since this release".
* **Version Bump**: Determine whether the next release contains breaking changes. This informs what
  kind of version bump is needed (minor vs. major). Then, bump the crate version in
  `Cargo.toml` accordingly. Do not commit the result, that will be done in the next step.
* **Publish**: Run `cargo xtask publish`. This will:
  * Bump the changelog, replacing the "Unreleased" section with one for the current version.
  * Create a commit and tag for the release.
  * Run `cargo publish` on each PAC.
* **Pull Request**: Open a Pull Request with the changes and merge it once CI passes.
* **GitHub Release**: Go to <https://github.com/nrf-rs/nrf-pacs/releases> and click the tag you just
  pushed. Click *Edit Tag* and paste the changelog entries for the new version (no *Release Title*
  is necessary). Click *Publish Release*.
* **Announcement**: Post a link to the GitHub release in [`#nrf-rs:matrix.org`] and any other places
  you'd like to announce it.

[`#nrf-rs:matrix.org`]: https://matrix.to/#/#nrf-rs:matrix.org

repository: nrf-rs/nrf-pacs

gha_language: Rust

repo_name: nrf-rs/nrf-pacs


text:
Ray Tracer
==========

This project is a ray tracer written in *Rust* by Tobias Faller.

The ray tracer currently features:

 - Boxes, spheres, planes and models stored in .obj files
 - Animation of objects
 - Phong illumination model
 - *PNG*, *JPEG* and *Y4M* image / video export

Feel free to clone / fork and use the source code as you like.

See [Advanced Computer Graphics](https://cg.informatik.uni-freiburg.de/teaching.htm) for course material and more information.

Dependencies
------------

The libraries are downloaded automatically by cargo but are listed here for completeness:

 - [image](https://crates.io/crates/image) (MIT)
 - [log](https://crates.io/crates/log) (MIT/Apache-2.0)
 - [rand](https://crates.io/crates/rand) (MIT/Apache-2.0)
 - [scoped_threadpool](https://crates.io/crates/scoped_threadpool) (MIT)
 - [time](https://crates.io/crates/time) (MIT/Apache-2.0)
 - [vecmath](https://crates.io/crates/vecmath) (MIT)
 - [y4m](https://crates.io/crates/y4m) (MIT)


text:
---
version: v1.8.0
---

# Protecting namespaces

You can define namespaces to be used in your cluster. If they don't exist, Helmsman will create them for you.

You can also define certain namespaces to be protected using the `protected` field. Please check [this doc](../misc/protect_namespaces_and_releases.md) for details about what protection means and the difference between namespace-level and release-level protection.

```toml
#...

[namespaces]
[namespaces.staging]
[namespaces.production]
  protected = true

#...
```

```yaml

namespaces:
  staging:
  production:
    protected: true

```

The example above will create two namespaces; staging and production. Where Helmsman sees the production namespace as a protected namespace.

repository: Praqma/helmsman

gha_language: Go

repo_name: Praqma/helmsman


text:
The Greek letter $ \omega $ (lower case) or $ \Omega $ (upper case),
equivalent in sound to the flat English o, as in ’coal’.


text:
todo.md
-------

Generate a todo.md file based on TODO comments in your git repo.

Add as a git hook to automatically update the todo.md file every time you
commit!

Usage
=====

    todo.md.sh - generate a todo file based on your code
      -h - display this help
      -l - LIVE MODE this will add the generated file to your staged changes.
           Use this in the git hook. Off by default for playing around in the terminal
      -o - print output to STDOUT
      -f - write to this file (defaults to todo.md and path starts at the repo's root)
      -t - text to search for (defaults to TODO)
      -e - exclude pattern
      -i - include pattern

Examples
========

## Vanilla
	todo.md.sh
Finds all records matching "TODO", and generates a file in the repo root titled
``todo.md``. Does ***NOT*** add this file to your repo's staged changes.

## Different Search Term
	todo.md.sh -t FIXME
Finds all records matching "FIXME", and generates a file called ``todo.md``.

## Print to Screen
	todo.md.sh -o
Finds all records matching "TODO" and prints to ``STDOUT``.

## Custom File
	todo.md.sh -f please_fix_me.txt
Finds all records matching "TODO" and writes them to the repo root in a file
named ``please_fix_me.txt``. You can also provide a path here, and it will write
to that path, starting from the repo root. IE ``todo.md.sh -f static/todo.md``
will write the output to a file called ``$repo_root/static/todo.md``.

## LIVE MODE
	todo.md.sh -l
Finds all "TODO" records, writes them to todo.md, **and stages todo.md for the
next** ``git commit``.

## LIVE MODE + STDOUT
	todo.md.sh -o -l
This will print a message to ``STDERR`` telling you this doesn't work, and
ignores LIVE MODE, running as if only ``-o`` was passed. To reiterate: using
``-o`` and ``-l`` ***will not*** stage anything.

Exclusion/Inclusion
===================
## Exclude Pattern(s)
    todo.md.sh -e css
Don't print anything containing the string "css". (This includes .css filename
**and** any lines in the code mentioning "css".)

    todo.md.sh -e css -e js
Don't print "css" or "js" lines.

## Include Pattern(s)
    todo.md.sh -i py
*Only* print lines matching "py" (Again, includes "py" in filename **and** in
comments.)

    todo.md.sh -i py -i css
*Only* print lines matching "py" *or* "css".

---

-i and -e can't be used together.

-i and -e values are passed to ``egrep``, so any pattern that will work with
``egrep`` should work with ``todo.md.sh``. See ``man egrep`` for advanced
patterns.

Adding the git hook
===================

If you want this file to be auto-generated every time you commit, add this to
``.git/hooks/pre-commit``:

	path/to/todo/script/todo.md.sh -l

You can pass any options **other than -o and -h** to this command. However, if
you want the todo.md file itself to be inclued in the commit automatically, you
**must** include ``-l`` (and **not** ``-o``).

### You probably don't want to do this for HUGE repos, or it will significantly slow down the amount of time it takes to run ``git commit``.

### Make sure ***both*** ``todo.md.sh`` ***and*** ``.git/hooks/pre-commit`` have executable permissions or todo.md.sh won't work inside the hook.


text:
+++
date = "2020-03-10T00:00:00Z"
title = "Executive Visibility with Yvonne Wassenaar, CEO of Puppet"
type = "podcast"
hero = ""
metadescription = "The EnterpriseReady Podcast is a show aiming to change the enterprise software narrative from how to sell to the enterprise, to how to build for the enterprise."
pagetitle = "Yvonne Wassenaar, CEO of Puppet - EnterpriseReady Podcast | BUILDING the world’s best enterprise software"
ogimage = "/podcast/images/podcast_og.png"
image = "/podcast/images/episodes/yvonne-wassenaar.jpg"
weight = "20"
+++

{{< soundcloud soundcloud-url="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/717532729&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true" >}}

\
In episode 20 of EnterpriseReady, Grant is joined by Yvonne Wassenaar, CEO of Puppet. They discuss her experience serving on boards of enterprise software companies, transitioning from a single product company to multiple products, and the role of professional services.

[Yvonne Wassenaar](https://twitter.com/ytechdata) is a seasoned C-level executive with broad experience scaling, diversifying, and transforming businesses throughout the Americas, Europe, and Asia. She is currently the CEO of [Puppet](https://puppet.com/), and an advisor at [Snyk](https://snyk.io/).

repository: enterpriseready/enterpriseready

repo_name: enterpriseready/enterpriseready


text:
### Meetup #2

__When:__ Tuesday, 28th of June, 19:00

__Where:__ [IDEIAhub, Av. D. Joao II Nº35 11ºA, Lisboa, Portugal](https://maps.google.com/maps?f=q&hl=en&q=Av.+D.+Joao+II+N%C2%BA35+11%C2%BAA%2C+Lisboa+%2C+pt)

__Speakers:__

1. [Duarte Henriques](https://twitter.com/duartehenriques), topic: Automated Testing Challenges, [presentation](https://github.com/sardinesrb/meetup/files/457777/automated-testing-c.1.pdf)

2. [Paulo Pereira](https://twitter.com/odesassossegado), topic: Development is Production, [presentation](https://github.com/sardinesrb/meetup/files/457776/sardines.rb2.-.20160628.-.development.is.production.pdf)

__Sponsors:__ [Equal Experts](https://www.equalexperts.com/) (catering), [IDEIAhub](https://www.ideiahub.pt/) (location)

repository: sardinesrb/meetup

repo_name: sardinesrb/meetup


text:
# kafka-perfbeat

This script uses `kafka-producer-perf-test.sh` and `kafka-consumer-perf-test.sh` from Apache Kafka distribution to send producer and consumer metrics to Datadog.
It creates a topic `kafka.auto_create_topics_enable` with replication factor = (# of nodes - 1) to replicate data to all nodes in the cluster,
then produces records with `acks=al` to capture perfmance metrics and detect any issues to in-sync replicas in every other nodes.

## Requirement

- `../scripts/dd-custom-metric.sh` is requied for sending custom metrics to Datadog
- `avn` CLI
- `jq`
- `java`
- kafka release from [here](https://kafka.apache.org/downloads)
- 1 Kafka service running on Aiven with `kafka.auto_create_topics_enable` enabled.

## Usage

Replace corresponding project, service names and set desired values in `kafka-perfbeat.env`

```bash
./kafka-perfbeat.sh producer
```

```bash
./kafka-perfbeat.sh consumer
```

repository: aiven/aiven-examples

repo_name: aiven/aiven-examples


text:
# Rutgers-332-452-Group-11-Project

**This is the project repository of Group #11**

Rutgers University Software Engineering class, spring 2018

### Attention:

**This is repository for daily updating, not for any submission activity!**

please check our DemoFile repository for more detail at [DemoFiles](https://github.com/YaochengTong/DemoFiles)

gha_language: Java


text:
A simple GeoIP API proxy for OS Monitor [![Build Status](https://drone.io/github.com/eolwral/proxy-whoisapi/status.png)](https://drone.io/github.com/eolwral/proxy-whoisapi/latest)
==============

### Introduction

This is a sub-project of OS Monitor to build a proxy server which improves speed and security for GeoIP API query, because every query is a HTTPS request that pass through a server, user's IP and information is hidden, the query result will be cached for 1 week, if anyone query same IP, the result can be reused.

### How it works?

The Architecture

       +-------+      +-------+       +-------+
       | Nginx | ==>  |  API  | <==>  | Redis |
       +-------+      +-------+       +-------+
                         ||
                      +-----------------+
                      | External GeoAPI |
                      +-----------------+

- API is written by Go, it gets information from external GeoAPI and push new query result into Redis.
- Nginx is running as an SSL termination and reversed proxy, ([Strong Encryption](https://www.ssllabs.com/ssltest/analyze.html?d=osmonitor.mobi))
- Redis is a database to keep data for 1 week.

### Is it free ?
Don't worry! I use donation to keep server's running, that costs $5 US per month, SSL certificate and domain cost $10.97 US, the current donation already can support 1 year.

If you would like to support this server, you still can donate. :)

[![Donate using PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D9NDEKVA8WE3A "Donate using PayPal")

repository: eolwral/proxy-whoisapi

repo_name: eolwral/proxy-whoisapi


text:
# evoqsocialinvite

DNN Evoq Social Invitation and Registration

Project Description

Evoq Social Invitation and Registration is a DNN Social module that allows users to invite others to join the social community and provides a registration code to track their registration. This module was built as a tutorial to teach how to integrate with the
 DNN Social framework in 3 ways:

Game Mechanics Scoring: adding scoring definitions to allow administrators to assign points to module actions. In this example, we have two custom scoring actions: InvitationSent (sending an invitation) and InvitationUsed (the recipient registered as a
 result of the user's invitation)

Activity Stream: Actions of inviting a user is logged in the Journal or Activity stream to show a history record of the user's activity.

Notifications and notification actions: A user receives a social notification when a recipient he invited registers using the registration code from the invitation email. A Friend Request action is attached to that notification that allows the user to request
 his invite recipient to be his friend

Video Tutorial

I have the free video/blog of this tutorial up on my site for version 1.0, click
here.

repository: DotNetNuclear/evoqsocialinvite

repo_name: DotNetNuclear/evoqsocialinvite


text:
# jBC Runtime

<PageHeader />

| <!----> | <!----> |
| --- | --- |
| [Running jBC programs](./running-jbc-programs/README.md) | Launching jBASE executables |
| [Options](./jbc-run-time-options/README.md) | Run time options for jBASE executables |

Back to [Knowledgebase](./../README.md)

<PageFooter />

repository: josepheshaw/docs

repo_name: josepheshaw/docs


text:
# Theme Source

This page is based on [ swcool/landing-page-theme ](https://github.com/swcool/landing-page-theme)

## License
The contents of this repository are licensed under the [Apache
2.0](http://www.apache.org/licenses/LICENSE-2.0.html).


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

# Release versions

Note that `master` is generally a work in progress, and you probably want to use a
tagged release version.

# Quick start

This is a lightweight C++ option parser library, supporting the standard GNU
style syntax for options.

Options can be given as:

    --long
    --long=argument
    --long argument
    -a
    -ab
    -abc argument

where c takes an argument, but a and b do not.

Additionally, anything after `--` will be parsed as a positional argument.

## Basics

```cpp
#include <cxxopts.hpp>
```

Create a `cxxopts::Options` instance.

```cpp
cxxopts::Options options("MyProgram", "One line description of MyProgram");
```

Then use `add_options`.

```cpp
options.add_options()
  ("d,debug", "Enable debugging") // a bool parameter
  ("i,integer", "Int param", cxxopts::value<int>())
  ("f,file", "File name", cxxopts::value<std::string>())
  ("v,verbose", "Verbose output", cxxopts::value<bool>()->default_value("false"))
  ;
```

Options are declared with a long and an optional short option. A description
must be provided. The third argument is the value, if omitted it is boolean.
Any type can be given as long as it can be parsed, with operator>>.

To parse the command line do:

```cpp
auto result = options.parse(argc, argv);
```

To retrieve an option use `result.count("option")` to get the number of times
it appeared, and

```cpp
result["opt"].as<type>()
```

to get its value. If "opt" doesn't exist, or isn't of the right type, then an
exception will be thrown.

Note that the result of `options.parse` should only be used as long as the
`options` object that created it is in scope.

## Exceptions

Exceptional situations throw C++ exceptions. There are two types of
exceptions: errors defining the options, and errors when parsing a list of
arguments. All exceptions derive from `cxxopts::OptionException`. Errors
defining options derive from `cxxopts::OptionSpecException` and errors
parsing arguments derive from `cxxopts::OptionParseException`.

All exceptions define a `what()` function to get a printable string
explaining the error.

## Help groups

Options can be placed into groups for the purposes of displaying help messages.
To place options in a group, pass the group as a string to `add_options`. Then,
when displaying the help, pass the groups that you would like displayed as a
vector to the `help` function.

## Positional Arguments

Positional arguments can be optionally parsed into one or more options.
To set up positional arguments, call

```cpp
options.parse_positional({"first", "second", "last"})
```

where "last" should be the name of an option with a container type, and the
others should have a single value.

## Default and implicit values

An option can be declared with a default or an implicit value, or both.

A default value is the value that an option takes when it is not specified
on the command line. The following specifies a default value for an option:

```cpp
cxxopts::value<std::string>()->default_value("value")
```

An implicit value is the value that an option takes when it is given on the
command line without an argument. The following specifies an implicit value:

```cpp
cxxopts::value<std::string>()->implicit_value("implicit")
```

If an option had both, then not specifying it would give the value `"value"`,
writing it on the command line as `--option` would give the value `"implicit"`,
and writing `--option=another` would give it the value `"another"`.

Note that the default and implicit value is always stored as a string,
regardless of the type that you want to store it in. It will be parsed as
though it was given on the command line.

## Boolean values

Boolean options have a default implicit value of `"true"`, which can be
overridden. The effect is that writing `-o` by itself will set option `o` to
`true`. However, they can also be written with various strings using `=value`.
There is no way to disambiguate positional arguments from the value following
a boolean, so we have chosen that they will be positional arguments, and
therefore, `-o false` does not work.

## `std::vector<T>` values

Parsing of list of values in form of an `std::vector<T>` is also supported, as long as `T`
can be parsed. To separate single values in a list the definition `CXXOPTS_VECTOR_DELIMITER`
is used, which is ',' by default. Ensure that you use no whitespaces between values because
those would be interpreted as the next command line option. Example for a command line option
that can be parsed as a `std::vector<double>`:

~~~
--my_list=1,-2.1,3,4.5
~~~

## Custom help

The string after the program name on the first line of the help can be
completely replaced by calling `options.custom_help`. Note that you might
also want to override the positional help by calling `options.positional_help`.

## Example

Putting all together:
```cpp
int main(int argc, char** argv)
{
    cxxopts::Options options("test", "A brief description");

    options.add_options()
        ("b,bar", "Param bar", cxxopts::value<std::string>())
        ("d,debug", "Enable debugging", cxxopts::value<bool>()->default_value("false"))
        ("f,foo", "Param foo", cxxopts::value<int>()->default_value("10"))
        ("h,help", "Print usage")
    ;

    auto result = options.parse(argc, argv);

    if (result.count("help"))
    {
      std::cout << options.help() << std::endl;
      exit(0);
    }
    bool debug = result["debug"].as<bool>();
    std::string bar;
    if (result.count("bar"))
      bar = result["bar"].as<std::string>();
    int foo = result["foo"].as<int>();

    return 0;
}
```

# Linking

This is a header only library.

# Requirements

The only build requirement is a C++ compiler that supports C++11 features such as:

* regex
* constexpr
* default constructors

GCC >= 4.9 or clang >= 3.1 with libc++ are known to work.

The following compilers are known not to work:

* MSVC 2013

# TODO list

* Allow unrecognised options.

repository: projectchrono/chrono

repo_name: projectchrono/chrono


text:
# **Finding Lane Lines on the Road**

---

**Finding Lane Lines on the Road**

The goals / steps of this project are the following:
* Make a pipeline that finds lane lines on the road
* Reflect on your work in a written report

[//]: # (Image References)

[image1]: ./test_images_output/final_solidWhiteRight.jpg "Final Solid White Right"
[image2]: ./test_images_output/pipeline.jpg "Pipeline Solid White Curve"

---

### Reflection

### 1. Describe your pipeline. As part of the description, explain how you modified the draw_lines() function.

My pipeline consisted of following steps.
1. Extracting only white and yellow colors from the image. This was achieved by converting image to HSV color space and masking the color range.
This was especially needed for optional challenge wherein the left solid yellow line was not being detected if this step was skipped.
2. Converting image to grayscale
3. Applying Gaussian Blur to remove noise (kernel size=7)
4. Apply canny edge detection (low_threshold=100 & low_threshold=150)
5. Apply region of interest mask
6. Apply Hough tranform (rho=1, theta=1 radian, threshold=25, min_line_length=5, max_line_gap=2)
7. Identify if the line segments belong to left line or right line based on slope. Draw the left and right lines by averaging the slope and intercept of left line and right lines.
8. Draw the lines on the original image

Image transformation as it passes through the pipeline

![pipeline image][image2]

In order to draw a single line on the left and right lanes, I modified the draw_lines() function by
1. Set y_min and y_max as height of image
2. For each line in lines
  * Find slope of the line. If vertical line, then slope = -infinity
  * Classify the line as left line is -infinity < slope < -0.5 (~153 degrees). Save the left line's x,y co-ordinates, slope and intercept.
  * Classify the line as right line is 0.5 < slope < infinity (~27 degrees). Save the right line's x,y co-ordinates, slope and intercept.
  * Ignore all other lines. Eliminates outliers.
  * Check if any of the y co-ordinates of the line are lesser than y-min, then make that as y_min (to find highest point of the line in the image).
3. If left line's co-ordinates exists, the draw the left line by averaging the left line's slope & intercept, y_min and y_max.
4. If right line's co-ordinates exists, the draw the right line by averaging the right line's slope & intercept, y_min and y_max

Output videos for the 3 test videos are available at:
* [Test video 1 - Solid White Right](https://github.com/murthy-varun/Self_Driving_Car_ND/blob/master/CarND-LaneLines-P1/test_videos_output/solidWhiteRight.mp4)
* [Test video 2 - Solid Yellow Left](https://github.com/murthy-varun/Self_Driving_Car_ND/blob/master/CarND-LaneLines-P1/test_videos_output/solidYellowLeft.mp4)
* [Test video 3 - Challenge](https://github.com/murthy-varun/Self_Driving_Car_ND/blob/master/CarND-LaneLines-P1/test_videos_output/challenge.mp4)

### 2. Identify potential shortcomings with your current pipeline
This pipeline currently uses hard-coded parameters which may not work in different different conditions for example day vs evening vs night, sunny vs rainy vs snowy conditions etc.
Another potential issue is if the camera's position changes, the ROI mask that needs to applied will need to be changed as well.

### 3. Suggest possible improvements to your pipeline

A possible improvement would be to have a set of parameters for different conditions and adaptively use the parameter set for detected conditions.


text:
## Name

![Icon](/res/icons/16x16/app-assistant.png) Assistant - Serenity Assistant

[Open](file:///bin/Assistant)

## Synopsis

```**sh
$ Assistant
```

## Description

`Assistant` is a helpful program that is used to search for and open applications, files, settings, and anything else a user may want to access. It can be opened by pressing `Super+Space` and closed by pressing `Esc`.

### Features

* Enter a URL to open it in the web browser, e.g. `serenityos.org`.
* Perform quick calculations by typing the equal sign (=) followed by a mathematical expression, e.g. `=22*101`. Press Return to copy the result.
* Run commands in [Terminal](help://man/1/Applications/Terminal) by prefixing them with a dollar sign ($), e.g. `$ uname -a`.
* Launch applications with arguments, e.g. launch Pixel Paint with a file: `pp image.png`.

repository: SerenityOS/serenity

repo_name: SerenityOS/serenity