text:
ZNC cmd notify
=============

ZNC cmd notify  is a module for [ZNC][] that will send notifications to a command that you
can customize to invoke any action you want (Forward email/SMS messages) for any private
message or channel highlight that matches a configurable set of conditions.

This project is forked from ZNC to Notifo created by [John Reese](http://johnmreese.com).

Minor edits made by Benwa.

Compiling
---------

If you have installed ZNC from a Linux distribution's repository, you will most likely
need to install the development package before building this module.  On Ubuntu, this can
be installed with:

    $ sudo aptitude install znc-dev

If you have `make` installed, you can compile the module with:

    $ make

Otherwise, run the full command:

    $ znc-buildmod cmdnotify.cpp

Installation
------------

Create the notify script at /etc/znc_notify.sh that takes
in a message as parameters. Example:

    #!/bin/bash
    echo "$@" | mail ...@msg.telus.com
    EOF

Copy the compiled module into your ZNC profile:

    $ cp cmdnotify.so ~/.znc/modules/

Now, load the module in ZNC:

    /msg *status loadmod cmdnotify

Commands
--------

*   `help`

    Links you to this fine document.

*   `set <option> <value>`

    Allows you to modify configuration values.

*   `append <option> <value>`

    Allows you to add a string to end of a configuration value.  Automatically adds a
    space to separate the appended value from the existing value.

*   `prepend <option> <value>`

    Allows you to add a string to beginning of a configuration value.  Automatically adds
    a space to separate the prepended value from the existing value.

*   `get [<option>]`

    Allows you to see current configuration values.

*   `unset <option>`

    Allows you to reset a configuration option back to the default value.

*   `status [<context>]`

    Check the status of current conditions.  Specifying the "context" of either a channel
    or nick name will provide status values specific to that context.

*   `send <message>`

    Manually trigger a notification with the given message.  Useful for testing to validate
    credentials, etc.

*   `eval <expression>`

    Evaluate the given expression in an empty context.  Useful for testing to validate that
    a given expression is properly formatted and does not contain invalid tokens.

Configuration
-------------

### Settings

*   `cmd = "/home/user/znc_notify.sh"`

    The command to run when a notification is triggered. Defaults to `/etc/znc_notify.sh`.

### Conditions

*   `away_only = "no"`

    If set to "yes", notifications will only be sent if the user has set their `/away` status.

*   `client_count_less_than = 1`

    Notifications will only be sent if the number of connected IRC clients is less than this
    value.  A value of 0 (zero) will disable this condition.

*   `highlight = ""`

    Space-separated list of highlight strings to match against channel messages using
    case-insensitive, wildcard matching.    Strings will be compared in order they appear in the configuration value, and
    the first string to match will end the search, meaning that earlier strings take priority
    over later values.

    Individual strings may be prefixed with:

    *   `-` (hypen) to negate the match, which makes the string act as a filter rather than
        a search

    *   `_` (underscore) to trigger a "whole-word" match, where it must be surrounded by
        whitespace to match the value

    *   `*` (asterisk) to match highlight strings that start with any of the above prefixes

    As an example, a highlight value of "-pinto car" will trigger notification on the
    message "I like cars", but will prevent notifications for "My favorite car is the Pinto"
    *and* "I like pinto beans".  Conversely, a highlight value of "car -pinto" will trigger
    notifications for the first two messages, and only prevent notification of the last one.

    As another example, a value of "_car" will trigger notification for the message "my car
    is awesome", but will not match the message "I like cars".

*   `idle = 0`

    Time in seconds since the last activity by the user on any channel or query window,
    including joins, parts, messages, and actions.  Notifications will only be sent if the
    elapsed time is greater than this value.  A value of 0 (zero) will disable this condition.

*   `last_active = 0`

    Time in seconds since the last message sent by the user on that channel or query window.
    Notifications will only be sent if the elapsed time is greater than this value.  A value
    of 0 (zero) will disable this condition.

    Note that this condition keeps track of the last message sent to each channel and query
    window separately, so a recent PM to Joe will not affect a notification sent from
    channel #foo.

*   `last_notification = 0`

    Time in seconds since the last notification sent from that channel or query window.
    Notifications will only be sent if the elapsed time is greater than this value.  A value
    of 0 (zero) will disable this condition.

    Note that this condition keeps track of the last notification sent from each channel and
    query window separately, so a recent PM from Joe will not affect a notification sent
    from channel #foo.

*   `nick_blacklist = ""`

    Space-separated list of nicks.  Applies to both channel mentions and query windows.
    Notifications will only be sent for messages from nicks that are not present in this
    list, using a case-insensitive comparison.

    Note that wildcard patterns can be used to match multiple nicks with a single blacklist
    entry. For example, `set nick_blacklist *bot` will not send notifications from nicks
    like "channelbot", "FooBot", or "Robot".  Care must be used to not accidentally
    blacklist legitimate nicks with wildcards.

*   `replied = "no"`

    If set to "yes", notifications will only be sent if you have replied to the channel or
    query window more recently than the last time a notification was sent for that context.

### Notifications

*   `message_length = 1024`

    Maximum length of the notification message to be sent.  The message will be nicely
    truncated and ellipsized at or before this length is reached.  A value of 0 (zero) will
    disable this option.

### Advanced

*   `channel_conditions = "all"`

    This option allows customization of the boolean logic used to determine how conditional
    values are used to filter notifications for channel messages.  It evaluates as a full
    boolean logic expression,  including the use of sub-expressions.  The default value of
    "all" will bypass this evaluation and simply require all conditions to be true.

    The expression consists of space-separated tokens in the following grammar:

    *   expression = expression operator expression | "(" expression ")" | value
    *   operator = "and" | "or"
    *   value = "true" | "false" | condition
    *   condition = <any condition option>

    As a simple example, to replicate the default "all" value, would be the value of
    "away_only and client_count_less_than and highlight and idle and last_active and
    last_notification and nick_blacklist and replied".

    Alternately, setting a value of "true" would send a notification for *every* message,
    while a value of "false" would *never* send a notification.

    For a more complicated example, the value of "client_count_less_than and highlight and
    (last_active or last_notification or replied) and nick_blacklist" would send a
    notification if any of the three conditions in the sub-expression are met, while still
    requiring all of the conditions outside of the parentheses to also be met.

*   `query_conditions = "all"`

    This option is more or less identical to `channel_conditions`, except that it is used
    to filter notifications for private messages.

Roadmap
-------

### Settings

*   Customizable notification titles and message formats.

License
-------

This project is licensed under the MIT license.  See the `LICENSE` file for details.

[mantis]: http://leetcode.net/mantis
[ZNC]: http://en.znc.in "ZNC, an advanced IRC bouncer"
[ISO 8601]: http://en.wikipedia.org/wiki/ISO_8601 "ISO 8601 Date Format"

<!-- vim:set ft= expandtab tabstop=4 shiftwidth=4: -->


text:
package com.barentine.totalconnect.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for GetDoorBellSettingsResult complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="GetDoorBellSettingsResult">
 *   <complexContent>
 *     <extension base="{https://services.alarmnet.com/TC2/}WebMethodResults">
 *       <sequence>
 *         <element name="wiFiDoorBellSettings" type="{https://services.alarmnet.com/TC2/}WiFiDoorBellSettings" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GetDoorBellSettingsResult", propOrder = {
    "wiFiDoorBellSettings"
})
public class GetDoorBellSettingsResult
    extends WebMethodResults
{

    protected WiFiDoorBellSettings wiFiDoorBellSettings;

    /**
     * Gets the value of the wiFiDoorBellSettings property.
     *
     * @return
     *     possible object is
     *     {@link WiFiDoorBellSettings }
     *
     */
    public WiFiDoorBellSettings getWiFiDoorBellSettings() {
        return wiFiDoorBellSettings;
    }

    /**
     * Sets the value of the wiFiDoorBellSettings property.
     *
     * @param value
     *     allowed object is
     *     {@link WiFiDoorBellSettings }
     *
     */
    public void setWiFiDoorBellSettings(WiFiDoorBellSettings value) {
        this.wiFiDoorBellSettings = value;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package at.fhooe.mcm.hba.datastructure;

public interface IElement {

	/**
	 * An element which can be sent via mqqt
	 */
}


text:
package org.robolectric.shadows.testing;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import java.util.ArrayList;
import java.util.List;

public class TestContentProvider1 extends ContentProvider {

  public final List<String> transcript = new ArrayList<>();

  @Override
  public boolean onCreate() {
    transcript.add("onCreate");
    return false;
  }

  @Override
  public void shutdown() {
    super.shutdown();
    transcript.add("shutdown");
  }

  @Override
  public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
    transcript.add("query for " + uri);
    return null;
  }

  @Override
  public String getType(Uri uri) {
    return null;
  }

  @Override
  public Uri insert(Uri uri, ContentValues values) {
    return null;
  }

  @Override
  public int delete(Uri uri, String selection, String[] selectionArgs) {
    return 0;
  }

  @Override
  public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
    return 0;
  }
}


text:
package io.sundr.adapter.testing.general;

public class ClassWithSuperClassParam extends ClassWithParam<String> {

}


text:
package com.google.datastore.v1.client;

import java.util.HashMap;
import java.util.Map;

/** An immutable object containing settings for a {@link DatastoreEmulator}. */
public class DatastoreEmulatorOptions {
  private final Map<String, String> envVars;

  DatastoreEmulatorOptions(Map<String, String> envVars) {
    this.envVars = envVars;
  }

  /** Builder for {@link DatastoreEmulatorOptions}. */
  public static class Builder {
    private final Map<String, String> envVars = new HashMap<String, String>();

    public DatastoreEmulatorOptions build() {
      return new DatastoreEmulatorOptions(envVars);
    }

    /** Adds an environment variable to pass to the emulator. */
    public Builder addEnvVar(String var, String value) {
      envVars.put(var, value);
      return this;
    }
  }

  public Map<String, String> getEnvVars() {
    return envVars;
  }
}


text:
package org.estatio.module.capex.seed;

import org.incode.module.document.dom.impl.types.DocumentType;
import org.incode.module.document.fixture.DocumentTemplateFSAbstract;

import org.estatio.module.invoice.dom.DocumentTypeData;

public class DocumentTypeFSForIbanProof extends DocumentTemplateFSAbstract {

    protected DocumentType upsertType(
            DocumentTypeData documentTypeData,
            ExecutionContext executionContext) {
        return upsertType(documentTypeData.getRef(), documentTypeData.getName(), executionContext);
    }

    @Override
    protected void execute(final ExecutionContext executionContext) {
        upsertType(DocumentTypeData.IBAN_PROOF, executionContext);
    }

}


