text:
#include <allegro.h>
#include <stdio.h>
#include <ctype.h>
#include "song.h"
#include "utility.h"	//For eof_buffer_file()
#include "ini.h"		//For eof_difficulty_ini_tags[]
#include "main.h"		//For logging
#include "ini_import.h"
#include "undo.h"
#include "foflc/Lyric_storage.h"	//For strcasestr_spec()
#include "menu/song.h"	//For eof_is_number()

#ifdef USEMEMWATCH
#include "memwatch.h"
#endif

typedef struct
{

	char type[256];
	char value[1024];

} EOF_IMPORT_INI_SETTING;

#define EOF_MAX_INI_IMPORTED_LINES 100
EOF_IMPORT_INI_SETTING eof_import_ini_setting[EOF_MAX_INI_IMPORTED_LINES];
int eof_import_ini_settings = 0;

char eof_ini_pro_drum_tag_present;		//Is set to nonzero if eof_import_ini() finds the "pro_drums = True" tag (to influence MIDI import)
char eof_ini_star_power_tag_present;	//Is set to nonzero if eof_import_ini() finds the "multiplier_note = 116" tag (to influence MIDI import)
char eof_ini_sysex_open_bass_present;	//Is set to nonzero if eof_import_ini() finds the "sysex_open_bass = True" tag (to influence MIDI import)

/* it would probably be easier to use Allegro's configuration routines to read
 * the ini files since it looks like they are formatted correctly */
int eof_import_ini(EOF_SONG * sp, char * fn, int function)
{
	char * textbuffer = NULL;
	char * line_token = NULL;
	char * token;
	char * equals = NULL;
	int i;
	int j;
	unsigned long stringlen, tracknum;
	char setting_stored;
	char *value_index;
	char status;

	eof_log("eof_import_ini() entered", 1);

	eof_ini_pro_drum_tag_present = 0;	//Reset this condition to false
	eof_ini_star_power_tag_present = 0;	//Reset this condition to false
	eof_ini_sysex_open_bass_present = 0;//Reset this condition to false

	if(!sp || !fn)
	{
		return 0;
	}
	eof_log("\tBuffering INI file into memory", 1);
	eof_import_ini_settings = 0;
	textbuffer = (char *)eof_buffer_file(fn, 1);	//Buffer the INI file into memory, adding a NULL terminator at the end of the buffer
	if(!textbuffer)
	{
		eof_log("\tCannot open INI file, skipping", 1);
		return 0;
	}
	eof_log("\tTokenizing INI file buffer", 1);
	(void) ustrtok(textbuffer, "\r\n");
	eof_log("\tParsing INI file buffer", 1);
	while(1)
	{	//While the INI file hasn't been exhausted
		line_token = ustrtok(NULL, "\r\n");	//Return the next line
		if(!line_token)
		{	//If there isn't another line
			break;
		}
		else
		{	//If there is another line
			if(ustrlen(line_token) > 6)
			{	//If the line is at least 7 characters long
				/* find the first '=' */
				for(i = 0; i < ustrlen(line_token); i++)
				{
					if(ugetc(&line_token[uoffset(line_token, i)]) == '=')
					{
						equals = &line_token[uoffset(line_token, i)];
						break;
					}
				}

				/* if this line has an '=', process line as a setting */
				if(equals)
				{
					if(eof_import_ini_settings == EOF_MAX_INI_IMPORTED_LINES)
						break;	//Break from while loop if the eof_import_ini_setting[] array is full

					equals[0] = '\0';
					token = equals + 1;
					(void) ustrncpy(eof_import_ini_setting[eof_import_ini_settings].type, line_token, 256-1);
					(void) ustrncpy(eof_import_ini_setting[eof_import_ini_settings].value, token, 1024-1);
					while(1)
					{	//Drop all trailing space characters from the tag type string
						stringlen = ustrlen(eof_import_ini_setting[eof_import_ini_settings].type);
						if(stringlen < 1)
							break;
						if(eof_import_ini_setting[eof_import_ini_settings].type[stringlen - 1] == ' ')
						{	//If the last character in this tag type is a space character, truncate it to simplify the tag matching below
							eof_import_ini_setting[eof_import_ini_settings].type[stringlen - 1] = '\0';
						}
						else
							break;
					}
					if(eof_import_ini_setting[eof_import_ini_settings].type[0] != '\0')
					{	//If the type string wasn't just space characters up to the equal sign, add the INI setting
						eof_import_ini_settings++;
					}
				}
			}//If the line is at least 7 characters long
		}//If there is another line
	}//While the INI file hasn't been exhausted
	eof_log("\tProcessing INI file contents", 1);
	for(i = 0; i < eof_import_ini_settings; i++)
	{	//For each imported INI setting
		if(eof_import_ini_setting[i].type[0] == '\0')
			continue;	//Skip this INI type if its string is empty

		value_index = eof_import_ini_setting[i].value;	//Prepare to skip leading whitespace
		while((*value_index != '\0') && (*value_index == ' '))
		{	//If this is a space character
			value_index++;	//Point to the next character
		}

		if(*value_index != '\0')
		{	//If the value portion of the entry has content
			if(!ustricmp(eof_import_ini_setting[i].type, "artist"))
			{
				if(!ustricmp(value_index, "Unknown Artist"))
				{	//If this is EOF's placeholder for an undefined artist field
					if(ustricmp(sp->tags->artist, "Unknown Artist"))
					{	//If the project doesn't explicitly list this as the artist field
						value_index[0] = '\0';	//Make it an empty string so it can be compared against the string already in the project
					}
				}
				if(eof_compare_set_ini_string_field(sp->tags->artist, value_index, 256-1, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "name"))
			{
				if(!ustricmp(value_index, "Untitled"))
				{	//If this is EOF's placeholder for an undefined song title field
					if(ustricmp(sp->tags->title, "Untitled"))
					{	//If the project doesn't explicitly list this as the song title field
						value_index[0] = '\0';	//Make it an empty string so it can be compared against the string already in the project
					}
				}
				if(eof_compare_set_ini_string_field(sp->tags->title, value_index, 256-1, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "frets"))
			{
				if(eof_compare_set_ini_string_field(sp->tags->frettist, value_index, 256-1, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "album"))
			{
				if(eof_compare_set_ini_string_field(sp->tags->album, value_index, 256-1, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "year"))
			{
				unsigned long index;
				if(eof_is_number(value_index))
				{	//If the number is a valid year (all numerical characters)
					value_index[4] = '\0';	//Ensure the number is truncated to 4 characters
					if(eof_compare_set_ini_string_field(sp->tags->year, value_index, 32-1, &function, eof_import_ini_setting[i].type))
					{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
						free(textbuffer);	//Free buffered INI file from memory
						return 0;
					}
				}
				else
				{		//If there are non numerical characters
					if(eof_compare_set_ini_string_setting(sp, "year", value_index, &function, eof_import_ini_setting[i].type))	//Add the year as a custom INI setting
					{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
						free(textbuffer);	//Free buffered INI file from memory
						return 0;
					}
				}
				if(eof_find_ini_setting_tag(sp, &index, "year") && (sp->tags->year[0] != '\0'))
				{	//If the project has both a "year" custom INI setting AND a "year" numerical setting
					allegro_message("Warning:  This project contains both a numerical and a non numerical year tag, one should be removed manually");
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "loading_phrase"))
			{
				if(eof_compare_set_ini_string_field(sp->tags->loading_text, value_index, 512-1, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "lyrics"))
			{
				if(eof_compare_set_ini_boolean(&status, sp->tags->lyrics, value_index, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
				sp->tags->lyrics = status;
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "eighthnote_hopo"))
			{
				if(eof_compare_set_ini_boolean(&status, sp->tags->eighth_note_hopo, value_index, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
				sp->tags->eighth_note_hopo = status;
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "delay"))
			{
				long value;
				if(eof_compare_set_ini_integer(&value, sp->tags->ogg[eof_selected_ogg].midi_offset, value_index, &function, eof_import_ini_setting[i].type))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
				if(value < 0)
				{	//If the converted MIDI delay was negative
					value = 0;
				}
				sp->tags->ogg[0].midi_offset = value;
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "score"))
			{
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "scores"))
			{
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "scores_ext"))
			{
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "real_guitar_tuning"))
			{
				unsigned long tracknum = sp->track[EOF_TRACK_PRO_GUITAR]->tracknum;			//The 22 fret pro guitar track if it is populated, otherwise the 17 fret track if it is populated
				if(eof_compare_set_ini_pro_guitar_tuning(sp->pro_guitar_track[tracknum], value_index, &function))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "real_guitar_22_tuning"))
			{
				unsigned long tracknum = sp->track[EOF_TRACK_PRO_GUITAR_22]->tracknum;
				if(eof_compare_set_ini_pro_guitar_tuning(sp->pro_guitar_track[tracknum], value_index, &function))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "real_bass_tuning"))
			{
				unsigned long tracknum = sp->track[EOF_TRACK_PRO_BASS]->tracknum;
				if(eof_compare_set_ini_pro_guitar_tuning(sp->pro_guitar_track[tracknum], value_index, &function))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "real_bass_22_tuning"))
			{
				unsigned long tracknum = sp->track[EOF_TRACK_PRO_BASS_22]->tracknum;
				if(eof_compare_set_ini_pro_guitar_tuning(sp->pro_guitar_track[tracknum], value_index, &function))
				{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
					free(textbuffer);	//Free buffered INI file from memory
					return 0;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "pro_drums"))
			{
				int func = 0;
				(void) eof_compare_set_ini_boolean(&status, 0, value_index, &func, eof_import_ini_setting[i].type);	//Check if this tag's value is "True" or "1"
				if(status)
				{
					eof_ini_pro_drum_tag_present = 1;
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "five_lane_drums"))
			{
				int func = 0;
				(void) eof_compare_set_ini_boolean(&status, 0, value_index, &func, eof_import_ini_setting[i].type);	//Check if this tag's value is "True" or "1"
				if(status)
				{
					tracknum = sp->track[EOF_TRACK_DRUM]->tracknum;
					sp->track[EOF_TRACK_DRUM]->flags |= EOF_TRACK_FLAG_SIX_LANES;	//Set the five lane drum flag
					sp->legacy_track[tracknum]->numlanes = 6;						//Set the lane count
					tracknum = sp->track[EOF_TRACK_DRUM_PS]->tracknum;
					sp->track[EOF_TRACK_DRUM_PS]->flags |= EOF_TRACK_FLAG_SIX_LANES;	//Set the five lane drum flag for the PS drum track
					sp->legacy_track[tracknum]->numlanes = 6;							//Set the lane count
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "multiplier_note"))
			{
				int func = 0;
				(void) eof_compare_set_ini_boolean(&status, 0, value_index, &func, eof_import_ini_setting[i].type);	//Check if this tag's value is "True" or "1"
				if(status)
				{
					eof_ini_star_power_tag_present = 1;	//MIDI import won't have to convert solos phrases to star power, EOF's notation for star power style phrases was found
				}
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "sysex_open_bass"))
			{
				int func = 0;
				(void) eof_compare_set_ini_boolean(&status, 0, value_index, &func, eof_import_ini_setting[i].type);	//Check if this tag's value is "True" or "1"
				if(status)
				{
					eof_ini_sysex_open_bass_present = 1;	//MIDI import will interpret forced HOPO lane 1 bass to be a HOPO bass gem and not an open strum
				}
			}

			//Other tags ignored by INI import because they are only informational about EOF's exported MIDIs
			else if(!ustricmp(eof_import_ini_setting[i].type, "sysex_pro_slide") || !ustricmp(eof_import_ini_setting[i].type, "sysex_high_hat_ctrl") || !ustricmp(eof_import_ini_setting[i].type, "sysex_rimshot") || !ustricmp(eof_import_ini_setting[i].type, "sysex_slider"))
			{	//These Sysex indicators are only used by Phase Shift
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "star_power_note"))
			{	//Used by Phase Shift
			}
			else if(!ustricmp(eof_import_ini_setting[i].type, "song_length"))
			{	//Used by one or more unnamed rhythm games
			}

			/* for custom settings or difficulty strings */
			else
			{
				setting_stored = 0;
				for(j = 0; (j < EOF_TRACKS_MAX) && (j < sp->tracks); j++)
				{	//For each string in the eof_difficulty_ini_tags[] array (for each currently supported track number)
					if(eof_difficulty_ini_tags[j] && !ustricmp(eof_import_ini_setting[i].type, eof_difficulty_ini_tags[j]))
					{	//If this INI setting matches the difficulty tag, store the difficulty value into the appropriate track structure
						long value;
						long original = sp->track[j]->difficulty;
						if(original == 0xFF)
						{	//If the project does not have this difficulty defined
							original = -1;	//Convert it to -1 so it can be accurately compared to the value in the INI file
						}
						if(atoi(value_index) >= 0)
						{	//Only store the difficulty if it isn't negative (-1 means empty track)
							if(eof_compare_set_ini_integer(&value, original, value_index, &function, eof_import_ini_setting[i].type))
							{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
								free(textbuffer);	//Free buffered INI file from memory
								return 0;
							}
							if((value < 0) || (value > 6))		//If the difficulty is invalid
								value = 0xFF;					//Reset to undefined
							sp->track[j]->difficulty = value;
						}
						setting_stored = 1;	//Consider this INI tag handled (if it was -1, it will be dropped instead of being stored as a custom INI tag)
						break;
					}
				}
				if(!setting_stored)
				{
					if(!ustricmp(eof_import_ini_setting[i].type, "diff_drums_real"))
					{	//If this is a pro drum difficulty tag
						long value;
						long original = (sp->track[EOF_TRACK_DRUM]->flags & 0x0F000000) >> 24;
						if(original == 0xF)
						{	//If the project does not have this difficulty defined
							original = -1;	//Convert it to -1 so it can be accurately compared to the value in the INI file
						}
						if(eof_compare_set_ini_integer(&value, original, value_index, &function, eof_import_ini_setting[i].type))
						{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
							free(textbuffer);	//Free buffered INI file from memory
							return 0;
						}
						if((value < 0) || (value > 6))		//If the difficulty is invalid
							value = 0xF;					//Reset to undefined
						sp->track[EOF_TRACK_DRUM]->flags &= ~(0x0F << 24);	//Clear the lower nibble of the drum track's flag's most significant byte
						sp->track[EOF_TRACK_DRUM]->flags |= ((unsigned long)value << 24);	//Store the pro drum difficulty in the drum track's flag's most significant byte
					}
					else if(!ustricmp(eof_import_ini_setting[i].type, "diff_vocals_harm"))
					{	//If this is a harmony difficulty tag
						long value;
						long original = (sp->track[EOF_TRACK_VOCALS]->flags & 0x0F000000) >> 24;
						if(original == 0xF)
						{	//If the project does not have this difficulty defined
							original = -1;	//Convert it to -1 so it can be accurately compared to the value in the INI file
						}
						if(eof_compare_set_ini_integer(&value, original, value_index, &function, eof_import_ini_setting[i].type))
						{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
							free(textbuffer);	//Free buffered INI file from memory
							return 0;
						}
						if((value < 0) || (value > 6))		//If the difficulty is invalid
							value = 0xF;					//Reset to undefined
						sp->track[EOF_TRACK_VOCALS]->flags &= ~(0x0F << 24);	//Clear the low nibble of the vocal track's flag's most significant byte
						sp->track[EOF_TRACK_VOCALS]->flags |= ((unsigned long)value << 24);	//Store the pro drum difficulty in the drum track's flag's most significant byte
					}
					else if(!ustricmp(eof_import_ini_setting[i].type, "diff_band"))
					{	//If this is a band difficulty tag
						long value;
						if(eof_compare_set_ini_integer(&value, sp->tags->difficulty, value_index, &function, eof_import_ini_setting[i].type))
						{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
							free(textbuffer);	//Free buffered INI file from memory
							return 0;
						}
						if((value < 0) || (value > 6))		//If the difficulty is invalid
							value = 0xFF;					//Reset to undefined
						sp->tags->difficulty = value;
					}
					else
					{	//Store it as a custom INI setting
						if(eof_compare_set_ini_string_setting(sp, eof_import_ini_setting[i].type, value_index, &function, eof_import_ini_setting[i].type))
						{	//If the INI file is being merged with the project and the user did not want the project's setting replaced
							free(textbuffer);	//Free buffered INI file from memory
							return 0;
						}
					}
				}
			}
		}//If the value portion of the entry has content
	}//For each imported INI setting
	eof_log("\tFreeing INI buffer", 1);
	free(textbuffer);	//Free buffered INI file from memory
	return 1;
}

