local class = require ('lua-aws.class')
local Signer = require ('lua-aws.signers.base')
local util = require ('lua-aws.util')
local sec_cache = {}
--[[
  When building the stringToSign, these sub resource params should be
  part of the canonical resource string with their NON-decoded values
]]
local subResources = {
    acl = 1,
    cors = 1,
    lifecycle = 1,
    delete = 1,
    location = 1,
    logging = 1,
    notification = 1,
    partNumber = 1,
    policy = 1,
    requestPayment = 1,
    restore = 1,
    tagging = 1,
    torrent = 1,
    uploadId = 1,
    uploads = 1,
    versionId = 1,
    versioning = 1,
    versions = 1,
    website = 1,
}
--[[
  when building the stringToSign, these querystring params should be
  part of the canonical resource string with their NON-encoded values
]]
local responseHeaders = {
    ['response-content-type'] = 1,
    ['response-content-language'] = 1,
    ['response-expires'] = 1,
    ['response-cache-control'] = 1,
    ['response-content-disposition'] = 1,
    ['response-content-encoding'] = 1
}

return class.AWS_S3Signer.extends(Signer) {
    initialize = function (self, api)
        self._api = api
    end,
    sign = function (self, req, credentials, timestamp)
        self:add_authorization(req, credentials, timestamp)
    end,
    add_authorization = function (self, req, credentials, date)
        if not req.headers['presigned-expires'] then
            req.headers['X-Amz-Date'] = date;
        end

        if credentials.sessionToken then
            -- presigned URLs require this header to be lowercased
            req.headers['x-amz-security-token'] = credentials.sessionToken;
        end

        local signature = self:signature(credentials.secretAccessKey, self:string_to_sign(req))
        local auth = 'AWS ' .. credentials.accessKeyId .. ':' .. signature

        req.headers['Authorization'] = auth;
    end,
    string_to_sign = function (self, req)
        local parts = {};
        table.insert(parts, req.method)
        table.insert(parts, req.headers['Content-MD5'] or '')
        table.insert(parts, req.headers['Content-Type'] or '')

        -- This is the "Date" header, but we use X-Amz-Date.
        -- The S3 signing mechanism requires us to pass an empty
        -- string for this Date header regardless.
        table.insert(parts, req.headers['presigned-expires'] or '');

        local headers = self:canonicalizedAmzHeaders(req);
        if headers then
            table.insert(parts, headers)
        end


を知っていますぼくはカムパネルラといっしょに歩いていたのですと云おうとしましたがもうのどがつまって何とも云えませんでした。すると博士はジョバンニが挨拶あいさつに来たとでも思ったものですか、しばらくしげしげジョバンニを見ていましたが「あなたはジョバンニさんでしたね。どうも今晩はありがとう。」と叮ていねいに云いました。ジョバンニは何も云えずにただおじぎをしました。

リンク 1
リンク 2
リンク 3
リンク 4
リンク 5
リンク 6
リンク 7
foobar  baz

 HTML tag is here

[[foo bar]]

吾輩は猫である。名前はまだ無い。
どこで生れたかとんと見当がつかぬ。
hoge
– 夏目漱石

タイトル２-２

lorem ipsum 雨ニモ負ケズ 1

lorem ipsum 雨ニモ負ケズ 0-1

lorem ipsum 雨ニモ負ケズ 1-2

lorem ipsum 雨ニモ負ケズ 2

lorem ipsum 雨ニモ負ケズ 3

lorem ipsum 雨ニモ負ケズ 1

lorem ipsum 雨ニモ負ケズ 2

lorem ipsum 雨ニモ負ケズ 3

タイトル２-２-1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
ジョバンニは思わずかけよって博士の前に立って、ぼくはカムパネルラの行った方を知っていますぼくはカムパネルラといっしょに歩いていたのですと云おうとしましたがもうのどがつまって何とも云えませんでした。すると博士はジョバンニが挨拶あいさつに来たとでも思ったものですか、しばらくしげしげジョバンニを見ていましたが「あなたはジョバンニさんでしたね。どうも今晩はありがとう。」と叮ていねいに云いました。ジョバンニは何も云えずにただおじぎをしました。

<h2


 func(t *testing.T) {
			req, err := http.NewRequest("POST", "/load-test", new(bytes.Buffer))
			if err != nil {
				t.Error(err)
				t.FailNow()
			}

			req.Form = url.Values{"targetURL": []string{ti.targetURL}}
			req.ParseForm()

			actual, err := getTargetURL(req)

			if ti.expectError {
				assert.Error(t, err)
			} else {
				assert.NoError(t, err)
			}

			assert.Equal(t, ti.expected, actual)

		})
	}
}

