text:
function Lab::saveSingleProfileStyleChanges(%this,%profile) {
	%profileStyle = %profile.getName()@"_Style";

	if (isObject(%profileStyle)) {
		//There's a style profile object for this profile, save changes to this
		foreach$(%field in $ProfileFieldList) {
			%mainDefault = $LabProfileStyleDefault[%profile.getName(),%field] = %value;

			if (%mainDefault $= "")
				%mainDefault = $LabProfileDefault[%profile.getName(),%field];

			%mainValue =  %profile.getFieldValue(%field);

			if(%mainValue !$= %mainDefault) {
				%profileStyle.setFieldValue(%field,%mainValue);
			}
		}

		//Now save it to file
		%group = %profileStyle.getGroup();
		%file = %group.myFile;

		if (isFile(%file)) {
			%result = %group.save(%file,false,"$tmpGroup = ");
		}

		if (%result)
			info("Changes have been saved to file:",%file);
	} else {
		info("Profile changes saved to original file");
		//Standard profile file so save it as usual (from GuiEditor)
		GuiEditorProfilesPM.saveDirtyObject( %profile );
	}
}
//------------------------------------------------------------------------------
//==============================================================================
// Load the Specific UI Style settings
function Lab::saveProfileStyleChanges(%this) {
	//First compare the values of all profiles
	foreach(%profileStyle in LabStyleGroup) {
		%profile =  %profileStyle.internalName;

		if (!isObject(%profile)) {
			%profile = getWord(strreplace(%profileStyle.getName(),"_"," "),0);
		}

		if (!isObject(%profile)) {
			warnLog("A profile style have a invalid target profile. We were looking for:",%profile);
			continue;
		}

		foreach$(%field in $ProfileFieldList) {
			%mainDefault = $LabProfileStyleDefault[%profile.getName(),%field] = %value;

			if (%mainDefault $= "")
				%mainDefault = $LabProfileDefault[%profile.getName(),%field];

			%mainValue =  %profile.getFieldValue(%field);

			if(%mainValue !$= %mainDefault) {
				%profileStyle.setFieldValue(%field,%default);
			}
		}
	}

	//Now save all grouped style profiles to their file
	foreach$(%group in $LabStyleGroupList) {
		%file = %group.myFile;

		if (isFile(%file)) {
			%result = %group.save(%file,false,"$tmpGroup = ");
		}

		if (%result)
			info("Changes have been saved to file:",%file);
	}
}
//------------------------------------------------------------------------------

//==============================================================================
// Load the Specific UI Style settings
function Lab::exportAllUnmapProfileStyle(%this,%fileName) {
	//First compare the values of all profiles
	%newGroup = new SimGroup();

	foreach(%profile in LabProfileGroup) {
		//Ignore profile with a style clone already
		%copy = LabStyleGroup.findObjectByInternalName(%profile.getName());

		if (isObject(%copy)) {
			continue;
		}

		%newStyle = newScriptObject(%profile.getName()@"_Style");

		//%newStyle.name = %fileName@"_Style";
		foreach$(%field in $ProfileFieldList) {
			if (%field $= "name") continue;

			%value = %profile.getFieldValue(%field);

			if (%value $= "") continue;

			eval("%newStyle."@%field@" = %value;");
			//%newStyle.setFieldValue(%field, %value);
		}

		%newStyle.internalName = %profile.getName();
		%newGroup.add(%newStyle);
	}

	if (%fileName $= "") %fileName = "unmapped";

	%file = "art/gui/"@$Pref::Editor::GuiStyle@"/"@%fileName@".pstyle.cs";
	%result = %newGroup.save(%file,false,"$tmpGroup = ");

	if (%result) info("Save to file success:",%file);
	else info("Save to file failed:",%file);
}
//------------------------------------------------------------------------------


text:
=begin
Composer sketch tool.
Author: Mark D. Blackwell.
Date started writing: March 21, 2009.
Date last modified: November 26, 2009.
Copyright (c) 2009 Mark D. Blackwell.

G B Eb(D) F# A C# F(E) Ab C E(Eb) (D-F): Bb
11-bit binary numbers are 2**11 = 2048 raw sequences.
require printer
require compositionfileio
Use special processing for gaps; keep them out of chord_word.
Use Enumerable.
=end
require 'invokeutilities'
require 'chordutilities'
require 'generatedprunedorderedpostordernarytree'
require 'generatechords'
require 'generatenotespace'
require 'harmonymidi'
module Invoke
#-----------------------------
  class Build
    include InvokeUtilities
    include ChordUtilities

    def initialize( n)
      @note_space_width = n
      @logger = MyLogger.new( 'log/build.txt')
      @logger.debug 'in Invoke::Build#initialize'
      suffix = @note_space_width.to_s + '.txt'
      @file_name_chords    = 'marshal/chords-'    + suffix
      @file_name_necklaces = 'marshal/necklaces-' + suffix
      if @note_space_width >= 1
        @note_space = GenerateNoteSpace::NoteSpace.new( @note_space_width)
        @most_significant_bit_value = @note_space.most_significant_bit_value
        build_fill_chords()
#        @fill_chords = []
        add_fill_chords_to_necklaces( @fill_chords)
        save_chords()
        save_necklaces()
      end
    end #def

    def save_chords
      chords = 'contents-' + @note_space_width.to_s
      f = MyFile.new( @file_name_chords, 'w')
      f.print( chords)
      f.close
    end

    def save_necklaces
      necklaces = 'contents-' + @note_space_width.to_s
      f = MyFile.new( @file_name_necklaces, 'w')
      f.print( necklaces)
      f.close
#      f.print( YAML::dump( @note_space.necklaces)) # IO.open'ing a block didn't work! ???
    end

    def select
#      @select_necklaces_indices = (0...@note_space.necklaces.length).to_a
#      @select_necklaces_indices = [] # Empty means, 'Use all the notes.'
      @select_necklaces_indices = [1] # Or 0,33,69,350,[0, 1, 69, 280],[5, 10, 11, 12, 13, 14]
    end

    def build_fill_chords
#@logger.debug 'in Invoke::Build#build_fill_chords'
#@logger.debug 'in Invoke::Build#build_fill_chords before GenerateChords::TreeDecorator.new'
      @tree_decorator = GenerateChords::TreeDecorator.new( @note_space, get_necklaces_out_notes())
      @tree = GeneratedPrunedOrderedPostOrderNaryTree::Tree.new( @tree_decorator,
      GenerateChords::LeafDecorator.initial())
      dump_fixed()
#@logger.debug 'in Invoke::Build#build_fill_chords before GenerateChords::Tree#walk'
      @fill_chords, @counts_dump = @tree.walk
#@logger.debug 'in Invoke::Build#build_fill_chords after GenerateChords::Tree#walk'
    end

    def get_necklaces_out_notes
      width = @note_space.width
      exclude = Array.new( width, @select_necklaces_indices.empty? ? false : true)
      @select_necklaces_indices.each do |i|
        word = @note_space.necklaces.at( i).word << Bit::BIT_WIDTH # Start before first.
        (1..12).each do |absolute|
          word >>= Bit::BIT_WIDTH
          exclude[ absolute % width] = false if Bit::BIT_VALUE_1 == word & Bit::SINGLE_BIT
        end #each bit
      end #each i
      exclude
    end

    def add_fill_chords_to_necklaces( fill_chords)
#@logger.debug 'in Invoke::Build#add_fill_chords_to_necklaces'
      fill_chords.each_with_index do |chords, fill_word|
        raise 'fill_word nil' if fill_word.nil?
        next if chords.nil?
        unnormalized_word = fill_word | @most_significant_bit_value
        normalized_word = normalize( unnormalized_word, @note_space.width)
        detected_necklace = @note_space.necklaces.word_to_necklace( normalized_word)
        detected_necklace.add_rooted_chord( unnormalized_word, chords) unless detected_necklace.nil?
      end #each_with_index chords, fill_word
    end #def

  end #class Build
end #module Invoke

redpajama_set_name: RedPajamaGithub


text:
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org>               //
//  available at http://getid3.sourceforge.net                 //
//            or http://www.getid3.org                         //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details                             //
/////////////////////////////////////////////////////////////////
//                                                             //
// module.audio.wavpack.php                                    //
// module for analyzing WavPack v4.0+ Audio files              //
// dependencies: NONE                                          //
//                                                            ///
/////////////////////////////////////////////////////////////////

class getid3_wavpack extends getid3_handler
{

	function Analyze() {
		$info = &$this->getid3->info;

		fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);

		while (true) {

			$wavpackheader = fread($this->getid3->fp, 32);

			if (ftell($this->getid3->fp) >= $info['avdataend']) {
				break;
			} elseif (feof($this->getid3->fp)) {
				break;
			} elseif (
				isset($info['wavpack']['blockheader']['total_samples']) &&
				isset($info['wavpack']['blockheader']['block_samples']) &&
				($info['wavpack']['blockheader']['total_samples'] > 0) &&
				($info['wavpack']['blockheader']['block_samples'] > 0) &&
				(!isset($info['wavpack']['riff_trailer_size']) || ($info['wavpack']['riff_trailer_size'] <= 0)) &&
				((isset($info['wavpack']['config_flags']['md5_checksum']) && ($info['wavpack']['config_flags']['md5_checksum'] === false)) || !empty($info['md5_data_source']))) {
					break;
			}

			$blockheader_offset = ftell($this->getid3->fp) - 32;
			$blockheader_magic  =                              substr($wavpackheader,  0,  4);
			$blockheader_size   = getid3_lib::LittleEndian2Int(substr($wavpackheader,  4,  4));

			$magic = 'wvpk';
			if ($blockheader_magic != $magic) {
				$info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$blockheader_offset.', found "'.getid3_lib::PrintHexBytes($blockheader_magic).'"';
				switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') {
					case 'wavpack':
					case 'wvc':
						break;
					default:
						unset($info['fileformat']);
						unset($info['audio']);
						unset($info['wavpack']);
						break;
				}
				return false;
			}

			if (empty($info['wavpack']['blockheader']['block_samples']) ||
				empty($info['wavpack']['blockheader']['total_samples']) ||
				($info['wavpack']['blockheader']['block_samples'] <= 0) ||
				($info['wavpack']['blockheader']['total_samples'] <= 0)) {
				// Also, it is possible that the first block might not have
				// any samples (block_samples == 0) and in this case you should skip blocks
				// until you find one with samples because the other information (like
				// total_samples) are not guaranteed to be correct until (block_samples > 0)

				// Finally, I have defined a format for files in which the length is not known
				// (for example when raw files are created using pipes). In these cases
				// total_samples will be -1 and you must seek to the final block to determine
				// the total number of samples.

				$info['audio']['dataformat']   = 'wavpack';
				$info['fileformat']            = 'wavpack';
				$info['audio']['lossless']     = true;
				$info['audio']['bitrate_mode'] = 'vbr';

				$info['wavpack']['blockheader']['offset'] = $blockheader_offset;
				$info['wavpack']['blockheader']['magic']  = $blockheader_magic;
				$info['wavpack']['blockheader']['size']   = $blockheader_size;

				if ($info['wavpack']['blockheader']['size'] >= 0x100000) {
					$info['error'][] = 'Expecting WavPack block size less than "0x100000", found "'.$info['wavpack']['blockheader']['size'].'" at offset '.$info['wavpack']['blockheader']['offset'];
					switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') {
						case 'wavpack':
						case 'wvc':
							break;
						default:
							unset($info['fileformat']);
							unset($info['audio']);
							unset($info['wavpack']);
							break;
					}
					return false;
				}

