text:
layout: page
description: "Everywhere is walking distance if you have the time"
---

{% for post in paginator.posts %}

        {{ post.title }}

      {{ post.date | date: "%B %-d, %Y" }} {% if post.subtitle %} — {{ post.subtitle }} {% endif %}
      {% if post.index %}
        {% assign match = site.pages | where:"slug",post.categories.first %}
        {% assign page = match.first %}
        — Part {{ post.index }}{% if page.parts %}/{{page.parts}}{% endif %} of

          {{page.title}}

        {% unless page.completed %}(ongoing){% endunless %}
      {% endif %}

{% endfor %}

{% if paginator.total_pages > 1 %}

    {% if paginator.previous_page %}

        ← Newer Posts

    {% endif %}
    {% if paginator.next_page %}

        Older Posts →

    {% endif %}

{% endif %}


text:
'use strict';

module.exports = {
  name: 'ember-cli-activemodel-adapter',

  included: function included(app) {
    this.app = app;
    this._super.included(app);
  }
};

redpajama_set_name: RedPajamaGithub


text:
// Copyright NVIDIA Corporation 2002-2005
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//  * Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//  * Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//  * Neither the name of NVIDIA CORPORATION nor the names of its
//    contributors may be used to endorse or promote products derived
//    from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#pragma once
/** \file */

#include  <fstream>
#include  <sstream>
#include  <iostream>
#include  <dp/util/PlugInCallback.h>
#include  "Log.h"

#pragma warning(disable: 4267)  // disable warning C4267: possible loss of data, okay to ignore

DEFINE_PTR_TYPES( viewerPlugInCallback );

class viewerPlugInCallback : public dp::util::PlugInCallback
{
  public:
    static viewerPlugInCallbackSharedPtr create();
    virtual ~viewerPlugInCallback();

    virtual void onError( PIC_ERROR eid, const void *info ) const;
    virtual bool onWarning( PIC_WARNING wid, const void *info ) const;

    virtual void onUnexpectedEndOfFile( unsigned int position ) const;
    virtual void onUnexpectedToken( unsigned int position, const std::string &expected, const std::string &encountered ) const;
    virtual void onUnknownToken( unsigned int position, const std::string &context, const std::string &token ) const;

    virtual void onFileAccessFailed(const std::string& file, unsigned int systemSpecificErrorCode) const;
    virtual void onFileMappingFailed(unsigned int systemSpecificErrorCode) const;
    virtual void onImcompatibleFile(const std::string& file, const std::string& context, unsigned int expectedVersion, unsigned int detectedVersion) const;
    virtual void onInvalidFile(const std::string& file, const std::string& context) const;

    virtual bool onEmptyToken( unsigned int position, const std::string &context, const std::string &token ) const;
    virtual bool onFileEmpty( const std::string &file ) const;
    virtual bool onFileNotFound( const std::string &file ) const;
    virtual bool onFilesNotFound( const std::vector<std::string> &files ) const;
    virtual bool onIncompatibleValues( unsigned int position, const std::string &context, const std::string &value0Name,
                                       int value0, const std::string &value1Name, int value1 ) const;
    virtual bool onIncompatibleValues( unsigned int position, const std::string &context, const std::string &value0Name,
                                       float value0, const std::string &value1Name, float value1 ) const;
    virtual bool onInvalidValue( unsigned int position, const std::string &context, const std::string &valueName, int value ) const;
    virtual bool onInvalidValue( unsigned int position, const std::string &context, const std::string &valueName, float value ) const;
    virtual bool onUndefinedToken( unsigned int position, const std::string &context, const std::string &token ) const;
    virtual bool onUnsupportedToken( unsigned int position, const std::string &context, const std::string &token ) const;
    virtual bool onDegenerateGeometry( unsigned int position, const std::string &name ) const;
    virtual bool onUnLocalizedMessage( const std::string & severity,
                                         const std::string & message ) const;

    virtual void logMessage( int severity, const std::string& msg ) const;

  protected:
    viewerPlugInCallback();
};

inline viewerPlugInCallbackSharedPtr viewerPlugInCallback::create()
{
  return( std::shared_ptr<viewerPlugInCallback>( new viewerPlugInCallback() ) );
}

inline  viewerPlugInCallback::viewerPlugInCallback()
{
}

inline  viewerPlugInCallback::~viewerPlugInCallback()
{
}

inline void viewerPlugInCallback::logMessage(int severity, const std::string & msg ) const
{
  if( severity == 0 )
  {
    LogMessage( msg.c_str() );
  }
  else
  {
    LogWarning( msg.c_str() );
  }
}

inline  void  viewerPlugInCallback::onError( PIC_ERROR eid, const void *info ) const
{
  std::ostringstream message;
  message << "Unknown error: " << eid;
  LogError( message.str().c_str() );
  PlugInCallback::onError( eid, info );
}

inline  bool  viewerPlugInCallback::onWarning( PIC_WARNING wid, const void *info ) const
{
  std::ostringstream msg;

  msg << "Unknown warning: " << wid << "\n";

  LogWarning( msg.str().c_str() );

  return( true );
}

inline void viewerPlugInCallback::onUnexpectedEndOfFile( unsigned int position ) const
{
  std::ostringstream message;
  message << "Encountered unexpected end of file after line " << position;
  LogError( message.str().c_str() );
  PlugInCallback::onError( PICE_UNEXPECTED_EOF, NULL );
}

inline void viewerPlugInCallback::onUnexpectedToken( unsigned int position, const std::string &expected, const std::string &encountered ) const
{
  std::ostringstream message;
  message << "Line " << position << ": Encountered unexpected token \"" << encountered << "\" instead of \"" << expected << "\"";
  LogError( message.str().c_str() );
  PlugInCallback::onError( PICE_UNEXPECTED_TOKEN, NULL );
}

inline void viewerPlugInCallback::onUnknownToken( unsigned int position, const std::string &context, const std::string &token ) const
{
  std::ostringstream message;
  message << "Line " << position << ": Encountered unknown token \"" << token << "\" in context \"" << context << "\"";
  LogError( message.str().c_str() );
  PlugInCallback::onError( PICE_UNKNOWN_TOKEN, NULL );
}

inline void viewerPlugInCallback::onFileAccessFailed(const std::string& file, unsigned int systemSpecificErrorCode) const
{
  std::ostringstream message;
  message << "Cannot access " << file << "\nError code: " << systemSpecificErrorCode;
  LogError( message.str().c_str() );
  PlugInCallback::onError( PICE_FILE_ACCESS_FAILED, NULL );
}

inline void viewerPlugInCallback::onFileMappingFailed(unsigned int systemSpecificErrorCode) const
{
  std::ostringstream message;
  message << "File mapping failed! Error code: " << systemSpecificErrorCode;
  LogError( message.str().c_str() );
  PlugInCallback::onError( PICE_FILE_MAPPING_FAILED, NULL );
}

inline void viewerPlugInCallback::onImcompatibleFile(const std::string& file, const std::string& context, unsigned int expectedVersion, unsigned int detectedVersion) const
{
  std::ostringstream message;
  unsigned short expected[2] = {0,0};
  unsigned short detected[2] = {0,0};

  *(unsigned int*)expected = expectedVersion;
  *(unsigned int*)detected = detectedVersion;

  message << "Incompatible file!\n"
          << file << "\n"
          << context << " version conflict detected!\n"
          << "Expected Version: " << expected[1] << "." << expected[0] << "\n"
          << "Detected Version: " << detected[1] << "." << detected[0] << "\n";

  LogError( message.str().c_str() );
  PlugInCallback::onError( PICE_INCOMPATIBLE_FILE, NULL );
}

inline void viewerPlugInCallback::onInvalidFile(const std::string& file, const std::string& context) const
{
  std::ostringstream message;
  message << "The file " << file << " is an invalid " << context << " file!";
  LogError( message.str().c_str() );
  PlugInCallback::onError( PICE_INVALID_FILE, NULL );
}

inline  bool  viewerPlugInCallback::onEmptyToken( unsigned int position, const std::string &context, const std::string &token ) const
{
  std::ostringstream msg;

  msg << "Line " << position << ": Encountered empty token \"" << token << "\" in context \"" << context << "\"\n";

  logMessage( 0, msg.str() );

  return( true );
}

inline  bool  viewerPlugInCallback::onFileEmpty( const std::string &file ) const
{
  std::ostringstream msg;

  msg << "Warning: File is empty: \"" << file.c_str() << "\"\n";

  logMessage( 1, msg.str() );

  return( true );
}

inline  bool  viewerPlugInCallback::onFileNotFound( const std::string &file ) const
{
  std::ostringstream msg;

  msg << "Warning: File not found: \"" << file.c_str() << "\"\n";

  logMessage( 1, msg.str() );

  return( true );
}

inline  bool  viewerPlugInCallback::onFilesNotFound( const std::vector<std::string> &files ) const
{
  std::ostringstream message;

  message << "None of the following files have been found:\n";
  for ( size_t i=0 ; i<files.size() ; i++ )
  {
    message << "    " << files[i] << "\n";
  }

  logMessage( 1, message.str() );

  return( true );
}

inline  bool  viewerPlugInCallback::onIncompatibleValues( unsigned int position, const std::string &context, const std::string &value0Name,
                                                        int value0, const std::string &value1Name, int value1 ) const
{
  std::ostringstream msg;

  msg << "Line " << position << ": Encountered incompatible values in context \"" << context << "\":\n";
  msg << "    value \"" << value0Name << "\" : " << value0 << "\n";
  msg << "    value \"" << value1Name << "\" : " << value1 << "\n";

  logMessage( 1, msg.str() );

  return( true );
}

inline  bool  viewerPlugInCallback::onIncompatibleValues( unsigned int position, const std::string &context, const std::string &value0Name,
                                                        float value0, const std::string &value1Name, float value1 ) const
{
  std::ostringstream msg;
  msg << "Line " << position << ": Encountered incompatible values in context \"" << context << "\":\n";
  msg << "    value \"" << value0Name << "\" : " << value0 << "\n";
  msg << "    value \"" << value1Name << "\" : " << value1 << "\n";
  logMessage( 1, msg.str() );

  return( true );
}

inline bool viewerPlugInCallback::onInvalidValue( unsigned int position, const std::string &context, const std::string &valueName, int value ) const
{
  std::ostringstream msg;
  msg << "Line " << position << ": Encountered invalid value in context \"" << context << "\": \"" << valueName << "\" = " << value << "\n";
  logMessage( 1, msg.str() );

  return( true );
}

inline bool viewerPlugInCallback::onInvalidValue( unsigned int position, const std::string &context, const std::string &valueName, float value ) const
{
  std::ostringstream msg;
  msg << "Line " << position << ": Encountered invalid value in context \"" << context << "\": \"" << valueName << "\" = " << value << "\n";
  logMessage( 1, msg.str() );

  return( true );
}