text:
<?php
class formHelper extends AppHelper {

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
DSIR Bulletin 236: 47 (1988)

#### Original name
Clavaria ypsilonidia R.H. Petersen, 1988

### Remarks
null


text:
FROM ubuntu:xenial

RUN apt-get update -y && \
    apt-get install -y libcanberra-gtk-module:i386 thunderbird && \
    apt-get autoremove -y && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/*

WORKDIR /var/www
CMD thunderbird


text:
package csp_test

import (
	"net/http/httptest"
	"testing"

	"github.com/google/go-cmp/cmp"
	"github.com/google/go-safeweb/safehttp"
	"github.com/google/go-safeweb/safehttp/plugins/csp"
	"github.com/google/safehtml/template"
)

func TestServeMuxInstallCSP(t *testing.T) {
	mb := safehttp.NewServeMuxConfig(nil)
	for _, i := range csp.Default("") {
		mb.Intercept(i)
	}

	var nonce string
	var err error
	handler := safehttp.HandlerFunc(func(w safehttp.ResponseWriter, r *safehttp.IncomingRequest) safehttp.Result {
		fns := map[string]interface{}{
			"CSPNonce": func() string { return "WrongNonce" },
		}
		// These are not used in the handler, just recorded to test whether the
		// handler can retrieve the CSP nonce (e.g. for when the CSP plugin is
		// installed, but auto-injection isn't yet supported and has to be done
		// manually by the handler).
		nonce, err = csp.Nonce(r.Context())
		t := template.Must(template.New("name").Funcs(fns).Parse(`<script nonce="{{CSPNonce}}" type="application/javascript">alert("script")</script><h1>{{.}}</h1>`))

		return safehttp.ExecuteTemplateWithFuncs(w, t, "Content", fns)
	})
	mux := mb.Mux()
	mux.Handle("/bar", safehttp.MethodGet, handler)

	rr := httptest.NewRecorder()

	req := httptest.NewRequest(safehttp.MethodGet, "https://foo.com/bar", nil)

	mux.ServeHTTP(rr, req)

	if err != nil {
		t.Fatalf("csp.Nonce: got error %v", err)
	}

	if nonce == "" {
		t.Fatalf("csp.Nonce: got %q, want non-empty", nonce)
	}

	if got, want := rr.Code, safehttp.StatusOK; got != int(want) {
		t.Errorf("rr.Code got: %v want: %v", got, want)
	}

	wantHeaders := map[string][]string{
		"Content-Type": {"text/html; charset=utf-8"},
		"Content-Security-Policy": {
			"object-src 'none'; script-src 'unsafe-inline' 'nonce-" + nonce + "' 'strict-dynamic' https: http:; base-uri 'none'",
			"require-trusted-types-for 'script'"},
	}
	if diff := cmp.Diff(wantHeaders, map[string][]string(rr.Header())); diff != "" {
		t.Errorf("rr.Header(): mismatch (-want +got):\n%s", diff)
	}

	wantBody := `<script nonce="` + nonce +
		`" type="application/javascript">alert("script")</script><h1>Content</h1>`
	if gotBody := rr.Body.String(); gotBody != wantBody {
		t.Errorf("response body: got %q, want nonce %q", gotBody, wantBody)
	}

}


text:
<?php
require_once AKD_PHPCOLCLI_LIB . "/Scheme.php";

class CledCliDefaultScheme extends CledCliScheme {
    protected function init() {
        $this->name    = "Default";
        $this->def     = new CledCliColorScheme(NULL, NULL);
        $this->success = new CledCliColorScheme(Colors::FG_GREEN, NULL);
        $this->warn    = new CledCliColorScheme(Colors::FG_YELLOW, NULL);
        $this->error   = new CledCliColorScheme(Colors::FG_RED, NULL);
    }
}

?>


text:
package com.android_mobile.core.utiles;

import java.util.ArrayList;

public class StringTookit {
    public static String fieldToSetMethod(String fieldName) {
        String r = "set";
        char[] chars = fieldName.toCharArray();
//		System.out.println("firstChar:"+fieldName.charAt(0));
        r += fieldName.replaceFirst((fieldName.charAt(0) + ""), (fieldName.charAt(0) + "").toUpperCase());
        return r;
    }

    public static String fieldToGetMethod(String fieldName) {
        String r = "get";
        char[] chars = fieldName.toCharArray();
//		System.out.println("firstChar:"+fieldName.charAt(0));
        r += fieldName.replaceFirst((fieldName.charAt(0) + ""), (fieldName.charAt(0) + "").toUpperCase());
        return r;
    }

    public static String fieldToIsMethod(String fieldName) {
        String r = "is";
        char[] chars = fieldName.toCharArray();
//		System.out.println("firstChar:"+fieldName.charAt(0));
        r += fieldName.replaceFirst((fieldName.charAt(0) + ""), (fieldName.charAt(0) + "").toUpperCase());
        return r;
    }

    public static String JSONStringFormat(String json) {
        String fillStringUnit = "\t";
        if (json == null || json.trim().length() == 0) {
            return null;
        }

        int fixedLenth = 0;
        ArrayList<String> tokenList = new ArrayList<String>();
        {
            String jsonTemp = json;
            while (jsonTemp.length() > 0) {
                String token = getToken(jsonTemp);
                jsonTemp = jsonTemp.substring(token.length());
                token = token.trim();
                tokenList.add(token);
            }
        }

        for (int i = 0; i < tokenList.size(); i++) {
            String token = tokenList.get(i);
            int length = token.getBytes().length;
            if (length > fixedLenth && i < tokenList.size() - 1 && tokenList.get(i + 1).equals(":")) {
                fixedLenth = length;
            }
        }

        StringBuilder buf = new StringBuilder();
        int count = 0;
        for (int i = 0; i < tokenList.size(); i++) {

            String token = tokenList.get(i);

            if (token.equals(",")) {
                buf.append(token);
                doFill(buf, count, fillStringUnit);
                continue;
            }
            if (token.equals(":")) {
                buf.append(" ").append(token).append(" ");
                continue;
            }
            if (token.equals("{")) {
                String nextToken = tokenList.get(i + 1);
                if (nextToken.equals("}")) {
                    i++;
                    buf.append("{ }");
                } else {
                    count++;
                    buf.append(token);
                    doFill(buf, count, fillStringUnit);
                }
                continue;
            }
            if (token.equals("}")) {
                count--;
                doFill(buf, count, fillStringUnit);
                buf.append(token);
                continue;
            }
            if (token.equals("[")) {
                String nextToken = tokenList.get(i + 1);
                if (nextToken.equals("]")) {
                    i++;
                    buf.append("[ ]");
                } else {
                    count++;
                    buf.append(token);
                    doFill(buf, count, fillStringUnit);
                }
                continue;
            }
            if (token.equals("]")) {
                count--;
                doFill(buf, count, fillStringUnit);
                buf.append(token);
                continue;
            }

            buf.append(token);
            if (i < tokenList.size() - 1 && tokenList.get(i + 1).equals(":")) {
                int fillLength = fixedLenth - token.getBytes().length;
                if (fillLength > 0) {
                    for (int j = 0; j < fillLength; j++) {
                        buf.append(" ");
                    }
                }
            }
        }
        return buf.toString();
    }

    private static String getToken(String json) {
        StringBuilder buf = new StringBuilder();
        boolean isInYinHao = false;
        while (json.length() > 0) {
            String token = json.substring(0, 1);
            json = json.substring(1);

            if (!isInYinHao &&
                    (token.equals(":") || token.equals("{") || token.equals("}")
                            || token.equals("[") || token.equals("]")
                            || token.equals(","))) {
                if (buf.toString().trim().length() == 0) {
                    buf.append(token);
                }

                break;
            }

            if (token.equals("\\")) {
                buf.append(token);
                buf.append(json.substring(0, 1));
                json = json.substring(1);
                continue;
            }
            if (token.equals("\"")) {
                buf.append(token);
                if (isInYinHao) {
                    break;
                } else {
                    isInYinHao = true;
                    continue;
                }
            }
            buf.append(token);
        }
        return buf.toString();
    }

    private static void doFill(StringBuilder buf, int count, String fillStringUnit) {
        buf.append("\n");
        for (int i = 0; i < count; i++) {
            buf.append(fillStringUnit);
        }
    }
}


text:
<ion-view>
    <ion-content padding="true" class="has-header">

            Text
            <textarea placeholder=""> </textarea>

            <button class="button button-stable button-block">Back</button>
            <button class="button button-stable button-block">Skip</button>
            <button class="button button-stable button-block">Hint</button>

    </ion-content>
</ion-view>


text:
%This function calculates the discrete derivative of a matrix in
%x-direction using forward finite differences. The matrix can also be 3d.
%Right now, zero Dirichlet boundary conditions are used. For zero Neumann
%boundary conditions, uncomment the two lines in the middle.

function A = vwdiff_x(u)

[m n c]=size(u);
e = ones(n,1);
mul=spdiags([e -e], -1:0, n, n);

%mul(n,n)=1;
%mul(n-1,n)=-1;

for k=1:c
A(:,:,k)=u(:,:,k)*mul;
end


text:
import { describe, it } from 'mocha';
import { expect } from 'chai';
import Controller from '../src/js/controller';

describe('Controller', () => {

  it('Should be able to initialize a controller', () => {
    let ctrl = new Controller();
    ctrl.init();
    expect(ctrl.model.rows).to.not.be.undefined;
    expect(ctrl.model.max).to.be.equal(1);
  });

  it('Should be able to add new boxes to existing rows', () => {
    let ctrl = new Controller();
    ctrl.init();
    ctrl.createBox(0,1);
    expect(ctrl.model.max).to.be.equal(2);

    ctrl.createBox(0,2);
    expect(ctrl.model.max).to.be.equal(3);
  });

  it('Should create a new row when overflow', () => {
    let ctrl = new Controller();
    ctrl.init();
    ctrl.createBox(0,1);
    ctrl.createBox(0,1);
    ctrl.createBox(0,2);
    expect(ctrl.model.rows.length).to.be.equal(2);
    expect(ctrl.model.rows[1].capacity).to.be.equal(2);
  });

  it('Should be able to remove items', () => {
    let ctrlRemove = new Controller();
    ctrlRemove.init();
    // Add 4 items for testing
    for (let i = 0; i < 5; i++) {
      ctrlRemove.createBox(0,1);
    }
    // Should remove the last row
    ctrlRemove.removeBox(0,2);
    expect(ctrlRemove.model.rows.length).to.be.equal(2);

  });
});


text:
'use strict';

var FetchContextApi = require('fetch-context-api.js');

module.exports = SimpleMovableFetch;

var FETCH_STATE_WAIT_FOR_MOVE = 1;
var FETCH_STATE_ACTIVE = 2;
var FETCH_STATE_STOPPING = 3;
var FETCH_STATE_STOPPED = 4;
var FETCH_STATE_TERMINATED = 5;

function SimpleMovableFetch(fetcher, indirectCloseIndication, fetchContext, maxActiveFetchesInMovableFetch) {
    this._fetcher = fetcher;
    this._indirectCloseIndication = indirectCloseIndication;
    this._movableFetchContext = fetchContext;
    this._maxActiveFetchesInMovableFetch = maxActiveFetchesInMovableFetch;

    this._lastFetch = null;
    this._activeFetchesInMovableFetch = 0;
    this._pendingImagePartParams = null;
    this._movableState = FETCH_STATE_WAIT_FOR_MOVE;

    this._isProgressive = false;
    this._isProgressiveChangedCalled = false;

    fetchContext.on('move', this._onMove, this);
    fetchContext.on('terminate', this._onTerminated, this);
    fetchContext.on('isProgressiveChanged', this._onIsProgressiveChanged, this);
    fetchContext.on('stop', this._onStop, this);
    fetchContext.on('resume', this._onResume, this);
}

SimpleMovableFetch.prototype.start = function start(imagePartParams) {
    this._onMove(imagePartParams);
};

SimpleMovableFetch.prototype._onIsProgressiveChanged = function isProgressiveChanged(isProgressive) {
    this._isProgressive = isProgressive;
    var lastActiveFetch = this._getLastFetchActive();
    if (lastActiveFetch !== null) {
        lastActiveFetch._onEvent('isProgressiveChanged', isProgressive);
    } else {
        this._isProgressiveChangedCalled = true;
    }
};

SimpleMovableFetch.prototype._onStop = function stop(isAborted) {
    this._switchState(FETCH_STATE_STOPPING, FETCH_STATE_ACTIVE);
    var lastActiveFetch = this._getLastFetchActive();
    if (lastActiveFetch !== null) {
        lastActiveFetch._onEvent('stop', isAborted);
    }
};

SimpleMovableFetch.prototype._onResume = function resume() {
    this._switchState(FETCH_STATE_ACTIVE, FETCH_STATE_STOPPED, FETCH_STATE_STOPPING);

    if (this._lastFetch === null) {
        throw 'imageDecoderFramework error: resuming non stopped fetch';
    }

    if (this._isProgressiveChangedCalled) {
        this._isProgressiveChangedCalled = false;
        this._lastFetch._onEvent('isProgressiveChanged', this._isProgressive);
    }
    this._lastFetch._onEvent('resume');
};

SimpleMovableFetch.prototype._onTerminated = function onTerminated(isAborted) {
    throw 'imageDecoderFramework error: Unexpected termination of movable fetch';
};

SimpleMovableFetch.prototype._onMove = function move(imagePartParams) {
    this._pendingImagePartParams = imagePartParams;
    this._movableState = FETCH_STATE_ACTIVE;
    this._tryStartPendingFetch();
};

SimpleMovableFetch.prototype._tryStartPendingFetch = function tryStartPendingFetch() {
    if (this._indirectCloseIndication.isCloseRequested ||
        this._activeFetchesInMovableFetch >= this._maxActiveFetchesInMovableFetch ||
        this._pendingImagePartParams === null ||
        this._movableState !== FETCH_STATE_ACTIVE) {

            return;
    }

    var newFetch = {
        imagePartParams: this._pendingImagePartParams,
        state: FETCH_STATE_ACTIVE,

        fetchContext: null,
        self: this
    };

    this._pendingImagePartParams = null;
    ++this._activeFetchesInMovableFetch;

    newFetch.fetchContext = new FetchContextApi();
    newFetch.fetchContext.on('internalStopped', onSingleFetchStopped, newFetch);
    newFetch.fetchContext.on('internalDone', onSingleFetchDone, newFetch);

    this._fetcher.startFetch(newFetch.fetchContext, newFetch.imagePartParams);
};

SimpleMovableFetch.prototype._singleFetchStopped = function singleFetchStopped(fetch, isDone) {
    --this._activeFetchesInMovableFetch;
    this._lastFetch = null;
    fetch.state = FETCH_STATE_TERMINATED;

    this._tryStartPendingFetch();
};

SimpleMovableFetch.prototype._getLastFetchActive = function getLastFetchActive() {
    if (this._movableState === FETCH_STATE_STOPPED || this._lastFetch === null) {
        return null;
    }

    if (this._lastFetch.state === FETCH_STATE_ACTIVE) {
        return this._lastFetch.fetchContext;
    }
    return null;
};

SimpleMovableFetch.prototype._switchState = function switchState(targetState, expectedState, expectedState2, expectedState3) {
    if (this._movableState !== expectedState && this._movableState !== expectedState2 && this._movableState !== expectedState3) {
        throw 'imageDecoderFramework error: Unexpected state ' + this._movableState + ', expected ' + expectedState + ' or ' + expectedState2 + ' or ' + expectedState3;
    }
    this._movableState = targetState;
};

SimpleMovableFetch.prototype._isLastFetch = function isLastFetch(fetch) {
    return this._lastFetch === fetch && this._pendingImagePartParams === null;
};

function onSingleFetchStopped() {
    /* jshint validthis: true */
    var fetch = this;
    var movableFetch = fetch.self;

