text:
<?php
/**
 * Slider
 * Shortcode that allows to display a simple slideshow
 */

if ( !class_exists( 'avia_sc_slider_full' ) )
{
	class avia_sc_slider_full extends aviaShortcodeTemplate
	{
			static $slide_count = 0;

			/**
			 * Create the config array for the shortcode button
			 */
			function shortcode_insert_button()
			{
				$this->config['name']			= __('Fullwidth Easy Slider', 'avia_framework' );
				$this->config['tab']			= __('Media Elements', 'avia_framework' );
				$this->config['icon']			= AviaBuilder::$path['imagesURL']."sc-slideshow-full.png";
				$this->config['order']			= 80;
				$this->config['target']			= 'avia-target-insert';
				$this->config['shortcode'] 		= 'av_slideshow_full';
				$this->config['shortcode_nested'] = array('av_slide_full');
				$this->config['tooltip'] 	    = __('Display a simple fullwidth slideshow element', 'avia_framework' );
				$this->config['tinyMCE'] 		= array('disable' => "true");
				$this->config['drag-level'] 	= 1;
			}

			/**
			 * Popup Elements
			 *
			 * If this function is defined in a child class the element automatically gets an edit button, that, when pressed
			 * opens a modal window that allows to edit the element properties
			 *
			 * @return void
			 */
			function popup_elements()
			{
				$this->elements = array(

					array(
							"type" 			=> "modal_group",
							"id" 			=> "content",
							'container_class' =>"avia-element-fullwidth avia-multi-img",
							"modal_title" 	=> __("Edit Form Element", 'avia_framework' ),
							"add_label"		=>  __("Add single image or video", 'avia_framework' ),
							"std"			=> array(),

							'creator'		=>array(

										"name" => __("Add Images", 'avia_framework' ),
										"desc" => __("Here you can add new Images to the slideshow.", 'avia_framework' ),
										"id" 	=> "id",
										"type" 	=> "multi_image",
										"title" => __("Add multiple Images",'avia_framework' ),
										"button" => __("Insert Images",'avia_framework' ),
										"std" 	=> ""
										),

							'subelements' 	=> array(

									array(
											"type" 	=> "tab_container", 'nodescription' => true
										),

									array(
											"type" 	=> "tab",
											"name"  => __("Slide" , 'avia_framework'),
											'nodescription' => true
										),

									array(
										"name" 	=> __("Which type of slide is this?",'avia_framework' ),
										"id" 	=> "slide_type",
										"type" 	=> "select",
										"std" 	=> "",
										"subtype" => array(   __('Image Slide','avia_framework' )	=>'image',
										                      __('Video Slide','avia_framework' )	=>'video',
										                      )
								    ),

									array(
									"name" 	=> __("Choose another Image",'avia_framework' ),
									"desc" 	=> __("Either upload a new, or choose an existing image from your media library",'avia_framework' ),
									"id" 	=> "id",
									"fetch" => "id",
									"type" 	=> "image",
									"required"=> array('slide_type','is_empty_or','image'),
									"title" => __("Change Image",'avia_framework' ),
									"button" => __("Change Image",'avia_framework' ),
									"std" 	=> ""),

									array(
									"name" 	=> __("Video URL", 'avia_framework' ),
									"desc" 	=> __('Enter the URL to the Video. Currently supported are Youtube, Vimeo and direct linking of web-video files (mp4, webm, ogv)', 'avia_framework' ) .'

'.
									__('Working examples Youtube & Vimeo:', 'avia_framework' ).'

								http://vimeo.com/1084537

								http://www.youtube.com/watch?v=5guMumPFBag

',
									"required"=> array('slide_type','equals','video'),
									"id" 	=> "video",
									"std" 	=> "http://",
									"type" 	=> "video",
									"title" => __("Upload Video",'avia_framework' ),
									"button" => __("Use Video",'avia_framework' ),
									),

									array(
									"name" 	=> __("Choose fallback image for mobile devices",'avia_framework' ),
									"desc" 	=> __("Either upload a new, or choose an existing image from your media library",'avia_framework' )."
".__("Video on most mobile devices can't be controlled properly with JavaScript, which is mandatory here, therefore you are required to select a fallback image which can be displayed instead", 'avia_framework' ) ."" ,
									"id" 	=> "mobile_image",
									"fetch" => "id",
									"type" 	=> "image",
									"required"=> array('slide_type','equals','video'),
									"title" => __("Choose Image",'avia_framework' ),
									"button" => __("Choose Image",'avia_framework' ),
									"std" 	=> ""),

									array(
									"name" 	=> __("Video Size", 'avia_framework' ),
									"desc" 	=> __("By default the video will try to match the default slideshow size that was selected in the slider settings at 'Slideshow Image and Video Size'", 'avia_framework' ),
									"id" 	=> "video_format",
									"type" 	=> "select",
									"std" 	=> "",
									"required"=> array('slide_type','equals','video'),
									"subtype" => array(
														__('Try to match the default slideshow size (Video will not be cropped, but black borders will be visible at each side)',  'avia_framework' ) 	=>'',
														__('Try to match the default slideshow size but stretch the video to fill the whole slider (video will be cropped at top and bottom)',  'avia_framework' ) 	=>'stretch',
														__('Show the full Video without cropping',  'avia_framework' ) =>'full',
														)
									),

									array(
									"name" 	=> __("Video Aspect Ratio", 'avia_framework' ),
									"desc" 	=> __("In order to calculate the correct height and width for the video slide you need to enter a aspect ratio (width:height). usually: 16:9 or 4:3.", 'avia_framework' )."
".__("If left empty 16:9 will be used", 'avia_framework' ) ,
									"id" 	=> "video_ratio",
									"required"=> array('video_format','not',''),
									"std" 	=> "16:9",
									"type" 	=> "input"),

									 array(
									"name" 	=> __("Hide Video Controls", 'avia_framework' ),
									"desc" 	=> __("Check if you want to hide the controls (works for youtube and self hosted videos)", 'avia_framework' ) ,
									"id" 	=> "video_controls",
									"required"=> array('slide_type','equals','video'),
									"std" 	=> "",
									"type" 	=> "checkbox"),

									array(
									"name" 	=> __("Mute Video Player", 'avia_framework' ),
									"desc" 	=> __("Check if you want to mute the video", 'avia_framework' ) ,
									"id" 	=> "video_mute",
									"required"=> array('slide_type','equals','video'),
									"std" 	=> "",
									"type" 	=> "checkbox"),

									array(
									"name" 	=> __("Loop Video Player", 'avia_framework' ),
									"desc" 	=> __("Check if you want to loop the video (instead of showing the next slide the video will play from the beginning again)", 'avia_framework' ) ,
									"id" 	=> "video_loop",
									"required"=> array('slide_type','equals','video'),
									"std" 	=> "",
									"type" 	=> "checkbox"),

									array(
									"name" 	=> __("Disable Autoplay", 'avia_framework' ),
									"desc" 	=> __("Check if you want to disable video autoplay when this slide shows", 'avia_framework' ) ,
									"id" 	=> "video_autoplay",
									"required"=> array('slide_type','equals','video'),
									"std" 	=> "",
									"type" 	=> "checkbox"),

									array(
									"type" 	=> "close_div",
									'nodescription' => true
										),

									array(
											"type" 	=> "tab",
											"name"	=> __("Caption",'avia_framework' ),
											'nodescription' => true
										),

									array(
									"name" 	=> __("Caption Title", 'avia_framework' ),
									"desc" 	=> __("Enter a caption title for the slide here", 'avia_framework' ) ,
									"id" 	=> "title",
									"std" 	=> "",
									"container_class" => 'av_half av_half_first',
									"type" 	=> "input"),

									array(
									"name" 	=> __("Caption Title Font Size", 'avia_framework' ),
									"desc" 	=> __("Select a custom font size. Leave empty to use the default", 'avia_framework' ),
									"id" 	=> "custom_title_size",
									"type" 	=> "select",
									"std" 	=> "",
									"container_class" => 'av_half',
									"subtype" => AviaHtmlHelper::number_array(10,120,1, array( __("Default Size", 'avia_framework' )=>''), 'px'),
										),

									 array(
									"name" 	=> __("Caption Text", 'avia_framework' ),
									"desc" 	=> __("Enter some additional caption text", 'avia_framework' ) ,
									"id" 	=> "content",
									"type" 	=> "textarea",
									"container_class" => 'av_half av_half_first',
									"std" 	=> "",
									),

									array(
									"name" 	=> __("Caption Text Font Size", 'avia_framework' ),
									"desc" 	=> __("Select a custom font size. Leave empty to use the default", 'avia_framework' ),
									"id" 	=> "custom_content_size",
									"type" 	=> "select",
									"std" 	=> "",
									"container_class" => 'av_half av_no_bottom',
									"subtype" => AviaHtmlHelper::number_array(10,90,1, array( __("Default Size", 'avia_framework' )=>''), 'px'),
									),

									array(
									"name" 	=> __("Caption Positioning",'avia_framework' ),
									"id" 	=> "caption_pos",
									"type" 	=> "select",
									"std" 	=> "caption_bottom",
									"subtype" => array(
												'Right Framed'=>'caption_right caption_right_framed caption_framed',
												'Left Framed'=>'caption_left caption_left_framed caption_framed',
												'Bottom Framed'=>'caption_bottom caption_bottom_framed caption_framed',
												'Center Framed'=>'caption_center caption_center_framed caption_framed',
												'Right without Frame'=>'caption_right',
												'Left without Frame'=>'caption_left',
												'Bottom without Frame'=>'caption_bottom',
												'Center without Frame'=>'caption_center'
											),
									),

									array(
									"name" 	=> __("Apply a link or buttons to the slide?", 'avia_framework' ),
									"desc" 	=> __("You can choose to apply the link to the whole image or to add 'Call to Action Buttons' that get appended to the caption", 'avia_framework' ),
									"id" 	=> "link_apply",
									"type" 	=> "select",
									"std" 	=> "",
									"subtype" => array(
										__('No Link for this slide',  	'avia_framework' ) =>'',
										__('Apply Link to Image',  		'avia_framework' ) =>'image',
										__('Attach one button',  		'avia_framework' ) =>'button',
										__('Attach two buttons',  		'avia_framework' ) =>'button button-two')),

									array(
									"name" 	=> __("Image Link?", 'avia_framework' ),
									"desc" 	=> __("Where should the Image link to?", 'avia_framework' ),
									"id" 	=> "link",
									"required"=> array('link_apply','equals','image'),
									"type" 	=> "linkpicker",
									"fetchTMPL"	=> true,
									"subtype" => array(
														__('Open Image in Lightbox', 'avia_framework' ) =>'lightbox',
														__('Set Manually', 'avia_framework' ) =>'manually',
														__('Single Entry', 'avia_framework' ) => 'single',
														__('Taxonomy Overview Page',  'avia_framework' ) => 'taxonomy',
														),
									"std" 	=> ""),

									array(
									"name" 	=> __("Open Link in new Window?", 'avia_framework' ),
									"desc" 	=> __("Select here if you want to open the linked page in a new window", 'avia_framework' ),
									"id" 	=> "link_target",
									"type" 	=> "select",
									"std" 	=> "",
									"required"=> array('link','not_empty_and','lightbox'),
									"subtype" => AviaHtmlHelper::linking_options()),

									array(	"name" 	=> __("Button 1 Label", 'avia_framework' ),
											"desc" 	=> __("This is the text that appears on your button.", 'avia_framework' ),
								            "id" 	=> "button_label",
								            "type" 	=> "input",
								            "container_class" => 'av_half av_half_first',
											"required"=> array('link_apply','contains','button'),
								            "std" 	=> "Click me"),

								   	array(
											"name" 	=> __("Button 1 Color", 'avia_framework' ),
											"desc" 	=> __("Choose a color for your button here", 'avia_framework' ),
											"id" 	=> "button_color",
											"type" 	=> "select",
											"std" 	=> "light",
								    		"container_class" => 'av_half',
											"required"=> array('link_apply','contains','button'),
											"subtype" => array(
														__('Translucent Buttons', 'avia_framework' ) => array(
															__('Light Transparent', 'avia_framework' )=>'light',
															__('Dark Transparent', 'avia_framework' )=>'dark',
														),

														__('Colored Buttons', 'avia_framework' ) => array(
															__('Theme Color', 'avia_framework' )=>'theme-color',
															__('Theme Color Subtle', 'avia_framework' )=>'theme-color-subtle',
															__('Blue', 'avia_framework' )=>'blue',
															__('Red',  'avia_framework' )=>'red',
															__('Green', 'avia_framework' )=>'green',
															__('Orange', 'avia_framework' )=>'orange',
															__('Aqua', 'avia_framework' )=>'aqua',
															__('Teal', 'avia_framework' )=>'teal',
															__('Purple', 'avia_framework' )=>'purple',
															__('Pink', 'avia_framework' )=>'pink',
															__('Silver', 'avia_framework' )=>'silver',
															__('Grey', 'avia_framework' )=>'grey',
															__('Black', 'avia_framework' )=>'black',
														)

														)),
								array(
									"name" 	=> __("Button 1 Link?", 'avia_framework' ),
									"desc" 	=> __("Where should the Button link to?", 'avia_framework' ),
									"id" 	=> "link1",
									"container_class" => 'av_half av_half_first',
									"required"=> array('link_apply','contains','button'),
									"type" 	=> "linkpicker",
									"fetchTMPL"	=> true,
									"subtype" => array(
														__('Set Manually', 'avia_framework' ) =>'manually',
														__('Single Entry', 'avia_framework' ) => 'single',
														__('Taxonomy Overview Page',  'avia_framework' ) => 'taxonomy',
														),
									"std" 	=> ""),

								array(
									"name" 	=> __("Button 1 Link Target?", 'avia_framework' ),
									"desc" 	=> __("Select here if you want to open the linked page in a new window", 'avia_framework' ),
									"id" 	=> "link_target1",
									"type" 	=> "select",
									"std" 	=> "",
									"container_class" => 'av_half',
									"required"=> array('link_apply','contains','button'),
									"subtype" => AviaHtmlHelper::linking_options()),

								array(	"name" 	=> __("Button 2 Label", 'avia_framework' ),
											"desc" 	=> __("This is the text that appears on your second button.", 'avia_framework' ),
								            "id" 	=> "button_label2",
								            "type" 	=> "input",
								            "container_class" => 'av_half av_half_first',
											"required"=> array('link_apply','contains','button-two'),
								            "std" 	=> "Click me"),

								   	array(
											"name" 	=> __("Button 2 Color", 'avia_framework' ),
											"desc" 	=> __("Choose a color for your second button here", 'avia_framework' ),
											"id" 	=> "button_color2",
											"type" 	=> "select",
											"std" 	=> "light",
								    		"container_class" => 'av_half',
											"required"=> array('link_apply','contains','button-two'),
											"subtype" => array(
														__('Translucent Buttons', 'avia_framework' ) => array(
															__('Light Transparent', 'avia_framework' )=>'light',
															__('Dark Transparent', 'avia_framework' )=>'dark',
														),

														__('Colored Buttons', 'avia_framework' ) => array(
															__('Theme Color', 'avia_framework' )=>'theme-color',
															__('Theme Color Subtle', 'avia_framework' )=>'theme-color-subtle',
															__('Blue', 'avia_framework' )=>'blue',
															__('Red',  'avia_framework' )=>'red',
															__('Green', 'avia_framework' )=>'green',
															__('Orange', 'avia_framework' )=>'orange',
															__('Aqua', 'avia_framework' )=>'aqua',
															__('Teal', 'avia_framework' )=>'teal',
															__('Purple', 'avia_framework' )=>'purple',
															__('Pink', 'avia_framework' )=>'pink',
															__('Silver', 'avia_framework' )=>'silver',
															__('Grey', 'avia_framework' )=>'grey',
															__('Black', 'avia_framework' )=>'black',
														)

														)),
								array(
									"name" 	=> __("Button 2 Link?", 'avia_framework' ),
									"desc" 	=> __("Where should the Button link to?", 'avia_framework' ),
									"id" 	=> "link2",
									"container_class" => 'av_half av_half_first',
									"required"=> array('link_apply','contains','button-two'),
									"type" 	=> "linkpicker",
									"fetchTMPL"	=> true,
									"subtype" => array(
														__('Set Manually', 'avia_framework' ) =>'manually',
														__('Single Entry', 'avia_framework' ) => 'single',
														__('Taxonomy Overview Page',  'avia_framework' ) => 'taxonomy',
														),
									"std" 	=> ""),

								array(
									"name" 	=> __("Button 2 Link Target?", 'avia_framework' ),
									"desc" 	=> __("Select here if you want to open the linked page in a new window", 'avia_framework' ),
									"id" 	=> "link_target2",
									"type" 	=> "select",
									"std" 	=> "",
									"container_class" => 'av_half',
									"required"=> array('link_apply','contains','button-two'),
									"subtype" => AviaHtmlHelper::linking_options()),

								array(
										"type" 	=> "close_div",
										'nodescription' => true
									),

								array(
										"type" 	=> "tab",
										"name"	=> __("Colors",'avia_framework' ),
										'nodescription' => true
									),

								array(
										"name" 	=> __("Font Colors", 'avia_framework' ),
										"desc" 	=> __("Either use the themes default colors or apply some custom ones", 'avia_framework' ),
										"id" 	=> "font_color",
										"type" 	=> "select",
										"std" 	=> "",
										"subtype" => array( __('Default', 'avia_framework' )=>'',
															__('Define Custom Colors', 'avia_framework' )=>'custom'),
								),

								array(
									"name" 	=> __("Custom Caption Title Font Color", 'avia_framework' ),
									"desc" 	=> __("Select a custom font color. Leave empty to use the default", 'avia_framework' ),
									"id" 	=> "custom_title",
									"type" 	=> "colorpicker",
									"std" 	=> "",
									"container_class" => 'av_half av_half_first',
									"required" => array('font_color','equals','custom')
										),

								array(
										"name" 	=> __("Custom Caption Content Font Color", 'avia_framework' ),
										"desc" 	=> __("Select a custom font color. Leave empty to use the default", 'avia_framework' ),
										"id" 	=> "custom_content",
										"type" 	=> "colorpicker",
										"std" 	=> "",
										"container_class" => 'av_half',
										"required" => array('font_color','equals','custom')

								),

								array(
										"type" 	=> "close_div",
										'nodescription' => true
									),

								array(
										"type" 	=> "close_div",
										'nodescription' => true
									),

							)

					),

					array(
							"name" 	=> __("Slideshow Image and Video Size", 'avia_framework' ),
							"desc" 	=> __("Choose image and Video size for your slideshow.", 'avia_framework' ),
							"id" 	=> "size",
							"type" 	=> "select",
							"std" 	=> "featured",
							"subtype" =>  AviaHelper::get_registered_image_sizes(1000)
							),

					array(
						"name" 	=> __("Stretch image to fit the slideshow size?",'avia_framework' ),
						"desc" 	=> __("By default the image stretches across the full width of the screen. You can deactivate this behavior and simply align it in the center of the slider",'avia_framework' ),
						"id" 	=> "stretch",
						"type" 	=> "select",
						"std" 	=> "",
						"subtype" => array(__('Yes, stretch the image','avia_framework' ) =>'',__('No, dont stretch the image. If the browser window is bigger than the image simply align it centered','avia_framework' ) =>'image_no_stretch')),

					array(
							"name" 	=> __("Slideshow Transition", 'avia_framework' ),
							"desc" 	=> __("Choose the transition for your Slideshow.", 'avia_framework' ),
							"id" 	=> "animation",
							"type" 	=> "select",
							"std" 	=> "slide",
							"subtype" => array(__('Slide sidewards','avia_framework' ) =>'slide', __('Slide up/down','avia_framework' ) =>'slide_up', __('Fade','avia_framework' ) =>'fade'),
							),

					array(
						"name" 	=> __("Autorotation active?",'avia_framework' ),
						"desc" 	=> __("Check if the slideshow should rotate by default",'avia_framework' ),
						"id" 	=> "autoplay",
						"type" 	=> "select",
						"std" 	=> "false",
						"subtype" => array(__('Yes','avia_framework' ) =>'true',__('No','avia_framework' ) =>'false')),

					array(
						"name" 	=> __("Stop Autorotation with the last slide", 'avia_framework' ),
						"desc" 	=> __("Check if you want to disable autorotation when this last slide is displayed", 'avia_framework' ) ,
						"id" 	=> "autoplay_stopper",
						"required"=> array('autoplay','equals','true'),
						"std" 	=> "",
						"type" 	=> "checkbox"),

					array(
						"name" 	=> __("Slideshow autorotation duration",'avia_framework' ),
						"desc" 	=> __("Images will be shown the selected amount of seconds.",'avia_framework' ),
						"id" 	=> "interval",
						"type" 	=> "select",
						"std" 	=> "5",
						"subtype" =>
						array('2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9','10'=>'10','15'=>'15','20'=>'20','30'=>'30','40'=>'40','60'=>'60','100'=>'100')),

					array(
						"name" 	=> __("Slideshow control styling?",'avia_framework' ),
						"desc" 	=> __("Here you can select if and how to display the slideshow controls",'avia_framework' ),
						"id" 	=> "control_layout",
						"type" 	=> "select",
						"std" 	=> "av-control-default",
						"subtype" => array(__('Default','avia_framework' ) =>'av-control-default',__('Minimal','avia_framework' ) =>'av-control-minimal',__('Hidden','avia_framework' ) =>'av-control-hidden')),

					array(
						"name" 	=> __("Use first slides caption as permanent caption", 'avia_framework' ),
						"desc" 	=> __("If checked the caption will be placed on top of the slider. Please be aware that all slideshow link settings and other captions will be ignored then", 'avia_framework' ) ,
						"id" 	=> "perma_caption",
						"std" 	=> "",
						"type" 	=> "checkbox"),

					array(
							"name" 	=> __("Slideshow Background Image",'avia_framework' ),
							"desc" 	=> __("If you are displaying transparent images like pngs you can set a static background image or pattern that will appear behind those pngs.",'avia_framework' ),
							"id" 	=> "src",
							"type" 	=> "image",
							"title" => __("Insert Image",'avia_framework' ),
							"button" => __("Insert",'avia_framework' ),
							"std" 	=> ""),

                    array(
						"name" 	=> __("Background Image Position",'avia_framework' ),
						"id" 	=> "position",
						"type" 	=> "select",
						"std" 	=> "top left",
                        "required" => array('src','not',''),
						"subtype" => array(   __('Top Left','avia_framework' )       =>'top left',
						                      __('Top Center','avia_framework' )     =>'top center',
						                      __('Top Right','avia_framework' )      =>'top right',
						                      __('Bottom Left','avia_framework' )    =>'bottom left',
						                      __('Bottom Center','avia_framework' )  =>'bottom center',
						                      __('Bottom Right','avia_framework' )   =>'bottom right',
						                      __('Center Left','avia_framework' )    =>'center left',
						                      __('Center Center','avia_framework' )  =>'center center',
						                      __('Center Right','avia_framework' )   =>'center right'
						                      )
				    ),

	               array(
						"name" 	=> __("Background Repeat",'avia_framework' ),
						"id" 	=> "repeat",
						"type" 	=> "select",
						"std" 	=> "no-repeat",
                        "required" => array('src','not',''),
						"subtype" => array(   __('No Repeat','avia_framework' )          =>'no-repeat',
						                      __('Repeat','avia_framework' )             =>'repeat',
						                      __('Tile Horizontally','avia_framework' )  =>'repeat-x',
						                      __('Tile Vertically','avia_framework' )    =>'repeat-y',
						                      __('Stretch to fit','avia_framework' )     =>'stretch'
						                      )
				  ),

	               array(
						"name" 	=> __("Background Attachment",'avia_framework' ),
						"id" 	=> "attach",
						"type" 	=> "select",
						"std" 	=> "scroll",
                        "required" => array('src','not',''),
						"subtype" => array(__('Scroll','avia_framework' )=>'scroll',__('Fixed','avia_framework' ) =>'fixed')
						),

				);

			}

			/**
			 * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
			 * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
			 * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
			 *
			 *
			 * @param array $params this array holds the default values for $content and $args.
			 * @return $params the return array usually holds an innerHtml key that holds item specific markup.
			 */
			function editor_element($params)
			{
				$params['innerHtml'] = "config['icon']."' title='".$this->config['name']."' />";
				$params['innerHtml'].= "
".$this->config['name']."
";
				return $params;
			}

			/**
			 * Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window
			 * Works in the same way as Editor Element
			 * @param array $params this array holds the default values for $content and $args.
			 * @return $params the return array usually holds an innerHtml key that holds item specific markup.
			 */
			function editor_sub_element($params)
			{

				$img_template 		= $this->update_template("img_fakeArg", "{{img_fakeArg}}");
				$template 			= $this->update_template("title", "{{title}}");
				$content 			= $this->update_template("content", "{{content}}");
				$video 				= $this->update_template("video", "{{video}}");
				$thumbnail = isset($params['args']['id']) ? wp_get_attachment_image($params['args']['id']) : "";

				$params['innerHtml']  = "";
				$params['innerHtml'] .= "
";
				$params['innerHtml'] .=	"
class_by_arguments('slide_type' ,$params['args']).">";
				$params['innerHtml'] .= "		{$thumbnail}";
				$params['innerHtml'] .= "
";
				$params['innerHtml'] .= "
".$params['args']['title']."
";
				$params['innerHtml'] .= "
".stripslashes($params['content'])."
";
				$params['innerHtml'] .= "			".stripslashes($params['args']['video'])."";
				$params['innerHtml'] .= "
";
				$params['innerHtml'] .= "
";
				$params['innerHtml'] .= "
";

				return $params;
			}

			/**
			 * Frontend Shortcode Handler
			 *
			 * @param array $atts array of attributes
			 * @param string $content text within enclosing form of shortcode element
			 * @param string $shortcodename the shortcode found, when == callback name
			 * @return string $output returns the modified html string
			 */
			function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
			{
				$atts = shortcode_atts(array(
				'size'			=> 'featured',
				'animation'		=> 'slide',
				'ids'    	 	=> '',
				'autoplay'		=> 'false',
				'interval'		=> 5,
				'handle'		=> $shortcodename,
				'src' 			=> '',
				'position'	 	=> 'top left',
				'repeat' 		=> 'no-repeat',
				'attach' 		=> 'scroll',
				//'easing'		=> 'easeInOutQuint',
				'stretch'		=> '',
				'control_layout'=> 'av-control-default',
				'perma_caption'	=> '',
				'autoplay_stopper'=>'',
				'content'		=> ShortcodeHelper::shortcode2array($content, 1)

				), $atts, $this->config['shortcode']);

				extract($atts);
				$output  	= "";
				$background  = "";
			    $class = "";

			    if($src != "")
			    {
			         if($repeat == 'stretch')
			         {
			             $background .= "background-repeat: no-repeat; ";
			             $class .= " avia-full-stretch";
			         }
			         else
			         {
			             $background .= "background-repeat: {$repeat}; ";
			         }

			         $background .= "background-image: url({$src}); ";
			         $background .= "background-attachment: {$attach}; ";
			         $background .= "background-position: {$position}; ";
			    }

			    if($background) $params['bg'] = "style = '{$background}'";

				$skipSecond = false;
				avia_sc_slider_full::$slide_count++;

				$params['class'] = "avia-fullwidth-slider main_color avia-shadow ".$meta['el_class'].$class;
				$params['open_structure'] = false;

				//we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
				if(isset($meta['index']) && $meta['index'] == 0) $params['close'] = false;
				if(!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section )) $params['close'] = false;

				if(isset($meta['index']) && $meta['index'] != 0) $params['class'] .= " slider-not-first";

				$params['id'] = "full_slider_".avia_sc_slider_full::$slide_count;

				$output .=  avia_new_section($params);

				$slider  = new avia_slideshow($atts);
				$slider->set_extra_class($stretch);
				$output .= $slider->html();

				$output .= "
"; //close section

				//if the next tag is a section dont create a new section from this shortcode
				if(!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'],  AviaBuilder::$full_el ))
				{
				    $skipSecond = true;
				}

				//if there is no next element dont create a new section.
				if(empty($meta['siblings']['next']['tag']))
				{
				    $skipSecond = true;
				}

				if(empty($skipSecond)) {

				$output .= avia_new_section(array('close'=>false, 'id' => "after_full_slider_".avia_sc_slider_full::$slide_count));

				}

				return $output;

			}

	}
}


