text:
---
layout: docs
title: 'Get started with Dexie in Svelte'
---

  +

Dexie v4.x comes with the best Svelte- and Sveltekit support.

In version 3.2 we've introduced **live queries** - queries that observe the result and make your component mirror the data in real time and in version 4.0.1-alpha.10 we improved the typing compability and SvelteKit support of liveQuery().

If a change is made (by the app itself or from an external tab or worker), a binary range tree algorithm will efficiently detect whether those changes would affect your queries and if so, re-execute your callback and re-render component.
[Here's a sample app demonstrates it](https://2n8bd.csb.app/).

[liveQuery()](/docs/liveQuery()) can be explained like this: **It observes the result of a promise-returning function that queries Dexie** *(In contrast to just execute it imperatively)*.
It is highly composable as you can call other functions that queries dexie compute a result based on their outcome.
Maybe you already have some functions you wrote long time ago.
Calling them from within the scope of the callback passed to [liveQuery()](/docs/liveQuery()) will turn your imperative async functions into an Observable, which also complies with the Svelte Store specification.

# 1. Create a Svelte project

Here we refer to Svelte's own [Getting Started](https://svelte.dev/blog/the-easiest-way-to-get-started) page.

# 2. Install dexie

```
npm install dexie@next
```

*Svelte and SvelteKit users are recommended to install `dexie@next` which gives you version 4.x, as it contains Svelte compatible typings and SSR friendly `liveQuery()`*

# 3. Create a file `db.js` (or `db.ts`)

Applications typically have one single Dexie instance declared as its own module. This is where you declare which tables you need and how each table shall be indexed. A Dexie instance is a singleton throughout the application - you do not need to create it on demand. Export the resulting `db` instance from your module so that components or other modules can use it to query or write to the database.

```ts
// db.js
import Dexie from 'dexie';

export const db = new Dexie('myDatabase');
db.version(1).stores({
  friends: '++id, name, age', // Primary key and indexed props
});

```

### Using Typescript?

If you use Typescript, table properties (such as `db.friends`) needs to be explicitly declared on a subclass of Dexie just to help out with the typings for your db instance, its tables and entity models.

```ts
// db.ts
import Dexie, { type Table } from 'dexie';

export interface Friend {
  id?: number;
  name: string;
  age: number;
}

export class MySubClassedDexie extends Dexie {
  // 'friends' is added by dexie when declaring the stores()
  // We just tell the typing system this is the case
  friends!: Table<Friend>;

  constructor() {
    super('myDatabase');
    this.version(1).stores({
      friends: '++id, name, age' // Primary key and indexed props
    });
  }
}

export const db = new MySubClassedDexie();

```
*See also [issue 1560](https://github.com/dexie/Dexie.js/issues/1560) containing a solution to improve typings for `liveQuery()` in case you want a more precise typings of the '$' vars.*

# 4. Create a component that adds some data

Writing to the database can be done using [Table.add()](/docs/Table/Table.add()), [Table.put()](/docs/Table/Table.put()), [Table.update()](/docs/Table/Table.update()) and [Collection.modify()](/docs/Collection/Collection.modify()) - see Dexie's [quick reference](/docs/API-Reference#add-items) for examples. Here we're gonna create a simple Svelte component that allows the user to add friends into the database using [Table.add()](/docs/Table/Table.add()).

```svelte
<!-- FriendAdder.svelte -->
<script>
  import { db } from "./db";

  export let defaultAge = 21;

  let status = "";

  let friendName = "";
  let friendAge = defaultAge;

  async function addFriend() {
    try {

      // Add the new friend!
      const id = await db.friends.add({
        name: friendName,
        age: friendAge
      });

      status = `Friend ${friendName} successfully added. Got id ${id}`;

      // Reset form:
      friendName = "";
      friendAge = defaultAge;
    } catch (error) {
      status = `Failed to add ${friendName}: ${error}`;
    }
  }
</script>
<div>
  <p>{status}</p>
  <fieldset>
    <legend>Add new friend</legend>
    <label>
      Name:
      <input
          type="text"
          bind:value={friendName} />
    </label>
    <br/>
    <label>
      Age:
      <input
        type="number"
        bind:value={friendAge} />
    </label>
    <br />
    <button on:click={addFriend}>Add Friend</button>
  </fieldset>
</div>
```

# 5. Create a component that queries data

Write a simple component that just renders all friends in the database.

```svelte
<!-- FriendList.svelte -->
<script>
  import { liveQuery } from "dexie";
  import { db } from "./db";

  let friends = liveQuery(
    () => db.friends.toArray()
  );

</script>
<ul>
  {#if $friends}
    {#each $friends as friend (friend.id)}
      <li>{friend.name}, {friend.age}</li>
    {/each}
  {/if}
</ul>

```
*To make more detailed queries, refer to Dexie's [quick reference for querying items](/docs/API-Reference#query-items).*

Notice two things here:

1. liveQuery() returns a reactive Svelte Store (or actually an Observable that happens to comply with the [The Svelte Store Contract](https://svelte.dev/docs#component-format-script-4-prefix-stores-with-$-to-access-their-values)). To access the reactive value of a Svelte Store, friends needs to be prefixed with $, `$friends`.
2. The result will be undefined momentarily before the very initial result arrives - which explains why we need the `{#if $friends}` condition.

# 6. Pass some query params

Let's improve the FriendList component and allow a parent component to pass some props that we use from within the query.
This time let's also use async / await (for pedagogical reasons only - it makes it simple to extend the function to do more queries if needed).

```svelte
<!-- FriendList.svelte -->
<script>
  import { liveQuery } from "dexie";
  import { db } from "./db";

  // Query parameters:
  export let minAge = 18;
  export let maxAge = 65;

  //
  // Query
  //
  $: friends = liveQuery(async () => {
    //
    // Query Dexie's API
    //
    const friends = await db.friends
      .where('age')
      .between(minAge, maxAge)
      .toArray();

    // Return result
    return friends;
  });
</script>
<ul>
  {#if $friends}
    {#each $friends as friend (friend.id)}
      <li>{friend.name}, {friend.age}</li>
    {/each}
  {/if}
</ul>
```

Notice two things in the above example:

1. As the query depends on the minAge and maxAge params, it needs to be declared as `$: friends` rather than just `let friends`, so that the query will update if a parent component changes minAge or maxAge.
2. The async callback is just a plain async function that can compute any type of result based on what it queries. It can use Promise.all() to query things in parallel or query things sequentially after each other. Any Dexie-call along the way will be marked for observation. In any case the end result will become observed.

# 7. Put it together

```svelte
<!-- App.svelte -->
<script>
  import FriendAdder from "./FriendAdder.svelte";
  import FriendList from "./FriendList.svelte";
</script>

<h1>My simple Dexie app</h1>

<FriendAdder />

<h2>Result</h2>
<FriendList />

```

When running this example, notice that adding friends within the given age range will make them show up instantly in your view.

# Things to play with

Test out how to edit query parameters and watch the live results update, or open up app in several windows and see them instantly reflect the changes from the other window...

## Make query parameters editable

Add a new component that allows the user to specify `minAge` and `maxAge` and pass those into the props to `<FriendList>`. You will notice that updating the props will also be instantly reflected in the query results of your app (also demonstrated in [this already cooked app](https://2n8bd.csb.app/))

## Run app in multiple windows

Open your app (or [the pre-cookied one](https://2n8bd.csb.app/)) in multiple new windows and watch them react to each other's changes.

*NOTE: IndexedDB is tied to using same browser and same origin. Sync across different origins, browsers, clients and users is another topic and requires a sync solution. If you're interested, have a look at what's coming in [Dexie Cloud](/cloud/).*

## Observe joined data

Do something similar to [this sample](/docs/API-Reference#joining) and observe the result of a function similar to `getBandsStartingWithA()` (a function that compose a result from multiple related queries). Notice that any change that affects any of the queries will make the component rerender, including the related data.

# More Samples and Resources

* [Play with Dexie.js and Svelte in Codesandbox](https://codesandbox.io/s/svelte-with-dexie-livequery-2n8bd?file=/App.svelte)
* [Read the docs for liveQuery()](/docs/liveQuery())
* [Read the general docs for Dexie.js](/docs/).

branch_name: refs/heads/gh-pages


text:
# pinch_and_zoom

Super simple and light JQuery plugin for image pinch/zoom on touch devices.

Add touch gestures (pinch zoom and touch drag) to an image (like Google Maps).
Based on a canvas element for smooth rendering.

Inspired by https://github.com/rombdn/img-touch-canvas.

Usage
------------

The image will be scaled to cover all the container so if you want the image to be showed at its original size by default
then set the container size to match the image original size (see example).

  <canvas id="image_canvas"></canvas>
  <script>
    $('#image_canvas').pinch_and_zoom({
      path: IMAGE_PATH
    })
  </script>

Options
------------

```
zoomSpeed       Speed of zoom when pinching / zooming (default 1, lower number is slower).
initialFit      Initial display. 'fill' to fill canvas (default), 'fit' to fit image centered in canvas.
onShow          Callback for initial display, returns image scale.
onZoom          Callback for during zoom, returns image scale.
maxZoom         Maximium zoom possible (default null), e.g. 2.0 for max 200%.
```

Licence
------------
(c) 2015 Brian Tsai
This code may be freely distributed under the MIT License

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Page 1

Hello, Page 1.

I am *italics* and I am **bold**.

Some `valid code` inline but also in a block:

```
Preformatted text
in here.
```

> This text
> is indented.
>> And this is indented more.

- A
- Bulleted
- List

1. A
2. Numbered
3. List

The [Python homepage](https://www.python.org/).

This site's [homepage](index)

This site's [](index)

## Subheading

Subheading text.

### Sub-subheading

More subheading text.

![Python Logo](https://www.python.org/static/community_logos/python-logo.png)

![Local Python Logo](python-logo.png)

branch_name: refs/heads/main


text:
# iSAC
implementation of iSAC

# how to use

## clone source code
```sh
git clone https://github.com/Taiki-Ishigaki/iSAC.git iSAC
```

## build sorce code
```sh
cd iSAC
mkdir build
cd build
cmake ..
make
```

## Reference
- [E. Tzorakoleftherakis, and T. D. Murphey. "Iterative sequential action control for stable, model-based control of nonlinear systems." IEEE Transactions on Automatic Control (2018).](https://arxiv.org/pdf/1706.08932.pdf)
- [Alex Ansari and Todd Murphey, "Sequential Action Control: Closed-Form Optimal Control for Nonlinear and Nonsmooth Systems" IEEE Transaction on Robotics Volume32, 5, p1196-1214 (2016)](https://arxiv.org/pdf/1708.09347.pdf)

repository: Taiki-Ishigaki/iSAC

repo_name: Taiki-Ishigaki/iSAC


text:
# shams ☀

Generate a plot of the sun's position in the sky over the year.

The y-axis represents time of day, running from 00:00 at the top to 23:59 at the bottom.

The x-axis represents day of the year, running from Jan. 1 on the left to Dec. 31 on the right.

A pixel's lightness corresponds to the sun's altitude (angular height in the sky) at that time, with white being straight overhead and black being directly underfoot.

A pixel's hue corresponds to the sun's azimuth (angle North, East, South, or West) at that time.

Written in Python 3 and released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).

Concept/code by [Anoush Khan](https://github.com/doubleaykay) and [Dan Strauss](https://github.com/DragonMarionette)

repository: doubleaykay/shams

gha_language: Python

repo_name: doubleaykay/shams


text:
# Simple JS-YAML port for Deno

This is a simple and crude port of [JS-YAML](https://github.com/nodeca/js-yaml) for [Deno](https://deno.land).

## Usage

Just import `js-yaml.js` file. For example:

```typescript
import { load } from 'https://deno.land/x/js_yaml_port/js-yaml.js'
console.log(load('hello: world')) // => prints { hello: "world" }
```

## API References

Just use [JS-YAML repo](https://github.com/nodeca/js-yaml#api) for references.

## Development

### Required tools

* [`node`](https://nodejs.org) to run package manager.
* [`pnpm`](https://pnpm.js.org) to install npm packages.
* [`deno`](https://deno.land) to build and test.
* `cp`.
* `make`.

### Build and Test

#### Build

```sh
make js-yaml.js
```

#### Test

```sh
make test
```

## License

[MIT](https://git.io/JvdHV) © [Hoàng Văn Khải](https://github.com/KSXGitHub/)

repository: KSXGitHub/simple-js-yaml-port-for-deno

gha_language: JavaScript

gha_license_id: MIT

repo_name: KSXGitHub/simple-js-yaml-port-for-deno


text:
Julia package SDE.jl
====================

This is work in progress. This package includes functionality to

* simulate diffusion processes in one or more dimension
* especially simulate vector linear processes / Ornstein-Uhlenbeck processes
* Monte Carlo sample diffusion bridges, diffusion processes conditioned to hit a point *v* at a prescribed time *T*
* functions for transition density, mean and covariance of linear processes
* perform Monte Carlo estimates of transition densities of general diffusion processes
* to nonparametrically estimate the drift of a diffusion with unit diffusion coefficient

The layout/api is still the state of flux and the package is currently undergoing a major revision,
I hope to have some nice version 1 in summer.

[![Build Status](https://api.travis-ci.org/mschauer/SDE.jl.png)](https://travis-ci.org/mschauer/SDE.jl)


text:
---
layout: post
title: Creating a Good Experience
category: devops
---

![placeholder](https://vivekjuneja.files.wordpress.com/2015/04/developer-experience.jpg?w=660
 "freaking awesome")

One common aspect of building in and for a Service Oriented system is the idea of “Standardizing Developer Experience”.

**What is Developer Experience ?**

A Developer in a Service Oriented project has to deal with multiple concerns. Each such concern is vital to the success of the Project. These concerns are essential to managing the chaos in a Distributed system.

Let us look at some of these concerns :-

1. How does a Developer decide on the Size of a Service ?

2. How does a Developer ensure that she is building a consistent set of API Interfaces to her service

3. How does a Developer provide API Mocks or Stubs for other developers to use when consuming her service

4. How does a Developer provide consistent documentation for the Service APIs that she developed

5. How does a Developer help prevent failures for others as a result of using the Service she built

6. How does a Developer ensure she is providing Health check capability in the Service

7. How does a Developer ensure the service is ready for instrumentation and monitoring

8. How does a Developer know how to publish her service

9. How does a Developer able to provide consistent Test Cases and Test coverage for the service

10. How does a Developer get access to test the service she developed along with the other dependent services

11. How does a Developer able to deploy the Service anywhere, be it Private Data center or a Public Cloud service

12. How does a Developer able to consistently provide Authentication and Authorization capability to its service

13. How does a Developer manage and support the variety of Consumers / API Clients

14. How can a Developer reliably make a change to a code and ensure that this change does not affect other dependent services

15. How can a Developer ensure that a change can be moved to Production environment reliably without major human interference:)

16. How does a Developer ensure that the Service she built is easy for Debugging

17. How does a Developer know how much capacity the Service needs to be run

18. How does a Developer know how to scale the services horizontally and independentaly

19. How does a Developer reliably use the Good patterns when developing for a Distributed system like Circuit Breaker, Timeouts etc.

All these above patterns are essential for creating a Good developer experience. A Good Developer experience ensures better code quality, reliable and stress free changes to a system, and independent Teams.

As we develop the POC for demonstrating Service Design and Domain Isolation, it is essential for us to also show that this isn’t possible without creating a Good Developer experience.

The goal is not just to create an experience, but Standardize it.

What do I mean by Standardizing ?

Standardizing means making all these concerns a part of a standard template. For example, we know about Email templates. Email templates are used to help create consistent emails for all recipients. Similarly, Standard Templates for Developer experience will avoid mismatch amongst developers. Standard Templates for Developer experience will reduce the burden of managing all these ideas for a Developer. This will ensure that the Developer can quickly and reliably focus on building the actual Logic, instead of managing this mess.

The good part of this template is that it can be shared with anyone. Internal teams or Partners, anyone can have access to this template and build reliable code with certainity.

But, a Good developer experience cannot prevent Bad code:) It can help Good developers become better, and build consistent and standard system required for a successful Service Oriented product.

And creating good Developer experience is NOT expensive or time taking. It is easy with the wealth of tools available. All we need to do is to build this Template from the various tools available and bring them all together.


text:
# package:tar

Vendored elements from `package:tar` for use in creation and extraction of
tar-archives.

 * Repository: `https://github.com/simolus3/tar/`
 * Revision: `7cdb563c9894600c6a739ec268f8673d6122006f`

repository: jonasfj/pub

gha_language: Dart

repo_name: jonasfj/pub


text:
---
meta.Title: "Umbraco .Net Core Updates"
meta.Description: "Updates and information related to the upcoming release of Umbraco on .NET 5+."
---

# Umbraco on .NET 5+

:::note
This article is intended for keeping an overview of all the information, official as well as unofficial, currently available on the upcoming release of Umbraco on .NET 5.

Are you aware of some information about Umbraco on .NET 5 that isn't already added to this list?
Please feel free to submit a Pull Request by using the **Edit this page** button at the top of this article.
:::

In this article you will find detailed instructions on [how to try out and test the current beta version of Umbraco on .NET 5](#umbraco-9-net-5-beta). You will also find a list of relevant links to official as well as unofficial resources on the upcoming release.

## Umbraco 9 Documentation

We have started verifying the current documentation against Umbraco 9.

You can find a complete list of all updated articles on the [Umbraco 9 Articles](Umbraco9Articles.md) page.

## News and updates from Umbraco HQ

In this section you will find links to news and updates from the .Net Core team at Umbraco HQ, as well as from the UniCore community team.

### Blog posts

* [Packages in Umbraco 9 via NuGet](https://umbraco.com/blog/packages-in-umbraco-9-via-nuget/)
* [Umbraco 9 Beta Release](https://umbraco.com/blog/umbraco-9-beta-release/)
* [Alpha 4 release of Umbraco on .NET Core](https://umbraco.com/blog/alpha-4-release-of-umbraco-on-net-core/)
* [Alpha 3 release of Umbraco on .NET Core](https://umbraco.com/blog/alpha-3-release-of-umbraco-on-net-core/)
* [Status of migration to .NET Core, December 2020](https://umbraco.com/blog/status-of-migration-to-net-core-december-2020/)
* [.NET Core Alpha release](https://umbraco.com/blog/net-core-alpha-release/)
* [.NET Core in the Unicorner](https://umbraco.com/blog/the-unicorner-returns-net-core-alpha-release/)
* [Automated testing in Umbraco](https://umbraco.com/blog/automated-testing-in-umbraco/)
* [Status of migrating to .NET Core](https://umbraco.com/blog/status-of-migration-to-net-core/)
* [Unicore team visit at Umbraco HQ](https://umbraco.com/blog/unicore-team-visit-at-umbraco-hq/)
* [The Unicore Team](https://umbraco.com/blog/the-unicore-team/)

### Other resources

* [The Umbraco Roadmap](https://umbraco.com/products/roadmap/)
* [Community: The UniCore team](https://our.umbraco.com/get-involved/the-unicore-team/)
* [Overview of Project Unicore/Migrating Umbraco CMS to .NET Core](https://umbraco.com/products/umbraco-cms/migrating-umbraco-to-net-core/)

## Community resources

In this section you will find a list of Umbraco .Net Core resources provided by the Umbraco Community.

### Community blog posts

* [Umbraco Package Migration to .NET Core (blog post series)](https://www.andybutland.dev/2021/03/umbraco-package-migration-to-net-core.html)
* [Running Umbraco on a Raspberry Pi or How I Stopped Worrying and Learned to Love Linux](https://skrift.io/issues/running-umbraco-on-a-raspberry-pi-or-how-i-stopped-worrying-and-learned-to-love-linux/)
* [Demystifying config in Umbraco .NET Core](https://24days.in/umbraco-cms/2020/umbraco-dotnet-core-config/)
* [Rick Butterfield: Umbraco Unicore first impressions](https://rickbutterfield.com/blog/umbraco-unicore-impressions)
* [Greystate: Trying Out the .NET Core Umbraco Alpha Release](https://greystate.dk/log/2020/09/04/umbraco-net-core-alpha/)

### Other

* [YouTube: Part01 Porting a Package from V8 to V9](https://www.youtube.com/watch?v=_GqlI_YZeKQ)
* [YouTube: Part02 Configuration & Options in Umbraco Package for .NETCore](https://www.youtube.com/watch?v=AOFdQAODU5o)
* [YouTube: Configuring Umbraco on .NET Core - JSON Schema](https://www.youtube.com/watch?v=rpUg-oySw8g)
* [YouTube: Migrating Event Handlers to Notification Handlers in Umbraco V9](https://www.youtube.com/watch?v=o_rpltxwj-8)
* [Adrian Ochmann: Umbraco (.NEThttps://m.youtube.com/watch?v=o_rpltxwj-8 Core) Docker Example](https://github.com/thecogworks/umbraco-core-docker-example)
* [Youtube: umbraCoffee #141 - Unicore Alpha](https://www.youtube.com/watch?v=-ceCJZ9Tus0&ab_channel=umbraCoffee)
* [Youtube: umbraCoffee #110 - Meet the Unicore team](https://www.youtube.com/watch?v=55xAuUxkpUo&ab_channel=umbraCoffee)
* [Umbraco Community: Unicore Team update](https://www.youtube.com/watch?v=0WmP3Xdq9dU)

## Umbraco 9 (.NET 5) Release Candidate

:::warning
As this is an **release candidate**, bugs and minor issues are to be expected.

Found a bug that isn't already reported? Please report it on the [GitHub tracker](https://github.com/umbraco/Umbraco-CMS/issues/new?assignees=&labels=type%2Fbug&template=01_bug_report.yml).
:::

To get started, follow the steps outlined below.

### Prerequisites

* [.NET 5 SDK](https://dotnet.microsoft.com/download)
* SQL connection string (MS SQL Server/Azure), unless you want to install using SQL CE (Compact Edition)

### Steps to install the Umbraco `dotnet new` template

1. Install the new Umbraco dotnet template:

    ```none
    dotnet new -i Umbraco.Templates::9.0.0-rc001
    ```

### [Optional] Update the template from earlier pre-release versions

If you have already installed the Umbraco `dotnet new` template, you will need ensure it is up-to-date

1. Use a command prompt of your choice to update the `dotnet new` templates

    ```none
    dotnet new -i Umbraco.Templates::9.0.0-rc001
    ```

### Steps to create an Umbraco solution using the `dotnet new` template

1. Create a new empty Umbraco solution using MS SQL Azure/Server:

    ```none
    dotnet new umbraco -n MyCustomUmbracoProject
    ```

    Or if you prefer to using SQL CE:

    ```none
    dotnet new umbraco --SqlCe -n MyCustomUmbracoProject
    ```

You will now have a new project with the name `MyCustomUmbracoProject`, or whichever name you chose.

The new project can be opened and run using your favorite IDE or you can continue to use the CLI commands.

### Steps to build and run

The following steps, will continue using CLI based on the steps above.

1. Navigate to the newly created project folder:

    ```none
    cd MyCustomUmbracoProject
    ```

2. Build and run the new Umbraco .Net Core project:

    ```none
    dotnet build
    dotnet run
    ```

The project is now running on the [Kestrel server](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/?view=aspnetcore-5.0&tabs=windows#kestrel) and is available on the ports listed in the console.

The next step is to run through the Umbraco CMS installation. If you chose to use MS SQL Server/Azure you will need to add your connection string during this setup process.

Once the installation process is complete you might need to **manually restart the application** in order to start the application again and get access to the Umbraco backoffice.

## Umbraco 9 Nightly Builds

To get the latest nightly builds - the latest version of the Umbraco dotnet template, you will need to add another NuGet source.

1. Use a command prompt of your choice to insert this custom NuGet feed:

```none
dotnet nuget add source "https://www.myget.org/F/umbraconightly/api/v3/index.json" -n "Umbraco Nightly"
```

2. Install the new Umbraco dotnet template

    ```none
    dotnet new -i Umbraco.Templates::9.0.0-*
    ```

In order to get the latest template from the new source, you will need to use a wildcard symbol like shown above.

Now you can continue in the same way as if you were using the [beta version](#steps-to-install-the-umbraco-dotnet-new-template)

## Package development

Since Alpha 4, we have added a new template to in `Umbraco.Templates` package which is targeting packages.

To use the new template write:

```none
dotnet new umbracopackage -n MyCustomUmbracoPackage
```

This generates an empty package with an empty `package.manifest`. But more importantly it also contains a `build/MyCustomUmbracoPackage.targets` file.

This file will be included in the NuGet package when using `dotnet pack`.

The file contains an `msbuild` target that is executed on build when a project has a dependency to this package. It copies the `app_plugin` folder into the project. This is required for having Umbraco packages as NuGet packages.

Furthermore, we introduced a new flag on the regular `dotnet new umbraco` template. You can now write:

```none
dotnet new umbraco -n MyCustomUmbracoProject -p MyCustomUmbracoPackage
```

This new `-P` indicates that the solution is a test-site of the package `MyCustomUmbracoPackage`. It will add a project dependency to `MyCustomUmbracoPackage` and import the target file from that project. So when you build the new solution, it will also copy the `App_Plugins` folder from the package project into the solution. In the same way, as if it was a NuGet reference.

### Full example

The following example shows how to use the templates in combination

```none
dotnet new umbracopackage -n MyCustomUmbracoPackage
dotnet new umbraco -n MyCustomUmbracoPackage.Testsite -p MyCustomUmbracoPackage
cd MyCustomUmbracoPackage.Testsite
dotnet build
```

### Changes between alpha 4 and beta 1

See tickets  tagged on [Github](https://github.com/umbraco/Umbraco-CMS/pulls?q=is%3Apr+is%3Aclosed+label%3Arelease%2Fnetcore-beta001) for a full overview.

#### Summary
- Members
  - Members are updated to ASP.NET Core Identity
  - Member passwords are rolled to a stronger hashing algorithm on member login
  - Members have stored a security stamp
  - Public Access Restrictions is updated to use the new member implementation
- Events
  - The remaining events are migrated to the new notification pattern
  - Added TreeAlias to tree notifications.
- Other
  - IUmbracoMapper should be injected instead of UmbracoMapper
  - Features and optimizations from Umbraco 8.13
- Bugfixes
  - Fix for Can't enable AppData mode for models builder in Alpha4
  - Fix warning logged regarding Antiforgery tokens
  - Fix for problem with models builder and nested content
  - Fix for ContentCacheRefresherNotification is dispatching every 10 seconds FileSystem changes??

### Changes between beta 1 and beta 2

See tickets tagged on [Github](https://github.com/umbraco/Umbraco-CMS/issues?q=label%3Arelease%2Fnetcore-beta002+is%3Aclosed) for a full overview.

#### Summary
- Breaking changes
  - `HideTopLevelNodeFromPath` default value changed to to `true`.
  - All notifications moved to the same namespace to make them easily discoverable
    - More notifications also postfixed with "Notification". `ServerVariablesParsing` => `ServerVariablesParsingNotification`.
  - The order of view location changes, so `/Views` is the first to search.
  - "WebRouting:DisableRedirectUrlTracking" configuration changed from `string` to `bool`.
- Features
  - Added API to validate user creadentials without actually logging them in.
  - Reintroduced missing overloads for `GetCropUrl`.
  - Enabled Microsoft SouceLink Debugging Feature.
  - Added localizable error descriptors for Users and Members
  - Replaced System.Drawing with ImageSharp when extracting the height and width of uploaded images.
- Bugfixes
  - Fixed issue with scheduled publishing.
  - Fixed issues where the runtime lever was not used correct.
  - Fixed issue with ModelsBuilder when using inherited Document Types.
  - Fixed issues where the javascript minifier was too agressive.
  - Fixed issue with hardcoded '\' as directory separator char (Linux issue).
  - Fixed issue in the Danish translation file leading to error doing install.

### Changes between beta 2 and beta 3

See tickets tagged on [Github](https://github.com/umbraco/Umbraco-CMS/issues?q=label%3Arelease%2F9.0.0-beta003+is%3Aclosed) for a full overview.

#### Summary
- Breaking changes
  - Examine 2.0 implementation.
  - ModelsBuilder mode names are changed.
     - `PureLive` => `InMemoryAuto`
     - `AppData` => `SourceCodeManual`
     - `LiveAppData` => `SourceCodeAuto`
 - Scope optional parameter ordering
- Features
  - Restart not required on install.
  - Modelsbuilder InMemoryAuto (PureLive) output is generated in temp folder
  - Latests updated from Umbraco 8.14-RC
- Bugfixes
  - Fix for unsafe project names; these are no longer unsafe for namespaces.
     - E.g. "Umbraco 9" will now use namespace "Umbraco_9"
  - Resolve virtual paths from DataEditorAttribute. E.g. "~/App_Data/...."

### Changes between beta 3 and beta 4

See tickets tagged on [Github](https://github.com/umbraco/Umbraco-CMS/issues?q=label%3Arelease%2F9.0.0-beta004+is%3Aclosed) for a full overview.

#### Summary
- Features
  - Added notifications when emails are sent
  - Allow Css / JS assets to be added via c# code in addition to `package.manifest`
- Bugfixes
  - Moved extensions methods from `HtmlHelper` to `IHtmlHelper`
  - Fixed issue with saving data types
  - Fixed issue with recurring tasks executing too often.
  - Fixed serialization issues with data types
  - Fixed issue with View Model validation failing when using value types
  - Added missing friendly overload for IsAllowedTemplate
  - Fixed issues with the Umbraco dotnet new templates
  - Project name is not set
  - Unattended install info is now json escaped
  - Fixed issue with updating password
  - Fixed issue with members not approved by default when using the build-in macro snippets
  - Fixed issues with MediaPicker3

### Changes between beta 4 and rc 1

See tickets tagged on [Github](https://github.com/umbraco/Umbraco-CMS/issues?q=label%3Arelease%2F9.0.0-rc001+is%3Aclosed) for a full overview.

#### Summary
- Breaking changes
  - Methods obsoleted in 8.15 removed
  - Route plugin controllers by area
  - RenderController configuration as .NETCore IOptions pattern
- Features
  - Packages migrations and UI changes to support NuGet packages.
  - 8.15 features
- Bugfixes
  - Changes the RoslynCompiler to use assemblies resolved from the DependencyContext (Fix for MB InMemoryAuto)
  - Migrated missing surfaceaction extension methods
  - Add RazorCompileOnPublish property to UmbracoProject for template
  - Migrated missing UmbracoAuthorizedController
  - Linux case-sensitive directories (Grid)
  - Render grid editor partial async
  - Render Block List component partial async
  - Use english names for cultures in language CRUD
  - Rebuild Database Cache button does nothing

## Umbraco Forms 9 (.NET Core) Beta

On Friday 4th June a beta release of the Umbraco Forms package for V9 was released.

It's available from the Umbraco prerelease MyGet feed used for the CMS betas.

    ```none
    dotnet nuget add source "https://www.myget.org/F/umbracoprereleases/api/v3/index.json" -n "Umbraco Prereleases"
    ```
And the package name is: Umbraco.Forms.9.0.0-beta002.

With an Umbraco V9 application running rc1, you can install the package with the following command:

```none
dotnet add package Umbraco.Forms --version 9.0.0-beta002
```

And then restart the web application with:

```none
dotnet run
```

You'll find the [Forms documentation](Add-ons/UmbracoForms) updated where necessary for V9, mostly around configuration and some changes to method signatures when extending Forms with custom workflow and field types.

If you find any issues, we'd appreciate reports at the [public issue tracker](https://github.com/umbraco/Umbraco.Forms.Issues/issues).  If you could please prefix any issues with "V9: " that would be useful to distinguish them from anything raised for other versions.

repository: jakob-bagterp/UmbracoDocs

repo_name: jakob-bagterp/UmbracoDocs


text:
---
id: mmpost
title: Multimedia Post-install
sidebar_position: 2
# sidebar_label:
---

RPM Fusion repositories also provide a lot of complement packages, it's often difficult to remember which is the exact name of each complement package. One can easily remember using the package group that the repository extends.

### Complements multimedia packages for Gstreamer enabled applications

```shell
sudo dnf groupupdate multimedia \
    --setop="install_weak_deps=False" \
    --exclude=PackageKit-gstreamer-plugin
```

### Complements sound-and-video packages

```shell
sudo dnf groupupdate sound-and-video
```

repository: rpmfusion-infra/website

repo_name: rpmfusion-infra/website


text:
# Summary

---

### What's included?
* `std::filesystem::path`
  * explicit path type, vs. std::string
  * manipulation of paths
* File and Directory access
  * copy, rename, remove, ...
  * exits, type, status, size, ...
  * directory iteration

---

### What's missing?

---

### Temporary Files and Directories
* Atomically create a unique file name or directory
* Like the Linux command `tempfile` or `mktemp`
* or `tmpfile()` from `<stdio.h>` or `mkstemp(...)` from `<stdlib.h>`

```bash
~$ tempfile
/tmp/filevyLcbf
~$ mktemp -d
/tmp/tmp.Mtt52jXKCo
~$ ls -ld /tmp/filevyLcbf /tmp/tmp.Mtt52jXKCo
-rw------- 1 finn finn    0 Feb 11 22:22 /tmp/filevyLcbf
drwx------ 2 finn finn 4096 Feb 11 22:23 /tmp/tmp.Mtt52jXKCo
```

---

### What's more?

---

# More Documentation
* http://en.cppreference.com/w/cpp/filesystem/path
* http://www.boost.org/doc/libs/1_66_0/libs/filesystem/doc/reference.html

---

### End
Thank you for your Attention.

repository: cpp-ug-hb/filesystem

repo_name: cpp-ug-hb/filesystem


text:
# Changelog

## 1.10.122 (2017/12/13)

* Add [Sentry](https://sentry.io) error tracking service
* Bug with latest release of Jersey (See this [stackoverflow issue](https://stackoverflow.com/questions/44088493/jersey-stopped-working-with-injectionmanagerfactory-not-found))

## 1.10.120 (2017/12/07)

* Update libs

## 1.10.119 (2017/12/07)

* Get first valid terminal found (default ACS ACR122)

## 1.9.110 (2017/09/17)

* Bad version format

## 1.9.109 (2017/09/17)

* Switch to AppVeyor instead of Travis
* Upgrade to Gradle 4.1
* Update dependencies

## 1.9.105 (2017/01/30)

* Update Launch4j download urls

## 1.8.103 (2016/11/10)

* Update dependencies

## 1.8.101 (2016/11/10)

* Gérer les erreurs HTTP 5xx (Issue #12)
* Double appels des webservices (Issue #11)
* Revenir au panel de sélection des utilisateurs lors de la (dés)association d'une carte
* Improve logging
* Renew Travis token

## 1.7.100 (2016/10/17)

* Do not close panel on associate or remove action (Issue #10)
* String compare ignoreCase (Issue #9)
* Add flag to use application without reader

## 1.6.97 (2016/10/07)

* Use encrypted token for Travis

## 1.5.95 (2016/10/01)

* Display if card used by member on Card UID Viewer dialog (Issue #6)
* Increase webservice timeout (Issue #4)

## 1.4 (2016/09/29)

* Remove ivy
* Add gradlew
* Travis deploy only if new version

## 1.3 (2016/09/27)

* Improve logging
* Add StyleCI micro-service
* Add gradle dependencies
* Create tag and deploy release through Travis
* Remove ext folder on Uninstall
* Better output for Configuration

## 1.2 (2016/09/19)

* Upgrade to Java 1.8
* New way to build setup with Travis

## 1.1 (2016/09/19)

* Review Launch4j build process
* Upgrade to Launch4j 3.9
* Codacy issues
* Implement Scan booking webservice (Issue #1)

## 1.0 (2016/09/19)

* Initial version

repository: crazy-max/crossfit-reader

repo_name: crazy-max/crossfit-reader


text:
## EMR Cost Calculator

#### A simple python module that calculates the cost of a single or a group of EMR clusters.

Given that Amazon doesn’t provide a straightforward solution to calculate the cost of an EMR workflow, this module aims to calculate the cost of an EMR workflow given a period of days,
or the cost of a single cluster given the cluster id. The simple way to do that would be to use the information given by the JobFLow method of the boto.emr module. However, this method
doesn’t return any information about the Task nodes of a cluster, and whether or not spot instances were used.

This cost calculator takes care of both. In case spot instances were used, the spot_price is retrieved by the corresponding field of the InstanceGroup emrobject. This figure corersponds
to the bidprice and this is the price we use in order to calculate the total cost. In many cases however (and depending on your bidding policy) this might not be the final price that you
pay for the instances (for more information about the amazon spot instance market check [here] (http://aws.amazon.com/ec2/purchasing-options/spot-instances/)). Since the price that we pay
is the current minimum bidprice (that has been granted instances) a more accurate approach would require to monitor the minimum bid price while the cluster is alive and adjust the cluster cost
accordingly. However, this approach adds a lot of complexity and in case that your bidding prices are not extremely higher than the minimum bid price, our current approach is accurate enough.

### How it works

This module is using [docopt](http://docopt.org/) in order to parse command line arguments.

It currently support two operations:

1.  Get the cost of an EMR cluster given the cluster id
  * `emr_cost_calculator.py cluster --region=<The region you launched your clusters in> --cluster_id=<j-xxxxxxxxxxxx>`

In both cases the aws_access_key_id and the aws_secret_access_key, which are required to connect to the AWS EMR API,
can be passed as parameters to the script. Alternatively, you can set the environment variables:

`AWS_ACCESS_KEY_ID - Your AWS Access Key ID
AWS_SECRET_ACCESS_KEY - Your AWS Secret Access Key`

#### On demand prices

Since Amazon doesn’t provide the on_demand prices for each instance type through an API, the only way to dynamically retrieving those prices would be to scrape the Amazon website.
for convenience, and since those prices do not change very often, we chose to store them in a yaml file. this list is not complete and only contains the instance types that we
were interested in.

### License

Distributed under the MIT license. See `LICENSE` for more information.

repository: binshi/emr-cost-calculator

repo_name: binshi/emr-cost-calculator


text:
TODO for individual features (commits may handle any number of these)

### More Systems

- Windows (see through, not pass through; hackable? to open/close and allow airflow?)
- Fire (spreads to burnables, consumes oxygen, burns out when stuff burns up or it
  runs out of air)
- When an NPC dies it should leave behind a corpse (or something?
- [R] to repair broken objects (doors, lights, airlocks, windows?); require skill, require components
- Sounds (nearby things can hear them, some kind of transient entity or maybe just another callback)
  Maybe a good time to add a "transient" tag to entities and delete them at the beginning of each update loop
  Maybe not
- Inventory (objects can be possessed by an entity; must be collected somehow?)

### Refactors

- If we disable the parallel feature, can we use dispatchers? This would be a serious
  help if (e.g.) we want persistent state across runs of a System (e.g. caching)
- Destructible / mutable tiles (as setup for a big meteor hitting the station, or
  a big bomb going off, or whatever)
- Move components into their own crate
- Move worldgen into its own crate
- Move loadable into its own crate (and add a proc-macro derive crate as well)

### UI/UX

- Some kind of indicator that the player is "stuck in place" (e.g. when hacking)
- Some kind of indicator in hacks of how long it will take
- More interesting space background (not just black)

### Bugs

- You can see door state being updated offscreen (because doors are memorable);
  to fix this we need that "memory system"
- If you die while hacking, it tries to keep hacking (due to QueuedPlayerActions
  not being save/loaded). Blocked by I don't know how to ser/deser Entity objects

### Improvements

- Put RNG in resources (with save/load) and get consistent entity iteration order
  so it's impossible to game the RNG with save/load)
- CanSuffocate should be a part of Breathe
- Context-aware control indicators (e.g. "[H] Hack" only appears if there is an adjacent hackable)

### Big

- Seriously consider if the "spaceship" setting is interesting enough (maybe not)
- Start thinking about more interesting worldgen
- Start thinking about how to plug in skills

### Performance Stuff

- "Has changed" tag on certain components, manually done (FlaggedStorage is probably not good enough)
  then use this for efficiency things (e.g. only update oxygen containers if they're adjacent to something
  that changed)
- SmallVec implementation (so no heap allocation until it's too big; may help with oxygen) (probably just
  pull in a dependency; also currently not using vecs on anything important)

repository: rodya-mirov/palladium

gha_language: Rust

repo_name: rodya-mirov/palladium


text:
# deep_translator

Project to evaluate sequential machine learning translators.

## Data

I have taken the ENG-DEU translation file from "http://www.manythings.org/anki/":http://www.manythings.org/anki/
Check out the *_about.txt* file for more information.

## Preprocessor

## Translator

First step was to get a basic pipeline going and be able to run training/evaluation on the data.

Currently, I have no Train/Dev/Test sets. Before implementing the sampled model, I will extend the preprocessor to to so.
Otherwise, checking performance of the different model would be hard.

### Model_Simple
A simple bidirectional RNN with input embedding and short term memory via LSTM.

### Model_Sampled
TBD: Adjust the simple model by using SampledSoftmaxLos (tf.nn.sampled_softmax_loss()) during training.

### Model_Search
TBD: This will extend the simple model by using BeamSearch.

### Model_Attention
TBD: Again, extend the Model using Attenion


text:
---
title: "Why Monads?"
date: 2018-06-11
categories: [scala,monads,programming]
tags: [scala,monads]
---
Recently I had the unlucky experience of trying to explain to some friends over Slack what monads actually do. Trying to show how they are quite useful outside of "they allow Haskell to have side-effects" proved difficult.

I went away for a while and started really putting some thought into how to best explain it. I've gotten so used to using them that I never thought too hard about why. This post is about why, and - hopefully - at the same time help others who have a difficult time grokking them....

<hr />

## Why Are Monads Hard?

There are [pages and pages][google] of the Internet dedicated to trying to explain monads. They really are quite simple once you understand them, so either...

* a conceptual barrier that's difficult to cross;
* all the documentation and blog posts suck; or
* the use-case is so foreign to most programmers that they don't understand the problem that monads solve, making the solution nigh impossible to grok.

## How Is This Post Different?

My focus is going to be on the final bullet point: defining the use-case. I'm going to make the problem so clear that it should be obvious when a monad is warranted.

By the end, the reader will have re-invented monads - out of necessity - to solve the problem posed. The reader should understand the problem they solve, how they solve it, when to use them, and how to use them effectively.

## Setup

For the code in this post I'll be using [Scala][scala] and the [Ammonite-REPL][ammonite]. Any line of code beginning with `@` is executed from within [Ammonite][ammonite].

```scala
@ import scala.util.Random
```

## Premise: Pure vs. Effect

We'll begin with a premise...

> All code produces values, and those values fall into one of two categories: _pure_ or _effect_. [^1]

Consider the following line of code:

```scala
@ 3
Int = 3
```

This is a _pure_ value; there was no side-effect necessary to compute it.

```scala
@ Random.nextInt(100)
Int = 42
```

This is an _effect_ value. Before its value is known, a side-effect had to take place: either it read from somewhere (e.g. `/dev/random`) or updated some internal state.

Next, let's stipulate that...

> Using the result of an _effect_ implies that the value returned must also - by definition - be the result of an _effect_.

That stipulation may be a bit much to accept. But, consider: any computation we perform after getting our random number was dependent on the side-effect used to produce it.

Instead of side-effects, think about `Try` values. If it's possible for a computation to fail and return an error, then every value derived from it must also be possible to fail (and therefore also be a `Try`). [^2]

## The Problem

Now that we've setup our premise, let's dive into what the problem is. First, let's start with a simple function:

```scala
def pair[T](x: T) = (x, x)
```

Let's see what happens when we call this function with a _pure_ value:

```scala
@ pair(3)
(Int, Int) = (3, 3)
```

And now let's call it with an _effect_ value:

```scala
@ pair(Random.nextInt(100))
(Int, Int) = (23, 23)
```

It appears to have worked fine in both instances, so what's wrong?

We've identified that any value returned by `Random.nextInt` is the result of an _effect_. We've also stipulated that any value derived from it (the value returned by `pair`) must also be an _effect_ value.

The problem is that we have no type-safe way of letting the compiler know that `Random.nextInt` returns an _effect_ value. Because of this, we can incorrectly be allowed to use it in a _pure_ context: our `pair` function.

## A Naïve Solution

A quick solution would be to make a new type that wraps any code and identify it as an _effect_:

```scala
case class Effect[A](private val value: A)
```

And now we can call a function and identify the return value an `Effect`.

```scala
@ val x = Effect(Random.nextInt(100))
x: Effect[Int] = Effect(48)
```

But, now let's call our `pair` function with it:

```scala
@ pair(x)
(Effect[Int], Effect[Int]) = (Effect(48), Effect(48))
```

While this is correct, it's not _really_ what's desired. We want the return value to be an `Effect` that results in a pair, not a pair of effects.

## A Better Solution

Let's start by redefining our `Effect` class, adding a `flatMap` method to it that allows us to pass the value of our `Effect` through a function that will return a new `Effect`.

```scala
case class Effect[A](private val value: A) {
  def flatMap[B](f: A => Effect[B]) = f(value)
}
```

*Remember our earlier stipulation:*

> Using the result of an _effect_ implies that the value returned must also - by definition - be the result of an _effect_.

And to help ourselves, let's create a way to "map" a _pure_ function and get back a function that returns an `Effect`:

```scala
def fmap[A,B](f: A => B): (A => Effect[B]) = {
  x => Effect(f(x))
}
```

Hurrah!

```scala
@ Effect(Random.nextInt(100)).flatMap(fmap(pair))
Effect[(Int, Int)] = Effect((9, 9))
```

## What Was Accomplished?

Let's recap the problem:

* There are two categories of values: _pure_ and _effect_.
* There's no type-safe way to distinguish between them.

To solve this problem we've defined a functional, type-safe wrapper around _effect_ values, and guaranteed that any result derived from an _effect_ value is also treated as an _effect_. This prevents us from ever accidentally using an _effect_ value in a _pure_ context.

Just to show that this solution could be used for another, completely different category of values, let's treat that previous paragraph as a mad lib:

*...around asynchronous values, and guaranteed that any result derived from an asynchronous value is also treated as asynchronous. This prevents us from ever accidentally using an asynchronous value in a synchronous context.*

Or how about...

*...around optional values, and guaranteed that any result derived from an optional value is also treated as optional...*

## So, What Is A Monad?

A monad is just a formal definition (rooted in [category theory][theory]) of what was coded above. In short:

> A monad is used to categorize values and compose functions within that category in a type-safe manner.

Our `Effect` class is a monad that wraps values that were derived through the use of side-effects. But, the use of monads is not exclusive to that use-case. These are also examples of monads:

* Option
* Try
* Future
* Task ([monix][monix])
* IO ([cats-effect][cats])

Once a value is optional (`Option`), any new, derived value from it must also be optional. If a function executes asynchronously (`Task`), then any function that uses the result must also - by definition - be considered asynchronous.

The formal definition of a Monad is any type that implements two functions:

1. inject a value into the monad; and
2. map that value and returns a new monad instance

And, those two functions must be coded in such a way as to adhere to these three [laws][laws] ([Haskell][haskell] syntax):

1. Right identity: `m >>= return ≡ m`
2. Left identity: `return a >>= f ≡ f a`
3. Associativity: `(m >>= f) >>= g ≡ m >>= (\x -> f x >>= g)`

And translated into English...

1. The "constructor" for a monad acts as the identity function when passed to `flatMap`.
2. The result of calling `flatMap` with a function, should be the same as calling the function with the value injected.
3. As long as the order of operations is unchanged, where the `flatMap` calls are bound should not affect the result.

Let's make sure that our `Effect` class implements these laws correctly:

```scala
@ def inc(x: Int) = x+1
@ def sq(x: Int) = x*x

// right identity
@ Effect(1).flatMap(Effect.apply) == Effect(1)
Boolean: true

// left identity
@ Effect(1).flatMap(fmap(inc)) == fmap(inc)(1)
Boolean: true

// associativity
@ Effect(1).flatMap(fmap(inc)).flatMap(fmap(sq))
Effect[Int] = Effect(4)

@ Effect(1).flatMap(x => fmap(inc)(x).flatMap(fmap(sq)))
Effect[Int] = Effect(4)
```

Congratulations, you just re-invented monads!

## What About IO?

Ignoring `Option`, one of the first experiences programmers get with monads is the `IO` monad via [Haskell][haskell], [Cats][cats], or some similar monadic library.

What makes the `IO` monad different is that the values it wraps are a _description_ of code to evaluate (e.g. a "thunk"). That's it!

There's truly nothing mystical or different other than the category of value being stored, which is a body of code to evaluate as opposed to the result of executing that code.

The _only_ thing about the `IO` monad that is "special" is that - eventually - it needs to be evaluated. In [Haskell][haskell] this is implicitly done by the `main` function (which is why it returns `IO`). Using the [cats-effect][cats] library in [Scala][scala], you're responsible for doing it yourself.

Regardless, the problem being solved is (conceptually) the same, and the solution is exactly the same.

## fin.

I hope this helps you to understand monads a bit more, what problem(s) they are used to solve, and - more importantly - giving you the knowledge to know when and how to use them effectively!

[^1]: *There are many different categories of values (e.g. optional, either, asynchronous, ...), but for our problem we're going to focus only on this particular category...*

[^2]: *If coming from a language like [Go][go], think about functions that return `error` values. If you just blissfully ignore them it's a bug. You need to either handle them (and do something else that can't fail), or propogate the error, which instantly means your return value is now in the category of "may fail".*

[google]:    https://www.google.com/search?q=monad
[wikipedia]: https://en.wikipedia.org/wiki/Monad_(functional_programming)
[theory]:    https://en.wikipedia.org/wiki/Monad_(category_theory)
[laws]:      https://wiki.haskell.org/Monad_laws
[scala]:     https://www.scala-lang.org/
[haskell]:   https://www.haskell.org/
[cats]:      https://typelevel.org/cats-effect/
[async]:     https://javascript.info/async-await
[monix]:     https://monix.io/
[ammonite]:  http://ammonite.io/#Ammonite-REPL
[go]:        https://golang.org/

repository: massung/codeninja

extension: markdown

repo_name: massung/codeninja


text:
betterplace_implementation
==========================

This snippet shows a simple implementation of Betterplace.org API to display project progress on a custom website. The snippet uses PHP Vers. 5.2.0. and does not contain a CSS layout. For further details see Betterplace.org API: https://github.com/betterplace/betterplace_apidocs

license: Unlicense


text:
![Mars Landing](./MarsLander.png)

### Introduction

Space exploration is not only dangerous but also expensive.
We can't afford to test all ideas or software with real space equipment.
One of the solutions to this problem is computing simulations.

We can model various situations and environments with computers and
experiment without fear to lose expensive equipment or human lives.
Of course, we can't simulate all the possible factors and consider everything,
and more complex model takes much more efforts to create it.
So one of the main problems of computing simulations is to choose this border.
Even a simple model can help to test ideas and find their disadvantages for early stages.

### Problem

Let's look at one of the simple models of the Mars lander. This simulation is realized as
a coding game at [CodinGame site](http://codingame.com) with various difficulties (you can find links in the next section).
Try to solve it and land the model of the Mars Lander.
How do you think to solve it? Which algorithms will you use for this?
Is it a practical and useful coding problem or do you think it's just a game?

### Output
The algorithm description as a text or as a code.
You can use any services to share your code (gist for example).
Your thoughts about the real usage of coding tasks like "Mars Lander" by CodinGame.

### Additional material
[Mars Lander **Level 1**](https://www.codingame.com/games/puzzles/40)

[Mars Lander **Level 2**](https://www.codingame.com/games/puzzles/12)

[Mars Lander **Level 3**](https://www.codingame.com/games/puzzles/39)

### Useful Resources

[Computer simulation](https://en.wikipedia.org/wiki/Computer_simulation)

[NASA Rover Curiosity: Meeting on Mars](http://www.siemens.com/innovation/en/home/pictures-of-the-future/digitalization-and-software/simulation-and-virtual-reality-mars-rover.html)

[Curiosity landing simulation](https://www.khanacademy.org/partner-content/nasa/searchingforlife/mars_science_lab/p/curiosity-landing-simulation)

### Metadata

Theme: Coding

Skills: Programming, Software Architecture

Difficulty: ★★★☆☆

repository: Spacer-im/Challenges

repo_name: Spacer-im/Challenges


text:
# Clinical Laboratory Diagnostics (CLD) Tests

Clinical Laboratory Diagnostics (CLD) Tests  is an application for helping specialists to prepare them for branch examination.
These tests based upon the real questions from the "Elex" program.

### Version
1.0.0

### Branches
Repository holds two branches:
- gh-pages - try application [here]
- master - branch for developing and testing

### Basic usage

  - After page loading you can chose questions by chapters or random questions from all chapters
  - There is a time counter during passing the tests to control the time limit
  - After test will be passed you can see and filter it's results

License
----

MIT

**Free Software, profit!**

[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)

   [here]:<http://olroyko.github.io/xmapo_kld>


text:
# MemeMe
The app allows user to takes pictures and overlays text to make memes out of friends, family, or pets. Also allows sharing with others via social media or email, and viewing past memes in a table or collection view.

## Technologies Used
UIKit, Swift, presenting view controllers, delegate pattern, UIControls, tables, collections, tabs, navigation

## Install
```
    git clone git@github.com:manujua82/MemeMe.git
```

## Usage

MemeMe is a meme-generating app that enables a user to attach a caption to a picture from their phone. After adding text to an image chosen from the photo Album or Camera, the user can share it with friends. MemeMe also temporarily stores sent memes which user can browse in a table or a grid.

When the user launches the app a meme list will appear. It will be the root view of the navigation stack. When the user taps the + button in the top right corner the app push the Meme Editor View.

In the Meme Editor View, when the user clicks on the “Album” button, an Image Picker is presented, making it possible to choose an image from the Photo Album. If there is a camera available on the device, pressing the camera button launches the camera, and a newly snapped photo can be chosen for the meme. If a camera is not available on the device, the camera button is disabled.
After an image is chosen, the image picker is dismissed, allowing text to be entered into the top and bottom text fields of the editor. When a user clicks inside one of the text fields, the default text disappears and the keyboard slides up. When the user finishes entering text and presses return, the keyboard is dismissed and the new meme is displayed.

When the user presses the share button, Apple’s stock Activity View appears, displaying several options for sharing the meme. After an option is chosen, the Activity View is dismissed and the meme list view appears. The meme list view  also appears upon pressing the “Cancel” button.
Selecting a meme from the table or collection presents the Meme Detail View. Clicking on the  back arrow of the Meme Detail View presents the previous Sent Memes View, either the table or collection.

## Screenshot
![Alt text](/ScreenShot/screenshot.gif?raw=true "")

## License
The contents of this repository are covered under the [MIT License](LICENSE).


text:
gauss-quad
=========
 [![Build Status](https://travis-ci.com/DomiDre/gauss-quad.svg?branch=master)](https://travis-ci.com/DomiDre/gauss-quad)
 [![](http://meritbadge.herokuapp.com/gauss-quad)](https://crates.io/crates/gauss-quad)

 The ``gauss-quad`` crate is a small library to calculate integrals of the type

 ![equation](https://latex.codecogs.com/svg.latex?%5Cint_a%5Eb%20f%28x%29%20w%28x%29%20%5Cmathrm%7Bd%7Dx)

 using Gaussian quadrature.

 To use the crate, the desired quadrature rule  has to be included in the program, e.g. for a Gauss-Legendre rule

 ```
  use gauss_quad::GaussLegendre;
 ```

 The general call structure is to first initialize the n-point quadrature rule setting the degree n via

```
 let quad = QUADRATURE_RULE::init(n);
```

where QUADRATURE_RULE can currently be set to calculate either:

| QUADRATURE_RULE  | Integral      |
| -------------    | ------------- |
| Midpoint         | ![equation](https://latex.codecogs.com/svg.latex?%5Cint_a%5Eb%20f%28x%29%20%5Cmathrm%7Bd%7Dx)  |
| Simpson          | ![equation](https://latex.codecogs.com/svg.latex?%5Cint_a%5Eb%20f%28x%29%20%5Cmathrm%7Bd%7Dx)  |
| GaussLegendre    | ![equation](https://latex.codecogs.com/svg.latex?%5Cint_a%5Eb%20f%28x%29%20%5Cmathrm%7Bd%7Dx)  |
| GaussJacobi      | ![equation](https://latex.codecogs.com/svg.latex?%5Cint_a%5Eb%20f%28x%29%281-x%29%5E%5Calpha%20%281+x%29%5E%5Cbeta%20%5Cmathrm%7Bd%7Dx)  |
| GaussLaguerre    | ![equation](https://latex.codecogs.com/svg.latex?%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty%20f%28x%29x%5E%5Calpha%20e%5E%7B-x%7D%20%5Cmathrm%7Bd%7Dx)  |
| GaussHermite     | ![equation](https://latex.codecogs.com/svg.latex?%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty%20f%28x%29%20e%5E%7B-x%5E2%7D%20%5Cmathrm%7Bd%7Dx)  |

For the quadrature rules that take an additional parameter, such as Gauss-Laguerre and Gauss-Jacobi, the parameters have to be added to the initialization, e.g.

```
 let quad = GaussLaguerre::init(n, alpha);
```

Then to calculate the integral of a function call

```
let integral = quad.integrate(a, b, f(x));
```

where a and b (both f64) are the integral bounds and the f(x) the integrand (fn(f64) -> f64).
For example to integrate a parabola from 0..1 one can use a lambda expression as integrand and call:
```
let integral = quad.integrate(0.0, 1.0, |x| x*x);
```

If the integral is improper, as in the case of Gauss-Laguerre and Gauss-Hermite integrals, no integral bounds should be passed and the call simplifies to
```
let integral = quad.integrate(f(x));
```

repository: DomiDre/gauss-quad

repo_name: DomiDre/gauss-quad


text:
---
title: "About"
bg: orange  #defined in _config.yml, can use html color like '#0fbfcf'
color: black   #text color
fa-icon: calendar
style: center
---

![Alt text](/img/MobiLearn.jpg)

---

## Mobi has two types of meetings:
* ### Mobi LEARN meetings which are one hour workshops over a specific platform. We usually cover Android, iOS, Web, Design, and Embedded systems.
* ### Our Dev meetings are where Mobi really makes a difference. We spend an hour working on our projects and building products to improve campus life.

## We meet every Friday at 5pm in ERB 103 @ UTA

## View our calendar HERE


text:
# UILabel incorrectly sized in UITableViewCell (Animation after assigning text)
### Possible iOS Bug:

Notice the `...` even though the `UILabel` is vertically justified on 2 lines

![preview](https://i.stack.imgur.com/rbuOj.png)

---

### Stack Overflow Question 35260912

Xcode project & source code related to [Invoke `reloadData` prior `setNeedsLayout`](https://stackoverflow.com/questions/35260912/uilabel-incorrectly-sized-in-uitableviewcell-animation-after-assigning-text/35261287#35261287) answer.

---

**Instructions:**

1. Build and run

**References:**

- Question [35260912](https://stackoverflow.com/questions/35260912) on Stack Overflow
- This and other answers posted on [Swift Recipes](http://swiftarchitect.com/recipes/)


text:
```
usage: ayr [-h] [--export {csv,json,xlsx}]
```

Displays the 30-day history of the Anchor Yield Reserve. An increasing yield reserve indicates that the return on collateral staked by borrowers in Anchor is greater than the yield paid to depositors. A decreasing yield reserve means yield paid to depositors is outpacing the staking returns of borrower's collateral. TLDR: Shows the address that contains UST that is paid on anchor interest earn. [Source: https://terra.engineer/]

```
optional arguments:
  -h, --help            show this help message (default: False)
  --export {csv,json,xlsx}
                        Export raw data into csv, json, xlsx (default: )
```

![ayr](https://user-images.githubusercontent.com/46355364/154049600-71d940f6-c7f3-4c50-a939-f76e539ed5cf.png)

repository: conrad-strughold/GamestonkTerminal

repo_name: conrad-strughold/GamestonkTerminal


text:
# Troubleshooting

Here are some things to check if there are problems running syzkaller.

 - Use the `-debug` command line option to make syzkaller print all possible debug output,
   from both the `syz-manager` top-level program and the `syz-fuzzer` instances. With this option
   syzkaller will only run one VM instance.

 - Use the `-v N` command line option to increase the amount of logging output, from both
   the `syz-manager` top-level program and the `syz-fuzzer` instances (which go to the
   output files in the `crashes` subdirectory of the working directory). Higher values of
   N give more output.

 - If logging indicates problems with the executor program (e.g. `executor failure`),
   try manually running a short sequence of system calls:
     - Copy `syz-executor` and `syz-execprog` into a running VM.
     - In the VM run `./syz-execprog -executor ./syz-executor -debug sampleprog` where
       sampleprog is a simple system call script (e.g. just containing `getpid()`).
     - For example, if this reports that `clone` has failed, this probably indicates
       that the test kernel does not include support for all of the required namespaces.
       In this case, running the `syz-execprog` test with the `-sandbox=setuid` option fixes the problem,
       so the main configuration needs to be updated to set `sandbox` to `setuid`.

Also see [this](linux/troubleshooting.md) for Linux kernel specific troubleshooting advice.

If none of the above helps, file a bug on [the bug tracker](https://github.com/google/syzkaller/issues)
or ask us directly on the<EMAIL_ADDRESS>mailing list.
Please include syzkaller commit id that you use and `syz-manager` output with `-debug` flag enabled if applicable.

repository: ZHYfeng/Dependency

gha_language: Go

repo_name: ZHYfeng/Dependency


text:
# Gogen

## Publish releases
For a release the tool `goreleaser` is used. You can get it [here](https://github.com/goreleaser/goreleaser/releases). Download your needed binary file and extract to your `$GOPATH/bin`. `$GOPATH/bin` should be on your path environment variables.

Also export your VCS token like: `GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN`

`goreleaser` builds from the latest tag which you made and it requires a clean working copy. Then `goreleaser` places the build output into a folder ``dist``

repository: tboehle/gogen

repo_name: tboehle/gogen


text:
# From scratch

> If you wish to make an apple pie from scratch, you must first invent the universe. - Carl Sagan

Implement various stuff from scratch. Goes without saying, but don't use any of this for anything serious - it will probably break the first chance it gets.

## [Befunge](befunge)

Befunge is a stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid.

## [Bencode](bencode)

Bencode (pronounced like B-encode) is the encoding used by the peer-to-peer file sharing system BitTorrent for storing and transmitting loosely structured data.

## [Brainf\*\*k](branf)

An esoteric programming language created in 1993 by Urban Müller, and is notable for its extreme minimalism.

## [Huffman coding](huffman-code)

In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression.

## [deflate](deflate)

In computing, Deflate is a lossless data compression file format that uses a combination of LZSS and Huffman coding.

## In progress

## [BitTorrent](torrent)

BitTorrent is a communication protocol for peer-to-peer file sharing (P2P) which is used to distribute data and electronic files over the Internet.

- [x] Torrent file processing
- [ ] Tracker server
- [ ] Tracker communication
  - [ ] http/https
  - [ ] udp
- [ ] Downloader

### [png](png)

- [x] File parser
  - [x] Extract chunks
  - [ ] Checksum (optional)
- [x] Header parser
- [x] Palette parser
- [ ] Decompress data
  - [ ] Deflate
    - [x] Huffman encoding
    - [ ] LZSS
    - [ ] Checksum (optional)
- [ ] Interlace support
- [ ] Filter support

## TODO plan/ideas

- [ ] sha1
- [ ] sha256
- [ ] md5
- [ ] rsa
- [ ] CRC-32 (png dependency)
- [ ] ADLER32 (png dependency)

repository: DarkoKukovec/from-scratch

repo_name: DarkoKukovec/from-scratch


text:
# Upload files from application Pods to S3

In this example use case we provide a solution to export data from an
application Pod to a helper Pod that uploads the data to S3.

## Components

### Application StatefulSet

The StatefulSet with application  data is created with 2 StorageOS volumes. One
for the data and one for the backups directory. Many applications
allow backups to be exported remotely, but some only allow backups to the local
filesystem. In this example, the directory to store backups inside the
container is `/backups`.

The same StatefulSet runs a second sidecar container exposing a Rsync daemon.
The Rsync container shares the `/backup` location with the application (main)
container.

> To expose files without having a separate location for backups, while using
> the data path, the Kubernetes manifests can be changed in the Statefulset
> volumes section to share the `/data` volume.

### S3 Uploader

A Kubernetes Cron Job is created. That scheduler creates a Pod running two programs.
Firstly the Pod connects to the Rsync daemon running in the StatefulSet via a
Kubernetes Service and syncs the `/backup` directory. It then uploads the
content into an S3 bucket.

The connection to Rsync is established using a username and password injected to
the Worker via Kubernetes Secrets. Both the Rsync daemon and the client use the
same Secret.

A few parameters are passed to the Worker Pod using a ConfigMap. The configurable
information is the Rsync Service Name and the Credentials to access Rsync and
the S3 Bucket.

Finally, the Worker uses a Secret to download the AWS credentials. Set your own
parameters and credentials in the Kubernetes manifests.

To change the frequency of the Worker trigger, you can change the Kubernetes
manifest for the Cron Job. The current configuration runs a backup every hour.

> Make sure you set your AWS credentials in the Secret
> `k8s-manifests/05-aws-secret.yaml` and the S3 bucket name in the ConfigMap
> `k8s-manifests/90-uploader-config.yaml`.

repository: storageos/use-cases

gha_language: Shell

repo_name: storageos/use-cases


text:
# Ruby Challenges / Analyzing Shakespeare

Hey there! We're [thoughtbot](https://thoughtbot.com), a design and
development consultancy that brings your digital product ideas to life.
We also love to share what we learn.

This coding exercise comes from [Upcase](https://thoughtbot.com/upcase),
the online learning platform we run. It's part of the
[Ruby Challenges](https://thoughtbot.com/upcase/ruby-challenges) course and is just one small sample of all
the great material available on Upcase, so be sure to visit and check out the rest.

## Exercise Intro

Difficulty: **Easy, but requires isolating an external service during testing.**

As a Shakespeare buff, statistics junkie, and Unix lover, Ben finds himself wanting a command-line tool for analyzing Macbeth.

Write a command-line program that prints the number of lines spoken by each character in the play.

## Instructions

To start, you'll want to clone and run the setup script for the repo

    git clone git@github.com:thoughtbot-upcase-exercises/analyzing-shakespeare.git
    cd analyzing-shakespeare
    bin/setup

Sample usage/output (using made-up numbers):

    $ ruby macbeth_analyzer.rb
      543 Macbeth
      345 Banquo
      220 Duncan
      (etc.)

You can find an XML-encoded version of Macbeth here: http://www.ibiblio.org/xml/examples/shakespeare/macbeth.xml. Your program should download and parse this file at runtime.

Your solution must be tested, preferably via TDD. Running your tests _should not_ download the play from the ibiblio.org server.

Note: some lines are attributed to a speaker called "ALL". Your program should ignore these.

## Featured Solution

Check out the [featured solution branch](https://github.com/thoughtbot-upcase-exercises/analyzing-shakespeare/compare/featured-solution#toc) to
see the approach we recommend for this exercise.

## Forum Discussion

If you find yourself stuck, be sure to check out the associated
[Upcase Forum discussion](https://forum.upcase.com/t/ruby-challenges-analyzing-shakespeare/4604)
for this exercise to see what other folks have said.

## Next Steps

When you've finished the exercise, head on back to the
[Ruby Challenges](https://thoughtbot.com/upcase/ruby-challenges) course to find the next exercise,
or explore any of the other great content on
[Upcase](https://thoughtbot.com/upcase).

## License

analyzing-shakespeare is Copyright © 2015-2018 thoughtbot, inc. It is free software,
and may be redistributed under the terms specified in the
[LICENSE](/LICENSE.md) file.

## Credits

![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg)

This exercise is maintained and funded by
[thoughtbot, inc](http://thoughtbot.com/community).

The names and logos for Upcase and thoughtbot are registered trademarks of
thoughtbot, inc.


text:
# Server Commons
This project is used to create a new NodeJS Express server with use of ECMA6 Decorators, Configuration and Sequelize.

## Environment Variables

>- `DB_NAME`: The database name
>- `DB_USERNAME`: The database user
>- `DB_PASSWORD`: The database password
>- `DB_HOST`: The database address
>- `DB_PORT`: The database port
>- `VERBOSE`: `true` if you want to log SQL Statements
>- `DB_DIALECT`: Can be `mysql`, `postgres`, `mariadb`
>- `DB_SOCKET_PATH`: If you want to use socket path
>- `SYNC`: True to auto generate the database
>- `DB_MAX_CONCURRENT_QUERIES`: Max concurrent queries
>- `DB_POOL_MAX_CONNECTIONS`: Max connections to keep on pool
>- `DB_POOL_MIN_CONNECTIONS`: Min connections to keep on pool
>- `DB_POOL_MAX_IDLE_TIME`: Max connections idle

## How to use it
To use this project you need to pull the following project with the kickstart of a server

### Models
In Domain Driven Development, we can also call it Repository. How to use it.

### Routers
These are the Resources, the REST API. For example this:

```javascript
import { RestController, GET, POST, PUT, DELETE } from 'base-server/router';
import { NotFoundError } from 'base-server/errors';
import AddressService from '../services/AddressService';
import AddressModel from '../models/AddressModel';

@RestController('/address')
export default class AddressRouter {

  @GET('/:uuid')
  async findAddress({ params }) {
    const address = await AddressModel.find(params.uuid);
    if (!address) throw new NotFoundError('Address not Found');
    return address;
  }

  @POST('/')
  async createAddress({ body }) {
    const address = await AddressService.create(body);
    return AddressModel.find(address.uuid);
  }

  @PUT('/:uuid')
  async updateAddress({ params, body }) {
    await AddressService.update(params.uuid, body);
  }

  @DELETE('/:uuid')
  async deleteAddress({ params }) {
    await AddressService.deleteAddress(params.uuid);
  }

}
```

### Sequelize
They are the Entities, the objects that are persisted on the database

```javascript
import { DataTypes } from 'sequelize';
import State from './State';

const { BIGINT, STRING } = DataTypes;

const City = sequelize.define('City', {
  id: { type: BIGINT, primaryKey: true, autoIncrement: true },
  name: { type: STRING(256), allowNull: false },
}, {
  timestamps: false,
  tableName: 'city'
});

City.belongsTo(State, {
  as: 'State',
  foreignKey: 'state_id'
});

export default City;
```

### Services
They have to keep the business logic

### index.js

```javascript
import Server from 'base-server/server';
import { join } from 'path';

const server = new Server({
  migration: {
    name: 'pipeu-event-schedule',
    dir: join(__dirname, '..', 'db'),
  },
});

// add requires to all your routers (compatible with Babel+Webpack)
require('./routers/MyRouter');

export default server;
```

repository: sergiofilhowz/nodejs-base-server

repo_name: sergiofilhowz/nodejs-base-server


text:
# Think of the children!
## An Umbraco plugin to toggle display of unpublished backoffice nodes

If you're anything like me, you have a habit of littering your Umbraco install with unpublished content nodes - you create content in advance and schedule the publish, or unpublish content only to republish it at a later date.

Think of the children! can help - the plugin adds a new option to the context menu in the content tree. Click it once, unpublished content is hidden. Click it again, and behold, the hidden children return!

If this doesn't help you sleep better at night, I don't know what will. Note: if unpublished Umbraco nodes have you losing sleep, you should talk to someone. I'm not a doctor, but seriously.

repository: nathanwoulfe/thinkofthechildren

repo_name: nathanwoulfe/thinkofthechildren


text:
# maze-solver
A-Maze-ingly Retro Route Puzzle

This program will output a valid route one could follow to collect all specified items within a map.
The map is a json description of set of rooms with allowed path and contained object.
This is also a simple implementation of a [bfs algorithm](https://en.wikipedia.org/wiki/Breadth-first_search).

### How to Build
`docker build -t maze-solver -f Dockerfile . `

### Usage
Local Usage:

`node app.js -m ./map/map2.json  -s 4 -o 'Knife' 'PottedPlant' 'Pillow'`

Using Docker:

` docker run -v $(pwd):/mnt maze-solver:1.0.0 ./scripts/run.sh -m ./map/map.json -s 2 -o Knife PottedPlant`

Output Sample:
```
ID      Room            Object Collected                                                                                ----------------------------------------
2       Dining Room             None
1       Hallway                 None
2       Dining Room             None
3       Kitchen                 Knife
2       Dining Room             None
4       Sun Room                PottedPlant                                                                                All objects Collected ```

repository: salvorusso/maze-solver

repo_name: salvorusso/maze-solver


text:
# Getting started

## Setting up your workshop development environment
This workshop is aimed at the intermediate Java or OO programmer who wants to start with native Android development. As a prerequisite, please set up a working Android development environment. Please check if you have already installed—and if not, download and install—the following software on your computer:

### 1. Android Studio
Install the [Android Studio](http://developer.android.com/sdk/installing/studio.html) bundle, which includes:
  * The Android Studio IDE, which is based on the community edition of IntelliJ IDEA.
  * All the Android SDK tools to design, test, debug, and profile your app.
  * The latest Android platform to compile your app.
  * The latest Android system image to run your app in the emulator.

If Android Studio gives any errors concerning your version of Java, you may need to update to [Java Software Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) version 8. Note that a Java Runtime Environment (JRE) is not enough to do Android development; you need the Java SDK.

### 2. Git client (optional)

A [Git](http://git-scm.com/downloads) client or command line tool is recommended to clone the workshop repository. [Sourcetree](http://www.sourcetreeapp.com/) is a pretty cool Git GUI client. If you don't have an internet connection, or don't want the hassle of working with Git, you can get (or download) a zip-file with the repository contents on the day of the workshop.

### 3. Ensure everything's up-to-date

![Android Studio Check for updates](img/android-studio-check-for-updates.png)

After you have installed Android Studio you might need to update to the latest version. Fire up Android Studio and select “Check for Updates…” under the “Help” menu. We will use a modern version of Android Studio for this workshop.

Also check that you have the latest “SDK Tools”, “Android platform” and “Extras” installed. You can access the SDK manager by clicking on the SDK Manager Icon ![SDK Manager Icon](img/sdk-manager-studio.png) in the toolbar. Your configuration should look something like the screenshots below, but using whichever latest versions are available.

![SDK Tools](img/sdk-tools.png)
> You only need the latest versions of the “Tools”, “Platform-tools” and “Build-tools”

![Android 6.0 (API 23)](img/sdk-android-api-22.png)
> Select the packages that are selected in the screenshot. If you don't have an Android device install one of the Intel Atom images so you can create an emulator later on. If you have enough hard disk space simply click the checkbox before the “Android 6.0 (API 23)” folder to select and download everything.

![Extras](img/sdk-extras.png)
> Simply install everything in the “Extras” section for the workshop. The “Google USB Driver” is only compatible with Windows machines, so install that if you run Android Studio on Windows and want to connect your dev phone via a USB cable.

Specifically, you should have:
* Under “Tools:
 * Android SDK Tools
 * Android SDK Platform-tools
 * Android SDK Build=tools
* Under a modern Android version (as of this writing, “Android 6.0 (API 23)”):
 * SDK Platform
 * Documentation for Android SDK (recommended)
 * Samples for SDK (recommended for learning)
* Under “Extras”:
 * Android Support Repository
 * Android Support Library
 * Google Play services
 * Google Repository

Once you have selected all the packages above click the “Install Packages” button and sit tight.

### 4. Prepare a device

Preferably we would like you to connect your phone to your computer and run and test the samples on a real device. If you don't own an Android device you can install an Android emulator, also known as an Android Virtual Device (AVD).

#### Physical device

Plug in your device through USB, and make sure it's set up for USB debugging and permits installing apps from unknown sources.

**Note:** If you're connecting your Android device to a Windows machine, make sure you have installed the correct device driver. If you have ever successfully connected your Android device to your PC, for instance to exchange files, you probably already have it.

##### USB Debugging

![USB Debugging](img/usb-debugging.png)

If you want to run apps on your device, the first thing you need to do is enable “USB debugging” on the device itself. You can do so by starting the Settings app on your device and selecting “Developer Options” → USB Debugging”. If you don't see the developer options item in your settings menu, you can enable them by clicking on the “Settings” → “About Phone” → “Build” item a couple of times to enable them.

#### ADB permission

Now that you've enabled the developer settings, you need to make sure your laptop or computer is authorized to use your device. When you plug in your device, you should get a dialog on your device:

![Allow USB debugging?](img/usb-debugging-allow.png)

If you intend to use your device with your computer more frequently, tick "Always allow from this computer" and press OK.

#### Virtual device (Emulator)

Install at least one Android Virtual Device (AVD) running Lollipop for this workshop. All the capabilities of the AVD Manager are accessible directly from the Android Studio interface. Click the AVD Manager Icon ![AVD Manager Icon](img/avd-manager-studio.png) in the toolbar to open it and create new AVDs.

##Let's go!

Once you've installed all the software, necessary development kits and set up a device, you are all set for the workshop!

You may want to keep this [cheatsheet](cheatsheet.md) at hand. Now let's [go to lesson 1](lesson1/README.md)!

repository: RepoForks/beginners-workshop

repo_name: RepoForks/beginners-workshop


text:
# Aurelia UI Components

## Using components

You can easily include the components into your project by adding `aurelia-ui-components` as a plugin in your app's main.js file.

To only load the components you're using, pass an array of component names when registering the plugin. For example: `.plugin('aurelia-ui-components', ['menu', 'tooltip'])`

## Including the component styles

The preferred way is by using SASS. Simply import components.scss into your app and all the component styles will be merged into your stylesheet.

There is also a precompiled CSS file in the dist/ folder you can use.

## Running the example

* `cd example; npm install`
* `cd ..; npm run watch`

repository: joncarlson/aurelia-ui-components

repo_name: joncarlson/aurelia-ui-components


text:
---
layout: doc-page
title: "Dependent Function Types"
nightlyOf: https://docs.scala-lang.org/scala3/reference/new-types/dependent-function-types.html
---

A dependent function type is a function type whose result depends
on the function's parameters. For example:

```scala
trait Entry { type Key; val key: Key }

def extractKey(e: Entry): e.Key = e.key          // a dependent method

val extractor: (e: Entry) => e.Key = extractKey  // a dependent function value
//             ^^^^^^^^^^^^^^^^^^^
//             a dependent function type
```

Scala already has _dependent methods_, i.e. methods where the result
type refers to some of the parameters of the method. Method
`extractKey` is an example. Its result type, `e.Key` refers to its
parameter `e` (we also say, `e.Key` _depends_ on `e`). But so far it
was not possible to turn such methods into function values, so that
they can be passed as parameters to other functions, or returned as
results. Dependent methods could not be turned into functions simply
because there was no type that could describe them.

In Scala 3 this is now possible. The type of the `extractor` value above is

```scala
(e: Entry) => e.Key
```

This type describes function values that take any argument `e` of type
`Entry` and return a result of type `e.Key`.

Recall that a normal function type `A => B` is represented as an
instance of the [`Function1` trait](https://scala-lang.org/api/3.x/scala/Function1.html)
(i.e. `Function1[A, B]`) and analogously for functions with more parameters. Dependent functions
are also represented as instances of these traits, but they get an additional
refinement. In fact, the dependent function type above is just syntactic sugar for

```scala
Function1[Entry, Entry#Key]:
  def apply(e: Entry): e.Key
```

[More details](./dependent-function-types-spec.md)

repository: lampepfl/dotty

gha_language: Scala

repo_name: lampepfl/dotty


text:
## Problems with mobile last

I have built a few responsive sites in the past and always started out with the large (desktop) version first, adding in media queries to scale the site down for smaller devices. I wouldn't say I was unhappy with this approach, it was easy-ish to design for, but did always leave a large amount of code written in the media queries. A lot of styling that was previously set above was then overridden and unset for mobile devices.

Another thing that concerned me was content, designing with content based on a large devices would tend to look like too much information once it got to the small screen, just squash it all down so long as it's readable.

Building things in afterwards is always a nightmare, just try writing unit tests after you have written your code.

## Mobile first to the rescue

Setting your mobile styling first and then using media queries to scale up your design rather than down seemed to result in a lot less CSS. I was shocked, even with the little amount of CSS required for this minimal design, you can [see it on GitHub](https://github.com/phawk/phawk.github.com/blob/master/css/styles.scss). I would be a firm believer that the best way to have more maintainable code and less bugs is to have less code in the first place, so I am very happy when I have to write less to get the same job done.

The other benefit of a mobile first approach is that the code just works, you can't ever forget to do the mobile version, because it is mobile by default. I'd also imagine that re-paint times on mobile can be a lot more performant as there is a lot less styling to calculate.

### Any Downsides?

The one negative point I found was mobile first is harder to design for. This could be down to it being the first time I have used this approach though, or also down to the fact that I barely design things anymore, but I would still use this approach for every new project in the future.

gha_language: TypeScript


text:
# F1 times

[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Netlify Status](https://api.netlify.com/api/v1/badges/9d9e8da1-84cc-4430-a618-5841aca3bbc9/deploy-status)](https://app.netlify.com/sites/f1-times/deploys)

Check the times of the races by your local time, track time or any choosen timezone. Default is your localtime but if you choose a timezone, that will be the default until you reset it.

## License

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

gha_language: Vue


text:
<!--

Hi!

Thanks for taking the time to submit a feature request or bug report. Please try to fill out the relevant fields, and remove any irrelevant section from this template.

-->

## Feature request

Please describe the new feature or behaviour you'd like to see.
If possible, give a concrete use case.

## Bug report

If running as an npm package:

```
Thumbsup version: __________
Node version: __________
NPM version: __________
Operating system: __________
```

If running as a Docker container:

```
Thumbsup image tag: __________
Docker version: __________
Operating system: __________
```

About the bug...

- Are you getting an error message?
- Have you tried running `DEBUG="*" thumbsup <args>` to get more troubleshooting info?
- Is the behavior different from expected?
- Can you provide steps to reproduce the issue?

repository: wipash/thumbsup

repo_name: wipash/thumbsup


text:
## Get a Location by ID

This endpoint retrieves the data for a single Location.

### HTTP Request

`GET /api/public/v2/locations/<id>`

```http
GET /api/public/v2/locations/123 HTTP/1.1
Host: app.makeshift.ca
Authorization: Bearer <token>
```

```shell
curl -X GET \
  'https://app.makeshift.ca/api/public/v2/locations/123' \
  -H 'Authorization: Bearer <token>'
```

```json
{
  "data": {
    "id": "123",
    "type": "location",
    "attributes": {
        "name": "Victoria",
        "time_zone": "America/Los_Angeles",
        "external_name": null,
        "api_id": null,
        "week_starts_on": 0
    },
    "relationships": {
      "departments": {
        "data": [
          {
            "id": "1",
            "type": "department"
          }
        ]
      }
    }
  }
}
```

### Request Parameters

Parameter | Default | Description
--------- | ------- | -----------
fields | All | A comma-separated list of fields to select. Example: `?fields[location]=name,id`

repository: AppColony/slate

branch_name: refs/heads/develop

gha_license_id: NOASSERTION

repo_name: AppColony/slate


text:
---
layout: organization
category: local

title: United Community Centers, East New York Farms!
impact_area: Human Rights
keywords:
  - Adults in Need
  - Children in Need
  - Education
  - The Elderly
  - The Environment
  - Families in Need
  - Global Problems
  - Health and Wellness
  - Understanding and Diversity
  - Women in Need
location_services: Brooklyn
location_offices: Brooklyn
website: www.ucc-eny.org

description: |
  UCC works to help people in East New York solve problems we see in our community by working together. One of our programs is the East New York Farms! project, where  we work with youth and adults to grow fresh, healthy food for our community.
mission: |
  United Community Centers is a neighborhood-based, multi generational, multi service organization that seeks to:

      * Provide first-rate services that meet the needs of the community

      * Involve residents of all ages in social efforts to learn about and resolve community problems

  We are open to anyone, although most of the people we serve live in East New York. We strive to create programs that recognize and value the "richness of difference" within both our community and the world at large.

cash_grants: yes
grants:
  - |
    We are seeking $990 to fund our Summer Cooking program. 33 teens in our internship program (ages 13-18) rotate through cooking lunch for the rest of the group, using fresh and affordable ingredients from our farm, and learning how to prepare their own affordable, healthy meals. 9 weekly lunches throughout the summer cost about $110 each.
  - |
    We are seeking $1100 to fund stipends for 10 Community Educators to lead cooking demonstrations at Women, Infants, and Children (WIC) centers throughout East New York. Community Educators are residents who are trained in teaching about healthy, seasonal eating and where to find fresh food in our community. They lead demonstrations at WIC centers inform women with young children about our farmers market.
service_opp: yes
services:
  - |
    Volunteers are welcome at our farm, April - November, 1st and 3rd Saturdays of each month, 10am - 2pm

learn:
  - Give students a tour of our office and facilities
  - Speak over the phone about our work
cont_relationship:
  - Help students develop a community service project with us

salutation: Ms
first_name: Sarita
last_name: Daftary
title_contact_person: East New York Farms! Project Director

city: Brooklyn
state: NY
address: |
  613 New Lots Avenue
  Brooklyn NY 11207
lat: 40.664704
lng: -73.886578
phone:<PHONE_NUMBER>
ext: 28
fax:<PHONE_NUMBER>
email<EMAIL_ADDRESS>preferred_contact: email
contact_person_intro: |
  I've worked at UCC for 8 years, as part of the East New York Farms! Project. We were so honored when last year PS 13, a school close by in East New York, chose us for their Penny Harvest.
---
UCC works to help people in East New York solve problems we see in our community by working together. One of our programs is the East New York Farms! project, where  we work with youth and adults to grow fresh, healthy food for our community.

repository: flipside-org/penny-harvest

gha_language: CSS

repo_name: flipside-org/penny-harvest


text:
When generating reports, `hourly` may be configured to work with multiple repositories and branches.

### Multiple branches

List trackable branches using the `repo.branch` parameter.

```yaml
repo:
	branch:
	- master
	- develop
```

!!! note
    `hourly-in` and `hourly-out` apply to the currently checkout out branch and are not affected by the `repo.branch` settings.

### Mutltiple repos

To configure hourly with multiple repos, add the following to your `hourly.yaml` file

```yaml
report:
  repos:
    - ${repo} # current repo's settings
    - name: "My Other Repo" # name of repo or ''
      branch: null # name(s) of branch or null for currently checked out
      gitdir: path/to/other/repo
```

Use `report.repos` to list other repos and their configurations.

### Report groupings

`report.grouping` will determine how labor will be grouped for time sheets and plotting.
This grouping is designed to be flexible to fit your time tracking needs.

#### Labor distributed accross repos, branches, and developer

To generate reports based on committer's emails:

```yaml
report:
  grouping:
    - repo
    - branch
    - email
```

Alternatively, you may divide work based on the commiter's name:

```yaml
report:
  grouping:
    - repo
    - branch
    - email
```

!!! note
    You can also do `name` and `email` if need be.

#### Total labor across multiple repos, independent of branches and developers

Here you need only specify that work should be grouped by `repo.name`

```yaml
report:
  grouping:
    - repo
```

#### Total labor per developer, independent of repos and branches

This may be used for tracking work for generating time sheets for a team of developers.

```yaml
report:
  grouping:
    - email
    - name
```

#### Example from `hourly` repo

The hourly repo has a top-level `hourly.yaml` that demonstrates using multiple branches.

<details>
	<summary> hourly.yaml </summary>

```yaml
{! hourly.yaml !}
```
</details>

repository: RandyMcMillan/hourly

repo_name: RandyMcMillan/hourly


text:
Package for fuzzy matching addresses in different datasets.

To conduct address matching, three main objects are used:

* An address object, for individual addresses.  This handles parsing, tokenising, standardising the text etc.
* A matcher object, which contains the core matching algorithm.  Given an "address_to_match", and a dict of potential_matches, it will find the best match
* A datagetter object.  This has two functions:  first, given an address, it can get_potential_matches_from_address.  Second, given a token, it returns the frequency with which that token is seen in the corpus of all addresses.  This helps the algorithm places greater weight on tokens which have higher 'discriminativeness'.

Functions quite effectively but still things to do:

* Need unit tests
* Need to clarify treatment of unicode.  Probably convert all strings to unicode at earliest opportunity.
* Need to be more explicit about use of arbitrary constants


text:
# anidub-loader

Download TV Series from http://online.anidub.com/ in Plex Media Server notation

## Usage

```bash
npm start page=http://online.anidub.com/anime_tv/full/2914-kovboy-bibop-cowboy-bebop-04-iz-26.html plex-path=~/Movies/TV\ Shows/ season=1
```

## Options

- `page` — Url for tv series home page on http://online.anidub.com/

- `plex-path` — Path to where videos will be saved

  > Default: `./`

- `title` — TV Series title.

- `season` — Season number.

  > Default: 1

- `episodes` — Range of episodes to download.

  Examples:

  ```
  episodes=1
  episodes=1,24
  episodes=1-24
  episodes=1-24,32
  ```

## Limitations

- Currently supports processing only for vk.com video hosting.

## Additional

- [Naming and Organizing TV Shows](https://support.plex.tv/hc/en-us/articles/200220687-Naming-Series-Season-Based-TV-Shows)

repository: a-ignatov-parc/anidub-loader

repo_name: a-ignatov-parc/anidub-loader