text:
class TokyoMetro::Api::TrainOperation::Info::BasicError

  def decorate( request , railway_line , max_delay , controller , no_train )
    decorator_class.new( request , self , railway_line , controller )
  end

  private

  def decorator_class
    raise "This method \'#{ __method__ }\' is not defined in this class \'#{ self.class }\'."
  end

end

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Windows;
using System.Windows.Media;
using Esthar.Core;

namespace Esthar
{
    internal sealed class UserTagView : DependencyObject
    {
        public UserTagView(UserTag tag)
        {
            Name = tag.Name;
            Priority = tag.Priority;
            Font = (FontDescriptorView)tag.Font;
            Foreground = tag.Foreground;
            Background = tag.Background;
            LocationBindable = tag.LocationBindable;
            MessageBindable = tag.MessageBindable;
        }

        public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(UserTagView), new PropertyMetadata(default(string)));
        public static readonly DependencyProperty PriorityProperty = DependencyProperty.Register("Priority", typeof(int), typeof(UserTagView), new PropertyMetadata(default(int)));
        public static readonly DependencyProperty FontProperty = DependencyProperty.Register("Font", typeof(FontDescriptorView), typeof(UserTagView), new PropertyMetadata(default(FontDescriptorView)));
        public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register("Foreground", typeof(Color), typeof(UserTagView), new PropertyMetadata(default(Color), OnPropertyChanged));
        public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(Color), typeof(UserTagView), new PropertyMetadata(default(Color), OnPropertyChanged));
        public static readonly DependencyProperty LocationBindableProperty = DependencyProperty.Register("LocationBindable", typeof(bool), typeof(UserTagView), new PropertyMetadata(default(bool)));
        public static readonly DependencyProperty MessageBindableProperty = DependencyProperty.Register("MessageBindable", typeof(bool), typeof(UserTagView), new PropertyMetadata(default(bool)));
        public static readonly DependencyProperty ForegroundBrushProperty = DependencyProperty.Register("ForegroundBrush", typeof(Brush), typeof(UserTagView), new PropertyMetadata(default(Brush)));
        public static readonly DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(UserTagView), new PropertyMetadata(default(Brush)));

        public string Name
        {
            get { return (string)GetValue(NameProperty); }
            set { SetValue(NameProperty, value); }
        }

        public int Priority
        {
            get { return (int)GetValue(PriorityProperty); }
            set { SetValue(PriorityProperty, value); }
        }

        public FontDescriptorView Font
        {
            get { return (FontDescriptorView)GetValue(FontProperty); }
            set { SetValue(FontProperty, value); }
        }

        public Color Foreground
        {
            get { return (Color)GetValue(ForegroundProperty); }
            set { SetValue(ForegroundProperty, value); }
        }

        public Color Background
        {
            get { return (Color)GetValue(BackgroundProperty); }
            set { SetValue(BackgroundProperty, value); }
        }

        public bool LocationBindable
        {
            get { return (bool)GetValue(LocationBindableProperty); }
            set { SetValue(LocationBindableProperty, value); }
        }

        public bool MessageBindable
        {
            get { return (bool)GetValue(MessageBindableProperty); }
            set { SetValue(MessageBindableProperty, value); }
        }

        public Brush ForegroundBrush
        {
            get { return (Brush)GetValue(ForegroundBrushProperty); }
            set { SetValue(ForegroundBrushProperty, value); }
        }

        public Brush BackgroundBrush
        {
            get { return (Brush)GetValue(BackgroundBrushProperty); }
            set { SetValue(BackgroundBrushProperty, value); }
        }

        private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            UserTagView tag = (UserTagView)d;

            if (e.Property == ForegroundProperty)
                tag.ForegroundBrush = new SolidColorBrush((Color)e.NewValue);
            else if (e.Property == BackgroundProperty)
                tag.BackgroundBrush = new SolidColorBrush((Color)e.NewValue);
            else
                throw new NotImplementedException();
        }

        public static explicit operator UserTag(UserTagView self)
        {
            return new UserTag(self.Name)
            {
                Priority = self.Priority,
                Font = (FontDescriptor)self.Font,
                Foreground = self.Foreground,
                Background = self.Background,
                LocationBindable = self.LocationBindable,
                MessageBindable = self.MessageBindable
            };
        }

        public static explicit operator UserTagView(UserTag self)
        {
            return new UserTagView(self);
        }
    }
}


text:
namespace solar{

	struct win32_cli_app_setup_params {
		MAKE_PROPERTY(win32_cli_app_setup_params, win32_cli_app_error_behavoir, assert_behavoir, win32_cli_app_error_behavoir::THROW);
		MAKE_PROPERTY(win32_cli_app_setup_params, win32_cli_app_error_behavoir, alert_behavoir, win32_cli_app_error_behavoir::THROW);
	};

	class win32_cli_app {
	private:
		win32_cli_app_setup_params _setup_params;
		HANDLE _error_handle;
		HANDLE _output_handle;
		int _error_count;

	public:
		win32_cli_app();

		void setup(const win32_cli_app_setup_params& params);
		void write_to_error_console(const std::string& message);
		int get_error_count() const;

	private:
		bool handle_assert_failed(const char* file_name, int line_number, const char* expression);
		bool handle_alert(const char* file_name, int line_number, const char* message);
		void handle_trace(const char* file_name, int line_number, bool add_newline, const char* message);
	};

}


text:
Originally published: 2006-10-20 13:28:37
Last updated: 2006-10-20 13:28:37
Author: Vaibhav Bhatia

a small script which i use to get the DHCP ip of my laptop


text:
DROP DATABASE IF EXISTS yelp_challenge_db;
CREATE DATABASE yelp_challenge_db;
use yelp_challenge_db;


text:
package com.dwarfartisan.parsec;

import org.junit.Assert;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;

/**
 * OneOf Tester.
 *
 * @author <Authors name>
 * @version 1.0
 * @since
一月 9, 2016

 */
public class OneOfTest extends Base{
    private String data = "It is a \"string\" for this unit test";

    @Before
    public void before() throws Exception {
    }

    @After
    public void after() throws Exception {
    }

    /**
     * Method: parse(State<T> s)
     */
    @Test
    public void testParse() throws Exception {
        State<Character> state = newState("hello");

        OneOf<Character> oneOf = new OneOf<>(new Character[]{'h', 'b'});

        Character c = oneOf.parse(state);

        Assert.assertEquals(c,new Character('h'));

        try{
            Character d = oneOf.parse(state);
            String message = String.format("Expect a char in %s but %c", "hello", d);
            Assert.fail(message);
        }catch (ParsecException e){
            Assert.assertTrue(true);
        }
    }

}


text:
<?php

ini_set('display_errors', 0);

/* http://steamcommunity.com/dev */
define('STEAM_API_KEY', getenv('STEAM_API_KEY'));

function http_request($url) {
	if (function_exists('curl_init')) {
		$ch = curl_init();
		curl_setopt_array($ch, array(
			CURLOPT_URL => $url,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_FOLLOWLOCATION => true
		));
		$data = curl_exec($ch);
		if (curl_error($ch)) {
			trigger_error(curl_error($ch), E_USER_ERROR);
		}
		$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
		if ($status != 200) {
			trigger_error("http_request ({$url}) failed with status code {$status} (!= 200)", E_USER_ERROR);
		}
		curl_close($ch);
		return $data;
	} else {
		return file_get_contents($url);
	}
}

function steam_api_request($method, $params=array()) {
	$params['key'] = STEAM_API_KEY;
	$params['format'] = 'json';
	$query = array();
	foreach ($params as $key => $value) {
		$query[] = urlencode($key) . '=' . urlencode($value);
	}
	return json_decode(http_request('http://api.steampowered.com/' . $method . '/?' . implode('&', $query)), true);
}

function steam_api_get_summary($steamid) {
	$result = steam_api_request('ISteamUser/GetPlayerSummaries/v0002', array('steamids' => $steamid));
	return (empty($result['response']['players'][0]) ? null : $result['response']['players'][0]);
}

function steam_api_resolve_vanity($url) {
	$result = steam_api_request('ISteamUser/ResolveVanityURL/v0001', array('vanityurl' => $url));
	return (empty($result['response']['steamid']) ? null : $result['response']['steamid']);
}

