text:
=begin

Copyright 2012-2013 inBloom, Inc. and its affiliates.

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.

=end
require "selenium-webdriver"

require_relative '../../../../utils/sli_utils.rb'
require_relative '../../../../utils/selenium_common.rb'

Given /^the testing device app key has been created$/ do
  @oauthClientId = "EGbI4LaLaL"
  @oauthClientSecret = "iGdeAGCugi4VwZNtMJR062nNKjB7gRKUjSB0AcZqpn8Beeee"
  @oauthRedirectURI = "http://device"
end

Given /^I import the odin-local-setup application and realm data$/ do
  @ci_realm_store_path = File.dirname(__FILE__) + '/../../../../../../../../tools/jmeter/odin-ci/'
  @local_realm_store_path = File.dirname(__FILE__) + '/../../../../../../../../tools/jmeter/odin-local-setup/'
  #get current working dir
  current_dir = Dir.getwd
  # Get current server environment (ci or local) from properties.yml
  app_server = Property['app_bootstrap_server']
  # Drop in ci specific app-auth fixture data
  if app_server == "ci"
    puts "\b\bDEBUG: We are setting CI environment app auth data"
    Dir.chdir(@ci_realm_store_path)
    `sh ci-jmeter-realm.sh`
  # Drop in local specific app-auth fixture data
  elsif app_server == "local"
    puts "\b\bDEBUG: We are setting LOCAL environment app auth data"
    Dir.chdir(@local_realm_store_path)
    `sh local-jmeter-realm.sh`
  else
    puts "\n\nWARNING: No App server context set, assuming CI environment.."
    Dir.chdir(@ci_realm_store_path)
    `sh ci-jmeter-realm.sh`
  end
  # restore back current dir
  Dir.chdir(current_dir)
end

When /^I navigate to the API authorization endpoint with my client ID$/ do
  @driver.get Property['api_server_url'] + "/api/oauth/authorize?response_type=code&client_id=#{@oauthClientId}"
end

Then /^I should be redirected to the realm choosing page$/ do
  assertWithWait("Failed to navigate to Realm chooser") {@driver.title.index("Choose your realm") != nil}
end

When /^I select "(.*?)" drop the dropdown and click go$/ do |arg1|
  select = Selenium::WebDriver::Support::Select.new(@driver.find_element(:tag_name, "select"))
  select.select_by(:text, arg1)
  assertWithWait("Could not find the Go button")  { @driver.find_element(:id, "go") }
  @driver.find_element(:id, "go").click
end

Then /^I should receive a json response containing my authorization code$/ do
  assertWithWait("Could not find text 'authorization_code' on page") {@driver.page_source.include?("authorization_code")}

  @oauthAuthCode = @driver.page_source.match(/"authorization_code":"(?<Code>[^"]*)"/)[:Code]
end

When /^I navigate to the API token endpoint with my client ID, secret, authorization code, and redirect URI$/ do
  @driver.get Property['api_server_url'] + "/api/oauth/token?response_type=code&client_id=#{@oauthClientId}" +
  "&client_secret=#{@oauthClientSecret}&code=#{@oauthAuthCode}&redirect_uri=#{@oauthRedirectURI}"
end

Then /^I should receive a json response containing my authorization token$/ do
  assertWithWait("Could not find text 'authorization_token' on page") {@driver.page_source.include?("access_token")}

  @sessionId = @driver.page_source.match(/"access_token":"(?<Token>[^"]*)"/)[:Token]
  puts "sessionId = #@sessionId"
end


text:
      www.coffeeseller.com

Coffee Seller is an independent coffee wholesaler. The company had a functioning website but they weren't happy with the design so we went about re-designing the website for them.

    ← Our work

Plan

We examined the competitor landscape and as a result of this we modernised the logo and then went on to look at the brand imagery and layout.

Design

The large rotating images that we designed really communicate Coffee Seller's range of products. What's more, by increasing the size of the images on the product listing pages we were able to increase the chance of sales.

Develop

The website was built in an ecommerce content management system called Magento. We used the existing framework and re-skinned the site with the new design. We also fixed some of the bugs in the system, made the navigation more intuitive and responsive and made the overall site faster to use.

Site address: www.coffeeseller.com

What COFFEE SELLER say

"From start to finish I have been extremely impressed by the service provided by say web design. From day one they were willing to listen to my ideas and suggest their own. Along the way we had a few issues with the website, but they were willing to fix these straight away to ensure the site suffered little down time. For a professional and quick service, I would defiantly recommend say web design."

    Ross Wright, Marketing Manager

    www.coffeeseller.com

redpajama_set_name: RedPajamaGithub


text:
module SpacesHelper

  def space_tree artical=nil
    url_opts = {:artical_id => artical.id.to_s} if artical.present?
    content_tag :div, :id=>"articals-tree", :data=>{trigger: "articalTree"} do
      content_tag(:script, "", src: tree_space_path(@space, {:format=>:js}.merge(url_opts||{})), :type=>"text/javascript")
    end
  end

end


text:
import { bootstrap }  from '@angular/platform-browser-dynamic';

import { HelloWorldComponent } from './hello_world';

bootstrap(HelloWorldComponent);


text:
package com.lightcrafts.ui.editor;

import com.lightcrafts.ui.operation.OpActions;
import com.lightcrafts.ui.operation.OpStack;
import com.lightcrafts.ui.toolkit.CoolButton;
import com.lightcrafts.ui.toolkit.IconFactory;

import javax.swing.*;
import javax.swing.border.Border;
import java.awt.image.BufferedImage;
import java.util.Iterator;
import java.util.List;

class OpsToolbar extends JPanel {

    // Add space below, to tune the layout:
    private static Border ToolBorder =
        BorderFactory.createEmptyBorder(0, 0, 3, 0);

    private List actions;

    OpsToolbar(OpStack stack) {
        this(stack.getAddActions(), true);
    }

    // Make a disabled OpToolbar, for the no-Document display mode:
    OpsToolbar() {
        this(OpStack.getStaticAddActions(), false);
    }

    private OpsToolbar(List actions, boolean enabled) {
        this.actions = actions;
        setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        setEnabled(enabled);
        initButtons();
        setBorder(ToolBorder);
    }

    private void initButtons() {
        boolean enabled = isEnabled();
        add(Box.createHorizontalGlue());

        CoolButton.ButtonStyle style = CoolButton.ButtonStyle.LEFT;
        for (Iterator i=actions.iterator(); i.hasNext(); ) {
            Action action = (Action) i.next();
            if (! i.hasNext()) {
                style = CoolButton.ButtonStyle.RIGHT;
            }
            JButton button = createButton(action, style);
            button.setEnabled(enabled);
            add(button);
            style = CoolButton.ButtonStyle.CENTER;
        }
        add(Box.createHorizontalGlue());
    }

    private static JButton createButton(
        Action action, CoolButton.ButtonStyle style
    ) {
        BufferedImage image =
            (BufferedImage) action.getValue(OpActions.IconImageKey);
        image = IconFactory.getScaledImage(image, IconFactory.StandardSize - 2);
        Icon icon = new ImageIcon(image);

        CoolButton button = new CoolButton(style);
        action.putValue(Action.SMALL_ICON, icon);
        button.setAction(action);
        button.setIcon(icon);

        return button;
    }
}


text:
using System.Configuration;

namespace Quartz.ScheduleConfiguration.ConfigurationSection
{
    [ConfigurationCollection(typeof(ScheduleElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
    public class ScheduleCollection : ConfigurationElementCollection
    {
        protected override string ElementName { get; } = "Schedule";
        public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMapAlternate;
        protected override ConfigurationElement CreateNewElement() => new ScheduleElement();
        protected override object GetElementKey(ConfigurationElement element) =>  ((ScheduleElement)element).Name;
    }
}


text:
package com.intellij.openapi.keymap;

import com.intellij.openapi.keymap.impl.BundledKeymapProvider;

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

/**
 * @author yole
 */
public class JBuilderKeymapProvider implements BundledKeymapProvider {
  @Override
  public List<String> getKeymapFileNames() {
    return Arrays.asList("JBuilderKeymap.xml");
  }
}


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        msw/control.cpp
// Purpose:     wxControl class
// Author:      Julian Smart
// Modified by:
// Created:     01/02/97
// RCS-ID:      $Id: control.cpp,v 1.102 2005/06/17 20:17:50 VZ Exp $
// Copyright:   (c) Julian Smart
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

// ============================================================================
// declarations
// ============================================================================

// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
    #pragma implementation "control.h"
#endif

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#if wxUSE_CONTROLS

#ifndef WX_PRECOMP
    #include "wx/event.h"
    #include "wx/app.h"
    #include "wx/dcclient.h"
    #include "wx/log.h"
    #include "wx/settings.h"
#endif

#include "wx/control.h"

#if wxUSE_NOTEBOOK
    #include "wx/notebook.h"
#endif // wxUSE_NOTEBOOK

#include "wx/msw/private.h"
#include "wx/msw/uxtheme.h"

#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__))
    #include <commctrl.h>
#endif

// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------

IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)

// ============================================================================
// wxControl implementation
// ============================================================================

// ----------------------------------------------------------------------------
// wxControl ctor/dtor
// ----------------------------------------------------------------------------

wxControl::~wxControl()
{
    m_isBeingDeleted = true;
}

// ----------------------------------------------------------------------------
// control window creation
// ----------------------------------------------------------------------------

bool wxControl::Create(wxWindow *parent,
                       wxWindowID id,
                       const wxPoint& pos,
                       const wxSize& size,
                       long style,
                       const wxValidator& wxVALIDATOR_PARAM(validator),
                       const wxString& name)
{
    if ( !wxWindow::Create(parent, id, pos, size, style, name) )
        return false;

#if wxUSE_VALIDATORS
    SetValidator(validator);
#endif

    return true;
}

bool wxControl::MSWCreateControl(const wxChar *classname,
                                 const wxString& label,
                                 const wxPoint& pos,
                                 const wxSize& size)
{
    WXDWORD exstyle;
    WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), &exstyle);

    return MSWCreateControl(classname, msStyle, pos, size, label, exstyle);
}