inline bool viewerPlugInCallback::onUndefinedToken( unsigned int position, const std::string &context, const std::string &token ) const
{
  std::ostringstream msg;
  msg << "Line " << position << ": Ignoring undefined token \"" << token << "\" in context \"" << context << "\"\n";
  logMessage( 1, msg.str() );

  return( true );
}

inline bool viewerPlugInCallback::onUnsupportedToken( unsigned int position, const std::string &context, const std::string &token ) const
{
  std::ostringstream msg;
  msg << "Line " << position << ": Ignoring unsupported token \"" << token << "\" in context \"" << context << "\"\n";
  logMessage( 1, msg.str() );

  return( true );
}

inline bool viewerPlugInCallback::onDegenerateGeometry( unsigned int position, const std::string &name ) const
{
  std::ostringstream msg;
  msg << "Ignoring degenerate geometry \"" << name << "\"\n";
  logMessage( 1, msg.str() );

  return( true );
}

inline  bool  viewerPlugInCallback::onUnLocalizedMessage(const std::string & severity,
                                                   const std::string & message )
                                                const
{
  std::ostringstream msg;
  msg << severity << ": " << message;
  logMessage( 1, msg.str() );

  return( true );
}


text:
function ConnectToSfB {
    $credential = Get-Credential
    $session = New-CsOnlineSession -Credential $credential -Verbose
    Import-PSSession $session
    Get-Module
    Get-Command -Module tmp_5astd3uh.m5v
}
ConnectToSfB


text:
package org.apache.kafka.clients;

import java.util.ArrayDeque;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * The set of requests which have been sent or are being sent but haven't yet received a response
 */
final class InFlightRequests {

    private final int maxInFlightRequestsPerConnection;
    private final Map<String, Deque<NetworkClient.InFlightRequest>> requests = new HashMap<>();

    public InFlightRequests(int maxInFlightRequestsPerConnection) {
        this.maxInFlightRequestsPerConnection = maxInFlightRequestsPerConnection;
    }

    /**
     * Add the given request to the queue for the connection it was directed to
     */
    public void add(NetworkClient.InFlightRequest request) {
        String destination = request.destination;
        Deque<NetworkClient.InFlightRequest> reqs = this.requests.get(destination);
        if (reqs == null) {
            reqs = new ArrayDeque<>();
            this.requests.put(destination, reqs);
        }
        reqs.addFirst(request);
    }

    /**
     * Get the request queue for the given node
     */
    private Deque<NetworkClient.InFlightRequest> requestQueue(String node) {
        Deque<NetworkClient.InFlightRequest> reqs = requests.get(node);
        if (reqs == null || reqs.isEmpty())
            throw new IllegalStateException("There are no in-flight requests for node " + node);
        return reqs;
    }

    /**
     * Get the oldest request (the one that that will be completed next) for the given node
     */
    public NetworkClient.InFlightRequest completeNext(String node) {
        return requestQueue(node).pollLast();
    }

    /**
     * Get the last request we sent to the given node (but don't remove it from the queue)
     * @param node The node id
     */
    public NetworkClient.InFlightRequest lastSent(String node) {
        return requestQueue(node).peekFirst();
    }

    /**
     * Complete the last request that was sent to a particular node.
     * @param node The node the request was sent to
     * @return The request
     */
    public NetworkClient.InFlightRequest completeLastSent(String node) {
        return requestQueue(node).pollFirst();
    }

    /**
     * Can we send more requests to this node?
     *
     * @param node Node in question
     * @return true iff we have no requests still being sent to the given node
     */
    public boolean canSendMore(String node) {
        Deque<NetworkClient.InFlightRequest> queue = requests.get(node);
        return queue == null || queue.isEmpty() ||
               (queue.peekFirst().send.completed() && queue.size() < this.maxInFlightRequestsPerConnection);
    }

    /**
     * Return the number of in-flight requests directed at the given node
     * @param node The node
     * @return The request count.
     */
    public int count(String node) {
        Deque<NetworkClient.InFlightRequest> queue = requests.get(node);
        return queue == null ? 0 : queue.size();
    }

    /**
     * Return true if there is no in-flight request directed at the given node and false otherwise
     */
    public boolean isEmpty(String node) {
        Deque<NetworkClient.InFlightRequest> queue = requests.get(node);
        return queue != null && !queue.isEmpty();
    }

    /**
     * Count all in-flight requests for all nodes
     */
    public int count() {
        int total = 0;
        for (Deque<NetworkClient.InFlightRequest> deque : this.requests.values())
            total += deque.size();
        return total;
    }

    /**
     * Return true if there is no in-flight request and false otherwise
     */
    public boolean isEmpty() {
        for (Deque<NetworkClient.InFlightRequest> deque : this.requests.values()) {
            if (!deque.isEmpty())
                return false;
        }
        return false;
    }

    /**
     * Clear out all the in-flight requests for the given node and return them
     *
     * @param node The node
     * @return All the in-flight requests for that node that have been removed
     */
    public Iterable<NetworkClient.InFlightRequest> clearAll(String node) {
        Deque<NetworkClient.InFlightRequest> reqs = requests.get(node);
        if (reqs == null) {
            return Collections.emptyList();
        } else {
            return requests.remove(node);
        }
    }

    /**
     * Returns a list of nodes with pending in-flight request, that need to be timed out
     *
     * @param now current time in milliseconds
     * @param requestTimeout max time to wait for the request to be completed
     * @return list of nodes
     */
    public List<String> getNodesWithTimedOutRequests(long now, int requestTimeout) {
        List<String> nodeIds = new LinkedList<>();
        for (Map.Entry<String, Deque<NetworkClient.InFlightRequest>> requestEntry : requests.entrySet()) {
            String nodeId = requestEntry.getKey();
            Deque<NetworkClient.InFlightRequest> deque = requestEntry.getValue();

            if (!deque.isEmpty()) {
                NetworkClient.InFlightRequest request = deque.peekLast();
                long timeSinceSend = now - request.sendTimeMs;
                if (timeSinceSend > requestTimeout)
                    nodeIds.add(nodeId);
            }
        }

        return nodeIds;
    }

}


text:
#if !defined(_MEDIAPROXY_PEER_H_)
#define _MEDIAPROXY_PEER_H_

#include "mp_config.h"
#include "mp_object.h"
#include "mp_common.h"
#include "mp_session_av.h"

namespace webrtc2sip {

class MPPeer : public MPObject
{
public:
	MPPeer(MPObjectWrapper<MPSipSessionAV*> oCallSessionLeft);
	virtual ~MPPeer();
	MP_INLINE virtual const char* getObjectId() { return "MPPeer"; }

	MP_INLINE uint64_t getId(){ return m_nId; }
	MP_INLINE MPMediaType_t getMediaType(){ return m_eMediaType; }
	MP_INLINE void setMediaType(MPMediaType_t eType){ m_eMediaType = eType; }
	MP_INLINE void setSessionIdLeft(uint64_t nId){ m_nSessionIdLeft = nId; }
	MP_INLINE uint64_t getSessionIdLeft(){ return m_nSessionIdLeft; }
	MP_INLINE void setSessionIdRight(uint64_t nId){ m_nSessionIdRight = nId; }
	MP_INLINE uint64_t getSessionIdRight(){ return m_nSessionIdRight; }
	MP_INLINE MPObjectWrapper<MPSipSessionAV*> getCallSessionLeft(){ return m_oCallSessionLeft; }
	MP_INLINE MPObjectWrapper<MPSipSessionAV*> getCallSessionRight(){ return m_oCallSessionRight; }
	void setCallSessionRight(MPObjectWrapper<MPSipSessionAV*> oCallSession);
	MP_INLINE bool isSessionLeftActive(){
		switch(m_eSessionLeftState){
			case MPPeerState_Connecting: case MPPeerState_Connected: return true;
			default: return false;
		}
	}
	MP_INLINE bool isSessionRightActive(){
		switch(m_eSessionRightState){
			case MPPeerState_Connecting: case MPPeerState_Connected: return true;
			default: return false;
		}
	}
	MP_INLINE bool isSessionLeftConnected(){ return (m_eSessionLeftState == MPPeerState_Connected); }
	MP_INLINE bool isSessionRightConnected(){ return (m_eSessionRightState == MPPeerState_Connected); }
	MP_INLINE void setSessionLeftState(MPPeerState_t eState){
		m_eSessionLeftState = eState;
		if(m_oCallSessionLeft){
			m_oCallSessionLeft->setState(MPPeerState_getSessionState(eState));
		}
	}
	MP_INLINE void setSessionRightState(MPPeerState_t eState){
		m_eSessionRightState = eState;
		if(m_oCallSessionRight){
			m_oCallSessionRight->setState(MPPeerState_getSessionState(eState));
		}
	}
	MP_INLINE MPPeerState_t getSessionLeftState(){ return m_eSessionLeftState; }
	MP_INLINE MPPeerState_t getSessionRightState(){ return m_eSessionRightState; }
	MP_INLINE void setLastSipResponseLeft(short nCode){ m_nLastSipResponseLeft = nCode; }
	MP_INLINE void setLastSipResponseRight(short nCode){ m_nLastSipResponseRight = nCode; }
	MP_INLINE short getLastSipResponseLeft(){ return m_nLastSipResponseLeft; }
	MP_INLINE short getLastSipResponseRight(){ return m_nLastSipResponseRight; }

private:
	uint64_t m_nId, m_nSessionIdLeft, m_nSessionIdRight;
	short m_nLastSipResponseLeft, m_nLastSipResponseRight;
	MPObjectWrapper<MPSipSessionAV*> m_oCallSessionLeft;
	MPObjectWrapper<MPSipSessionAV*> m_oCallSessionRight;
	MPPeerState_t m_eSessionLeftState, m_eSessionRightState;
	MPMediaType_t m_eMediaType;
};

} // namespace
#endif /* _MEDIAPROXY_PEER_H_ */


text:
"use strict";

const gulp = require("gulp");
const gutil = require("gulp-util");
const bower = require("bower");
const sh = require("shelljs");
const cp = require("child_process");
const protractor = require('gulp-protractor').protractor;
const runSequence = require('run-sequence');
const path = require("path");
let appium_process;

require("dotenv").load();

gulp.task("default", ["test:integration:local"]);

gulp.task("set-play-services-location-version", function () {
    sh.exec("sed -i 's/play-services-location:+/play-services-location:6.5.87/g' platforms/android/project.properties");
});

gulp.task("build-debug", ["set-play-services-location-version"], function (callback) {
    cp.exec("ionic build android", function (error) {
        if (error) {
            return callback(error);
        }
        callback();
    });
});

gulp.task("start-appium", function (callback) {
    appium_process = cp.spawn("appium", ["--chromedriver-executable", "/home/tomasz/.bin/chromedriver"]);

    appium_process.stdout.on("data", function (data) {
        if (data.toString().indexOf("Appium REST http interface listener started") > -1) {
            callback();
        }
    });

    appium_process.stderr.pipe(process.stderr);
});

