text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015-2017 Red Hat, Inc. and/or its affiliates
    and other contributors as indicated by the @author tags.

    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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.hawkular.alerts</groupId>
    <artifactId>hawkular-alerts</artifactId>
    <version>2.0.0.Final-SNAPSHOT</version>
  </parent>

  <artifactId>hawkular-alerts-engine</artifactId>
  <packaging>jar</packaging>

  <name>Hawkular Alerting: Engine</name>

  <dependencies>

    <!-- Hawkular Alerting dependencies -->
    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-commons</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-events-aggregation</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-filter-api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-core</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
      <version>${version.org.drools}</version>
      <exclusions>
        <exclusion>
          <groupId>xmlpull</groupId>
          <artifactId>xmlpull</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xpp3</groupId>
          <artifactId>xpp3_min</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!--
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${version.com.google.guava}</version>
    </dependency>
    -->

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>${version.org.apache.commons.commons-math3}</version>
    </dependency>

    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4-runtime</artifactId>
      <version>${version.org.antlr}</version>
    </dependency>

    <!-- Wildfly dependencies -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>${version.com.fasterxml.jackson}</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>${version.com.fasterxml.jackson}</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>${version.com.fasterxml.jackson}</version>
    </dependency>

    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-core</artifactId>
      <version>${version.org.infinispan.wildfly}</version>
    </dependency>

    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-query</artifactId>
      <version>${version.org.infinispan.wildfly}</version>
      <exclusions>
        <exclusion>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-search-backend-elasticsearch</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!--
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-search-engine</artifactId>
      <version>${version.org.hibernate}</version>
    </dependency>
    -->

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <scope>test</scope>
      <version>${version.org.apache.logging.log4j}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>test</scope>
      <version>${version.org.apache.logging.log4j}</version>
    </dependency>

    <!-- Tests -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
      <version>${version.junit}</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>hawkular-alerts/**</exclude>
        </excludes>
        <filtering>false</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <excludes>**/engine/tags/parser/*.java</excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>${version.org.antlr}</version>
        <executions>
          <execution>
            <id>antlr4</id>
            <goals>
              <goal>antlr4</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <listener>true</listener>
              <visitor>true</visitor>
              <outputDirectory>src/main/java</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.org.apache.maven.plugins.maven-jar-plugin}</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
            <manifestEntries>
              <Implementation-Vendor-Id>org.hawkular.alerts</Implementation-Vendor-Id>
              <Implementation-Version>${project.version}</Implementation-Version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!--
          Profiles to control test scenarios activated with the variable test-env
          Default tests don't run performance and persistence tests.
    -->
    <profile>
      <id>default-tests</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${version.org.apache.maven.plugins.maven-surefire-plugin}</version>
            <configuration>
              <systemProperties>
                <property>
                  <name>testOutput</name>
                  <value>${project.build.testOutputDirectory}</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
var oStrReg = /([()\\|$\^*?.+\[\]\{\}\/])/g;
var oTagRegs = {};

function Smtpl(_asWordReg)
{
	this._msWordReg = _asWordReg || '\\w+?';
	this._moTagRegs = oTagRegs[this._msWordReg] || (oTagRegs[this._msWordReg] = {});
}
var proto = Smtpl.prototype;

proto.render = function(_asStr, _aoParams, _asTag)
{
	if (!_asStr && !_aoParams) return '';

	_asTag = _asTag || '$';
	var _oSelf = this;

	if (typeof _asStr !== 'string')
	{
		return function(_asStr)
		{
			return _oSelf._replace(_asStr, _aoParams, _asTag);
		};
	}
	else if (!_aoParams)
	{
		return function(_aoParams)
		{
			return _oSelf._replace(_asStr, _aoParams || {}, _asTag);
		};
	}

	return _oSelf._replace(_asStr, _aoParams, _asTag);
};

proto._replace = function(_asStr, _aoParams, _asTag)
{
	var _oSelf = this;
	return (''+_asStr).replace(_oSelf._generateReplaceRegExp(_asTag), function(_asTotal, _asName)
	{
		return _oSelf.value(_asName, _aoParams, _asTotal, _asTag, arguments);
	});
};

/**
 * return param value
 * @param  {String} _asName          param name
 * @param  {Object} _aoParams        params
 * @param  {String} _asTotal         match string
 * @param  {String} _asTag           match tag
 * @param  {*Array} _asReplaceArgs   replace arguments
 * @return {String}                  replace value
 */
proto.value = function(_asName, _aoParams, _asTotal, _asTag, _aoReplaceArgs)
{
	return _asName in _aoParams ? _aoParams[_asName] : '';
};

proto._generateReplaceRegExp = function(_asTag)
{
	var _oReg = this._moTagRegs[_asTag];

	if (!_oReg)
	{
		var _sTempTag = _asTag.replace(oStrReg, '\\$1');
		_oReg = new RegExp(_sTempTag+'('+this._msWordReg+')'+_sTempTag, 'g');
		this._moTagRegs[_asTag] = _oReg;
	}

	return _oReg;
};

redpajama_set_name: RedPajamaGithub


text:
git add .
git commit -am "change no. xxx"
git push origin master


text:
#include <arcore_c_api.h>
#include "platform_tools/android/apps/arcore/src/main/cpp/SkArCamera.h"
#include "SkArUtil.h"

std::unique_ptr<SkArCamera> SkArCamera::Make(SkArSession* session, SkArFrame* frame) {
    return std::unique_ptr<SkArCamera>(new SkArCamera(session, frame));
}

SkArCamera::~SkArCamera() {
    ArCamera_release(fArCamera);
}

SkArCamera::SkArCamera(SkArSession* session, SkArFrame* frame) : fArCamera(nullptr) {
    ArFrame_acquireCamera(session->getArSession(), frame->getArFrame(), &fArCamera);
}

void SkArCamera::getViewMatrix(const SkArSession* session, float outColMajor[16]) {
    ArCamera_getViewMatrix(session->getArSession(), fArCamera, outColMajor);
}

void SkArCamera::getProjectionMatrix(const SkArSession* session, float nearClip,
                                     float farClip, float outColMajor[16]) {
    ArCamera_getProjectionMatrix(session->getArSession(), fArCamera, nearClip, farClip,
                                 outColMajor);
}

SkArTrackingState SkArCamera::getTrackingState(const SkArSession* session) {
    ArTrackingState arTrackingState;
    ArCamera_getTrackingState(session->getArSession(), fArCamera, &arTrackingState);
    return SkArUtil::MakeSkArTrackingState(arTrackingState);
}


text:
require "oily_png"

class RgbaPng

  def self.init(file, destination)
    if !file || !destination
      puts 'Usage: rgba-png sourcefile destination'

      return
    end

    colors = parse(file)
    create_files colors, destination

    puts colors.uniq.length.to_s + ' image(s) created!'
  end

  # Creates colors array from source file
  def self.parse(file)
    colors = []
    rgba = /rgba\((\d+),(\d+),(\d+),(\d?.\d+)\)/

    IO.foreach(file) do |line|
      is_rgba = line.match rgba

      if is_rgba
        color = {
            r: is_rgba[1].to_i,
            g: is_rgba[2].to_i,
            b: is_rgba[3].to_i,
            a: (is_rgba[4].to_f * 255).to_i # Convert alpha value to 0-255 range
        }

        colors.push(color)
      end
    end

    colors
  end

  # Create file name from color, ex: 255-255-255-0.8
  def self.file_name(color)
    # Convert the alpha to 0-1 range
    alpha = (color[:a] / 255.to_f).round(1)

    color[:r].to_s + '-' + color[:g].to_s + '-' + color[:b].to_s + '-' + alpha.to_s
  end

  # Create png files from colors
  def self.create_files(colors, destination)
    colors.uniq.each do |color|
      bg = ChunkyPNG::Color.rgba(color[:r], color[:g], color[:b], color[:a])
      png = ChunkyPNG::Image.new(16, 16, bg)

      unless Dir.exists? destination
        Dir.mkdir destination
      end

      png.save(destination + '/' + (file_name(color) + '.png'), interlace: true)
    end
  end

end


text:
import io
import os
from binaryornot import check

from .gitignore import read_ignore, remove_ignores

def read_directory(project_directory):
    directory_entries = []

    project_parent_directory = os.path.normpath(
        os.path.join(project_directory, os.pardir)
    )

    ignore_path = os.path.join(project_directory, '.gitignore')
    ignore_list = []
    if os.path.exists(ignore_path):
        ignore_list = read_ignore(read_file(ignore_path))

    for root, dirs, files in os.walk(project_directory):

        directory_path = os.path.relpath(root, project_parent_directory)

        if '.git' in directory_path:
            dirs[:] = []
            continue

        directory = {
            'path': directory_path,
            'files': [],
        }

        if ignore_list:
            files = remove_ignores(files, ignore_list)

        for file_path in files:
            if file_path.startswith('.'):
                continue

            file_path = os.path.join(root, file_path)

            content = read_file(file_path)
            is_binary = check.is_binary(file_path)

            directory['files'].append({
                'path': os.path.relpath(file_path, project_parent_directory),
                'binary': is_binary,
                'content': content,
            })

        directory_entries.append(directory)

    return directory_entries

def read_file(file_path):
    is_binary = check.is_binary(file_path)
    mode = 'r{}'.format('b' if is_binary else 't')
    return io.open(file_path, mode=mode).read()


text:
package com.google.gerrit.client.openid;

import com.google.gerrit.client.SignInDialog;
import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.SmallHeading;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.FormElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormSubmitCompleteEvent;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
import com.google.gwtexpui.globalkey.client.NpTextBox;

import java.util.Map;