int eof_compare_set_ini_string_field(char *dest, char *src, unsigned long maxchars, int *function, char *tag)
{
	if(!dest || !src || !function || !tag)
		return 1;	//Return error

	if(ustricmp(dest, src))
	{	//If the strings don't match
		if(*function)
		{	//If the calling function wanted to check for differences and prompt the user to overwrite
			(void) snprintf(eof_log_string, sizeof(eof_log_string) - 1, "Song property \"%s\" altered in INI file", tag);
			eof_log(eof_log_string, 1);
			eof_clear_input();
			if(alert("Warning:  The INI file has been externally edited.", "Merge its changes with the active project?", NULL, "&Yes", "&No", 'y', 'n') != 1)
			{	//If the user did not opt to merge the changes into the project
				return 1;	//Return user cancellation
			}
			eof_prepare_undo(EOF_UNDO_TYPE_NONE);
			*function = 0;	//Disable any further user prompting regarding this INI file
		}

		(void) ustrncpy(dest, src, (int)maxchars);	//Copy the string
	}
	return 0;
}

int eof_compare_set_ini_boolean(char *status, char original, char *string, int *function, char *tag)
{
	if(!status || !string || !function || !tag)
		return 1;	//Return error

	if(!ustricmp(string, "True") || !ustricmp(string, "1"))
	{	//If the string indicates a true status
		*status = 1;
	}
	else
	{
		*status = 0;
	}

	if(*function && (*status != original))
	{	//If the determined boolean status does not match the supplied original value, and the calling function wanted to prompt the user in such a case
		(void) snprintf(eof_log_string, sizeof(eof_log_string) - 1, "Song boolean \"%s\" altered in INI file", tag);
		eof_log(eof_log_string, 1);
		eof_clear_input();
		if(alert("Warning:  The INI file has been externally edited.", "Merge its changes with the active project?", NULL, "&Yes", "&No", 'y', 'n') != 1)
		{	//If the user did not opt to merge the changes into the project
			return 1;	//Return user cancellation
		}
		eof_prepare_undo(EOF_UNDO_TYPE_NONE);
		*function = 0;	//Disable any further user prompting regarding this INI file
	}
	return 0;
}