bool wxControl::MSWCreateControl(const wxChar *classname,
                                 WXDWORD style,
                                 const wxPoint& pos,
                                 const wxSize& size,
                                 const wxString& label,
                                 WXDWORD exstyle)
{
    // if no extended style given, determine it ourselves
    if ( exstyle == (WXDWORD)-1 )
    {
        exstyle = 0;
        (void) MSWGetStyle(GetWindowStyle(), &exstyle);
    }

    // all controls should have this style
    style |= WS_CHILD;

    // create the control visible if it's currently shown for wxWidgets
    if ( m_isShown )
    {
        style |= WS_VISIBLE;
    }

    // choose the position for the control: we have a problem with default size
    // here as we can't calculate the best size before the control exists
    // (DoGetBestSize() may need to use m_hWnd), so just choose the minimal
    // possible but non 0 size because 0 window width/height result in problems
    // elsewhere
    int x = pos.x == wxDefaultCoord ? 0 : pos.x,
        y = pos.y == wxDefaultCoord ? 0 : pos.y,
        w = size.x == wxDefaultCoord ? 1 : size.x,
        h = size.y == wxDefaultCoord ? 1 : size.y;

    // ... and adjust it to account for a possible parent frames toolbar
    AdjustForParentClientOrigin(x, y);

    m_hWnd = (WXHWND)::CreateWindowEx
                       (
                        exstyle,            // extended style
                        classname,          // the kind of control to create
                        label,              // the window name
                        style,              // the window style
                        x, y, w, h,         // the window position and size
                        GetHwndOf(GetParent()),  // parent
                        (HMENU)GetId(),     // child id
                        wxGetInstance(),    // app instance
                        NULL                // creation parameters
                       );

    if ( !m_hWnd )
    {
#ifdef __WXDEBUG__
        wxFAIL_MSG(wxString::Format
                   (
                    _T("CreateWindowEx(\"%s\", flags=%08x, ex=%08x) failed"),
                    classname, (unsigned int)style, (unsigned int)exstyle
                   ));
#endif // __WXDEBUG__

        return false;
    }

    // install wxWidgets window proc for this window
    SubclassWin(m_hWnd);

    // set up fonts and colours
    InheritAttributes();
    if (!m_hasFont)
        SetFont(GetDefaultAttributes().font);

    // set the size now if no initial size specified
    SetInitialBestSize(size);

    return true;
}

// ----------------------------------------------------------------------------
// various accessors
// ----------------------------------------------------------------------------

wxBorder wxControl::GetDefaultBorder() const
{
    // we want to automatically give controls a sunken style (confusingly,
    // it may not really mean sunken at all as we map it to WS_EX_CLIENTEDGE
    // which is not sunken at all under Windows XP -- rather, just the default)
#if defined(__POCKETPC__) || defined(__SMARTPHONE__)
    return wxBORDER_SIMPLE;
#else
    return wxBORDER_SUNKEN;
#endif
}

WXDWORD wxControl::MSWGetStyle(long style, WXDWORD *exstyle) const
{
    long msStyle = wxWindow::MSWGetStyle(style, exstyle);

    if ( AcceptsFocus() )
    {
        msStyle |= WS_TABSTOP;
    }

    return msStyle;
}

wxSize wxControl::DoGetBestSize() const
{
    return wxSize(DEFAULT_ITEM_WIDTH, DEFAULT_ITEM_HEIGHT);
}

// This is a helper for all wxControls made with UPDOWN native control.
// In wxMSW it was only wxSpinCtrl derived from wxSpinButton but in
// WinCE of Smartphones this happens also for native wxTextCtrl,
// wxChoice and others.
wxSize wxControl::GetBestSpinnerSize(const bool is_vertical) const
{
    // take size according to layout
    wxSize bestSize(
#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
                    0,GetCharHeight()
#else
                    ::GetSystemMetrics(is_vertical ? SM_CXVSCROLL : SM_CXHSCROLL),
                    ::GetSystemMetrics(is_vertical ? SM_CYVSCROLL : SM_CYHSCROLL)
#endif
    );

    // correct size as for undocumented MSW variants cases (WinCE and perhaps others)
    if (bestSize.x==0)
        bestSize.x = bestSize.y;
    if (bestSize.y==0)
        bestSize.y = bestSize.x;

    // double size according to layout
    if (is_vertical)
        bestSize.y *= 2;
    else
        bestSize.x *= 2;

    return bestSize;
}

/* static */ wxVisualAttributes
wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
    wxVisualAttributes attrs;

    // old school (i.e. not "common") controls use the standard dialog font
    // by default
    attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);

    // most, or at least many, of the controls use the same colours as the
    // buttons -- others will have to override this (and possibly simply call
    // GetCompositeControlsDefaultAttributes() from their versions)
    attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT);
    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);

    return attrs;
}

// another version for the "composite", i.e. non simple controls
/* static */ wxVisualAttributes
wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
    wxVisualAttributes attrs;
    attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);

    return attrs;
}

// ----------------------------------------------------------------------------
// message handling
// ----------------------------------------------------------------------------

bool wxControl::ProcessCommand(wxCommandEvent& event)
{
    return GetEventHandler()->ProcessEvent(event);
}

#ifdef __WIN95__
bool wxControl::MSWOnNotify(int idCtrl,
                            WXLPARAM lParam,
                            WXLPARAM* result)
{
    wxEventType eventType wxDUMMY_INITIALIZE(wxEVT_NULL);

    NMHDR *hdr = (NMHDR*) lParam;
    switch ( hdr->code )
    {
        case NM_CLICK:
            eventType = wxEVT_COMMAND_LEFT_CLICK;
            break;

        case NM_DBLCLK:
            eventType = wxEVT_COMMAND_LEFT_DCLICK;
            break;

        case NM_RCLICK:
            eventType = wxEVT_COMMAND_RIGHT_CLICK;
            break;

        case NM_RDBLCLK:
            eventType = wxEVT_COMMAND_RIGHT_DCLICK;
            break;

        case NM_SETFOCUS:
            eventType = wxEVT_COMMAND_SET_FOCUS;
            break;

        case NM_KILLFOCUS:
            eventType = wxEVT_COMMAND_KILL_FOCUS;
            break;

        case NM_RETURN:
            eventType = wxEVT_COMMAND_ENTER;
            break;

        default:
            return wxWindow::MSWOnNotify(idCtrl, lParam, result);
    }

    wxCommandEvent event(wxEVT_NULL, m_windowId);
    event.SetEventType(eventType);
    event.SetEventObject(this);

    return GetEventHandler()->ProcessEvent(event);
}
#endif // Win95

WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
{
    HDC hdc = (HDC)pDC;
    if ( m_hasFgCol )
    {
        ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
    }

    WXHBRUSH hbr = 0;
    if ( !colBg.Ok() )
    {
        hbr = MSWGetBgBrush(pDC, hWnd);

        // if the control doesn't have any bg colour, foreground colour will be
        // ignored as the return value would be 0 -- so forcefully give it a
        // non default background brush in this case
        if ( !hbr && m_hasFgCol )
            colBg = GetBackgroundColour();
    }

    // use the background colour override if a valid colour is given
    if ( colBg.Ok() )
    {
        ::SetBkColor(hdc, wxColourToRGB(colBg));

        // draw children with the same colour as the parent
        wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg, wxSOLID);

        hbr = (WXHBRUSH)brush->GetResourceHandle();

        // if we use custom background, we should set foreground ourselves too
        if ( !m_hasFgCol )
        {
            ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT));
        }
        //else: already set above
    }

    return hbr;
}

WXHBRUSH wxControl::MSWControlColor(WXHDC pDC, WXHWND hWnd)
{
    wxColour colBg;

    if ( HasTransparentBackground() )
        ::SetBkMode((HDC)pDC, TRANSPARENT);
    else // if the control is opaque it shouldn't use the parents background
        colBg = GetBackgroundColour();

    return DoMSWControlColor(pDC, colBg, hWnd);
}

WXHBRUSH wxControl::MSWControlColorDisabled(WXHDC pDC)
{
    return DoMSWControlColor(pDC,
                             wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE),
                             GetHWND());
}

// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------

// this is used in radiobox.cpp and slider95.cpp and should be removed as soon
// as it is not needed there any more!
//
// Call this repeatedly for several wnds to find the overall size
// of the widget.
// Call it initially with wxDefaultCoord for all values in rect.
// Keep calling for other widgets, and rect will be modified
// to calculate largest bounding rectangle.
void wxFindMaxSize(WXHWND wnd, RECT *rect)
{
    int left = rect->left;
    int right = rect->right;
    int top = rect->top;
    int bottom = rect->bottom;

    GetWindowRect((HWND) wnd, rect);

    if (left < 0)
        return;

    if (left < rect->left)
        rect->left = left;

    if (right > rect->right)
        rect->right = right;

    if (top < rect->top)
        rect->top = top;

    if (bottom > rect->bottom)
        rect->bottom = bottom;
}

#endif // wxUSE_CONTROLS


text:
package griffon.plugins.glazedlists.javafx.gui;

import griffon.exceptions.InstanceMethodInvocationException;
import javafx.beans.property.Property;

import javax.annotation.Nonnull;

import static griffon.util.GriffonClassUtils.getGetterName;
import static griffon.util.GriffonClassUtils.invokeExactInstanceMethod;
import static griffon.util.GriffonNameUtils.requireNonBlank;
import static java.util.Objects.requireNonNull;

/**
 * @author Andres Almiray
 */
final class JavaFXPropertyExtractor {
    private static final String PROPERTY_SUFFIX = "Property";

    @Nonnull
    @SuppressWarnings("ConstantConditions")
    public static <B> Property getProperty(@Nonnull B bean, @Nonnull String propertyName) {
        requireNonNull(bean, "Argument 'bean' must not be null");
        requireNonBlank(propertyName, "Argument 'propertyName' must not be null");

        if (!propertyName.endsWith(PROPERTY_SUFFIX)) {
            propertyName += PROPERTY_SUFFIX;
        }

        InstanceMethodInvocationException imie;
        try {
            // 1. try <columnName>Property() first
            return (Property<?>) invokeExactInstanceMethod(bean, propertyName);
        } catch (InstanceMethodInvocationException e) {
            imie = e;
        }

        // 2. fallback to get<columnName>Property()
        try {
            return (Property<?>) invokeExactInstanceMethod(bean, getGetterName(propertyName));
        } catch (InstanceMethodInvocationException e) {
            throw imie;
        }
    }
}


text:
package org.knowm.xchange.hitbtc.v2.dto;

import java.math.BigDecimal;

import com.fasterxml.jackson.annotation.JsonProperty;