public class OpenIdLoginPanel extends Composite implements
    FormPanel.SubmitHandler {
  private final SignInDialog.Mode mode;
  private final LoginIcons icons;
  private final FlowPanel panelWidget;
  private final FormPanel form;
  private final FlowPanel formBody;
  private final FormPanel redirectForm;
  private final FlowPanel redirectBody;

  private FlowPanel errorLine;
  private InlineLabel errorMsg;

  private Button login;
  private NpTextBox providerId;
  private CheckBox rememberId;
  private boolean discovering;

  public OpenIdLoginPanel(final SignInDialog.Mode requestedMode,
      final String initialErrorMsg) {
    mode = requestedMode;

    icons = GWT.create(LoginIcons.class);

    formBody = new FlowPanel();
    formBody.setStyleName("gerrit-OpenID-loginform");

    form = new FormPanel();
    form.setMethod(FormPanel.METHOD_GET);
    form.addSubmitHandler(this);
    form.add(formBody);

    redirectBody = new FlowPanel();
    redirectBody.setVisible(false);
    redirectForm = new FormPanel();
    redirectForm.add(redirectBody);

    panelWidget = new FlowPanel();
    panelWidget.add(form);
    panelWidget.add(redirectForm);
    initWidget(panelWidget);

    createHeaderLogo();
    createHeaderText();
    createErrorBox();
    createIdentBox();

    link(OpenIdUtil.URL_GOOGLE, OpenIdUtil.C.nameGoogle(), icons.iconGoogle());
    link(OpenIdUtil.URL_YAHOO, OpenIdUtil.C.nameYahoo(), icons.iconYahoo());

    if (initialErrorMsg != null) {
      showError(initialErrorMsg);
    }
    formBody.add(new HTML(OpenIdUtil.C.whatIsOpenIDHtml()));
  }

  public void setFocus(final boolean take) {
    if (take) {
      providerId.selectAll();
    }
    providerId.setFocus(take);
  }

  private void createHeaderLogo() {
    final FlowPanel headerLogo = new FlowPanel();
    headerLogo.setStyleName("gerrit-OpenID-logobox");
    headerLogo.add(icons.openidLogo().createImage());
    formBody.add(headerLogo);
  }

  private void createHeaderText() {
    final FlowPanel headerText = new FlowPanel();
    final String me = Window.Location.getHostName();
    final SmallHeading headerLabel = new SmallHeading();
    switch (mode) {
      case LINK_IDENTIY:
        headerLabel.setText(OpenIdUtil.M.linkAt(me));
        break;
      case REGISTER:
        headerLabel.setText(OpenIdUtil.M.registerAt(me));
        break;
      case SIGN_IN:
      default:
        headerLabel.setText(OpenIdUtil.M.signInAt(me));
        break;
    }
    headerText.add(headerLabel);
    formBody.add(headerText);
  }

  private void createErrorBox() {
    errorLine = new FlowPanel();
    errorLine.setVisible(false);

    errorMsg = new InlineLabel();
    errorLine.setStyleName("gerrit-OpenID-errorline");
    errorLine.add(errorMsg);
    formBody.add(errorLine);
  }

  private void showError(final String msgText) {
    errorMsg.setText(msgText);
    errorLine.setVisible(true);
  }

  private void hideError() {
    errorLine.setVisible(false);
  }

  private void createIdentBox() {
    final FlowPanel group = new FlowPanel();
    group.setStyleName("gerrit-OpenID-loginline");

    final FlowPanel line1 = new FlowPanel();
    group.add(line1);

    providerId = new NpTextBox();
    providerId.setVisibleLength(60);
    providerId.setStyleName("gerrit-OpenID-openid_identifier");
    providerId.setTabIndex(0);
    providerId.addKeyPressHandler(new KeyPressHandler() {
      @Override
      public void onKeyPress(final KeyPressEvent event) {
        if (event.getCharCode() == KeyCodes.KEY_ENTER) {
          event.preventDefault();
          form.submit();
        }
      }
    });
    line1.add(providerId);

    login = new Button();
    switch (mode) {
      case LINK_IDENTIY:
        login.setText(OpenIdUtil.C.buttonLinkId());
        break;
      case REGISTER:
        login.setText(OpenIdUtil.C.buttonRegister());
        break;
      case SIGN_IN:
      default:
        login.setText(OpenIdUtil.C.buttonSignIn());
        break;
    }
    login.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(final ClickEvent event) {
        form.submit();
      }
    });
    login.setTabIndex(2);
    line1.add(login);

    if (mode == SignInDialog.Mode.SIGN_IN) {
      rememberId = new CheckBox(OpenIdUtil.C.rememberMe());
      rememberId.setTabIndex(1);
      group.add(rememberId);

      final String last = Cookies.getCookie(OpenIdUtil.LASTID_COOKIE);
      if (last != null && !"".equals(last)) {
        providerId.setText(last);
        rememberId.setValue(true);
      }
    }

    formBody.add(group);
  }

  private void link(final String identUrl, final String who,
      final AbstractImagePrototype icon) {
    final ClickHandler i = new ClickHandler() {
      @Override
      public void onClick(final ClickEvent event) {
        if (!discovering) {
          providerId.setText(identUrl);
          form.submit();
        }
      }
    };

    final FlowPanel line = new FlowPanel();
    line.addStyleName("gerrit-OpenID-directlink");

    final Image img = icon.createImage();
    img.addClickHandler(i);
    line.add(img);

    final InlineLabel lbl = new InlineLabel();
    switch (mode) {
      case LINK_IDENTIY:
        lbl.setText(OpenIdUtil.M.linkWith(who));
        break;
      case REGISTER:
        lbl.setText(OpenIdUtil.M.registerWith(who));
        break;
      case SIGN_IN:
      default:
        lbl.setText(OpenIdUtil.M.signInWith(who));
        break;
    }
    lbl.addClickHandler(i);
    line.add(lbl);

    formBody.add(line);
  }

  private void enable(final boolean on) {
    providerId.setEnabled(on);
    login.setEnabled(on);
  }

  private void onDiscovery(final DiscoveryResult result) {
    discovering = false;

    if (result.validProvider) {
      redirectForm.setMethod(FormPanel.METHOD_POST);
      redirectForm.setAction(result.providerUrl);
      redirectBody.clear();
      for (final Map.Entry<String, String> e : result.providerArgs.entrySet()) {
        redirectBody.add(new Hidden(e.getKey(), e.getValue()));
      }

      // The provider won't support operation inside an IFRAME, so we
      // replace our entire application. No fancy waits are needed,
      // the browser won't update anything until its started to load
      // the provider's page.
      //
      FormElement.as(redirectForm.getElement()).setTarget("_top");
      redirectForm.submit();

    } else {
      // We failed discovery. We have to use a deferred command here
      // as we are being called from within an invisible IFRAME. Jump
      // back to the main event loop in the parent window.
      //
      onDiscoveryFailure();
    }
  }

  private void onDiscoveryFailure() {
    showError(OpenIdUtil.C.notSupported());
    enable(true);
    providerId.selectAll();
    providerId.setFocus(true);
  }

  @Override
  public void onSubmit(final SubmitEvent event) {
    event.cancel();

    final String openidIdentifier = providerId.getText();
    if (openidIdentifier == null || openidIdentifier.equals("")) {
      enable(true);
      return;
    }

    discovering = true;
    enable(false);
    hideError();

    final boolean remember = rememberId != null && rememberId.getValue();
    final String token = History.getToken();
    OpenIdUtil.SVC.discover(openidIdentifier, mode, remember, token,
        new GerritCallback<DiscoveryResult>() {
          public void onSuccess(final DiscoveryResult result) {
            onDiscovery(result);
          }

          @Override
          public void onFailure(final Throwable caught) {
            super.onFailure(caught);
            onDiscoveryFailure();
          }
        });
  }

  public void onSubmitComplete(final FormSubmitCompleteEvent event) {
  }
}


text:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR

# Clean build directory if present
rm -rf build
mkdir build
mkdir build/pundit-ui

# Copy diirt web app and configutaion
cp -r diirt build/pundit-ui

# Copy web ui
cp -r web-ui/public_html/ build/pundit-ui/
mv build/pundit-ui/public_html build/pundit-ui/web-ui

# Create tarball
cd build
tar -zcf pundit-ui.tar.gz pundit-ui

# Copy to rpmbuild/SOURCES
cd ../..
cp pundit-ui/build/pundit-ui.tar.gz rpmbuild/SOURCES


text:
using System;

namespace FastExcel
{
    /// <summary>
    /// Add a custom name to the field
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
    public class ExcelColumnAttribute : Attribute
    {
        /// <summary>
        /// Column name in  Excel
        /// </summary>
        public string Name { get; set; }
    }
}


text:
package com.datastax.dse.driver.internal.core.insights.exceptions;

