text:
---
title: HTML, oida. A slightly less minimalist Pandoc HTML template.
---

You know what's great? [Pandoc](https://pandoc.org). You know what's slightly less great? The readability of it's default HTML template. So I copied over the 7 CSS declarations from the [Better *beep*ing Website](http://bettermotherfuckingwebsite.com/). You're welcome.

## How do I use this?

Refer to the [Pandoc documentation](http://pandoc.org/MANUAL.html#templates) for now. I'll update this section when I get around to it.

To use this as your default template, move `html-oida.html` to the `templates` folder of your Pandoc [user data directory](http://pandoc.org/MANUAL.html#general-options) (search for `--data-dir`) and rename it to `default.html5`.

## Can I have a preview?

[Sure.](https://hirnsalat.github.io/html-oida/)

## I'm already in the preview, where do I download this?

[Over here.](https://github.com/hirnsalat/html-oida)

## Does it still support syntax highlighting, MathJax and other fancy Pandoc features?

Of course. Unless I broke something.

repository: hirnsalat/html-oida

repo_name: hirnsalat/html-oida


text:
# @ykey/raven-route

**raven-route** is Router for @ykey/raven.

## Requirement

## Installation

- package.json
```json
{
  "dependencies": {
    "@ykey/raven-route": "https://github.com/ykeyjp/raven-route.js.git"
  }
}
```
and `npm update` or `yarn install`.

## Contribution

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3.  Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## Licence

Copyright (c) 2017 ykeyjp
Released under the MIT license
[MIT](http://opensource.org/licenses/mit-license.php)

## Author
[ykeyjp](https://github.com/ykeyjp)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
layout:     post
title:      Neural Network - 2
subtitle:   Backpropagation
date:       2018-12-16
author:     William
header-img: img/post-bg-universe.jpg
catalog: true
tags:
    - Neural Network
---

# Neural NetWork
## Backpropagation Proof

Backpropagation is about understanding how changing the weights and biases in a network changes the cost function. Using backpropagation, our final target is calculate partial derivatives $\frac{\partial C}{\partial w}$ and $\frac{\partial C}{\partial b}$.

All the mathmatic behind it is just chain rule. First, let's go through the notation.

>- $w^l_{jk}$ denotes the weight for the connection from the $k^{th}$ neuron in $(l-1)^{th}$ layder to $j^{th}$ neuron in $l^{th}$ layer
>- $b^l_j$ denotes the bias of $j^{th}$ neuron in $l^{th}$ layer
>- $a^l_j$ denotes the activation(output) of $j^{th}$ neuron in $l^{th}$ layer
>- $z^l_j$ denotes intermediate result for $j^{th}$ neuron in $l^{th}$ layer
>- $\sigma$ denotes activation function

Above notations have relationship below:

$$a^l_j = \sigma(\sum_k w^l_{jk}a^{l-1}_k + b^l_j)$$

$$a^l_j = \sigma(z^l_j)$$

Vectorized:

$$a^l = \sigma(w^l*a^{l-1} + b^l)$$

$$a^l = \sigma(z^l)$$

>- $\delta^l_j$ denotes the error for $j^{th}$ neuron in $l^{th}$ layer

The definition of error $\delta^l_j$ is as below:

$$\delta^l_j = \frac{\partial C}{\partial z^l_j}$$

Then BP will relate intermediate result $\delta^l_j$ with our final target $\frac{\partial C}{\partial w}$ and $\frac{\partial C}{\partial b}$.

Next, let's prove backpropagation step by step.

**Step.1 Forward propagation.**

The input $x$ can be treated as $a^1$. Once we know $w$ and $b$, all the activation $a^2,a^3...a^L$ and intermediate result $z^2, z^3 ... z^L$ can be calculated using following equation:

$$z^l = w^l*a^{l-1} + b^l$$

$$a^l = \sigma(z^l)$$

This is called Forward Propagation.

**Step.2 Calculate error at last layer**

$$\delta^L_j = \frac{\partial C}{\partial z^L_j} = \frac{\partial C}{\partial a^L}*\frac{\partial a^L}{\partial z^L_j} = \frac{\partial C}{\partial a^L_j}*\sigma'(z^L_j)$$

>- L is the last layer (output layer)
>- Cost function $C$ is a function of all the outputs $a^L$
>- $\frac{\partial a^L_m}{\partial z^L_j} = 0 (m \neq j)$. So $\frac{\partial a^L}{\partial z^L_j} = \frac{\partial a^L_j}{\partial z^L_j}$.
>- $a^L_j = \sigma(z^L_j)$

Vectorized:

$$\delta^L = \frac{\partial C}{\partial a^L} \odot \sigma'(z^L) = \bigtriangledown_aC \odot \sigma'(z^L)$$

>- $\odot$ is element-wise product.
>- $\bigtriangledown_aC$ denotes the gradient of function $C$ on $a$.

**Step.3 Back propagation error**

$$z^{l+1}_j = \sum_k w^{l+1}_{jk}*a^l_k + b^{l+1}_j = \sum_k w^{l+1}_{jk}*\sigma(z^l_k) + b^{l+1}_j$$

$$\frac{\partial z^{l+1}_j}{\partial z^l_k} = w^{l+1}_{jk} * \sigma'(z^l_k)$$

$$\delta^l_k = \frac{\partial C}{\partial z^l_k} = \sum_j\frac{\partial C}{\partial z^{l+1}_j} * \frac{\partial z^{l+1}_j}{\partial z^l_k} = \sum_j\delta^{l+1}_j*w^{l+1}_{jk} * \sigma'(z^l_k)$$

Vectorized:

$$z^{l+1} = w^{l+1}*\sigma(z^l) + b^{l+1}$$

$$\delta^l = ((w^{l+1})^T\delta^{l+1})\odot\sigma'(z^l)$$

Uisng above equation, we can calculate backforward for all the $\delta^2, \delta^3 ... \delta^L$.

**Step.4 Calculate partial derivatives**

$$\frac{\partial C}{\partial b^l_j} = \frac{\partial C}{\partial z^l_j}*\frac{\partial z^l_j}{\partial b^l_j} = \delta^l_j*1 = \delta^l_j$$

$$\frac{\partial C}{\partial w^l_{jk}} = \frac{\partial C}{\partial z^l_j}*\frac{\partial z^l_j}{\partial w^l_{jk}} = \delta^l_j*a^{l-1}_k$$

Vectorized:

$$\frac{\partial C}{\partial b^l} = \delta^l$$

$$\frac{\partial C}{\partial w^l} = \delta^l*(a^{l-1})^T$$

## BP Slow Learning Issues - Saturated Neuron

Suppose using sigmoid function as activation function, its shape look like below:

As you can see, as input approching infinite or infinitesimal, its derivative approching 0.

$$\delta^L_j = \frac{\partial C}{\partial a^L_j}*\sigma'(z^L_j)$$

$$\delta^l_k = \sum_j\delta^{l+1}_j*w^{l+1}_{jk} * \sigma'(z^l_k)$$

In above two key equations, they both have $\sigma'$. So when the input for $\sigma'$ is a large positive or negative value, it will return a nearly 0 value. Then $\delta$ becomes very small, as a result, the partial derivatives are small (Neuron learns slowly).

To address this issue, the cross-entropy was introduced which will be discussed in next article.

## References
[Neural Networks and Deep Learning](neuralnetworksanddeeplearning.com/chap1.html
)

filename: 2018-12-16-NN Backpropagation.md


text:
[Sparkx](../README.md) > ["services/src/HTTPService"](../modules/_services_src_httpservice_.md)

# External module: "services/src/HTTPService"

## Index

### Classes

* [HTTPService](../classes/_services_src_httpservice_.httpservice.md)

### Interfaces

* [IHTTPHeaders](../interfaces/_services_src_httpservice_.ihttpheaders.md)
* [IQueryPrams](../interfaces/_services_src_httpservice_.iqueryprams.md)

---

gha_language: TypeScript

gha_license_id: MIT


text:
## About algorithm

An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.

An algorithm is a set of ordered instructions based on a formal language with the following conditions:

*   **Finite**. The number of instructions must be finite.
*   **Executable**. All instructions must be executable in some language-dependent way, in a finite amount of time.
*   **Deterministic**. The algorithm must be predictable.

An algorithm can be expressed in many ways: as a sequence of instructions; as a block-scheme; as a code in an existing or new programming language; as a piece of text in a human language; or in other, similar ways.

An algorithm can solve a class of problems. For example, both "sum 1 and 3" and "sum 4 and 5" are problems in the same class: "sum two integer numbers." Furthermore, a given class of problems can generally be solved by a variety of algorithms.

One important aspect of algorithm design is performance. For large datasets a good algorithm may outperform a poor algorithm by several orders of magnitude. Algorithm performance is often rated with [Big O or Θ notation](http://en.wikipedia.org/wiki/Big_O_notation), but one should be cautious with asymptotic notation, since big constants may be involved.

A key algorithm classification is known as [Algorithm Complexity](http://en.wikipedia.org/wiki/Computational_complexity_theory).

# Related Links

Additional resources on algorithms include:

*   [Algorithm on Wikipedia](http://en.wikipedia.org/wiki/Algorithm)
*   [Algorithm on Howstuffworks](http://computer.howstuffworks.com/question717.htm)
*   [Dictionary of Algorithms and Data Structures](http://xlinux.nist.gov/dads/)

gha_language: JavaScript


text:
### [CVE-2022-3287](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-3287)
![](https://img.shields.io/static/v1?label=Product&message=fwupd&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-256%20%7C%20CWE-552&color=brighgreen)

### Description

When creating an OPERATOR user account on the BMC, the redfish plugin saved the auto-generated password to /etc/fwupd/redfish.conf without proper restriction, allowing any user on the system to read the same configuration file.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/chnzzh/Redfish-CVE-lib

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

repo_name: trickest/cve


text:
# sample-template

## Commit Numero Uno
1. Created a repository on Github
2. Initialized it with a readme and an MIT license
3. Copied the repository and cloned it down into new directory
4. Switch to a new branch
5. Open repository in VSCode
6. Write first few instructions in the readme
7. Touch .gitignore makes a .gitignore file
8. Go to github.com/github/gitignore and click on the Global folder
9. Go to the mac operating system file and copy into your .gitignore
10. Go to the visual studio code file and copy into your .gitignore (or whatever editior you are on)
11. Also copy down other team members' test editors .gitignore's. Do the same for seperate operating systems.
12. Officially set up with a .gitignore and cloned down repository

## Commit Numero Dos
1. Make a .eslintrc that can be read by .eslint
2. Add specific rules to the .eslintrc or look at your previous .eslint's and grab those

## Commit Numero Tres
1. Make a new package.json through npm init
2. Change description, license, author and <email>
3. Add github after email in parenthesis
4. Change scripts test to mocha
5. npm install --save-dev mocha
6. npm install --save-dev eslint
7. Add "pretest": "eslint ." to the package.json
8. Or you can add "lint": "eslint .", "pretest": "npm run lint".
9. Add "start": "node server"
10. Change the main to the same file so node server or you can just get rid of it

repository: Clairefollett/sample-template

repo_name: Clairefollett/sample-template


text:
# RecogitoJS

__RecogitoJS__ is an experiment to extract the annotation functionality
of [Recogito](https://recogito.pelagios.org) to an independent, client-only
JavaScript library. With __RecogitoJS__, we want to bring Recogito-like
annotation to any website, and enable everyone to build customized annotation
applications more easily. [Try the demo](https://pelagios.org/recogito-text-js/index.html).

![Screenshot](screenshot.png)

__This project is just getting started. To make it happen, we need your help. Get in touch if you want to contribute!__

## Using RecogitoJS

The example below shows how to make text annotate-able with just a few lines of JavaScript.
The full API documentation is on the [Wiki](../../wiki/Developer-Documentation).

```html
<body>
  <!-- The text content we want to annotate -->
  <pre id="content">My text to annotate.</pre>

  <!-- Initialize Recogito and load a bunch of annotations -->
  <script type="text/javascript">
    (function() {

      var r = Recogito.init({
        // REQUIRED - id of the element to make annotate-able
        content: 'content',

        // OPTIONAL - 'true' for read-only display (default = false)
        readOnly: false,

        // OPTIONAL - a function that allows you to add your
        // your own CSS class names based on annotation characteristics.
        formatter: function(annotation) {
          return 'my-class';
        }
      });

      r.loadAnnotations('annotations.w3c.json');

      // Add event handlers using .on
      r.on('createAnnotation', function(annotation) {
        // Do something
      });

    })();
  </script>
</body>
```

## Developer Information

The plan is to organize the project into a number of sub-modules.

- __recogito-text-highlights__ is a dependency-free JavaScript
  library that handles text highlight rendering and mouse selection
- __recogito-annotation-editor__ is a [React](https://reactjs.org/)
  project for the annotation editor popup window
- __recogito-relations__ is a port of Recogito's
  [relationship annotation](https://recogito.pelagios.org/help/relations)
  functionality

To run the project in development mode:

- Enter the `recogito-text-highlights` folder and run `npm install` to
  install dependencies
- Do the same for the `recogito-relations` folder
- Enter the `recogito-annotation-editor` folder and run `npm install`
- Run `npm start` and go to [localhost:3000](http://localhost:3000)

To build the minified bundle, run `npm run build`.

## Annotation Format

RecogitoJS supports annotations in JSON-LD, according to the
[W3C Web Annotation model](https://www.w3.org/TR/annotation-model/).

```json
{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "id": "http://example.org/annotation/494718ed-72a7-4d33-b78e-e74b5f00259e",
  "type": "Annotation",
  "body": [{
    "type": "TextualBody",
    "value": "This is a comment."
  },{
    "type": "TextualBody",
    "value": "MyTag",
    "purpose": "tagging"
  }],
  "target": {
    "source": "http://example.com/my-page",
    "selector": [{
      "type": "TextQuoteSelector",
      "exact": "Troy"
    },{
      "type": "TextPositionSelector",
      "start": 106,
      "end": 110
    }]
  }
}
```

## Next Steps

This project is just getting started. Ultimately, we'd like to port the full
range of features from Recogito to RecogitoJS. For now, however, the following
things are highest up on the wishlist:

- Handling user identity
- Geo-Tagging via the Recogito API
- A generic semantic tagging component based on Wikidata and/or the OpenRefine
  Reconciliation API specification
- TEI annotation via [CETEIcean](https://github.com/TEIC/CETEIcean)

## License

[BSD 3-Clause](LICENSE) (= feel free to use this code in whatever way
you wish. But keep the attribution/license file, and if this code
breaks something, don't complain to us :-)

repository: performant-software/recogito-text-js

repo_name: performant-software/recogito-text-js


text:
# Android/Java client guide

The official Java client handles all communication in realtime with the server and is specifically optimized for Android projects. It implements all features in the server and is compatible with Java 1.7+ and Android 2.3+. To work with the Java client you'll need a build tool like Gradle and an editor/IDE like IntelliJ or Eclipse.

!!! info "Compatibility with Nakama 2"
    This client guide is only available for Nakama 1 and has not yet been updated to support Nakama 2. Leave a comment on [this GitHub issue](https://github.com/heroiclabs/nakama-java/issues/9) if you are interested in using this client with Nakama 2.

## Download

The client can be downloaded from GitHub releases. You can download "nakama-java-$version.jar" or "nakama-java-$version-all.jar" which includes a shadowed copy of all dependencies. If you use a build tool like Gradle you can skip the download and fetch it from the [central repository](#install-and-setup).

For upgrades you can see changes and enhancements in the CHANGELOG before you update to newer versions.

!!! Bug "Help and contribute"
    The Java client is open source on GitHub. Please report issues and contribute code to help us improve it.

## Install and setup

When you've downloaded the jar package you should include it in your project or if you use Gradle add the client as a dependency to your "build.gradle".

```groovy
repositories {
    maven {
        url 'https://dl.bintray.com/heroiclabs/default/'
    }
}

dependencies {
  compile(group: 'com.heroiclabs.nakama', name: 'client', version: '+')
  compile('org.slf4j:slf4j-api:1.7.25') {
    force = true // don't upgrade to "1.8.0-alpha2"
  }
}
```

The client object is used to execute all logic against the server.

```java
import com.heroiclabs.nakama.Client;

public class NakamaSessionManager {
  private final Client client;

  public NakamaSessionManager() {
    client = DefaultClient.builder("defaultkey")
        .host("<IP_ADDRESS>")
        .port(7350)
        .ssl(false)
        .build();
  }
}
```

We use the builder pattern with many classes in the Java client. Most classes have a shorthand ".defaults()" method to construct an object with default values.

!!! Note
    By default the client uses connection settings "<IP_ADDRESS>" and 7350 to connect to a local Nakama server.

```java
// Quickly setup a client for a local server.
Client client = DefaultClient.defaults("defaultkey");
```

### For Android

Android uses a permissions system which determines which platform services the application will request to use and ask permission for from the user. The client uses the network to communicate with the server so you must add the "INTERNET" permission.

```xml
<uses-permission android:name="android.permission.INTERNET"/>
```

## Authenticate

With a client object you can authenticate against the server. You can register or login a [user](user-accounts.md) with one of the [authenticate options](authentication.md).

To authenticate you should follow our recommended pattern in your client code:

   1\. Build an instance of the client.

```java
Client client = DefaultClient.defaults("defaultkey");
```

   2\. Login or register a user.

!!! Tip
    It's good practice to cache a device identifier on Android when it's used to authenticate because they can change with device OS updates.

```java
String id = UUID.randomUUID().toString();
AuthenticateMessage message = AuthenticateMessage.Builder.device(id);
Deferred<Session> deferred = client.login(message)
deferred.addCallbackDeferring(new Callback<Deferred<Session>, Session>() {
  @Override
  public Deferred<Session> call(Session session) throws Exception {
    return client.connect(session);
  }
}).addErrback(new Callback<Deferred<Session>, Error>() {
  @Override
  public Deferred<Session> call(Error err) throws Exception {
    if (err.getCode() == Error.ErrorCode.USER_NOT_FOUND) {
      System.out.println("User not found, we'll register the user.");
      return client.register(message);
    }
    throw err;
  }
}).addCallbackDeferring(new Callback<Deferred<Session>, Session>() {
  @Override
  public Deferred<Session> call(Session session) throws Exception {
    return client.connect(session);
  }
}).addCallback(new Callback<Session, Session>() { // See step (3).
  @Override
  public Session call(Session session) throws Exception {
    System.out.format("Session connected: '%s'", session.getToken());
    return session;
  }
}).addErrback(new Callback<Error, Error>() {
  @Override
  public Error call(Error err) throws Exception {
    System.err.format("Error('%s', '%s')", err.getCode(), err.getMessage());
    return err;
  }
});
```

In the code above we use `AuthenticateMessage.Builder.device(id)` but for other authentication options have a look at the [code examples](authentication.md#register-or-login).

The client uses [promise chains](#promise-chains) for an easy way to execute asynchronous callbacks.

   3\. Store session for quick reconnects.

We can replace the callback marked in step 2 with a callback which stores the session object on Android.

```java
Callback<Session, Session> callback = new Callback<Session, Session>() {
  @Override
  public Session call(Session session) throws Exception {
    System.out.format("Session connected: '%s'", session.getToken());
    // Android code.
    SharedPreferences pref = getActivity().getPreferences(Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = pref.edit();
    editor.putString("nk.session", session.getToken());
    editor.commit();
    return session;
  }
};
```

A __full example__ class with all code above is [here](#full-android-example).

## Send messages

When a user has been authenticated a session is used to connect with the server. You can then send messages for all the different features in the server.

This could be to [add friends](social-friends.md), join [groups](social-groups-clans.md) and [chat](social-realtime-chat.md), or submit scores in [leaderboards](gameplay-leaderboards.md), and [matchmake](gameplay-matchmaker.md) into a [multiplayer match](gameplay-multiplayer-realtime.md). You can also execute remote code on the server via [RPC](runtime-code-basics.md).

The server also provides a [storage engine](storage-collections.md) to keep preferences and other records owned by users. We'll use storage to introduce how messages are sent.

```java
String json = "{\"jsonkey\":\"jsonvalue\"}";

CollatedMessage<ResultSet<RecordId>> message = StorageWriteMessage.Builder.newBuilder()
    .record("someBucket", "someCollection", "myRecord", json)
    .build();
Deferred<ResultSet<RecordId>> deferred = client.send(message)
deferred.addCallback(new Callback<ResultSet<RecordId>, ResultSet<RecordId>>() {
  @Override
  public ResultSet<RecordId> call(ResultSet<RecordId> list) throws Exception {
    for (RecordId recordId : list) {
      String version = new String(recordId.getVersion());
      System.out.format("Record stored '%s'", version);
    }
    return list;
  }
}).addErrback(new Callback<Error, Error>() {
  @Override
  public Error call(Error err) throws Exception {
    System.err.format("Error('%s', '%s')", err.getCode(), err.getMessage());
    return err;
  }
});
```

Have a look at other sections of documentation for more code examples.

## Promise chains

The client uses promises to represent asynchronous actions with the Deferred library. This makes it easy to chain together actions which must occur in sequence and handle errors.

A deferred object is created when messages are sent and can attach callbacks and error handlers for working on the deferred result.

```java
Callback<Session, Session> callback = new Callback<Session, Session>() {
  @Override
  public Session call(Session session) throws Exception {
    System.out.format("Session connected: '%s'", session.getToken());
    return session;
  }
};

Callback<Error, Error> errback = new Callback<Error, Error>() {
  @Override
  public Error call(Error err) throws Exception {
    System.err.format("Error('%s', '%s')", err.getCode(), err.getMessage());
    return err;
  }
};
```

You can chain callbacks because each callback returns a `Deferred<T>`. Each method on the `Client` returns a `Deferred<T>` so you can chain calls with `deferred.addCallbackDeferring(...)`.

```java
String id = UUID.randomUUID().toString();
AuthenticateMessage message = AuthenticateMessage.Builder.device(id);
Deferred<Session> deferred = client.register(message)
deferred.addCallbackDeferring(new Callback<Deferred<Session>, Session>() {
  @Override
  public Deferred<Session> call(Session session) throws Exception {
    return client.connect(session);
  }
}).addCallback(new Callback<Session, Session>() {
  @Override
  public Session call(Session session) throws Exception {
    System.out.format("Session connected: '%s'", session.getToken());
    return session;
  }
});
```

## Logs and errors

The [server](install-configuration.md#log) and the client can generate logs which are helpful to debug code. To log all messages sent by the client you can enable "trace" when you build a `"Client"`.

```java
Client client = DefaultClient.builder("defaultkey")
    .trace(true)
    .build();
```

The client uses SLF4J as the logging facade framework. This lets you choose whatever underlying logging framework you want to use. You should add one to your dependencies.

```groovy
dependencies {
  compile(group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.+')
}
```

With Android you may want to use "slf4j-android" instead.

```groovy
dependencies {
  compile(group: 'org.slf4j', name: 'slf4j-android', version: '1.7.+')
}
```

Every error in the Java client implements the `"Error"` class. It contains details on the source and content of an error:

```java
Callback<Error, Error> errback = new Callback<Error, Error>() {
  @Override
  public Error call(Error err) throws Exception {
    System.err.format("Error code '%s'", err.getCode());
    System.err.format("Error message '%s'", err.getMessage());
    return err;
  }
};
```

## Full Android example

An example class used to manage a session with the Java client.

```java
package com.heroiclabs.nakama.example;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

import com.heroiclabs.nakama.*;
import com.heroiclabs.nakama.Error;
import com.heroiclabs.nakama.Error.ErrorCode;
import com.stumbleupon.async.*;

public class NakamaSessionManager {
  private final Client client;
  private final Callback<Error, Error> errback;
  private Session session;

  public NakamaSessionManager() {
    client = DefaultClient.builder("defaultkey").build();
    errback = new Callback<Error, Error>() {
      @Override
      public Error call(Error err) throws Exception {
        System.err.format("Error('%s', '%s')", err.getCode(), err.getMessage());
        return err;
      }
    };
  }

  /** Get the Client reference to send/receive messages from the server. */
  public Client getClient() {
    return client;
  }

  /**
   * Login (or register) and connect a user using a device ID.
   * @param activity The Activity calling this method.
   * @param deviceId The Device ID to login with.
   */
  public void connect(final Activity activity, String deviceId) {
    final AuthenticateMessage message = AuthenticateMessage.Builder.device(deviceId);
    client.login(message)
      .addCallbackDeferring(new Callback<Deferred<Session>, Session>() {
        @Override
        public Deferred<Session> call(Session session) throws Exception {
          // Login was successful.
          // Store the session for later use.
          SharedPreferences pref = activity.getPreferences(Context.MODE_PRIVATE);
          pref.edit()
            .putString("nk.session", session.getToken())
            .apply();

          return client.connect(session);
        }
      })
      .addErrback(new Callback<Deferred<Session>, Error>() {
        @Override
        public Deferred<Session> call(Error err) throws Exception {
          if (err.getCode() == ErrorCode.USER_NOT_FOUND) {
            // Login failed because this is a new user.
            // Let's register instead.
            System.out.println("User not found, registering.");
            return client.register(message);
          }
          throw err;
        }
      })
      .addCallbackDeferring(new Callback<Deferred<Session>, Session>() {
        @Override
        public Deferred<Session> call(Session session) throws Exception {
          // Registration has succeeded, try connecting again.
          // Store the session for later use.
          SharedPreferences pref = activity.getPreferences(Context.MODE_PRIVATE);
          pref.edit().putString("nk.session", session.getToken()).apply();

          return client.connect(session);
        }
      })
      .addCallback(new Callback<Session, Session>() {
        @Override
        public Session call(Session session) throws Exception {
          // We're connected to the server!
          System.out.println("Connected!");
          return session;
        }
      })
      .addErrback(errback);
  }

  /**
   * Attempt to restore a Session from SharedPreferences and connect.
   * @param activity The Activity calling this method.
   */
  public void restoreSessionAndConnect(Activity activity) {
    SharedPreferences pref = activity.getPreferences(Context.MODE_PRIVATE);
    // Lets check if we can restore a cached session.
    String sessionString = pref.getString("nk.session", null);
    if (sessionString == null || sessionString.isEmpty()) {
      return; // We have no session to restore.
    }

    Session session = DefaultSession.restore(sessionString);
    if (session.isExpired(System.currentTimeMillis())) {
      return; // We can't restore an expired session.
    }

    final NakamaSessionManager self = this;
    client.connect(session)
      .addCallback(new Callback<Session, Session>() {
        @Override
        public Session call(Session session) throws Exception {
          System.out.format("Session connected: '%s'.", session.getToken());
          self.session = session;
          return session;
        }
      });
  }
}
```

## Client reference

You can find the Java Client Reference [here](https://heroiclabs.github.io/nakama-java/current/).

repository: CoreyVH/nakama-docs

repo_name: CoreyVH/nakama-docs


text:
# Viewport Resizer

[![GitHub version](https://badge.fury.io/gh/maltewassermann%2Fviewport-resizer.svg)](https://badge.fury.io/gh/maltewassermann%2Fviewport-resizer)

__Responsive Design Testing Tool__

Viewport resizer is a browser-based tool to test any website’s responsiveness. It is available on http://lab.maltewassermann.com/viewport-resizer.

repository: AzimMahmud/viewport-resizer

repo_name: AzimMahmud/viewport-resizer


text:
## Format
This parser expects a JSON file with the following structure:
```json
{
"classes" : {
    "MyClassName" : {
        ...
      }
  }
}
```

Within the classes object each property will represent a class, the name of the class will be its key and its definition,
an object.

### Class Definition
A class definition is an object whose properties can contain any value which JSON accepts, that is:
- Numbers
- Strings
- Lists
- Objects

So for example, the following would define a valid class within this format:
```json
{
"classes": {
    "MyClassName": {
        "myIntProp": 13,
        "myFloatProp": 13.0,
        "myStrProp": "DummyValue",
        "myListProp": [1, 4, "Word", ["Inner", "List", "Values"]],
        "myObjProp": {
            "innerProp" : 3
         }
      }
  }
}
```
Classes can be named anything you want.

### Class Inheritance
It is possible to inherit the properties of another class by using a specially reserver keywork `Inherits` as a property
for a class. This property MUST be a list of strings where each string is the name of another class within the `classes` object.

The order of definition does not matter so long as it is properly named.

Example:
```json
"classes": {
    "MyClassName": {
        "myIntProp": 13,
        "myFloatProp": 13.0,
        "myStrProp": "DummyValue",
        "myListProp": [1, 4, "Word", ["Inner", "List", "Values"]],
        "myObjProp": {
            "innerProp" : 3
         }
      },
      "SecondClassName" : {
        "Inherits": ["MyClassName"],
        "childProp": "This is a new value",
        "myStrProp": "This is overwritten by child"
      }
  }
  ```

  As per standard inheritance rules, children will inherit all properties from their parents and if a property is redefined
  within the child then that value is the one that will be written.

  The JSON above once parsed produces the following result:

  ```json
  "MyClassName": {
    "myFloatProp": 13.0,
    "myListProp": [1, 4, "Word", ["Inner", "List","Values"]],
    "myIntProp": 13,
    "myObjProp": {
      "innerProp": 3
    },
    "myStrProp": "DummyValue"
  },
  "SecondClassName": {
    "myFloatProp": 13.0,
    "myIntProp": 13,
    "myObjProp": {
      "innerProp": 3
    },
    "myStrProp": "This is overwritten by child",
    "myListProp": [1, 4, "Word", ["Inner", "List","Values"]],
    "childProp": "This is a new value"
  }
  ```
It is important to note that the order of the properties is not important, but rest assured that inheritance is always
solved first.

### Private properties
It is also possible to define properties that are private to that class, that is, will not be inherited by any class
that derives from them. this is done by prefixing the name of the property that will be private with the string `$_`.

Example:

```json
{
"classes" : {
    "MyClassName" : {
        "$_MyPrivateProp": "This will not be inherited",
        "PublicProp": "This will be inherited"
     },
     "MyOtherClass": {
      "Inherits": ["MyClassName"]
     }
  }
}
```
The above JSON produces as a result:

```json
{
  "MyClassName" : {
      "MyPrivateProp": "This will not be inherited",
      "PublicProp": "This will be inherited"
   },
   "MyOtherClass": {
     "PublicProp": "This will be inherited"
   }
}
```

Notice that the private prefix is dropped on the parsed result.

### Class Reference
Class definitions also allow to reference another class in order to create an "instance" of that class,
this is useful for composing classes in lists or other properties.

In order to reference another class simply write a string value which is the name of another class prefixed with the string
`ref_`:

E.g: `ref_MyClassName`

Usage example:

```json
{
"classes" : {
    "SwordClass" : {
        "name": "Sword",
        "weight": 50,
        "sharpness": 10
     },
     "ShieldClass": {
      "name": "Shield",
      "defense": 50
     },
     "WandClass": {
      "name": "Wand",
      "magic": 30
     },
     "BackpackClass": {
       "name": "Backpack",
       "contents": ["ref_SwordClass", "ref_ShieldClass", "ref_WandClass"]
     }
  }
}
```

The code above produces the following result:

```json
{
  "ShieldClass": {
    "name": "Shield",
    "defense": 50
  },
  "WandClass": {
    "name": "Wand",
    "magic": 30
  },
  "SwordClass": {
    "name": "Sword",
    "weight": 50,
    "sharpness": 10
  },
  "BackpackClass": {
    "name": "Backpack",
    "contents": [
      {
        "name": "Sword",
        "weight": 50,
        "sharpness": 10
      },
      {
        "name": "Shield",
        "defense": 50
      },
      {
        "name": "Wand",
        "magic": 30
      }
    ]
  }
}
```

## Script Usage
Simply run the script `main.py` with your formatted JSON using Python version 3.5 or above.

E.g: `python3 main.py my_json_file.json`

This will generate an `output.json` file with the parsed result.

license: Unlicense

gha_license_id: Unlicense


text:
# Recognition-using-IOT
## What is IOT?
**The Internet of Things (IoT) refers to a system of interrelated, internet-connected objects that are able to collect and transfer data over a wireless network without human intervention.** The Internet of things describes the network of physical objects—“things”—that are embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the Internet.
## How it works?
![image](https://user-images.githubusercontent.com/78999467/110644495-40367b80-81dd-11eb-90f7-72461b0e9fab.png)

The face detection part is deployed in the IoT devices and the computation-intensive task, i.e., face recognition is carried out in backend Cloud servers. The system uses Local Binary Pattern Histograms to recognize the person from the local database created for the family members of the house. Security, monitoring, and control to automation in real-time are the key components of this system. Total processing time can be further reduced by deploying a face recognition application from Core Cloud to Edge Cloud. Furthermore, the k-nearest neighbor algorithm shows promising results compared to other face recognition algorithms.

### The hardware required to implement this system:
- Raspberry Pi 3 microprocessor

![image](https://user-images.githubusercontent.com/78999467/110644893-a58a6c80-81dd-11eb-8016-bf005009d410.png)

- external web camera

![image](https://user-images.githubusercontent.com/78999467/110644944-afac6b00-81dd-11eb-83a1-3cfd4fbd6548.png)

- stepper motor

![image](https://user-images.githubusercontent.com/78999467/110645001-bb982d00-81dd-11eb-8fe0-506a3b736a9e.png)


text:
# Set up image build

You have two options to build Docker container images:

## 1. Manual image builds (not preferred)

You can run the following command to build the container images:

    PROJECT=<your-id> make docker-images

This will create 3 container images. Verify by running:

```sh
$ docker images
REPOSITORY                                  TAG        SIZE
gcr.io/foo/userdirectory                    latest     13.8 MB
gcr.io/foo/coffeedirectory                  latest     14.5 MB
gcr.io/foo/web                              latest     13.5 MB
```
You can then use the following command to push images to
[Google Container Registry](https://cloud.google.com/container-registry/):

    gcloud docker -- push <image-name>

However, this method is not recommended as it is not automated and it does not
tag images with Git commit IDs to identify them (always tags as `:latest`).

## 2. Automated image builds (preferred)

You can up automate continuous builds using the [Google Cloud Container
Builder](https://cloud.google.com/container-builder/)

1. Fork this repository on GitHub
1. Go to Cloud Platform Console → Container Registry → [Build Triggers](https://console.cloud.google.com/gcr/triggers)
   → Add Trigger
1. Pick the coffeelog repository (that is, your fork of my repo)
1. Select the "cloudbuild.yml" option and specify the file path as that.
1. Create the trigger.
1. Trigger the first build manually.
1. See the logs if the image build succeeds.

Verify the images are pushed (the image name format should be
`gcr.io/PROJECT_ID/...`):

```sh
$ gcloud alpha container images list

NAME
gcr.io/ahmetb-starter/coffeedirectory
gcr.io/ahmetb-starter/userdirectory
gcr.io/ahmetb-starter/web
```

repository: ahmetb/coffeelog

gha_language: Go

repo_name: ahmetb/coffeelog


text:
# Team Tracker

Helps users to track teams attending a hackathon.

This is an Epicodus friday project for Java that focuses on behavior testing, encapsulated classes, getter methods, using handlebars with spark, and proper usage of .gitignore.

## Getting Started

To run this application you will need to clone/download the contents of the repository and compile them through IntelliJ IDEA.

Once the application is running, follow the console prompts.

### Prerequisites

You will need the following packages and software installed:

```
Java JDK 1.8.0_151
JAVA JRE 1.8.0_151
IntelliJ IDEA
dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile "com.sparkjava:spark-core:2.6.0"
    compile "com.sparkjava:spark-template-handlebars:2.5.5"
    compile 'org.slf4j:slf4j-simple:1.7.21'
}
```
### Specifications

## Built With

* [IntelliJ IDEA](https://www.jetbrains.com/idea/) - JAVA IDE

## Authors

* **Jun Li** - [june11084](https://github.com/june11084)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
# Course work for Intrdocution of Object Oriented Programming

This is a course work for one of our UTA's mandatory courses. The fi folder is not mine, but is needed to run the code.

## Intro

Java Project. Starts without parameters.

```
List of commands
```
Works like linux terminal, with just a little bit different commands

md = make dir
mf = make file
ls = list
cp = copy
find = ....
rm = delete
cd = change directory
mv = rename
exit = ...


text:
This repository contains a cross platform suite of client API for the MarkLogic Server REST API.

## Introduction

The MLCPlusPlus project maintains the MarkLogic C++ mlclient API. This API provides a C++ native connection
to MarkLogic Server version 6 and above.

A C wrapper API around the core C++ API is also provided. This enables legacy C applications to be configured to
talk to MarkLogic Server. All C++ usage is abstracted behind this wrapper API.

Cross platform C# and Python wrappers are also now available! These reflect those language's own programming idioms,
but use the core C++ API for speed of execution. This is transparent to the developer.

## Latest release

The latest release is 8.0.2 - See [The release notes](https://github.com/adamfowleruk/mlcplusplus/blob/develop/documentation/release-notes/release-notes-8.0.2.md) for details.

Note the Major and Minor version numbers of this project track MarkLogic Server, the revision number tracks this API's changes, rather than the revision number of MarkLogic Server.

## Documentation

Various documentation is available:-
 - Client documentation home page for all languages - http://adamfowleruk.github.io/mlcplusplus/api/index.html
 - GitHub future Release features - https://github.com/adamfowleruk/mlcplusplus/milestones
 - GitHub Issues tracker - https://github.com/adamfowleruk/mlcplusplus/issues

## Getting involved

Please email adam dot fowler at marklogic.com if you are interested in helping out.

repository: dmcassel/mlcplusplus

branch_name: refs/heads/develop

repo_name: dmcassel/mlcplusplus


text:
# Changelog

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

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres roughly to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2021-03-06

* FIX: Moved Celery task creation to `ContestManager.add` method
* DOC: Added README, LICENSE, and CHANGELOG (this also became version 1.0.0 by default, replacing
	the previous version number system, a shrugging emoji)
* TST: Started writing tests for cryptic contest views
* STY: Pylint-inspired fixes, including line length and standardizing tabs versus spaces single
	versus double quotes

gha_language: Python


text:
# react-weather-forecast

React's weather forecast application using OpenWeatherMap API.
[Demo](http://tom-snaphunt-challenge.surge.sh/)

## Getting started

Instructions for running and using the application.

### Prerequisites

You need to install (example of software that I used).

- node
- npm

Tested in browsers: Chrome, Mozilla, Edge, Safari.

### Installing and start

```
  npm i
  npm start
```

Application will run on `<IP_ADDRESS>:3000` for testing on other device. Should be replaced by `localhost:3000`.

### Production

```
  npm run build
```

Build will be located in the directory `./static`.

## Mockup

### My thought process

1) I spend 8 hours  on the test.
2) If you are given 14 more days, what further improvements or enhancements would you implement:
   - Implement Unit Test, e2e Test, apply CI/CD.
   - Enhance optimisation (i.e. File size, lazy loading).
   - Use eslint and configuration linter strict mode for coding styles and format code auto with prettier.
3) Which parts of your work are you most proud of?
   - Mobile responsive.
   - Applied HOC as transforms a component into another component.
   - Apply React.lazy to render a dynamic import as a regular component, Suspense component to show some fallback content while we’re waiting for it to load - such as a loading indicator.
   - Use Redux architecture revolves around a strict unidirectional data flow.
   - Work with a Remote API using Redux Saga, easier to manage, more efficient to execute, simple to test, and better at handling failures.
4) Which parts of the challenge do you spend the most time on?
   - Setup Base-code, define structure and libraries will be used.


text:
# //base/memory Types

## Overview
This directory contains a variety of pointer-like objects (aka smart pointers).
This is a brief overview of what they are and how they should be used. Refer to
individual header files for details. C++ is not memory safe, so use these types
to help guard against potential memory bugs.
There are other pointer-like object types implemented elsewhere that may be
right for a given use case, such as `absl::optional<T>` and
`std::unique_ptr<T>`. More on all types in video form
[here](https://youtu.be/MpwbWSEDfjM?t=582s) and in a doc
[here](https://docs.google.com/document/d/1VRevv8JhlP4I8fIlvf87IrW2IRjE0PbkSfIcI6-UbJo/edit?usp=sharing).

## `raw_ptr<T>`
Use for class fields/members that would otherwise be a `T*`.

This is a weakly refcounted wrapper for a `T*` (also called a raw
pointer). When the object is deleted, the allocator will "poison" the memory
that object occupied and keep the memory around so it’s not reused. This reduces
the risk and impact of a use-after-free bug.

Depending on the use case, it's possible a smart pointer with additional
features would be more appropriate, but if none of those are applicable or
necessary, `raw_ptr<T>` is preferred over a `T*`.

For more information, see [`raw_ptr.md`](./raw_ptr.md); for guidance on
usage, see
[the style guide](../../styleguide/c++/c++.md#non_owning-pointers-in-class-fields).

## `raw_ref<T>`
Use for class fields/members that would otherwise be a `T&`.

This shares much in common with `raw_ptr<T>`, but asserts that the
`raw_ref<T>` is not nullable.

For more information, see [`raw_ptr.md`](./raw_ptr.md); for guidance on
usage, see
[the style guide](../../styleguide/c++/c++.md#non_owning-pointers-in-class-fields).

## `base::WeakPtr<T>`
Use when a reference to an object might outlive the object itself.

These are useful for asynchronous work, which is common in Chrome. If an async
task references other objects or state, and it's possible for that state to be
destroyed before the task runs, those references should be held in a
`WeakPtr<T>`. Each `WeakPtr<T>` is associated with a `WeakPtrFactory<T>`. When
the associated factory (usually owned by T) is destroyed, all `WeakPtr<T>` are
invalidated (becomes null) rather than becoming use-after-frees. If such
references should never outlive the object, consider using SafeRef instead.

## `base::SafeRef<T>`
Use to express that a reference to an object must not outlive the object.

An example is if you have a class member that you want to guarantee outlives the
class itself. SafeRef automatically enforces the lifetime assumptions and
eliminates the need for validity checks.

If the assumption that the object is valid is broken, then the process
terminates safely and generates a crash report. Though not ideal, it's
preferable to a potentially undiscovered security bug.

This type is built on top of WeakPtr, so if you want a `SafeRef<T>`, T needs a
WeakPtrFactory as a member. It works like `WeakPtr`, but doesn't allow for a
null state. There's also overlap with `raw_ptr`, though this was implemented
first.

## `base::scoped_refptr<T>`
Use when you want manually managed strong refcounting. Use carefully!

It’s an owning smart pointer, so it owns a pointer to something allocated in the
heap and gives shared ownership of the underlying object, since it can be
copied. When all `scoped_refptr`s pointing to the same object are gone, that
object gets destroyed.

This is Chrome's answer to `std::shared_ptr<T>`. It additionally requires T to
inherit from `RefCounted` or `RefCountedThreadSafe`, since the ref counting
happens in the object itself, unlike `shared_ptr<T>`. It's preferred for an
object to remain on the same thread, as `RefCounted` is much cheaper. If there
are `scoped_refptr`s to the same object on different threads, use
`RefCountedThreadSafe`, since accesses to the reference count can race.
In this case, without external synchronization, the destructor can run on any
thread. If the destructor interacts with other systems it is important to
control and know which thread has the last reference to the object, or you can
end up with flakiness.

repository: chromium/chromium

repo_name: chromium/chromium


text:
# Constants and Utilities

_Consumable constants and helpers for clients and servers to help mitigate the [magic string problem](https://en.wikipedia.org/wiki/Magic_string)._

## Contributing

### Organization

This project is organized in a very _flat_ structure to enable simple discoverability.

### Development

There's nothing to run. Just write code and tests.

### Committing

This project uses [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) and as such, has specific committing guidelines. **Your commit will be rejected if you do not adhere to these guidelines.**

### Tests

Running the tests is super simple. We use [Jest](https://jestjs.io/en/) for testing.

```bash
# Run the tests once (for CI)
npm run test

# Run the tests in watch mode (for development)
npm run test:watch
```

### Releases

We use [semantic-release](https://github.com/semantic-release/semantic-release) to manage GitHub and NPM releases. The `semantic-release` commands will automatically generate tags, releases, and a [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) CHANGELOG with one command.

The releases will happen in response to merged PRs on this Repo and should not be triggered locally.

**If you know what you're doing** and really want to trigger a release to GitHub and NPM on your local machine, you can run:

```bash
npm run release -- --no-ci
```

You'll notice that we do not have to specify the specific type of version upgrade `(patch|minor|major)`. Semantic-release will automatically parse our conventional commit messages and generate the proper semantic version upgrade for us.

## License

MIT © [masiamj](https://github.com/masiamj)

repository: eeon-tech/constants-and-utils

repo_name: eeon-tech/constants-and-utils


text:
## DCAT Merger ##

This [Node.js](http://nodejs.org) package allows to merge the [DCAT](http://www.w3.org/TR/vocab-dcat/) information of several sources into one single Turtle file. Below you can find a short summary of what happens under the hood.

- We connect the existing datasets to the new catalog.
- We create the necessary Catalog Records, between the catalog and the datasets.
- We enhance the information of the datasets by using the available keywords and descriptions together with *named entity recognition (NER)*. NER is facilitated through DBpedia Spotlight.
- We expand the information provided by DBpedia spotlight by querying DBpedia itself. This is done using [Linked Data Fragments](http://linkeddatafragments.org/) (via <http://fragments.dbpedia.org/2014/en>).

### Installation ###

- Install [Node.js](http://nodejs.org)
- Clone this repo
- Navigate to the folder of the repo
- Execute `npm install . -g`

### Usage ###

Create a `config.json` with the sources you want to merge. An example `config.json` can be found in the repo. For every source you need to provide the name and the url or file. You want to choose the option 'file' if you want to read a local Turtle file. Here, you can also set the DBpedia spotlight instances you want to use for NER. By default the use of NER is disabled, however, you can enable it by adding `"useNER" : true` to your `config.json`. *In the folder `data` you can find some example Turtle files.*

#### Stand Alone Application ####
- Execute `dcat-merger [OPTION]...`.

Output control

- `-v, --verbose`: verbose
- `-c, --config` : config file, if not specified the program will look for 'config.json' in the current directory.
- `-o, --output` : output file, if no output file is specified output is redirect to `stdout`.
- `-t, --theme`  : config file for the themeMatcher, if not specified the default one will be used.
- `-s, --spatial`: config file for the spatialDetector, if not specified the default one will be used.
- `-h`, `--help` : show help
- `--version`: show version information

#### Node.js Module ####

You can also use the module via

```javascript
var dcatMerger = require('dcat-merger');

//here you can choose your own custom 'helpers'
//or the ones that came with this package, those can be found
//in the 'lib' folder
//for this examples we use the ones from this package

var spatialDetector = require('../lib/spatialDetector.js');
var themeMatcher = require('../lib/themeMatcher.js');

//you also need to call some methods before they are ready for use
//ttl is a string containing all the triples in Turtle format,
//example in 'resources' folder
themeMatcher.setMappingTriples(ttl);

//spatialFile is a json file, example in  'resources' folder
spatialDetector.setConfig(require(spatialFile));

//you also need to set the config, example in config.json
dcatMerger.setConfig(getConfigFromFile());
dcatMerger.setThemeMatcher(themeMatcher);
dcatMerger.setSpatialDetector(spatialDetector);

dcatMerger.merge().then(function(triples){
	console.log(triples);
});
```

The variable `triples` is an array containing objects with the following elements: subject, predicate, object and graph (= one triple).

### Remarks ###

- To match the different concepts from DBpedia with those from the TDT/dcat taxonomy, we created a basic mapping between the two. Replacing themeMatcher.js with a custom implementation allows to inject your own dynamic/static mapping.
- To define the spatial property of a dataset, we created a spatialDetector.js. Based on the found resources (using NER), we determine if the resources point to a place/location etc. If you want to determine which types of classes are recognised as spatial, you can edit `resources/spatialConfig.js` (if you run it in a Node.js Application).
- Tested on Ubuntu 14.04.

### License ###

MIT licensed

Authors:
 * Pieter Heyvaert<EMAIL_ADDRESS>- [@PHaDventure](http://www.twitter.com/PHaDventure)
 * Pieter Colpaert<EMAIL_ADDRESS>

repository: pheyvaer/dcat-merger

repo_name: pheyvaer/dcat-merger


text:
# molecular-meshfile
GPU-optimized 3D mesh file format with command line exporter and header-only runtime component.

Files contain a collection of buffers that can be copied to the GPU as-is. The exporter (called "compiler") imports OBJ or COLLADA files and executes a series of precomputation and optimization steps.

## Compiler ##

The compiler comes as a command line utility and converts meshes exported by your DCC applications to the optimized mesh files.

Features:
- Loads OBJ and COLLADA (.dae) files.
- Reorders triangles for optimized GPU cache utilization.
- Reduces precision to 16 Bit floats or integers where appropriate (e.g. normals).
- Interleaves data that is needed within the same pass. E.g. color and normals are not needed in shadow pass, so they are not interleaved with position.
- Stores vertex weights and vertex-bone relationship for skeletal animation purposes.
- Optionally performs Precomputed Radiance Transfer calculations and stores Spherical Harmonics coefficients.

## Using the File Format in Your Engine ##

In an application using the file format, you only need the two headers inside the `runtime` subdirectory.

``` cpp
// Load entire file into one contiguous buffer, or even mmap() your file:
const void* data = MyEngine::LoadFile("mesh.mmf");

// Cast to MeshFile struct:
const MeshFile* file = static_cast<const MeshFile*>(data);

// Check magic number and version:
assert(file->magic == MeshFile::kMagic);
assert(file->version == MeshFile::kVersion);

MyEngine::Mesh* mesh = MyEngine::CreateMesh();

// Store buffer contents on GPU:
for(unsigned int i = 0; i < file->numBuffers; ++i)
{
  mesh->StoreBuffer(
    i, // Buffer index. Referenced by index specs or vertex specs
    file->GetBufferData(i), // Pointer to the data
    file->buffers[i].size, // Size of the data in bytes
    file->buffers[i].type // Vertex buffer or index buffer
  );
}

// Index specs define separate batches to draw:
for(unsigned int i = 0; i < file->numIndexSpecs; ++i)
{
  const IndexBufferInfo& info = file->GetIndexSpec(i);
  mesh->AddBatch(info.mode, // Draw mode (triangles, lines, ...)
    info.type, // Data type in index buffer (uint8, uint16, uint32)
    info.buffer, // Buffer index of index buffer :). See above.
    info.offset, // Offset into index buffer
    info.count, // Number of indices
    info.vertexDataSet // Index of vertex data set. See below.
  );
  mesh->SetMaterial(info.material);
}

// Vertex data sets define vertex attributes:
for(unsigned int i = 0; i < file->numVertexDataSets; ++i)
{
  const MeshFile::VertexDataSet& vSet = file->GetVertexDataSet(i);

  // Each vertex spec describes one vertex attribute, e.g. normal:
  for(unsigned int vSpec = 0; vSpec < vSet.numVertexSpecs; ++vSpec)
  {
    const VertexAttributeInfo& info = file.GetVertexSpec(i, vSpec);
    mesh->AddVertexAttribute(
      i, // Index of the data set, referenced by IndexBufferInfo above
      info.semantic, // Position, normal, vertex color, ...
      info.type, // Data type like float16, int32, ...
      info.components, // Number of components for vector attributes, e.g. 3 for normals
      info.offset, // Offset into the vertex buffer in bytes
      info.stride, // Distance from one entry to the next (for interleaved data)
      info.buffer, // Buffer index of the vertex buffer
      info.normalized
    );
  }
}

// Use precalculated axis-aligned bounding box:
mesh->SetBounds(file->boundsMin, file->boundsMax);
```

## License ##

MIT License

Copyright (c) 2018 Fabian Herb

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

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

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

repository: cmdrf/molecular-meshfile

repo_name: cmdrf/molecular-meshfile


text:
# YouVersion Web Open Ideas

[![Maintainability](https://api.codeclimate.com/v1/badges/7f8a6cdd0c63e79ff2c8/maintainability)](https://codeclimate.com/github/lifechurch/youversion-web-open-ideas/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/7f8a6cdd0c63e79ff2c8/test_coverage)](https://codeclimate.com/github/lifechurch/youversion-web-open-ideas/test_coverage)

The purpose of this repo is to create a place for volunteer contributors to post potential solutions to issues, mostly as one-off React Components, or small collections of components/pages.

The project contained here should have an extremely-low-friction setup, and be relatively easy to contribute potential React-based solutions to.

"Official" issues that are ready to be worked on are marked with the [Help Wanted](https://github.com/lifechurch/youversion-web-open-ideas/labels/help%20wanted) label. We may institute other labels or methods of organization later.

## What it looks like

When run, the project should display a "table of contents" menu or list of links to "solutions" related to [issues from this repo](https://github.com/lifechurch/youversion-web-open-ideas/issues).

Following one of those links should navigate to a page showing a potential solution.

## How to contribute

- Choose an issue from this repo that is labeled ["Help Wanted"](https://github.com/lifechurch/youversion-web-open-ideas/labels/help%20wanted)
- Fork and clone this repo
- Run the development command for this project/app
- Add a new route, following existing examples
- Create necessary new components/pages at that route, that show a potential solution to the issue you've chosen
- If your solution should have tests, create tests in the appropriate test file
- [Commit your changes, and submit a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)

### Code style and standards

Since this project is a bit of a sandbox, we don't plan to be too strict. We'll automate code style suggestions where we can, through the use of tools like ESLint, and generally stick to common standards in the "community". When we've developed an official standards doc, we'll link to that here. In the mean time, here are some guidelines:

- Most style and code rules we would like to adhere to are configured in our [ESLint](https://eslint.org/) configuration file. It's `.eslintrc.js` in this repo. If your programming environment is set up to use project-specific ESLint configs, you will automatically catch most relevant issues. This is a very handy tool, and we recommend it!
- When building Components, put them in the `components` directory. Ideally, the resulting import statements should look something like `import Home from './components/Home'`.
- For other things not covered here, our "catch-all" is to refer to the AirBNB [Javascript](https://github.com/airbnb/javascript) and [React/JSX](https://github.com/airbnb/javascript/tree/master/react) style guides. Or just ask! We'll figure it out together. =)

## Getting started

- Fork and/or clone this repo.
- Run `yarn` to download and install the dependencies.
- Run `yarn start` to run the [create-react-app](https://github.com/facebook/create-react-app) based app.

## License

See the `LICENSE` file in the root of this repository.

repository: kelvinabella/youversion-web-open-ideas

repo_name: kelvinabella/youversion-web-open-ideas


text:
To use GreyNoise on Cortex XSOAR, retrieve your user account's API key and enter it in the integration's configuration.

#### Configure an API account on GreyNoise

- [Login](https://viz.greynoise.io/login) / [Register](https://viz.greynoise.io/signup) at GreyNoise
- Once signed in, go to [Account Settings](https://viz.greynoise.io/account/) to get the API Key.

repository: demisto/content

repo_name: demisto/content


text:
# aws-templates
Some useful scripts and templates for working with AWS.

## full-stack.json
This is a Cloud Formation template originally based on https://github.com/awslabs/service-discovery-ecs-consul/blob/master/service-discovery-blog-template but I've added automated VPC, subnet, a postgres db, a redis service, and registration of the db with consul.

Basically, if you want to deploy a Dockerized app on ECS this will get you started quickly.

Find more info on the original at https://aws.amazon.com/blogs/compute/service-discovery-via-consul-with-amazon-ecs/

## vpc-subnet-setup.json
This is a Cloud Formation template that creates a VPC, subnet, and related.

## redis-task.json
An simple example of a redis task definition for ECS.

## register-postgres.sh
A bash script to register a postgres server as a service with consul. Takes two parameters. First the postgres host name, then the postgres port.

## AWS Issues
* If the nginx password is not set properly by the ConsulInstance setup scripts run the folowing on the instance:

        sudo htpasswd -cb /etc/nginx/.htpasswd admin <password> && sudo /usr/sbin/nginx -s reload

* The Agent Version listed on the Cluster page under the ECS Instances tab should be 1.7.1 or greater. This seams to result in failure to deploy some docker images. Request the agent is updated by clicking through to the agent page and clicking the Update Agent button. You'll want to update the AMI used in the cloud formation script based on the [AMI images for agent versions](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_agent_versions.html).

repository: mauricecarey/aws-templates

repo_name: mauricecarey/aws-templates


text:
# Day 101 \[Easy\]

This problem was asked by Alibaba.

Given an even number (greater than 2), return two prime numbers whose sum will be equal to the given number.

A solution will always exist. See Goldbach’s conjecture.

Example:

Input: `4`
Output: `2 + 2 = 4`
If there are more than one solution possible, return the lexicographically smaller solution.

If `[a, b]` is one solution with `a <= b`, and `[c, d]` is another solution with `c <= d`, then:
```
[a, b] < [c, d]
```
if `a < c` OR `a == c` AND `b < d`.

repository: sraaphorst/daily-coding-problem

repo_name: sraaphorst/daily-coding-problem


text:
# Development Notes

## First Iteration

For my first iteration of this project, I've chosen to use a redux store to store state. Since we
need a way for a component to know about the state of the rest of the world in order to have
idempotent behavior, we need to keep the state of the world in a single place, and have the
component tree update whenever that state changes.

Another choice I made was to have components pass data about their children to a render prop
function. So for example an `Account` component will look up its containers and then pass them down
to a function. The user gets to decide how to use that data

```
<Account accountId=1>
  {(containers) => containers.map((container) => <Container containerId={container.id}></Container>)}
</Account>
```

This seemed like a good idea at first, but I turns out to be a little too brittle. What if a user
wants to do something like this:

```
<Account accountId=1>
  <Container containerId=1>
    ...
  </Container>
</Account>
```

Under the current API, they can't. I want to give users the freedom to express their desired GTM
state and the CLI takes care of the rest. Render prop function doesn't seem like the right way. I
think its back to the drawing board...

repository: jstoebel/gtm-composer

repo_name: jstoebel/gtm-composer


text:
# DEPRECATED

This package is no longer in-use. There is no recommended alternative.

# CWP Basic Recipe metapackage

The purpose of this module is to provide an easy way to obtain just the right mix of modules for a given CWP recipe
release. Including a stable, latest release of this module in your project implies you are running a compliant
supported baseline.

Note: the stability of the site could still be affected by modules you add on top of this foundational mix.

repository: silverstripe/cwp-recipe-basic

repo_name: silverstripe/cwp-recipe-basic


text:
Through
teaching and interacting with students, I broadened my perspectives on basic
issues in linguistics, and deepened my understanding of theoretical approaches
to those issues. My teaching philosophy consists of three principles:

1. make clear statements about long-term goals and short-term goals that a student has to achieve;
2. facilitate students’ interest through tangible but non-trivial puzzles;
3. balance empirical and theoretical aspects in teaching specific linguistic analyses.

I particularly enjoy teaching introductory linguistics courses at the
undergraduate level, as it is where I first encountered the excitement of
linguistics as a student.

### Current and upcoming courses (at Edinburgh)

- Autumn 2021:
	- Course organizer, 'Semantic Theory' (upper-level undergraduate; MSc)
	- Contributor, 'Pragmatics' (upper-level undergraduate; MSc)

### Past courses

- **At University of Edinburgh**
	- Spring 2020: Semantics block (2 weeks) of 'Linguistics and English Language 1B' (1st-year undergraduate)
	- Spring 2020: 'Current Issues in Semantics and Pragmatics' (Upper-level undergraduate/MSc; co-taught with Rob Truswell)
	- Fall 2019: Course organiser, 'Introduction to Semantics and Pragmatics' (MSc; Edinburgh)
	- Autumn 2021
    	- 'Guided Research in Linguistics A: cross-linguistic variation and universal in semantics' (upper-level undergraduate; MSc)
   		- Semantics block (2 weeks) of 'Linguistics and English Language 2A' (2nd-year undergraduate)
    	- Contributor, 'Pragmatics' (upper-level undergraduate; MSc)
	- Spring 2021:
    	- Course organiser, 'Linguistics and English Language 1B' (1st-year undergraduate)
    	- Contributor, 'Syntax: Theory and Practice' (upper-level undergraduate; MSc)

- **At Leiden University**
	- Fall 2018: 'Semantics: Current issues' (MA; LUCL)
	- Fall 2018: 'Japanese Linguistics seminar' (BA3; Leiden)
	- Fall 2018: 'Trends in Japanese Linguistics' (MA; Leiden)
	- Spring 2017: 'Semantics 2' (BA; Leiden)
	- Spring 2017: 'Graduation seminar' (BA; Leiden)
	- Spring 2017: 'Introduction to Japanese Linguistics' (BA; Leiden)
	- Fall 2016: 'Trends in Japanese Linguistics: Japanese and theories of semantics and pragmatics' (MA; Leiden)

### Supervision

- I am currently co-supervising the following three PhD students at the University of Edinburgh:
	- Takanobu Nakamura (Topic: Semantics of distributivity in Japanese; co-supervised with Rob Truswell and Bryan Pickel)
	- Thomas Stephen (Topic: Compositional semantics of clausal complementation; co-supervised with Rob Truswell and Bryan Pickel)
	- Esther Lam (Topic: On classifiers in Nung (Tai); co-supervised with Nik Gisborne and Bert Remijsen)
- I have (co-)supervised more than 20 Undergraduate and Master-level dissertations at Leiden and Edinburgh.


text:
---
layout: post
comments: true
title: Naaresh, disappointing Master
---

The post on battle engine have trouble being finished, and still require editing because he have bloated out of proportion. In the meanwhile, I still play warmachine, and I have tried several experiments. One just ended in failure, and it's that poor Ascetic Master Naaresh.

How it was supposed to work
===========================

[Theme] Masters of War

* Master Ascetic Naaresh [+32]
	- Archidon [10]
	- Archidon [10]
	- Basilisk Krea [7]
	- Rhinodon [12]
	- Titan Gladiator [15]
* Extoller Soulward [3]
* Swamp Gobber Chef [1]
* Legends of Halaak [8]
* Paingiver Beast Handlers (min) [5]
* Praetorian Swordsmen (max) [13]
	- Praetorian Swordsman Officer & Standard [4]
* Praetorian Swordsmen (max) [13]
	- Praetorian Swordsman Officer & Standard [4]
* Tyrant Commander & Standard Bearer [0(6)]

Trying to play it full beast mostly mean you have a worse Zaadesh ; but Naaresh have Blur, and Swordmen are both notoriously hard to deliver and very good once they are in the fray. And his feat only impact his battlegroup, but two or three POW 20 archidon seem good enough for armor breaking. And with Spiny Growth and Cyclone, he probably can play aggressively.

How it played out
=================

Badly. In particular, I never really delivered more than two swordmen from each units. Naaresh assassinated the Harbinger, but didn't do much more. The two main problem is that his spell list is too low powered, and his personal prowess are, to say it gently, sparse.

Anatomy of a bad spell list
---------------------------

Unlike a lot of people, I don't terribly mind having one bad spell or two, since it's rather the norm, so Bleed don't tick me off. He have three spells, on paper all interesting : Cyclone, Blur, and Lamentations. In practice, only Cyclone really mattered

### Reactive vs proactive

One of the reasons for that is that Blur and Lamentation are reactive spell.  While being reactive isn't bad per se, it mean it's only useful a fraction of the time (since your opponent need to actively use the thing you want to counter), and having too much reactive stuff can easily be a problem. Here, we have more than half of his spell list dedicated not only to counter stuff, which in retrospective should have alarmed me.

### Lamentation, or the problem with magic counter

Lamentation is in the grand family of ability that punish warcasters from advancing. In theory, everyone use spells all the time, and mostly everyone have upkeeps. So why isn't that spell a good generic counter ? Because there is too many way to weasel out of it. It check the caster, and not the point of origin, so channeling is a counter, and most actual spellslinger can channel, as it's almost mandatory to use offensive spell without dying. Double of free is still free, so anything that pay for upkeep mean Lamentation isn't gonna do much on it. If the spell create an aura, you can even cast it, then enter the Lamentation zone without problem. It also only work on fury/focus user, meaning it do nothing to most wizard solos.

 It's particulary brutal against Lightning Strike users, and Horde in general isn't a super big fan of being Lamented. But it's a lot more niche than one may believe, and it's entirely possible to have a string of five games where it's alway useless.

<img src="/images/NaareshVsRavyn.png" alt="I am pretty sure that Ravyn have bigger problems than Lamentation right now" style="float: inline-end; margin: 5px">There is also another teeny weeny problem : given that Naaresh threaten assassination at 17" easily, people already have a very strong incentive to not put their caster within 12" of him. It's tempting fate. On the illustration, the empty base is where Naaresh can Cyclone, meaning that Ravyn is pretty much in charge range despite the obstacle

### Blur, too easy to ignore

Blur, meanwhile, suffer from how good accuracy fixing is at a range. That may seem strange since average RAT is a solid point lower than MAT ; but while every list I got had shooting, they also had :
* purification
* prey
* boostable to hit electro-leap
* blessed
* Ravyn and Issyria's feat
* Blinding Light

None ever had a problem to hit a swordmen under blur and a Krea. And even thoses who were in cover actually died rather often, either because electroleap are autohitting anyway, or because they stacked several rules together. That's another example of a reactive ability who is too narrow ; while I can get by the idea that stacking Blur and a krea make me safe from, say, Demo Corps bombardier shooting, the amount of list who have shooting who actually care about defense on single wound model isn't terribly high. Which make the spell a lot worse than it seem.

Naaresh, impotent martial master
--------------------------------

The second part of the problem is that Naaresh look like a good beater, but he isn't actually one. He is a seriously pitiful MAT 7 (for the record, he is supposed to be the ultimate master-under-a-waterfall skorne, who honed his skill for several centuries), which, outside of lore problems, mean that he is quickly hitting on 7+ or 8+ infantry. He don't exactly have the fury to allow himself to miss that often. At least not given the low amount of support he hand out.

The effort to reward ratio on whipping him is also pretty bad. Anatomical Precision doesn't let you make only one damage, and spike can be seriously dangerous, in addition to requiring more than a min unit of paingiver for max stacks. That would be fine if the setup lead you to tear apart jacks and casters effortlessly, but it's far from the case. At POW 16, killing an armor 19 jacks often only barely leave you with one fury to sprint, and killing a caster in two attacks is rather dicey too. It don't compare well with, say, Morghoul 2, or Kromac 2, or any of the actual heavy hitter casters.

Good points ?
-------------

The best part of Naaresh is that Cyclone is an extraordinary spell. Since it's a full advance, you can use a Tyrant Commander to make it 8" ; that mean you can reposition 8", then charge the now-visible target, or alternatively charge something close to your target, and use Cyclone to get to your true target, maybe even in its back ! Naaresh is also surprisingly resilient, since he don't have to pay for its upkeep, regain life, and actually have a decent amount of armor thanks to his special rule. And he have access to Spiny Growth for even better protection. You can also use it as a substitute for sprint if you don't kill your target, or as a way to move more on turn 1 if so needed.

His feat is also rather good, even with a limited battlegroup. While Skorne is renowned for hitting hard, Archidons and Rhinodons can often have trouble with hard targets. With that feat, they can seriously threaten anything short of a colossal, from a very long distance if needed. So it make it rather easy to defang an opposing list by targeting and killing its heavy hitter, and then you have a bunch of 14/19 and 11/23 beast lodged in the frontline, being hard to kill.

Conclusion
==========

Overall, Naaresh is fun to play, but don't nearly do enough for a competitive pairing in all of my experience. There might be a chance that I just tried the wrong thing (maybe immortal could work ? Maybe in Disciple of Agony with a dracodile and nihilators ?), but I think the problem are in his design. It is a bit sad, because Cyclone is a near infinite box of trick, especially when you can sprint on top of that !

As for delivering swordmen, I am a lot higher on Jalaam compared to Naaresh right now. I know that a lot of list have way to ignore stealth or cover, but he seem to be significantly more diversified in his way to bring people alive.


text:
---
title: Making postie work with cron jobs, fails with wp-config.php outside of web root
author: David
layout: post
header: no
permalink: /note/making-postie-work-with-cron-jobs-fails-with-wp-config-php-outside-of-web-root/
categories:
  - note
tags:
  - wordpress
---
I use the excellent [Postie][1] plugin to post to this blog via email. I’ve been battling for days to get it to automatically check the mailbox for new message though, and while I still haven’t got it working using [WP-Cron][2] (WordPress’ "pseudo-cron”), I’ve finally managed to get it working via a direct cron job.

What *didn’t* work : any form of call to wp-content/plugins/postie/get_mail.php when my wp-config.php file was [one directory up][3] from the root of my wordpress directory (a security enhancement). I was getting errors like this:

    PHP Fatal error: require_once(): Failed opening required ‘/home/funkypenguin/wp-settings.php’
    (include_path=’.:/usr/share/pear:/usr/share/php’) in /home/funkypenguin/wp-config.php on line 79

Once I moved wp-config.php back into the web root directory, I got happy messages like this instead:

    [Wed May 14 22:10:04 2014] [error] [client 2407:1000:1:7::161:79] Postie: Starting mail fetch [Wed May 14
    22:10:04 2014] [error] [client 2407:1000:1:7::161:79] Postie: Postie is in
    /home/funkypenguin/public_html/wp-content/plugins/postie

Since I can no longer locate wp-config out of the web-accessible portion of my directory structure, I added the following to .htaccess instead:

{% highlight conf %}
<files wp-config.php>
order allow,deny
deny from all
 </files>
{% endhighlight %}

[1]: http://postieplugin.com/
[2]: http://code.tutsplus.com/articles/insights-into-wp-cron-an-introduction-to-scheduling-tasks-in-wordpress--wp-23119
[3]: http://codex.wordpress.org/Hardening_WordPress#Securing_wp-config.php


text:
# EU Vote Calculator

Vote calculator for working out if a EU vote has sucesfully went through

## Getting Started
Download the zip and open the  .sln file in visual studios and run it.

## Built With

* [Visual Studios](https://visualstudio.microsoft.com/vs/) In C#

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).

## Authors

* **Thomas Cook** - *Maths programming and saving programming*
* **Aaron Karara** - *form control*
* **Piyush Karathia** - *naming code*
* **Thomas Houghton** - *Form control*
* **Camreon Graves** - *Testing*

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

repository: tomhcook/EU-VOTE-CALC

repo_name: tomhcook/EU-VOTE-CALC


text:
# Kickstart CSS for Prototype Development

This is a Kickstarter for a CSS theme that can be used for rapid prototypes. Only HTML5 semantic elements are used.

This repro uses HTML5 Boilerplate for its structure and takes advantage of its normalize.css and main.css
These can be found in the css folder.

## Getting Started

This repro allows rapid development of protoypes by omitting the need of classes or styles and only requiring semantic elements.
Your code should be wrapped in a main element
```html
<main>
	<section>
		// sematic elements and content here
	</section>
</main>
```


text:
# ApiKey

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | Pointer to **string** | Date of creation of the API key. | [optional] [readonly]
**CreatedBy** | Pointer to **string** | Datadog user handle that created the API key. | [optional] [readonly]
**Key** | Pointer to **string** | API key. | [optional] [readonly]
**Name** | Pointer to **string** | Name of your API key. | [optional]

## Methods

### NewApiKey

`func NewApiKey() *ApiKey`

NewApiKey instantiates a new ApiKey object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewApiKeyWithDefaults

`func NewApiKeyWithDefaults() *ApiKey`

NewApiKeyWithDefaults instantiates a new ApiKey object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetCreated

`func (o *ApiKey) GetCreated() string`

GetCreated returns the Created field if non-nil, zero value otherwise.

### GetCreatedOk

`func (o *ApiKey) GetCreatedOk() (*string, bool)`

GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetCreated

`func (o *ApiKey) SetCreated(v string)`

SetCreated sets Created field to given value.

### HasCreated

`func (o *ApiKey) HasCreated() bool`

HasCreated returns a boolean if a field has been set.

### GetCreatedBy

`func (o *ApiKey) GetCreatedBy() string`

GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise.

### GetCreatedByOk

`func (o *ApiKey) GetCreatedByOk() (*string, bool)`

GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetCreatedBy

`func (o *ApiKey) SetCreatedBy(v string)`

SetCreatedBy sets CreatedBy field to given value.

### HasCreatedBy

`func (o *ApiKey) HasCreatedBy() bool`

HasCreatedBy returns a boolean if a field has been set.

### GetKey

`func (o *ApiKey) GetKey() string`

GetKey returns the Key field if non-nil, zero value otherwise.

### GetKeyOk

`func (o *ApiKey) GetKeyOk() (*string, bool)`

GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetKey

`func (o *ApiKey) SetKey(v string)`

SetKey sets Key field to given value.

### HasKey

`func (o *ApiKey) HasKey() bool`

HasKey returns a boolean if a field has been set.

### GetName

`func (o *ApiKey) GetName() string`

GetName returns the Name field if non-nil, zero value otherwise.

### GetNameOk

`func (o *ApiKey) GetNameOk() (*string, bool)`

GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetName

`func (o *ApiKey) SetName(v string)`

SetName sets Name field to given value.

### HasName

`func (o *ApiKey) HasName() bool`

HasName returns a boolean if a field has been set.

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: chussenot/datadog-api-client-go

gha_license_id: NOASSERTION

repo_name: chussenot/datadog-api-client-go


text:
Juliet is a lightweight middleware chaining helper that pass a Context (map) object
from a middleware to the next one.

This work is inspired by [Stack](https://github.com/alexedwards/stack) by Alex Edwards
and [Alice](https://github.com/justinas/alice) by Justinas Stankevicius.

Godoc is here : https://godoc.org/github.com/root-gg/juliet

And there is a working example in the examples package :

```go
package main

import (
	"net/http"
	"log"
	"net"
	"fmt"

	"github.com/root-gg/juliet"
)

// Juliet is a lightweight middleware chaining helper that pass a Context (map) object
// from a middleware to the next one.
//
// Middlewre is a pattern where http request/response are passed through many handlers to reuse code.

// For example this classic middleware log the requested url
func logMiddleware(next http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		// Our middleware logic goes here...
		log.Println(r.URL.String())

		// Pass the request to the next middleware / handler
		next.ServeHTTP(w, r)
	})
}

// Juliet adds a context parameter to the middleware pattern that will be passed along the Chain.
// For example this middleware puts the request's source IP address in the context.
func getSourceIpMiddleware(ctx *juliet.Context, next http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

		// Get the source IP from the request remote address
		ip, _, err := net.SplitHostPort(r.RemoteAddr)

		// You can handle failure at any point of the chain by not calling next.ServeHTTP
		if err != nil {
			http.Error(w, "Unable to parse source ip address", 500)
			return
		}

		// Save the source ip in the context
		ctx.Set("ip", ip)

		// Pass the request to the next middleware / handler
		next.ServeHTTP(w, r)
	})
}

// As a context is nothing more that a map[interface{}]interface{} with syntactic sugar you have to ensure you
// check types of values you get from the context. To keep your code clean you can write helpers to do that and keep
// type safety everywhere.
func getSourceIp(ctx *juliet.Context) string {
	if sourceIP, ok := ctx.Get("ip"); ok {
		return sourceIP.(string)
	}
	return ""
}

// The last link of a middleware chain is the application Handler
func pingHandler(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte("pong\n"))
}

// Juliet can also pass the context parameter to application Handlers
func ipHandler(ctx *juliet.Context, resp http.ResponseWriter, req *http.Request) {
	// write http response
	resp.Write([]byte(fmt.Sprintf("your IP address is : %s\n", getSourceIp(ctx))))
}

func main(){
	// Juliet links middleware and handler with chain objects
	chain := juliet.NewChain()

	// Chain objects are immutable and any operation on it returns a new chain object.
	// You can append one or more middleware to the chain at a time using the Append method.
	chain = chain.Append(getSourceIpMiddleware)

	// You can append a middleware to the beginning of the chain with the AppendChain method.
	// When working with a non context-aware ( Juliet ) middleware you have to use the Adapt method.
	chain = juliet.NewChain(juliet.Adapt(logMiddleware)).AppendChain(chain)

	// Now we have this middleware chain : logUrl > getSourceIp > ApplicationHandler
	// We could have built it in one pass this way :
	//  chain := juliet.NewChain(juliet.Adapt(logMiddleware),getSourceIpMiddleware)

	// It's now time to add some application handlers and to bind everything to some HTTP route.

	// With a context handler
	http.Handle("/ip", chain.Then(ipHandler))

	// With a classic http.HandlerFunc
	http.Handle("/ping", chain.ThenHandlerFunc(pingHandler))

	// With a classic http.Handler
	http.Handle("/404", chain.ThenHandler(http.NotFoundHandler()))

	log.Fatal(http.ListenAndServe(":1234", nil))
}

// $ go run main.go
// 2016/02/01 12:20:39 /ip
// 2016/02/01 12:20:44 /ping
// 2016/02/01 12:20:56 /404
//
// $ curl <IP_ADDRESS>:1234/ip
// your IP address is : <IP_ADDRESS>
// $ curl <IP_ADDRESS>:1234/ping
// pong
// $ curl <IP_ADDRESS>:1234/404
// 404 page not found
```

repository: root-gg/juliet

repo_name: root-gg/juliet


text:
---
slug: user-pool-authenticating-with-user-pass
title: User Pool Authenticating with a username and password
author: Aleksander Wons
tags: [userpools, cdk]
---

[I explain how the basic authentication with a username and password works](https://cloudbyexample.io/part-2-aws-cognito-user-pool-authenticating-with-username-and-password/). I explain what aliases are and how we can use them. I also show how the account confirmation/verification works. The examples will be explained using an actual User Pool we will be able to create using CDK. All of the source code is available on GitHub. As always, the repository contains a Docker configuration for Visual Studio Code.

repository: livioso/cognito-wiki

repo_name: livioso/cognito-wiki


text:
# AngularJS + NodeWebkit seed

This is a seed project developed at [Wolox](http://www.wolox.com.ar)
after building a desktop app with AngularJS, NodeWebkit, Jade and CoffeeScript.
It is intended to be a starting point for everyone who wants to build a cross-platform desktop app
using AngularJS and NodeWebkit.

We started working with [this seed](https://github.com/Anonyfox/node-webkit-hipster-seed). After some
development, we realized that the directory structure and the way things were compiled were not going
to scale.

### Dependencies

* AngularJS  1.3.0
* NodeWebkit 0.11.5
* Jade 1.9.1
* CoffeeScript 1.8.0
* Bower 1.3.2
* Grunt 0.4.3

### Current status

This project is a fork of an existing project at [Wolox](http://www.wolox.com.ar). Although its dependencies are up to date, there is still some work to be done with real time compilation for development.

As we keep developing our project and find some usefull stuff that should be present in this repo, we'll keep updating this seed.

### Getting Started
* `git clone git@github.com:Wolox/angular-nodewebkit-seed.git`
* `bower install && npm install`
* `grunt`

In another terminal window, run `npm run app`. This will run the app.

Grunt will continuously listen for file changes in `src` directory and recompile the app if needed.

Whenever you add a coffeescript file, you need to add it to `appjs.json`. This file indicates which files and in which order must be minified. This is something we want to change at some point in the future.

### Compiling app for production

`grunt prod` will run grunt in production mode and build the executable files under the `dist` folder.

### Environment configuration
Under `src/scripts/config` you will find a file called `development.coffee`. This file will be included in the compiled files when running `grunt` in development mode. In the same weay, if you create a file named `production.coffee`, it will be included in the compiled files for production.

## About ##

This project is maintained by [Matías De Santi](https://github.com/mdesanti) and it was written by [Wolox](http://www.wolox.com.ar).

![Wolox](https://raw.githubusercontent.com/Wolox/press-kit/master/logos/logo_banner.png)

## License

**AngularJS-Nodewebkit-seed** is available under the MIT

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

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

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

repository: Wolox/angular-nodewebkit-seed

repo_name: Wolox/angular-nodewebkit-seed


text:
# ⚡ Projects: YouBuy (Traditional Server Application)

## What is this?

This is a sample project for use within the various ["status quo"] or ["shiny future"] stories.

["status quo"]: ../status_quo.md
["shiny future"]: ../shiny_future.md

## Description

YouBuy is a growing e-commerce website that now has millions of users. The team behind YouBuy is struggling to keep up with traffic and keep server costs low. Having originally written YouBuy in a mix of Ruby on Rails and Node, the YouBuy team decides to rewrite many parts of their service in Rust which they've investigated and found to be performant while still allowing for high levels of abstraction they're used to.

## 🤔 Frequently Asked Questions

### **What makes YouBuy and other server applications different from others?**
* Many server applications are written in languages with garbage collectors. Many of the things that Rust forces users to care about are not first order concerns for those working on server applications (e.g., memory management, stack vs heap allocations, etc.).
* Many server applications are written in languages without static type checking. The developers of YouBuy don't have much experience with statically typed languages and some of the developers early in their Rust learning journeys expressed frustration that they found it hard to get their programs to compile especially when using async constructs.

### **Does YouBuy require a custom tailored runtime?**
YouBuy should be perfectly fine with a runtime from crates.io. In fact, their concern isn't at the runtime level but at the high-level server framework level.

### **How much of this project is likely to be built with open source components from crates.io?**
YouBuy is in fierce competition with many other e-commerce sites. Therefore, the less that YouBuy engineers have to write themselves, the better. Ideally, YouBuy can focus 100% of its energy on features that differentiate it from its competition and none of its time on tweaking its networking stack.

### **What is of most concern to this project?**
It seems like YouBuy is always on the verge of either becoming the next billion-dollar company with hundreds of millions of users or completely going out of business. YouBuy needs to be able to move fast and focus on the application business logic.

### **What is of least concern to this project?**
Since moving fast is of primary concern, the ins and outs of the underlying networking stack are only of concern when something goes wrong. The hope is that that rarely if ever happens and when it does, it's easy to find the source of the issue.

repository: eminence/wg-async-foundations

gha_language: Shell

repo_name: eminence/wg-async-foundations