text:
/*!
 * @addtogroup AuthDatabase Projects/CoX/Servers/AuthDatabase
 * @{
 */

#include "AuthDBSyncHandler.h"

#include "Messages/AuthDatabase/AuthDBSyncEvents.h"
#include "HandlerLocator.h"
#include "MessageBus.h"

#include <QSqlError> // used to format returned errors
#include <cassert>

using namespace SEGSEvents;

bool AuthDBSyncHandler::per_thread_startup()
{
    AuthDbSyncContext &db_ctx(m_db_context.localData());
    bool result = db_ctx.loadAndConfigure();
    if(!result)
        postGlobalEvent(new ServiceStatusMessage({"AuthDBSync failed to load/configure",-1},0));
    else
        postGlobalEvent(new ServiceStatusMessage({"AuthDBSync loaded/configured",0},0));
    return result;
}

void AuthDBSyncHandler::dispatch(Event *ev)
{
    // We are servicing a request from message queue, using dispatchSync as a common processing point.
    // nullptr result means that the given message is one-way
    switch (ev->type())
    {

        case AuthDBEventTypes::evCreateAccountMessage:
            on_create_account(static_cast<CreateAccountMessage *>(ev));
            break;
        case AuthDBEventTypes::evRetrieveAccountRequest:
            on_retrieve_account(static_cast<RetrieveAccountRequest *>(ev));
            break;
        case AuthDBEventTypes::evValidatePasswordRequest:
            on_validate_password(static_cast<ValidatePasswordRequest *>(ev));
            break;
        default:
            assert(false);
            break;
    }
}

void AuthDBSyncHandler::serialize_from(std::istream &/*is*/)
{
    assert(false);
}

void AuthDBSyncHandler::serialize_to(std::ostream &/*os*/)
{
    assert(false);
}

void AuthDBSyncHandler::on_create_account(CreateAccountMessage *msg)
{
    AuthDbSyncContext &db_ctx(m_db_context.localData());
    if(!db_ctx.addAccount(msg->m_data))
    {
        if(msg->src() != nullptr)
            msg->src()->putq(new AuthDbStatusMessage({db_ctx.getLastError()->text()},msg->session_token()));
    }
    else
    {
        if(msg->src() != nullptr)
            msg->src()->putq(new AuthDbStatusMessage({"OK"},msg->session_token()));
    }
}

void AuthDBSyncHandler::on_retrieve_account(RetrieveAccountRequest *msg)
{
    AuthDbSyncContext &db_ctx(m_db_context.localData());
    RetrieveAccountResponseData resp;

    if(!db_ctx.retrieveAccountAndCheckPassword(msg->m_data, resp))
    {
        resp.mark_as_missing();
    }

    if(db_ctx.getLastError())
        msg->src()->putq(new AuthDbStatusMessage({db_ctx.getLastError()->text()},msg->session_token()));
    else
        msg->src()->putq(new RetrieveAccountResponse(std::move(resp), msg->session_token()));
}

void AuthDBSyncHandler::on_validate_password(ValidatePasswordRequest *msg)
{
    AuthDbSyncContext &db_ctx(m_db_context.localData());
    ValidatePasswordResponseData res;
    if(db_ctx.getPasswordValidity(msg->m_data,res))
    {
        msg->src()->putq(new ValidatePasswordResponse(std::move(res),msg->session_token()));
    }
    msg->src()->putq(new AuthDbStatusMessage({db_ctx.getLastError()->text()},msg->session_token()));
}

AuthDBSyncHandler::AuthDBSyncHandler()
{
    HandlerLocator::setAuthDB_Handler(this);
}

//! @}


text:
<TITLE>Evilwatcher - Monitor domains and hosts attribution</title>

    <link rel="stylesheet" href="assets/stylesheets/styles.css">

<?php
include("db.inc.php");
$conexao = mysql_connect($host,$username,$password);
$db = mysql_select_db($db);
echo "
EvilWatcher - Show all hosts and servers with checks paused

";
$consulta=mysql_query("SELECT * FROM servers where inactive = 0 and pause = 1");
echo "
";
echo "
";
echo "
";
echo "Server	";
echo "DNS Host	";
echo "DNS Target	";
echo "DNS IP Target	";
echo "Inserted	";
echo "Qtd Checks	";
echo "Last Check	";
echo "Scanned	";
echo "Same Host	";
echo "
";
while ($dados = mysql_fetch_array($consulta)) {
	$id = $dados["id"];
	$consulta_dash=mysql_query("SELECT id,dns_host,dns_target,dns_ip_target,dns_timestamp,count,last_check,scanned FROM dns_checks where id_server = $id");
	while ($dados_dash = mysql_fetch_array($consulta_dash)){
		$id_host = $dados_dash["id"];

	        echo "
";
       		echo "".$dados["name"]."	";
		echo "".$dados_dash["dns_host"] ."	";
                echo "".$dados_dash["dns_target"]." 	";
                echo "".$dados_dash["dns_ip_target"]." 	";
                echo "".date('d/m/Y H:i:s',strtotime($dados_dash["dns_timestamp"])) ."	";
                echo "".$dados_dash["count"] ."	";
                echo "".date('d/m/Y H:i:s',strtotime($dados_dash["last_check"])) ."	";

		if ($dados_dash["scanned"] == '0'){
			echo "No 	";
		} else {
            echo "Yes	";
		}
		echo "View all register same host	";
		echo "
";
	}
}
echo "

";
echo "";
?>

redpajama_set_name: RedPajamaGithub


text:
package com.opengamma.master.security;

import org.fudgemsg.FudgeMsg;
import org.fudgemsg.MutableFudgeMsg;
import org.fudgemsg.mapping.FudgeBuilder;
import org.fudgemsg.mapping.FudgeBuilderFor;
import org.fudgemsg.mapping.FudgeDeserializer;
import org.fudgemsg.mapping.FudgeSerializer;

import com.opengamma.util.fudgemsg.AbstractFudgeBuilder;

/**
 * A Fudge builder for {@code RawSecurity}.
 */
@FudgeBuilderFor(RawSecurity.class)
public class RawSecurityFudgeBuilder extends AbstractFudgeBuilder implements FudgeBuilder<RawSecurity> {

  /** Field name. */
  public static final String RAW_DATA_FIELD_NAME = "rawData";

  @Override
  public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final RawSecurity object) {
    final MutableFudgeMsg msg = serializer.newMessage();
    RawSecurityFudgeBuilder.toFudgeMsg(serializer, object, msg);
    return msg;
  }

  public static void toFudgeMsg(final FudgeSerializer serializer, final RawSecurity object, final MutableFudgeMsg msg) {
    ManageableSecurityFudgeBuilder.toFudgeMsg(serializer, object, msg);
    if (object.getRawData().length != 0) {
      addToMessage(msg, RAW_DATA_FIELD_NAME, object.getRawData());
    }
  }

  @Override
  public RawSecurity buildObject(final FudgeDeserializer deserializer, final FudgeMsg msg) {
    final RawSecurity object = new RawSecurity(msg.getString(ManageableSecurityFudgeBuilder.SECURITY_TYPE_FIELD_NAME));
    RawSecurityFudgeBuilder.fromFudgeMsg(deserializer, msg, object);
    return object;
  }

  public static void fromFudgeMsg(final FudgeDeserializer deserializer, final FudgeMsg msg, final RawSecurity object) {
    ManageableSecurityFudgeBuilder.fromFudgeMsg(deserializer, msg, object);
    if (msg.hasField(RAW_DATA_FIELD_NAME)) {
      object.setRawData(msg.getValue(byte[].class, RAW_DATA_FIELD_NAME));
    }
  }

}


text:
module.exports = Object.freeze({
    dev: {db: "mongodb://localhost/dippa"},
    staging: {db: "mongodb://localhost/dippa_staging"},
    test: {db: "mongodb://localhost/dippa_test"}
});


text:
<!DOCTYPE html>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title><div> with role tablist; inherited supported state or property "aria-expanded" value
         of "false"
      </title>

obj1

obj2


text:
call activate %CONDA_ENV%

@rem Ensure that the documentation builds without warnings
if "%BUILD_DOC%" == "yes" python setup.py build_doc
@rem Run system info tool
pushd bin
numba -s
popd

@rem switch off color messages
set NUMBA_DISABLE_ERROR_MESSAGE_HIGHLIGHTING=1
@rem switch on developer mode
set NUMBA_DEVELOPER_MODE=1
@rem enable the faulthandler
set PYTHONFAULTHANDLER=1
@rem enable new style error handling
set NUMBA_CAPTURED_ERRORS=new_style

@rem First check that the test discovery works
python -m numba.tests.test_runtests
@rem Now run the Numba test suite
@rem Note that coverage is run from the checkout dir to match the "source"
@rem directive in .coveragerc
if "%RUN_COVERAGE%" == "yes" (
    set PYTHONPATH=.
    coverage erase
    coverage run runtests.py -b --exclude-tags='long_running' -m -- numba.tests
) else (
    set NUMBA_ENABLE_CUDASIM=1
    python -m numba.runtests -b --exclude-tags='long_running' -m -- numba.tests
)

if %errorlevel% neq 0 exit /b %errorlevel%


text:
using Serilog.Events;

namespace Umbraco.Cms.Infrastructure.Logging.Viewer
{
    public class SerilogExpressionsFunctions
    {
        // This Has() code is the same as the renamed IsDefined() function
        // Added this to help backport and ensure saved queries continue to work if using Has()
        public static LogEventPropertyValue? Has(LogEventPropertyValue? value)
        {
            return new ScalarValue(value != null);
        }
    }
}


text:
require 'silver_lining'

module Vcloud
  module Format
    class TasksList < Formatter

      attr_accessor :tasks_list_id

      def initialize(tasks_list_id)
        @tasks_list_id = tasks_list_id
      end

      def resource
        "tasksList/#{tasks_list_id}"
      end
    end
  end
end


text:
{lang}navbutton_products{lang}

{lang}sidebar_nav_online_merchant{lang}

{lang}sidebar_nav_apps_marketplace{lang}

{lang}sidebar_nav_documentation{lang}

{lang}sidebar_nav_bug_reports{lang}

{lang}sidebar_nav_live_shops{lang}

{lang}sidebar_nav_online_demo{lang}


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/base.xml"/>
    <logger name="org.springframework.web" level="INFO"/>
    <springProfile name="default">
        <logger name="com.yqboots" level="DEBUG"/>
    </springProfile>
    <springProfile name="prd">
        <logger name="com.yqboots" level="ERROR"/>
    </springProfile>