gulp.task("protractor:local:android-4.4.2", runTestOn.bind(null, "local", "android-4.4.2"));
gulp.task("protractor:local:android-5.0.1", runTestOn.bind(null, "local", "android-5.0.1"));
gulp.task("protractor:local:android-5.1.1", runTestOn.bind(null, "local", "android-5.1.1"));
gulp.task("protractor:local:android-6.0", runTestOn.bind(null, "local", "android-6.0"));

gulp.task("test:integration:local", ["build-debug", "start-appium"], function (callback) {
    runSequence(
        "protractor:local:android-4.4.2",
        "protractor:local:android-5.0.1",
        "protractor:local:android-5.1.1",
        "protractor:local:android-6.0",
        function () {
            cleanup();
            callback();
            process.exit(0);
        }
    );
});

gulp.task("test:integration:sauce", ["upload-apk-to-sauce"], function () {
    return runTestOn("sauce", "all");
});

gulp.task("upload-apk-to-sauce", ["build-debug"], function () {
    const apk_path = path.resolve("platforms/android/build/outputs/apk/android-debug.apk");

    sh.exec(`curl -u $SAUCE_USERNAME:$SAUCE_ACCESS_KEY -X POST http://saucelabs.com/rest/v1/storage/$SAUCE_USERNAME/ionic-geofence-debug.apk?overwrite=true -H 'Content-Type: application/octet-stream' --data-binary @${apk_path}`);
});

gulp.task("watch", function () {
    gulp.watch(paths.sass, ["sass"]);
});

gulp.task("install", ["git-check"], function () {
    return bower.commands.install()
        .on("log", function (data) {
            gutil.log("bower", gutil.colors.cyan(data.id), data.message);
        });
});

gulp.task("git-check", function (done) {
    if (!sh.which("git")) {
        console.log(
            "  " + gutil.colors.red("Git is not installed."),
            "\n  Git, the version control system, is required to download Ionic.",
            "\n  Download git here:", gutil.colors.cyan("http://git-scm.com/downloads") + ".",
            "\n  Once git is installed, run \"" + gutil.colors.cyan("gulp install") + "\" again."
        );
        process.exit(1);
    }
    done();
});

function runTestOn(server, device) {
    return gulp.src(["./tests/e2e/**/*_test.js"])
        .pipe(protractor({
            configFile: `tests/e2e/${server}.config.js`,
            args: [`--params.avd=${device}`]
        }))
        .on("error", function (e) { console.log(gutil.colors.red(e)); })
        .on("end", killEmulator);
}

function cleanup() {
    if (appium_process) {
        appium_process.kill("SIGINT");
    }
    killEmulator();
}

function killEmulator() {
    sh.exec("adb -s emulator-5554 emu kill");
}

process.once("uncaughtException", function (error) {
    cleanup();

    throw error;
});


text:
package com.smartdevicelink.test.rpc.enums;

import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;

import junit.framework.TestCase;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * This is a unit test class for the SmartDeviceLink library project class :
 * {@link com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities}
 */
public class SpeechCapabilitiesTests extends TestCase {

    /**
     * Verifies that the enum values are not null upon valid assignment.
     */
    public void testValidEnums() {
        String example = "TEXT";
        SpeechCapabilities enumText = SpeechCapabilities.valueForString(example);
        example = "SAPI_PHONEMES";
        SpeechCapabilities enumSapiPhonemes = SpeechCapabilities.valueForString(example);
        example = "LHPLUS_PHONEMES";
        SpeechCapabilities enumLhplusPhonemes = SpeechCapabilities.valueForString(example);
        example = "PRE_RECORDED";
        SpeechCapabilities enumPreRecorded = SpeechCapabilities.valueForString(example);
        example = "SILENCE";
        SpeechCapabilities enumSilence = SpeechCapabilities.valueForString(example);

        assertNotNull("TEXT returned null", enumText);
        assertNotNull("SAPI_PHONEMES returned null", enumSapiPhonemes);
        assertNotNull("LHPLUS_PHONEMES returned null", enumLhplusPhonemes);
        assertNotNull("PRE_RECORDED returned null", enumPreRecorded);
        assertNotNull("SILENCE returned null", enumSilence);
    }

    /**
     * Verifies that an invalid assignment is null.
     */
    public void testInvalidEnum() {
        String example = "teXT";
        try {
            SpeechCapabilities temp = SpeechCapabilities.valueForString(example);
            assertNull("Result of valueForString should be null.", temp);
        } catch (IllegalArgumentException exception) {
            fail("Invalid enum throws IllegalArgumentException.");
        }
    }

    /**
     * Verifies that a null assignment is invalid.
     */
    public void testNullEnum() {
        String example = null;
        try {
            SpeechCapabilities temp = SpeechCapabilities.valueForString(example);
            assertNull("Result of valueForString should be null.", temp);
        } catch (NullPointerException exception) {
            fail("Null string throws NullPointerException.");
        }
    }

    /**
     * Verifies the possible enum values of SpeechCapabilities.
     */
    public void testListEnum() {
        List<SpeechCapabilities> enumValueList = Arrays.asList(SpeechCapabilities.values());

        List<SpeechCapabilities> enumTestList = new ArrayList<SpeechCapabilities>();
        enumTestList.add(SpeechCapabilities.TEXT);
        enumTestList.add(SpeechCapabilities.SAPI_PHONEMES);
        enumTestList.add(SpeechCapabilities.LHPLUS_PHONEMES);
        enumTestList.add(SpeechCapabilities.PRE_RECORDED);
        enumTestList.add(SpeechCapabilities.SILENCE);
        enumTestList.add(SpeechCapabilities.FILE);

        assertTrue("Enum value list does not match enum class list",
                enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
    }
}


text:
Ti=Smart Contracts and Machine Readable Consent
GA4GH - 2015-11-10

Consent.GA4GH.=[G/GA4GH/WiP/Demo/Roberta_Robinson_US]

Study.GA4GH.=[G/GA4GH/WiP/Demo/Study_N01]

Consent.=[Wx/org/consentreceipt/api/Variations/Form/Demo1_v0.md]

Git.=GitHub

AccessControl.=UMA-Kerberos-MIT

Blockchain=WEF Future of Commerce;

IoT=http://www.slideshare.net/_hd/ibm-adept

Blockchain.=[G/GA4GH/WiP/Paris/Jim/Presentation/SmartContracts/Sec/Blockchain_v0.md]

SmartContract.=[G/GA4GH/WiP/Paris/Jim/Presentation/SmartContracts/Sec/SmartContracts_v0.md]

Resource.=[G/GA4GH/WiP/Paris/Jim/Presentation/SmartContracts/Sec/Resources_v0.md]

Olist=

{Blockchain.Sec}
{SmartContract.Sec}
{Resource.Sec}

=[G/Z/Base]


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE272_Least_Privilege_Violation__w32_wchar_t_SHRegCreateUSKey_01.c
Label Definition File: CWE272_Least_Privilege_Violation__w32.label.xml
Template File: point-flaw-01.tmpl.c
*/
/*
 * @description
 * CWE: 272 Least Privilege Violation
 * Sinks: SHRegCreateUSKey
 *    GoodSink: Create a registry key using SHRegCreateUSKeyW() and SHREGSET_HKCU
 *    BadSink : Create a registry key using SHRegCreateUSKeyW() and SHREGSET_HKLM
 * Flow Variant: 01 Baseline
 *
 * */

#include "std_testcase.h"

#include <windows.h>
#include <shlwapi.h>
#pragma comment( lib, "shlwapi" )

#ifndef OMITBAD

void CWE272_Least_Privilege_Violation__w32_wchar_t_SHRegCreateUSKey_01_bad()
{
    {
        wchar_t * keyName = L"TEST\\TestKey";
        HUSKEY hKey;
        /* FLAW: Call SHRegCreateUSKeyW() with SHREGSET_HKLM violating the least privilege principal */
        if (SHRegCreateUSKeyW(
                    keyName,
                    KEY_WRITE,
                    NULL,
                    &hKey,
                    SHREGSET_HKLM) != ERROR_SUCCESS)
        {
            printLine("Registry key could not be created");
        }
        else
        {
            printLine("Registry key created successfully");
            SHRegCloseUSKey(hKey);
        }
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

static void good1()
{
    {
        wchar_t * keyName = L"TEST\\TestKey";
        HUSKEY hKey;
        /* FIX: Call SHRegCreateUSKeyW() with SHREGSET_HKCU */
        if (SHRegCreateUSKeyW(
                    keyName,
                    KEY_WRITE,
                    NULL,
                    &hKey,
                    SHREGSET_HKCU) != ERROR_SUCCESS)
        {
            printLine("Registry key could not be created");
        }
        else
        {
            printLine("Registry key created successfully");
            SHRegCloseUSKey(hKey);
        }
    }
}

void CWE272_Least_Privilege_Violation__w32_wchar_t_SHRegCreateUSKey_01_good()
{
    good1();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
   its own for testing or for building a binary to use in testing binary
   analysis tools. It is not used when compiling all the testcases as one
   application, which is how source code analysis tools are tested. */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE272_Least_Privilege_Violation__w32_wchar_t_SHRegCreateUSKey_01_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE272_Least_Privilege_Violation__w32_wchar_t_SHRegCreateUSKey_01_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
'use strict';

import mongoose from 'mongoose';

var ProcessorSchema = new mongoose.Schema({
  title: String,
  shorttitle: String,
  summary: String,
  link: String,
  pubdate: String,
  companies: String,
  position: String,
  score: Number,
  active: Boolean
});

export default mongoose.model('Processor', ProcessorSchema);


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	errorHandler = require('./errors.server.controller'),
	Exchange = mongoose.model('Exchange'),
	_ = require('lodash');

/**
 * Create a Exchange
 */
exports.create = function(req, res) {
	var exchange = new Exchange(req.body);
	exchange.user = req.user;

    var util = require('util');

	exchange.save(function(err) {
		if (err) {
            console.log("Error: " + err);
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(exchange);
		}
	});
};

/**
 * Show the current Exchange
 */
exports.read = function(req, res) {
	res.jsonp(req.exchange);
};

/**
 * Update a Exchange
 */
exports.update = function(req, res) {
	var exchange = req.exchange ;

	exchange = _.extend(exchange , req.body);

	exchange.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(exchange);
		}
	});
};

/**
 * Delete an Exchange
 */
exports.delete = function(req, res) {
	var exchange = req.exchange ;

	exchange.remove(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(exchange);
		}
	});
};

/**
 * List of Exchanges
 */
exports.list = function(req, res) {
	Exchange.find().sort('-created').populate('user', 'displayName').exec(function(err, exchanges) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(exchanges);
		}
	});
};

/**
 * Exchange middleware
 */
exports.exchangeByID = function(req, res, next, id) {
	Exchange.findById(id).populate('user', 'displayName').exec(function(err, exchange) {
		if (err) return next(err);
		if (! exchange) return next(new Error('Failed to load Exchange ' + id));
		req.exchange = exchange ;
		next();
	});
};

/**
 * Exchange authorization middleware
 */