text:
module Awful
  module Short
    def cloudfront(*args)
      Awful::CloudFront.new.invoke(*args)
    end
  end

  class CloudFront < Cli

    COLORS = {
      enabled:    :green,
      disabled:   :red,
      deployed:   :green,
      inprogress: :yellow,
    }

    no_commands do
      def cloudfront
        @cloudfront ||= Aws::CloudFront::Client.new
      end
    end

    desc 'ls', 'list distributions'
    method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
    def ls
      marker = nil
      items = []
      loop do
        response = cloudfront.list_distributions(marker: marker).distribution_list
        items += response.items
        marker = response.next_marker
        break unless marker
      end

      items.output do |list|
        if options[:long]
          print_table list.map { |i|
            origins = i.origins.items.map(&:domain_name).join(',').slice(0..40)
            state = i.enabled ? :Enabled : :Disabled
            [ i.id, i.domain_name, i.comment, origins, color(i.status), color(state), i.last_modified_time ]
          }
        else
          puts list.map(&:id).sort
        end
      end
    end

    desc 'get ID', 'dump out config for distribution'
    def get(id)
      cloudfront.get_distribution(id: id).distribution.output do |dist|
        puts YAML.dump(stringify_keys(dist.to_hash))
      end
    end

    desc 'status ID', 'show status for distribution'
    def status(id)
      cloudfront.get_distribution(id: id).distribution.status.output do |status|
        puts color(status)
      end
    end

    desc 'aliases ID [LIST]', 'get/set aliases for distribution'
    method_option :add,    aliases: '-a', type: :boolean, default: false, desc: 'add list to existing aliases'
    method_option :delete, aliases: '-d', type: :boolean, default: false, desc: 'delete list from existing aliases'
    def aliases(id, *list)
      if list.empty?
        cloudfront.get_distribution(id: id).distribution.distribution_config.aliases.items.output(&method(:puts))
      else
        response = cloudfront.get_distribution(id: id) # get current config
        config = response.distribution.distribution_config
        new = config[:aliases][:items]
        if options[:add]
          new += list           # append to existing
        elsif options[:delete]
          new -= list           # remove from existing
        else
          new = list            # replace existing
        end
        config[:aliases] = {quantity: new.count, items: new}
        cloudfront.update_distribution(id: id, distribution_config: config, if_match: response.etag)
      end
    end

    desc 'origins ID', 'list origins for distribution with ID'
    method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
    def origins(id)
      cloudfront.get_distribution(id: id).distribution.distribution_config.origins.items.output do |list|
        if options[:long]
          print_table list.map { |o|
            c = o.custom_origin_config
            config = o.s3_origin_config ? [ 's3' ] : [ 'custom', c.origin_protocol_policy, c.http_port, c.https_port  ]
            [ o.id, o.domain_name, o.origin_path ] + config
          }
        else
          puts list.map(&:id).sort
        end
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.google.cloud.documentai.v1beta2.samples;