int eof_compare_set_ini_string_setting(EOF_SONG *sp, char *tag, char *value, int *function, char *logtag)
{
	unsigned long index;
	char *ptr;
	char alter = 0, add = 0;

	if(!sp || !tag || !value || !function)
		return 1;	//Return error

	index = sp->tags->ini_settings;	//If no match is found, the setting will be appended to the list
	ptr = eof_find_ini_setting_tag(sp, &index, tag);	//Find the specified INI tag in the project if it exists
	if(ptr)
	{	//If the target INI setting was found in the project
		for(;(*ptr != '\0') && isspace(*ptr);ptr++);	//Skip whitespace following the equal sign
		if(ustricmp(ptr, value))
		{	//If the INI setting's tag value doesn't match the value specified
			alter = 1;	//Note that an existing INI setting will be altered
		}
	}
	else
	{	//If the INI setting was not in the project
		add = 1;	//Note that a new INI setting will be added
	}

	if(alter || add)
	{	//If any INI setting is being altered or added
		if(alter)
		{
			(void) snprintf(eof_log_string, sizeof(eof_log_string) - 1, "Song INI setting \"%s\" altered in INI file", logtag);
		}
		else
		{
			(void) snprintf(eof_log_string, sizeof(eof_log_string) - 1, "Song INI setting \"%s\" added in INI file", logtag);
		}
		eof_log(eof_log_string, 1);
		if(*function)
		{	//If the calling function wanted to prompt the user before changing/adding an INI setting
			eof_clear_input();
			if(alert("Warning:  The INI file has been externally edited.", "Merge its changes with the active project?", NULL, "&Yes", "&No", 'y', 'n') != 1)
			{	//If the user did not opt to merge the changes into the project
				return 1;	//Return user cancellation
			}
			eof_prepare_undo(EOF_UNDO_TYPE_NONE);
			*function = 0;	//Disable any further user prompting regarding this INI file
		}

		//Replace the existing INI setting or append it to the list of INI settings as appropriate
		if(index < EOF_MAX_INI_SETTINGS)
		{	//If the maximum number of INI settings isn't already defined
			(void) snprintf(sp->tags->ini_setting[index], sizeof(sp->tags->ini_setting[index]) - 1, "%s = %s", tag, value);
			if(index >= sp->tags->ini_settings)
			{	//If this was a newly-added setting
				sp->tags->ini_settings++;	//Increment the counter
			}
		}
	}

	return 0;
}

int eof_compare_set_ini_pro_guitar_tuning(EOF_PRO_GUITAR_TRACK *tp, char *string, int *function)
{
	unsigned long ctr = 0, ctr2;
	char tuning[EOF_TUNING_LENGTH] = {0};
	char * line_token = NULL;

	if(!tp || !string || !function)
		return 1;	//Return error

	line_token = ustrtok(string, " \r\n");	//Find first token (string of characters that isn't whitespace, carriage return or newline)
	while(line_token != NULL)
	{	//For each string tuning that is parsed
		if(line_token[0] == '"')
			break;	//Stop parsing if the tuning name string has been reached
		if(ctr >= EOF_TUNING_LENGTH)
			break;	//Do not read more string tunings than are supported
		tuning[ctr] = atol(line_token) % 12;	//Convert the string to an integer value
		ctr++;	//Increment the counter
		line_token = ustrtok(NULL, " \r\n");	//Find next token
	}

	if(*function)
	{	//If the calling function wanted to check for differences and prompt the user to overwrite
		char changes = 0;
		if((ctr < 4 || ctr > 6))
		{	//If the number of strings defined isn't supported
			allegro_message("Warning:  Invalid pro guitar tuning tag.  Reverting to 6 string standard tuning.");
			ctr = 6;
			memset(tuning, 0, EOF_TUNING_LENGTH);
		}
		for(ctr2 = 0; ctr2 < ctr; ctr2++)
		{	//For each string tuning parsed
			if(tuning[ctr2] != tp->tuning[ctr2])
			{	//If this tuning is different from what's already in the project
				changes = 1;
				break;
			}
		}
		if(changes || (ctr != tp->numstrings))
		{	//If the INI tag defined a different number of strings, or a different tuning for any of them
			eof_log("Pro guitar/bass tuning tag altered in INI file", 1);
			eof_clear_input();
			if(alert("Warning:  The INI file has been externally edited.", "Merge its changes with the active project?", NULL, "&Yes", "&No", 'y', 'n') != 1)
			{	//If the user did not opt to merge the changes into the project
				return 1;	//Return user cancellation
			}
			eof_prepare_undo(EOF_UNDO_TYPE_NONE);
		}
		*function = 0;	//Disable any further user prompting regarding this INI file
	}

	tp->numstrings = ctr;	//Define the number of strings in the track based on the tuning tag
	memcpy(tp->tuning, tuning, EOF_TUNING_LENGTH);	//Copy the tuning array
	return 0;
}

int eof_compare_set_ini_integer(long *value, long original, char *string, int *function, char *tag)
{
	if(!value || !string || !function)
		return 1;	//Return error

	*value = atoi(string);

	if(*function && (*value != original))
	{	//If the converted number does not match the supplied original value, and the calling function wanted to prompt the user in such a case
		(void) snprintf(eof_log_string, sizeof(eof_log_string) - 1, "Song property \"%s\" altered in INI file", tag);
		eof_log(eof_log_string, 1);
		eof_clear_input();
		if(alert("Warning:  The INI file has been externally edited.", "Merge its changes with the active project?", NULL, "&Yes", "&No", 'y', 'n') != 1)
		{	//If the user did not opt to merge the changes into the project
			return 1;	//Return user cancellation
		}
		eof_prepare_undo(EOF_UNDO_TYPE_NONE);
		*function = 0;	//Disable any further user prompting regarding this INI file
	}
	return 0;
}

char *eof_find_ini_setting_tag(EOF_SONG *sp, unsigned long *index, char *tag)
{
	unsigned long ctr;
	char buffer[512] = {0};
	char *ptr;

	if(!sp || !index || !tag)
		return NULL;	//Return error

	(void) snprintf(buffer, sizeof(buffer) - 1, "%s =", tag);	//Build the left half of the string that results from this INI setting
	for(ctr = 0; ctr < sp->tags->ini_settings; ctr++)
	{	//For each INI setting in the project
		ptr = strcasestr_spec(sp->tags->ini_setting[ctr], buffer);	//If this INI setting matches the specified tag, get the address of the first character after the equal sign
		if(ptr)
		{	//If this INI setting contains the specified tag
			*index = ctr;	//Store the INI setting number containing this tag
			return ptr;
		}
	}

	return NULL;	//No match found
}


text:
<!DOCTYPE html>

<title>CSS3 | backgrounds and borders</title>

Patterns above and below should be identical

redpajama_set_name: RedPajamaGithub


text:
// Copyright 2016 InWorldz Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InWorldz.PrimExporter.ExpLib.ImportExport
{
    /// <summary>
    /// Statistics relating to exported objects
    /// </summary>
    public class ExportStats
    {
        /// <summary>
        /// The number of concrete multi-meshes
        /// </summary>
        public int ConcreteCount { get; set; }

        /// <summary>
        /// The number of multi-mesh instances
        /// </summary>
        public int InstanceCount { get; set; }

        /// <summary>
        /// Count of all submeshes
        /// </summary>
        public int SubmeshCount { get; set; }

        /// <summary>
        /// Number of unique textures
        /// </summary>
        public int TextureCount { get; set; }

        /// <summary>
        /// The number of non-instanced primitives
        /// </summary>
        public int PrimCount { get; set; }

        /// <summary>
        /// A list of all groups and their prim counts
        /// </summary>
        public List<Tuple<string, int>> GroupsByPrimCount { get; set; } = new List<Tuple<string, int>>();

        /// <summary>
        /// A list of all groups and their submesh counts
        /// </summary>
        public List<Tuple<string, int>> GroupsBySubmeshCount { get; set; } = new List<Tuple<string, int>>();
    }
}


text:
// appjetContext.cache_requestCache()._t_start = (new Date()).valueOf();
var _appjethidden_ = {};
var serverhandlers = { tasks: {} };

/*
 * @overview
 *
 * AppJet standard library preamble.
 *
 * This is run at the beginning of every request, right after all
 * native calls are loaded into appjetContext.  This file is run
 * in the same scope as the app, the global scope, which is also
 * accessible from all modules.
 */

//----------------------------------------------------------------
// delete pesky rhino built-in string stuff
//----------------------------------------------------------------
(function() {
  // rhino strings come with a bunch of random "html helpers"
  // that we don't want
  var htmlStuff = ["bold", "italics", "fixed", "strike",
    "small", "big", "sub", "fontsize", "fontcolor", "link",
    "anchor", "sup", "blink"];
  for(var i in htmlStuff) {
    delete String.prototype[htmlStuff[i]];
  }
})();

//----------------------------------------------------------------
// module implementation
//----------------------------------------------------------------