    if (fetch.state !== FETCH_STATE_STOPPING) {
        throw 'imageDecoderFramework error: Unexpected state of fetch ' + fetch.state + ' on stopped';
    }

    if (movableFetch._isLastFetch(fetch)) {
        fetch.state = FETCH_STATE_STOPPED;
        movableFetch._switchState(FETCH_STATE_STOPPED, FETCH_STATE_STOPPING);
        movableFetch._movableFetchContext.stopped();
    } else {
        movableFetch._singleFetchStopped(fetch);
    }
}

function onSingleFetchDone() {
    /* jshint validthis: true */
    var fetch = this;
    var movableFetch = fetch.self;

    if (fetch.state !== FETCH_STATE_ACTIVE && fetch.state !== FETCH_STATE_STOPPING) {
        throw 'imageDecoderFramework error: Unexpected state of fetch ' + fetch.state + ' on done';
    }

    fetch.state = FETCH_STATE_TERMINATED;
    if (movableFetch._isLastFetch(fetch)) {
        movableFetch._switchState(FETCH_STATE_WAIT_FOR_MOVE, FETCH_STATE_ACTIVE, FETCH_STATE_STOPPING);
        movableFetch._movableFetchContext.done();
    }
    movableFetch._singleFetchStopped(fetch);
}


text:
define(["jquery", "backbone", "models/IndexModel"],
	function($, Backbone, Model) {

		// Creates a new Backbone Collection class object
		var IndexCollection = Backbone.Collection.extend({

			// Tells the Backbone Collection that all of it's models will be of type Model (listed up top as a dependency)
			model: Model

		});

		// Returns the Model class
		return IndexCollection;

	}

);


text:
/**
 * @file
 * @brief Cortex-M public interrupt handling
 *
 * ARM-specific kernel interrupt handling interface. Included by arm/arch.h.
 */

#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_IRQ_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_IRQ_H_

#include <irq.h>
#include <sw_isr_table.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef _ASMLANGUAGE
GTEXT(_IntExit);
GTEXT(z_arch_irq_enable)
GTEXT(z_arch_irq_disable)
GTEXT(z_arch_irq_is_enabled)
#else
extern void z_arch_irq_enable(unsigned int irq);
extern void z_arch_irq_disable(unsigned int irq);
extern int z_arch_irq_is_enabled(unsigned int irq);

extern void _IntExit(void);

/* macros convert value of it's argument to a string */
#define DO_TOSTR(s) #s
#define TOSTR(s) DO_TOSTR(s)

/* concatenate the values of the arguments into one */
#define DO_CONCAT(x, y) x ## y
#define CONCAT(x, y) DO_CONCAT(x, y)

/* internal routine documented in C file, needed by IRQ_CONNECT() macro */
extern void z_irq_priority_set(unsigned int irq, unsigned int prio,
			      u32_t flags);

/* Flags for use with IRQ_CONNECT() */
#ifdef CONFIG_ZERO_LATENCY_IRQS
/**
 * Set this interrupt up as a zero-latency IRQ. It has a fixed hardware
 * priority level (discarding what was supplied in the interrupt's priority
 * argument), and will run even if irq_lock() is active. Be careful!
 */
#define IRQ_ZERO_LATENCY	BIT(0)
#endif

/**
 * Configure a static interrupt.
 *
 * All arguments must be computable by the compiler at build time.
 *
 * Z_ISR_DECLARE will populate the .intList section with the interrupt's
 * parameters, which will then be used by gen_irq_tables.py to create
 * the vector table and the software ISR table. This is all done at
 * build-time.
 *
 * We additionally set the priority in the interrupt controller at
 * runtime.
 *
 * @param irq_p IRQ line number
 * @param priority_p Interrupt priority
 * @param isr_p Interrupt service routine
 * @param isr_param_p ISR parameter
 * @param flags_p IRQ options
 *
 * @return The vector assigned to this interrupt
 */
#define Z_ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
({ \
	Z_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \
	z_irq_priority_set(irq_p, priority_p, flags_p); \
	irq_p; \
})

/**
 * Configure a 'direct' static interrupt.
 *
 * See include/irq.h for details.
 * All arguments must be computable at build time.
 */
#define Z_ARCH_IRQ_DIRECT_CONNECT(irq_p, priority_p, isr_p, flags_p) \
({ \
	Z_ISR_DECLARE(irq_p, ISR_FLAG_DIRECT, isr_p, NULL); \
	z_irq_priority_set(irq_p, priority_p, flags_p); \
	irq_p; \
})

/* FIXME prefer these inline, but see GH-3056 */
#ifdef CONFIG_SYS_POWER_MANAGEMENT
extern void _arch_isr_direct_pm(void);
#define Z_ARCH_ISR_DIRECT_PM() _arch_isr_direct_pm()
#else
#define Z_ARCH_ISR_DIRECT_PM() do { } while (false)
#endif

#define Z_ARCH_ISR_DIRECT_HEADER() z_arch_isr_direct_header()
extern void z_arch_isr_direct_header(void);

#define Z_ARCH_ISR_DIRECT_FOOTER(swap) z_arch_isr_direct_footer(swap)

/* arch/arm/core/exc_exit.S */
extern void _IntExit(void);

#ifdef CONFIG_TRACING
extern void z_sys_trace_isr_exit(void);
#endif

static inline void z_arch_isr_direct_footer(int maybe_swap)
{

#ifdef CONFIG_TRACING
	z_sys_trace_isr_exit();
#endif
	if (maybe_swap) {
		_IntExit();
	}
}

#define Z_ARCH_ISR_DIRECT_DECLARE(name) \
	static inline int name##_body(void); \
	__attribute__ ((interrupt ("IRQ"))) void name(void) \
	{ \
		int check_reschedule; \
		ISR_DIRECT_HEADER(); \
		check_reschedule = name##_body(); \
		ISR_DIRECT_FOOTER(check_reschedule); \
	} \
	static inline int name##_body(void)

/* Spurious interrupt handler. Throws an error if called */
extern void z_irq_spurious(void *unused);

#ifdef CONFIG_GEN_SW_ISR_TABLE
/* Architecture-specific common entry point for interrupts from the vector
 * table. Most likely implemented in assembly. Looks up the correct handler
 * and parameter from the _sw_isr_table and executes it.
 */
extern void _isr_wrapper(void);
#endif

#endif /* _ASMLANGUAGE */

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_IRQ_H_ */


text:
package de.tum.in.www1.jReto.routing;

import java.nio.ByteBuffer;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;

import de.tum.in.www1.jReto.module.api.Address;
import de.tum.in.www1.jReto.module.api.Connection;
import de.tum.in.www1.jReto.packet.PacketType;
import de.tum.in.www1.jReto.routing.algorithm.LinkStateRoutingTable;
import de.tum.in.www1.jReto.routing.algorithm.Tree;
import de.tum.in.www1.jReto.routing.packets.ConnectionPurpose;
import de.tum.in.www1.jReto.routing.packets.LinkHandshake;
import de.tum.in.www1.jReto.routing.packets.LinkStatePacket;
import de.tum.in.www1.jReto.routing.packets.MulticastHandshake;
import de.tum.in.www1.jReto.routing.packets.RoutedConnectionEstablishedConfirmationPacket;
import de.tum.in.www1.jReto.util.RepeatedExecutor;

