text:
<?php

namespace Doctrine\DBAL;

use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\ExceptionConverterDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use function array_map;
use function bin2hex;
use function implode;
use function is_resource;
use function is_string;
use function json_encode;
use function sprintf;
use function str_split;

class DBALException extends \Exception
{
    /**
     * @param string $method
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function notSupported($method)
    {
        return new self("Operation '$method' is not supported by platform.");
    }

    public static function invalidPlatformSpecified() : self
    {
        return new self(
            "Invalid 'platform' option specified, need to give an instance of ".
            "\Doctrine\DBAL\Platforms\AbstractPlatform.");
    }

    /**
     * @param mixed $invalidPlatform
     */
    public static function invalidPlatformType($invalidPlatform) : self
    {
        if (\is_object($invalidPlatform)) {
            return new self(
                sprintf(
                    "Option 'platform' must be a subtype of '%s', instance of '%s' given",
                    AbstractPlatform::class,
                    \get_class($invalidPlatform)
                )
            );
        }

        return new self(
            sprintf(
                "Option 'platform' must be an object and subtype of '%s'. Got '%s'",
                AbstractPlatform::class,
                \gettype($invalidPlatform)
            )
        );
    }

    /**
     * Returns a new instance for an invalid specified platform version.
     *
     * @param string $version        The invalid platform version given.
     * @param string $expectedFormat The expected platform version format.
     *
     * @return DBALException
     */
    public static function invalidPlatformVersionSpecified($version, $expectedFormat)
    {
        return new self(
            sprintf(
                'Invalid platform version "%s" specified. ' .
                'The platform version has to be specified in the format: "%s".',
                $version,
                $expectedFormat
            )
        );
    }

    /**
     * @return \Doctrine\DBAL\DBALException
     */
    public static function invalidPdoInstance()
    {
        return new self(
            "The 'pdo' option was used in DriverManager::getConnection() but no ".
            "instance of PDO was given."
        );
    }

    /**
     * @param string|null $url The URL that was provided in the connection parameters (if any).
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function driverRequired($url = null)
    {
        if ($url) {
            return new self(
                sprintf(
                    "The options 'driver' or 'driverClass' are mandatory if a connection URL without scheme " .
                    "is given to DriverManager::getConnection(). Given URL: %s",
                    $url
                )
            );
        }

        return new self("The options 'driver' or 'driverClass' are mandatory if no PDO ".
            "instance is given to DriverManager::getConnection().");
    }

    /**
     * @param string $unknownDriverName
     * @param array  $knownDrivers
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function unknownDriver($unknownDriverName, array $knownDrivers)
    {
        return new self("The given 'driver' ".$unknownDriverName." is unknown, ".
            "Doctrine currently supports only the following drivers: ".implode(", ", $knownDrivers));
    }

    /**
     * @param \Doctrine\DBAL\Driver $driver
     * @param \Exception            $driverEx
     * @param string                $sql
     * @param array                 $params
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function driverExceptionDuringQuery(Driver $driver, \Exception $driverEx, $sql, array $params = [])
    {
        $msg = "An exception occurred while executing '".$sql."'";
        if ($params) {
            $msg .= " with params " . self::formatParameters($params);
        }
        $msg .= ":\n\n".$driverEx->getMessage();

        return static::wrapException($driver, $driverEx, $msg);
    }

    /**
     * @param \Doctrine\DBAL\Driver $driver
     * @param \Exception            $driverEx
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function driverException(Driver $driver, \Exception $driverEx)
    {
        return static::wrapException($driver, $driverEx, "An exception occurred in driver: " . $driverEx->getMessage());
    }

    /**
     * @param \Doctrine\DBAL\Driver $driver
     * @param \Exception            $driverEx
     *
     * @return \Doctrine\DBAL\DBALException
     */
    private static function wrapException(Driver $driver, \Exception $driverEx, $msg)
    {
        if ($driverEx instanceof Exception\DriverException) {
            return $driverEx;
        }
        if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof Driver\DriverException) {
            return $driver->convertException($msg, $driverEx);
        }

        return new self($msg, 0, $driverEx);
    }

    /**
     * Returns a human-readable representation of an array of parameters.
     * This properly handles binary data by returning a hex representation.
     *
     * @param array $params
     *
     * @return string
     */
    private static function formatParameters(array $params)
    {
        return '[' . implode(', ', array_map(function ($param) {
            if (is_resource($param)) {
                return (string) $param;
            }

            $json = @json_encode($param);

            if (! is_string($json) || $json == 'null' && is_string($param)) {
                // JSON encoding failed, this is not a UTF-8 string.
                return '"\x' . implode('\x', str_split(bin2hex($param), 2)) . '"';
            }

            return $json;
        }, $params)) . ']';
    }

    /**
     * @param string $wrapperClass
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function invalidWrapperClass($wrapperClass)
    {
        return new self("The given 'wrapperClass' ".$wrapperClass." has to be a ".
            "subtype of \Doctrine\DBAL\Connection.");
    }

    /**
     * @param string $driverClass
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function invalidDriverClass($driverClass)
    {
        return new self("The given 'driverClass' ".$driverClass." has to implement the ".
            "\Doctrine\DBAL\Driver interface.");
    }

    /**
     * @param string $tableName
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function invalidTableName($tableName)
    {
        return new self("Invalid table name specified: ".$tableName);
    }

    /**
     * @param string $tableName
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function noColumnsSpecifiedForTable($tableName)
    {
        return new self("No columns specified for table ".$tableName);
    }

    /**
     * @return \Doctrine\DBAL\DBALException
     */
    public static function limitOffsetInvalid()
    {
        return new self("Invalid Offset in Limit Query, it has to be larger than or equal to 0.");
    }

    /**
     * @param string $name
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function typeExists($name)
    {
        return new self('Type '.$name.' already exists.');
    }

    /**
     * @param string $name
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function unknownColumnType($name)
    {
        return new self('Unknown column type "'.$name.'" requested. Any Doctrine type that you use has ' .
            'to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the ' .
            'known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database ' .
            'introspection then you might have forgotten to register all database types for a Doctrine Type. Use ' .
            'AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement ' .
            'Type#getMappedDatabaseTypes(). If the type name is empty you might ' .
            'have a problem with the cache or forgot some mapping information.'
        );
    }

    /**
     * @param string $name
     *
     * @return \Doctrine\DBAL\DBALException
     */
    public static function typeNotFound($name)
    {
        return new self('Type to be overwritten '.$name.' does not exist.');
    }
}


text:
@interface ViewController : UIViewController

@property (nonatomic, strong) MBPagesContainerViewController3 *pagesContainer;

@end

redpajama_set_name: RedPajamaGithub


text:
require 'fipextractor/reference_table'
require 'fipextractor/brand'
require 'fipextractor/model'
require 'fipextractor/model_year'
require 'fipextractor/model_through_year'
require 'fipextractor/vehicle'

module FipExtractor
end


text:
<?php
/**
 * @group Kwc_Trl
 * @group Kwc_Trl_StaticTexts
 * @group Kwc_Trl_StaticTexts_Placeholder
 */
class Kwc_Trl_StaticTextsPlaceholder_Test extends Kwc_TestAbstract
{
    public function setUp()
    {
        Kwf_Registry::get('config')->languages = array('de', 'en');
        Kwf_Trl::getInstance()->setWebCodeLanguage('de');
        Kwf_Trl::getInstance()->setModel(new Kwc_Trl_StaticTextsPlaceholder_TrlModelWeb(), Kwf_Trl::SOURCE_WEB);
        Kwf_Trl::getInstance()->setModel(new Kwf_Model_FnF(), Kwf_Trl::SOURCE_KWF);
        parent::setUp('Kwc_Trl_StaticTextsPlaceholder_Root');
    }

    public function tearDown()
    {
        Kwf_Trl::getInstance()->setWebCodeLanguage(null);
        Kwf_Trl::getInstance()->setModel(null, Kwf_Trl::SOURCE_WEB);
        Kwf_Trl::getInstance()->setModel(null, Kwf_Trl::SOURCE_KWF);
        parent::tearDown();
    }

    public function testPlaceholdingWeb()
    {
        // web code language is 'de', tested language is 'en'

        $c = $this->_root->getPageByUrl('http://'.Kwf_Registry::get('config')->server->domain.'/en/testtrl', 'en');

        $this->assertEquals('en', $c->getLanguage());

        $render = $c->render();

        $this->assertContains('trlTest: Visible', $render);
        $this->assertContains('trlcTest: On', $render);
        $this->assertContains('trlpTest1: reply', $render);
        $this->assertContains('trlpTest2: replies', $render);
        $this->assertContains('trlcpTest1: reply', $render);
        $this->assertContains('trlcpTest2: replies', $render);
    }

    public function testPlaceholdingKwf()
    {
        // web code language is 'de', tested language is 'en'

        $c = $this->_root->getPageByUrl('http://'.Kwf_Registry::get('config')->server->domain.'/en/testtrl', 'en');

        $this->assertEquals('en', $c->getLanguage());

        $render = $c->render();

        $this->assertContains('trlKwfTest: Visible', $render);
        $this->assertContains('trlcKwfTest: On', $render);
        $this->assertContains('trlpKwfTest1: reply', $render);
        $this->assertContains('trlpKwfTest2: replies', $render);
        $this->assertContains('trlcpKwfTest1: reply', $render);
        $this->assertContains('trlcpKwfTest2: replies', $render);
    }
}


text:
package BerkeleyDB::Hash ;

# This file is only used for MLDBM

use BerkeleyDB ;

1 ;


text:
#include "third_party/blink/renderer/core/html/forms/type_ahead.h"

#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"