</configuration>


text:
<?php
/**
 * Spiral Framework, IDE Helper
 *
 * @author    Dmitry Mironov <dmitry.mironov@spiralscout.com>
 * @licence   MIT
 */

namespace Spiral\IdeHelper\Locators;

use Spiral\IdeHelper\Model\ClassDefinition;

/**
 * Interface LocatorInterface
 *
 * @package Spiral\IdeHelper\Locators
 */
interface LocatorInterface
{
    /**
     * @return ClassDefinition[]
     */
    public function locate(): array;
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.apache.hadoop.yarn.webapp.hamlet.HamletImpl.EImp (hadoop-yarn-common 2.3.0 API)
</TITLE>

<META NAME="date" CONTENT="2015-03-06">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.hadoop.yarn.webapp.hamlet.HamletImpl.EImp

Packages that use HamletImpl.EImp

org.apache.hadoop.yarn.webapp.hamlet

Uses of HamletImpl.EImp in org.apache.hadoop.yarn.webapp.hamlet

Subclasses of HamletImpl.EImp in org.apache.hadoop.yarn.webapp.hamlet

 class
Hamlet.A<T extends HamletSpec._>

 class
Hamlet.ABBR<T extends HamletSpec._>

 class
Hamlet.ACRONYM<T extends HamletSpec._>

 class
Hamlet.ADDRESS<T extends HamletSpec._>

 class
Hamlet.AREA<T extends HamletSpec._>

 class
Hamlet.B<T extends HamletSpec._>

 class
Hamlet.BASE<T extends HamletSpec._>

 class
Hamlet.BDO<T extends HamletSpec._>

 class
Hamlet.BLOCKQUOTE<T extends HamletSpec._>

 class
Hamlet.BODY<T extends HamletSpec._>

 class
Hamlet.BR<T extends HamletSpec._>

 class
Hamlet.BUTTON<T extends HamletSpec._>

 class
Hamlet.CAPTION<T extends HamletSpec._>

 class
Hamlet.CITE<T extends HamletSpec._>

 class
Hamlet.CODE<T extends HamletSpec._>

 class
Hamlet.COL<T extends HamletSpec._>

 class
Hamlet.COLGROUP<T extends HamletSpec._>

 class
Hamlet.DD<T extends HamletSpec._>

 class
Hamlet.DEL<T extends HamletSpec._>

 class
Hamlet.DFN<T extends HamletSpec._>

 class
Hamlet.DIV<T extends HamletSpec._>

 class
Hamlet.DL<T extends HamletSpec._>

 class
Hamlet.DT<T extends HamletSpec._>

 class
Hamlet.EM<T extends HamletSpec._>

 class
Hamlet.FIELDSET<T extends HamletSpec._>

 class
Hamlet.FORM<T extends HamletSpec._>

 class
Hamlet.H1<T extends HamletSpec._>

 class
Hamlet.H2<T extends HamletSpec._>

 class
Hamlet.H3<T extends HamletSpec._>

 class
Hamlet.H4<T extends HamletSpec._>

 class
Hamlet.H5<T extends HamletSpec._>

 class
Hamlet.H6<T extends HamletSpec._>

 class
Hamlet.HEAD<T extends HamletSpec._>

 class
Hamlet.HR<T extends HamletSpec._>

 class
Hamlet.HTML<T extends HamletSpec._>

 class
Hamlet.I<T extends HamletSpec._>

 class
Hamlet.IMG<T extends HamletSpec._>

 class
Hamlet.INPUT<T extends HamletSpec._>

 class
Hamlet.INS<T extends HamletSpec._>

 class
Hamlet.KBD<T extends HamletSpec._>

 class
Hamlet.LABEL<T extends HamletSpec._>

 class
Hamlet.LEGEND<T extends HamletSpec._>

 class
Hamlet.LI<T extends HamletSpec._>

 class
Hamlet.LINK<T extends HamletSpec._>

 class
Hamlet.MAP<T extends HamletSpec._>

 class
Hamlet.META<T extends HamletSpec._>

 class
Hamlet.OBJECT<T extends HamletSpec._>

 class
Hamlet.OL<T extends HamletSpec._>

 class
Hamlet.OPTGROUP<T extends HamletSpec._>

 class
Hamlet.OPTION<T extends HamletSpec._>

 class
Hamlet.P<T extends HamletSpec._>

 class
Hamlet.PARAM<T extends HamletSpec._>

 class
Hamlet.PRE<T extends HamletSpec._>

 class
Hamlet.Q<T extends HamletSpec._>

 class
Hamlet.SAMP<T extends HamletSpec._>

 class
Hamlet.SCRIPT<T extends HamletSpec._>

 class
Hamlet.SELECT<T extends HamletSpec._>

 class
Hamlet.SMALL<T extends HamletSpec._>

 class
Hamlet.SPAN<T extends HamletSpec._>

 class
Hamlet.STRONG<T extends HamletSpec._>

 class
Hamlet.STYLE<T extends HamletSpec._>

 class
Hamlet.SUB<T extends HamletSpec._>

 class
Hamlet.SUP<T extends HamletSpec._>

 class
Hamlet.TABLE<T extends HamletSpec._>

 class
Hamlet.TBODY<T extends HamletSpec._>

 class
Hamlet.TD<T extends HamletSpec._>

 class
Hamlet.TEXTAREA<T extends HamletSpec._>

 class
Hamlet.TFOOT<T extends HamletSpec._>

 class
Hamlet.TH<T extends HamletSpec._>

 class
Hamlet.THEAD<T extends HamletSpec._>

 class
Hamlet.TITLE<T extends HamletSpec._>

 class
Hamlet.TR<T extends HamletSpec._>

 class
Hamlet.UL<T extends HamletSpec._>

 class
Hamlet.VAR<T extends HamletSpec._>

 class
HamletImpl.Generic<T extends HamletSpec._>

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2015 Apache Software Foundation. All Rights Reserved.


text:
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
import {TestBed} from '@angular/core/testing';
import {HttpClient} from '@angular/common/http';

import {User} from './user';
import {UserListService} from './user-list.service';

describe('User list service: ', () => {
  // A small collection of test users
  const testUsers: User[] = [
    {
      _id: 'chris_id',
      name: 'Chris',
      age: 25,
      company: 'UMM',
      email: 'chris@this.that'
    },
    {
      _id: 'pat_id',
      name: 'Pat',
      age: 37,
      company: 'IBM',
      email: 'pat@something.com'
    },
    {
      _id: 'jamie_id',
      name: 'Jamie',
      age: 37,
      company: 'Frogs, Inc.',
      email: 'jamie@frogs.com'
    }
  ];
  const mUsers: User[] = testUsers.filter(user =>
    user.company.toLowerCase().indexOf('m') !== -1
  );

  // We will need some url information from the userListService to meaningfully test company filtering;
  // https://stackoverflow.com/questions/35987055/how-to-write-unit-testing-for-angular-2-typescript-for-private-methods-with-ja
  let userListService: UserListService;
  let currentlyImpossibleToGenerateSearchUserUrl: string;

  // These are used to mock the HTTP requests so that we (a) don't have to
  // have the server running and (b) we can check exactly which HTTP
  // requests were made to ensure that we're making the correct requests.
  let httpClient: HttpClient;
  let httpTestingController: HttpTestingController;

  beforeEach(() => {
    // Set up the mock handling of the HTTP requests
    TestBed.configureTestingModule({
      imports: [HttpClientTestingModule]
    });
    httpClient = TestBed.get(HttpClient);
    httpTestingController = TestBed.get(HttpTestingController);
    // Construct an instance of the service with the mock
    // HTTP client.
    userListService = new UserListService(httpClient);
  });

  afterEach(() => {
    // After every test, assert that there are no more pending requests.
    httpTestingController.verify();
  });

  it('getUsers() calls api/users', () => {
    // Assert that the users we get from this call to getUsers()
    // should be our set of test users. Because we're subscribing
    // to the result of getUsers(), this won't actually get
    // checked until the mocked HTTP request "returns" a response.
    // This happens when we call req.flush(testUsers) a few lines
    // down.
    userListService.getUsers().subscribe(
      users => expect(users).toBe(testUsers)
    );

    // Specify that (exactly) one request will be made to the specified URL.
    const req = httpTestingController.expectOne(userListService.baseUrl);
    // Check that the request made to that URL was a GET request.
    expect(req.request.method).toEqual('GET');
    // Specify the content of the response to that request. This
    // triggers the subscribe above, which leads to that check
    // actually being performed.
    req.flush(testUsers);
  });

  it('getUsers(userCompany) adds appropriate param string to called URL', () => {
    userListService.getUsers('m').subscribe(
      users => expect(users).toEqual(mUsers)
    );

    const req = httpTestingController.expectOne(userListService.baseUrl + '?company=m&');
    expect(req.request.method).toEqual('GET');
    req.flush(mUsers);
  });

  it('filterByCompany(userCompany) deals appropriately with a URL that already had a company', () => {
    currentlyImpossibleToGenerateSearchUserUrl = userListService.baseUrl + '?company=f&something=k&';
    userListService['userUrl'] = currentlyImpossibleToGenerateSearchUserUrl;
    userListService.filterByCompany('m');
    expect(userListService['userUrl']).toEqual(userListService.baseUrl + '?something=k&company=m&');
  });

  it('filterByCompany(userCompany) deals appropriately with a URL that already had some filtering, but no company', () => {
    currentlyImpossibleToGenerateSearchUserUrl = userListService.baseUrl + '?something=k&';
    userListService['userUrl'] = currentlyImpossibleToGenerateSearchUserUrl;
    userListService.filterByCompany('m');
    expect(userListService['userUrl']).toEqual(userListService.baseUrl + '?something=k&company=m&');
  });

  it('filterByCompany(userCompany) deals appropriately with a URL has the keyword company, but nothing after the =', () => {
    currentlyImpossibleToGenerateSearchUserUrl = userListService.baseUrl + '?company=&';
    userListService['userUrl'] = currentlyImpossibleToGenerateSearchUserUrl;
    userListService.filterByCompany('');
    expect(userListService['userUrl']).toEqual(userListService.baseUrl + '');
  });

  it('getUserById() calls api/users/id', () => {
    const targetUser: User = testUsers[1];
    const targetId: string = targetUser._id;
    userListService.getUserById(targetId).subscribe(
      user => expect(user).toBe(targetUser)
    );

    const expectedUrl: string = userListService.baseUrl + '/' + targetId;
    const req = httpTestingController.expectOne(expectedUrl);
    expect(req.request.method).toEqual('GET');
    req.flush(targetUser);
  });

  it('user list filters by name', () => {
    expect(testUsers.length).toBe(3);
    let userName = 'a';
    expect(userListService.filterUsers(testUsers, userName, null).length).toBe(2);
  });

  it('user list filters by age', () => {
    expect(testUsers.length).toBe(3);
    let userAge = 37;
    expect(userListService.filterUsers(testUsers, null, userAge).length).toBe(2);
  });

  it('user list filters by name and age', () => {
    expect(testUsers.length).toBe(3);
    let userAge = 37;
    let userName = 'i';
    expect(userListService.filterUsers(testUsers, userName, userAge).length).toBe(1);
  });

  it('contains a user named \'Chris\'', () => {
    expect(testUsers.some((user: User) => user.name === 'Chris')).toBe(true);
  });

  it('contain a user named \'Jamie\'', () => {
    expect(testUsers.some((user: User) => user.name === 'Jamie')).toBe(true);
  });

  it('doesn\'t contain a user named \'Santa\'', () => {
    expect(testUsers.some((user: User) => user.name === 'Santa')).toBe(false);
  });

  it('has two users that are 37 years old', () => {
    expect(testUsers.filter((user: User) => user.age === 37).length).toBe(2);
  });

  it('contains all the users', () => {
    expect(testUsers.length).toBe(3);
  });

  it('adding a user calls api/users/new', () => {
    const jesse_id = 'jesse_id';
    const newUser: User = {
      _id: '',
      name: 'Jesse',
      age: 72,
      company: 'Smithsonian',
      email: 'jesse@stuff.com'
    };

    userListService.addNewUser(newUser).subscribe(
      id => {
        expect(id).toBe(jesse_id);
      }
    );

    const expectedUrl: string = userListService.baseUrl + '/new';
    const req = httpTestingController.expectOne(expectedUrl);
    expect(req.request.method).toEqual('POST');
    req.flush(jesse_id);
  });

});


text:
/* Generated By:JJTree: Do not edit this line. OAlias.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.orientechnologies.orient.core.sql.parser;

import java.util.Map;

public
class OAlias extends SimpleNode {
  public OAlias(int id) {
    super(id);
  }

  public OAlias(OrientSql p, int id) {
    super(p, id);
  }

  /** Accept the visitor. **/
  public Object jjtAccept(OrientSqlVisitor visitor, Object data) {
    return visitor.visit(this, data);
  }