$stats = null;
function load_stats() {
	global $stats;
	if ($stats === null) {
		$day = ceil(time()/(3600*24));
		if (file_exists('stats.json.txt')) {
			$stats = json_decode(file_get_contents('stats.json.txt'), true);
			if ($day != $stats['Day']) {
				$stats = null;
			}
		}
		if (!$stats) {
			$stats = array(
				'Day' => $day,
				'SteamAPI' => array(
					'ResolveVanityURL' => 0,
					'GetPlayerSummaries' => 0
				)
			);
			save_stats();
		}
	}
}

function save_stats() {
	global $stats;
	if ($stats !== null) {
		@file_put_contents('stats.json.txt', json_encode($stats, JSON_PRETTY_PRINT));
	}
}

function send_json($data) {
	save_stats();
	header('Content-Type: application/json');
	echo json_encode($data);
	exit();
}

function send_json_error($message) {
	send_json(array('error' => $message));
}

load_stats();

if (!empty($_GET['id'])) {
	$id = $_GET['id'];

	$isVanity = true;
	if (preg_match('#(?:http://)?steamcommunity\.com/id/([^/\?&]+)#', $id, $matches)) {
		$id = urldecode($matches[1]);
	} else if (preg_match('#(?:http://)?steamcommunity\.com/profiles/(7656119\d+)#', $id, $matches)) {
		$id = $matches[1];
		$isVanity = false;
	} else if (preg_match('/^7656119\d+$/', $id)) {
		$isVanity = false;
	}

	if ($isVanity) {
		$id = steam_api_resolve_vanity($id);
		$stats['SteamAPI']['ResolveVanityURL']++;
		if (!$id) {
			send_json_error('Profile not found with that vanity url.');
		}
	}

	$statusName = array('Offline', 'Online', 'Busy', 'Away', 'Snooze', 'Looking to Trade', 'Looking to Play');
	$summary = steam_api_get_summary($id);
	$stats['SteamAPI']['GetPlayerSummaries']++;
	if (!$summary) {
		send_json_error('Profile not found.');
	} else if ($summary['communityvisibilitystate'] == 1) {
		send_json_error('Profile is private.');
	} else {
		$result = array(
			'id' => $summary['steamid'],
			'name' => $summary['personaname'],
			'avatar' => $summary['avatarmedium'],
			'status' => $statusName[$summary['personastate']]
			);
		if (isset($summary['gameid'])) {
			$result['game'] = array(
				'name' => $summary['gameextrainfo'],
				'logo' => 'https://cdn.steamstatic.com/steam/apps/' . $summary['gameid'] . '/capsule_sm_120.jpg',
				'link' => 'https://steamcommunity.com/app/' . $summary['gameid'],
				);
			$result['status'] .= ' - In-Game';
			if (isset($summary['gameserverip'])) {
				$result['game']['join'] = 'steam://connect/' . $summary['gameserverip'];
			} else if (isset($summary['lobbysteamid'])) {
				$result['game']['join'] = 'steam://joinlobby/' . $summary['gameid'] . '/' . $summary['lobbysteamid'] . '/' . $summary['steamid'];
			}
		}
		send_json($result);
	}

}

?>
<!DOCTYPE html>

		<meta charset="UTF-8">
		<title>Awesome Reconnect</title>

		<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootswatch/3.1.1.1/darkly/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/fontawesome/4.0.3/css/font-awesome.min.css">

		<link rel="stylesheet" type="text/css" href="main.css">

Awesome Reconnect

			<form class="form-inline" onsubmit="return false;">

A reconnect button for online Steam games!

				<input id="steam-id" class="form-control input-lg" type="text" placeholder="SteamID / VanityURL / CommunityURL">
				<button class="btn btn-success btn-lg" type="submit">OK</button>
			</form>

						Join

Go play games now, leave this page open, if you get disconnected come back here and rejoin.

					<button type="button" class="btn btn-warning btn-sm">Forget Me</button>

FAQ

What is this?

Insert your SteamID, the site will ping your Steam profile every minute, keeping track of the last game/server that you were playing on, allowing you to rejoin if the connection is lost.

Why create this?

I enjoy playing Awesomenauts, but sadly it lacks a rejoin button. When for some reason I lose the connection there is no way to find the same match, now, this keeps track of it for me.

Does it work with all online Steam games?

No, only with games that use Steam based servers. With supported games you will see a 'Join' button on your profile (and here) while playing.

			 Forum Topic
			 Code on GitHub

<?php echo 'Steam API requests today: ', ($stats['SteamAPI']['ResolveVanityURL'] + $stats['SteamAPI']['GetPlayerSummaries']); ?>

Created by Gonçalo Baltazar (Steam), 2014.
Using Bootstrap 3 (darkly) and Font Awesome. Powered by Steam.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="603ac9ba-72fd-49bb-bfbf-cd60a119e31f" name="Default" comment="" />
    <ignored path="Strava_to_Excel.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="Strava_to_Excel" />
  </component>
  <component name="FileEditorManager">
    <splitter split-orientation="horizontal" split-proportion="0.5805648">
      <split-first>
        <leaf>
          <file leaf-file-name="strava2excel.py" pinned="false" current-in-tab="true">
            <entry file="file://$PROJECT_DIR$/strava2excel.py">
              <provider selected="true" editor-type-id="text-editor">
                <state vertical-scroll-proportion="0.93877554">
                  <caret line="123" column="4" selection-start-line="123" selection-start-column="4" selection-end-line="123" selection-end-column="4" />
                  <folding>
                    <element signature="e#29#48#0" expanded="true" />
                  </folding>
                </state>
              </provider>
            </entry>
          </file>
        </leaf>
      </split-first>
      <split-second>
        <leaf>
          <file leaf-file-name="strava2excel.py" pinned="false" current-in-tab="true">
            <entry file="file://$PROJECT_DIR$/strava2excel.py">
              <provider selected="true" editor-type-id="text-editor">
                <state vertical-scroll-proportion="4.2244897">
                  <caret line="138" column="0" selection-start-line="138" selection-start-column="0" selection-end-line="138" selection-end-column="0" />
                  <folding>
                    <element signature="e#29#48#0" expanded="true" />
                  </folding>
                </state>
              </provider>
            </entry>
          </file>
        </leaf>
      </split-second>
    </splitter>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Python Script" />
      </list>
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/api_tests.py" />
        <option value="$PROJECT_DIR$/strava2excel.py" />
      </list>
    </option>
  </component>
  <component name="NamedScopeManager">
    <order />
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="51" />
    <option name="y" value="23" />
    <option name="width" value="1389" />
    <option name="height" value="877" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="Strava_to_Excel" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="Strava_to_Excel" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="strava2excel" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scratches" />
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="recentsLimit" value="5" />
    <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
    <property name="settings.editor.splitter.proportion" value="0.2" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="FullScreen" value="false" />
  </component>
  <component name="RunManager" selected="Python.strava2excel">
    <configuration default="false" name="api_tests" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/api_tests.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Attests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Doctests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Nosetests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Unittests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PUREUNITTEST" value="true" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="py.test">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="testToRun" value="" />
      <option name="keywords" value="" />
      <option name="params" value="" />
      <option name="USE_PARAM" value="false" />
      <option name="USE_KEYWORD" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="strava2excel" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="Strava_to_Excel" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/strava2excel.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <list size="2">
      <item index="0" class="java.lang.String" itemvalue="Python.strava2excel" />
      <item index="1" class="java.lang.String" itemvalue="Python.api_tests" />
    </list>
    <recent_temporary>
      <list size="1">
        <item index="0" class="java.lang.String" itemvalue="Python.api_tests" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="603ac9ba-72fd-49bb-bfbf-cd60a119e31f" name="Default" comment="" />
      <created>1474217570986</created>
      <option name="number" value="Default" />
      <updated>1474217570986</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="51" y="23" width="1389" height="877" extended-state="0" />
    <editor active="true" />
    <layout>
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.13318935" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3589109" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/strava2excel.py">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="70" column="25" selection-start-line="70" selection-start-column="25" selection-end-line="70" selection-end-column="25" />
          <folding>
            <element signature="e#29#48#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/strava2excel.py">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="e#29#48#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$USER_HOME$/Library/Python/3.4/lib/python/site-packages/pandas/indexes/base.py">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.4954792">
          <caret line="1946" column="0" selection-start-line="1946" selection-start-column="0" selection-end-line="1946" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/strava2excel.py">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.93877554">
          <caret line="123" column="4" selection-start-line="123" selection-start-column="4" selection-end-line="123" selection-end-column="4" />
          <folding>
            <element signature="e#29#48#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