				$info['wavpack']['blockheader']['minor_version'] = ord($wavpackheader{8});
				$info['wavpack']['blockheader']['major_version'] = ord($wavpackheader{9});

				if (($info['wavpack']['blockheader']['major_version'] != 4) ||
					(($info['wavpack']['blockheader']['minor_version'] < 4) &&
					($info['wavpack']['blockheader']['minor_version'] > 16))) {
						$info['error'][] = 'Expecting WavPack version between "4.2" and "4.16", found version "'.$info['wavpack']['blockheader']['major_version'].'.'.$info['wavpack']['blockheader']['minor_version'].'" at offset '.$info['wavpack']['blockheader']['offset'];
						switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') {
							case 'wavpack':
							case 'wvc':
								break;
							default:
								unset($info['fileformat']);
								unset($info['audio']);
								unset($info['wavpack']);
								break;
						}
						return false;
				}

				$info['wavpack']['blockheader']['track_number']  = ord($wavpackheader{10}); // unused
				$info['wavpack']['blockheader']['index_number']  = ord($wavpackheader{11}); // unused
				$info['wavpack']['blockheader']['total_samples'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 12,  4));
				$info['wavpack']['blockheader']['block_index']   = getid3_lib::LittleEndian2Int(substr($wavpackheader, 16,  4));
				$info['wavpack']['blockheader']['block_samples'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 20,  4));
				$info['wavpack']['blockheader']['flags_raw']     = getid3_lib::LittleEndian2Int(substr($wavpackheader, 24,  4));
				$info['wavpack']['blockheader']['crc']           = getid3_lib::LittleEndian2Int(substr($wavpackheader, 28,  4));

				$info['wavpack']['blockheader']['flags']['bytes_per_sample']     =    1 + ($info['wavpack']['blockheader']['flags_raw'] & 0x00000003);
				$info['wavpack']['blockheader']['flags']['mono']                 = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000004);
				$info['wavpack']['blockheader']['flags']['hybrid']               = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000008);
				$info['wavpack']['blockheader']['flags']['joint_stereo']         = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000010);
				$info['wavpack']['blockheader']['flags']['cross_decorrelation']  = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000020);
				$info['wavpack']['blockheader']['flags']['hybrid_noiseshape']    = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000040);
				$info['wavpack']['blockheader']['flags']['ieee_32bit_float']     = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000080);
				$info['wavpack']['blockheader']['flags']['int_32bit']            = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000100);
				$info['wavpack']['blockheader']['flags']['hybrid_bitrate_noise'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000200);
				$info['wavpack']['blockheader']['flags']['hybrid_balance_noise'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000400);
				$info['wavpack']['blockheader']['flags']['multichannel_initial'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000800);
				$info['wavpack']['blockheader']['flags']['multichannel_final']   = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00001000);

				$info['audio']['lossless'] = !$info['wavpack']['blockheader']['flags']['hybrid'];
			}

			while (!feof($this->getid3->fp) && (ftell($this->getid3->fp) < ($blockheader_offset + $blockheader_size + 8))) {

				$metablock = array('offset'=>ftell($this->getid3->fp));
				$metablockheader = fread($this->getid3->fp, 2);
				if (feof($this->getid3->fp)) {
					break;
				}
				$metablock['id'] = ord($metablockheader{0});
				$metablock['function_id'] = ($metablock['id'] & 0x3F);
				$metablock['function_name'] = $this->WavPackMetablockNameLookup($metablock['function_id']);

				// The 0x20 bit in the id of the meta subblocks (which is defined as
				// ID_OPTIONAL_DATA) is a permanent part of the id. The idea is that
				// if a decoder encounters an id that it does not know about, it uses
				// that "ID_OPTIONAL_DATA" flag to determine what to do. If it is set
				// then the decoder simply ignores the metadata, but if it is zero
				// then the decoder should quit because it means that an understanding
				// of the metadata is required to correctly decode the audio.
				$metablock['non_decoder'] = (bool) ($metablock['id'] & 0x20);

				$metablock['padded_data'] = (bool) ($metablock['id'] & 0x40);
				$metablock['large_block'] = (bool) ($metablock['id'] & 0x80);
				if ($metablock['large_block']) {
					$metablockheader .= fread($this->getid3->fp, 2);
				}
				$metablock['size'] = getid3_lib::LittleEndian2Int(substr($metablockheader, 1)) * 2; // size is stored in words
				$metablock['data'] = null;

				if ($metablock['size'] > 0) {

					switch ($metablock['function_id']) {
						case 0x21: // ID_RIFF_HEADER
						case 0x22: // ID_RIFF_TRAILER
						case 0x23: // ID_REPLAY_GAIN
						case 0x24: // ID_CUESHEET
						case 0x25: // ID_CONFIG_BLOCK
						case 0x26: // ID_MD5_CHECKSUM
							$metablock['data'] = fread($this->getid3->fp, $metablock['size']);

							if ($metablock['padded_data']) {
								// padded to the nearest even byte
								$metablock['size']--;
								$metablock['data'] = substr($metablock['data'], 0, -1);
							}
							break;

						case 0x00: // ID_DUMMY
						case 0x01: // ID_ENCODER_INFO
						case 0x02: // ID_DECORR_TERMS
						case 0x03: // ID_DECORR_WEIGHTS
						case 0x04: // ID_DECORR_SAMPLES
						case 0x05: // ID_ENTROPY_VARS
						case 0x06: // ID_HYBRID_PROFILE
						case 0x07: // ID_SHAPING_WEIGHTS
						case 0x08: // ID_FLOAT_INFO
						case 0x09: // ID_INT32_INFO
						case 0x0A: // ID_WV_BITSTREAM
						case 0x0B: // ID_WVC_BITSTREAM
						case 0x0C: // ID_WVX_BITSTREAM
						case 0x0D: // ID_CHANNEL_INFO
							fseek($this->getid3->fp, $metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size'], SEEK_SET);
							break;

						default:
							$info['warning'][] = 'Unexpected metablock type "0x'.str_pad(dechex($metablock['function_id']), 2, '0', STR_PAD_LEFT).'" at offset '.$metablock['offset'];
							fseek($this->getid3->fp, $metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size'], SEEK_SET);
							break;
					}

					switch ($metablock['function_id']) {
						case 0x21: // ID_RIFF_HEADER
							getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
							$original_wav_filesize = getid3_lib::LittleEndian2Int(substr($metablock['data'], 4, 4));

							$getid3_temp = new getID3();
							$getid3_temp->openfile($this->getid3->filename);
							$getid3_riff = new getid3_riff($getid3_temp);
							$getid3_riff->ParseRIFFdata($metablock['data']);
							$metablock['riff']            = $getid3_temp->info['riff'];
							$info['audio']['sample_rate'] = $getid3_temp->info['riff']['raw']['fmt ']['nSamplesPerSec'];
							unset($getid3_riff, $getid3_temp);

							$metablock['riff']['original_filesize'] = $original_wav_filesize;
							$info['wavpack']['riff_trailer_size'] = $original_wav_filesize - $metablock['riff']['WAVE']['data'][0]['size'] - $metablock['riff']['header_size'];
							$info['playtime_seconds'] = $info['wavpack']['blockheader']['total_samples'] / $info['audio']['sample_rate'];

							// Safe RIFF header in case there's a RIFF footer later
							$metablockRIFFheader = $metablock['data'];
							break;

						case 0x22: // ID_RIFF_TRAILER
							$metablockRIFFfooter = $metablockRIFFheader.$metablock['data'];
							getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);

							$startoffset = $metablock['offset'] + ($metablock['large_block'] ? 4 : 2);
							$getid3_temp = new getID3();
							$getid3_temp->openfile($this->getid3->filename);
							$getid3_temp->info['avdataend']  = $info['avdataend'];
							$getid3_temp->info['fileformat'] = 'riff';
							$getid3_riff = new getid3_riff($getid3_temp);
							$metablock['riff'] = $getid3_riff->ParseRIFF($startoffset, $startoffset + $metablock['size']);

							if (!empty($metablock['riff']['INFO'])) {
								$getid3_riff->RIFFcommentsParse($metablock['riff']['INFO'], $metablock['comments']);
								$info['tags']['riff'] = $metablock['comments'];
							}
							unset($getid3_temp, $getid3_riff);
							break;

						case 0x23: // ID_REPLAY_GAIN
							$info['warning'][] = 'WavPack "Replay Gain" contents not yet handled by getID3() in metablock at offset '.$metablock['offset'];
							break;

						case 0x24: // ID_CUESHEET
							$info['warning'][] = 'WavPack "Cuesheet" contents not yet handled by getID3() in metablock at offset '.$metablock['offset'];
							break;

						case 0x25: // ID_CONFIG_BLOCK
							$metablock['flags_raw'] = getid3_lib::LittleEndian2Int(substr($metablock['data'], 0, 3));

							$metablock['flags']['adobe_mode']     = (bool) ($metablock['flags_raw'] & 0x000001); // "adobe" mode for 32-bit floats
							$metablock['flags']['fast_flag']      = (bool) ($metablock['flags_raw'] & 0x000002); // fast mode
							$metablock['flags']['very_fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000004); // double fast
							$metablock['flags']['high_flag']      = (bool) ($metablock['flags_raw'] & 0x000008); // high quality mode
							$metablock['flags']['very_high_flag'] = (bool) ($metablock['flags_raw'] & 0x000010); // double high (not used yet)
							$metablock['flags']['bitrate_kbps']   = (bool) ($metablock['flags_raw'] & 0x000020); // bitrate is kbps, not bits / sample
							$metablock['flags']['auto_shaping']   = (bool) ($metablock['flags_raw'] & 0x000040); // automatic noise shaping
							$metablock['flags']['shape_override'] = (bool) ($metablock['flags_raw'] & 0x000080); // shaping mode specified
							$metablock['flags']['joint_override'] = (bool) ($metablock['flags_raw'] & 0x000100); // joint-stereo mode specified
							$metablock['flags']['copy_time']      = (bool) ($metablock['flags_raw'] & 0x000200); // copy file-time from source
							$metablock['flags']['create_exe']     = (bool) ($metablock['flags_raw'] & 0x000400); // create executable
							$metablock['flags']['create_wvc']     = (bool) ($metablock['flags_raw'] & 0x000800); // create correction file
							$metablock['flags']['optimize_wvc']   = (bool) ($metablock['flags_raw'] & 0x001000); // maximize bybrid compression
							$metablock['flags']['quality_mode']   = (bool) ($metablock['flags_raw'] & 0x002000); // psychoacoustic quality mode
							$metablock['flags']['raw_flag']       = (bool) ($metablock['flags_raw'] & 0x004000); // raw mode (not implemented yet)
							$metablock['flags']['calc_noise']     = (bool) ($metablock['flags_raw'] & 0x008000); // calc noise in hybrid mode
							$metablock['flags']['lossy_mode']     = (bool) ($metablock['flags_raw'] & 0x010000); // obsolete (for information)
							$metablock['flags']['extra_mode']     = (bool) ($metablock['flags_raw'] & 0x020000); // extra processing mode
							$metablock['flags']['skip_wvx']       = (bool) ($metablock['flags_raw'] & 0x040000); // no wvx stream w/ floats & big ints
							$metablock['flags']['md5_checksum']   = (bool) ($metablock['flags_raw'] & 0x080000); // compute & store MD5 signature
							$metablock['flags']['quiet_mode']     = (bool) ($metablock['flags_raw'] & 0x100000); // don't report progress %

							$info['wavpack']['config_flags'] = $metablock['flags'];

							$info['audio']['encoder_options'] = '';
							if ($info['wavpack']['blockheader']['flags']['hybrid']) {
								$info['audio']['encoder_options'] .= ' -b???';
							}
							$info['audio']['encoder_options'] .= ($metablock['flags']['adobe_mode']     ? ' -a' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['optimize_wvc']   ? ' -cc' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['create_exe']     ? ' -e' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['fast_flag']      ? ' -f' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['joint_override'] ? ' -j?' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['high_flag']      ? ' -h' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['md5_checksum']   ? ' -m' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['calc_noise']     ? ' -n' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['shape_override'] ? ' -s?' : '');
							$info['audio']['encoder_options'] .= ($metablock['flags']['extra_mode']     ? ' -x?' : '');
							if (!empty($info['audio']['encoder_options'])) {
								$info['audio']['encoder_options'] = trim($info['audio']['encoder_options']);
							} elseif (isset($info['audio']['encoder_options'])) {
								unset($info['audio']['encoder_options']);
							}
							break;

						case 0x26: // ID_MD5_CHECKSUM
							if (strlen($metablock['data']) == 16) {
								$info['md5_data_source'] = strtolower(getid3_lib::PrintHexBytes($metablock['data'], true, false, false));
							} else {
								$info['warning'][] = 'Expecting 16 bytes of WavPack "MD5 Checksum" in metablock at offset '.$metablock['offset'].', but found '.strlen($metablock['data']).' bytes';
							}
							break;

						case 0x00: // ID_DUMMY
						case 0x01: // ID_ENCODER_INFO
						case 0x02: // ID_DECORR_TERMS
						case 0x03: // ID_DECORR_WEIGHTS
						case 0x04: // ID_DECORR_SAMPLES
						case 0x05: // ID_ENTROPY_VARS
						case 0x06: // ID_HYBRID_PROFILE
						case 0x07: // ID_SHAPING_WEIGHTS
						case 0x08: // ID_FLOAT_INFO
						case 0x09: // ID_INT32_INFO
						case 0x0A: // ID_WV_BITSTREAM
						case 0x0B: // ID_WVC_BITSTREAM
						case 0x0C: // ID_WVX_BITSTREAM
						case 0x0D: // ID_CHANNEL_INFO
							unset($metablock);
							break;
					}

				}
				if (!empty($metablock)) {
					$info['wavpack']['metablocks'][] = $metablock;
				}

			}

		}

		$info['audio']['encoder']         = 'WavPack v'.$info['wavpack']['blockheader']['major_version'].'.'.str_pad($info['wavpack']['blockheader']['minor_version'], 2, '0', STR_PAD_LEFT);
		$info['audio']['bits_per_sample'] = $info['wavpack']['blockheader']['flags']['bytes_per_sample'] * 8;
		$info['audio']['channels']        = ($info['wavpack']['blockheader']['flags']['mono'] ? 1 : 2);

		if (!empty($info['playtime_seconds'])) {

			$info['audio']['bitrate']     = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];

		} else {

			$info['audio']['dataformat']  = 'wvc';

		}

		return true;
	}

	function WavPackMetablockNameLookup(&$id) {
		static $WavPackMetablockNameLookup = array(
			0x00 => 'Dummy',
			0x01 => 'Encoder Info',
			0x02 => 'Decorrelation Terms',
			0x03 => 'Decorrelation Weights',
			0x04 => 'Decorrelation Samples',
			0x05 => 'Entropy Variables',
			0x06 => 'Hybrid Profile',
			0x07 => 'Shaping Weights',
			0x08 => 'Float Info',
			0x09 => 'Int32 Info',
			0x0A => 'WV Bitstream',
			0x0B => 'WVC Bitstream',
			0x0C => 'WVX Bitstream',
			0x0D => 'Channel Info',
			0x21 => 'RIFF header',
			0x22 => 'RIFF trailer',
			0x23 => 'Replay Gain',
			0x24 => 'Cuesheet',
			0x25 => 'Config Block',
			0x26 => 'MD5 Checksum',
		);
		return (isset($WavPackMetablockNameLookup[$id]) ? $WavPackMetablockNameLookup[$id] : '');
	}

}