/**
* The Router class is responsible for discovering remote peers (represented via the Node class) in the network (both directly and indirectly reachable ones),
* and establish connections to those peers.
*
* In this implementation, this involves the following tasks:
*
* - Using of Reto Modules to discover direct neighbors and advertise the local peer (this is implemented in the DefaultRouter subclass).
* - Distribution of routing information using a flooding algorithm.
* - Building a link-state routing table based on that information.
* - Computing reachability information about other nodes when new routing information is received and informing the delegate about changes in reachabilty
* - Establishing connections to other peers, including routed connections
* - Acting as a router for other nodes, i.e. forwarding data from one peer to another, without handling the data on the local peer
* - Supporting multicast connections (computing routes, handling incoming underlying connections accordingly)
*/
public class Router {
	public static class BroadcastDelaySettings {
		public final double regularDelay;
		public final double shortDelay;

		public BroadcastDelaySettings(double regularDelay, double shortDelay) {
			this.regularDelay = regularDelay;
			this.shortDelay = shortDelay;
		}
	}

	public static interface RouterHandler {
		void onNodeFound(Router router, Node node);
		void onRouteImproved(Router router, Node node);
		void onNodeLost(Router router, Node node);
		void onConnection(Router router, Node node, Connection connection);
	}
	public static interface OnConnectionHandler {
		public void onConnect(Connection connection);
	}
	public static interface OnFailHandler {
		public void onFail();
	}

    /** The local peer's identifier */
	private final UUID identifier;
    /** The Executor used for networking related tasks. Delegate methods are also called on this Executor. */
	private final Executor executor;
    /** The Router's delegate. */
	private RouterHandler handler;

    /** A map from a node's UUID to the node for all Nodes known to the Router */
	private Map<UUID, Node> nodes = new HashMap<UUID, Node>();
    /** The set of Nodes that are neighbors of the local peer. */
	private Set<Node> neighbors = new HashSet<Node>();
    /**
    * Forking connections act as a normal underling connection for the local peer, but forward received data to another peer in the background.
    * This type of connection is used in multicast connections.
    * As the local peer may not hold a reference to the connection, it must be retained here.
    */
	private final Set<ForkingConnection> forwardingConnections = new HashSet<>();

    /** The linkStatePacketManager floods LinkStatePackets (i.e. routing information) through the network */
	private FloodingPacketManager linkStatePacketManager;
    /** Link state information packets are flooded periodically. The delayedLinkStateBroadcaster calls the appropriate methods in specified intervals. */
	private RepeatedExecutor delayedLinkStateBroadcaster;
    /** The routing table that builds a representation of the network using received link state information. */
	private final LinkStateRoutingTable<UUID> routingTable;

	public Executor getExecutor() {
		return this.executor;
	}

	public Collection<Node> getNeighborNodes() {
		return this.neighbors;
	}

	public UUID getLocalNodeIdentifier() {
		return this.identifier;
	}
	public void setHandler(RouterHandler handler) {
		this.handler = handler;
	}

    /**
    * Constructs a Router.
    * @param identifier The local peer's identifier
    * @param linkStateBroadcastDelaySettings Settings related to the time intervals in which link state information is sent.
    * @param executor The Executor used for networking purposes. Delegate methods are also called on this executor.
    **/
	public Router(UUID identifier, Executor executor, BroadcastDelaySettings linkStateBroadcastDelaySettings) {
		this.identifier = identifier;
		this.executor = executor;
		this.routingTable = new LinkStateRoutingTable<UUID>(identifier);

		this.linkStatePacketManager = new FloodingPacketManager(new FloodingPacketManager.PacketHandler() {
			@Override
			public Set<PacketType> getHandledPacketTypes() {
				return new HashSet<>(Arrays.asList(PacketType.LINK_STATE));
			}
			@Override
			public void handlePacket(ByteBuffer data, PacketType type) {
				LinkStatePacket packet = LinkStatePacket.deserialize(data);
				if (packet == null) {
					System.err.println("Received invalid LinkState packet.");
				} else {
					Router.this.handleLinkStatePacket(packet);
				}
			}
		}, this);

		this.delayedLinkStateBroadcaster = new RepeatedExecutor(new Runnable() {
			@Override
			public void run() {
				Router.this.broadcastLinkStateInformation();
			}
		}, linkStateBroadcastDelaySettings.regularDelay, linkStateBroadcastDelaySettings.shortDelay, executor);
		this.delayedLinkStateBroadcaster.start();
	}

    /** Constructs a new node for a given identifier. */
	private Node provideNode(UUID nodeIdentifier) {
		Node node = this.nodes.get(nodeIdentifier);

		if (node == null) {
			node = new Node(this, nodeIdentifier, this.identifier);
			this.nodes.put(nodeIdentifier, node);
		}

		return node;
	}
    /**
    * Adds an address for a given node.
    * The routing metadata connection for that node is established.
    * Finally, changes in reachability are computed, and the delegate is informed about any changes.
    */
	public void addAddress(UUID nodeIdentifier, Address address) {
		if (nodeIdentifier.equals(this.identifier)) return;

		Node node = this.provideNode(nodeIdentifier);
		Address oldBestAddress = node.getBestAddress();
		node.addAddress(address);

		if (oldBestAddress == null || (oldBestAddress.getCost() > address.getCost())) {
			node.establishRoutingConnection();
			this.updateNodes(this.routingTable.getRoutingTableChangeForNeighborUpdate(nodeIdentifier, address.getCost()));
		}
	}
    /**
    * Removes an address for a node.
    * Notifies the delegate about routing table changes.
    */
	public void removeAddress(UUID nodeIdentifier, Address address) {
		if (nodeIdentifier.equals(this.identifier)) return;
		if (!this.nodes.containsKey(nodeIdentifier)) throw new InvalidParameterException("Attempted to remove address from unknown node.");

		Node node = this.provideNode(nodeIdentifier);
		node.removeAddress(address);

		if (node.getAddresses().size() != 0) {
			this.updateNodes(this.routingTable.getRoutingTableChangeForNeighborUpdate(nodeIdentifier, node.getBestAddress().getCost()));
		} else {
			this.updateNodes(this.routingTable.getRoutingTableChangeForNeighborRemoval(nodeIdentifier));
		}
	}

    /*
    * Establishes a direct connection with a specific ConnectionPurpose to a given neighboring destination node
    *
    * @param destination The node to establish the connection with. Needs to be a direct neighbor of this node.
    * @param purpose The connection's purpose. Used to differentiate between routing metadata connections and standard routed connections.
    * @param onConnection A callback called when the connection is established.
    * @param onFail A closure called when an error occurs.
    */
	public void establishDirectConnection(Node destination, ConnectionPurpose purpose, final OnConnectionHandler onConnection, final OnFailHandler onFail) {
		Address bestAddress = destination.getBestAddress();

		if (bestAddress == null) {
			System.err.println("Failed to establish direct connection: no address is currently known for this peer. Most likely, it will be discovered soon.");
			onFail.onFail();
			return;
		}

		final Connection connection = bestAddress.createConnection();
		LinkHandshake linkHandshake = new LinkHandshake(this.identifier, purpose);

		SinglePacketHelper.write(connection, linkHandshake, new SinglePacketHelper.OnSuccessHandler() {
			@Override
			public void onSuccess() {
				onConnection.onConnect(connection);
			}
		}, new SinglePacketHelper.OnFailHandler() {
			@Override
			public void onFail() {
				System.err.println("Failed to send LinkHandshake packet.");
				onFail.onFail();
			}
		});

		connection.connect();
	}
    /**
    * Handles direct connections. Expects to receive a LinkHandshake packet, which is sent by this method's counterpart, establishDirectConnection.
    * Depending on the ConnectionPurpose received, the connection is either used as a routing connection, or handled as a hop connection.
    */
	public void handleDirectConnection(final Connection connection) {
		SinglePacketHelper.read(connection, new SinglePacketHelper.OnPacketHandler() {
			@Override
			public void onPacket(ByteBuffer data) {
				LinkHandshake packet = LinkHandshake.deserialize(data);

				if (packet == null) {
					System.err.println("Received invalid LinkHandshake packet.");
					connection.close();
					return;
				}

				switch (packet.connectionPurpose) {
				case ROUTING_DATA_EXCHANGE_CONNECTION:
					Router.this.provideNode(packet.peerIdentifier).handleRoutingConnection(connection);
					break;
				case ROUTED_CONNECTION:
					Router.this.handleHopConnection(packet.peerIdentifier, connection);
					break;
				default:
					System.err.println("Unknown connection purpose.");
					connection.close();
					break;
				}
			}
		}, new SinglePacketHelper.OnFailHandler() {
			@Override
			public void onFail() {
				System.err.println("Did not receive LinkHandshake, cannot handle this connection.");
			}
		});
	}

	private static class MutableBoolean {
		public boolean value = false;
	}
    /**
    * Establishes all hop connections based on a nextHopTree. Hop connections are direct connections between two nodes and are part of a routed or multicast connection.
    * When establishing a routed connection, multiple peers may need to establish direct connections to each other. This method establishes the connections
    * that need to be established by the local peer.
    *
    * This method establishes a direct connection for each child of the root (the local peer) of the next hop tree passed in.
    * It then sends a MulticastHandshake over each connection.
    *
    * If there are multiple children, a MulticastConnection is constructed that bundles the connections (i.e. it acts as a single connection that sends data to a set of subconnections).
    * If the local peer is a destination, a ForkingConnection used that is handled by the local peer as a normal underlying connection.
    *
    * @param destinationIdentifiers A set of UUIDs representing all destinations of the multicast connection for which the hop connections are used.
    * @param nextHopTree A Tree of UUIDs rooted at the local peer. This method establishes direct connections to each child, then sends the subtrees of the next hop tree to each child, such that they in turn can establish the next hop connections.
    * @param sourcePeerIdentifier The peer from which this connection originated.
    * @param onConnection A closure that is called when the next hop connections were established.
    * @param onFail A closure that is called when the connection establishement process failed.
    */
	public void establishHopConnections(final Set<UUID> destinationIdentifiers, final Tree<UUID> nextHopTree, final UUID sourcePeerIdentifier, final OnConnectionHandler onConnection, final OnFailHandler onFail) {
		final boolean useMulticastConnection = nextHopTree.children.size() > 1;
		final MulticastConnection multicastConnection = (useMulticastConnection) ? new MulticastConnection() : null;
		// A class wrapper for a boolean so the same instance can be accessed from all callbacks.
		final MutableBoolean failed = new MutableBoolean();

		for (final Tree<UUID> nextHopSubtree : nextHopTree.children) {
			this.establishDirectConnection(this.provideNode(nextHopSubtree.value), ConnectionPurpose.ROUTED_CONNECTION, new OnConnectionHandler() {
				@Override
				public void onConnect(final Connection connection) {
					MulticastHandshake handshake = new MulticastHandshake(sourcePeerIdentifier, destinationIdentifiers, nextHopSubtree);

					SinglePacketHelper.write(connection, handshake, new SinglePacketHelper.OnSuccessHandler() {
						@Override
						public void onSuccess() {
							if (failed.value) {
								connection.close();
								return;
							}

							if (useMulticastConnection) {
								multicastConnection.addSubconnection(connection);
								if (multicastConnection.getSubconnections().size() == nextHopTree.children.size()) {
									onConnection.onConnect(multicastConnection);
								}
							} else {
								onConnection.onConnect(connection);
							}
						}
					}, new SinglePacketHelper.OnFailHandler() {
						@Override
						public void onFail() {
							System.err.println("Could not send RoutingHandshake, connection establishment failed.");
							failed.value = true;

							if (multicastConnection != null) multicastConnection.close();

							onFail.onFail();
						}
					});
				}
			}, new OnFailHandler() {
				@Override
				public void onFail() {
					failed.value = true;

					if (multicastConnection != null) multicastConnection.close();

					onFail.onFail();
				}
			});
		}
	}