exports.hasAuthorization = function(req, res, next) {
	if (req.exchange.user.id !== req.user.id) {
		return res.status(403).send('User is not authorized');
	}
	next();
};

exports.getCurrentPrice = function(req, res) {
    return 'T1';
};


text:
namespace BEmu
{
	namespace IntradayTickRequest
	{
		IntradayTickRequestElementTime::IntradayTickRequestElementTime(const std::string& elementName, const Datetime& date)
			: CanConvertToStringType(DisplayFormats::IntradayRequests_FormatDatetime_SecondsLast(date), false)
		{
			this->_instance = date;
			this->_elementName = elementName;
		}

		IntradayTickRequestElementTime::~IntradayTickRequestElementTime()
		{
		}

		Datetime IntradayTickRequestElementTime::getDate() const
		{
			return this->_instance;
		}

		Name IntradayTickRequestElementTime::name() const
		{
			Name result(this->_elementName.c_str());
			return result;
		}

		std::ostream& IntradayTickRequestElementTime::print(std::ostream& stream, int level, int spacesPerLevel) const
		{
			std::string tabs = IndentType::Indent(level, spacesPerLevel);
			stream << tabs << this->_elementName << " = " << this->ValueAsString() << std::endl;
			return stream;
		}

	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF 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

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

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

<entity-engine-xml>

    <!-- Facility Manager security -->
    <SecurityPermission description="View operations in the Facility Manager." permissionId="FACILITY_VIEW"/>
    <SecurityPermission description="Create operations in the Facility Manager." permissionId="FACILITY_CREATE"/>
    <SecurityPermission description="Update operations in the Facility Manager." permissionId="FACILITY_UPDATE"/>
    <SecurityPermission description="Delete operations in the Facility Manager." permissionId="FACILITY_DELETE"/>
    <SecurityPermission description="ALL operations in the Facility Manager." permissionId="FACILITY_ADMIN"/>
    <SecurityPermission description="Limited view operations in the Facility Manager." permissionId="FACILITY_ROLE_VIEW"/>
    <SecurityPermission description="Limited update operations in the Facility Manager." permissionId="FACILITY_ROLE_UPDATE"/>