(function(globalScope) {

   //----------------------------------------------------------------
   // Utility Functions
   //----------------------------------------------------------------
   function appjetContext() {
     return net.appjet.oui.ExecutionContextUtils.currentContext();
   }
   function internalError(m) {
     throw new Error("AppJet Internal Error: "+m);
   }
   function apiError(m) {
     throw new Error("AppJet API Error: "+m);
   }
   function newScope() {
     var o = new Object();
     o.__parent__ = null;
     o.__proto__ = globalScope;
     return o;
   }
   _appjethidden_._debugMessage = function(m) {
     //java.lang.System.out.println(m);
   };
   var debug = _appjethidden_._debugMessage;
   function copySymbol(srcName, symName, src, dst, dstSymName) {
     if (!src.hasOwnProperty(symName)) {
       apiError("Import error: module \""+srcName+"\" does not contain the symbol \""+symName+"\".");
     }
     if (symName.charAt(0) == '_') {
       apiError("Import error: cannot import symbol \""+symName+"\" because it is private (begins with _)");
     }
     debug("  | copying symbol ["+symName+"]");
     dst[dstSymName || symName] = src[symName];
   }
   function copyPublicSymbols(src, dst) {
     for (k in src) {
       if (src.hasOwnProperty(k) && (k.length > 0) && (k.charAt(0) != '_')) {
         copySymbol('', k, src, dst);
       }
     }
   }

   // Module import cache... hidden from other scopes.
   var moduleObjects = {};
   var modulesBeingLoaded = {};

   /*--------------------------------------------------------------------------------
    * loadModule():
    *   Evaluates moduleName in its own private scope, then copies its public identifiers
    *   into a new scope.  This new scope is stored in moduleObjects[moduleName] for future use
    *   by import()s.
    *
    *   If moduleName is currently being loaded (because we are in the middle of another loadModule()
    *   higher in the call stack), then this function does noething, on the assumption
    *   that moduleName will eventually be loaded anyway.  Therefore, it cannot be assumed that
    *   moduleName is done being loaded when loadModule() returns, only that it eventually will be
    *   loaded when all loadModule calls return up the call stack.
    *--------------------------------------------------------------------------------*/
   function loadModule(moduleName) {
     if (modulesBeingLoaded[moduleName]) {
       // This is OK.  The module will be loaded eventually.
       return;
     }
     if (moduleObjects[moduleName]) {
       return;
     }
     modulesBeingLoaded[moduleName] = true;
     try {
       debug("loadModule: "+moduleName);

       var modulePrivateScope =
         Packages.net.appjet.ajstdlib.ajstdlib.runModuleInNewScope(
            appjetContext(), moduleName.split('.').join('/'));

       if (!modulePrivateScope) {
         // moduleName is not a module.  This is normal, because when someone calls
         // import("foo.bar"), we dont know if bar is a module or an identifier in the foo module.
         delete modulesBeingLoaded[moduleName];
         return;
       }
       // Thinking this could be useful:
       // modulePrivateScope['__MODULE_NAME__'] = moduleName;
       var moduleObj = newScope();
       copyPublicSymbols(modulePrivateScope, moduleObj);
       moduleObjects[moduleName] = moduleObj;
     } finally {
       delete modulesBeingLoaded[moduleName];
     }
   }

   /*--------------------------------------------------------------------------------
    * importSingleModule():
    *
    *   Takes a single moduleName (like "etherpad.foo.bar.baz") and creates the identifier "baz"
    *   in dstScope, referencing the module etherpad.foo.bar.baz.
    *
    *   This function is called one or more times by importPath().  Note that importPath() is more like
    *   the import() function that modules ses.
    *--------------------------------------------------------------------------------*/
   function importSingleModule(moduleName, dstScope) {
     debug("importSingleModule: "+moduleName);
     if (typeof(moduleName) != 'string') {
       apiError("modules should be referred to with string, not "+typeof(moduleName));
     }

     var moduleObj = moduleObjects[moduleName]; // public module scope
     if (!moduleObj) {
       return false;
     }

     var importedName = moduleName;
     if (importedName.indexOf(".") != -1) {
       importedName = importedName.split(".").slice(-1)[0];
     }
     dstScope[importedName] = moduleObj;
     return true;
   }

   /*--------------------------------------------------------------------------------
    * importPath():
    *   takes a modulePath (like "a.b.c.{d,e,f}" or "a.b.*" or just "a.b" or "a") and
    *   repeatedly calls importSingleModule() as necessary, copying public symbols into dst.
    *--------------------------------------------------------------------------------*/
   function importPath(modulePath, dst) {
     debug("importPath: "+modulePath);

     // Two possibilties:
     //   1. import the exact module and that's it.
     //
     //   2. module contains a "." and we need to import up to the
     //      last ., and then import a name (or set of names) from it.

     // first try case 1:
     var ok = importSingleModule(modulePath, dst);
     if (ok) {
       return;
     }

     if (modulePath.indexOf(".") == -1) {
       throw new Error("Module does not exist: "+modulePath);
     }

     // now try case 2:
     var tempDst = newScope();
     var moduleName = modulePath.split('.').slice(0, -1).join('.');
     var importedName = modulePath.split('.').slice(-1)[0];
     var lastName = modulePath.split('.').slice(-2, -1)[0];

     ok = importSingleModule(moduleName, tempDst);
     if (!ok) {
       throw new Error("Neither module exists: "+moduleName+", "+modulePath);
     }

     if (!tempDst[lastName]) {
       internalError("import failed for "+moduleName+"|"+importedName+". This could be an appjet bug.");
     }
     if (importedName == "*") {
       copyPublicSymbols(tempDst[lastName], dst);
     } else if (importedName.match(/^\{.*\}$/)) {
       importedName.slice(1,-1).split(',').forEach(function(sym) {
         if (sym.match(/^.*=>.*$/)) {
           copySymbol(moduleName, sym.split("=>")[0], tempDst[lastName], dst, sym.split("=>")[1]);
         } else {
           copySymbol(moduleName, sym, tempDst[lastName], dst);
         }
       });
     } else {
       copySymbol(moduleName, importedName, tempDst[lastName], dst);
     }
   }

   //----------------------------------------------------------------
   // scheduling
   //----------------------------------------------------------------

   var scheduledImports = [];

   function scheduleImportPath(p, dst) {
     scheduledImports.push([p, dst]);
   }

   function runScheduledImports() {
     scheduledImports.forEach(function(x) {
       importPath(x[0], x[1]);
     });
   }

   //----------------------------------------------------------------
   // The global import function
   //----------------------------------------------------------------

   _appjethidden_.importsAllowed = true;

   globalScope['import'] = function(path1, path2, etc) {
     if (!_appjethidden_.importsAllowed) {
       throw Error("Imports are finished.  No more imports are allowed.");
     }

     var dstScope = this;
     if (arguments.length < 1) {
       apiError("importModule() takes the name of at least one module as an argument.");
     }
     for (var i = 0; i < arguments.length; i++) {
       var path = arguments[i];
       debug("scheduling import: "+path);
       scheduleImportPath(path, dstScope);
       // evaluate all modules in this path.
       var parts = path.split('.');
       for (var j = 0; j < parts.length; j++) {
         var moduleName = parts.slice(0,j+1).join('.');
         loadModule(moduleName);
       }
     }
   };

   _appjethidden_.finishImports = function() {
     debug("Running scheduled imports...");
     runScheduledImports();
     _appjethidden_.importsAllowed = false;
   };

   //----------------------------------------------------------------
   // jimport
   //----------------------------------------------------------------
   function _jimportSinglePackage(pname, dstScope) {
     //_appjethidden_._debugMessage("_jimportSinglePackage: "+pname);
     // TODO: support "*" and "{}" syntax like scala.
     var src = Packages;
     var srcParent = null;
     var localName = pname.split(".").pop();
     var soFar = '';

     pname.split(".").forEach(function(x) {
       soFar += x+'.';
       if (!src[x]) {
         throw ('Could not find java package/class: '+soFar);
       } else {
         //_appjethidden_._debugMessage("descenting into "+src+"["+x+"]");
         srcParent = src;
         src = src[x];
       }
     });

     if (String(src).indexOf('function') == 0) {
       // TODO: checking String(src).indexOf('function') is rather brittle.
       //       is there a cleaner way?
       // TODO: this only works on static functions... so make sure
       //       src[x] is a static function!
       dstScope[localName] = function() {
          return src.apply(srcParent, Array.prototype.slice.call(arguments));
       };
     } else {
       // importing a regular java class
       dstScope[localName] = src;
     }
   }

   /**
    * Import a java package over LiveConnect.
    */
   globalScope['jimport'] = function() {
     var dstScope = this;
     for (var i = 0; i < arguments.length; i++) {
       var pname = arguments[i].split(".").pop();
       _jimportSinglePackage(arguments[i], dstScope);
     }
   };

   //----------------------------------------------------------------
   // {appjet, request, response} imported by default
   //----------------------------------------------------------------
   globalScope['import'].call(globalScope,
     "global.appjet.appjet", "global.request.request", "global.response.response");

})(this);


text:
using System;
using Castle.MicroKernel;
using Hangfire;

namespace Web.UI.Injection.Hangfire
{
    //see: https://github.com/BredStik/HangFire.Windsor/
    public class WindsorJobActivator : JobActivator
    {
        private readonly IKernel _kernel;

        /// <summary>
        /// Initializes new instance of WindsorJobActivator with a Windsor Kernel
        /// </summary>
        /// <param name="kernel">Kernel that will be used to create instance
        /// of classes during job activation process.</param>
        public WindsorJobActivator(IKernel kernel)
        {
            if (kernel == null) throw new ArgumentNullException("kernel");

            _kernel = kernel;
        }