public class HitbtcSymbol {

  private final String id;
  private final String baseCurrency;
  private final String quoteCurrency;
  private final BigDecimal quantityIncrement;
  private final BigDecimal tickSize;
  private final BigDecimal takeLiquidityRate;
  private final BigDecimal provideLiquidityRate;
  private final String feeCurrency;

  public HitbtcSymbol(
      @JsonProperty("id") String id,
      @JsonProperty("baseCurrency") String baseCurrency,
      @JsonProperty("quoteCurrency") String quoteCurrency,
      @JsonProperty("quantityIncrement") BigDecimal quantityIncrement,
      @JsonProperty("tickSize") BigDecimal tickSize,
      @JsonProperty("takeLiquidityRate") BigDecimal takeLiquidityRate,
      @JsonProperty("provideLiquidityRate") BigDecimal provideLiquidityRate,
      @JsonProperty("feeCurrency") String feeCurrency) {

    this.id = id;
    this.baseCurrency = baseCurrency;
    this.quoteCurrency = quoteCurrency;
    this.quantityIncrement = quantityIncrement;
    this.tickSize = tickSize;
    this.takeLiquidityRate = takeLiquidityRate;
    this.provideLiquidityRate = provideLiquidityRate;
    this.feeCurrency = feeCurrency;
  }

  public String getId() {
    return id;
  }

  public String getBaseCurrency() {
    return baseCurrency;
  }

  public String getQuoteCurrency() {
    return quoteCurrency;
  }

  public BigDecimal getQuantityIncrement() {
    return quantityIncrement;
  }

  public BigDecimal getTickSize() {
    return tickSize;
  }

  public BigDecimal getTakeLiquidityRate() {
    return takeLiquidityRate;
  }

  public BigDecimal getProvideLiquidityRate() {
    return provideLiquidityRate;
  }

  public String getFeeCurrency() {
    return feeCurrency;
  }

  @Override
  public String toString() {
    return "HitbtcSymbol{" +
        "id='" + id + '\'' +
        ", baseCurrency='" + baseCurrency + '\'' +
        ", quoteCurrency='" + quoteCurrency + '\'' +
        ", quantityIncrement=" + quantityIncrement +
        ", tickSize=" + tickSize +
        ", takeLiquidityRate=" + takeLiquidityRate +
        ", provideLiquidityRate=" + provideLiquidityRate +
        ", feeCurrency='" + feeCurrency + '\'' +
        '}';
  }
}


text:
package administration.dao;

public class DAOConfigurationException extends RuntimeException {
    /*
     * Constructeurs
     */
    public DAOConfigurationException( String message ) {
        super( message );
    }

    public DAOConfigurationException( String message, Throwable cause ) {
        super( message, cause );
    }

    public DAOConfigurationException( Throwable cause ) {
        super( cause );
    }
}


text:
//-----------------------------------------------
//
//	This file is part of the Siv3D Engine.
//
//	Copyright (c) 2008-2022 Ryo Suzuki
//	Copyright (c) 2016-2022 OpenSiv3D Project
//
//	Licensed under the MIT License.
//
//-----------------------------------------------

# pragma once
# include <Siv3D/Windows/Windows.hpp>
# include <Siv3D/Window/IWindow.hpp>
# include <Siv3D/Window.hpp>
# include <Siv3D/DLL.hpp>
# include <Siv3D/WindowState.hpp>
# include <Siv3D/ResizeMode.hpp>
# include <Siv3D/Optional.hpp>
# include <ShObjIdl_core.h>

namespace s3d
{
	class CWindow final : public ISiv3DWindow
	{
	private:

		HWND m_hWnd = nullptr;
		HINSTANCE m_hInstance = nullptr;
		std::wstring m_windowClassName;
		HDEVNOTIFY m_deviceNotificationHandle = nullptr;

		LibraryHandle m_user32 = nullptr;
		decltype(GetSystemMetricsForDpi)* m_pGetSystemMetricsForDpi = nullptr;
		decltype(AdjustWindowRectExForDpi)* m_pAdjustWindowRectExForDpi = nullptr;

		String m_title = String(Window::DefaultTitle);
		String m_actualTitle = String(SIV3D_BUILD(DEBUG) ? U"Siv3D App (Debug Build)"_sv : Window::DefaultTitle);

		WindowState m_state;
		uint32 m_dpi = USER_DEFAULT_SCREEN_DPI;
		Size m_border = Size(0, 0);
		Size m_targetWindowPos = Point(0, 0);
		RECT m_storedWindowRect = { 0, 0, 0, 0 }; // フルスクリーンからウィンドウモードに復帰するときのウィンドウサイズ
		Optional<ResizeMode> m_oldResizeMode;
		bool m_toggleFullscreenEnabled = true;
		bool m_toggleFullscreenRequest = false;
		bool m_showWindowCalled = false;

		ComPtr<ITaskbarList3> m_taskbar;

		int32 getSystemMetrics(int32 index) const;

		Rect adjustWindowRect(const Point& pos, const Size& size, int32 windowStyleFlags) const;

		void setWindowPos(const Rect& rect, UINT flags);

	public:

		CWindow();

		~CWindow() override;

		void init() override;

		void destroy();

		void update() override;

		void setWindowTitle(const String& title) override;

		const String& getWindowTitle() const noexcept override;

		void* getHandle() const noexcept override;

		const WindowState& getState() const noexcept override;

		void setStyle(WindowStyle style) override;

		void setPos(const Point& pos) override;

		void maximize() override;

		void restore() override;

		void minimize() override;

		bool resizeByVirtualSize(const Size& virtualSize) override;

		bool resizeByFrameBufferSize(const Size& frameBufferSize) override;

		void setMinimumFrameBufferSize(const Size& size) override;

		void setFullscreen(bool fullscreen, size_t monitorIndex) override;

		void setToggleFullscreenEnabled(bool enabled) override;

		bool isToggleFullscreenEnabled() const override;

		void show() override;

		void setTaskbarProgressBar(double progress0_1) override;

		void setFullscreen(bool fullscreen, size_t monitorIndex, bool skipSceneResize);

		void onResize(bool minimized, bool maximized);

		void onFocus(bool focused);

		void onFrameBufferResize(const Size& size);

		void onDPIChange(uint32 dpi, const Point& suggestedPos);

		void onBoundsUpdate();

		void onMinMaxInfo(LPMINMAXINFO pMinMaxInfo);

		void onEnterSizeMove();

		void onExitSizeMove();

		void requestToggleFullscreen();
	};
}


text:
package org.kie.workbench.common.forms.adf.engine.shared.formGeneration.layout;

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

import javax.enterprise.context.Dependent;

import org.kie.workbench.common.forms.adf.definitions.settings.ColSpan;
import org.kie.workbench.common.forms.adf.service.definitions.layout.LayoutColumnDefinition;
import org.kie.workbench.common.forms.adf.service.definitions.layout.LayoutSettings;
import org.uberfire.ext.layout.editor.api.editor.LayoutColumn;
import org.uberfire.ext.layout.editor.api.editor.LayoutComponent;
import org.uberfire.ext.layout.editor.api.editor.LayoutRow;
import org.uberfire.ext.layout.editor.api.editor.LayoutTemplate;

@Dependent
public class LayoutGenerator {

    public static final int MAX_SPAN = 12;

    private ColSpan[] structure;

    private List<Row> rows = new ArrayList<>();

    private Row currentRow;

    public void init(LayoutColumnDefinition[] structure) {

        currentRow = null;

        rows.clear();

        int autoCount = 0;
        int maxSpan = 0;

        for (LayoutColumnDefinition col : structure) {
            if (col.getSpan().equals(ColSpan.AUTO)) {
                autoCount++;
            } else {
                maxSpan += col.getSpan().getSpan();
            }
        }

        if (maxSpan > MAX_SPAN) {
            throw new IllegalArgumentException("Max SPAN allowed for all layout columns is 12.");
        }
        if (maxSpan < MAX_SPAN && autoCount == 0) {
            throw new IllegalArgumentException("Wrong layout definition, the columns total span must be 12");
        }
        if (maxSpan + autoCount > MAX_SPAN) {
            throw new IllegalArgumentException("There's not enough space for all columns in layout.");
        }

        int freeSpan = MAX_SPAN - maxSpan;

        int freeOffset = 0;
        int freeAVGSpan = 0;

        if (freeSpan > 0) {
            freeOffset = freeSpan % autoCount;
            freeAVGSpan = Math.floorDiv(freeSpan,
                                        autoCount);
        }

        List<ColSpan> spans = new ArrayList<>();

        for (LayoutColumnDefinition definition : structure) {
            if (definition.getSpan().equals(ColSpan.AUTO)) {
                int span = freeAVGSpan;

                if (freeOffset > 0) {
                    span++;
                    freeOffset--;
                }
                spans.add(ColSpan.calculateSpan(span));
            } else {
                spans.add(definition.getSpan());
            }
        }

        this.structure = spans.toArray(new ColSpan[spans.size()]);
    }

    public void addComponent(LayoutComponent component,
                             LayoutSettings settings) {
        if (currentRow == null || currentRow.isFull()) {
            newRow();
        }

        if (!currentRow.addComponent(component,
                                     settings)) {
            newRow();
            currentRow.addComponent(component,
                                    settings);
        }
    }

    public LayoutTemplate build() {
        LayoutTemplate template = new LayoutTemplate();

        rows.stream()
                .filter(row -> !row.cells.isEmpty())
                .forEach(row -> {
                    LayoutRow layoutRow = new LayoutRow();

                    template.addRow(layoutRow);

                    row.cells.forEach(cell -> {
                        LayoutColumn layoutColumn = new LayoutColumn(String.valueOf(cell.horizontalSpan));
                        layoutRow.add(layoutColumn);

                        if (cell.getComponentsCount() == 0) {
                            return;
                        } else if (cell.getComponentsCount() == 1) {
                            layoutColumn.add(cell.components.get(0));
                        } else {
                            cell.components.forEach(component -> {
                                LayoutRow nestedRow = new LayoutRow();
                                layoutColumn.addRow(nestedRow);
                                LayoutColumn nestedColumn = new LayoutColumn(String.valueOf(MAX_SPAN));
                                nestedRow.add(nestedColumn);
                                nestedColumn.add(component);
                            });
                        }
                    });
                });

        return template;
    }