    <!-- add admin to SUPER permission group -->
    <SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="SUPER" permissionId="FACILITY_ADMIN"/>

</entity-engine-xml>


text:
CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS
        '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE;

-- declare the protocol name along with in/out funcs
CREATE PROTOCOL s3 (
        readfunc  = read_from_s3
);

-- Check out the catalog table
select * from pg_extprotocol;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-ap-northeast-1.amazonaws.com/apnortheast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-ap-northeast-2.amazonaws.com/apnortheast2.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-ap-southeast-1.amazonaws.com/apsoutheast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-ap-southeast-2.amazonaws.com/apsoutheast2.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-eu-central-1.amazonaws.com/eucentral1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-eu-west-1.amazonaws.com/euwest1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-sa-east-1.amazonaws.com/saeast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-us-east-1.amazonaws.com/useast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- ========

drop external table s3example;
create READABLE external table s3example (date text, time text, open float, high float,
        low float, volume int) location('s3://s3-us-west-1.amazonaws.com/uswest1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv';

\d s3example

SELECT count(*) FROM s3example;
SELECT sum(open) FROM s3example;
SELECT avg(open) FROM s3example;

-- =======
-- CLEANUP
-- =======
DROP EXTERNAL TABLE s3example;

DROP PROTOCOL s3;


text:
package org.mcisb.ui.util.dnd;

import javax.swing.*;

/**
 *
 * @author Neil Swainston
 */
public class DraggableLabel extends JLabel
{
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	private final Object userObject;

	/**
	 *
	 * @param userObject
	 */
	public DraggableLabel( final Object userObject )
	{
		super( userObject.toString() );
		this.userObject = userObject;
	}

	/**
	 *
	 * @return Object
	 */
	public Object getUserObject()
	{
		return userObject;
	}
}


text:
<?php

// Require the base class.
require_once dirname(__DIR__) . '/BaseExample.php';

/**
 * This example lists all existing active creatives for a given advertiser.
 * To get an advertiser ID, run GetAdvertisers.
 */
class GetCreatives extends BaseExample
{
    /**
     * (non-PHPdoc)
     * @see BaseExample::getInputParameters()
     * @return array
     */
    protected function getInputParameters()
    {
        return [['name' => 'user_profile_id',
                 'display' => 'User Profile ID',
                 'required' => true],
                ['name' => 'advertiser_id',
                 'display' => 'Advertiser ID',
                 'required' => true]];
    }

    /**
     * (non-PHPdoc)
     * @see BaseExample::run()
     */
    public function run()
    {
        $values = $this->formValues;

        printf(
            '
Listing all active creatives for advertiser ID %s
',
            $values['advertiser_id']
        );

        $response = null;
        $pageToken = null;

        $this->printResultsTableHeader('Creatives');

        do {
            // Create and execute the creative fields list request.
            $response = $this->service->creatives->listCreatives(
                $values['user_profile_id'],
                ['active' => true,
                 'advertiserId' => $values['advertiser_id'],
                 'pageToken' => $pageToken]
            );

            foreach ($response->getCreatives() as $creatives) {
                $this->printResultsTableRow($creatives);
            }

            // Update the next page token.
            $pageToken = $response->getNextPageToken();
        } while (!empty($response->getCreatives()) && !empty($pageToken));

        $this->printResultsTableFooter();
    }

    /**
     * (non-PHPdoc)
     * @see BaseExample::getName()
     * @return string
     */
    public static function getName()
    {
        return 'Get All Creatives';
    }

    /**
     * (non-PHPdoc)
     * @see BaseExample::getResultsTableHeaders()
     * @return array
     */
    public function getResultsTableHeaders()
    {
        return ['id' => 'Creative ID',
                'name' => 'Creative Name',
                'type' => 'Creative Type'];
    }
}


text:
require 'spec_helper'

module Spree
  describe ReimbursementType::OriginalPayment do
    let(:reimbursement)           { create(:reimbursement, return_items_count: 1) }
    let(:return_item)             { reimbursement.return_items.first }
    let(:payment)                 { reimbursement.order.payments.first }
    let(:simulate)                { false }
    let!(:default_refund_reason)  { Spree::RefundReason.find_or_create_by!(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false) }

    subject { Spree::ReimbursementType::OriginalPayment.reimburse(reimbursement, [return_item], simulate)}

    before { reimbursement.update!(total: reimbursement.calculated_total) }

    describe ".reimburse" do
      context "simulate is true" do
        let(:simulate) { true }

        it "returns an array of readonly refunds" do
          expect(subject.map(&:class)).to eq [Spree::Refund]
          expect(subject.map(&:readonly?)).to eq [true]
        end
      end

      context "simulate is false" do
        it 'performs the refund' do
          expect {
            subject
          }.to change { payment.refunds.count }.by(1)
          expect(payment.refunds.sum(:amount)).to eq reimbursement.return_items.to_a.sum(&:total)
        end
      end

      context 'when no credit is allowed on the payment' do
        before do
          Spree::Payment.any_instance.should_receive(:credit_allowed).and_return 0
        end

        it 'returns an empty array' do
          expect(subject).to eq []
        end
      end

      context 'when a payment is negative' do
        before do
          Spree::Payment.any_instance.should_receive(:amount).and_return -100
        end

        it 'returns an empty array' do
          expect(subject).to eq []
        end
      end
    end
  end
end


text:
module Marmite
  module Services
    # Processes an update API request and selects a response
    class UpdateEndpoint
      include Mixins::InferEndpointResource
      include Mixins::ServiceHooks

      # Initializes an instance
      # @param attributes [Hash] the attributes to update
      # @param controller [ActionController::API] the resource controller
      # @param resource_id [Integer, String] the resource id
      def initialize(attributes:, controller:, resource_id:)
        @controller = controller
        @attributes = attributes
        @resource_id = resource_id
      end

      # If the resource is not found it selects a not_found response
      # If the resource is found and updated it selects an ok response
      # If the resource update fails it selects a conflict response
      def call
        return update_not_found unless resource_found?

        resource_constant.transaction do
          call_before_validations

          perform_update

          return update_ok
        end

      rescue ActiveRecord::RecordInvalid
        update_conflict
      end

      private

      attr_reader :attributes, :controller, :resource_id

      # Performs update on resource
      # @return [Boolean] if the resource updates return true, else false
      def perform_update
        resource.update!(attributes)
      end

      # Checks if the resource was found
      # @see Policies::WasTheResourceFound
      def resource_found?
        Policies::WasTheResourceFound.new(resource: resource).call
      end

      # Resource to update and render in response
      # @return [Resource] if the resource object was found
      # @return [nil] if the resource object was not found
      def resource
        @resource ||= begin
          resource_query
                      .new(relation: resource_constant.all)
                      .find_for_update(resource_id: resource_id)
        end
      end

      # Responds to request with update_conflict action
      def update_conflict
        controller.update_conflict(resource: resource)
      end

      # Responds to request with update_not_found action
      def update_not_found
        controller.update_not_found
      end

      # Responds to request with update_ok action
      def update_ok
        controller.update_ok(resource: resource)
      end
    end
  end
end


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>Module: ActionController::Caching::Pages</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />

          Module
          ActionController::Caching::Pages

            In:

                vendor/rails/actionpack/lib/action_controller/caching.rb

Page caching is an approach to caching where the entire action output of is
stored as a HTML file that the web server can serve without going through
the Action Pack. This can be as much as 100 times faster than going through
the process of dynamically generating the content. Unfortunately, this
incredible speed-up is only available to stateless pages where all visitors
are treated the same. Content management systems — including weblogs
and wikis — have many pages that are a great fit for this approach,
but account-based systems where people log in and manipulate their own data
are often less likely candidates.

Specifying which actions to cache is done through the <tt>caches</tt> class
method:

  class WeblogController < ActionController::Base
    caches_page :show, :new
  end

This will generate cache files such as weblog/show/5 and weblog/new, which
match the URLs used to trigger the dynamic generation. This is how the web
server is able pick up a cache file when it exists and otherwise let the
request pass on to the Action Pack to generate it.

Expiration of the cache is handled by deleting the cached file, which
results in a lazy regeneration approach where the cache is not restored
before another hit is made against it. The API for doing so mimics the
options from url_for and friends:

  class WeblogController < ActionController::Base
    def update
      List.update(@params["list"]["id"], @params["list"])
      expire_page :action => "show", :id => @params["list"]["id"]
      redirect_to :action => "show", :id => @params["list"]["id"]
    end
  end

Additionally, you can expire caches using Sweepers that act on changes in
the model to determine when a cache is supposed to be expired.

Setting the cache directory

The cache directory should be the document root for the web server and is
set using Base.page_cache_directory = "/document/root". For
Rails, this directory has already been set to RAILS_ROOT +
"/public".

Setting the cache extension

By default, the cache extension is .html, which makes it easy for the
cached files to be picked up by the web server. If you want something else,
like .php or .shtml, just set Base.page_cache_extension.

Methods

      cache_page
      expire_page

Classes and Modules

      Module ActionController::Caching::Pages::ClassMethods

Public Instance methods

          cache_page(content = nil, options = {})

Manually cache the <tt>content</tt> in the key determined by
<tt>options</tt>. If no content is provided, the contents of @response.body
is used If no options are provided, the current <tt>options</tt> for this
action is used. Example:

  cache_page "I'm the cached content", :controller => "lists", :action => "show"

[Source]

     # File vendor/rails/actionpack/lib/action_controller/caching.rb, line 130
130:       def cache_page(content = nil, options = {})
131:         return unless perform_caching && caching_allowed
132:         self.class.cache_page(content || @response.body, url_for(options.merge({ :only_path => true, :skip_relative_url_root => true })))
133:       end

          expire_page(options = {})

Expires the page that was cached with the <tt>options</tt> as a key.
Example:

  expire_page :controller => "lists", :action => "show"

[Source]

     # File vendor/rails/actionpack/lib/action_controller/caching.rb, line 116
116:       def expire_page(options = {})
117:         return unless perform_caching
118:         if options[:action].is_a?(Array)
119:           options[:action].dup.each do |action|
120:             self.class.expire_page(url_for(options.merge({ :only_path => true, :skip_relative_url_root => true, :action => action })))
121:           end
122:         else
123:           self.class.expire_page(url_for(options.merge({ :only_path => true, :skip_relative_url_root => true })))
124:         end
125:       end

[Validate]


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Neo.IronLua;

namespace LuaDLR.Test
{
	[TestClass]
	public class RunLuaTests : TestHelper
	{
		private object TestAssert(object test, string sMessage)
		{
			if (!(bool)Lua.RtConvertValue(test, typeof(bool)))
			{
				LuaStackFrame frame = LuaExceptionData.GetStackTrace(new StackTrace(0, true)).FirstOrDefault(c => c.Type == LuaStackFrameType.Lua);
				if (frame == null)
					Assert.IsTrue(false, "Test failed (unknown position) " + sMessage);
				else
					Assert.IsTrue(false, "Test failed at line {0}, column {1}, file {2} {3}", frame.LineNumber, frame.ColumnNumber, frame.FileName, sMessage);
			}
			return test;
		}

		private void DoScript(Lua l, LuaGlobal g, string sScript)
		{
			Type type = typeof(RunLuaTests);
			using (Stream src = type.Assembly.GetManifestResourceStream(type, "CompTests." + sScript))
			using (StreamReader sr = new StreamReader(src))
			{
				Console.WriteLine();
				Console.WriteLine(new string('=', 60));
				Console.WriteLine("= " + sScript);
				Console.WriteLine();
				try
				{
					g.DoChunk(l.CompileChunk(sr, sScript, Lua.StackTraceCompileOptions));
				}
				catch (Exception e)
				{
					if (e is LuaException)
						Console.WriteLine("Line: {0}, Column: {1}", ((LuaException)e).Line, ((LuaException)e).Column);
					Console.WriteLine("StackTrace:");
					Console.WriteLine(LuaExceptionData.GetData(e).StackTrace);
					throw;
				}
			}
		}

		[TestMethod]
		public void RunTest()
		{
			using (Lua l = new Lua())
			{
				var g = l.CreateEnvironment<LuaGlobal>();
				dynamic dg = g;

				dg.math.randomseed(0);
				dg.assert = new Func<object, string, object>(TestAssert);

				DoScript(l, g, "calls.lua");
				DoScript(l, g, "strings.lua");
				//DoScript(l, g, "literals.lua");

				DoScript(l, g, "math.lua");
				DoScript(l, g, "bitwise.lua");
			}
		}

		[TestMethod]
		public void TestSingle01()
		{
			TestCode("return 0xfffffffffffff800", 0xfffffffffffff800);
		}

		[TestMethod]
		public void TestSingle02()
		{
			TestCode(Lines(
				"function deep(n)",
				"  if n > 0 then return deep(n-1); else return 101; end;",
 				"end;",
				"return deep(3000);"), 101);
		}

		[TestMethod]
		public void TestSingle03()
		{
			TestCode("a = nil; (function (x) a = x end)(23) return a", 23);
		}

		[TestMethod]
		public void TestSingle04()
		{
			TestCode(Lines(
				"local x = \"-- a comment\0\0\0\\n  x = 10 + \\n23; \\",
				"		local a = function () x = 'hi' end; \\",
				"		return '\\0'\"",
				"function read1 (x)",
				"  local i = 0",
				"  return function ()",
				"    collectgarbage()",
				"    i=i+1",
				"    return string.sub(x, i, i)",
				"  end",
				"end",
				"a = assert(load(read1(x), 'modname', 't', _G))",
				"return a(), _G.x;"
				), "\0", 33);
		}

		[TestMethod]
		public void TestSingle05()
		{
			TestCode("return tonumber('0ffffFFFF', 16) + 1", (long)4294967296);
		}
	}
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Flora, Jena 62: 361 (1879)

#### Original name
Lecanora inversa Nyl.

### Remarks
null


text:
package org.apache.tinkerpop.gremlin.process.traversal.step.map;

import org.apache.tinkerpop.gremlin.util.NumberHelper;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;

import java.util.Collections;
import java.util.Iterator;
import java.util.Set;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 * @author Daniel Kuppitz (http://gremlin.guru)
 */
public final class SumLocalStep<E extends Number, S extends Iterable<E>> extends MapStep<S, E> {

    public SumLocalStep(final Traversal.Admin traversal) {
        super(traversal);
    }

    @Override
    protected E map(final Traverser.Admin<S> traverser) {
        Number result;
        final Iterator<E> iterator = traverser.get().iterator();
        if (iterator.hasNext()) {
            result = iterator.next();
            while (iterator.hasNext()) {
                result = NumberHelper.add(result, iterator.next());
            }
        } else {
            result = 0;
        }
        return (E) result;
    }

    @Override
    public Set<TraverserRequirement> getRequirements() {
        return Collections.singleton(TraverserRequirement.OBJECT);
    }
}


text:
package org.apache.flink.runtime.dispatcher;

import org.apache.flink.api.common.JobExecutionResult;
import org.apache.flink.api.common.JobID;
import org.apache.flink.api.common.time.Time;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.blob.BlobServer;
import org.apache.flink.runtime.client.JobSubmissionException;
import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.concurrent.FutureUtils;
import org.apache.flink.runtime.heartbeat.HeartbeatServices;
import org.apache.flink.runtime.highavailability.HighAvailabilityServices;
import org.apache.flink.runtime.highavailability.RunningJobsRegistry;
import org.apache.flink.runtime.jobgraph.JobGraph;
import org.apache.flink.runtime.jobmanager.OnCompletionActions;
import org.apache.flink.runtime.jobmanager.SubmittedJobGraph;
import org.apache.flink.runtime.jobmanager.SubmittedJobGraphStore;
import org.apache.flink.runtime.jobmaster.JobManagerRunner;
import org.apache.flink.runtime.messages.Acknowledge;
import org.apache.flink.runtime.metrics.MetricRegistry;
import org.apache.flink.runtime.rpc.FatalErrorHandler;
import org.apache.flink.runtime.rpc.RpcEndpoint;
import org.apache.flink.runtime.rpc.RpcService;
import org.apache.flink.util.ExceptionUtils;
import org.apache.flink.util.FlinkException;
import org.apache.flink.util.Preconditions;

import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

/**
 * Base class for the Dispatcher component. The Dispatcher component is responsible
 * for receiving job submissions, persisting them, spawning JobManagers to execute
 * the jobs and to recover them in case of a master failure. Furthermore, it knows
 * about the state of the Flink session cluster.
 */
public abstract class Dispatcher extends RpcEndpoint implements DispatcherGateway {

	public static final String DISPATCHER_NAME = "dispatcher";

	private final Configuration configuration;

	private final SubmittedJobGraphStore submittedJobGraphStore;
	private final RunningJobsRegistry runningJobsRegistry;

	private final HighAvailabilityServices highAvailabilityServices;
	private final BlobServer blobServer;
	private final HeartbeatServices heartbeatServices;
	private final MetricRegistry metricRegistry;

	private final FatalErrorHandler fatalErrorHandler;

	private final Map<JobID, JobManagerRunner> jobManagerRunners;

	protected Dispatcher(
			RpcService rpcService,
			String endpointId,
			Configuration configuration,
			HighAvailabilityServices highAvailabilityServices,
			BlobServer blobServer,
			HeartbeatServices heartbeatServices,
			MetricRegistry metricRegistry,
			FatalErrorHandler fatalErrorHandler) throws Exception {
		super(rpcService, endpointId);

		this.configuration = Preconditions.checkNotNull(configuration);
		this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices);
		this.blobServer = Preconditions.checkNotNull(blobServer);
		this.heartbeatServices = Preconditions.checkNotNull(heartbeatServices);
		this.metricRegistry = Preconditions.checkNotNull(metricRegistry);
		this.fatalErrorHandler = Preconditions.checkNotNull(fatalErrorHandler);

		this.submittedJobGraphStore = highAvailabilityServices.getSubmittedJobGraphStore();
		this.runningJobsRegistry = highAvailabilityServices.getRunningJobsRegistry();

		jobManagerRunners = new HashMap<>(16);
	}

	//------------------------------------------------------
	// Lifecycle methods
	//------------------------------------------------------

	@Override
	public void postStop() throws Exception {
		Exception exception = null;
		// stop all currently running JobManagerRunners
		for (JobManagerRunner jobManagerRunner : jobManagerRunners.values()) {
			jobManagerRunner.shutdown();
		}

		jobManagerRunners.clear();

		try {
			submittedJobGraphStore.stop();
		} catch (Exception e) {
			exception = ExceptionUtils.firstOrSuppressed(e, exception);
		}

		try {
			super.postStop();
		} catch (Exception e) {
			exception = ExceptionUtils.firstOrSuppressed(e, exception);
		}

		if (exception != null) {
			throw new FlinkException("Could not properly terminate the Dispatcher.", exception);
		}
	}

	//------------------------------------------------------
	// RPCs
	//------------------------------------------------------

	@Override
	public CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, Time timeout) {
		final JobID jobId = jobGraph.getJobID();

		log.info("Submitting job {} ({}).", jobGraph.getJobID(), jobGraph.getName());

		final RunningJobsRegistry.JobSchedulingStatus jobSchedulingStatus;

		try {
			jobSchedulingStatus = runningJobsRegistry.getJobSchedulingStatus(jobId);
		} catch (IOException e) {
			log.warn("Cannot retrieve job status for {}.", jobId, e);
			return FutureUtils.completedExceptionally(
				new JobSubmissionException(jobId, "Could not retrieve the job status.", e));
		}

		if (jobSchedulingStatus == RunningJobsRegistry.JobSchedulingStatus.PENDING) {
			try {
				submittedJobGraphStore.putJobGraph(new SubmittedJobGraph(jobGraph, null));
			} catch (Exception e) {
				log.warn("Cannot persist JobGraph.", e);
				return FutureUtils.completedExceptionally(
					new JobSubmissionException(jobId, "Could not persist JobGraph.", e));
			}

			final JobManagerRunner jobManagerRunner;

			try {
				jobManagerRunner = createJobManagerRunner(
					ResourceID.generate(),
					jobGraph,
					configuration,
					getRpcService(),
					highAvailabilityServices,
					blobServer,
					heartbeatServices,
					metricRegistry,
					new DispatcherOnCompleteActions(jobGraph.getJobID()),
					fatalErrorHandler);

				jobManagerRunner.start();
			} catch (Exception e) {
				try {
					// We should only remove a job from the submitted job graph store
					// if the initial submission failed. Never in case of a recovery
					submittedJobGraphStore.removeJobGraph(jobId);
				} catch (Throwable t) {
					log.warn("Cannot remove job graph from submitted job graph store.", t);
					e.addSuppressed(t);
				}

				return FutureUtils.completedExceptionally(
					new JobSubmissionException(jobId, "Could not start JobManager.", e));
			}

			jobManagerRunners.put(jobId, jobManagerRunner);

			return CompletableFuture.completedFuture(Acknowledge.get());
		} else {
			return FutureUtils.completedExceptionally(
				new JobSubmissionException(jobId, "Job has already been submitted and " +
					"is currently in state " + jobSchedulingStatus + '.'));
		}
	}

	@Override
	public CompletableFuture<Collection<JobID>> listJobs(Time timeout) {
		// TODO: return proper list of running jobs
		return CompletableFuture.completedFuture(jobManagerRunners.keySet());
	}

	/**
	 * Cleans up the job related data from the dispatcher. If cleanupHA is true, then
	 * the data will also be removed from HA.
	 *
	 * @param jobId JobID identifying the job to clean up
	 * @param cleanupHA True iff HA data shall also be cleaned up
	 */
	private void removeJob(JobID jobId, boolean cleanupHA) throws Exception {
		JobManagerRunner jobManagerRunner = jobManagerRunners.remove(jobId);

		if (jobManagerRunner != null) {
			jobManagerRunner.shutdown();
		}

		if (cleanupHA) {
			submittedJobGraphStore.removeJobGraph(jobId);
		}

		// TODO: remove job related files from blob server
	}

	protected abstract JobManagerRunner createJobManagerRunner(
		ResourceID resourceId,
		JobGraph jobGraph,
		Configuration configuration,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		OnCompletionActions onCompleteActions,
		FatalErrorHandler fatalErrorHandler) throws Exception;

	//------------------------------------------------------
	// Utility classes
	//------------------------------------------------------

	private class DispatcherOnCompleteActions implements OnCompletionActions {

		private final JobID jobId;

		private DispatcherOnCompleteActions(JobID jobId) {
			this.jobId = Preconditions.checkNotNull(jobId);
		}

		@Override
		public void jobFinished(JobExecutionResult result) {
			log.info("Job {} finished.", jobId);

			runAsync(new Runnable() {
				@Override
				public void run() {
					try {
						removeJob(jobId, true);
					} catch (Exception e) {
						log.warn("Could not properly remove job {} from the dispatcher.", jobId, e);
					}
				}
			});
		}

		@Override
		public void jobFailed(Throwable cause) {
			log.info("Job {} failed.", jobId);

			runAsync(new Runnable() {
				@Override
				public void run() {
					try {
						removeJob(jobId, true);
					} catch (Exception e) {
						log.warn("Could not properly remove job {} from the dispatcher.", jobId, e);
					}
				}
			});
		}

		@Override
		public void jobFinishedByOther() {
			log.info("Job {} was finished by other JobManager.", jobId);

			runAsync(new Runnable() {
				@Override
				public void run() {
					try {
						removeJob(jobId, false);
					} catch (Exception e) {
						log.warn("Could not properly remove job {} from the dispatcher.", jobId, e);
					}
				}
			});
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ibenben.mapper.UserSessionMapper">
  <resultMap id="BaseResultMap" type="com.ibenben.domain.UserSession">
    <id column="session_id" jdbcType="INTEGER" property="sessionId" />
    <result column="user_id" jdbcType="INTEGER" property="userId" />
    <result column="access_token" jdbcType="VARCHAR" property="accessToken" />
    <result column="ip" jdbcType="VARCHAR" property="ip" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
    <result column="group_type" jdbcType="VARCHAR" property="groupType" />
  </resultMap>
  <sql id="Base_Column_List">
    session_id, user_id, access_token, ip, created_time, expire_time, last_login_time,group_type
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from user_session
    where session_id = #{sessionId,jdbcType=INTEGER}
  </select>

  <select id="getUserSession" parameterType="com.ibenben.domain.User" resultType="java.lang.Integer">
    select
    session_id
    from user_session
    where user_id = #{userId,jdbcType=INTEGER}
  </select>

  <select id="getUserSessionByToken" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    *
    from user_session
    where access_token = #{token,jdbcType=VARCHAR}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from user_session
    where session_id = #{sessionId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.ibenben.domain.UserSession">
    insert into user_session (session_id, user_id, access_token,
      ip, created_time, expire_time,
      last_login_time,group_type)
    values (#{sessionId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{accessToken,jdbcType=VARCHAR},
      #{ip,jdbcType=VARCHAR}, #{createdTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP},
      #{lastLoginTime,jdbcType=TIMESTAMP},#{groupType,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ibenben.domain.UserSession">
    insert into user_session
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="sessionId != null">
        session_id,
      </if>
      <if test="userId != null">
        user_id,
      </if>
      <if test="accessToken != null">
        access_token,
      </if>
      <if test="ip != null">
        ip,
      </if>
      <if test="createdTime != null">
        created_time,
      </if>
      <if test="expireTime != null">
        expire_time,
      </if>
      <if test="lastLoginTime != null">
        last_login_time,
      </if>
      <if test="groupType != null">
        group_type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="sessionId != null">
        #{sessionId,jdbcType=INTEGER},
      </if>
      <if test="userId != null">
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="accessToken != null">
        #{accessToken,jdbcType=VARCHAR},
      </if>
      <if test="ip != null">
        #{ip,jdbcType=VARCHAR},
      </if>
      <if test="createdTime != null">
        #{createdTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expireTime != null">
        #{expireTime,jdbcType=TIMESTAMP},
      </if>
      <if test="lastLoginTime != null">
        #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="groupType != null">
        #{groupType,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ibenben.domain.UserSession">
    update user_session
    <set>
      <if test="userId != null">
        user_id = #{userId,jdbcType=INTEGER},
      </if>
      <if test="accessToken != null">
        access_token = #{accessToken,jdbcType=VARCHAR},
      </if>
      <if test="ip != null">
        ip = #{ip,jdbcType=VARCHAR},
      </if>
      <if test="createdTime != null">
        created_time = #{createdTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expireTime != null">
        expire_time = #{expireTime,jdbcType=TIMESTAMP},
      </if>
      <if test="lastLoginTime != null">
        last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="groupType != null">
        group_type = #{groupType,jdbcType=VARCHAR},
      </if>
    </set>
    where session_id = #{sessionId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ibenben.domain.UserSession">
    update user_session
    set user_id = #{userId,jdbcType=INTEGER},
      access_token = #{accessToken,jdbcType=VARCHAR},
      ip = #{ip,jdbcType=VARCHAR},
      created_time = #{createdTime,jdbcType=TIMESTAMP},
      expire_time = #{expireTime,jdbcType=TIMESTAMP},
      last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
      group_type = #{groupType,jdbcType=VARCHAR}
    where session_id = #{sessionId,jdbcType=INTEGER}
  </update>
</mapper>


text:
Exaples work for Debian9. You might need to do things differently for other distributions.

After login,

Install pip

	$ sudo apt-get install python-pip

Install git

	$ sudo apt-get install git

clone the frauk repo

    $ git clone https://github.com/Maschinendeck/frauk

enter the directory created by git clone

	$ cd frauk

check if virtualenv is installed

	$ pip list | grep virtualenv

if yes fine else install it with

	$ pip install virtualenv

create a new virtual environment for the frauk app and activate it

	$ virtualenv venv
    $ source venv/bin/activate

and install the frauk python package.
the ````--editable```` installs frauk in its current location.

	(venv) $ pip install --editable .

it should now install flask and other things, including frauk.

copy the ````config.py```` and change the database path to wherever you want.

now we need to set a few environment variables. since we are in a virtual environment these are stored permanently

    (venv) $ export FLASK_APP=frauk
    (venv) $ export FLASK_DEBUG=0 # 1 when developing
    (venv) $ export FRAUK_CONFIG=/home/vann/projects/frauk/config.py

to create a new database do:

	(venv) $ python
    > from frauk import db
    > db.create_all()
    > exit()

after that you can import an sqlite database from chaosdorfs mete with

	(venv) $ python mete_import /path/to/mete.db

now to start everything and check if it works do:

	(venv) $ flask run

it should tell you that it's listening on ````localhost:5000````.

````(venv) $ curl localhost:5000```` to test if its working

__So far you've got a development setup. If that's your goal you can stop reading.__

If you want to put it behind a webserver, go ahead and install gunicorn and nginx

	(venv) $ pip install gunicorn
	(venv) $ sudo apt-get install nginx

gunicorn runns our application and sits behind nginx as reverse proxy

test if gunicorn is working\

	(venv) $ gunicorn frauk:frauk

then create your config for nginx at ````/etc/nginx/sites-available/frauk````

```nginx
# /etc/nginx/sites-available/frauk
# Handle requests to frauk on port 80
server {
        listen 80;
        server_name <your domain or ip>;

                # Handle all locations
        location / {
                        # Pass the request to Gunicorn
                proxy_pass http://127.0.0.1:8000;

                # Set some HTTP headers so that our app knows where the
                # request really came from
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}
```

this activates the config above

	$ sudo ln -s \
	/etc/nginx/sites-available/frauk \
	/etc/nginx/sites-enabled/frauk

reload the nginx config with

	(venv) $ sudo service nginx reload

now check if you can reach the app with curl

	(venv) $ curl 127.0.0.1

yeah, that's it congratz.


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@android:color/holo_orange_dark" />

    <corners android:radius="20dp" />

</shape>


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<!-- Copyright © 1991-2017 Unicode, Inc.
For terms of use, see http://www.unicode.org/copyright.html
Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
-->
<ldml>
	<identity>
		<version number="$Revision: 13571 $"/>
		<language type="sid"/>
	</identity>
	<localeDisplayNames>
		<languages>
			<language type="sid" draft="unconfirmed">Sidaamu Afo</language>
		</languages>
		<scripts>
			<script type="Latn" draft="unconfirmed">Latin</script>
		</scripts>
		<territories>
			<territory type="ET" draft="unconfirmed">Itiyoophiya</territory>
		</territories>
	</localeDisplayNames>
	<characters>
		<exemplarCharacters draft="unconfirmed">[a b c d e f g h i j k l m n o p q r s t u v w x y z]</exemplarCharacters>
		<exemplarCharacters type="index" draft="unconfirmed">[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]</exemplarCharacters>
	</characters>
	<dates>
		<calendars>
			<calendar type="generic">
				<dateFormats>
					<dateFormatLength type="full">
						<dateFormat>
							<pattern draft="unconfirmed">EEEE, MMMM dd, y G</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="long">
						<dateFormat>
							<pattern draft="unconfirmed">dd MMMM y G</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="medium">
						<dateFormat>
							<pattern draft="unconfirmed">dd-MMM-y G</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="short">
						<dateFormat>
							<pattern draft="unconfirmed">dd/MM/yy GGGGG</pattern>
						</dateFormat>
					</dateFormatLength>
				</dateFormats>
				<timeFormats>
					<timeFormatLength type="full">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a zzzz</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="long">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a z</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="medium">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="short">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm a</pattern>
						</timeFormat>
					</timeFormatLength>
				</timeFormats>
			</calendar>
			<calendar type="gregorian">
				<days>
					<dayContext type="format">
						<dayWidth type="abbreviated">
							<day type="sun" draft="unconfirmed">Sam</day>
							<day type="mon" draft="unconfirmed">San</day>
							<day type="tue" draft="unconfirmed">Mak</day>
							<day type="wed" draft="unconfirmed">Row</day>
							<day type="thu" draft="unconfirmed">Ham</day>
							<day type="fri" draft="unconfirmed">Arb</day>
							<day type="sat" draft="unconfirmed">Qid</day>
						</dayWidth>
						<dayWidth type="wide">
							<day type="sun" draft="unconfirmed">Sambata</day>
							<day type="mon" draft="unconfirmed">Sanyo</day>
							<day type="tue" draft="unconfirmed">Maakisanyo</day>
							<day type="wed" draft="unconfirmed">Roowe</day>
							<day type="thu" draft="unconfirmed">Hamuse</day>
							<day type="fri" draft="unconfirmed">Arbe</day>
							<day type="sat" draft="unconfirmed">Qidaame</day>
						</dayWidth>
					</dayContext>
					<dayContext type="stand-alone">
						<dayWidth type="narrow">
							<day type="sun" draft="unconfirmed">S</day>
							<day type="mon" draft="unconfirmed">S</day>
							<day type="tue" draft="unconfirmed">M</day>
							<day type="wed" draft="unconfirmed">R</day>
							<day type="thu" draft="unconfirmed">H</day>
							<day type="fri" draft="unconfirmed">A</day>
							<day type="sat" draft="unconfirmed">Q</day>
						</dayWidth>
					</dayContext>
				</days>
				<dayPeriods>
					<dayPeriodContext type="format">
						<dayPeriodWidth type="abbreviated">
							<dayPeriod type="am" draft="unconfirmed">soodo</dayPeriod>
							<dayPeriod type="pm" draft="unconfirmed">hawwaro</dayPeriod>
						</dayPeriodWidth>
						<dayPeriodWidth type="wide">
							<dayPeriod type="am" draft="unconfirmed">soodo</dayPeriod>
							<dayPeriod type="pm" draft="unconfirmed">hawwaro</dayPeriod>
						</dayPeriodWidth>
					</dayPeriodContext>
				</dayPeriods>
				<eras>
					<eraAbbr>
						<era type="0" draft="unconfirmed">YIA</era>
						<era type="1" draft="unconfirmed">YIG</era>
					</eraAbbr>
				</eras>
				<dateFormats>
					<dateFormatLength type="full">
						<dateFormat>
							<pattern draft="unconfirmed">EEEE, MMMM dd, y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="long">
						<dateFormat>
							<pattern draft="unconfirmed">dd MMMM y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="medium">
						<dateFormat>
							<pattern draft="unconfirmed">dd-MMM-y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="short">
						<dateFormat>
							<pattern draft="unconfirmed">dd/MM/yy</pattern>
						</dateFormat>
					</dateFormatLength>
				</dateFormats>
				<timeFormats>
					<timeFormatLength type="full">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a zzzz</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="long">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a z</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="medium">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="short">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm a</pattern>
						</timeFormat>
					</timeFormatLength>
				</timeFormats>
			</calendar>
		</calendars>
	</dates>
	<numbers>
		<currencyFormats numberSystem="latn">
			<currencyFormatLength>
				<currencyFormat type="standard">
					<pattern draft="unconfirmed">¤#,##0.00</pattern>
				</currencyFormat>
			</currencyFormatLength>
		</currencyFormats>
		<currencies>
			<currency type="ETB">
				<symbol>Br</symbol>
			</currency>
		</currencies>
	</numbers>
</ldml>


text:
using std::ifstream;
using std::ofstream;

namespace kortex {

    class KMatrix;
    inline void mat_minus_mat( const KMatrix& A, const KMatrix& B, KMatrix& C );
    inline void mat_plus_mat( const KMatrix& A, const KMatrix& B, KMatrix& C );
    inline void mat_mat( const KMatrix& A, const KMatrix& B, KMatrix& C );
    inline bool mat_inv( const KMatrix& A, KMatrix& iA );

    class KMatrix {
    public:
        KMatrix();
        KMatrix( int h, int w );
        KMatrix( const KMatrix& rhs );

        /// wraps around data - no change possible
        KMatrix( const double* data, int h, int w );
        /// wraps around data - possible to change
        KMatrix( double* data, int h, int w );

        ~KMatrix();

        bool is_initialized() const;

        /// sets the state of the matrix to init_  and deallocates any memory. see reset()
        void release();
        /// sets the state of the matrix to init_ but does not deallocate memory. see release()
        void reset();

        /// copies the matrix contents - creates memory and copies the
        /// contents. see clone() also
        void copy ( const KMatrix& rhs );
        /// makes an exact copy of rhs. copies pointers and not data if rhs is a
        /// wrapped matrix
        void clone( const KMatrix& rhs );

        /// creates/owns itself memory - not possible to call for already
        /// wrapped initializations. call release() first for that situations.
        void init( int h, int w );

        /// resizes the matrix dimensions. for wrapped matrices, before and
        /// after size() should be the same - otherwise fatals out. see reshape.
        void resize( int h, int w );

        /// reshapes the matrix -> h*w == nr*nc should stay the same. no memory
        /// alloc/dealloc occurs. see resize.
        void reshape( int h, int w );

        /// expands the size of the matrix while keeping original values
        /// intact. new entries are uninitialized. see resize and reshape also.
        void expand( int h, int w );

        /// sets the matrix data - does not do any initializations for memory !
        /// if this is a fresh matrix - call init(h,w) before. data size 'dsz'
        /// should be equivalent to nr*nc
        void set( const double* data, int dsz );

        void set( const double& v0, const double& v1 );
        void set( const double& v0, const double& v1, const double& v2 );
        void set( const double& v0, const double& v1, const double& v2, const double& v3 );

        void set( const double& v0, const double& v1, const double& v2,
                  const double& v3, const double& v4, const double& v5,
                  const double& v6, const double& v7, const double& v8 );

        void set_row( int rid, const float * rdata, int rdsz );
        void set_row( int rid, const double* rdata, int rdsz );
        /// set the contents of the row with row_data[0:csz-1] starting from r0,c0
        void set_row( int r0, int c0, const double* row_data, int csz );
        void set_row( int r, const double* rdata, int rsz, double alpha );

        void set_col( int cid, const double* cdata, int csz );
        void set_col( int r0, int c0, const double* cdata, int csz );
        void set_col( int c, const double* cdata, int csz, double alpha );

        double      * get_pointer();
        double      * get_row( int rid );
        double      * get_col( int cid );

        const double* get_const_pointer() const;
        const double* get_row( int rid ) const;
        const double* get_col( int cid ) const;

        // to prevent double-free errors when inserted into a vector
        KMatrix& operator= ( const KMatrix& rhs ) {
            copy( rhs );
            return *this;
        }

        // convenient access
        const double* operator() () const {
            return get_const_pointer();
        }
        const double& operator() (int y0, int x0) const {
            assert_boundary( y0, 0, nr );
            assert_boundary( x0, 0, nc );
            return get_const_pointer()[ y0*nc+x0 ];
        }
        // double& operator() (int y0, int x0) {
            // assert_boundary( y0, 0, nr );
            // assert_boundary( x0, 0, nc );
            // return get_pointer()[ y0*nc+x0 ];
        // }

        const double& operator[] (int k) const {
            assert_boundary( k, 0, size() );
            return get_const_pointer()[k];
        }
        double& operator() (int k) {
            assert_boundary( k, 0, size() );
            return get_pointer()[k];
        }

        KMatrix operator-( const KMatrix& rhs ) const {
            KMatrix res;
            mat_minus_mat( *this, rhs, res );
            return res;
        }

        KMatrix operator+( const KMatrix& rhs ) const {
            KMatrix res;
            mat_plus_mat( *this, rhs, res );
            return res;
        }

        KMatrix operator*( const KMatrix& rhs ) const {
            KMatrix res;
            mat_mat( *this, rhs, res );
            return res;
        }

        KMatrix inv() const {
            KMatrix res;
            if( !mat_inv( *this, res ) ) {
                logman_warning("could not invert matrix - setting to identity");
                res.identity();
            }
            return res;
        }

        void set( int y0, int x0, double v ) {
            assert_statement( !is_const(), "cannot modify const matrix" );
            get_pointer()[ y0*nc+x0 ] = v;
        }

        /// copies  this[ dr:dr+srsz, dc:dc+srsz ] =  rhs[ sr:sr+srsz, sc:sc+scsz ]
        void copy( const KMatrix& rhs, int sr, int sc, int srsz, int scsz, int dr, int dc );
        void copy( const KMatrix& rhs, int dr, int dc );

        /// this[ dr:dr+bh, dc:dc+bw ] -= B
        void subtract( const KMatrix& B, int dr, int dc );

        void   transpose();

        void   identity();
        void   zero   ();
        void   negate ();
        double normalize();

        double trace  () const;
        double det    () const;
        double norm   () const;
        double norm_sq() const;

        void scale_row( int rid, double alpha );
        void scale_col( int cid, double alpha );
        void scale    ( double s );

        void negate_col( int cid );
        void negate_row( int rid );

        void print( const string& str ) const;

        void save( const string& file ) const;
        void load( const string& file );

        void save( ofstream& fout, const string& mat_name ) const;
        void load( ifstream& fin,  const string& mat_name );

        void save_binary( ofstream& fout ) const;
        void load_binary( ifstream& fin );

        int  h          () const { return nr;          }
        int  w          () const { return nc;          }
        int  size       () const { return nr*nc;       }
        bool is_wrapper () const { return m_wrapper;   }
        bool is_const   () const { return m_const;     }
        bool is_square  () const { return bool(nr==nc);}
    private:
        const double* m_ro_data; // read only data pointer
        double      * m_data;    // data pointer

        MemUnit m_memory;
        bool    m_wrapper;
        bool    m_const;
        int     nr;
        int     nc;

        void init_();

        size_t req_mem(int h, int w) const { return sizeof(*m_data)*h*w; }
    };

///
/// mat-ops
///

    inline void mat_transpose( const KMatrix& A, KMatrix& At ) {
        At.init( A.w(), A.h() );
        mat_transpose( A(), A.h(), A.w(), At.get_pointer(), At.size() );
    }

    inline bool mat_inv( const KMatrix& A, KMatrix& iA ) {
        assert_statement( A.h() == A.w(), "matrix must be square - call pseudo_inv instead" );
        iA.resize( A.h(), A.w() );
        return mat_inv( A(), A.h(), A.w(), iA.get_pointer(), iA.h(), iA.w() );
    }

    inline void mat_mat( const KMatrix& A, const KMatrix& B, KMatrix& C ) {
        C.resize( A.h(), B.w() );
        mat_mat( A(), A.h(), A.w(), B(), B.h(), B.w(), C.get_pointer(), C.size() );
    }

    inline void mat_mat_trans( const KMatrix& A, const KMatrix& B, KMatrix& C ) {
        C.resize( A.h(), B.h() );
        mat_mat_trans( A(), A.h(), A.w(), B(), B.h(), B.w(),
                       C.get_pointer(), C.size() );
    }

    inline void mat_trans_mat( const KMatrix& A, const KMatrix& B, KMatrix& C ) {
        C.resize( A.w(), B.w() );
        mat_trans_mat( A(), A.h(), A.w(), B(), B.h(), B.w(),
                       C.get_pointer(), C.size() );
    }

    inline void mat_mat_mat_trans( const KMatrix& A, const KMatrix& B, const KMatrix& C,
                                   KMatrix& D ) {
        D.resize( A.h(), C.h() );
        mat_mat_mat_trans( A(), A.h(), A.w(), B(), B.h(), B.w(), C(), C.h(), C.w(),
                           D.get_pointer(), D.size() );
    }

    inline void mat_mat_mat( const KMatrix& A, const KMatrix& B, const KMatrix& C,
                             KMatrix& D ) {
        D.resize( A.h(), C.w() );
        mat_mat_mat( A(), A.h(), A.w(), B(), B.h(), B.w(), C(), C.h(), C.w(),
                     D.get_pointer(), D.size() );
    }

    inline void mat_trans_mat_mat( const KMatrix& A, const KMatrix& B, const KMatrix& C,
                                   KMatrix& D ) {
        D.resize( A.w(), C.w() );
        mat_trans_mat_mat( A(), A.h(), A.w(), B(), B.h(), B.w(), C(), C.h(), C.w(),
                           D.get_pointer(), D.size() );
    }

    inline void mat_mat_elem( const KMatrix& A, const KMatrix& B, KMatrix& C ) {
        C.resize( A.h(), A.w() );
        mat_mat_elem( A(), A.h(), A.w(), B(), B.h(), B.w(), C.get_pointer(), C.h(), C.w() );
    }

    inline void mat_minus_mat( const KMatrix& A, const KMatrix& B, KMatrix& C ) {
        C.resize( A.h(), A.w() );
        mat_minus_mat( A(), A.h(), A.w(), B(), B.h(), B.w(), C.get_pointer(), C.h(), C.w() );
    }

    inline void mat_plus_mat( const KMatrix& A, const KMatrix& B, KMatrix& C ) {
        C.resize( A.h(), A.w() );
        mat_plus_mat( A(), A.h(), A.w(), B(), B.h(), B.w(), C.get_pointer(), C.h(), C.w() );
    }

    inline void cross_matrix( const KMatrix& b, KMatrix& Bx ) {
        assert_statement( b.size() == 3, "invalid b matrix" );
        Bx.resize( 3, 3 );
        mat_cross_form( b(), 3, Bx.get_pointer(), Bx.size() );
    }

    inline void mat_ABAt( const KMatrix& A, const KMatrix& B,
                          KMatrix& C ) {
        C.resize( A.h(), A.h() );
        mat_ABAt( A(), A.h(), A.w(), B(), B.h(), B.w(), C.get_pointer(), C.size() );
    }

    inline void mat_AtA( const KMatrix& A, KMatrix& U ) {
        mat_trans_mat( A, A, U );
    }

    inline bool mat_inv_3( const KMatrix& A, KMatrix& iA, double inversion_threshold ) {
        assert_statement( A.is_square() && A.h() == 3, "invalid matrix" );
        iA.resize( 3, 3 );
        return mat_inv_3( A(), A.h(), iA.get_pointer(), A.h(), inversion_threshold );
    }

    /// solves the Ax=b by computing the (brute)inverse of the A matrix for 3d
    /// matrices. returns false if inverse computation fails...
    inline bool mat_solve_Ax_b_3( const KMatrix& A, const KMatrix& b, KMatrix& x ) {
        assert_statement( A.is_square() && A.h() == 3, "invalid matrix size" );
        assert_statement( b.size() == 3, "invalid size" );
        x.resize(3,1);
        return mat_solve_Ax_b_3( A(), A.h(), A.w(), b(), b.size(),
                                 x.get_pointer(), x.size() );
    }

    inline void mat_concat_hor( const KMatrix& A, const KMatrix& B, KMatrix& cAB ) {
        assert_statement( A.h() == B.h(), "invalid matrix size" );
        cAB.resize( A.h(), A.w() + B.w() );
        cAB.copy( A, 0, 0, A.h(), A.w(), 0, 0     );
        cAB.copy( B, 0, 0, B.h(), B.w(), 0, A.w() );
    }

    inline void mat_concat_ver( const KMatrix& A, const KMatrix& B, KMatrix& cAB ) {
        assert_statement( A.w() == B.w(), "invalid matrix size" );
        cAB.init( A.h() + B.h(), A.w() );
        cAB.copy( A, 0, 0, A.h(), A.w(),     0, 0 );
        cAB.copy( B, 0, 0, B.h(), B.w(), A.h(), 0 );
    }

    /// decomposes AB so that AB = [A | B];
    inline void mat_deconcat_hor( const KMatrix& AB, KMatrix& A, KMatrix& B ) {
        assert_statement( (AB.h()==A.h()) && (AB.h()==B.h()), "invalid matrix size" );
        assert_statement( AB.w() == A.w() + B.w(), "invalid matrix size" );
        A.copy( AB, 0, 0,     A.h(), A.w(), 0, 0 );
        B.copy( AB, 0, A.w(), B.h(), B.w(), 0, 0 );
    }

    inline double mat_pseudo_inv( const KMatrix& A, KMatrix& iA ) {
        iA.resize( A.w(), A.h() );
        return mat_pseudo_inv( A(), A.h(), A.w(), iA.get_pointer(), iA.h(), iA.w() );
    }

    /// makes matrix symmetric by copying keep_upper [true: upper->lower, false:
    /// lower->upper];
    inline void mat_sym( KMatrix& A, bool keep_upper ) {
        assert_statement( A.is_square(), "matrix need to be symmetric" );
        mat_sym( A.get_pointer(), A.h(), A.w(), keep_upper );
    }

    /// returns the value of the maximum diagonal element
    double diag_max( const KMatrix& A );

    /// retuns max( abs( a_ij ) )
    double abs_max( const KMatrix& A );

    void mat_row_add( const KMatrix& A, int arid, double alpha,
                      const KMatrix& B, int brid, double beta,
                      KMatrix&       C, int crid );

    void mat_Ax_plus_y( const KMatrix& A, const KMatrix& x, const KMatrix& y, KMatrix& c );

    void mat_alpha_Ax_plus_beta_y( const double& alpha, const KMatrix& A, const KMatrix& x,
                                   const double& beta,  const KMatrix& y, KMatrix& c );

    void mat_col_copy( const KMatrix& src, int sc, double alpha, KMatrix& dst, int dc );

    bool rq_givens_decomposition_3( const KMatrix& A, KMatrix& R, KMatrix& Q );

    void initialize( const double* A, int nr, int nc, int lda, KMatrix& mA );
    void initialize( const KMatrix& mA, double* A, int asz );

    inline bool is_equal( const KMatrix& a, const KMatrix& b, const double& eps=1e-12 ) {
        return is_equal( a(), a.h(), a.w(), b(), b.h(), b.w(), eps );
    }
    void row_to_column_order( const KMatrix& A,   KMatrix& A_co );
    void column_to_row_order( const KMatrix& A_co, KMatrix& A   );

    void mat_copy_columns( const KMatrix& A, const vector<int>& cols, KMatrix& fA );

    inline void mat_top_left( const KMatrix& A, int nr, int nc, KMatrix& B ) {
        B.resize(nr,nc);
        B.copy( A, 0, 0, nr, nc, 0, 0 );
    }

    inline void mat_top_right( const KMatrix& A, int nr, int nc, KMatrix& B ) {
        assert_statement( nc <= A.w(), "invalid" );
        B.resize(nr,nc);
        B.copy( A, 0, A.w()-nc, nr, nc, 0, 0 );
    }

    inline void mat_bottom_left( const KMatrix& A, int nr, int nc, KMatrix& B ) {
        assert_statement( nr <= A.h(), "invalid" );
        B.resize(nr,nc);
        B.copy( A, A.h()-nr, 0, nr, nc, 0, 0 );
    }

    inline void mat_bottom_right( const KMatrix& A, int nr, int nc, KMatrix& B ) {
        assert_statement( nr <= A.h(), "invalid" );
        assert_statement( nc <= A.w(), "invalid" );
        B.resize(nr,nc);
        B.copy( A, A.h()-nr, A.w()-nc, nr, nc, 0, 0 );
    }

    /// computes C = inv(A)*B
    inline bool mat_inv_mat( const KMatrix& A, const KMatrix& B, KMatrix& C ) {
        KMatrix Ai;
        if( !mat_inv( A, Ai ) )
            return false;
        mat_mat( Ai, B, C );
        return true;
    }

}

#endif


text:
Randomly generate data, to use with property-based tests

## Installation

Add this line to your application's Gemfile:

    gem 'randomly_generated'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install randomly_generated

## Usage

This is currently a proof of concept, to be used in conjunction with
the rspec-generative gem.

## Contributing

1. Fork it ( https://github.com/[my-github-username]/randomly_generated/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


text:
<?php

namespace Mbpro\BlogBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class MbproBlogBundle extends Bundle
{
}


text:
package com.google.gerrit.entities;

import org.eclipse.jgit.annotations.Nullable;

public class SubmissionId {
  private final String submissionId;

  public SubmissionId(Change.Id changeId, @Nullable String topic) {
    submissionId = topic != null ? String.format("%s-%s", changeId, topic) : changeId.toString();
  }

  public SubmissionId(Change change) {
    this(change.getId(), change.getTopic());
  }

  @Override
  public String toString() {
    return submissionId;
  }
}