    /**
    * Handles a incoming hop connection (i.e. a direct connection with a purpose of RoutedConnection).
    * Expects to receive a MulticastHandshake from the connection.
    *
    * If the next hop tree in the MulticastHandshake is a leaf, the connection can be handled as a multicast connection directly.
    * Otherwise, the nextHopTree is used to establish the next hop connections, to which data is forwarded.
    * The connection is only handled on the local peer if it is a destination.
    *
    * @param connection The connection to handle
    */
	public void handleHopConnection(UUID hopSourceIdentifier, final Connection connection) {
		SinglePacketHelper.read(connection, new SinglePacketHelper.OnPacketHandler() {
			@Override
			public void onPacket(ByteBuffer data) {
				MulticastHandshake multicastHandshake = MulticastHandshake.deserialize(data);

				if (multicastHandshake == null) {
					System.err.println("Received invalid MulticastHandshake.");
					connection.close();
				}

				if (multicastHandshake.nextHopsTree.isLeaf()) {
					Router.this.handleMulticastConnection(multicastHandshake.sourcePeerIdentifier, connection);
				} else {
					Router.this.establishForwardingConnections(multicastHandshake.sourcePeerIdentifier, multicastHandshake.destinationIdentifiers, multicastHandshake.nextHopsTree, connection);
				}
			}
		}, new SinglePacketHelper.OnFailHandler() {
			@Override
			public void onFail() {
				System.err.println("Failed to receive RoutingPacket. Cannot handle connection.");
			}
		});
	}
    /**
    * Establishes forwarding connections. Data received from an incoming connection is forwarded to an outgoing connection established via establishHopConnections,
    * and vice versa. If the local peer is a destination, a ForkingConnection is used to allow the local peer to handle the connection.
    *
    * @param sourcePeerIdentifier The UUID of the peer which originally established the connection.
    * @param destinations A set of UUIDs that represent the destinations.
    * @param nextHopTree A tree rooted at the local peer representing the connections that still need to be established.
    * @param incomingConnection The connection from which data should be forwarded.
    */
	public void establishForwardingConnections(final UUID sourceNodeIdentifier, final Set<UUID> destinationNodeIdentifiers, Tree<UUID> nextHopsTree, final Connection incomingConnection) {
		this.establishHopConnections(destinationNodeIdentifiers, nextHopsTree, sourceNodeIdentifier, new OnConnectionHandler() {
			@Override
			public void onConnect(Connection outgoingConnection) {
				Connection connection = Router.this.createForwardingConnection(incomingConnection, outgoingConnection);
				if (destinationNodeIdentifiers.contains(Router.this.identifier)) Router.this.handleMulticastConnection(sourceNodeIdentifier, connection);
			}
		}, new OnFailHandler() {
			@Override
			public void onFail() {
				System.err.println("Failed to establish connection to the next hops.");
				incomingConnection.close();
			}
		});
	}
    /** Creates a forking connection for an incoming and outgoing connection. */
	public Connection createForwardingConnection(Connection incomingConnection, Connection outgoingConnection) {
		ForkingConnection forwardingConnection = new ForkingConnection(incomingConnection, outgoingConnection, new ForkingConnection.CloseHandler() {
			@Override
			public void onClose(ForkingConnection connection) {
				Router.this.removeForwardingConnection(connection);
			}
		});

		this.forwardingConnections.add(forwardingConnection);

		return forwardingConnection;
	}
    /** Removes a forking connection. */
	public void removeForwardingConnection(ForkingConnection connection) {
		this.forwardingConnections.remove(connection);
	}

   /**
    * Establishes a multicast connection to a set of destinations. If the destinations set contains only one element, a unicast connection is established.
    *
    * Starts the hop connection establishement process. Expects a confirmation packet from all destinations to ensure that the connection was established successfully (these packets are sent by the handleMulticastConnection method). Finally sends a confirmation packet in turn, to signal that the connection is fully functional.
    *
    * @param destinations A set of destinations.
    * @param onConnection A closure that is called when the connection was fully established.
    * @param onFail A closure that is called when the connection establishment process fails.
    */
	public void establishMulticastConnection(final Set<Node> destinations, final OnConnectionHandler onConnection, final OnFailHandler onFail) {
		final Set<UUID> destinationIdentifiers = new HashSet<UUID>();
		for (Node destination : destinations) destinationIdentifiers.add(destination.getIdentifier());
		Tree<UUID> nextHopTree = this.routingTable.getNextHopTree(destinationIdentifiers);

		if (nextHopTree == null) {
			onFail.onFail();
			return;
		}

		final Set<UUID> receivedConfirmations = new HashSet<>();

		this.establishHopConnections(destinationIdentifiers, nextHopTree, this.identifier, new OnConnectionHandler() {
			@Override
			public void onConnect(final Connection connection) {
				SinglePacketHelper.read(connection, destinationIdentifiers.size(), new SinglePacketHelper.OnPacketHandler() {
					@Override
					public void onPacket(ByteBuffer data) {
						RoutedConnectionEstablishedConfirmationPacket packet = RoutedConnectionEstablishedConfirmationPacket.deserialize(data);
						if (packet == null) {
							System.err.println("Failed to receive confirmation packet.");
							connection.close();
							return;
						}
						receivedConfirmations.add(packet.source);
					}
				}, new SinglePacketHelper.OnSuccessHandler() {
					@Override
					public void onSuccess() {
						if (receivedConfirmations.equals(destinationIdentifiers)) {
							SinglePacketHelper.write(connection, new RoutedConnectionEstablishedConfirmationPacket(identifier), new SinglePacketHelper.OnSuccessHandler() {
								@Override
								public void onSuccess() {
									onConnection.onConnect(connection);
								}
							}, new SinglePacketHelper.OnFailHandler() {
								@Override
								public void onFail() {
									onFail.onFail();
								}
							});
						} else {
							System.err.println(identifier+": Did not receive all confirmation packets.");
							connection.close();
						}
					}
				}, new SinglePacketHelper.OnFailHandler() {
					@Override
					public void onFail() {
						System.err.println("Failed to receive confirmation packets.");
						onFail.onFail();
					}
				});
			}
		}, onFail);
	}
    /**
    * Handles a multicast connection.
    *
    * Sends a confirmation packet to the establisher of the connection. Then expects to receive a confirmation packet in turn.
    * Once the confirmation is received, the connection can be handled by the local peer.
    *
    * @param sourcepeerIdentifier The identifier of the peer that originally established the connection.
    * @param connection An underlying connection that should be handled.
    */
	public void handleMulticastConnection(final UUID sourceNodeIdentifier, final Connection connection) {
		SinglePacketHelper.write(connection, new RoutedConnectionEstablishedConfirmationPacket(this.identifier), new SinglePacketHelper.OnSuccessHandler() {
			@Override
			public void onSuccess() {
				SinglePacketHelper.read(connection, new SinglePacketHelper.OnPacketHandler() {
					@Override
					public void onPacket(ByteBuffer data) {
						RoutedConnectionEstablishedConfirmationPacket packet = RoutedConnectionEstablishedConfirmationPacket.deserialize(data);
						if (packet == null) {
							System.err.println("Received invalid data.");
							connection.close();
							return;
						}

						Router.this.handler.onConnection(Router.this, Router.this.provideNode(sourceNodeIdentifier), connection);
					}
				}, new SinglePacketHelper.OnFailHandler() {
					@Override
					public void onFail() {
						System.err.println(identifier+": Did not receive establishment confirmation.");
					}
				});
			}
		}, new SinglePacketHelper.OnFailHandler() {
			@Override
			public void onFail() {
				System.err.println(identifier+": Failed to send routed connection established confirmation.");
			}
		});
	}

    /**
    * Updates all nodes with routing table changes.
    * Informs the delegate about any changes in reachability.
    * @param change A RoutingTableChange object reflecting a set of changes in the routing table.
    */
	public void updateNodes(LinkStateRoutingTable.Change<UUID> change) {
		if (change.isEmpty()) return;

		System.out.println();
		System.out.println(" -- Updating with Routing Table Change (local identifier: "+this.identifier+") -- ");
		if (change.nowReachable.isEmpty()) { System.out.println(" - No new nodes reachable."); }
        else { System.out.println(" - Nodes now reachable: "); }

        for (LinkStateRoutingTable.Change.NowReachableInformation<UUID> nowReachable : change.nowReachable) {
            Node discoveredNode = this.provideNode(nowReachable.node);
            Node nextHopNode = this.provideNode(nowReachable.nextHop);

            discoveredNode.setNextHop(nextHopNode);
            discoveredNode.setCost((int)nowReachable.cost);

            System.out.println("\t"+nowReachable.node+" (via "+nowReachable.nextHop+", cost: "+nowReachable.cost+")");
        }

        if (change.nowUnreachable.isEmpty()) { System.out.println(" - No nodes became unreachable."); }
        else { System.out.println(" - Nodes now unreachable: "); }

        for (UUID nowUnreachable : change.nowUnreachable) {
            Node unreachableNode = this.provideNode(nowUnreachable);

            unreachableNode.setNextHop(null);

            System.out.println("\t"+nowUnreachable+"");
        }

        if (change.routeChanged.isEmpty()) { System.out.println(" - No routes changed."); }
        else { System.out.println(" - Routes changed for nodes: "); }

        ArrayList<Node> nodesWithImprovedRoutes = new ArrayList<>();

        for (LinkStateRoutingTable.Change.RouteChangedInformation<UUID> routeChangeInformation : change.routeChanged) {
            Node changedNode = this.provideNode(routeChangeInformation.node);
            Node nextHopNode = this.provideNode(routeChangeInformation.nextHop);

            if (routeChangeInformation.oldCost > routeChangeInformation.cost) {
            	nodesWithImprovedRoutes.add(changedNode);
            }

            changedNode.setNextHop(nextHopNode);
            changedNode.setCost((int)routeChangeInformation.cost);

            System.out.println("\t"+routeChangeInformation.node+" (old cost: "+routeChangeInformation.oldCost+", new cost: "+routeChangeInformation.cost+", reachable via: "+routeChangeInformation.nextHop+")");
        }

        System.out.println();

        change.nowReachable.stream().map(nowReachableInfo -> this.provideNode(nowReachableInfo.node)).forEach(node -> this.handler.onNodeFound(this, node));
        change.nowUnreachable.stream().map(nowUnreachable -> this.provideNode(nowUnreachable)).forEach(node -> this.handler.onNodeLost(this, node));
        nodesWithImprovedRoutes.forEach(node -> this.handler.onRouteImproved(this, node));
	}
    /**
    * Handles a received link state packet and updates the routing table.
    */
	public void handleLinkStatePacket(LinkStatePacket packet) {
		this.updateNodes(this.routingTable.getRoutingTableChangeForLinkStateInformationUpdate(packet.peerIdentifier, packet.neighbors));
	}
    /** Broadcasts link state information using the linkStatePacketManager. */
	public void broadcastLinkStateInformation() {
		LinkStatePacket packet = new LinkStatePacket(this.identifier, this.routingTable.getLinkStateInformation());
		this.linkStatePacketManager.floodPacket(packet);
	}