// [START documentai_v1beta2_generated_DocumentUnderstandingService_BatchProcessDocuments_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest;
import com.google.cloud.documentai.v1beta2.DocumentUnderstandingServiceClient;
import com.google.cloud.documentai.v1beta2.ProcessDocumentRequest;
import com.google.longrunning.Operation;
import java.util.ArrayList;

public class AsyncBatchProcessDocuments {

  public static void main(String[] args) throws Exception {
    asyncBatchProcessDocuments();
  }

  public static void asyncBatchProcessDocuments() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
        DocumentUnderstandingServiceClient.create()) {
      BatchProcessDocumentsRequest request =
          BatchProcessDocumentsRequest.newBuilder()
              .addAllRequests(new ArrayList<ProcessDocumentRequest>())
              .setParent("parent-995424086")
              .build();
      ApiFuture<Operation> future =
          documentUnderstandingServiceClient.batchProcessDocumentsCallable().futureCall(request);
      // Do something.
      Operation response = future.get();
    }
  }
}
// [END documentai_v1beta2_generated_DocumentUnderstandingService_BatchProcessDocuments_async]


text:
#ifndef SYSTEMS_CONTROLLERS_BODYMOTIONDATA_H_
#define SYSTEMS_CONTROLLERS_BODYMOTIONDATA_H_

#include <vector>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include "PiecewisePolynomial.h"
#include <drakeQPLocomotionPlan_export.h> // TODO: exports

class BodyMotionData
{
public: // TODO: would be better to make this private
  int body_or_frame_id;
  PiecewisePolynomial<double> trajectory;
  std::vector<bool> toe_off_allowed;
  std::vector<bool> in_floating_base_nullspace;
  std::vector<bool> control_pose_when_in_contact;
  Eigen::Isometry3d transform_task_to_world;
  Eigen::Vector3d xyz_proportional_gain_multiplier;
  Eigen::Vector3d xyz_damping_ratio_multiplier;
  double exponential_map_proportional_gain_multiplier;
  double exponential_map_damping_ratio_multiplier;
  Eigen::Matrix<double, 6, 1> weight_multiplier;

public:
  int findSegmentIndex(double t) const;

  int getBodyOrFrameId() const;

  bool isToeOffAllowed(int segment_index) const;

  bool isInFloatingBaseNullSpace(int segment_index) const;

  bool isPoseControlledWhenInContact(int segment_index) const;

  double getExponentialMapDampingRatioMultiplier() const;

  double getExponentialMapProportionalGainMultiplier() const;

  const PiecewisePolynomial<double>& getTrajectory() const;

  PiecewisePolynomial<double>& getTrajectory();

  const Eigen::Isometry3d& getTransformTaskToWorld() const;

  const Eigen::Matrix<double, 6, 1>& getWeightMultiplier() const;

  const Eigen::Vector3d& getXyzDampingRatioMultiplier() const;

  const Eigen::Vector3d& getXyzProportionalGainMultiplier() const;
};

#endif /* SYSTEMS_CONTROLLERS_BODYMOTIONDATA_H_ */


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 12(1): 22 (1980)

#### Original name
Dendrosphaeraceae Cif. ex Benny & Kimbr.

### Remarks
null