import {
  intersection,
  keys,
  forEach,
  assign,
  mapKeys
} from 'lodash';
import * as fs from 'fs';
import * as path from 'path';
import * as assert from 'assert';
import ui from './ui';
import * as createDebug from 'debug';
import * as argParser from 'yargs';
import requireTree = require('require-tree');
import Command from './command';
import findAddons from './find-addons';
import * as dedent from 'dedent-js';
import * as dotenv from 'dotenv';

const debug = createDebug('@denali-js/cli:bootstrap');

process.on('unhandledRejection', (reason: any, promise: any) => {
  ui.warn('A promise was rejected but did not have a .catch() handler:');
  ui.warn(reason && reason.stack || reason || promise);
  throw reason;
});

/**
 * Kicks off the Denali CLI. Discovers any addons in this project, and builds a list of all commands
 * supplied by addons. It then gives each command a chance to define any command line arguments and
 * options, and then kicks off yargs. Each command should have defined itself and the appropriate
 * way to invoke itself (by default, the _run method).
 */
export default function run(projectPkg?: any)  {
  dotenv.config();
  debug('discovering commands from addons');
  let commands: { [key: string]: typeof Command } = {};
  let coreCommands: { [key: string]: typeof Command };
  let globalCommands: { [key: string]: typeof Command };
  // Special case Denali itself - we want to treat the Denali source like a local project, but it
  // won't have a dependency on Denali, so it won't be able to load core commands like build and
  // test from a local copy of Denali.  So to get the core commands, we point it to the global
  // package instead.
  let addons = findAddons(projectPkg && projectPkg.name !== '@denali-js/core');

  argParser.usage(dedent`
    Usage: denali <command> [options]

    Denali is an opinionated Node.js framework that lets you focus on shipping APIs.
  `);

  addons.forEach((addon) => {
    let addonCommands = discoverCommands(commands, addon.pkg.name, path.join(addon.distDir, 'commands'));

    debug(`found ${ keys(addonCommands).length } commands from ${ addon.pkg.name }: [ ${ keys(addonCommands).join(', ') } ] `);
    if (addon.pkg.name === '@denali-js/core') {
      assert(keys(addonCommands).length > 0, 'Denali package was found, but no core commands were found. Is your Denali installation corrupted?');
      coreCommands = addonCommands;

      let denaliInstallType: string;
      if (projectPkg && projectPkg.name !== '@denali-js/core') {
        denaliInstallType = fs.lstatSync(path.join(process.cwd(), 'node_modules', '@denali-js', 'core')).isSymbolicLink() ? 'linked' : 'local';
      } else {
        denaliInstallType = 'global';
      }
      ui.info(` | denali v${ addon.pkg.version } [${ denaliInstallType }]`);

    } else {
      commands = Object.assign(commands, addonCommands);
    }
  });

  if (coreCommands) {
    // Core commands take precedence over others
    commands = Object.assign(commands, coreCommands);
  }

  // Special-case @denali-js/cli commands
  globalCommands = discoverCommands(commands, '@denali-js/cli', path.join(__dirname, '..', 'commands'));

  // Global commands take precendence over all
  commands = Object.assign(commands, globalCommands);

  forEach(commands, (CommandClass: typeof Command, name: string): void => {
    try {
      CommandClass.configure(name, argParser, projectPkg);
    } catch (error) {
      ui.warn(`${ name } command failed to configure itself:`);
      ui.warn(error.stack);
    }
  });

  let versions = dedent`
    node ${ process.versions.node }
    openssl ${ process.versions.openssl }
  `;

  argParser
  .wrap(Math.min(100, argParser.terminalWidth()))
  .help()
  .version(versions)
  .parse(process.argv.slice(2), { projectPkg });
}

/**
 * Discover the commands that are available in the supplied directory. For any commands whose names
 * collide with previously loaded commands, namespace the older command under it's addon name.
 */
function discoverCommands(commandsSoFar: { [commandName: string]: typeof Command }, addonName: string, dir: string) {
  if (!fs.existsSync(dir)) {
    return {};
  }
  if (addonName === '@denali-js/core') {
    addonName = 'core';
  } else if (addonName.startsWith('denali-')) {
    addonName = addonName.slice('denali-'.length);
  } else if (addonName.startsWith('@denali-js/')) {
    addonName = addonName.slice('@denali-js/'.length);
  }
  // Load the commands
  let Commands: { [key: string]: typeof Command } = requireTree(dir, {
    // tslint:disable-next-line:completed-docs
    transform(obj: any) { return obj.default || obj; }
  });
  // Give commands a chance to define their own invocation name separate from the filename. Also,
  // let them know what addon they loaded from, so we can later scope their command name if it
  // collides and gets clobbered
  Commands = mapKeys(Commands, (CommandClass, commandDir) => {
    CommandClass.addon = addonName;
    return CommandClass.commandName || commandDir;
  });
  // Check for any command name collisions. In case of a collision, the older command gets moved to
  // a scoped invocation.
  intersection(keys(Commands), keys(commandsSoFar)).forEach((collidingCommandName: string) => {
    let clobberedCommand = commandsSoFar[collidingCommandName];
    commandsSoFar[clobberedCommand.addon + ':' + collidingCommandName] = clobberedCommand;
  });
  // Merge the newly discovered commands into what we have so far
  return assign(commandsSoFar, Commands);
}


text:
package io.agrest.parser.converter;

import com.fasterxml.jackson.databind.node.DoubleNode;
import com.fasterxml.jackson.databind.node.FloatNode;
import com.fasterxml.jackson.databind.node.IntNode;
import com.fasterxml.jackson.databind.node.TextNode;
import io.agrest.AgException;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class FloatConverterTest {

    @Test
    public void testConverter_Zero() {
        Float value = 0f;
        assertEquals(value, convert(value));
    }

    @Test
    public void testConverter_Integer_Zero() {
        Float value = 0f;
        assertEquals(value, convert(0));
    }

    @Test
    public void testConverter_MinValue() {
        Float value = Float.MIN_VALUE;
        assertEquals(value, convert(value));
    }

    @Test
    public void testConverter_NegativeMinValue() {
        Float value = -Float.MIN_VALUE;
        assertEquals(value, convert(value));
    }

    @Test
    public void testConverter_MaxValue() {
        Float value = Float.MAX_VALUE;
        assertEquals(value, convert(value));
    }

    @Test
    public void testConverter_NegativeMaxValue() {
        Float value = -Float.MAX_VALUE;
        assertEquals(value, convert(value));
    }

    @Test
    public void testConverter_NaN() {
        assertEquals(Float.valueOf(Float.NaN), convert("NaN"));
    }

    @Test
    public void testConverter_PositiveInfinity() {
        assertEquals(Float.valueOf(Float.POSITIVE_INFINITY), convert("Infinity"));
        assertEquals(Float.valueOf(Float.POSITIVE_INFINITY), convert("+Infinity"));
    }

    @Test
    public void testConverter_NegativeInfinity() {
        assertEquals(Float.valueOf(Float.NEGATIVE_INFINITY), convert("-Infinity"));
    }

    @Test(expected = AgException.class)
    public void testConverter_TooLarge_Positive() {
        FloatConverter.converter().value(new DoubleNode(Float.MAX_VALUE * 1.1d));
    }

    @Test(expected = AgException.class)
    public void testConverter_TooSmall_Positive() {
        FloatConverter.converter().value(new DoubleNode(Float.MIN_VALUE * 0.9d));
    }

    @Test(expected = AgException.class)
    public void testConverter_TooLarge_Negative() {
        FloatConverter.converter().value(new DoubleNode(Float.MAX_VALUE * -1.1d));
    }

    @Test(expected = AgException.class)
    public void testConverter_TooSmall_Negative() {
        FloatConverter.converter().value(new DoubleNode(Float.MIN_VALUE * -0.9d));
    }

    private Float convert(Float value) {
        return (Float) FloatConverter.converter().value(new FloatNode(value));
    }

    private Float convert(Integer value) {
        return (Float) FloatConverter.converter().value(new IntNode(value));
    }

    private Float convert(String value) {
        return (Float) FloatConverter.converter().value(new TextNode(value));
    }
}