    /** Called by a Node when it became directly reachable. */
	public void onNeighborReachable(final Node node) {
		this.neighbors.add(node);
		this.updateNodes(this.routingTable.getRoutingTableChangeForNeighborUpdate(node.getIdentifier(), node.getCost()));
		this.delayedLinkStateBroadcaster.runActionInShortDelay();
	}

    /** Called by a Node when it lost its neighbor status. */
	public void onNeighborLost(Node node) {
		this.neighbors.remove(node);
		this.updateNodes(this.routingTable.getRoutingTableChangeForNeighborRemoval(node.getIdentifier()));
		this.delayedLinkStateBroadcaster.runActionInShortDelay();
	}
	public void disconnectAll() {
		for (Node neighbor : this.neighbors) {
			neighbor.closeRoutingConnection();
		}
	}
	public FloodingPacketManager getLinkStatePacketManager() {
		return this.linkStatePacketManager;
	}
}


text:
import React from 'react';

export const SidePanelContext = React.createContext();


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2019 The Netty Project
  ~
  ~ The Netty Project licenses this file to you under the Apache License,
  ~ version 2.0 (the "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at:
  ~
  ~   https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  ~ License for the specific language governing permissions and limitations
  ~ under the License.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.netty</groupId>
    <artifactId>netty-parent</artifactId>
    <version>4.1.79.Final-SNAPSHOT</version>
  </parent>
  <artifactId>netty-resolver-dns-native-macos</artifactId>

  <name>Netty/Resolver/DNS/Native/MacOS</name>
  <packaging>jar</packaging>

  <profiles>
    <profile>
      <id>mac</id>
      <activation>
        <os>
          <family>mac</family>
        </os>
      </activation>
      <properties>
        <jni.compiler.args.ldflags>LDFLAGS=-Wl,-weak_library,${unix.common.lib.unpacked.dir}/lib${unix.common.lib.name}.a -Wl,-platform_version,macos,10.6,10.6</jni.compiler.args.ldflags>
        <skipTests>false</skipTests>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <!-- unpack the unix-common static library and include files -->
              <execution>
                <id>unpack</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>unpack-dependencies</goal>
                </goals>
                <configuration>
                  <includeGroupIds>${project.groupId}</includeGroupIds>
                  <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
                  <classifier>${jni.classifier}</classifier>
                  <outputDirectory>${unix.common.lib.dir}</outputDirectory>
                  <includes>META-INF/native/**</includes>
                  <overWriteReleases>false</overWriteReleases>
                  <overWriteSnapshots>true</overWriteSnapshots>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.fusesource.hawtjni</groupId>
            <artifactId>maven-hawtjni-plugin</artifactId>
            <executions>
              <execution>
                <id>build-native-lib</id>
                <configuration>
                  <name>netty_resolver_dns_native_macos_${os.detected.arch}</name>
                  <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
                  <libDirectory>${project.build.outputDirectory}</libDirectory>
                  <!-- We use Maven's artifact classifier instead.
                       This hack will make the hawtjni plugin to put the native library
                       under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
                  <platform>.</platform>
                  <configureArgs>
                    <arg>${jni.compiler.args.ldflags}</arg>
                    <arg>${jni.compiler.args.cflags}</arg>
                    <arg>MACOSX_DEPLOYMENT_TARGET=10.6</arg>
                  </configureArgs>
                </configuration>
                <goals>
                  <goal>generate</goal>
                  <goal>build</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <!-- Generate the JAR that contains the native library in it. -->
              <execution>
                <id>native-jar</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <archive>
                    <manifest>
                      <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                    </manifest>
                    <manifestEntries>
                      <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_${os.detected.arch}.jnilib; osname=MacOSX; processor=${os.detected.arch}</Bundle-NativeCode>
                      <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
                      <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
                    </manifestEntries>
                    <index>true</index>
                    <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                  </archive>
                  <classifier>${jni.classifier}</classifier>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>io.netty</groupId>
          <artifactId>netty-transport-native-unix-common</artifactId>
          <version>${project.version}</version>
          <classifier>${jni.classifier}</classifier>
          <!--
          The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
          dependency to get the static library which is built directly into the shared library generated by this project.
          -->
          <optional>true</optional>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>mac-m1-cross-compile</id>
      <properties>
        <jni.compiler.args.ldflags>LDFLAGS=-arch arm64 -Wl,-weak_library,${unix.common.lib.unpacked.dir}/lib${unix.common.lib.name}.a -Wl,-platform_version,macos,11.0,11.0</jni.compiler.args.ldflags>
        <jni.compiler.args.cflags>CFLAGS=-target arm64-apple-macos11 -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>

        <!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
        <jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
        <javaModuleNameClassifier>${os.detected.name}.aarch_64</javaModuleNameClassifier>
        <skipTests>true</skipTests>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <!-- unpack the unix-common static library and include files -->
              <execution>
                <id>unpack</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>unpack-dependencies</goal>
                </goals>
                <configuration>
                  <includeGroupIds>${project.groupId}</includeGroupIds>
                  <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
                  <classifier>${jni.classifier}</classifier>
                  <outputDirectory>${unix.common.lib.dir}</outputDirectory>
                  <includes>META-INF/native/**</includes>
                  <overWriteReleases>false</overWriteReleases>
                  <overWriteSnapshots>true</overWriteSnapshots>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.fusesource.hawtjni</groupId>
            <artifactId>maven-hawtjni-plugin</artifactId>
            <executions>
              <execution>
                <id>build-native-lib</id>
                <configuration>
                  <name>netty_resolver_dns_native_macos_aarch_64</name>
                  <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
                  <libDirectory>${project.build.outputDirectory}</libDirectory>
                  <!-- We use Maven's artifact classifier instead.
                       This hack will make the hawtjni plugin to put the native library
                       under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
                  <platform>.</platform>
                  <configureArgs>
                    <arg>${jni.compiler.args.ldflags}</arg>
                    <arg>${jni.compiler.args.cflags}</arg>
                    <configureArg>--host=aarch64-apple-darwin</configureArg>
                    <arg>MACOSX_DEPLOYMENT_TARGET=11.0</arg>
                  </configureArgs>
                </configuration>
                <goals>
                  <goal>generate</goal>
                  <goal>build</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <!-- Generate the JAR that contains the native library in it. -->
              <execution>
                <id>native-jar</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <archive>
                    <manifest>
                      <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                    </manifest>
                    <manifestEntries>
                      <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_aarch_64.jnilib; osname=MacOSX; processor=aarch64</Bundle-NativeCode>
                      <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
                      <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
                    </manifestEntries>
                    <index>true</index>
                    <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                  </archive>
                  <classifier>${jni.classifier}</classifier>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>io.netty</groupId>
          <artifactId>netty-transport-native-unix-common</artifactId>
          <version>${project.version}</version>
          <classifier>${jni.classifier}</classifier>
          <!--
          The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
          dependency to get the static library which is built directly into the shared library generated by this project.
          -->
          <optional>true</optional>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

  <properties>
    <javaModuleNameClassifier>${os.detected.name}.${os.detected.arch}</javaModuleNameClassifier>
    <javaModuleName>io.netty.resolver.dns.macos.${javaModuleNameClassifier}</javaModuleName>
    <!-- Needed as we use SelfSignedCertificate in our tests -->
    <unix.common.lib.name>netty-unix-common</unix.common.lib.name>
    <unix.common.lib.dir>${project.build.directory}/unix-common-lib</unix.common.lib.dir>
    <unix.common.lib.unpacked.dir>${unix.common.lib.dir}/META-INF/native/lib</unix.common.lib.unpacked.dir>
    <unix.common.include.unpacked.dir>${unix.common.lib.dir}/META-INF/native/include</unix.common.include.unpacked.dir>
    <jni.compiler.args.cflags>CFLAGS=-O3 -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>
    <jni.compiler.args.ldflags>LDFLAGS=-z now -L${unix.common.lib.unpacked.dir} -Wl,--whole-archive -l${unix.common.lib.name} -Wl,--no-whole-archive</jni.compiler.args.ldflags>
    <japicmp.skip>true</japicmp.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-resolver-dns-classes-macos</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <!-- Generate the fallback JAR that does not contain the native library. -->
          <execution>
            <id>default-jar</id>
            <configuration>
              <excludes>
                <exclude>META-INF/native/**</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>


text:
<?php

// Set the path to the form definition file.
$tform_def_file = 'form/faq.tform.php';

// include the core configuration and application classes
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');

// Check the  module permissions and redirect if not allowed.
if(!stristr($_SESSION['s']['user']['modules'],'help')) {
	header('Location: ../index.php');
	die;
}

// Load the templating and form classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');

// Create a class page_action that extends the tform_actions base class
class page_action extends tform_actions {

	//* Customisations for the page actions will be defined here

}

// Create the new page object
$page = new page_action();

// Start the page rendering and action handling
$page->onLoad();

?>


text:
--
-- Add rev_deleted flag to revision table.
-- Deleted revisions can thus continue to be listed in history
-- and user contributions, and their text storage doesn't have
-- to be disturbed.
--
-- 2005-03-31
--

ALTER TABLE /*$wgDBprefix*/revision
  ADD rev_deleted tinyint unsigned NOT NULL default '0';


text:
<!doctype html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>F2F | Welcome</title>

    <link rel="icon" type="image/png" href="img/F2F_short.png">

    <link rel="stylesheet" href="css/bootstrap.css" />

    <link rel="stylesheet" href="css/animate.css" />

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

    <link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/main.css" />

            <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">

            </button>

English

French

English

German

Sign up/Login

Connect

My Travel companion is my family

            <form>

            <input placeholder="Where are you travelling to?" type="text" name="location" id="location" value="">

            <input placeholder="Arrival" type="text" name="arrival" id="datepickerArrival" value="">

            <input placeholder="Departure" type="text" name="departure" id="datepickerDeparture" value="">

            <input type="submit" name="submit" id="submit" value="Search">

            </form>

                        Borrow

                                All you need to worry about is to fit your family in your travel plans, for all the rest you can use our platform.

                   Lend

                         	Lend things you bought for your child till the new one arrives, make useless belongings useful for others.

                    Share

                            Only a family can understand family's issues. Share your concerns and your experiences with other families.

    	Borrow

Does planning your vacations look like this??

            Did you ever find that planning vacations ever since you got children became very painful? Did you ever dream to not have to carry on all your children equipements while your are travelling?

Our platform will connect you to local families so that you can borrow them at your destination place. You need to provide us with your travel planned date and location and we will connect you with local families willing to rent out their equipment according to your needs.

Does your garage look like this??

Is your garage full with your children equipements that you are not using but are not ready to give away yet? You canot sell them but you would be happy to free up your place?

Our platform will connect you to families travelling at your destination so that you can rent your equipments and help them finding what they need for their vacations.

    	Lend

    	Share

Do you have questions on your destination??

Are you worried about access to recreational or health facilities at your destination? Are you thinkining about what activities your children can do once you leave for your vacations?

Why not asking another family?

Our platform will connect you with families at your destination in order to find an answer for your concerns. Connect with another family and use their personal experience.

Sign in

New account

				<form class="cd-form">

						E-mail
						<input class="full-width has-padding has-border" id="signin-email" type="email" placeholder="E-mail">
						Error message here!

						Password
						<input class="full-width has-padding has-border" id="signin-password" type="text"  placeholder="Password">
						Hide
						Error message here!

						<input type="checkbox" id="remember-me" checked>
						Remember me

						<input class="full-width" type="submit" value="Login">

				</form>

Forgot your password?

				<form class="cd-form">

						Username
						<input class="full-width has-padding has-border" id="signup-username" type="text" placeholder="Username">
						Error message here!

						E-mail
						<input class="full-width has-padding has-border" id="signup-email" type="email" placeholder="E-mail">
						Error message here!

						Password
						<input class="full-width has-padding has-border" id="signup-password" type="text"  placeholder="Password">
						Hide
						Error message here!

						<input type="checkbox" id="accept-terms">
						I agree to the Terms

						<input class="full-width has-padding" type="submit" value="Create account">

				</form>

Lost your password? Please enter your email address. You will receive a link to create  new password.

				<form class="cd-form">

						E-mail
						<input class="full-width has-padding has-border" id="reset-email" type="email" placeholder="E-mail">
						Error message here!

						<input class="full-width has-padding" type="submit" value="Reset password">

				</form>

Back to log-in

			Close

Join Us On :

Copyright © Family to Family. All rights reserved.


text:
<?php

namespace App\Auth\Guards;

use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Auth\SessionGuard;
use Illuminate\Contracts\Session\Session;
use Symfony\Component\HttpFoundation\Request;
use App\Auth\Providers\MerchantProvider;

/**
 * Check Illuminate\Auth\SessionGuard, I'm actually
 * lazy to replicate those... -_-
 * Customize this and the provider class depending on your need
 * e.g. Don't authenticate users if not verified
 */
class MerchantGuard extends SessionGuard
{
    protected $provider;

    public function __construct(
        string $name,
        MerchantProvider $provider,
        Session $session,
        Request $request = null
    ) {
        $this->name = $name;
        $this->provider = $provider;
        $this->session = $session;
        $this->request = $request;
    }
}


text:
package tsdb

import (
	"encoding/json"
	"fmt"
	"sort"

	"github.com/influxdb/influxdb/influxql"
	"github.com/influxdb/influxdb/models"
)

// ShowMeasurementsExecutor implements the Executor interface for a SHOW MEASUREMENTS statement.
type ShowMeasurementsExecutor struct {
	stmt      *influxql.ShowMeasurementsStatement
	mappers   []Mapper
	chunkSize int
}

// NewShowMeasurementsExecutor returns a new ShowMeasurementsExecutor.
func NewShowMeasurementsExecutor(stmt *influxql.ShowMeasurementsStatement, mappers []Mapper, chunkSize int) *ShowMeasurementsExecutor {
	return &ShowMeasurementsExecutor{
		stmt:      stmt,
		mappers:   mappers,
		chunkSize: chunkSize,
	}
}

// Execute begins execution of the query and returns a channel to receive rows.
func (e *ShowMeasurementsExecutor) Execute() <-chan *models.Row {
	// Create output channel and stream data in a separate goroutine.
	out := make(chan *models.Row, 0)

	go func() {
		// Open the mappers.
		for _, m := range e.mappers {
			if err := m.Open(); err != nil {
				out <- &models.Row{Err: err}
				return
			}
		}

		// Create a set to hold measurement names from mappers.
		set := map[string]struct{}{}
		// Iterate through mappers collecting measurement names.
		for _, m := range e.mappers {
			// Get the data from the mapper.
			c, err := m.NextChunk()
			if err != nil {
				out <- &models.Row{Err: err}
				return
			} else if c == nil {
				// Mapper had no data.
				continue
			}

			// Convert the mapper chunk to a string array of measurement names.
			mms, ok := c.([]string)
			if !ok {
				out <- &models.Row{Err: fmt.Errorf("show measurements mapper returned invalid type: %T", c)}
				return
			}

			// Add the measurement names to the set.
			for _, mm := range mms {
				set[mm] = struct{}{}
			}
		}

		// Convert the set into an array of measurement names.
		measurements := make([]string, 0, len(set))
		for mm := range set {
			measurements = append(measurements, mm)
		}
		// Sort the names.
		sort.Strings(measurements)

		// Calculate OFFSET and LIMIT
		off := e.stmt.Offset
		lim := len(measurements)
		stmtLim := e.stmt.Limit

		if stmtLim > 0 && off+stmtLim < lim {
			lim = off + stmtLim
		} else if off > lim {
			off, lim = 0, 0
		}

		// Put the results in a row and send it.
		row := &models.Row{
			Name:    "measurements",
			Columns: []string{"name"},
			Values:  make([][]interface{}, 0, len(measurements)),
		}

		for _, m := range measurements[off:lim] {
			v := []interface{}{m}
			row.Values = append(row.Values, v)
		}

		if len(row.Values) > 0 {
			out <- row
		}

		close(out)
		// It's important that all resources are released when execution completes.
		e.close()
	}()
	return out
}

// Close closes the executor such that all resources are released. Once closed,
// an executor may not be re-used.
func (e *ShowMeasurementsExecutor) close() {
	if e != nil {
		for _, m := range e.mappers {
			m.Close()
		}
	}
}

// ShowMeasurementsMapper is a mapper for collecting measurement names from a shard.
type ShowMeasurementsMapper struct {
	remote Mapper
	shard  *Shard
	stmt   *influxql.ShowMeasurementsStatement
	state  interface{}

	ChunkSize int
}

// NewShowMeasurementsMapper returns a mapper for the given shard, which will return data for the meta statement.
func NewShowMeasurementsMapper(shard *Shard, stmt *influxql.ShowMeasurementsStatement) *ShowMeasurementsMapper {
	return &ShowMeasurementsMapper{
		shard: shard,
		stmt:  stmt,
	}
}

// Open opens the mapper for use.
func (m *ShowMeasurementsMapper) Open() error {
	if m.remote != nil {
		return m.remote.Open()
	}

	var measurements Measurements

	if m.shard != nil {
		// If a WHERE clause was specified, filter the measurements.
		if m.stmt.Condition != nil {
			var err error
			measurements, err = m.shard.index.measurementsByExpr(m.stmt.Condition)
			if err != nil {
				return err
			}
		} else {
			// Otherwise, get all measurements from the database.
			measurements = m.shard.index.Measurements()
		}
		sort.Sort(measurements)
	}

	// Create a channel to send measurement names on.
	ch := make(chan string)
	// Start a goroutine to send the names over the channel as needed.
	go func() {
		for _, mm := range measurements {
			ch <- mm.Name
		}
		close(ch)
	}()

	// Store the channel as the state of the mapper.
	m.state = ch

	return nil
}

// SetRemote sets the remote mapper to use.
func (m *ShowMeasurementsMapper) SetRemote(remote Mapper) { m.remote = remote }

// TagSets is only implemented on this mapper to satisfy the Mapper interface.
func (m *ShowMeasurementsMapper) TagSets() []string { return nil }

// Fields returns a list of field names for this mapper.
func (m *ShowMeasurementsMapper) Fields() []string { return []string{"name"} }

// NextChunk returns the next chunk of measurement names.
func (m *ShowMeasurementsMapper) NextChunk() (interface{}, error) {
	if m.remote != nil {
		b, err := m.remote.NextChunk()
		if err != nil {
			return nil, err
		} else if b == nil {
			return nil, nil
		}

		names := []string{}
		if err := json.Unmarshal(b.([]byte), &names); err != nil {
			return nil, err
		} else if len(names) == 0 {
			// Mapper on other node sent 0 values so it's done.
			return nil, nil
		}
		return names, nil
	}
	return m.nextChunk()
}

// nextChunk implements next chunk logic for a local shard.
func (m *ShowMeasurementsMapper) nextChunk() (interface{}, error) {
	// Allocate array to hold measurement names.
	names := make([]string, 0, m.ChunkSize)

	// Get the channel of measurement names from the state.
	measurementNames := m.state.(chan string)

	// Get the next chunk of names.
	for n := range measurementNames {
		names = append(names, n)
		if len(names) == m.ChunkSize {
			break
		}
	}
	// See if we've read all the names.
	if len(names) == 0 {
		return nil, nil
	}

	return names, nil
}

// Close closes the mapper.
func (m *ShowMeasurementsMapper) Close() {
	if m.remote != nil {
		m.remote.Close()
	}
}


text:
#include "config.h"
#include "modules/indexeddb/IDBTransaction.h"

#include "core/dom/DOMError.h"
#include "core/dom/Document.h"
#include "modules/indexeddb/IDBDatabase.h"
#include "modules/indexeddb/IDBDatabaseCallbacks.h"
#include "modules/indexeddb/IDBPendingTransactionMonitor.h"
#include "platform/SharedBuffer.h"
#include "public/platform/WebIDBDatabase.h"

#include <gtest/gtest.h>

using namespace WebCore;

namespace {

class IDBTransactionTest : public testing::Test {
public:
    IDBTransactionTest()
        : m_handleScope(v8::Isolate::GetCurrent())
        , m_scope(v8::Context::New(v8::Isolate::GetCurrent()))
        , m_document(Document::create())
    {
    }

    ExecutionContext* executionContext()
    {
        return m_document.get();
    }

private:
    v8::HandleScope m_handleScope;
    v8::Context::Scope m_scope;
    RefPtr<Document> m_document;
};

class FakeWebIDBDatabase : public blink::WebIDBDatabase {
public:
    static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWebIDBDatabase()); }

    virtual void commit(long long transactionId) OVERRIDE { }
    virtual void abort(long long transactionId) OVERRIDE { }
    virtual void close() OVERRIDE { }

private:
    FakeWebIDBDatabase() { }
};