text:
var SettingsUserView = Ember.View.extend({
    currentUser: Ember.computed.alias('controller.session.user'),

    isNotOwnProfile: Ember.computed('controller.user.id', 'currentUser.id', function () {
        return this.get('controller.user.id') !== this.get('currentUser.id');
    }),

    canAssignRoles: Ember.computed.or('currentUser.isAdmin', 'currentUser.isOwner'),

    rolesDropdownIsVisible: Ember.computed.and('isNotOwnProfile', 'canAssignRoles'),

    deleteUserActionIsVisible: Ember.computed('currentUser', 'canAssignRoles', 'controller.user', function () {
        if ((this.get('canAssignRoles') && this.get('isNotOwnProfile') && !this.get('controller.user.isOwner')) ||
            (this.get('currentUser.isEditor') && (!this.get('isNotOwnProfile') ||
            this.get('controller.user.isAuthor')))) {
            return true;
        }
    }),

    userActionsAreVisible: Ember.computed.or('deleteUserActionIsVisible', 'rolesDropdownIsVisible')

});

export default SettingsUserView;


text:
import React from 'react';
import { FormattedHTMLMessage } from 'react-intl';
import { FormattedHTMLMessageWithLink } from '../../../../components/widgets/FormattedHTMLMessageWithLink';
import LocalizableError from '../../../../i18n/LocalizableError';
import styles from './styles.scss';

interface Props {
  error: LocalizableError | null | undefined;
  onExternalLinkClick: (...args: Array<any>) => any;
}

export function ConfirmationError({ error, onExternalLinkClick }: Props) {
  if (!error) {
    return null;
  }

  const errorHasLink = !!error.values.linkLabel;

  return (
    <p className={styles.error}>
      {errorHasLink ? (
        <FormattedHTMLMessageWithLink
          // @ts-ignore ts-migrate(2769) FIXME: No overload matches this call.
          message={error}
          onExternalLinkClick={onExternalLinkClick}
        />
      ) : (
        <FormattedHTMLMessage {...error} />
      )}
    </p>
  );
}


text:
package hydra.timeserver;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

/**
 * A response from the time server.
 * @author dsmith
 *
 */
class TimeResponse {
  private final byte packetId;
  private final long timeStamp;

  public TimeResponse(final byte packetId, final long timeStamp) {
    this.packetId = packetId;
    this.timeStamp = timeStamp;
  }

  public byte getPacketId() {
    return packetId;
  }
  public long getTimeStamp() {
    return timeStamp;
  }

  public byte[] toByteArray()
  {
    ByteArrayOutputStream ba = new ByteArrayOutputStream();
    DataOutputStream dataOut = new DataOutputStream(ba);
    try {
      dataOut.writeByte(packetId);
      dataOut.writeLong(timeStamp);
      dataOut.close();
    } catch (IOException e) {
      throw new RuntimeException("ByteArrayOutputStream will not throw an IOException");
    }
    return ba.toByteArray();
  }