func TestGetImage(t *testing.T) {
	for _, ti := range []struct {
		tag              string
		role             string
		imageName        string
		imageTag         string
		expectedResponse string
		expectError      bool
	}{
		{
			tag:              "valid master image",
			role:             "masterImage",
			imageName:        "hellofresh/kangal-jmeter-master",
			imageTag:         "latest",
			expectedResponse: "hellofresh/kangal-jmeter-master:latest",
			expectError:      false,
		},
		{
			tag:              "valid worker set",
			role:             "workerImage",
			imageName:        "hellofresh/kangal-jmeter-worker",
			imageTag:         "latest",
			expectedResponse: "hellofresh/kangal-jmeter-worker:latest",
			expectError:      false,
		},
		{
			tag:              "valid empty master image and tag",
			role:             "masterImage",
			imageName:        "",
			imageTag:         "",
			expectedResponse: "",
			expectError:      false,
		},
		{
			tag:              "invalid master image name",
			role:             "masterImage",
			imageName:        "hellofresh/kangal-jmeter-master",
			imageTag:         "latest",
			expectedResponse: "hellofresh/kangal-jmeter-worker:latest",
			expectError:      true,
		},
		{
			tag:              "invalid worker image tag",
			role:             "workerImage",
			imageName:        "hellofresh/kangal-jmeter-worker",
			imageTag:         "1.0",
			expectedResponse: "hellofresh/kangal-jmeter-worker:latest",
			expectError:      true,
		},
		{
			tag:              "image without tag",
			role:             "workerImage",
			imageName:        "hellofresh/kangal-jmeter-worker",
			imageTag:         "",
			expectedResponse: "",
			expectError:      false,
		},
		{
			tag:              "host registry includes port",
			role:             "workerImage",
			imageName:        "test.com:5000/hellofresh/hellofreshkangal-jmeter-worker",
			imageTag:         "v1.7",
			expectedResponse: "test.com:5000/hellofresh/hellofreshkangal-jmeter-worker:v1.7",
			expectError:      false,
		},
		{
			tag:              "Empty tag",
			role:             "workerImage",
			imageName:        "test.com:5000/hellofresh/hellofreshkangal-jmeter-worker",
			imageTag:         "",
			expectedResponse: "",
			expectError:      false,
		},
	} {
		t.Run(ti.tag, func(t *testing.T) {

			image := apisLoadTestV1.ImageDetails{
				Image: "",
				Tag:   "",
			}

			sentImage := ""
			if (ti.imageName != "") && (ti.imageTag != "") {
				sentImage = ti.imageName + ":" + ti.imageTag
			}

			if ti.role == "masterImage" {
				request := buildMocFormReq(t, map[string]string{testFile: "testdata/valid/loadtest.jmx"}, "1", string(apisLoadTestV1.LoadTestTypeJMeter), "", sentImage, "")
				image, _ = getImage(request, ti.role)
			}
			if ti.role == "workerImage" {


断仓库是否正在执行操作，不一定准，还是得靠lock，不过libgit2底层应该有锁，所以代码里有些地方若不确定是否需要加锁，可以不加
        //如果有设临时状态，说明在执行某个操作，比如正在fetching，所以这时应该不允许再执行fetch或pull之类的操作，我做了处理，即使用户去cl页面执行，也无法绕过此限制( ? 不确定，cl页面好像已经无视tmpStatus了，而且没加mutex，直接依靠libgit2底层的锁（好像有））
        //仅当requireAction不等于检查本地未提交修改时，tmpStatus的值才有意义，否则可能没意义。(因为如果requireAction等于检查未提交修改，这时tmpStatus有可能不为空，但检查本地未提交修改时不与pull/push之类的操作冲突，所以，这时其实仍然可以执行操作)
        val hasTmpStatus = curRepo.pendingTask != RepoPendingTask.NEED_CHECK_UNCOMMITED_CHANGES && curRepo.tmpStatus.isNotBlank()
        val actionEnabled = !isDetached && !hasTmpStatus

        repoStatusGood && actionEnabled
    }

    val doActWithLockIfRepoGoodAndActEnabled = { curRepo:RepoEntity, act: suspend ()->Unit ->
        doJobThenOffLoading {
            Libgit2Helper.doActWithRepoLockIfPredicatePassed(curRepo, isRepoGoodAndActEnabled, act)
        }
    }

    val isRepoGood = {curRepo:RepoEntity ->
        curRepo.gitRepoState!=null && !Libgit2Helper.isRepoStatusNotReadyOrErr(curRepo)
    }

    val doActIfRepoGoodOrElse = { curRepo:RepoEntity, act:()->Unit, elseAct:()->Unit ->
        if(isRepoGood(curRepo)) {
            act()
        }else {
            elseAct()
        }
    }

    val doActIfRepoGood = { curRepo:RepoEntity, act:()->Unit ->
        doActIfRepoGoodOrElse(curRepo, act, {})
    }

    // No HEAD，但怕用户看不懂，所以说 no commit
    val showNoCommitDialog = rememberSaveable { mutableStateOf(false) }
    val repoNameOfNoCommitDialog = rememberSaveable { mutableStateOf("") }

    // 传仓库对象，现在用不到，日后可能用到
    val initNoCommitDialog = {curRepo:RepoEntity ->
        repoNameOfNoCommitDialog.value = curRepo.repoName
        showNoCommitDialog.value = true
    }

    if(showNoCommitDialog.value) {
        CopyableDialog2(
            title = repoNameOfNoCommitDialog.value,
            text = stringResource(R.string.repo_no_commit_note),
            onCancel = { showNoCommitDialog.value = false },
            cancelBtnText = stringResource(R.string.ok),
            //隐藏ok键
            okCompose = {}
        ) { }  // ok不执行操作，反正已经隐藏了
    }

    val showSelectedItemsShortDetailsDialog = rememberSaveable { mutableStateOf(false)}
//    val selectedItemsShortDetailsStr = rememberSaveable { mutableStateOf("")}
    if(showSelectedItemsShortDetailsDialog.value) {
        SelectedItemDialog(
//            detailStr = selectedItemsShortDetailsStr.value,
            selectedItems = selectedItems.value,
            formatter = {it.repoName},
            switchItemSelected = switchItemSelected,
            clearAll = {selectedItems.value.clear()},
            closeDialog = {showSelectedItemsShortDetailsDialog.value = false}
        )
    }

    val showSelectedItems = {
//        val sb = StringBuilder()
//        selectedItems.value.toList().forEach {
//            sb.append(it.repoName).append("\n\n")
//        }
//        selectedItemsShortDetailsStr.value = sb.removeSuffix("\n").toString()
        showSelectedItemsShortDetailsDialog.value = true
    }

    // b


isableTutorials = false;
#endif // !MASTER

const char* FrontendFilenames[][2] = {
	{"fe2_mainpanel_ul", "" },
	{"fe2_mainpanel_ur", "" },
	{"fe2_mainpanel_dl", "" },
	{"fe2_mainpanel_dr", "" },
	{"fe2_mainpanel_dr2", "" },
	{"fe2_tabactive", "" },
	{"fe_iconbrief", "" },
	{"fe_iconstats", "" },
	{"fe_iconcontrols", "" },
	{"fe_iconsave", "" },
	{"fe_iconaudio", "" },
	{"fe_icondisplay", "" },
	{"fe_iconlanguage", "" },
	{"fe_controller", "" },
	{"fe_controllersh", "" },
	{"fe_arrows1", "" },
	{"fe_arrows2", "" },
	{"fe_arrows3", "" },
	{"fe_arrows4", "" },
	{"fe_radio1", "" },
	{"fe_radio2", "" },
	{"fe_radio3", "" },
	{"fe_radio4", "" },
	{"fe_radio5", "" },
	{"fe_radio6", "" },
	{"fe_radio7", "" },
	{"fe_radio8", "" },
	{"fe_radio9", "" },
};

#ifdef MENU_MAP
const char* MapFilenames[][2] = {
	{"mapMid01", "mapMid01A"},
	{"mapMid02", "mapMid02A"},
	{"mapMid03", "mapMid03A"},
	{"mapBot01", "mapBot01A"},
	{"mapBot02", "mapBot02A"},
	{"mapBot03", "mapBot03A"},
	{"mapTop01", "mapTop01A"},
	{"mapTop02", "mapTop02A"},
	{"mapTop03", "mapTop03A"},
};
CSprite2d CMenuManager::m_aMapSprites[NUM_MAP_SPRITES];
#endif

// 0x5F3344
const char* MenuFilenames[][2] = {
	{"connection24", ""},
	{"findgame24", ""},
	{"hostgame24", ""},
	{"mainmenu24", ""},
	{"Playersetup24", ""},
	{"singleplayer24", ""},
	{"multiplayer24", ""},
	{"dmalogo128", "dmalogo128m"},
	{"gtaLogo128", "gtaLogo128"},
	{"rockstarLogo128", "rockstarlogo128m"},
	{"gamespy256", "gamespy256a"},
	{"mouse", "mousetimera"},
	{"mousetimer", "mousetimera"},
	{"mp3logo", "mp3logoA"},
	{"downOFF", "buttonA"},
	{"downON", "buttonA"},
	{"upOff", "buttonA"},
	{"upON", "buttonA"},
	{"gta3logo256", "gta3logo256m"},
	{ nil, nil }
};

#define MENU_X_RIGHT_ALIGNED(x) SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - (x))

#ifdef ASPECT_RATIO_SCALE
// All of the defines below replace the StretchX function. Otherwise use SCREEN_SCALE_X.
#define MENU_X_LEFT_ALIGNED(x) SCALE_AND_CENTER_X(x)
#define MENU_X(x) SCREEN_SCALE_X(x)
#define MENU_Y(y) SCREEN_SCALE_Y(y)
#else
#define MENU_X_LEFT_ALIGNED(x) StretchX(x)
#define MENU_X(x) StretchX(x)
#define MENU_Y(y) StretchY(y)
#endif

#ifdef PS2_LIKE_MENU
#define PAGE_NAME_X MENU_X_RIGHT_ALIGNED
#else
#define PAGE_NAME_X SCREEN_SCALE_FROM_RIGHT
#endif

// Seperate func. in VC
#define ChangeScreen(screen, option, updateDelay, clearAlpha) \
	do { \
		m_nPrevScreen = m_nCurrScreen; \
		int newOpt = option; \
		SETUP_SCROLLING(screen) \


/* 801FC5FC 001F825C  EC 00 08 2A */	fadds f0, f0, f1
/* 801FC600 001F8260  D0 45 80 00 */	stfs f2, -0x8000(r5)
/* 801FC604 001F8264  F0 01 A0 0C */	psq_st f0, 12(r1), 1, qr2
/* 801FC608 001F8268  38 80 00 00 */	li r4, 0
/* 801FC60C 001F826C  38 60 00 FF */	li r3, 0xff
/* 801FC610 001F8270  2C 1F 00 00 */	cmpwi r31, 0
/* 801FC614 001F8274  88 01 00 0C */	lbz r0, 0xc(r1)
/* 801FC618 001F8278  B0 85 80 00 */	sth r4, -0x8000(r5)
/* 801FC61C 001F827C  B0 85 80 00 */	sth r4, -0x8000(r5)
/* 801FC620 001F8280  98 65 80 00 */	stb r3, -0x8000(r5)
/* 801FC624 001F8284  98 65 80 00 */	stb r3, -0x8000(r5)
/* 801FC628 001F8288  98 65 80 00 */	stb r3, -0x8000(r5)
/* 801FC62C 001F828C  98 05 80 00 */	stb r0, -0x8000(r5)
/* 801FC630 001F8290  41 82 00 14 */	beq lbl_801FC644
/* 801FC634 001F8294  C0 02 98 60 */	lfs f0, coord_zero-_SDA2_BASE_(r2)
/* 801FC638 001F8298  D0 05 80 00 */	stfs f0, -0x8000(r5)
/* 801FC63C 001F829C  C0 02 98 60 */	lfs f0, coord_zero-_SDA2_BASE_(r2)
/* 801FC640 001F82A0  D0 05 80 00 */	stfs f0, -0x8000(r5)
lbl_801FC644:
/* 801FC644 001F82A4  FC 20 F0 50 */	fneg f1, f30
/* 801FC648 001F82A8  3C C0 CC 01 */	lis r6, 0xCC008000@ha
/* 801FC64C 001F82AC  FC 00 E8 50 */	fneg f0, f29
/* 801FC650 001F82B0  38 A0 02 80 */	li r5, 0x280
/* 801FC654 001F82B4  38 80 00 00 */	li r4, 0
/* 801FC658 001F82B8  38 60 00 FF */	li r3, 0xff
/* 801FC65C 001F82BC  D0 26 80 00 */	stfs f1, 0xCC008000@l(r6)
/* 801FC660 001F82C0  2C 1F 00 00 */	cmpwi r31, 0
/* 801FC664 001F82C4  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 801FC668 001F82C8  D0 26 80 00 */	stfs f1, -0x8000(r6)
/* 801FC66C 001F82CC  D3 A6 80 00 */	stfs f29, -0x8000(r6)
/* 801FC670 001F82D0  B0 A6 80 00 */	sth r5, -0x8000(r6)
/* 801FC674 001F82D4  B0 86 80 00 */	sth r4, -0x8000(r6)
/* 801FC678 001F82D8  98 66 80 00 */	stb r3, -0x8000(r6)
/* 801FC67C 001F82DC  98 6


4.1)
        -s   Load a SPIR-V shader program (files: vert.spv and frag.spv, OpenGL>=4.6)
]]
-- Note: To generate a SPIR-V files from GLSL source with the glslangValidator;
-- $ glslangValidator -G -o vert.spv basic.vert
-- $ glslangValidator -G -o frag.spv basic.frag

local option = arg[1]
local prog -- program handle

if not option then
   print(USAGE)
   os.exit(true)
elseif option == '-c' then
   prog = compile_shader_program()
elseif option == '-w' then
   write_shader_binary("program.bin")
   os.exit(true)
elseif option == '-b' then
   prog = load_shader_binary("program.bin", 36385)
elseif option == '-s' then
   prog = load_spirv_shader("vert.spv", "frag.spv")
else
   print("Invalid option")
   print(USAGE)
   os.exit(true)
end

-- Init scene -----------------------------------------------------------------

local position_data = {
   -0.8, -0.8, 0.0,
    0.8, -0.8, 0.0,
    0.0,  0.8, 0.0
}
local color_data = {
    1.0, 0.0, 0.0,
    0.0, 1.0, 0.0,
    0.0, 0.0, 1.0
}

-- Create and populate


>= m_param.min_resolution ) {
		shape2 shape = m_shape/n;
		m_grid_0.add_layer(shape,n*m_dx);
		m_grid_1.add_layer(shape,n*m_dx);
		n *= 2;
	}
	//
	if( m_set_boundary_flux ) {
		flux_boundary_condition2 boundary_cond;
		m_set_boundary_flux(0.0,boundary_cond.velocity);
		m_grid_0.set_flux_boundary_condition(boundary_cond);
		m_grid_1.set_flux_boundary_condition(boundary_cond);
	}
	//
	int refinement_count = m_param.use_sizing_func ? m_param.initial_refinement : 1;
	int count (0);
	while( refinement_count-- ) {
		//
		std::swap(m_grid,m_grid_prev);
		if( m_param.use_sizing_func ) {
			if( count ) {
				m_macoctreesizingfunc.activate_cells(*m_grid_prev,*m_grid,m_combined_solid_func,nullptr);
			} else {
				m_grid->activate_cells([&](char depth, const vec2d &p) {
					return depth > 3;
				});
			}
		} else {
			m_grid->activate_cells(fluid_func,m_combined_solid_func);
		}
		m_grid->balance_layers();
		m_grid->assign_indices();
		m_grid->assign_levelset(fluid_func,m_combined_solid_func);
		//
		if( m_param.use_sizing_func ) {
			m_macoctreesizingfunc.compute_sizing_function(*m_grid_prev,*m_grid,0.0,m_combined_solid_func,[&]( const vec2d &p ) {
				return m_moving_solid_func ? m_moving_solid_func(m_timestepper->get_current_time(),p).second : vec2d();
			});
		}
		count ++;
	}
	//
	if( velocity_func ) {
		m_grid->set_velocity([&]( const vec2d &p, char dim ) {
			return velocity_func(p)[dim];
		});
	}
	//
	if( m_param.use_FLIP ) {
		shared_array2<Real> highres_fluid(m_shape);
		shared_macarray2<Real> highres_velocity(m_shape);
		//
		if(m_grid->reconstruct_fluid(highres_fluid(),[&]( int i, int j, const Real &levelset_value ) {
			const double value = fluid_func(m_dx*vec2i(i,j).cell());
			return value < m_dx && value > -m_narrowband_depth;
		})) {
			//
			m_grid->reconstruct_velocity(highres_velocity(),[&]( int dim, int i, int j) {
				const double value = fluid_func(m_dx*vec2i(i,j).face(dim));
				return value < m_dx && value > -m_narrowband_depth;
			});
			//
			m_flip->resample(highres_fluid(),m_combined_solid_func,highres_velocity());
		}
	}
	//
	const double sqrt2 = sqrt(2.0);
	//
	m_solid.initialize(m_shape.nodal());
	m_solid.set_as_levelset(sqrt2*m_dx);
	if( m_solid_func ) {
		std::vector<vec2i> valid_positions[m_parallel.get_thread_num()];
		m_parallel.for_each(m_shape.nodal(),[&](int i, int j, int tid) {
			double value = m_solid_func(m_dx*vec2i(i,j).nodal());
			if( std::abs(value) < sqrt2*m_dx ) {
				valid_positions[tid].push_back(vec2i(i,j));
			}
		});
		for( const auto &e : valid_


excel_header_attach_photo_path))
        headerRow.createCell(ATTACH_PHOTO_SIZE).setCellValue(getString(R.string.export_excel_header_attach_photo_size))
        headerRow.createCell(WRITE_TIME_MILLIS).setCellValue(getString(R.string.export_excel_header_write_time_millis))
        headerRow.createCell(SYMBOL).setCellValue(getString(R.string.export_excel_header_symbol))
        headerRow.createCell(IS_ALL_DAY).setCellValue(getString(R.string.export_excel_header_is_all_day))

        headerRow.getCell(SEQ).cellStyle = headerStyle
        headerRow.getCell(WRITE_DATE).cellStyle = headerStyle
        headerRow.getCell(TITLE).cellStyle = headerStyle
        headerRow.getCell(CONTENTS).cellStyle = headerStyle
        headerRow.getCell(ATTACH_PHOTO_NAME).cellStyle = headerStyle
        headerRow.getCell(ATTACH_PHOTO_SIZE).cellStyle = headerStyle
        headerRow.getCell(WRITE_TIME_MILLIS).cellStyle = headerStyle
        headerRow.getCell(SYMBOL).cellStyle = headerStyle
        headerRow.getCell(IS_ALL_DAY).cellStyle = headerStyle

        // FIXME:
        // https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/Sheet.html#setColumnWidth-int-int-
        sheet.setColumnWidth(SEQ, 256 * 10)
        sheet.setColumnWidth(WRITE_DATE, 256 * 30)
        sheet.setColumnWidth(TITLE, 256 * 30)
        sheet.setColumnWidth(CONTENTS, 256 * 50)
        sheet.setColumnWidth(ATTACH_PHOTO_NAME, 256 * 80)
        sheet.setColumnWidth(ATTACH_PHOTO_SIZE, 256 * 15)
        sheet.setColumnWidth(WRITE_TIME_MILLIS, 256 * 60)
        sheet.setColumnWidth(SYMBOL, 256 * 10)
        sheet.setColumnWidth(IS_ALL_DAY, 256 * 30)
        val diarySymbolMap = FlavorUtils.getDiarySymbolMap(requireActivity())
        val size = diaryList.size
        diaryList.forEachIndexed { index, diaryDto ->
            val row = sheet.createRow(index + 1)
            val photoNames = StringBuffer()
            val photoSizes = StringBuffer()
            diaryDto.photoUris?.map {
                photoNames.append("$DIARY_PHOTO_DIRECTORY${FilenameUtils.getName(it.getFilePath())}\n")
                photoSizes.append("${File(it.getFilePath()).length() / 1024}\n")
            }

            val sequence = row.createCell(SEQ).apply {cellStyle = bodyStyle}
            val writeDate = row.createCell(WRITE_DATE).apply {cellStyle = bodyStyle}
            val title = row.createCell(TITLE).apply {cellStyle = bodyStyle}
            val contents = row.createCell(CONTENTS).apply {cellStyle = bodyStyle}
            val attachPhotoNames = row.createCell(ATTACH_PHOTO_NAME).apply {cellStyle = bodyStyle}
            val attachPhotoSizes = row.createCell(ATTACH_PHOTO_SIZE).apply {cellStyle = bodyStyle}
            val writeTimeMillis = row.createCell(WRITE_TIME_MILLIS).apply {cellStyle = bodyStyle}
            val weather = row.createCell(SYMBOL).apply {cellStyle = bodyStyle}
            val isAllDay = row.createCell(IS_ALL_DAY).apply {cellStyle = bodyStyle}

            sequence.setCellValue(diaryDto.sequence.toDouble())
            writeDate.setCellValue(DateUtils.getDateTimeStringFromTimeMillis(diaryDto.currentTimeMillis))
            title.setCellValue(diaryDto.title)
            contents.setCellValue(diaryDto.contents)
            attachPhotoNames.setCellValue(photoNames.toString())
            attachPhotoSizes.setCellValue(photoSizes.toString())
            writeTimeMillis.setCellValue(diaryDto.currentTimeMillis.toDouble())
            isAllDay.setCellValue(diaryDto.isAllDay)
            weather.setCellValue(diarySymbolMap[diaryDto.weather])

            requireActivity().runOnUiThread {
                infoView?.run {
                    text = "${index.plus(1)} / $size\n$guideMessage"


ars_and_bases.push(
            coeff,
            batch_proof
                .split_quot_poly_comms
                .first()
                .ok_or(PlonkError::IndexError)?
                .0,
        );
        for poly in batch_proof.split_quot_poly_comms.iter().skip(1) {
            coeff *= zeta_to_n_plus_2;
            scalars_and_bases.push(coeff, poly.0);
        }

        Ok(scalars_and_bases)
    }

    /// Combine the polynomial evaluations into a single evaluation. Useful in
    /// batch opening.
    /// The returned value is the scalar in `[E]1` described in Sec 8.4, step 11 of https://eprint.iacr.org/2019/953.pdf
    pub(crate) fn aggregate_evaluations(
        lin_poly_constant: &E::Fr,
        poly_evals_vec: &[ProofEvaluations<E::Fr>],
        plookup_proofs_vec: &[Option<PlookupProof<E>>],
        buffer_v_and_uv_basis: &[E::Fr],
    ) -> Result<E::Fr, PlonkError> {
        assert_eq!(poly_evals_vec.len(), plookup_proofs_vec.len());

        let mut result: E::Fr = lin_poly_constant.neg();
        let mut v_and_uv_basis = buffer_v_and_uv_basis.iter();

        for (poly_evals, plookup_proof) in poly_evals_vec.iter().zip(plookup_proofs_vec.iter()) {
            // evaluations at point `zeta`
            for &wire_eval in poly_evals.wires_evals.iter() {
                Self::add_pcs_eval(
                    &mut result,
                    v_and_uv_basis
                        .next()
                        .ok_or(PlonkError::IteratorOutOfRange)?,
                    wire_eval,
                );
            }
            for &sigma_eval in poly_evals.wire_sigma_evals.iter() {
                Self::add_pcs_eval(
                    &mut result,
                    v_and_uv_basis
                        .next()
                        .ok_or(PlonkError::IteratorOutOfRange)?,
                    sigma_eval,
                );
            }
            // evaluations at point `zeta * g`
            Self::add_pcs_eval(
                &mut result,
                v_and_uv_basis
                    .next()
                    .ok_or(PlonkError::IteratorOutOfRange)?,
                poly_evals.perm_next_eval,
            );

            // add Plookup related polynomial evaluations
            if let Some(proof_lk) = plookup_proof {
                let evals = &proof_lk.poly_evals;
                // evaluations at point `zeta`
                for &eval in evals.evals_vec().iter() {
                    Self::add_pcs_eval(
                        &mut result,
                        v_and_uv_basis
                            .next()
                            .ok_or(PlonkError::IteratorOutOfRange)?,
                        eval,
                    );
                }
                // evaluations at point `zeta * g`
                for &next_eval in evals.next_evals_vec().iter() {
                    Self::add_pcs_eval(
                        &mut result,
                        v_and_uv_basis
                            .next()
                            .ok_or(PlonkError::IteratorOutOfRange)?,
                        next_eval,
                    );
                }
            }
        }
        // ensure all the buffer has been consumed
        if v_an


 } // selectChild
}; // HighestLODChildSelectorCallback

/** \class CollapseLOD CollapseLOD.h <osgwTools/CollapseLOD.h>
\brief Removes LOD Nodes from a scene graph.

In typical usage, the application should invoke this visitor as with any OSG NodeVisitor, and
after traversal returns, the application should call the \ref finishProcessingLODs method.

This NodeVisitor has two modes of operation. It can replace LOD Nodes with Group Nodes, or it
can simply remove the LOD Nodes altogether. In either case, only the highest LOD child as
determined by the NodeSelectorCallback, remains (either attached to the new Group or attached
to the removed LOD's former parent).

See \ref CollapseMode to control the mode of operation. COLLAPSE_TO_GROUP is useful when the
LOD Node contains callbacks, UserData, DescriptionLists, etc. This information is
copied from the LOD to the new Group. COLLAPSE_TO_PARENT (the default) removes the LOD and
the references to any such associated data.

\test testvisitors

*/
class OSGWTOOLS_EXPORT CollapseLOD : public osg::NodeVisitor
{
public:
	/** CollapseMode documentation TBD. */

    enum CollapseMode {
        COLLAPSE_TO_GROUP,
        COLLAPSE_TO_PARENT,
        NUM_COLLAPSE_MODES
    };

    /** Constructor
    \param SelectorCallback Callback to determine which child is the highest LOD. By default,
	the function uses an instance of \ref HighestLODChildSelectorCallback.
    \param CollapseMode LOD removal method. Default is COLLAPSE_TO_PARENT. The function
	removes the LODs and attaches the highest LOD child to the the LOD former parent(s).
    \param TraversalMode The traversal mode. The default is to traverse all children.
    */
	CollapseLOD( NodeSelectorCallback *SelectorCallback=NULL,
        const CollapseMode collapseMode=COLLAPSE_TO_PARENT,
        const osg::NodeVisitor::TraversalMode travMode=osg::NodeVisitor::TRAVERSE_ALL_CHILDREN );
	virtual ~CollapseLOD() {};

	void apply( osg::LOD& node );
	void apply( osg::Node& node );

	unsigned int getLODsLocated(void) const {return(_LODsLocated);}
	unsigned int getLODsProcessed(void) const {return(_LODsProcessed);}

    /** Calling code must call this function to remove LODs.
    This NodeVisitor collects LOD Nodes, but doesn't actually process/remove
    them until the calling code executes this member function. */
	unsigned int finishProcessingLODs(void);

protected:
	void processNode( osg::Node& node );

	NodeSet _collectedLODNodes;
	unsigned int _LODsLocated, _LODsProcessed, _depth;
	CollapseMode _collapseMode;
	osg::ref_ptr<NodeSelectorCallback> _selectorCallback;

};

// osgwTools
}

// __OSGWTOOLS_COLLAPSE_LOD__
#endif


ForFlashOperations") SST39WF_16_BS_Driver::Action_ReadID( volatile CHIP_WORD* SectorCheck, FLASH_WORD& ManufacturerCode, FLASH_WORD& DeviceCode )
{
	NATIVE_PROFILE_HAL_DRIVERS_FLASH();

    // assume both CS is using the same flash chip, take
    SectorCheck = CPU_GetUncachableAddress( SectorCheck );

    ///////////////////////////////////
    //
    //
    FLASH_BEGIN_PROGRAMMING_FAST();

    // Enter product ID mode
    SectorCheck[0x5555] = 0x00AA;
    SectorCheck[0x2AAA] = 0x0055;
    SectorCheck[0x5555] = 0x0090;

    ManufacturerCode = SectorCheck[0x0000];
    DeviceCode       = SectorCheck[0x0001];

    // Exit product ID mode
    SectorCheck[0x5555] = 0x00AA;
    SectorCheck[0x2AAA] = 0x0055;
    SectorCheck[0x5555] = 0x00F0;

    FLASH_END_PROGRAMMING_FAST( "SST39WF_16 ReadProductID", SectorCheck );
    //
    //
    ///////////////////////////////////

}

void __section("SectionForFlashOperations")SST39WF_16_BS_Driver::Action_EraseBlock( void* context, volatile CHIP_WORD * Block)
{
	NATIVE_PROFILE_HAL_DRIVERS_FLASH();

	 MEMORY_MAPPED_NOR_BLOCK_CONFIG* config = (MEMORY_MAPPED_NOR_BLOCK_CONFIG*)context;

    //volatile CHIP_WORD* BaseAddress=(CHIP_WORD*) FlashConfig->Flash_ComputeBaseAddress ((UINT32)SectorStart);
	volatile CHIP_WORD* BaseAddress = (CHIP_WORD*) config->Memory.BaseAddress;

    ///////////////////////////////////
    //
    //
    FLASH_BEGIN_PROGRAMMING_FAST();

    BaseAddress[0x5555] = 0x00AA;
    BaseAddress[0x2AAA] = 0x0055;
    BaseAddress[0x5555] = 0x0080;
    BaseAddress[0x5555] = 0x00AA;
    BaseAddress[0x2AAA] = 0x0055;

    *Block = 0x0030;	//SST Sector (=MS Block) erase.

    // wait for the full max time (no continuations are allowed)
    //FLASH_SLEEP_IF_INTERRUPTS_ENABLED( FlashConfig->CommonConfig.Duration_Max_SectorErase_uSec );
	//This macro is no longer present in 3.0RTM. What matters most, we are using FLASH_BEGIN_PROGRAMMING_FAST, which disables IRQs anyway.

    // the 50 mSec erase is in progress.
    // wait for device to signal completion
    // done is indicated by no toggling bits.
    // wake up every 40uSec to take interrupts
    while(*Block != *Block);

    FLASH_END_PROGRAMMING_FAST( "SST39WF_16 EraseBlock", Block );
}

void __section("SectionForFlashOperations") SST39WF_16_BS_Driver::Action_WriteWord(void * context, volatile CHIP_WORD * Sector, CHIP_WORD Data )
{
	NATIVE_PROFILE_HAL_DRIVERS_FLASH();
	MEMORY_MAPPED_NOR_BLOCK_CONFIG* config = (MEMORY_MAPPED_NOR_BLOCK_CONFIG*)context;

	//volatile CHIP_WORD* BaseAddress = (CHIP_WORD*)FlashConfig->Flash_ComputeBaseAddress((UINT32)Address);
	volatile CHIP_WORD* BaseAddress = (CHIP_WORD*)config->Memory.BaseAddress;

    ///////////////////////////////////
    //
    //
    FLASH_BEGIN_PROGRAMMING_FAST();

    BaseAddress[0x5555] = 0x00AA;
    BaseAddress[0x2AAA] = 0x0055;
    BaseAddress[0x5555] = 0x00A0;

    *Sector = Data;

    // wait for device to signal completion
    // done is indicated by no toggling bits.
    // wake up every 10uSec to check again and take interrupts
    while(*Sector != *Sector);

    FLASH_END_PROGRAMMING_F


pub use self::cleanup_sst::{Runner as CleanupSSTRunner, Task as CleanupSSTTask};
pub use self::compact::{Runner as CompactRunner, Task as CompactTask};
pub use self::consistency_check::{Runner as ConsistencyCheckRunner, Task as ConsistencyCheckTask};
pub use self::raftlog_gc::{Runner as RaftlogGcRunner, Task as RaftlogGcTask};
pub use self::read::{LocalReader, Progress as ReadProgress, Task as ReadTask};
pub use self::region::{
    Runner as RegionRunner, Task as RegionTask, PENDING_APPLY_CHECK_INTERVAL,
    STALE_PEER_CHECK_INTERVAL,
};
pub use self::split_check::{KeyEntry, Runner as SplitCheckRunner, Task as SplitCheckTask};
pub(crate) mod schema;

pub(crate) use data::parse_rows;

pub mod data;
pub use data::{Encoding, StandardEncoder, UnsignedLEB128Encoder};

pub use data::DataParsingError;
pub use schema::SchemaParsingError;
use crate::changelog::sanitize;
use crate::changelog::{ChangelogT, CrateChangelog, WorkspaceChangelog};
use crate::crate_selection::ReleaseWorkspace;
use crate::tests::workspace_mocker::{
    example_workspace_1, example_workspace_1_aggregated_changelog,
};
use anyhow::Context;
use predicates::prelude::*;

#[test]
fn release_createreleasebranch() {
    let workspace_mocker = example_workspace_1().unwrap();
    let workspace = ReleaseWorkspace::try_new(workspace_mocker.root()).unwrap();
    workspace.git_checkout_new_branch("develop").unwrap();
    let mut cmd = assert_cmd::Command::cargo_bin("release-automation").unwrap();
    let cmd = cmd.args(&[
        &format!("--workspace-path={}", workspace.root().display()),
        "release",
        "--steps=CreateReleaseBranch",
    ]);
    cmd.assert().success();

    crate::release::ensure_release_branch(&workspace).unwrap();
}

#[test]
fn release_createreleasebranch_fails_on_dirty_repo() {
    let workspace_mocker = example_workspace_1().unwrap();
    workspace_mocker.add_or_replace_file(
        "crates/crate_a/README",
        indoc::indoc! {r#"
            # Example

            Some changes
            More changes
            "#,
        },
    );
    let workspace = ReleaseWorkspace::try_new(workspace_mocker.root()).unwrap();
    workspace.git_checkout_new_branch("develop").unwrap();

    let mut cmd = assert_cmd::Command::cargo_bin("release-automation").unwrap();
    let cmd = cmd.args(&[
        &format!("--workspace-path={}", workspace.root().display()),
        "--log-level=debug",
        "release",
        "--steps=CreateReleaseBranch",
    ]);

    cmd.assert()
        .stderr(predicate::str::contains("repository is not clean"))
        .failure();
}

macro_rules! assert_cmd_success {
    ($cmd:expr) => {{
        let output = $cmd.output().unwrap();

        let (stderr, stdout) = (
            String::from_utf8_lossy(&output.stderr),
            String::from_utf8_lossy(&output.stdout),
        );

        if !output.status.success() {
            panic!(
                "code: {:?}\nstderr:\n'{}'\n---\nstdout:\n'{}'\n---\n",
                output.status.code(),
                stderr,
                stdout,
            );
        };

        (String::from(stderr), String::from(stdout))
    }};
}

// todo(backlog): ensure all of these conditions have unit tests?
#[test]
fn bump_versions_on_selection() {
    let workspace_mocker = example_workspace_1().unwrap();
    let workspace = ReleaseWorkspace::try_new(workspace_mocker.root()).unwrap();
    workspace.gi


8Y2lyY2xlIGN4PSIzODkuMTk5IiBjeT0iMjA1LjczOCIgcj0iMS41OTYiLz4NCjxjaXJjbGUgY3g9IjM5MC4zMTUiIGN5PSIyMDEuOTA5IiByPSIxLjU5NiIvPg0KPC9nPg0KPGcgZmlsbD0iI2Q0YWYzYSI+DQo8Y2lyY2xlIGN4PSIzNzkuMzg1IiBjeT0iMjA3LjI5NyIgcj0iLjc3NyIvPg0KPGNpcmNsZSBjeD0iMzgzLjc3NCIgY3k9IjIwOC4zNzEiIHI9Ii43OTgiLz4NCjxjaXJjbGUgY3g9IjM5Ni41MzciIGN5PSIyMTEuMDgyIiByPSIuNzk3Ii8+DQo8Y2lyY2xlIGN4PSIzODguMTYxIiBjeT0iMjA5LjQwNyIgcj0iLjc5NyIvPg0KPGNpcmNsZSBjeD0iMzg5LjMxOCIgY3k9IjIwNS41NzgiIHI9Ii43OTciLz4NCjxjaXJjbGUgY3g9IjM5MC40MzYiIGN5PSIyMDEuNzUiIHI9Ii43OTgiLz4NCjwvZz4NCjwvc3ZnPg0K');
 width: 200%;
 height: 100%;
 background-size: 100% 100%;
}
/* saint_martin */
.mf {
 background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5MDAgNjAwIj4NCjxwYXRoIGZpbGw9IiNlZDI5MzkiIGQ9Im0wLDBoOTAwdjYwMGgtOTAweiIvPg0KPHBhdGggZmlsbD0iI2ZmZiIgZD0ibTAsMGg2MDB2NjAwaC02MDB6Ii8+DQo8cGF0aCBmaWxsPSIjMDAyMzk1IiBkPSJtMCwwaDMwMHY2MDBoLTMwMHoiLz4NCjwvc3ZnPg0K');
 width: 150%;
 height: 100%;
 background-size: 100% 100%;
}
/* madagascar */
.mg {
 background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5MDAgNjAwIj4NCjxwYXRoIGZpbGw9IiNmZmYiIGQ9Im0wLDBoOTAwdjYwMGgtOTAweiIvPg0KPHBhdGggZmlsbD0iI2ZjM2QzMiIgZD0ibTMwMCwwaDYwMHY2MDBoLTYwMHoiLz4NCjxwYXRoIGZpbGw9IiMwMDdlM2EiIGQ9Im0zMDAsMzAwaDkwMHYzMDBoLTkwMHoiLz4NCjwvc3ZnPg0K');
 width: 150%;
 height: 100%;
 background-size


ead()
        .worker_threads(2)
        .max_blocking_threads(2)
        .enable_io()
        .enable_time()
        .build()
        .unwrap();

    let connector = hyper_tls::HttpsConnector::new();
    let client = hyper::Client::builder().build(connector);

    let join = rt.spawn(request_dialog(&client, rr, tune));
    rt.block_on(join)
        .map_err(|e| FutioError::Other(Box::new(e)))?
}

/// Given a suitable `hyper::Client` and `RequestRecord`, return a
/// `Future` with `Dialog` output.
///
/// The provided `FutioTunables` governs timeout intervals (initial response
/// and complete body), if the response `BodyImage` will be in `Ram` or
/// `FsRead`, and `BlockingPolicy`.
pub fn request_dialog<CN, B>(
    client: &hyper::Client<CN, B>,
    rr: RequestRecord<B>,
    tune: FutioTunables)
    -> impl Future<Output=Result<Dialog, FutioError>> + Send + 'static
    where CN: hyper::client::connect::Connect + Clone + Send + Sync + 'static,
          B: http_body::Body + Send + 'static,
          B::Data: Send,
          B::Error: Into<Flaw>
{
    let prolog = rr.prolog;

    let futr = client
        .request(rr.request)
        .err_into::<FutioError>()
        .map_ok(|response| Monolog { prolog, response });

    let futr = if let Some(t) = tune.res_timeout() {
        Either::Left(
            tokio::time::timeout(t, futr).map(move |r| match r {
                Ok(Ok(v)) => Ok(v),
                Ok(Err(e)) => Err(e),
                Err(_) => Err(FutioError::ResponseTimeout(t))
            })
        )
    } else {
        Either::Right(futr)
    };

    async move {
        let monolog = futr .await?;

        let body_timeout = tune.body_timeout();

        let futr = resp_future(monolog, tune);

        let futr = if let Some(t) = body_timeout {
            Either::Left(
                tokio::time::timeout(t, futr).map(move |r| match r {
                    Ok(Ok(v)) => Ok(v),
                    Ok(Err(e)) => Err(e),
                    Err(_) => Err(FutioError::BodyTimeout(t))
                })
            )
        } else {
            Either::Right(futr)
        };

        futr .await? .prepare()
    }
}

async fn resp_future(monolog: Monolog, tune: FutioTunables)
    -> Result<InDialog, FutioError>
{
    let (resp_parts, body) = monolog.response.into_parts();

    // Result<BodySink> based on CONTENT_LENGTH header.
    let bsink = match resp_parts.headers.try_decode::<ContentLength>() {
        Some(Ok(ContentLength(l))) => {
            if l > tune.image().max_body() {
                Err(FutioError::ContentLengthTooLong(l))
            } else if l > tune.image().max_body_ram() {
                BodySink::with_fs(tune.image().temp_dir())
                    .map_err(FutioError::from)
            } else {
                Ok(BodySink::with_ram(l))
            }
        },
        Some(Err(e)) => Err(FutioError::Other(Box::new(e))),
        None => Ok(BodySink::with_ram(tune.image().max_body_ram()))
    }?;

    // Regardless of policy, we always receive `Bytes` from


elf.get_model_grid().num_rows()
        elif dimension_string == "ncol":
            return self.get_model_grid().num_columns()
        elif dimension_string == "nlay":
            return self.get_model_grid().num_layers()
        elif dimension_string == "ncpl":
            return self.get_model_grid().num_cells_per_layer()
        elif dimension_string == "nodes":
            if return_shape:
                return self.get_model_grid().get_model_dim()
            else:
                return self.get_model_grid().num_cells()
        elif dimension_string == "nja":
            return self.get_model_grid().num_connections()
        elif dimension_string == "ncelldim":
            return self.get_model_grid().get_num_spatial_coordinates()
        else:
            return None

    def deconstruct_axis(self, shape_array):
        deconstructed_shape_array = []
        for entry in shape_array:
            if entry == "ncpl":
                if self.get_model_grid().grid_type() == DiscretizationType.DIS:
                    deconstructed_shape_array.append("ncol")
                    deconstructed_shape_array.append("nrow")
                else:
                    deconstructed_shape_array.append(entry)
            elif entry == "nodes":
                if self.get_model_grid().grid_type() == DiscretizationType.DIS:
                    deconstructed_shape_array.append("ncol")
                    deconstructed_shape_array.append("nrow")
                    deconstructed_shape_array.append("nlay")
                elif (
                    self.get_model_grid().grid_type()
                    == DiscretizationType.DISV
                ):
                    deconstructed_shape_array.append("ncpl")
                    deconstructed_shape_array.append("nlay")
                else:
                    deconstructed_shape_array.append(entry)
            else:
                deconstructed_shape_array.append(entry)
        return deconstructed_shape_array


%), 28%);
$skin-active-400:          $skin-base-active;
$skin-active-700:          shade(tint($skin-base-active, -15%), 30%);

$white:                   #fff;
$white-lighter:           darken($white, 0.6%);
$white-light:             darken($white, 1.8%);
$white-dark:              darken($white, 3.3%);
$white-darker:            darken($white, 5.8%);

//==Brand Shades
//
//## Brand colors for use across QuantumUI.

$brand-primary-darker:         shade(tint($brand-primary, -19%), 38%);
$brand-primary-dark:           shade(tint($brand-primary, -9%), 18%);
$brand-primary-light:          tint(shade($brand-primary, -9%), 18%);
$brand-primary-lighter:        tint(shade($brand-primary, -19%), 38%);

$brand-info-darker:            shade(tint($brand-info, -7.5%), 15%);
$brand-info-dark:              shade(tint($brand-info, -3.75%), 7.5%);
$brand-info-light:             tint(shade($brand-info, -9%), 18%);
$brand-info-lighter:           tint(shade($brand-info, -19%), 38%);

$brand-success-darker:         shade(tint($brand-success, -7.5%), 15%);
$brand-success-dark:           shade(tint($brand-success, -3.75%), 7.5%);
$brand-success-light:          tint(shade($brand-success, -9%), 18%);
$brand-success-lighter:        tint(shade($brand-success, -18%), 38%);

$brand-warning-darker:         shade(tint($brand-warning, -7.5%), 15%);
$brand-warning-dark:           shade(tint($brand-warning, -3.75%), 7.5%);
$brand-warning-light:          tint(shade($brand-warning, -9%), 18%);
$brand-warning-lighter:        tint(shade($brand-warning, -19%), 38%);

$brand-danger-darker:         shade(tint($brand-danger, -7.5%), 15%);
$brand-danger-dark:           shade(tint($brand-danger, -3.75%), 7.5%);
$brand-danger-light:          tint(shade($brand-danger, -9%), 18%);
$brand-danger-lighter:        tint(shade($brand-danger, -19%), 38%);
//== Scaffolding
//
//## Settings for some of the most global styles.

$font-size-largest:       21px;
$font-size-smallest:      ceil(($font-size-base * 0.7)); // ~10px

//== Components
//
//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).

$line-height-largest:       1.18;

$border-radius-largest:     8px;

//** component font family.
$component-font-family:        'Glyphicons Halflings';
$angle-icon:                   '\e259';
$angle-up-icon:                '\e260';
$tick-icon:                    '\e013';
$info-icon:                    '\e086';
$danger-icon:                  '\e107';
$warning-icon:                 '\e101';

$caret-width-large:         5px;

//== Dropdowns
//
//## Dropdown menu container and contents.

$dropdown-min-width:             160px;
$dropdown-box-shadow:            0 6px 12px rgba($skin-base-700, 2%/100.0%);
$dropdown-caret-color:           $skin-base-800;

//** Background for the dropdown container.
$dropdown-container-bg:


v-bind:foo="{{bar}}" foo="{{bar}}" foo2='{%bar%}'>
        {{foo.bar}}

    """.trimIndent(), "test.{%.%}${VueFileElementType.INJECTED_FILE_SUFFIX}")
  }

  fun testSrcAttribute() {
    doTestVue("""
      <template src="foo"></template>

      <template>
        <template src="foo"></template>

      </template>
    """.trimIndent())
  }

  fun testLangAttribute() {
    doTestVue("""
      <template>

</template>
      <template lang="html">

</template>
    """.trimIndent())
  }

  fun testDivNestedUnderP() {
    doTestVue("<template>

</template>")
  }

  fun testScriptSetupGeneric() {
    doTestVue("""

    """.trimIndent())
  }

  fun testScriptSetupGenericBroken() {
    doTestVue("""

    """.trimIndent())
  }

  fun testScriptSetupGenericJS() {
    doTestVue("""

    """.trimIndent())
  }

  fun testTitleVue() {
    doTestVue("""
      <title>This is <std>title</std></title>

<Title>This is <custom>title</custom></Title>

    """.trimIndent())
  }

  fun testTitleHtml() {
    super.doTest("""
      <title>This is <std>title</std></title>

<Title>This is <custom>title</custom></Title>

    """.trimIndent(), "test.html")
  }

  fun testStyleReparse() {
    doReparseTest("</styl\n", "<div\n")
    doReparseTest(".foo { }</styl\n", "<div\n")
  }

  fun testJsxReparse() {
    doReparseTest("""

    """.trimIndent(), """

    """.trimIndent())
  }

  fun testLangReparse() {
    val baseText = """

      <template>

      </template>
    """.trimIndent()
    doReparseTest(baseText, baseText.replace("js", "ts"))
  }

  fun testDeepWithSelectors() {
    doTestVue("""
      <template>
      </template>

    """.trimIndent())
  }
}// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governe


try
    for the specified row.
  */
  inline bool rowProhibited2(int i) const
  {
    if (!anyProhibited_)
      return false;
    else
      return (rowChanged_[i] & 2) != 0;
  }
  /// Mark row as ineligible for preprocessing
  inline void setRowProhibited(int i)
  {
    rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] | (2));
  }
  /*! \brief Test if row is marked as used

     This is for doing faster lookups to see where two rows have entries
     in common.  It can be used anywhere as long as it ends up zeroed out.
  */
  inline bool rowUsed(int i) const
  {
    return (rowChanged_[i] & 4) != 0;
  }
  /// Mark row as used
  inline void setRowUsed(int i)
  {
    rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] | (4));
  }
  /// Mark row as unused
  inline void unsetRowUsed(int i)
  {
    rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] & (~4));
  }

  /// Check if there are any prohibited rows or columns
  inline bool anyProhibited() const
  {
    return anyProhibited_;
  }
  /// Set a flag for presence of prohibited rows or columns
  inline void setAnyProhibited(bool val = true)
  {
    anyProhibited_ = val;
  }
  //@}
};

/*! \class CoinPostsolveMatrix
    \brief Augments CoinPrePostsolveMatrix with information about the problem
	   that is only needed during postsolve.

  The notable point is that the matrix representation is threaded. The
  representation is column-major and starts with the standard two pairs of
  arrays: one pair to hold the row indices and coefficients, the second pair
  to hold the column starting positions and lengths. But the row indices and
  coefficients for a column do not necessarily occupy a contiguous block in
  their respective arrays. Instead, a link array gives the position of the
  next (row index,coefficient) pair. If the row index and value of a
  coefficient a<p,j> occupy position kp in their arrays, then the position of
  the next coefficient a<q,j> is found as kq = link[kp].

  This threaded representation allows for efficient expansion of columns as
  rows are reintroduced during postsolve transformations. The basic packed
  structures are allocated to the expected size of the postsolved matrix,
  and as new coefficients are added, their location is simply added to the
  thread for the column.

  There is no provision to convert the threaded representation to a packed
  representation. In the context of postsolve, it's not required. (You did
  keep a copy of the original matrix, eh?)

  The constructors that take an OSI or ClpSimplex as a parameter really should
  not be here, but for historical reasons they will likely remain for the
  forseeable future.  -- lh, 111202 --
*/
class CoinPostsolveMatrix : public CoinPrePostsolveMatrix {
public:
  /*! \brief `Native' constructor

    This constructor creates an empty object which must then be loaded.
    On the other hand, it doesn't assume that the client is an
    OsiSolverInterface.
  */
  CoinPostsolveMatrix(int ncols_alloc, int nrows_alloc,
    CoinBigIndex nelems_alloc);

  /*! \brief Clp OSI constructor

    See Clp code for the definition.
  */
  CoinPostsolveMatrix(ClpSimplex *si,

    int ncols0,
    int nrows0,
    CoinBigIndex nelems0,

    double maxmin_,
    // end prepost members

    double *sol,
    double *acts


then
			pastingtiles = false
		end
		if eyedroppertool then eyedroppertool = false; ANDROIDSHOWTOOLS = false end
		if inmap(cox, coy) == false then
			return
		end
		if editentities and map[cox][coy][2] then
			currenttile = map[cox][coy][2]
			return false
		end
		editentities = false
		tilesall()
		if backgroundtilemode then
			local backgroundtile = bmapt(cox, coy, 1)
			if backgroundtile then
				currenttile = backgroundtile
			else
				currenttile = 1
			end
		else
			currenttile = map[cox][coy][1]
		end
	elseif button == "l" then
		if editormenuopen == false then
			levelmodified = true
			if customrcopen == "link" then
				local tileX, tileY = getMouseTile(x, y+8*scale)
				setrclink(tileX, tileY)
				return
			elseif editorstate == "linktool" then
				local tileX, tileY = getMouseTile(x, y+8*scale)
				local r = map[tileX][tileY]
				if #r > 1 then
					local tile = r[2]
					--LIST OF NUMBERS THAT ARE ACCEPT AS OUTPUT (doors, lights)
					if tablecontains( inputsi, r[2] ) then
						--linktoolX, linktoolY = tileX, tileY
						--syke, just open up the right click menu
						openrightclickmenu(x, y, tileX, tileY)
						--then automatically click the link button ONLY if there's just one
						local count = 0
						local button
						for i, b in ipairs(rightclickobjects) do
							if b and b.type == "button" and b.func == startrclink then
								count = count + 1
								button = b
							end
						end
						if count == 1 and button then
							startrclink(unpack(button.arguments))
						end
					end
				end
			elseif editorstate == "selectiontool" then
				if not customrcopen then
					selectiontoolclick[1][1] = x/scale + xscroll*16
					selectiontoolclick[1][2] = y/scale + yscroll*16
					selectiontoolselection = {}
				end
			elseif editorstate ~= "portalgun" and customrcopen == false and not (assistmode and quickmenuopen) then
				undo_clear()

				-- left click on the selected area
				if tileselection and tileselection.finished
				and x > (tileselection[1]-xscroll-1)*16*scale and y > ((tileselection[2]-yscroll-1)*16-8)*scale
				and x < (tileselection[3]-xscroll)*16*scale and y < ((tileselection[4]-yscroll)*16-8)*scale then
					mtclipboard = getTilesSelection()
					emptySelection("store")
					pastecenter =  {-(math.floor((x-(tileselection[1]-xscroll)*16*scale)/scale/16))-1, -(math.floor((y-((tileselection[2]-yscroll-1)*16-8)*scale)/scale/16))}
					pastingtiles = true
					editentities = false
					tilesall()
					tileselectionmoving = true

					allowdrag = false
					return
				end
				if ctrlpressed then
					if pastingtiles then
						pastingtiles = false
						mtclipboard = {}
					end
					resettileselection()
					local tx, ty = getMouseTile(x, y+8*screenzoom*scale)
					tileselection = {tx, ty, tx, ty}
					tileselection.finished = false
					allowdrag = true
				elseif pastingtiles then
					--PASTE TILES
					for i, v in pairs(mtclipboard) do
						for j, w in pairs(v) do
							if w[1] == 1 and (not w[2]) and (not w["back"]) and pastemode


sllk	%r0,%r0,-524289
	sllk	%r0,%r0,524288
	sllk	%r0,%r0,0(%r0)
	sllk	%r0,%r0,0(%r1,%r2)

#CHECK: error: invalid operand
#CHECK: srak	%r0,%r0,-524289
#CHECK: error: invalid operand
#CHECK: srak	%r0,%r0,524288
#CHECK: error: %r0 used in an address
#CHECK: srak	%r0,%r0,0(%r0)
#CHECK: error: invalid use of indexed addressing
#CHECK: srak	%r0,%r0,0(%r1,%r2)

	srak	%r0,%r0,-524289
	srak	%r0,%r0,524288
	srak	%r0,%r0,0(%r0)
	srak	%r0,%r0,0(%r1,%r2)

#CHECK: error: invalid operand
#CHECK: srlk	%r0,%r0,-524289
#CHECK: error: invalid operand
#CHECK: srlk	%r0,%r0,524288
#CHECK: error: %r0 used in an address
#CHECK: srlk	%r0,%r0,0(%r0)
#CHECK: error: invalid use of indexed addressing
#CHECK: srlk	%r0,%r0,0(%r1,%r2)

	srlk	%r0,%r0,-524289
	srlk	%r0,%r0,524288
	srlk	%r0,%r0,0(%r0)
	srlk	%r0,%r0,0(%r1,%r2)

#CHECK: error: invalid operand
#CHECK: stch	%r0, -524289
#CHECK: error: invalid operand
#CHECK: stch	%r0, 524288

	stch	%r0, -524289
	stch	%r0, 524288

#CHECK: error: invalid operand
#CHECK: sthh	%r0, -524289
#CHECK: error: invalid operand
#CHECK: sthh	%r0, 524288

	sthh	%r0, -524289
	sthh	%r0, 524288

#CHECK: error: invalid operand
#CHECK: stfh	%r0, -524289
#CHECK: error: invalid operand
#CHECK: stfh	%r0, 524288

	stfh	%r0, -524289
	stfh	%r0,


e == PathType.ABSOLUTE) {
                                    try {
                                        File(it.file.path.ioPath).delete()
                                    }catch (e: Exception) {
                                        MyLog.w(TAG, "remove file failed: ioPath=${it.file.path.ioPath}, err=${e.localizedMessage}")
                                    }
                                }
                            }
                        }

                        Msg.requireShow(activityContext.getString(R.string.deleted))
                    }
                }

            }

            val iconList = listOf(
                Icons.Filled.Delete,
                Icons.Filled.DocumentScanner,  // show in files
                Icons.AutoMirrored.Filled.OpenInNew, // open as
                Icons.Filled.SelectAll,
            )
            val iconTextList = listOf(
                stringResource(R.string.delete),
                stringResource(R.string.show_in_files),
                stringResource(R.string.open_as),
                stringResource(R.string.select_all),
            )
            val iconOnClickList = listOf(
                delete@{
                    initDeleteRecentFilesDialog()
                },

                showInFiles@{
                    selectedRecentFileList.value.firstOrNull()?.let { showInFiles(it.file.path) }
                    Unit
                },

                openAs@{
                    selectedRecentFileList.value.firstOrNull()?.let { initOpenAsDialog(it.file.path.ioPath, showReloadDialog = false) }
                    Unit
                },

                selectAll@{
                    selectedRecentFileList.value.let {
                        it.clear()
                        it.addAll(recentFileList.value)
                    }

                    Unit
                }
            )

            val getSelectedFilesCount = {
                selectedRecentFileList.value.size
            }
            val iconEnableList = listOf(
                delete@{ true },
                showInFiles@{ isSubPageMode.not() && selectedRecentFileList.value.size == 1 },
                openAs@{ selectedRecentFileList.value.size == 1 },
                selectAll@{ true },
            )

            val showSelectedItemsShortDetailsDialog = rememberSaveable { mutableStateOf(false) }
            if(showSelectedItemsShortDetailsDialog.value) {
                SelectedItemDialog(
                    selectedItems = selectedRecentFileList.value,
                    formatter = {it.file.name},
                    switchItemSelected = switchItemSelected,
                    clearAll = {selectedRecentFileList.value.clear()},
                    closeDialog = {showSelectedItemsShortDetailsDialog.value = false}
                )
            }

            val countNumOnClickForBottomBar = {
                showSelectedItemsShortDetailsDialog.value = true
            }
            if(selectionMode.value) {
                BottomBar(
                    quitSelectionMode=quitSelectionMode,
                    iconList=iconList,
                    iconTextList=iconTextList,
                    iconDescTextList=iconTextList,
                    iconOnClickList=iconOnClickList,
                    iconEnableList=iconEnableList,
                    moreItemTextList=listOf(),
                    moreItemOnClickList=listOf(),
                    moreItemEnableList = listOf(),
                    getSelectedFilesCount = getSelectedFilesCount,
                    countNumOnClickEnabled = true,
                    countNumOnClick = countNumOnClickForBottomBar,
                    reverseMoreItemList = true
                )
            }

        }

    }

    // open file err or no file opened or loading file
    if(
        ((editorOpenFileErr.value) // open file err
//                || (notOpenFile)  // no file opened
                || (loadingFile))  // loading file
        && somethingWrong  // load file err or file not ready or file path is blank
        && !notOpenFile
    ){
        FullScreenScrollableColumn(contentPadding) {
            val fontSize = MyStyleKt.TextSize.default
            val iconModifier = MyStyleKt.Icon.modifier

            //20240429: 这里必须把判断用到的状态变量写全，不然目前的Compose的刷新机制可能有bug，当if的第一个判断条件值没变时，可能会忽略后面的判断，有待验证


ой над Preact, пытающийся достичь 100% совместимости с React.

Причина, по которой Preact не пытается включить в себя все возможности React, заключается в том, чтобы оставаться **маленьким** и **сфокусированным** — в противном случае было бы разумнее просто направлять оптимизации в проект React, который уже является очень сложной и хорошо структурированной кодовой базой.

---

<toc></toc>

---

## Основные отличия

Основное отличие Preact от React заключается в том, что Preact не реализует синтетическую систему событий по соображениям размера и производительности. Для регистрации обработчиков событий в Preact используется стандартная для браузера функция `addEventListener`, что означает, что именование и поведение событий в Preact работает так же, как и в обычном JavaScript / DOM. Полный список обработчиков событий DOM перечислен в [Справочнике по событиям][MDN's Event Reference].

Стандартные события браузера работают очень похоже на то, как события работают в React, с небольшими отличиями. В Preact:

- события не распространяются через компоненты `<Portal>`.
- стандартное `onInput` должно использоваться вместо `onChange` от React для ввода формы (**только если `preact/compat` не используется**)
- стандартное `onDblClick` должно использоваться вместо `onDoubleClick` от React (**только если `preact/compat` не используется**)
- `onSearch` обычно следует использовать для `<input type="search">`, поскольку кнопка очистки "x" не активирует `onInput` в IE11.

Ещё одно заметное отличие заключается в том, что Preact более точно следует спецификации DOM. Пользовательские элементы поддерживаются так же, как и любой другой элемент, а пользовательские события поддерживаются с именами, чувствительными к регистру (как и в DOM).

## Совместимость версий

Как для preact, так и для [preact/compat] совместимость версий измеряется по отношению к _текущим_ и _предыдущим_ основным выпускам React. Когда команда React анонсирует новые функции, они могут быть добавлены в ядро Preact, если это имеет смысл с учетом [целей проекта][Project Goals]. Это довольно демократичный процесс, постоянно развивающийся посредством дискуссий и решений, принимаемых открыто, с использованием вопросов и запросов на включение.

> Таким образом, сайт и документация отражают версии React с `15.x` по `17.x`, с некоторыми д


LCoded = 1;
            } else if (L >= 0) {
                assert(L == tc.L());
                for (int i = 1; i < LValuesCoded.length; i++) {
                    if (LValuesCoded[i] == L) { LCoded = i; break; }
                }
            }
        }
        CodingMethod tokenDflt = null;
        if (LCoded != 0 && tokenCoding == fitTokenCoding(fVlen, L)) {
            // A simple L value is enough to recover the tokenCoding.
            tokenDflt = tokenCoding;
        }
        int FDef = (favoredCoding == dflt)?1:0;
        int UDef = (unfavoredCoding == dflt || unfavoredCoding == null)?1:0;
        int TDef = (tokenCoding == tokenDflt)?1:0;
        int TDefL = (TDef == 1) ? LCoded : 0;
        assert(TDef == ((TDefL>0)?1:0));
        ByteArrayOutputStream bytes = new ByteArrayOutputStream(10);
        bytes.write(_meta_pop + FDef + 2*UDef + 4*TDefL);
        try {
            if (FDef == 0)  bytes.write(favoredCoding.getMetaCoding(dflt));
            if (TDef == 0)  bytes.write(tokenCoding.getMetaCoding(dflt));
            if (UDef == 0)  bytes.write(unfavoredCoding.getMetaCoding(dflt));
        } catch (IOException ee) {
            throw new RuntimeException(ee);
        }
        return bytes.toByteArray();
    }
    public static int parseMetaCoding(byte[] bytes, int pos, Coding dflt, CodingMethod res[]) {
        int op = bytes[pos++] & 0xFF;
        if (op < _meta_pop || op >= _meta_limit)  return pos-1; // backup
        op -= _meta_pop;
        int FDef = op % 2;
        int UDef = (op / 2) % 2;
        int TDefL = (op / 4);
        int TDef = (TDefL > 0)?1:0;
        int L = LValuesCoded[TDefL];
        CodingMethod[] FCode = {dflt}, TCode = {null}, UCode = {dflt};
        if (FDef == 0)
            pos = BandStructure.parseMetaCoding(bytes, pos, dflt, FCode);
        if (TDef == 0)
            pos = BandStructure.parseMetaCoding(bytes, pos, dflt, TCode);
        if (UDef == 0)
            pos = BandStructure.parseMetaCoding(bytes, pos, dflt, UCode);
        PopulationCoding pop = new PopulationCoding();
        pop.L = L;  // might be -1
        pop.favoredCoding   = FCode[0];
        pop.tokenCoding     = TCode[0];  // might be null!
        pop.unfavoredCoding = UCode[0];
        res[0] = pop;
        return pos;
    }

    private String keyString(CodingMethod m) {
        if (m instanceof Coding)
            return ((Coding)m).keyString();
        if (m == null)
            return "none";
        return m.toString();
    }
    public String toString() {
        PropMap p200 = Utils.currentPropMap();
        boolean verbose
            = (p200 != null &&
               p200.getBoolean(Utils.COM_PREFIX+"verbose.pop"));
        StringBuilder res = new StringBuilder(100);
        res.append("pop(").append("fVlen=").append(fVlen);
        if (verbose && fValues != null) {
            res.append(" fV=[");
            for (int i = 1; i <= fVlen; i++) {
                res.append(i==1?"":",").append(fValues[i]);
            }
            res.append(";").append(computeSentinelValue());
            res.append("]");
        }
        res.append(" fc=").append(keyString(favoredCoding));
        res.append(" tc=").append(keyString(tokenCoding));
        res.


OZEN : SEALED;
          Handle<AccessorInfo> info =
              Accessors::MakeModuleExport(name, index, attr);
          Handle<Object> result =
              JSObject::SetAccessor(module, info).ToHandleChecked();
          DCHECK(!result->IsUndefined());
          USE(result);
          break;
        }
        case MODULE: {
          Object* referenced_context = Context::cast(host_context)->get(index);
          Handle<JSModule> value(Context::cast(referenced_context)->module());
          JSObject::SetOwnPropertyIgnoreAttributes(module, name, value, FROZEN)
              .Assert();
          break;
        }
        case INTERNAL:
        case TEMPORARY:
        case DYNAMIC:
        case DYNAMIC_GLOBAL:
        case DYNAMIC_LOCAL:
          UNREACHABLE();
      }
    }

    JSObject::PreventExtensions(module).Assert();
  }

  DCHECK(!isolate->has_pending_exception());
  return isolate->heap()->undefined_value();
}

RUNTIME_FUNCTION(Runtime_DeleteLookupSlot) {
  HandleScope scope(isolate);
  DCHECK(args.length() == 2);

  CONVERT_ARG_HANDLE_CHECKED(Context, context, 0);
  CONVERT_ARG_HANDLE_CHECKED(String, name, 1);

  int index;
  PropertyAttributes attributes;
  ContextLookupFlags flags = FOLLOW_CHAINS;
  BindingFlags binding_flags;
  Handle<Object> holder = context->Lookup(name,
                                          flags,
                                          &index,
                                          &attributes,
                                          &binding_flags);

  // If the slot was not found the result is true.
  if (holder.is_null()) {
    return isolate->heap()->true_value();
  }

  // If the slot was found in a context, it should be DONT_DELETE.
  if (holder->IsContext()) {
    return isolate->heap()->false_value();
  }

  // The slot was found in a JSObject, either a context extension object,
  // the global object, or the subject of a with.  Try to delete it
  // (respecting DONT_DELETE).
  Handle<JSObject> object = Handle<JSObject>::cast(holder);
  Handle<Object> result;
  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
      isolate, result,
      JSReceiver::DeleteProperty(object, name));
  return *result;
}

// A mechanism to return a pair of Object pointers in registers (if possible).
// How this is achieved is calling convention-dependent.
// All currently supported x86 compiles uses calling conventions that are cdecl
// variants where a 64-bit value is returned in two 32-bit registers
// (edx:eax on ia32, r1:r0 on ARM).
// In AMD-64 calling convention a struct of two pointers is returned in rdx:rax.
// In Win64 calling convention, a struct of two pointers is returned in memory,
// allocated by the caller, and passed as a pointer in a hidden first parameter.
#ifdef V8_HOST_ARCH_64_BIT
struct ObjectPair {
  Object* x;
  Object* y;
};

static inline ObjectPair MakePair(Object* x, Object* y) {
  ObjectPair result = {x, y};
  // Pointers x and y returned in rax and rdx, in AMD-x64-abi.
  // In Win64 they are assigned to a hidden first argument.
  return result;
}
#elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT
// For x32 a 128-bit struct return is done as rax and rdx from the ObjectPair
// are used in the full codegen and Crankshaft compiler. An alternative is
// using uint64_t and modifying full codegen and Crankshaft compiler.
struct ObjectPair {
  Object* x;
  uint32_t x_upper;
  Object* y;
  uint32_t y_upper;
};

static inline ObjectPair MakePair(Object* x, Object* y) {
  ObjectPair result = {x, 0, y, 0};
  // Pointers x and y returned in ra


ant_,
.theme-base16-tomorrow .hljs-literal {
	color: #f5871f;
}
.theme-base16-tomorrow .hljs-title,
.theme-base16-tomorrow .hljs-class .hljs-title,
.theme-base16-tomorrow .hljs-title.class_ {
	color: #eab700;
}
.theme-base16-tomorrow .hljs-strong {
	font-weight: bold;
	color: #eab700;
}
.theme-base16-tomorrow .hljs-code,
.theme-base16-tomorrow .hljs-addition,
.theme-base16-tomorrow .hljs-title.class_.inherited__,
.theme-base16-tomorrow .hljs-string {
	color: #718c00;
}
.theme-base16-tomorrow .hljs-built_in,
.theme-base16-tomorrow .hljs-doctag,
.theme-base16-tomorrow .hljs-quote,
.theme-base16-tomorrow .hljs-keyword.hljs-atrule,
.theme-base16-tomorrow .hljs-regexp {
	color: #3e999f;
}
.theme-base16-tomorrow .hljs-function .hljs-title,
.theme-base16-tomorrow .hljs-attribute,
.theme-base16-tomorrow .ruby .hljs-property,
.theme-base16-tomorrow .hljs-title.function_,
.theme-base16-tomorrow .hljs-section {
	color: #4271ae;
}
.theme-base16-tomorrow .hljs-type,
.theme-base16-tomorrow .hljs-template-tag,
.theme-base16-tomorrow .diff .hljs-meta,
.theme-base16-tomorrow .hljs-keyword {
	color: #8959a8;
}
.theme-base16-tomorrow .hljs-emphasis {
	color: #8959a8;
	font-style: italic;
}
.theme-base16-tomorrow .hljs-meta,
.theme-base16-tomorrow .hljs-meta .hljs-keyword,
.theme-base16-tomorrow .hljs-meta .hljs-string {
	color: #a3685a;
}
.theme-base16-tomorrow .hljs-meta .hljs-keyword,
.theme-base16-tomorrow .hljs-meta-keyword {
	font-weight: bold;
}
.theme-base16-tomorrow-min {
	/*!
  Theme: Tomorrow
  Author: Chris Kempson (http://chriskempson.com)
  License: ~ MIT (or more permissive) [via base16-schemes-source]
  Maintainer: @highlightjs/core-team
  Version: 2021.09.0
*/
}
.theme-base16-tomorrow-min pre code.hljs {
	display: block;
	overflow-x: auto;
	padding: 1em;
}
.theme-base16-tomorrow-min code.hljs {
	padding: 3px 5px;
}
.theme-base16-tomorrow-min .hljs {
	color: #4d4d4c;
	background: #fff;
}
.theme-base16-tomorrow-min .hljs ::selection,
.theme-base16-tomorrow-min .hljs::selection {
	background-color: #d6d6d6;
	color: #4d4d4c;
}
.theme-base16-tomorrow-min .hljs-comment {
	color: #8e908c;
}
.theme-base16-tomorrow-min .hljs-tag {
	color: #969896;
}
.theme-base16-tomorrow-min .hljs-operator,
.theme-base16-tomorrow-min .hljs-punctuation,
.theme-base16-tomorrow-min .hljs-subst {
	color: #4d4d4c;
}
.theme-base16-tomorrow-min .hljs-operator {
	opacity: 0.7;
}
.theme-base16-tomorrow-min .hljs-bullet,
.theme-base16-tomorrow-min .hljs-de


gabedateiId('dad'),
              0.2,
            ),
          );

          fileView = (await queue.next)!;
          expect(fileView.status, FileViewStatus.uploading);
          expect(fileView.uploadProgress, 0.2);

          uploadProzess.add(
            DateiUploadProzessFortschritt.erfolgreich(
              const AbgabedateiId('dad'),
            ),
          );
          fileView = (await queue.next)!;
          expect(fileView.status, FileViewStatus.successfullyUploaded);
          expect(fileView.uploadProgress, null);

          uploadProzess.add(
            DateiUploadProzessFortschritt.fehlgeschlagen(
              const AbgabedateiId('dad'),
            ),
          );
          fileView = (await queue.next)!;
          expect(fileView.uploadProgress, null);
        },
      );

      test(
        'Gibt die LocalFiles unter der jeweiligen Id an den Speicher weiter',
        () async {
          var abgabedateiId1 = const AbgabedateiId('id1');
          var abgabedateiId2 = const AbgabedateiId('id2');
          var name1 = 'Datei1.pdf';
          var name2 = 'Datei2.pdf';
          fuegeLokaleDateiHinzuUndSetzeId(id: abgabedateiId1, name: name1);
          fuegeLokaleDateiHinzuUndSetzeId(id: abgabedateiId2, name: name2);

          /// Weil in der Methode async Sachen ausgeführt werden müssen wir warten,
          /// bis die Dateien komplett "verarbeitet" wurden.
          await bloc.files.firstWhere((files) => files.length == 2);

          expect(fileSaver.getFile('$abgabedateiId1'), isNotNull);
          expect(fileSaver.getFile('$abgabedateiId2'), isNotNull);
        },
      );

      test(
        'Regressions-Test: Wenn eine Datei bereits hochgeladen wurde, dann sollte bei den anderen nur lokalen, noch am hochladenen Dateien noch der richtige Upload-Fortschritt angezeigt werden',
        () async {
          useCases.abgabe.add(
            erstelleAbgabenModelSnapshot(
              abgegeben: false,
              abgabedateien: [hochgeladeneAbgabedatei(name: 'name.pdf')],
            ),
          );

          var hochladeneDateiName = 'abc.mp3';
          var abgabedateiId = const AbgabedateiId('id2');
          useCases.abgabeprozessFortschrittFuerDateiMitName(
            Stream.value(
              DateiUploadProzessFortschritt.imGange(abgabedateiId, 0.2),
            ),
            hochladeneDateiName,
          );
          fuegeLokaleDateiHinzuUndSetzeId(
            name: hochladeneDateiName,
            id: abgabedateiId,
          );

          expect(
            bloc.files
                .where((files) => files.length == 2)
                .map(
                  (files) =>
                      files
                          .singleWhere((file) => file.name == 'abc.mp3')
                          .status,
                ),
            emitsInOrder([FileViewStatus.unitiated, FileViewStatus.uploading]),
          );
        },
      );

      test(
        'Schreibt hinter den Dateinamen einer Datei "(1)", "(2)" etc, wenn bereits eine lokale oder hochgeladene Datei mit dem selben Namen hinzugefügt wurde',
        () async {
          var abgabedateiId = const AbgabedateiId('id');


_V2_Languagename_Var_Pop_Order_By>
    var_samp?: Maybe<Pokemon_V2_Languagename_Var_Samp_Order_By>
    variance?: Maybe<Pokemon_V2_Languagename_Variance_Order_By>
}

/** aggregate avg on columns */
export type Pokemon_V2_Languagename_Avg_Fields = {
    __typename?: 'pokemon_v2_languagename_avg_fields'
    id?: Maybe<Scalars['Float']>
    language_id?: Maybe<Scalars['Float']>
    local_language_id?: Maybe<Scalars['Float']>
}

/** order by avg() on columns of table "pokemon_v2_languagename" */
export type Pokemon_V2_Languagename_Avg_Order_By = {
    id?: Maybe<Order_By>
    language_id?: Maybe<Order_By>
    local_language_id?: Maybe<Order_By>
}

/** Boolean expression to filter rows from the table "pokemon_v2_languagename". All fields are combined with a logical 'AND'. */
export type Pokemon_V2_Languagename_Bool_Exp = {
    _and?: Maybe<Array<Pokemon_V2_Languagename_Bool_Exp>>
    _not?: Maybe<Pokemon_V2_Languagename_Bool_Exp>
    _or?: Maybe<Array<Pokemon_V2_Languagename_Bool_Exp>>
    id?: Maybe<Int_Comparison_Exp>
    language_id?: Maybe<Int_Comparison_Exp>
    local_language_id?: Maybe<Int_Comparison_Exp>
    name?: Maybe<String_Comparison_Exp>
    pokemonV2LanguageByLocalLanguageId?: Maybe<Pokemon_V2_Language_Bool_Exp>
    pokemon_v2_language?: Maybe<Pokemon_V2_Language_Bool_Exp>
}

/** aggregate max on columns */
export type Pokemon_V2_Languagename_Max_Fields = {
    __typename?: 'pokemon_v2_languagename_max_fields'
    id?: Maybe<Scalars['Int']>
    language_id?: Maybe<Scalars['Int']>
    local_language_id?: Maybe<Scalars['Int']>
    name?: Maybe<Scalars['String']>
}

/** order by max() on columns of table "pokemon_v2_languagename" */
export type Pokemon_V2_Languagename_Max_Order_By = {
    id?: Maybe<Order_By>
    language_id?: Maybe<Order_By>
    local_language_id?: Maybe<Order_By>
    name?: Maybe<Order_By>
}

/** aggregate min on columns */
export type Pokemon_V2_Languagename_Min_Fields = {
    __typename?: 'pokemon_v2_languagename_min_fields'
    id?: Maybe<Scalars['Int']>
    language_id?: Maybe<Scalars['Int']>
    local_language_id?: Maybe<Scalars['Int']>
    name?: Maybe<Scalars['String']>
}

/** order by min() on columns of table "pokemon_v2_languagename" */
export type Pokemon_V2_Languagename_Min_Order_By = {
    id?: Maybe<Order_By>
    language_id?: Maybe<Order_By>
    local_language_id?: Maybe<Order_By>
    name?: Maybe<Order_By>
}

/** Ordering options when selecting data from "pokemon_v2_languagename". */
export type Pokemon_V2_Languagename_Order_By = {
    id?: Maybe<Order_By>
    language_id?: Maybe<Order_By>
    local_language_id?: Maybe<Order_By>
    name?: Maybe<Order_By>
    pokemonV2LanguageByLocalLanguageId?: Maybe<Pokemon_V2_Language_Order_By>
    pokemon_v2_language?:


"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-set"},
"dom-urlsearchparams-set-name-value-name": {"dfnID":"dom-urlsearchparams-set-name-value-name","dfnText":"name","external":false,"refSections":[],"url":"#dom-urlsearchparams-set-name-value-name"},
"dom-urlsearchparams-set-name-value-value": {"dfnID":"dom-urlsearchparams-set-name-value-value","dfnText":"value","external":false,"refSections":[],"url":"#dom-urlsearchparams-set-name-value-value"},
"dom-urlsearchparams-sort": {"dfnID":"dom-urlsearchparams-sort","dfnText":"sort()","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-sort"},{"id":"ref-for-dom-urlsearchparams-sort\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-sort"},
"dom-urlsearchparams-urlsearchparams": {"dfnID":"dom-urlsearchparams-urlsearchparams","dfnText":"new URLSearchParams(init)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-urlsearchparams"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-urlsearchparams"},
"dom-urlsearchparams-urlsearchparams-init-init": {"dfnID":"dom-urlsearchparams-urlsearchparams-init-init","dfnText":"init","external":false,"refSections":[],"url":"#dom-urlsearchparams-urlsearchparams-init-init"},
"double-dot-path-segment": {"dfnID":"double-dot-path-segment","dfnText":"double-dot path segment","external":false,"refSections":[{"refs":[{"id":"ref-for-double-dot-path-segment"},{"id":"ref-for-double-dot-path-segment\u2460"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-double-dot-path-segment\u2461"}],"title":"4.4. URL parsing"}],"url":"#double-dot-path-segment"},
"e5fc5b88": {"dfnID":"e5fc5b88","dfnText":"strictly split","external":true,"refSections":[{"refs":[{"id":"ref-for-strictly-split"}],"title":"3.5. Host parsing"}],"url":"https://infra.spec.whatwg.org/#strictly-split"},
"ef301390": {"dfnID":"ef301390","dfnText":"blob URL entry","external":true,"refSections":[{"refs":[{"id":"ref-for-blob-url-entry"}],"title":"4.1. URL representation"}],"url":"https://w3c.github.io/FileAPI/#blob-url-entry"},
"empty-host": {"dfnID":"empty-host","dfnText":"empty host","external":false,"refSections":[{"refs":[{"id":"ref-for-empty-host"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-empty-host\u2460"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-empty-host\u2461"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-empty-host\u2462"},{"id":"ref-for-empty-host\u2463"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-empty-host\u2464"}],"title":"4.4. URL parsing"}],"url":"#empty-host"},
"eof-code-point": {"dfnID":"eof-code-point","dfnText":"EOF code point","external":false,"refSections":[{"refs":[{"id":"ref-for-eof-code-point"},{"id":"ref-for-eof-code-point\u2460"},{"id":"ref-for-eof-code-point\u2461"}],"title":"1.2.


import time

def operate(a, b, x, y):
    x_prime = a * x + b * y
    y_prime = a * x - b * y
    return x_prime, y_prime

prompt_a = ""
prompt_b = ""
prompt_x = ""
prompt_y = ""
error_msg = ""
repeat_msg = ""
invalid_choice_msg = ""

def main():
    global prompt_a, prompt_b, prompt_x, prompt_y, error_msg, repeat_msg, invalid_choice_msg
    language = input("Please select language: Press 1 for English, Press 2 for Chinese(Entering another number will exit):")

    if language == "1":
        print("Welcome to this calculator!")
        prompt_a = "Please enter the value of a: "
        prompt_b = "Please enter the value of b: "
        prompt_x = "Please enter the value of x: "
        prompt_y = "Please enter the value of y: "
        error_msg = "Unable to perform calculation, please enter different values!"
        repeat_msg = "Press 1 to perform another calculation, or any other key to exit: "
        invalid_choice_msg = "Invalid language selection. Exiting in 3 seconds..."

    elif language == "2":
        print("欢迎使用本计算器！")
        prompt_a = "请输入a的值："
        prompt_b = "请输入b的值："
        prompt_x = "请输入x的值："
        prompt_y = "请输入y的值："
        error_msg = "无法运算，请输入其他数值！"
        repeat_msg = "按数字1键决定是否要再来一遍运算๑（按其他键退出）："
        invalid_choice_msg = "无效的语言选择。3秒后退出..."

    else:
        print(invalid_choice_msg)
        time.sleep(2)
        return

    while True:
        a = input(prompt_a)
        b = input(prompt_b)
        x = input(prompt_x)
        y = input(prompt_y)

        try:
            a = float(a)
            b = float(b)
            x = float(x)
            y = float(y)

            x_prime, y_prime = operate(a, b, x, y)
            print(f"Result: ({x_prime}, {y_prime})")

            choice = input(repeat_msg)
            if choice != '1':
                break

        except ValueError:
            print(error_msg)
            continue

if __name__ == "__main__":
    main()


lesImpl()
        if (json is JsonValue.Object && json.entries.isNotEmpty()) {
          if (json.entries.keys.first().startsWith("$")) {
            matchingRules.fromV2Json(json)
          } else {
            matchingRules.fromV3Json(json)
          }
        } else logger.warn { "$json is not valid matching rules format" }
        return matchingRules
      }
    }

  private fun addRules(categoryName: String, matcherDef: JsonValue) {
    addCategory(categoryName).fromJson(matcherDef)
  }

    private fun toV2Map(): Map<String, Any?> {
        val result = mutableMapOf<String, Any?>()
        rules.forEach { entry ->
            entry.value.toMap(PactSpecVersion.V2).forEach {
                result[it.key] = it.value
            }
        }
        return result
    }

    private fun addV2Rule(categoryName: String, item: String?, matcher: Map<String, Any?>) {
        val category = addCategory(categoryName)
        if (item != null) {
            category.addRule(item, MatchingRule.fromJson(Json.toJson(matcher)))
        } else {
            category.addRule(MatchingRule.fromJson(Json.toJson(matcher)))
        }
    }
}
package au.com.dius.pact.core.model.matchingrules.expressions

import au.com.dius.pact.core.model.generators.Generator
import au.com.dius.pact.core.model.matchingrules.MatchingRule
import au.com.dius.pact.core.support.Either
import au.com.dius.pact.core.support.Result
import au.com.dius.pact.core.support.expressions.DataType
import au.com.dius.pact.core.support.isNotEmpty
import io.github.oshai.kotlinlogging.KLogging

data class MatchingReference(
  val name: String
)

enum class ValueType {
  Unknown,
  String,
  Number,
  Integer,
  Decimal,
  Boolean;

  fun merge(valueType: ValueType): ValueType {
    return when (this) {
      String -> String
      Number -> when (valueType) {
        Number, Boolean, Unknown -> Number
        Integer -> Integer
        Decimal -> Decimal
        String -> String
      }
      Integer -> when (valueType) {
        Number, Integer, Boolean -> Integer
        Decimal -> Decimal
        String -> String
        Unknown -> Integer
      }
      Decimal -> when (valueType) {
        Number, Integer, Boolean -> Decimal
        Decimal -> Decimal
        String -> String
        Unknown -> Decimal
      }
      Boolean -> when (valueType) {
        Number -> Number
        Integer -> Integer
        Decimal -> Decimal
        String -> String
        Unknown, Boolean -> Boolean
      }
      Unknown -> valueType
    }
  }

  fun toDataType(): DataType {
    return when (this) {
      Unknown -> DataType.RAW
      String -> DataType.STRING
      Number -> DataType.DECIMAL
      Integer -> DataType.INTEGER
      Decimal -> DataType.DECIMAL
      Boolean -> DataType.BOOLEAN
    }
  }
}

data class MatchingRuleDefinition(
  val value: String?,
  val valueType: ValueType,
  val rules: List<Either<MatchingRule, MatchingReference>>,
  val generator: Generator?
) {
  constructor(
    value: String?,
    rule: MatchingRule?,
    generator: Generator?
  ): this(
    value,
    ValueType.Unknown,
    if (rule != null) listOf(Either.A(rule)) else emptyList(),
    generator
  )

  constructor(
    value: String?,
    rule: MatchingReference,
    generator: Generator?
  ): this(
    value,
    ValueType.Unknown,
    listOf(Either.B(rule)),
    generator
  )

  /**


rGuide(
  'Leveling Guides\\Class Quests\\Warrior',
  {
    description = 'This guide will walk you through completing various Warrior Class Quests.',
  },
  [[
step
ding 10
step
talk Lyria Du Lac##913
accept A Warrior's Training##1638 |goto Elwynn Forest 41.09,65.77 |or
'|complete completedq(1679) |or
|only if Human Warrior
step
Enter the building |goto Stormwind City 71.60,39.93 < 7 |walk
talk Harry Burlguard##6089
|tip Inside the building.
turnin A Warrior's Training##1638 |goto Stormwind City 74.25,37.26
accept Bartleby the Drunk##1639 |goto Stormwind City 74.25,37.26 |or
'|complete completedq(1678) |or
|only if Human Warrior
step
talk Bartleby##6090
|tip He walks around this area inside the building.
turnin Bartleby the Drunk##1639 |goto Stormwind City 73.83,37.17
accept Beat Bartleby##1640 |goto Stormwind City 73.83,37.17 |or
'|complete completedq()
|tip He will attack you immediately after you accept this quest.
|only if Human Warrior
step
talk Bartleby##6090
|tip He walks around this area inside the building.
turnin Beat Bartleby##1640 |goto Stormwind City 73.83,37.17
accept Bartleby's Mug##1665 |goto Stormwind City 73.83,37.17
|only if Human Warrior
step
talk Harry Burlguard##6089
|tip Inside the building.
turnin Bartleby's Mug##1665 |goto Stormwind City 74.25,37.26
|only if Human Warrior
step
talk Granis Swiftaxe##1229
|tip Inside the building.
accept Muren Stormpike##1679 |goto Dun Morogh 47.36,52.65 |or
'|complete completedq(1638) |or
|only if (Dwarf Warrior) or (Gnome Warrior)
step
talk Muren Stormpike##6114
|tip Upstairs inside the building.
turnin Muren Stormpike##1679 |goto Ironforge 70.78,90.27
accept Vejrek##1678 |goto Ironforge 70.78,90.27 |or
'|complete completedq(1665) |or
|only if (Dwarf Warrior) or (Gnome Warrior)
step
Follow the path up |goto Dun Morogh 27.97,56.18 < 20 |only if walking
kill Vejrek##6113
|tip Inside the hut.
collect Vejrek's Head##6799 |q 1678/1 |goto Dun Morogh 27.83,57.95 |or
'|complete completedq(1665)
|only if (Dwarf Warrior) or (Gnome Warrior)
step
talk Muren Stormpike##6114
|tip Upstairs inside the building.
turnin Vejrek##1678 |goto Ironforge/0 70.78,90.29 |or
'|complete completedq(1665)
|only if (Dwarf Warrior) or (Gnome Warrior)
step
talk Kyra Windblade##3598
accept Elanaria##1684 |goto Teldrassil 56.22,59.19
|only if NightElf Warrior
step
talk Elanaria##4088
turnin Elanaria##1684 |goto Darnassus 57.29,34.61
accept Vorlus Vilehoof##1683 |goto Darnassus 57.29,34.61
|only if NightElf Warrior
step
Follow the path |goto Teldrassil 48.78,61.64
Follow the path up |goto Teldrassil 49.02,63.24
Continue up the path |goto Teldrassil 47.98,64.47
kill Vorlus Vilehoof##6128
collect Horn of Vorlus##6805 |q 1683/1 |goto Teldrassil 47.26,63.52
|only if NightElf Warrior
step
talk Elanaria##4088
turnin Vorlus Vilehoof##1683 |goto Darnassus 57.29,34.61
|only if NightElf Warrior
step
ding 30
step
_NOTE:_
Incoming Difficult Quest
|tip You're going to be tasked with surviving


nna party!",
                "author": "25 Cent",
                "date": "2011-12-02T17:57:28.556094Z"
            },
            {
                "author": "juan",
                "comment": "ghj ghg hjg hhh hhh hhgjg",
                "rating": 4,
                "date": "2017-12-18T03:33:56.880Z"
            },
            {
                "author": "huyuyu",
                "comment": "ghgg hghhhghgh hghgjg",
                "rating": 3,
                "date": "2017-12-18T03:36:25.655Z"
            },
            {
                "author": "ssssssssss",
                "comment": "dfsdf sdf  sdfds fsd fsd fsd df sd ffff",
                "rating": 2,
                "date": "2017-12-18T03:38:48.914Z"
            },
            {
                "author": "jorge",
                "comment": "me parece mas o menos",
                "rating": 1,
                "date": "2017-12-18T03:41:49.173Z"
            }
        ]
    },
    {
        "id": 1,
        "name": "Zucchipakoda",
        "image": "images/zucchipakoda.png",
        "category": "appetizer",
        "label": "",
        "price": "1.99",
        "featured": false,
        "description": "Deep fried Zucchini coated with mildly spiced Chickpea flour batter accompanied with a sweet-tangy tamarind sauce",
        "comments": [
            {
                "rating": 5,
                "comment": "Imagine all the eatables, living in conFusion!",
                "author": "John Lemon",
                "date": "2012-10-16T17:57:28.556094Z"
            },
            {
                "rating": 4,
                "comment": "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
                "author": "Paul McVites",
                "date": "2014-09-05T17:57:28.556094Z"
            },
            {
                "rating": 3,
                "comment": "Eat it, just eat it!",
                "author": "Michael Jaikishan",
                "date": "2015-02-13T17:57:28.556094Z"
            },
            {
                "rating": 4,
                "comment": "Ultimate, Reaching for the stars!",
                "author": "Ringo Starry",
                "date": "2013-12-02T17:57:28.556094Z"
            },
            {
                "rating": 2,
                "comment": "It's your birthday, we're gonna party!",
                "author": "25 Cent",
                "date": "2011-12-02T17:57:28.556094Z"
            }
        ]
    },
    {
        "id": 2,
        "name": "Vadonut",
        "image": "images/vadonut.png",
        "category": "appetizer",
        "label": "New",
        "price": "1.99",
        "featured": false,
        "description": "A quintessential ConFusion experience, is it a vada or is it a donut?",
        "comments": [
            {
                "rating": 5,
                "comment": "Imagine all the eatables, living in conFusion!",
                "author": "John Lemon",
                "date": "2012-10-16T17:57:28.556094Z"
            },
            {
                "rating": 4,
                "comment": "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
                "author": "Paul McVites",
                "date": "2014-09-05T17:57:28.556094Z"
            },
            {
                "rating": 3,
                "comment": "Eat


  using Stat = struct stat;
  Stat file_stat = Stat();
  if (FMT_POSIX_CALL(fstat(fd_, &file_stat)) == -1)
    FMT_THROW(system_error(errno, FMT_STRING("cannot get file attributes")));
  static_assert(sizeof(long long) >= sizeof(file_stat.st_size),
                "return type of file::size is not large enough");
  return file_stat.st_size;
#  endif
}

std::size_t file::read(void* buffer, std::size_t count) {
  rwresult result = 0;
  FMT_RETRY(result, FMT_POSIX_CALL(read(fd_, buffer, convert_rwcount(count))));
  if (result < 0)
    FMT_THROW(system_error(errno, FMT_STRING("cannot read from file")));
  return detail::to_unsigned(result);
}

std::size_t file::write(const void* buffer, std::size_t count) {
  rwresult result = 0;
  FMT_RETRY(result, FMT_POSIX_CALL(write(fd_, buffer, convert_rwcount(count))));
  if (result < 0)
    FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
  return detail::to_unsigned(result);
}

file file::dup(int fd) {
  // Don't retry as dup doesn't return EINTR.
  // http://pubs.opengroup.org/onlinepubs/009695399/functions/dup.html
  int new_fd = FMT_POSIX_CALL(dup(fd));
  if (new_fd == -1)
    FMT_THROW(system_error(
        errno, FMT_STRING("cannot duplicate file descriptor {}"), fd));
  return file(new_fd);
}

void file::dup2(int fd) {
  int result = 0;
  FMT_RETRY(result, FMT_POSIX_CALL(dup2(fd_, fd)));
  if (result == -1) {
    FMT_THROW(system_error(
        errno, FMT_STRING("cannot duplicate file descriptor {} to {}"), fd_,
        fd));
  }
}

void file::dup2(int fd, std::error_code& ec) noexcept {
  int result = 0;
  FMT_RETRY(result, FMT_POSIX_CALL(dup2(fd_, fd)));
  if (result == -1) ec = std::error_code(errno, std::generic_category());
}

buffered_file file::fdopen(const char* mode) {
// Don't retry as fdopen doesn't return EINTR.
#  if defined(__MINGW32__) && defined(_POSIX_)
  FILE* f = ::fdopen(fd_, mode);
#  else
  FILE* f = FMT_POSIX_CALL(fdopen(fd_, mode));
#  endif
  if (!f) {
    FMT_THROW(system_error(
        errno, FMT_STRING("cannot associate stream with file descriptor")));
  }
  buffered_file bf(f);
  fd_ = -1;
  return bf;
}

#  if defined(_WIN32) && !defined(__MINGW32__)
file file::open_windows_file(wcstring_view path, int oflag) {
  int fd = -1;
  auto err = _wsopen_s(&fd, path.c_str(), oflag, _SH_DENYNO, default_open_mode);
  if (fd == -1) {
    FMT_THROW(system_error(err, FMT_STRING("cannot open file {}"),
                           detail::to_utf8<wchar_t>(path.c_str()).c_str()));
  }
  return file(fd);
}
#  endif

pipe::pipe() {
  int fds[2] = {};
#  ifdef _WIN32
  // Make the default pipe capacity same as on Linux 2.6.11+.
  enum { DEFAULT_CAPACITY = 65536 };
  int result = FMT_POSIX_CALL(pipe(fds, DEFAUL


#include <rhock/native.h>

// Leds
RHOCK_NATIVE_DECLARE(robot_led, 30);
RHOCK_NATIVE_DECLARE(robot_leds, 31);
RHOCK_NATIVE_DECLARE(robot_leg_leds, 32);

// Moves
RHOCK_NATIVE_DECLARE(robot_control, 40);
RHOCK_NATIVE_DECLARE(robot_h, 41);
RHOCK_NATIVE_DECLARE(robot_f, 42);
RHOCK_NATIVE_DECLARE(robot_r, 43);
RHOCK_NATIVE_DECLARE(robot_reset, 45);
RHOCK_NATIVE_DECLARE(robot_ex, 46);
RHOCK_NATIVE_DECLARE(robot_ey, 47);
RHOCK_NATIVE_DECLARE(robot_ez, 44);
RHOCK_NATIVE_DECLARE(robot_ea, 48);

// Speed
RHOCK_NATIVE_DECLARE(robot_stop, 50);
RHOCK_NATIVE_DECLARE(robot_x_speed, 51);
RHOCK_NATIVE_DECLARE(robot_y_speed, 52);
RHOCK_NATIVE_DECLARE(robot_turn_speed, 53);

// Distances sensor
RHOCK_NATIVE_DECLARE(robot_dist, 54);

// Distances
RHOCK_NATIVE_DECLARE(robot_turn, 60);
RHOCK_NATIVE_DECLARE(robot_move_x, 61);
RHOCK_NATIVE_DECLARE(robot_move_y, 62);

// Buzzer
RHOCK_NATIVE_DECLARE(robot_beep, 55);

// IMU
RHOCK_NATIVE_DECLARE(robot_yaw, 33);
RHOCK_NATIVE_DECLARE(robot_pitch, 34);
RHOCK_NATIVE_DECLARE(robot_roll, 35);

// Motors control
RHOCK_NATIVE_DECLARE(robot_motor_start, 37);
RHOCK_NATIVE_DECLARE(robot_motor_stop, 38);
RHOCK_NATIVE_DECLARE(robot_motor_position, 39);

// Controls
RHOCK_NATIVE_DECLARE(robot_get_control, 58);


iX;
        int roiY = refFloatProcessor.roiY;
        int width = refFloatProcessor.getWidth();
        int height = refFloatProcessor.getHeight();

        //convolve 3x3
        testFloatProcessor.convolve(kernel, width, height);

        float v1, v2, v3;           //input pixel values around the current pixel
        float v4, v5, v6;
        float v7, v8, v9;

        float scale = 0f;

        float k1 = kernel[0];
        float k2 = kernel[1];
        float k3 = kernel[2];
        float k4 = kernel[3];
        float k5 = kernel[4];
        float k6 = kernel[5];
        float k7 = kernel[6];
        float k8 = kernel[7];
        float k9 = kernel[8];
        for (int i = 0; i < kernel.length; i++)
            scale += kernel[i];
        if (scale == 0) scale = 1f;
        scale = 1f / scale; //multiplication factor (multiply is faster than divide)

        float[] pixels2 = (float[]) refFloatProcessor.getPixelsCopy();
        //float[] pixels2 = (float[])getPixelsCopy();
        int xEnd = roiX + roiWidth;
        int yEnd = roiY + roiHeight;
        for (int y = roiY; y < yEnd; y++) {
            int p = roiX + y * width;            //points to current pixel
            int p6 = p - (roiX > 0 ? 1 : 0);      //will point to v6, currently lower
            int p3 = p6 - (y > 0 ? width : 0);    //will point to v3, currently lower
            int p9 = p6 + (y < height - 1 ? width : 0); // ...  to v9, currently lower
            v2 = pixels2[p3];
            v5 = pixels2[p6];
            v8 = pixels2[p9];
            if (roiX > 0) {
                p3++;
                p6++;
                p9++;
            }
            v3 = pixels2[p3];
            v6 = pixels2[p6];
            v9 = pixels2[p9];

            for (int x = roiX; x < xEnd; x++, p++) {
                if (x < width - 1) {
                    p3++;
                    p6++;
                    p9++;
                }
                v1 = v2;
                v2 = v3;
                v3 = pixels2[p3];
                v4 = v5;
                v5 = v6;
                v6 = pixels2[p6];
                v7 = v8;
                v8 = v9;
                v9 = pixels2[p9];
                float sum = k1 * v1 + k2 * v2 + k3 * v3
                        + k4 * v4 + k5 * v5 + k6 * v6
                        + k7 * v7 + k8 * v8 + k9 * v9;
                sum *= scale;
                refFloatProcessor.setf(x, y, sum);
            }
        }  //end perform reference 3x3

        //test the two arrays are the same
        //test each Pixel Value
          for(int i = 0; i<refFloatProcessor.height; i++)
          {
              for(int j = 0; j<refFloatProcessor.width; j++)
              {
                  //check the result
                  assertEquals(refFloatProcessor.getPixelValue(j,i), testFloatProcessor.getPixelValue(j,i), Float.MAX_VALUE );
              }
          }
	}
}
/*
 * #%L
 * ImageJ2 software for multidimensional image processing and analysis.
 * %%
 * Copyright (C) 2014 - 2024 ImageJ2 developers.
 * %%
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY E


字军武器库",
		[23805] = "荣耀之墓",
		[24000] = "遗忘回廊",
		[26104] = "铁甲湾",
		[26642] = "黑手大厅",
		[26662] = "禁锢之厅",
		[26666] = "孵化间",
		[26668] = "龙塔大厅",
		[26670] = "黑石竞技场",
		[26683] = "霍德玛尔城",
		[26684] = "熔炉",
		[26686] = "蛛网隧道",
		[26688] = "塔萨洛尔",
		[26711] = "哈雷肯之巢",
		[26713] = "摩多姆",
		[26715] = "尖塔王座",
		[26718] = "战斗之厅",
		[26733] = "禁闭室",
		[26735] = "秩序大厅",
		[26740] = "东区兵营",
		[26742] = "秩序竞技场",
		[26745] = "索瑞森神殿",
		[26747] = "黑铁大道",
		[26749] = "西区兵营",
		[26750] = "暗炉城",
		[26751] = "黑铁酒吧",
		[26755] = "住宅区",
		[26758] = "黑色宝库",
		[26759] = "工艺之厅",
		[26761] = "魔法之厅",
		[26764] = "浇铸间",
		[26765] = "熔火之桥",
		[26766] = "讲学厅",
		[26768] = "钢铁大厅",
		[26769] = "帝王之座",
		[26781] = "制造厂",
		[26784] = "召唤者之墓",
		[32277] = "市场区",
		[32281] = "节日小道",
		[32285] = "国王广场",
		[32301] = "屠杀广场",
		[32303] = "街巷",
		[32319] = "十字军广场",
		[32320] = "血色十字军堡垒",
		[32322] = "阿隆索斯礼拜堂",
		[32331] = "圣光大厅",
		[32342] = "长者广场",
		[32344] = "安诺通灵塔",
		[32345] = "贝拉通灵塔",
		[32349] = "卡达通灵塔",
		[32352] = "屠宰房",
		[32357] = "物资库",
		[32367] = "赤色王座",
		[32528] = "仓库",
		[32549] = "巴罗夫家族宝库",
		[32565] = "谴责之厅",
		[32566] = "秘密之厅",
		[32567] = "巫师会所",
		[32568] = "暗影墓穴",
		[32569] = "掠夺者灵堂",
		[32573] = "遗骨之穴",
		[32574] = "召唤大厅",
		[32576] = "观察室",
		[32577] = "尸骨储藏所",
		[32579] = "实验室",
		[32581] = "院长的书房",
		[33710] = "扭木广场",
		[33730] = "艾德雷斯神殿",
		[33748] = "图书馆",
		[33749] = "伊莫塔尔的牢笼",
		[33750] = "上层精灵庭院",
		[33774] = "戈多克的王座",
		[33775] = "毁灭大厅",
		[34776] = "温室",
	}
elseif LOCALE == "esES" then
	SUB_L = {
		[15285] = "Caverna Vaharada",
		[15292] = "Que


#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <fcntl.h>
#include <unistd.h>

#include "Evas.h"
#include "Evas_Engine_Buffer.h"
#include "evas_bench.h"

static const char *
_test_image_get(const char *name)
{
   static char filename[PATH_MAX];

   snprintf(filename, PATH_MAX, TESTS_SRC_DIR"/images/%s", name);

   return filename;
}

static Evas *
_setup_evas()
{
   Evas *evas;
   Evas_Engine_Info_Buffer *einfo;

   evas = evas_new();

   evas_output_method_set(evas, evas_render_method_lookup("buffer"));
   einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(evas);

   einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
   einfo->info.dest_buffer = malloc(sizeof (char) * 500 * 500 * 4);
   einfo->info.dest_buffer_row_bytes = 500 * sizeof (char) * 4;

   evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);

   evas_output_size_set(evas, 500, 500);
   evas_output_viewport_set(evas, 0, 0, 500, 500);

   return evas;
}

static void
evas_bench_saver_tgv(int request)
{
   Evas *e = _setup_evas();
   const char *source;
   Eina_Tmpstr *dest;
   Evas_Object *o;
   int fd;
   int i;

   source = _test_image_get("mars_rover_panorama_half-size.jpg");
   fd = eina_file_mkstemp("evas_saver_benchXXXXXX.tgv", &dest);
   if (fd < 0) return;
   close(fd);

   o = evas_object_image_add(e);
   evas_object_image_file_set(o, source, NULL);

   for (i = 0; i < request; i++)
     {
        evas_object_image_save(o, dest, NULL, "compress=1 quality=50");
     }

   unlink(dest);
   eina_tmpstr_del(dest);

   evas_free(e);
}

void evas_bench_saver(Eina_Benchmark *bench)
{
   eina_benchmark_register(bench, "tgv-saver", EINA_BENCHMARK(evas_bench_saver_tgv), 20, 2000, 100);
}