text:
<?php
namespace PHPCommerce\Vendor\RatePAY\Service\Payment\Type;

use DateTime;
use PHPCommerce\Vendor\RatePAY\Service\Payment\Type\ContactsType;
use JMS\Serializer\Annotation\XmlRoot;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\XmlList;
use JMS\Serializer\Annotation\Type;

class CustomerType {
    const GENDER_MALE = 'M';

    const GENDER_FEMALE = 'F';

    const GENDER_UNKNOWN = 'U';

    /**
     * GmbH
     */
    const COMPANY_TYPE_GMBH = 'GMBH';

    /**
     * GmbH i.Gr (GmbH in Gründung)
     */
    const COMPANY_TYPE_GMBH_I_GR = 'GMBH-I-GR';

    /**
     * gGmbH (Gemeinnützige GmbH)
     */
    const COMPANY_TYPE_GGMBH = 'GGMBH';

    /**
     * GmbH & Co. KG
     */
    const COMPANY_TYPE_GMBH_CO_KG = 'GMBH-CO-KG';

    /**
     * OHG
     */
    const COMPANY_TYPE_OHG = 'OHG';

    /**
     * KG
     */
    const COMPANY_TYPE_KG = 'KG';

    /**
     * e.V. (Eingetragener Verein)
     */
    const COMPANY_TYPE_EV = 'EV';

    /**
     *  Eingetragene Genossenschaft
     */
    const COMPANY_TYPE_EG = 'EG';

    /**
     *  AG (Aktiengesellschaft)
     */
    const COMPANY_TYPE_AG = 'AG';

    /**
     *  UG (Unternehmergesellschaft)
     */
    const COMPANY_TYPE_UG = 'UG';

    /**
     * UG i.Gr. (Unternehmergesellschaft in Gründung)
     */
    const COMPANY_TYPE_UG_I_GR = 'UG-I-GR';

    /**
     * Einzelunternehmen
     */
    const COMPANY_TYPE_EINZELUNTERNEHMER = 'EINZELUNTERNEHMER';

    /**
     * e.K. (Eingetragener Kaufmann)
     */
    const COMPANY_TYPE_EK = 'EK';

    /**
     * Partnerschaft
     */
    const COMPANY_TYPE_PARTNERSCHAFT = 'PARTNERSCHAFT';

    /**
     * GbR
     */
    const COMPANY_TYPE_GBR = 'GBR';

    /**
     * Anstalt öffentlichen Rechts
     */
    const COMPANY_TYPE_AOR = 'AOR';

    /**
     * Körperschaft öffentlichen Rechts
     */
    const COMPANY_TYPE_KOR = 'KOR';

    /**
     * Stiftung
     */
    const COMPANY_TYPE_STIFTUNG = 'STIFTUNG';

    /**
     * andere (Sammeltyp für alle anderen Geschäftsformen)
     */
    const COMPANY_TYPE_OTHER = 'OTHER';

    /**
     * SE (Europäische Gesellschaft)
     */
    const COMPANY_TYPE_SE = 'SE';

    /**
     * SCE (Europäische Genossenschaft)
     */
    const COMPANY_TYPE_SCE = 'SCE';

    /**
     * OEG (Offene Erwerbsgesellschaft)
     */
    const COMPANY_TYPE_OEG = 'OEG';

    /**
     * Kommanditerwerbsgesellschaft
     */
    const COMPANY_TYPE_KEG = 'KEG';

    /**
     * Einfache Gesellschaft
     */
    const COMPANY_TYPE_EINFACHE_GESELLSCHAFT = 'EINFACHE-GESELLSCHAFT';

    /**
     * Kollektivgesellschaft
     */
    const COMPANY_TYPE_KOLLEKTIVGESELLSCHAFT = 'KOLLEKTIVGESELLSCHAFT';

    /**
     * Customer's first name
     * @var string
     * @SerializedName("first-name")
     */
    protected $firstName;

    /**
     * Customer's last name
     * @var string
     * @SerializedName("last-name")
     */
    protected $lastName;

    /**
     * Customer's middle name
     * @var string
     * @SerializedName("middle-name")
     */
    protected $middleName;

    /**
     * Name suffix e.g. "Sen." or "Jun."
     * @var string
     * @SerializedName("name-suffix")
     */
    protected $nameSuffix;

    /**
     * Salutation e.g. "Mr." or "Mrs."
     * @var string
     */
    protected $salutation;

    /**
     * Company name, applicable for B2B customers only
     * @var string
     * @SerializedName("company-name")
     */
    protected $companyName;

    /**
     * Customer's title, e.g. "Dr."
     * @var string
     */
    protected $title;

    /**
     * Customer's gender. If the attribute is
     * unknown, the value "U" (unknown) must be used.
     * @var string
     */
    protected $gender;

    /**
     * Customer's date of birth; applicable for
     * retail customers (B2C) only
     * @var DateTime
     * @SerializedName("date-of-birth")
     * @Type("DateTime<'Y-m-d'>")
     */
    protected $dateOfBirth;

    /**
     * Customer's IP address
     * @var string
     * @SerializedName("ip-address")
     */
    protected $ipAddress;

    /**
     * @var ContactsType
     */
    protected $contacts;

    /**
     * @var AddressType[]
     * @XmlList(entry="address")
     */
    protected $addresses;

    /**
     * @var BankAccountType
     * @SerializedName("bank-account")
     */
    protected $bankAccount;

    /**
     * @var string
     */
    protected $nationality;

    /**
     * @var bool
     * @SerializedName("customer-allow-marketing")
     */
    protected $customerAllowMarketing;

    /**
     * @var bool
     * @SerializedName("customer-allow-credit-inquiry")
     */
    protected $customerAllowCreditInquiry;

    /**
     * @var string
     * @SerializedName("vat-id")
     */
    protected $vatId;

    /**
     * @var string
     * @SerializedName("company-id")
     */
    protected $companyId;

    /**
     * City of the company's register court
     * @var string
     * @SerializedName("registry-location")
     */
    protected $registryLocation;

    /**
     * Key of the company's legal form
     * @var string
     * @SerializedName("company-type")
     */
    protected $companyType;

    /**
     * The company's internet presence
     * @var string
     * @SerializedName("homepage")
     */
    protected $homepage;

    /**
     * @return BankAccountType
     */
    public function getBankAccount()
    {
        return $this->bankAccount;
    }

    /**
     * @param BankAccountType $bankAccount
     */
    public function setBankAccount($bankAccount)
    {
        $this->bankAccount = $bankAccount;
        return $this;
    }

    /**
     * @return string
     */
    public function getNationality()
    {
        return $this->nationality;
    }

    /**
     * @param string $nationality
     */
    public function setNationality($nationality)
    {
        $this->nationality = $nationality;
        return $this;
    }

    /**
     * @return boolean
     */
    public function isCustomerAllowMarketing()
    {
        return $this->customerAllowMarketing;
    }

    /**
     * @param boolean $customerAllowMarketing
     */
    public function setCustomerAllowMarketing($customerAllowMarketing)
    {
        $this->customerAllowMarketing = $customerAllowMarketing;
        return $this;
    }

    /**
     * @return boolean
     */
    public function isCustomerAllowCreditInquiry()
    {
        return $this->customerAllowCreditInquiry == 'yes';
    }

    /**
     * @param boolean $customerAllowCreditInquiry
     */
    public function setCustomerAllowCreditInquiry($customerAllowCreditInquiry)
    {
        $this->customerAllowCreditInquiry = (!!$customerAllowCreditInquiry) ? 'yes' : 'no';
        return $this;
    }

    /**
     * @return string
     */
    public function getVatId()
    {
        return $this->vatId;
    }