namespace blink {

TypeAhead::TypeAhead(TypeAheadDataSource* data_source)
    : data_source_(data_source), repeating_char_(0) {}

constexpr base::TimeDelta kTypeAheadTimeout = base::TimeDelta::FromSecondsD(1);

static String StripLeadingWhiteSpace(const String& string) {
  unsigned length = string.length();

  unsigned i;
  for (i = 0; i < length; ++i) {
    if (string[i] != kNoBreakSpaceCharacter && !IsSpaceOrNewline(string[i]))
      break;
  }

  return string.Substring(i, length - i);
}

int TypeAhead::HandleEvent(const KeyboardEvent& event,
                           MatchModeFlags match_mode) {
  if (last_type_time_) {
    if (event.PlatformTimeStamp() < *last_type_time_)
      return -1;

    if (event.PlatformTimeStamp() - *last_type_time_ > kTypeAheadTimeout)
      buffer_.Clear();
  } else {
    // If |last_type_time_| is null, there should be no type ahead session in
    // progress. Thus, |buffer_|, which represents a partial match, should be
    // empty.
    DCHECK(buffer_.IsEmpty());
  }
  last_type_time_ = event.PlatformTimeStamp();

  UChar c = event.charCode();
  buffer_.Append(c);

  int option_count = data_source_->OptionCount();
  if (option_count < 1)
    return -1;

  int search_start_offset = 1;
  String prefix;
  if (match_mode & kCycleFirstChar && c == repeating_char_) {
    // The user is likely trying to cycle through all the items starting
    // with this character, so just search on the character.
    prefix = String(&c, 1);
    repeating_char_ = c;
  } else if (match_mode & kMatchPrefix) {
    prefix = buffer_.ToString();
    if (buffer_.length() > 1) {
      repeating_char_ = 0;
      search_start_offset = 0;
    } else {
      repeating_char_ = c;
    }
  }

  if (!prefix.IsEmpty()) {
    int selected = data_source_->IndexOfSelectedOption();
    int index = (selected < 0 ? 0 : selected) + search_start_offset;
    index %= option_count;

    // Compute a case-folded copy of the prefix string before beginning the
    // search for a matching element. This code uses foldCase to work around the
    // fact that String::startWith does not fold non-ASCII characters. This code
    // can be changed to use startWith once that is fixed.
    String prefix_with_case_folded(prefix.FoldCase());
    for (int i = 0; i < option_count; ++i, index = (index + 1) % option_count) {
      // Fold the option string and check if its prefix is equal to the folded
      // prefix.
      String text = data_source_->OptionAtIndex(index);
      if (StripLeadingWhiteSpace(text).FoldCase().StartsWith(
              prefix_with_case_folded))
        return index;
    }
  }

  if (match_mode & kMatchIndex) {
    bool ok = false;
    int index = buffer_.ToString().ToInt(&ok);
    if (index > 0 && index <= option_count)
      return index - 1;
  }
  return -1;
}

bool TypeAhead::HasActiveSession(const KeyboardEvent& event) {
  if (!last_type_time_)
    return false;
  base::TimeDelta delta = event.PlatformTimeStamp() - *last_type_time_;
  return delta <= kTypeAheadTimeout;
}

void TypeAhead::ResetSession() {
  last_type_time_.reset();
  buffer_.Clear();
}

}  // namespace blink


text:
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
using Foundation;
using System.Drawing;
using UIKit;

namespace ArcGISRuntimeXamarin.Samples.RenderSimpleMarkers
{
    [Register("RenderSimpleMarkers")]
    public class RenderSimpleMarkers : UIViewController
    {
        // Constant holding offset where the MapView control should start
        private const int yPageOffset = 60;

        // Create and hold reference to the used MapView
        private MapView _myMapView = new MapView();

        public RenderSimpleMarkers()
        {
            Title = "Render simple markers";
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Create the UI, setup the control references and execute initialization
            CreateLayout();
            Initialize();
        }

        public override void ViewDidLayoutSubviews()
        {
            // Setup the visual frame for the MapView
            _myMapView.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);

            base.ViewDidLayoutSubviews();
        }

        private void Initialize()
        {
            // Create new Map with basemap
            Map myMap = new Map(Basemap.CreateImagery());

            // Create initial map location and reuse the location for graphic
            MapPoint centralLocation = new MapPoint(-226773, 6550477, SpatialReferences.WebMercator);
            Viewpoint initialViewpoint = new Viewpoint(centralLocation, 7500);

            // Set initial viewpoint
            myMap.InitialViewpoint = initialViewpoint;

            // Provide used Map to the MapView
            _myMapView.Map = myMap;

            // Create overlay to where graphics are shown
            GraphicsOverlay overlay = new GraphicsOverlay();

            // Add created overlay to the MapView
            _myMapView.GraphicsOverlays.Add(overlay);

            // Create a simple marker symbol
            SimpleMarkerSymbol simpleSymbol = new SimpleMarkerSymbol()
            {
                Color = Color.Red,
                Size = 10,
                Style = SimpleMarkerSymbolStyle.Circle
            };

            // Add a new graphic with a central point that was created earlier
            Graphic graphicWithSymbol = new Graphic(centralLocation, simpleSymbol);
            overlay.Graphics.Add(graphicWithSymbol);
        }

        private void CreateLayout()
        {
            // Add MapView to the page
            View.AddSubviews(_myMapView);
        }
    }
}


text:
package org.tp23.antinstaller.renderer.swing;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridBagLayout;
import java.awt.Image;
import java.awt.Insets;
import java.util.ArrayList;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.Border;

import org.tp23.antinstaller.ValidationException;
import org.tp23.antinstaller.input.OutputField;
import org.tp23.antinstaller.page.Page;
import org.tp23.antinstaller.page.SimpleInputPage;
import org.tp23.antinstaller.renderer.RendererFactory;
import org.tp23.gui.GBCF;

/**
 *
 *
This PageRenderer just renders a list of SwingInputRenderers using
* a BoxLayout

 *

 *
Copyright: Copyright (c) 2004

 *
Company: tp23

 * @author Paul Hinds
 * @version $Id: SimpleInputPageRenderer.java,v 1.2 2006/11/10 17:02:01 kumarvi Exp $
 */
public class SimpleInputPageRenderer
	extends SwingPageRenderer {

	private JPanel contentPanel = new JPanel(){
		/**
		 * added by kumarvi
		 */
		public void paintComponent(Graphics g)
		 {  super.paintComponent(g);
		   this.setForeground(Color.BLUE);
		    super.paintComponent(g);
		    ImageScaler is = new ImageScaler();
				ImageIcon icon = new ImageIcon(is.getScaledInstance("resources/mainbackground.jpg",600,400));
				Image image = icon.getImage();
		    if(image != null) g.drawImage(image, 0,0,600,400,this);

		 }
		/**
		 * end of addition
		 */

	};

	private GridBagLayout gridLayout = new GridBagLayout();
	private GBCF cf = new GBCF(); // GridBagConstraintsFactory
	private boolean overflow = false;
	// used in overflow
	JScrollPane scroller = null;

	private ArrayList renderers = new ArrayList();;

	public SimpleInputPageRenderer(){
	}

	public boolean validateFields() throws ValidationException {
		OutputField[] fields = page.getOutputField();
		for (int i = 0; i < fields.length; i++) {
			if(!fields[i].validate(ctx)){
				SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer)renderers.get(i);
				renderer.renderError();
				return false;
			}
		}
		return true;
	}
	public void updateInputFields(){
		for (int i = 0; i < renderers.size(); i++) {
			((SwingOutputFieldRenderer)renderers.get(i)).updateInputField();
		}
	}

	public void updateDefaultValues(){
		for (int i = 0; i < renderers.size(); i++) {
			((SwingOutputFieldRenderer)renderers.get(i)).updateDefaultValue();
		}
	}

	public void instanceInit() throws Exception {
		overflow = ((SimpleInputPage)page).isOverflow();
		if(overflow){
			//WARNING this causes flickering in the UI
			contentPanel.setMaximumSize(new Dimension(SwingPageRenderer.PAGE_WIDTH - 50,SwingPageRenderer.PAGE_HEIGHT));
			scroller = new JScrollPane();
			scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
			scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
			scroller.setBorder(BorderFactory.createCompoundBorder(
							BorderFactory.createEmptyBorder(4,4,4,4),
							BorderFactory.createEtchedBorder()
							));
			add(scroller,BorderLayout.CENTER);
			scroller.getViewport().add(contentPanel);
			//contentPanel.setBackground(Color.red);
		}
		else {
			this.add(contentPanel,BorderLayout.CENTER);
			contentPanel.setBorder(BorderFactory.createEmptyBorder(SwingOutputFieldRenderer.TOP_INDENT,4,4,4));
		}

		OutputField[] fields = page.getOutputField();
		contentPanel.setDoubleBuffered(true);
		contentPanel.setLayout(gridLayout);
		int row = 0;
		for (int i = 0; i < fields.length; i++) {
			SwingOutputFieldRenderer renderer = RendererFactory.getSwingRenderer(fields[i]);
			/**
			 * Commented out following section by Kumarvi
			 */
			//String text = fields[i].getExplanatoryText();
			//if(fields[i].getExplanatoryText()!=null){
				//JTextArea area = new DisplayTextArea(contentPanel.getBackground(),contentPanel.getForeground());
				//area.setIgnoreRepaint(true);
				//area.setText(text);
				//contentPanel.add(area,cf.getSpan(row++));
			//}

			/**
			 * End of comments
			 */
			renderer.setOutputField(fields[i]);
			renderer.setInstallerContext(ctx);
			renderer.initComponent(contentPanel);
			row = renderer.addSelf(contentPanel,cf,row,overflow);
			renderers.add(renderer);
		}
		JPanel filler = new JPanel();
		filler.setOpaque(false);
		//contentPanel.add(new JPanel(),cf.getVertGlue(row++));
		contentPanel.add(filler,cf.getVertGlue(row++));
	}
}
/**
 * A JTextArea taht is not exditable and looks like a JLabel but uses
 * JTextAreas ability to wrap.  Also has a fixed prefered width;
 * @author Paul Hinds
 * @version $Id: SimpleInputPageRenderer.java,v 1.2 2006/11/10 17:02:01 kumarvi Exp $
 */