public class InsightEventFormatException extends RuntimeException {

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


text:
#ifndef INCLUDE_ALLO_ARRAY_H
#define INCLUDE_ALLO_ARRAY_H 1

#include "allocore/system/al_Config.h"
#include <limits.h> /* ULONG_MAX */

/*
 Maximum number of dimensions a array may represent
 To model higher dimensional spaces, use a nested array descriptor
 */
#define ALLO_ARRAY_MAX_DIMS (4)

#ifdef __cplusplus
extern "C" {
#endif

#pragma mark AlloTy
/**
	Unique identifiers for principal types
		(inspired by SDIF; higher bits represent semantics, lower bits represent size)
		(unlike SDIF, assumption is little-endian; and 'byte' is represented as AlloUInt8Ty)
*/
enum {
	/* type with no size */
	AlloVoidTy			= 0x0000,

	/* floating point numbers */
	AlloFloat32Ty		= 0x0004,
	AlloFloat64Ty		= 0x0008,

	/* signed integers */
	AlloSInt8Ty			= 0x0101,
	AlloSInt16Ty		= 0x0102,
	AlloSInt32Ty		= 0x0104,
	AlloSInt64Ty		= 0x0108,

	/* unsigned integers */
	AlloUInt8Ty			= 0x0201,
	AlloUInt16Ty		= 0x0202,
	AlloUInt32Ty		= 0x0204,
	AlloUInt64Ty		= 0x0208,

	/* structural types */
	AlloArrayTy			= 0x1A2C,	/* 2C == 44 bytes, sizeof AlloArray */

	/* pointer types */
	AlloPointer32Ty		= 0x2F04,
	AlloPointer64Ty		= 0x2F08
};

typedef uint16_t AlloTy;

/** Return the size, in bytes, for a given type
*/
static size_t allo_type_size(const AlloTy ty);

/** Return a human-readable string for a given type
*/
const char * allo_type_name(const AlloTy ty);

/** Converts any format value into a double in [0, 1].
	Useful for converting numeric formats.
*/
static double allo_type_tonumber(AlloTy ty, const char * ptr);

/** Converts a double in [0, 1] to a specified AlloTy.
	Useful for converting numeric formats.
*/
static void allo_type_fromnumber(AlloTy ty, double number, char * dst);

/** Description a dynamically-typed, multidimensional array */
typedef struct AlloArrayHeader {

	/** The type of data stored (see enums above) */
	AlloTy type;

	/**
		The number of values per cell
		Aka components, planecount, parts, rank, order...
	*/
	uint8_t components;

	/** The number of dimensions (actually should not be > ALLO_ARRAY_MAX_DIMS!) */
	uint8_t dimcount;

	/** The size of each dimension */
	uint32_t dim[ALLO_ARRAY_MAX_DIMS];

	/** The number of bytes between elements of that dimension */
	uint32_t stride[ALLO_ARRAY_MAX_DIMS];

} AlloArrayHeader;

/** Dynamically-typed, multidimensional array */
typedef struct AlloArray {
	/**
		The data encapsulated.
		First member of the struct to permit easy dereferencing without pointer adjustment.
		Anonymous union with 64-bit padding for portability
		Serialized data should be little-endian, but in-memory data should match to the native endianness
		Stride is necessary for arrays that are 4 or 8 byte aligned
	*/
	union{
		char * ptr;
		uint64_t pad;
	} data;

	/** The description of this data */
	AlloArrayHeader header;

} AlloArray;

/** Returns the number of elements (cells) in an array
*/
static uint32_t allo_array_elements(const AlloArray * arr);

/** Returns the total memory footprint, in bytes, based on the array header
*/
static size_t allo_array_size_from_header(const AlloArrayHeader * h);

/** Returns the total memory footprint, in bytes
*/
static size_t allo_array_size(const AlloArray * arr);

/** Set an array header, e.g. just after allocating
*/
void allo_array_setheader(AlloArray * dst, const AlloArrayHeader * src);

/** Set dimension attributes without modifying memory
*/
void allo_array_setdim1d(AlloArrayHeader * h, uint32_t nx);

/** Set dimension attributes without modifying memory
*/
void allo_array_setdim2d(AlloArrayHeader * h, uint32_t nx, uint32_t ny);

/** Set stride factors based on a specific byte alignment
*/
void allo_array_setstride(AlloArrayHeader * h, unsigned alignSize);

/** Checks if headers are equivalent.

@return 1 if they are equivalent, otherwise 0.
*/
int allo_array_equal_headers(const AlloArrayHeader * h1, const AlloArrayHeader * h2);

/** Allocate new memory based on current size in header
*/
void allo_array_allocate(AlloArray * arr);

/** Create a new array based on a header
*/
void allo_array_create(AlloArray * arr, const AlloArrayHeader *h);

/** Create a new 1D array
*/
void allo_array_create1d(
	AlloArray * arr,
	uint8_t components,
	AlloTy type,
	uint32_t dimx,
	size_t align
);

/** Create a new 2D array
*/
void allo_array_create2d(
	AlloArray * arr,
	uint8_t components,
	AlloTy type,
	uint32_t dimx,
	uint32_t dimy,
	size_t align
);

/** Adapt an array to another size
*/
void allo_array_adapt(AlloArray * arr, const AlloArrayHeader *h);

/** Adapt an array to 2D
*/
void allo_array_adapt2d(
	AlloArray * arr,
	uint8_t components,
	AlloTy type,
	uint32_t dimx,
	uint32_t dimy,
	size_t align
);

/** Set header attributes to zero
*/
void allo_array_header_clear(AlloArrayHeader *h);

/** Set all attributes, including header, to zero
*/
void allo_array_clear(AlloArray * arr);

/** Free memory
*/
void allo_array_free(AlloArray * arr);

/** Free memory and zero attributes
*/
void allo_array_destroy(AlloArray * arr);

/** Copy a array into another array
*/
void allo_array_copy(AlloArray *dst, AlloArray *src);

/* An extended array (wrapper)
*/
typedef struct AlloArrayWrapper {

	AlloArray array;

	/* The reference count */
	int refs;

} AlloArrayWrapper;

AlloArrayWrapper * allo_array_wrapper_new();

void allo_array_wrapper_free(AlloArrayWrapper *w);

void allo_array_wrapper_setup(AlloArrayWrapper *wrap);

void allo_array_wrapper_retain(AlloArrayWrapper *wrap);

void allo_array_wrapper_release(AlloArrayWrapper *wrap);

/*
 *
 ********* INLINE IMPLEMENTATION BELOW ***********
 *
 */
#pragma mark -------------------------------------

static inline size_t allo_type_size(AlloTy ty) {
	switch(ty) {
		case AlloUInt8Ty:		return sizeof(uint8_t);
		case AlloUInt16Ty:		return sizeof(uint16_t);
		case AlloUInt32Ty:		return sizeof(uint32_t);
		case AlloUInt64Ty:		return sizeof(uint64_t);
		case AlloSInt8Ty:		return sizeof(int8_t);
		case AlloSInt16Ty:		return sizeof(int16_t);
		case AlloSInt32Ty:		return sizeof(int32_t);
		case AlloSInt64Ty:		return sizeof(int64_t);
		case AlloFloat32Ty:		return sizeof(float);
		case AlloFloat64Ty:		return sizeof(double);
		case AlloArrayTy:		return sizeof(AlloArray);
		case AlloPointer32Ty:	return sizeof(int32_t);
		case AlloPointer64Ty:	return sizeof(int64_t);
		default:				return 0;
	}
}

static inline double allo_type_tonumber(AlloTy ty, const char * ptr) {
	switch(ty) {
		case AlloUInt8Ty:		return (double)(((uint8_t *)ptr)[0])/255.;	/* UCHAR_MAX */
		case AlloUInt16Ty:		return (double)(((uint8_t *)ptr)[0])/65535.;
		case AlloUInt32Ty:		return (double)(((uint8_t *)ptr)[0])/(double)0xffffffff;
		case AlloUInt64Ty:		return (double)(((uint8_t *)ptr)[0])/(double)ULONG_MAX;
		case AlloSInt8Ty:		return 0.5+(double)(((uint8_t *)ptr)[0])/255.;	/* UCHAR_MAX */
		case AlloSInt16Ty:		return 0.5+(double)(((uint8_t *)ptr)[0])/65535.;
		case AlloSInt32Ty:		return 0.5+(double)(((uint8_t *)ptr)[0])/(double)0xffffffff;
		case AlloSInt64Ty:		return 0.5+(double)(((uint8_t *)ptr)[0])/(double)ULONG_MAX;
		case AlloFloat32Ty:		return (double)(((float *)ptr)[0]);
		case AlloFloat64Ty:		return ((double *)ptr)[0];
		default:				return 0;
	}
}

static inline void allo_type_fromnumber(AlloTy ty, double number, char * dst) {
	switch(ty) {
		case AlloUInt8Ty:		*((uint8_t *)dst) = (uint8_t)(number * 255.); break;
		case AlloUInt16Ty:		*((uint16_t *)dst) = (uint16_t)(number * 65535.); break;
		case AlloUInt32Ty:		*((uint32_t *)dst) = (uint32_t)(number * (double)(0xffffffff)); break;
		case AlloUInt64Ty:		*((uint64_t *)dst) = (uint64_t)(number * (double)(ULONG_MAX)); break;

		case AlloSInt8Ty:		*((int8_t *)dst) = (int8_t)((number-0.5) * 255.); break;
		case AlloSInt16Ty:		*((int16_t *)dst) = (int16_t)((number-0.5) * 65535.); break;
		case AlloSInt32Ty:		*((int32_t *)dst) = (int32_t)((number-0.5) * (double)(0xffffffff)); break;
		case AlloSInt64Ty:		*((int64_t *)dst) = (int64_t)((number-0.5) * (double)(ULONG_MAX)); break;
		case AlloFloat32Ty:		*((float *)dst) = (float)number; break;
		case AlloFloat64Ty:		*((double *)dst) = number; break;
		default:				*dst = 0;
	}
}

static inline uint32_t allo_array_elements(const AlloArray * arr) {
	uint32_t i, elements = 1;
	for (i=0; i<arr->header.dimcount; i++)
		elements *= arr->header.dim[i];
	return elements;
}

static inline size_t allo_array_size_from_header(const AlloArrayHeader * h) {
	if(h->dimcount != 0){
		int idx = h->dimcount-1;
		return h->stride[idx] * h->dim[idx];
	}
	return 0;
}

static inline size_t allo_array_size(const AlloArray * arr) {
	return allo_array_size_from_header(&arr->header);
}

/* Multidimensional terminology:
	# Dimensions	0			1			2			3			4
	----------------------------------------------------------------------------
	Index						row			column		pillar		file
	Tensor						scalar		vector		matrix
	Sound						sample		time		channel		pattern
	Polytope		point		line		polygon		polyhedron	polychoron
	n-cube			point		line		square		cube		tesseract
	n-sphere					interval	circle		sphere		hypersphere
	Boundary		none		vertex		edge		face		cell
	Movement		position	velocity	accel.		jerk		snap
*/

#ifdef __cplusplus
}
#endif

#endif /* INCLUDE_ALLO_H */


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-title" content="【黑白陈奕迅】">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-touch-fullscreen" content="yes">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<meta name="format-detection" content="telephone=no">
		<meta name="format-detection" content="email=no">
		<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
		<meta itemprop="name" content="【黑白陈奕迅】">
		<meta itemprop="description" content="">
		<meta itemprop="image" content="">
	<title>firebase</title>

	<input type='text' id='nameInput' placeholder='Name'>
    <input type='text' id='ageInput' placeholder='age'>
    <input type='text' id='telInput' placeholder='tel'>


text:
package com.axiastudio.zoefx.persistence;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * User: tiziano
 * Date: 07/01/15
 * Time: 21:50
 */
@Entity
public class Author {
    @Id
    public Long id;
    @Column
    public String name;
    @Column
    public String surname;
}


text:
/* this is just for the sake of codepen */
body {
    background-image: url(/images/stars.png);
}

.space-invaders {
    display: block;
    position: relative;
    overflow: scroll;
}

/* this is where the game is played out */
.space {
    display: block;
    position: relative;

    width: 960px;
    margin: 0 auto;

    height: 400px;
}


text:
package gcewing.sg;

import java.io.*;
import java.util.*;
import com.google.gson.*;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.AxisAlignedBB;
import gcewing.sg.BaseModClient.*;

public class BaseModel implements IModel {

    public double[] bounds;
    public Face[] faces;
    public double[][] boxes;

    public static class Face {
        int texture;
        double[][] vertices;
        int[][] triangles;
        //Vector3 centroid;
        Vector3 normal;
    }

    static Gson gson = new Gson();

    public static BaseModel fromResource(ResourceLocation location) {
        // Can't use resource manager because this needs to work on the server
        String path = String.format("/assets/%s/%s", location.getResourceDomain(), location.getResourcePath());
        InputStream in = BaseModel.class.getResourceAsStream(path);
        if (in == null)
            throw new RuntimeException(String.format("Cannot find resource %s", path));
        BaseModel model = gson.fromJson(new InputStreamReader(in), BaseModel.class);
        model.prepare();
        return model;
    }

    public AxisAlignedBB getBounds() {
        return AxisAlignedBB.getBoundingBox(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);
    }

    void prepare() {
        for (Face face : faces) {
            double[][] p = face.vertices;
            int[] t = face.triangles[0];
            //face.centroid = Vector3.average(p[t[0]], p[t[1]], p[t[2]]);
            face.normal = Vector3.unit(Vector3.sub(p[t[1]], p[t[0]]).cross(Vector3.sub(p[t[2]], p[t[0]])));
        }
    }

    public void addBoxesToList(Trans3 t, List list) {
        if (boxes != null && boxes.length > 0) {
            for (int i = 0; i < boxes.length; i++)
                addBoxToList(boxes[i], t, list);
        }
        else {
            addBoxToList(bounds, t, list);
        }
    }

    protected void addBoxToList(double[] b, Trans3 t, List list) {
        t.addBox(b[0], b[1], b[2], b[3], b[4], b[5], list);
    }

    public void render(Trans3 t, IRenderTarget renderer, ITexture... textures) {
        Vector3 p = null, n = null;
        for (Face face : faces) {
            int k = face.texture;
            if (k >= textures.length)
                k = textures.length - 1;
            ITexture tex = textures[k];
            if (tex != null) {
                renderer.setTexture(tex);
                for (int[] tri : face.triangles) {
                    renderer.beginTriangle();
                    for (int i = 0; i < 3; i++) {
                        int j = tri[i];
                        double[] c = face.vertices[j];
                        p = t.p(c[0], c[1], c[2]);
                        n = t.v(c[3], c[4], c[5]);
                        renderer.setNormal(n);
                        renderer.addVertex(p, c[6], c[7]);
                    }
                    renderer.endFace();
                }
            }
        }
    }

}


text:
<template name="bikeMaps">

      {{> googleMap name="exampleMap" options=nearbyMapOptions}}

Nearby Bike Parking

</template>


text:
create table address (
  id                        bigint not null,
  street                    varchar(255),
  postal                    integer,
  postal_area               varchar(255),
  constraint pk_address primary key (id))
;

create table child (
  id                        bigint not null,
  name                      varchar(255),
  changed                   bigint,
  constraint pk_child primary key (id))
;

create table guardian (
  id                        bigint not null,
  name                      varchar(255),
  phone                     integer,
  address_id                bigint,
  constraint pk_guardian primary key (id))
;

create table child_guardian (
  child_id                       bigint not null,
  guardian_id                    bigint not null,
  constraint pk_child_guardian primary key (child_id, guardian_id))
;
create sequence address_seq;

create sequence child_seq;

create sequence guardian_seq;

alter table guardian add constraint fk_guardian_address_1 foreign key (address_id) references address (id) on delete restrict on update restrict;
create index ix_guardian_address_1 on guardian (address_id);

alter table child_guardian add constraint fk_child_guardian_child_01 foreign key (child_id) references child (id) on delete restrict on update restrict;

alter table child_guardian add constraint fk_child_guardian_guardian_02 foreign key (guardian_id) references guardian (id) on delete restrict on update restrict;

# --- !Downs

SET REFERENTIAL_INTEGRITY FALSE;

drop table if exists address;

drop table if exists child;

drop table if exists child_guardian;

drop table if exists guardian;

SET REFERENTIAL_INTEGRITY TRUE;

drop sequence if exists address_seq;

drop sequence if exists child_seq;

drop sequence if exists guardian_seq;


text:
package com.orhanobut.hawk;

import android.content.Context;
import android.util.Log;
import android.util.Pair;

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

import rx.Observable;
import rx.Subscriber;

public final class Hawk {