    /**
     * @param string $vatId
     */
    public function setVatId($vatId)
    {
        $this->vatId = $vatId;
        return $this;
    }

    /**
     * @return string
     */
    public function getCompanyId()
    {
        return $this->companyId;
    }

    /**
     * @param string $companyId
     */
    public function setCompanyId($companyId)
    {
        $this->companyId = $companyId;
        return $this;
    }

    /**
     * @return string
     */
    public function getFirstName()
    {
        return $this->firstName;
    }

    /**
     * @param string $firstName
     */
    public function setFirstName($firstName)
    {
        $this->firstName = $firstName;
        return $this;
    }

    /**
     * @return string
     */
    public function getLastName()
    {
        return $this->lastName;
    }

    /**
     * @param string $lastName
     */
    public function setLastName($lastName)
    {
        $this->lastName = $lastName;
        return $this;
    }

    /**
     * @return string
     */
    public function getMiddleName()
    {
        return $this->middleName;
    }

    /**
     * @param string $middleName
     */
    public function setMiddleName($middleName)
    {
        $this->middleName = $middleName;
        return $this;
    }

    /**
     * @return string
     */
    public function getNameSuffix()
    {
        return $this->nameSuffix;
    }

    /**
     * @param string $nameSuffix
     */
    public function setNameSuffix($nameSuffix)
    {
        $this->nameSuffix = $nameSuffix;
        return $this;
    }

    /**
     * @return string
     */
    public function getSalutation()
    {
        return $this->salutation;
    }

    /**
     * @param string $salutation
     */
    public function setSalutation($salutation)
    {
        $this->salutation = $salutation;
        return $this;
    }

    /**
     * @return string
     */
    public function getCompanyName()
    {
        return $this->companyName;
    }

    /**
     * @param string $companyName
     */
    public function setCompanyName($companyName)
    {
        $this->companyName = $companyName;
        return $this;
    }

    /**
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @param string $title
     */
    public function setTitle($title)
    {
        $this->title = $title;
        return $this;
    }

    /**
     * @return string
     */
    public function getGender()
    {
        return $this->gender;
    }

    /**
     * @param string $gender
     */
    public function setGender($gender)
    {
        $this->gender = $gender;
        return $this;
    }

    /**
     * @return DateTime
     */
    public function getDateOfBirth()
    {
        return $this->dateOfBirth;
    }

    /**
     * @param DateTime $dateOfBirth
     */
    public function setDateOfBirth(DateTime $dateOfBirth = null)
    {
        $this->dateOfBirth = $dateOfBirth;
        return $this;
    }

    /**
     * @return string
     */
    public function getIpAddress()
    {
        return $this->ipAddress;
    }

    /**
     * @param string $ipAddress
     */
    public function setIpAddress($ipAddress)
    {
        $this->ipAddress = $ipAddress;
        return $this;
    }

    /**
     * @return ContactsType
     */
    public function getContacts()
    {
        return $this->contacts;
    }

    /**
     * @param ContactsType $contacts
     */
    public function setContacts(ContactsType $contacts)
    {
        $this->contacts = $contacts;
        return $this;
    }

    /**
     * @return AdressType[]
     */
    public function getAddresses()
    {
        return $this->addresses;
    }

    /**
     * @param AdressType[] $addresses
     */
    public function setAddresses($addresses)
    {
        $this->addresses = $addresses;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getRegistryLocation()
    {
        return $this->registryLocation;
    }

    /**
     * @param mixed $registryLocation
     * @return CustomerType
     */
    public function setRegistryLocation($registryLocation)
    {
        $this->registryLocation = $registryLocation;
        return $this;
    }

    /**
     * @return string
     */
    public function getCompanyType()
    {
        return $this->companyType;
    }

    /**
     * @param string $companyType
     * @return CustomerType
     */
    public function setCompanyType($companyType)
    {
        $this->companyType = $companyType;
        return $this;
    }

    /**
     * @return string
     */
    public function getHomepage()
    {
        return $this->homepage;
    }

    /**
     * @param string $homepage
     * @return CustomerType
     */
    public function setHomepage($homepage)
    {
        $this->homepage = $homepage;
        return $this;
    }

}


text:
**How many distinct handfuls of 7 may be drawn from a packet containing 4 blue candies, 3 green ones, 3 red, 2 orange and 1 yellow?**

The code here provided is a tool to compute the answer to this one and similar questions, both with brute force and with an enumerative combinatorics
 closed form formula.
Theoretical grounds about the closed form computations can be found here: http://arxiv.org/abs/1511.06142 .
Use the same link to cite the code.

### Python version
Based on python 3.5+. All the methods and main_example.py are back compatible with python 2.7. Use python 3 to have optimal performance (see [xrange](http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html#xrange)).

### Install
To install the required libraries, please install [pip](https://pypi.python.org/pypi/pip) and run

* `pip install -r requirements.txt`

### Testing
Unit testing with [pytest](https://docs.pytest.org/en/latest/):

* `pytest .`

### License
Counting_sub_multisets is licensed under the terms of the
[MIT](https://choosealicense.com/licenses/mit/) or any later version.


text:
export function extractVersionsFromSemver(semver) {
  semver = semver || "1.0.0"
  const [major, minor, patch] = semver.split(".").map((n) => parseInt(n, 10))
  return { major, minor, patch }
}


text:
package org.drools.compiler.integrationtests.drl;

import java.util.Collection;

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.KieUtil;
import org.drools.testcoverage.common.util.TestParametersUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class VariableTest {

    private final KieBaseTestConfiguration kieBaseTestConfiguration;

    public VariableTest(final KieBaseTestConfiguration kieBaseTestConfiguration) {
        this.kieBaseTestConfiguration = kieBaseTestConfiguration;
    }

    @Parameterized.Parameters(name = "KieBase type={0}")
    public static Collection<Object[]> getParameters() {
        return TestParametersUtil.getKieBaseCloudConfigurations(true);
    }

    @Test
    public void testVariableDeclaration() {
        final String drl = "rule KickOff\n" +
                "dialect \"mvel\"\n" +
                "when\n" +
                "then\n" +
                "int i;\n" +
                "end";

        KieUtil.getKieBuilderFromDrls(kieBaseTestConfiguration, true, drl);
    }
}


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        src/richtext/richtextindentspage.cpp
// Purpose:     Implements the rich text formatting dialog indents page.
// Author:      Julian Smart
// Modified by:
// Created:     10/3/2006 2:28:21 PM
// Copyright:   (c) Julian Smart
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#if wxUSE_RICHTEXT

#include "wx/richtext/richtextindentspage.h"

/*!
 * wxRichTextIndentsSpacingPage type definition
 */

wxIMPLEMENT_DYNAMIC_CLASS(wxRichTextIndentsSpacingPage, wxRichTextDialogPage);

/*!
 * wxRichTextIndentsSpacingPage event table definition
 */

wxBEGIN_EVENT_TABLE( wxRichTextIndentsSpacingPage, wxRichTextDialogPage )

////@begin wxRichTextIndentsSpacingPage event table entries
    EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT, wxRichTextIndentsSpacingPage::OnAlignmentLeftSelected )
    EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT, wxRichTextIndentsSpacingPage::OnAlignmentRightSelected )
    EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED, wxRichTextIndentsSpacingPage::OnAlignmentJustifiedSelected )
    EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED, wxRichTextIndentsSpacingPage::OnAlignmentCentredSelected )
    EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE, wxRichTextIndentsSpacingPage::OnAlignmentIndeterminateSelected )
    EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, wxRichTextIndentsSpacingPage::OnIndentLeftUpdated )
    EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, wxRichTextIndentsSpacingPage::OnIndentLeftFirstUpdated )
    EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, wxRichTextIndentsSpacingPage::OnIndentRightUpdated )
    EVT_COMBOBOX( ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL, wxRichTextIndentsSpacingPage::OnRichtextOutlinelevelSelected )
    EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, wxRichTextIndentsSpacingPage::OnSpacingBeforeUpdated )
    EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, wxRichTextIndentsSpacingPage::OnSpacingAfterUpdated )
    EVT_COMBOBOX( ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE, wxRichTextIndentsSpacingPage::OnSpacingLineSelected )