class FakeIDBDatabaseCallbacks : public IDBDatabaseCallbacks {
public:
    static PassRefPtr<FakeIDBDatabaseCallbacks> create() { return adoptRef(new FakeIDBDatabaseCallbacks()); }
    virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) OVERRIDE { }
    virtual void onForcedClose() OVERRIDE { }
    virtual void onAbort(int64_t transactionId, PassRefPtr<DOMError> error) OVERRIDE { }
    virtual void onComplete(int64_t transactionId) OVERRIDE { }
private:
    FakeIDBDatabaseCallbacks() { }
};

TEST_F(IDBTransactionTest, EnsureLifetime)
{
    OwnPtr<FakeWebIDBDatabase> backend = FakeWebIDBDatabase::create();
    RefPtr<FakeIDBDatabaseCallbacks> connection = FakeIDBDatabaseCallbacks::create();
    RefPtr<IDBDatabase> db = IDBDatabase::create(executionContext(), backend.release(), connection);

    const int64_t transactionId = 1234;
    const Vector<String> transactionScope;
    RefPtr<IDBTransaction> transaction = IDBTransaction::create(executionContext(), transactionId, transactionScope, IndexedDB::TransactionReadOnly, db.get());

    // Local reference, IDBDatabase's reference and IDBPendingTransactionMonitor's reference:
    EXPECT_EQ(3, transaction->refCount());

    RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::createUndefined(), transaction.get());
    IDBPendingTransactionMonitor::deactivateNewTransactions();

    // Local reference, IDBDatabase's reference, and the IDBRequest's reference
    EXPECT_EQ(3, transaction->refCount());

    // This will generate an abort() call to the back end which is dropped by the fake proxy,
    // so an explicit onAbort call is made.
    executionContext()->stopActiveDOMObjects();
    transaction->onAbort(DOMError::create(AbortError, "Aborted"));

    EXPECT_EQ(1, transaction->refCount());
}