        /// <summary>
        /// Activates a job of a given type using the Windsor Kernel
        /// </summary>
        /// <param name="jobType">Type of job to activate</param>
        /// <returns></returns>
        public override object ActivateJob(Type jobType)
        {
            return _kernel.Resolve(jobType);
        }
    }
}


text:
package io.sponges.dubtrack4j.event.framework;

import com.google.common.base.Preconditions;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;

import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Consumer;

/**
 * A simple, thread safe and reflectionless event handling system.
 *
 * @author Connor Spencer Harries
 */
public final class EventBus {

    private final Multimap<Class<? extends Event>, Consumer<Event>> consumerMap;
    private final ReadWriteLock lock;

    public EventBus() {
        this.consumerMap = ArrayListMultimap.create();
        this.lock = new ReentrantReadWriteLock();
    }

    @SuppressWarnings("unchecked")
    public <T extends Event> boolean register(Class<T> clazz, Consumer<T> consumer) {
        Preconditions.checkNotNull(consumer, "consumer cannot be null");
        Preconditions.checkNotNull(clazz, "clazz cannot be null");
        lock.writeLock().lock();
        try {
            Consumer<Event> handler = (Consumer<Event>) consumer;
            return consumerMap.put(clazz, handler);
        } finally {
            lock.writeLock().unlock();
        }
    }

    public <T extends Event> boolean unregister(Consumer<T> consumer) {
        Preconditions.checkNotNull(consumer, "consumer cannot be null");
        lock.writeLock().lock();
        try {
            boolean removed = false;
            Iterator<Consumer<Event>> consumerIterator = consumerMap.values().iterator();
            while (consumerIterator.hasNext()) {
                if (consumerIterator.next() == consumer) {
                    consumerIterator.remove();
                    removed = true;
                }
            }
            return removed;
        } finally {
            lock.writeLock().unlock();
        }
    }

    public <T extends Event> T post(T event) {
        Preconditions.checkNotNull(event, "event cannot be null");
        lock.readLock().lock();
        try {
            Class<? extends Event> clazz = event.getClass();
            Collection<Consumer<Event>> consumers = consumerMap.get(clazz);
            for (Consumer<Event> consumer : consumers) {
                consumer.accept(event);
            }
            event.postEvent();
            return event;
        } finally {
            lock.readLock().unlock();
        }
    }
}


text:
class ContractHistory < ActiveRecord::Base
  belongs_to :contract, :class_name => 'Contract', :foreign_key => :contract_id
  belongs_to :atlanta_operator, :class_name => 'AtlantaOperator', :foreign_key => :atlanta_operator_id
  belongs_to :atlanta_group, :class_name => 'AtlantaGroup', :foreign_key => :atlanta_group_id
  belongs_to :contract_type, :class_name => 'ContractType', :foreign_key => :contract_type_id
  belongs_to :customer_node, :class_name => 'CustomerNode', :foreign_key => :customer_node_id
  belongs_to :person, :class_name => 'Person', :foreign_key => :person_id
  validates_presence_of :contract_id
  validates_numericality_of :contract_id, :allow_nil => false, :only_integer => true
  validates_presence_of :last_modified
  validates_presence_of :contract_name
  validates_length_of :contract_name, :allow_nil => false, :maximum => 40
  validates_length_of :customer_reference, :allow_nil => true, :maximum => 40
  validates_presence_of :atlanta_operator_id
  validates_numericality_of :atlanta_operator_id, :allow_nil => false, :only_integer => true
  validates_presence_of :atlanta_group_id
  validates_numericality_of :atlanta_group_id, :allow_nil => false, :only_integer => true
  validates_presence_of :effective_start_date
  validates_presence_of :effective_end_date
  validates_presence_of :contract_type_id
  validates_numericality_of :contract_type_id, :allow_nil => false, :only_integer => true
  validates_presence_of :customer_node_id
  validates_numericality_of :customer_node_id, :allow_nil => false, :only_integer => true
  validates_presence_of :person_id
  validates_numericality_of :person_id, :allow_nil => false, :only_integer => true
  validates_numericality_of :account_manager_operator_id, :allow_nil => true, :only_integer => true
  validates_numericality_of :assigned_csr_operator_id, :allow_nil => true, :only_integer => true
  validates_presence_of :contract_status_code
  validates_numericality_of :contract_status_code, :allow_nil => false, :only_integer => true
  validates_numericality_of :contract_duration, :allow_nil => true, :only_integer => true
  validates_numericality_of :contract_duration_unit_code, :allow_nil => true, :only_integer => true
  validates_length_of :comments, :allow_nil => true, :maximum => 2000
  validates_length_of :overidden_contracts, :allow_nil => true, :maximum => 2000
  validates_length_of :related_documents, :allow_nil => true, :maximum => 2000
  validates_numericality_of :sales_channel_code, :allow_nil => true, :only_integer => true
  validates_presence_of :select_all_ind_code
  validates_numericality_of :select_all_ind_code, :allow_nil => false, :only_integer => true
  validates_length_of :general_1, :allow_nil => true, :maximum => 255
  validates_length_of :general_2, :allow_nil => true, :maximum => 255
  validates_length_of :general_3, :allow_nil => true, :maximum => 255
  validates_length_of :general_4, :allow_nil => true, :maximum => 255
  validates_length_of :general_5, :allow_nil => true, :maximum => 255
  validates_length_of :general_6, :allow_nil => true, :maximum => 255
  validates_length_of :general_7, :allow_nil => true, :maximum => 255
  validates_length_of :general_8, :allow_nil => true, :maximum => 255
  validates_length_of :general_9, :allow_nil => true, :maximum => 255
  validates_length_of :general_10, :allow_nil => true, :maximum => 255
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="314046d9-cafe-4ecc-9718-18515ab9a19e" name="Default" comment="" />
    <ignored path="bootstrap-hover-dropdown.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path="$PROJECT_DIR$/out/" />
    <ignored path=".idea/dataSources.local.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="FavoritesManager">
    <favorites_list name="bootstrap-hover-dropdown" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="pointer-events-detect.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/pointer-events-detect.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="8" column="27" selection-start-line="8" selection-start-column="11" selection-end-line="8" selection-end-column="27" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name=".gitignore" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/.gitignore">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-0.45454547">
              <caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="bootstrap-hover-dropdown.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/bootstrap-hover-dropdown.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="30" column="41" selection-start-line="30" selection-start-column="41" selection-end-line="30" selection-end-column="41" />
              <folding>
                <element signature="n#!!doc" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="demo.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/demo.html">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-22.068966">
              <caret line="287" column="46" selection-start-line="287" selection-start-column="46" selection-end-line="287" selection-end-column="46" />
              <folding>
                <element signature="n#style#0;n#div#4;n#div#0;n#div#0;n#body#0;n#html#0;n#!!top" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name=".editorconfig" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/.editorconfig">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.20222446">
              <caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="GradleLocalSettings">
    <option name="externalProjectsViewState">
      <projects_view />
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/pointer-events-detect.js" />
        <option value="$PROJECT_DIR$/demo.html" />
        <option value="$PROJECT_DIR$/bootstrap-hover-dropdown.js" />
        <option value="$PROJECT_DIR$/.gitignore" />
        <option value="$PROJECT_DIR$/.editorconfig" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <gulpfiles>
      <GulpfileState>
        <gulpfile-path>$PROJECT_DIR$/gulpfile.js</gulpfile-path>
      </GulpfileState>
    </gulpfiles>
  </component>
  <component name="NamedScopeManager">
    <order />
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds">
    <option name="x" value="2560" />
    <option name="y" value="252" />
    <option name="width" value="1920" />
    <option name="height" value="1057" />
  </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="1" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ColorIdeProjectViewPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="ColorIdeProjectViewPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bootstrap-hover-dropdown" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bootstrap-hover-dropdown" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bootstrap-hover-dropdown" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="PackagesPane" />
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="GoToClass.includeLibraries" value="false" />
    <property name="GoToClass.toSaveIncludeLibraries" value="false" />
    <property name="GoToFile.includeJavaFiles" value="false" />
    <property name="MemberChooser.sorted" value="false" />
    <property name="MemberChooser.showClasses" value="true" />
    <property name="MemberChooser.copyJavadoc" value="false" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="editor.config.accepted" value="true" />
    <property name="settings.editor.selected.configurable" value="reference.settingsdialog.IDE.editor.colors.General" />
    <property name="settings.editor.splitter.proportion" value="0.2" />
    <property name="JavaScriptLanguageLevel" value="ES6" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="Applet" factoryName="Applet">
      <option name="WIDTH" value="400" />
      <option name="HEIGHT" value="300" />
      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
      <module />
      <method />
    </configuration>
    <configuration default="true" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="BashConfigurationType" factoryName="Bash">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="INTERPRETER_PATH" value="/bin/bash" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="PARENT_ENVS" value="true" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
      <predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
      <module name="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
      <method />
    </configuration>
    <configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
      <ExternalSystemSettings>
        <option name="executionName" />
        <option name="externalProjectPath" />
        <option name="externalSystemIdString" value="GRADLE" />
        <option name="scriptParameters" />
        <option name="taskDescriptions">
          <list />
        </option>
        <option name="taskNames">
          <list />
        </option>
        <option name="vmOptions" />
      </ExternalSystemSettings>
      <method />
    </configuration>
    <configuration default="true" type="JRubyCucumberRunConfigurationType" factoryName="JRuby Cucumber">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" value="-Dforce.jruby.jit=true -Djruby.debug.fullTrace=true" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
      <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
      <method />
    </configuration>
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="TEST_OBJECT" value="class" />
      <option name="VM_PARAMETERS" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <envs />
      <patterns />
      <method />
    </configuration>
    <configuration default="true" type="JarApplication" factoryName="JAR Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="MongoRunConfiguration" factoryName="Mongo">
      <setting name="path" value="" />
      <setting name="shellParams" value="" />
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
      <method />
    </configuration>
    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
      <TestRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method />
    </configuration>
    <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server">
      <method />
    </configuration>
    <configuration default="true" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <method />
    </configuration>
    <configuration name="<template>" type="TestNG" default="true" selected="false">
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="ToolWindowManager">
    <frame x="2560" y="252" width="1920" height="1057" extended-state="6" />
    <editor active="true" />
    <layout>
      <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="SvgViewer" active="false" anchor="right" 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="Palette	" active="false" anchor="right" 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="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" 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="-1" side_tool="false" 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="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Mongo Explorer" active="false" anchor="right" 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="Terminal" 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="Gulp" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Designer" active="false" anchor="left" 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="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16145833" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Database" active="false" anchor="right" 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="Navigate" active="false" anchor="left" 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="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="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <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="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="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="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="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="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="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" />
      <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" />
    </layout>
  </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$/demo.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-22.068966">
          <caret line="287" column="46" selection-start-line="287" selection-start-column="46" selection-end-line="287" selection-end-column="46" />
          <folding>
            <element signature="n#style#0;n#div#4;n#div#0;n#div#0;n#body#0;n#html#0;n#!!top" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bootstrap-hover-dropdown.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="30" column="41" selection-start-line="30" selection-start-column="41" selection-end-line="30" selection-end-column="41" />
          <folding>
            <element signature="n#!!doc" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/pointer-events-detect.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="8" column="27" selection-start-line="8" selection-start-column="11" selection-end-line="8" selection-end-column="27" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.gitignore">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-0.45454547">
          <caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0625">
          <caret line="3" column="109" selection-start-line="3" selection-start-column="109" selection-end-line="3" selection-end-column="109" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bower.json">
      <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 />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/composer.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.22916667">
          <caret line="11" column="13" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.editorconfig">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.20222446">
          <caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