class DisplayTextArea extends JTextArea{
	DisplayTextArea(Color back,Color fore){
		super();
		this.setBackground(back);
		this.setForeground(fore);
		this.setLineWrap(true);
		this.setWrapStyleWord(true);
		this.setEditable(false);
		this.setSelectionColor(back);
		this.setSelectionColor(back);
		this.setMargin(new Insets(5,0,0,0));
	}

	public Dimension getPreferredSize(){
		Dimension pref = super.getPreferredSize();
		return new Dimension(SwingPageRenderer.PAGE_WIDTH - 40,pref.height);
	}
	public Dimension getMinimumSize(){
		Dimension pref = super.getMinimumSize();
		return new Dimension(SwingPageRenderer.PAGE_WIDTH - 40,pref.height);
	}
}


text:
package com.github.jomnipod;

import com.github.jomnipod.IBFRecord.Iterator;

public class IBFDateTime extends DateTime {

	public IBFDateTime(Iterator iterator) {
		super(iterator.nextByte().intValue(), iterator.nextByte().intValue(), iterator.nextUnsignedLEShort().intValue(),
				iterator.nextByte().intValue(), iterator.nextByte().intValue(), iterator.nextByte().intValue());
	}

}


text:
#import "PBXStructureSymbol.h"

@interface PBXStructureSymbol (PBXCodeAssistantCategory)
- (id)smallIcon;
- (id)icon;
@end


text:
//=============================================================================================================

#ifndef NEUROMAGSETUPWIDGET_H
#define NEUROMAGSETUPWIDGET_H

//*************************************************************************************************************
//=============================================================================================================
// INCLUDES
//=============================================================================================================

#include "../ui_neuromagsetup.h"

//*************************************************************************************************************
//=============================================================================================================
// QT INCLUDES
//=============================================================================================================

#include <QWidget>

//*************************************************************************************************************
//=============================================================================================================
// DEFINE NAMESPACE MneRtClientPlugin
//=============================================================================================================

namespace MneRtClientPlugin
{

//*************************************************************************************************************
//=============================================================================================================
// FORWARD DECLARATIONS
//=============================================================================================================

class Neuromag;

//=============================================================================================================
/**
* DECLARE CLASS NeuromagSetupWidget
*
* @brief The NeuromagSetupWidget class provides the ECG configuration window.
*/
class NeuromagSetupWidget : public QWidget
{
    Q_OBJECT

public:

    //=========================================================================================================
    /**
    * Constructs a NeuromagSetupWidget which is a child of parent.
    *
    * @param [in] p_pNeuromag   a pointer to the corresponding Neuromag.
    * @param [in] parent        pointer to parent widget; If parent is 0, the new NeuromagSetupWidget becomes a window. If parent is another widget, NeuromagSetupWidget becomes a child window inside parent. NeuromagSetupWidget is deleted when its parent is deleted.
    */
    NeuromagSetupWidget(Neuromag* p_pNeuromag, QWidget *parent = 0);

    //=========================================================================================================
    /**
    * Destroys the NeuromagSetupWidget.
    * All NeuromagSetupWidget's children are deleted first. The application exits if NeuromagSetupWidget is the main widget.
    */
    ~NeuromagSetupWidget();

    //=========================================================================================================
    /**
    * Inits the setup widget
    */
    void init();

//slots
    void bufferSizeEdited();        /**< Buffer size edited and set new buffer size.*/

    void checkedRecordDataChanged();    /**< Record Data checkbox changed. */

    void printToLog(QString message);   /**< Implements printing messages to rtproc log.*/

    void pressedFiffRecordFile();   /**< Triggers file dialog to select record file.*/

    void pressedConnect();          /**< Triggers a connection trial to rt_server.*/

    void pressedSendCLI();          /**< Triggers a send request of a cli command.*/

    void fiffInfoReceived();        /**< Triggered when new fiff info is recieved by producer and stored intor rt_server */

private:
    //=========================================================================================================
    /**
    * Set command connection status
    *
    * @param[in] p_bConnectionStatus    the connection status
    */
    void cmdConnectionChanged(bool p_bConnectionStatus);

    //=========================================================================================================
    /**
    * Shows the About Dialog
    *
    */
    void showAboutDialog();

//    //=========================================================================================================
//    /**
//    * Shows the SQUID Control Dialog
//    *
//    */
//    void SQUIDControlDialog();

    Neuromag*   m_pNeuromag;      /**< a pointer to corresponding mne rt client.*/

    Ui::NeuromagSetupWidgetClass ui; /**< the user interface for the NeuromagSetupWidget.*/

    bool m_bIsInit;                     /**< false when gui is not initialized jet. Prevents gui from already interacting when not initialized */
};

} // NAMESPACE

#endif // NEUROMAGSETUPWIDGET_H


text:
package io.snappydata.cluster

class ThinConnectorSplitClusterDUnitTest(s: String) extends SplitClusterDUnitTest(s) {
  override protected val useThinClientConnector = true

}


text:
from pypif import pif
from pypif.obj.common.pio import Pio
from pypif.util.serializable import Serializable
from six import string_types

class PifSearchHit(Serializable):
    """
    Class to store a single PIF search hit.
    """

    def __init__(self, id=None, dataset=None, dataset_version=None, score=None, updated_at=None, system=None,
                 extracted=None, extracted_path=None, **kwargs):
        """
        Constructor.

        :param id: String with the ID of the record.
        :param dataset: Integer with the dataset of the record.
        :param dataset_version: Integer with the dataset version of the record.
        :param score: Score with the relevancy of the result.
        :param updated_at: String with the last time that the record was updated.
        :param system: Pif System object that matched.
        :param extracted: Dictionary with a map of extracted property names to values.
        :param extracted_path: Dictionary with a map of extracted property names to paths in a PIF.
        """
        self._id = None
        self.id = id
        self._dataset = None
        self.dataset = dataset
        self._dataset_version = None
        self.dataset_version = dataset_version
        self._score = None
        self.score = score
        self._updated_at = None
        self.updated_at = updated_at
        self._system = None
        self.system = system
        self._extracted = None
        self.extracted = extracted
        self._extracted_path = None
        self.extracted_path = extracted_path

    @property
    def id(self):
        return self._id

    @id.setter
    def id(self, id):
        self._id = id

    @id.deleter
    def id(self):
        self._id = None

    @property
    def dataset(self):
        return self._dataset

    @dataset.setter
    def dataset(self, dataset):
        self._dataset = dataset

    @dataset.deleter
    def dataset(self):
        self._dataset = None

    @property
    def dataset_version(self):
        return self._dataset_version

    @dataset_version.setter
    def dataset_version(self, dataset_version):
        self._dataset_version = dataset_version

    @dataset_version.deleter
    def dataset_version(self):
        self._dataset_version = None

    @property
    def score(self):
        return self._score

    @score.setter
    def score(self, score):
        self._score = score

    @score.deleter
    def score(self):
        self._score = None

    @property
    def updated_at(self):
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        self._updated_at = updated_at

    @updated_at.deleter
    def updated_at(self):
        self._updated_at = None

    @property
    def system(self):
        return self._system

    @system.setter
    def system(self, system):
        if system is None:
            self._system = None
        elif isinstance(system, string_types):
            self._system = pif.loads(system)
        elif isinstance(system, dict):
            self._system = pif.loado(system)
        elif isinstance(system, Pio):
            self._system = system
        else:
            raise TypeError('Not a valid system type: must be string, dict, or Pio, but got ' + str(type(system)))

    @system.deleter
    def system(self):
        self._system = None

    @property
    def extracted(self):
        return self._extracted

    @extracted.setter
    def extracted(self, extracted):
        self._extracted = extracted

    @extracted.deleter
    def extracted(self):
        self._extracted = None

    @property
    def extracted_path(self):
        return self._extracted_path

    @extracted_path.setter
    def extracted_path(self, extracted_path):
        self._extracted_path = extracted_path

    @extracted_path.deleter
    def extracted_path(self):
        self._extracted_path = None


text:
#ifndef N_CHUNKLODNODE_H
#define N_CHUNKLODNODE_H
//------------------------------------------------------------------------------
/**
    @class nChunkLodNode
    @ingroup NCTerrain2

    @brief A node in a quad tree of LOD chunks.

    (C) 2003 RadonLabs GmbH
*/
#include "kernel/ntypes.h"
#include "kernel/nref.h"
#include "ncterrain2/nchunklodmesh.h"
#include "mathlib/bbox.h"
#include "ncterrain2/nchunklodrenderparams.h"
#include "ncterrain2/nchunklodtree.h"

class nChunkLodTree;