  public static TimeResponse fromByteArray(byte[] bytes) throws IOException
  {
    ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
    DataInputStream dataIn = new DataInputStream(bi);
    byte packetId = dataIn.readByte();
    long timeStamp = dataIn.readLong();
    return new TimeResponse(packetId, timeStamp);

  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillBefore="true"
    android:fillAfter="true">

    <alpha
        android:duration="100"
        android:fromAlpha="1"
        android:toAlpha="0"/>

</set>


text:
provide(function(exports) {
  exports('loaded now');
});


text:
package scala.swing

import javax.swing.JTabbedPane

object TabbedPane {
  object Layout extends Enumeration {
    import JTabbedPane._
    val Wrap  : Layout.Value = Value(WRAP_TAB_LAYOUT)
    val Scroll: Layout.Value = Value(SCROLL_TAB_LAYOUT)
  }

  class Page protected[TabbedPane](parent0: TabbedPane, title0: String, content0: Component, tip0: String) extends Proxy {
    def self: Any = content0

    def this(title0: String, content0: Component, tip0: String) =
      this(null, title0, content0, tip0)
    def this(title0: String, content0: Component) =
      this(title0, content0, "")
    content = content0 // first add component, *then* set other things
    title = title0
    tip = tip0

    protected[TabbedPane] var parent: TabbedPane = parent0

    protected var _title: String = title0
    def title: String = _title
    def title_=(t: String): Unit = {
      // beware to keep this order since, index depends on the _old_ title
      if (parent != null) parent.peer.setTitleAt(index, t)
      _title = t
    }
    protected var _content: Component = content0
    def content: Component = _content//UIElement.cachedWrapper(peer.getComponentAt(index).asInstanceOf[JComponent])
    def content_=(c: Component): Unit = { _content = c; if (parent != null) parent.peer.setComponentAt(index, c.peer) }
    protected var _tip: String = tip0
    def tip: String = _tip//peer.getToolTipTextAt(index)
    def tip_=(t: String): Unit = { _tip = t; if (parent != null) parent.peer.setToolTipTextAt(index, if(t == "") null else t) }
    protected var _enabled = true
    def enabled: Boolean = _enabled//peer.isEnabledAt(index)
    def enabled_=(b: Boolean): Unit = { _enabled = b; if (parent != null) parent.peer.setEnabledAt(index, b) }
    protected var _mnemonic: Int = -1
    def mnemonic: Int = _mnemonic//peer.getMnemonicAt(index)
    def mnemonic_=(k: Int): Unit = { _mnemonic = k; if (parent != null) parent.peer.setMnemonicAt(index, k)}
    protected var _foreground: Color = null
    def foreground: Color = _foreground//peer.getForegroundAt(index)
    def foreground_=(c: Color): Unit = { _foreground = c; if (parent != null) parent.peer.setForegroundAt(index, c)}
    protected var _background: Color = null
    def background: Color = _background //peer.getBackgroundAt(index)
    def background_=(c: Color): Unit = { _background = c; if (parent != null) parent.peer.setBackgroundAt(index, c)}
    def bounds: Rectangle = parent.peer.getBoundsAt(index)

    // TODO: icon, disabledIcon

    def index: Int = if(parent != null) parent.peer.indexOfTab(title) else 0//_index
    //protected[TabbedPane] var _index: Int = index0
  }
}

/**
 * Displays the contents of one of several pages at a time. For each page a tab is
 * visible at all times. The user can click on one of these tabs to move the
 * corresponding page to the front.
 *
 * @see javax.swing.JTabbedPane
 */
class TabbedPane extends Component with Publisher {
  override lazy val peer: JTabbedPane = new JTabbedPane with SuperMixin
  import TabbedPane._

  object pages extends BufferWrapper[Page] {
    def runCount: Int = peer.getTabRunCount

    def remove(n: Int): Page = {
      val t = apply(n)
      peer.removeTabAt(n)
      t.parent = null
      //for(i <- n to length) apply(i)._index -= 1
      t
    }

    override def insert(n: Int, t: Page): Unit = {
      //for(i <- n to length) apply(i)._index += 1
      t.parent = TabbedPane.this
      peer.insertTab(t.title, null, t.content.peer, if(t.tip == "") null else t.tip, n)
    }

    override def addOne(t: Page): this.type = {
      t.parent = TabbedPane.this
      peer.addTab(t.title, null, t.content.peer, if(t.tip == "") null else t.tip)
      this
    }

    def length: Int = peer.getTabCount

    def apply(n: Int): Page = new Page(TabbedPane.this, peer.getTitleAt(n),
      UIElement.cachedWrapper[Component](peer.getComponentAt(n).asInstanceOf[javax.swing.JComponent]),
      peer.getToolTipTextAt(n))
  }

  def tabLayoutPolicy: Layout.Value = Layout(peer.getTabLayoutPolicy)
  def tabLayoutPolicy_=(p: Layout.Value): Unit = { peer.setTabLayoutPolicy(p.id) }

  def tabPlacement: Alignment.Value = Alignment(peer.getTabPlacement)
  /**
   * Possible values are Left, Right, Top, Bottom.
   */
  def tabPlacement_=(b: Alignment.Value): Unit = peer.setTabPlacement(b.id)

  /**
   * The current page selection
   */
  object selection extends Publisher {
    def page: Page = pages(index)
    def page_=(p: Page): Unit = { index = p.index }

    def index: Int = peer.getSelectedIndex
    def index_=(n: Int): Unit = peer.setSelectedIndex(n)

    peer.addChangeListener(new javax.swing.event.ChangeListener {
      def stateChanged(e: javax.swing.event.ChangeEvent): Unit =
        publish(event.SelectionChanged(TabbedPane.this))
    })
  }
}


text:
package com.kinopoisk;

import java.io.IOException;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils;

import java.io.IOException;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class KinopoiskRequestInterceptor implements Interceptor {

    private static final String KP_SECRET = "a17qbcw1du0aedm";
    private static final String KP_UUID = "84e8b92499a32a3d0d8ea956e6a05d76";
    private static final String KP_CLIENT_ID = "55decdcf6d4cd1bcaa1b3856";
    private static final String API_CHECK_FOR_UPDATE = "ios/check-new-version.php";

    @Override
    public Response intercept(Chain chain) throws IOException {

        Request interceptedRequest = chain.request();
        HttpUrl originalHttpUrl = interceptedRequest.url();

        // chain.proceed(buildCheckForUpdateRequest(originalHttpUrl.host())).close();
        return chain.proceed(buildMainRequest(interceptedRequest));
    }

    private String encodeWithSecret(String action) {
        return new String(Hex.encodeHex(DigestUtils.md5(action + KP_SECRET)));
    }

    /** build main request with additional parameters, required by kinopoisk */
    private Request buildMainRequest(Request interceptedRequest) {
        HttpUrl interceptedUrl = interceptedRequest.url();
        String commandName = interceptedUrl.pathSegments().get(2);
        URL oUrl = interceptedUrl.url();

        String action;
        if (oUrl.getQuery() == null) {
            action = commandName + "?" + "uuid=" + KP_UUID;
        } else {
            action = commandName + "?" + oUrl.getQuery() + "&uuid=" + KP_UUID;
        }

        // Build encoded key for query
        String encodedKey = encodeWithSecret(action);

        // Put additional params to auth
        HttpUrl url = interceptedUrl.newBuilder()
                .addQueryParameter("uuid", KP_UUID)
                .addQueryParameter("key", encodedKey)
                .build();

        // Put additional headers to look like KP client
        interceptedRequest = basicHeaders(interceptedRequest.newBuilder()
                .removeHeader("User-Agent")
                .url(url))
                .build();

        return interceptedRequest;
    }

    /** build a request to check if our client is deprecated
     * with new kinopoisk api we should do it with any request to setup cookies */
    private Request buildCheckForUpdateRequest(String host) {

        String action = "check-new-version.php" + "?" + "appVersion=" + Constants.API_VERSION + "&uuid=" + KP_UUID;
        String encodedKey = encodeWithSecret(action);

        HttpUrl url = new HttpUrl.Builder()
                .scheme("https")
                .host(host)
                .addPathSegments(API_CHECK_FOR_UPDATE)
                .addQueryParameter("key", encodedKey)
                .addQueryParameter("appVersion", Constants.API_VERSION)
                .addQueryParameter("uuid", KP_UUID)
                .build();

        Request.Builder builder = basicHeaders(new Request.Builder())
                .url(url)
                .addHeader("Cookie", "user_country=ru");

        return builder.build();
    }

    private Request.Builder basicHeaders(Request.Builder builder) {
        // Generate req date
        Date date = new Date();
        DateFormat dateFormat = new SimpleDateFormat("HH:mm MM.dd.yyyy", Locale.getDefault());
        String clientDate = dateFormat.format(date);

        builder
                .addHeader("device", "android")
                .addHeader("Android-Api-Version", "22")
                .addHeader("countryID", "2")
                .addHeader("ClientId", KP_CLIENT_ID)
                .addHeader("clientDate", clientDate)
                .addHeader("cityID", "2")
                .addHeader("Image-Scale", "3")
                .addHeader("Cache-Control", "max-stale=0")
                .addHeader("User-Agent", "Android client (5.1 / api22), ru.kinopoisk/3.7.0 (45)")
                .addHeader("Accept-Encoding", "gzip");

        return builder;
    }
}


text:
package com.netflix.genie.web.data.services.impl.jpa.entities;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.netflix.genie.common.internal.dtos.JobStatus;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import javax.validation.ConstraintViolationException;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

/**
 * Tests for {@link JobEntity}.
 *
 * @author amsharma
 * @author tgianos
 */
class JobEntityTest extends EntityTestBase {

    private static final String USER = "tgianos";
    private static final String NAME = "TomsJob";
    private static final String VERSION = "1.2.3";

    private JobEntity entity;

    @BeforeEach
    void setup() {
        this.entity = new JobEntity();
        this.entity.setUser(USER);
        this.entity.setName(NAME);
        this.entity.setVersion(VERSION);
    }

    @Test
    void testDefaultConstructor() {
        final JobEntity localJobEntity = new JobEntity();
        Assertions.assertThat(localJobEntity.getUniqueId()).isNotBlank();
    }

    @Test
    void testConstructor() {
        Assertions.assertThat(this.entity.getUniqueId()).isNotBlank();
        Assertions.assertThat(NAME).isEqualTo(this.entity.getName());
        Assertions.assertThat(USER).isEqualTo(this.entity.getUser());
        Assertions.assertThat(this.entity.getVersion()).isEqualTo(VERSION);
    }

    @Test
    void testOnCreateJob() {
        Assertions.assertThat(this.entity.getTagSearchString()).isNull();
        this.entity.onCreateJob();
        Assertions.assertThat(this.entity.getTagSearchString()).isNull();
        final TagEntity one = new TagEntity("abc");
        final TagEntity two = new TagEntity("def");
        final TagEntity three = new TagEntity("ghi");
        this.entity.setTags(Sets.newHashSet(three, two, one));
        this.entity.onCreateJob();
        Assertions.assertThat(this.entity.getTagSearchString()).isEqualTo("|abc||def||ghi|");
    }

    @Test
    void testSetGetClusterName() {
        this.testOptionalField(
            this.entity::getClusterName,
            this.entity::setClusterName,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void testSetGetCommandName() {
        this.testOptionalField(
            this.entity::getCommandName,
            this.entity::setCommandName,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void testSetGetCommandArgs() {
        Assertions.assertThat(this.entity.getCommandArgs()).isEmpty();
        this.entity.setCommandArgs(null);
        Assertions.assertThat(this.entity.getCommandArgs()).isEmpty();
        final List<String> commandArgs = Lists.newArrayList();
        this.entity.setCommandArgs(commandArgs);
        Assertions.assertThat(this.entity.getCommandArgs()).isEmpty();
        commandArgs.add(UUID.randomUUID().toString());
        this.entity.setCommandArgs(commandArgs);
        Assertions.assertThat(this.entity.getCommandArgs()).isEqualTo(commandArgs);
    }

    @Test
    void testSetGetStatus() {
        Assertions.assertThat(this.entity.getStatus()).isNull();
        this.entity.setStatus(JobStatus.KILLED.name());
        Assertions.assertThat(this.entity.getStatus()).isEqualTo(JobStatus.KILLED.name());
    }

    @Test
    void testSetGetStatusMsg() {
        this.testOptionalField(this.entity::getStatusMsg, this.entity::setStatusMsg, UUID.randomUUID().toString());
    }

    @Test
    void testSetGetStarted() {
        this.testOptionalField(this.entity::getStarted, this.entity::setStarted, Instant.ofEpochMilli(123453L));
    }

    @Test
    void testSetGetFinished() {
        this.testOptionalField(this.entity::getFinished, this.entity::setFinished, Instant.ofEpochMilli(123453L));
    }

    @Test
    void testSetGetArchiveLocation() {
        this.testOptionalField(
            this.entity::getArchiveLocation,
            this.entity::setArchiveLocation,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void testSetNotifiedJobStatus() {
        final JobEntity localJobEntity = new JobEntity();
        Assertions.assertThat(localJobEntity.getNotifiedJobStatus()).isNotPresent();
        localJobEntity.setNotifiedJobStatus(JobStatus.RUNNING.name());
        Assertions.assertThat(localJobEntity.getNotifiedJobStatus()).isPresent().contains(JobStatus.RUNNING.name());
    }

    @Test
    void testSetGetTags() {
        Assertions.assertThat(this.entity.getTags()).isEmpty();
        final TagEntity one = new TagEntity("someTag");
        final TagEntity two = new TagEntity("someOtherTag");
        final Set<TagEntity> tags = Sets.newHashSet(one, two);
        this.entity.setTags(tags);
        Assertions.assertThat(this.entity.getTags()).isEqualTo(tags);

        this.entity.setTags(null);
        Assertions.assertThat(this.entity.getTags()).isEmpty();
    }

    @Test
    void testValidate() {
        this.validate(this.entity);
    }

    @Test
    void testValidateBadSuperClass() {
        Assertions
            .assertThatExceptionOfType(ConstraintViolationException.class)
            .isThrownBy(() -> this.validate(new JobEntity()));
    }

    @Test
    void canSetCluster() {
        final ClusterEntity cluster = new ClusterEntity();
        final String clusterName = UUID.randomUUID().toString();
        cluster.setName(clusterName);
        Assertions.assertThat(this.entity.getCluster()).isNotPresent();
        Assertions.assertThat(this.entity.getClusterName()).isNotPresent();
        this.entity.setCluster(cluster);
        Assertions.assertThat(this.entity.getCluster()).isPresent().contains(cluster);
        Assertions.assertThat(this.entity.getClusterName()).isPresent().contains(clusterName);

        this.entity.setCluster(null);
        Assertions.assertThat(this.entity.getCluster()).isNotPresent();
        Assertions.assertThat(this.entity.getClusterName()).isNotPresent();
    }

    @Test
    void canSetCommand() {
        final CommandEntity command = new CommandEntity();
        final String commandName = UUID.randomUUID().toString();
        command.setName(commandName);
        Assertions.assertThat(this.entity.getCommand()).isNotPresent();
        Assertions.assertThat(this.entity.getCommandName()).isNotPresent();
        this.entity.setCommand(command);
        Assertions.assertThat(this.entity.getCommand()).isPresent().contains(command);
        Assertions.assertThat(this.entity.getCommandName()).isPresent().contains(commandName);

        this.entity.setCommand(null);
        Assertions.assertThat(this.entity.getCommand()).isNotPresent();
        Assertions.assertThat(this.entity.getCommandName()).isNotPresent();
    }

    @Test
    void canSetApplications() {
        final ApplicationEntity application1 = new ApplicationEntity();
        application1.setUniqueId(UUID.randomUUID().toString());
        final ApplicationEntity application2 = new ApplicationEntity();
        application2.setUniqueId(UUID.randomUUID().toString());
        final ApplicationEntity application3 = new ApplicationEntity();
        application3.setUniqueId(UUID.randomUUID().toString());
        final List<ApplicationEntity> applications = Lists.newArrayList(application1, application2, application3);

        Assertions.assertThat(this.entity.getApplications()).isEmpty();
        this.entity.setApplications(applications);
        Assertions.assertThat(this.entity.getApplications()).isEqualTo(applications);
    }

    @Test
    void canSetAgentHostName() {
        this.testOptionalField(
            this.entity::getAgentHostname,
            this.entity::setAgentHostname,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetProcessId() {
        this.testOptionalField(this.entity::getProcessId, this.entity::setProcessId, 352);
    }

    @Test
    void canSetExitCode() {
        this.testOptionalField(this.entity::getExitCode, this.entity::setExitCode, 80072043);
    }

    @Test
    void canSetMemoryUsed() {
        this.testOptionalField(this.entity::getMemoryUsed, this.entity::setMemoryUsed, 10_240L);
    }

    @Test
    void canSetRequestApiClientHostname() {
        this.testOptionalField(
            this.entity::getRequestApiClientHostname,
            this.entity::setRequestApiClientHostname,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetRequestApiClientUserAgent() {
        this.testOptionalField(
            this.entity::getRequestApiClientUserAgent,
            this.entity::setRequestApiClientUserAgent,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetRequestAgentClientHostname() {
        this.testOptionalField(
            this.entity::getRequestAgentClientHostname,
            this.entity::setRequestAgentClientHostname,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetRequestAgentClientVersion() {
        this.testOptionalField(
            this.entity::getRequestAgentClientVersion,
            this.entity::setRequestAgentClientVersion,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetRequestAgentClientPid() {
        this.testOptionalField(this.entity::getRequestAgentClientPid, this.entity::setRequestAgentClientPid, 28_000);
    }

    @Test
    void canSetNumAttachments() {
        this.testOptionalField(this.entity::getNumAttachments, this.entity::setNumAttachments, 380_208);
    }

    @Test
    void canSetTotalSizeOfAttachments() {
        this.testOptionalField(
            this.entity::getTotalSizeOfAttachments,
            this.entity::setTotalSizeOfAttachments,
            90832432L
        );
    }

    @Test
    void canSetStdOutSize() {
        this.testOptionalField(this.entity::getStdOutSize, this.entity::setStdOutSize, 90334432L);
    }

    @Test
    void canSetStdErrSize() {
        this.testOptionalField(this.entity::getStdErrSize, this.entity::setStdErrSize, 9089932L);
    }

    @Test
    void canSetGroup() {
        this.testOptionalField(
            this.entity::getGenieUserGroup,
            this.entity::setGenieUserGroup,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetClusterCriteria() {
        final Set<TagEntity> one = Sets.newHashSet("one", "two", "three")
            .stream()
            .map(TagEntity::new)
            .collect(Collectors.toSet());
        final Set<TagEntity> two = Sets.newHashSet("four", "five", "six")
            .stream()
            .map(TagEntity::new)
            .collect(Collectors.toSet());
        final Set<TagEntity> three = Sets.newHashSet("seven", "eight", "nine")
            .stream()
            .map(TagEntity::new)
            .collect(Collectors.toSet());

        final CriterionEntity entity1 = new CriterionEntity(null, null, null, null, one);
        final CriterionEntity entity2 = new CriterionEntity(null, null, null, null, two);
        final CriterionEntity entity3 = new CriterionEntity(null, null, null, null, three);

        final List<CriterionEntity> clusterCriteria = Lists.newArrayList(entity1, entity2, entity3);

        this.entity.setClusterCriteria(clusterCriteria);
        Assertions.assertThat(this.entity.getClusterCriteria()).isEqualTo(clusterCriteria);
    }

    @Test
    void canSetNullClusterCriteria() {
        this.entity.setClusterCriteria(null);
        Assertions.assertThat(this.entity.getClusterCriteria()).isEmpty();
    }

    @Test
    void canSetConfigs() {
        final Set<FileEntity> configs = Sets.newHashSet(new FileEntity(UUID.randomUUID().toString()));
        this.entity.setConfigs(configs);
        Assertions.assertThat(this.entity.getConfigs()).isEqualTo(configs);
    }

    @Test
    void canSetNullConfigs() {
        this.entity.setConfigs(null);
        Assertions.assertThat(this.entity.getConfigs()).isEmpty();
    }

    @Test
    void canSetDependencies() {
        final Set<FileEntity> dependencies = Sets.newHashSet(new FileEntity(UUID.randomUUID().toString()));
        this.entity.setDependencies(dependencies);
        Assertions.assertThat(this.entity.getDependencies()).isEqualTo(dependencies);
    }

    @Test
    void canSetNullDependencies() {
        this.entity.setDependencies(null);
        Assertions.assertThat(this.entity.getDependencies()).isEmpty();
    }

    @Test
    void canSetArchivingDisabled() {
        this.entity.setArchivingDisabled(true);
        Assertions.assertThat(this.entity.isArchivingDisabled()).isTrue();
    }

    @Test
    void canSetEmail() {
        this.testOptionalField(this.entity::getEmail, this.entity::setEmail, UUID.randomUUID().toString());
    }

    @Test
    void canSetCommandCriteria() {
        final Set<TagEntity> tags = Sets.newHashSet(
            new TagEntity(UUID.randomUUID().toString()),
            new TagEntity(UUID.randomUUID().toString())
        );

        final CriterionEntity commandCriterion = new CriterionEntity(null, null, null, null, tags);
        this.entity.setCommandCriterion(commandCriterion);
        Assertions.assertThat(this.entity.getCommandCriterion()).isEqualTo(commandCriterion);
    }

    @Test
    void canSetSetupFile() {
        final FileEntity setupFileEntity = new FileEntity(UUID.randomUUID().toString());
        this.entity.setSetupFile(setupFileEntity);
        Assertions.assertThat(this.entity.getSetupFile()).isPresent().contains(setupFileEntity);
    }

    @Test
    void canSetTags() {
        final TagEntity one = new TagEntity(UUID.randomUUID().toString());
        final TagEntity two = new TagEntity(UUID.randomUUID().toString());
        final Set<TagEntity> tags = Sets.newHashSet(one, two);

        this.entity.setTags(tags);
        Assertions.assertThat(this.entity.getTags()).isEqualTo(tags);

        this.entity.setTags(null);
        Assertions.assertThat(this.entity.getTags()).isEmpty();
    }

    @Test
    void canSetRequestedCpu() {
        this.testOptionalField(this.entity::getRequestedCpu, this.entity::setRequestedCpu, 16);
    }

    @Test
    void canSetRequestedMemory() {
        this.testOptionalField(this.entity::getRequestedMemory, this.entity::setRequestedMemory, 2048L);
    }

    @Test
    void canSetRequestedApplications() {
        final String application = UUID.randomUUID().toString();
        final List<String> applications = Lists.newArrayList(application);
        this.entity.setRequestedApplications(applications);
        Assertions.assertThat(this.entity.getRequestedApplications()).isEqualTo(applications);
    }

    @Test
    void canSetRequestedTimeout() {
        this.testOptionalField(this.entity::getRequestedTimeout, this.entity::setRequestedTimeout, 28023423);
    }

    @Test
    void canSetRequestedEnvironmentVariables() {
        Assertions.assertThat(this.entity.getRequestedEnvironmentVariables()).isEmpty();

        this.entity.setRequestedEnvironmentVariables(null);
        Assertions.assertThat(this.entity.getRequestedEnvironmentVariables()).isEmpty();

        final Map<String, String> variables = Maps.newHashMap();
        variables.put(UUID.randomUUID().toString(), UUID.randomUUID().toString());
        this.entity.setRequestedEnvironmentVariables(variables);
        Assertions.assertThat(this.entity.getRequestedEnvironmentVariables()).isEqualTo(variables);

        // Make sure outside modifications of collection don't affect internal class state
        variables.put(UUID.randomUUID().toString(), UUID.randomUUID().toString());
        Assertions.assertThat(this.entity.getRequestedEnvironmentVariables()).isNotEqualTo(variables);

        this.entity.setRequestedEnvironmentVariables(variables);
        Assertions.assertThat(this.entity.getRequestedEnvironmentVariables()).isEqualTo(variables);

        // Make sure this clears variables
        this.entity.setRequestedEnvironmentVariables(null);
        Assertions.assertThat(this.entity.getRequestedEnvironmentVariables()).isEmpty();
    }

    @Test
    void canSetEnvironmentVariables() {
        Assertions.assertThat(this.entity.getEnvironmentVariables()).isEmpty();

        this.entity.setEnvironmentVariables(null);
        Assertions.assertThat(this.entity.getEnvironmentVariables()).isEmpty();

        final Map<String, String> variables = Maps.newHashMap();
        variables.put(UUID.randomUUID().toString(), UUID.randomUUID().toString());
        this.entity.setEnvironmentVariables(variables);
        Assertions.assertThat(this.entity.getEnvironmentVariables()).isEqualTo(variables);

        // Make sure outside modifications of collection don't affect internal class state
        variables.put(UUID.randomUUID().toString(), UUID.randomUUID().toString());
        Assertions.assertThat(this.entity.getEnvironmentVariables()).isNotEqualTo(variables);

        this.entity.setEnvironmentVariables(variables);
        Assertions.assertThat(this.entity.getEnvironmentVariables()).isEqualTo(variables);

        // Make sure this clears variables
        this.entity.setEnvironmentVariables(null);
        Assertions.assertThat(this.entity.getEnvironmentVariables()).isEmpty();
    }

    @Test
    void canSetInteractive() {
        Assertions.assertThat(this.entity.isInteractive()).isFalse();
        this.entity.setInteractive(true);
        Assertions.assertThat(this.entity.isInteractive()).isTrue();
    }

    @Test
    void canSetResolved() {
        Assertions.assertThat(this.entity.isResolved()).isFalse();
        this.entity.setResolved(true);
        Assertions.assertThat(this.entity.isResolved()).isTrue();
    }

    @Test
    void canSetRequestedJobDirectoryLocation() {
        this.testOptionalField(
            this.entity::getRequestedJobDirectoryLocation,
            this.entity::setRequestedJobDirectoryLocation,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetJobDirectoryLocation() {
        this.testOptionalField(
            this.entity::getJobDirectoryLocation,
            this.entity::setJobDirectoryLocation,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetRequestedAgentConfigExt() {
        this.testOptionalField(
            this.entity::getRequestedAgentConfigExt,
            this.entity::setRequestedAgentConfigExt,
            Mockito.mock(JsonNode.class)
        );
    }

    @Test
    void canSetRequestedAgentEnvironmentExt() {
        this.testOptionalField(
            this.entity::getRequestedAgentEnvironmentExt,
            this.entity::setRequestedAgentEnvironmentExt,
            Mockito.mock(JsonNode.class)
        );
    }

    @Test
    void canSetAgentVersion() {
        this.testOptionalField(
            this.entity::getAgentVersion,
            this.entity::setAgentVersion,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetAgentPid() {
        this.testOptionalField(this.entity::getAgentPid, this.entity::setAgentPid, 31_382);
    }

    @Test
    void canSetClaimed() {
        Assertions.assertThat(this.entity.isClaimed()).isFalse();
        this.entity.setClaimed(true);
        Assertions.assertThat(this.entity.isClaimed()).isTrue();
    }

    @Test
    void canSetTimeoutUsed() {
        this.testOptionalField(this.entity::getTimeoutUsed, this.entity::setTimeoutUsed, 324_323);
    }

    @Test
    void canSetApi() {
        Assertions.assertThat(this.entity.isApi()).isTrue();
        this.entity.setApi(false);
        Assertions.assertThat(this.entity.isApi()).isFalse();
    }

    @Test
    void canSetArchiveStatus() {
        this.testOptionalField(
            this.entity::getArchiveStatus,
            this.entity::setArchiveStatus,
            UUID.randomUUID().toString()
        );
    }

    @Test
    void canSetRequestedLauncherExt() {
        this.testOptionalField(
            this.entity::getRequestedLauncherExt,
            this.entity::setRequestedLauncherExt,
            Mockito.mock(JsonNode.class)
        );
    }

    @Test
    void canSetLauncherExt() {
        this.testOptionalField(this.entity::getLauncherExt, this.entity::setLauncherExt, Mockito.mock(JsonNode.class));
    }

    @Test
    void canSetCpuUsed() {
        this.testOptionalField(this.entity::getCpuUsed, this.entity::setCpuUsed, 42);
    }

    @Test
    void canSetGpuRequested() {
        this.testOptionalField(this.entity::getRequestedGpu, this.entity::setRequestedGpu, 24);
    }

    @Test
    void canSetGpuUsed() {
        this.testOptionalField(this.entity::getGpuUsed, this.entity::setGpuUsed, 242524);
    }

    @Test
    void canSetRequestedDiskMb() {
        this.testOptionalField(this.entity::getRequestedDiskMb, this.entity::setRequestedDiskMb, 1_5234L);
    }

    @Test
    void canSetDiskMbUsed() {
        this.testOptionalField(this.entity::getDiskMbUsed, this.entity::setDiskMbUsed, 1_234L);
    }

    @Test
    void canSetRequestedNetworkMbps() {
        this.testOptionalField(this.entity::getRequestedNetworkMbps, this.entity::setRequestedNetworkMbps, 52L);
    }

    @Test
    void canSetNetworkMbpsUsed() {
        this.testOptionalField(this.entity::getNetworkMbpsUsed, this.entity::setNetworkMbpsUsed, 521L);
    }

    @Test
    void canSetRequestedImages() {
        this.testOptionalField(
            this.entity::getRequestedImages,
            this.entity::setRequestedImages,
            Mockito.mock(JsonNode.class)
        );
    }

    @Test
    void canSetImageNameUsed() {
        this.testOptionalField(
            this.entity::getImagesUsed,
            this.entity::setImagesUsed,
            Mockito.mock(JsonNode.class)
        );
    }

    @Test
    void testToString() {
        Assertions.assertThat(this.entity.toString()).isNotBlank();
    }
}


text:
<?php

namespace School\ConfigBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ConstanteType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('paysFrancais')
            ->add('paysAnglais')
            ->add('ministereFrancais')
            ->add('ministereAnglais')
            ->add('deviseFrancais')
            ->add('deviseAnglais')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'School\ConfigBundle\Entity\Constante'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'school_configbundle_constante';
    }
}


text:
<?php

class RefAkdPresensiMhs extends \Phalcon\Mvc\Model
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=11, nullable=false)
     */
    public $id;

    /**
     *
     * @var string
     * @Primary
     * @Column(type="string", length=25, nullable=false)
     */
    public $nomhs;

    /**
     *
     * @var integer
     * @Primary
     * @Column(type="integer", length=6, nullable=false)
     */
    public $psmhs_id;

    /**
     *
     * @var integer
     * @Primary
     * @Column(type="integer", length=6, nullable=false)
     */
    public $ps_id;

    /**
     *
     * @var string
     * @Primary
     * @Column(type="string", length=4, nullable=false)
     */
    public $thn_akd;

    /**
     *
     * @var string
     * @Primary
     * @Column(type="string", length=3, nullable=false)
     */
    public $session_id;

    /**
     *
     * @var string
     * @Primary
     * @Column(type="string", length=10, nullable=false)
     */
    public $kode_mk;

    /**
     *
     * @var string
     * @Primary
     * @Column(type="string", length=8, nullable=false)
     */
    public $thn_kur;

    public function getSource()
    {
        return 'ref_akd_presensi_mhs';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return RefAkdKrs[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return RefAkdKrs
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}


text:
/**
 *
 *  (c) 2010-2021 Pawel Fus & Daniel Studencki
 *
 *  License: www.highcharts.com/license
 *
 *  !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
 *
 * */
'use strict';
import '../Core/Utilities.js';
var reduceArrayMixin = {
    /**
     * Get min value of array filled by OHLC data.
     * @private
     * @param {Array<*>} arr Array of OHLC points (arrays).
     * @param {string} index Index of "low" value in point array.
     * @return {number} Returns min value.
     */
    minInArray: function (arr, index) {
        return arr.reduce(function (min, target) {
            return Math.min(min, target[index]);
        }, Number.MAX_VALUE);
    },
    /**
     * Get max value of array filled by OHLC data.
     * @private
     * @param {Array<*>} arr Array of OHLC points (arrays).
     * @param {string} index Index of "high" value in point array.
     * @return {number} Returns max value.
     */
    maxInArray: function (arr, index) {
        return arr.reduce(function (max, target) {
            return Math.max(max, target[index]);
        }, -Number.MAX_VALUE);
    },
    /**
     * Get extremes of array filled by OHLC data.
     * @private
     * @param {Array<*>} arr Array of OHLC points (arrays).
     * @param {string} minIndex Index of "low" value in point array.
     * @param {string} maxIndex Index of "high" value in point array.
     * @return {Array<number,number>} Returns array with min and max value.
     */
    getArrayExtremes: function (arr, minIndex, maxIndex) {
        return arr.reduce(function (prev, target) {
            return [
                Math.min(prev[0], target[minIndex]),
                Math.max(prev[1], target[maxIndex])
            ];
        }, [Number.MAX_VALUE, -Number.MAX_VALUE]);
    }
};
export default reduceArrayMixin;


text:
class CreateGitPushes < ActiveRecord::Migration
  def change
    create_table :git_pushes do |t|
      t.text :payload

      t.timestamps
    end
  end
end


text:
using CandyFramework.Entity.Entity.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Data.Entity.Infrastructure.Annotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CandyFramework.DataAccessLayer.Concrete.EntityFramework.Mapping
{
    internal static class UserGroupMap
    {
        internal static void UserGroupMapping(this DbModelBuilder builder)
        {
            var config = builder.Entity<UserGroupEntity>();

            config.ToTable("USER_GROUP");
            config.HasKey(x => x.Id);

            config.Property(x => x.Name).HasColumnName("NAME").IsRequired().HasMaxLength(100);
            config.Property(x => x.State).HasColumnOrder(104).HasColumnName("STATE").IsRequired();
            config.Property(x => x.CreateDate).HasColumnOrder(100).HasColumnName("CREATE_DATE").IsRequired();
            config.Property(x => x.UpdateDate).HasColumnOrder(101).HasColumnName("UPDATE_DATE").IsRequired();
            config.Property(x => x.CreateUser).HasColumnOrder(102).HasColumnName("CREATE_USER").HasMaxLength(30).IsRequired();
            config.Property(x => x.UpdateUser).HasColumnOrder(103).HasColumnName("UPDATE_USER").HasMaxLength(30).IsRequired();

            config.Property(p => p.Name).HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute("IX_USER_GROUP_NAME", 1) { IsUnique = true }));
            //config.Property(p => p.IndexColmunName2).HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute("IX_TABLENAME_1", 2) { IsUnique = true }));
        }
    }
}


text:
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
CLEAR='\033[0m'

## Grab the 'latest' Celera Assembler code from Sourceforge

## this will redirect to the latest
LATEST_URL="http://sourceforge.net/projects/wgs-assembler/files/latest/download?source=files"

## for convenience
LATEST_NAME="wgs-latest.tar.bz2"

## working directory
WORKING_DIR=`readlink -f $(dirname $0)`

## will use curl for the download
CURL_BIN=`which curl`

if [ "${CURL_BIN}" = "" ]; then
    printf "${RED}This script requires that you have 'curl' available in your path.${CLEAR}\n"
    exit 1
fi

printf "${YELLOW}This script will download the latest version of Celera Assembler\nand patch 'runCA.pl' to add support for 'SLURM'.${CLEAR}\n"
read -p "Is this OK? [Y/n]: " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Nn]$ ]]; then
    printf "${RED}Aborting script...${CLEAR}\n"
    exit 1
fi

printf "${YELLOW}Downloading 'latest' version of Celera Assembler from Sourceforge...${CLEAR}\n"

${CURL_BIN} -L ${LATEST_URL} -o ${LATEST_NAME}

## could trap errors, but too lazy
if [ $? -eq 0 ]; then
    printf "${GREEN}Download seems OK.${CLEAR}\n"
else
    echo "${RED}There was some error running 'curl'.${CLEAR}\n"
    exit 1
fi

printf "${YELLOW}Extracting archive...${CLEAR}\n"

tar xjf ${LATEST_NAME}

## see above
if [ $? -eq 0 ]; then
    printf "${GREEN}Archive extraction seems OK.${CLEAR}\n"
else
    echo "${RED}There was an error extracting the archive.${CLEAR}\n"
    exit 1
fi

printf "${YELLOW}Looking for 'runCA.pl' script under working dir...${CLEAR}\n"

## should find one script that matches under working dir
SCRIPT_COUNT=`find ${WORKING_DIR} -name "runCA.pl" | wc -l`

if [ "${SCRIPT_COUNT}" -eq "1" ]; then

    printf "${YELLOW}Found 'runCA.pl' and will now patch...${CLEAR}\n"

    ## use the path from find
    RUNCA=`find ${WORKING_DIR} -name "runCA.pl"`

    ## apply the patch
    patch ${RUNCA} << "SLURM_PATCH"
--- ./wgs-8.3rc2/src/AS_RUN/runCA.pl	2015-05-20 17:28:27.000000000 -0400
+++ runCA-with-slurm	2015-08-14 11:04:12.000000000 -0400
@@ -307,6 +307,26 @@
         setGlobal("gridEngineJobID",              "LSB_JOBID");
     }

+    ### BEGIN ___ Brett Whitty <brett@gnomatix.com> SLURM support patch - block 1/2 ___
+    if (($var eq "gridEngine") && ($val eq "SLURM")) {
+        setGlobal("gridEngineSubmitCommand",      "sbatch");
+        setGlobal("gridEngineHoldOption",         "--depend=afterany:\"WAIT_TAG\"");
+        setGlobal("gridEngineHoldOptionNoArray",  "--depend=afterany:\"WAIT_TAG\"");
+        setGlobal("gridEngineSyncOption",         "");                                          ## TODO: SLURM may not support w/out wrapper; See LSF bsub manpage to compare
+        setGlobal("gridEngineNameOption",         "-D `pwd` -J");
+        setGlobal("gridEngineArrayOption",        "-a ARRAY_JOBS");
+        setGlobal("gridEngineArrayName",          "ARRAY_NAME\[ARRAY_JOBS\]");
+        setGlobal("gridEngineOutputOption",       "-o");                                        ## NB: SLURM default joins STDERR & STDOUT if no -e specified
+        setGlobal("gridEnginePropagateCommand",   "scontrol update job=\"WAIT_TAG\"");          ## TODO: manually verify this in all cases
+        setGlobal("gridEngineNameToJobIDCommand", "squeue -h -o\%F_* -n \"WAIT_TAG\" | uniq");  ## TODO: manually verify this in all cases
+        setGlobal("gridEngineNameToJobIDCommandNoArray", "squeue -h -o\%i -n \"WAIT_TAG\"");    ## TODO: manually verify this in all cases
+        setGlobal("gridEngineTaskID",             "SLURM_ARRAY_TASK_ID");
+        setGlobal("gridEngineArraySubmitID",      "%A_%a");
+        setGlobal("gridEngineJobID",              "SLURM_JOB_ID");
+    }
+    ### END ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
     #  Update obsolete usage.

     if ($var eq "doOverlapTrimming") {
@@ -1526,7 +1546,9 @@

     if (defined($waitTag)) {
         my $hold = $holdOption;
-        if (getGlobal("gridEngine") eq "LSF" || getGlobal("gridEngine") eq "PBS"){
+    ### BEGIN ___ Brett Whitty <brett@gnomatix.com> SLURM support patch - block 2/2 ___
+        if (getGlobal("gridEngine") eq "LSF" || getGlobal("gridEngine") eq "PBS" || getGlobal("gridEngine") eq "SLURM"){
+    ### END ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            my $tcmd = getGlobal("gridEngineNameToJobIDCommand");
            $tcmd =~ s/WAIT_TAG/$waitTag/g;
            my $propJobCount = `$tcmd |wc -l`;
SLURM_PATCH

fi

## final lazy check
if [ $? -eq 0 ]; then
    printf "${GREEN}Patching seems OK.${CLEAR}\n\n"
    printf "${YELLOW}The patched Celera Assembler 'runCA[.pl]' script now supports option 'gridEngine = SLURM'${CLEAR}.\n\n"
    printf "For more details, see:\n${GREEN}https://github.com/brettwhitty/bw-ca-tools/runCA-slurm-patch/README.md${CLEAR}\n\n"
    printf "${YELLOW}You can now either build and install Celera Assembler from the source code in the working directory,\n"
    printf "or copy 'runCA.pl' over top of 'runCA' in your existing CA install 'bin' dir.${CLEAR}\n\n"
    printf "Patched script is here:\n${GREEN}${RUNCA}\n${CLEAR}\n"
    exit 0
else
    printf "${RED}Patching appears to have failed.${CLEAR}\n"
    exit 1
fi


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MonoGdx.Scene2D.Utils;
using MonoGdx.TableLayout;
using MonoGdx.Graphics.G2D;

namespace MonoGdx.Scene2D.UI
{
    public class HorizontalGroup : WidgetGroup
    {
        private HorizontalGroupStyle _style;
        private float _prefWidth;
        private float _prefHeight;
        private bool _sizeInvalid = true;

        public HorizontalGroup ()
        {
            Touchable = Scene2D.Touchable.ChildrenOnly;
        }

        public HorizontalGroup (Skin skin)
            : this(skin.Get<HorizontalGroupStyle>())
        { }

        public HorizontalGroup (Skin skin, string styleName)
            : this(skin.Get<HorizontalGroupStyle>(styleName))
        { }

        public HorizontalGroup (HorizontalGroupStyle style)
            : this()
        {
            Style = style;
        }

        public HorizontalGroupStyle Style
        {
            get { return _style; }
            set { _style = value; }
        }

        public Alignment Alignment { get; set; }

        public bool IsReversed { get; set; }

        public override void Invalidate ()
        {
            base.Invalidate();
            _sizeInvalid = true;
        }

        private void ComputeSize ()
        {
            _sizeInvalid = false;
            _prefWidth = 0;
            _prefHeight = 0;

            foreach (var child in Children) {
                if (child is ILayout) {
                    ILayout layout = child as ILayout;
                    _prefWidth += layout.PrefWidth;
                    _prefHeight = Math.Max(_prefHeight, layout.PrefHeight);

                }
                else {
                    _prefWidth += child.Width;
                    _prefHeight = Math.Max(_prefHeight, child.Height);
                }
            }
        }

        public override void Layout ()
        {
            float groupHeight = Height;
            float x = IsReversed ? 0 : Width;
            float dir = IsReversed ? 1 : -1;

            foreach (var child in Children) {
                float width;
                float height;

                if (child is ILayout) {
                    ILayout layout = child as ILayout;
                    width = layout.PrefWidth;
                    height = layout.PrefHeight;
                }
                else {
                    width = child.Width;
                    height = child.Height;
                }

                float y;
                if ((Alignment & Alignment.Bottom) != 0)
                    y = 0;
                else if ((Alignment & Alignment.Top) != 0)
                    y = groupHeight - height;
                else
                    y = (groupHeight - height) / 2;

                if (!IsReversed)
                    x += width * dir;
                child.SetBounds(x, y, width, height);
                if (IsReversed)
                    x += width * dir;
            }
        }

        public override void Draw (GdxSpriteBatch spriteBatch, float parentAlpha)
        {
            Validate();

            if (_style != null && _style.Background != null) {
                spriteBatch.Color = Color.MultiplyAlpha(parentAlpha);
                _style.Background.Draw(spriteBatch, X, Y, Width, Height);
            }

            base.Draw(spriteBatch, parentAlpha);
        }

        public override float PrefWidth
        {
            get
            {
                if (_sizeInvalid)
                    ComputeSize();
                return _prefWidth;
            }
        }

        public override float PrefHeight
        {
            get
            {
                if (_sizeInvalid)
                    ComputeSize();
                return _prefHeight;
            }
        }
    }

    public class HorizontalGroupStyle
    {
        public HorizontalGroupStyle ()
        { }

        public HorizontalGroupStyle (ISceneDrawable background)
        {
            Background = background;
        }

        public HorizontalGroupStyle (HorizontalGroupStyle style)
        {
            Background = style.Background;
        }

        public ISceneDrawable Background { get; set; }
    }
}


text: [^1]: [PostgreSQL: Documentation: 10: 2.8. Updates](https://www.postgresql.org/docs/10/static/tutorial-update.html)


text:
  << Back to forms
  <app-form [createMode]="createMode"
            [editMode]="editMode"
            [deleteMode]="deleteMode">
  </app-form>


text:
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- These settings headers are only used on tablets. -->

    <header
        android:fragment="me.chunyu.dev.yuriel.kotdebugtool.ExampleActivity$GeneralPreferenceFragment"
        android:icon="@drawable/dt_ic_info_black_24dp"
        android:title="@string/pref_header_general" />

    <header
        android:fragment="me.chunyu.dev.yuriel.kotdebugtool.ExampleActivity$NotificationPreferenceFragment"
        android:icon="@drawable/dt_ic_notifications_black_24dp"
        android:title="@string/pref_header_notifications" />

    <header
        android:fragment="me.chunyu.dev.yuriel.kotdebugtool.ExampleActivity$DataSyncPreferenceFragment"
        android:icon="@drawable/dt_ic_sync_black_24dp"
        android:title="@string/pref_header_data_sync" />

</preference-headers>


text:
if (typeof EditableList === 'undefined') {
  EditableList = {};
}

EditableList._removeListNumbers = function(raw) {
  var numberStrip = new RegExp("^\\d+\\s*[-.)]?\\s+");
  return (typeof raw !== 'undefined') ? raw.replace(numberStrip,"") : "";
}

EditableList._processTextarea = function(raw,process) {
  var unprocessed = raw.split(/[\r\n]+/);
  if (typeof process === 'undefined') {
    var processed = [];
    $.each(unprocessed,function(){
      var trimmed = $.trim(this);
      if (trimmed) {
        clipped = EditableList._removeListNumbers(trimmed);
        if (clipped) {
          processed.push(clipped);
        }
      }
    });
    return processed;
  }
  else {
    return unprocessed;
  }
}

Template.editableList.helpers({
  context : function() {
    return this.context || this.document || this.doc || this.object || this.obj || this.data || this.dataContext || Blaze._parentData(1);
  }
});

Template.editable_list_widget.helpers({

  listName : function() {
    return this.listName;
  },

  listItems : function() {
    var showList = Blaze._templateInstance().showList.get(); // The showList thing is a hack to take care of sortables and blaze not working together
    return showList && _.map(EditableText._drillDown(this.context,this.field) || [],function(item,index) {return {text:item,index:index};});
  },

  editingItem : function(obj) {
    var selected = Blaze._templateInstance().selected.get();
    return selected && this.text === selected.text && this.index === selected.index;
  },

  placeholder : function() {
    return this.placeholder || "";
  },

  canEditList : function(data) {
    return EditableText.userCanEdit.call(data,data.context,Mongo.Collection.get(data.collection));
  },

  itemIndex : function() {
    return this.index + 1;
  },

  optionalTemplateHelper : function() {
	return this.template && Template[this.template];
  }

});

Template.editable_list_widget.events({
  'click .editable-list li' : function(evt,tmpl) {
    var Collection = Mongo.Collection.get(tmpl.data.collection);
	var userCanEdit = EditableText.userCanEdit.call(tmpl.data,tmpl.data.context,Collection);
    userCanEdit = (typeof tmpl.data.userCanEdit !== 'undefined') ? (tmpl.data.userCanEdit && userCanEdit) : userCanEdit;
    if (userCanEdit) {
      var selected = tmpl.selected.get();
      if (!selected || (selected && selected.index !== this.index)) {
        evt.stopImmediatePropagation();
        var parentElem = tmpl.$(evt.currentTarget).closest('li');
        document.activeElement.blur(); // Make sure the focusout event fires first when switching editable text objects, so that the first one gets saved properly
        tmpl.selected.set({text:this.text,index:this.index});
        Tracker.flush();
        EditableText._activateInput(parentElem.find('input'));
      }
    }
  }
});

var okCancelEvents = {};
okCancelEvents.ok = function (value,evt,tmpl) {
  evt.stopImmediatePropagation();
  var key = tmpl.data.field;
  var Collection = Mongo.Collection.get(tmpl.data.collection);
  var selected = tmpl.selected.get();
  var newValue = $.trim(value.toString()).replace(/mml:/g,"");
  var oldValue = {};
  oldValue[key] = selected.text;
  if (selected && newValue !== selected.text) {
    var transactionText = ((newValue) ? 'edit' : 'remove') + ' ' + (tmpl.data.objectTypeText || 'list item');
    var oldArray = EditableText._drillDown(tmpl.data.context,key);
    var index = selected.index;
    var callbacks = (newValue) ? ['beforeUpdate','afterUpdate'] : ['beforeRemove','afterRemove'];
    var endOfArray = (newValue) ? [newValue].concat(oldArray.slice(index+1)) : oldArray.slice(index+1);
    var editedArray = oldArray.slice(0,index).concat(endOfArray);
    var updatedValue = {};
    updatedValue[key] = editedArray;
    EditableText.update.call(tmpl.data,Collection,tmpl.data.context,{$set:updatedValue},callbacks,transactionText);
  }
  tmpl.selected.set(null);
}
okCancelEvents.cancel = function (value,evt,tmpl) {
  evt.stopImmediatePropagation();
  tmpl.selected.set(null);
}

Template.editable_list_widget.events(EditableText._okCancelEvents('.editable-list-input', okCancelEvents, true));

Template.editable_list_widget.created = function() {
  this.selected = new ReactiveVar();
  this.showList = new ReactiveVar(true);
}

Template.editable_list_widget.rendered = function() {
  var self = this;
  if (!(typeof self.data.userCanEdit !== 'undefined' && !self.data.userCanEdit) && EditableText.userCanEdit.call(self.data,self.data.context,Mongo.Collection.get(self.data.collection))) {
	this.$('.editable-list').sortable({
	  items: "> li:not(.editable-list-form)",
	  start: function(e,ui) {
		self.selected.set(null);
	  },
	  update: function(e,ui){
		var items = self.$(this).find('li:not(.editable-list-form)');
		var reordered = [];
		items.each(function(i){
		  var item = Blaze.getData(this);
		  reordered.push(item.text);
		});
		var mod = {};
		mod[self.data.field] = reordered;
		self.data.transactionUpdateText = self.data.transactionUpdateText || 'reorder list';
		Meteor.defer(function() { // Need to defer to avoid too much recursion
		  // TODO -- add support for ['beforeReorder','afterReorder'] callbacks
		  EditableText.update.call(self.data,Mongo.Collection.get(self.data.collection),self.data.context,{$set:mod});
		  // What follows is a truly brutal blunt-force hack that creates unsightly flicker
		  // but it keeps the Blaze data in sync with the field from the document being edited
		  // If there's a better way to force a template redraw, I'd love to hear it
		  self.showList.set(false);
		  Tracker.flush();
		  self.showList.set(true);
		});
	  }
	});
  }
}

Template.editable_list_form.helpers({

  canEditList : function(data) {
	var userCanEdit = EditableText.userCanEdit.call(data,data.context,Mongo.Collection.get(data.collection));
    return (typeof data.userCanEdit !== 'undefined') ? (data.userCanEdit && userCanEdit) : userCanEdit;
  }

});

Template.editable_list_form.events({
  'submit .add-new-list-item, focusout .add-new-list-item input' : function(evt,tmpl) {
    evt.preventDefault();
    if (EditableText.userCanEdit.call(this,this.context,Mongo.Collection.get(this.collection))) {
      var newItem = $.trim(tmpl.$(evt.target).closest('.add-new-list-item').find('input').val()).replace(/mml:/g,"");
      if (newItem !== '') {
        var updatedValue = {};
        updatedValue[this.field] = newItem;
        var modifier = {};
        modifier[(this.allowDuplicates) ? "$push" : "$addToSet"] = updatedValue;
        EditableText.update.call(this,Mongo.Collection.get(this.collection),this.context,modifier,['beforeInsert','afterInsert'],'add to list');
        tmpl.$(evt.target).closest('.add-new-list-item').find('input').val('');
      }
    }
  },
  'paste .add-new-list-item' : function(evt,tmpl) {
    if (this.allowPasteMultiple && EditableText.userCanEdit.call(this,this.context,Mongo.Collection.get(this.collection))) {
      var text = evt.originalEvent.clipboardData.getData("text/plain");
      var items = EditableList._processTextarea(text);
      if (items.length > 1) {
        evt.preventDefault();
        var self = this;
        var newItems = this.context[this.field];
        _.each(items,function(item) {
          var newItem = $.trim(item.replace(/mml:/g,""));
          if (newItem !== '') {
            if (self.allowDuplcates) {
              newItems.push(newValue);
            }
            else {
              newItems = _.union(newItems,newItem);
            }
          }
        });
        var updatedValue = {};
        updatedValue[this.field] = newItems;
        var modifier = {$set:updatedValue};
        EditableText.update.call(this,Mongo.Collection.get(this.collection),this.context,modifier,['beforeInsertMultiple','afterInsertMultiple'],'add to list');
      }
    }
  }
});


text:
<!DOCTYPE html>
<html>
<head>
    <title>Getting Started with Three.js</title>

    <script src="three.js-master/build/three.min.js"></script>
	<script src="three.js-master/examples/js/controls/TrackballControls.js"></script>
    <script src="my.js"></script>
 </head>
<body>

</body>
</html>


text:
#include "scanner/api/op.h"
#include "scanner/engine/op_info.h"
#include "scanner/engine/op_registry.h"

namespace scanner {
namespace internal {

OpRegistration::OpRegistration(const OpBuilder& builder) {
  const std::string& name = builder.name_;
  const bool variadic_inputs = builder.variadic_inputs_;
  std::vector<Column> input_columns;
  size_t i = 0;
  for (auto& name_type : builder.input_columns_) {
    Column col;
    col.set_id(i++);
    col.set_name(std::get<0>(name_type));
    col.set_type(std::get<1>(name_type));
    input_columns.push_back(col);
  }
  std::vector<Column> output_columns;
  i = 0;
  for (auto& name_type : builder.output_columns_) {
    Column col;
    col.set_id(i++);
    col.set_name(std::get<0>(name_type));
    col.set_type(std::get<1>(name_type));
    col.set_type_name((std::get<2>(name_type)));
    output_columns.push_back(col);
  }
  bool can_stencil = builder.can_stencil_;
  const std::vector<i32>& stencil = builder.preferred_stencil_;
  bool has_bounded_state = builder.has_bounded_state_;
  i32 warmup = builder.warmup_;
  bool has_unbounded_state = builder.has_unbounded_state_;
  const std::string& pbn = builder.protobuf_name_;
  const std::string& stream_pbn = builder.stream_protobuf_name_;
  OpInfo* info = new OpInfo(name, variadic_inputs, input_columns,
                            output_columns, can_stencil, stencil,
                            has_bounded_state, warmup, has_unbounded_state,
                            pbn, stream_pbn);
  OpRegistry* registry = get_op_registry();
  Result result = registry->add_op(name, info);
  if (!result.success()) {
    LOG(WARNING) << "Failed to register op " << name << ": " << result.msg();
  }
}
}
}


text:
using System;

namespace MarkdownWeb.MarkdownService.Extensions
{
    public class PageLink
    {
        public PageLink(string url, string label)
        {
            Url = url ?? throw new ArgumentNullException(nameof(url));
            Label = label;
        }

        public string Url { get; set; }
        public string Label { get; }
        public bool? IsMissing { get; set; }
        public bool IsWikiLink { get; set; }
        public bool IsLocal { get; set; }
    }
}