?>


text:
package requirements

import (
	"github.com/blang/semver"
	"github.com/cloudfoundry/cli/cf/api"
	"github.com/cloudfoundry/cli/cf/configuration/core_config"
	"github.com/cloudfoundry/cli/cf/terminal"
)

//go:generate counterfeiter -o fakes/fake_factory.go . Factory
type Factory interface {
	NewApplicationRequirement(name string) ApplicationRequirement
	NewDEAApplicationRequirement(name string) DEAApplicationRequirement
	NewServiceInstanceRequirement(name string) ServiceInstanceRequirement
	NewLoginRequirement() Requirement
	NewRoutingAPIRequirement() Requirement
	NewSpaceRequirement(name string) SpaceRequirement
	NewTargetedSpaceRequirement() Requirement
	NewTargetedOrgRequirement() TargetedOrgRequirement
	NewOrganizationRequirement(name string) OrganizationRequirement
	NewDomainRequirement(name string) DomainRequirement
	NewUserRequirement(username string, wantGuid bool) UserRequirement
	NewBuildpackRequirement(buildpack string) BuildpackRequirement
	NewApiEndpointRequirement() Requirement
	NewMinAPIVersionRequirement(commandName string, requiredVersion semver.Version) Requirement
}

type apiRequirementFactory struct {
	ui          terminal.UI
	config      core_config.Reader
	repoLocator api.RepositoryLocator
}

func NewFactory(ui terminal.UI, config core_config.Reader, repoLocator api.RepositoryLocator) (factory apiRequirementFactory) {
	return apiRequirementFactory{ui, config, repoLocator}
}

func (f apiRequirementFactory) NewApplicationRequirement(name string) ApplicationRequirement {
	return NewApplicationRequirement(
		name,
		f.ui,
		f.repoLocator.GetApplicationRepository(),
	)
}

func (f apiRequirementFactory) NewDEAApplicationRequirement(name string) DEAApplicationRequirement {
	return NewDEAApplicationRequirement(
		name,
		f.ui,
		f.repoLocator.GetApplicationRepository(),
	)
}

func (f apiRequirementFactory) NewServiceInstanceRequirement(name string) ServiceInstanceRequirement {
	return NewServiceInstanceRequirement(
		name,
		f.ui,
		f.repoLocator.GetServiceRepository(),
	)
}

func (f apiRequirementFactory) NewLoginRequirement() Requirement {
	return NewLoginRequirement(
		f.ui,
		f.config,
	)
}

func (f apiRequirementFactory) NewRoutingAPIRequirement() Requirement {
	return NewRoutingAPIRequirement(
		f.ui,
		f.config,
	)
}

func (f apiRequirementFactory) NewSpaceRequirement(name string) SpaceRequirement {
	return NewSpaceRequirement(
		name,
		f.ui,
		f.repoLocator.GetSpaceRepository(),
	)
}

func (f apiRequirementFactory) NewTargetedSpaceRequirement() Requirement {
	return NewTargetedSpaceRequirement(
		f.ui,
		f.config,
	)
}

func (f apiRequirementFactory) NewTargetedOrgRequirement() TargetedOrgRequirement {
	return NewTargetedOrgRequirement(
		f.ui,
		f.config,
	)
}

func (f apiRequirementFactory) NewOrganizationRequirement(name string) OrganizationRequirement {
	return NewOrganizationRequirement(
		name,
		f.ui,
		f.repoLocator.GetOrganizationRepository(),
	)
}

func (f apiRequirementFactory) NewDomainRequirement(name string) DomainRequirement {
	return NewDomainRequirement(
		name,
		f.ui,
		f.config,
		f.repoLocator.GetDomainRepository(),
	)
}

func (f apiRequirementFactory) NewUserRequirement(username string, wantGuid bool) UserRequirement {
	return NewUserRequirement(
		username,
		f.ui,
		f.repoLocator.GetUserRepository(),
		wantGuid,
	)
}

func (f apiRequirementFactory) NewBuildpackRequirement(buildpack string) BuildpackRequirement {
	return NewBuildpackRequirement(
		buildpack,
		f.ui,
		f.repoLocator.GetBuildpackRepository(),
	)
}

func (f apiRequirementFactory) NewApiEndpointRequirement() Requirement {
	return NewApiEndpointRequirement(
		f.ui,
		f.config,
	)
}

func (f apiRequirementFactory) NewMinAPIVersionRequirement(commandName string, requiredVersion semver.Version) Requirement {
	return NewMinAPIVersionRequirement(
		f.ui,
		f.config,
		commandName,
		requiredVersion,
	)
}


text:
mpf.devices.score_reel module
=============================

.. automodule:: mpf.devices.score_reel
    :members:
    :undoc-members:
    :show-inheritance:


text:
pyModeS.extra.aero module
=========================

.. automodule:: pyModeS.extra.aero
    :members:
    :undoc-members:
    :show-inheritance:


text:
<#
.SYNOPSIS
Get-PersistenceFilesAndRegistryKeysStack.ps1
Requires logparser.exe in path
Pulls stack rank of all Service Failures from acquired Service Failure data

This script expects files matching the pattern *SvcFail.tsv to be in
the current working directory.
.NOTES
DATADIR PersistanceFilesAndRegistryKeys
#>

if (Get-Command logparser.exe) {

	$lpquery = @"
    SELECT
        COUNT(Type) as Quantity,
        Type, Set, Path, Value
    FROM
        *PersistenceFilesAndRegistryKeys.csv
    GROUP BY
       Type, Set, Path, Value
    ORDER BY
        Quantity ASC
"@

	& logparser -stats:off -i:csv -o:csv $lpquery

}
else {
	$ScriptName = [System.IO.Path]::GetFileName($MyInvocation.ScriptName)
	"${ScriptName} requires logparser.exe in the path."
}


text:
using System.Collections.Generic;
using EasyPost.Models.API;
using EasyPost.Tests._Utilities;
using EasyPost.Tests._Utilities.Annotations;
using Xunit;

namespace EasyPost.Tests.ModelsTests
{
    public class TimeInTransitTests : UnitTest
    {
        public TimeInTransitTests() : base("time_in_transit")
        {
        }