  public void toString(Map<Object, Object> params, StringBuilder builder) {

  }
}
/* JavaCC - OriginalChecksum=c0c2ff315abe152a8ea5f2ecafd0f853 (do not edit this line) */


text:
<?php

class Horde_Text_Diff_Op_Delete extends Horde_Text_Diff_Op_Base
{
    public function __construct($lines)
    {
        $this->orig = $lines;
        $this->final = false;
    }

    public function reverse()
    {
        return new Horde_Text_Diff_Op_Add($this->orig);
    }
}


text:
import {Directive, HostListener, Input} from 'angular2/core';

@Directive({
    selector: '[myTooltip]',
    host: {
        '(mouseover)': 'show()'
    }
})
export class TooltipDirective {
    @Input('myTooltip') text: string;

    show() {
        alert(this.text);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="64dp"
    android:height="64dp"
    android:viewportHeight="256"
    android:viewportWidth="256">

    <group
        android:name="shape_layer_1"
        android:translateX="128"
        android:translateY="128">
        <group android:name="sun">
            <group
                android:name="earth"
                android:translateX="75">
                <group
                    android:name="moon"
                    android:translateX="25">
                    <path
                        android:name="ellipse_path_1_2"
                        android:fillColor="#ffadadad"
                        android:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0" />
                </group>

                <path
                    android:name="ellipse_path_1_1"
                    android:fillColor="#ff5656ea"
                    android:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0" />
            </group>

            <path
                android:name="ellipse_path_1"
                android:fillColor="#ffff8000"
                android:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0" />
        </group>
    </group>

</vector>


text:
module Sunspot
  module Query
    class Scope < Connective::Conjunction
      def to_params
        { :fq => @components.map { |component| component.to_filter_query }}
      end
    end
  end
end


text:
package main

import (
        "encoding/json"
        "errors"
        "fmt"
        "strconv"
        "strings"
        "time"

        "github.com/hyperledger/fabric/core/chaincode/shim"
)

// SimpleChaincode example simple Chaincode implementation
type SimpleChaincode struct {
}

var assetIndexStr = "_assetindex" //Description for the key/value that will store a list of all known Assets
var openTradesStr = "_opentrades" //Description for the key/value that will store all open trades

type Asset struct {
        Description     string `json:"description"` //the fieldtags are needed to keep case from bouncing around
        LastTransaction string `json:"lastTransaction"`
        Temperature     int    `json:"temperature"`
        Status          bool   `json:"status"`
        ID              int    `json:"id"`
        User            string `json:"user"`
}

type Description struct {
        LastTransaction string `json:"lastTransaction"`
        ID              int    `json:"id"`
}

type AnOpenTrade struct {
        User      string        `json:"user"`      //user who created the open trade order
        Timestamp int64         `json:"timestamp"` //utc timestamp of creation
        Want      Description   `json:"want"`      //description of desired Asset
        Willing   []Description `json:"willing"`   //array of Assets willing to trade away
}

type AllTrades struct {
        OpenTrades []AnOpenTrade `json:"open_trades"`
}

// ===========================================================================================================                                                                                =================
// Main
// ===========================================================================================================                                                                                =================
func main() {
        err := shim.Start(new(SimpleChaincode))
        if err != nil {
                fmt.Printf("Error starting Simple chaincode: %s", err)
        }
}

// ===========================================================================================================                                                                                =================
// Init - reset all the things
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
        var Aval int
        var err error

        if len(args) != 1 {
                return nil, errors.New("Incorrect number of arguments. Expecting 1")
        }

        // Initialize the chaincode
        Aval, err = strconv.Atoi(args[0])
        if err != nil {
                return nil, errors.New("Expecting integer value for asset holding")
        }

        // Write the state to the ledger
        err = stub.PutState("abc", []byte(strconv.Itoa(Aval))) //making a test var "abc", I find it handy to read/write to it right away to test the network
        if err != nil {
                return nil, err
        }

        var empty []string
        jsonAsBytes, _ := json.Marshal(empty) //marshal an emtpy array of strings to clear the index
        err = stub.PutState(assetIndexStr, jsonAsBytes)
        if err != nil {
                return nil, err
        }

        var trades AllTrades
        jsonAsBytes, _ = json.Marshal(trades) //clear the open trade struct
        err = stub.PutState(openTradesStr, jsonAsBytes)
        if err != nil {
                return nil, err
        }

        return nil, nil
}

// ===========================================================================================================                                                                                =================
// Run - Our entry point for Invocations - [LEGACY] obc-peer 4/25/2016
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) Run(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
        fmt.Println("run is running " + function)
        return t.Invoke(stub, function, args)
}

// ===========================================================================================================                                                                                =================
// Invoke - Our entry point for Invocations
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
        fmt.Println("invoke is running " + function)

        // Handle different functions
        if function == "init" { //initialize the chaincode state, used as reset
                return t.Init(stub, "init", args)
        } else if function == "delete" { //deletes an entity from its state
                res, err := t.Delete(stub, args)
                cleanTrades(stub) //lets make sure all open trades are still valid
                return res, err
        } else if function == "write" { //writes a value to the chaincode state
                return t.Write(stub, args)
        } else if function == "init_asset" { //create a new Asset
                return t.init_Asset(stub, args)
        } else if function == "set_user" { //change owner of a Asset
                res, err := t.set_user(stub, args)
                cleanTrades(stub) //lets make sure all open trades are still valid
                return res, err
        } else if function == "open_trade" { //create a new trade order
                return t.open_trade(stub, args)
        } else if function == "perform_trade" { //forfill an open trade order
                res, err := t.perform_trade(stub, args)
                cleanTrades(stub) //lets clean just in case
                return res, err
        } else if function == "remove_trade" { //cancel an open trade order
                return t.remove_trade(stub, args)
        }
        fmt.Println("invoke did not find func: " + function) //error

        return nil, errors.New("Received unknown function invocation")
}

// ===========================================================================================================                                                                                =================
// Query - Our entry point for Queries
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
        fmt.Println("query is running " + function)

        // Handle different functions
        if function == "read" { //read a variable
                return t.read(stub, args)
        }
        fmt.Println("query did not find func: " + function) //error

        return nil, errors.New("Received unknown function query")
}

// ===========================================================================================================                                                                                =================
// Read - read a variable from chaincode state
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) read(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        var Description, jsonResp string
        var err error

        if len(args) != 1 {
                return nil, errors.New("Incorrect number of arguments. Expecting Description of the var to query")
        }

        Description = args[0]
        fmt.Print("Description " + Description)
        valAsbytes, err := stub.GetState(Description) //get the var from chaincode state
        if err != nil {
                jsonResp = "{\"Error\":\"Failed to get state for " + Description + "\"}"
                return nil, errors.New(jsonResp)
        }

        var infoIndex []string
        json.Unmarshal(valAsbytes, &infoIndex)

        for i, val := range infoIndex {
                fmt.Println("got: " + infoIndex[i] + " " + val)
        }

        return valAsbytes, nil //send it onward
}

// ===========================================================================================================                                                                                =================
// Delete - remove a key/value pair from state
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) Delete(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        if len(args) != 1 {
                return nil, errors.New("Incorrect number of arguments. Expecting 1")
        }

        Description := args[0]
        err := stub.DelState(Description) //remove the key from chaincode state
        if err != nil {
                return nil, errors.New("Failed to delete state")
        }

        //get the Asset index
        AssetsAsBytes, err := stub.GetState(assetIndexStr)
        if err != nil {
                return nil, errors.New("Failed to get Asset index")
        }
        var AssetIndex []string
        json.Unmarshal(AssetsAsBytes, &AssetIndex) //un stringify it aka JSON.parse()

        //remove Asset from index
        for i, val := range AssetIndex {
                fmt.Println(strconv.Itoa(i) + " - looking at " + val + " for " + Description)
                if val == Description { //find the correct Asset
                        fmt.Println("found Asset")
                        AssetIndex = append(AssetIndex[:i], AssetIndex[i+1:]...) //remove it
                        for x := range AssetIndex {                              //debug prints...
                                fmt.Println(string(x) + " - " + AssetIndex[x])
                        }
                        break
                }
        }
        jsonAsBytes, _ := json.Marshal(AssetIndex) //save new index
        err = stub.PutState(assetIndexStr, jsonAsBytes)
        return nil, nil
}