//------------------------------------------------------------------------------
class nChunkLodNode
{
public:
    /// constructor
    nChunkLodNode();
    /// destructor
    virtual ~nChunkLodNode();
    /// recursively read chunk parameters from .chu file
    bool LoadParams(Data::CFileStream* file, int recurseCount, nChunkLodTree* tree);
    /// convert neighbour labels to pointers
    void LookupNeighbours(nChunkLodTree* tree);
    /// set pointer to parent chunk
    void SetParent(nChunkLodNode* p);
    /// get pointer to parent chunk
    nChunkLodNode* GetParent() const;
    /// set pointer to child
    void SetChild(uint index, nChunkLodNode* c);
    /// get pointer to child
    nChunkLodNode* GetChild(uint index);
    /// get quadtree level of the node
    int GetLevel() const;
    /// get x position in quadtree level
    int GetX() const;
    /// get z position in quadtree level
    int GetZ() const;
    /// set lod value
    void SetLod(ushort l);
    /// get lod value
    ushort GetLod() const;
    /// return true if node has children
    bool HasChildren() const;
    /// get the status of the split flag
    bool GetSplit() const;
    /// compute the bounding box of this node
    void ComputeBoundingBox(nChunkLodTree* tree, bbox3& box) const;
    /// clears the split values throughout the quad tree
    void ClearSplits();
    /// update geometry based on viewpoint
    void Update(nChunkLodTree* tree, const vector3& viewPoint);
    /// update textures based on viewpoint
    void UpdateTexture(nChunkLodTree* tree, const vector3& viewPoint);
    /// returns true when the data for this chunk is available
    bool IsValid() const;
    /// split this chunk (makes it valid for rendering)
    void DoSplit(nChunkLodTree* tree, const vector3& viewPoint);
    /// return true if this chunk can be split
    bool CanSplit(nChunkLodTree* tree);
    /// schedule this node's data for loading at the given priority
    void WarmUpData(nChunkLodTree* tree, float priority);
    /// request to load the data for this node at the given priority
    void RequestLoadData(nChunkLodTree* tree, float priority);
    /// request to load texture for this node
    void RequestLoadTexture(nChunkLodTree* tree);
    /// request unloading the data of this node
    void RequestUnloadData(nChunkLodTree* tree);
    /// request to unload texture of this node
    void RequestUnloadTexture(nChunkLodTree* tree);
    /// request unloading the chunk node and all child nodes
    void RequestUnloadSubtree(nChunkLodTree* tree);
    /// request to unload textures for this node and all its descendants
    void RequestUnloadTextures(nChunkLodTree* tree);
    /// render the chunk lod node
    int Render(nChunkLodRenderParams& renderParams, bbox3::ClipStatus clipStatus, bool textureBound);
    /// return true if contains valid texture
    bool HasValidTexture() const;
    /// get the chunk's texture
    nTexture2* GetTexture() const;
    /// get this chunk's texgen parameters
    void GetTexGen(nChunkLodTree* tree, nFloat4& texGenS, nFloat4& texGenT) const;
	/// get a chunklod mesh
	nChunkLodMesh* GetChunkLodMesh() const;

private:
    /// bind our texture
    void RenderTexture(nChunkLodRenderParams& renderParams);

    nChunkLodNode* parent;          // pointer to parent chunk
    nChunkLodNode* children[4];     // pointer to children
    union
    {
        int label;
        nChunkLodNode* node;
    } neighbour[4];                 // labels / pointers to neighbor nodes

    ushort x;                       // chunk "address" (its position in the quadtree)
    ushort z;
    uchar level;

    short minY;                     // vertical bounds, for constructing bounding box
    short maxY;

    bool split;                     // true if this node should be rendered by descendents
    ushort lod;                     // LOD of this chunk.  high byte never changes; low byte is the morph parameter.

    int vertexDataPosition;
    nChunkLodMesh* chunkLodMesh;
    nTexture2* chunkLodTexture;
};

//------------------------------------------------------------------------------
/**
    Compute the bounding box for this node.
*/
inline
void
nChunkLodNode::ComputeBoundingBox(nChunkLodTree* tree, bbox3& box) const
{
    float levelFactor = float(1 << (tree->treeDepth - 1 - this->level));
    static vector3 center;
    static vector3 extent;
    const vector3& origin = tree->GetTerrainOrigin();

    center.x = ((this->x + 0.5f) * levelFactor * tree->baseChunkDimension) - origin.x;
    center.y = ((this->maxY + this->minY) * 0.5f * tree->verticalScale) - origin.y;
    center.z = ((this->z + 0.5f) * levelFactor * tree->baseChunkDimension) - origin.z;

    const float extraBoxSize = 1e-3f;   // this is to make chunks overlap by about a millimeter, to avoid cracks.
    extent.x = levelFactor * tree->baseChunkDimension * 0.5f + extraBoxSize;
    extent.y = (this->maxY + this->minY) * 0.5f * tree->verticalScale;
    extent.z = extent.x;

    box.set(center, extent);
}

//------------------------------------------------------------------------------
/**
*/
inline
int
nChunkLodNode::GetLevel() const
{
    return this->level;
}

//------------------------------------------------------------------------------
/**
*/
inline
int
nChunkLodNode::GetX() const
{
    return this->x;
}

//------------------------------------------------------------------------------
/**
*/
inline
int
nChunkLodNode::GetZ() const
{
    return this->z;
}

//------------------------------------------------------------------------------
/**
*/
inline
void
nChunkLodNode::SetParent(nChunkLodNode* p)
{
    this->parent = p;
}

//------------------------------------------------------------------------------
/**
*/
inline
nChunkLodNode*
nChunkLodNode::GetParent() const
{
    return this->parent;
}

//------------------------------------------------------------------------------
/**
*/
inline
void
nChunkLodNode::SetChild(uint index, nChunkLodNode* c)
{
    n_assert(index < 4);
    this->children[index] = c;
}

//------------------------------------------------------------------------------
/**
*/
inline
nChunkLodNode*
nChunkLodNode::GetChild(uint index)
{
    n_assert(index < 4);
    return this->children[index];
}

//------------------------------------------------------------------------------
/**
*/
inline
void
nChunkLodNode::SetLod(ushort l)
{
    this->lod = l;
}

//------------------------------------------------------------------------------
/**
*/
inline
ushort
nChunkLodNode::GetLod() const
{
    return this->lod;
}

//------------------------------------------------------------------------------
/**
*/
inline
bool
nChunkLodNode::HasChildren() const
{
    return (this->children[0] != 0);
}

//------------------------------------------------------------------------------
/**
*/
inline
bool
nChunkLodNode::IsValid() const
{
    if (this->chunkLodMesh && (this->chunkLodMesh->IsValid()))
    {
        return true;
    }
    else
    {
        return false;
    }
}

//------------------------------------------------------------------------------
/**
*/
inline
bool
nChunkLodNode::GetSplit() const
{
    return this->split;
}

//------------------------------------------------------------------------------
/**
*/
inline
bool
nChunkLodNode::HasValidTexture() const
{
    if (this->chunkLodTexture && (this->chunkLodTexture->IsValid()))
    {
        return true;
    }
    else
    {
        return false;
    }
}

//------------------------------------------------------------------------------
/**
    Get the chunk's texture. May return 0 if texture is not valid!
*/
inline
nTexture2*
nChunkLodNode::GetTexture() const
{
    if (this->HasValidTexture())
    {
        return this->chunkLodTexture;
    }
    else
    {
        return 0;
    }
}

//------------------------------------------------------------------------------
/**
*/
inline
nChunkLodMesh*
nChunkLodNode::GetChunkLodMesh() const
{
	if(this->IsValid())
		return this->chunkLodMesh;
	return 0;
}

//------------------------------------------------------------------------------
#endif


text:
package com.badlogic.gdx.graphics.g3d.utils;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.g3d.Renderable;
import com.badlogic.gdx.graphics.g3d.Shader;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader;
import com.badlogic.gdx.graphics.g3d.shaders.GLES10Shader;