////@end wxRichTextIndentsSpacingPage event table entries

wxEND_EVENT_TABLE()

IMPLEMENT_HELP_PROVISION(wxRichTextIndentsSpacingPage)

/*!
 * wxRichTextIndentsSpacingPage constructors
 */

wxRichTextIndentsSpacingPage::wxRichTextIndentsSpacingPage( )
{
    Init();
}

wxRichTextIndentsSpacingPage::wxRichTextIndentsSpacingPage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create(parent, id, pos, size, style);
}

/*!
 * Initialise members
 */

void wxRichTextIndentsSpacingPage::Init()
{
    m_dontUpdate = false;

////@begin wxRichTextIndentsSpacingPage member initialisation
    m_alignmentLeft = NULL;
    m_alignmentRight = NULL;
    m_alignmentJustified = NULL;
    m_alignmentCentred = NULL;
    m_alignmentIndeterminate = NULL;
    m_indentLeft = NULL;
    m_indentLeftFirst = NULL;
    m_indentRight = NULL;
    m_outlineLevelCtrl = NULL;
    m_spacingBefore = NULL;
    m_spacingAfter = NULL;
    m_spacingLine = NULL;
    m_pageBreakCtrl = NULL;
    m_previewCtrl = NULL;
////@end wxRichTextIndentsSpacingPage member initialisation

}

/*!
 * wxRichTextIndentsSpacingPage creator
 */

bool wxRichTextIndentsSpacingPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
////@begin wxRichTextIndentsSpacingPage creation
    wxRichTextDialogPage::Create( parent, id, pos, size, style );

    CreateControls();
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
////@end wxRichTextIndentsSpacingPage creation
    return true;
}

/*!
 * Control creation for wxRichTextIndentsSpacingPage
 */