  private static HawkBuilder hawkBuilder;

  private Hawk() {
    // no instance
  }

  /**
   * This will init the hawk without password protection.
   *
   * @param context is used to instantiate context based objects. ApplicationContext will be used
   */
  public static HawkBuilder init(Context context) {
    if (context == null) {
      throw new NullPointerException("Context should not be null");
    }
    hawkBuilder = new HawkBuilder(context);
    return hawkBuilder;
  }

  /**
   * Saves every type of Objects. List, List<T>, primitives
   *
   * @param key   is used to save the data
   * @param value is the data that is gonna be saved. Value can be object, list type, primitives
   * @return true if put is successful
   */
  public static <T> boolean put(String key, T value) {
    if (key == null) {
      throw new NullPointerException("Key cannot be null");
    }
    //if the value is null, simply remove it
    if (value == null) {
      return remove(key);
    }

    String encodedText = zip(value);
    //if any exception occurs during encoding, encodedText will be null and thus operation is unsuccessful
    return encodedText != null && hawkBuilder.getStorage().put(key, encodedText);
  }

  /**
   * Creates a stream to put data, RxJava dependency is required
   *
   * @param <T> value type
   * @return Observable<Boolean>
   */
  public static <T> Observable<Boolean> putObservable(final String key, final T value) {
    Utils.checkRx();
    return Observable.create(new Observable.OnSubscribe<Boolean>() {
      @Override
      public void call(Subscriber<? super Boolean> subscriber) {
        try {
          boolean result = put(key, value);
          if (!subscriber.isUnsubscribed()) {
            subscriber.onNext(result);
            subscriber.onCompleted();
          }
        } catch (Exception e) {
          if (!subscriber.isUnsubscribed()) {
            subscriber.onError(e);
          }
        }
      }
    });
  }

  /**
   * Encodes the given value as full text (cipher + data info)
   *
   * @param value is the given value to encode
   * @return full text as string
   */
  private static <T> String zip(T value) {
    if (value == null) {
      throw new NullPointerException("Value cannot be null");
    }
    byte[] encodedValue = hawkBuilder.getEncoder().encode(value);

    String cipherText;

    if (!hawkBuilder.isEncrypted()) {
      cipherText = DataHelper.encodeBase64(encodedValue);
    } else {
      cipherText = hawkBuilder.getEncryption().encrypt(encodedValue);
    }

    if (cipherText == null) {
      return null;
    }
    return DataHelper.addType(cipherText, value);
  }

  /**
   * @param key is used to get the saved data
   * @return the saved object
   */
  public static <T> T get(String key) {
    if (key == null) {
      throw new NullPointerException("Key cannot be null");
    }
    String fullText = hawkBuilder.getStorage().get(key);
    if (fullText == null) {
      return null;
    }
    DataInfo dataInfo = DataHelper.getDataInfo(fullText);
    byte[] bytes;

    if (!hawkBuilder.isEncrypted()) {
      bytes = DataHelper.decodeBase64(dataInfo.getCipherText());
    } else {
      bytes = hawkBuilder.getEncryption().decrypt(dataInfo.getCipherText());
    }

    if (bytes == null) {
      return null;
    }

    try {
      return hawkBuilder.getEncoder().decode(bytes, dataInfo);
    } catch (Exception e) {
      Logger.d(e.getMessage());
    }
    return null;
  }

  /**
   * Gets the saved data, if it is null, default value will be returned
   *
   * @param key          is used to get the saved data
   * @param defaultValue will be return if the response is null
   * @return the saved object
   */
  public static <T> T get(String key, T defaultValue) {
    T t = get(key);
    if (t == null) {
      return defaultValue;
    }
    return t;
  }

  /**
   * Creates a stream of data
   * RxJava dependency is required
   *
   * @param key of the data
   * @param <T> type of the data
   * @return Observable<T>
   */
  public static <T> Observable<T> getObservable(String key) {
    Utils.checkRx();
    return getObservable(key, null);
  }

  /**
   * Creates a stream of data
   * RxJava dependency is required
   *
   * @param key          of the data
   * @param defaultValue of the default value if the value doesn't exists
   * @param <T>          type of the data
   * @return Observable</T>
   */
  public static <T> Observable<T> getObservable(final String key, final T defaultValue) {
    Utils.checkRx();
    return Observable.create(new Observable.OnSubscribe<T>() {
      @Override
      public void call(Subscriber<? super T> subscriber) {
        try {
          T t = get(key, defaultValue);
          if (!subscriber.isUnsubscribed()) {
            subscriber.onNext(t);
            subscriber.onCompleted();
          }
        } catch (Exception e) {
          if (!subscriber.isUnsubscribed()) {
            subscriber.onError(e);
          }
        }
      }
    });
  }

  /**
   * Enables chaining of multiple put invocations.
   *
   * @return a simple chaining object
   */
  public static Chain chain() {
    return new Chain();
  }

  /**
   * Enables chaining of multiple put invocations.
   *
   * @param capacity the amount of put invocations you're about to do
   * @return a simple chaining object
   */
  public static Chain chain(int capacity) {
    return new Chain(capacity);
  }

  /**
   * Size of the saved data. Each key will be counted as 1
   *
   * @return the size
   */
  public static long count() {
    return hawkBuilder.getStorage().count();
  }

  /**
   * Clears the storage, note that crypto data won't be deleted such as salt key etc.
   * Use resetCrypto in order to clear crypto information
   *
   * @return true if clear is successful
   */
  public static boolean clear() {
    return hawkBuilder.getStorage().clear();
  }

  /**
   * Removes the given key/value from the storage
   *
   * @param key is used for removing related data from storage
   * @return true if remove is successful
   */
  public static boolean remove(String key) {
    return hawkBuilder.getStorage().remove(key);
  }

  /**
   * Removes values associated with the given keys from the storage
   *
   * @param keys are used for removing related data from storage
   * @return true if all removals are successful
   */
  public static boolean remove(String... keys) {
    return hawkBuilder.getStorage().remove(keys);
  }

  /**
   * Checks the given key whether it exists or not
   *
   * @param key is the key to check
   * @return true if it exists in the storage
   */
  public static boolean contains(String key) {
    return hawkBuilder.getStorage().contains(key);
  }

  /**
   * Clears all saved data that is used for the crypto
   *
   * @return true if reset is successful
   */
  public static boolean resetCrypto() {
    return hawkBuilder.getEncryption() == null || hawkBuilder.getEncryption().reset();
  }

  public static LogLevel getLogLevel() {
    if (hawkBuilder == null) {
      return LogLevel.NONE;
    }
    return hawkBuilder.getLogLevel();
  }

  /**
   * Provides the ability to chain put invocations:
   * Hawk.chain().put("foo", 0).put("bar", false).commit()
   *

   * commit() writes the chain values to persistent storage. Omitting it will
   * result in all chained data being lost.
   */
  public static final class Chain {

    private final List<Pair<String, ?>> items;

    public Chain() {
      this(10);
    }

    public Chain(int capacity) {
      items = new ArrayList<>(capacity);
    }

    /**
     * Saves every type of Objects. List, List<T>, primitives
     *
     * @param key   is used to save the data
     * @param value is the data that is gonna be saved. Value can be object, list type, primitives
     */
    public <T> Chain put(String key, T value) {
      if (key == null) {
        throw new NullPointerException("Key cannot be null");
      }
      String encodedText = zip(value);
      if (encodedText == null) {
        Log.d("HAWK", "Key : " + key + " is not added, encryption failed");
        return this;
      }
      items.add(new Pair<>(key, encodedText));
      return this;
    }

    /**
     * Commits the chained values to storage.
     *
     * @return true if successfully saved, false otherwise.
     */
    public boolean commit() {
      return hawkBuilder.getStorage().put(items);
    }

  }

}


text:
var embedder = null;

function reportResult(result) {
  var msg = ['fetch-' + result];
  embedder.postMessage(JSON.stringify(msg), '*');
}

window.addEventListener('message', function(e) {
  embedder = e.source;
  var data = JSON.parse(e.data);
  if (data[0] == 'start-fetch') {
    fetch('http://127.0.0.1:' + location.port + '/extensions/xhr.txt')
        .then((result) => result.text())
        .then((text) => {
          reportResult(
              (text == 'File to request via XHR.\n') ? 'success' : 'failure');
        })
        .catch(err => {
          reportResult('failure');
        });
  } else {
    reportResult('unexpected-message');
  }
});

window.console.log('Script has been successfully injected.');


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><results>
	<result gamesPlayed="0" gamesWon="0" name="[AI] Kosiak"/>
	<result gamesPlayed="0" gamesWon="0" name="[AI] Dmowska"/>
	<result gamesPlayed="0" gamesWon="0" name="[AI] Szczepański"/>
	<result gamesPlayed="0" gamesWon="0" name="[AI] Trawiński"/>
</results>


text:
/*jslint node:true, browser:true */
'use strict';
/*
    Copyright 2015 Enigma Marketing Services Limited

    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.
*/

module.exports = function (app) {
    // master edit directive. Holds all edited data and does HTTP requests
    app = require('./directives/edit')(app);
    // implements save and cancel buttons
    app = require('./directives/api')(app);
    // interface to edit data. Check widgets in ./lk-var-types
    app = require('./directives/var')(app);
    // exposes the error messages
    app = require('./directives/error')(app);
    // searches items in an API and adds them to an angular model
    app = require('./directives/search')(app);

    return app;
};


text:
using System;
using IBatisNet.DataMapper.Test.Domain;
using NUnit.Framework;

namespace IBatisNet.DataMapper.Test.NUnit.SqlMapTests.MSSQL
{
    /// <summary>
    /// Summary description for StatementTest.
    /// </summary>
    [TestFixture]
    [Category("MSSQL")]
    public class StatementTest : BaseTest
    {
        #region Setup/Teardown

        /// <summary>
        /// SetUp
        /// </summary>
        [SetUp]
        public void Init()
        {
            InitScript(sqlMap.DataSource, ScriptDirectory + "account-init.sql");
            InitScript(sqlMap.DataSource, ScriptDirectory + "account-procedure.sql", false);
            InitScript(sqlMap.DataSource, ScriptDirectory + "ps_SelectAccount.sql", false);
            InitScript(sqlMap.DataSource, ScriptDirectory + "category-init.sql");
            InitScript(sqlMap.DataSource, ScriptDirectory + "order-init.sql");
        }

        /// <summary>
        /// TearDown
        /// </summary>
        [TearDown]
        public void Dispose()
        {
            /* ... */
        }

        #endregion