// ===========================================================================================================                                                                                =================
// Write - write variable into chaincode state
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) Write(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        var description, value string // Entities
        var err error
        fmt.Println("running write()")

        if len(args) != 2 {
                return nil, errors.New("Incorrect number of arguments. Expecting 2. Description of the variable and value to set")
        }

        description = args[0] //reDescription for funsies
        value = args[1]
        err = stub.PutState(description, []byte(value)) //write the variable into the chaincode state
        if err != nil {
                return nil, err
        }
        return nil, nil
}

// ===========================================================================================================                                                                                =================
// Init Asset - create a new Asset, store into chaincode state
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) init_Asset(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        var err error

        //   0       1       2     3
        // "asdf", "blue", "35", "bob"
        if len(args) != 5 {
                fmt.Println("- Incorrect number of arguments. Expecting 5")
                return nil, errors.New("Incorrect number of arguments. Expecting 5")
        }

        //input sanitation
        fmt.Println("- start init Asset")
        if len(args[0]) <= 0 {
                return nil, errors.New("1st argument must be a non-empty string")
        }
        if len(args[1]) <= 0 {
                return nil, errors.New("2nd argument must be a non-empty string")
        }
        if len(args[2]) <= 0 {
                return nil, errors.New("3rd argument must be a non-empty string")
        }
        if len(args[3]) <= 0 {
                return nil, errors.New("4th argument must be a non-empty string")
        }
        if len(args[4]) <= 0 {
                return nil, errors.New("5th argument must be a non-empty string")
        }

        //fmt.Print("Assigning first values...")
        description := args[0]
        lastTransaction := strings.ToLower(args[1])
        user := strings.ToLower(args[2])
        temperature := strings.ToLower(args[3])
        id := strings.ToLower(args[4])
        status := strings.ToLower("false")

        //check if Asset already exists
        AssetAsBytes, err := stub.GetState(description)
        if err != nil {
                fmt.Println("Failed to get Asset Description")
                return nil, errors.New("Failed to get Asset Description")
        }
        res := Asset{}
        json.Unmarshal(AssetAsBytes, &res)
        if res.Description == description {
                fmt.Println("This Asset arleady exists: " + description)
                fmt.Println(res)
                return nil, errors.New("This Asset already exists") //all stop a Asset by this Description exists
        }

        //build the Asset json string manually
        str := `{"description": "` + description + `", "lastTransaction": "` + lastTransaction + `", "temperature": "` + temperature + `", "status": "` + status + `", "id": "` + id + `", "user": "` + user + `"}`
        err = stub.PutState(description, []byte(str)) //store Asset with id as key
        if err != nil {
                fmt.Println("error [init_asset] str.PutState! ")
                return nil, err
        }

        //get the Asset index
        AssetsAsBytes, err := stub.GetState(assetIndexStr)
        if err != nil {
                return nil, errors.New("Failed to get Asset index")
        }
        var AssetIndex []string
        json.Unmarshal(AssetsAsBytes, &AssetIndex) //un stringify it aka JSON.parse()

        //append
        AssetIndex = append(AssetIndex, description) //add Asset Description to index list
        fmt.Println("! Asset index: ", AssetIndex)
        jsonAsBytes, _ := json.Marshal(AssetIndex)
        err = stub.PutState(assetIndexStr, jsonAsBytes) //store Description of Asset

        fmt.Println("- end init Asset")
        return nil, nil
}

// ===========================================================================================================                                                                                =================
// Set User Permission on Asset
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) set_user(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        var err error

        //   0       1
        // "Description", "bob"
        if len(args) < 3 {
                return nil, errors.New("Incorrect number of arguments. Expecting 2")
        }

        fmt.Println("- start set user")
        fmt.Println(args[0] + " - " + args[1] + " - " + args[2])
        AssetAsBytes, err := stub.GetState(args[0])
        if err != nil {
                return nil, errors.New("Failed to get thing")
        }

        res := Asset{}
        json.Unmarshal(AssetAsBytes, &res) //un stringify it aka JSON.parse()
        temp, err := strconv.Atoi(args[2])
        if err != nil {
                msg := "Temperature needs to be a numeric string " + args[2]
                fmt.Println(msg)
                return nil, errors.New(msg)
        }

        fmt.Println("Current temperature " + strconv.Itoa(temp))
        if temp > 24 {
                fmt.Println("[Smart Contract] Asset need to be verified " + strconv.Itoa(temp))
                res.Status = true
        } else {
                fmt.Println("[Smart Contract] Satisfied! " + strconv.Itoa(temp))
                tmp, err := strconv.Atoi(args[2])
                if err != nil {
                        msg := "Temperature needs to be a numeric string " + args[2]
                        fmt.Println(msg)
                        return nil, errors.New(msg)
                }

                res.Status = false
                res.Temperature = tmp
                res.User = args[1] //change the user

                jsonAsBytes, _ := json.Marshal(res)
                err = stub.PutState(args[0], jsonAsBytes) //rewrite the Asset with id as key
                if err != nil {
                        return nil, err
                }

                fmt.Println("- end set user")
                return nil, nil
        }

        jsonAsBytes, _ := json.Marshal(res)
        err = stub.PutState(args[0], jsonAsBytes) //rewrite the Asset with id as key
        if err != nil {
                return nil, err
        }

        fmt.Println("- infraction applied to the ledger state")
        return nil, nil
}

// ===========================================================================================================                                                                                =================
// Open Trade - create an open trade for a Asset you want with Assets you have
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) open_trade(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        var err error
        var will_id int
        var trade_away Description

        //      0        1      2     3      4      5       6
        //["bob", "blue", "16", "red", "16"] *"blue", "35*
        if len(args) < 5 {
                return nil, errors.New("Incorrect number of arguments. Expecting like 5?")
        }
        if len(args)%2 == 0 {
                return nil, errors.New("Incorrect number of arguments. Expecting an odd number")
        }

        id, err := strconv.Atoi(args[2])
        if err != nil {
                return nil, errors.New("3rd argument must be a numeric string")
        }

        open := AnOpenTrade{}
        open.User = args[0]
        open.Timestamp = makeTimestamp() //use timestamp as an ID
        open.Want.LastTransaction = args[1]
        open.Want.ID = id
        fmt.Println("- start open trade")
        jsonAsBytes, _ := json.Marshal(open)
        err = stub.PutState("_debug1", jsonAsBytes)

        for i := 3; i < len(args); i++ { //create and append each willing trade
                will_id, err = strconv.Atoi(args[i+1])
                if err != nil {
                        msg := "is not a numeric string " + args[i+1]
                        fmt.Println(msg)
                        return nil, errors.New(msg)
                }

                trade_away = Description{}
                trade_away.LastTransaction = args[i]
                trade_away.ID = will_id
                fmt.Println("! created trade_away: " + args[i])
                jsonAsBytes, _ = json.Marshal(trade_away)
                err = stub.PutState("_debug2", jsonAsBytes)

                open.Willing = append(open.Willing, trade_away)
                fmt.Println("! appended willing to open")
                i++
        }

        //get the open trade struct
        tradesAsBytes, err := stub.GetState(openTradesStr)
        if err != nil {
                return nil, errors.New("Failed to get opentrades")
        }
        var trades AllTrades
        json.Unmarshal(tradesAsBytes, &trades) //un stringify it aka JSON.parse()

        trades.OpenTrades = append(trades.OpenTrades, open) //append to open trades
        fmt.Println("! appended open to trades")
        jsonAsBytes, _ = json.Marshal(trades)
        err = stub.PutState(openTradesStr, jsonAsBytes) //rewrite open orders
        if err != nil {
                return nil, err
        }
        fmt.Println("- end open trade")
        return nil, nil
}

// ===========================================================================================================                                                                                =================
// Perform Trade - close an open trade and move ownership
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) perform_trade(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        var err error

        //      0               1                                       2                                    3                                                                                4                                       5
        //[data.id, data.closer.user, data.closer.Description, data.opener.user, data.opener.LastTransaction,                                                                                data.opener.Weight]
        if len(args) < 6 {
                return nil, errors.New("Incorrect number of arguments. Expecting 6")
        }

        fmt.Println("- start close trade")
        timestamp, err := strconv.ParseInt(args[0], 10, 64)
        if err != nil {
                return nil, errors.New("1st argument must be a numeric string")
        }

        id, err := strconv.Atoi(args[5])
        if err != nil {
                return nil, errors.New("6th argument must be a numeric string")
        }

        //get the open trade struct
        tradesAsBytes, err := stub.GetState(openTradesStr)
        if err != nil {
                return nil, errors.New("Failed to get opentrades")
        }
        var trades AllTrades
        json.Unmarshal(tradesAsBytes, &trades) //un stringify it aka JSON.parse()

        for i := range trades.OpenTrades { //look for the trade
                fmt.Println("looking at " + strconv.FormatInt(trades.OpenTrades[i].Timestamp, 10) + " for " + strconv.FormatInt(timestamp, 10))
                if trades.OpenTrades[i].Timestamp == timestamp {
                        fmt.Println("found the trade")

                        AssetAsBytes, err := stub.GetState(args[2])
                        if err != nil {
                                return nil, errors.New("Failed to get thing")
                        }
                        closersAsset := Asset{}
                        json.Unmarshal(AssetAsBytes, &closersAsset) //un stringify it aka JSON.parse()

                        //verify if Asset meets trade requirements
                        if closersAsset.LastTransaction != trades.OpenTrades[i].Want.LastTransaction || closersAsset.ID != trades.OpenTrades[i].Want.ID {
                                msg := "Asset in input does not meet trade requriements"
                                fmt.Println(msg)
                                return nil, errors.New(msg)
                        }

                        Asset, e := findAsset4Trade(stub, trades.OpenTrades[i].User, args[4], id) //find a Ass                                                                                et that is suitable from opener
                        if e == nil {
                                fmt.Println("! no errors, proceeding")

                                t.set_user(stub, []string{args[2], trades.OpenTrades[i].User}) //change owner                                                                                of selected Asset, closer -> opener
                                t.set_user(stub, []string{Asset.Description, args[1]})         //change owner                                                                                of selected Asset, opener -> closer

                                trades.OpenTrades = append(trades.OpenTrades[:i], trades.OpenTrades[i+1:]...)                                                                                //remove trade
                                jsonAsBytes, _ := json.Marshal(trades)
                                err = stub.PutState(openTradesStr, jsonAsBytes) //rewrite open orders
                                if err != nil {
                                        return nil, err
                                }
                        }
                }
        }
        fmt.Println("- end close trade")
        return nil, nil
}