    protected void newRow() {
        List<Cell> cells = new ArrayList<>();
        for (ColSpan span : structure) {
            cells.add(new Cell(span.getSpan()));
        }
        currentRow = new Row(cells);
        rows.add(currentRow);
    }

    private class Row {

        List<Cell> cells;

        int currentIndex = 0;

        public Row(List<Cell> cells) {
            this.cells = cells;
        }

        boolean isFull() {
            return currentIndex == cells.size() || (currentIndex > 0 && cells.get(currentIndex - 1).wrap);
        }

        public boolean addComponent(LayoutComponent component,
                                    LayoutSettings settings) {

            int horizontalSpan = settings.getHorizontalSpan();

            Cell currentCell = cells.get(currentIndex);
            currentCell.wrap = settings.isWrap();

            currentCell.addLayoutComponent(component);

            if (horizontalSpan > 1) {
                while (horizontalSpan > 1 && cells.size() > currentIndex + 1) {
                    Cell cell = cells.remove(currentIndex + 1);
                    currentCell.horizontalSpan += cell.horizontalSpan;
                }
            }

            currentIndex++;
            return true;
        }
    }

    private class Cell {

        private int horizontalSpan = 1;
        private int verticalSpan = 1;
        private boolean wrap;

        private List<LayoutComponent> components = new ArrayList<>();

        public Cell(int horizontalSpan) {
            this.horizontalSpan = horizontalSpan;
        }

        private void addLayoutComponent(LayoutComponent component) {
            components.add(component);
        }

        private int getComponentsCount() {
            return components.size();
        }

        public int getVerticalSpan() {
            return verticalSpan;
        }

        public void setVerticalSpan(int verticalSpan) {
            this.verticalSpan = verticalSpan;
        }
    }
}


text:
layout: page
title: Stanton Liberated Air Executive Retreat
date: 2016-05-24
author: Larry Green
tags: weekly links, java
status: published
summary: Etiam velit neque, sagittis a iaculis.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 11/24/2019
  endDate: 11/25/2019
  ctyhocn: LITMCHX
  groupCode: SLAER
published: true
---
Nulla accumsan lacus est, sed commodo libero consectetur quis. Nullam vel arcu hendrerit, fringilla massa nec, lobortis ligula. In venenatis orci at justo ornare sagittis. Quisque semper sollicitudin convallis. Cras ut elit vitae purus sagittis porta. Ut eros nisl, luctus sed semper ac, consequat nec turpis. Fusce euismod lectus ut erat pretium ultricies. Aliquam rhoncus, magna eu pharetra iaculis, neque dui convallis massa, id porta mauris orci sed elit. Pellentesque vitae quam elementum, ullamcorper diam a, iaculis purus. Donec varius euismod arcu.
Aliquam in lorem semper augue laoreet pharetra. Ut mattis turpis risus, sed sodales tortor placerat ut. Duis gravida turpis nibh, eu tristique odio tempus sed. Quisque ultricies erat felis, at sodales magna egestas a. Cras eget rhoncus ex. Integer vel finibus felis. Curabitur porttitor ultricies efficitur. In in ex at enim ornare aliquet id in turpis. Phasellus nec suscipit est, eget finibus sapien. Pellentesque at mi in felis consectetur eleifend sed in metus. Morbi tempor neque eget dignissim vestibulum. Ut eget lectus blandit, facilisis massa et, congue nibh.

* Sed consectetur nisl id tellus tristique feugiat
* Pellentesque ullamcorper neque sit amet turpis vulputate, vel euismod ligula commodo.

Fusce gravida fringilla lacus, sed egestas neque imperdiet dapibus. Sed vel pulvinar dolor. Aenean suscipit, lorem nec tempus semper, est est molestie nulla, sed maximus nisi ante quis felis. Nunc lacinia tincidunt iaculis. Donec in quam id lacus dictum pulvinar non vitae enim. Praesent aliquam dui et facilisis tincidunt. Nulla suscipit nisl id orci gravida, non fermentum erat luctus. Curabitur porta non dolor dignissim malesuada. Donec id gravida erat. Phasellus vel nisi justo. Nam leo odio, molestie eu dui et, condimentum convallis augue.


text:
public class TronUI {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

    }

}


text:
angular
.module('DNNQuickSurvey')
.factory('questionsFactory', function ($http, $q) {
	var service = {};

	// DNN Services Framework
	var $self = this;
	if (sf) {
		$self.ServiceRoot = sf.getServiceRoot(moduleName); // Gets path to API
		$self.ServicePath = $self.ServiceRoot + 'Question/'; // Adds Controller name
		$self.Headers = {
			"ModuleId": sf.getModuleId(), // Gets ModuleId
			"TabId": sf.getTabId(), // Gets current TabId
			"RequestVerificationToken": sf.getAntiForgeryValue() // Generates AntiForgery Value
		};
	}

	// ADD - UPDATE
	service.setQuestions = function (question) {
		return $http({
			method: 'POST',
			url: $self.ServicePath + 'Upsert?moduleId=' + sf.getModuleId(),
			headers: $self.Headers,
			data: JSON.stringify(question)
		});
	};

	// Delete
	service.deleteQuestion = function (questionId) {
		return $http({
			method: 'POST',
			url: $self.ServicePath + 'Delete?questionId=' + questionId,
			headers: $self.Headers,
			data: JSON.stringify(questionId)
		});
	};
	service.callQuestionsData = function () {
		var deferred = $q.defer();
		$http({
			method: 'GET',
			url: $self.ServicePath + 'GetList?moduleId=' + sf.getModuleId(),
			headers: $self.Headers
		}).success(function (data) {
			deferred.resolve(data);
		}).error(function () {
			console.log('There was an error getting the questions.');
		});
		return deferred.promise;
	}
	return service;
})
.factory('answersFactory', function ($http, $q) {
	var service = {};

	// DNN Services Framework
	var $self = this;
	if (sf) {
		$self.ServiceRoot = sf.getServiceRoot(moduleName); // Gets path to API
		$self.ServicePath = $self.ServiceRoot + 'Answer/'; // Adds Controller name
		$self.Headers = {
			"ModuleId": sf.getModuleId(), // Gets ModuleId
			"TabId": sf.getTabId(), // Gets current TabId
			"RequestVerificationToken": sf.getAntiForgeryValue() // Generates AntiForgery Value
		};
	}

	// ADD - UPDATE
	service.setAnswers = function (answer) {
		return $http({
			method: 'POST',
			url: $self.ServicePath + 'Upsert?moduleId=' + sf.getModuleId(),
			headers: $self.Headers,
			data: JSON.stringify(answer)
		});
	};

	service.callAnswersData = function () {
		var deferred = $q.defer();
		$http({
			method: 'GET',
			url: $self.ServicePath + 'GetList?moduleId=' + sf.getModuleId(),
			headers: $self.Headers
		}).success(function (data) {
			deferred.resolve(data);
		}).error(function () {
			console.log('There was an error getting the answers.');
		});
		return deferred.promise;
	}
	return service;
})
.factory('localizationFactory', function ($http, $q) {
	var service = {};

	var dataUrl = "/DesktopModules/DNNQuickSurvey/API/DNNQuickSurvey/ResxData";

	// DNN Services Framework
	var $self = this;
	if ($.ServicesFramework) {
		$self.ServiceRoot = sf.getServiceRoot(moduleName);
		$self.ServicePath = $self.ServiceRoot + "Event/";
		$self.Headers = {
			"ModuleId": moduleId,
			"TabId": sf.getTabId(),
			"RequestVerificationToken": sf.getAntiForgeryValue()
		};
	}

	// GET
	service.callResx = function () {
		var deferred = $q.defer();
		$http({
			method: 'GET',
			url: dataUrl,
			headers: $self.Headers
		}).success(function (data) {
			deferred.resolve(data);
		}).error(function () {
			console.log('There was an error getting the categories');
		});
		return deferred.promise;
	}

	return service;
})
;


