text:
[![Gem Version](https://badge.fury.io/rb/middleman-favicon-maker.svg)](http://badge.fury.io/rb/middleman-favicon-maker)
[![Code Climate](https://codeclimate.com/github/follmann/middleman-favicon-maker.png)](https://codeclimate.com/github/follmann/middleman-favicon-maker)

[FaviconMaker](https://github.com/follmann/favicon_maker) is a gem which generates favicon files in various sizes from a base image. This gem integrates FaviconMaker effortlessly into your [Middleman](https://github.com/middleman/middleman) project.

## Installation

### Dependencies

Before you can use FaviconMaker, you need to install [ImageMagick](http://www.imagemagick.org/script/index.php). On OS X, the easiest way to do this is to run:

``` shell
brew install imagemagick
```

### Using Bundler

``` ruby
gem "middleman-favicon-maker", "~> 3.7"
```

If you're using Middleman version 2.x, use version 0.0.6 of middleman-favicon-maker.

## Integrating with Middleman
### Templates
Create an image e.g. named `_favicon_template.png` and place it in your source directory. The leading underscore prevents it from being copied into the build directory. Ideally, this image's dimensions would be 152 x 152 or have multiple templates for different ranges (small, medium, big). In your config.rb, extend the `configure :build` block. The image formats used for templates should be either PNG or SVG (since v3.6).

### Simple config
This config assumes that a PNG file named `_favicon_template.png` lives in the source folder. The generated icons are stored in the build folder root.

``` ruby
configure :build do
  ...
  activate :favicon_maker, :icons => {
    "_favicon_template.png" => [
      { icon: "apple-touch-icon-152x152-precomposed.png" },
      { icon: "apple-touch-icon-114x114-precomposed.png" },
      { icon: "apple-touch-icon-72x72-precomposed.png" },
    ]
  }
  ...
end
```

### Advanced config
Using all configuration options. The `template_dir` and `output_dir` point to source and build dir if not set, you can use absolute or relative paths. You can use multiple template files that suit the different resolutions better. `format` and `size` are optional and only required when the size of the icon and/or the file format is not encoded in the filename. Multiple resolutions in one file is only supported for the .ico format.

``` ruby
configure :build do
  ...
  activate :favicon_maker do |f|
    f.template_dir  = 'source/images'
    f.icons = {
      "_favicon_template_hires.png" => [
        { icon: "apple-touch-icon-152x152-precomposed.png" },
        { icon: "apple-touch-icon-114x114-precomposed.png" },
        { icon: "apple-touch-icon-72x72-precomposed.png" },
        { icon: "mstile-144x144", format: :png },
      ],
      "_favicon_template_lores.png" => [
        { icon: "favicon.png", size: "16x16" },
        { icon: "favicon.ico", size: "64x64,32x32,24x24,16x16" },
      ]
    }
  end
  ...
end
```

### List of icons you might be interested in
This is a moving target. Feel free to extend it and submit the change.

``` ruby
  [
    { icon: "apple-touch-icon-152x152-precomposed.png" },             # Same as apple-touch-icon-57x57.png, for retina iPad with iOS7.
    { icon: "apple-touch-icon-144x144-precomposed.png" },             # Same as apple-touch-icon-57x57.png, for retina iPad with iOS6 or prior.
    { icon: "apple-touch-icon-120x120-precomposed.png" },             # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS7.
    { icon: "apple-touch-icon-114x114-precomposed.png" },             # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS6 or prior.
    { icon: "apple-touch-icon-76x76-precomposed.png" },               # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS7.
    { icon: "apple-touch-icon-72x72-precomposed.png" },               # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS6 or prior.
    { icon: "apple-touch-icon-60x60-precomposed.png" },               # Same as apple-touch-icon-57x57.png, for non-retina iPhone with iOS7.
    { icon: "apple-touch-icon-57x57-precomposed.png" },               # iPhone and iPad users can turn web pages into icons on their home screen. Such link appears as a regular iOS native application. When this happens, the device looks for a specific picture. The 57x57 resolution is convenient for non-retina iPhone with iOS6 or prior. Learn more in Apple docs.
    { icon: "apple-touch-icon-precomposed.png", size: "57x57" },      # Same as apple-touch-icon.png, expect that is already have rounded corners (but neither drop shadow nor gloss effect).
    { icon: "apple-touch-icon.png", size: "57x57" },                  # Same as apple-touch-icon-57x57.png, for "default" requests, as some devices may look for this specific file. This picture may save some 404 errors in your HTTP logs. See Apple docs
    { icon: "favicon-196x196.png" },                                  # For Android Chrome M31+.
    { icon: "favicon-160x160.png" },                                  # For Opera Speed Dial (up to Opera 12; this icon is deprecated starting from Opera 15), although the optimal icon is not square but rather 256x160. If Opera is a major platform for you, you should create this icon yourself.
    { icon: "favicon-96x96.png" },                                    # For Google TV.
    { icon: "favicon-32x32.png" },                                    # For Safari on Mac OS.
    { icon: "favicon-16x16.png" },                                    # The classic favicon, displayed in the tabs.
    { icon: "favicon.png", size: "16x16" },                           # The classic favicon, displayed in the tabs.
    { icon: "favicon.ico", size: "64x64,32x32,24x24,16x16" },         # Used by IE, and also by some other browsers if we are not careful.
    { icon: "mstile-70x70.png", size: "70x70" },                      # For Windows 8 / IE11.
    { icon: "mstile-144x144.png", size: "144x144" },
    { icon: "mstile-150x150.png", size: "150x150" },
    { icon: "mstile-310x310.png", size: "310x310" },
    { icon: "mstile-310x150.png", size: "310x150" }
  ]
```

## Markup meta links

Specifying meta links is only necessary if you want to support non-iOS devices. Safari mobile will automatically look for the icon files in the root directory. If you'd like to know more about how this works, check out this great blog post: [Everything you always wanted to know about touch icons](http://mathiasbynens.be/notes/touch-icons)

### HTML

``` html
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="apple-touch-icon-152x152-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png" />
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png" />
<link rel="shortcut icon" href="favicon.png" />
<link rel="icon" type="image/ico" href="favicon.ico" />
```

### HAML

``` haml
%link{ rel: "apple-touch-icon", sizes: "152x152", href: "apple-touch-icon-152x152-precomposed.png" }
%link{ rel: "apple-touch-icon", sizes: "144x144", href: "apple-touch-icon-144x144-precomposed.png" }
%link{ rel: "apple-touch-icon", sizes: "114x114", href: "apple-touch-icon-114x114-precomposed.png" }
%link{ rel: "apple-touch-icon", sizes: "72x72", href: "apple-touch-icon-72x72-precomposed.png" }
%link{ rel: "apple-touch-icon", href: "apple-touch-icon-precomposed.png" }
%link{ rel: "shortcut icon", href: "favicon.png" }
%link{ rel: "icon", type: "image/ico", href: "favicon.ico" }
```
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Copyright

© 2011-2014 Andreas Follmann. See LICENSE for details.


text:
package jenkins.security;

import org.junit.rules.ExternalResource;

import org.junit.rules.TemporaryFolder;

/**
 * Test rule that injects a temporary {@link DefaultConfidentialStore}
 * @author Kohsuke Kawaguchi
 */
public class ConfidentialStoreRule extends ExternalResource {
    private final TemporaryFolder tmp = new TemporaryFolder();

    @Override
    protected void before() throws Throwable {
        tmp.create();
        ConfidentialStore.TEST.set(new DefaultConfidentialStore(tmp.getRoot()));
    }

    @Override
    protected void after() {
        ConfidentialStore.TEST.set(null);
        tmp.delete();
    }

    static {
        ConfidentialStore.TEST = new ThreadLocal<>();
    }
}

redpajama_set_name: RedPajamaGithub


text:
Although the problem is named "Heaps" I solved using std::multiset. Maybe I will update to Heaps in the future.

//TODO Implement Heaps and update here.

https://www.hackerrank.com/challenges/ctci-find-the-running-median/problem?
Solution: https://www.hackerrank.com/challenges/ctci-find-the-running-median/submissions/code/152339748

for more details see [here](../../leetcode/480-sliding-window-median).


text:
$(document).ready(function() {

  var $spinner = $('#spinner');
  var $editProfile = $('.edit-profile');
  var $editPw = $('.edit-pw');
  var $likeQuotes = $('.likes');
  var $allQuotes = $('.all-quotes');
  var $catQuotes = $('.category-quotes');

  $editProfile.on('submit', 'form.edit-form', function(event) {
    event.preventDefault();
    $spinner.show();

    var $target = $(event.target);
    $.ajax ({
      type: 'PUT',
      url: $target.attr('action'),
      data: $target.serialize()
    }).done(function(response){
      $spinner.hide();
      $target.closest('form').append(response);
      window.location.href="/edit";
    })
  })

  $editPw.on('submit', 'form.edit-pw', function(event) {
    event.preventDefault();
    $spinner.show();

    var $target = $(event.target);
    $.ajax ({
      type: 'PUT',
      url: $target.attr('action'),
      data: $target.serialize()
    }).done(function(response){
      $spinner.hide();
      $target.closest('form').append(response);
      window.location.href="/edit_pw";
    })
  })

  $likeQuotes.on('submit', 'form.like-form', function(event) {
    event.preventDefault();
    $spinner.show();

    var $target = $(event.target);
    $.ajax ({
      type: 'DELETE',
      url: $target.attr('action'),
    }).done(function(response){
      $spinner.hide();
      $target.closest('.likes').prepend(response);
      $target.closest('.liked-quote').remove();
    })
  })

  $allQuotes.on('submit', 'form.like-form', function(event) {
    event.preventDefault();
    $spinner.show();

    var $target = $(event.target);
    $target.hide();

    $.ajax({
      type: 'POST',
      url: $target.attr('action'),
      data: $target.serialize()
    }).done(function(response){
      $spinner.hide();
      $target.closest('.like-link').append(response);
    })
  })

  $(".sign-up-link").on("click", function(event) {
    event.preventDefault();
    $(event.target).hide();
    $(".sign-up-form").show();
  })

  $catQuotes.on('submit', 'form.like-form', function(event) {
    event.preventDefault();
    $spinner.show();

    var $target = $(event.target);
    $target.hide();

    $.ajax({
      type: 'POST',
      url: $target.attr('action'),
      data: $target.serialize()
    }).done(function(response){
      $spinner.hide();
      $target.closest('.like-link').append(response);
    })
  })

});


text:
package com.tantaman.fresh_observables;

public interface Subscription {
	public void dispose();
}


text:
/*
 * Code generated from Atmel Start.
 *
 * This file will be overwritten when reconfiguring your Atmel Start project.
 * Please copy examples or other code you want to keep to a separate file
 * to avoid losing it when reconfiguring.
 */

#include "driver_examples.h"
#include "driver_init.h"
#include "utils.h"

/**
 * Example of using ADC_0 to generate waveform.
 */
void ADC_0_example(void)
{
	uint8_t buffer[2];

	adc_sync_enable_channel(&ADC_0, 0);

	while (1) {
		adc_sync_read_channel(&ADC_0, 0, buffer, 2);
	}
}

static uint8_t src_data[128];
static uint8_t chk_data[128];
/**
 * Example of using FLASH_0 to read and write Flash main array.
 */
void FLASH_0_example(void)
{
	uint32_t page_size;
	uint16_t i;

	/* Init source data */
	page_size = flash_get_page_size(&FLASH_0);

	for (i = 0; i < page_size; i++) {
		src_data[i] = i;
	}

	/* Write data to flash */
	flash_write(&FLASH_0, 0x3200, src_data, page_size);

	/* Read data from flash */
	flash_read(&FLASH_0, 0x3200, chk_data, page_size);
}

/**
 * Example of using FLASH_0 to read and write Flash RWWEE array.
 */
void RWW_FLASH_0_example(void)
{
	uint32_t page_size;
	uint16_t i;

	/* Init source data */
	page_size = _rww_flash_get_page_size(&FLASH_0.dev);

	for (i = 0; i < page_size; i++) {
		src_data[i] = i;
	}

	/* Write data to RWWEE flash */
	if (_rww_flash_write(&FLASH_0.dev, NVMCTRL_RWW_EEPROM_ADDR, src_data, page_size) != ERR_NONE) {
		while (1)
			; /* Trap here when flash write error happen */
	}

	/* Read data from RWWEE flash */
	if (_rww_flash_read(&FLASH_0.dev, NVMCTRL_RWW_EEPROM_ADDR, chk_data, page_size) != ERR_NONE) {
		while (1)
			; /* Trap here when flash read error happen */
	}

	/* Check data */
	for (i = 0; i < page_size; i++) {
		if (src_data[i] != chk_data[i]) {
			while (1)
				; /* Trap here when check error happen */
		}
	}
}

void I2C_0_example(void)
{
	struct io_descriptor *I2C_0_io;

	i2c_m_sync_get_io_descriptor(&I2C_0, &I2C_0_io);
	i2c_m_sync_enable(&I2C_0);
	i2c_m_sync_set_slaveaddr(&I2C_0, 0x12, I2C_M_SEVEN);
	io_write(I2C_0_io, (uint8_t *)"Hello World!", 12);
}

/**
 * Example of using TARGET_IO to write "Hello World" using the IO abstraction.
 *
 * Since the driver is asynchronous we need to use statically allocated memory for string
 * because driver initiates transfer and then returns before the transmission is completed.
 *
 * Once transfer has been completed the tx_cb function will be called.
 */

static uint8_t example_TARGET_IO[12] = "Hello World!";

static void tx_cb_TARGET_IO(const struct usart_async_descriptor *const io_descr)
{
	/* Transfer completed */
}

void TARGET_IO_example(void)
{
	struct io_descriptor *io;

	usart_async_register_callback(&TARGET_IO, USART_ASYNC_TXC_CB, tx_cb_TARGET_IO);
	/*usart_async_register_callback(&TARGET_IO, USART_ASYNC_RXC_CB, rx_cb);
	usart_async_register_callback(&TARGET_IO, USART_ASYNC_ERROR_CB, err_cb);*/
	usart_async_get_io_descriptor(&TARGET_IO, &io);
	usart_async_enable(&TARGET_IO);

	io_write(io, example_TARGET_IO, 12);
}

void CAN_0_tx_callback(struct can_async_descriptor *const descr)
{
	(void)descr;
}
void CAN_0_rx_callback(struct can_async_descriptor *const descr)
{
	struct can_message msg;
	uint8_t            data[64];
	msg.data = data;
	can_async_read(descr, &msg);
	return;
}

/**
 * Example of using CAN_0 to Encrypt/Decrypt datas.
 */
void CAN_0_example(void)
{
	struct can_message msg;
	struct can_filter  filter;
	uint8_t            send_data[4];
	send_data[0] = 0x00;
	send_data[1] = 0x01;
	send_data[2] = 0x02;
	send_data[3] = 0x03;

	msg.id   = 0x45A;
	msg.type = CAN_TYPE_DATA;
	msg.data = send_data;
	msg.len  = 4;
	msg.fmt  = CAN_FMT_STDID;
	can_async_register_callback(&CAN_0, CAN_ASYNC_TX_CB, (FUNC_PTR)CAN_0_tx_callback);
	can_async_enable(&CAN_0);

	/**
	 * CAN_0_tx_callback callback should be invoked after call
	 * can_async_write, and remote device should recieve message with ID=0x45A
	 */
	can_async_write(&CAN_0, &msg);

	msg.id  = 0x100000A5;
	msg.fmt = CAN_FMT_EXTID;
	/**
	 * remote device should recieve message with ID=0x100000A5
	 */
	can_async_write(&CAN_0, &msg);

	/**
	 * CAN_0_rx_callback callback should be invoked after call
	 * can_async_set_filter and remote device send CAN Message with the same
	 * content as the filter.
	 */
	can_async_register_callback(&CAN_0, CAN_ASYNC_RX_CB, (FUNC_PTR)CAN_0_rx_callback);
	filter.id   = 0x469;
	filter.mask = 0;
	can_async_set_filter(&CAN_0, 0, CAN_FMT_STDID, &filter);

	filter.id   = 0x10000096;
	filter.mask = 0;
	can_async_set_filter(&CAN_0, 1, CAN_FMT_EXTID, &filter);
}


text:
using System;
using System.Linq;
using System.Reflection;
using Rudine.Web;
using Rudine.Web.Util;

namespace Rudine.Interpreters.Xsn
{
    /// <summary>
    ///     Supports written signature detection & extraction from BaseDoc objects.
    /// </summary>
    internal static class BaseDocExtensions
    {
        /// <summary>
        ///     attempts to screen properties that follow the naming pattern & inner property structure InfoPath xsd signature
        ///     elements
        ///     converted to when processed by xsd.exe (_XsnToCSharp.tt) to yield the C# class.
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        private static PropertyInfo[] GetFormObjectSignatureProperties(BaseDoc o)
        {
            return CacheMan.Cache(() =>
                                  {
                                      return o
                                          .GetFormObjectMappedProperties()
                                          .Where(m => m.Name.StartsWith("signatures", StringComparison.InvariantCultureIgnoreCase))
                                          .ToArray();
                                  },
                false,
                o.DocTypeName,
                o.solutionVersion,
                "GetFormWetSignatureProperties");
        }
    }
}


text:
 using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpeedPowerUp : MonoBehaviour {

	public int scoreValue;
	private GameController gameController;
	private GameObject gameControllerObject;
	public float speedIncrease;

	void Start () {
		gameControllerObject = GameObject.FindWithTag ("GameController");
		if (gameControllerObject != null) {
			gameController = gameControllerObject.GetComponent<GameController>();
		}
		if (gameController == null) {
			Debug.Log ("Cannot find 'GameController' script");
		}
	}

	// Use this for initialization
	void OnTriggerEnter(Collider other)
	{
		if (other.CompareTag ("PlayerOne") ){
			gameController.playerControllers[0].SpeedChange (speedIncrease);
			ScoreManager.Instance.AddPoints (0, scoreValue);
		}
		else if (other.CompareTag ("PlayerTwo") ){
			gameController.playerControllers[1].SpeedChange (speedIncrease);
			ScoreManager.Instance.AddPoints (1, scoreValue);
		}
	}
}


text:
module Jekyll
  module Template
    VERSION = "0.21.0"
  end
end


text:
<?php

namespace PhpSsrs\ReportingService2010;

class PrepareQueryResponse
{

  /**
   *
   * @var DataSetDefinition $DataSettings
   * @access public
   */
  public $DataSettings = null;

  /**
   *
   * @var boolean $Changed
   * @access public
   */
  public $Changed = null;

  /**
   *
   * @var String1[] $ParameterNames
   * @access public
   */
  public $ParameterNames = null;

  /**
   *
   * @param DataSetDefinition $DataSettings
   * @param boolean $Changed
   * @param String1[] $ParameterNames
   * @access public
   */
  public function __construct($DataSettings = null, $Changed = null, $ParameterNames = null)
  {
    $this->DataSettings = $DataSettings;
    $this->Changed = $Changed;
    $this->ParameterNames = $ParameterNames;
  }

}


text:
package com.uni.model;

public enum UserLevel {
	ADMIN, USER;
}


text:
package org.apache.synapse.startup.quartz;

import javax.xml.namespace.QName;

import org.apache.axiom.om.OMElement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.synapse.config.xml.XMLConfigConstants;
import org.apache.synapse.config.xml.StartupFactory;
import org.apache.synapse.Startup;
import org.apache.synapse.SynapseException;
import org.apache.synapse.task.TaskDescription;
import org.apache.synapse.task.TaskDescriptionFactory;

/**
 * <task class="org.my.synapse.Task" name="string">
 *  <description>description in text</description>
 *  <property name="stringProp" value="String"/>
 *  <property name="xmlProp">
 *   <somexml>config</somexml>
 *  </property>
 *  <trigger ([[count="10"]? interval="1000"] | [cron="0 * 1 * * ?"] | [once=(true | false)])/>
 * </task>
 */
public class SimpleQuartzFactory implements StartupFactory {

    public final static QName TASK
        = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "task");

    private final static Log log = LogFactory.getLog(SimpleQuartzFactory.class);

    public Startup createStartup(OMElement el) {

        if (log.isDebugEnabled()) {
            log.debug("Creating StartUpController Task");
        }

        if (el.getQName().equals(TASK)) {

            StartUpController startUpController = new StartUpController();
            TaskDescription taskDescription =
                    TaskDescriptionFactory.createTaskDescription(el,
                            XMLConfigConstants.SYNAPSE_OMNAMESPACE);
            if (taskDescription == null) {
                handleException("Invalid task - Task description can not be created  from :" + el);
                return null;
            }
            startUpController.setName(taskDescription.getName());
            startUpController.setTaskDescription(taskDescription);
            startUpController.setDescription(taskDescription.getTaskDescription());
            return startUpController;
        } else {
            handleException("Syntax error in the task : wrong QName for the task");
            return null;
        }
    }

    public Class<SimpleQuartzSerializer> getSerializerClass() {
        return SimpleQuartzSerializer.class;
    }

    public QName getTagQName() {
        return TASK;
    }

    private void handleException(String message) {
        log.error(message);
        throw new SynapseException(message);
    }

}


text:
package com.ark.android.weatherapp.mvpContract;

/**
 *
 * Created by Ark on 6/26/2017.
 */

public interface ActivityFragmentContract {

    interface FragmentInteractionListener {
        void changeToolbarButtonsVisibility(boolean settingVisible, boolean addVisible, boolean donVisible);
        void showBackBtn(boolean show);
        void resetToolBar();
    }

    interface FragmentToolBarSetupInterface{
        void setupToolBar();
    }
}


text:
require 'spec_helper'

describe "archives/index.html.erb" do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
<!DOCTYPE html>

  <meta charset="UTF-8">

  <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1">
  <title>Dva Demo</title>
  <link rel="stylesheet" href="index.css" />


text:
package org.apache.ignite.internal.processors.cache.extras;

import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.typedef.internal.*;

/**
 * Extras where attributes, obsolete version and TTL are set.
 */
public class GridCacheAttributesObsoleteTtlEntryExtras extends GridCacheEntryExtrasAdapter {
    /** Obsolete version. */
    private GridCacheVersion obsoleteVer;

    /** TTL. */
    private long ttl;

    /** Expire time. */
    private long expireTime;

    /**
     * Constructor.
     *
     * @param obsoleteVer Obsolete version.
     * @param ttl TTL.
     * @param expireTime Expire time.
     */
    public GridCacheAttributesObsoleteTtlEntryExtras(GridCacheVersion obsoleteVer,
        long ttl, long expireTime) {
        assert obsoleteVer != null;
        assert ttl != 0;

        this.obsoleteVer = obsoleteVer;
        this.ttl = ttl;
        this.expireTime = expireTime;
    }

    /** {@inheritDoc} */
    @Override public GridCacheEntryExtras mvcc(GridCacheMvcc mvcc) {
        return mvcc != null ? new GridCacheAttributesMvccObsoleteTtlEntryExtras(mvcc, obsoleteVer, ttl,
            expireTime) : this;
    }

    /** {@inheritDoc} */
    @Override public GridCacheVersion obsoleteVersion() {
        return obsoleteVer;
    }

    /** {@inheritDoc} */
    @Override public GridCacheEntryExtras obsoleteVersion(GridCacheVersion obsoleteVer) {
        if (obsoleteVer != null) {
            this.obsoleteVer = obsoleteVer;

            return this;
        }
        else
            return new GridCacheAttributesTtlEntryExtras(ttl, expireTime);
    }

    /** {@inheritDoc} */
    @Override public long ttl() {
        return ttl;
    }

    /** {@inheritDoc} */
    @Override public long expireTime() {
        return expireTime;
    }

    /** {@inheritDoc} */
    @Override public GridCacheEntryExtras ttlAndExpireTime(long ttl, long expireTime) {
        if (ttl != 0) {
            this.ttl = ttl;
            this.expireTime = expireTime;

            return this;
        }
        else
            return new GridCacheAttributesObsoleteEntryExtras(obsoleteVer);
    }

    /** {@inheritDoc} */
    @Override public int size() {
        return 24;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return S.toString(GridCacheAttributesObsoleteTtlEntryExtras.class, this);
    }
}


text:
using Kensaku32go.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Xml.Serialization;

namespace Kensaku32go
{
    /// <summary>
    /// Interaction logic for StartupWindow.xaml
    /// </summary>
    public partial class StartupWindow : Window
    {
        private readonly string xmlFilePath;
        private readonly Config config = new Config();

        public StartupWindow()
        {
            InitializeComponent();

            xmlFilePath = Path.Combine(Environment.ExpandEnvironmentVariables(@"%APPDATA%\Kensaku32go\Default.xml"));
            Directory.CreateDirectory(Path.GetDirectoryName(xmlFilePath));

            if (File.Exists(xmlFilePath) && new FileInfo(xmlFilePath).Length >= 1)
            {
                using (var fs = File.OpenRead(xmlFilePath))
                {
                    config = (Config)new XmlSerializer(typeof(Config)).Deserialize(fs);
                }
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            sources.ItemsSource = new string[0]
                .Concat(
                    new string[]
                    {
                        Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
                    }
                )
                .Concat(
                    Enumerable.Range(0, 26)
                    .Select(index => ((char)('A' + index)) + ":\\")
                    .Where(Directory.Exists)
                )
                .ToArray();

            listDirs.ItemsSource = config.Dirs;
        }

        private void nextBtn_Click(object sender, RoutedEventArgs e)
        {
            using (var fs = File.Create(xmlFilePath))
            {
                new XmlSerializer(typeof(Config)).Serialize(fs, config);
            }

            App.fpdb = Path.ChangeExtension(xmlFilePath, ".db");
            App.dirs = config.Dirs.ToArray();

            App.Current.MainWindow = new MainWindow();
            App.Current.MainWindow.Show();
            Close();
        }

        private void listDirs_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (listDirs.SelectedItem != null)
            {
                while (config.Dirs.Remove(listDirs.SelectedItem as string))
                {
                }
            }
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var dir = ((Button)sender).Content + "";
            while (config.Dirs.Remove(dir))
            {
            }
            config.Dirs.Add(dir);
        }

        private void listDirs_DragEnter(object sender, DragEventArgs e)
        {
            e.Effects = e.AllowedEffects & (e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None);
        }

        private void listDirs_Drop(object sender, DragEventArgs e)
        {
            var files = e.Data.GetData(DataFormats.FileDrop) as string[];
            if (files != null)
            {
                foreach (var dir in files.Where(it => Directory.Exists(it)))
                {
                    while (config.Dirs.Remove(dir))
                    {
                    }
                    config.Dirs.Add(dir);
                }
            }
        }
    }
}


text:
/* eslint-env node, mocha */
/* global expect */
/* eslint no-console: 0 */
'use strict';

// Uncomment the following lines to use the react test utilities
// import TestUtils from 'react-addons-test-utils';
import createComponent from 'helpers/shallowRenderHelper';

import ControllerUnitComponent from 'components//ControllerUnit.js';

describe('ControllerUnitComponent', () => {
  let component;

  beforeEach(() => {
    component = createComponent(ControllerUnitComponent);
  });

  it('should have its component name as default className', () => {
    expect(component.props.className).to.equal('controllerunit-component');
  });
});


text:
@layout(locate('orchestra::layout.main'))

@section('content')

		@include(locate('orchestra::layout.widgets.header'))
		{{ $form }}

		@placeholder('orchestra.account')
		@placeholder('orchestra.helps')

@endsection


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/tpu/v2alpha1/cloud_tpu.proto

package com.google.cloud.tpu.v2alpha1;

/**
 *
 *
 *

 * Sets the scheduling options for this node.
 *

 *
 * Protobuf type {@code google.cloud.tpu.v2alpha1.SchedulingConfig}
 */
public final class SchedulingConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.tpu.v2alpha1.SchedulingConfig)
    SchedulingConfigOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SchedulingConfig.newBuilder() to construct.
  private SchedulingConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SchedulingConfig() {}

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new SchedulingConfig();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.tpu.v2alpha1.CloudTpuProto
        .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.tpu.v2alpha1.CloudTpuProto
        .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.tpu.v2alpha1.SchedulingConfig.class,
            com.google.cloud.tpu.v2alpha1.SchedulingConfig.Builder.class);
  }

  public static final int PREEMPTIBLE_FIELD_NUMBER = 1;
  private boolean preemptible_;
  /**
   *
   *
   *

   * Defines whether the node is preemptible.
   *

   *
   * bool preemptible = 1;
   *
   * @return The preemptible.
   */
  @java.lang.Override
  public boolean getPreemptible() {
    return preemptible_;
  }

  public static final int RESERVED_FIELD_NUMBER = 2;
  private boolean reserved_;
  /**
   *
   *
   *

   * Whether the node is created under a reservation.
   *

   *
   * bool reserved = 2;
   *
   * @return The reserved.
   */
  @java.lang.Override
  public boolean getReserved() {
    return reserved_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (preemptible_ != false) {
      output.writeBool(1, preemptible_);
    }
    if (reserved_ != false) {
      output.writeBool(2, reserved_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (preemptible_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, preemptible_);
    }
    if (reserved_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, reserved_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.tpu.v2alpha1.SchedulingConfig)) {
      return super.equals(obj);
    }
    com.google.cloud.tpu.v2alpha1.SchedulingConfig other =
        (com.google.cloud.tpu.v2alpha1.SchedulingConfig) obj;

    if (getPreemptible() != other.getPreemptible()) return false;
    if (getReserved() != other.getReserved()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + PREEMPTIBLE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPreemptible());
    hash = (37 * hash) + RESERVED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReserved());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.tpu.v2alpha1.SchedulingConfig prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   *

   * Sets the scheduling options for this node.
   *

   *
   * Protobuf type {@code google.cloud.tpu.v2alpha1.SchedulingConfig}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.tpu.v2alpha1.SchedulingConfig)
      com.google.cloud.tpu.v2alpha1.SchedulingConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.tpu.v2alpha1.CloudTpuProto
          .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.tpu.v2alpha1.CloudTpuProto
          .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.tpu.v2alpha1.SchedulingConfig.class,
              com.google.cloud.tpu.v2alpha1.SchedulingConfig.Builder.class);
    }

    // Construct using com.google.cloud.tpu.v2alpha1.SchedulingConfig.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      preemptible_ = false;

      reserved_ = false;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.tpu.v2alpha1.CloudTpuProto
          .internal_static_google_cloud_tpu_v2alpha1_SchedulingConfig_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.tpu.v2alpha1.SchedulingConfig getDefaultInstanceForType() {
      return com.google.cloud.tpu.v2alpha1.SchedulingConfig.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.tpu.v2alpha1.SchedulingConfig build() {
      com.google.cloud.tpu.v2alpha1.SchedulingConfig result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.tpu.v2alpha1.SchedulingConfig buildPartial() {
      com.google.cloud.tpu.v2alpha1.SchedulingConfig result =
          new com.google.cloud.tpu.v2alpha1.SchedulingConfig(this);
      result.preemptible_ = preemptible_;
      result.reserved_ = reserved_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.tpu.v2alpha1.SchedulingConfig) {
        return mergeFrom((com.google.cloud.tpu.v2alpha1.SchedulingConfig) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.tpu.v2alpha1.SchedulingConfig other) {
      if (other == com.google.cloud.tpu.v2alpha1.SchedulingConfig.getDefaultInstance()) return this;
      if (other.getPreemptible() != false) {
        setPreemptible(other.getPreemptible());
      }
      if (other.getReserved() != false) {
        setReserved(other.getReserved());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 8:
              {
                preemptible_ = input.readBool();

                break;
              } // case 8
            case 16:
              {
                reserved_ = input.readBool();

                break;
              } // case 16
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private boolean preemptible_;
    /**
     *
     *
     *

     * Defines whether the node is preemptible.
     *

     *
     * bool preemptible = 1;
     *
     * @return The preemptible.
     */
    @java.lang.Override
    public boolean getPreemptible() {
      return preemptible_;
    }
    /**
     *
     *
     *

     * Defines whether the node is preemptible.
     *

     *
     * bool preemptible = 1;
     *
     * @param value The preemptible to set.
     * @return This builder for chaining.
     */
    public Builder setPreemptible(boolean value) {

      preemptible_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Defines whether the node is preemptible.
     *

     *
     * bool preemptible = 1;
     *
     * @return This builder for chaining.
     */
    public Builder clearPreemptible() {

      preemptible_ = false;
      onChanged();
      return this;
    }

    private boolean reserved_;
    /**
     *
     *
     *

     * Whether the node is created under a reservation.
     *

     *
     * bool reserved = 2;
     *
     * @return The reserved.
     */
    @java.lang.Override
    public boolean getReserved() {
      return reserved_;
    }
    /**
     *
     *
     *

     * Whether the node is created under a reservation.
     *

     *
     * bool reserved = 2;
     *
     * @param value The reserved to set.
     * @return This builder for chaining.
     */
    public Builder setReserved(boolean value) {

      reserved_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Whether the node is created under a reservation.
     *

     *
     * bool reserved = 2;
     *
     * @return This builder for chaining.
     */
    public Builder clearReserved() {

      reserved_ = false;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.tpu.v2alpha1.SchedulingConfig)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.tpu.v2alpha1.SchedulingConfig)
  private static final com.google.cloud.tpu.v2alpha1.SchedulingConfig DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.tpu.v2alpha1.SchedulingConfig();
  }

  public static com.google.cloud.tpu.v2alpha1.SchedulingConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SchedulingConfig> PARSER =
      new com.google.protobuf.AbstractParser<SchedulingConfig>() {
        @java.lang.Override
        public SchedulingConfig parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<SchedulingConfig> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<SchedulingConfig> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.tpu.v2alpha1.SchedulingConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
#import "InfoTextField.h"

@implementation InfoTextField

- (void) setStringValue: (NSString *) string
{
    [super setStringValue: string];

    [self setSelectable: ![[self stringValue] isEqualToString: @""]];
}

- (void) setObjectValue: (id <NSCopying>) object
{
    [super setObjectValue: object];

    [self setSelectable: ![[self stringValue] isEqualToString: @""]];
}

@end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>setlist.fm Playlist Exporter</title>

    <link href="http://fonts.googleapis.com/css?family=Montserrat:400" rel="stylesheet" type="text/css">
    <link href="popup.css" rel="stylesheet" type="text/css">

Extracting data

setlist.fm

        Spotify


text:
import 'codemirror/lib/codemirror.css'
import 'antd/lib/index.css'
import './sass/app.scss'
import React from 'react'
import ReactDOM from 'react-dom'
import ReactDOMServer from 'react-dom/server'
import Router from './router'

class App {
  constructor(options) {}
  render(element) {
    var appRootElement = React.createElement(Router)
    if (element) {
      ReactDOM.render(appRootElement, element)
      return
    }
    return ReactDOMServer.renderToString(appRootElement)
  }

  renderToDOM(element) {
    if (!element) {
      throw new Error('App.renderToDOM: element is required!')
    }
    this.render(element)
  }

  renderToString() {
    return this.render()
  }
}

var attachElement = document.getElementById('react-app')
var app = new App()

app.renderToDOM(attachElement)


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

<vulnerability xmlns="http://www.github/gregtampa/HBCTF-Battlegrounds/vulnerability"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.github/gregtampa/HBCTF-Battlegrounds/vulnerability">
  <name>Parameterised Accounts Module</name>
  <author>Thomas Shaw</author>
  <author>Puppet Labs</author>
  <module_license>Apache v2</module_license>
  <description>Parameterised user account creation and modification. Adds an account with a generated weak password by default.</description>

  <type>system</type>
  <privilege>none</privilege>
  <access>local</access>
  <platform>linux</platform>

  <read_fact>accounts</read_fact>

  <default_input into="accounts">
    <generator type="account">
      <input into="password">
        <generator type="weak_password_generator"/>
      </input>
    </generator>
    <generator type="account">
      <input into="password">
        <generator type="weak_password_generator"/>
      </input>
    </generator>
  </default_input>

  <!--optional details-->
  <reference>https://forge.puppet.com/puppetlabs/accounts</reference>

  <requires>
    <module_path>utilities/unix/system/accounts</module_path>
  </requires>

</vulnerability>


text:
@interface STStatefulArtboard (Snapshots)

/// Returns a new artboard reflecting the given state. All states metadata will be lost (i.e. it
/// will be "clean" snapshot)
- (id <STArtboard>)snapshotForState: (STStateDescription *)state;

@end


text:
FROM tragus/ubuntu

MAINTAINER James Johnson

#   wget -q https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.0.4-1_amd64.deb && \

COPY chef-server-core_12.0.4-1_amd64.deb /tmp/
COPY run_chef_server /tmp/

RUN apt-get update && \
    apt-get -y install curl wget && \
    echo "Downloading chef packge." && \
    dpkg -i /tmp/chef-server-core_12.0.4-1_amd64.deb && \
    dpkg-divert --local --rename --add /sbin/initctl && \
    ln -sf /bin/true /sbin/initctl

# Need to read https://docs.chef.io/server_firewalls_and_ports.html and update here.
# EXPOSE 1234

# TBD
ENTRYPOINT /bin/bash


text:
package com.hello.eoskin.helloanimals;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Collections.Generic;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp.Utilities;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp.Formatting
{
    internal static class FormattingHelpers
    {
        // TODO:  Need to determine correct way to handle newlines
        public const string NewLine = "\r\n";

        public static string GetIndent(this SyntaxToken token)
        {
            var precedingTrivia = token.GetAllPrecedingTriviaToPreviousToken();

            // indent is the spaces/tabs between last new line (if there is one) and end of trivia
            var indent = precedingTrivia.AsString();
            int lastNewLinePos = indent.LastIndexOf(NewLine);
            if (lastNewLinePos != -1)
            {
                int start = lastNewLinePos + NewLine.Length;
                indent = indent.Substring(start, indent.Length - start);
            }

            return indent;
        }

        public static string ContentBeforeLastNewLine(this IEnumerable<SyntaxTrivia> trivia)
        {
            var leading = trivia.AsString();
            int lastNewLinePos = leading.LastIndexOf(NewLine);
            if (lastNewLinePos == -1)
            {
                return string.Empty;
            }
            else
            {
                return leading.Substring(0, lastNewLinePos);
            }
        }

        public static ValueTuple<SyntaxToken, SyntaxToken> GetBracePair(this SyntaxNode node)
        {
            return node.GetBraces();
        }

        public static bool IsValidBracePair(this ValueTuple<SyntaxToken, SyntaxToken> bracePair)
        {
            if (bracePair.Item1.IsKind(SyntaxKind.None) ||
                bracePair.Item1.IsMissing ||
                bracePair.Item2.IsKind(SyntaxKind.None))
            {
                return false;
            }

            // don't check whether token is actually braces as long as it is not none.
            return true;
        }

        public static bool IsOpenParenInParameterList(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.OpenParenToken && token.Parent.Kind() == SyntaxKind.ParameterList;
        }

        public static bool IsCloseParenInParameterList(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.CloseParenToken && token.Parent.Kind() == SyntaxKind.ParameterList;
        }

        public static bool IsOpenParenInArgumentList(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.OpenParenToken && token.Parent.Kind() == SyntaxKind.ArgumentList;
        }

        public static bool IsCloseParenInArgumentList(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.CloseParenToken && token.Parent.Kind() == SyntaxKind.ArgumentList;
        }

        public static bool IsColonInTypeBaseList(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.ColonToken && token.Parent.Kind() == SyntaxKind.BaseList;
        }

        public static bool IsCommaInArgumentOrParameterList(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.CommaToken && (token.Parent.IsAnyArgumentList() || token.Parent.Kind() == SyntaxKind.ParameterList);
        }

        public static bool IsLambdaBodyBlock(this SyntaxNode node)
        {
            if (node.Kind() != SyntaxKind.Block)
            {
                return false;
            }

            return node.Parent.Kind() == SyntaxKind.SimpleLambdaExpression ||
                   node.Parent.Kind() == SyntaxKind.ParenthesizedLambdaExpression;
        }

        public static bool IsAnonymousMethodBlock(this SyntaxNode node)
        {
            if (node.Kind() != SyntaxKind.Block)
            {
                return false;
            }

            return node.Parent.Kind() == SyntaxKind.AnonymousMethodExpression;
        }

        public static bool IsSemicolonInForStatement(this SyntaxToken token)
        {
            var forStatement = token.Parent as ForStatementSyntax;
            return
                token.Kind() == SyntaxKind.SemicolonToken &&
                forStatement != null &&
                (forStatement.FirstSemicolonToken == token || forStatement.SecondSemicolonToken == token);
        }

        public static bool IsSemicolonOfEmbeddedStatement(this SyntaxToken token)
        {
            if (token.Kind() != SyntaxKind.SemicolonToken)
            {
                return false;
            }

            var statement = token.Parent as StatementSyntax;
            if (statement == null ||
                statement.GetLastToken() != token)
            {
                return false;
            }

            return IsEmbeddedStatement(statement);
        }

        public static bool IsCloseBraceOfExpression(this SyntaxToken token)
        {
            if (token.Kind() != SyntaxKind.CloseBraceToken)
            {
                return false;
            }

            return token.Parent is ExpressionSyntax;
        }

        public static bool IsCloseBraceOfEmbeddedBlock(this SyntaxToken token)
        {
            if (token.Kind() != SyntaxKind.CloseBraceToken)
            {
                return false;
            }

            var block = token.Parent as BlockSyntax;
            if (block == null ||
                block.CloseBraceToken != token)
            {
                return false;
            }

            return IsEmbeddedStatement(block);
        }

        public static bool IsEmbeddedStatement(this SyntaxNode node)
        {
            SyntaxNode statementOrElse = node as StatementSyntax;
            if (statementOrElse == null)
            {
                statementOrElse = node as ElseClauseSyntax;
            }

            return statementOrElse != null
                && statementOrElse.Parent != null
                && statementOrElse.Parent.IsEmbeddedStatementOwner();
        }

        public static bool IsCommaInEnumDeclaration(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.CommaToken &&
                token.Parent.IsKind(SyntaxKind.EnumDeclaration);
        }

        public static bool IsCommaInAnyArgumentsList(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.CommaToken &&
                token.Parent.IsAnyArgumentList();
        }

        public static bool IsParenInParenthesizedExpression(this SyntaxToken token)
        {
            var parenthesizedExpression = token.Parent as ParenthesizedExpressionSyntax;
            if (parenthesizedExpression == null)
            {
                return false;
            }

            return parenthesizedExpression.OpenParenToken.Equals(token) || parenthesizedExpression.CloseParenToken.Equals(token);
        }

        public static bool IsParenInArgumentList(this SyntaxToken token)
        {
            var parent = token.Parent;
            switch (parent.Kind())
            {
                case SyntaxKind.SizeOfExpression:
                    var sizeOfExpression = (SizeOfExpressionSyntax)parent;
                    return sizeOfExpression.OpenParenToken == token || sizeOfExpression.CloseParenToken == token;

                case SyntaxKind.TypeOfExpression:
                    var typeOfExpression = (TypeOfExpressionSyntax)parent;
                    return typeOfExpression.OpenParenToken == token || typeOfExpression.CloseParenToken == token;

                case SyntaxKind.CheckedExpression:
                case SyntaxKind.UncheckedExpression:
                    var checkedOfExpression = (CheckedExpressionSyntax)parent;
                    return checkedOfExpression.OpenParenToken == token || checkedOfExpression.CloseParenToken == token;

                case SyntaxKind.DefaultExpression:
                    var defaultExpression = (DefaultExpressionSyntax)parent;
                    return defaultExpression.OpenParenToken == token || defaultExpression.CloseParenToken == token;

                case SyntaxKind.MakeRefExpression:
                    var makeRefExpression = (MakeRefExpressionSyntax)parent;
                    return makeRefExpression.OpenParenToken == token || makeRefExpression.CloseParenToken == token;

                case SyntaxKind.RefTypeExpression:
                    var refTypeOfExpression = (RefTypeExpressionSyntax)parent;
                    return refTypeOfExpression.OpenParenToken == token || refTypeOfExpression.CloseParenToken == token;

                case SyntaxKind.RefValueExpression:
                    var refValueExpression = (RefValueExpressionSyntax)parent;
                    return refValueExpression.OpenParenToken == token || refValueExpression.CloseParenToken == token;

                case SyntaxKind.ArgumentList:
                    var argumentList = (ArgumentListSyntax)parent;
                    return argumentList.OpenParenToken == token || argumentList.CloseParenToken == token;

                case SyntaxKind.AttributeArgumentList:
                    var attributeArgumentList = (AttributeArgumentListSyntax)parent;
                    return attributeArgumentList.OpenParenToken == token || attributeArgumentList.CloseParenToken == token;
            }

            return false;
        }

        public static bool IsCloseParenInStatement(this SyntaxToken token)
        {
            var statement = token.Parent as StatementSyntax;
            if (statement == null)
            {
                return false;
            }

            var ifStatement = statement as IfStatementSyntax;
            if (ifStatement != null)
            {
                return ifStatement.CloseParenToken.Equals(token);
            }

            var switchStatement = statement as SwitchStatementSyntax;
            if (switchStatement != null)
            {
                return switchStatement.CloseParenToken.Equals(token);
            }

            var whileStatement = statement as WhileStatementSyntax;
            if (whileStatement != null)
            {
                return whileStatement.CloseParenToken.Equals(token);
            }

            var doStatement = statement as DoStatementSyntax;
            if (doStatement != null)
            {
                return doStatement.CloseParenToken.Equals(token);
            }

            var forStatement = statement as ForStatementSyntax;
            if (forStatement != null)
            {
                return forStatement.CloseParenToken.Equals(token);
            }

            var foreachStatement = statement as ForEachStatementSyntax;
            if (foreachStatement != null)
            {
                return foreachStatement.CloseParenToken.Equals(token);
            }

            var lockStatement = statement as LockStatementSyntax;
            if (lockStatement != null)
            {
                return lockStatement.CloseParenToken.Equals(token);
            }

            var usingStatement = statement as UsingStatementSyntax;
            if (usingStatement != null)
            {
                return usingStatement.CloseParenToken.Equals(token);
            }

            return false;
        }

        public static bool IsDotInMemberAccessOrQualifiedName(this SyntaxToken token)
        {
            return token.IsDotInMemberAccess() || (token.Kind() == SyntaxKind.DotToken && token.Parent.Kind() == SyntaxKind.QualifiedName);
        }

        public static bool IsDotInMemberAccess(this SyntaxToken token)
        {
            var memberAccess = token.Parent as MemberAccessExpressionSyntax;
            if (memberAccess == null)
            {
                return false;
            }

            return token.Kind() == SyntaxKind.DotToken
                && memberAccess.OperatorToken.Equals(token);
        }

        public static bool IsGenericGreaterThanToken(this SyntaxToken token)
        {
            if (token.Kind() == SyntaxKind.GreaterThanToken)
            {
                return token.Parent.IsKind(SyntaxKind.TypeParameterList, SyntaxKind.TypeArgumentList);
            }

            return false;
        }

        public static bool IsCommaInInitializerExpression(this SyntaxToken token)
        {
            return token.Kind() == SyntaxKind.CommaToken &&
                    ((token.Parent is InitializerExpressionSyntax) ||
                     (token.Parent is AnonymousObjectCreationExpressionSyntax));
        }

        public static bool IsIdentiferInLabeledStatement(this SyntaxToken token)
        {
            var labeledStatement = token.Parent as LabeledStatementSyntax;
            return token.Kind() == SyntaxKind.IdentifierToken &&
                labeledStatement != null &&
                labeledStatement.Identifier == token;
        }

        public static bool IsColonInSwitchLabel(this SyntaxToken token)
        {
            return FormattingRangeHelper.IsColonInSwitchLabel(token);
        }

        public static bool IsColonInLabeledStatement(this SyntaxToken token)
        {
            var labeledStatement = token.Parent as LabeledStatementSyntax;
            return token.Kind() == SyntaxKind.ColonToken &&
                labeledStatement != null &&
                labeledStatement.ColonToken == token;
        }

        public static bool IsEmbeddedStatementOwnerWithCloseParen(this SyntaxNode node)
        {
            return node is IfStatementSyntax ||
                   node is WhileStatementSyntax ||
                   node is ForStatementSyntax ||
                   node is ForEachStatementSyntax ||
                   node is UsingStatementSyntax;
        }

        public static bool IsNestedQueryExpression(this SyntaxToken token)
        {
            var fromClause = token.Parent as FromClauseSyntax;
            return token.Kind() == SyntaxKind.InKeyword &&
                   fromClause != null &&
                   fromClause.Expression is QueryExpressionSyntax;
        }

        public static bool IsFirstFromKeywordInExpression(this SyntaxToken token)
        {
            var queryExpression = token.Parent.Parent as QueryExpressionSyntax;
            return token.Kind() == SyntaxKind.FromKeyword &&
                   queryExpression != null &&
                   queryExpression.GetFirstToken().Equals(token);
        }

        public static bool IsInitializerForObjectOrAnonymousObjectCreationExpression(this SyntaxNode node)
        {
            var initializer = node as InitializerExpressionSyntax;
            AnonymousObjectMemberDeclaratorSyntax anonymousObjectInitializer = null;
            if (initializer == null)
            {
                anonymousObjectInitializer = node as AnonymousObjectMemberDeclaratorSyntax;
                if (anonymousObjectInitializer == null)
                {
                    return false;
                }
            }

            var parent = initializer != null ? initializer.Parent : anonymousObjectInitializer.Parent;
            if (parent is AnonymousObjectCreationExpressionSyntax)
            {
                return true;
            }

            if (parent is ObjectCreationExpressionSyntax)
            {
                if (initializer.Expressions.Count <= 0)
                {
                    return true;
                }

                var expression = initializer.Expressions[0];
                if (expression.Kind() == SyntaxKind.SimpleAssignmentExpression)
                {
                    return true;
                }
            }

            return false;
        }

        public static bool IsInitializerForArrayOrCollectionCreationExpression(this SyntaxNode node)
        {
            var initializer = node as InitializerExpressionSyntax;
            AnonymousObjectMemberDeclaratorSyntax anonymousObjectInitializer = null;
            if (initializer == null)
            {
                anonymousObjectInitializer = node as AnonymousObjectMemberDeclaratorSyntax;
                if (anonymousObjectInitializer == null)
                {
                    return false;
                }
            }

            var parent = initializer != null ? initializer.Parent : anonymousObjectInitializer.Parent;
            if (parent is ArrayCreationExpressionSyntax ||
                parent is ImplicitArrayCreationExpressionSyntax ||
                parent is EqualsValueClauseSyntax ||
                parent.Kind() == SyntaxKind.SimpleAssignmentExpression)
            {
                return true;
            }

            if (parent is ObjectCreationExpressionSyntax)
            {
                return !IsInitializerForObjectOrAnonymousObjectCreationExpression(initializer);
            }

            return false;
        }

        public static bool ParenOrBracketContainsNothing(this SyntaxToken token1, SyntaxToken token2)
        {
            return (token1.Kind() == SyntaxKind.OpenParenToken && token2.Kind() == SyntaxKind.CloseParenToken) ||
                   (token1.Kind() == SyntaxKind.OpenBracketToken && token2.Kind() == SyntaxKind.CloseBracketToken);
        }

        public static bool IsLastTokenInLabelStatement(this SyntaxToken token)
        {
            if (token.Kind() != SyntaxKind.SemicolonToken && token.Kind() != SyntaxKind.CloseBraceToken)
            {
                return false;
            }

            if (token.Parent == null)
            {
                return false;
            }

            return token.Parent.Parent is LabeledStatementSyntax;
        }

        public static ValueTuple<SyntaxToken, SyntaxToken> GetFirstAndLastMemberDeclarationTokensAfterAttributes(this MemberDeclarationSyntax node)
        {
            Contract.ThrowIfNull(node);

            // there are no attributes associated with the node. return back first and last token of the node.
            var attributes = node.GetAttributes();
            if (attributes.Count == 0)
            {
                return ValueTuple.Create(node.GetFirstToken(includeZeroWidth: true), node.GetLastToken(includeZeroWidth: true));
            }

            var lastToken = node.GetLastToken(includeZeroWidth: true);
            var lastAttributeToken = attributes.Last().GetLastToken(includeZeroWidth: true);
            if (lastAttributeToken.Equals(lastToken))
            {
                return ValueTuple.Create(default(SyntaxToken), default(SyntaxToken));
            }

            var firstTokenAfterAttribute = lastAttributeToken.GetNextToken(includeZeroWidth: true);

            // there are attributes, get first token after the tokens belong to attributes
            return ValueTuple.Create(firstTokenAfterAttribute, lastToken);
        }

        public static bool IsBlockBody(this SyntaxNode node)
        {
            Contract.ThrowIfNull(node);

            var blockNode = node as BlockSyntax;
            if (blockNode == null)
            {
                return false;
            }

            switch (blockNode.Parent.Kind())
            {
                case SyntaxKind.AnonymousMethodExpression:
                case SyntaxKind.CheckedStatement:
                case SyntaxKind.UncheckedStatement:
                case SyntaxKind.UnsafeStatement:
                case SyntaxKind.TryStatement:
                case SyntaxKind.CatchClause:
                case SyntaxKind.FinallyClause:
                case SyntaxKind.MethodDeclaration:
                case SyntaxKind.OperatorDeclaration:
                case SyntaxKind.ConversionOperatorDeclaration:
                case SyntaxKind.ConstructorDeclaration:
                case SyntaxKind.DestructorDeclaration:
                case SyntaxKind.AddAccessorDeclaration:
                case SyntaxKind.GetAccessorDeclaration:
                case SyntaxKind.SetAccessorDeclaration:
                case SyntaxKind.RemoveAccessorDeclaration:
                case SyntaxKind.UnknownAccessorDeclaration:
                    return true;
                default:
                    return false;
            }
        }

        public static bool IsPlusOrMinusExpression(this SyntaxToken token)
        {
            if (token.Kind() != SyntaxKind.PlusToken && token.Kind() != SyntaxKind.MinusToken)
            {
                return false;
            }

            return token.Parent is PrefixUnaryExpressionSyntax;
        }

        public static bool IsInterpolation(this SyntaxToken currentToken)
        {
            return currentToken.Parent.IsKind(SyntaxKind.Interpolation);
        }
    }
}


text:
mkdir /var/run/sshd

# create an ubuntu user
PASS=`pwgen -c -n -1 10`
echo "User: ubuntu Pass: $PASS"
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo ubuntu
echo "ubuntu:$PASS"  | chpasswd

/usr/sbin/sshd

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_LOG_DIR=/var/log/apache2

/usr/sbin/apache2 -D FOREGROUND


text:
"""Main entry point for Swarming backend handlers."""

import webapp2
from google.appengine.api import datastore_errors
from google.appengine.api import taskqueue

import mapreduce_jobs
from components import decorators
from server import stats
from server import task_scheduler

class CronBotDiedHandler(webapp2.RequestHandler):
  @decorators.require_cronjob
  def get(self):
    task_scheduler.cron_handle_bot_died()
    self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'
    self.response.out.write('Success.')

class CronAbortExpiredShardToRunHandler(webapp2.RequestHandler):
  @decorators.require_cronjob
  def get(self):
    task_scheduler.cron_abort_expired_task_to_run()
    self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'
    self.response.out.write('Success.')

class CronTriggerCleanupDataHandler(webapp2.RequestHandler):
  """Triggers task to delete orphaned blobs."""

  @decorators.require_cronjob
  def get(self):
    taskqueue.add(method='POST', url='/internal/taskqueue/cleanup_data',
                  queue_name='cleanup')
    self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'
    self.response.out.write('Success.')

class TaskCleanupDataHandler(webapp2.RequestHandler):
  """Deletes orphaned blobs."""

  @decorators.silence(datastore_errors.Timeout)
  @decorators.require_taskqueue('cleanup')
  def post(self):
    # TODO(maruel): Clean up old TaskRequest after a cut-off date.
    self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'
    self.response.out.write('Success.')

### Mapreduce related handlers

class InternalLaunchMapReduceJobWorkerHandler(webapp2.RequestHandler):
  """Called via task queue or cron to start a map reduce job."""
  @decorators.require_taskqueue(mapreduce_jobs.MAPREDUCE_TASK_QUEUE)
  def post(self, job_id):  # pylint: disable=R0201
    mapreduce_jobs.launch_job(job_id)

###

def get_routes():
  """Returns internal urls that should only be accessible via the backend."""
  routes = [
    # Cron jobs.
    # TODO(maruel): Rename cron.yaml job url. Doing so is a bit annoying since
    # the app version has to be running an already compatible version already.
    ('/internal/cron/abort_bot_died', CronBotDiedHandler),
    ('/internal/cron/handle_bot_died', CronBotDiedHandler),
    ('/internal/cron/abort_expired_task_to_run',
        CronAbortExpiredShardToRunHandler),

    ('/internal/cron/stats/update', stats.InternalStatsUpdateHandler),
    ('/internal/cron/trigger_cleanup_data', CronTriggerCleanupDataHandler),

    # Task queues.
    ('/internal/taskqueue/cleanup_data', TaskCleanupDataHandler),

    # Mapreduce related urls.
    (r'/internal/taskqueue/mapreduce/launch/<job_id:[^\/]+>',
      InternalLaunchMapReduceJobWorkerHandler),
  ]
  return [webapp2.Route(*a) for a in routes]


text:
sap.ui.define(['sap/ui/commons/TextView', 'sap/ui/core/Fragment'],
	function(TextView, Fragment) {
	"use strict";

	sap.ui.jsfragment("testdata.customizing.customer.CustomTextViewFrag", {

		createContent : function(oController) {
			var oTextView = new TextView("iHaveCausedDestruction", {
				text : "Hello World"
			});
			return oTextView;
		}

	});

});


text:
package eu.estcube.gsconnector;

import java.util.Map;

import org.hbird.exchange.core.Parameter;

import eu.estcube.domain.JMSConstants;
import eu.estcube.domain.TelemetryObject;
import eu.estcube.domain.TelemetryParameter;

public abstract class HelpCommandAbstract {

    public TelemetryObject createHelpList(TelemetryObject telemetryObject, String[] messageSplit) {

        String[] messagePiece = { null, null, null };
        /*
         * i starts from 1 because, first line is help name, which is unnecessary.
         */
        for (int i = 1; i < messageSplit.length; i++) {
            if (messageSplit[i].contains(JMSConstants.GS_DEVICE_END_MESSAGE)) {
                break;
            }
            messagePiece = messageSplit[i].split(":");

            telemetryObject.addParameter(new TelemetryParameter(
            		getHelpHashMap().get(messagePiece[0]),
            		messagePiece[1].substring((messagePiece[1].indexOf("(") + 1), messagePiece[1].indexOf(")"))));
            if (messagePiece.length == 3) {
                telemetryObject.addParameter(new TelemetryParameter(
                		getHelpHashMap().get(messagePiece[1].substring((messagePiece[1].length() - 1))),
                        messagePiece[2].substring((messagePiece[2].indexOf("(") + 1), messagePiece[2].indexOf(")"))));
            }
        }

        return telemetryObject;
    }

    protected abstract Map<String, String> getHelpHashMap();
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NXDO.RJava.Core
{
    internal class JPCharacter : JParamValue
    {
        private JPCharacter(char? c, string jParamClassName)
            : base(jParamClassName)
        {
            this.JValue = JParamValueHelper.ToPrimitiveValue(c);
        }

        private JPCharacter(char[] array, string jParamClassName)
            : base(jParamClassName)
        {
            this.JValue = JParamValueHelper.GetPrimitiveArray(array);
        }

        private JPCharacter(char?[] array, string jParamClassName)
            : base(jParamClassName)
        {
            this.JValue = JParamValueHelper.GetObjectArray("java.lang.Character", array);
        }

        public static implicit operator JPCharacter(char c)
        {
            return new JPCharacter(c, "char");
        }

        public static implicit operator JPCharacter(char? c)
        {
            return new JPCharacter(c, "java.lang.Character");
        }

        public static implicit operator JPCharacter(char[] array)
        {
            return new JPCharacter(array, "char[]");
        }

        public static implicit operator JPCharacter(char?[] array)
        {
            return new JPCharacter(array, "[Ljava.lang.Character;");
        }
    }
}


text:
<?php
/**
 * @namespace
 */
namespace Vein\Core\Crud\Helper\Filter\Field;

use Vein\Core\Crud\Grid\Filter\Field;

/**
 * Class grid filter field helper
 *
 * @category   Vein\Core
 * @package    Crud
 * @subpackage Helper
 */
class Standart extends \Vein\Core\Crud\Helper
{
	/**
	 * Generates a widget to show a html grid filter
	 *
	 * @param \Vein\Core\Crud\Grid\Filter\Field $filter
	 *
	 * @return string
	 */
	static public function _(Field $field)
	{
		$code = '';
		if ($field instanceof Field\Submit) {
			return $code;
		}

        $code .= '

';

		return $code;
	}

    /**
     * Crud helper end tag
     *
	 * @param \Vein\Core\Crud\Grid\Filter\Field $filter
	 *
     * @return string
     */
    static public function endTag(Field $field)
    {
		if ($field instanceof Field\Submit) {
			return '';
		}

        return '

';
    }
}


text:
package tr.xip.wanikani.db.tables;

import android.provider.BaseColumns;

/**
 * Created by Hikari on 1/5/15.
 */
public class ItemsTable implements BaseColumns {
    public static final String TABLE_NAME = "items";
    public static final String COLUMN_NAME_ID = "_id";
    public static final String COLUMN_NAME_CHARACTER = "character";
    public static final String COLUMN_NAME_KANA = "kana";
    public static final String COLUMN_NAME_MEANING = "meaning";
    public static final String COLUMN_NAME_IMAGE = "image";
    public static final String COLUMN_NAME_ONYOMI = "onyomi";
    public static final String COLUMN_NAME_KUNYOMI = "kunyomi";
    public static final String COLUMN_NAME_IMPORTANT_READING = "important_reading";
    public static final String COLUMN_NAME_LEVEL = "level";
    public static final String COLUMN_NAME_ITEM_TYPE = "item_type";
    public static final String COLUMN_NAME_SRS = "srs";
    public static final String COLUMN_NAME_UNLOCKED_DATE = "unlocked_date";
    public static final String COLUMN_NAME_AVAILABLE_DATE = "available_date";
    public static final String COLUMN_NAME_BURNED = "burned";
    public static final String COLUMN_NAME_BURNED_DATE = "burned_date";
    public static final String COLUMN_NAME_MEANING_CORRECT = "meaning_correct";
    public static final String COLUMN_NAME_MEANING_INCORRECT = "meaning_incorrect";
    public static final String COLUMN_NAME_MEANING_MAX_STREAK = "meaning_max_streak";
    public static final String COLUMN_NAME_MEANING_CURRENT_STREAK = "meaning_current_streak";
    public static final String COLUMN_NAME_READING_CORRECT = "reading_correct";
    public static final String COLUMN_NAME_READING_INCORRECT = "reading_incorrect";
    public static final String COLUMN_NAME_READING_MAX_STREAK = "reading_max_streak";
    public static final String COLUMN_NAME_READING_CURRENT_STREAK = "reading_current_streak";
    public static final String COLUMN_NAME_MEANING_NOTE = "meaning_note";
    public static final String COLUMN_NAME_USER_SYNONYMS = "user_synonyms";
    public static final String COLUMN_NAME_READING_NOTE = "reading_note";
    public static final String COLUMN_NAME_NULLABLE = "nullable";

    public static final String[] COLUMNS = {
            COLUMN_NAME_ID,
            COLUMN_NAME_CHARACTER,
            COLUMN_NAME_KANA,
            COLUMN_NAME_MEANING,
            COLUMN_NAME_IMAGE,
            COLUMN_NAME_ONYOMI,
            COLUMN_NAME_KUNYOMI,
            COLUMN_NAME_IMPORTANT_READING,
            COLUMN_NAME_LEVEL,
            COLUMN_NAME_ITEM_TYPE,
            COLUMN_NAME_SRS,
            COLUMN_NAME_UNLOCKED_DATE,
            COLUMN_NAME_AVAILABLE_DATE,
            COLUMN_NAME_BURNED,
            COLUMN_NAME_BURNED_DATE,
            COLUMN_NAME_MEANING_CORRECT,
            COLUMN_NAME_MEANING_INCORRECT,
            COLUMN_NAME_MEANING_MAX_STREAK,
            COLUMN_NAME_MEANING_CURRENT_STREAK,
            COLUMN_NAME_READING_CORRECT,
            COLUMN_NAME_READING_INCORRECT,
            COLUMN_NAME_READING_MAX_STREAK,
            COLUMN_NAME_READING_CURRENT_STREAK,
            COLUMN_NAME_MEANING_NOTE,
            COLUMN_NAME_USER_SYNONYMS,
            COLUMN_NAME_READING_NOTE,
            COLUMN_NAME_NULLABLE
    };
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.

#if !PORTABLE

using System;
using System.Security.Cryptography;

namespace Microsoft.Azure.KeyVault.Cryptography
{

    /// <summary>
    /// Supported algorithm names. Do not add to this enumeration
    /// without also modifying IncrementHash.Create / CreateHMAC
    /// </summary>
    public enum HashAlgorithmName
    {
        SHA256,
        SHA384,
        SHA512,
    }

    public sealed class IncrementalHash : IDisposable
    {
        private static readonly byte[] NullBuffer = new byte[0];

        public static IncrementalHash CreateHMAC( HashAlgorithmName algorithmName, byte[] key )
        {
            HMAC hmac = null;

            switch ( algorithmName )
            {
                case HashAlgorithmName.SHA256:
                    hmac = new HMACSHA256( key );
                    break;

                case HashAlgorithmName.SHA384:
                    hmac = new HMACSHA384( key );
                    break;

                case HashAlgorithmName.SHA512:
                    hmac = new HMACSHA512( key );
                    break;

                default:
                    throw new NotSupportedException( "Unsupported HashAlgorithmName" );
            }

            return new IncrementalHash( hmac );
        }

        private HMAC _hmac;

        private IncrementalHash( HMAC hmac )
        {
            _hmac = hmac;
        }

        public void AppendData( byte[] data )
        {
            if ( _hmac == null ) throw new ObjectDisposedException( "IncrementalHash" );

            _hmac.TransformBlock( data, 0, data.Length, data, 0 );
        }

        public byte[] GetHashAndReset()
        {
            // This is the only opportunity we have to finalize the hash for dnx451
            _hmac.TransformFinalBlock( NullBuffer, 0, 0 );

            return _hmac.Hash;
        }

        public void Dispose()
        {
            if ( _hmac != null )
            {
                _hmac.Dispose();
                _hmac = null;
            }
        }
    }

}

#endif


text:
layout: post
title: 02 Silenci
date: 2016-03-26 10:00:00
---

Es necessiten *dos anys* per aprendre a *parlar*

i *seixanta* per aprendre a *callar*.

Ernest Heminway


text:
package com.ait.lienzo.client.core.animation;

public class TimedAnimation extends AbstractAnimation
{
    public TimedAnimation(final double duration, final IAnimationCallback callback)
    {
        super(duration, callback);
    }

    @Override
    public IAnimation doFrame()
    {
        if (System.currentTimeMillis() >= (getBegTime() + getDuration()))
        {
            stop();
        }
        return super.doFrame();
    }
}


text:
package com.ait.platform.common.exception;

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

import org.hibernate.exception.ConstraintViolationException;
import org.springframework.beans.TypeMismatchException;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.validation.BindException;
import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import org.springframework.web.multipart.MultipartException;
import org.springframework.web.multipart.support.MissingServletRequestPartException;
import org.springframework.web.servlet.NoHandlerFoundException;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;

/**
 * @author AllianzIT
 *
 */
@RestControllerAdvice
public class AitRestExceptionHandler extends ResponseEntityExceptionHandler {

	// 400

	@Override
	protected ResponseEntity<Object> handleMethodArgumentNotValid(final MethodArgumentNotValidException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
		logger.info(ex.getClass().getName());
		//
		final List<String> errors = new ArrayList<String>();
		for (final FieldError error : ex.getBindingResult().getFieldErrors()) {
			errors.add(error.getField() + ": " + error.getDefaultMessage());
		}
		for (final ObjectError error : ex.getBindingResult().getGlobalErrors()) {
			errors.add(error.getObjectName() + ": " + error.getDefaultMessage());
		}
		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, ex.getLocalizedMessage(), errors);
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	@Override
	protected ResponseEntity<Object> handleBindException(final BindException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
		logger.info(ex.getClass().getName());
		//
		final List<String> errors = new ArrayList<String>();
		for (final FieldError error : ex.getBindingResult().getFieldErrors()) {
			errors.add(error.getField() + ": " + error.getDefaultMessage());
		}
		for (final ObjectError error : ex.getBindingResult().getGlobalErrors()) {
			errors.add(error.getObjectName() + ": " + error.getDefaultMessage());
		}
		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, ex.getLocalizedMessage(), errors);
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	@Override
	protected ResponseEntity<Object> handleTypeMismatch(final TypeMismatchException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
		logger.info(ex.getClass().getName());
		//
		final String error = ex.getValue() + " value for " + ex.getPropertyName() + " should be of type " + ex.getRequiredType();

		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, ex.getLocalizedMessage(), error);
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	@Override
	protected ResponseEntity<Object> handleMissingServletRequestPart(final MissingServletRequestPartException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
		logger.info(ex.getClass().getName());
		//
		final String error = ex.getRequestPartName() + " part is missing";
		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, ex.getLocalizedMessage(), error);
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	@Override
	protected ResponseEntity<Object> handleMissingServletRequestParameter(final MissingServletRequestParameterException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
		logger.info(ex.getClass().getName());
		//
		final String error = ex.getParameterName() + " parameter is missing";
		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, ex.getLocalizedMessage(), error);
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	//
	//
	@ExceptionHandler({ MethodArgumentTypeMismatchException.class })
	public ResponseEntity<Object> handleMethodArgumentTypeMismatch(final MethodArgumentTypeMismatchException ex, final WebRequest request) {
		logger.info(ex.getClass().getName());
		//
		final String error = ex.getName() + " should be of type " + ex.getRequiredType().getName();

		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, ex.getLocalizedMessage(), error);
		return new ResponseEntity<Object>(AitException, new HttpHeaders(), AitException.getStatus());
	}

	@ExceptionHandler({ ConstraintViolationException.class })
	public ResponseEntity<Object> handleConstraintViolation(final ConstraintViolationException ex, final WebRequest request) {
		logger.info(ex.getClass().getName());
		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, "Error de integridad referencial", "Verifique que la información relacionada que intenta ingresar sea adecuada");
		return new ResponseEntity<Object>(AitException, new HttpHeaders(), AitException.getStatus());
	}

	@ExceptionHandler({ DataIntegrityViolationException.class })
	public ResponseEntity<Object> handleDataIntegrityViolationException(final DataIntegrityViolationException ex, final WebRequest request) {
		logger.info(ex.getClass().getName());
		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, "Error de integridad de datos", "Verifique que la información que intenta ingresar no se encuentre repetida");
		return new ResponseEntity<Object>(AitException, new HttpHeaders(), AitException.getStatus());
	}

	// 404

	@Override
	protected ResponseEntity<Object> handleNoHandlerFoundException(final NoHandlerFoundException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
		logger.info(ex.getClass().getName());
		//
		final String error = "No handler found for " + ex.getHttpMethod() + " " + ex.getRequestURL();

		final AitException AitException = new AitException(HttpStatus.NOT_FOUND, ex.getLocalizedMessage(), error);
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	// 405

	// @Override
	// protected ResponseEntity<Object> handleHttpRequestMethodNotSupported(final HttpRequestMethodNotSupportedException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
	// logger.info(ex.getClass().getName());
	// //
	// final StringBuilder builder = new StringBuilder();
	// builder.append(ex.getMethod());
	// builder.append(" method is not supported for this request. Supported methods are ");
	//
	// for (final MediaType type : ex.getSupportedMediaTypes()) {
	// builder.append(type + " ");
	// }
	//
	// final AitException AitException = new AitException(HttpStatus.METHOD_NOT_ALLOWED, ex.getLocalizedMessage(), builder.toString());
	// return new ResponseEntity<Object>(AitException, new HttpHeaders(), AitException.getStatus());
	// }

	// 415

	@Override
	protected ResponseEntity<Object> handleHttpMediaTypeNotSupported(final HttpMediaTypeNotSupportedException ex, final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
		logger.info(ex.getClass().getName());
		ex.printStackTrace();
		//
		final StringBuilder builder = new StringBuilder();
		builder.append(ex.getContentType());
		builder.append(" media type is not supported. Supported media types are ");

		for (final MediaType type : ex.getSupportedMediaTypes()) {
			builder.append(type + " ");
		}

		final AitException AitException = new AitException(HttpStatus.UNSUPPORTED_MEDIA_TYPE, ex.getLocalizedMessage(), builder.substring(0, builder.length() - 2));
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	// 500

	@ExceptionHandler({ AccessDeniedException.class })
	public ResponseEntity<Object> handleAccessDeniedException(final Exception ex, final HttpHeaders headers, final WebRequest request) {
		logger.info(ex.getClass().getName());
		logger.error("error", ex);
		//
		final AitException AitException = new AitException(HttpStatus.UNAUTHORIZED, "Acceso no permitido", "Su perfil no cuenta con los permisos necesarios para acceder al servicio solicitado");
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}

	// @ExceptionHandler({ RuntimeException.class })
	// public ResponseEntity<Object> handleAll(final Exception ex, final HttpHeaders headers, final WebRequest request) {
	// logger.info(ex.getClass().getName());
	// logger.error("error", ex);
	// //
	// final AitException AitException = new AitException(HttpStatus.INTERNAL_SERVER_ERROR, ex.getLocalizedMessage(), "Error en el procesamiento de la solicitud");
	// return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	// }

	@ExceptionHandler({ RuntimeException.class })
	@ResponseBody
	public ResponseEntity<Object> handleAll(final Exception ex) {
		logger.info(ex.getClass().getName());
		logger.error("error", ex);
		//
		final AitException AitException = new AitException(HttpStatus.INTERNAL_SERVER_ERROR, ex.getLocalizedMessage(), "Error en el procesamiento de la solicitud");
		return new ResponseEntity<Object>(AitException, new HttpHeaders(), AitException.getStatus());
	}

	@ExceptionHandler({ AitException.class })
	public ResponseEntity<Object> handleAitException(final AitException ex) {
		logger.info(ex.getClass().getName());
		logger.error("error", ex);
		return new ResponseEntity<Object>(ex, new HttpHeaders(), ex.getStatus());
	}

	@ExceptionHandler(MultipartException.class)
	@ResponseBody
	public ResponseEntity<Object> handleFileException(Exception ex, final HttpHeaders headers, WebRequest request) {
		ex.printStackTrace();
		final AitException AitException = new AitException(HttpStatus.BAD_REQUEST, ex.getLocalizedMessage(), "Error al cargar informacion adicional");
		return handleExceptionInternal(ex, AitException, headers, AitException.getStatus(), request);
	}
}


text:
package org.springframework.data.hazelcast.repository;

import org.springframework.data.keyvalue.repository.KeyValueRepository;
import org.springframework.data.repository.NoRepositoryBean;

import java.io.Serializable;

/**
 *

 * Subtype {@link org.springframework.stereotype.Repository @Repository} for Hazelcast usage.
 *

 *

 * Although part of the rationale of the repository interface is to abstract the implementation, it is useful for type
 * checking to confirm the allowed type generics for the domain classes.
 *

 *

 * Note that {@link org.springframework.data.keyvalue.repository.KeyValueRepository KeyValueRepository} defines that the
 * {@code ID} class extends {@link Serializable}.
 *

 *
 * @param <T>  The type of the domain value class
 * @param <ID> The type of the domain key class
 * @author Neil Stevenson
 */
@NoRepositoryBean
public interface HazelcastRepository<T extends Serializable, ID extends Serializable>
        extends KeyValueRepository<T, ID> {
}


text:
This project is an application skeleton for a typical [AngularJS](http://angularjs.org/) web app.
You can use it to quickly bootstrap your angular webapp projects and dev environment for these
projects.


text:
  Ergänzt den Abschnitt "Änderungen" um Verweise auf einen externen
  Repository-Browser.

  In der Einstellung "Auto" versucht Hudson, den Repository-Browser aus anderen
  Jobs abzuleiten. Dazu muß das SCM des vorliegenden Jobs von einem Repository-Browser
  unterstützt werden und ein anderer Job existieren, dessen Verbindung zu einem
  solchen Repository-Browser bereits vollständig konfiguriert wurde.


text:
#ifndef VIEWEITEM_H
#define VIEWEITEM_H

#include <gui/DbObjectItem.h>

class QAction;
class QDomDocument;
class QDomElement;
class QMenu;

class ArrowItem;

namespace DbObjects
{
namespace Common
{
class DbView;

typedef DbObjectPtr<DbView> DbViewPtr;
}
}

/*!
 * \class ViewItem
 * \headerfile gui/ViewItem.h
 * \brief Graphics item, implements the database view. Support moving, resizing, changing of the color etc.
 */
class ViewItem : public DbObjectItem
{
    public:
        ViewItem(const QString &, const QString &, QMenu *, const QPoint &);
        ~ViewItem();
        virtual int type() const;

        QString name() const;
        QString schemaName() const;

        QDomElement toXml(QDomDocument &) const;
        // \todo add fromXml(...)

        void setFieldsTypesVisible(bool);
        void setIndicesVisible(bool);

    public:
        enum { Type = UserType + 8 };

    private:
        DbObjects::Common::DbViewPtr mModel;
};

ViewItem *toView(QGraphicsItem *);

#endif // VIEWEITEM_H