        /// <summary>
        /// Test guid column/field.
        /// </summary>
        [Test]
        public void TestGuidColumn()
        {
            Category category = new Category();
            category.Name = "toto";
            category.Guid = Guid.NewGuid();

            int key = (int) sqlMap.Insert("InsertCategory", category);

            Category categoryTest = (Category) sqlMap.QueryForObject("GetCategory", key);
            Assert.AreEqual(key, categoryTest.Id);
            Assert.AreEqual(category.Name, categoryTest.Name);
            Assert.AreEqual(category.Guid, categoryTest.Guid);
        }

        /// <summary>
        /// Test guid column/field through parameterClass.
        /// </summary>
        [Test]
        public void TestGuidColumnParameterClass()
        {
            Guid newGuid = Guid.NewGuid();
            int key = (int) sqlMap.Insert("InsertCategoryGuidParameterClass", newGuid);

            Category categoryTest = (Category)sqlMap.QueryForObject("GetCategory", key);
            Assert.AreEqual(key, categoryTest.Id);
            Assert.AreEqual("toto", categoryTest.Name);
            Assert.AreEqual(newGuid, categoryTest.Guid);
        }

        /// <summary>
        /// Test guid column/field through parameterClass without specifiyng dbType
        /// </summary>
        [Test]
        public void TestGuidColumnParameterClassJIRA20()
        {
            Guid newGuid = Guid.NewGuid();
            int key = (int) sqlMap.Insert("InsertCategoryGuidParameterClassJIRA20", newGuid);

            Category categoryTest = (Category)sqlMap.QueryForObject("GetCategory", key);
            Assert.AreEqual(key, categoryTest.Id);
            Assert.AreEqual("toto", categoryTest.Name);
            Assert.AreEqual(newGuid, categoryTest.Guid);
        }

        /// <summary>
        /// Test Insert Account via store procedure
        /// </summary>
        [Test]
        public void TestInsertAccountViaStoreProcedure()
        {
            Account account = new Account();

            account.Id = 99;
            account.FirstName = "Achille";
            account.LastName = "Talon";
            account.EmailAddress = "Achille.Talon@somewhere.com";

            sqlMap.Insert("InsertAccountViaStoreProcedure", account);

            Account testAccount = sqlMap.QueryForObject("GetAccountViaColumnName", 99) as Account;

            Assert.IsNotNull(testAccount);
            Assert.AreEqual(99, testAccount.Id);
        }

        /// <summary>
        /// Test an insert using SCOPE_IDENTITY.
        /// </summary>
        [Test]
        public void TestInsertCategoryScope()
        {
            Category category = new Category();
            category.Name = "toto";
            category.Guid = Guid.NewGuid();

            sqlMap.QueryForObject("InsertCategoryScope", category, category);
            Assert.That(category.Id, Is.EqualTo(1));
        }

        /// <summary>
        /// Test Insert Category Via ParameterMap.
        /// </summary>
        [Test]
        public void TestInsertCategoryViaParameterMap()
        {
            Category category = new Category();
            category.Name = "Cat";
            category.Guid = Guid.NewGuid();

            int key = (int) sqlMap.Insert("InsertCategoryViaParameterMap", category);
            Assert.AreEqual(1, key);
        }

        /// <summary>
        /// Test statement with properties subtitutions
        /// (Test for IBATISNET-21 : Property substitutions do not occur inside selectKey statement)
        /// </summary>
        [Test]
        public void TestInsertCategoryWithProperties()
        {
            Category category = new Category();
            category.Guid = Guid.NewGuid();

            int key = (int) sqlMap.Insert("InsertCategoryWithProperties", category);

            Category categoryTest = sqlMap.QueryForObject("GetCategory", key) as Category;
            Assert.AreEqual(key, categoryTest.Id);
            Assert.AreEqual("Film", categoryTest.Name);
            Assert.AreEqual(category.Guid, categoryTest.Guid);
        }

        /// <summary>
        /// Test an insert with identity key.
        /// </summary>
        [Test]
        public void TestInsertIdentityViaInsertQuery()
        {
            Category category = new Category();
            category.Name = "toto";
            category.Guid = Guid.NewGuid();

            int key = (int)sqlMap.Insert("InsertCategory", category);
            Assert.AreEqual(1, key);
        }

        /// <summary>
        /// Test Insert Via Insert Statement.
        /// (Test for IBATISNET-21 : Property substitutions do not occur inside selectKey statement)
        /// </summary>
        [Test]
        public void TestInsertViaInsertStatement()
        {
            Category category = new Category();
            category.Name = "toto";
            category.Guid = Guid.NewGuid();

            int key = (int)sqlMap.Insert("InsertCategoryViaInsertStatement", category);
            Assert.AreEqual(1, key);
        }

        /// <summary>
        /// Test select via store procedure
        /// </summary>
        [Test]
        public void TestSelect()
        {
            Order order = (Order)sqlMap.QueryForObject("GetOrderWithAccountViaSP", 1);
            AssertOrder1(order);
            AssertAccount1(order.Account);
        }

        /// <summary>
        /// Test Update Category with Extended ParameterMap
        /// </summary>
        [Test]
        public void TestUpdateCategoryWithExtendParameterMap()
        {
            Category category = new Category();
            category.Name = "Cat";
            category.Guid = Guid.NewGuid();

            int key = (int)sqlMap.Insert("InsertCategoryViaParameterMap", category);
            category.Id = key;

            category.Name = "Dog";
            category.Guid = Guid.NewGuid();

            sqlMap.Update("UpdateCategoryViaParameterMap", category);

            Category categoryRead = null;
            categoryRead = (Category) sqlMap.QueryForObject("GetCategory", key);

            Assert.AreEqual(category.Id, categoryRead.Id);
            Assert.AreEqual(category.Name, categoryRead.Name);
            Assert.AreEqual(category.Guid.ToString(), categoryRead.Guid.ToString());
        }
    }
}


text:
package com.neilren.neilren4j.service;

import com.neilren.neilren4j.common.baseclass.BaseService;
import com.neilren.neilren4j.dao.TIpMapper;
import com.neilren.neilren4j.dbentity.TIp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author NeilRen
 * @version 1.0
 * @ClassName IPService
 * @Description TODO
 * @Date 2018/8/5 10:01
 */
@Service
public class IPService extends BaseService {
    @Autowired
    private TIpMapper ipMapper;