package org.pitrecki.spring_learnining.r4.witharound;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

/**
 * @author Piotr 'pitrecki' Nowak
 *         Created by Pitrecki on 2017-03-19.
 */
@Aspect
public class Audience
{
    private final Logger logger = LogManager.getLogger();

    @Pointcut("execution(* org.pitrecki.spring_learnining.r4.witharound.Performance.perform(..)) && bean(concert)")
    public void performance() {
    }

    @Around("performance()")
    public void watchPerfomance(ProceedingJoinPoint joinPoint) {
        try {
            logger.info("Silencing cell phones");
            logger.info("Taking seats");
            joinPoint.proceed();
            logger.info("CLAP CLAP CLAP!!");
        } catch (Throwable throwable) {
            logger.info("Demanding refund");
        }
    }

}


text:
package tech.aroma.application.service.reactions.actions;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import tech.sirwellington.alchemy.test.junit.runners.AlchemyTestRunner;
import tech.sirwellington.alchemy.test.junit.runners.Repeat;

/**
 *
 * @author SirWellington
 */
@Repeat(50)
@RunWith(AlchemyTestRunner.class)
public class ActionRunnerSynchronousTest
{

    private ActionRunnerSynchronous instance;

    @Before
    public void setUp() throws Exception
    {
        instance = new ActionRunnerSynchronous();
    }

    @Test
    public void testRunThroughActions() throws Exception
    {
        ActionRunnerTest.testActionRunner(instance);
    }

}


text:
title: "Migration in the social stage of Dictyostelium discoideum amoebae impacts competition"
collection: publications
permalink: /publication/2010-10-01-paper-title-number-2
excerpt: 'Interaction conditions can change the balance of cooperation and conflict in multicellular groups. After aggregating together, cells of the social amoeba Dictyostelium discoideum may migrate as a group (known as a slug) to a new location. We consider this migration stage as an arena for social competition and conflict because the cells in the slug may not be from a genetically homogeneous population. '
date: 2015-10-22
venue: 'Peer J'
paperurl: 'http://abenaa07.github.io/files/2015_Migration_in_the_social_stage_of_dicty.pdf'
citation: 'Chandra N. Jack, Neil J. Buttery, Boahemaa Adu-Oppong, Michael Powers, Joan E. Strassmann and David C. Queller (2015). "Migration in the social stage of Dictyostelium discoideum amoebae impacts competition." Peer J. 1(2).'
---

[Download paper here]('http://abenaa07.github.io/files/2015_Migration_in_the_social_stage_of_dicty.pdf')

Recommended citation:     Jack CN, Buttery N, Adu-Oppong B, Powers M, Thompson CRL, Queller DC, Strassmann JE. (2015) Migration in the social stage of Dictyostelium discoideum amoebae impacts competition. PeerJ 3:e1352 https://doi.org/10.7717/peerj.1352


text:
package com.yahoo.vespa.hosted.controller.api.integration.certificates;

public class EndpointCertificateException extends RuntimeException {

    private final Type type;

    public EndpointCertificateException(Type type, String message) {
        super(message);
        this.type = type;
    }

    public EndpointCertificateException(Type type, String message, Throwable cause) {
        super(message, cause);
        this.type = type;
    }

    public Type type() {
        return type;
    }

    public enum Type {
        CERT_NOT_AVAILABLE,
        VERIFICATION_FAILURE
    }
}


text:
@implementation UILabel (MBIBnsepectable)
#pragma mark - hexRgbColor
- (void)setTextHexColor:(NSString *)textHexColor{
    NSScanner *scanner = [NSScanner scannerWithString:textHexColor];
    unsigned hexNum;
    if (![scanner scanHexInt:&hexNum]) return;
    self.textColor = [self colorWithRGBHex:hexNum];
}

- (UIColor *)colorWithRGBHex:(UInt32)hex {
    int r = (hex >> 16) & 0xFF;
    int g = (hex >> 8) & 0xFF;
    int b = (hex) & 0xFF;

    return [UIColor colorWithRed:r / 255.0f
                           green:g / 255.0f
                            blue:b / 255.0f
                           alpha:1.0f];
}

- (NSString *)textHexColor{
    return @"0xffffff";
}
@end


text:
module Sequent
  module Test
    module DateTimePatches
      module Normalize
        def normalize
          in_time_zone('UTC')
        end
      end

      module Compare
        # rubocop:disable Style/Alias
        alias :'___<=>' :'<=>'
        # rubocop:enable Style/Alias

        # omit nsec in datetime comparisons
        def <=>(other)
          if other&.is_a?(DateTimePatches::Normalize)
            result = normalize.iso8601 <=> other.normalize.iso8601
            return result unless result == 0

            # use usec here, which *truncates* the nsec (ie. like Postgres)
            return normalize.usec <=> other.normalize.usec
          end
          public_send(:'___<=>', other)
        end
      end
    end
  end
end

class Time
  prepend Sequent::Test::DateTimePatches::Normalize
  prepend Sequent::Test::DateTimePatches::Compare
end

class DateTime
  prepend Sequent::Test::DateTimePatches::Normalize
  prepend Sequent::Test::DateTimePatches::Compare
end

module ActiveSupport
  class TimeWithZone
    prepend Sequent::Test::DateTimePatches::Normalize
  end
end


text:
package idp

import (
	"encoding/gob"
	jwt "github.com/dgrijalva/jwt-go"
	// "github.com/gorilla/sessions"
	hclient "github.com/ory/hydra/client"
	"net/http"
	"time"
)

const (
	SessionCookieName = "challenge"
)

type Challenge struct {
	// Parent IDP that got the challenge
	idp *IDP

	// Hydra's client
	Client *hclient.Client

	// Time of expiration
	Expires time.Time

	// Unique JWT id
	JTI string

	// Redirect URL
	Redirect string

	// Requested scopes
	Scopes []string

	// Set in the challenge endpoint, after authenticated.
	User string
}

func init() {
	// Gob is used by gorilla sessions
	gob.Register(&Challenge{})
}

// Saves the Challenge to it's session store
func (c *Challenge) Save(w http.ResponseWriter, r *http.Request) error {
	session, err := c.idp.config.ChallengeStore.New(r, SessionCookieName)
	if err != nil {
		return err
	}

	session.Options = c.idp.createChallengeCookieOptions
	session.Values[SessionCookieName] = c

	return c.idp.config.ChallengeStore.Save(r, w, session)
}

// Update the Challenge, e.g. add user representation
func (c *Challenge) Update(w http.ResponseWriter, r *http.Request) error {
	session, err := c.idp.config.ChallengeStore.Get(r, SessionCookieName)
	if err != nil {
		return err
	}

	session.Options = c.idp.createChallengeCookieOptions
	session.Values[SessionCookieName] = c

	return c.idp.config.ChallengeStore.Save(r, w, session)
}