public class GLES10ShaderProvider extends BaseShaderProvider {
	@Override
	protected Shader createShader(final Renderable renderable) {
		return new GLES10Shader();
	}
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ustilago striaeformis f. phlei W.H. Davis

### Remarks
null


text:
package daemon

import (
	"io"

	"github.com/Sirupsen/logrus"
	"github.com/containers/image/docker/reference"
	"github.com/containers/image/docker/tarfile"
	"github.com/containers/image/types"
	"github.com/docker/docker/client"
	"github.com/pkg/errors"
	"golang.org/x/net/context"
)

type daemonImageDestination struct {
	ref                  daemonReference
	*tarfile.Destination // Implements most of types.ImageDestination
	// For talking to imageLoadGoroutine
	goroutineCancel context.CancelFunc
	statusChannel   <-chan error
	writer          *io.PipeWriter
	// Other state
	committed bool // writer has been closed
}

// newImageDestination returns a types.ImageDestination for the specified image reference.
func newImageDestination(systemCtx *types.SystemContext, ref daemonReference) (types.ImageDestination, error) {
	if ref.ref == nil {
		return nil, errors.Errorf("Invalid destination docker-daemon:%s: a destination must be a name:tag", ref.StringWithinTransport())
	}
	namedTaggedRef, ok := ref.ref.(reference.NamedTagged)
	if !ok {
		return nil, errors.Errorf("Invalid destination docker-daemon:%s: a destination must be a name:tag", ref.StringWithinTransport())
	}

	c, err := client.NewClient(client.DefaultDockerHost, "1.22", nil, nil) // FIXME: overridable host
	if err != nil {
		return nil, errors.Wrap(err, "Error initializing docker engine client")
	}

	reader, writer := io.Pipe()
	// Commit() may never be called, so we may never read from this channel; so, make this buffered to allow imageLoadGoroutine to write status and terminate even if we never read it.
	statusChannel := make(chan error, 1)

	ctx, goroutineCancel := context.WithCancel(context.Background())
	go imageLoadGoroutine(ctx, c, reader, statusChannel)

	return &daemonImageDestination{
		ref:             ref,
		Destination:     tarfile.NewDestination(writer, namedTaggedRef),
		goroutineCancel: goroutineCancel,
		statusChannel:   statusChannel,
		writer:          writer,
		committed:       false,
	}, nil
}

// imageLoadGoroutine accepts tar stream on reader, sends it to c, and reports error or success by writing to statusChannel
func imageLoadGoroutine(ctx context.Context, c *client.Client, reader *io.PipeReader, statusChannel chan<- error) {
	err := errors.New("Internal error: unexpected panic in imageLoadGoroutine")
	defer func() {
		logrus.Debugf("docker-daemon: sending done, status %v", err)
		statusChannel <- err
	}()
	defer func() {
		if err == nil {
			reader.Close()
		} else {
			reader.CloseWithError(err)
		}
	}()

	resp, err := c.ImageLoad(ctx, reader, true)
	if err != nil {
		err = errors.Wrap(err, "Error saving image to docker engine")
		return
	}
	defer resp.Body.Close()
}

// Close removes resources associated with an initialized ImageDestination, if any.
func (d *daemonImageDestination) Close() error {
	if !d.committed {
		logrus.Debugf("docker-daemon: Closing tar stream to abort loading")
		// In principle, goroutineCancel() should abort the HTTP request and stop the process from continuing.
		// In practice, though, various HTTP implementations used by client.Client.ImageLoad() (including
		// https://github.com/golang/net/blob/master/context/ctxhttp/ctxhttp_pre17.go and the
		// net/http version with native Context support in Go 1.7) do not always actually immediately cancel
		// the operation: they may process the HTTP request, or a part of it, to completion in a goroutine, and
		// return early if the context is canceled without terminating the goroutine at all.
		// So we need this CloseWithError to terminate sending the HTTP request Body
		// immediately, and hopefully, through terminating the sending which uses "Transfer-Encoding: chunked"" without sending
		// the terminating zero-length chunk, prevent the docker daemon from processing the tar stream at all.
		// Whether that works or not, closing the PipeWriter seems desirable in any case.
		d.writer.CloseWithError(errors.New("Aborting upload, daemonImageDestination closed without a previous .Commit()"))
	}
	d.goroutineCancel()

	return nil
}

func (d *daemonImageDestination) Reference() types.ImageReference {
	return d.ref
}

// Commit marks the process of storing the image as successful and asks for the image to be persisted.
// WARNING: This does not have any transactional semantics:
// - Uploaded data MAY be visible to others before Commit() is called
// - Uploaded data MAY be removed or MAY remain around if Close() is called without Commit() (i.e. rollback is allowed but not guaranteed)
func (d *daemonImageDestination) Commit() error {
	logrus.Debugf("docker-daemon: Closing tar stream")
	if err := d.Destination.Commit(); err != nil {
		return err
	}
	if err := d.writer.Close(); err != nil {
		return err
	}
	d.committed = true // We may still fail, but we are done sending to imageLoadGoroutine.

	logrus.Debugf("docker-daemon: Waiting for status")
	err := <-d.statusChannel
	return err
}


text:
pimcore.registerNS("pimcore.object.importer");
pimcore.object.importer = Class.create({

    initialize: function (parentNode, classId, className) {

        this.parentId = parentNode.id;
        this.parentNode = parentNode;
        this.classId = classId;
        this.className = className;
        this.importId = uniqid();
        this.showUpload();
    },

    showUpload: function () {

        pimcore.helpers.uploadDialog('/admin/object-helper/import-upload/?pimcore_admin_sid='
                        + pimcore.settings.sessionId + "&id=" + this.importId, "Filedata", function(res) {
            this.getFileInfo();
        }.bind(this), function () {
            Ext.MessageBox.alert(t("error"), t("error"));
        });
    },

    getFileInfo: function () {
        Ext.Ajax.request({
            url: "/admin/object-helper/import-get-file-info",
            params: {
                id: this.importId,
                method: "post",
                className: this.className,
                classId: this.classId
            },
            success: this.getFileInfoComplete.bind(this)
        });
    },

    getFileInfoComplete: function (response) {

        var data = Ext.decode(response.responseText);

        if (data.success) {
            this.showDataWindow(data);
        }
        else {
            Ext.MessageBox.alert(t("error"), t("unsupported_filetype"));
        }
    },

    showDataWindow: function (data) {

        this.importJobTotal = data.rows;

        var dataStore = new Ext.data.JsonStore({
            autoDestroy: true,
            data: data,
            root: 'dataPreview',
            fields: data.dataFields
        });

        var dataGridCols = [];
        for (var i = 0; i < data.dataFields.length; i++) {
            dataGridCols.push({header: t("field") + " " + i, sortable: false, dataIndex: data.dataFields[i]});
        }

        var dataGrid = new Ext.grid.GridPanel({
            store: dataStore,
            columns: dataGridCols,
            viewConfig: {
                forceFit: false
            },
            height: 390,
            width: 690,
            autoScroll: true
        });

        var headRecord = dataStore.getAt(0);

        var formPanel = new Ext.form.FormPanel({
            items: [
                {
                    xtype: "checkbox",
                    name: "hasHeadRow",
                    fieldLabel: t("importFileHasHeadRow"),
                    listeners: {
                        check: function(headRecord, dataGrid, checkbox, checked) {
                            var i;
                            if (checked) {
                                dataGrid.store.remove(headRecord);
                                this.importJobTotal = data.rows - 1;
                                this.settingsForm.getForm().findField('skipHeadRow').setValue(true);
                                for (i = 0; i < headRecord.fields.items.length; i++) {
                                    var value = headRecord.get("field_" + i);
                                    dataGrid.getColumnModel().setColumnHeader(i, value);
                                }
                            } else {
                                dataGrid.store.insert(0, headRecord);
                                this.importJobTotal = data.rows;
                                this.settingsForm.getForm().findField('skipHeadRow').setValue(false);
                                for (i = 0; i < headRecord.fields.items.length; i++) {
                                    dataGrid.getColumnModel().setColumnHeader(i, "field_" + i);
                                }
                            }
                            dataGrid.getView().refresh();
                        }.bind(this, headRecord, dataGrid)
                    }
                }
            ],
            labelWidth: 200,
            autoHeight:true,
            bodyStyle: "padding: 10px;"
        });

        var mappingStore = new Ext.data.JsonStore({
            autoDestroy: true,
            data: data,
            root: 'mappingStore',
            fields: ["source", "firstRow", "target"]
        });

        var targetFields = data.targetFields;
        targetFields.push(["",t("ignore")]);

        var sourceFields = [];
        for (i = 0; i < data.cols; i++) {
            sourceFields.push([i,t("field") + " " + i]);
        }

        this.mappingGrid = new Ext.grid.EditorGridPanel({
            store: mappingStore,
            columns: [
                {
                    header: t("source"),sortable: false,
                    dataIndex: "source",
                    renderer: function(value, p, r) {
                        return r.data.source + " (" + r.data.firstRow + ")";
                    }.bind(this)
                    /*,editor: new Ext.form.ComboBox({
                     store: sourceFields,
                     mode: "local",
                     triggerAction: "all"
                     })*/
                },
                {header: t("target"),sortable: false, dataIndex: "target", editor: new Ext.form.ComboBox({
                    store: targetFields,
                    mode: "local",
                    triggerAction: "all"
                })}
            ],
            viewConfig: {
                forceFit: true
            }
        });

        var filenameMappingStore = sourceFields;
        filenameMappingStore.push(["default", "default"]);
        filenameMappingStore.push(["id", "ID"]);

        this.settingsForm = new Ext.form.FormPanel({
            items: [
                {
                    xtype: "combo",
                    name: "filename",
                    store: filenameMappingStore,
                    mode: "local",
                    triggerAction: "all",
                    fieldLabel: t("filename"),
                    value: "default"
                },
                {
                    xtype:'displayfield',
                    value:t("object_import_filename_description"),
                    cls: 'pimcore_extra_label_bottom'
                },
                {
                    xtype: "checkbox",
                    name: "overwrite",
                    fieldLabel: t("overwrite_object_with_same_key")
                },
                {
                    xtype:'displayfield',
                    value:t("overwrite_object_with_same_key_description"),
                    cls: 'pimcore_extra_label_bottom'
                },
                {
                    xtype: "hidden",
                    id: 'skipHeadRow',
                    name: "skipHeadRow",
                    value: false
                }
            ],
            bodyStyle: "padding: 10px;"
        });

        this.dataWin = new Ext.Window({
            modal: true,
            width: 700,
            height: 500,
            layout: "fit",
            items: [
                {
                    xtype: "tabpanel",
                    activeTab: 0,
                    items: [
                        {
                            xtype: "panel",
                            title: t("preview"),
                            layout: "fit",
                            items: [formPanel,dataGrid]
                        },
                        {
                            xtype: "panel",
                            title: t("data_mapping"),
                            layout: "fit",
                            items: [this.mappingGrid]
                        },
                        {
                            xtype: "panel",
                            title: t("settings"),
                            layout: "fit",
                            items: [this.settingsForm],
                            buttons: [
                                {
                                    text: t("import"),
                                    handler: this.importStart.bind(this)
                                }
                            ]
                        }
                    ]
                }
            ],
            title: t("import")
        });

        this.dataWin.show();
    },

    importStart: function () {

        // get mapping
        var data = this.mappingGrid.getStore().queryBy(function(record, id) {
            return true;
        });

        var mappingData = [];
        var tmData = [];
        for (var i = 0; i < data.items.length; i++) {
            tmData = [];

            var keys = Object.keys(data.items[i].data);
            for (var u = 0; u < keys.length; u++) {
                tmData.push(data.items[i].data[keys[u]]);
            }
            mappingData.push(tmData);
        }

        this.jobRequest = {
            mapping: Ext.encode(mappingData),
            id: this.importId,
            className: this.className,
            classId: this.classId,
            job: 1,
            parentId: this.parentId
        };

        this.jobRequest = mergeObject(this.jobRequest, this.settingsForm.getForm().getFieldValues());

        this.dataWin.close();

        this.importProgressBar = new Ext.ProgressBar({
            text: t('Initializing'),
            style: "margin: 10px;",
            width: 500
        });

        this.importProgressWin = new Ext.Window({
            items: [this.importProgressBar],
            modal: true,
            bodyStyle: "background: #fff;",
            closable: false
        });
        this.importProgressWin.show();

        this.importErrors = [];
        this.importJobCurrent = 1;

        window.setTimeout(function() {
            this.importProcess();
        }.bind(this), 1000);

        // get mapping
    },

    importProcess: function () {

        if (this.importJobCurrent > this.importJobTotal) {
            this.importProgressWin.close();

            // error handling
            if (this.importErrors.length > 0) {

                var jobs = [];
                for (var i = 0; i < this.importErrors.length; i++) {
                    jobs.push(this.importErrors[i].job);
                }
                Ext.Msg.alert(t("error"), t("error_jobs") + ": " + jobs.join(","));
            }

            this.parentNode.reload();

            return;
        }

        var status = (this.importJobCurrent / this.importJobTotal);
        var percent = Math.ceil(status * 100);
        this.importProgressBar.updateProgress(status, percent + "%");

        this.jobRequest.job = this.importJobCurrent;
        Ext.Ajax.request({
            url: "/admin/object-helper/import-process",
            params: this.jobRequest,
            method: "post",
            success: function (response) {

                var rdata = Ext.decode(response.responseText);
                if (rdata) {
                    if (!rdata.success) {
                        this.importErrors.push({
                            job: rdata.message
                        });
                    }
                }
                else {
                    this.importErrors.push({
                        job: response.request.parameters.job
                    });
                }

                window.setTimeout(function() {
                    this.importJobCurrent++;
                    this.importProcess();
                }.bind(this), 400);
            }.bind(this)
        });
    }
});


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.groovy.refactoring.rename;

import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.refactoring.rename.RenameJavaClassProcessor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement;

import java.util.Collection;

/**
 * @author Maxim.Medvedev
 */
public class RenameAliasImportedClassProcessor extends RenameJavaClassProcessor {
  @Override
  public boolean canProcessElement(@NotNull PsiElement element) {
    return element instanceof GroovyPsiElement && super.canProcessElement(element);
  }