// ===========================================================================================================                                                                                =================
// findAsset4Trade - look for a matching Asset that this user owns and return it
// ===========================================================================================================                                                                                =================
func findAsset4Trade(stub shim.ChaincodeStubInterface, user string, LastTransaction string, id int) (m Asset, err error) {
        var fail Asset
        fmt.Println("- start find Asset 4 trade")
        fmt.Println("looking for " + user + ", " + LastTransaction + ", " + strconv.Itoa(id))

        //get the Asset index
        AssetsAsBytes, err := stub.GetState(assetIndexStr)
        if err != nil {
                return fail, errors.New("Failed to get Asset index")
        }
        var AssetIndex []string
        json.Unmarshal(AssetsAsBytes, &AssetIndex) //un stringify it aka JSON.parse()

        for i := range AssetIndex { //iter through all the Assets
                //fmt.Println("looking @ Asset Description: " + AssetIndex[i]);

                AssetAsBytes, err := stub.GetState(AssetIndex[i]) //grab this Asset
                if err != nil {
                        return fail, errors.New("Failed to get Asset")
                }
                res := Asset{}
                json.Unmarshal(AssetAsBytes, &res) //un stringify it aka JSON.parse()
                //fmt.Println("looking @ " + res.User + ", " + res.LastTransaction + ", " + strconv.Itoa(res.W                                                                                eight));

                //check for user && LastTransaction && Weight
                if strings.ToLower(res.User) == strings.ToLower(user) && strings.ToLower(res.LastTransaction) == strings.ToLower(LastTransaction) && res.ID == id {
                        fmt.Println("found a Asset: " + res.Description)
                        fmt.Println("! end find Asset 4 trade")
                        return res, nil
                }
        }

        fmt.Println("- end find Asset 4 trade - error")
        return fail, errors.New("Did not find Asset to use in this trade")
}

// ===========================================================================================================                                                                                =================
// Make Timestamp - create a timestamp in ms
// ===========================================================================================================                                                                                =================
func makeTimestamp() int64 {
        return time.Now().UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
}