text:
define(['updeep'], function(updeep) {
    'use strict';

    return function configuration(state, { type, payload }) {
        if (!state) return { properties: {}, messages: {} }

        switch (type) {
            case 'CONFIGURATION_UPDATE': return update(state, payload);
        }

        return state;
    }

    function update(state, payload) {
        return updeep(payload, state)
    }
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Starter Template for Bootstrap</title>

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

    <link href="css/full-slider.css" rel="stylesheet">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    Toggle navigation

                </button>
                Start Bootstrap

About

Services

Contact

A Full-Width Image Slider Template

Caption 2

Caption 3

A Full Width Image Slider Template

This is a great starting point for yet another modern and stylish website. Here are some things to consider when working with this template:

Unique Fonts

Attractive Colors

Content Spacing for Legibility and Design

Decent Pictures that Still Load Quickly (less than 400KB for example)

Make the Pictures INFORMATIVE

Custom Styling for the Captions

Copyright © Company 2013


text:
/*
 * ContainerExitStatus.h
 *
 *  Created on: Jan 5, 2015
 *      Author: weikui
 */

#ifndef CONTAINEREXITSTATUS_H_
#define CONTAINEREXITSTATUS_H_

enum ContainerExitStatus {
	SUCCESS = 0,
	ABORTED = -100,
	DISKS_FAILED = -101,
	INVALID = -1000
};
#endif /* CONTAINEREXITSTATUS_H_ */


text:
using System;
using System.Globalization;
using AutoFixture;
using Tranquire.Selenium.Questions.UIModels.Converters;
using Tranquire.Tests;
using Xunit;

namespace Tranquire.Selenium.Tests.Converters
{
    public class DateTimeConvertersTests
    {
        [Theory, DomainAutoData]
        internal void FromBool(DateTimeConverters sut)
        {
            Assert.Throws<NotSupportedException>(() => sut.Convert(true, CultureInfo.InvariantCulture));
        }

        [Theory, DomainAutoData]
        internal void FromString(DateTimeConverters sut, IFixture fixture)
        {
            // arrange
            var expected = fixture.Create<DateTime>();
            var dateString = expected.ToString("o", CultureInfo.InvariantCulture);
            // act
            var actual = sut.Convert(dateString, CultureInfo.InvariantCulture);
            // assert
            Assert.Equal(expected, actual);
        }

        [Theory, DomainAutoData]
        internal void FromStringArray(DateTimeConverters sut)
        {
            Assert.Throws<NotSupportedException>(() => sut.Convert(true, CultureInfo.InvariantCulture));
        }
    }
}


text:
require File.expand_path('../helper', __FILE__)

class ActiveCollabTest < Service::TestCase
  def setup
    @stubs = Faraday::Adapter::Test::Stubs.new
  end

  def test_push
    @stubs.post "/foo" do |env|
      query = Rack::Utils.parse_nested_query(env[:url].query)
      body  = Rack::Utils.parse_nested_query(env[:body])
      assert_equal '2', body['discussion']['milestone_id']
      assert_equal '3', body['discussion']['parent_id']
      assert_equal 'activecollab.com', env[:url].host
      assert_equal "projects/1/discussions/add", query['path_info']
      assert_equal "token", query["token"]
      assert_equal 'application/xml', env[:request_headers]["Accept"]
      assert_match /grit/, env[:body]
      [200, {}, '{}']
    end

    svc = service({
      'url'          => 'http://activecollab.com/foo',
      'token'        => 'token',
      'project_id'   => '1',
      'milestone_id' => '2',
      'category_id'  => '3'
    }, payload)

    def svc.shorten_url(*args)
      'short'
    end

    svc.receive_push
  end

  def service(*args)
    super Service::ActiveCollab, *args
  end
end


text:
name             'sbp_screen'
maintainer       'Sander van Harmelen'
maintainer_email 'svanharmelen@schubergphilis.com'
license          'Apache 2.0'
description      'Installs/Configures screen'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '0.1.2'

supports         'redhat'
supports         'centos'
supports         'ubuntu'


text:
Master [![Build Status](https://travis-ci.org/dvla/vehicles-acquire-online.svg?branch=master)](https://travis-ci.org/dvla/vehicles-acquire-online)

DVLA Vehicles Acquire Online
=====================

`vehicles-acquire-online` is the Web frontend for acquiring service from the motor trade vehicles online..

Architectural overview
----------------------

### Presentation layer

This project encapsulates the presentation layer of the application.

The codebase is predominantly [Scala][scala] and is implemented against [Play][play-framework]: a 'full stack' Web
framework for the JVM.

### Microservices

Most complex business decisions are deferred to a network of [RESTful][rest] microservices. These are maintained through
separate projects:

-   `ordnance-survey`
-   `vehicle-keeper-lookup`
-   `vehicles-acquire-fulfil`
-   `email-service`

These services are mocked for automated testing, but must be running locally for manual testing/development of dependant
components within the presentation layer.

Development prerequisites
-----------------------
1.  JDK 1.7 must be installed
1.  Install SASS. The [current documentation][install-sass] suggests:
    2. Install Ruby

       Mac: `brew install ruby` Add the bin folder to the path as suggested during the install

       Debian Linux: `sudo apt-get install ruby`
    2. Install SASS

       Mac & Debian Linux: `sudo gem install sass`

1.  Install SBT.  The [current documentation][install-sbt] suggests:

    Mac: `brew install sbt`

    Debian Linux: `sudo apt-get install sbt`

1.  Increase 'permanent generation space' requirements for SBT.

    Mac: Create the file `~/.sbtconfig` with the following content:

        SBT_OPTS="-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:PermSize=256M -XX:MaxPermSize=2048M $SBT_OPTS"

    Linux: edit ~/.bashrc and add

        export SBT_OPTS="-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:PermSize=256M -XX:MaxPermSize=2048M$SBT_OPTS"

Compiling
---------
Being a standard Play! application vehiles-online can be compiled by simply running `sbt compile`. A distribution zip bundle can be generated by running `sbt dist`

Running
-------
Vehicles-online needs certain secrets to be able to run. If you don't have access to the secret repo you won't be able to run the application except during the test run. There are three ways to run the application:

1. Running vehicles-online only
    - Clone the secret repo in the parent folder of vehicles-online
    - `cd <<the appropriate secrets repo>>`
    - `./setup XYZ` *"XYZ" is an offline secret key obtained through a trusted team member*
    - `cd ../vehicles-acquire-online`
    - `sbt run`
    The application is now accessible at http://localhost:9000 . There is some functionality that might not work because vehicles-online depends on various REST services which are missing. The whole application will only work if these REST services are ther.
2. Running  REST microservices manually from source code
    - Git clone all the microservices projects and decript they secrets `vehicles-acquire-fulfil`, `vehicles-lookup`, `os-address-lookup`, `<<the appropriate secrets repo>>' They should be all clonned in the same folder where `vehicles-online` was clonned.
    - Decrypt secrets `cd <<the appropriate secrets repo>>`, `./setup XYZ` *Again "XYZ" is an offline secret key obtained through a trusted team member*
3. Sandbox - Automatically run all the microservices
Just run ```sbt sandbox``` within vehicles-online and it will do all the above fast and reliable.

Afterwards open your browser to:

    http://localhost:9000/

If here are any local changes to the vehicles-acquire-online code base they would be automatically picked up next time the browser is refreshed.

### Running with production logging

To emulate production-level logging:

1.  Ensure `syslog` is configured. Details have been provided for [configuring `syslog` on OSX][syslog-osx].

2.  Run the `vehicles-acquire-online` application:

        cd vehicles-acquire-online
        ./startWithLog.sh

3.  Open in Web browser:

        http://localhost:9000/

Session encryption
------------------

Please refer to the [session encryption][session-encryption] document for details on the encryption algorithm used.

[install-sass]: http://sass-lang.com/install "Install SASS"
[install-sbt]: http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html#installing-sbt "Install SBT"
[rest]: https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm "REST"
[play-framework]: http://www.playframework.com/ "Play Framework"
[scala]: http://www.scala-lang.org/ "Scala Language"
[syslog-osx]: syslog-osx.md "Configuring syslog on OSX"
[session-encryption]: encrypted-session-state.md "Session Encryption"


text:
using System;

namespace SwtorCaster.Core.Services.Combat
{
    public interface ICombatLogService
    {
        bool IsRunning { get; }
        void Start();
        void Stop();
    }
}


text:
package com.doctoror.fuckoffmusicplayer.presentation.library.albums;

import android.content.Context;
import android.database.Cursor;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.PopupMenu;

import com.bumptech.glide.RequestManager;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.doctoror.fuckoffmusicplayer.R;
import com.doctoror.fuckoffmusicplayer.domain.albums.AlbumsProviderKt;
import com.doctoror.fuckoffmusicplayer.presentation.util.DrawableUtils;
import com.doctoror.fuckoffmusicplayer.presentation.widget.CursorRecyclerViewAdapter;
import com.doctoror.fuckoffmusicplayer.presentation.widget.viewholder.AlbumWithMenuViewHolder;
import com.l4digital.fastscroll.FastScroller;

/**
 * "Albums" recycler adapter
 */
final class AlbumsRecyclerAdapter extends CursorRecyclerViewAdapter<AlbumWithMenuViewHolder>
        implements FastScroller.SectionIndexer {

    private final RequestOptions requestOptions = new RequestOptions()
            .error(R.drawable.album_art_placeholder)
            .diskCacheStrategy(DiskCacheStrategy.NONE);

    private final LayoutInflater mLayoutInflater;

    private final RequestManager mRequestManager;

    interface OnAlbumClickListener {

        void onAlbumClick(int position, long id, String album);

        void onAlbumDeleteClick(long id, @Nullable String name);
    }

    private OnAlbumClickListener mOnAlbumClickListener;

    AlbumsRecyclerAdapter(
            @NonNull final Context context,
            @NonNull final RequestManager requestManager) {
        mLayoutInflater = LayoutInflater.from(context);
        mRequestManager = requestManager;
    }

    void setOnAlbumClickListener(@Nullable final OnAlbumClickListener onAlbumClickListener) {
        mOnAlbumClickListener = onAlbumClickListener;
    }

    private void onItemClick(final int position) {
        final Cursor item = getCursor();
        if (item != null && item.moveToPosition(position)) {
            onAlbumClick(position,
                    item.getLong(AlbumsProviderKt.COLUMN_ID),
                    item.getString(AlbumsProviderKt.COLUMN_ALBUM));
        }
    }

    private void onAlbumClick(final int position, final long id, @NonNull final String album) {
        if (mOnAlbumClickListener != null) {
            mOnAlbumClickListener.onAlbumClick(position, id, album);
        }
    }

    private void onMenuClick(@NonNull final View btnView, final int position) {
        final PopupMenu popup = new PopupMenu(btnView.getContext(), btnView);
        final Menu popupMenu = popup.getMenu();

        final MenuInflater inflater = popup.getMenuInflater();
        inflater.inflate(R.menu.list_item_album, popupMenu);

        final long id = getItemId(position);
        final Cursor item = getCursor();

        if (item != null && item.moveToPosition(position)) {
            final String albumName = item.getString(AlbumsProviderKt.COLUMN_ALBUM);
            popup.setOnMenuItemClickListener(menuItem -> onMenuItemClick(menuItem, id, albumName));
            popup.show();
        }
    }

    private boolean onMenuItemClick(@NonNull final MenuItem menuItem,
                                    final long itemId,
                                    @NonNull final String name) {
        switch (menuItem.getItemId()) {
            case R.id.actionDelete:
                if (mOnAlbumClickListener != null) {
                    mOnAlbumClickListener.onAlbumDeleteClick(itemId, name);
                }
                return true;

            default:
                return false;
        }
    }

    @Override
    public void onBindViewHolder(
            @NonNull final AlbumWithMenuViewHolder viewHolder,
            @NonNull final Cursor cursor) {
        viewHolder.text1.setText(cursor.getString(AlbumsProviderKt.COLUMN_ALBUM));
        final String artLocation = cursor.getString(AlbumsProviderKt.COLUMN_ALBUM_ART);
        if (TextUtils.isEmpty(artLocation)) {
            mRequestManager.clear(viewHolder.image);
            viewHolder.image.setImageResource(R.drawable.album_art_placeholder);
        } else {
            mRequestManager
                    .load(artLocation)
                    .apply(requestOptions)
                    .into(viewHolder.image);
        }
    }

    @NonNull
    @Override
    public AlbumWithMenuViewHolder onCreateViewHolder(
            @NonNull final ViewGroup parent, final int viewType) {
        final AlbumWithMenuViewHolder vh = new AlbumWithMenuViewHolder(
                mLayoutInflater.inflate(R.layout.recycler_item_album_with_menu, parent, false));

        vh.itemView.setOnClickListener(v -> onItemClick(vh.getAdapterPosition()));

        vh.btnMenu.setImageDrawable(DrawableUtils.getTintedDrawable(vh.btnMenu.getContext(),
                R.drawable.ic_more_vert_black_24dp, Color.WHITE));

        vh.btnMenu.setOnClickListener(v -> onMenuClick(v, vh.getAdapterPosition()));

        return vh;
    }

    @Override
    public String getSectionText(final int position) {
        final Cursor c = getCursor();
        if (c != null && c.moveToPosition(position)) {
            final String album = c.getString(AlbumsProviderKt.COLUMN_ALBUM);
            if (!TextUtils.isEmpty(album)) {
                return String.valueOf(album.charAt(0));
            }
        }
        return null;
    }
}


text:
namespace content {

class MockDeviceLightListener : public blink::WebDeviceLightListener {
 public:
  MockDeviceLightListener() : did_change_device_light_(false) {}
  ~MockDeviceLightListener() override {}

  void didChangeDeviceLight(double value) override {
    data_.value = value;
    did_change_device_light_ = true;
  }

  bool did_change_device_light() const { return did_change_device_light_; }

  void set_did_change_device_light(bool value) {
    did_change_device_light_ = value;
  }

  const DeviceLightData& data() const { return data_; }

 private:
  bool did_change_device_light_;
  DeviceLightData data_;

  DISALLOW_COPY_AND_ASSIGN(MockDeviceLightListener);
};

class DeviceLightEventPumpForTesting : public DeviceLightEventPump {
 public:
  DeviceLightEventPumpForTesting()
      : DeviceLightEventPump(0) {}
  ~DeviceLightEventPumpForTesting() override {}

  void DidStart(mojo::ScopedSharedBufferHandle renderer_handle) {
    DeviceLightEventPump::DidStart(std::move(renderer_handle));
  }
  void SendStartMessage() override {}
  void SendStopMessage() override {}
  void FireEvent() override {
    DeviceLightEventPump::FireEvent();
    Stop();
    base::MessageLoop::current()->QuitWhenIdle();
  }

 private:
  DISALLOW_COPY_AND_ASSIGN(DeviceLightEventPumpForTesting);
};

class DeviceLightEventPumpTest : public testing::Test {
 public:
  DeviceLightEventPumpTest() = default;

 protected:
  void SetUp() override {
    listener_.reset(new MockDeviceLightListener);
    light_pump_.reset(new DeviceLightEventPumpForTesting);
    shared_memory_ =
        mojo::SharedBufferHandle::Create(sizeof(DeviceLightHardwareBuffer));
    mapping_ = shared_memory_->Map(sizeof(DeviceLightHardwareBuffer));
    ASSERT_TRUE(mapping_);
  }

  void InitBuffer() {
    DeviceLightData& data = buffer()->data;
    data.value = 1.0;
  }

  MockDeviceLightListener* listener() { return listener_.get(); }
  DeviceLightEventPumpForTesting* light_pump() { return light_pump_.get(); }
  mojo::ScopedSharedBufferHandle handle() {
    return shared_memory_->Clone(
        mojo::SharedBufferHandle::AccessMode::READ_ONLY);
  }
  DeviceLightHardwareBuffer* buffer() {
    return reinterpret_cast<DeviceLightHardwareBuffer*>(mapping_.get());
  }

 private:
  base::MessageLoop loop_;
  std::unique_ptr<MockDeviceLightListener> listener_;
  std::unique_ptr<DeviceLightEventPumpForTesting> light_pump_;
  mojo::ScopedSharedBufferHandle shared_memory_;
  mojo::ScopedSharedBufferMapping mapping_;

  DISALLOW_COPY_AND_ASSIGN(DeviceLightEventPumpTest);
};

TEST_F(DeviceLightEventPumpTest, DidStartPolling) {
  InitBuffer();

  light_pump()->Start(listener());
  light_pump()->DidStart(handle());

  base::RunLoop().Run();

  const DeviceLightData& received_data = listener()->data();
  EXPECT_TRUE(listener()->did_change_device_light());
  EXPECT_EQ(1, static_cast<double>(received_data.value));
}

TEST_F(DeviceLightEventPumpTest, FireAllNullEvent) {
  light_pump()->Start(listener());
  light_pump()->DidStart(handle());

  base::RunLoop().Run();

  const DeviceLightData& received_data = listener()->data();
  EXPECT_TRUE(listener()->did_change_device_light());
  EXPECT_FALSE(received_data.value);
}

TEST_F(DeviceLightEventPumpTest, DidStartPollingValuesEqual) {
  InitBuffer();

  light_pump()->Start(listener());
  light_pump()->DidStart(handle());

  base::RunLoop().Run();

  const DeviceLightData& received_data = listener()->data();
  EXPECT_TRUE(listener()->did_change_device_light());
  EXPECT_EQ(1, static_cast<double>(received_data.value));

  double last_seen_data = received_data.value;
  // Set next value to be same as previous value.
  buffer()->data.value = 1.0;
  listener()->set_did_change_device_light(false);

  // Reset the pump's listener.
  light_pump()->Start(listener());

  base::ThreadTaskRunnerHandle::Get()->PostTask(
      FROM_HERE, base::Bind(&DeviceLightEventPumpForTesting::FireEvent,
                            base::Unretained(light_pump())));
  base::RunLoop().Run();

  // No change in device light as present value is same as previous value.
  EXPECT_FALSE(listener()->did_change_device_light());
  EXPECT_EQ(last_seen_data, static_cast<double>(received_data.value));
}

}  // namespace content


text:
module Kindai
  class Publisher
    attr_accessor :root_path
    attr_accessor :book

    def self.new_from_path(root_path)
      me = self.new
      me.root_path = root_path
      me
    end

    def name(n)
      config(:name, n)
      self
    end

    def resize(width, height)
      config(:resize, {:width => width, :height => height})
      self
    end

    def trim(geometry = true)
      config(:trim, geometry) unless config(:trim)
      self
    end

    def zip
      config(:zip, true)
      self
    end

    def divide
      config(:divide, true)
      self
    end

    def empty(glob)
      FileUtils.rm_r(Dir.glob(File.join(self.root_path, glob)))
    end

    def publish
      Kindai::Util.logger.info("publish #{root_path}, #{config(:name)}")
      raise "no name" unless config(:name)
      self.ensure_book
      if seems_finished?
        Kindai::Util.logger.info("already published")
        return
      end
      create_directory

      path = original_path

      path = trim!(path) if trim?
      path = divide!(path) if divide?
      path = resize!(path) if resize?
      path = zip!(path) if zip?
    end

    def publish_auto
      self.ensure_book
      self.clone.trim.resize(1280, 960).trim.zip.name('iphone').publish
      self.clone.trim.resize(600, 800).divide.zip.name('kindle').publish
    end

    def publish_default
      self.ensure_book
      self.clone.trim.name('default').publish
    end

    def publish_for_iphone
      self.ensure_book
      self.clone.trim.resize(1280, 960).trim.zip.name('iphone').publish
    end

    def publish_for_ipad
      self.ensure_book
      self.clone.trim.resize(768*2, 1024).trim.zip.name('ipad').publish
    end

    def publish_for_kindle
      self.ensure_book
      self.clone.trim.resize(600, 800).divide.zip.name('kindle').publish
    end

    def ensure_book
      @book ||= Kindai::Book.new_from_local_directory(root_path)
      true
    end

    # ------------------------------------
    protected

    def config(k, v = nil)
      @config ||= {}
      return @config[k] unless v
      @config[k] = v
      @config
    end

    def trim?
      config(:trim)
    end

    def resize?
      config(:resize)
    end

    def zip?
      config(:zip)
    end

    def divide?
      config(:divide)
    end

    # ---------- aciton --------------

    def trim!(source_path)
      return trim_path if files(source_path).length == files(trim_path).length
      info = config(:trim).kind_of?(Hash) ? config(:trim) : Kindai::Util.trim_info_auto(book, original_files)
      Kindai::Util.logger.info "trim position: #{info}"
      files(source_path).each{|file|
        dst = File.join(trim_path, File.basename(file))
        Kindai::Util.trim_file_to(file, dst, info)
        GC.start
      }
      return trim_path
    end

    def resize!(source_path)
      files(source_path).each{|file|
        dst = File.join(output_path, File.basename(file))
        Kindai::Util.resize_file_to(file, dst, config(:resize))
        GC.start
      }
      return output_path
    end

    def divide!(source_path)
      files(source_path).each{|file|
        Kindai::Util.divide_43(file, output_path)
        GC.start
      }
      return output_path
    end

    def zip!(source_path)
      Kindai::Util.generate_zip(source_path)
      FileUtils.rm_r(self.output_path)
      return source_path
    end

    # ---------util------------

    def create_directory
      Dir.mkdir(trim_path) unless File.directory?(trim_path)
      Dir.mkdir(output_path) unless File.directory?(output_path)
    end

    def trim_path
      File.join(root_path, 'trim')
    end

    def original_path
      File.join(root_path, 'original')
    end

    def output_path
      File.join(root_path, File.basename(root_path) + '_' + config(:name))
    end

    def original_files
      files(original_path)
    end

    def files(path)
      Dir.glob(File.join(path, '*jpg'))
    end

    def seems_finished?
      zip? ? File.exists?(output_path + '.zip') : File.directory?(output_path)
    end

  end
end


text:
/**
 * Created by gorgus on 2015-01-07.
 */

declare module "urllite" {

	interface UrlLiteResult {
		origin: string;
		protocol: string;
		username: string;
		password: string;
		host: string;
		hostname: string;
		port: string;
		pathname: string;
		search: string;
		hash: string;
		resolve(url: string): UrlLiteResult;
		relativize(url: string): UrlLiteResult;
	}

    function urllite(url: string): UrlLiteResult;

	namespace urllite {}
    export = urllite;

}


text:
#######################DISA INFORMATION###############################
#Group ID (Vulid): V-791
#Group Title: NIS/NIS+/yp File Permissions
#Rule ID: SV-27179r1_rule
#Severity: CAT II
#Rule Version (STIG-ID): GEN001360
#Rule Title: The NIS/NIS+/yp command files must have mode 0755 or less
#permissive.
#
#Vulnerability Discussion: NIS/NIS+/yp files are part of the system's
#identification and authentication processes and are, therefore,
#critical to system security. Unauthorized modification of these files
#could compromise these processes and the system.
#
#Responsibility: System Administrator
#IAControls: ECLP-1
#
#Check Content:
#Perform the following to check NIS file ownership:
# ls -la /var/yp/*;
#If the file's mode is more permissive than 0755, this is a finding.
#
#Fix Text: Change the mode of NIS/NIS+/yp command files to 0755 or
#less permissive.
#
#Procedure (example):
# chmod 0755 <filename>
#######################DISA INFORMATION###############################

#Global Variables#
PDI=GEN001360
BADYPFILE=`find /var/yp/ -type f -perm /7022`

#Start-Lockdown

for BADFILE in $BADYPFILE
  do
    chmod u-s,g-ws,o-wt $BADFILE
done


text:
const WEB_PREFIX = "http://localhost:9876";

interface BlockTestCase {
    packageName: string;
    testFiles: { testName: string, contents: string }[];
}

declare const testJSON: { libsTests: BlockTestCase[], commonTests: BlockTestCase[] };

// Blockly crashes if this isn't defined
(Blockly as any).Msg.DELETE_VARIABLE = "Delete the '%1' variable";

// target.js should be embedded in the page
pxt.setAppTarget((window as any).pxtTargetBundle);

// Webworker needs this config to run
pxt.webConfig = {
    relprefix: undefined,
    verprefix: undefined,
    workerjs: WEB_PREFIX + "/blb/worker.js",
    monacoworkerjs: undefined,
    pxtVersion: undefined,
    pxtRelId: undefined,
    pxtCdnUrl: undefined,
    commitCdnUrl: undefined,
    blobCdnUrl: undefined,
    cdnUrl: undefined,
    targetVersion: undefined,
    targetRelId: undefined,
    targetUrl: undefined,
    targetId: undefined,
    simUrl: undefined,
    partsUrl: undefined,
    runUrl: undefined,
    docsUrl: undefined,
    isStatic: undefined,
};

class BlocklyCompilerTestHost implements pxt.Host {
    static cachedFiles: pxt.Map<string> = {};

    static createTestHostAsync() {
        if (pxt.appTarget.appTheme && pxt.appTarget.appTheme.extendFieldEditors && pxt.editor.initFieldExtensionsAsync) {
            return pxt.editor.initFieldExtensionsAsync({})
            .then(res => {
                if (res.fieldEditors)
                    res.fieldEditors.forEach(fi => {
                        pxt.blocks.registerFieldEditor(fi.selector, fi.editor, fi.validator);
                    })
            })
            .then(() => new BlocklyCompilerTestHost())
        }

        return Promise.resolve(new BlocklyCompilerTestHost())
    }

    constructor() {
    }

    readFile(module: pxt.Package, filename: string): string {
        if (module.id == "this" && filename == "pxt.json") {
            return JSON.stringify(pxt.appTarget.blocksprj.config);
        }

        const bundled = pxt.getEmbeddedScript(module.id);

        if (bundled) {
            return bundled[filename];
        }

        return "";
    }

    writeFile(module: pxt.Package, filename: string, contents: string): void {
        if (filename == pxt.CONFIG_NAME)
            return; // ignore config writes
        throw ts.pxtc.Util.oops("trying to write " + module + " / " + filename)
    }

    getHexInfoAsync(extInfo: pxtc.ExtensionInfo): Promise<pxtc.HexInfo> {
        return pxt.hex.getHexInfoAsync(this, extInfo)
    }

    cacheStoreAsync(id: string, val: string): Promise<void> {
        return Promise.resolve()
    }

    cacheGetAsync(id: string): Promise<string> {
        return Promise.resolve(null as string)
    }

    downloadPackageAsync(pkg: pxt.Package) {
        return Promise.resolve();
    }
}

function fail(msg: string) {
    chai.assert(false, msg);
}

let cachedBlocksInfo: pxtc.BlocksInfo;

function getBlocksInfoAsync(): Promise<pxtc.BlocksInfo> {
    if (cachedBlocksInfo) {
        return Promise.resolve(cachedBlocksInfo);
    }

    return BlocklyCompilerTestHost.createTestHostAsync()
        .then(host => {
            const pkg = new pxt.MainPackage(host);
            return pkg.getCompileOptionsAsync();
        }, err => fail('Unable to create test host'))
        .then(opts => {
            opts.ast = true
            let resp = pxtc.compile(opts)
            if (resp.diagnostics && resp.diagnostics.length > 0)
                resp.diagnostics.forEach(diag => console.error(diag.messageText));
            if (!resp.success)
                return Promise.reject("Could not compile");

            // decompile to blocks
            let apis = pxtc.getApiInfo(opts, resp.ast);
            let blocksInfo = pxtc.getBlocksInfo(apis);
            pxt.blocks.initializeAndInject(blocksInfo);

            cachedBlocksInfo = blocksInfo;

            return cachedBlocksInfo;
        }, err => fail('Could not get compile options'))
}

function testXmlAsync(blocksfile: string) {
    return initAsync()
        .then(() => getBlocksInfoAsync())
        .then(blocksInfo => {
            const workspace = new Blockly.Workspace();
            (Blockly as any).mainWorkspace = workspace;
            const xml = Blockly.Xml.textToDom(blocksfile);

            try {
                Blockly.Xml.domToWorkspace(xml, workspace);
            }
            catch (e) {
                if (e.message && e.message.indexOf("isConnected") !== -1) {
                    fail("Could not build workspace, this usually means a blockId (aka blockly 'type') changed")
                }
                fail(e.message);
            }

            const err = compareBlocklyTrees(xml, Blockly.Xml.workspaceToDom(workspace));
            if (err) {
                fail(`XML mismatch (${err.reason}) ${err.chain} \n See https://makecode.com/develop/blockstests for more info`);
            }
        }, err => fail(`Unable to get block info: ` + JSON.stringify(err)))
}