        [Fact]
        [Testing.Function]
        public void TestGetBySmartrateAccuracy()
        {
            Dictionary<SmartrateAccuracy, int> pairs = new Dictionary<SmartrateAccuracy, int>
            {
                { SmartrateAccuracy.Percentile50, 1 },
                { SmartrateAccuracy.Percentile75, 2 },
                { SmartrateAccuracy.Percentile85, 3 },
                { SmartrateAccuracy.Percentile90, 4 },
                { SmartrateAccuracy.Percentile95, 5 },
                { SmartrateAccuracy.Percentile97, 6 },
                { SmartrateAccuracy.Percentile99, 7 }
            };

            TimeInTransit timeInTransit = new TimeInTransit
            {
                Percentile50 = 1,
                Percentile75 = 2,
                Percentile85 = 3,
                Percentile90 = 4,
                Percentile95 = 5,
                Percentile97 = 6,
                Percentile99 = 7
            };

            foreach (KeyValuePair<SmartrateAccuracy, int> pair in pairs)
            {
                SmartrateAccuracy accuracy = pair.Key;
                int expected = pair.Value;
                int? actual = timeInTransit.GetBySmartrateAccuracy(accuracy);
                Assert.Equal(expected, actual);
            }
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ovularia canadensis Henn.

### Remarks
null


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Sql.Models
{
    internal partial class ManagedInstanceVulnerabilityAssessmentListResult
    {
        internal static ManagedInstanceVulnerabilityAssessmentListResult DeserializeManagedInstanceVulnerabilityAssessmentListResult(JsonElement element)
        {
            Optional<IReadOnlyList<ManagedInstanceVulnerabilityAssessment>> value = default;
            Optional<string> nextLink = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<ManagedInstanceVulnerabilityAssessment> array = new List<ManagedInstanceVulnerabilityAssessment>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedInstanceVulnerabilityAssessment.DeserializeManagedInstanceVulnerabilityAssessment(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return new ManagedInstanceVulnerabilityAssessmentListResult(Optional.ToList(value), nextLink.Value);
        }
    }
}


text:
import rospy

from strands_executive_msgs.msg import Task
from strands_executive_msgs.srv import AddTasks, SetExecutionStatus
from std_msgs.msg import String
from random import shuffle
from strands_navigation_msgs.msg import TopologicalNode
from strands_navigation_msgs.msg import TopologicalMap

class PatrolScheduler(object):
    """ Repeatedly sends a randomised list of task to the task executor. These don't have tasks associated with them. If you want to add tasks, see fifo_tester.py for an example."""
    def __init__(self):
        self.node_names = []
        rospy.Subscriber('topological_map', TopologicalMap, self.map_callback)

        # load waypoint from datacentre
        self.waypoints = self.get_nodes()
        rospy.loginfo('Patrolling the following nodes: %s' % self.waypoints)
        self.current_waypoint = ''
        self.add_tasks_srv = None
        rospy.Subscriber("/current_node", String, self.current_node_cb)

        add_tasks_srv_name = 'task_executor/add_tasks'
        set_exe_stat_srv_name = 'task_executor/set_execution_status'
        rospy.loginfo("Waiting for task_executor service...")
        rospy.wait_for_service(add_tasks_srv_name)
        rospy.wait_for_service(set_exe_stat_srv_name)
        rospy.loginfo("Done")
        self.add_tasks_srv = rospy.ServiceProxy(add_tasks_srv_name, AddTasks)
        set_execution_status_srv = rospy.ServiceProxy(set_exe_stat_srv_name, SetExecutionStatus)

        shuffle(self.waypoints)
        self.send_tasks()

        try:
            # Make sure the task executor is running
            set_execution_status_srv(True)
        except rospy.ServiceException, e:
            print "Service call failed: %s"%e

    def map_callback(self, msg):
        print 'got map: %s' % len(msg.nodes)
        self.node_names = [node.name for node in msg.nodes]

    def get_nodes(self):
        while len(self.node_names) == 0:
            print 'no nodes'
            rospy.sleep(1)
        return self.node_names

    def send_tasks(self):
        rospy.loginfo("Sending next batch of patrol tasks")

        patrol_tasks = [Task(start_node_id=wp, end_node_id=wp) for wp in self.waypoints]

        self.add_tasks_srv(patrol_tasks)

    def current_node_cb(self, data):

        # if we have just changed nodes
        if self.current_waypoint != data.data:
            rospy.loginfo("Changed nodes to %s from %s" % (data.data, self.current_waypoint))
            self.current_waypoint = data.data
            # if we're on the last waypoint, send the tasks again
            # actually this is incorrect as we could pass through a node on the way to somewhere else, but it doesn't really matter
            if self.current_waypoint == self.waypoints[-1]:
                shuffle(self.waypoints)
                self.send_tasks()

if __name__ == '__main__':
    rospy.init_node("patrol_scheduler")

    try:
        patrol_scheduler = PatrolScheduler()
        rospy.spin()
    except KeyError, e:
        rospy.logfatal("It's likely that you haven't set ros_param for topological_map_name. This is normally done by topological navigation.\n KeyError: %s" % (e))


text:
package mblog.web.controller.admin;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import mblog.core.data.PointRule;
import mblog.core.persist.service.PointRuleService;
import mblog.core.persist.utils.QueryRules;
import mblog.web.controller.BaseController;
import mtons.modules.pojos.Data;
import mtons.modules.pojos.Paging;

/**
 * @author tys
 */
@Controller
@RequestMapping("/admin/pointrule")
public class PointRuleController extends BaseController {
	private static final Logger log = LoggerFactory.getLogger(PointRuleController.class);
	@Autowired
	private PointRuleService pointRuleService;

	@RequestMapping("/list")
	public String list(Integer pn, String serialNo,String type,
			String status,String startTime,String endTime, ModelMap model) throws ParseException {
		Paging paging = wrapPage(pn,30);

		List<QueryRules> qrLst = new ArrayList<>();
		if(StringUtils.isNotBlank(serialNo)){
			QueryRules qr = new QueryRules("sysSource",serialNo,"like"	);
			qrLst.add(qr);
		}
		if(StringUtils.isNotBlank(type)){
			QueryRules qr = new QueryRules("type",Integer.valueOf(type)	);qrLst.add(qr);
		}
		if(StringUtils.isNotBlank(status)){
			QueryRules qr = new QueryRules("status",status	);qrLst.add(qr);
		}

		if(StringUtils.isNotBlank(startTime)){
			QueryRules qr = new QueryRules("startTime",DateUtils.parseDate(startTime+" 00:00:00", new String[]{"yyyy-MM-dd HH:mm:ss"}),"ge"	);qrLst.add(qr);
		}

		if(StringUtils.isNotBlank(endTime)){
			QueryRules qr = new QueryRules("endTime",DateUtils.parseDate(endTime+" 23:59:59", new String[]{"yyyy-MM-dd HH:mm:ss"}),"le");qrLst.add(qr);
		}

		pointRuleService.paging(paging, qrLst);
		model.put("page", paging);
		model.put("serialNo", serialNo);
		model.put("type", type);
		model.put("status", status);
		model.put("startTime", startTime);
		model.put("endTime", endTime);

		return "/admin/pointrule/list";
	}

	/*@RequestMapping("/delete")
	public String delete(Long id) {
		cardTransactionRecordService.delete(id);
		return "redirect:/admin/cardTransactionRecord/CardTransactionRecord";
	}
*/
	@RequestMapping("/edit")
	public String edit(@RequestParam(value = "id", required = false, defaultValue = "0") long id, Model model) {
		if (id != 0) {
			PointRule pointRule = pointRuleService.findById(id);
			if(pointRule.getReserve2()==0){
				pointRule=null;//全体用户积分规则是系统默认选项,不支持修改
			}
			model.addAttribute("pointRule", pointRule);
		}
		return "/admin/pointrule/edit";
	}

	@RequestMapping("/save")
	// @ResponseBody
	public String save(Long id, String serialNo,Integer type,Integer direction,Integer ratio,
			Integer status,String startTime,String endTime,String reserve3,Long reserve1,Long reserve2,ModelMap model) {
		try {
			long opId = getSubject().getProfile().getId();
			PointRule pointRule = new PointRule();
			pointRule.setId(id);
			pointRule.setSerialNo(type+""+StringUtils.leftPad(serialNo, 4,"0"));
			pointRule.setType(type);
			pointRule.setDirection(direction);
			pointRule.setRatio(ratio);
			pointRule.setStatus(status);
			pointRule.setStartTime(DateUtils.parseDate(startTime+" 00:00:00", new String[]{"yyyy-MM-dd HH:mm:ss"}));
			pointRule.setEndTime(DateUtils.parseDate(endTime+" 23:59:59", new String[]{"yyyy-MM-dd HH:mm:ss"}));
			pointRule.setReserve3(reserve3);
			pointRule.setOpId(opId);
			pointRule.setReserve1(reserve1);
			//全体用户积分规则是系统默认选项,不支持修改
			reserve2=1L;
			pointRule.setReserve2(reserve2);
			pointRule.setUpdateTime(new Date());
			pointRuleService.save(pointRule);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "redirect:/admin/pointrule/list";
	}

	@SuppressWarnings("deprecation")
	@RequestMapping("/sync")
	public @ResponseBody Data sync(String startTime,String endTime,Model model) {
		try {
			pointRuleService.calCardTransactionRecordPoint(DateUtils.parseDate(startTime+" 00:00:00", new String[]{"yyyy-MM-dd HH:mm:ss"}), DateUtils.parseDate(endTime+" 23:59:59", new String[]{"yyyy-MM-dd HH:mm:ss"}));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data.success("ok");
	}

}


text:
@interface UIImage (Crop)
- (UIImage *)crop:(CGRect)rect;
@end


text:
layout: with-pants
---

    Makin' it purty--don't you think?

    But not this! This shouldn't be pretty--because it's code.


text:
"use strict";

var assert = require("assert");
var testRejected = require("./helpers/testThreeCases").testRejected;

var adapter = global.adapter;
var rejected = adapter.rejected;
var pending = adapter.pending;

var dummy = { dummy: "dummy" }; // we fulfill or reject with this when we don't intend to test against it
var sentinel = { sentinel: "sentinel" }; // a sentinel fulfillment value to test for with strict equality

describe("2.2.3: If `onRejected` is a function,", function () {
    describe("2.2.3.1: it must be called after `promise` is rejected, with `promise`'s rejection reason as its " +
             "first argument.", function () {
        testRejected(sentinel, function (promise, done) {
            promise.then(null, function onRejected(reason) {
                assert.strictEqual(reason, sentinel);
                done();
            });
        });
    });

    describe("2.2.3.2: it must not be called before `promise` is rejected", function () {
        specify("rejected after a delay", function (done) {
            var tuple = pending();
            var isRejected = false;

            tuple.promise.then(null, function onRejected() {
                assert.strictEqual(isRejected, true);
                done();
            });

            setTimeout(function () {
                tuple.reject(dummy);
                isRejected = true;
            }, 50);
        });

        specify("never rejected", function (done) {
            var tuple = pending();
            var onRejectedCalled = false;

            tuple.promise.then(null, function onRejected() {
                onRejectedCalled = true;
                done();
            });

            setTimeout(function () {
                assert.strictEqual(onRejectedCalled, false);
                done();
            }, 150);
        });
    });

    describe("2.2.3.3: it must not be called more than once.", function () {
        specify("already-rejected", function (done) {
            var timesCalled = 0;

            rejected(dummy).then(null, function onRejected() {
                assert.strictEqual(++timesCalled, 1);
                done();
            });
        });

        specify("trying to reject a pending promise more than once, immediately", function (done) {
            var tuple = pending();
            var timesCalled = 0;

            tuple.promise.then(null, function onRejected() {
                assert.strictEqual(++timesCalled, 1);
                done();
            });

            tuple.reject(dummy);
            tuple.reject(dummy);
        });

        specify("trying to reject a pending promise more than once, delayed", function (done) {
            var tuple = pending();
            var timesCalled = 0;

            tuple.promise.then(null, function onRejected() {
                assert.strictEqual(++timesCalled, 1);
                done();
            });

            setTimeout(function () {
                tuple.reject(dummy);
                tuple.reject(dummy);
            }, 50);
        });

        specify("trying to reject a pending promise more than once, immediately then delayed", function (done) {
            var tuple = pending();
            var timesCalled = 0;

            tuple.promise.then(null, function onRejected() {
                assert.strictEqual(++timesCalled, 1);
                done();
            });

            tuple.reject(dummy);
            setTimeout(function () {
                tuple.reject(dummy);
            }, 50);
        });

        specify("when multiple `then` calls are made, spaced apart in time", function (done) {
            var tuple = pending();
            var timesCalled = [0, 0, 0];

            tuple.promise.then(null, function onRejected() {
                assert.strictEqual(++timesCalled[0], 1);
            });

            setTimeout(function () {
                tuple.promise.then(null, function onRejected() {
                    assert.strictEqual(++timesCalled[1], 1);
                });
            }, 50);

            setTimeout(function () {
                tuple.promise.then(null, function onRejected() {
                    assert.strictEqual(++timesCalled[2], 1);
                    done();
                });
            }, 100);

            setTimeout(function () {
                tuple.reject(dummy);
            }, 150);
        });

        specify("when `then` is interleaved with rejection", function (done) {
            var tuple = pending();
            var timesCalled = [0, 0];

            tuple.promise.then(null, function onRejected() {
                assert.strictEqual(++timesCalled[0], 1);
            });

            tuple.reject(dummy);

            tuple.promise.then(null, function onRejected() {
                assert.strictEqual(++timesCalled[1], 1);
                done();
            });
        });
    });
});


text:
/**
  @module ember-flexberry
*/

import Ember from 'ember';
import RequiredActionsMixin from '../mixins/required-actions';
import DomActionsMixin from '../mixins/dom-actions';
import DynamicPropertiesMixin from '../mixins/dynamic-properties';
import DynamicActionsMixin from '../mixins/dynamic-actions';

/**
  Component's CSS-classes names.
  JSON-object containing string constants with CSS-classes names related to component's .hbs markup elements.

  @property {Object} flexberryClassNames
  @property {String} flexberryClassNames.prefix Component's CSS-class names prefix ('flexberry-slider').
  @property {String} flexberryClassNames.wrapper Component's wrapping
 CSS-class name ('flexberry-slider').
  @readonly
  @static

  @for FlexberryDdauSliderComponent
*/
const flexberryClassNamesPrefix = 'flexberry-slider';
const flexberryClassNames = {
  prefix: flexberryClassNamesPrefix,
  wrapper: flexberryClassNamesPrefix
};

/**
  Flexberry slider component with bootstrap-ui-slider through ui-ember-slider
  and ["Data Down Actions UP (DDAU)" pattern](https://emberway.io/ember-js-goodbye-mvc-part-1-21777ecfd708) one way binding.
  Component doesn't mutate passed value by its own, it only invokes 'change' action,
  which signalizes to the route, controller, or another component, that passed value should be mutated.

  Usage with manual 'change' action handling:
  templates/my-form.hbs
  ```handlebars
  {{flexberry-ddau-slider
    value=model.value
    change=(action "onModelValueChange")
  }}
  ```

  controllers/my-form.js
  ```javascript
  actions: {
    onModelValueChange(e) {
      // Set new value to model's 'value' property.
      this.set('model.value', e.newValue);

      // Log jQuery 'change' event object triggered after checkbox input was clicked.
      console.log(e.originalEvent);
    }
  }
  ```

  Usage with {{#crossLink "FlexberryDdauSliderActionsHandlerMixin"}}flexberry-ddau-checkbox-actions-handler mixin{{/crossLink}}:
  ```handlebars
  {{flexberry-ddau-slider
    value=model.value
    change=(action "onSliderChange" "model.value")
  }}
  ```

  controllers/my-form.js
  ```javascript
  import Ember from 'ember';
  import FlexberryDdauSliderActionsHandlerMixin from 'ember-flexberry/mixins/flexberry-ddau-slider-actions-handler';

  export default Ember.Controller.extend(FlexberryDdauSliderActionsHandlerMixin, {
  });
  ```

  @class FlexberryDdauSliderComponent
  @extends Ember.Component
  @uses RequiredActionsMixin
  @uses DomActionsMixin
  @uses DynamicActionsMixin
  @uses DynamicPropertiesMixin
*/
let FlexberryDdauSliderComponent = Ember.Component.extend(
  RequiredActionsMixin,
  DomActionsMixin,
  DynamicActionsMixin,
  DynamicPropertiesMixin, {

    /**
      Component's required actions names.
      For actions enumerated in this array an assertion exceptions will be thrown,
      if actions handlers are not defined for them.

      @property _requiredActions
      @type String[]
      @default ['change']
    */
    _requiredActionNames: ['change'],

    /**
      Reference to component's CSS-classes names.
      Must be also a component's instance property to be available from component's .hbs template.
    */
    flexberryClassNames,

    /**
      Component's wrapping
 CSS-classes names.

      Any other CSS-classes can be added through component's 'class' property.
      ```handlebars
      {{flexberry-ddau-slider class="toggle" value=model.value change=(action "onModelValueChange")}}
      ```

      @property classNames
      @type String[]
      @default ['flexberry-slider', 'ui']
    */
    classNames: [flexberryClassNames.wrapper, 'ui'],

    /**
      Components class names bindings.

      @property classNameBindings
      @type String[]
      @default ['readonly:read-only']
    */
    classNameBindings: ['readonly:read-only'],

    /**
      Component's min value.

      @property min
      @type Number
      @default 0.01
    */
    min: 0.01,

    /**
      Component's max value.

      @property max
      @type Number
      @default 100
    */
    max: 1,

    /**
      Component's default value.

      @property defaultValue
      @type Number
      @default 1
    */
    defaultValue: 1,

    /**
      Component's value.

      @property value
      @type Number
      @default null
    */
    value: null,
    /**
      Component's range step.

      @property step
      @type Number
      @default 1
    */
    step: 0.01,

    /**
      Flag: indicates whether component is in readonly mode.

      @property readonly
      @type Boolean
      @default false
    */
    readonly: false,

    actions: {
      /**
        Handles inner input's bubbled 'change' action.
        Invokes component's {{#crossLink "FlexberryDdauSlider/sendingActions.change:method"}}'change'{{/crossLink}} action.

        @method actions.change
        @param {Object} e [jQuery event object](http://api.jquery.com/category/events/event-object/)
        which describes inner input's 'change' event.
      */
      change(e) {
        let value = e.value.newValue;

        // Invoke component's custom 'change' action.
        this.sendAction('change', {
          newValue: value,
          originalEvent: e
        });

        // Prevent second call to this.sendAction('change', ...) inside dom-actions mixin,
        // otherwise component's outer 'change' action handler will be called twice.
        return false;
      }
    },

    /**
      Initializes DOM-related component's properties.
    */
    didInsertElement() {
      this._super(...arguments);
    },

    /**
      Destroys DOM-related component's properties.
    */
    willDestroyElement() {
      this._super(...arguments);
    }

    /**
      Component's action invoking when slider was moved and it's 'value' state changed.

      @method sendingActions.change
      @param {Object} e Action's event object.
      @param {Boolean} e.newValue Component's new value.
      @param {Object} e.originalEvent [jQuery event object](http://api.jquery.com/category/events/event-object/)
      which describes inner input's 'change' event.
    */
  }
);

// Add component's CSS-class names as component's class static constants
// to make them available outside of the component instance.
FlexberryDdauSliderComponent.reopenClass({
  flexberryClassNames
});

export default FlexberryDdauSliderComponent;


text:
/** Resource.js
 * 	Author: Vincent Hagen
 *
 * 	Wraps resources in Junction, allows them to be read (static) or executed
 */
"use strict";
var o = require("./core.js");
var fs = require("fs");
var HttpError = require("./Http.js").HttpError;
var log = require("./log.js");

module.exports = (function() {

	var Resource, StaticResource, ScriptResource;

	// General class structure of a Resource, Should not be instanciated.
	Resource = o.Object.extend({
		fname: null, // file name of the resource.
		isLoaded: false, // Is the file loaded
		create: function(fname) {

			this.fname = fname;

			this.load();
		},
		// Loads the file
		load: function() {
			this.isLoaded = true;
			this.onLoadend();
		},
		// triggered after file is loaded
		onLoadend: function() { },
		/* Runs the resource.
		 * ctx: context to which the resource should send to
		 * Returns whenever loading succeeded or not. */
		run: function(ctx) {
			// _error has occured while loading
			if(this._err) {
				ctx.error(this._err);
				return false;
			}

			// Wait until the resource is loaded
			if(!this.isLoaded) {
				this.onLoadend = this.run.bind(this, ctx);
				return false;
			}

			return true;
		},
		/* Sets an HttpError
		 * err: Error object, either nodeJs error or HttpError */
		error: function(err) {
			if(!( err instanceof HttpError) ) err = new HttpError(err);
			this._err = err;
			this.onLoadend();
		}
	});
	/* Constructor function to create an resource, resources with an ":" in
		their name are considerd a ScriptResource, the rest a Static Resource */
	Resource.create = function(fname, uri) {
		log("Resource", "Creating: " + fname);

		// Get the method out the fname if it has any
		var idx = fname.lastIndexOf(".js:");
		var meth
		if( idx !== -1) {
			meth = fname.substr(idx + 4);
			fname = fname.substr(0, idx + 3);
		}
		return new ScriptResource(fname, meth);
	};
	/* Reload all resources */
	Resource.reloadAll = function() {
		// StaticResource.reloadAll();
		ScriptResource.reloadAll();
	};
	/* Lists all loaded resources
	 * Note: For now only ScriptResources are really loaded */
	Resource.list = function() {
		return Object.keys(ScriptResource.all).join("\n");
	}

	// Describes a ScriptResource
	ScriptResource = Resource.extend({
		method: null, // Method to execute
		_classDef: null, // reference to the required class
		create: function(fname, method) {
			_super(ScriptResource).create.call(this, fname);

			this.method = method;
		},
		// Loads the ScriptResource by requiring the given file
		load: function() {
			this.ClassDef = require(this.fname);
			ScriptResource.all[this.fname] = true;

			_super(ScriptResource).load.call(this);
		},
		/* Runs the method of the given script by instanciating the class
		 * and running the given method of that instance with the context.
		 * ctx: HttpContext of the connecting client
		 */
		run: function(ctx) {
			if(_super(ScriptResource).run.call(this, ctx) === false) return false;

			var self = this;
			var svc;
			try {
				svc = new this.ClassDef(ctx, this.method);
				if(this.method && svc.isReady) svc[this.method]();
			} catch(err) {
				self.error = err;
				ctx.error(err);
			}
		}
	});
	// Keep track of all loaded scripts
	ScriptResource.all = {};
	// Reloads all scripts
	ScriptResource.reloadAll = function() {
		for(var k in ScriptResource.all)
			ScriptResource.reload(k);

		ScriptResource.all = {};
	};
	// To reload a script is to throw away it's require.cache
	ScriptResource.reload = function(f) {
		delete require.cache[require.resolve(f)];
	};

	return { Resource: Resource, ScriptResource: ScriptResource };
})();


text:
package com.blazebit.storage.rest.impl.view;

import java.net.URI;
import java.util.Calendar;

import com.blazebit.persistence.view.EntityView;
import com.blazebit.persistence.view.IdMapping;
import com.blazebit.persistence.view.Mapping;
import com.blazebit.persistence.view.MappingParameter;
import com.blazebit.storage.core.api.StorageProviderFactoryDataAccess;
import com.blazebit.storage.core.model.jpa.ObjectStatistics;
import com.blazebit.storage.core.model.jpa.Storage;
import com.blazebit.storage.core.model.jpa.StorageId;
import com.blazebit.storage.rest.model.StatisticsRepresentation;
import com.blazebit.storage.rest.model.StorageListElementRepresentation;
import com.fasterxml.jackson.annotation.JsonIgnore;

@EntityView(Storage.class)
public abstract class StorageListElementRepresentationView extends StorageListElementRepresentation {

	private static final long serialVersionUID = 1L;

	public StorageListElementRepresentationView(
			@Mapping("id.name") String name,
			@Mapping("uri") URI uri,
			@Mapping("creationDate") Calendar creationDate,
			@Mapping("quotaPlan") StorageQuotaPlanChoiceRepresentationView quotaPlan,
			@Mapping("statistics") ObjectStatistics statistics,
			@MappingParameter("storageProviderFactoryDataAccess") StorageProviderFactoryDataAccess storageProviderFactoryDataAccess) {
		super(name, storageProviderFactoryDataAccess.getType(uri), creationDate, quotaPlan, toStatistics(statistics));
	}

	@JsonIgnore
	@IdMapping("id")
	public abstract StorageId getId();

	private static StatisticsRepresentation toStatistics(ObjectStatistics statistics) {
		StatisticsRepresentation result = new StatisticsRepresentation();
		result.setObjectBytes(statistics.getObjectBytes());
		result.setObjectCount(statistics.getObjectCount());
		result.setObjectVersionBytes(statistics.getObjectVersionBytes());
		result.setObjectVersionCount(statistics.getObjectVersionCount());
		return result;
	}

}


text:
Types for Google Cloud Talent v4beta1 API
=========================================

.. automodule:: google.cloud.talent_v4beta1.types
    :members:
    :undoc-members:
    :show-inheritance:


text:
var gulp = require('gulp');
var fs = require('fs');
var coveralls = require('gulp-coveralls');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');

var stageLoader = require('./core/stage-loader');
var stream = require('./core/stream');
var options = require('./core/options');
var trace = require('./core/trace');

var tasks = {};

function runTests(mochaReporter) {
  return gulp.src(['tests/*.js', 'tests/pipeline/*.js', 'lib/*/tests/*.js'])
      .pipe(mocha({
        ui: 'bdd',
        ignoreLeaks: true,
        reporter: mochaReporter,
      }));
}

function buildTestTask(name, mochaReporter, istanbulReporters) {
  gulp.task(name, function(cb) {
    if (!options.coverage && typeof options.coverage !== 'undefined') {
      runTests(mochaReporter).on('end', cb);
      return;
    }
    gulp.src(['core/*.js', 'lib/*.js', 'lib/chromium-phases/*.js', 'lib/write-cpp-phase/*.js'])
    .pipe(istanbul())
    .pipe(istanbul.hookRequire())
    .on('finish', function() {
      require('./core/trace').enable();
      runTests(mochaReporter)
      .pipe(istanbul.writeReports({
        reporters: istanbulReporters,
      }))
      .on('end', function() {
        if (istanbulReporters.indexOf('html') !== -1) {
          process.stdout.write('Detailed coverage report at file://' + fs.realpathSync('coverage/index.html') + '\n');
        }
        if (istanbulReporters.indexOf('lcov') !== -1) {
          gulp.src('coverage/lcov.info')
          .pipe(coveralls())
          .on('error', function(err) {
            console.warn(err);
            console.warn('Failed to upload LCOV data to Coveralls.')
            console.warn('Has this repository been enabled for Coveralls tracking? https://coveralls.io/repos/new');
          })
          .on('finish', function() {
            process.stdout.write('Uploaded LCOV data to Coveralls.\n');
          });
        }
        cb();
      });
    });
  });
}

buildTestTask('test', 'nyan', ['html', 'text-summary']);
buildTestTask('travis-test', 'spec', ['lcov', 'text', 'text-summary']);
buildTestTask('quiet-test', 'dot', []);

function buildTask(name, stageList) {
  tasks[name] = stageList;
  gulp.task(name, function(incb) {
    var cb = function(data) {
      trace.dump();
      incb();
    };
    stageLoader.startPipeline(stageList, cb, function(e) { throw e; });
  });
};

/*
 * Some example pipelines.
 */
buildTask('html', [{name: 'input', options: {data: 'tasks.erlnmyr'}}, 'fileToString', 'doExperiment']);
buildTask('js', [{name: 'input', options: {data: options.file}}, 'fileToJSON', 'JSWriter', {name: 'writeStringFile', options: {filename: 'result.js.html'}}]);
buildTask('stats', [{name: 'input', options: {data: options.file}}, 'fileToJSON', 'StatsWriter', 'log']);

/*
 * examples using filters
 */
buildTask('compactComputedStyle', [{name: 'input', options: {data: options.file}}, 'fileToJSON', 'StyleFilter', 'jsonStringify', {name: 'writeStringFile', options: {filename: options.file + '.filter'}}]);
buildTask('extractStyle', [{name: 'input', options: {data: options.file}}, 'fileToJSON', 'StyleMinimizationFilter', 'jsonStringify', {name: 'writeStringFile', options: {filename: options.file + '.filter'}}]);
buildTask('tokenStyles', [{name: 'input', options: {data: options.file}}, 'fileToJSON', 'StyleTokenizerFilter', 'jsonStringify', {name: 'writeStringFile', options: {filename: options.file + '.filter'}}]);
buildTask('nukeIFrame', [{name: 'input', options: {data: options.file}}, 'fileToJSON', 'NukeIFrameFilter', 'jsonStringify', {name: 'writeStringFile', options: {filename: options.file + '.filter'}}]);

/*
 * example of fabrication
 */
buildTask('generate', [{name: 'input', options: {data: options.file}}, 'fileToBuffer', 'bufferToString', 'jsonParse', 'SchemaBasedFabricator', 'jsonStringify', {name: 'writeStringFile', options: {filename: options.file + '.gen'}}]);

/*
 * examples using device telemetry
 */
buildTask('get', [{name: 'input', options: {data: options.url}}, {name: 'fetch', options: {browser: options.saveBrowser}}, 'jsonStringify', {name: 'writeStringFile', options: {filename: 'result.json'}}]);
buildTask('perf', [{name: 'input', options: {data: options.url}}, 'trace', 'jsonStringify', {name: 'writeStringFile', options: {filename: 'trace.json'}}]);
buildTask('endToEnd', [{name: 'input', options: {data: options.url}}, {name: 'fetch', options: {browser: options.saveBrowser}}, 'HTMLWriter',
                       {name: 'trace', options: {browser: options.perfBrowser}}, 'jsonStringify', {name: 'writeStringFile', options: {filename: 'trace.json'}}]);

/*
 * running an experiment
 */
buildTask('runExperiment', [{name: 'input', options: {data: options.file}}, 'fileToString', 'doExperiment']);

/*
 * ejs fabrication
 */
buildTask('ejs', [{name: 'input', options: {data: options.file}}, 'fileToString', 'ejsFabricator',
                  {name: 'writeStringFile', options: {tag: 'ejsFabricator'}}]);

buildTask('mhtml', [{name: 'input', options: {data: '.'}}, 'readDir',
          {name: 'filter', options: {regExp: new RegExp(options.inputSpec)}}, 'fileToJSON', 'HTMLWriter',
          {name: 'regexReplace',
            options: {tag: 'filename', inputSpec: new RegExp(options.inputSpec), outputSpec: options.outputSpec}},
          {name: 'writeStringFile', options: {tag: 'filename'}}]);

buildTask('processLogs', [{name: 'input', options: {data: options.dir}}, 'readDir', 'fork', 'fileToJSON', 'traceFilter',
          'tracePIDSplitter', 'traceTree', {name: 'tracePrettyPrint', options: {showTrace: 'false'}},
          {name: 'log', options: {tags: ['filename']}}]);

module.exports.tasks = tasks;


text:
#ifndef MCP2515_h
#define MCP2515_h

#include "Arduino.h." // for Arduino 1.0 , otherwise do #include "WProgram.h"

typedef struct
{
  unsigned short adrsValue;
  boolean isExtendedAdrs;
  unsigned long extendedAdrsValue;
  boolean rtr;
  byte dataLength;
  byte data[8];
}  CANMSG;

class MCP2515
{
  public:
    static boolean initCAN(int baudConst);
	static boolean setCANNormalMode();
	static boolean setCANReceiveonlyMode();
	static boolean setWakeMode();
	static boolean setSleepMode();
	static boolean isAwake();
	static boolean receiveCANMessage(CANMSG *msg, unsigned long timeout);
	static boolean transmitCANMessage(CANMSG msg, unsigned long timeout);
	static boolean getMSG(CANMSG *msg, unsigned long timeout, unsigned long message_addr);
	static boolean CANSNIFF(CANMSG *msg, unsigned short address, unsigned long timeout);
	static boolean SNIFF_ALL(CANMSG *msg);

	/*
	static boolean BRAKE_PRESSURE(CANMSG *msg, unsigned long timeout);
	static boolean ABSCAN(CANMSG *msg, unsigned long timeout);
	static boolean ACCELERATOR(CANMSG *msg, unsigned long timeout);
	*/

	static byte getCANTxErrCnt();
	static byte getCANRxErrCnt();
	static long queryOBD(unsigned char code, char* buffer);
	static byte readReg(byte regno);

	private:
	static boolean setCANBaud(int baudConst);
	static void writeReg(byte regno, byte val);
	static void writeRegBit(byte regno, byte bitno, byte val);
//	static byte readReg(byte regno);
};

//Data rate selection constants
#define CAN_BAUD_10K 1
#define CAN_BAUD_50K 2
#define CAN_BAUD_100K 3
#define CAN_BAUD_125K 4
#define CAN_BAUD_250K 5
#define CAN_BAUD_500K 6

#define ABSCAN 0x513
#define ACCELERATOR 0x410
#define BRAKE_PRESSURE 0x511
#define SWAngle 0x511

#define ENGINE_COOLANT_TEMP 0x05
#define ENGINE_RPM          0x0C
#define VEHICLE_SPEED       0x0D
#define MAF_SENSOR          0x10
#define O2_VOLTAGE          0x14
#define THROTTLE		0x11
#define REAL_THROTTLE		0x11
#define FUEL_LEVEL		0x2F
#define RUN_TIME		0x1F
#define INTAKE_TEMP		0x0F

#define PID_REPLY		0x7E8

#endif


text:
<?php

$loader = require_once __DIR__ . '/../vendor/autoload.php';

/** @var Composer\Autoload\ClassLoader $loader */
$loader->addPsr4('Demo\\', __DIR__ . '/Demo');

register_shutdown_function(function () {
    echo "\n\nStatistics:\n";
    echo ' - Memory usage: ' . number_format(memory_get_usage(true), 0, '.', ' ') . " bytes\n";
    echo ' - Memory peak usage: ' . number_format(memory_get_peak_usage(true), 0, '.', ' ') . " bytes\n";
});

return $loader;


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <meta property="og:locale" content="ja_JP">
  <title>LINE - Simple IT Life</title>
  <link rel="stylesheet" href="/assets/css/app.css">
  <link rel="shortcut icon" type="image/png"
    href="/favicon.png"  />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css">

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma-social@1/bin/bulma-social.min.css">

<title>LINE | Simple IT Life</title>
<meta name="generator" content="Jekyll v4.1.1" />
<meta property="og:title" content="LINE" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Linux系の知識やDB関連などを入門の入門としてまとめます。simple is the best !!" />
<meta property="og:description" content="Linux系の知識やDB関連などを入門の入門としてまとめます。simple is the best !!" />
<link rel="canonical" href="http://localhost:4000/tag/line/" />
<meta property="og:url" content="http://localhost:4000/tag/line/" />
<meta property="og:site_name" content="Simple IT Life" />

                Simple IT Life

                Top
                About

LINE タグページ

        デザイナー歴0年のエンジニアがLINEスタンプを制作した話

LINEのスタンプを自作する イラストを作成してから公開するまでの流れをまとめる そもそもイラストなんて描いたことが無かったのでイラストの描き方からまとめていく → LINEスタンプ「イカソクくん」販売中!!

        Read more

Published: 2017年12月6日

        LINE BOTからWatson Conversationを使ってみる

Watson Conversationを使って会話を行うチャットボットを作成する 会話の内容としては、好きなゲームを聞かれたら「スプラトゥーン」と答えるだけの内容とする

        Read more

Published: 2017年9月4日

        LINE Messaging APIを使ってBotを作成する

LINE Messaging APIを使ってBotを作成する 今回はユーザーがBotに話しかけるとBotがオウム返しするだけの内容とする LINE Messaging APIとはLINEのボットを作成してユーザーと対話を行う際に利用するAPI

        Read more

Published: 2017年8月21日

            Contact
             |
            お問い合わせ・フィードバック

© 2020年 tomsato (About me)


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Hotcakes.Modules.Core.Admin.Parts.ContentBlocks.Html {

    public partial class Editor {

        /// <summary>
        /// HtmlEditor1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::Hotcakes.Modules.Core.Admin.Controls.HtmlEditor HtmlEditor1;

        /// <summary>
        /// btnSave control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.LinkButton btnSave;

        /// <summary>
        /// btnCancel control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.LinkButton btnCancel;
    }
}


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

<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>

    <title>Differences in forrest-osgi</title>

      <title>Overview</title>

        The build process and invocation methods are similar, but not
        the same. Building is done with Apache Ant™ and a shell
        script is used to invoke the application.

      <title>Building forrest-osgi</title>

        The build process involves a pair of Ant scripts at the top
        level and another script for each plugin. The main process is
        defined in build.xml and plugin bundles inherit from
        master.xml. $FORREST_HOME should
        point to the top of this whiteboard experiment,
        /path/to/forrest/whiteboard/forrest-osgi. The default Ant
        target in build.xml will build the launcher as
        well as all plugin bundles. The Ant script assumes you have
        changed the environment variable $FORREST_HOME as
        described.

      <title>Running forrest-osgi</title>

        You may run forrest-osgi on an existing content object in
        dynamic mode, but there is no method yet to provision a
        content object (no forrest seed).

        To run, modify $FORREST_HOME as described above
        and invoke $FORREST_HOME/bin/forrest. The HTTP
        Service will bind to port 8080 by default. The
        controlling property is set in
        conf/config.properties. [There is an issue which
        needs to be investigated and that is that not all of the
        bundles shut down cleanly, and it prevents the JVM from
        exiting without being explicitly killed. - This previous issue
        has been solved by upgrading to Apache Felix 3.2.1. The issue
        involved acquiring bundle locks to remove listeners, which is
        no longer done. See FELIX-2936.]

        Because forrest-osgi is not based on Cocoon, the method by
        which it becomes a web application differs. Being web aware or
        capable is no longer an inherited trait. Instead, forrest-osgi
        is responsible for implementing and publishing its own
        servlet. It does this by registering its servlet with the
        Apache Felix™ implementation of the OSGi HTTP Service,
        which uses Jetty behind the scenes.

        See the page on launching for more.

      <title>Plugins in forrest-osgi</title>

        There are differences in the plugin architecture that stem
        simply from the fact that forrest-osgi is not based on Apache
        Cocoon™. The mechanism to resolve plugins is based on the
        extension of the source document for a given request. This
        mechanism needs improvement.

        See the page on bundles for
        more.

        For the request http://localhost:8080/index.html,
        the HTML output plugin is selected based on the request
        itself. The local content object is searched for
        index.* and the input plugin is chosen based on
        the search results. Notice the port number in the example
        request. The default port for forrest-osgi is unchanged from
        the Apache Felix HTTP Service implementation
        (8080), allowing forrest-osgi and other versions
        of Forrest to run concurrently with default settings.

        Skins and dispatcher themes can be encapsulated completely in
        plugins and decoupled from core functionality. The locationmap
        can also be encapsulated in this way. Implementation of these
        rendering options has not yet started.

      <title>Content and transformation</title>

        The experimental implementation uses bundle fragments to house
        the resources and stylesheets needed by the input and output
        plugins. Bundle fragments allow the resources to be versioned
        separately from the code, and a change in one does not
        necessarily trigger a build in the other. Bundle fragments
        attach to their host bundle in the OSGi framework and their
        classpaths combine in useful ways.

      <title>Conventions used and abused in forrest-osgi</title>

        A mix of conventions has been borrowed into the small code
        base from several sources. This is to document what has been
        done so far, not to prevent change.

        BundleActivator classes have assumed the form
        FooBarPlugin. Plugin at the end being
        the marker of an activator. The activator is at the root of
        the bundle's package space and must be exported.

        Service implementation packages have assumed the form
        org.foo.bar.service, and this implementation
        package is generally not exported.

        Plugin resource bundle fragments have assumed the form
        org.foo.plugin.x.y.res, and their host
        org.foo.plugin.x.y, where x is the
        type of plugin and y is a short descriptor of the
        content supported by the plugin. The main difference here from
        standard Forrest is the resource bundle.

</document>


text:
require File.expand_path('../spec_helper', __FILE__)

load_extension("hash")

describe "C-API Hash function" do
  before :each do
    @s = CApiHashSpecs.new
  end

  describe "rb_hash" do
    it "calls #hash on the object" do
      obj = mock("rb_hash")
      obj.should_receive(:hash).and_return(5)
      @s.rb_hash(obj).should == 5
    end

    it "converts a Bignum returned by #hash to a Fixnum" do
      obj = mock("rb_hash bignum")
      obj.should_receive(:hash).and_return(bignum_value)

      # The actual conversion is an implementation detail.
      # We only care that ultimately we get a Fixnum instance.
      @s.rb_hash(obj).should be_an_instance_of(Fixnum)
    end

    it "calls #to_int to converts a value returned by #hash to a Fixnum" do
      obj = mock("rb_hash to_int")
      obj.should_receive(:hash).and_return(obj)
      obj.should_receive(:to_int).and_return(12)

      @s.rb_hash(obj).should == 12
    end

    it "raises a TypeError if the object does not implement #to_int" do
      obj = mock("rb_hash no to_int")
      obj.should_receive(:hash).and_return(nil)

      lambda { @s.rb_hash(obj) }.should raise_error(TypeError)
    end
  end

  describe "rb_hash_new" do
    it "returns a new hash" do
      @s.rb_hash_new.should == {}
    end

    it "creates a hash with no default proc" do
      @s.rb_hash_new {}.default_proc.should be_nil
    end
  end

  describe "rb_hash_dup" do
    it "returns a copy of the hash" do
      hsh = {}
      dup = @s.rb_hash_dup(hsh)
      dup.should == hsh
      dup.should_not equal(hsh)
    end
  end

  describe "rb_hash_freeze" do
    it "freezes the hash" do
      @s.rb_hash_freeze({}).frozen?.should be_true
    end
  end

  describe "rb_hash_aref" do
    it "returns the value associated with the key" do
      hsh = {chunky: 'bacon'}
      @s.rb_hash_aref(hsh, :chunky).should == 'bacon'
    end

    it "returns the default value if it exists" do
      hsh = Hash.new(0)
      @s.rb_hash_aref(hsh, :chunky).should == 0
      @s.rb_hash_aref_nil(hsh, :chunky).should be_false
    end

    it "returns nil if the key does not exist" do
      hsh = { }
      @s.rb_hash_aref(hsh, :chunky).should be_nil
      @s.rb_hash_aref_nil(hsh, :chunky).should be_true
    end
  end

  describe "rb_hash_aset" do
    it "adds the key/value pair and returns the value" do
      hsh = {}
      @s.rb_hash_aset(hsh, :chunky, 'bacon').should == 'bacon'
      hsh.should == {chunky: 'bacon'}
    end
  end

  describe "rb_hash_clear" do
    it "returns self that cleared keys and values" do
      hsh = { :key => 'value' }
      @s.rb_hash_clear(hsh).should equal(hsh)
      hsh.should == {}
    end
  end

  describe "rb_hash_delete" do
    it "removes the key and returns the value" do
      hsh = {chunky: 'bacon'}
      @s.rb_hash_delete(hsh, :chunky).should == 'bacon'
      hsh.should == {}
    end
  end

  describe "rb_hash_delete_if" do
    it "removes an entry if the block returns true" do
      h = { a: 1, b: 2, c: 3 }
      @s.rb_hash_delete_if(h) { |k, v| v == 2 }
      h.should == { a: 1, c: 3 }
    end

    it "returns an Enumerator when no block is passed" do
      @s.rb_hash_delete_if({a: 1}).should be_an_instance_of(Enumerator)
    end
  end

  describe "rb_hash_fetch" do
    before :each do
      @hsh = {:a => 1, :b => 2}
    end

    it "returns the value associated with the key" do
      @s.rb_hash_fetch(@hsh, :b).should == 2
    end

    it "raises a KeyError if the key is not found and default is set" do
      @hsh.default = :d
      lambda { @s.rb_hash_fetch(@hsh, :c) }.should raise_error(KeyError)
    end

    it "raises a KeyError if the key is not found and no default is set" do
      lambda { @s.rb_hash_fetch(@hsh, :c) }.should raise_error(KeyError)
    end
  end

  describe "rb_hash_foreach" do
    it "iterates over the hash" do
      hsh = {name: "Evan", sign: :libra}

      out = @s.rb_hash_foreach(hsh)
      out.equal?(hsh).should == false
      out.should == hsh
    end

    it "stops via the callback" do
      hsh = {name: "Evan", sign: :libra}

      out = @s.rb_hash_foreach_stop(hsh)
      out.size.should == 1
    end

    it "deletes via the callback" do
      hsh = {name: "Evan", sign: :libra}

      out = @s.rb_hash_foreach_delete(hsh)
      out.should == {name: "Evan", sign: :libra}
      hsh.should == {}
    end
  end

  describe "rb_hash_size" do
    it "returns the size of the hash" do
      hsh = {fast: 'car', good: 'music'}
      @s.rb_hash_size(hsh).should == 2
    end

    it "returns zero for an empty hash" do
      @s.rb_hash_size({}).should == 0
    end
  end

  describe "rb_hash_lookup" do
    it "returns the value associated with the key" do
      hsh = {chunky: 'bacon'}
      @s.rb_hash_lookup(hsh, :chunky).should == 'bacon'
    end

    it "does not return the default value if it exists" do
      hsh = Hash.new(0)
      @s.rb_hash_lookup(hsh, :chunky).should be_nil
      @s.rb_hash_lookup_nil(hsh, :chunky).should be_true
    end

    it "returns nil if the key does not exist" do
      hsh = { }
      @s.rb_hash_lookup(hsh, :chunky).should be_nil
      @s.rb_hash_lookup_nil(hsh, :chunky).should be_true
    end

    describe "rb_hash_lookup2" do
      it "returns the value associated with the key" do
        hash = {chunky: 'bacon'}

        @s.rb_hash_lookup2(hash, :chunky, nil).should == 'bacon'
      end

      it "returns the default value if the key does not exist" do
        hash = {}

        @s.rb_hash_lookup2(hash, :chunky, 10).should == 10
      end
    end
  end

  describe "rb_hash_set_ifnone" do
    it "sets the default value of non existing keys" do
      hash = {}

      @s.rb_hash_set_ifnone(hash, 10)

      hash[:chunky].should == 10
    end
  end

  describe "rb_Hash" do
    it "returns an empty hash when the argument is nil" do
      @s.rb_Hash(nil).should == {}
    end

    it "returns an empty hash when the argument is []" do
      @s.rb_Hash([]).should == {}
    end

    it "tries to convert the passed argument to a hash by calling #to_hash" do
      h = BasicObject.new
      def h.to_hash; {"bar" => "foo"}; end
      @s.rb_Hash(h).should == {"bar" => "foo"}
    end

    it "raises a TypeError if the argument does not respond to #to_hash" do
      lambda { @s.rb_Hash(42) }.should raise_error(TypeError)
    end

    it "raises a TypeError if #to_hash does not return a hash" do
      h = BasicObject.new
      def h.to_hash; 42; end
      lambda { @s.rb_Hash(h) }.should raise_error(TypeError)
    end
  end
end


text:
package it.polimi.genomics.core.DataStructures.RegionCondition

/**
 * In order to be selected, the strand of the region has to be equal to the strand_name parameter of this predicate
 * @param strand_name: the accepted value of strand
 */
case class StrandCondition(strand : String) extends RegionCondition {

}


text:
"""
A family of function objects for changing a set of weights over time.

Learning functions come in two varieties: LearningFunction, and
CFPLearningFunction.  A LearningFunction (e.g. Hebbian) applies to one
set of weights, typically from one ConnectionField.  To apply learning
to an entire CFProjection, a LearningFunction can be plugged in to
CFPLF_Plugin.  CFPLF_Plugin is one example of a CFPLearningFunction,
which is a function that works with the entire Projection at once.
Some optimizations and algorithms can only be applied at the full
CFPLearningFn level, so there are other CFPLearningFns beyond
CFPLF_Plugin.

Any new learning functions added to this directory will automatically
become available for any model.

$Id$
"""
__version__='$Revision$'

import param

from topo.base.functionfamily import LearningFn
# Imported here so that all learning functions will be in the same package
from topo.base.functionfamily import Hebbian,IdentityLF  # pyflakes:ignore (API import)

class Oja(LearningFn):
    """
    Oja's rule (Oja, 1982; Dayan and Abbott, 2001, equation 8.16.)

    Hebbian rule with soft multiplicative normalization, tending the
    weights toward a constant sum-squared value over time.  Thus this
    function does not normally need a separate output_fn for normalization.
    """

    alpha=param.Number(default=0.1,bounds=(0,None))
    def __call__(self,input_activity, unit_activity, weights, single_connection_learning_rate):
        weights += single_connection_learning_rate * (unit_activity * input_activity -
                                                      self.alpha * (unit_activity**2) * weights)

class Covariance(LearningFn):
    """
    Covariance learning rule supporting either input or unit thresholds.

    As presented by Dayan and Abbott (2001), covariance rules allow
    either potentiation or depression of the same synapse, depending
    on an activity level.  By default, this implementation follows
    Dayan and Abbott equation 8.8, with the unit_threshold determining
    the level of postsynaptic activity (activity of the target unit),
    below which LTD (depression) will occur.

    If you wish to use an input threshold as in Dayan and Abbott
    equation 8.9 instead, set unit_threshold to zero and change
    input_threshold to some positive value instead.  When both
    thresholds are zero this rule degenerates to the standard Hebbian
    rule.

    Requires some form of output_fn normalization for stability.
    """

    unit_threshold =param.Number(default=0.5,bounds=(0,None),
        doc="Threshold between LTD and LTP, applied to the activity of this unit.")
    input_threshold=param.Number(default=0.0,bounds=(0,None),
        doc="Threshold between LTD and LTP, applied to the input activity.")
    def __call__(self,input_activity, unit_activity, weights, single_connection_learning_rate):
        weights += single_connection_learning_rate * (unit_activity - self.unit_threshold) * (input_activity - self.input_threshold)

class CPCA(LearningFn):
    """
    CPCA (Conditional Principal Component Analysis) rule.

    (See O'Reilly and Munakata, Computational Explorations in
    Cognitive Neuroscience, 2000, equation 4.12.)

    Increases each weight in proportion to the product of this
    neuron's activity, input activity, and connection weights.

    Has built-in normalization, and so does not require output_fn
    normalization for stability.  Intended to be a more biologically
    plausible version of the Oja rule.

    Submitted by Veldri Kurniawan and Lewis Ng.
    """

    def __call__(self,input_activity, unit_activity, weights, single_connection_learning_rate):
        """
        Update the value of the given weights matrix based on the
        input_activity matrix (of the same size as the weights matrix),
        the response of this unit (the unit_activity), and the previous weights
        matrix governed by a per-connection learning rate.
        """

        weights += single_connection_learning_rate * unit_activity * (input_activity - weights);

class BCMFixed(LearningFn):
    """
    Bienenstock, Cooper, and Munro (1982) learning rule with a fixed threshold.

    (See Dayan and Abbott, 2001, equation 8.12) In the BCM rule,
    activities change only when there is both pre- and post-synaptic
    activity.  The full BCM rule requires a sliding threshold (see
    CFPBCM), but this version is simpler and easier to analyze.

    Requires some form of output_fn normalization for stability.
    """

    unit_threshold=param.Number(default=0.5,bounds=(0,None),doc="Threshold between LTD and LTP.")
    def __call__(self,input_activity, unit_activity, weights, single_connection_learning_rate):
        weights += single_connection_learning_rate * unit_activity * input_activity * (unit_activity-self.unit_threshold)

_public = list(set([_k for _k,_v in locals().items()
                    if isinstance(_v,type) and issubclass(_v,LearningFn)]))

# Automatically discover all .py files in this directory.
import os,fnmatch
__all__ = _public + [f.split('.py')[0] for f in os.listdir(__path__[0]) if fnmatch.fnmatch(f,'[!._]*.py')]
del f,os,fnmatch


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Azure.Management.Redis;

namespace AzureRedisCacheSample.Services
{
    /// <summary>
    /// class to access Redis using Microsoft.Azure.Management.Redis
    /// </summary>
    public class MicrosoftRedisService
    {
    }
}


text:
<?php

namespace app\actions\api\internal;

use DateTimeZone;
use Yii;
use yii\web\ViewAction as BaseAction;
use app\models\User;

abstract class BaseStatAction extends BaseAction
{
    public $user;

    public function getCacheFormatVersion()
    {
        return 1;
    }

    public function getCacheId()
    {
        return hash_hmac(
            'sha256',
            http_build_query(
                ['user_id' => $this->user->id, '__format' => $this->getCacheFormatVersion()],
                '',
                '&'
            ),
            static::class
        );
    }

    public function getCacheExpires()
    {
        return 600;
    }

    public function run()
    {
        $response = Yii::$app->getResponse();
        $response->format = 'compact-json';

        $request = Yii::$app->getRequest();
        $screenName = $request->get('screen_name');

        if (!is_scalar($screenName)) {
            return ['error' => ['screen_name' => ['not found']]];
        }

        if (!$this->user = User::findOne(['screen_name' => $screenName])) {
            return ['error' => ['screen_name' => ['not found']]];
        }

        return $this->decorate($this->makeDataOrLoadCache());
    }

    private function makeDataOrLoadCache()
    {
        $cache = Yii::$app->cache;
        if (!$cache) {
            return $this->makeData();
        }
        $key = $this->getCacheId();
        $data = $cache->get($key);
        if ($data !== false) {
            return $data;
        }
        $data = $this->makeData();
        $cache->set($key, $data, $this->getCacheExpires());
        return $data;
    }

    abstract protected function makeData();

    protected function decorate($data)
    {
        return $data;
    }
}


text:
<?xml version="1.0"?>
<ArrayOfStructureConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <StructureConfig>
    <Type>Strongback</Type>
    <DownrangeDistance>0</DownrangeDistance>
    <HeightOffset>-25</HeightOffset>
  </StructureConfig>
  <StructureConfig>
    <Type>ServiceTower</Type>
    <DownrangeDistance>-28</DownrangeDistance>
    <HeightOffset>-50</HeightOffset>
  </StructureConfig>
  <StructureConfig>
    <Type>ASDS</Type>
    <DownrangeDistance>968900</DownrangeDistance>
    <HeightOffset>5</HeightOffset>
  </StructureConfig>
  <StructureConfig>
    <Type>LandingPad</Type>
    <DownrangeDistance>-2650</DownrangeDistance>
    <HeightOffset>5</HeightOffset>
  </StructureConfig>
  <StructureConfig>
    <Type>LandingPad</Type>
    <DownrangeDistance>-1511</DownrangeDistance>
    <HeightOffset>5</HeightOffset>
  </StructureConfig>
</ArrayOfStructureConfig>


text:
<resources>
    <string name="app_name">FirstDive</string>
</resources>


text:
namespace Microsoft.Azure.Management.BatchAI.Fluent.ToolTypeSettings.HasCommandLineArgs.Definition
{
    /// <summary>
    /// The stage of a definition allowing to specify command line arguments for the job.
    /// </summary>
    /// <typeparam name="ReturnT">The next stage of the definition.</typeparam>
    public interface IWithCommandLineArgs<ReturnT>
    {
        /// <summary>
        /// Specifies command line arguments for the job.
        /// </summary>
        /// <param name="commandLineArgs">Command line arguments for the job.</param>
        /// <return>The next stage of the definition.</return>
        ReturnT WithCommandLineArgs(string commandLineArgs);
    }
}


text:
{% extends "speakers/base.html" %}
{% load boxes_tags i18n %}

{% block content %}

    {% if accepting_proposals %}

{% box "talk-proposals" %}

{% trans "To submit a talk" %}:

{% trans "sign up and log in" %}

{% trans "create a speaker profile" %}

{% trans "submit one or more proposals" %}

{% blocktrans %}You will be able to come back and revise your submission until the deadline. Remember that speakers must register and pay to attend the conference.{% endblocktrans %}

    {% else %}

{% trans "Talk submissions are now closed" %} and the {% trans "schedule has been announced" %}.

    {% endif %}
{% endblock %}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="style.css" />
    <link rel="stylesheet" href="fonts/iconfont.css" />

            <simple-grid :data-list="gridData" :columns="gridColumns">
            </simple-grid>

                <button @click="this.show = true">Create</button>

        <modal-dialog v-bind:show.sync="show">

Create New Customer

                    Customer Id
                    <input type="text" v-model="item.customerId" disabled="disabled" />

                    Company Name
                    <input type="text" v-model="item.companyName" />

                    Contact Name
                    <input type="text" v-model="item.contactName" />

                    Phone
                    <input type="text" v-model="item.phone">

                    <button @click="createCustomer">Save</button>

        </modal-dialog>

    <template id="grid-template">

                        {{ col.name | capitalize }}

                        {{ entry[col.name] }}

    </template>

    <template id="dialog-template">

                <slot name="header"></slot>
                <slot name="body"></slot>
                <slot name="footer"></slot>

    </template>