text:
<!--
  ~ Copyright 2016 Nicolas Picon <nicopico.dev@gmail.com>
  ~
  ~ 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.
  -->

<manifest
    package="fr.nicopico.dashclock.birthday"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application
        android:label="@string/app_name_debug"
        tools:replace="label">

        <service
            android:name=".BirthdayService"
            android:label="@string/app_name_debug"
            tools:replace="label"/>

        <activity
            android:name=".SettingsActivity"
            android:label="@string/app_name_debug"
            tools:replace="label"/>

    </application>

</manifest>


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>

// UnityEngine.Light
struct Light_t1596303683;

#include "codegen/il2cpp-codegen.h"
#include "UnityEngine_UnityEngine_Color1588175760.h"

// UnityEngine.Color UnityEngine.Light::get_color()
extern "C"  Color_t1588175760  Light_get_color_m2336101442 (Light_t1596303683 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityEngine.Light::set_color(UnityEngine.Color)
extern "C"  void Light_set_color_m763171967 (Light_t1596303683 * __this, Color_t1588175760  ___value, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityEngine.Light::INTERNAL_get_color(UnityEngine.Color&)
extern "C"  void Light_INTERNAL_get_color_m4212442015 (Light_t1596303683 * __this, Color_t1588175760 * ___value, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityEngine.Light::INTERNAL_set_color(UnityEngine.Color&)
extern "C"  void Light_INTERNAL_set_color_m3939727787 (Light_t1596303683 * __this, Color_t1588175760 * ___value, const MethodInfo* method) IL2CPP_METHOD_ATTR;

redpajama_set_name: RedPajamaGithub


text:
#include "caf/config.hpp"

#define CAF_SUITE io_triggering
#include "caf/test/unit_test.hpp"

#include <memory>
#include <iostream>

#include "caf/all.hpp"
#include "caf/io/all.hpp"

using namespace std;
using namespace caf;
using namespace caf::io;

namespace {

// -- client implementation, used for both test servers ------------------------

behavior client(broker* self, connection_handle hdl) {
  std::vector<char> buf;
  buf.resize(200);
  std::iota(buf.begin(), buf.end(), 0);
  self->write(hdl, buf.size(), buf.data());
  CAF_REQUIRE_EQUAL(self->wr_buf(hdl).size(), 200u);
  self->configure_read(hdl, receive_policy::at_least(1));
  self->flush(hdl);
  return {
    [=](const new_data_msg&) {
      CAF_FAIL("server unexpectedly sent data");
    },
    [=](const connection_closed_msg&) {
      self->quit();
    }
  };
}

// -- first test server --------------------------------------------------------

struct server1_state {
  size_t received = 0;
  connection_handle peer = invalid_connection_handle;
};

// consumes 5 more tokens, then waits for passivated message to shutdown
behavior server1_stage4(stateful_actor<server1_state, broker>* self) {
  CAF_MESSAGE("enter server stage 4");
  self->trigger(self->state.peer, 5);
  return {
    [=](const new_data_msg& dm) {
      CAF_REQUIRE_EQUAL(dm.buf.size(), 10u);
      self->state.received += 1;
    },
    [=](const connection_passivated_msg& cp) {
      CAF_REQUIRE_EQUAL(cp.handle, self->state.peer);
      CAF_REQUIRE_EQUAL(self->state.received, 15u);
      CAF_REQUIRE_NOT_EQUAL(self->state.peer, invalid_connection_handle);
      // delay new tokens to force MM to remove this broker from its loop
      CAF_MESSAGE("server is done");
      self->quit();
    }
  };
}

// consumes 5 more tokens, then waits for passivated message to send itself
// a message that generates 5 more (force MM to actually remove this broker
// from its event loop and then re-adding it)
behavior server1_stage3(stateful_actor<server1_state, broker>* self) {
  CAF_MESSAGE("enter server stage 3");
  self->trigger(self->state.peer, 5);
  return {
    [=](const new_data_msg& dm) {
      CAF_REQUIRE_EQUAL(dm.buf.size(), 10u);
      self->state.received += 1;
    },
    [=](const connection_passivated_msg& cp) {
      CAF_REQUIRE_EQUAL(cp.handle, self->state.peer);
      CAF_REQUIRE_EQUAL(self->state.received, 10u);
      CAF_REQUIRE_NOT_EQUAL(self->state.peer, invalid_connection_handle);
      // delay new tokens to force MM to remove this broker from its loop
      self->send(self, ok_atom::value);
    },
    [=](ok_atom) {
      self->become(server1_stage4(self));
    }
  };
}

// consumes 5 tokens, then waits for passivated message and generates 5 more
behavior server1_stage2(stateful_actor<server1_state, broker>* self) {
  CAF_MESSAGE("enter server stage 2");
  self->trigger(self->state.peer, 5);
  return {
    [=](const new_data_msg& dm) {
      CAF_REQUIRE_EQUAL(dm.buf.size(), 10u);
      self->state.received += 1;
    },
    [=](const connection_passivated_msg& cp) {
      CAF_REQUIRE_EQUAL(cp.handle, self->state.peer);
      CAF_REQUIRE_EQUAL(self->state.received, 5u);
      CAF_REQUIRE_NOT_EQUAL(self->state.peer, invalid_connection_handle);
      self->become(server1_stage3(self));
    }
  };
}

// waits for the connection to the client
behavior server1(stateful_actor<server1_state, broker>* self) {
  return {
    [=](const new_connection_msg& nc) {
      CAF_REQUIRE_EQUAL(self->state.peer, invalid_connection_handle);
      self->state.peer = nc.handle;
      self->configure_read(nc.handle, receive_policy::exactly(10));
      self->become(server1_stage2(self));
    }
  };
}

// -- second test server -------------------------------------------------------

struct server2_state {
  size_t accepted = 0;
};

// consumes 5 more tokens, then waits for passivated message to shutdown
behavior server2_stage4(stateful_actor<server2_state, broker>* self) {
  CAF_MESSAGE("enter server stage 4");
  return {
    [=](const new_connection_msg&) {
      self->state.accepted += 1;
    },
    [=](const acceptor_passivated_msg&) {
      CAF_REQUIRE_EQUAL(self->state.accepted, 16u);
      CAF_MESSAGE("server is done");
      self->quit();
    }
  };
}

// consumes 5 more tokens, then waits for passivated message to send itself
// a message that generates 5 more (force MM to actually remove this broker
// from its event loop and then re-adding it)
behavior server2_stage3(stateful_actor<server2_state, broker>* self) {
  CAF_MESSAGE("enter server stage 3");
  return {
    [=](const new_connection_msg&) {
      self->state.accepted += 1;
    },
    [=](const acceptor_passivated_msg& cp) {
      CAF_REQUIRE_EQUAL(self->state.accepted, 11u);
      // delay new tokens to force MM to remove this broker from its loop
      self->send(self, ok_atom::value, cp.handle);
    },
    [=](ok_atom, accept_handle hdl) {
      self->trigger(hdl, 5);
      self->become(server2_stage4(self));
    }
  };
}

// consumes 5 tokens, then waits for passivated message and generates 5 more
behavior server2_stage2(stateful_actor<server2_state, broker>* self) {
  CAF_MESSAGE("enter server stage 2");
  CAF_REQUIRE_EQUAL(self->state.accepted, 1u);
  return {
    [=](const new_connection_msg&) {
      self->state.accepted += 1;
    },
    [=](const acceptor_passivated_msg& cp) {
      CAF_REQUIRE_EQUAL(self->state.accepted, 6u);
      self->trigger(cp.handle, 5);
      self->become(server2_stage3(self));
    }
  };
}

// waits for the connection to the client
behavior server2(stateful_actor<server2_state, broker>* self) {
  return {
    [=](const new_connection_msg& nc) {
      self->state.accepted += 1;
      self->trigger(nc.source, 5);
      self->become(server2_stage2(self));
    }
  };
}

// -- config and fixture -------------------------------------------------------

struct config : actor_system_config {
  config() {
    auto argc = test::engine::argc();
    auto argv = test::engine::argv();
    load<io::middleman>();
    parse(argc, argv);
  }
};

struct fixture {
  config client_cfg;
  actor_system client_system;
  config server_cfg;
  actor_system server_system;

  fixture() : client_system(client_cfg), server_system(server_cfg) {
    // nop
  }
};

} // namespace <anonymous>

CAF_TEST_FIXTURE_SCOPE(trigger_tests, fixture)

CAF_TEST(trigger_connection) {
  CAF_MESSAGE("spawn server");
  uint16_t port = 0;
  auto serv = server_system.middleman().spawn_server(server1, port);
  CAF_REQUIRE(serv);
  CAF_REQUIRE_NOT_EQUAL(port, 0);
  CAF_MESSAGE("server spawned at port " << port);
  std::thread child{[&] {
    auto cl = client_system.middleman().spawn_client(client, "localhost", port);
    CAF_REQUIRE(cl);
  }};
  child.join();
}

CAF_TEST(trigger_acceptor) {
  CAF_MESSAGE("spawn server");
  uint16_t port = 0;
  auto serv = server_system.middleman().spawn_server(server2, port);
  CAF_REQUIRE(serv);
  CAF_REQUIRE_NOT_EQUAL(port, 0);
  CAF_MESSAGE("server spawned at port " << port);
  std::thread child{[&] {
    // 16 clients will succeed to connect
    for (int i = 0; i < 16; ++i) {
      auto cl = client_system.middleman().spawn_client(client,
                                                       "localhost", port);
      CAF_REQUIRE(cl);
    }
  }};
  child.join();
}

CAF_TEST_FIXTURE_SCOPE_END()


text:
var Router = module.exports = function() {
  this.routes = [];
};

Router.prototype.add = function(method, url, handler) {
  this.routes.push({method: method,
                    url: url,
                    handler: handler});
};

Router.prototype.resolve = function(request, response) {
  var path = require("url").parse(request.url).pathname;

  return this.routes.some(function(route) {
    var match = route.url.exec(path);
    if (!match || route.method != request.method)
      return false;

    var urlParts = match.slice(1).map(decodeURIComponent);
    route.handler.apply(null, [request, response]
                                .concat(urlParts));
    return true;
  });
};


text:
<?php defined('BX_DOL') or die('hack attempt');

class BxPersonsCmts extends BxBaseModProfileCmts
{
    function __construct($sSystem, $iId, $iInit = 1)
    {
    	$this->_sModule = 'bx_persons';

        parent::__construct($sSystem, $iId, $iInit);
    }
}

/** @} */


text:
module Ark
  class GeneralOwner
    def initialize(resource)
      @resource = resource
    end

    attr_reader :resource

    def command
      "chown -R #{resource.owner}:#{resource.group} #{resource.path}"
    end
  end
end


text:
#ifndef SkMatrixParts_DEFINED
#define SkMatrixParts_DEFINED

#include "SkDisplayable.h"
#include "SkMemberInfo.h"
#include "SkPathMeasure.h"

class SkDrawPath;
class SkDrawRect;
class SkPolygon;

class SkDrawMatrix;
// class SkMatrix;

class SkMatrixPart : public SkDisplayable {
public:
    SkMatrixPart();
    virtual bool add() = 0;
    virtual void dirty();
    virtual SkDisplayable* getParent() const;
    virtual bool setParent(SkDisplayable* parent);
#ifdef SK_DEBUG
    virtual bool isMatrixPart() const { return true; }
#endif
protected:
    SkDrawMatrix* fMatrix;
};

class SkRotate : public SkMatrixPart {
    DECLARE_MEMBER_INFO(Rotate);
    SkRotate();
protected:
    virtual bool add();
    SkScalar degrees;
    SkPoint center;
};

class SkScale : public SkMatrixPart {
    DECLARE_MEMBER_INFO(Scale);
    SkScale();
protected:
    virtual bool add();
    SkScalar x;
    SkScalar y;
    SkPoint center;
};

class SkSkew : public SkMatrixPart {
    DECLARE_MEMBER_INFO(Skew);
    SkSkew();
protected:
    virtual bool add();
    SkScalar x;
    SkScalar y;
    SkPoint center;
};

class SkTranslate : public SkMatrixPart {
    DECLARE_MEMBER_INFO(Translate);
    SkTranslate();
protected:
    virtual bool add();
    SkScalar x;
    SkScalar y;
};

class SkFromPath : public SkMatrixPart {
    DECLARE_MEMBER_INFO(FromPath);
    SkFromPath();
    virtual ~SkFromPath();
protected:
    virtual bool add();
    int32_t mode;
    SkScalar offset;
    SkDrawPath* path;
    SkPathMeasure fPathMeasure;
};

class SkRectToRect : public SkMatrixPart {
    DECLARE_MEMBER_INFO(RectToRect);
    SkRectToRect();
    virtual ~SkRectToRect();
#ifdef SK_DUMP_ENABLED
    virtual void dump(SkAnimateMaker* );
#endif
    virtual const SkMemberInfo* preferredChild(SkDisplayTypes type);
protected:
    virtual bool add();
    SkDrawRect* source;
    SkDrawRect* destination;
};

class SkPolyToPoly : public SkMatrixPart {
    DECLARE_MEMBER_INFO(PolyToPoly);
    SkPolyToPoly();
    virtual ~SkPolyToPoly();
#ifdef SK_DUMP_ENABLED
    virtual void dump(SkAnimateMaker* );
#endif
    virtual void onEndElement(SkAnimateMaker& );
    virtual const SkMemberInfo* preferredChild(SkDisplayTypes type);
protected:
    virtual bool add();
    SkPolygon* source;
    SkPolygon* destination;
};

// !!! add concat matrix ?

#endif // SkMatrixParts_DEFINED


text:
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, wrap-iife, no-shadow, consistent-return, one-var, one-var-declaration-per-line, camelcase, default-case, no-new, quotes, no-duplicate-case, no-case-declarations, no-fallthrough, max-len */
/* global UsernameValidator */
/* global ActiveTabMemoizer */
/* global ShortcutsNavigation */
/* global Build */
/* global Issuable */
/* global Issue */
/* global ShortcutsIssuable */
/* global ZenMode */
/* global Milestone */
/* global IssuableForm */
/* global LabelsSelect */
/* global MilestoneSelect */
/* global MergedButtons */
/* global Commit */
/* global NotificationsForm */
/* global TreeView */
/* global NotificationsDropdown */
/* global UsersSelect */
/* global GroupAvatar */
/* global LineHighlighter */
/* global ProjectFork */
/* global BuildArtifacts */
/* global GroupsSelect */
/* global Search */
/* global Admin */
/* global NamespaceSelects */
/* global ShortcutsDashboardNavigation */
/* global Project */
/* global ProjectAvatar */
/* global CompareAutocomplete */
/* global ProjectNew */
/* global Star */
/* global ProjectShow */
/* global Labels */
/* global Shortcuts */

import BindInOut from './behaviors/bind_in_out';
import GroupsList from './groups_list';
import ProjectsList from './projects_list';

const ShortcutsBlob = require('./shortcuts_blob');
const UserCallout = require('./user_callout');

(function() {
  var Dispatcher;

  $(function() {
    return new Dispatcher();
  });

  Dispatcher = (function() {
    function Dispatcher() {
      this.initSearch();
      this.initFieldErrors();
      this.initPageScripts();
    }

    Dispatcher.prototype.initPageScripts = function() {
      var page, path, shortcut_handler;
      page = $('body').attr('data-page');
      if (!page) {
        return false;
      }
      path = page.split(':');
      shortcut_handler = null;
      switch (page) {
        case 'sessions:new':
          new UsernameValidator();
          new ActiveTabMemoizer();
          break;
        case 'projects:boards:show':
        case 'projects:boards:index':
          shortcut_handler = new ShortcutsNavigation();
          break;
        case 'projects:builds:show':
          new Build();
          break;
        case 'projects:merge_requests:index':
        case 'projects:issues:index':
          if (gl.FilteredSearchManager) {
            new gl.FilteredSearchManager(page === 'projects:issues:index' ? 'issues' : 'merge_requests');
          }
          Issuable.init();
          new gl.IssuableBulkActions({
            prefixId: page === 'projects:merge_requests:index' ? 'merge_request_' : 'issue_',
          });
          shortcut_handler = new ShortcutsNavigation();
          break;
        case 'projects:issues:show':
          new Issue();
          shortcut_handler = new ShortcutsIssuable();
          new ZenMode();
          break;
        case 'projects:milestones:show':
        case 'groups:milestones:show':
        case 'dashboard:milestones:show':
          new Milestone();
          break;
        case 'dashboard:todos:index':
          new gl.Todos();
          break;
        case 'dashboard:projects:index':
        case 'dashboard:projects:starred':
        case 'explore:projects:index':
        case 'explore:projects:trending':
        case 'explore:projects:starred':
        case 'admin:projects:index':
          new ProjectsList();
          break;
        case 'dashboard:groups:index':
        case 'explore:groups:index':
          new GroupsList();
          break;
        case 'projects:milestones:new':
        case 'projects:milestones:edit':
        case 'projects:milestones:update':
          new ZenMode();
          new gl.DueDateSelectors();
          new gl.GLForm($('.milestone-form'));
          break;
        case 'groups:milestones:new':
          new ZenMode();
          break;
        case 'projects:compare:show':
          new gl.Diff();
          break;
        case 'projects:branches:index':
          gl.AjaxLoadingSpinner.init();
          break;
        case 'projects:issues:new':
        case 'projects:issues:edit':
          shortcut_handler = new ShortcutsNavigation();
          new gl.GLForm($('.issue-form'));
          new IssuableForm($('.issue-form'));
          new LabelsSelect();
          new MilestoneSelect();
          new gl.IssuableTemplateSelectors();
          break;
        case 'projects:merge_requests:new':
        case 'projects:merge_requests:new_diffs':
        case 'projects:merge_requests:edit':
          new gl.Diff();
          shortcut_handler = new ShortcutsNavigation();
          new gl.GLForm($('.merge-request-form'));
          new IssuableForm($('.merge-request-form'));
          new LabelsSelect();
          new MilestoneSelect();
          new gl.IssuableTemplateSelectors();
          break;
        case 'projects:tags:new':
          new ZenMode();
          new gl.GLForm($('.tag-form'));
          break;
        case 'projects:releases:edit':
          new ZenMode();
          new gl.GLForm($('.release-form'));
          break;
        case 'projects:merge_requests:show':
          new gl.Diff();
          shortcut_handler = new ShortcutsIssuable(true);
          new ZenMode();
          new MergedButtons();
          break;
        case 'projects:merge_requests:commits':
          new MergedButtons();
          break;
        case "projects:merge_requests:diffs":
          new gl.Diff();
          new ZenMode();
          new MergedButtons();
          break;
        case 'dashboard:activity':
          new gl.Activities();
          break;
        case 'projects:commit:show':
          new Commit();
          new gl.Diff();
          new ZenMode();
          shortcut_handler = new ShortcutsNavigation();
          break;
        case 'projects:commit:pipelines':
          new gl.MiniPipelineGraph({
            container: '.js-pipeline-table',
          }).bindEvents();
          break;
        case 'projects:commits:show':
        case 'projects:activity':
          shortcut_handler = new ShortcutsNavigation();
          break;
        case 'projects:show':
          shortcut_handler = new ShortcutsNavigation();
          new NotificationsForm();
          if ($('#tree-slider').length) {
            new TreeView();
          }
          break;
        case 'projects:pipelines:builds':
        case 'projects:pipelines:show':
          const { controllerAction } = document.querySelector('.js-pipeline-container').dataset;

          new gl.Pipelines({
            initTabs: true,
            tabsOptions: {
              action: controllerAction,
              defaultAction: 'pipelines',
              parentEl: '.pipelines-tabs',
            },
          });
          break;
        case 'groups:activity':
          new gl.Activities();
          break;
        case 'groups:show':
          shortcut_handler = new ShortcutsNavigation();
          new NotificationsForm();
          new NotificationsDropdown();
          new ProjectsList();
          break;
        case 'groups:group_members:index':
          new gl.MemberExpirationDate();
          new gl.Members();
          new UsersSelect();
          break;
        case 'projects:members:show':
          new gl.MemberExpirationDate('.js-access-expiration-date-groups');
          new GroupsSelect();
          new gl.MemberExpirationDate();
          new gl.Members();
          new UsersSelect();
          break;
        case 'groups:new':
        case 'admin:groups:new':
        case 'groups:create':
        case 'admin:groups:create':
          BindInOut.initAll();
        case 'groups:new':
        case 'admin:groups:new':
        case 'groups:edit':
        case 'admin:groups:edit':
          new GroupAvatar();
          break;
        case 'projects:tree:show':
          shortcut_handler = new ShortcutsNavigation();
          new TreeView();
          break;
        case 'projects:find_file:show':
          shortcut_handler = true;
          break;
        case 'projects:blob:show':
        case 'projects:blame:show':
          new LineHighlighter();
          shortcut_handler = new ShortcutsNavigation();
          const fileBlobPermalinkUrlElement = document.querySelector('.js-data-file-blob-permalink-url');
          const fileBlobPermalinkUrl = fileBlobPermalinkUrlElement && fileBlobPermalinkUrlElement.getAttribute('href');
          new ShortcutsBlob({
            skipResetBindings: true,
            fileBlobPermalinkUrl,
          });
          break;
        case 'groups:labels:new':
        case 'groups:labels:edit':
        case 'projects:labels:new':
        case 'projects:labels:edit':
          new Labels();
          break;
        case 'projects:labels:index':
          if ($('.prioritized-labels').length) {
            new gl.LabelManager();
          }
          break;
        case 'projects:network:show':
          // Ensure we don't create a particular shortcut handler here. This is
          // already created, where the network graph is created.
          shortcut_handler = true;
          break;
        case 'projects:forks:new':
          new ProjectFork();
          break;
        case 'projects:artifacts:browse':
          new BuildArtifacts();
          break;
        case 'help:index':
          gl.VersionCheckImage.bindErrorEvent($('img.js-version-status-badge'));
          break;
        case 'search:show':
          new Search();
          break;
        case 'projects:repository:show':
          new gl.ProtectedBranchCreate();
          new gl.ProtectedBranchEditList();
          break;
        case 'projects:ci_cd:show':
          new gl.ProjectVariables();
          break;
        case 'ci:lints:create':
        case 'ci:lints:show':
          new gl.CILintEditor();
          break;
        case 'users:show':
          new UserCallout();
          break;
      }
      switch (path.first()) {
        case 'sessions':
        case 'omniauth_callbacks':
          if (!gon.u2f) break;
          gl.u2fAuthenticate = new gl.U2FAuthenticate(
            $('#js-authenticate-u2f'),
            '#js-login-u2f-form',
            gon.u2f,
            document.querySelector('#js-login-2fa-device'),
            document.querySelector('.js-2fa-form'),
          );
          gl.u2fAuthenticate.start();
        case 'admin':
          new Admin();
          switch (path[1]) {
            case 'groups':
              new UsersSelect();
              break;
            case 'projects':
              new NamespaceSelects();
              break;
            case 'labels':
              switch (path[2]) {
                case 'new':
                case 'edit':
                  new Labels();
              }
            case 'abuse_reports':
              new gl.AbuseReports();
              break;
          }
          break;
        case 'dashboard':
        case 'root':
          shortcut_handler = new ShortcutsDashboardNavigation();
          new UserCallout();
          break;
        case 'profiles':
          new NotificationsForm();
          new NotificationsDropdown();
          break;
        case 'projects':
          new Project();
          new ProjectAvatar();
          switch (path[1]) {
            case 'compare':
              new CompareAutocomplete();
              break;
            case 'edit':
              shortcut_handler = new ShortcutsNavigation();
              new ProjectNew();
              break;
            case 'new':
              new ProjectNew();
              break;
            case 'show':
              new Star();
              new ProjectNew();
              new ProjectShow();
              new NotificationsDropdown();
              break;
            case 'wikis':
              new gl.Wikis();
              shortcut_handler = new ShortcutsNavigation();
              new ZenMode();
              new gl.GLForm($('.wiki-form'));
              break;
            case 'snippets':
              shortcut_handler = new ShortcutsNavigation();
              if (path[2] === 'show') {
                new ZenMode();
              }
              break;
            case 'labels':
            case 'graphs':
            case 'compare':
            case 'pipelines':
            case 'forks':
            case 'milestones':
            case 'project_members':
            case 'deploy_keys':
            case 'builds':
            case 'hooks':
            case 'services':
            case 'protected_branches':
              shortcut_handler = new ShortcutsNavigation();
          }
      }
      // If we haven't installed a custom shortcut handler, install the default one
      if (!shortcut_handler) {
        new Shortcuts();
      }
    };

    Dispatcher.prototype.initSearch = function() {
      // Only when search form is present
      if ($('.search').length) {
        return new gl.SearchAutocomplete();
      }
    };

    Dispatcher.prototype.initFieldErrors = function() {
      $('.gl-show-field-errors').each((i, form) => {
        new gl.GlFieldErrors(form);
      });
    };

    return Dispatcher;
  })();
}).call(window);


text:
'use strict';

function ProblemSet () {
    this.data = [];
}

ProblemSet.prototype.initialize = function (numberOfMembers) {
    for(var i = 0; i < numberOfMembers; i++) {
        this.data[i] = i;
    }
};

ProblemSet.prototype.connect = function (first, second) {
    var oldValue = this.data[first];
    for (var i = 0; i < this.data.length; i++) {
        if (this.data[i] === oldValue) {
            this.data[i] = this.data[second];
        }
    }
};

ProblemSet.prototype.areConnected = function (first, second) {

    return this.data[first] === this.data[second];
};

module.exports = {
    ProblemSet: ProblemSet
};


text:
<?php
if(!isset($_SESSION)) session_start();
$ds = DIRECTORY_SEPARATOR;  //1

$storeFolder = '..'.$ds.'uploads';   //2

//$targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds;
//$targetPath = $storeFolder . $ds;

if (!empty($_FILES)) {

    $tempFile = $_FILES['file']['tmp_name'];          //3

    $targetFile = $storeFolder . $ds . $_FILES['file']['name'];  //5

    move_uploaded_file($tempFile, $targetFile); //6

    $_SESSION['uploaded_files'][] = array(
        "filepath" => $targetFile,
        "filename" => $_FILES['file']['name'],
        "filetype" => $_FILES['file']['type']
    );

//    echo 1;
}

if(isset($_POST['remove_file'])) {
    //    $file_to_delete = $_POST['current_file'];

    //    echo $_POST['current_file']['remove_file'] . "\n";
    $file_to_delete = $storeFolder . $ds . $_POST['remove_file']['current_file'];
    //    echo $file_to_delete . "\n";

    //    $arr = array('nice_item', 'remove_me', 'another_liked_item', 'remove_me_also');

    $new_values = array_diff($_SESSION['uploaded_files'], array($file_to_delete));

    //    echo json_encode($new_values);

    $_SESSION['uploaded_files'] = $new_values;

    echo json_encode($_SESSION['uploaded_files']);
    die();
}
else {
    die("Restricted Access. Please turn around and go back the way you came.");
}

//if((isset($_GET) && !empty($_GET)) || (isset($_PUT) && !empty($_PUT))) {
//    die("Restricted Access. Please turn around and go back the way you came.");
//}
//die();


text:
import Ember from 'ember';
import FormMixin from 'open-event-frontend/mixins/form';

const { Component, computed, $ } = Ember;

export default Component.extend(FormMixin, {
  getValidationRules() {
    $.fn.form.settings.rules.checkMaxMin = () => {
      if (this.get('data.minQuantity') > this.get('data.maxQuantity')) {
        return false;
      }
      return true;
    };
    $.fn.form.settings.rules.checkMaxTotal = () => {
      if (this.get('data.maxQuantity') > this.get('data.ticketsNumber')) {
        return false;
      }
      return true;
    };
    return {
      inline : true,
      delay  : false,
      on     : 'blur',

      fields: {
        discountCode: {
          identifier : 'discount_code',
          rules      : [
            {
              type   : 'empty',
              prompt : this.l10n.t('Please enter a discount code')
            },
            {
              type  : 'regExp',
              value : '^[a-zA-Z0-9_-]*$'
            }
          ]
        },
        numberOfdiscountTickets: {
          identifier : 'number_of_discount_tickets',
          rules      : [
            {
              type   : 'empty',
              prompt : this.l10n.t('Please enter the number of tickets')
            }
          ]
        },
        discountAmount: {
          identifier : 'discount_amount',
          rules      : [
            {
              type   : 'empty',
              prompt : this.l10n.t('Please enter the discount amount')
            }
          ]
        },
        discountPercent: {
          identifier : 'discount_percent',
          rules      : [
            {
              type   : 'empty',
              prompt : this.l10n.t('Please enter the discount percentage')
            }
          ]
        },
        allTicketTypes: {
          identifier : 'all_ticket_types',
          rules      : [
            {
              type   : 'checked',
              prompt : this.l10n.t('Please select the appropriate choices')
            }
          ]
        },
        minOrder: {
          identifier : 'min_order',
          optional   : true,
          rules      : [
            {
              type   : 'integer',
              prompt : this.l10n.t('Please enter a valid integer')
            },
            {
              type   : 'checkMaxMin',
              prompt : this.l10n.t('Minimum value should not be greater than maximum')
            }
          ]
        },
        maxOrder: {
          identifier : 'max_order',
          optional   : true,
          rules      : [
            {
              type   : 'integer',
              prompt : this.l10n.t('Please enter a valid integer')
            },
            {
              type   : 'checkMaxMin',
              prompt : this.l10n.t('Maximum value should not be less than minimum')
            },
            {
              type   : 'checkMaxTotal',
              prompt : this.l10n.t('Maximum value should not be greater than number of tickets')
            }
          ]
        }
      }
    };
  },
  discountLink: computed('data.code', function() {
    const params = this.get('routing.router.router.state.params');
    return location.origin + this.get('routing.router').generate('public', params['events.view'].event_id, { queryParams: { discount_code: this.get('data.code') } });
  }),
  actions: {
    submit() {
      this.onValid(() => {
      });
    }
  }
});


text:
// Copyright (c) 2003-present, Jodd Team (jodd.org). All Rights Reserved.

/**
 * Quick and dirty Java transactions management. No JTA, no two-phase commit, no XA, no theory;
 * but - pragmatic.
 */
package jodd.jtx;


text:
/**
  @file   PlotBrazil.cc
  Defines the PlotBrazil class.
  @author Daniel Abercrombie <dabercro@mit.edu>
*/

#include <vector>
#include <fstream>

#include "PlotBrazil.h"

ClassImp(PlotBrazil)

//--------------------------------------------------------------------
PlotBrazil::PlotBrazil( TString fileName )
{

  if (fileName != "")
    ReadConfig(fileName);

  AddLegendEntry("2-#sigma band", 5);
  AddLegendEntry("1-#sigma band", 3);
  AddLegendEntry("Expected", 1, 3, 2);
  AddLegendEntry("Observed", 1, 3, 1);

}

//--------------------------------------------------------------------
PlotBrazil::~PlotBrazil()
{ }

//--------------------------------------------------------------------
void
PlotBrazil::AddPoint ( Double_t point, Double_t observed, Double_t lowest, Double_t low,
                       Double_t mid, Double_t high, Double_t highest )
{

  DisplayFunc(__func__);
  Message(eDebug, "Adding point at %f, observed: %f, limit band: %f, %f, %f, %f, %f",
          point, observed, lowest, low, mid, high, highest);

  Int_t Npoint = fObserved.GetN();

  // Set the single lines

  fObserved.SetPoint(Npoint, point, observed);
  fObserved.SetPointError(Npoint, 0.0, 0.0);
  fExpected.SetPoint(Npoint, point, mid);
  fExpected.SetPointError(Npoint, 0.0, 0.0);

  // Make the bands

  fOneSigma.SetPoint(Npoint, point, (low + high)/2);
  fOneSigma.SetPointError(Npoint, 0.0, (high - low)/2);

  fTwoSigma.SetPoint(Npoint, point, (lowest + highest)/2);
  fTwoSigma.SetPointError(Npoint, 0.0, (highest - lowest)/2);

  // Sort everything, just in case

  fExpected.Sort();
  fObserved.Sort();
  fOneSigma.Sort();
  fTwoSigma.Sort();

}

//--------------------------------------------------------------------
void
PlotBrazil::ReadConfig(TString filename)
{

  DisplayFunc(__func__);
  Message(eInfo, "Reading config file: %s", filename.Data());

  std::ifstream configFile;
  configFile.open(filename.Data());
  TString xVal;
  TString observed;
  TString lowest, low, mid, high, highest;
  Bool_t reading = true;

  while (reading) {
    configFile >> xVal >> observed >> lowest >> low >> mid >> high >> highest;
    if (highest != "")
      AddPoint(xVal.Atof(), observed.Atof(), lowest.Atof(), low.Atof(),
               mid.Atof(), high.Atof(), highest.Atof());
    else
      reading = false;
  }

  configFile.close();

}

//--------------------------------------------------------------------
void
PlotBrazil::MakePlot(TString FileBase, TString XLabel, TString YLabel,
                     Bool_t logY, Bool_t logX)
{

  std::vector<TGraphErrors*> theLines;

  fTwoSigma.SetFillColor(5);
  fOneSigma.SetFillColor(3);
  fTwoSigma.SetFillStyle(1001);
  fOneSigma.SetFillStyle(1001);

  theLines.push_back(&fTwoSigma);
  theLines.push_back(&fOneSigma);
  theLines.push_back(&fExpected);
  theLines.push_back(&fObserved);

  SetDrawFirst(0);

  BaseCanvas(FileBase, theLines, XLabel, YLabel, logY, logX);

}


text:
/**
 * Created by Wayne on 16/3/17.
 */

'use strict';

tender.factory('CommonHelper', ['GlobalEvent', function (GlobalEvent) {

  var commonHelper = {
    showAlert: function (scope, info) {
      return scope.$emit(GlobalEvent.onShowAlert, info);
    }
  };

  return commonHelper;
}]);


text:
namespace gpu {
namespace gles2 {

class MockCopyTexImageResourceManager final
    : public CopyTexImageResourceManager {
 public:
  MockCopyTexImageResourceManager(const gles2::FeatureInfo* feature_info);

  MockCopyTexImageResourceManager(const MockCopyTexImageResourceManager&) =
      delete;
  MockCopyTexImageResourceManager& operator=(
      const MockCopyTexImageResourceManager&) = delete;

  ~MockCopyTexImageResourceManager() final;

  MOCK_METHOD1(Initialize, void(const DecoderContext* decoder));
  MOCK_METHOD0(Destroy, void());

  // Cannot MOCK_METHOD more than 10 args.
  void DoCopyTexImage2DToLUMACompatibilityTexture(
      const DecoderContext* decoder,
      GLuint dest_texture,
      GLenum dest_texture_target,
      GLenum dest_target,
      GLenum luma_format,
      GLenum luma_type,
      GLint level,
      GLenum internal_format,
      GLint x,
      GLint y,
      GLsizei width,
      GLsizei height,
      GLuint source_framebuffer,
      GLenum source_framebuffer_internal_format) override {}

  void DoCopyTexSubImageToLUMACompatibilityTexture(
      const DecoderContext* decoder,
      GLuint dest_texture,
      GLenum dest_texture_target,
      GLenum dest_target,
      GLenum luma_format,
      GLenum luma_type,
      GLint level,
      GLint xoffset,
      GLint yoffset,
      GLint zoffset,
      GLint x,
      GLint y,
      GLsizei width,
      GLsizei height,
      GLuint source_framebuffer,
      GLenum source_framebuffer_internal_format) override {}
};

class MockCopyTextureResourceManager final
    : public CopyTextureCHROMIUMResourceManager {
 public:
  MockCopyTextureResourceManager();

  MockCopyTextureResourceManager(const MockCopyTextureResourceManager&) =
      delete;
  MockCopyTextureResourceManager& operator=(
      const MockCopyTextureResourceManager&) = delete;

  ~MockCopyTextureResourceManager() final;

  MOCK_METHOD2(Initialize,
               void(const DecoderContext* decoder,
                    const gles2::FeatureInfo::FeatureFlags& feature_flags));
  MOCK_METHOD0(Destroy, void());

  // Cannot MOCK_METHOD more than 10 args.
  void DoCopyTexture(
      DecoderContext* decoder,
      GLenum source_target,
      GLuint source_id,
      GLint source_level,
      GLenum source_internal_format,
      GLenum dest_target,
      GLuint dest_id,
      GLint dest_level,
      GLenum dest_internal_format,
      GLsizei width,
      GLsizei height,
      bool flip_y,
      bool premultiply_alpha,
      bool unpremultiply_alpha,
      CopyTextureMethod method,
      CopyTexImageResourceManager* luma_emulation_blitter) override {}
  void DoCopySubTexture(
      DecoderContext* decoder,
      GLenum source_target,
      GLuint source_id,
      GLint source_level,
      GLenum source_internal_format,
      GLenum dest_target,
      GLuint dest_id,
      GLint dest_level,
      GLenum dest_internal_format,
      GLint xoffset,
      GLint yoffset,
      GLint x,
      GLint y,
      GLsizei width,
      GLsizei height,
      GLsizei dest_width,
      GLsizei dest_height,
      GLsizei source_width,
      GLsizei source_height,
      bool flip_y,
      bool premultiply_alpha,
      bool unpremultiply_alpha,
      CopyTextureMethod method,
      CopyTexImageResourceManager* luma_emulation_blitter) override {}
};

}  // namespace gles2
}  // namespace gpu

#endif  // GPU_COMMAND_BUFFER_SERVICE_COPY_TEXTURE_CHROMIUM_MOCK_H_


text:
Renewal Dashboard is a dashboard plugin meant to be a wrapper for managing client wordpress dashboards while changing the dashboard view to provide a better experience in a controlled environment.

Possible integration with Redux Framework for a combo package of:
- Foundation - JointsWP and/or Bootstrap Base Theme
- Redux Framework
- Renewal Dashboard

### What comes with Renewal Dashboard?
Features will be added here.

- Feature 1
- Feature 2
- Feature 3
- Feature 4
- Feature 5

### What tools do I need to use Renewal Dashboard?
Upload the plugin zip to your wordpress site.


text:
package io.js.J2V8Interop;

import java.lang.reflect.Method;
import java.util.HashMap;

// TODO: this is just used experimentally, the algorithmic usage needs to be clarified/solidified
public class JavaTypeEntry {
    private HashMap<Integer, Method> methods = new HashMap<Integer, Method>();

    public void addMethod(int hash, Method method) {
        methods.put(hash, method);
    }

    public Method getMethod(int hash) {
        return methods.get(hash);
    }
}


text: Sandbox for Spring Boot experiments


text:
// Copyright 2018 Google Inc.
//
// 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.
//
///////////////////////////////////////////////////////////////////////////////

#include "tink/subtle/rsa_ssa_pkcs1_verify_boringssl.h"

#include <iostream>
#include <string>
#include <utility>

#include "gtest/gtest.h"
#include "absl/status/status.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "openssl/bn.h"
#include "include/rapidjson/document.h"
#include "tink/config/tink_fips.h"
#include "tink/internal/err_util.h"
#include "tink/internal/rsa_util.h"
#include "tink/internal/ssl_unique_ptr.h"
#include "tink/public_key_sign.h"
#include "tink/public_key_verify.h"
#include "tink/subtle/common_enums.h"
#include "tink/subtle/wycheproof_util.h"
#include "tink/util/status.h"
#include "tink/util/statusor.h"
#include "tink/util/test_matchers.h"

namespace crypto {
namespace tink {
namespace subtle {
namespace {

using ::crypto::tink::test::IsOk;
using ::crypto::tink::test::StatusIs;

class RsaSsaPkcs1VerifyBoringSslTest : public ::testing::Test {};

// Test vector from
// https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/Digital-Signatures
struct NistTestVector {
  std::string n;
  std::string e;
  std::string message;
  std::string signature;
  HashType sig_hash;
};

static const NistTestVector nist_test_vector{
    absl::HexStringToBytes(
        "c47abacc2a84d56f3614d92fd62ed36ddde459664b9301dcd1d61781cfcc026bcb2399"
        "bee7e75681a80b7bf500e2d08ceae1c42ec0b707927f2b2fe92ae852087d25f1d260cc"
        "74905ee5f9b254ed05494a9fe06732c3680992dd6f0dc634568d11542a705f83ae96d2"
        "a49763d5fbb24398edf3702bc94bc168190166492b8671de874bb9cecb058c6c8344aa"
        "8c93754d6effcd44a41ed7de0a9dcd9144437f212b18881d042d331a4618a9e630ef9b"
        "b66305e4fdf8f0391b3b2313fe549f0189ff968b92f33c266a4bc2cffc897d1937eeb9"
        "e406f5d0eaa7a14782e76af3fce98f54ed237b4a04a4159a5f6250a296a902880204e6"
        "1d891c4da29f2d65f34cbb"),
    absl::HexStringToBytes("49d2a1"),
    absl::HexStringToBytes(
        "95123c8d1b236540b86976a11cea31f8bd4e6c54c235147d20ce722b03a6ad756fbd91"
        "8c27df8ea9ce3104444c0bbe877305bc02e35535a02a58dcda306e632ad30b3dc3ce0b"
        "a97fdf46ec192965dd9cd7f4a71b02b8cba3d442646eeec4af590824ca98d74fbca934"
        "d0b6867aa1991f3040b707e806de6e66b5934f05509bea"),
    absl::HexStringToBytes(
        "51265d96f11ab338762891cb29bf3f1d2b3305107063f5f3245af376dfcc7027d39365"
        "de70a31db05e9e10eb6148cb7f6425f0c93c4fb0e2291adbd22c77656afc196858a11e"
        "1c670d9eeb592613e69eb4f3aa501730743ac4464486c7ae68fd509e896f63884e9424"
        "f69c1c5397959f1e52a368667a598a1fc90125273d9341295d2f8e1cc4969bf228c860"
        "e07a3546be2eeda1cde48ee94d062801fe666e4a7ae8cb9cd79262c017b081af874ff0"
        "0453ca43e34efdb43fffb0bb42a4e2d32a5e5cc9e8546a221fe930250e5f5333e0efe5"
        "8ffebf19369a3b8ae5a67f6a048bc9ef915bda25160729b508667ada84a0c27e7e26cf"
        "2abca413e5e4693f4a9405"),
    HashType::SHA256};

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, BasicVerify) {
  if (IsFipsModeEnabled()) {
    GTEST_SKIP() << "Test not run in FIPS-only mode";
  }

  internal::RsaPublicKey pub_key{nist_test_vector.n, nist_test_vector.e};
  internal::RsaSsaPkcs1Params params{nist_test_vector.sig_hash};

  auto verifier_result = RsaSsaPkcs1VerifyBoringSsl::New(pub_key, params);
  ASSERT_TRUE(verifier_result.ok()) << verifier_result.status();
  auto verifier = std::move(verifier_result.value());
  auto status =
      verifier->Verify(nist_test_vector.signature, nist_test_vector.message);
  EXPECT_TRUE(status.ok()) << status << internal::GetSslErrors();
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, NewErrors) {
  if (IsFipsModeEnabled()) {
    GTEST_SKIP() << "Test not run in FIPS-only mode";
  }

  internal::RsaPublicKey nist_pub_key{nist_test_vector.n, nist_test_vector.e};
  internal::RsaSsaPkcs1Params nist_params{nist_test_vector.sig_hash};
  internal::RsaPublicKey small_pub_key{std::string("\x23"), std::string("\x3")};
  internal::RsaSsaPkcs1Params sha1_hash_params{HashType::SHA1};

  {  // Small modulus.
    auto result = RsaSsaPkcs1VerifyBoringSsl::New(small_pub_key, nist_params);
    EXPECT_FALSE(result.ok());
    EXPECT_EQ(absl::StatusCode::kInvalidArgument, result.status().code());
    EXPECT_PRED_FORMAT2(testing::IsSubstring,
                        "only modulus size >= 2048-bit is supported",
                        std::string(result.status().message()));
  }

  {  // Use SHA1 for digital signature.
    auto result =
        RsaSsaPkcs1VerifyBoringSsl::New(nist_pub_key, sha1_hash_params);
    EXPECT_FALSE(result.ok());
    EXPECT_EQ(absl::StatusCode::kInvalidArgument, result.status().code());
    EXPECT_PRED_FORMAT2(testing::IsSubstring,
                        "SHA1 is not safe for digital signature",
                        std::string(result.status().message()));
  }
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, Modification) {
  if (IsFipsModeEnabled()) {
    GTEST_SKIP() << "Test not run in FIPS-only mode";
  }

  internal::RsaPublicKey pub_key{nist_test_vector.n, nist_test_vector.e};
  internal::RsaSsaPkcs1Params params{nist_test_vector.sig_hash};

  auto verifier_result = RsaSsaPkcs1VerifyBoringSsl::New(pub_key, params);
  ASSERT_TRUE(verifier_result.ok()) << verifier_result.status();
  auto verifier = std::move(verifier_result.value());
  // Modify the message.
  for (std::size_t i = 0; i < nist_test_vector.message.length(); i++) {
    std::string modified_message = nist_test_vector.message;
    modified_message[i / 8] ^= 1 << (i % 8);
    auto status =
        verifier->Verify(nist_test_vector.signature, modified_message);
    EXPECT_FALSE(status.ok()) << status << internal::GetSslErrors();
  }
  // Modify the signature.
  for (std::size_t i = 0; i < nist_test_vector.signature.length(); i++) {
    std::string modified_signature = nist_test_vector.signature;
    modified_signature[i / 8] ^= 1 << (i % 8);
    auto status =
        verifier->Verify(modified_signature, nist_test_vector.message);
    EXPECT_FALSE(status.ok()) << status << internal::GetSslErrors();
  }
  // Truncate the signature.
  for (std::size_t i = 0; i < nist_test_vector.signature.length(); i++) {
    std::string truncated_signature(nist_test_vector.signature, 0, i);
    auto status =
        verifier->Verify(truncated_signature, nist_test_vector.message);
    EXPECT_FALSE(status.ok()) << status << internal::GetSslErrors();
  }
}

static util::StatusOr<std::unique_ptr<RsaSsaPkcs1VerifyBoringSsl>> GetVerifier(
    const rapidjson::Value& test_group) {
  internal::RsaPublicKey key;
  key.n = WycheproofUtil::GetInteger(test_group["n"]);
  key.e = WycheproofUtil::GetInteger(test_group["e"]);

  HashType md = WycheproofUtil::GetHashType(test_group["sha"]);
  internal::RsaSsaPkcs1Params params;
  params.hash_type = md;

  auto result = RsaSsaPkcs1VerifyBoringSsl::New(key, params);
  if (!result.ok()) {
    std::cout << "Failed: " << result.status() << "\n";
  }
  return result;
}

// Tests signature verification using the test vectors in the specified file.
// allow_skipping determines whether it is OK to skip a test because
// a verfier cannot be constructed. This option can be used for
// if a file contains test vectors that are not necessarily supported
// by tink.
bool TestSignatures(const std::string& filename, bool allow_skipping) {
  std::unique_ptr<rapidjson::Document> root =
      WycheproofUtil::ReadTestVectors(filename);
  std::cout << (*root)["algorithm"].GetString();
  std::cout << "generator version " << (*root)["generatorVersion"].GetString();
  std::cout << "expected version 0.4.12";
  int passed_tests = 0;
  int failed_tests = 0;
  int group_count = 0;
  for (const rapidjson::Value& test_group : (*root)["testGroups"].GetArray()) {
    group_count++;
    auto verifier_result = GetVerifier(test_group);
    if (!verifier_result.ok()) {
      std::string type = test_group["type"].GetString();
      if (allow_skipping) {
        std::cout << "Could not construct verifier for " << type << " group "
                  << group_count << ": " << verifier_result.status();
      } else {
        ADD_FAILURE() << "Could not construct verifier for " << type
                      << " group " << group_count << ": "
                      << verifier_result.status();
        failed_tests += test_group["tests"].GetArray().Size();
      }
      continue;
    }
    auto verifier = std::move(verifier_result.value());
    for (const rapidjson::Value& test : test_group["tests"].GetArray()) {
      std::string expected = test["result"].GetString();
      std::string msg = WycheproofUtil::GetBytes(test["msg"]);
      std::string sig = WycheproofUtil::GetBytes(test["sig"]);
      std::string id =
          absl::StrCat(test["tcId"].GetInt(), " ", test["comment"].GetString());
      auto status = verifier->Verify(sig, msg);
      if (expected == "valid") {
        if (status.ok()) {
          ++passed_tests;
        } else {
          ++failed_tests;
          ADD_FAILURE() << "Valid signature not verified:" << id
                        << " status:" << status;
        }
      } else if (expected == "invalid") {
        if (!status.ok()) {
          ++passed_tests;
        } else {
          ++failed_tests;
          ADD_FAILURE() << "Invalid signature verified:" << id;
        }
      } else if (expected == "acceptable") {
        // The validity of the signature is undefined. Hence the test passes
        // but we log the result since we might still want to know if the
        // library is strict or forgiving.
        ++passed_tests;
        std::cout << "Acceptable signature:" << id << ":" << status;
      } else {
        ++failed_tests;
        ADD_FAILURE() << "Invalid field result:" << expected;
      }
    }
  }
  int num_tests = (*root)["numberOfTests"].GetInt();
  std::cout << "total number of tests: " << num_tests;
  std::cout << "number of tests passed:" << passed_tests;
  std::cout << "number of tests failed:" << failed_tests;
  return failed_tests == 0;
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, WycheproofRsaPkcs12048SHA256) {
  if (IsFipsModeEnabled()) {
    GTEST_SKIP() << "Test not run in FIPS-only mode";
  }
  ASSERT_TRUE(TestSignatures("rsa_signature_2048_sha256_test.json",
                             /*allow_skipping=*/true));
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, WycheproofRsaPkcs13072SHA256) {
  if (IsFipsModeEnabled() && !FIPS_mode()) {
    GTEST_SKIP()
        << "Test is skipped if kOnlyUseFips but BoringCrypto is unavailable.";
  }
  ASSERT_TRUE(TestSignatures("rsa_signature_3072_sha256_test.json",
                             /*allow_skipping=*/true));
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, WycheproofRsaPkcs13072SHA512) {
  if (IsFipsModeEnabled() && !FIPS_mode()) {
    GTEST_SKIP()
        << "Test is skipped if kOnlyUseFips but BoringCrypto is unavailable.";
  }
  ASSERT_TRUE(TestSignatures("rsa_signature_3072_sha512_test.json",
                             /*allow_skipping=*/true));
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, WycheproofRsaPkcs14096SHA512) {
  if (IsFipsModeEnabled()) {
    GTEST_SKIP() << "Test not run in FIPS-only mode";
  }
  ASSERT_TRUE(TestSignatures("rsa_signature_4096_sha512_test.json",
                             /*allow_skipping=*/true));
}

// FIPS-only mode test
TEST_F(RsaSsaPkcs1VerifyBoringSslTest, TestFipsFailWithoutBoringCrypto) {
  if (!IsFipsModeEnabled() || FIPS_mode()) {
    GTEST_SKIP()
        << "Test assumes kOnlyUseFips but BoringCrypto is unavailable.";
  }

  internal::RsaPublicKey pub_key{nist_test_vector.n, nist_test_vector.e};
  internal::RsaSsaPkcs1Params params{/*sig_hash=*/HashType::SHA256};
  EXPECT_THAT(RsaSsaPkcs1VerifyBoringSsl::New(pub_key, params).status(),
              StatusIs(absl::StatusCode::kInternal));
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, TestAllowedFipsModuli) {
  if (!IsFipsModeEnabled() || !FIPS_mode()) {
    GTEST_SKIP() << "Test assumes kOnlyUseFips and BoringCrypto.";
  }

  internal::SslUniquePtr<BIGNUM> rsa_f4(BN_new());
  internal::RsaPrivateKey private_key;
  internal::RsaPublicKey public_key;
  BN_set_word(rsa_f4.get(), RSA_F4);

  EXPECT_THAT(
      internal::NewRsaKeyPair(3072, rsa_f4.get(), &private_key, &public_key),
      IsOk());

  internal::RsaSsaPkcs1Params params{/*sig_hash=*/HashType::SHA256};
  EXPECT_THAT(RsaSsaPkcs1VerifyBoringSsl::New(public_key, params).status(),
              IsOk());
}

TEST_F(RsaSsaPkcs1VerifyBoringSslTest, TestRestrictedFipsModuli) {
  if (!IsFipsModeEnabled() || !FIPS_mode()) {
    GTEST_SKIP() << "Test assumes kOnlyUseFips and BoringCrypto.";
  }

  internal::SslUniquePtr<BIGNUM> rsa_f4(BN_new());
  internal::RsaPrivateKey private_key;
  internal::RsaPublicKey public_key;
  internal::RsaSsaPkcs1Params params{/*sig_hash=*/HashType::SHA256};
  BN_set_word(rsa_f4.get(), RSA_F4);

  EXPECT_THAT(
      internal::NewRsaKeyPair(2560, rsa_f4.get(), &private_key, &public_key),
      IsOk());

  EXPECT_THAT(RsaSsaPkcs1VerifyBoringSsl::New(public_key, params).status(),
              StatusIs(absl::StatusCode::kInternal));

  EXPECT_THAT(
      internal::NewRsaKeyPair(4096, rsa_f4.get(), &private_key, &public_key),
      IsOk());

  EXPECT_THAT(RsaSsaPkcs1VerifyBoringSsl::New(public_key, params).status(),
              StatusIs(absl::StatusCode::kInternal));
}

}  // namespace
}  // namespace subtle
}  // namespace tink
}  // namespace crypto


text:
@class JJTabBar;
@protocol JJTabBarDelegate <NSObject,UITabBarDelegate>

- (void)tabBar:(JJTabBar *)tabbar plusBtnDidClick:(UIButton *)btn;

@end

@interface JJTabBar : UITabBar

@property(nonatomic,weak) id <JJTabBarDelegate> delegate;

@end


text:
module Azure::AlertsManagement::Mgmt::V2019_05_05_preview
  module Models
    #
    # Defines values for SuppressionType
    #
    module SuppressionType
      Always = "Always"
      Once = "Once"
      Daily = "Daily"
      Weekly = "Weekly"
      Monthly = "Monthly"
    end
  end
end


text:
layout: media
title: "Ancestral state reconstruction"
categories: arborapps otsapps
excerpt: "Reconstruct character evolution on a phylogenetic tree."
ads: true
share: false
image:
  feature: branch-1600x800.jpg
  teaser: branch-400x250.jpg
  credit: Michael Rose

---

<meta http-equiv="refresh" content="0;url=http://52.204.46.78/ancestral-state/">

You should be automatically forwarded to the Arbor app. If not, click here.


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>MSF Telemed</title>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

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

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  <link rel="stylesheet" href="dist/css/AdminLTE.css">

  <link rel="stylesheet" href="dist/css/skins/_all-skins.css">

  <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">

  <link rel="stylesheet" href="plugins/iCheck/all.css">

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

  <link rel="stylesheet" href="plugins/select2/select2.css">

      MSF

      MSFTelemed

        Toggle navigation

      <form class="navbar-form navbar-left hidden-xs">

          <input type="text" class="form-control form-search" placeholder="Search">

        <button type="submit" class="btn btn-search"></button>
      </form>

              10

You have 10 notifications

                       5 new members joined today

                       Very long description here that may not fit into the
                      page and may cause design problems

                       5 new members joined

                       25 sales made

                       You changed your username

View all

              4

You have 4 messages

                        Support Team
                         5 mins

Why not buy a new awesome theme?

                        AdminLTE Design Team
                         2 hours

Why not buy a new awesome theme?

                        Developers
                         Today

Why not buy a new awesome theme?

                        Sales Department
                         Yesterday

Why not buy a new awesome theme?

                        Reviewers
                         2 days

Why not buy a new awesome theme?

See All Messages

                  Jane Doe - Internal Specialist
                  Member since Nov. 2012

                    Profile

                  Settings

                  Sign out

Jane Doe

         Online

        <form class="navbar-form visible-xs" role="search">

            <input type="text" class="form-control" placeholder="Search" name="q">

                <button class="btn btn-default" type="submit"></button>

        </form>

NAVIGATION

           Home

           New Projects

           My Contacts

           Recent Events

           Files

           Management

 Dashboard

 My Company

           Logout

My Company

        Lorem Ipsum

Your Company Name

              Your Slogan Here

              Company Description

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dictum orci orci, vel gravida ante blandit eget. Ut efficitur dapibus tincidunt. Nulla lectus metus, volutpat ut massa nec, iaculis mattis metus. Fusce efficitur mattis congue. Mauris dapibus elit quis massa convallis semper. Praesent vitae dui vel dolor mollis maximus. Mauris vel hendrerit nisi. Sed faucibus sit amet ligula vitae euismod. Nam condimentum justo id sem mollis accumsan id in arcu. Quisque ac lacus a elit ullamcorper tempor eu eu ante.

              Size Overview

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dictum orci orci

              Economic Activity

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dictum orci orci

              Country

United State

              Website

www.yoursite.com

              Company Contact

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dictum orci orci

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Lorem ipsum dolor sit amet, consectetur adipiscing elit

      Version 2.3.8

    Copyright © 2017 MSF Telemed. All rights
    reserved.


text:
// TransportWindow.h
//
// * PURPOSE
//   Standalone window container for the group/node inspectors.
// * HISTORY
//   e.moon		18aug99		Begun

#ifndef __TransportWindow_H__
#define __TransportWindow_H__

#include <Window.h>

#include "cortex_defs.h"
__BEGIN_CORTEX_NAMESPACE

class TransportView;
class NodeManager;
class RouteWindow;

class TransportWindow :
	public	BWindow {
	typedef	BWindow _inherited;

public:											// *** messages
	enum message_t {
		// groupID: int32
		M_SELECT_GROUP					= TransportWindow_message_base
	};

public:											// *** ctors/dtor
	virtual ~TransportWindow();

	TransportWindow(
		NodeManager*						manager,
		BWindow*								parent,
		const char*							name);

	BMessenger parentWindow() const;

public:											// *** BHandler
	virtual void MessageReceived(
		BMessage*								message);

public:											// *** BWindow
	virtual bool QuitRequested();

private:
	TransportView*						m_view;
	BWindow*									m_parent;

	void _togglePlayback(); //nyi
};

__END_CORTEX_NAMESPACE
#endif /*__TransportWindow_H__*/


text:
namespace vmcs_n = ::intel_x64::vmcs;

// -----------------------------------------------------------------------------
// Aliases
// -----------------------------------------------------------------------------

using vmcs_t = bfvmm::intel_x64::vmcs;
using exit_handler_t = bfvmm::intel_x64::exit_handler;

// -----------------------------------------------------------------------------
// Definitions
// -----------------------------------------------------------------------------

namespace eapis
{
namespace intel_x64
{

/// Base
///
/// Provides an interface for shared features of handlers for the various
/// exit reasons. New exit reasons may be handled by extending this class
/// with the relevant exit-reason-specific code.
///
class EXPORT_EAPIS_HVE base
{

public:

    /// Default Constructor
    ///
    /// @expects
    /// @ensures
    ///
    base() = default;

    /// Destructor
    ///
    /// @expects
    /// @ensures
    ///
    virtual ~base() = default;

public:

    /// Enable Log
    ///
    /// Example:
    /// @code
    /// this->enable_log();
    /// @endcode
    ///
    /// @expects
    /// @ensures
    ///
    void enable_log()
    { m_log_enabled = true; }

    /// Disable Log
    ///
    /// Example:
    /// @code
    /// this->disable_log();
    /// @endcode
    ///
    /// @expects
    /// @ensures
    ///
    void disable_log()
    { m_log_enabled = false; }

    /// Dump Log
    ///
    /// Example:
    /// @code
    /// this->dump_log();
    /// @endcode
    ///
    /// @expects
    /// @ensures
    ///
    virtual void dump_log() = 0;

    /// Add Record to Log
    ///
    /// Example:
    /// @code
    /// this->add_record();
    /// @endcode
    ///
    /// @expects
    /// @ensures
    ///
    /// @param log The log to add a record to
    /// @param record The record to add to the log
    ///
    template<typename T> void
    add_record(std::list<T> &log, const T &record)
    {
        if (log.size() < EAPIS_LOG_MAX) {
            log.push_back(record);
        }
    }

protected:

    /// Log enabled
    ///
    /// If true, *each* class derived from base will log exit-reason-specific
    /// information on exit (provided also that NDEBUG == 0).
    //
    bool m_log_enabled{false};

public:

    /// @cond

    base(base &&) = default;
    base &operator=(base &&) = default;

    base(const base &) = delete;
    base &operator=(const base &) = delete;

    /// @endcond
};

}
}

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#endif


text:
package topics

import (
	"encoding/json"

	"fmt"
	"github.com/Financial-Times/neo-utils-go/neoutils"
	"github.com/jmcvetta/neoism"
)

type service struct {
	conn neoutils.NeoConnection
}

// NewCypherTopicsService provides functions for create, update, delete operations on topics in Neo4j,
// plus other utility functions needed for a service
func NewCypherTopicsService(cypherRunner neoutils.NeoConnection) service {
	return service{cypherRunner}
}

func (s service) Initialise() error {
	return s.conn.EnsureConstraints(map[string]string{
		"Thing":             "uuid",
		"Concept":           "uuid",
		"Topic":             "uuid",
		"TMEIdentifier":     "value",
		"UPPIdentifier":     "value"})
}

func (s service) Read(uuid string) (interface{}, bool, error) {
	results := []Topic{}

	query := &neoism.CypherQuery{
		Statement: `MATCH (n:Topic {uuid:{uuid}})
OPTIONAL MATCH (upp:UPPIdentifier)-[:IDENTIFIES]->(n)
OPTIONAL MATCH (tme:TMEIdentifier)-[:IDENTIFIES]->(n)
return distinct n.uuid as uuid, n.prefLabel as prefLabel, labels(n) as types, {uuids:collect(distinct upp.value), TME:collect(distinct tme.value)} as alternativeIdentifiers`,
		Parameters: map[string]interface{}{
			"uuid": uuid,
		},
		Result: &results,
	}

	err := s.conn.CypherBatch([]*neoism.CypherQuery{query})

	if err != nil {
		return Topic{}, false, err
	}

	if len(results) == 0 {
		return Topic{}, false, nil
	}

	return results[0], true, nil
}

func (s service) Write(thing interface{}) error {

	topic := thing.(Topic)

	//cleanUP all the previous IDENTIFIERS referring to that uuid
	deletePreviousIdentifiersQuery := &neoism.CypherQuery{
		Statement: `MATCH (t:Thing {uuid:{uuid}})
		OPTIONAL MATCH (t)<-[iden:IDENTIFIES]-(i)
		DELETE iden, i`,
		Parameters: map[string]interface{}{
			"uuid": topic.UUID,
		},
	}

	//create-update node for TOPIC
	createTopicQuery := &neoism.CypherQuery{
		Statement: `MERGE (n:Thing {uuid: {uuid}})
					set n={allprops}
					set n :Concept
					set n :Topic
		`,
		Parameters: map[string]interface{}{
			"uuid": topic.UUID,
			"allprops": map[string]interface{}{
				"uuid":      topic.UUID,
				"prefLabel": topic.PrefLabel,
			},
		},
	}

	queryBatch := []*neoism.CypherQuery{deletePreviousIdentifiersQuery, createTopicQuery}

	//ADD all the IDENTIFIER nodes and IDENTIFIES relationships
	for _, alternativeUUID := range topic.AlternativeIdentifiers.TME {
		alternativeIdentifierQuery := createNewIdentifierQuery(topic.UUID, tmeIdentifierLabel, alternativeUUID)
		queryBatch = append(queryBatch, alternativeIdentifierQuery)
	}

	for _, alternativeUUID := range topic.AlternativeIdentifiers.UUIDS {
		alternativeIdentifierQuery := createNewIdentifierQuery(topic.UUID, uppIdentifierLabel, alternativeUUID)
		queryBatch = append(queryBatch, alternativeIdentifierQuery)
	}

	return s.conn.CypherBatch(queryBatch)

}

func createNewIdentifierQuery(uuid string, identifierLabel string, identifierValue string) *neoism.CypherQuery {
	statementTemplate := fmt.Sprintf(`MERGE (t:Thing {uuid:{uuid}})
					CREATE (i:Identifier {value:{value}})
					MERGE (t)<-[:IDENTIFIES]-(i)
					set i : %s `, identifierLabel)
	query := &neoism.CypherQuery{
		Statement: statementTemplate,
		Parameters: map[string]interface{}{
			"uuid":  uuid,
			"value": identifierValue,
		},
	}
	return query
}

func (s service) Delete(uuid string) (bool, error) {
	clearNode := &neoism.CypherQuery{
		Statement: `
			MATCH (t:Thing {uuid: {uuid}})
			OPTIONAL MATCH (t)<-[iden:IDENTIFIES]-(i:Identifier)
			REMOVE t:Concept
			REMOVE t:Topic
			DELETE iden, i
			SET t = {uuid:{uuid}}
		`,
		Parameters: map[string]interface{}{
			"uuid": uuid,
		},
		IncludeStats: true,
	}

	removeNodeIfUnused := &neoism.CypherQuery{
		Statement: `
			MATCH (t:Thing {uuid: {uuid}})
			OPTIONAL MATCH (t)-[a]-(x)
			WITH t, count(a) AS relCount
			WHERE relCount = 0
			DELETE t
		`,
		Parameters: map[string]interface{}{
			"uuid": uuid,
		},
	}

	err := s.conn.CypherBatch([]*neoism.CypherQuery{clearNode, removeNodeIfUnused})

	s1, err := clearNode.Stats()
	if err != nil {
		return false, err
	}

	var deleted bool
	if s1.ContainsUpdates && s1.LabelsRemoved > 0 {
		deleted = true
	}

	return deleted, err
}

func (s service) DecodeJSON(dec *json.Decoder) (interface{}, string, error) {
	sub := Topic{}
	err := dec.Decode(&sub)
	return sub, sub.UUID, err
}

func (s service) Check() error {
	return neoutils.Check(s.conn)
}

func (s service) Count() (int, error) {

	results := []struct {
		Count int `json:"c"`
	}{}

	query := &neoism.CypherQuery{
		Statement: `MATCH (n:Topic) return count(n) as c`,
		Result:    &results,
	}

	err := s.conn.CypherBatch([]*neoism.CypherQuery{query})

	if err != nil {
		return 0, err
	}

	return results[0].Count, nil
}


text:
import Xen from '../xen/xen.js';

class MagentaVisualizer extends Xen.Base {
  get template() {
    return Xen.html`

      <canvas id="canvas" width="400" height="300"></canvas>

        <button id="start" class="button" on-click="onStart">Start</button>
        <button id="stop" class="button" on-click="onStop">Stop</button>

    `;
  }

  static get observedAttributes() {
    return ['notes'];
  }

  _didMount() {
    this.canvas = this.host.getElementById('canvas');
  }

  _render(props, state) {
    this.initPage().then(() => {
      this.initVisualizer(props);
      this.initPlayer();
    });
    return state;
  }

  initPage() {
    return new Promise((resolve, reject) => {
        const script = document.createElement('script');
        script.src = 'https://cdn.jsdelivr.net/npm/@magenta/music@1.4.2';
        script.onload = () => resolve();
        script.onerror = (err) => reject(err);
        document.head.appendChild(script);
    });
  }

  initVisualizer(props) {
    if (props.notes && !this.notesSet) {
      this.visualizer = new window.mm.Visualizer(this.notes, this.canvas);
      this.notes = props.notes;
      this.isNotesSet = true;
    }
  }

  initPlayer() {
    if (this.visualizer && !this.player) {
      this.player = new window.mm.Player(true, {
        run: (note) => this.visualizer.redraw(note),
        stop: () => {console.log('done');}
      });
    }
  }

  onStart() {
    this.player.start(this.notes);
  }

  onStop() {
    this.player.stop();
  }
}

customElements.define('magenta-visualizer', MagentaVisualizer);


text:
class Solution:
    def smallestEvenMultiple(self, n: int) -> int:
        """
            n : positive integer
            return : smallest positive integer that is a multiple of both 2 and n
        """
        if n % 2 == 0:
            # if n is alreay muliply by 2
            # return itself
            return n

        # if previous condition is false
        # n * 2 is the smallest positive integer.
        return n * 2


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Chimp.Logging.Core</name>
    </assembly>
    <members>
        <member name="T:Chimp.Logging.NoOpLoggerFactory">
            <summary>
            No-op logger factory implementation.
            </summary>
        </member>
        <member name="F:Chimp.Logging.NoOpLoggerFactory.Instance">
            <summary>
            No-op logger instance.
            </summary>
        </member>
        <member name="T:Chimp.Logging.ILogger">
            <summary>
            Logger interface.
            </summary>
        </member>
        <member name="M:Chimp.Logging.ILogger.Log(Chimp.Logging.LogLevel,System.Object)">
            <summary>
            Writes an object to the log.
            </summary>
            <param name="level">Log level.</param>
            <param name="obj">Object to write.</param>
        </member>
        <member name="M:Chimp.Logging.ILogger.Log(Chimp.Logging.LogLevel,System.String)">
            <summary>
            Writes a string to the log.
            </summary>
            <param name="level">Log level.</param>
            <param name="str">String to write.</param>
        </member>
        <member name="M:Chimp.Logging.ILogger.Log(Chimp.Logging.LogLevel,System.String,System.Object[])">
            <summary>
            Writes a formatted string to the log.
            </summary>
            <param name="level">Log level.</param>
            <param name="format">Format string.</param>
            <param name="args">Arguments.</param>
        </member>
        <member name="T:Chimp.Logging.ILoggerFactory">
            <summary>
            Logger factory interface.
            </summary>
        </member>
        <member name="M:Chimp.Logging.ILoggerFactory.CreateLogger(System.String)">
            <summary>
            Creates a logger for a given name.
            </summary>
            <param name="name">Logger name.</param>
            <returns>Logger.</returns>
        </member>
        <member name="M:Chimp.Logging.ILoggerFactory.CreateLogger(System.Type)">
            <summary>
            Creates a logger for a given type.
            </summary>
            <param name="type">Logger type.</param>
            <returns>Logger.</returns>
        </member>
        <member name="M:Chimp.Logging.ILoggerFactory.CreateLogger``1">
            <summary>
            Creates a logger for a given type.
            </summary>
            <typeparam name="T">Logger type.</typeparam>
            <returns>Logger.</returns>
        </member>
        <member name="T:Chimp.Logging.LogLevel">
            <summary>
            Log level.
            </summary>
        </member>
        <member name="F:Chimp.Logging.LogLevel.Trace">
            <summary>
            Trace.
            </summary>
        </member>
        <member name="F:Chimp.Logging.LogLevel.Debug">
            <summary>
            Debug.
            </summary>
        </member>
        <member name="F:Chimp.Logging.LogLevel.Information">
            <summary>
            Information.
            </summary>
        </member>
        <member name="F:Chimp.Logging.LogLevel.Warning">
            <summary>
            Warning.
            </summary>
        </member>
        <member name="F:Chimp.Logging.LogLevel.Error">
            <summary>
            Error.
            </summary>
        </member>
        <member name="F:Chimp.Logging.LogLevel.Critical">
            <summary>
            Critical.
            </summary>
        </member>
        <member name="F:Chimp.Logging.LogLevel.None">
            <summary>
            None.
            </summary>
        </member>
        <member name="T:Chimp.Logging.NoOpLogger">
            <summary>
            No-op logger implementation.
            </summary>
        </member>
        <member name="F:Chimp.Logging.NoOpLogger.Instance">
            <summary>
            No-op logger instance.
            </summary>
        </member>
    </members>
</doc>


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval"
    >
    <solid android:color="#bdce26"/>
    <stroke android:width="5dp"
        android:color="#5cc48c"
        />

</shape>


text:
return function (loader)

  local Configuration = loader.load "cosy.configuration"
  local I18n          = loader.load "cosy.i18n"
  local Logger        = loader.load "cosy.logger"
  local Redis         = loader.load "cosy.redis"
  local Value         = loader.load "cosy.value"
  local Socket        = loader.require "socket"
  local Smtp          = loader.require "socket.smtp"
  local Ssl           = loader.require "ssl"
  if not Ssl then
    Ssl = _G.ssl
  end

  Configuration.load {
    "cosy.email",
    "cosy.nginx",
  }

  local i18n   = I18n.load "cosy.email"
  i18n._locale = Configuration.locale

  if _G.js then
    error "Not available"
  end

  local Email = {}

  -- First case: detection, using blocking sockets
  -- Second case: email sending, using non-blocking sockets

  local make_socket = {}

  function make_socket.async ()
    local result = loader.scheduler.wrap (Socket.tcp ())
    result:settimeout (Configuration.smtp.timeout)
    result:setoption ("keepalive"  , true)
    result:setoption ("reuseaddr"  , true)
    result:setoption ("tcp-nodelay", true)
    return result
  end

  -- http://lua-users.org/wiki/StringRecipes
  local email_pattern = "<[A-Za-z0-9%.%%%+%-]+@[A-Za-z0-9%.%%%+%-]+%.%w%w%w?%w?>"

  local tls_alias = {
    ["TLS v1.2"] = "tlsv1_2",
    ["TLS v1.1"] = "tlsv1_1",
    ["TLS v1.0"] = "tlsv1",
    ["SSL v3"  ] = "sslv3",
    ["SSL v2"  ] = "sslv23",
  }
  -- http://stackoverflow.com/questions/11070623/lua-send-mail-with-gmail-account
  local Tcp = {}

  local function forward__index (self, key)
    return getmetatable (self) [key]
        or function (_, ...)
             return self.socket [key] (self.socket, ...)
           end
  end

  function Tcp.PLAINTEXT ()
    return function (_, make)
      return make ()
    end
  end

  local TLS_mt = {
    __index = forward__index,
  }
  function TLS_mt:connect (host, port)
    self.socket = self.make ()
    if not self.socket:connect (host, port) then
      return false
    end
    self.socket = Ssl.wrap (self.socket, {
      mode     = "client",
      protocol = tls_alias [self.protocol],
    })
    return self.socket:dohandshake ()
  end
  function Tcp.TLS (protocol, make)
    return function ()
      return setmetatable ({
        socket   = make (),
        protocol = protocol,
        make     = make,
      }, TLS_mt)
    end
  end

  local STARTTLS_mt = {
    __index = forward__index,
  }
  function STARTTLS_mt:connect (host, port)
    self.socket = self.make ()
    if not self.socket:connect (host, port) then
      return nil, "connection failed"
    end
    self.socket:send ("EHLO cosy\r\n")
    repeat
      local line = self.socket:receive "*l"
    until line == nil
    self.socket:send "STARTTLS\r\n"
    self.socket:receive "*l"
    self.socket = Ssl.wrap (self.socket, {
      mode     = "client",
      protocol = tls_alias [self.protocol],
    })
    local result = self.socket:dohandshake ()
    self.socket:send ("EHLO cosy\r\n")
    return result
  end
  function Tcp.STARTTLS (protocol, make)
    return function ()
      return setmetatable ({
        socket   = make (),
        protocol = protocol,
        make     = make,
      }, STARTTLS_mt)
    end
  end

  function Email.discover ()
    local domain        = Configuration.http.hostname
    local host          = Configuration.smtp.host
    local username      = Configuration.smtp.username
    local password      = Configuration.smtp.password
    local methods       = { Configuration.smtp.method }
    if #methods == 0 then
      methods = {
        "STARTTLS",
        "TLS",
        "PLAINTEXT",
      }
    end
    local protocols = { Configuration.smtp.protocol }
    if #protocols == 0 then
      protocols = {
        "TLS v1.2",
        "TLS v1.1",
        "TLS v1.0",
        "SSL v3",
        "SSL v2",
      }
    end
    local ports     = { Configuration.smtp.port }
    if #ports == 0 then
      ports = {
        25,
        587,
        465
      }
    end
    for _, method in ipairs (methods) do
      local protos = (method == "PLAIN") and { "nothing" } or protocols
      for _, protocol in ipairs (protos) do
        for _, port in ipairs (ports) do
          Logger.debug {
            _        = i18n ["smtp:discover"],
            host     = host,
            port     = port,
            method   = method,
            protocol = protocol,
          }
          local ok, s = pcall (Smtp.open, host, port, Tcp [method] (protocol, make_socket.async))
          if ok then
            ok = pcall (s.auth, s, username, password, s:greet (domain))
            if ok then
              Configuration.smtp.port     = port
              Configuration.smtp.method   = method
              Configuration.smtp.protocol = protocol
              return true
            else
              s:close ()
            end
          end
        end
      end
    end
  end

  function Email.send (message)
    loader.scheduler.addthread (function ()
      local locale    = message.locale or Configuration.locale
      local si18n     = I18n.new (locale)
      local localized = si18n (message)
      message.from    = localized.from   .message
      message.to      = localized.to     .message
      message.subject = localized.subject.message
      message.body    = localized.body   .message
      if Email.ready then
        local ok, result = pcall (Smtp.send, {
          from     = message.from:match (email_pattern),
          rcpt     = message.to  :match (email_pattern),
          source   = Smtp.message {
            headers = {
              from    = message.from,
              to      = message.to,
              subject = message.subject,
            },
            body = message.body
          },
          user     = Configuration.smtp.username,
          password = Configuration.smtp.password,
          server   = Configuration.smtp.host,
          port     = Configuration.smtp.port,
          create   = Tcp [Configuration.smtp.method] (Configuration.smtp.protocol, make_socket.async),
        })
        if ok and result then
          return
        end
      end
      local redis = Redis.client ()
      redis:rpush (Configuration.smtp.redis_key, Value.expression (localized))
    end)
  end

  loader.scheduler.addthread (function ()
    local ok, result = pcall (Email.discover)
    if not ok or not result then
      Email.ready = false
      Logger.warning {
        _ = i18n ["smtp:not-available"],
      }
    else
      Email.ready = true
      Logger.info {
        _        = i18n ["smtp:available"],
        host     = Configuration.smtp.host,
        port     = Configuration.smtp.port,
        method   = Configuration.smtp.method,
        protocol = Configuration.smtp.protocol,
      }
    end
  end)

  return Email

end


text:
package org.springframework.cloud.stream.app.rabbit.sink;

import org.springframework.amqp.core.MessageDeliveryMode;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint;
import org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.messaging.MessageHandler;

/**
 * A sink module that sends data to RabbitMQ.
 *
 * @author Gary Russell
 */
@EnableBinding(Sink.class)
@EnableConfigurationProperties(RabbitSinkProperties.class)
public class RabbitSinkConfiguration {

	@Autowired
	private RabbitSinkProperties properties;

	@Value("#{${rabbit.converterBeanName:null}}")
	private MessageConverter messageConverter;

	@ServiceActivator(inputChannel = Sink.INPUT)
	@Bean
	public MessageHandler amqpChannelAdapter(ConnectionFactory rabbitConnectionFactory) {
		AmqpOutboundEndpoint handler = new AmqpOutboundEndpoint(rabbitTemplate(rabbitConnectionFactory));
		DefaultAmqpHeaderMapper mapper = new DefaultAmqpHeaderMapper();
		mapper.setRequestHeaderNames(this.properties.getMappedRequestHeaders());
		handler.setHeaderMapper(mapper);
		handler.setDefaultDeliveryMode(this.properties.getPersistentDeliveryMode()
										? MessageDeliveryMode.PERSISTENT
										: MessageDeliveryMode.NON_PERSISTENT);
		if (this.properties.getExchangeExpression() == null) {
			handler.setExchangeName(this.properties.getExchange());
		}
		else {
			handler.setExpressionExchangeName(this.properties.getExchangeExpression());
		}
		if (this.properties.getRoutingKeyExpression() == null) {
			handler.setRoutingKey(this.properties.getRoutingKey());
		}
		else {
			handler.setExpressionRoutingKey(this.properties.getRoutingKeyExpression());
		}
		return handler;
	}

	@Bean
	public RabbitTemplate rabbitTemplate(ConnectionFactory rabbitConnectionFactory) {
		RabbitTemplate rabbitTemplate = new RabbitTemplate(rabbitConnectionFactory);
		if (this.messageConverter != null) {
			rabbitTemplate.setMessageConverter(this.messageConverter);
		}
		return rabbitTemplate;
	}

	@Bean
	@ConditionalOnProperty(name = "rabbit.converterBeanName", havingValue = RabbitSinkProperties.JSON_CONVERTER)
	public Jackson2JsonMessageConverter jsonConverter() {
		return new Jackson2JsonMessageConverter();
	}

}


text:
package types

import "github.com/fractalplatform/fractal/common"

type SnapshotBlock struct {
	Number    uint64
	BlockHash common.Hash
}

// SnapshotInfo write rawdb
type SnapshotInfo struct {
	Root common.Hash
}


text:
class StockTakesController < ApplicationController

  before_action :set_stock_take, only: [:show, :edit, :update, :destroy]
  before_action :authorize_stock_take
  # GET /stock_takes
  # GET /stock_takes.json
  def index
    @stock_takes = StockTake.all
  end

  # GET /stock_takes/1
  # GET /stock_takes/1.json
  def show
  end

  # GET /stock_takes/new
  def new
    @stock_take = StockTake.new
    @stores = Store.order(:name)
    @warehouses = Warehouse.all
  end

  # GET /stock_takes/1/edit
  def edit
    @stores = Store.order(:name)
    @warehouses = Warehouse.all
  end

  # POST /stock_takes
  # POST /stock_takes.json
  def create
    @stock_take = StockTake.new(stock_take_params)
    @warehouses = Warehouse.all
    @stores = Store.order(:name)

    respond_to do |format|
      if @stock_take.save
        format.html { redirect_to @stock_take, notice: 'Stock take was successfully created.' }
        format.json { render :show, status: :created, location: @stock_take }
      else
        format.html { render :new }
        format.json { render json: @stock_take.errors, status: :unprocessable_entity }
      end
    end
  end

  def post_stock_take
    @stock_take = StockTake.find(params[:id])
    @stock_take.draft = false
     respond_to do |format|
      if @stock_take.save
        format.html { redirect_to @stock_take, notice: 'Stock take was successfully created.' }
        format.json { render :show, status: :created, location: @stock_take }
      else
        format.html { render :new }
        format.json { render json: @stock_take.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /stock_takes/1
  # PATCH/PUT /stock_takes/1.json
  def update
    @warehouses = Warehouse.all
    @stores = Store.order(:name)
    respond_to do |format|
      if @stock_take.update(stock_take_params)
        format.html { redirect_to @stock_take, notice: 'Stock take was successfully updated.' }
        format.json { render :show, status: :ok, location: @stock_take }
      else
        format.html { render :edit }
        format.json { render json: @stock_take.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /stock_takes/1
  # DELETE /stock_takes/1.json
  def destroy
    @stock_take.destroy
    respond_to do |format|
      format.html { redirect_to stock_takes_url, notice: 'Stock take was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  def authorize_stock_take
    authorize StockTake
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_stock_take
      @stock_take = StockTake.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def stock_take_params
      params.require(:stock_take).permit(:title, :hub_id, :warehouse_id, :store_no, :date)
    end
end


text:
<?php

declare(strict_types = 1);

namespace UaRequestTest\Header;

use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;
use SebastianBergmann\RecursionContext\InvalidArgumentException;
use UaRequest\Header\XOriginalUseragent;

final class XOriginalUseragentTest extends TestCase
{
    /**
     * @throws ExpectationFailedException
     * @throws InvalidArgumentException
     */
    public function testData(): void
    {
        $ua = 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3';

        $header = new XOriginalUseragent($ua);

        self::assertSame($ua, $header->getValue(), 'header mismatch');
        self::assertTrue($header->hasDeviceInfo(), 'device info mismatch');
        self::assertTrue($header->hasBrowserInfo(), 'browser info mismatch');
        self::assertTrue($header->hasPlatformInfo(), 'platform info mismatch');
        self::assertTrue($header->hasEngineInfo(), 'engine info mismatch');
    }
}