// Deletes the challenge from the store
func (c *Challenge) Delete(w http.ResponseWriter, r *http.Request) error {
	session, err := c.idp.config.ChallengeStore.Get(r, SessionCookieName)
	if err != nil {
		return err
	}

	session.Options = c.idp.deleteChallengeCookieOptions
	return c.idp.config.ChallengeStore.Save(r, w, session)
}

// User refused access to requested scopes, forward the desicion to Hydra via redirection.
func (c *Challenge) RefuseAccess(w http.ResponseWriter, r *http.Request) error {
	err := c.Delete(w, r)
	if err != nil {
		return err
	}

	http.Redirect(w, r, c.Redirect+"&consent=false", http.StatusFound)

	return nil
}

// User granted access to requested scopes, forward the desicion to Hydra via redirection.
func (c *Challenge) GrantAccessToAll(w http.ResponseWriter, r *http.Request) error {
	now := time.Now()

	token := jwt.New(jwt.SigningMethodRS256)

	claims := token.Claims.(jwt.MapClaims)
	claims["aud"] = c.Client.GetID()
	claims["exp"] = now.Add(time.Minute * 4).Unix()
	claims["iat"] = now.Unix()
	claims["scp"] = c.Scopes
	claims["jti"] = c.JTI
	claims["sub"] = c.User

	// Sign and get the complete encoded token as a string
	key, err := c.idp.getConsentKey()
	if err != nil {
		return err
	}

	tokenString, err := token.SignedString(key)
	if err != nil {
		return err
	}

	// Delete the cookie
	err = c.Delete(w, r)
	if err != nil {
		return err
	}

	// All this work might have taken too long (fetching key may be time consuming)
	// so check token expiration
	if c.Expires.Before(time.Now()) {
		return ErrorChallengeExpired
	}

	http.Redirect(w, r, c.Redirect+"&consent="+tokenString, http.StatusFound)

	return nil
}


text:
"""Macro

Macro support and dispatcher
"""

import os
from inspect import getmembers, getmodule, isfunction

from creoleparser import parse_args

class Macro(object):

    def __init__(self, name, arg_string, body, isblock):
        super(Macro, self).__init__()

        self.name = name
        self.arg_string = arg_string
        self.body = body
        self.isblock = isblock

def dispatcher(name, arg_string, body, isblock, environ):
    if name in environ["macros"]:
        macro = Macro(name, arg_string, body, isblock)
        args, kwargs = parse_args(arg_string)
        try:
            return environ["macros"][name](macro, environ, *args, **kwargs)
        except Exception, e:
            return "ERROR: Error while executing macro %r (%s)" % (name, e)
    else:
        return "Macro not found!"

def loadMacros():
    path = os.path.abspath(os.path.dirname(__file__))
    p = lambda x: os.path.splitext(x)[1] == ".py"
    modules = [x for x in os.listdir(path) if p(x) and not x == "__init__.py"]

    macros = {}

    for module in modules:
        name, _ = os.path.splitext(module)

        moduleName = "%s.%s" % (__package__, name)
        m = __import__(moduleName, globals(), locals(), __package__)

        p = lambda x: isfunction(x) and getmodule(x) is m
        for name, function in getmembers(m, p):
            name = name.replace("_", "-")
            try:
                macros[name] = function
            except Exception:
                continue

    return macros


text:
package org.mamute.search;

import java.util.List;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;

import org.hibernate.Session;
import org.mamute.dao.InvisibleForUsersRule;
import org.mamute.dao.QuestionDAO;
import org.mamute.model.LoggedUser;
import org.mamute.model.Question;
import org.mamute.model.User;
import org.mamute.providers.SessionFactoryCreator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import br.com.caelum.vraptor.environment.Environment;
import br.com.caelum.vraptor.events.VRaptorInitialized;

import static org.mamute.model.SanitizedText.fromTrustedText;

@ApplicationScoped
public class IndexSyncJob {
	public static final Logger LOGGER = LoggerFactory.getLogger(IndexSyncJob.class);

	private QuestionIndex index;
	private Environment environment;
	private SessionFactoryCreator factory;

	@Deprecated
	protected IndexSyncJob() {
	}

	@Inject
	public IndexSyncJob(QuestionIndex index, Environment environment, SessionFactoryCreator factory) {
		this.index = index;
		this.environment = environment;
		this.factory = factory;
	}

	public void execute() {
		new Thread(new Runnable() {
			@Override
			public void run() {
				Session session = factory.getInstance().openSession();
				try {
					QuestionDAO questions = new QuestionDAO(session, generateUser());

					long pages = questions.numberOfPages();
					long total = 0;
					LOGGER.info("Syncing questions!");
					for (int i = 0; i < pages; i++) {
						List<Question> q = questions.allVisible(i);
						index.indexQuestionBatch(q);
						total += q.size();
					}
					LOGGER.info("Synced " + total + " questions");
				} finally {
					session.close();
				}
			}
		}).start();
	}

	private InvisibleForUsersRule generateUser() {
		User user = new User(fromTrustedText("System"), "system");
		LoggedUser loggedUser = new LoggedUser(user, null);
		return new InvisibleForUsersRule(loggedUser);
	}

	public void onStartup(@Observes VRaptorInitialized init) {
		if (environment.supports("solr.syncOnStartup") && environment.supports("feature.solr")) {
			execute();
		}
	}
}


text:
package com.alibaba.dubbo.remoting.zookeeper;

import java.util.List;

import com.alibaba.dubbo.common.URL;

public interface ZookeeperClient {

	void create(String path, String data, boolean ephemeral);

	void create(String path, boolean ephemeral);

	void delete(String path);

	List<String> getChildren(String path);

	List<String> addChildListener(String path, ChildListener listener);

	void addChildNodeListener(String path, ChildNodeListener listener);

	void removeChildListener(String path, ChildListener listener);

	void addStateListener(StateListener listener);

	void removeStateListener(StateListener listener);

	boolean isConnected();

	void close();

	URL getUrl();

}


text:
export * from './action.component';
export * from './action.routes';


text:
package org.apache.directory.shared.kerberos.codec.EncKdcRepPart;

import org.apache.directory.api.asn1.ber.grammar.Grammar;
import org.apache.directory.api.asn1.ber.grammar.States;

/**
 * This class stores the EncKdcRepPart grammar's constants. It is also used for debugging
 * purpose
 *
 * @author Apache Directory Project
 */
public enum EncKdcRepPartStatesEnum implements States
{
    // Start
    START_STATE, // 0

    // ----- EncKdcRepPart component --------------------------------------

    ENC_KDC_REP_PART_SEQ_TAG_STATE, // 1

    ENC_KDC_REP_PART_KEY_TAG_STATE, // 2

    ENC_KDC_REP_PART_LAST_REQ_TAG_STATE, // 3

    ENC_KDC_REP_PART_NONCE_TAG_STATE, // 4
    ENC_KDC_REP_PART_NONCE_STATE, // 5

    ENC_KDC_REP_PART_KEY_EXPIRATION_TAG_STATE, // 6
    ENC_KDC_REP_PART_KEY_EXPIRATION_STATE, // 7

    ENC_KDC_REP_PART_FLAGS_TAG_STATE, // 8
    ENC_KDC_REP_PART_FLAGS_STATE, // 9

    ENC_KDC_REP_PART_AUTH_TIME_TAG_STATE, // 10
    ENC_KDC_REP_PART_AUTH_TIME_STATE, // 11

    ENC_KDC_REP_PART_START_TIME_TAG_STATE, // 12
    ENC_KDC_REP_PART_START_TIME_STATE, // 13

    ENC_KDC_REP_PART_END_TIME_TAG_STATE, // 14
    ENC_KDC_REP_PART_END_TIME_STATE, // 15

    ENC_KDC_REP_PART_RENEW_TILL_TAG_STATE, // 16
    ENC_KDC_REP_PART_RENEW_TILL_STATE, // 17

    ENC_KDC_REP_PART_SREALM_TAG_STATE, // 18
    ENC_KDC_REP_PART_SREALM_STATE, // 19

    ENC_KDC_REP_PART_SNAME_TAG_STATE, // 20

    ENC_KDC_REP_PART_CADDR_TAG_STATE, // 21

    // End
    LAST_ENC_KDC_REP_PART_STATE; // 22

    /**
     * Get the grammar name
     *
     * @param grammar The grammar code
     * @return The grammar name
     */
    public String getGrammarName( int grammar )
    {
        return "ENC_KDC_REP_PART_GRAMMAR";
    }

    /**
     * Get the grammar name
     *
     * @param grammar The grammar class
     * @return The grammar name
     */
    public String getGrammarName( Grammar<EncKdcRepPartContainer> grammar )
    {
        if ( grammar instanceof EncKdcRepPartGrammar )
        {
            return "ENC_KDC_REP_PART_GRAMMAR";
        }
        else
        {
            return "UNKNOWN GRAMMAR";
        }
    }

    /**
     * Get the string representing the state
     *
     * @param state The state number
     * @return The String representing the state
     */
    public String getState( int state )
    {
        return ( ( state == LAST_ENC_KDC_REP_PART_STATE.ordinal() ) ? "LAST_ENC_KDC_REP_PART_STATE" : name() );
    }

    /**
     * {@inheritDoc}
     */
    public boolean isEndState()
    {
        return this == LAST_ENC_KDC_REP_PART_STATE;
    }