TEST_F(IDBTransactionTest, TransactionFinish)
{
    OwnPtr<FakeWebIDBDatabase> backend = FakeWebIDBDatabase::create();
    RefPtr<FakeIDBDatabaseCallbacks> connection = FakeIDBDatabaseCallbacks::create();
    RefPtr<IDBDatabase> db = IDBDatabase::create(executionContext(), backend.release(), connection);

    const int64_t transactionId = 1234;
    const Vector<String> transactionScope;
    RefPtr<IDBTransaction> transaction = IDBTransaction::create(executionContext(), transactionId, transactionScope, IndexedDB::TransactionReadOnly, db.get());

    // Local reference, IDBDatabase's reference and IDBPendingTransactionMonitor's reference:
    EXPECT_EQ(3, transaction->refCount());

    IDBPendingTransactionMonitor::deactivateNewTransactions();

    // Local reference, IDBDatabase's reference
    EXPECT_EQ(2, transaction->refCount());

    IDBTransaction* transactionPtr = transaction.get();
    transaction.clear();

    // IDBDatabase's reference
    EXPECT_EQ(1, transactionPtr->refCount());

    // Stop the context, so events don't get queued (which would keep the transaction alive).
    executionContext()->stopActiveDOMObjects();

    // Fire an abort to make sure this doesn't free the transaction during use. The test
    // will not fail if it is, but ASAN would notice the error.
    db->onAbort(transactionId, DOMError::create(AbortError, "Aborted"));
}

} // namespace


text:
	{% for paper in iswc_papers %}

						{% if paper.Track == 'demo' %}[D{{ paper.PIndex }}] {% elsif paper.Track == 'poster' %}[P{{ paper.PIndex}}] {% endif %}{{ paper.Title }}

							{% if site.paper_links %}

							{% endif %}

					{{ paper.Authors }}

					{% if paper.Start != null %}{% if paper.Session != null %}{{ paper.Session }} | {% endif %}{{ paper.Start | date: "%a, %b %e @ %R" }}{% endif %}{% if paper.Room != null %} | {{ paper.Room }}{% endif %}
				{% if paper.Abstract != null %}
				 |
									Abstract

				{% endif %}
				{% if site.voting and paper.Track == 'poster' or paper.Track == 'demo' %}
				|
					 Vote

				{% endif %}

				{% if paper.Abstract != null %}

				    {{ paper.Abstract }}

				{% endif %}

	{% endfor %}


text:
package com.kyakujin.android.autoeco.db;

import com.kyakujin.android.autoeco.Conf;
import com.kyakujin.android.autoeco.db.AutoEcoContract.BatteryTbl;
import com.kyakujin.android.autoeco.db.AutoEcoContract.EcoTbl;
import com.kyakujin.android.autoeco.db.AutoEcoContract.ManualTbl;
import com.kyakujin.android.autoeco.db.AutoEcoContract.MappingTbl;
import com.kyakujin.android.autoeco.db.AutoEcoContract.SchedTbl;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

/**
 * DataBase OpenHelper Version 2.
 * (This class is preliminary.)
 */
public class AutoEcoDBOpenHelperV2 extends AutoEcoDBOpenHelper {
    private final String TAG = Conf.APP_NAME + ":" + this.getClass().getSimpleName();
    private static final int DB_VERSION = 2;

    private static final String UPDATE_QUERY = "alter table sched add column reserve INTEGER";
    private static final String UPDATE_DATA = "update sched set reserve ='0'";

    public AutoEcoDBOpenHelperV2(Context context) {
        super(context, DB_VERSION);
    }

    interface Tables {
        String ECO = EcoTbl.getPath();
        String SCHED = SchedTbl.getPath();
        String BATTERY = BatteryTbl.getPath();
        String MANUAL = ManualTbl.getPath();
        String MAPPING = MappingTbl.getPath();
    }

    /** 削除トリガー */
    interface Triggers {
        String MAPPING_DELETE = "mapping_delete";
        String ECO_DELETE = "eco_delete";
        String ECO_UPDATE = "eco_update";
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL("CREATE TABLE " + Tables.ECO + " ("
                + EcoTbl._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                + EcoTbl.NAME + " TEXT, "
                + EcoTbl.UPDATE_DATE + " TIMESTAMP DEFAULT (DATETIME('now','localtime')), "
                + EcoTbl.WIFI_ENABLED + " INTEGER, "
                + EcoTbl.BLUETOOTH_ENABLED + " INTEGER, "
                + EcoTbl.ROTATE_ENABLED + " INTEGER, "
                + EcoTbl.SYNC_ENABLED + " INTEGER, "
                + EcoTbl.BRIGHTNESS_ENABLED + " INTEGER, "
                + EcoTbl.BRIGHTNESS_VALUE + " INTEGER, "
                + EcoTbl.BRIGHTNESS_AUTO + " INTEGER, "
                + EcoTbl.SLEEP_ENABLED + " INTEGER, "
                + EcoTbl.SLEEP_TIME + " INTEGER, "
                + EcoTbl.SILENT_ENABLED + " INTEGER, "
                + EcoTbl.SILENT_MODE + " INTEGER"
                + ");");

        db.execSQL("CREATE TABLE " + Tables.SCHED + " ("
                + SchedTbl._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                + SchedTbl.ENABLED + " INTEGER, "
                + SchedTbl.HOUR + " INTEGER, "
                + SchedTbl.MINUTE + " INTEGER, "
                + SchedTbl.HOUR_MINUTE_STRING + " TEXT, "
                + SchedTbl.PATTERN + " INTEGER, "
                // + "UNIQUE(" + SchedTbl.HOUR + ", " + SchedTbl.MINUTE + ")"
                + "reserve" + " INTEGER, "
                + "UNIQUE(" + SchedTbl.HOUR_MINUTE_STRING + ")"

                + ");");

        db.execSQL("CREATE TABLE " + Tables.BATTERY + " ("
                + BatteryTbl._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                + BatteryTbl.ENABLED + " INTEGER, "
                + BatteryTbl.THRESHOLD + " INTEGER "
                + ");");

        db.execSQL("CREATE TABLE " + Tables.MANUAL + " ("
                + ManualTbl._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                + ManualTbl.NAME + " TEXT "
                + ");");

        db.execSQL("CREATE TABLE " + Tables.MAPPING + " ("
                + MappingTbl._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
                + MappingTbl.ECO_ID + " INTEGER,"
                + MappingTbl.SCHED_ID + " INTEGER,"
                + MappingTbl.BATTERY_ID + " INTEGER, "
                + MappingTbl.MANUAL_ID + " INTEGER, "
                + "UNIQUE(" + MappingTbl.ECO_ID + ", " + MappingTbl.SCHED_ID + ")"
                + ");");

        db.execSQL("CREATE TRIGGER " + Triggers.MAPPING_DELETE
                + " AFTER DELETE ON " + Tables.SCHED
                + " BEGIN DELETE FROM " + Tables.MAPPING
                + " WHERE " + MappingTbl.SCHED_ID + " =old." + SchedTbl._ID
                + ";" + " END;");

        db.execSQL("CREATE TRIGGER " + Triggers.ECO_DELETE
                + " AFTER DELETE ON " + Tables.MAPPING
                + " BEGIN DELETE FROM " + Tables.ECO
                + " WHERE " + EcoTbl._ID + " =old." + MappingTbl.ECO_ID
                + ";" + " END;");

        db.execSQL("CREATE TRIGGER " + Triggers.ECO_UPDATE
                + " AFTER UPDATE ON " + Tables.ECO
                + " BEGIN UPDATE " + Tables.ECO + " SET " + EcoTbl.UPDATE_DATE
                + " = (DATETIME('now','localtime'))"
                + " WHERE " + EcoTbl._ID + " =old." + EcoTbl._ID
                + ";" + " END;");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        if (oldVersion < DB_VERSION) {
            db.execSQL(UPDATE_QUERY);
            db.execSQL(UPDATE_DATA);
        }
    }

    @Override
    public int getVersion() {
        return DB_VERSION;
    }

}


text:
#ifndef __MATHML_SOLVER_ERROR_H__
#define __MATHML_SOLVER_ERROR_H__

#include "MathMLSolverPrerequisites.h"
#include "MathMLString.h"

namespace MathML
{

    /**
     * This class describes an error related to MathML.
     */
    class _MATHML_SOLVER_EXPORT Error
    {
    public:
        enum ErrorCode
        {
            ERR_INVALIDPARAMS,
            ERR_ITEM_NOT_FOUND,
            ERR_INTERNAL_ERROR,
        };

    private:
        /** Error code. */
        ErrorCode mErrorCode;
        /** Error message. */
        String mMsg;

    public:
        /** Constructor. */
        Error( ErrorCode errorCode, const String& errorMessage )
            : mErrorCode( errorCode )
            , mMsg( errorMessage )
        {}

        /** Destructor. */
        virtual ~Error(){}

        /** Returns the error code. */
        ErrorCode getErrorCode() const { return mErrorCode; }

        /** Returns the error message. */
        const String& getErrorMessage() const { return mMsg; }

    };

    /**
     * Handles errors. Users of the library may implement this to be notified when errors occur.
     */
    class _MATHML_SOLVER_EXPORT ErrorHandler
    {
    public:
        /** Constructor. */
        ErrorHandler(){}

        /** Destructor. */
        virtual ~ErrorHandler(){}

        /** This method is used to pass errors to implementors.
        @param error An error that occurred.
        @return true if caller should continue, false for cancel.
        */
        virtual bool handleError( const Error* error ) = 0;

    };

} // namespace MathML

#endif // __MATHML_SOLVER_ERROR_H__