function mkLink(el: Element) {
    let tag = el.tagName.toLowerCase();
    switch (tag) {
        case "block":
        case "shadow":
            return `<${tag} type="${el.getAttribute("type")}">`;
        case "value":
        case "statement":
        case "title":
        case "field":
            return `<${tag} name="${el.getAttribute("name")}">`;

        default:
            return `<${tag}>`;;

    }
}

function compareBlocklyTrees(a: Element, b: Element, prev: string[] = []): { chain: string, reason: string } {
    prev.push(mkLink(a));
    if (!shallowEquals(a, b)) return {
        chain: prev.join(" -> "),
        reason: "mismatched element"
    };

    for (let i = 0; i < a.childNodes.length; i++) {
        const childA = a.childNodes.item(i);
        if (childA.nodeType === Node.ELEMENT_NODE) {
            const childB = getMatchingChild(childA as Element, b);
            if (!childB) return {
                chain: prev.join(" -> "),
                reason: "missing child " + mkLink(childA as Element)
            };

            const err = compareBlocklyTrees(childA as Element, childB as Element, prev.slice());
            if (err) {
                return err;
            }
        }
    }

    return undefined;
}

function getMatchingChild(searchFor: Element, parent: Element) {
    for (let i = 0; i < parent.childNodes.length; i++) {
        const child = parent.childNodes.item(i);
        if (child.nodeType === Node.ELEMENT_NODE && shallowEquals(searchFor, child as Element)) return child;
    }
    return undefined;
}