void wxRichTextIndentsSpacingPage::CreateControls()
{
////@begin wxRichTextIndentsSpacingPage content construction
    wxRichTextIndentsSpacingPage* itemRichTextDialogPage1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemRichTextDialogPage1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5);

    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW, 5);

    wxStaticText* itemStaticText6 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Alignment"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer5->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    itemBoxSizer7->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5);

    wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer7->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5);

    m_alignmentLeft = new wxRadioButton( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT, _("&Left"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
    m_alignmentLeft->SetValue(false);
    m_alignmentLeft->SetHelpText(_("Left-align text."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_alignmentLeft->SetToolTip(_("Left-align text."));
    itemBoxSizer9->Add(m_alignmentLeft, 0, wxALIGN_LEFT|wxALL, 5);

    m_alignmentRight = new wxRadioButton( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT, _("&Right"), wxDefaultPosition, wxDefaultSize, 0 );
    m_alignmentRight->SetValue(false);
    m_alignmentRight->SetHelpText(_("Right-align text."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_alignmentRight->SetToolTip(_("Right-align text."));
    itemBoxSizer9->Add(m_alignmentRight, 0, wxALIGN_LEFT|wxALL, 5);

    m_alignmentJustified = new wxRadioButton( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED, _("&Justified"), wxDefaultPosition, wxDefaultSize, 0 );
    m_alignmentJustified->SetValue(false);
    m_alignmentJustified->SetHelpText(_("Justify text left and right."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_alignmentJustified->SetToolTip(_("Justify text left and right."));
    itemBoxSizer9->Add(m_alignmentJustified, 0, wxALIGN_LEFT|wxALL, 5);

    m_alignmentCentred = new wxRadioButton( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED, _("Cen&tred"), wxDefaultPosition, wxDefaultSize, 0 );
    m_alignmentCentred->SetValue(false);
    m_alignmentCentred->SetHelpText(_("Centre text."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_alignmentCentred->SetToolTip(_("Centre text."));
    itemBoxSizer9->Add(m_alignmentCentred, 0, wxALIGN_LEFT|wxALL, 5);

    m_alignmentIndeterminate = new wxRadioButton( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE, _("&Indeterminate"), wxDefaultPosition, wxDefaultSize, 0 );
    m_alignmentIndeterminate->SetValue(false);
    m_alignmentIndeterminate->SetHelpText(_("Use the current alignment setting."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_alignmentIndeterminate->SetToolTip(_("Use the current alignment setting."));
    itemBoxSizer9->Add(m_alignmentIndeterminate, 0, wxALIGN_LEFT|wxALL, 5);

    itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);

    wxStaticLine* itemStaticLine16 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
    itemBoxSizer4->Add(itemStaticLine16, 0, wxGROW|wxLEFT|wxBOTTOM, 5);

    itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer4->Add(itemBoxSizer18, 0, wxGROW, 5);

    wxStaticText* itemStaticText19 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Indentation (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer18->Add(itemBoxSizer20, 0, wxALIGN_LEFT|wxALL, 5);

    itemBoxSizer20->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5);

    wxFlexGridSizer* itemFlexGridSizer22 = new wxFlexGridSizer(0, 2, 0, 0);
    itemBoxSizer20->Add(itemFlexGridSizer22, 0, wxALIGN_CENTER_VERTICAL, 5);

    wxStaticText* itemStaticText23 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer22->Add(itemStaticText23, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_indentLeft = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
    m_indentLeft->SetHelpText(_("The left indent."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_indentLeft->SetToolTip(_("The left indent."));
    itemFlexGridSizer22->Add(m_indentLeft, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText25 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer22->Add(itemStaticText25, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_indentLeftFirst = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
    m_indentLeftFirst->SetHelpText(_("The first line indent."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_indentLeftFirst->SetToolTip(_("The first line indent."));
    itemFlexGridSizer22->Add(m_indentLeftFirst, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText27 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer22->Add(itemStaticText27, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_indentRight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
    m_indentRight->SetHelpText(_("The right indent."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_indentRight->SetToolTip(_("The right indent."));
    itemFlexGridSizer22->Add(m_indentRight, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText29 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Outline level:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer22->Add(itemStaticText29, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxArrayString m_outlineLevelCtrlStrings;
    m_outlineLevelCtrl = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL, wxEmptyString, wxDefaultPosition, wxSize(85, -1), m_outlineLevelCtrlStrings, wxCB_READONLY );
    m_outlineLevelCtrl->SetHelpText(_("The outline level."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_outlineLevelCtrl->SetToolTip(_("The outline level."));
    itemFlexGridSizer22->Add(m_outlineLevelCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);

    wxStaticLine* itemStaticLine32 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
    itemBoxSizer4->Add(itemStaticLine32, 0, wxGROW|wxTOP|wxBOTTOM, 5);

    itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer4->Add(itemBoxSizer34, 0, wxGROW, 5);

    wxStaticText* itemStaticText35 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer34->Add(itemStaticText35, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBoxSizer* itemBoxSizer36 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer34->Add(itemBoxSizer36, 0, wxALIGN_LEFT|wxALL, 5);

    itemBoxSizer36->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5);

    wxFlexGridSizer* itemFlexGridSizer38 = new wxFlexGridSizer(30, 2, 0, 0);
    itemBoxSizer36->Add(itemFlexGridSizer38, 0, wxALIGN_CENTER_VERTICAL, 5);

    wxStaticText* itemStaticText39 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer38->Add(itemStaticText39, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_spacingBefore = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
    m_spacingBefore->SetHelpText(_("The spacing before the paragraph."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_spacingBefore->SetToolTip(_("The spacing before the paragraph."));
    itemFlexGridSizer38->Add(m_spacingBefore, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText41 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer38->Add(itemStaticText41, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_spacingAfter = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_spacingAfter->SetToolTip(_("The spacing after the paragraph."));
    itemFlexGridSizer38->Add(m_spacingAfter, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText43 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("L&ine spacing:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer38->Add(itemStaticText43, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxArrayString m_spacingLineStrings;
    m_spacingLineStrings.Add(_("(none)"));
    m_spacingLineStrings.Add(_("Single"));
    m_spacingLineStrings.Add(_("1.1"));
    m_spacingLineStrings.Add(_("1.2"));
    m_spacingLineStrings.Add(_("1.3"));
    m_spacingLineStrings.Add(_("1.4"));
    m_spacingLineStrings.Add(_("1.5"));
    m_spacingLineStrings.Add(_("1.6"));
    m_spacingLineStrings.Add(_("1.7"));
    m_spacingLineStrings.Add(_("1.8"));
    m_spacingLineStrings.Add(_("1.9"));
    m_spacingLineStrings.Add(_("2"));
    m_spacingLine = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE, _("(none)"), wxDefaultPosition, wxSize(85, -1), m_spacingLineStrings, wxCB_READONLY );
    m_spacingLine->SetStringSelection(_("(none)"));
    m_spacingLine->SetHelpText(_("The line spacing."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_spacingLine->SetToolTip(_("The line spacing."));
    itemFlexGridSizer38->Add(m_spacingLine, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pageBreakCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_PAGEBREAK, _("&Page Break"), wxDefaultPosition, wxDefaultSize, 0 );
    m_pageBreakCtrl->SetValue(false);
    m_pageBreakCtrl->SetHelpText(_("Inserts a page break before the paragraph."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_pageBreakCtrl->SetToolTip(_("Inserts a page break before the paragraph."));
    itemBoxSizer34->Add(m_pageBreakCtrl, 0, wxALIGN_LEFT|wxALL, 5);

    itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);

    m_previewCtrl = new wxRichTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxBORDER_THEME|wxVSCROLL|wxTE_READONLY );
    m_previewCtrl->SetHelpText(_("Shows a preview of the paragraph settings."));
    if (wxRichTextIndentsSpacingPage::ShowToolTips())
        m_previewCtrl->SetToolTip(_("Shows a preview of the paragraph settings."));
    itemBoxSizer3->Add(m_previewCtrl, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

////@end wxRichTextIndentsSpacingPage content construction

    wxArrayString outlineLevelCtrlStrings;
    outlineLevelCtrlStrings.Add(_("(none)"));
    outlineLevelCtrlStrings.Add("1");
    outlineLevelCtrlStrings.Add("2");
    outlineLevelCtrlStrings.Add("3");
    outlineLevelCtrlStrings.Add("4");
    outlineLevelCtrlStrings.Add("5");
    outlineLevelCtrlStrings.Add("6");
    outlineLevelCtrlStrings.Add("7");
    outlineLevelCtrlStrings.Add("8");
    outlineLevelCtrlStrings.Add("9");
    outlineLevelCtrlStrings.Add("10");

    m_outlineLevelCtrl->Freeze();
    m_outlineLevelCtrl->Append(outlineLevelCtrlStrings);
    m_outlineLevelCtrl->Thaw();
    m_outlineLevelCtrl->SetStringSelection(_("(none)"));
}

wxRichTextAttr* wxRichTextIndentsSpacingPage::GetAttributes()
{
    return wxRichTextFormattingDialog::GetDialogAttributes(this);
}

/// Updates the font preview
void wxRichTextIndentsSpacingPage::UpdatePreview()
{
    static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \
Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.\n");

    static const wxChar* s_para2 = wxT("Duis pharetra consequat dui. Cum sociis natoque penatibus \
et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.\n");

    static const wxChar* s_para3 = wxT("Integer convallis dolor at augue \
iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n");

    TransferDataFromWindow();
    wxRichTextAttr attr(*GetAttributes());
    attr.SetFlags(attr.GetFlags() &
      (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|
       wxTEXT_ATTR_LINE_SPACING|
       wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT));

    wxFont font(m_previewCtrl->GetFont());
    font.SetPointSize(9);
    m_previewCtrl->SetFont(font);

    wxRichTextAttr normalParaAttr;
    normalParaAttr.SetFont(font);
    normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY")));

    m_previewCtrl->Freeze();
    m_previewCtrl->Clear();

    m_previewCtrl->BeginStyle(normalParaAttr);
    m_previewCtrl->WriteText(s_para1);
    m_previewCtrl->EndStyle();

    m_previewCtrl->BeginStyle(attr);
    m_previewCtrl->WriteText(s_para2);
    m_previewCtrl->EndStyle();

    m_previewCtrl->BeginStyle(normalParaAttr);
    m_previewCtrl->WriteText(s_para3);
    m_previewCtrl->EndStyle();

    m_previewCtrl->Thaw();
}

/// Transfer data from/to window
bool wxRichTextIndentsSpacingPage::TransferDataFromWindow()
{
    wxPanel::TransferDataFromWindow();

    wxRichTextAttr* attr = GetAttributes();

    if (m_alignmentLeft->GetValue())
        attr->SetAlignment(wxTEXT_ALIGNMENT_LEFT);
    else if (m_alignmentCentred->GetValue())
        attr->SetAlignment(wxTEXT_ALIGNMENT_CENTRE);
    else if (m_alignmentRight->GetValue())
        attr->SetAlignment(wxTEXT_ALIGNMENT_RIGHT);
    else if (m_alignmentJustified->GetValue())
        attr->SetAlignment(wxTEXT_ALIGNMENT_JUSTIFIED);
    else
    {
        attr->SetAlignment(wxTEXT_ALIGNMENT_DEFAULT);
        attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_ALIGNMENT));
    }

    wxString leftIndent(m_indentLeft->GetValue());
    wxString leftFirstIndent(m_indentLeftFirst->GetValue());
    if (!leftIndent.empty() || !leftFirstIndent.empty())
    {
        int visualLeftIndent = 0;
        if (!leftIndent.empty())
            visualLeftIndent = wxAtoi(leftIndent);

        int visualLeftFirstIndent = wxAtoi(leftFirstIndent);
        int actualLeftIndent = visualLeftFirstIndent;
        int actualLeftSubIndent = visualLeftIndent - visualLeftFirstIndent;

        attr->SetLeftIndent(actualLeftIndent, actualLeftSubIndent);
    }
    else
        attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LEFT_INDENT));

    wxString rightIndent(m_indentRight->GetValue());
    if (!rightIndent.empty())
        attr->SetRightIndent(wxAtoi(rightIndent));
    else
        attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_RIGHT_INDENT));

    wxString spacingAfter(m_spacingAfter->GetValue());
    if (!spacingAfter.empty())
        attr->SetParagraphSpacingAfter(wxAtoi(spacingAfter));
    else
        attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_AFTER));

    wxString spacingBefore(m_spacingBefore->GetValue());
    if (!spacingBefore.empty())
        attr->SetParagraphSpacingBefore(wxAtoi(spacingBefore));
    else
        attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE));

    int spacingIndex = m_spacingLine->GetSelection() - 1;
    int lineSpacing = 0;
    if (spacingIndex > -1)
        lineSpacing = 10 + spacingIndex;

    if (lineSpacing == 0)
        attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LINE_SPACING));
    else
        attr->SetLineSpacing(lineSpacing);

    int outlineLevel = m_outlineLevelCtrl->GetSelection();
    if (outlineLevel == wxNOT_FOUND || outlineLevel == 0)
    {
        attr->SetOutlineLevel(-1);
        attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_OUTLINE_LEVEL));
    }
    else
        attr->SetOutlineLevel(outlineLevel-1);

    attr->SetPageBreak(m_pageBreakCtrl->GetValue());

    return true;
}

bool wxRichTextIndentsSpacingPage::TransferDataToWindow()
{
    m_dontUpdate = true;

    wxPanel::TransferDataToWindow();

    wxRichTextAttr* attr = GetAttributes();

    if (attr->HasAlignment())
    {
        if (attr->GetAlignment() == wxTEXT_ALIGNMENT_LEFT)
            m_alignmentLeft->SetValue(true);
        else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_RIGHT)
            m_alignmentRight->SetValue(true);
        else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
            m_alignmentCentred->SetValue(true);
        else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED)
            m_alignmentJustified->SetValue(true);
        else
            m_alignmentIndeterminate->SetValue(true);
    }
    else
        m_alignmentIndeterminate->SetValue(true);

    if (attr->HasLeftIndent())
    {
        wxString leftIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent() + attr->GetLeftSubIndent()));
        wxString leftFirstIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent()));

        m_indentLeft->SetValue(leftIndent);
        m_indentLeftFirst->SetValue(leftFirstIndent);
    }
    else
    {
        m_indentLeft->SetValue(wxEmptyString);
        m_indentLeftFirst->SetValue(wxEmptyString);
    }

    if (attr->HasRightIndent())
    {
        wxString rightIndent(wxString::Format(wxT("%ld"), attr->GetRightIndent()));

        m_indentRight->SetValue(rightIndent);
    }
    else
        m_indentRight->SetValue(wxEmptyString);

    if (attr->HasParagraphSpacingAfter())
    {
        wxString spacingAfter(wxString::Format(wxT("%d"), attr->GetParagraphSpacingAfter()));

        m_spacingAfter->SetValue(spacingAfter);
    }
    else
        m_spacingAfter->SetValue(wxEmptyString);

    if (attr->HasParagraphSpacingBefore())
    {
        wxString spacingBefore(wxString::Format(wxT("%d"), attr->GetParagraphSpacingBefore()));

        m_spacingBefore->SetValue(spacingBefore);
    }
    else
        m_spacingBefore->SetValue(wxEmptyString);

    if (attr->HasLineSpacing())
    {
        int index = 0;

        int lineSpacing = attr->GetLineSpacing();
        if (lineSpacing >= 10 && lineSpacing <= 20)
            index = (lineSpacing - 10) + 1;
        else
            index = 0;

        m_spacingLine->SetSelection(index);
    }
    else
        m_spacingLine->SetSelection(0);

    if (attr->HasOutlineLevel())
    {
        int outlineLevel = attr->GetOutlineLevel();
        if (outlineLevel < 0)
            outlineLevel = 0;
        if (outlineLevel > 9)
            outlineLevel = 9;

        m_outlineLevelCtrl->SetSelection(outlineLevel+1);
    }
    else
        m_outlineLevelCtrl->SetSelection(0);

    m_pageBreakCtrl->SetValue(attr->HasPageBreak());

    UpdatePreview();

    m_dontUpdate = false;

    return true;
}

/*!
 * Should we show tooltips?
 */

bool wxRichTextIndentsSpacingPage::ShowToolTips()
{
    return wxRichTextFormattingDialog::ShowToolTips();
}

/*!
 * Get bitmap resources
 */

wxBitmap wxRichTextIndentsSpacingPage::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin wxRichTextIndentsSpacingPage bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end wxRichTextIndentsSpacingPage bitmap retrieval
}

/*!
 * Get icon resources
 */

wxIcon wxRichTextIndentsSpacingPage::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin wxRichTextIndentsSpacingPage icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end wxRichTextIndentsSpacingPage icon retrieval
}
/*!
 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT
 */

void wxRichTextIndentsSpacingPage::OnAlignmentLeftSelected( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT
 */

void wxRichTextIndentsSpacingPage::OnAlignmentRightSelected( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED
 */

void wxRichTextIndentsSpacingPage::OnAlignmentJustifiedSelected( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED
 */

void wxRichTextIndentsSpacingPage::OnAlignmentCentredSelected( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE
 */

void wxRichTextIndentsSpacingPage::OnAlignmentIndeterminateSelected( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_TEXT event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT
 */

void wxRichTextIndentsSpacingPage::OnIndentLeftUpdated( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_TEXT event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST
 */

void wxRichTextIndentsSpacingPage::OnIndentLeftFirstUpdated( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_TEXT event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT
 */

void wxRichTextIndentsSpacingPage::OnIndentRightUpdated( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_TEXT event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE
 */

void wxRichTextIndentsSpacingPage::OnSpacingBeforeUpdated( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_TEXT event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER
 */

void wxRichTextIndentsSpacingPage::OnSpacingAfterUpdated( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_COMBOBOX event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE
 */

void wxRichTextIndentsSpacingPage::OnSpacingLineSelected( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

/*!
 * wxEVT_COMBOBOX event handler for ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL
 */

void wxRichTextIndentsSpacingPage::OnRichtextOutlinelevelSelected( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_dontUpdate)
        UpdatePreview();
}

#endif // wxUSE_RICHTEXT


text:
import React from 'react';
import Section from './Section'
// import AddSectionButton from './AddSectionButton';

export default class Chart extends React.Component {
  // static propTypes = {
  //   name: React.PropTypes.string,
  // };

  constructor(props) {
    super(props);
  }

  render() {
    var that = this;
  	const sectionsToRender = this.props.sections.map(function(section) {
	  		if(section === null || section === undefined) {
	  			return null
	  		}
	  		return <Section
          removeSection={that.props.actions.removeSection}
          key={section.id}
          id={section.id}
          name={section.name}
          numMeasures={section.numMeasures}
          measures={section.measures}
          clicked={section.clicked}
          multiplier={section.multiplier}
          multiplierClicked={section.multiplierClicked}
          addMeasure={that.props.actions.addMeasure}
          removeMeasure={that.props.actions.removeMeasure}
          markBeatAsClicked={that.props.actions.markBeatAsClicked}
          setChord={that.props.actions.setChord}
          setSectionName={that.props.actions.setSectionName}
          markSectionAsClicked={that.props.actions.markSectionAsClicked}
          moveSectionUp={that.props.actions.moveSectionUp}
          moveSectionDown={that.props.actions.moveSectionDown}
          filter={that.props.filter}
          currentKey={that.props.currentKey}
          display={that.props.display}
          markChartInfoAsClicked={that.props.actions.markChartInfoAsClicked}
          setMultiplier={that.props.actions.setMultiplier}
          markMultiplierAsClicked={that.props.actions.markMultiplierAsClicked}
          addSection={that.props.actions.addSection} />
  	})
    return (
      <div style={{
        height: '90%',
        width: '98%',
        minWidth: '900px',
        minHeight: '600px',
        // padding: '10px',
        // border: '1px dotted red',
        position: 'relative'
      }}>
      	{sectionsToRender}
      </div>
    );
  }
}


text:
/// <reference path="../../business_logic/ThreeModel.ts" />

"use strict";

class ThreeFactory
{
    constructor()
    {
    }

    getThree(): ThreeModel
    {
        return new ThreeModel();
    }
}

angular.module(app_name).service("ThreeFactory", ThreeFactory);


text:
//
//  newBigPicView.h
//  mikuWeibo
//
//  Created by mikun on 2016/12/27.
//  Copyright © 2016年 庄黛淳华. All rights reserved.
//

#import <UIKit/UIKit.h>
#define BigPicViewBGAlpha 0.9
#define predictMargin 30
@protocol newBigPicViewDelegate <NSObject>
@optional
- (void)dismissBigPicViews;
- (void)picShouldChange:(CGFloat)offsetX;
- (void)picShouldRecover;

@end

@interface newBigPicView : UIView
/** 初始化方法,不要把这个 view 加到自己的 view 上面去!! */
+(newBigPicView *)bigPicture;

/** 把图片的 superview 和需要显示的图片在这个 subviews 中的 index 整个一起发过来 ,并且从原始位置放大*/
-(void)setPicsView:(UIView *)picsView showIndex:(NSUInteger)idx;

/** 把图片的 superview 和需要显示的图片在这个 subviews 中的 index 整个一起发过来 ,没有动画,直接显示*/
-(void)preLoadPicsView:(UIView *)picsView showIndex:(NSInteger)idx;

/** 把需要显示的图片 url 发过来,并且指定消失的时候回到哪里 ,打开的时候先黑屏加载完再渐隐出来,消失的时候回到指定的地方*/
-(void)setPicURL:(NSString *)URL returnView:(UIView *)returnView returnRect:(CGRect)returnRect;

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

@end


text:
<?php

use Anomaly\Streams\Platform\Database\Migration\Migration;

/**
 * Class AnomalyExtensionUrlLinkTypeCreateUrlLinkTypeFields
 *
 * @link          http://pyrocms.com/
 * @author        PyroCMS, Inc. <support@pyrocms.com>
 * @author        Ryan Thompson <ryan@pyrocms.com>
 */
class AnomalyExtensionUrlLinkTypeCreateUrlLinkTypeFields extends Migration
{

    /**
     * The addon fields.
     *
     * @var array
     */
    protected $fields = [
        'title'       => 'anomaly.field_type.text',
        'url'         => 'anomaly.field_type.text',
        'description' => 'anomaly.field_type.textarea',
    ];

}