// ===========================================================================================================                                                                                =================
// Remove Open Trade - close an open trade
// ===========================================================================================================                                                                                =================
func (t *SimpleChaincode) remove_trade(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {
        var err error

        //      0
        //[data.id]
        if len(args) < 1 {
                return nil, errors.New("Incorrect number of arguments. Expecting 1")
        }

        fmt.Println("- start remove trade")
        timestamp, err := strconv.ParseInt(args[0], 10, 64)
        if err != nil {
                return nil, errors.New("1st argument must be a numeric string")
        }

        //get the open trade struct
        tradesAsBytes, err := stub.GetState(openTradesStr)
        if err != nil {
                return nil, errors.New("Failed to get opentrades")
        }
        var trades AllTrades
        json.Unmarshal(tradesAsBytes, &trades) //un stringify it aka JSON.parse()

        for i := range trades.OpenTrades { //look for the trade
                //fmt.Println("looking at " + strconv.FormatInt(trades.OpenTrades[i].Timestamp, 10) + " for "                                                                                + strconv.FormatInt(timestamp, 10))
                if trades.OpenTrades[i].Timestamp == timestamp {
                        fmt.Println("found the trade")
                        trades.OpenTrades = append(trades.OpenTrades[:i], trades.OpenTrades[i+1:]...) //remove                                                                                this trade
                        jsonAsBytes, _ := json.Marshal(trades)
                        err = stub.PutState(openTradesStr, jsonAsBytes) //rewrite open orders
                        if err != nil {
                                return nil, err
                        }
                        break
                }
        }

        fmt.Println("- end remove trade")
        return nil, nil
}

// ===========================================================================================================                                                                                =================
// Clean Up Open Trades - make sure open trades are still possible, remove choices that are no longer possible                                                                                , remove trades that have no valid choices
// ===========================================================================================================                                                                                =================
func cleanTrades(stub shim.ChaincodeStubInterface) (err error) {
        var didWork = false
        fmt.Println("- start clean trades")

        //get the open trade struct
        tradesAsBytes, err := stub.GetState(openTradesStr)
        if err != nil {
                return errors.New("Failed to get opentrades")
        }
        var trades AllTrades
        json.Unmarshal(tradesAsBytes, &trades) //un stringify it aka JSON.parse()

        fmt.Println("# trades " + strconv.Itoa(len(trades.OpenTrades)))
        for i := 0; i < len(trades.OpenTrades); { //iter over all the known open trades
                fmt.Println(strconv.Itoa(i) + ": looking at trade " + strconv.FormatInt(trades.OpenTrades[i].Timestamp, 10))

                fmt.Println("# options " + strconv.Itoa(len(trades.OpenTrades[i].Willing)))
                for x := 0; x < len(trades.OpenTrades[i].Willing); { //find a Asset that is suitable
                        fmt.Println("! on next option " + strconv.Itoa(i) + ":" + strconv.Itoa(x))
                        _, e := findAsset4Trade(stub, trades.OpenTrades[i].User, trades.OpenTrades[i].Willing[x].LastTransaction, trades.OpenTrades[i].Willing[x].ID)
                        if e != nil {
                                fmt.Println("! errors with this option, removing option")
                                didWork = true
                                trades.OpenTrades[i].Willing = append(trades.OpenTrades[i].Willing[:x], trades.OpenTrades[i].Willing[x+1:]...) //remove this option
                                x--
                        } else {
                                fmt.Println("! this option is fine")
                        }

                        x++
                        fmt.Println("! x:" + strconv.Itoa(x))
                        if x >= len(trades.OpenTrades[i].Willing) { //things might have shifted, recalcuate
                                break
                        }
                }

                if len(trades.OpenTrades[i].Willing) == 0 {
                        fmt.Println("! no more options for this trade, removing trade")
                        didWork = true
                        trades.OpenTrades = append(trades.OpenTrades[:i], trades.OpenTrades[i+1:]...) //remove                                                                                this trade
                        i--
                }

                i++
                fmt.Println("! i:" + strconv.Itoa(i))
                if i >= len(trades.OpenTrades) { //things might have shifted, recalcuate
                        break
                }
        }

        if didWork {
                fmt.Println("! saving open trade changes")
                jsonAsBytes, _ := json.Marshal(trades)
                err = stub.PutState(openTradesStr, jsonAsBytes) //rewrite open orders
                if err != nil {
                        return err
                }
        } else {
                fmt.Println("! all open trades are fine")
        }

        fmt.Println("- end clean trades")
        return nil
}


text:
package org.deeplearning4j.eval;

/**
 * @deprecated Use {@link org.nd4j.evaluation.EvaluationAveraging}
 */
@Deprecated
public enum EvaluationAveraging {
    Macro, Micro;

    public org.nd4j.evaluation.EvaluationAveraging toNd4j(){
        switch (this){
            case Macro:
                return org.nd4j.evaluation.EvaluationAveraging.Macro;
            case Micro:
                return org.nd4j.evaluation.EvaluationAveraging.Micro;
        }
        throw new UnsupportedOperationException("Unknown: " + this);
    }
}


text:
namespace Songhay.Tests.Extensions;

public class StreamReaderExtensionsTests
{
    /// <remarks>
    /// Source of the CSV file:
    /// https://github.com/danielesergio/md-big-data-computing/blob/main/sample_10000.csv
    /// </remarks>
    [Theory]
    [ProjectFileData(typeof(StreamReaderExtensionsTests), "../../../csv/sample_10000.csv")]
    public async Task ShouldReadLinesAsync(FileInfo csvFileInfo)
    {
        var lineCount = 0;
        using StreamReader reader = new (csvFileInfo.FullName);

        await reader.ReadLinesAsync(line => {

            var actual = line?.Split(',').Count() ?? 0;

            Assert.Equal(8, actual);

            lineCount++;

            return true;
        });

        Assert.Equal(10000, lineCount);
    }
}


text:
namespace service_manager {

TestServiceManager::TestServiceManager()
    : TestServiceManager(std::vector<Manifest>()) {}

TestServiceManager::TestServiceManager(const std::vector<Manifest>& manifests)
    : background_service_manager_(
          std::make_unique<BackgroundServiceManager>(manifests)) {}

TestServiceManager::~TestServiceManager() = default;

mojo::PendingReceiver<mojom::Service> TestServiceManager::RegisterTestInstance(
    const std::string& service_name) {
  return RegisterInstance(Identity{service_name, base::Token::CreateRandom(),
                                   base::Token{}, base::Token::CreateRandom()});
}

mojo::PendingReceiver<mojom::Service> TestServiceManager::RegisterInstance(
    const Identity& identity) {
  mojo::PendingRemote<mojom::Service> service;
  auto receiver = service.InitWithNewPipeAndPassReceiver();
  background_service_manager_->RegisterService(identity, std::move(service),
                                               mojo::NullReceiver());
  return receiver;
}

}  // namespace service_manager


text:
import os

def lenient_makedir(dir_path):
	"""Create given directory path if it doesn't already exist"""
	if not os.access(dir_path, os.F_OK):
		os.makedirs(dir_path)


text:
#include "p4RuntimeArchStandard.h"

#include <set>
#include <unordered_map>

#include <boost/optional.hpp>

#include "frontends/common/resolveReferences/referenceMap.h"
#include "frontends/p4/fromv1.0/v1model.h"
#include "frontends/p4/typeMap.h"
#include "ir/ir.h"
#include "lib/log.h"
#include "p4RuntimeArchHandler.h"
#include "typeSpecConverter.h"

namespace P4 {

/** \addtogroup control_plane
 *  @{
 */
namespace ControlPlaneAPI {

namespace Standard {

/// Implements @ref P4RuntimeArchHandlerIface for the v1model architecture. The
/// overridden methods will be called by the @P4RuntimeSerializer to collect and
/// serialize v1model-specific symbols which are exposed to the control-plane.
class P4RuntimeArchHandlerV1Model final : public P4RuntimeArchHandlerCommon<Arch::V1MODEL> {
 public:
    P4RuntimeArchHandlerV1Model(ReferenceMap* refMap, TypeMap* typeMap,
                                const IR::ToplevelBlock* evaluatedProgram)
        : P4RuntimeArchHandlerCommon<Arch::V1MODEL>(refMap, typeMap, evaluatedProgram) {}

    void collectExternFunction(P4RuntimeSymbolTableIface* symbols,
                               const P4::ExternFunction* externFunction) override {
        auto digest = getDigestCall(externFunction, refMap, typeMap, nullptr);
        if (digest) symbols->add(SymbolType::DIGEST(), digest->name);
    }

    void addTableProperties(const P4RuntimeSymbolTableIface& symbols, p4configv1::P4Info* p4info,
                            p4configv1::Table* table, const IR::TableBlock* tableBlock) override {
        P4RuntimeArchHandlerCommon<Arch::V1MODEL>::addTableProperties(symbols, p4info, table,
                                                                      tableBlock);
        auto tableDeclaration = tableBlock->container;

        bool supportsTimeout = getSupportsTimeout(tableDeclaration);
        if (supportsTimeout) {
            table->set_idle_timeout_behavior(p4configv1::Table::NOTIFY_CONTROL);
        } else {
            table->set_idle_timeout_behavior(p4configv1::Table::NO_TIMEOUT);
        }
    }

    void addExternFunction(const P4RuntimeSymbolTableIface& symbols, p4configv1::P4Info* p4info,
                           const P4::ExternFunction* externFunction) override {
        auto p4RtTypeInfo = p4info->mutable_type_info();
        auto digest = getDigestCall(externFunction, refMap, typeMap, p4RtTypeInfo);
        if (digest) addDigest(symbols, p4info, *digest);
    }

    /// @return serialization information for the digest() call represented by
    /// @call, or boost::none if @call is not a digest() call or is invalid.
    static boost::optional<Digest> getDigestCall(const P4::ExternFunction* function,
                                                 ReferenceMap* refMap, P4::TypeMap* typeMap,
                                                 p4configv1::P4TypeInfo* p4RtTypeInfo) {
        if (function->method->name != P4V1::V1Model::instance.digest_receiver.name)
            return boost::none;

        auto call = function->expr;
        BUG_CHECK(call->typeArguments->size() == 1, "%1%: Expected one type argument", call);
        BUG_CHECK(call->arguments->size() == 2, "%1%: Expected 2 arguments", call);

        // An invocation of digest() looks like this:
        //   digest<T>(receiver, { fields });
        // The name that shows up in the control plane API is the type name T. If T
        // doesn't have a name (e.g. tuple), we auto-generate one; ideally we would
        // be able to annotate the digest method call with a @name annotation in the
        // P4 but annotations are not supported on expressions.
        cstring controlPlaneName;
        auto* typeArg = call->typeArguments->at(0);
        if (typeArg->is<IR::Type_StructLike>()) {
            auto structType = typeArg->to<IR::Type_StructLike>();
            controlPlaneName = structType->controlPlaneName();
        } else if (auto* typeName = typeArg->to<IR::Type_Name>()) {
            auto* referencedType = refMap->getDeclaration(typeName->path, true);
            CHECK_NULL(referencedType);
            controlPlaneName = referencedType->controlPlaneName();
        } else {
            static std::unordered_map<const IR::MethodCallExpression*, cstring> autoNames;
            auto it = autoNames.find(call);
            if (it == autoNames.end()) {
                controlPlaneName = "digest_" + cstring::to_cstring(autoNames.size());
                ::warning(ErrorType::WARN_MISMATCH,
                          "Cannot find a good name for %1% method call, using "
                          "auto-generated name '%2%'",
                          call, controlPlaneName);
                autoNames.emplace(call, controlPlaneName);
            } else {
                controlPlaneName = it->second;
            }
        }

        // Convert the generic type for the digest method call to a P4DataTypeSpec
        auto* typeSpec = TypeSpecConverter::convert(refMap, typeMap, typeArg, p4RtTypeInfo);
        BUG_CHECK(typeSpec != nullptr,
                  "P4 type %1% could not "
                  "be converted to P4Info P4DataTypeSpec");
        return Digest{controlPlaneName, typeSpec, nullptr};
    }

    /// @return true if @table's 'support_timeout' property exists and is true. This
    /// indicates that @table supports entry ageing.
    static bool getSupportsTimeout(const IR::P4Table* table) {
        auto timeout = table->properties->getProperty(
            P4V1::V1Model::instance.tableAttributes.supportTimeout.name);
        if (timeout == nullptr) return false;
        if (!timeout->value->is<IR::ExpressionValue>()) {
            ::error(ErrorType::ERR_UNEXPECTED,
                    "Unexpected value %1% for supports_timeout on table %2%", timeout, table);
            return false;
        }

        auto expr = timeout->value->to<IR::ExpressionValue>()->expression;
        if (!expr->is<IR::BoolLiteral>()) {
            ::error(ErrorType::ERR_UNEXPECTED,
                    "Unexpected non-boolean value %1% for supports_timeout "
                    "property on table %2%",
                    timeout, table);
            return false;
        }

        return expr->to<IR::BoolLiteral>()->value;
    }
};

P4RuntimeArchHandlerIface* V1ModelArchHandlerBuilder::operator()(
    ReferenceMap* refMap, TypeMap* typeMap, const IR::ToplevelBlock* evaluatedProgram) const {
    return new P4RuntimeArchHandlerV1Model(refMap, typeMap, evaluatedProgram);
}

/// Implements  a common @ref P4RuntimeArchHandlerIface for the PSA and PNA architecture. The
/// overridden methods will be called by the @P4RuntimeSerializer to collect and
/// serialize PSA and PNA specific symbols which are exposed to the control-plane.
template <Arch arch>
class P4RuntimeArchHandlerPSAPNA : public P4RuntimeArchHandlerCommon<arch> {
 public:
    P4RuntimeArchHandlerPSAPNA(ReferenceMap* refMap, TypeMap* typeMap,
                               const IR::ToplevelBlock* evaluatedProgram)
        : P4RuntimeArchHandlerCommon<arch>(refMap, typeMap, evaluatedProgram) {}

    void collectExternInstance(P4RuntimeSymbolTableIface* symbols,
                               const IR::ExternBlock* externBlock) override {
        P4RuntimeArchHandlerCommon<arch>::collectExternInstance(symbols, externBlock);

        auto decl = externBlock->node->to<IR::IDeclaration>();
        if (decl == nullptr) return;
        if (externBlock->type->name == "Digest") {
            symbols->add(SymbolType::DIGEST(), decl);
        }
    }

    void addTableProperties(const P4RuntimeSymbolTableIface& symbols, p4configv1::P4Info* p4info,
                            p4configv1::Table* table, const IR::TableBlock* tableBlock) override {
        P4RuntimeArchHandlerCommon<arch>::addTableProperties(symbols, p4info, table, tableBlock);

        auto tableDeclaration = tableBlock->container;
        bool supportsTimeout = getSupportsTimeout(tableDeclaration);
        if (supportsTimeout) {
            table->set_idle_timeout_behavior(p4configv1::Table::NOTIFY_CONTROL);
        } else {
            table->set_idle_timeout_behavior(p4configv1::Table::NO_TIMEOUT);
        }
    }

    void addExternInstance(const P4RuntimeSymbolTableIface& symbols, p4configv1::P4Info* p4info,
                           const IR::ExternBlock* externBlock) override {
        P4RuntimeArchHandlerCommon<arch>::addExternInstance(symbols, p4info, externBlock);

        auto decl = externBlock->node->to<IR::Declaration_Instance>();
        if (decl == nullptr) return;
        auto p4RtTypeInfo = p4info->mutable_type_info();
        if (externBlock->type->name == "Digest") {
            auto digest = getDigest(decl, p4RtTypeInfo);
            if (digest) this->addDigest(symbols, p4info, *digest);
        }
    }

    /// @return serialization information for the Digest extern instacne @decl
    boost::optional<Digest> getDigest(const IR::Declaration_Instance* decl,
                                      p4configv1::P4TypeInfo* p4RtTypeInfo) {
        BUG_CHECK(decl->type->is<IR::Type_Specialized>(), "%1%: expected Type_Specialized",
                  decl->type);
        auto type = decl->type->to<IR::Type_Specialized>();
        BUG_CHECK(type->arguments->size() == 1, "%1%: expected one type argument", decl);
        auto typeArg = type->arguments->at(0);
        auto typeSpec =
            TypeSpecConverter::convert(this->refMap, this->typeMap, typeArg, p4RtTypeInfo);
        BUG_CHECK(typeSpec != nullptr,
                  "P4 type %1% could not be converted to P4Info P4DataTypeSpec");

        return Digest{decl->controlPlaneName(), typeSpec, decl->to<IR::IAnnotated>()};
    }

    /// @return true if @table's 'psa_idle_timeout' property exists and is true. This
    /// indicates that @table supports entry ageing.
    static bool getSupportsTimeout(const IR::P4Table* table) {
        auto timeout = table->properties->getProperty("psa_idle_timeout");

        if (timeout == nullptr) return false;

        if (auto exprValue = timeout->value->to<IR::ExpressionValue>()) {
            if (auto expr = exprValue->expression) {
                if (auto member = expr->to<IR::Member>()) {
                    if (member->member == "NOTIFY_CONTROL") {
                        return true;
                    } else if (member->member == "NO_TIMEOUT") {
                        return false;
                    }
                } else if (expr->is<IR::PathExpression>()) {
                    ::error(ErrorType::ERR_UNEXPECTED,
                            "Unresolved value %1% for psa_idle_timeout "
                            "property on table %2%. Must be a constant and one of "
                            "{ NOTIFY_CONTROL, NO_TIMEOUT }",
                            timeout, table);
                    return false;
                }
            }
        }

        ::error(ErrorType::ERR_UNEXPECTED,
                "Unexpected value %1% for psa_idle_timeout "
                "property on table %2%. Supported values are "
                "{ NOTIFY_CONTROL, NO_TIMEOUT }",
                timeout, table);
        return false;
    }
};

class P4RuntimeArchHandlerPSA final : public P4RuntimeArchHandlerPSAPNA<Arch::PSA> {
 public:
    P4RuntimeArchHandlerPSA(ReferenceMap* refMap, TypeMap* typeMap,
                            const IR::ToplevelBlock* evaluatedProgram)
        : P4RuntimeArchHandlerPSAPNA(refMap, typeMap, evaluatedProgram) {}
};

P4RuntimeArchHandlerIface* PSAArchHandlerBuilder::operator()(
    ReferenceMap* refMap, TypeMap* typeMap, const IR::ToplevelBlock* evaluatedProgram) const {
    return new P4RuntimeArchHandlerPSA(refMap, typeMap, evaluatedProgram);
}

class P4RuntimeArchHandlerPNA final : public P4RuntimeArchHandlerPSAPNA<Arch::PNA> {
 public:
    P4RuntimeArchHandlerPNA(ReferenceMap* refMap, TypeMap* typeMap,
                            const IR::ToplevelBlock* evaluatedProgram)
        : P4RuntimeArchHandlerPSAPNA(refMap, typeMap, evaluatedProgram) {}
};

P4RuntimeArchHandlerIface* PNAArchHandlerBuilder::operator()(
    ReferenceMap* refMap, TypeMap* typeMap, const IR::ToplevelBlock* evaluatedProgram) const {
    return new P4RuntimeArchHandlerPNA(refMap, typeMap, evaluatedProgram);
}

/// Implements @ref P4RuntimeArchHandlerIface for the UBPF architecture.
/// We re-use PSA to handle externs.
/// Rationale: The only configurable extern object in ubpf_model.p4 is Register.
/// The Register is defined exactly the same as for PSA. Therefore, we can re-use PSA.
class P4RuntimeArchHandlerUBPF final : public P4RuntimeArchHandlerCommon<Arch::PSA> {
 public:
    P4RuntimeArchHandlerUBPF(ReferenceMap* refMap, TypeMap* typeMap,
                             const IR::ToplevelBlock* evaluatedProgram)
        : P4RuntimeArchHandlerCommon<Arch::PSA>(refMap, typeMap, evaluatedProgram) {}
};

P4RuntimeArchHandlerIface* UBPFArchHandlerBuilder::operator()(
    ReferenceMap* refMap, TypeMap* typeMap, const IR::ToplevelBlock* evaluatedProgram) const {
    return new P4RuntimeArchHandlerUBPF(refMap, typeMap, evaluatedProgram);
}

}  // namespace Standard

}  // namespace ControlPlaneAPI

/** @} */ /* end group control_plane */
}  // namespace P4


text:
001
017    package org.apache.commons.configuration.interpol;
018
019    import org.apache.commons.configuration.EnvironmentConfiguration;
020    import org.apache.commons.lang.text.StrLookup;
021
022    /**
023     * <p>
024     * A specialized lookup implementation that allows access to environment
025     * variables.
026     * </p>
027     * <p>
028     * This implementation relies on {@link EnvironmentConfiguration} to resolve
029     * environment variables. It can be used for referencing environment variables
030     * in configuration files in an easy way, for instance:
031     *
032     * <pre>
033     * java.home = ${env:JAVA_HOME}
034     * </pre>
035     *
036     * </p>
037     * <p>
038     * <code>EnvironmentLookup</code> is one of the standard lookups that is
039     * registered per default for each configuration.
040     * </p>
041     *
042     * @author <a
043     *         href="http://commons.apache.org/configuration/team-list.html">Commons
044     *         Configuration team</a>
045     * @since 1.7
046     * @version $Id: EnvironmentLookup.java 833896 2009-11-08 17:38:19Z oheger $
047     */
048    public class EnvironmentLookup extends StrLookup
049    {
050        /** Stores the underlying <code>EnvironmentConfiguration</code>. */
051        private final EnvironmentConfiguration environmentConfig = new EnvironmentConfiguration();
052
053        /**
054         * Performs a lookup for the specified variable. This implementation
055         * directly delegates to a <code>EnvironmentConfiguration</code>.
056         *
057         * @param key the key to lookup
058         * @return the value of this key or <b>null</b> if it cannot be resolved
059         */
060        public String lookup(String key)
061        {
062            return environmentConfig.getString(key);
063        }
064    }


text:
package cis

const (
	NumberOfRetriesForScheduledScanRemoval = 10
	RetryIntervalInMilliseconds            = 100
)


text:
<?php

/**
 * RefTypeSport filter form base class.
 *
 * @package    sallesport
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseRefTypeSportFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'libelle'          => new sfWidgetFormFilterInput(),
      'montant_sport'    => new sfWidgetFormFilterInput(),
      'sport_image_path' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'libelle'          => new sfValidatorPass(array('required' => false)),
      'montant_sport'    => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'sport_image_path' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ref_type_sport_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'RefTypeSport';
  }

  public function getFields()
  {
    return array(
      'id_type_sport'    => 'Number',
      'libelle'          => 'Text',
      'montant_sport'    => 'Number',
      'sport_image_path' => 'Text',
    );
  }
}


text:
This repo contains Docker images with [burp 2.x](http://burp.grke.org/) server, client and a [web ui](https://git.ziirish.me/ziirish/burp-ui). All images are available at Docker Hub:

https://hub.docker.com/r/pschiffe/burp-server/
https://hub.docker.com/r/pschiffe/burp-client/
https://hub.docker.com/r/pschiffe/burp-ui/

## Burp Server

[![](https://images.microbadger.com/badges/image/pschiffe/burp-server.svg)](https://microbadger.com/images/pschiffe/burp-server "Get your own image badge on microbadger.com")

https://hub.docker.com/r/pschiffe/burp-server/

Burp server image with optional encryption, secure rsync to remote location and a [bui-agent](https://burp-ui.readthedocs.io/en/latest/buiagent.html) (for web ui).

### Persistent data

The container uses two persistent volumes - `/etc/burp` for configuration and `/var/spool/burp` for storing backups.

### Sytemd

Systemd is used to manage multiple processes inside of the container, so a couple of special requirements are needed when running it: `/run` and `/tmp` must be mounted on tmpfs, and cgroup filesystem must be bind-mounted from the host. Example Docker run bit when running on Red Hat based distro: `--tmpfs /run --tmpfs /tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro`

If you are using SELinux on the host, you need to enable the `container_manage_cgroup` variable with `setsebool -P container_manage_cgroup 1`.

Besides that, if you want to see the logs with `docker logs` command, allocate tty for the container with `-t, --tty` option.

### Adding clients

The client configuration can be automatically pre-created on server with `BURP_CLIENTS_CONFIG` env var. The format of this variable is: `'client1-hostname:client1-password client2-hostname:client2-password ...'`

### Example

```
docker run -dt -p 4971:4971 --name burp-server \
  -v burp-server-conf:/etc/burp \
  -v burp-server-data:/var/spool/burp \
  -e 'BURP_CLIENTS_CONFIG=host1:pass1 host2:pass2 host3:pass3'
  --tmpfs /run --tmpfs /tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
  pschiffe/burp-server
```

### Encryption

It's possible to encrypt backed up data with `encfs`. To use it, simply provide encryption password in `ENCRYPT_PASSWORD` env var. Because of the encfs fuse fs, you need to expose the `/dev/fuse` to the container with `--device /dev/fuse`, provide additional capability and possibly disable selinux (or apparmor) confinement with `--cap-add SYS_ADMIN --security-opt label:disable`.

### Rsync to remote location

If you want to regularly sync your backed up data to a remote location, you can use the built-in support for rsync. With `RSYNC_DEST` env var specify remote location in format `rsync://user@server/path`. Password for rsync user can be provided in `RSYNC_PASS` env var. If the remote location provides rsync secured with stunnel, you can use that as well. Specify remote server and port in `STUNNEL_RSYNC_HOST` env var in format `server:port` and then, change the server part of the `RSYNC_DEST` to `localhost`, as in `rsync://user@localhost/path`.

If at least `RSYNC_DEST` env var is set, timer script in the container will try to rsync the local data to the remote location at around 6 AM every morning (this can be modified in `/etc/systemd/system/rsync-sync.timer` file).

And that's not all, there is one more feature - if you set `RESTORE_FROM_RSYNC` env var to `1` and `/var/spool/burp` directory is empty, the container will try to download all the data from remote location with rsync (required rsync connection env vars must be set).

## Burp Web UI

[![](https://images.microbadger.com/badges/image/pschiffe/burp-ui.svg)](https://microbadger.com/images/pschiffe/burp-ui "Get your own image badge on microbadger.com")

https://hub.docker.com/r/pschiffe/burp-ui/

Burp UI image contains awesome [web ui for Burp created by Ziirish](https://git.ziirish.me/ziirish/burp-ui). If running this container on the same host as the Burp server, you can just link this container to the Burp server with alias `burp` and more or less that's it. The web service is listening on port `5000`. If you want to manage Burp server on a different host, at first you need to specify `BUI_AGENT_PASSWORD` env var and expose port `10000` of **burp-server** container, then you need to manually edit the `/etc/burp/burpui.cfg.tpl` file in the burp-ui container and add the new `[Agent:name]` section to it. Be sure to update the template file `burpui.cfg.tpl` as the `burpui.cfg` file is overwritten every time the container starts.

### Persistent data

`/etc/burp` directory contains configuration for this container.

### Example

```
docker run -d -p 5000:5000 --name burp-ui \
  -v burp-ui-conf:/etc/burp \
  --link burp-server:burp \
  pschiffe/burp-ui
```

## Burp Client

[![](https://images.microbadger.com/badges/image/pschiffe/burp-client.svg)](https://microbadger.com/images/pschiffe/burp-client "Get your own image badge on microbadger.com")

https://hub.docker.com/r/pschiffe/burp-client/

To backup data and send them to the Burp server, you need Burp client. Usage of this image is pretty simple. With `BURP_SERVER` and `BURP_SERVER_PORT` env vars you can specify an address and port of the Burp server, client password goes in `BURP_CLIENT_PASSWORD` env var and everything you need to backup just mount to `/tobackup` directory in the container. Be aware, however, that you might need to use the `--security-opt label:disable` option when accessing various system directories on the host. It's also possible to link to Burp server container with alias `burp` and I would recommend setting the container hostname to something meaningful, as the client will be identified with its hostname in the Burp server configuration.

### Persistent data

`/etc/burp` persistent directory in the container stores Burp client configuration.

### Example

```
docker run -d --name burp-client \
  -e BURP_SERVER=some-server.host \
  -e BURP_CLIENT_PASSWORD=super-secret \
  -v burp-client-conf:/etc/burp \
  -v /etc:/tobackup/somehost-etc:ro \
  -v /home:/tobackup/somehost-home:ro \
  -v some-docker-vol:/tobackup/some-docker-vol:ro \
  --hostname $HOSTNAME \
  --security-opt label:disable \
  pschiffe/burp-client
```

Once this container is created, it will backup the specified data and exit. After that, it's recommended to start the container ~ every 20 minutes with `docker start burp-client`, so it can check with the server and backup new files if scheduled. The schedule is determined by the server, not the client.

### Data recovery

You may also use it to recover data from a distant server.
You just have to provide arguments as you would to a regular burp client CLI.

for example:

```
docker run -d --name burp-client \
  -e BURP_SERVER=some-server.host \
  -e BURP_CLIENT_PASSWORD=super-secret \
  -v burp-client-conf:/etc/burp \
  -v /etc:/tobackup/somehost-etc \
  --hostname $HOSTNAME \
  --security-opt label:disable \
  pschiffe/burp-client \
  -al /tobackup/somehost-etc
```


text:
This is a REST API documentation. The REST API is only accessible when logged in.

```
Title : Show all datasets
URL : /api/dataset
Method : GET
URL Params :
Data Params :
Response Codes: Success (200 OK), Bad Request (400), Unauthorized (401)
```

```
Title : Show the dataset with unique identifier id
URL : /api/dataset/:id
Method : GET
URL Params : Required: id=[integer]
Data Params : { id : [integer] }
Response Codes: Success (200 OK), Bad Request (400), Unauthorized (401)
```

```
Title : Show all datasets of a specific user.
URL : /api/dataset/user/:id
Method : GET
URL Params : Required: id=[integer]
Data Params : { id : [integer] }
Response Codes: Success (200 OK), Bad Request (400), Unauthorized (401)
```

```
Title : Return a extracted feature of a dataset.
URL : /api/dataset/:id/:feature
Method : GET | POST | DELETE | PUT
URL Params : Required: id=[integer],  feature=[string]
Data Params : { id : [integer], feature:['speed', 'acceleration', 'distance_centroid',
   'metric_distance','centroid', 'medoid', 'swarm_speed', 'swarm_acceleration',
   'swarm_convex_hull_area', 'convex_hull', 'triangulation', 'voronoi'] }
Response Codes: Success (200 OK), Bad Request (400), Unauthorized (401)
```

```
Title : Get the movement data of a specific dataset.
URL : /api/movement_only/:id
Method : GET
URL Params : Required: id=[integer]
Data Params : { id : [integer] }
Response Codes: Success (200 OK), Bad Request (400), Unauthorized (401)
```

```
Title : Show all feature scales for the specific color schemes
URL : /api/percentile/:id
Method : GET
URL Params : Required: id=[integer]
Data Params : { id : [integer] }
Response Codes: Success (200 OK), Bad Request (400), Unauthorized (401)
```

```
Title : Get all metadata of a specific dataset
URL : /api/metadata/:id
Method : GET
URL Params : Required: id=[integer]
Data Params : { id : [integer] }
Response Codes: Success (200 OK), Bad Request (400), Unauthorized (401)
```


text:
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                                      http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <entity name="ServerGrove\Bundle\TranslationEditorBundle\Entity\Translation"
            table="sg_translation_value">

        <id name="id"
            type="integer"
            column="id">
            <generator strategy="AUTO"/>
        </id>

        <field name="value"
               column="value"
               type="text"/>

        <many-to-one target-entity="ServerGrove\Bundle\TranslationEditorBundle\Entity\Entry"
                     field="entry"
                     inversed-by="translations">
            <cascade>
                <cascade-persist/>
                <cascade-refresh/>
            </cascade>
        </many-to-one>

        <many-to-one target-entity="ServerGrove\Bundle\TranslationEditorBundle\Entity\Locale"
                     field="locale"
                     inversed-by="translations">
            <cascade>
                <cascade-persist/>
                <cascade-refresh/>
            </cascade>
        </many-to-one>

    </entity>

</doctrine-mapping>


text:
 package at.kc.tugraz.ss.friend.datatypes;

import at.tugraz.sss.serv.datatype.SSEntity;
import at.tugraz.sss.serv.datatype.*;
import at.tugraz.sss.serv.datatype.enums.*;
import io.swagger.annotations.*;

@ApiModel
public class SSFriend extends SSEntity{

  public static SSFriend get(
    final SSFriend  friend,
    final SSEntity  entity) throws SSErr{

    return new SSFriend(friend, entity);
  }

  public static SSFriend get(
    final SSUri         id) throws SSErr{

    return new SSFriend(id);
  }

  public SSFriend(){/* Do nothing because of only JSON Jackson needs this */ }

  protected SSFriend(
    final SSFriend friend,
    final SSEntity entity) throws SSErr{

    super(friend, entity);
  }

  protected SSFriend(
    final SSUri         id) throws SSErr{

    super(id, SSEntityE.user);
	}
}