function shallowEquals(a: Element, b: Element) {
    if (a.tagName.toLowerCase() !== b.tagName.toLowerCase()) return false;

    switch (a.tagName.toLowerCase()) {
        case "block":
        case "shadow":
            return a.getAttribute("type") === b.getAttribute("type");
        case "value":
        case "statement":
            return a.getAttribute("name") === b.getAttribute("name");
        case "title":
        case "field":
            return a.getAttribute("name") === b.getAttribute("name") && a.textContent.trim() === b.textContent.trim();
        case "mutation":
            const aAttributes = a.attributes;
            const bAttributes = b.attributes;

            if (aAttributes.length !== bAttributes.length) return false;

            for (let i = 0; i < aAttributes.length; i++) {
                const attrName = aAttributes.item(i).name;
                if (a.getAttribute(attrName) != b.getAttribute(attrName)) return false;
            }
            return a.textContent.trim() === b.textContent.trim();
        case "data":
            return a.textContent.trim() === b.textContent.trim();
        case "next":
        case "comment":
            return true;
    }

    return true;
}

let init = false;

function initAsync() {
    if (init) return Promise.resolve();
    init = true;
    if (pxt.appTarget.appTheme && pxt.appTarget.appTheme.extendFieldEditors && pxt.editor.initFieldExtensionsAsync) {
        return pxt.editor.initFieldExtensionsAsync({})
        .then(res => {
            if (res.fieldEditors)
                res.fieldEditors.forEach(fi => {
                    pxt.blocks.registerFieldEditor(fi.selector, fi.editor, fi.validator);
                })
        })
    }
    return Promise.resolve();
}

function encode(testcase: string) {
    return testcase.split(/[\\\/]/g).map(encodeURIComponent).join("/");
}

if (testJSON.libsTests && testJSON.libsTests.length) {
    describe("block tests in target", function() {
        this.timeout(5000);
        for (const test of testJSON.libsTests) {
            describe("for package " + test.packageName, () => {
                for (const testFile of test.testFiles) {
                    it("file " + testFile.testName, () => testXmlAsync(testFile.contents));
                }
            });
        }
    });
}
if (testJSON.commonTests && testJSON.commonTests.length) {
    describe("block tests in common-packages", function() {
        this.timeout(5000);
        for (const test of testJSON.commonTests) {
            describe("for package " + test.packageName, () => {
                for (const testFile of test.testFiles) {
                    it("file " + testFile.testName, () => testXmlAsync(testFile.contents));
                }
            });
        }
    });
}


text:
#include <aws/codestar/model/CreateUserProfileResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::CodeStar::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

CreateUserProfileResult::CreateUserProfileResult()
{
}