  @NotNull
  @Override
  public Collection<PsiReference> findReferences(@NotNull PsiElement element) {
    return RenameAliasedUsagesUtil.filterAliasedRefs(super.findReferences(element), element);
  }
}


text:
import json
import random
import re
import requests
import time
import xml.dom.minidom

class ClientException(Exception):
    pass

class Client(object):
    """
    Call APIs for WeChat Group
        login
        send_message_to_group
        send_message_to_groups
        send_messages_to_group
        send_messages_to_groups
        receive_message_from_group
        receive_messages_from_group
        receive_messages_from_groups
    """
    def __init__(self):
        self.session = requests.Session()
        self.host = 'https://wx.qq.com'
        self.login_host = 'https://login.weixin.qq.com'
        self.webpush_host = 'https://webpush.weixin.qq.com'
        self.device_id = "e{0}".format(random.randint(100000000000000, 1000000000000000))
        self.uuid = None
        self.wxuin = None
        self.wxsid = None
        self.pass_ticket = None
        self.skey = None

    def get_uuid(self):
        uri = ''.join([self.login_host, '/jslogin'])
        params = {
            'appid': 'wx782c26e4c19acffb',
            'redirect_uri': 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage',
            'fun': 'new',
            'lang': 'zh_CN',
            '_': int(time.time())
        }
        r = self.session.get(uri, params=params)
        if r.status_code == 200:
            return self.text_to_dict(r.text.encode('utf8'))['window.QRLogin.uuid']
        else:
            raise ClientException("Status code is {0}".format(r.status_code))

    def get_qrcode_uri(self):
        self.uuid = self.get_uuid()
        return "{0}/qrcode/{1}".format(self.login_host, self.uuid)

    def get_login_uri(self):
        uri = ''.join([self.login_host, '/cgi-bin/mmwebwx-bin/login'])
        r = self.session.get('{0}?loginicon=true&uuid={1}&tip=0&_={2}'.format(uri, self.uuid, int(time.time())))
        if r.status_code == 200:
            response = self.text_to_dict(r.text.encode('utf8'))
            window_code = response['window.code']
            if window_code == '200':
                return response['window.redirect_uri']
            else:
                return ""
        else:
            raise ClientException("Status code is {0}".format(r.status_code))

    def login(self, login_uri):
        r = self.session.get(login_uri)
        with open("login", "w") as f:
            f.write(r.text.encode('utf8'))
        cookies = self.session.cookies
        self.wxuin = cookies['wxuin']
        self.wxsid = cookies['wxsid']
        # returns pass_ticket and skey before redirecting
        xml_string = r.history[0].text.encode('utf8')
        doc = xml.dom.minidom.parseString(xml_string)
        node = doc.getElementsByTagName("pass_ticket")[0]
        self.pass_ticket = node.childNodes[0].nodeValue
        node = doc.getElementsByTagName("skey")[0]
        self.skey = node.childNodes[0].nodeValue

    def webwx_stat_report(self):
        uri = '{0}/cgi-bin/mmwebwx-bin/webwxstatreport'.format(self.host)
        params = {
            'fun': 'new'
        }

    def wx_init(self):
        uri = '{0}/cgi-bin/mmwebwx-bin/webwxinit'.format(self.host)
        params = {
            'pass_ticket': self.pass_ticket
        }
        data = {
            "BaseRequest": {
                "Uin": self.wxuin,
                "Sid": self.wxsid,
                "Skey": self.skey,
                "DeviceID": self.device_id
            }
        }
        r = self.session.post(uri, params=params, data=json.dumps(data))
        response_json = r.json()
        synckey = response_json['SyncKey']
        synckey_list = list()
        for item in synckey['List']:
            key = item['Key']
            value = item['Val']
            synckey_list.append('{0}_{1}'.format(key,value))
        self.synckey = '|'.join(synckey_list)

    def webwx_get_contact(self):
        uri = '{0}/cgi-bin/mmwebwx-bin/webwxgetcontact'.format(self.host)
        params = {
            'pass_ticket': self.pass_ticket,
            'skey': self.skey,
            'r': int(time.time())
        }
        r = self.session.get(uri, params=params)
        response_json = r.json()
        with open('contact','w') as f:
            f.write(r.text.encode('utf8'))

    def sync_check(self):
        uri = '{0}/cgi-bin/mmwebwx-bin/synccheck'.format(self.webpush_host)
        params = {
            'skey': self.skey,
            'sid': self.wxsid,
            'uin': self.wxuin,
            'deviceid': self.device_id,
            'synckey': self.synckey,
            '_': int(time.time())
        }
        r = self.session.get(uri, params=params)
        response_json = r.json()
        with open('synccheck','w') as f:
            f.write(r.text.encode('utf8'))
        # TODO
        window.synccheck={retcode:"0",selector:"2"}

    def webwx_sync(self):
        uri = '{0}/cgi-bin/mmwebwx-bin/webwxsync'.format(self.host)
        params = {
            'sid': self.wxsid,
            'skey': self.skey,
            'pass_ticket': self.pass_ticket
        }
        # TODO
        r = self.session.get(uri, params=params)
        response_json = r.json()
        with open('webwxsync','w') as f:
            f.write(r.text.encode('utf8'))

    def send_message_to_group(self, msg, group):
        pass

    def text_to_dict(self, text):
        ret = dict()
        for line in text.split(';'):
            if line:
                [key, __, value] = line.partition('=')
                ret[key.strip().strip('"')] = value.strip().strip('"')
        return ret

if __name__ == "__main__":
    client = Client()
    print client.get_qrcode_uri()
    redirect_uri = ''
    while not redirect_uri:
        print "polling"
        redirect_uri = client.get_login_uri()
        time.sleep(5)
    print redirect_uri
    client.login(redirect_uri)
    client.wx_init()
    client.webwx_get_contact()
    client.sync_check()
    client.webwx_sync()


text:
get '/comment/:id' do
  @cur_comment = Comment.find_by(id: params[:id])

  if @cur_comment
    erb :'comment/edit'
  else
    [404, "no comment found"]
  end
end

post '/perspective/:id/comments' do
  new_comment = Comment.new(title: params[:title],
                            content: params[:content],
                            perspective: Perspective.find_by(id: params[:id]))

  if new_comment.save
    redirect "/perspective/#{params[:id]}"
  else
    [402, "You did something wrong"]
  end
end

put '/comment/:id' do
  cur_comment = Comment.find_by(id: params[:id])
  perspective_id = cur_comment.perspective_id
  if cur_comment
    cur_comment.title = params[:title]
    cur_comment.content = params[:content]
    if cur_comment.save
      redirect "/perspective/#{perspective_id}"
    else
      [500, "didn't update"]
    end
  else
    [404, "no comment found"]
  end
end

delete '/perspective/:id/comment/:id' do
  cur_comment = Comment.find_by(id: params[:id])
  perspective_id = cur_comment.perspective_id
  if cur_comment
    if cur_comment.destroy
      redirect "/perspective/#{perspective_id}"
    else
      [500, "didn't delete"]
    end
  else
    [404, "no comment found"]
  end
end


text:
namespace dlib
{

// ----------------------------------------------------------------------------------------

    multithreaded_object::
    multithreaded_object (
    ):
        s(m_),
        is_running_(false),
        should_stop_(false),
        threads_started(0)
    {
    }

// ----------------------------------------------------------------------------------------

    multithreaded_object::
    ~multithreaded_object (
    )
    {
        DLIB_ASSERT(number_of_threads_alive() == 0,
               "\tmultithreaded_object::~multithreaded_object()"
               << "\n\tYou have let a multithreaded object destruct itself before terminating its threads"
               << "\n\tthis: " << this
        );
    }

// ----------------------------------------------------------------------------------------

    void multithreaded_object::
    clear (
    )
    {
        auto_mutex M(m_);
        stop();
        wait();
        dead_threads.clear();
        is_running_ = false;
        should_stop_ = false;
    }

// ----------------------------------------------------------------------------------------

    bool multithreaded_object::
    is_running (
    ) const
    {
        auto_mutex M(m_);
        return is_running_;
    }

// ----------------------------------------------------------------------------------------

    unsigned long multithreaded_object::
    number_of_threads_registered (
    ) const
    {
        auto_mutex M(m_);
        return thread_ids.size() + dead_threads.size();
    }

// ----------------------------------------------------------------------------------------

    unsigned long multithreaded_object::
    number_of_threads_alive (
    ) const
    {
        auto_mutex M(m_);
        return threads_started;
    }

// ----------------------------------------------------------------------------------------