    /**
     * {@inheritDoc}
     */
    public EncKdcRepPartStatesEnum getStartState()
    {
        return START_STATE;
    }
}


text:
package com.capitalone.dashboard.client;

import java.io.IOException;
import java.net.Authenticator;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.StringTokenizer;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//import com.atlassian.jira.rest.client.api.JiraRestClient;
//import com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory;
import com.capitalone.dashboard.util.FeatureSettings;
import com.capitalone.dashboard.util.Supplier;
import com.rallydev.rest.RallyRestApi;
//import com.rallydev.rest.request.QueryRequest;
//import com.rallydev.rest.response.QueryResponse;
//import com.rallydev.rest.util.Fetch;
//import com.rallydev.rest.util.QueryFilter;
/**
 * Separate JiraRestClient supplier to make unit testing easier
 *
 * @author MarkRx
 */
@Component
public class JiraRestClientSupplier implements Supplier<RallyRestApi> {
	private static final Logger LOGGER = LoggerFactory.getLogger(JiraRestClientSupplier.class);

	@Autowired
	private FeatureSettings featureSettings;

	@Override
	public RallyRestApi get() {
		RallyRestApi client = null;

		String jiraCredentials = featureSettings.getJiraCredentials();
		String jiraBaseUrl = featureSettings.getJiraBaseUrl();
		String proxyUri = null;
		String proxyPort = null;

		URI jiraUri = null;

		try {
			if (featureSettings.getJiraProxyUrl() != null && !featureSettings.getJiraProxyUrl().isEmpty() && (featureSettings.getJiraProxyPort() != null)) {
				proxyUri = this.featureSettings.getJiraProxyUrl();
				proxyPort = this.featureSettings.getJiraProxyPort();

				jiraUri = this.createJiraConnection(jiraBaseUrl,
						proxyUri + ":" + proxyPort,
						this.decodeCredentials(jiraCredentials).get("username"),
						this.decodeCredentials(jiraCredentials).get("password"));
			} else {
				jiraUri = new URI(jiraBaseUrl);
			}

			InetAddress.getByName(jiraUri.getHost());
			client = new RallyRestApi(jiraUri,"_EFc6tTldRuG8K58PPNlo23CaDb7skI0gF69otA1rs");

		} catch (UnknownHostException | URISyntaxException e) {
			LOGGER.error("The Jira host name is invalid. Further jira collection cannot proceed.");

			LOGGER.debug("Exception", e);
		}

		return client;
	}

	/**
	 * Converts Jira basic authentication credentials from Base 64 string to a
	 * username/password map
	 *
	 * @param jiraBasicAuthCredentialsInBase64
	 *            Base64-encoded single string in the following format:
	 *            username:password

	 *

	 *            A null parameter value will result in an empty hash map
	 *            response (e.g., nothing gets decoded)
	 * @return Decoded username/password map of strings
	 */
	private Map<String, String> decodeCredentials(String jiraBasicAuthCredentialsInBase64) {
		Map<String, String> credMap = new LinkedHashMap<String, String>();
		if (jiraBasicAuthCredentialsInBase64 != null) {
				//the tokenize includes a \n to ensure we trim those off the end (mac base64 adds these!)
			StringTokenizer tokenizer = new StringTokenizer(new String(
					Base64.decodeBase64(jiraBasicAuthCredentialsInBase64)), ":\n");
			for (int i = 0; tokenizer.hasMoreTokens(); i++) {
				if (i == 0) {
					credMap.put("username", tokenizer.nextToken());
				} else {
					credMap.put("password", tokenizer.nextToken());
				}
			}
		}

		return credMap;

	}

	/**
	 * Generates an authenticated proxy connection URI and Jira URI for use in
	 * talking to Jira.
	 *
	 * @param jiraBaseUri
	 *            A string representation of a Jira URI
	 * @param fullProxyUrl
	 *            A string representation of a completed proxy URL:
	 *            http://your.proxy.com:8080
	 * @param username
	 *            A string representation of a username to be authenticated
	 * @param password
	 *            A string representation of a password to be used in
	 *            authentication
	 * @return A fully configured Jira URI with authenticated proxy connection
	 */
	private URI createJiraConnection(String jiraBaseUri, String fullProxyUrl, String username,
			String password) {
		final String uname = username;
		final String pword = password;
		Proxy proxy = null;
		URLConnection connection = null;
		try {
			if (!StringUtils.isEmpty(jiraBaseUri)) {
				URL baseUrl = new URL(jiraBaseUri);
				if (!StringUtils.isEmpty(fullProxyUrl)) {
					URL proxyUrl = new URL(fullProxyUrl);
					URI proxyUri = new URI(proxyUrl.getProtocol(), proxyUrl.getUserInfo(),
							proxyUrl.getHost(), proxyUrl.getPort(), proxyUrl.getPath(),
							proxyUrl.getQuery(), null);
					proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyUri.getHost(),
							proxyUri.getPort()));
					connection = baseUrl.openConnection(proxy);

					if (!StringUtils.isEmpty(username) && (!StringUtils.isEmpty(password))) {
						String creds = uname + ":" + pword;
						Authenticator.setDefault(new Authenticator() {
							protected PasswordAuthentication getPasswordAuthentication() {
								return new PasswordAuthentication(uname, pword.toCharArray());
							}
						});
						connection.setRequestProperty("Proxy-Authorization",
								"Basic " + Base64.encodeBase64String((creds).getBytes()));
					}
				} else {
					connection = baseUrl.openConnection();
				}
			} else {
				LOGGER.error("The response from Jira was blank or non existant - please check your property configurations");
				return null;
			}

			return connection.getURL().toURI();

		} catch (URISyntaxException | IOException e) {
			try {
				LOGGER.error("There was a problem parsing or reading the proxy configuration settings during openning a Jira connection. Defaulting to a non-proxy URI.");
				return new URI(jiraBaseUri);
			} catch (URISyntaxException e1) {
				LOGGER.error("Correction:  The Jira connection base URI cannot be read!");
				return null;
			}
		}
	}
}


text:
package de.tudarmstadt.ukp.clarin.webanno.curation.casdiff;

import de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.api.Position;

public enum LinkCompareBehavior
{
    /**
     * The link target is considered to be the label. As a consequence, the
     * {@link Position#compareTo} method includes the role label into comparison but not the link
     * target.
     */
    LINK_TARGET_AS_LABEL,

    /**
     * The link role is considered to be the label and the {@link Position#compareTo} method takes
     * the link target into account
     */
    LINK_ROLE_AS_LABEL;

    public String getName()
    {
        return toString();
    }
}


text:
import Ember from 'ember';
import startApp from '../../helpers/start-app';
import {
  buildAttribute,
  buildAttributeWithOptions,
  fixture,
  it,
  itBehavesLikeAnAttribute,
  moduleFor
} from '../test-helper';
import { componentAttribute } from '../../page-object/build';
import { textAttribute } from '../../page-object/queries';
import {
  isHiddenAttribute,
  isVisibleAttribute
} from '../../page-object/predicates';

var application;

moduleFor('Components', 'component', {
  beforeEach: function() {
    application = startApp();
  },
  afterEach: function() {
    Ember.run(application, 'destroy');
  }
});

itBehavesLikeAnAttribute(componentAttribute, {});

it('uses scope', function(assert) {
  fixture('WrongRight');

  let attribute = buildAttribute(componentAttribute, {
    scope: '.scope',
    text: textAttribute('strong')
  });

  assert.equal(attribute().text(), 'Right');
});

it('uses parent scope', function(assert) {
  fixture('WrongRight');

  let attribute = buildAttributeWithOptions(componentAttribute, { scope: '.scope' }, {
    text: textAttribute('strong')
  });

  assert.equal(attribute().text(), 'Right');
});

it('overrides parent scope', function(assert) {
  fixture('WrongRight');

  let attribute = buildAttributeWithOptions(componentAttribute, { scope: '.wrong' }, {
    scope: '.scope',
    text: textAttribute('strong')
  });

  assert.equal(attribute().text(), 'Right');
});

it('sets child component scope', function(assert) {
  fixture('WrongRight');

  let attribute = buildAttribute(componentAttribute, {
    scope: '.scope',

    childComponent: {
      text: textAttribute('strong')
    }
  });

  assert.equal(attribute().childComponent().text(), 'Right');
});

it('lets define attributes without selector if page has scope defined', function(assert) {
  fixture('Hidden');

  let attribute = buildAttribute(componentAttribute, {
    scope: '.scope',

    hidden: isHiddenAttribute(),
    visible: isVisibleAttribute()
  });

  assert.equal(attribute().hidden(), true);
  assert.equal(attribute().visible(), false);
});


text: - networksetup -getairportnetwork en1 | cut -c 24-


text:
package kinesis

import (
	"github.com/paybyphone/kintail/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter"
)

func (c *Kinesis) WaitUntilStreamExists(input *DescribeStreamInput) error {
	waiterCfg := waiter.Config{
		Operation:   "DescribeStream",
		Delay:       10,
		MaxAttempts: 18,
		Acceptors: []waiter.WaitAcceptor{
			{
				State:    "success",
				Matcher:  "path",
				Argument: "StreamDescription.StreamStatus",
				Expected: "ACTIVE",
			},
		},
	}

	w := waiter.Waiter{
		Client: c,
		Input:  input,
		Config: waiterCfg,
	}
	return w.Wait()
}