CreateUserProfileResult::CreateUserProfileResult(const AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

CreateUserProfileResult& CreateUserProfileResult::operator =(const AmazonWebServiceResult<JsonValue>& result)
{
  const JsonValue& jsonValue = result.GetPayload();
  if(jsonValue.ValueExists("userArn"))
  {
    m_userArn = jsonValue.GetString("userArn");

  }

  if(jsonValue.ValueExists("displayName"))
  {
    m_displayName = jsonValue.GetString("displayName");

  }

  if(jsonValue.ValueExists("emailAddress"))
  {
    m_emailAddress = jsonValue.GetString("emailAddress");

  }

  if(jsonValue.ValueExists("sshPublicKey"))
  {
    m_sshPublicKey = jsonValue.GetString("sshPublicKey");

  }

  if(jsonValue.ValueExists("createdTimestamp"))
  {
    m_createdTimestamp = jsonValue.GetDouble("createdTimestamp");

  }

  if(jsonValue.ValueExists("lastModifiedTimestamp"))
  {
    m_lastModifiedTimestamp = jsonValue.GetDouble("lastModifiedTimestamp");

  }

  return *this;
}


text:
FactoryGirl.define do
  sequence :name do |n|
    "Foo bar #{n}"
  end

  sequence :email do |n|
    "person#{n}@example.com"
  end

  sequence :uid do |n|
    "#{n}"
  end

  sequence :permalink do |n|
    "foo_page_#{n}"
  end

  factory :user do |f|
    f.name "Foo bar"
    f.password "123456"
    f.email { generate(:email) }
    f.bio "This is Foo bar's biography."
  end

  factory :category do |f|
    f.name_pt { generate(:name) }
    f.name_en { generate(:name) }
  end

  factory :project do |f|
    f.name "Foo bar"
    f.permalink { generate(:permalink) }
    f.association :user, factory: :user
    f.association :category, factory: :category
    f.about "Foo bar"
    f.headline "Foo bar"
    f.goal 10000
    f.online_date Time.now
    f.online_days 5
    f.how_know 'Lorem ipsum'
    f.more_links 'Ipsum dolor'
    f.first_contributions 'Foo bar'
    f.video_url 'http://vimeo.com/17298435'
    f.state 'online'
  end

  factory :channels_subscriber do |f|
    f.association :user
    f.association :channel
  end

  factory :unsubscribe do |f|
    f.association :user, factory: :user
    f.association :project, factory: :project
  end

  factory :notification do |f|
    f.association :user, factory: :user
    f.association :contribution, factory: :contribution
    f.association :project, factory: :project
    f.template_name 'project_success'
    f.origin_name 'Foo Bar'
    f.origin_email 'foo@bar.com'
    f.locale 'pt'
  end

  factory :reward do |f|
    f.association :project, factory: :project
    f.minimum_value 10.00
    f.description "Foo bar"
    f.days_to_delivery 10
  end

  factory :contribution do |f|
    f.association :project, factory: :project
    f.association :user, factory: :user
    f.confirmed_at Time.now
    f.value 10.00
    f.state 'confirmed'
    f.credits false
    f.payment_id '1.2.3'
  end

  factory :payment_notification do |f|
    f.association :contribution, factory: :contribution
    f.extra_data {}
  end

  factory :authorization do |f|
    f.association :oauth_provider
    f.association :user
    f.uid 'Foo'
  end

  factory :oauth_provider do |f|
    f.name 'facebook'
    f.strategy 'GitHub'
    f.path 'github'
    f.key 'test_key'
    f.secret 'test_secret'
  end

  factory :configuration do |f|
    f.name 'Foo'
    f.value 'Bar'
  end

  factory :institutional_video do |f|
    f.title "My title"
    f.description "Some Description"
    f.video_url "http://vimeo.com/35492726"
    f.visible false
  end

  factory :update do |f|
    f.association :project, factory: :project
    f.association :user, factory: :user
    f.title "My title"
    f.comment "This is a comment"
    f.comment_html "
This is a comment
"
  end

  factory :channel do
    name "Test"
    email "email+channel@foo.bar"
    description "Lorem Ipsum"
    sequence(:permalink) { |n| "#{n}-test-page" }
  end

  factory :state do
    name "RJ"
    acronym "RJ"
  end

  factory :channel_post do |f|
    f.association :user, factory: :user
    f.association :channel, factory: :channel
    title "My title"
    f.body "This is a comment"
    f.body_html "
This is a comment
"
  end

end


text:
                    Start Instance

                               Delete Scenario

Scenario Details

                        Scenario ID
                        {{"# " + scenarioCtrl.currentScenario['id']}}

                        Scenario Name
                        {{scenarioCtrl.currentScenario['details']['name']}}

                        Amount of active Cases
                        {{scenarioCtrl.currentScenario['instances']['ids'].length}}

                        Termination Condition

                            <button class="btn btn-info btn-xs" type="button" data-toggle="modal"
                                    data-target="#terminationCondition">
                                Info
                            </button>

                        Average Duration
                        {{scenarioCtrl.currentScenario['duration']}}


text:
package org.rzo.yajsw.controller.jvm;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;

import org.rzo.yajsw.controller.Message;

public class MessageEncoder extends MessageToByteEncoder<Message>
{

	/** The Constant encoder. */
	static final CharsetEncoder encoder = Charset.defaultCharset().newEncoder();

	@Override
	protected void encode(ChannelHandlerContext ctx, Message m, ByteBuf buffer)
			throws Exception
	{
		buffer.writeByte(m.getCode());
		buffer.writeBytes(encoder.encode(CharBuffer.wrap(m.getMessage())));
		buffer.writeByte((byte) 0);
	}

}


text:
#include "./softmax_activation-inl.h"
#include "./mshadow_op.h"

namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(SoftmaxActivationParam param) {
  return new SoftmaxActivationOp<cpu>(param);
}

// DO_BIND_DISPATCH comes from operator_common.h
Operator *SoftmaxActivationProp::CreateOperator(Context ctx) const {
  DO_BIND_DISPATCH(CreateOp, param_);
}

DMLC_REGISTER_PARAMETER(SoftmaxActivationParam);

MXNET_REGISTER_OP_PROPERTY(SoftmaxActivation, SoftmaxActivationProp)
.describe(R"code(Applies softmax activation to input. This is intended for internal layers.

.. note::

  This operator has been deprecated, please use `softmax`.

If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
This is the default mode.

If `mode` = ``channel``, this operator will compute a k-class softmax at each position
of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
has at least 3 dimensions.
This can be used for `fully convolutional network`, `image segmentation`, etc.

Example::

  >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
  >>>                            [2., -.4, 7.,   3., 0.2]])
  >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
  >>> print softmax_act.asnumpy()
  [[  1.78322066e-02   1.46375655e-03   5.38485940e-04   6.56010211e-03   9.73605454e-01]
   [  6.56221947e-03   5.95310994e-04   9.73919690e-01   1.78379621e-02   1.08472735e-03]]

)code" ADD_FILELINE)
.add_argument("data", "NDArray-or-Symbol", "Input array to activation function.")
.add_arguments(SoftmaxActivationParam::__FIELDS__());

}  // namespace op
}  // namespace mxnet


text:
package org.javers.core.examples;

import org.javers.core.Javers;
import org.javers.core.JaversBuilder;
import org.javers.core.diff.Diff;
import org.javers.core.diff.changetype.*;
import org.javers.core.examples.model.Employee;
import org.junit.Test;
import static org.fest.assertions.api.Assertions.assertThat;

public class EmployeeHierarchiesDiffExample {

  /** NewObject example */
  @Test
  public void shouldDetectHired() {
    //given
    Javers javers = JaversBuilder.javers().build();

    Employee oldBoss = new Employee("Big Boss").addSubordinates(
            new Employee("Great Developer"));

    Employee newBoss = new Employee("Big Boss").addSubordinates(
            new Employee("Great Developer"),
            new Employee("Hired One"),
            new Employee("Hired Second"));

    //when
    Diff diff = javers.compare(oldBoss, newBoss);

    //then
    assertThat(diff.getObjectsByChangeType(NewObject.class))
        .hasSize(2)
        .containsOnly(new Employee("Hired One"),
                      new Employee("Hired Second"));

    System.out.println(diff);
  }

  /** ObjectRemoved example */
  @Test
  public void shouldDetectFired() {
    //given
    Javers javers = JaversBuilder.javers().build();

    Employee oldBoss = new Employee("Big Boss").addSubordinates(
        new Employee("Great Developer"),
        new Employee("Team Lead").addSubordinates(
                new Employee("Another Dev"),
                new Employee("To Be Fired")
        ));

    Employee newBoss = new Employee("Big Boss").addSubordinates(
        new Employee("Great Developer"),
        new Employee("Team Lead").addSubordinates(
                new Employee("Another Dev")
        ));

    //when
    Diff diff = javers.compare(oldBoss, newBoss);

    //then
    assertThat(diff.getChangesByType(ObjectRemoved.class)).hasSize(1);

    System.out.println(diff);
  }

  /** ValueChange example */
  @Test
  public void shouldDetectSalaryChange(){
    //given
    Javers javers = JaversBuilder.javers().build();

    Employee oldBoss = new Employee("Big Boss").addSubordinates(
        new Employee("Noisy Manager"),
        new Employee("Great Developer", 10000));

    Employee newBoss = new Employee("Big Boss").addSubordinates(
        new Employee("Noisy Manager"),
        new Employee("Great Developer", 20000));

    //when
    Diff diff = javers.compare(oldBoss, newBoss);

    //then
    ValueChange change =  diff.getChangesByType(ValueChange.class).get(0);

    assertThat(change.getAffectedLocalId()).isEqualTo("Great Developer");
    assertThat(change.getPropertyName()).isEqualTo("salary");
    assertThat(change.getLeft()).isEqualTo(10000);
    assertThat(change.getRight()).isEqualTo(20000);

    System.out.println(diff);
  }

  /** ReferenceChange example */
  @Test
  public void shouldDetectBossChange() {
    //given
    Javers javers = JaversBuilder.javers().build();

    Employee oldBoss = new Employee("Big Boss").addSubordinates(
        new Employee("Manager One")
           .addSubordinate(new Employee("Great Developer")),
        new Employee("Manager Second"));

    Employee newBoss = new Employee("Big Boss").addSubordinates(
        new Employee("Manager One"),
        new Employee("Manager Second")
           .addSubordinate(new Employee("Great Developer")));

    //when
    Diff diff = javers.compare(oldBoss, newBoss);

    //then
    ReferenceChange change = diff.getChangesByType(ReferenceChange.class).get(0);

    assertThat(change.getAffectedLocalId()).isEqualTo("Great Developer");
    assertThat(change.getLeft().value()).endsWith("Manager One");
    assertThat(change.getRight().value()).endsWith("Manager Second");

    System.out.println(diff);
  }
}