    void multithreaded_object::
    wait (
    ) const
    {
        auto_mutex M(m_);

        DLIB_ASSERT(thread_ids.is_in_domain(get_thread_id()) == false,
               "\tvoid multithreaded_object::wait()"
               << "\n\tYou can NOT call this function from one of the threads registered in this object"
               << "\n\tthis: " << this
        );

        while (threads_started > 0)
            s.wait();
    }

// ----------------------------------------------------------------------------------------

    void multithreaded_object::
    start (
    )
    {
        auto_mutex M(m_);
        const unsigned long num_threads_registered = dead_threads.size() + thread_ids.size();
        // start any dead threads
        for (unsigned long i = threads_started; i < num_threads_registered; ++i)
        {
            if (create_new_thread<multithreaded_object,&multithreaded_object::thread_helper>(*this) == false)
            {
                should_stop_ = true;
                is_running_ = false;
                throw thread_error();
            }
            ++threads_started;
        }
        is_running_ = true;
        should_stop_ = false;
        s.broadcast();
    }

// ----------------------------------------------------------------------------------------

    void multithreaded_object::
    pause (
    )
    {
        auto_mutex M(m_);
        is_running_ = false;
    }

// ----------------------------------------------------------------------------------------

    void multithreaded_object::
    stop (
    )
    {
        auto_mutex M(m_);
        should_stop_ = true;
        is_running_ = false;
        s.broadcast();
    }

// ----------------------------------------------------------------------------------------

    bool multithreaded_object::
    should_stop (
    ) const
    {
        auto_mutex M(m_);
        DLIB_ASSERT(thread_ids.is_in_domain(get_thread_id()),
               "\tbool multithreaded_object::should_stop()"
               << "\n\tYou can only call this function from one of the registered threads in this object"
               << "\n\tthis: " << this
        );
        while (is_running_ == false && should_stop_ == false)
            s.wait();
        return should_stop_;
    }

// ----------------------------------------------------------------------------------------

    multithreaded_object::raii_thread_helper::
    raii_thread_helper(
        multithreaded_object& self_,
        thread_id_type id_
    ) : self(self_), id(id_){}

    multithreaded_object::raii_thread_helper::
    ~raii_thread_helper()
    {
        auto_mutex M(self.m_);
        if (self.thread_ids.is_in_domain(id))
        {
            mfp temp;
            thread_id_type id_temp;
            self.thread_ids.remove(id,id_temp,temp);
            // put this thread's registered function back into the dead_threads queue
            self.dead_threads.enqueue(temp);
        }

        --self.threads_started;
        // If this is the last thread to terminate then
        // signal that that is the case.
        if (self.threads_started == 0)
        {
            self.is_running_ = false;
            self.should_stop_ = false;
            self.s.broadcast();
        }
    }

// ----------------------------------------------------------------------------------------

    void multithreaded_object::
    thread_helper(
    )
    {
        mfp mf;
        thread_id_type id = get_thread_id();

        // this guy's destructor does all the necessary cleanup in this function
        raii_thread_helper raii(*this, id);

        // if there is a dead_thread sitting around then pull it
        // out and put it into mf
        {
            auto_mutex M(m_);
            if (dead_threads.size() > 0)
            {
                dead_threads.dequeue(mf);
                mfp temp(mf);
                thread_ids.add(id,temp);
            }
        }

        if (mf.is_set())
        {
            // call the registered thread function
            mf();
        }
    }

// ----------------------------------------------------------------------------------------

}

#endif // DLIB_MULTITHREADED_OBJECT_EXTENSIOn_CPP


text:
#include <ctype.h>
#include "common.h"
#include "options.h"
#include "linefile.h"
#include "jksql.h"
#include "hdb.h"
#include "hash.h"
#include "ra.h"
#include "dirent.h"
#include "../inc/MLmatrix.h"
#include "../inc/MLcrossValidation.h"
#include "../inc/MLreadConfig.h"
#include "../inc/MLio.h"
#include "../inc/MLfilters.h"

char * profile = "localDb";
char * db = "bioInt";

void usage()
{
errAbort(	"Usage: ./MLgetCoefficients [config]\n");
}

int main(int argc, char *argv[])
/* Process command line. */
{
if(argc != 2)
	usage();
char * configFile=argv[1];
struct hash * config = raReadSingle(configFile);
matrix * coefficients = extractCoefficients(config);
if(coefficients)
	{
	fprint_matrix(stdout, coefficients);
	free_matrix(coefficients);
	}
else
	fprintf(stderr, "Model type doesn't support linear coefficients.\n");
return 0;
}


text:
package org.bsworks.x2.services.monitor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Application error context.
 *
 * @author Lev Himmelfarb
 */
public class ApplicationErrorContext
	implements Serializable {

	/**
	 * Serial version id.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Process name.
	 */
	private final String processName;

	/**
	 * Context sections.
	 */
	private final List<ApplicationErrorContextSection> sections =
		new ArrayList<>();

	/**
	 * Read-only view of the context sections.
	 */
	private final List<ApplicationErrorContextSection> sectionsRO =
		Collections.unmodifiableList(this.sections);

	/**
	 * Create new empty context.
	 */
	public ApplicationErrorContext() {

		this.processName = Thread.currentThread().getName();
	}

	/**
	 * Add context properties section.
	 *
	 * @param title Section title.
	 *
	 * @return The new section with no properties associated with it.
	 */
	public ApplicationErrorContextSection addSection(final String title) {

		final ApplicationErrorContextSection section =
			new ApplicationErrorContextSection(title);
		this.sections.add(section);

		return section;
	}

	/**
	 * Get name of the internal process, in which the error happened. The
	 * process name is the name of the thread, that called the context
	 * constructor.
	 *
	 * @return The process name.
	 */
	public String getProcessName() {

		return this.processName;
	}

	/**
	 * Get context sections.
	 *
	 * @return Unmodifiable list of the sections.
	 */
	public List<ApplicationErrorContextSection> getSections() {

		return this.sectionsRO;
	}
}


text:
import * as wasm from "wasm-game-of-life";

wasm.greet("Mozart");


text:
<?php

class FoundModel extends CommonModel{
    protected $pk   = 'found_id';
    protected $tableName =  'found';

}


text:
<?php

namespace Pathetic\TgBot\Types;

class UserProfilePhotos
{
    use \Pathetic\TgBot\TypeInitialization, \Pathetic\TgBot\PropertiesEasyAccess;

    /**
     * Total number of profile pictures the target user has.
     *
     * @var integer
     */
    public $total_count;