    public TIp selectByIP(String ip) {
        return ipMapper.selectByIP(ip);
    }
}


text:
**Note:** This param convertor currently works only with sequelize models.

Inspired by [sensio/framework-extra-bundle](https://github.com/sensiolabs/SensioFrameworkExtraBundle) (@ParamConverter)

Descripton
----
Main goal of this middleware is to convert given parameter in request URL, to sequelize instance of given model, for avoiding common code duplication (search instance in database, throw error if not found).

Installation
----
NPM
```console
npm install express-param-converter --save
```

Yarn
```
yarn add express-param-converter
```

Usage
----

##### Example with single instance convertation:
```javascript
var express = require('express');
var app = express();

var ExpressParamConverter = require('express-param-converter');

// Sequelize model
var Blog = require('./models/Blog');

app.get(
    '/blog/:id',
    [
        ExpressParamConverter.convert({ name: 'blog', model: Blog })
    ],
    function (res, req) {
        // Now you can easily access variables in `res.params`
        var blog = res.params.blog;

        return req.status(200).json({
            blog: blog,
        });
    }
);
```

##### This is how you can use multiple converters in one action:
```javascript
var express = require('express');
var app = express();

var ExpressParamConverter = require('express-param-converter');

// Sequelize models
var Blog = require('./models/Blog');
var Post = require('./models/Post');

app.get(
    '/blog/:id/post/:post_slug',
    [
        ExpressParamConverter.convert({ name: 'blog', model: Blog }),
        ExpressParamConverter.convert({ name: 'post', model: Post, options: { mappings: { post_slug: 'slug' } } })
    ],
    function (res, req) {
        // Note that `res.params` now contains `id`, `slug`, `blog` and `post` variables
        var blog = res.params.blog;
        var post = res.params.post;

        return req.status(200).json({
            blog: blog,
            post: post,
        });
    }
);
```

##### If you want to receive plain object you can use **plain** option
```javascript
var express = require('express');
var app = express();

var ExpressParamConverter = require('express-param-converter');

// Sequelize models
var Post = require('./models/Post');
var Comment = require('./models/Comment');

app.get(
    '/post/:post_slug/comment/:comment_id',
    [
        ExpressParamConverter.convert({ name: 'post', model: Post, options: { mappings: { post_slug: 'slug' }, plain: true } }),
        ExpressParamConverter.convert({ name: 'comment', model: Comment, options: { mappings: { comment_id: 'id' }, plain: true } })
    ],
    function (res, req) {
        var post = res.params.post;
        var comment = res.params.comment;

        // `plain` option do the same as:
        var plainComment = comment.get({ plain: true });

        return req.status(200).json({
            post: post,
            comment: plainComment,
        });
    }
);
```

TODO
----
- [x] Rewrite to typescript
- [ ] Make it independent from sequelize models
- [ ] Add additional parameters to options (i.e. `method` etc.)

License
----
This software is published under the [MIT License](LICENSE)


text:
void *pvPortMalloc( size_t xWantedSize );
void vPortFree( void *pv );
void *pvPortZalloc(size_t size);
void *pvPortCalloc(unsigned int n, unsigned int count);
void *pvPortRealloc(void * p, size_t size);
size_t xPortGetFreeHeapSize(void);
void prvHeapInit(void) ICACHE_FLASH_ATTR ;

#define os_malloc   pvPortMalloc
#define os_free     vPortFree
#define os_zalloc   pvPortZalloc
#define os_calloc   pvPortCalloc
#define os_realloc  pvPortRealloc
#define system_get_free_heap_size xPortGetFreeHeapSize

#endif // __MEM_H__


text:
/*!
 * Hello2D Game Engine
 * yoyo 2015 ShenZhen China
 * repo:https://github.com/play175/Hello2D
 * website:http://yoyo.play175.com
 * MIT Licensed
 */
#ifndef BLIT_H
#define BLIT_H

#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include "math2d.h"

static inline void memset32(void *dest, uint32_t data, int count) {
#ifdef __MINGW32__
	asm volatile(
	    "cld;"
	    "rep stosl;"//stosl指令为从eax保存四字节到edi
    :
    :"D"(dest),"c"(count),"a"(data)
	);
#else
	while (count--) {
		*dest = data;
		((uint32_t *)dest)++;
	}
#endif
}

void alphablend32(uint32_t *dest_bmp, int dst_width, uint32_t *src_bmp, int src_width, int blend_width, int blend_height);
void zoom(uint32_t *dest,int dw,int dh,int dst_width,uint32_t *src,int sw,int sh,int src_width);
void transform_blend_replace(int dx,int dy,uint32_t *dest,int dest_pitch,int dest_width,int dest_height
               , uint32_t *src,int src_pitch,int src_width,int src_height, struct mat *mat);

void transform_blend(int dx,int dy,uint32_t *dest,int dest_pitch,int dest_width,int dest_height
                     , uint32_t *src,int src_pitch,int src_width,int src_height, struct mat *m);
void transform_blend_add(int dx,int dy,uint32_t *dest,int dest_pitch,int dest_width,int dest_height
                         , uint32_t *src,int src_pitch,int src_width,int src_height, struct mat *m);
void transform_blend_lighten(int dx,int dy,uint32_t *dest,int dest_pitch,int dest_width,int dest_height
                             , uint32_t *src,int src_pitch,int src_width,int src_height, struct mat *m);
void transform_blend_overly(int dx,int dy,uint32_t *dest,int dest_pitch,int dest_width,int dest_height
                            , uint32_t *src,int src_pitch,int src_width,int src_height, struct mat *m);

#endif


text:
#include "Engine/Asset/Asset.h"

namespace Fork
{

namespace Engine
{

Asset::~Asset()
{
}

} // /namespace Engine

} // /namespace Fork

// ========================


text:
'use strict'

// For OpenLDAP:
// searchFilter: process.env.LDAP_SEARCH_FILTER || '(uid={{username}})'
// For Active Directory:
// searchFilter: '(sAMAccountName={{username}})'

const path = require('path')
const SERVER_PORT_WEB = process.env.MINELEV_SERVER_PORT_WEB || 8000

function ldapTlsSettings () {
  var fs = require('fs')
  var config = false

  if (process.env.MINELEV_LDAP_TLS_SETTINGS) {
    config = {
      rejectUnauthorized: process.env.MINELEV_LDAP_TLS_REJECT_UNAUTHORIZED ? true : false, // eslint-disable-line no-unneeded-ternary
      ca: [
        fs.readFileSync(path.join(__dirname, process.env.MINELEV_LDAP_TLS_CA_PATH))
      ]
    }
  }

  return config
}

module.exports = {
  SERVER_PORT_WEB: SERVER_PORT_WEB,
  DB_CONNECTION_LOG: process.env.MINELEV_LOG_DB_URI || 'mongodb://localhost/louie',
  BUDDY_API_URL: process.env.MINELEV_BUDDY_API_URL || 'http://localhost:' + SERVER_PORT_WEB + '/demo',
  BUDDY_JWT_KEY: process.env.MINELEV_BUDDY_JWT_KEY || 'Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go',
  CALLBACK_STATUS_URL: process.env.MINELEV_CALLBACK_STATUS_URL || 'https://api.buddy.com/status/',
  TEMPLATER_SERVICE_URL: process.env.MINELEV_TEMPLATER_SERVICE_URL || 'https://pdftemplater.service.t-fk.no',
  LIVESTATS_URL: process.env.MINELEV_LIVESTATS_URL || 'https://tfk-livestats.firebaseio.com/minelev.json',
  JWT_SECRET: process.env.MINELEV_JWT_SECRET || 'Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go',
  YAR_SECRET: process.env.MINELEV_YAR_SECRET || 'Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go',
  COOKIE_SECRET: process.env.MINELEV_COOKIE_SECRET || 'Louie Louie, oh no, I got to go Louie Louie, oh no, I got to go',
  GITHUB_FEEDBACK_URL: process.env.MINELEV_GITHUB_FEEDBACK_URL || 'https://api.github.com/repos/:user/:repo/issues',
  GITHUB_USER: process.env.MINELEV_GITHUB_USER || 'yourgithubuser',
  GITHUB_TOKEN: process.env.MINELEV_GITHUB_TOKEN || 'yourgithubtoken',
  LDAP: {
    url: process.env.MINELEV_LDAP_URL || 'ldap://ldap.forumsys.com:389',
    bindDn: process.env.MINELEV_LDAP_BIND_DN || 'cn=read-only-admin,dc=example,dc=com',
    bindCredentials: process.env.MINELEV_LDAP_BIND_CREDENTIALS || 'password',
    searchBase: process.env.MINELEV_LDAP_SEARCH_BASE || 'dc=example,dc=com',
    searchFilter: process.env.MINELEV_LDAP_SEARCH_FILTER || '(uid={{username}})',
    tlsOptions: ldapTlsSettings()
  }
}


text:
import "./setup";

import {expect} from "chai";
import {mountComponent} from "./utils";
import BtrzSelect from "../src/btrz-select";

const DUMMY_OPTIONS = [
  {text: "option1", value: "value1"},
  {text: "option2", value: "value2"},
  {text: "option3", value: "value3"}
];

describe("BtrzSelect", () => {
  it("should select the default value", () => {
    const EXPECTED_VALUE = "default_value",
      vm = mountComponent(BtrzSelect, {
        selectedValue: EXPECTED_VALUE
      });

    expect(vm.selected).to.equal(EXPECTED_VALUE);
  });

  it("should render the default value empty if not specified", () => {
    const EXPECTED_DEFAULT = "",
      vm = mountComponent(BtrzSelect),
      optionEl = $(vm.$el).find("option[value='']");

    expect(optionEl.text()).to.equal(EXPECTED_DEFAULT);
  });

  it("should render the disabled if specified", () => {
    const vm = mountComponent(BtrzSelect, {
        disabled: true
      }),
      select = $(vm.$el).find("select");

    expect($(select).attr("disabled")).to.be.eql("disabled");
  });

  it("should render the first option if specified", () => {
    const DEFAULT_OPTION = {text: "All", value: "all"},
      vm = mountComponent(BtrzSelect, {firstOption: DEFAULT_OPTION}),
      optionsEl = $(vm.$el).find("option"),
      availableOptions = optionsEl.map((idx, option) => {
        return {text: option.text.trim(), value: option.value.trim()};
      }).toArray();

    expect(availableOptions.length).to.be.eql(1);
    expect(availableOptions[0]).to.deep.equal(DEFAULT_OPTION);
  });

  it("should render the given options", () => {
    const DUMMY_OPTIONS = [
        {text: "option1", value: "value1"},
        {text: "option2", value: "value2"},
        {text: "option3", value: "value3"}
      ],
      vm = mountComponent(BtrzSelect, {options: DUMMY_OPTIONS}),
      optionsEl = $(vm.$el).find("option"),
      availableOptions = optionsEl.map((idx, option) => {
        return {text: option.text.trim(), value: option.value.trim()};
      }).toArray();

    expect(availableOptions).to.deep.equal(DUMMY_OPTIONS);
  });

  describe("should support v-model binding", () => {
    const V_MODEL_EVENT = "change";
    it("should be configured to emit the defined event", () => {
      expect(BtrzSelect.model.event).to.equal(V_MODEL_EVENT);
    });

    it("should emit change event with new selected value", (done) => {
      const EXPECTED_SELECTION = DUMMY_OPTIONS[1].value;
      const vm = mountComponent(BtrzSelect, {options: DUMMY_OPTIONS});

      vm.$on(V_MODEL_EVENT, (val) => {
        expect(val).to.equal(EXPECTED_SELECTION);
        done();
      });

      vm.selected = EXPECTED_SELECTION;
    });

    it("should update the select value when changed from a parent component.", () => {
      const ParentComponent = {
        name: "TestComponent",
        components: {BtrzSelect},
        template: `
        <div>
          <btrz-select v-model="selectedValue" :options="options">
          </btrz-select>
        </div>`,
        data() {
          return {
            selectedValue: DUMMY_OPTIONS[0].value,
            options: DUMMY_OPTIONS
          };
        }
      };

      const parentVm = mountComponent(ParentComponent);
      const selectEl = $(parentVm.$el).find("select");

      parentVm.selectedValue = DUMMY_OPTIONS[2].value;

      parentVm.$nextTick(() => {
        expect(selectEl.val()).to.equal(DUMMY_OPTIONS[2].value);
      });
    });
  });

  describe("hasTextAndValue", () => {
    it("should correctly validate option list when it contains value and text keys", () => {
      expect(BtrzSelect.methods.hasTextAndValue(DUMMY_OPTIONS)).to.equal(true);
    });

    it("should not validate if the option list not contains text", () => {
      const actual = BtrzSelect.methods.hasTextAndValue([
        {value: "test value", text: "test text"},
        {value: "test value2", otherKey: "test key"}
      ]);

      expect(actual).to.equal(false);
    });

    it("should not validate if the option list not contains value", () => {
      const actual = BtrzSelect.methods.hasTextAndValue([
        {text: "test1", value: "value key"},
        {text: "test2", otherKey: "test key"}
      ]);

      expect(actual).to.equal(false);
    });

    it("should not validate one of the options not contains value and text", () => {
      const actual = BtrzSelect.methods.hasTextAndValue([
        {text: "test1", value: "test key"},
        {otherKey: "test key"}
      ]);

      expect(actual).to.equal(false);
    });
  });
});


text: Puts stricter limits on the allowed slopes for mods roads.


text:
<?php

declare(strict_types=1);

namespace Vpn\Portal\Http;

use Vpn\Portal\Http\Exception\HttpException;

class Service implements ServiceInterface
{
    private ?AuthModuleInterface $authModule = null;

    private array $routeList = [];

    /** @var array<HookInterface> */
    private array $beforeHookList = [];

    /** @var array<string,array<string>> */
    private array $beforeAuthPathList = [
        'GET' => [],
        'POST' => [],
    ];

    public function setAuthModule(AuthModuleInterface $authModule): void
    {
        $this->authModule = $authModule;
    }

    public function addBeforeHook(HookInterface $beforeHook): void
    {
        $this->beforeHookList[] = $beforeHook;
    }

    public function get(string $pathInfo, callable $callback): void
    {
        $this->routeList[$pathInfo]['GET'] = $callback;
    }

    public function post(string $pathInfo, callable $callback): void
    {
        $this->routeList[$pathInfo]['POST'] = $callback;
    }

    public function postBeforeAuth(string $pathInfo, callable $callback): void
    {
        $this->routeList[$pathInfo]['POST'] = $callback;
        $this->beforeAuthPathList['POST'][] = $pathInfo;
    }

    public function addModule(ServiceModuleInterface $module): void
    {
        $module->init($this);
    }

    public function run(Request $request): Response
    {
        foreach ($this->beforeHookList as $beforeHook) {
            $hookResponse = $beforeHook->beforeAuth($request);
            // if we get back a Response object, return it immediately
            if ($hookResponse instanceof Response) {
                return $hookResponse;
            }
        }

        $requestMethod = $request->getRequestMethod();
        $pathInfo = $request->getPathInfo();

        // modules can use postBeforeAuth that require no authentication,
        // if the current request is for such a URL, execute the callback
        // immediately
        if (\array_key_exists($requestMethod, $this->beforeAuthPathList) && \in_array($pathInfo, $this->beforeAuthPathList[$requestMethod], true)) {
            return $this->routeList[$pathInfo][$requestMethod]($request);
        }

        // XXX code reaches this from oauth.php, maybe when wrong oauth (refresh) token is provided? the previous
        // it was probably because the old token endpoint was used? info.json got updated at some point...
        if (null === $this->authModule) {
            throw new HttpException('authentication required, but no authentication module loaded', 500);
        }

        // make sure we are authenticated
        if (null === $userInfo = $this->authModule->userInfo($request)) {
            if (null !== $authResponse = $this->authModule->startAuth($request)) {
                return $authResponse;
            }

            throw new HttpException('unable to authenticate user', 401);
        }

        foreach ($this->beforeHookList as $beforeHook) {
            $hookResponse = $beforeHook->afterAuth($userInfo, $request);
            // if we get back a Response object, return it immediately
            if ($hookResponse instanceof Response) {
                return $hookResponse;
            }
        }

        if (!\array_key_exists($pathInfo, $this->routeList)) {
            throw new HttpException(sprintf('"%s" not found', $pathInfo), 404);
        }
        if (!\array_key_exists($requestMethod, $this->routeList[$pathInfo])) {
            throw new HttpException(sprintf('method "%s" not allowed', $requestMethod), 405, ['Allow' => implode(',', array_keys($this->routeList[$pathInfo]))]);
        }

        return $this->routeList[$pathInfo][$requestMethod]($userInfo, $request);
    }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface com.cloudera.oryx.app.classreg.example.Feature (Oryx 2.8.0 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
com.cloudera.oryx.app.classreg.example.Feature

Packages that use Feature

Package
Description

com.cloudera.oryx.app.classreg.example

Representations of features and training / test examples that are used inside a
 classification or regression process.

Uses of Feature in com.cloudera.oryx.app.classreg.example

Classes in com.cloudera.oryx.app.classreg.example that implement Feature

Modifier and Type
Class and Description

class
CategoricalFeature

Represents a value of a categorical feature -- one that takes on discrete, unordered values like
 {male,female} rather than a continuous or discrete numeric value.

class
NumericFeature

Represents the value of a numeric feature -- one that takes on a real value, whether conceptually discrete or
 continuous.

Methods in com.cloudera.oryx.app.classreg.example that return Feature

Modifier and Type
Method and Description

Feature
Example.getFeature(int i)

Feature
Example.getTarget()

Constructors in com.cloudera.oryx.app.classreg.example with parameters of type Feature

Constructor and Description

Example(Feature target,
       Feature... features)

Example(Feature target,
       Feature... features)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014–2018. All rights reserved.


text:
//snippet-sourcedescription:[WorkflowStarter.java demonstrates how to start a workflow.]
//snippet-keyword:[Java]
//snippet-sourcesyntax:[java]
//snippet-keyword:[Code Sample]
//snippet-service:[swf]
//snippet-sourcetype:[full-example]
//snippet-sourcedate:[]
//snippet-sourceauthor:[soo-aws]

//snippet-start:[swf.java.workflow_starter.complete]
package aws.example.helloswf;

//snippet-start:[swf.java.workflow_starter.import]
import com.amazonaws.regions.Regions;
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow;
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClientBuilder;
import com.amazonaws.services.simpleworkflow.model.*;
//snippet-end:[swf.java.workflow_starter.import]

//snippet-start:[swf.java.workflow_starter.main]
public class WorkflowStarter {
    private static final AmazonSimpleWorkflow swf =
            AmazonSimpleWorkflowClientBuilder.standard().withRegion(Regions.DEFAULT_REGION).build();
    public static final String WORKFLOW_EXECUTION = "HelloWorldWorkflowExecution";

    public static void main(String[] args) {
        String workflow_input = "Amazon SWF";
        if (args.length > 0) {
            workflow_input = args[0];
        }

        System.out.println("Starting the workflow execution '" + WORKFLOW_EXECUTION +
                "' with input '" + workflow_input + "'.");

        WorkflowType wf_type = new WorkflowType()
            .withName(HelloTypes.WORKFLOW)
            .withVersion(HelloTypes.WORKFLOW_VERSION);

        Run run = swf.startWorkflowExecution(new StartWorkflowExecutionRequest()
            .withDomain(HelloTypes.DOMAIN)
            .withWorkflowType(wf_type)
            .withWorkflowId(WORKFLOW_EXECUTION)
            .withInput(workflow_input)
            .withExecutionStartToCloseTimeout("90"));

        System.out.println("Workflow execution started with the run id '" +
                run.getRunId() + "'.");
    }
}
//snippet-end:[swf.java.workflow_starter.main]
//snippet-end:[swf.java.workflow_starter.complete]


text:
<form [formGroup]="form" novalidate (ngSubmit)="apply(form.value, form.valid)">

    <mat-form-field>
        <input
            matInput [formControl]="from" [errorStateMatcher]="matcher"
            placeholder="{{ 'SEARCH.FILTER.RANGE.FROM' | translate }}"
            autocomplete="off"
            data-automation-id="number-range-from-input">
        <mat-error *ngIf="from.hasError('pattern') || from.hasError('min')" data-automation-id="number-range-from-error-invalid">
            {{ 'SEARCH.FILTER.VALIDATION.INVALID-FORMAT' | translate }}
        </mat-error>
        <mat-error *ngIf="from.hasError('required')" data-automation-id="number-range-from-error-required">
            {{ 'SEARCH.FILTER.VALIDATION.REQUIRED-VALUE' | translate }}
        </mat-error>
    </mat-form-field>

    <mat-form-field>
        <input
            matInput [formControl]="to" [errorStateMatcher]="matcher"
            placeholder="{{ 'SEARCH.FILTER.RANGE.TO' | translate }}"
            autocomplete="off"
            data-automation-id="number-range-to-input">
        <mat-error *ngIf="to.hasError('pattern') || to.hasError('min')" data-automation-id="number-range-to-error-invalid">
            {{ 'SEARCH.FILTER.VALIDATION.INVALID-FORMAT' | translate }}
        </mat-error>
        <mat-error *ngIf="to.hasError('required')" data-automation-id="number-range-to-error-required">
            {{ 'SEARCH.FILTER.VALIDATION.REQUIRED-VALUE' | translate }}
        </mat-error>
    </mat-form-field>

    <div class="adf-facet-buttons" *ngIf="!settings?.hideDefaultAction">
        <button mat-button color="primary" type="button" (click)="clear()" data-automation-id="number-range-btn-clear">
            {{ 'SEARCH.FILTER.ACTIONS.CLEAR' | translate }}
        </button>
        <button mat-button color="primary" type="submit" [disabled]="!form.valid" data-automation-id="number-range-btn-apply">
            {{ 'SEARCH.FILTER.ACTIONS.APPLY' | translate }}
        </button>
    </div>
</form>


text:
Ssh = require('ssh2');
async = require('async');

function RemoteExec(hosts, commands, options, cb) {
  var stdout = process.stdout
    , stderr = process.stderr;

  // return an error if no hosts were specified
  if (!hosts || !(typeof hosts === 'string' || hosts instanceof Array)) return cb(new Error('No hosts specified'));
  // array-ify hosts if necessary
  if (typeof hosts === 'string') hosts = [hosts];
  // return an error if no commands were specified
  if (!commands || !(typeof commands === 'string' || commands instanceof Array)) return cb(new Error('No commands specified'));
  // array-ify commands if necessary
  if (typeof commands === 'string') commands = [commands];

  // if 3rd arg (options) is a function, assume the user skipped the options and specified the callback
  if (options instanceof Function) {
    cb = options;
    options = null;
  }

  // default options
  if (!options) options = {};
  if (!options.port) options.port = 22;

  // grab refs to overloaded outputs if specified (defaults to process.stdout and process.stderr)
  if (options.stdout && options.stdout.write instanceof Function) {
    stdout = options.stdout;
    delete options.stdout;
  }
  if (options.stderr && options.stderr.write instanceof Function) {
    stderr = options.stderr;
    delete options.stderr;
  }

  // set callback to noop if not provided
  if (!cb) {
    cb = function(){};
  }

  function doHost(host, done) {
    if (!(typeof host === 'string' || host.name)) done(new Error('Invalid Host'));
    if (typeof host === 'string') host = {name: host, host: host};

    // scoop up any parameters for substitution into commands
    var params = {}, param;
    if (options.params && options.params.hasOwnProperty) {
      for (param in options.params) {
        params[param] = String(options.params[param]);
      }
    }
    for (param in host) {
      if (host.hasOwnProperty(param)) {
        params[param] = String(host[param]);
      }
    }
    // grab a new connection object
    var connection = new Ssh();

    function connect(done) {
      // attach event listeners and start the connection
      options.host = host.name;
      connection.on('ready', done);
      connection.on('error', done);
      connection.connect(options);
    }

    function runCommands(done) {
      // run beforeEach callback for each host (if set)
      if (options.beforeEach && typeof options.beforeEach === 'function') {
        options.beforeEach(host, commands, params);
      }

      // run each command in series
      async.eachSeries(commands, runCommand, done);
    }

    function runCommand(command, done){
      // if the current command ends with '&' (request for a background process)
      // then force an exit code of 0 to allow the connection to close
      // NOTE: this will most likely kill the command if it didn't specify 'nohup'
      if (/ &$/.test(command)) {
        command = command + '; exit 0';
      }

      // substitute parameters into the final command
      var param;
      for (param in params) {
        command = command.replace(new RegExp('{{' + param + '}}'), params[param]);
      }

      var missingParam
      if (missingParam = /{{[a-zA-Z0-9_]+}}/.exec(command)) {
        done(new Error('Missing parameter: ' + missingParam[0]));
      }

      // run the current command
      connection.exec(command, function(err, stream){
        if (err) done(err);

        // forward output to specified stream based on extended (null || stderr)
        stream.on('data', function(data, extended){
          ((extended && extended === 'stderr') ? stderr : stdout).write(data);
        });

        // capture the end of the command and return error if command exited with non-zero code
        stream.on('exit', function(code, signal){
          var err;
          if (code !== 0) {
            err = new Error(host.name + ' : ' + command + ' [Exit ' + code + ']');
          }
          done(err);
        });

      });
    }

    // 1: connect to current host
    // 2: run each command
    async.series([ connect, runCommands ], function(err) {
      // close the connection
      connection.end();

      // run afterEach callback for each host (if set)
      if (options.afterEach && typeof options.afterEach === 'function') {
        options.afterEach(host, commands, params, err);
      }

      done(err);
    });
  }

  // run commands on all hosts in parallel
  async.each(hosts, doHost, cb);
}

module.exports = RemoteExec;


text:
    @setlocal enableextensions enabledelayedexpansion
    set startdir=%cd%
    set temp=%startdir%
    set folder=
:loop
    if not "x%temp:~-1%"=="x\" (
        set folder=!temp:~-1!!folder!
        set temp=!temp:~0,-1!
        goto :loop
    )
    echo.startdir = %startdir%
    echo.folder   = %folder%
    endlocal && set folder=%folder%

if exist papilio_pro.bit (
	mkdir saved_bitfiles
	copy papilio_pro.bit saved_bitfiles\%folder%-papilio-pro.bit
	move Papilio_Pro_summary.html saved_bitfiles\%folder%-papilio-pro-summary.html
) else (
    echo "No File"
)

if exist papilio_one_500k.bit (
	mkdir saved_bitfiles
	copy papilio_one_500k.bit saved_bitfiles\%folder%-papilio-one_500K.bit
	move papilio_one_500k_summary.html saved_bitfiles\%folder%-papilio-one-500K-summary.html
) else (
    echo "No File"
)

if exist papilio_one_250k.bit (
	mkdir saved_bitfiles
	copy papilio_one_250k.bit saved_bitfiles\%folder%-papilio-one_250K.bit
	move papilio_one_250k_summary.html saved_bitfiles\%folder%-papilio-one-250K-summary.html
) else (
    echo "No File"
)

REM Deletes all unnecessary files
for /f %%F in ('dir /b /a-d ^| findstr /vile ".sch .xise .bit .bat .sym .vhd .pdf .ino .cmd_log .cmd .xst .prj .vhf .ut .h .cpp .xtcl  keywords.txt"') do del "%%F"
REM for /f %%F in ('dir /b  ^| findstr /vile "Sketch saved_bitfiles rebuild LX9 500K 250K smallfs ols-0.9.7 Libraries ym_converter"') do rmdir /q /s "%%F"
rmdir /q /s iseconfig

if exist Chip_Designer (
	cd Chip_Designer
	REM move Papilio_DUO_LX9.cmd_log Papilio_DUO_LX9.cmd
	for /f %%F in ('dir /b /a-d ^| findstr /vile ".sch .xise .bit .bat .sym .vhd .pdf .ino .cmd_log .cmd .xst .prj .vhf .ut .html .wcfg .ngc"') do del "%%F"
	for /f %%F in ('dir /b  ^| findstr /vile "Sketch saved_bitfiles rebuild LX9 500K 250K"') do rmdir /q /s "%%F"
	cd ..
)


text:
<?php namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;

use App\Http\Requests\Admin\Forum\UpdateChannelPermissionsRequest;
use Fetch404\Core\Models\Channel;
use Fetch404\Core\Models\ChannelPermission;
use Fetch404\Core\Models\Role;
use Laracasts\Flash\Flash;

class ChannelPermissionManagerController extends Controller {

	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
	public function index()
	{
		//
		$channels = Channel::all();

		return view('core.admin.forums.permission-editor.channel.index', array(
			'channels' => $channels
		));
	}

	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		//
	}

	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param Channel $channel
	 * @return Response
	 */
	public function edit(Channel $channel)
	{
		//
		$groups = Role::lists('name', 'id');

		$createThreadIds = ChannelPermission::where('channel_id', '=', $channel->id)->where('permission_id', '=', 1)->lists('role_id', 'role_id');
		$accessChannelIds = ChannelPermission::where('channel_id', '=', $channel->id)->where('permission_id', '=', 21)->lists('role_id', 'role_id');
		$replyIds = ChannelPermission::where('channel_id', '=', $channel->id)->where('permission_id', '=', 6)->lists('role_id', 'role_id');

		$createThreadIds = collect($createThreadIds);
		$createThreadIds = $createThreadIds->filter(function($item) {
			return $item != 2;
		});

		$replyIds = collect($replyIds);
		$replyIds = $replyIds->filter(function($item) {
			return $item != 2;
		});

		return view('core.admin.forums.permission-editor.channel.edit', array(
			'channel' => $channel,
			'accessChannel' => $accessChannelIds,
			'createThread' => $createThreadIds->toArray(),
			'reply' => $replyIds->toArray(),
			'groups' => $groups
		));
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param UpdateChannelPermissionsRequest $request
	 * @return Response
	 */
	public function update(UpdateChannelPermissionsRequest $request)
	{
		//
		$channel = $request->route()->getParameter('channel');

		$accessChannel = $request->input('allowed_groups');
		$createThreads = $request->input('create_threads');
		$reply = $request->input('reply_to_threads');

		$createThreads = collect($createThreads);
		$createThreads = $createThreads->filter(function($item) {
			return $item != 2;
		});

		$reply = collect($reply);
		$reply = $reply->filter(function($item) {
			return $item != 2;
		});

		ChannelPermission::where('channel_id', '=', $channel->id)
			->where('permission_id', '=', 21)
			->orWhere('permission_id', '=', 1)
			->orWhere('permission_id', '=', 6)
			->delete();

		foreach($accessChannel as $id)
		{
			$perm = ChannelPermission::firstOrCreate(array(
				'permission_id' => 21,
				'role_id' => $id,
				'channel_id' => $channel->id
			));
		}

		foreach($createThreads as $id)
		{
			$create_threads = ChannelPermission::firstOrCreate(array(
				'permission_id' => 1,
				'role_id' => $id,
				'channel_id' => $channel->id
			));
		}

		foreach($reply as $id)
		{
			$replyToThread = ChannelPermission::firstOrCreate(array(
				'permission_id' => 6,
				'role_id' => $id,
				'channel_id' => $channel->id
			));
		}

		Flash::success('Updated channel permissions!');

		return redirect(route('admin.forum.get.permissions.channels.edit', array(
			$channel
		)));
	}

}


text:
package org.apache.sqoop.util;

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

/**
 * Utility class for null substitution character handling.
 *
 */
public final class SubstitutionUtils {

  // List of items that needs to be de-escaped in order to be consistent with
  // Sqoop interpretation of the NULL string parameters.
  private static final Map<String, String> REMOVE_ESCAPE_CHARS;

  static {
    // Build static map of escape characters that needs to be de-escaped.
    // http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6
    REMOVE_ESCAPE_CHARS = new HashMap<String, String>();
    REMOVE_ESCAPE_CHARS.put("\\\\b", "\b");
    REMOVE_ESCAPE_CHARS.put("\\\\t", "\t");
    REMOVE_ESCAPE_CHARS.put("\\\\n", "\n");
    REMOVE_ESCAPE_CHARS.put("\\\\f", "\f");
    REMOVE_ESCAPE_CHARS.put("\\\\'", "'");
    REMOVE_ESCAPE_CHARS.put("\\\\\"", "\"");
    REMOVE_ESCAPE_CHARS.put("\\\\\\\\", "\\\\");
    // TODO(jarcec, optional): Deal with octal escape sequences?
  }

  /**
   * De-escape all escape sequences presented in the string.
   *
   * Sqoop is historically using --(input)-null-(non-)string parameters directly
   * in generated code and thus they need to be manually escaped on command
   * line. However some connectors might need their final form, so that they
   * can be also used outside generated code.
   *
   * @param string String to de-escape
   * @return String without escape sequences
   */
  public static String removeEscapeCharacters(String string) {

    // Our de-escaping is not suporting octal escape sequences
    if (string.matches("\\\\[0-9]+")) {
      throw new RuntimeException("Octal escape sequence is not supported");
    }

    for (Map.Entry<String, String> entry : REMOVE_ESCAPE_CHARS.entrySet()) {
      string = string.replaceAll(entry.getKey(), entry.getValue());
    }
    return string;
  }

  public static String getOrElse(String value){
	  return (value!=null?value:"");
  }

  private SubstitutionUtils() {
    // This class can't be instantiated
  }
}


text:
'use strict';

var exporters = require('./index');
var _ = require('lodash');
var through = require('through');
var _url = require('url');
var debug = require('debug')('formio:error');

module.exports = function(router) {
  var hook = require('../util/hook')(router.formio);

  // Mount the export endpoint using the url.
  router.get('/form/:formId/export', function(req, res, next) {
    if (!_.has(req, 'token') || !_.has(req, 'token.user._id')) {
      return res.sendStatus(400);
    }

    // Get the export format.
    var format = (req.query && req.query.format)
      ? req.query.format.toLowerCase()
      : 'json';

    // Handle unknown formats.
    if (!exporters.hasOwnProperty(format)) {
      return res.status(500).send('Unknown format');
    }

    // Load the form.
    router.formio.cache.loadCurrentForm(req, function(err, form) {
      if (err) {
        return res.sendStatus(401);
      }
      if (!form) {
        return res.sendStatus(404);
      }

      // Allow them to provide a query.
      var query = {};
      if (req.headers.hasOwnProperty('x-query')) {
        try {
          query = JSON.parse(req.headers['x-query']);
        }
        catch (e) {
          debug(e);
          router.formio.util.log(e);
        }
      }

      // Enforce the form.
      query.form = form._id;

      // Only show non-deleted items unless specified
      if (query && !query.hasOwnProperty('deleted')) {
        query.deleted = {$eq: null};
      }

      // Create the exporter.
      var exporter = new exporters[format](form, req, res);

      // Initialize the exporter.
      exporter.init()
        .then(function() {
          var addUrl = function(data) {
            _.each(data, function(field) {
              if (field && field._id) {
                // Add url property for resource fields
                var fieldUrl = hook.alter('fieldUrl', '/form/' + field.form + '/submission/' + field._id, form, field);
                field.url = _url.resolve(router.formio.config.apiHost, fieldUrl);
                // Recurse for nested resources
                addUrl(field.data);
              }
            });
          };

          // Skip this owner filter, if the user is the admin or owner.
          if (req.skipOwnerFilter !== true && req.isAdmin !== true) {
            // The default ownerFilter query.
            query.owner = req.token.user._id;
          }

          // Create the query stream.
          var stream = router.formio.resources.submission.model.find(query)
            .snapshot()
            .cursor({batchSize: 1000})
            .pipe(through(function(doc) {
              var row = doc.toObject({getters: true, virtuals: false});

              addUrl(row.data);
              router.formio.util.removeProtectedFields(form, 'export', row);

              this.queue(row);
            }));

          // Create the stream.
          return exporter.stream(stream);
        })
        .catch(function(error) {
          // Send the error.
          res.status(500).send(error);
        });
    });
  });
};


text:
'use strict';

var superagent = require('superagent');
var User = require('../../../models/user');

module.exports = function (req, res, next) {
  (new User({id: req.params.id})).fetch({cb: function (er, user) {
    if (er) return next(er);
    var avatar = user.get('avatar');
    if (!avatar) return next(404);
    superagent.get(avatar).end(function (er, imgRes) {
      if (er) return next(er);
      res.set(imgRes.headers);
      imgRes.pipe(res);
    });
  }});
};


text:
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
    Context "Validate parameters" {
        [object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object { $_ -notin ('whatif', 'confirm') }
        [object[]]$knownParameters = 'Name', 'Path', 'FilePath', 'InputObject', 'Architecture', 'Language', 'EnableException'
        $knownParameters += [System.Management.Automation.PSCmdlet]::CommonParameters
        It "Should only contain our specific parameters" {
            (@(Compare-Object -ReferenceObject ($knownParameters | Where-Object { $_ }) -DifferenceObject $params).Count ) | Should Be 0
        }
    }
}

Describe "$commandname Integration Tests" -Tag "IntegrationTests" {
    It "downloads a small update" {
        $results = Save-DbaKbUpdate -Name KB2992080 -Architecture All -Path C:\temp
        $results.Name -match 'aspnet'
        $results | Remove-Item -Confirm:$false
    }
    It "supports piping" {
        $results = Get-DbaKbUpdate -Name KB2992080 | select -First 1 | Save-DbaKbUpdate -Architecture All -Path C:\temp
        $results.Name -match 'aspnet'
        $results | Remove-Item -Confirm:$false
    }
    It "Download multiple updates" {
        $results = Save-DbaKbUpdate -Name KB2992080, KB4513696 -Architecture All -Path C:\temp

        # basic retry logic in case the first download didn't get all of the files
        if ($null -eq $results -or $results.Count -ne 2) {
            Write-Message -Level Warning -Message "Retrying..."
            if ($results.Count -gt 0) {
                $results | Remove-Item -Confirm:$false
            }
            Start-Sleep -s 30
            $results = Save-DbaKbUpdate -Name KB2992080, KB4513696 -Architecture All -Path C:\temp
        }

        $results.Count | Should -Be 2
        $results | Remove-Item -Confirm:$false

        # download multiple updates via piping
        $results = Get-DbaKbUpdate -Name KB2992080, KB4513696 | Save-DbaKbUpdate -Architecture All -Path C:\temp

        # basic retry logic in case the first download didn't get all of the files
        if ($null -eq $results -or $results.Count -ne 2) {
            Write-Message -Level Warning -Message "Retrying..."
            if ($results.Count -gt 0) {
                $results | Remove-Item -Confirm:$false
            }
            Start-Sleep -s 30
            $results = Get-DbaKbUpdate -Name KB2992080, KB4513696 | Save-DbaKbUpdate -Architecture All -Path C:\temp
        }

        $results.Count | Should -Be 2
        $results | Remove-Item -Confirm:$false
    }

    # see https://github.com/dataplat/dbatools/issues/6745
    It "Ensuring that variable scope doesn't impact the command negatively" {
        $filter = "SQLServer*-KB-*x64*.exe"

        $results = Save-DbaKbUpdate -Name KB4513696 -Architecture All -Path C:\temp
        $results.Count | Should -Be 1
        $results | Remove-Item -Confirm:$false
    }
}