text:
<?xml version="1.0"?>
<Document>

	<Sentence>
		<value>In people with badly damaged livers, proteins are not properly processed.</value>
		<pattern_crowdsource> In [[people|C0027361]] with badly [[damaged livers|C0151763]], proteins are not properly processed.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>people</surface-form>
				<RDF-ID>C0027361</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>badly</surface-form>
				<RDF-ID>C0205169</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>damaged livers</surface-form>
				<RDF-ID>C0151763</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>proteins</surface-form>
				<RDF-ID>C0033684</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>not</surface-form>
				<RDF-ID>C1518422</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0151763 PROCESS_OF C0027361</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>- Taking vitamins and medicines prescribed by your health care provider for low blood count, nerve problems, or nutritional problems from liver disease.</value>
		<pattern_crowdsource> - Taking [[vitamins|C0042890]] and [[medicines|C0013227]] prescribed by your health care provider for low [[blood count|C1535968]], nerve problems, or nutritional problems from liver disease.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>vitamins</surface-form>
				<RDF-ID>C0042890</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>medicines</surface-form>
				<RDF-ID>C0013227</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>health care provider</surface-form>
				<RDF-ID>C0018724</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>low</surface-form>
				<RDF-ID>C0205251</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>blood count</surface-form>
				<RDF-ID>C1535968</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>nerve problems</surface-form>
				<RDF-ID>C0746848</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>nutritional problems</surface-form>
				<RDF-ID>C0028709</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>liver disease</surface-form>
				<RDF-ID>C0023895</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C1535968 USES C0013227</triple>
			<triple>C1535968 USES C0042890</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Salt in the diet may worsen fluid buildup and swelling in the liver.</value>
		<pattern_crowdsource> Salt in the diet may worsen fluid buildup and [[swelling|C0038999]] in the [[liver|C0023884]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Salt</surface-form>
				<RDF-ID>C0206136</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>diet</surface-form>
				<RDF-ID>C0012155</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>fluid</surface-form>
				<RDF-ID>C0302908</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>swelling</surface-form>
				<RDF-ID>C0038999</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>liver</surface-form>
				<RDF-ID>C0023884</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0023884 LOCATION_OF C0038999</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>General recommendations for people with severe liver disease include:  - Eat large amounts of carbohydrate foods.</value>
		<pattern_crowdsource> General recommendations for [[people|C0027361]] with severe [[liver disease|C0023895]] include:  - Eat large amounts of carbohydrate foods.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>General</surface-form>
				<RDF-ID>C0205246</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>recommendations</surface-form>
				<RDF-ID>C0034866</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>people</surface-form>
				<RDF-ID>C0027361</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>severe</surface-form>
				<RDF-ID>C0205082</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>liver disease</surface-form>
				<RDF-ID>C0023895</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>large</surface-form>
				<RDF-ID>C0549177</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>amounts</surface-form>
				<RDF-ID>C1265611</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>carbohydrate foods</surface-form>
				<RDF-ID>C0453802</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0023895 PROCESS_OF C0027361</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>The increased carbohydrates and fat help prevent protein breakdown in the liver.</value>
		<pattern_crowdsource> The [[increased carbohydrates|C1291096]] and fat help prevent protein breakdown in the [[liver|C0023884]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>increased carbohydrates</surface-form>
				<RDF-ID>C1291096</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>fat</surface-form>
				<RDF-ID>C0424612</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>protein</surface-form>
				<RDF-ID>C0033684</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>liver</surface-form>
				<RDF-ID>C0023884</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0023884 LOCATION_OF C1291096</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>A person with a badly damaged liver may need to eat less protein.</value>
		<pattern_crowdsource> A [[person|C0027361]] with a badly [[damaged liver|C0151763]] may need to eat less protein.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>person</surface-form>
				<RDF-ID>C0027361</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>badly</surface-form>
				<RDF-ID>C0205169</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>damaged liver</surface-form>
				<RDF-ID>C0151763</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>protein</surface-form>
				<RDF-ID>C0033684</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0151763 PROCESS_OF C0027361</triple>
		</triples>
	</Sentence>

</Document>


text:
<?xml version="1.0"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <name>TeamCity Config DSL Script</name>
    <groupId>NUKE_GENERATED</groupId>
    <artifactId>NUKE_GENERATED</artifactId>
    <version>1.0-SNAPSHOT</version>

    <parent>
        <groupId>org.jetbrains.teamcity</groupId>
        <artifactId>configs-dsl-kotlin-parent</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <repositories>
        <repository>
            <id>jetbrains-all</id>
            <url>http://download.jetbrains.com/teamcity-repository</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>teamcity-server</id>
            <url>https://teamcity.jetbrains.com/app/dsl-plugins-repository</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>JetBrains</id>
            <url>http://download.jetbrains.com/teamcity-repository</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <sourceDirectory>.</sourceDirectory>
        <plugins>
            <plugin>
                <artifactId>kotlin-maven-plugin</artifactId>
                <groupId>org.jetbrains.kotlin</groupId>
                <version>${kotlin.version}</version>

                <configuration/>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>process-test-sources</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.teamcity</groupId>
                <artifactId>teamcity-configs-maven-plugin</artifactId>
                <version>${teamcity.dsl.version}</version>
                <configuration>
                    <format>kotlin</format>
                    <dstDir>target/generated-configs</dstDir>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.teamcity</groupId>
            <artifactId>configs-dsl-kotlin</artifactId>
            <version>${teamcity.dsl.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.teamcity</groupId>
            <artifactId>configs-dsl-kotlin-plugins</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-script-runtime</artifactId>
            <version>${kotlin.version}</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>


text:
using System;

namespace DotnetCoreClientDemo
{
    /// <summary>
    /// Program
    /// </summary>
    public class Program
    {

        /// <summary>
        /// Main
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine("Prepare Connect MQ");

            var messageManager = new MessageManager();

            Console.WriteLine("Prepare Send message to MQ");
            if (messageManager.SendOneMessage())
            {
                Console.WriteLine("Done, press Any Key will be close");
            }
            else
            {
                Console.WriteLine("Fail");
            }

            Console.ReadKey();

        }

    }
}