    /**
     * Requested profile pictures (in up to 4 sizes each).
     *
     * @var array
     */
    public $photos;
}


text:
// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

var XPInstallConfirm = {};

XPInstallConfirm.init = function XPInstallConfirm_init()
{
  Components.utils.import("resource://gre/modules/AddonManager.jsm");

  var _installCountdown;
  var _installCountdownInterval;
  var _focused;
  var _timeout;

  // Default to cancelling the install when the window unloads
  XPInstallConfirm._installOK = false;

  var bundle = document.getElementById("xpinstallConfirmStrings");

  let args = window.arguments[0].wrappedJSObject;

  // If all installs have already been cancelled in some way then just close
  // the window
  if (args.installs.every(i => i.state != AddonManager.STATE_DOWNLOADED)) {
    window.close();
    return;
  }

  var _installCountdownLength = 5;
  try {
    var prefs = Components.classes["@mozilla.org/preferences-service;1"]
                          .getService(Components.interfaces.nsIPrefBranch);
    var delay_in_milliseconds = prefs.getIntPref("security.dialog_enable_delay");
    _installCountdownLength = Math.round(delay_in_milliseconds / 500);
  } catch (ex) { }

  var itemList = document.getElementById("itemList");

  let installMap = new WeakMap();
  let installListener = {
    onDownloadCancelled: function(install) {
      itemList.removeChild(installMap.get(install));
      if (--numItemsToInstall == 0)
        window.close();
    }
  };

  var numItemsToInstall = args.installs.length;
  for (let install of args.installs) {
    var installItem = document.createElement("installitem");
    itemList.appendChild(installItem);

    installItem.name = install.addon.name;
    installItem.url = install.sourceURI.spec;
    var icon = install.iconURL;
    if (icon)
      installItem.icon = icon;
    var type = install.type;
    if (type)
      installItem.type = type;
    if (install.certName) {
      installItem.cert = bundle.getFormattedString("signed", [install.certName]);
    }
    else {
      installItem.cert = bundle.getString("unverified");
    }
    installItem.signed = install.certName ? "true" : "false";

    installMap.set(install, installItem);
    install.addListener(installListener);
  }

  var introString = bundle.getString("itemWarnIntroSingle");
  if (numItemsToInstall > 4)
    introString = bundle.getFormattedString("itemWarnIntroMultiple", [numItemsToInstall]);
  var textNode = document.createTextNode(introString);
  var introNode = document.getElementById("itemWarningIntro");
  while (introNode.hasChildNodes())
    introNode.removeChild(introNode.firstChild);
  introNode.appendChild(textNode);

  var okButton = document.documentElement.getButton("accept");
  okButton.focus();

  function okButtonCountdown() {
    _installCountdown -= 1;

    if (_installCountdown < 1) {
      okButton.label = bundle.getString("installButtonLabel");
      okButton.disabled = false;
      clearInterval(_installCountdownInterval);
    }
    else
      okButton.label = bundle.getFormattedString("installButtonDisabledLabel", [_installCountdown]);
  }

  function myfocus() {
    // Clear the timeout if it exists so only the last one will be used.
    if (_timeout)
      clearTimeout(_timeout);

    // Use setTimeout since the last focus or blur event to fire is the one we
    // want
    _timeout = setTimeout(setWidgetsAfterFocus, 0);
  }

  function setWidgetsAfterFocus() {
    if (_focused)
      return;

    _installCountdown = _installCountdownLength;
    _installCountdownInterval = setInterval(okButtonCountdown, 500);
    okButton.label = bundle.getFormattedString("installButtonDisabledLabel", [_installCountdown]);
    _focused = true;
  }

  function myblur() {
    // Clear the timeout if it exists so only the last one will be used.
    if (_timeout)
      clearTimeout(_timeout);

    // Use setTimeout since the last focus or blur event to fire is the one we
    // want
    _timeout = setTimeout(setWidgetsAfterBlur, 0);
  }

  function setWidgetsAfterBlur() {
    if (!_focused)
      return;

    // Set _installCountdown to the inital value set in setWidgetsAfterFocus
    // plus 1 so when the window is focused there is immediate ui feedback.
    _installCountdown = _installCountdownLength + 1;
    okButton.label = bundle.getFormattedString("installButtonDisabledLabel", [_installCountdown]);
    okButton.disabled = true;
    clearInterval(_installCountdownInterval);
    _focused = false;
  }

  function myUnload() {
    if (_installCountdownLength > 0) {
      document.removeEventListener("focus", myfocus, true);
      document.removeEventListener("blur", myblur, true);
    }
    window.removeEventListener("unload", myUnload, false);

    for (let install of args.installs)
      install.removeListener(installListener);

    // Now perform the desired action - either install the
    // addons or cancel the installations
    if (XPInstallConfirm._installOK) {
      for (let install of args.installs)
        install.install();
    }
    else {
      for (let install of args.installs) {
        if (install.state != AddonManager.STATE_CANCELLED)
          install.cancel();
      }
    }
  }

  window.addEventListener("unload", myUnload, false);

  if (_installCountdownLength > 0) {
    document.addEventListener("focus", myfocus, true);
    document.addEventListener("blur", myblur, true);

    okButton.disabled = true;
    setWidgetsAfterFocus();
  }
  else
    okButton.label = bundle.getString("installButtonLabel");
}

XPInstallConfirm.onOK = function XPInstallConfirm_onOk()
{
  Components.classes["@mozilla.org/base/telemetry;1"].
    getService(Components.interfaces.nsITelemetry).
    getHistogramById("SECURITY_UI").
    add(Components.interfaces.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH);
  // Perform the install or cancel after the window has unloaded
  XPInstallConfirm._installOK = true;
  return true;
}

XPInstallConfirm.onCancel = function XPInstallConfirm_onCancel()
{
  // Perform the install or cancel after the window has unloaded
  XPInstallConfirm._installOK = false;
  return true;
}


text:
<#
.SYNOPSIS
Install required Windows Features for BizTalk
.DESCRIPTION
This script installs required Windows Features for BizTalk
.EXAMPLE
./BizTalkWindowsFeatures.ps1
.NOTES
Run the script on the server that requires the features
#>
cls
Set-ExecutionPolicy RemoteSigned

# Vish: Windows installation media path changed to empty
# checked that this worked during manual install
$AlternateSourcePath = ""

# Create the Servicing Registry Key and LocalSourcePath String Value
New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Servicing -Force
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Servicing -Name "LocalSourcePath" -Value $AlternateSourcePath -Force

Write-Host("")
Write-Host("Installing Windows Features...") -Fore Green

# Install required Windows Features
Import-Module ServerManager
Install-WindowsFeature -name FS-FileServer
Install-WindowsFeature -name Storage-Services
Install-WindowsFeature -name Web-Default-Doc
Install-WindowsFeature -name Web-Dir-Browsing
Install-WindowsFeature -name Web-Http-Errors
Install-WindowsFeature -name Web-Static-Content
Install-WindowsFeature -name Web-Http-Logging
Install-WindowsFeature -name Web-Log-Libraries
Install-WindowsFeature -name Web-ODBC-Logging
Install-WindowsFeature -name Web-Request-Monitor
Install-WindowsFeature -name Web-Http-Tracing
Install-WindowsFeature -name Web-Stat-Compression
Install-WindowsFeature -name Web-Dyn-Compression
Install-WindowsFeature -name Web-Filtering
Install-WindowsFeature -name Web-Basic-Auth
Install-WindowsFeature -name Web-Digest-Auth
Install-WindowsFeature -name Web-Windows-Auth

Install-WindowsFeature -name Web-App-Dev -IncludeAllSubFeature
Install-WindowsFeature -name Web-Mgmt-Tools -IncludeAllSubFeature

Install-WindowsFeature -name NET-Framework-Core
Install-WindowsFeature -name NET-Framework-45-Core
Install-WindowsFeature -name NET-Framework-45-ASPNET
Install-WindowsFeature -name NET-WCF-HTTP-Activation45
Install-WindowsFeature -name NET-WCF-TCP-PortSharing45
Install-WindowsFeature -name RDC
Install-WindowsFeature -name RSAT-AD-PowerShell
Install-WindowsFeature -name RSAT-AD-AdminCenter
Install-WindowsFeature -name RSAT-ADDS-Tools
Install-WindowsFeature -name RSAT-ADLDS
Install-WindowsFeature -name FS-SMB1
Install-WindowsFeature -name PowerShell
Install-WindowsFeature -name PowerShell-V2
Install-WindowsFeature -name PowerShell-ISE
Install-WindowsFeature -name WAS-Process-Model
Install-WindowsFeature -name WAS-Config-APIs
Install-WindowsFeature -name WoW64-Support


text:
import { Component } from '@angular/core';
import { BoxComposerStore } from '../../box-composer.store';

export interface IClothingPiece {
  name: string;
  selected?: boolean;
  gender?: string;
  averageSpending?: number;
}

@Component({
  selector: 'option-clothing-piece',
  templateUrl: 'option-clothing-piece.component.html'
})
export class OptionClothingPieceComponent {
  clothingPieceList: Array<IClothingPiece>;

  constructor(private boxComposerStore: BoxComposerStore) {
    this.clothingPieceList = this.boxComposerStore.getClothingPieces();
  }

  select(clothingPiece: IClothingPiece) {
    clothingPiece.selected = (clothingPiece.selected) ? false : true;
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <dimen name="emoji_size">45dp</dimen>
    <dimen name="sticker_size">66dp</dimen>
    <dimen name="smiles_button_size">40dp</dimen>
    <dimen name="send_button_size">40dp</dimen>
    <dimen name="edit_text_max_height">40dp</dimen>
    <dimen name="button_margin_3dp">3dp</dimen>
    <dimen name="button_padding_7dp">7dp</dimen>

    <dimen name="keyboard_padding">14dp</dimen>
    <dimen name="keyboard_margin">5dp</dimen>
</resources>


text:
using System;
using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;

namespace Shouldly.Tests.ShouldNotThrow
{
    [TestFixture]
    public class TaskWithTimeoutScenario
    {
        [Test]
        public void ShouldThrowAWobbly()
        {
            var task = Task.Factory.StartNew(() => { Thread.Sleep(5000); },
                CancellationToken.None, TaskCreationOptions.None,
                TaskScheduler.Default);

            var ex = Should.Throw<ShouldCompleteInException>(() => task.ShouldNotThrow(TimeSpan.FromSeconds(0.5), "Some additional context"));
            ex.Message.ShouldContainWithoutWhitespace(ChuckedAWobblyErrorMessage);
        }

        protected string ChuckedAWobblyErrorMessage
        {
            get
            {
                return @"
    Task
        should complete in
    00:00:00.5000000
        but did not
    Additional Info:
    Some additional context";
            }
        }

        [Test]
        public void ShouldPass()
        {
            var task = Task.Factory.StartNew(() => { },
                CancellationToken.None, TaskCreationOptions.None,
                TaskScheduler.Default);

            task.ShouldNotThrow(TimeSpan.FromSeconds(2));
        }
    }
}
#endif


text:
using System.Threading.Tasks;
using Nethereum.BlockchainProcessing.BlockStorage.Entities;
using Nethereum.Hex.HexTypes;

namespace Nethereum.BlockchainProcessing.BlockStorage.Repositories
{
    public interface IBlockRepository
    {
        Task UpsertBlockAsync(Nethereum.RPC.Eth.DTOs.Block source);
        Task<IBlockView> FindByBlockNumberAsync(HexBigInteger blockNumber);
    }
}


text:
package bitrise

import (
	"bytes"
	"errors"
	"os"
	"strings"
	"text/template"

	"github.com/bitrise-io/bitrise/models"
	"github.com/bitrise-io/goinp/goinp"
)

var (
	templateFuncMap = template.FuncMap{
		"getenv": func(key string) string {
			return os.Getenv(key)
		},
		"enveq": func(key, expectedValue string) bool {
			return (os.Getenv(key) == expectedValue)
		},
	}
)

// TemplateDataModel ...
type TemplateDataModel struct {
	BuildResults  models.BuildRunResultsModel
	IsBuildFailed bool
	IsCI          bool
	IsPR          bool
	PullRequestID string
}

func createTemplateDataModel(buildResults models.BuildRunResultsModel) TemplateDataModel {
	pullReqID := os.Getenv(PullRequestIDEnvKey)
	isCI := (os.Getenv(CIModeEnvKey) == "true")
	return TemplateDataModel{
		BuildResults:  buildResults,
		IsBuildFailed: buildResults.IsBuildFailed(),
		IsCI:          isCI,
		PullRequestID: pullReqID,
		IsPR:          (pullReqID != ""),
	}
}

// EvaluateStepTemplateToBool ...
func EvaluateStepTemplateToBool(expStr string, buildResults models.BuildRunResultsModel) (bool, error) {
	if expStr == "" {
		return false, errors.New("EvaluateStepTemplateToBool: Invalid, empty input: expStr")
	}

	if !strings.Contains(expStr, "{{") {
		expStr = "{{" + expStr + "}}"
	}

	tmpl := template.New("EvaluateStepTemplateToBool").Funcs(templateFuncMap)
	tmpl, err := tmpl.Parse(expStr)
	if err != nil {
		return false, err
	}

	templateData := createTemplateDataModel(buildResults)
	var resBuffer bytes.Buffer
	if err := tmpl.Execute(&resBuffer, templateData); err != nil {
		return false, err
	}
	resString := resBuffer.String()

	return goinp.ParseBool(resString)
}