text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="path_to_url" xmlns:app="path_to_url" xmlns:tools="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="com.sendtion.xrichtextdemo.ui.NewActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar_new" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_new" /> </android.support.design.widget.CoordinatorLayout> ```
/content/code_sandbox/app/src/main/res/layout/activity_new.xml
xml
2016-10-26T01:13:05
2024-08-12T07:10:08
XRichText
sendtion/XRichText
1,760
222
```xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="path_to_url" xmlns:tools="path_to_url" android:id="@+id/widget_clock_day" android:layout_width="match_parent" android:layout_height="match_parent" tools:background="@android:color/black"> <ImageView android:id="@+id/widget_clock_day_card" style="@style/widget_background_card" tools:ignore="ContentDescription" /> <LinearLayout android:id="@+id/widget_clock_day_weather" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" android:orientation="vertical" android:gravity="center_horizontal"> <RelativeLayout android:id="@+id/widget_clock_day_clock_lightContainer" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextClock android:id="@+id/widget_clock_day_clock_1_light" android:textSize="64sp" android:textAlignment="center" android:format24Hour="HH" android:format12Hour="hh" android:fontFamily="sans-serif-light" android:layout_marginTop="-8dp" android:layout_centerHorizontal="true" style="@style/widget_text_clock" tools:text="09" /> <TextClock android:id="@+id/widget_clock_day_clock_2_light" android:textSize="64sp" android:textAlignment="center" android:format24Hour="mm" android:format12Hour="mm" android:fontFamily="sans-serif-light" android:layout_marginTop="-16dp" android:layout_marginBottom="-4dp" android:layout_centerHorizontal="true" android:layout_below="@id/widget_clock_day_clock_1_light" style="@style/widget_text_clock" tools:text="10" /> </RelativeLayout> <RelativeLayout android:id="@+id/widget_clock_day_clock_normalContainer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" tools:visibility="visible"> <TextClock android:id="@+id/widget_clock_day_clock_1_normal" android:textSize="64sp" android:textAlignment="center" android:format24Hour="HH" android:format12Hour="hh" android:layout_marginTop="-8dp" android:layout_centerHorizontal="true" style="@style/widget_text_clock" tools:text="09" /> <TextClock android:id="@+id/widget_clock_day_clock_2_normal" android:textSize="64sp" android:textAlignment="center" android:format24Hour="mm" android:format12Hour="mm" android:layout_marginTop="-16dp" android:layout_marginBottom="-4dp" android:layout_centerHorizontal="true" android:layout_below="@id/widget_clock_day_clock_1_normal" style="@style/widget_text_clock" tools:text="10" /> </RelativeLayout> <RelativeLayout android:id="@+id/widget_clock_day_clock_blackContainer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" tools:visibility="visible"> <TextClock android:id="@+id/widget_clock_day_clock_1_black" android:textSize="64sp" android:textAlignment="center" android:format24Hour="HH" android:format12Hour="hh" android:fontFamily="sans-serif-black" android:layout_marginTop="-8dp" android:layout_centerHorizontal="true" style="@style/widget_text_clock" tools:text="09" /> <TextClock android:id="@+id/widget_clock_day_clock_2_black" android:textSize="64sp" android:textAlignment="center" android:format24Hour="mm" android:format12Hour="mm" android:fontFamily="sans-serif-black" android:layout_marginTop="-16dp" android:layout_marginBottom="-4dp" android:layout_centerHorizontal="true" android:layout_below="@id/widget_clock_day_clock_1_black" style="@style/widget_text_clock" tools:text="10" /> </RelativeLayout> <RelativeLayout android:id="@+id/widget_clock_day_clock_analogContainer_auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" tools:visibility="visible"> <AnalogClock android:id="@+id/widget_clock_day_clock_analog_auto" android:layout_margin="@dimen/little_margin" android:layout_centerInParent="true" style="@style/widget_text_clock_analog" tools:ignore="RelativeOverlap,RtlHardcoded" /> </RelativeLayout> <RelativeLayout android:id="@+id/widget_clock_day_clock_analogContainer_light" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" tools:visibility="visible"> <AnalogClock android:id="@+id/widget_clock_day_clock_analog_light" android:layout_margin="@dimen/little_margin" android:layout_centerInParent="true" style="@style/widget_text_clock_analog.Light" tools:ignore="RelativeOverlap,RtlHardcoded" /> </RelativeLayout> <RelativeLayout android:id="@+id/widget_clock_day_clock_analogContainer_dark" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" tools:visibility="visible"> <AnalogClock android:id="@+id/widget_clock_day_clock_analog_dark" android:layout_margin="@dimen/little_margin" android:layout_centerInParent="true" style="@style/widget_text_clock_analog.Dark" tools:ignore="RelativeOverlap,RtlHardcoded" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/widget_clock_day_icon" android:layout_width="@dimen/widget_standard_weather_icon_size" android:layout_height="@dimen/widget_standard_weather_icon_size" android:layout_centerHorizontal="true" android:src="@drawable/weather_cloudy" tools:ignore="ContentDescription" /> <TextView android:id="@+id/widget_clock_day_title" android:text="@string/ellipsis" android:textSize="@dimen/widget_content_text_size" android:layout_centerHorizontal="true" android:layout_below="@id/widget_clock_day_icon" android:layout_marginTop="2dp" style="@style/widget_content_text" tools:text="Overcast 23" tools:ignore="RtlHardcoded" /> <TextView android:id="@+id/widget_clock_day_time" android:text="@string/wait_refresh" android:textSize="@dimen/widget_time_text_size" android:textAlignment="center" android:layout_centerHorizontal="true" android:layout_below="@id/widget_clock_day_title" android:layout_marginTop="2dp" style="@style/widget_content_text" tools:text="San Francisco WEN 19:36" tools:ignore="RtlHardcoded" /> </RelativeLayout> </LinearLayout> </RelativeLayout> ```
/content/code_sandbox/app/src/main/res/layout/widget_clock_day_vertical_card.xml
xml
2016-02-21T04:39:19
2024-08-16T13:35:51
GeometricWeather
WangDaYeeeeee/GeometricWeather
2,420
1,603
```xml import {cleanObject} from "@tsed/core"; import isMatch from "lodash/isMatch"; import low from "lowdb"; import {v4 as uuid} from "uuid"; import {Adapter} from "../domain/Adapter.js"; export interface AdapterModel { _id: string; expires_at?: Date; [key: string]: any; } export class LowDbAdapter<T extends AdapterModel> extends Adapter<T> { protected db: low.LowdbSync<{collection: T[]}>; get collection() { return this.db.get("collection"); } protected get dbFilePath() { const lowdbDir = this.configuration.get("adapters.lowdbDir", ".db"); return `${lowdbDir}/${this.collectionName}.json`; } public async create(payload: Partial<T>, expiresAt?: Date): Promise<T> { if (expiresAt) { payload.expires_at = expiresAt; } payload._id = uuid(); await this.validate(payload as T); await this.collection.push(this.serialize(payload) as T).write(); return this.deserialize(payload); } public async upsert(id: string, payload: T, expiresAt?: Date): Promise<T> { let item = await this.findById(id); if (!item) { payload._id = id || uuid(); await this.validate(payload as T); const item = this.serialize(payload); item.expires_at = expiresAt; await this.collection.push(item).write(); return this.deserialize(payload); } return (await this.update(id, payload, expiresAt)) as T; } update(id: string, payload: T, expiresAt?: Date): Promise<T | undefined> { return this.updateOne({_id: id}, payload, expiresAt); } public async updateOne(predicate: Partial<T & any>, payload: T, expiresAt?: Date): Promise<T | undefined> { let index = this.collection.findIndex(cleanObject(predicate)).value(); if (index === -1) { return; } let item = this.deserialize(this.collection.get(index).value()); Object.assign(item, payload, {_id: item._id}); await this.validate(item as T); item.expires_at = expiresAt || item.expires_at; await this.collection.set(index, item).write(); return this.deserialize(item); } findOne(predicate: Partial<T & any>): Promise<T | undefined> { const item = this.collection.find(cleanObject(predicate)).value(); return this.deserialize(item); } findById(_id: string): Promise<T | undefined> { return this.findOne({_id}); } public findAll(predicate: Partial<T & any> = {}): Promise<T[]> { return Promise.resolve( this.collection .filter(cleanObject(predicate)) .value() .map((item) => this.deserialize(item)) ); } public deleteOne(predicate: Partial<T & any>): Promise<T | undefined> { const item = this.collection.find(cleanObject(predicate)).value(); if (item) { this.collection.remove(({_id}) => _id === item._id).write(); return Promise.resolve(this.deserialize(item)); } return Promise.resolve(undefined); } public deleteById(_id: string): Promise<T | undefined> { return this.deleteOne({_id} as any); } public async deleteMany(predicate: Partial<T>): Promise<T[]> { let removedItems: T[] = []; await this.collection .remove((item) => { if (isMatch(item, cleanObject(predicate))) { removedItems.push(this.deserialize(item)); return true; } return false; }) .write(); return removedItems; } } ```
/content/code_sandbox/packages/orm/adapters/src/adapters/LowDbAdapter.ts
xml
2016-02-21T18:38:47
2024-08-14T21:19:48
tsed
tsedio/tsed
2,817
787
```xml // this import should be first in order to load some required settings (like globals and reflect-metadata) import { platformNativeScript } from 'nativescript-angular/platform-static'; import { NativeModuleNgFactory } from './native.module.ngfactory'; import { enableProdMode } from '@angular/core'; enableProdMode(); platformNativeScript().bootstrapModuleFactory(NativeModuleNgFactory); ```
/content/code_sandbox/nativescript/src/app.aot.ts
xml
2016-01-27T07:12:46
2024-08-15T11:32:04
angular-seed-advanced
NathanWalker/angular-seed-advanced
2,261
78
```xml /*! */ // tslint:disable:no-console // tslint:disable:no-object-literal-type-assertion import * as fs from 'fs-extra' import * as glob from 'globby' import 'mocha' import * as ppath from 'path' import * as os from 'os' import * as assert from 'assert' import * as gen from '../src/dialogGenerator' import {compareToOracle} from './generate.test' type Diff = { file: string, position: number } type Comparison = { original: string, originalFiles: string[], originalOnly: string[], merged: string, mergedFiles: string[], mergedOnly: string[], same: string[], different: Diff[] } function filePaths(files: string[], base: string): string { return files.map(f => ppath.resolve(base, f)).join('\n ') } function displayCompare(comparison: Comparison) { console.log(`Compare ${comparison.original} to ${comparison.merged}`) console.log(` originalOnly:\n ${filePaths(comparison.originalOnly, comparison.original)}`) console.log(` mergedOnly:\n ${filePaths(comparison.mergedOnly, comparison.merged)}`) console.log(` same:\n ${comparison.same.join('\n ')}`) console.log(` different:\n ${comparison.different.map(d => `${d.position}: ${ppath.resolve(comparison.original, d.file)} != ${ppath.resolve(comparison.merged, d.file)}`).join('\n ')}`) } function assertCheck(comparison: Comparison, errors: string[]) { if (errors.length > 0) { displayCompare(comparison) assert.fail(os.EOL + errors.join(os.EOL)) } } async function allFiles(base: string, path: string, files: Set<string>) { const stats = await fs.lstat(path) if (stats.isDirectory()) { for (const child of await fs.readdir(path)) { await allFiles(base, ppath.join(path, child), files) } } else { files.add(ppath.relative(base, path)) } } async function compareDirs(original: string, merged: string): Promise<Comparison> { const comparison: Comparison = {original, originalFiles: [], merged, mergedFiles: [], originalOnly: [], mergedOnly: [], same: [], different: []} const originalFiles = new Set<string>() const mergedFiles = new Set<string>() await allFiles(original, original, originalFiles) await allFiles(merged, merged, mergedFiles) comparison.originalFiles = Array.from(originalFiles) comparison.mergedFiles = Array.from(mergedFiles) for (const file1 of originalFiles) { if (mergedFiles.has(file1)) { // See if files are the same const originalVal = await fs.readFile(ppath.join(original, file1), 'utf-8') const mergedVal = await fs.readFile(ppath.join(merged, file1), 'utf-8') if (originalVal === mergedVal) { comparison.same.push(file1) } else { let pos = 0 while (pos < originalVal.length && pos < mergedVal.length) { if (originalVal[pos] !== mergedVal[pos]) { break } ++pos } comparison.different.push({file: file1, position: pos}) } } else { comparison.originalOnly.push(file1) } } comparison.mergedOnly = [...mergedFiles].filter(x => !originalFiles.has(x)) return comparison } function entryCompare(comparison: Comparison, name: string, expected: number | string[] | undefined, errors: string[]) { if (expected) { const value = comparison[name] as string[] if (typeof expected === 'number') { if (value.length !== expected) { errors.push(`${name}: ${value.length} != ${expected}`) } } else { for (const expect of expected as string[]) { if (!value.includes(expect)) { errors.push(`${name} does not contain ${expect}`) } } } } } function assertCompare( comparison: Comparison, errors: string[], same?: number | string[], different?: number | string[], originalOnly?: number | string[], mergedOnly?: number | string[]): boolean { entryCompare(comparison, 'same', same, errors) entryCompare(comparison, 'different', different, errors) entryCompare(comparison, 'originalOnly', originalOnly, errors) entryCompare(comparison, 'mergedOnly', mergedOnly, errors) return errors.length > 0 } function assertRemoved(comparison: Comparison, file: string, errors: string[]) { if (comparison.mergedFiles.includes(file)) { errors.push(`Did not expect ${file} in merged`) } } function assertAddedProperty(comparison: Comparison, added: string, errors: string[]): string[] { const found: string[] = [] for (const file of comparison.mergedFiles) { if (file.includes(added)) { found.push(file) } } if (found.length === 0) { errors.push(`Missing ${added} in merged files`) } return found } function assertRemovedProperty(comparison: Comparison, removed: string, errors: string[]): string[] { const found: string[] = [] for (const file of comparison.mergedFiles) { if (file.includes(removed)) { found.push(file) } } if (found.length > 0) { errors.push(`Found ${removed} in merged files`) } return found } const output_dir = ppath.join(os.tmpdir(), 'mergeTest') const merge_data = 'test/merge_data' const modified_data = `${merge_data}/modified` const originalSchema = ppath.join(merge_data, 'sandwichMerge.form') const modifiedSchema = ppath.join(merge_data, 'sandwichMerge-modified.form') const originalDir = ppath.join(output_dir, 'sandwichMerge-original') const mergedDir = ppath.join(output_dir, 'sandwichMerge-merged') function errorOnly(type: gen.FeedbackType, msg: string): void { if ((type === gen.FeedbackType.warning && !msg.startsWith('Replace')) || type === gen.FeedbackType.error) { assert.fail(`${type}: ${msg}`) } } function feedback(type: gen.FeedbackType, msg: string): void { if (type !== gen.FeedbackType.debug) { console.log(`${type}: ${msg}`) } if ((type === gen.FeedbackType.warning && !msg.startsWith('Replace')) || type === gen.FeedbackType.error) { assert.fail(`${type}: ${msg}`) } } async function assertContains(file: string, regex: RegExp, errors: string[]) { const val = await fs.readFile(ppath.join(mergedDir, file), 'utf8') if (!val.match(regex)) { errors.push(`${file} does not contain expected ${regex}`) } } async function assertMissing(file: string, regex: RegExp, errors: string[]) { const val = await fs.readFile(ppath.join(mergedDir, file), 'utf8') if (val.match(regex)) { errors.push(`${file} contains unexpected ${regex}`) } } async function assertUnchanged(file: string, expected: boolean, errors: string[]) { const unchanged = await gen.isUnchanged(ppath.join(mergedDir, file)) if (unchanged !== expected) { errors.push(`${file} is unexpectedly ${expected ? 'changed' : 'unchanged'}`) } } async function copyToMerged(pattern: string) { const pathPattern = ppath.join(modified_data, pattern).replace(/\\/g, '/') for (const path of await glob(pathPattern)) { const file = ppath.relative(modified_data, path) const dest = ppath.join(mergedDir, file) console.log(`Modifying ${dest}`) await fs.copyFile(path, dest) } } async function deleteMerged(pattern: string) { const pathPattern = ppath.join(mergedDir, pattern).replace(/\\/g, '/') for (const file of await glob(pathPattern)) { console.log(`Deleting ${file}`) await fs.unlink(file) } } function beforeSetup(singleton: boolean) { return async function () { try { console.log('Deleting output directory') await fs.remove(output_dir) console.log('Generating original files') await gen.generate(originalSchema, { prefix: 'sandwichMerge', outDir: originalDir, singleton: singleton, feedback: errorOnly }) } catch (e) { assert.fail((e as Error).message) } } } function beforeEachSetup() { return async function () { try { console.log('\n\nCopying original generated to merged') await fs.remove(mergedDir) await fs.copy(originalDir, mergedDir) } catch (e) { assert.fail((e as Error).message) } } } describe('dialog:generate --merge files', async function () { before(beforeSetup(false)) beforeEach(beforeEachSetup()) // Ensure merge with no changes is unchanged it('merge: self', async function () { try { console.log('Self merging') await gen.generate(originalSchema, { outDir: mergedDir, merge: true, feedback }) const comparison = await compareDirs(originalDir, mergedDir) const errors: string[] = [] assertCompare(comparison, errors, comparison.originalFiles.length) assertCheck(comparison, errors) } catch (e) { assert.fail((e as Error).message) } }) // Ensure merge with modified schema changes as expected it('merge: modified', async function () { try { console.log('Modified merge') await gen.generate(modifiedSchema, { prefix: 'sandwichMerge', outDir: mergedDir, merge: true, feedback }) const comparison = await compareDirs(originalDir, mergedDir) const errors = [] assertAddedProperty(comparison, 'Hobby', errors) assertRemovedProperty(comparison, 'Meat', errors) assertRemovedProperty(comparison, 'Toppings', errors) assertRemovedProperty(comparison, 'Sauces', errors) await assertContains('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /black/, errors) await assertMissing('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /white/, errors) //sandwichMerge await assertContains('language-generation/en-us/CheeseValue/sandwichMerge-CheeseValue.en-us.lg', /brie/, errors) // Unchanged hash + optional enum fixes = hash updated await assertUnchanged('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', true, errors) await assertUnchanged('language-generation/en-us/Name/sandwichMerge-Name.en-us.lg', true, errors) assertCheck(comparison, errors) } catch (e) { assert.fail((e as Error).message) } }) // Respect user changes it('merge: respect changes', async function () { try { // Modify a dialog file it should stay unchanged except for main.dialog which should be updated, but not hash updated // Remove a dialog file and it should not come back // Modify an .lu file and it should have enum updated, but not hash // Modify an .lg file and it should have enum updated, but not hash console.log('Respect changes merge') await copyToMerged('**/language-generation/en-us/Bread/*') await copyToMerged('**/language-generation/en-us/BreadValue/*') await copyToMerged('**/language-understanding/en-us/Bread/*') await copyToMerged('**/language-understanding/en-us/form/*') const dialogPath = ppath.join(mergedDir, 'sandwichMerge.dialog') const old = await fs.readJSON(dialogPath) old.$comment = 'changed dialog' old.triggers = ["sandwichMerge-foo-missing", ...old.triggers.filter(t => t !== 'sandwichMerge-price-remove-money')] await fs.writeJSON(dialogPath, old) await copyToMerged('dialogs/sandwichMerge-foo-missing.dialog') await deleteMerged('dialogs/Price/sandwichMerge-price-remove-money.dialog') await gen.generate(modifiedSchema, { prefix: 'sandwichMerge', outDir: mergedDir, merge: true, feedback }) const comparison = await compareDirs(originalDir, mergedDir) const errors = [] // Changed + optional enum fixes = hash not updated, so still changed await assertUnchanged('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', false, errors) await assertUnchanged('sandwichMerge.dialog', false, errors) // Despite enum update, hash updated so unchanged await assertUnchanged('language-generation/en-us/CheeseValue/sandwichMerge-CheeseValue.en-us.lg', true, errors) // Main should still be updated await assertContains('sandwichMerge.dialog', /sandwichMerge-foo/, errors) await assertMissing('sandwichMerge.dialog', /sandwichMerge-price-remove-money/, errors) await assertContains('sandwichMerge.dialog', /changed dialog/, errors) // Removed should stay removed assertRemoved(comparison, 'dialogs/sandwichMerged-price-remove-money.dialog', errors) // Still get enum updates await assertContains('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /black/, errors) await assertMissing('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /white/, errors) //sandwichMerge await assertMissing('language-understanding/en-us/sandwichMerge.en-us.lu', /pulled/, errors) await assertContains('language-understanding/en-us/Bread/sandwichMerge-Bread-BreadValue.en-us.lu', />- {BreadProperty={BreadValue=rye}}/, errors) await assertContains('language-understanding/en-us/Bread/sandwichMerge-Bread-BreadValue.en-us.lu', /black/, errors) assertCheck(comparison, errors) } catch (e) { assert.fail((e as Error).message) } }) }) describe('dialog:generate --merge singleton', async function () { before(beforeSetup(true)) beforeEach(beforeEachSetup()) // Ensure merge with no changes is unchanged it('merge singleton: self', async function () { try { console.log('Self merging') await gen.generate(originalSchema, { outDir: mergedDir, merge: true, singleton: true, feedback }) const comparison = await compareDirs(originalDir, mergedDir) const errors: string[] = [] assertCompare(comparison, errors, comparison.originalFiles.length) assertCheck(comparison, errors) } catch (e) { assert.fail((e as Error).message) } }) // Ensure merge with modified schema changes as expected it('merge singleton: modified', async function () { try { console.log('Modified merge') await gen.generate(modifiedSchema, { prefix: 'sandwichMerge', outDir: mergedDir, merge: true, singleton: true, feedback }) const comparison = await compareDirs(originalDir, mergedDir) const errors = [] assertAddedProperty(comparison, 'Hobby', errors) assertRemovedProperty(comparison, 'Meat', errors) assertRemovedProperty(comparison, 'Toppings', errors) assertRemovedProperty(comparison, 'Sauces', errors) await assertContains('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /black/, errors) await assertMissing('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /white/, errors) await assertContains('language-generation/en-us/CheeseValue/sandwichMerge-CheeseValue.en-us.lg', /brie/, errors) // Unchanged hash + optional enum fixes = hash updated await assertUnchanged('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', true, errors) await assertUnchanged('language-generation/en-us/Name/sandwichMerge-Name.en-us.lg', true, errors) assertCheck(comparison, errors) await compareToOracle(ppath.join(mergedDir, 'sandwichMerge.dialog')) } catch (e) { assert.fail((e as Error).message) } }) // Respect user changes it('merge singleton: respect changes', async function () { try { // Modify a dialog file it should stay unchanged except for main.dialog which should be updated, but not hash updated // Remove a dialog file and it should not come back // Modify an .lu file and it should have enum updated, but not hash // Modify an .lg file and it should have enum updated, but not hash console.log('Respect changes merge') await copyToMerged('**/language-generation/en-us/Bread/*') await copyToMerged('**/language-generation/en-us/BreadValue/*') await copyToMerged('**/language-understanding/en-us/Bread/*') await copyToMerged('**/language-understanding/en-us/sandwichMerge.en-us.lu') // Modify an existing trigger and add a custom trigger const dialogPath = ppath.join(mergedDir, 'sandwichMerge.dialog') const oldDialog = await fs.readJSON(dialogPath) const modifiedTrigger = oldDialog.triggers[1] const reorderedTrigger = oldDialog.triggers[2] modifiedTrigger.actions.push({$kind: "Microsoft.SetProperty"}) const newTrigger = {$kind: "Microsoft.OnCondition", actions: []} oldDialog.triggers.splice(3, 1, newTrigger, reorderedTrigger) oldDialog.triggers.splice(2, 1) await fs.writeFile(dialogPath, gen.stringify(oldDialog)) await gen.generate(modifiedSchema, { prefix: 'sandwichMerge', outDir: mergedDir, merge: true, singleton: true, feedback }) const comparison = await compareDirs(originalDir, mergedDir) const errors = [] // Changed + optional enum fixes = hash not updated, so still changed await assertUnchanged('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', false, errors) await assertUnchanged('sandwichMerge.dialog', false, errors) // Despite enum update, hash updated so unchanged await assertUnchanged('language-generation/en-us/CheeseValue/sandwichMerge-CheeseValue.en-us.lg', true, errors) // Still get enum updates await assertContains('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /black/, errors) await assertMissing('language-generation/en-us/BreadValue/sandwichMerge-BreadValue.en-us.lg', /white/, errors) await assertMissing('language-understanding/en-us/sandwichMerge.en-us.lu', /pulled/, errors) await assertContains('language-understanding/en-us/Bread/sandwichMerge-Bread-BreadValue.en-us.lu', />- {BreadProperty={BreadValue=rye}}/, errors) await assertContains('language-understanding/en-us/Bread/sandwichMerge-Bread-BreadValue.en-us.lu', /black/, errors) assertCheck(comparison, errors) const mergedDialog = await fs.readJSON(dialogPath) assert.deepStrictEqual(mergedDialog.triggers[1], modifiedTrigger, 'Did not preserve modified trigger') assert.deepStrictEqual(mergedDialog.triggers[2], newTrigger, 'Did not preserve custom trigger') assert.deepStrictEqual(mergedDialog.triggers[3], reorderedTrigger, 'Did not preserve reordered trigger') } catch (e) { assert.fail((e as Error).message) } }) }) ```
/content/code_sandbox/experimental/generation/generator/packages/library/test/merge.test.ts
xml
2016-09-20T16:17:28
2024-08-16T02:44:00
BotBuilder-Samples
microsoft/BotBuilder-Samples
4,323
4,395
```xml <dict> <key>LayoutID</key> <integer>3</integer> <key>PathMapRef</key> <array> <dict> <key>CodecID</key> <array> <integer>283903587</integer> </array> <key>Headphone</key> <dict/> <key>Inputs</key> <array> <string>Mic</string> </array> <key>IntSpeaker</key> <dict/> <key>Mic</key> <dict> <key>MuteGPIO</key> <integer>1342242840</integer> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspNoiseReduction</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>-1073029587</integer> <key>5</key> <data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspEqualization32</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>9</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1119939268</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>-1069504319</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1165674830</integer> <key>7</key> <integer>1106304591</integer> <key>8</key> <integer>-1073964333</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1141348835</integer> <key>7</key> <integer>1084737706</integer> <key>8</key> <integer>-1065063953</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1139052693</integer> <key>7</key> <integer>1080938866</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1161958655</integer> <key>7</key> <integer>1099668786</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1148922426</integer> <key>7</key> <integer>1086508776</integer> <key>8</key> <integer>-1076100424</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>10</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1169908270</integer> <key>7</key> <integer>1106659062</integer> <key>8</key> <integer>-1078236516</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>11</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1168889995</integer> <key>7</key> <integer>1103911084</integer> <key>8</key> <integer>-1082886964</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>12</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1160729473</integer> <key>7</key> <integer>1095247586</integer> <key>8</key> <integer>-1076100424</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>19</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1171440929</integer> <key>7</key> <integer>1103785747</integer> <key>8</key> <integer>-1075032379</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>21</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1163187837</integer> <key>7</key> <integer>1102690138</integer> <key>8</key> <integer>-1073319056</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>23</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1172459204</integer> <key>7</key> <integer>1098523915</integer> <key>8</key> <integer>-1062927862</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>24</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1175303133</integer> <key>7</key> <integer>1102375714</integer> <key>8</key> <integer>-1061058782</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>25</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1179874390</integer> <key>7</key> <integer>1097945441</integer> <key>8</key> <integer>-1054338996</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>26</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1167504019</integer> <key>7</key> <integer>1102555367</integer> <key>8</key> <integer>-1044515201</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>27</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1177335863</integer> <key>7</key> <integer>1102845396</integer> <key>8</key> <integer>-1054739513</integer> </dict> <dict> <key>2</key> <integer>2</integer> <key>3</key> <integer>31</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1184146588</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>-1069504319</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>2</integer> <key>DspFuncName</key> <string>DspGainStage</string> <key>DspFuncProcessingIndex</key> <integer>2</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1065353216</integer> <key>3</key> <integer>1065353216</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>Outputs</key> <array> <string>Headphone</string> <string>IntSpeaker</string> </array> <key>PathMapID</key> <integer>663</integer> </dict> </array> </dict> ```
/content/code_sandbox/Resources/ALC663/layout3.xml
xml
2016-03-07T20:45:58
2024-08-14T08:57:03
AppleALC
acidanthera/AppleALC
3,420
4,017
```xml import type { FlightRouterState } from '../../../../server/app-render/types' import type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime' import { createRouterCacheKey } from '../create-router-cache-key' export function findHeadInCache( cache: CacheNode, parallelRoutes: FlightRouterState[1] ): [CacheNode, string] | null { return findHeadInCacheImpl(cache, parallelRoutes, '') } function findHeadInCacheImpl( cache: CacheNode, parallelRoutes: FlightRouterState[1], keyPrefix: string ): [CacheNode, string] | null { const isLastItem = Object.keys(parallelRoutes).length === 0 if (isLastItem) { // Returns the entire Cache Node of the segment whose head we will render. return [cache, keyPrefix] } for (const key in parallelRoutes) { const [segment, childParallelRoutes] = parallelRoutes[key] const childSegmentMap = cache.parallelRoutes.get(key) if (!childSegmentMap) { continue } const cacheKey = createRouterCacheKey(segment) const cacheNode = childSegmentMap.get(cacheKey) if (!cacheNode) { continue } const item = findHeadInCacheImpl( cacheNode, childParallelRoutes, keyPrefix + '/' + cacheKey ) if (item) { return item } } return null } ```
/content/code_sandbox/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
315
```xml import { FindOptions } from 'sequelize'; export type AssociationCountOptions = { scope?: string | boolean; } & FindOptions; ```
/content/code_sandbox/src/model/model/association/association-count-options.ts
xml
2016-01-27T11:25:52
2024-08-13T16:56:45
sequelize-typescript
sequelize/sequelize-typescript
2,768
29
```xml <vector xmlns:android="path_to_url" android:height="30.222221dp" android:tint="?attr/colorControlNormal" android:viewportHeight="512" android:viewportWidth="576" android:width="34.0dp"> <path android:fillColor="@android:color/white" android:pathData="M336 96c26.5 0 48-21.5 48-48S362.5 0 336 0s-48 21.5-48 48 21.5 48 48 48zm216 320c-13.2 0-24 10.7-24 24 0 13.2-10.8 24-24 24h-69.5L460 285.6c11.7-4.7 20.1-16.2 20.1-29.6 0-17.7-14.3-32-32-32h-44L378 170.8c-12.5-25.5-35.5-44.2-61.8-50.9L245 98.7c-28.3-6.8-57.8-0.5-80.8 17.1l-39.7 30.4c-14 10.7-16.7 30.8-5.9 44.9 0.7 0.9 1.7 1.3 2.4 2.1L66.9 464H24c-13.2 0-24 10.7-24 24s10.8 24 24 24h480c39.7 0 72-32.3 72-72 0-13.2-10.8-24-24-24zm-260.5 48h-96.9l43.1-91-22-13c-12.1-7.2-21.9-16.9-29.5-27.8L123.7 464H99.5l52.3-261.4c4.1-1 8.1-2.9 11.7-5.6l39.7-30.4c7.7-5.9 17.4-8 25.3-6.1l14.7 4.4-37.5 87.4c-12.6 29.5-1.3 64 26.3 80.3l85 50.2-25.5 81.2zm110.6 0h-43.6l23.6-75.5c5.9-20.8-2.9-43.1-21.6-54.4L299.3 298l31.3-78.3 20.3 41.4c8 16.3 24.9 26.9 43.1 26.9h33.3l-25.2 176z"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_preset_fas_skiing_nordic.xml
xml
2016-07-02T10:44:04
2024-08-16T18:55:54
StreetComplete
streetcomplete/StreetComplete
3,781
672
```xml import { KeyboardCommand } from './KeyboardCommands' import { KeyboardShortcutCategory } from './KeyboardShortcut' export type KeyboardCommandHandler = { command: KeyboardCommand category?: KeyboardShortcutCategory description?: string onKeyDown?: (event: KeyboardEvent, data?: unknown) => boolean | void onKeyUp?: (event: KeyboardEvent, data?: unknown) => boolean | void element?: HTMLElement elements?: HTMLElement[] notElement?: HTMLElement notElementIds?: string[] notTags?: string[] } ```
/content/code_sandbox/packages/ui-services/src/Keyboard/KeyboardCommandHandler.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
114
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Dynamic|ARM"> <Configuration>Dynamic</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Dynamic|Win32"> <Configuration>Dynamic</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Dynamic|x64"> <Configuration>Dynamic</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Static_WinXP|ARM"> <Configuration>Static_WinXP</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Static_WinXP|Win32"> <Configuration>Static_WinXP</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Static_WinXP|x64"> <Configuration>Static_WinXP</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Static|ARM"> <Configuration>Static</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Static|Win32"> <Configuration>Static</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Static|x64"> <Configuration>Static</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <VCProjectVersion>15.0</VCProjectVersion> <ProjectGuid>{D4EA3F1F-208A-4670-A907-4DCBC3F3E269}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>ltlbuild</RootNamespace> <WindowsTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(MSBuildThisFileDirectory)..\Shared.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <DisableStaticLibSupport>true</DisableStaticLibSupport> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <DisableStaticLibSupport>true</DisableStaticLibSupport> <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <SupportWinXP>true</SupportWinXP> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <SupportWinXP>true</SupportWinXP> <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <DisableStaticLibSupport>true</DisableStaticLibSupport> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <SupportWinXP>true</SupportWinXP> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" /> </ImportGroup> <ImportGroup Label="Shared" /> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Static|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Static|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(SolutionDir)..\VC-LTL helper for Visual Studio.props" /> <Import Project="..\..\..\VC-LTL_Global.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>libcmt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\Vista\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|ARM'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>libcmt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\Vista\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|Win32'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>msvcrt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\Vista\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|ARM'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>msvcrt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\Vista\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|Win32'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>libcmt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\WinXP\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|ARM'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>libcmt</TargetName> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|x64'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>libcmt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\Vista\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|x64'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>msvcrt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\Vista\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|x64'"> <IncludePath>$(SolutionDir)$(VC-LTLUsedToolsVersion)\vcruntime;$(SolutionDir)ucrt\inc;$(SolutionDir)$(VC-LTLUsedToolsVersion);$(SolutionDir);$(IncludePath)</IncludePath> <TargetName>libcmt</TargetName> <OutDir>$(SolutionDir)..\VC\$(VC-LTLUsedToolsVersion)\lib\$(PlatformShortName)\WinXP\</OutDir> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_BEST_PRACTICES_USAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;WIN32;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> <MASM> <ObjectFileName>$(IntDir)%(FileName).asm.obj</ObjectFileName> <UseSafeExceptionHandlers>true</UseSafeExceptionHandlers> </MASM> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Static|ARM'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_BEST_PRACTICES_USAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;WIN32;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;CRTDLL;_LTL_Using_Dynamic_Lib;__Bulib_Dynamic_Lib;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;WIN32;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <IgnoreSpecificDefaultLibraries>ltl.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration> <ImportLibrary>$(OutDir)ltl.lib</ImportLibrary> <ProgramDatabaseFile>$(OutDir)ltl.pdb</ProgramDatabaseFile> </Link> <MASM> <ObjectFileName>$(IntDir)%(FileName).asm.obj</ObjectFileName> <UseSafeExceptionHandlers>true</UseSafeExceptionHandlers> </MASM> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|ARM'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;CRTDLL;_LTL_Using_Dynamic_Lib;__Bulib_Dynamic_Lib;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;WIN32;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <IgnoreSpecificDefaultLibraries>ltl.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration> <ImportLibrary>$(OutDir)ltl.lib</ImportLibrary> <ProgramDatabaseFile>$(OutDir)ltl.pdb</ProgramDatabaseFile> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;_ATL_XP_TARGETING;WIN32;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> <MASM> <ObjectFileName>$(IntDir)%(FileName).asm.obj</ObjectFileName> <UseSafeExceptionHandlers>true</UseSafeExceptionHandlers> </MASM> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|ARM'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;_ATL_XP_TARGETING;WIN32;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Static|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_BEST_PRACTICES_USAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> <MASM> <ObjectFileName>$(IntDir)%(FileName).asm.obj</ObjectFileName> </MASM> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Dynamic|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;CRTDLL;_LTL_Using_Dynamic_Lib;__Bulib_Dynamic_Lib;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <ProgramDatabaseFile>$(OutDir)ltl.pdb</ProgramDatabaseFile> <IgnoreSpecificDefaultLibraries>ltl.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <ImportLibrary>$(OutDir)ltl.lib</ImportLibrary> </Link> <MASM> <ObjectFileName>$(IntDir)%(FileName).asm.obj</ObjectFileName> </MASM> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Static_WinXP|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_DISABLE_DEPRECATE_LTL_MESSAGE;_CRT_SECURE_NO_WARNINGS;__Build_LTL;_CRTBLD;_MBCS;_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY;_VCRT_ALLOW_INTERNALS;_NO__LTL_Initialization;_ATL_XP_TARGETING;NDEBUG;_LIB;_CORECRT_BUILD;_CTIME_;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WholeProgramOptimization>false</WholeProgramOptimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <RuntimeTypeInfo>false</RuntimeTypeInfo> <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ForcedIncludeFiles>suppress.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> <MASM> <ObjectFileName>$(IntDir)%(FileName).asm.obj</ObjectFileName> </MASM> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\..\ftol2_downlevel.cpp"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(SupportWinXP)'!='true'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\arm\gshandlereh.c"> <ExcludedFromBuild Condition="'$(Platform)'!='ARM'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\i386\chandler4.c"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(SupportWinXP)'!='true'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\i386\ehprolg2.c"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\i386\ehprolg3.c"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\i386\ehprolg3a.c"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\vcruntime\argv_mode.cpp" /> <ClCompile Include="..\..\vcruntime\checkcfg.c" /> <ClCompile Include="..\..\vcruntime\commit_mode.cpp" /> <ClCompile Include="..\..\vcruntime\default_precision.cpp"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\vcruntime\denormal_control.cpp" /> <ClCompile Include="..\..\vcruntime\dll_dllmain.cpp" /> <ClCompile Include="..\..\vcruntime\dll_dllmain_stub.cpp" /> <ClCompile Include="..\..\vcruntime\dyn_tls_init.c" /> <ClCompile Include="..\..\vcruntime\ehvccctr.cpp" /> <ClCompile Include="..\..\vcruntime\ehvcccvb.cpp" /> <ClCompile Include="..\..\vcruntime\ehvecctr.cpp" /> <ClCompile Include="..\..\vcruntime\ehveccvb.cpp" /> <ClCompile Include="..\..\vcruntime\ehvecdtr.cpp" /> <ClCompile Include="..\..\vcruntime\env_mode.cpp" /> <ClCompile Include="..\..\vcruntime\exe_main.cpp"> <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData> </ClCompile> <ClCompile Include="..\..\vcruntime\exe_winmain.cpp"> <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData> </ClCompile> <ClCompile Include="..\..\vcruntime\exe_wmain.cpp"> <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData> </ClCompile> <ClCompile Include="..\..\vcruntime\exe_wwinmain.cpp"> <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData> </ClCompile> <ClCompile Include="..\..\vcruntime\file_mode.cpp" /> <ClCompile Include="..\..\vcruntime\fltused.cpp" /> <ClCompile Include="..\..\vcruntime\gs_cookie.c" /> <ClCompile Include="..\..\vcruntime\gs_report.c" /> <ClCompile Include="..\..\vcruntime\gs_support.c" /> <ClCompile Include="..\..\vcruntime\guard_support.c" /> <ClCompile Include="..\..\vcruntime\huge.c" /> <ClCompile Include="..\..\vcruntime\initializers.cpp" /> <ClCompile Include="..\..\vcruntime\invalid_parameter_handler.cpp" /> <ClCompile Include="..\..\vcruntime\loadcfg.c" /> <ClCompile Include="..\..\vcruntime\matherr.cpp" /> <ClCompile Include="..\..\vcruntime\matherr_detection.c" /> <ClCompile Include="..\..\vcruntime\mpxinit.c"> <ExcludedFromBuild Condition="('$(Platform)'!='Win32') And('$(Platform)'!='x64') ">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\vcruntime\new_array_nothrow.cpp" /> <ClCompile Include="..\..\vcruntime\new_mode.cpp" /> <ClCompile Include="..\..\vcruntime\new_scalar_nothrow.cpp" /> <ClCompile Include="..\..\vcruntime\pesect.c" /> <ClCompile Include="..\..\..\vc_msvcrt.cpp" /> <ClCompile Include="..\..\vcruntime\std_type_info_static.cpp" /> <ClCompile Include="..\..\vcruntime\thread_locale.cpp" /> <ClCompile Include="..\..\vcruntime\thread_safe_statics.cpp"> <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData> </ClCompile> <ClCompile Include="..\..\vcruntime\tlsdtor.cpp"> <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData> </ClCompile> <ClCompile Include="..\..\vcruntime\tlsdyn.cpp"> <RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData> </ClCompile> <ClCompile Include="..\..\vcruntime\tlssup.cpp" /> <ClCompile Include="..\..\vcruntime\tncleanup.cpp" /> <ClCompile Include="..\..\vcruntime\ucrt_detection.c" /> <ClCompile Include="..\..\vcruntime\ucrt_stubs.cpp" /> <ClCompile Include="..\..\vcruntime\std_nothrow.cpp"> <AssemblerListingLocation>$(IntDir)objs\</AssemblerListingLocation> <ObjectFileName>$(IntDir)objs\</ObjectFileName> </ClCompile> <ClCompile Include="..\..\vcruntime\throw_bad_alloc.cpp"> <AssemblerListingLocation>$(IntDir)objs\</AssemblerListingLocation> <ObjectFileName>$(IntDir)objs\</ObjectFileName> </ClCompile> <ClCompile Include="..\..\vcruntime\utility.cpp" /> <ClCompile Include="..\..\vcruntime\utility_desktop.cpp"> <AssemblerListingLocation>$(IntDir)objs\</AssemblerListingLocation> <ObjectFileName>$(IntDir)objs\</ObjectFileName> </ClCompile> <ClCompile Include="..\..\vcruntime\vcruntime_stubs.cpp" /> <ClCompile Include="..\..\amd64\gshandlereh.c"> <ExcludedFromBuild Condition="'$(Platform)'!='x64'">true</ExcludedFromBuild> </ClCompile> </ItemGroup> <ItemGroup> <ResourceCompile Include="ltlbuild.rc"> <ExcludedFromBuild Condition="'$(Configuration)'!='Redist'">true</ExcludedFromBuild> </ResourceCompile> </ItemGroup> <ItemGroup> <MASM Include="..\..\..\amd64\exception.asm"> <ExcludedFromBuild Condition="'$(Platform)'!='x64'">true</ExcludedFromBuild> </MASM> <CustomBuild Include="..\..\..\arm\exception.asm"> <FileType>Document</FileType> <Command>armasm -o "$(IntDir)%(fileName).asm.obj" "%(FullPath)"</Command> <Outputs>$(IntDir)%(fileName).asm.obj</Outputs> <ExcludedFromBuild Condition="'$(Platform)'!='ARM'">true</ExcludedFromBuild> </CustomBuild> <MASM Include="..\..\..\i386\exception.asm"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> </MASM> <MASM Include="..\..\i386\dllsupp.asm"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> </MASM> <MASM Include="..\..\i386\ehprolog.asm"> <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild> </MASM> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" /> </ImportGroup> </Project> ```
/content/code_sandbox/src/14.0.24231/Build/ltlbuild/ltlbuild.vcxproj
xml
2016-06-14T03:01:16
2024-08-12T19:23:19
VC-LTL
Chuyu-Team/VC-LTL
1,052
9,027
```xml <?xml version="1.0" encoding="utf-8"?> <!-- path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <vector xmlns:android="path_to_url" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:pathData="M6.677,5.873C-1.951,6.473 -2.486,18.986 6.649,19.764C6.119,19.405 5.45,18.697 4.619,17.761C-0.603,14.779 1.707,9.029 4.66,7.913C5.04,7.265 5.892,6.473 6.677,5.873Z" android:fillColor="#FFFFFF" android:fillAlpha="0.6" /> <path android:pathData="M11.34,5.87C2.712,6.469 2.177,18.982 11.312,19.76C10.782,19.401 10.114,18.693 9.282,17.757C4.06,14.775 6.37,9.025 9.323,7.909C9.703,7.261 10.555,6.469 11.34,5.87Z" android:fillColor="#FFFFFF" android:fillAlpha="0.8" /> <path android:pathData="M18.557,3.54L13.918,3.54L13.918,5.086L18.557,5.086L18.557,3.54L18.557,3.54ZM21.673,8.481L22.771,7.383C22.439,6.989 22.075,6.617 21.681,6.293L20.583,7.391C19.384,6.432 17.877,5.86 16.237,5.86C12.395,5.86 9.279,8.976 9.279,12.819C9.279,16.661 12.387,19.777 16.237,19.777C20.088,19.777 23.196,16.661 23.196,12.819C23.196,11.179 22.624,9.672 21.673,8.481L21.673,8.481ZM16.237,18.231C13.245,18.231 10.825,15.811 10.825,12.819C10.825,9.826 13.245,7.406 16.237,7.406C19.23,7.406 21.65,9.826 21.65,12.819C21.65,15.811 19.23,18.231 16.237,18.231L16.237,18.231Z" android:fillColor="#FFFFFF" /> <path android:pathData="M15.354,14.797L14.913,14.539L16.917,10.813L17.362,11.071L15.354,14.797ZM15.468,12.743L14.916,12.743L14.916,10.63L14.16,10.83L14.16,10.38L15.405,9.969L15.468,9.969L15.468,12.743ZM18.603,15.661L16.497,15.661L16.497,15.281L17.51,14.328C17.662,14.187 17.771,14.066 17.837,13.964C17.903,13.862 17.935,13.77 17.935,13.688C17.935,13.573 17.897,13.48 17.819,13.409C17.742,13.337 17.635,13.302 17.499,13.302C17.326,13.302 17.198,13.345 17.115,13.433C17.031,13.521 16.989,13.633 16.986,13.769L16.431,13.769C16.431,13.643 16.455,13.523 16.505,13.41C16.554,13.298 16.624,13.2 16.715,13.117C16.807,13.034 16.918,12.968 17.048,12.92C17.178,12.872 17.324,12.848 17.485,12.848C17.64,12.848 17.78,12.867 17.904,12.906C18.028,12.945 18.133,13 18.22,13.073C18.307,13.146 18.374,13.233 18.421,13.335C18.467,13.437 18.491,13.552 18.491,13.681C18.491,13.775 18.475,13.863 18.443,13.947C18.412,14.03 18.366,14.112 18.306,14.193C18.247,14.274 18.175,14.356 18.092,14.439C18.009,14.522 17.917,14.609 17.816,14.701L17.201,15.211L18.603,15.211L18.603,15.661Z" android:fillColor="#FFFFFF" /> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_animator_duration_half_x.xml
xml
2016-10-04T02:52:57
2024-08-07T08:40:22
AnimatorDurationTile
nickbutcher/AnimatorDurationTile
1,380
1,346
```xml <local:HostedPage x:Class="Telegram.Views.Settings.SettingsThemePage" xmlns="path_to_url" xmlns:x="path_to_url" xmlns:local="using:Telegram.Views" xmlns:themes="using:Telegram.Views.Settings" xmlns:common="using:Telegram.Common" xmlns:controls="using:Telegram.Controls" xmlns:mux="using:Microsoft.UI.Xaml.Controls" xmlns:viewModels="using:Telegram.ViewModels.Settings" xmlns:d="path_to_url" xmlns:mc="path_to_url" mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions> <controls:ContentPageHeader x:Name="Header"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <TextBlock Text="{x:Bind ViewModel.Title, Mode=OneWay}" Foreground="{ThemeResource PageHeaderForegroundBrush}" Style="{StaticResource BaseTextBlockStyle}" VerticalAlignment="Center" Margin="12,0" /> <controls:GlyphButton Click="Done_Click" Style="{StaticResource HeaderGlyphButtonStyle}" Glyph="&#xE10B;" AutomationProperties.Name="{CustomResource Done}" ToolTipService.ToolTip="{CustomResource Done}" Grid.Column="1" /> <controls:MoreButton Grid.Column="2"> <Button.Flyout> <MenuFlyout Placement="BottomEdgeAlignedRight"> <MenuFlyoutItem Text="{CustomResource EditName}" Click="{x:Bind ViewModel.EditName}"> <MenuFlyoutItem.Icon> <FontIcon Glyph="&#xE104;" FontFamily="{StaticResource TelegramThemeFontFamily}" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> </MenuFlyout> </Button.Flyout> </controls:MoreButton> </Grid> </controls:ContentPageHeader> <TextBox x:Name="Search" PlaceholderText="{CustomResource Search}" Text="{x:Bind ViewModel.Filter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="12,8" Grid.Row="1" /> <ListView x:Name="ScrollingHost" ItemsSource="{x:Bind ViewModel.Items}" SelectionMode="None" IsItemClickEnabled="True" ItemClick="List_ItemClick" Grid.Row="2"> <ListView.ItemTemplate> <DataTemplate x:DataType="viewModels:ThemeBrush"> <Grid Padding="12,8,12,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <TextBlock Text="{x:Bind Name}" VerticalAlignment="Center" Margin="12,0,0,0" Grid.Column="1" /> <TextBlock Text="{x:Bind HexValue, Mode=OneWay}" Style="{StaticResource InfoCaptionTextBlockStyle}" VerticalAlignment="Center" Margin="12,0,0,0" Grid.Column="1" Grid.Row="1" /> <TextBlock common:TextBlockHelper.Markdown="{x:Bind Description}" Visibility="{x:Bind Description, Converter={StaticResource NullToVisibilityConverter}}" Foreground="{ThemeResource SystemControlDisabledChromeDisabledLowBrush}" Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="Wrap" Margin="12,4,12,0" Grid.Row="2" Grid.ColumnSpan="2" /> <Grid x:Name="Alpha" x:Load="{x:Bind HasTransparency, Mode=OneWay}" Width="32" Height="32" Background="White" CornerRadius="16" Grid.RowSpan="2"> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Rectangle Fill="#CCCCCC" Grid.Column="1" /> <Rectangle Fill="#CCCCCC" Grid.Column="3" /> <Rectangle Fill="#CCCCCC" Grid.Column="0" Grid.Row="1" /> <Rectangle Fill="#CCCCCC" Grid.Column="2" Grid.Row="1" /> <Rectangle Fill="#CCCCCC" Grid.Column="1" Grid.Row="2" /> <Rectangle Fill="#CCCCCC" Grid.Column="3" Grid.Row="2" /> <Rectangle Fill="#CCCCCC" Grid.Column="0" Grid.Row="3" /> <Rectangle Fill="#CCCCCC" Grid.Column="2" Grid.Row="3" /> </Grid> <Ellipse Width="32" Height="32" Grid.RowSpan="2"> <Ellipse.Fill> <SolidColorBrush Color="{x:Bind Color, Mode=OneWay}" /> </Ellipse.Fill> </Ellipse> <Ellipse Width="32" Height="32" Stroke="#1A000000" StrokeThickness="0.5" Grid.RowSpan="2" /> <Rectangle Fill="{ThemeResource TelegramSeparatorMediumBrush}" Height="1" Margin="12,9,-12,-1" Grid.Row="3" Grid.ColumnSpan="2" /> </Grid> </DataTemplate> </ListView.ItemTemplate> <ListView.ItemContainerStyle> <Style TargetType="ListViewItem" BasedOn="{StaticResource DefaultListViewItemStyle}"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <!--<Setter Property="Padding" Value="0"/>--> </Style> </ListView.ItemContainerStyle> </ListView> </Grid> </local:HostedPage> ```
/content/code_sandbox/Telegram/Views/Settings/SettingsThemePage.xaml
xml
2016-05-23T09:03:33
2024-08-16T16:17:48
Unigram
UnigramDev/Unigram
3,744
1,340
```xml <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="path_to_url"> <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{44c9b78a-4b7f-4294-9d67-9de42ca531f0}</UniqueIdentifier> <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions> </Filter> <Filter Include="Header Files"> <UniqueIdentifier>{c332c3ff-84c1-48c0-9888-ef98ff47ea67}</UniqueIdentifier> <Extensions>h;hpp;hxx;hm;inl</Extensions> </Filter> <Filter Include="Resource Files"> <UniqueIdentifier>{2148ed3f-a989-45a5-9301-8dbc65b53e5d}</UniqueIdentifier> <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions> </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="..\src\pjlib-util-test\encryption.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\http_client.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\json_test.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\main.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\main_win32.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\resolver_test.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\stun.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\test.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\src\pjlib-util-test\xml.c"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\pjlib-util-test\test.h"> <Filter>Header Files</Filter> </ClInclude> </ItemGroup> </Project> ```
/content/code_sandbox/pjlib-util/build/pjlib_util_test.vcxproj.filters
xml
2016-01-24T05:00:33
2024-08-16T03:31:21
pjproject
pjsip/pjproject
1,960
589
```xml declare module "*module.css" { const styles: { [className: string]: string; }; export default styles; } ```
/content/code_sandbox/examples/with-jest/types.d.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
29
```xml export async function POST(req: Request) { const editorState = await req.json(); console.log("TODO: Save editorState on the server", editorState); return Response.json({ status: "ok", }); } ```
/content/code_sandbox/examples/with-slate/app/api/editor-state/route.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
49
```xml import CalendarOnboardingModal from '../../components/onboarding/CalendarOnboardingModal'; import DummyCalendarContainerView from '../calendar/DummyCalendarContainerView'; interface Props { onDone: () => void; } const CalendarOnboardingContainer = ({ onDone }: Props) => { return ( <> <DummyCalendarContainerView /> <CalendarOnboardingModal open onDone={onDone} /> </> ); }; export default CalendarOnboardingContainer; ```
/content/code_sandbox/applications/calendar/src/app/containers/setup/CalendarOnboardingContainer.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
95
```xml import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers" describe(".ensureEnvKeysExist", () => { const env = { COMMIT: "9d2f95a4019935f91ed10e9d716d2b7551dcbcc1", REPO_SLUG: "bar", PR_ID: "30", PR_DESTINATION_BRANCH: "develop", REPO_OWNER: "foo", } test("return true if every key is in env", () => { const result = ensureEnvKeysExist(env, ["COMMIT", "REPO_SLUG"]) expect(result).toBe(true) }) test("return false if any key is not in env", () => { const result0 = ensureEnvKeysExist(env, ["test"]) expect(result0).toBe(false) const result1 = ensureEnvKeysExist(env, [""]) expect(result1).toBe(false) }) }) describe(".ensureEnvKeysAreInt", () => { const env = { COMMIT: "9d2f95a4019935f91ed10e9d716d2b7551dcbcc1", REPO_SLUG: "bar", PR_ID: "30", PR_DESTINATION_BRANCH: "develop", REPO_OWNER: "foo", } test("return true if key is in env and value is int", () => { const result = ensureEnvKeysAreInt(env, ["PR_ID"]) expect(result).toBe(true) }) test("return false if any key is not in env", () => { const result0 = ensureEnvKeysAreInt(env, ["test"]) expect(result0).toBe(false) const result1 = ensureEnvKeysAreInt(env, [""]) expect(result1).toBe(false) }) test("return false if any key is in env, but vlaue is not int", () => { const result = ensureEnvKeysAreInt(env, ["REPO_OWNER"]) expect(result).toBe(false) }) }) ```
/content/code_sandbox/source/ci_source/_tests/ci_source_helper.test.ts
xml
2016-08-20T12:57:06
2024-08-13T14:00:02
danger-js
danger/danger-js
5,229
443
```xml /** * Show main window with updated search term * * @return {BrowserWindow} appWindow */ export default (appWindow: any, term: string) => { appWindow.show() appWindow.focus() appWindow.webContents.send('message', { message: 'showTerm', payload: term }) } ```
/content/code_sandbox/app/main/createWindow/showWindowWithTerm.ts
xml
2016-07-03T14:42:01
2024-08-16T01:50:01
cerebro
cerebroapp/cerebro
8,301
72
```xml import { StatusIndicator } from 'expo-dev-client-components'; import * as React from 'react'; import { Animated } from 'react-native'; type PulseIndicatorProps = { isActive?: boolean; color: string; }; export function PulseIndicator({ isActive, color }: PulseIndicatorProps) { const animatedValue = React.useRef(new Animated.Value(0)); const pulseScale = animatedValue.current.interpolate({ inputRange: [0, 1], outputRange: [0.95, 2], }); const pulseOpacity = animatedValue.current.interpolate({ inputRange: [0, 1], outputRange: [1, 0], }); const loop = React.useRef( Animated.loop( Animated.timing(animatedValue.current, { toValue: 1, duration: 1200, useNativeDriver: true, }) ) ); React.useEffect(() => { if (isActive) { loop.current.start(); } else { animatedValue.current.setValue(0); loop.current.stop(); loop.current.reset(); } }, [isActive]); return ( <StatusIndicator size="small" style={{ backgroundColor: color }}> <Animated.View style={{ flex: 1, borderRadius: 100, transform: [{ scale: pulseScale }], opacity: pulseOpacity, backgroundColor: color, }} /> </StatusIndicator> ); } ```
/content/code_sandbox/packages/expo-dev-launcher/bundle/components/PulseIndicator.tsx
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
304
```xml /** * Delete users created today and their related data */ import chalk from 'chalk'; import inquirer from 'inquirer'; import initMongoDB from '@fiora/database/mongoose/initMongoDB'; import User from '@fiora/database/mongoose/models/user'; import { deleteUser } from './deleteUser'; export async function deleteTodayRegisteredUsers() { await initMongoDB(); const now = new Date(); const time = new Date( `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()} 00:00:00`, ); const users = await User.find({ createTime: { $gte: time, }, }); console.log( `There are ${chalk.green( users.length.toString(), )} newly registered users today`, ); if (users.length === 0) { return; } const shouldDeleteUsers = await inquirer.prompt({ type: 'confirm', name: 'result', message: 'Confirm to delete these users?', }); if (!shouldDeleteUsers.result) { return; } await Promise.all( users.map((user) => deleteUser(user._id.toString(), false)), ); console.log( chalk.green('Successfully deleted todays newly registered users'), ); } async function run() { await deleteTodayRegisteredUsers(); process.exit(0); } export default run; ```
/content/code_sandbox/packages/bin/scripts/deleteTodayRegisteredUsers.ts
xml
2016-02-15T14:47:58
2024-08-14T13:07:55
fiora
yinxin630/fiora
6,485
296
```xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="path_to_url" xmlns:app="path_to_url"> <item android:id="@+id/add_event_type" android:icon="@drawable/ic_plus_vector" android:title="@string/add_new_type" app:showAsAction="always" /> </menu> ```
/content/code_sandbox/app/src/main/res/menu/menu_event_types.xml
xml
2016-01-26T21:02:54
2024-08-15T00:35:32
Simple-Calendar
SimpleMobileTools/Simple-Calendar
3,512
80
```xml import {NumberTypeSchema} from "cad/craft/schema/types/numberType"; import {EntityTypeSchema} from "cad/craft/schema/types/entityType"; import {ArrayTypeSchema} from "cad/craft/schema/types/arrayType"; import {ObjectTypeSchema} from "cad/craft/schema/types/objectType"; import {StringTypeSchema} from "cad/craft/schema/types/stringType"; import {BooleanTypeSchema} from "cad/craft/schema/types/booleanType"; import {Types} from "cad/craft/schema/types"; import {ApplicationContext} from "cad/context"; import {ParamsPath} from "cad/craft/wizard/wizardTypes"; export type Coercable = any; export type PrimitiveSchemaField = | EntityTypeSchema | NumberTypeSchema | StringTypeSchema | BooleanTypeSchema | ArrayTypeSchema; export type SchemaField = PrimitiveSchemaField | ObjectTypeSchema; export type OperationSchema = { [key: string]: SchemaField; }; export type OperationFlattenSchema = { [key: string]: PrimitiveSchemaField; }; export interface BaseSchemaField { defaultValue?: OperationParamValue, optional?: boolean, label?: string, resolve?: ValueResolver<any, any> } export type OperationParamPrimitive = number|boolean|string; export type OperationParamValue = OperationParamPrimitive|OperationParamPrimitive[]|OperationParams; export type OperationParams = { [key: string]: OperationParamValue; } export type MaterializedOperationParams = { [key: string]: any; } export type OperationParamsError = { path: string[], message: string }; export type OperationParamsErrorReporter = ((msg: string) => void) & { dot: (pathPart: string|number) => OperationParamsErrorReporter }; export type ValueResolver<IN, OUT> = (ctx: ApplicationContext, value: IN, md: SchemaField, reportError: OperationParamsErrorReporter) => OUT; export function flattenPath(path: ParamsPath): string { return path.join('/'); } export function schemaIterator(schema: OperationSchema, callback: (path: string[], flattenedPath: string, field: PrimitiveSchemaField) => void) { function inorder(schema: OperationSchema, parentPath: string[]) { Object.keys(schema).forEach(key => { const path = [...parentPath, key] const flattenedPath = flattenPath(path); const schemaField = schema[key]; if (schemaField.type === 'object') { inorder(schemaField.schema, path); } else { callback(path, flattenedPath, schemaField as PrimitiveSchemaField); } }) } inorder(schema, []); } export function unwrapMetadata(fieldMd: SchemaField) { if (fieldMd.type === Types.array) { return unwrapMetadata(fieldMd.items|| (fieldMd as any).itemType // backward compatibility, remove me ); } return fieldMd; } export const isValueNotProvided = value => value === undefined || value === null || value === ''; ```
/content/code_sandbox/web/app/cad/craft/schema/schema.ts
xml
2016-08-26T21:55:19
2024-08-15T01:02:53
jsketcher
xibyte/jsketcher
1,461
634
```xml declare interface ITeamsListWebPartStrings { PropertyPaneDescription: string; BasicGroupName: string; DescriptionFieldLabel: string; AppLocalEnvironmentSharePoint: string; AppLocalEnvironmentTeams: string; AppSharePointEnvironment: string; AppTeamsTabEnvironment: string; } declare module 'TeamsListWebPartStrings' { const strings: ITeamsListWebPartStrings; export = strings; } ```
/content/code_sandbox/samples/react-kiota-custom-api-client/teamified-client/src/webparts/teamsList/loc/mystrings.d.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
91
```xml import has from 'ramda/src/has'; import { Fiats } from '@config'; import { TFiatTicker, TTicker } from '@types'; /* Typeguard to determine if a given ticker is a TFiatTicker */ const isFiatTicker = (ticker: TTicker): ticker is TFiatTicker => has(ticker)(Fiats); export default isFiatTicker; ```
/content/code_sandbox/src/utils/isFiatTicker.ts
xml
2016-12-04T01:35:27
2024-08-14T21:41:58
MyCrypto
MyCryptoHQ/MyCrypto
1,347
82
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import hasBigInt64ArraySupport = require( './index' ); // TESTS // // The function returns a boolean... { hasBigInt64ArraySupport(); // $ExpectType boolean } // The compiler throws an error if the function is provided arguments... { hasBigInt64ArraySupport( true ); // $ExpectError hasBigInt64ArraySupport( [], 123 ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/assert/has-bigint64array-support/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
131
```xml import semver from 'semver'; import { DoctorCheck, DoctorCheckParams, DoctorCheckResult } from './checks.types'; export interface DoctorMultiCheckItemBase { getMessage: ((packageName: string) => string) | (() => string); sdkVersionRange: string; } // export abstract class DoctorMultiCheck<TCheckItem extends DoctorMultiCheckItemBase> implements DoctorCheck { abstract readonly checkItems: TCheckItem[]; abstract description: string; // will be the most permissive semver for all check items abstract sdkVersionRange: string; protected abstract runAsyncInner( params: DoctorCheckParams, checkItems: TCheckItem[] ): Promise<DoctorCheckResult>; async runAsync(params: DoctorCheckParams): Promise<DoctorCheckResult> { const filteredCheckItems = this.checkItems.filter( (check) => params.exp.sdkVersion === 'UNVERSIONED' || semver.satisfies(params.exp.sdkVersion!, check.sdkVersionRange) ); return this.runAsyncInner(params, filteredCheckItems); } } ```
/content/code_sandbox/packages/expo-doctor/src/checks/DoctorMultiCheck.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
229
```xml #import "ViewController.h" #ifdef BUILD_LITE_INTERPRETER #import "Benchmark.h" #endif @interface ViewController () @property(nonatomic, strong) UITextView* textView; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; #ifdef BUILD_LITE_INTERPRETER self.textView = [[UITextView alloc] initWithFrame:self.view.bounds]; self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view addSubview:self.textView]; NSData* configData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"config" ofType:@"json"]]; if (!configData) { NSLog(@"Config.json not found!"); return; } NSError* err; NSDictionary* config = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingAllowFragments error:&err]; if (err) { NSLog(@"Parse config.json failed!"); return; } // NB: When running tests on device, we need an empty app to launch the tests #ifdef RUN_BENCHMARK [Benchmark setup:config]; [self runBenchmark]; #endif #endif } #ifdef BUILD_LITE_INTERPRETER - (void)runBenchmark { self.textView.text = @"Start benchmarking...\n"; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSString* text = [Benchmark run]; dispatch_async(dispatch_get_main_queue(), ^{ self.textView.text = [self.textView.text stringByAppendingString:text]; }); }); } #endif @end ```
/content/code_sandbox/ios/TestApp/TestApp/ViewController.mm
xml
2016-08-13T05:26:41
2024-08-16T19:59:14
pytorch
pytorch/pytorch
81,372
314
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>${PODS_DEVELOPMENT_LANGUAGE}</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIdentifier</key> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>10.0.1</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>${CURRENT_PROJECT_VERSION}</string> <key>NSPrincipalClass</key> <string></string> </dict> </plist> ```
/content/code_sandbox/iMessageDemo/Pods/Target Support Files/SwiftMessages/SwiftMessages-Info.plist
xml
2016-08-08T16:17:15
2024-08-15T15:22:50
SwiftMessages
SwiftKickMobile/SwiftMessages
7,286
259
```xml /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import format from 'date-fns/format'; import { BaseEntity } from './BaseEntity'; export class TimeBased extends BaseEntity { displayName!: String; username!: String; digits!: String; period!: String; sharedSecret!: String; hexSharedSecret!: String; rqCode!: String; otp!: string; } ```
/content/code_sandbox/maxkey-web-frontend/maxkey-web-app/src/app/entity/TimeBased.ts
xml
2016-11-16T03:06:50
2024-08-16T09:22:42
MaxKey
dromara/MaxKey
1,423
110
```xml export * from './components/CarouselCard/index'; ```
/content/code_sandbox/packages/react-components/react-carousel-preview/library/src/CarouselCard.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
11
```xml import {JsonResponse} from "../../domain/JsonResponse.js"; import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function operationResponseMapper(jsonResponse: JsonResponse, options: JsonSchemaOptions = {}) { const response = execMapper("map", [jsonResponse], options); if (jsonResponse.status === 204) { delete response.content; } if (response.headers) { Object.entries(response.headers).forEach(([key, {type, ...props}]: [string, any]) => { response.headers[key] = { ...props, schema: { type } }; }); } return response; } registerJsonSchemaMapper("operationResponse", operationResponseMapper); ```
/content/code_sandbox/packages/specs/schema/src/components/open-spec/operationResponseMapper.ts
xml
2016-02-21T18:38:47
2024-08-14T21:19:48
tsed
tsedio/tsed
2,817
175
```xml import React from 'react'; import { BenchmarkType } from '../app/Benchmark'; interface IBox { color?: number; layout?: 'column' | 'row'; outer?: boolean; fixed?: boolean; } interface ITree { breadth: number; components: { Box: React.FC<IBox>; }; depth: number; id: number; wrap: number; } export default function Tree({ breadth, components, depth, id, wrap }: ITree) { const { Box } = components; let result = ( <Box color={id % 3} layout={depth % 2 === 0 ? 'column' : 'row'} outer> {depth === 0 && <Box color={(id % 3) + 3} fixed />} {depth !== 0 && Array.from({ length: breadth }).map((el, i) => ( <Tree breadth={breadth} components={components} depth={depth - 1} id={i} key={i} wrap={wrap} /> ))} </Box> ); for (let i = 0; i < wrap; i++) { result = <Box>{result}</Box>; } return result; } Tree.displayName = 'Tree'; Tree.benchmarkType = BenchmarkType.MOUNT; ```
/content/code_sandbox/packages/benchmarks/src/cases/Tree.tsx
xml
2016-08-16T06:41:32
2024-08-16T12:59:53
styled-components
styled-components/styled-components
40,332
290
```xml // /// <reference types="mocha" /> // import { assert } from 'chai'; // describe('PropertyBagGlobalNavWebPart', () => { // it('should do something', () => { // assert.ok(true); // }); // }); ```
/content/code_sandbox/samples/react-property-bag-editor/src/webparts/propertyBagGlobalNav/tests/PropertyBagGlobalNav.test.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
55
```xml import { Descendant, BaseEditor, BaseRange, Range, Element } from 'slate' import { ReactEditor } from 'slate-react' import { HistoryEditor } from 'slate-history' export type BlockQuoteElement = { type: 'block-quote' align?: string children: Descendant[] } export type BulletedListElement = { type: 'bulleted-list' align?: string children: Descendant[] } export type CheckListItemElement = { type: 'check-list-item' checked: boolean children: Descendant[] } export type EditableVoidElement = { type: 'editable-void' children: EmptyText[] } export type HeadingElement = { type: 'heading' align?: string children: Descendant[] } export type HeadingTwoElement = { type: 'heading-two' align?: string children: Descendant[] } export type ImageElement = { type: 'image' url: string children: EmptyText[] } export type LinkElement = { type: 'link'; url: string; children: Descendant[] } export type ButtonElement = { type: 'button'; children: Descendant[] } export type BadgeElement = { type: 'badge'; children: Descendant[] } export type ListItemElement = { type: 'list-item'; children: Descendant[] } export type MentionElement = { type: 'mention' character: string children: CustomText[] } export type ParagraphElement = { type: 'paragraph' align?: string children: Descendant[] } export type TableElement = { type: 'table'; children: TableRow[] } export type TableCellElement = { type: 'table-cell'; children: CustomText[] } export type TableRowElement = { type: 'table-row'; children: TableCell[] } export type TitleElement = { type: 'title'; children: Descendant[] } export type VideoElement = { type: 'video'; url: string; children: EmptyText[] } export type CodeBlockElement = { type: 'code-block' language: string children: Descendant[] } export type CodeLineElement = { type: 'code-line' children: Descendant[] } type CustomElement = | BlockQuoteElement | BulletedListElement | CheckListItemElement | EditableVoidElement | HeadingElement | HeadingTwoElement | ImageElement | LinkElement | ButtonElement | BadgeElement | ListItemElement | MentionElement | ParagraphElement | TableElement | TableRowElement | TableCellElement | TitleElement | VideoElement | CodeBlockElement | CodeLineElement export type CustomText = { bold?: boolean italic?: boolean code?: boolean text: string } export type EmptyText = { text: string } export type CustomEditor = BaseEditor & ReactEditor & HistoryEditor & { nodeToDecorations?: Map<Element, Range[]> } declare module 'slate' { interface CustomTypes { Editor: CustomEditor Element: CustomElement Text: CustomText | EmptyText Range: BaseRange & { [key: string]: unknown } } } ```
/content/code_sandbox/site/examples/custom-types.d.ts
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
713
```xml import { execSync } from 'child_process'; import { AllPackageInfo, getAllPackageInfo, isConvergedPackage } from '@fluentui/scripts-monorepo'; import * as semver from 'semver'; import yargs from 'yargs'; function tagPackages(npmToken: string) { const packagesToTag = getPackagesToTag(); let success = true; packagesToTag.forEach(pkg => { if (!tagPackage(pkg.name, pkg.version, npmToken)) { success = false; } }); if (!success) { console.error('failed to tag all packages'); process.exit(1); } } function tagPackage(name: string, version: string, npmToken: string): boolean { const prerelease = semver.parse(version)?.prerelease; // eslint-disable-next-line eqeqeq if (prerelease == null || prerelease.length === 0) { return true; } const prereleaseTag = prerelease[0]; const command = `npm dist-tag add ${name}@${version} ${prereleaseTag} --registry path_to_url --//registry.npmjs.org/:_authToken=${npmToken}`; console.log(command); try { execSync(command, { stdio: 'inherit' }); } catch (e) { console.error(`failed to tag ${name}@${version}`); console.error(e); return false; } return true; } function getPackagesToTag() { const packageInfos: AllPackageInfo = getAllPackageInfo(isConvergedPackage); return Object.values(packageInfos) .map(packageInfo => { if (!packageInfo.packageJson.private) { return { name: packageInfo.packageJson.name, version: packageInfo.packageJson.version, }; } return; }) .filter(Boolean) as Array<{ name: string; version: string }> | []; } function main(argv: yargs.Arguments) { if (!argv.token || typeof argv.token !== 'string') { throw new Error('Please pass an NPM token through the --token argument'); } tagPackages(argv.token); } if (require.main === module && process.env.RELEASE_VNEXT) { main(yargs.argv); } else { console.log('"RELEASE_VNEXT" not set - skipping'); } ```
/content/code_sandbox/scripts/executors/src/tag-react-components.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
498
```xml export interface ITerm { id: string; title: string; } ```
/content/code_sandbox/samples/react-news-extension/src/webparts/preferences/types/Component.Types.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
17
```xml import { hsv2rgb } from './hsv2rgb'; import { rgb2hex } from './rgb2hex'; import { _rgbaOrHexString } from './_rgbaOrHexString'; import type { IColor } from './interfaces'; /** * Gets a color with the same hue as `color` and other components updated to match the given * saturation and value. * * Does not modify the original `color` and does not supply a default alpha value. */ export function updateSV(color: IColor, s: number, v: number): IColor { const { r, g, b } = hsv2rgb(color.h, s, v); const hex = rgb2hex(r, g, b); return { ...color, s, v, r, g, b, hex, str: _rgbaOrHexString(r, g, b, color.a, hex), }; } ```
/content/code_sandbox/packages/react/src/utilities/color/updateSV.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
196
```xml /* * * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file. */ import { Event, Logger, Style, TerminalEnvironment } from '@extraterm/extraterm-extension-api'; import { Direction, Key, QAction, QKeyEvent, QLineEdit, QPoint, QPushButton, QSizePolicyPolicy, QVariant, QWidget, TextFormat, WidgetAttribute, WindowType } from "@nodegui/nodegui"; import { BoxLayout, GridLayout, Label, LineEdit, Menu, PushButton, Widget } from "qt-construct"; import { EventEmitter } from "extraterm-event-emitter"; import { Segment, TemplateString } from './TemplateString.js'; import { TitlePreview } from './TitlePreview.js'; export interface TemplateEditorOptions { icons?: boolean; title: string; } export class TemplateEditor { #widget: QWidget; #style: Style; #templateString: TemplateString; #titlePreview: TitlePreview = null; #showIcons = true; #onAcceptEventEmitter = new EventEmitter<void>(); onAccept: Event<void> = null; #onCancelEventEmitter = new EventEmitter<void>(); onCancel: Event<void> = null; #onTemplateChangedEventEmitter = new EventEmitter<string>(); onTemplateChanged: Event<string> = null; #templateLineEdit: QLineEdit = null; constructor(templateString: TemplateString, style: Style, log: Logger, templateEditorOptions: TemplateEditorOptions) { this.#showIcons = templateEditorOptions == null ? true : (templateEditorOptions.icons ?? true); this.onAccept = this.#onAcceptEventEmitter.event; this.onCancel = this.#onCancelEventEmitter.event; this.onTemplateChanged = this.#onTemplateChangedEventEmitter.event; this.#templateString = templateString; this.#style = style; let iconButton: QPushButton = null; const fieldList = [ ["Title", TerminalEnvironment.TERM_TITLE], ["Rows", TerminalEnvironment.TERM_ROWS], ["Columns", TerminalEnvironment.TERM_COLUMNS], ["Current command", TerminalEnvironment.EXTRATERM_CURRENT_COMMAND], ["Last command", TerminalEnvironment.EXTRATERM_LAST_COMMAND], ["Current command line", TerminalEnvironment.EXTRATERM_CURRENT_COMMAND_LINE], ["Last command line", TerminalEnvironment.EXTRATERM_LAST_COMMAND_LINE], ["Exit code", TerminalEnvironment.EXTRATERM_EXIT_CODE], ]; const fieldMenu = Menu({ onTriggered: (nativeAction) => { const action = new QAction(nativeAction); this.#insertText("${" + action.data().toString() + "}"); } }); for (const item of fieldList) { const action = fieldMenu.addAction(`${item[0]} $\{${item[1]}\}`); action.setData(new QVariant(item[1])); } if (this.#showIcons) { const iconPopup = this.#createIconPopup((iconName: string): void => { this.#insertText("${icon:" + iconName +"}"); iconPopup.hide(); }); iconButton = PushButton({ text: "Insert Icon", cssClass: ["group-right", "small"], onClicked: () => { if (iconPopup.isVisible()) { iconPopup.hide(); return; } this.#positionAround(iconPopup, iconButton); iconPopup.raise(); iconPopup.show(); } }); } this.#titlePreview = new TitlePreview(this.#templateString, this.#style, log); this.#titlePreview.onSegmentClicked((segment: Segment): void => { this.#templateLineEdit.setSelection(segment.startColumn, segment.endColumn - segment.startColumn); this.#templateLineEdit.setFocus(); }); this.#widget = Widget({ contentsMargins: 0, layout: GridLayout({ columns: 2, contentsMargins: 0, children: [ Label({ textFormat: TextFormat.RichText, text: this.#style.createHtmlIcon("fa-pencil-alt") + templateEditorOptions.title }), { layout: BoxLayout({ direction: Direction.LeftToRight, contentsMargins: 0, children: [ this.#templateLineEdit = LineEdit({ text: templateString.getTemplateString(), onTextEdited: (newText: string) => { this.#templateStringChanged(); }, onKeyPress: this.#onKeyPress.bind(this), }), { layout: BoxLayout({ direction: Direction.LeftToRight, contentsMargins: 0, spacing: 0, children: [ PushButton({ text: "Insert Field", cssClass: [this.#showIcons ? "group-left" : "", "small"], menu: fieldMenu }), iconButton ] }) } ] }) }, Widget({ contentsMargins: 0 }), this.#titlePreview.getWidget() ] }) }); } #onKeyPress(nativeEvent): void { const event = new QKeyEvent(nativeEvent); const key = event.key(); if(key !== Key.Key_Escape && key !== Key.Key_Enter && key !== Key.Key_Return) { return; } event.accept(); this.#templateLineEdit.setEventProcessed(true); if(key === Key.Key_Escape) { this.#onCancelEventEmitter.fire(); } else { this.#onAcceptEventEmitter.fire(); } } getWidget(): QWidget { return this.#widget; } setTemplateText(text: string): void { this.#templateLineEdit.setText(text); this.#templateStringChanged(); } focus(): void { this.#templateLineEdit.setFocus(); } #insertText(text: string): void { this.#templateLineEdit.insert(text); this.#templateStringChanged(); } #templateStringChanged(): void { const string = this.#templateLineEdit.text(); this.#templateString.setTemplateString(string); this.#titlePreview.templateStringUpdated(); this.#onTemplateChangedEventEmitter.fire(string); } #createIconPopup(iconSelectedFunc: (iconName: string) => void): QWidget { const ICONS_PER_ROW = 10; const iconList: string[] = [ "fa-linux", "fa-windows", "fa-apple", "fa-android", "fa-ubuntu", "fa-fedora", "fa-redhat", "fa-suse", "fa-centos", "fa-freebsd", "fa-keyboard", "fa-terminal", "fa-docker", "fa-laptop", "fa-desktop", "fa-server", "fa-database", "fa-microchip", "fa-mobile-alt", "fa-tablet-alt", "fa-bug", "fa-code", "fa-git", "fa-code-branch", "fa-sitemap", "fa-cloud", "fa-upload", "fa-download", "fa-comments", "fa-envelope", "fa-home", "fa-building", "fa-industry", "fa-city", "fa-robot", "fa-raspberry-pi", "fa-bolt", "fa-exclamation-triangle", "fa-shield-alt", "fa-usb", ]; const buttonStyleSheet = ` QPushButton[cssClass~="terminal-title"] { background-color: transparent; border: 0px; border-radius: 0px; } QPushButton[cssClass~="terminal-title"]:hover { background-color: ${this.#style.palette.backgroundSelected}; } `; const iconPopup = Widget({ cssClass: ["window-background"], windowFlag: WindowType.Popup, contentsMargins: 0, attribute: [WidgetAttribute.WA_WindowPropagation, WidgetAttribute.WA_X11NetWmWindowTypePopupMenu], sizePolicy: { vertical: QSizePolicyPolicy.Minimum, horizontal: QSizePolicyPolicy.Minimum, }, layout: GridLayout({ columns: ICONS_PER_ROW, spacing: 0, contentsMargins: [0, 0, 0, 0], children: iconList.map(iconName => { const icon = this.#style.createQIcon(<any> iconName); const hoverIcon = this.#style.createQIcon(<any> iconName, this.#style.palette.textHighlight); const pb = PushButton({ cssClass: ["terminal-title"], toolTip: "${icon:" + iconName + "}", icon, sizePolicy: { vertical: QSizePolicyPolicy.Minimum, horizontal: QSizePolicyPolicy.Minimum, }, onClicked: () => { iconSelectedFunc(iconName); }, onEnter: () => { pb.setIcon(hoverIcon); }, onLeave: () => { pb.setIcon(icon); } }); pb.setStyleSheet(buttonStyleSheet, false); return pb; }), }) }); return iconPopup; } #positionAround(popup: QWidget, target: QWidget): void { const rect = target.geometry(); const hint = popup.sizeHint(); const bottomLeft = target.mapToGlobal(new QPoint(0, rect.height())); let x = bottomLeft.x(); let y = bottomLeft.y(); const screenGeometry = target.window().windowHandle().screen().geometry(); if (y + hint.height() > screenGeometry.height()) { const topLeft = target.mapToGlobal(new QPoint(0, 0)); y = topLeft.y() - hint.height(); } x = Math.min(x, screenGeometry.width() - hint.width()); popup.setGeometry(x, y, hint.width(), hint.height()); } } ```
/content/code_sandbox/extensions/TerminalTitle/src/TemplateEditor.ts
xml
2016-03-04T12:39:59
2024-08-16T18:44:37
extraterm
sedwards2009/extraterm
2,501
2,063
```xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="path_to_url" xmlns:app="path_to_url" > <item android:title="@string/search" android:id="@+id/menu_search_chat" app:actionViewClass="androidx.appcompat.widget.SearchView" app:showAsAction="collapseActionView|never" /> <item android:title="0/0" android:id="@+id/menu_search_counter" android:visible="false" app:showAsAction="always"/> <item android:title="@string/back" android:id="@+id/menu_search_up" android:icon="@drawable/ic_search_up" android:visible="false" app:showAsAction="always"/> <item android:title="@string/next" android:id="@+id/menu_search_down" android:icon="@drawable/ic_search_down" android:visible="false" app:showAsAction="always"/> <item android:id="@+id/menu_ephemeral_messages" android:title="@string/ephemeral_messages" /> <item android:title="@string/menu_mute" android:id="@+id/menu_mute_notifications"/> <item android:id="@+id/menu_show_map" android:title="@string/tab_map" android:icon="@drawable/ic_map_white_24dp" app:showAsAction="ifRoom" /> <item android:title="@string/menu_archive_chat" android:id="@+id/menu_archive_chat"/> <item android:title="@string/menu_more_options"> <menu> <item android:title="@string/menu_add_attachment" android:id="@+id/menu_add_attachment" /> <item android:id="@+id/menu_leave" android:visible="false" android:title="@string/menu_leave_group"/> <item android:title="@string/clear_chat" android:id="@+id/menu_clear_chat"/> <item android:title="@string/menu_delete_chat" android:id="@+id/menu_delete_chat"/> </menu> </item> </menu> ```
/content/code_sandbox/src/main/res/menu/conversation.xml
xml
2016-07-03T07:32:36
2024-08-16T16:51:15
deltachat-android
deltachat/deltachat-android
1,082
440
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>libswresample</string> <key>CFBundleIdentifier</key> <string>com.arthenica.ffmpegkit.Libswresample</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>libswresample</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>3.8.100</string> <key>CFBundleVersion</key> <string>3.8.100</string> <key>CFBundleSignature</key> <string>????</string> <key>MinimumOSVersion</key> <string>12.1</string> <key>CFBundleSupportedPlatforms</key> <array> <string>iPhoneOS</string> </array> <key>NSPrincipalClass</key> <string></string> </dict> </plist> ```
/content/code_sandbox/osu.Framework.iOS/runtimes/ios/native/libswresample.xcframework/ios-arm64/libswresample.framework/Info.plist
xml
2016-08-26T03:45:35
2024-08-16T05:03:32
osu-framework
ppy/osu-framework
1,618
302
```xml <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net8.0-windows10.0.17763.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <UseWPF>True</UseWPF> <DebugType>embedded</DebugType> <Platforms>AnyCPU;ARM64;x64;x86</Platforms> <Version>2.41.0</Version> <SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion> <!--<UseWindowsForms>True</UseWindowsForms>--> </PropertyGroup> <ItemGroup> <PackageReference Include="KGySoft.CoreLibraries" Version="8.1.0" /> <PackageReference Include="System.Drawing.Common" Version="8.0.0" /> </ItemGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <UseVSHostingProcess>true</UseVSHostingProcess> <PlatformTarget>AnyCPU</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> <PlatformTarget>x64</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> <PlatformTarget>x64</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PlatformTarget>x86</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PlatformTarget>x86</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <PlatformTarget>ARM64</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <PlatformTarget>ARM64</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>$(DefineConstants)</DefineConstants> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\ScreenToGif.Model\ScreenToGif.Domain.csproj" /> </ItemGroup> </Project> ```
/content/code_sandbox/ScreenToGif.Util/ScreenToGif.Util.csproj
xml
2016-08-02T01:28:59
2024-08-16T05:33:15
ScreenToGif
NickeManarin/ScreenToGif
23,310
869
```xml <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="path_to_url"> <PropertyGroup> <TargetFramework>$(SdkTargetFramework)</TargetFramework> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId> <SignAssembly>true</SignAssembly> <PublicSign Condition=" '$([MSBuild]::IsOSPlatform(`Windows`))' == 'false' ">true</PublicSign> <RepositoryType>git</RepositoryType> <DefineConstants Condition="'$(IncludeAspNetCoreRuntime)' == 'false'">$(DefineConstants);EXCLUDE_ASPNETCORE</DefineConstants> <IsPackable>true</IsPackable> </PropertyGroup> <ItemGroup> <EmbeddedResource Update="**\*.resx" GenerateSource="true" /> </ItemGroup> <ItemGroup> <PackageReference Include="NuGet.Common" /> <PackageReference Include="NuGet.Configuration" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj" /> <ProjectReference Include="..\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj" /> </ItemGroup> <ItemGroup> <Compile Include="$(RepoRoot)src\Common\CliFolderPathCalculatorCore.cs" LinkBase="Common"/> </ItemGroup> </Project> ```
/content/code_sandbox/src/Cli/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj
xml
2016-07-22T21:26:02
2024-08-16T17:23:58
sdk
dotnet/sdk
2,627
318
```xml // See LICENSE.txt for license information. // ******************************************************************* // - [#] indicates a test step (e.g. # Go to a screen) // - [*] indicates an assertion (e.g. * Check the title) // - Use element testID when selecting an element. Create one if none. // ******************************************************************* import {Setup} from '@support/server_api'; import { serverOneUrl, siteOneUrl, } from '@support/test_config'; import {Autocomplete} from '@support/ui/component'; import { ChannelListScreen, ChannelScreen, HomeScreen, LoginScreen, ServerScreen, } from '@support/ui/screen'; import {getRandomId, timeouts, wait} from '@support/utils'; import {expect} from 'detox'; describe('Autocomplete - Emoji Suggestion', () => { const serverOneDisplayName = 'Server 1'; const channelsCategory = 'channels'; const emojiName = 'fox_face'; const emojiNameFirst2Chars = emojiName.substring(0, 2); const emojiName3rdToLastChars = emojiName.substring(2); let emojiSuggestionAutocomplete: any; beforeAll(async () => { const {channel, user} = await Setup.apiInit(siteOneUrl); ({emojiSuggestionItem: emojiSuggestionAutocomplete} = Autocomplete.getEmojiSuggestionItem(emojiName)); // # Log in to server await ServerScreen.connectToServer(serverOneUrl, serverOneDisplayName); await LoginScreen.login(user); // * Verify on channel list screen await ChannelListScreen.toBeVisible(); // # Open a channel screen await ChannelScreen.open(channelsCategory, channel.name); }); beforeEach(async () => { // # Clear post input await ChannelScreen.postInput.clearText(); // * Verify autocomplete is not displayed await Autocomplete.toBeVisible(false); }); afterAll(async () => { // # Log out await ChannelScreen.back(); await HomeScreen.logout(); }); it('MM-T4880_1 - should suggest emoji based on emoji name', async () => { // # Type in ":" then first 2 characters of emoji name to activate emoji suggestion autocomplete await ChannelScreen.postInput.typeText(`:${emojiNameFirst2Chars}`); await Autocomplete.toBeVisible(); // * Verify emoji suggestion list is displayed await expect(Autocomplete.flatEmojiSuggestionList).toBeVisible(); // # Type in 3rd to last characters of emoji name await ChannelScreen.postInput.typeText(emojiName3rdToLastChars); // * Verify emoji suggestion autocomplete contains associated emoji suggestion await expect(emojiSuggestionAutocomplete).toBeVisible(); }); it('MM-T4880_2 - should suggest emoji based on uppercase emoji name', async () => { // # Type in ":" then uppercase first 2 characters of emoji name to activate emoji suggestion autocomplete await ChannelScreen.postInput.typeText(`:${emojiNameFirst2Chars.toUpperCase()}`); await Autocomplete.toBeVisible(); // * Verify emoji suggestion list is displayed await expect(Autocomplete.flatEmojiSuggestionList).toBeVisible(); // # Type in uppercase 3rd to last characters of emoji name await ChannelScreen.postInput.typeText(emojiName3rdToLastChars.toUpperCase()); // * Verify emoji suggestion autocomplete contains associated emoji suggestion await expect(emojiSuggestionAutocomplete).toBeVisible(); }); it('MM-T4880_3 - should suggest emoji based on partial emoji name', async () => { // # Type in ":" then first 2 characters of emoji name to activate emoji suggestion autocomplete await ChannelScreen.postInput.typeText(`:${emojiNameFirst2Chars}`); await Autocomplete.toBeVisible(); // * Verify emoji suggestion list is displayed await expect(Autocomplete.flatEmojiSuggestionList).toBeVisible(); // # Type in partial emoji name await ChannelScreen.postInput.typeText(`${emojiName.substring(2, 4)}`); // * Verify emoji suggestion autocomplete contains associated emoji suggestion await expect(emojiSuggestionAutocomplete).toBeVisible(); }); it('MM-T4880_4 - should stop suggesting emoji after emoji name with trailing space', async () => { // # Type in ":" then first 2 characters of emoji name to activate emoji suggestion autocomplete await ChannelScreen.postInput.typeText(`:${emojiNameFirst2Chars}`); await Autocomplete.toBeVisible(); // * Verify emoji suggestion list is displayed await expect(Autocomplete.flatEmojiSuggestionList).toBeVisible(); // # Type in 3rd to last characters of emoji name await ChannelScreen.postInput.typeText(emojiName3rdToLastChars); // * Verify emoji suggestion autocomplete contains associated emoji suggestion await expect(emojiSuggestionAutocomplete).toBeVisible(); // # Type in trailing space await ChannelScreen.postInput.typeText(' '); await wait(timeouts.ONE_SEC); // * Verify emoji suggestion autocomplete does not contain associated emoji suggestion await expect(emojiSuggestionAutocomplete).not.toBeVisible(); }); it('MM-T4880_5 - should stop suggesting emoji when keyword is not associated with any emoji', async () => { // # Type in ":" then first 2 characters of emoji name to activate emoji suggestion autocomplete await ChannelScreen.postInput.typeText(`:${emojiNameFirst2Chars}`); await Autocomplete.toBeVisible(); // * Verify emoji suggestion list is displayed await expect(Autocomplete.flatEmojiSuggestionList).toBeVisible(); // # Type in keyword not associated with any emoji await ChannelScreen.postInput.typeText(getRandomId()); // * Verify emoji suggestion autocomplete does not contain associated emoji suggestion await expect(emojiSuggestionAutocomplete).not.toBeVisible(); }); it('MM-T4880_6 - should be able to select emoji suggestion multiple times', async () => { // # Type in ":" then first 2 characters of emoji name to activate emoji suggestion autocomplete await expect(Autocomplete.flatEmojiSuggestionList).not.toBeVisible(); await ChannelScreen.postInput.typeText(`:${emojiNameFirst2Chars}`); // * Verify emoji suggestion list is displayed await expect(Autocomplete.flatEmojiSuggestionList).toBeVisible(); // # Type in 3rd to last characters of emoji name and tap on emoji suggestion autocomplete await ChannelScreen.postInput.typeText(emojiName3rdToLastChars); await emojiSuggestionAutocomplete.tap(); // * Verify emoji suggestion list disappears await expect(Autocomplete.flatEmojiSuggestionList).not.toBeVisible(); // # Type in ":" then first 2 characters of emoji name again to re-activate emoji suggestion list await ChannelScreen.postInput.typeText(`:${emojiNameFirst2Chars}`); // * Verify emoji suggestion list is displayed await expect(Autocomplete.flatEmojiSuggestionList).toBeVisible(); }); }); ```
/content/code_sandbox/detox/e2e/test/autocomplete/emoji_suggestion.e2e.ts
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
1,472
```xml import React, { useEffect, useRef, useState } from 'react'; import { FocusScope } from 'react-aria'; import { Input } from 'react-aria-components'; export const EditableInput = ({ value = 'Untitled', ariaLabel, editable = false, name, className, onSubmit, onEditableChange, }: { value: string; ariaLabel?: string; editable?: boolean; onEditableChange?: (editable: boolean) => void; name?: string; className?: string; onSubmit: (value: string) => void; }) => { const [isEditable, setIsEditable] = useState(editable); const editableRef = useRef<HTMLDivElement>(null); useEffect(() => { setIsEditable(editable); } , [editable]); useEffect(() => { if (!isEditable) { return; } const keysToIgnore = [ 'Enter', 'Escape', ]; function lockKeyDownToInput(e: KeyboardEvent) { if (keysToIgnore.includes(e.key)) { return; } e.stopPropagation(); } window.addEventListener('keydown', lockKeyDownToInput, { capture: true }); return () => { window.removeEventListener('keydown', lockKeyDownToInput, { capture: true, }); }; }, [isEditable]); function onDoubleClick(e: React.MouseEvent<HTMLDivElement, MouseEvent>) { e.stopPropagation(); e.preventDefault(); setIsEditable(true); onEditableChange?.(true); } return ( <> <div ref={editableRef} className={ `items-center truncate justify-center data-[pressed]:bg-[--hl-sm] rounded-sm text-[--color-font] hover:bg-[--hl-xs] focus:ring-inset ring-1 ring-transparent focus:ring-[--hl-md] transition-all ${isEditable ? 'hidden' : ''} ${className || 'px-2'} ` } onDoubleClick={onDoubleClick} data-editable aria-label={ariaLabel} > <span className="truncate">{value}</span> </div> {isEditable && ( <FocusScope contain restoreFocus autoFocus> <Input className={`truncate ${className || 'px-2'}`} name={name} aria-label={ariaLabel} defaultValue={value} onKeyDown={e => { const value = e.currentTarget.value; if (e.key === 'Enter') { e.stopPropagation(); onSubmit(value); setIsEditable(false); onEditableChange?.(false); } if (e.key === 'Escape') { e.stopPropagation(); setIsEditable(false); onEditableChange?.(false); } }} onBlur={e => { const value = e.currentTarget.value; onSubmit(value); setIsEditable(false); onEditableChange?.(false); }} /> </FocusScope> )} </> ); }; ```
/content/code_sandbox/packages/insomnia/src/ui/components/editable-input.tsx
xml
2016-04-23T03:54:26
2024-08-16T16:50:44
insomnia
Kong/insomnia
34,054
628
```xml import React, {PureComponent} from 'react' import DatabaseList from 'src/shared/components/DatabaseList' import MeasurementList from 'src/shared/components/MeasurementList' import FieldList from 'src/shared/components/FieldList' import {defaultEveryFrequency} from 'src/kapacitor/constants' import {SourceContext} from 'src/CheckSources' import { ApplyFuncsToFieldArgs, Field, Namespace, QueryConfig, Source, TimeRange, Tag, } from 'src/types' import {KapacitorQueryConfigActions} from 'src/types/actions' interface Props { actions: KapacitorQueryConfigActions query: QueryConfig isDeadman: boolean isKapacitorRule: boolean onAddEvery: (every?: string) => void timeRange: TimeRange } class DataSection extends PureComponent<Props> { public render() { const {query, isDeadman, isKapacitorRule, onAddEvery} = this.props return ( <SourceContext.Consumer> {(source: Source) => ( <div className="rule-section"> <div className="query-builder"> <DatabaseList query={query} onChooseNamespace={this.handleChooseNamespace} /> <MeasurementList query={query} onChooseMeasurement={this.handleChooseMeasurement} onChooseTag={this.handleChooseTag} onGroupByTag={this.handleGroupByTag} onToggleTagAcceptance={this.handleToggleTagAcceptance} isKapacitorRule={isKapacitorRule} /> {isDeadman ? null : ( <FieldList query={query} applyFuncsToField={this.handleApplyFuncsToField(onAddEvery)} onGroupByTime={this.handleGroupByTime} onToggleField={this.handleToggleField} removeFuncs={this.handleRemoveFuncs} isKapacitorRule={isKapacitorRule} source={source} /> )} </div> </div> )} </SourceContext.Consumer> ) } private handleChooseNamespace = (namespace: Namespace): void => { const {actions, query} = this.props actions.chooseNamespace(query.id, namespace) } private handleChooseMeasurement = (measurement: string): void => { const {actions, query} = this.props actions.chooseMeasurement(query.id, measurement) } private handleToggleField = (field: Field): void => { const {actions, query} = this.props actions.toggleField(query.id, field) } private handleGroupByTime = (time: string): void => { const {actions, query} = this.props actions.groupByTime(query.id, time) } private handleApplyFuncsToField = (onAddEvery: (every: string) => void) => ( fieldFunc: ApplyFuncsToFieldArgs ): void => { const {actions, query} = this.props actions.applyFuncsToField(query.id, fieldFunc) onAddEvery(defaultEveryFrequency) } private handleChooseTag = (tag: Tag): void => { const {actions, query} = this.props actions.chooseTag(query.id, tag) } private handleToggleTagAcceptance = (): void => { const {actions, query} = this.props actions.toggleTagAcceptance(query.id) } private handleGroupByTag = (tagKey: string): void => { const {actions, query} = this.props actions.groupByTag(query.id, tagKey) } private handleRemoveFuncs = (fields: Field[]): void => { const {actions, query} = this.props actions.removeFuncs(query.id, fields) } } export default DataSection ```
/content/code_sandbox/ui/src/kapacitor/components/DataSection.tsx
xml
2016-08-24T23:28:56
2024-08-13T19:50:03
chronograf
influxdata/chronograf
1,494
837
```xml import { ContentType } from '@standardnotes/domain-core' import { ThemeFeatureDescription } from '../../Feature/ThemeFeatureDescription' import { ComponentArea } from '../../Component/ComponentArea' type RequiredThemeFields = Pick<ThemeFeatureDescription, 'availableInRoles'> export function FillThemeComponentDefaults( theme: Partial<ThemeFeatureDescription> & RequiredThemeFields, ): ThemeFeatureDescription { if (!theme.index_path) { theme.index_path = 'index.css' } theme.content_type = ContentType.TYPES.Theme if (!theme.area) { theme.area = ComponentArea.Themes } return theme as ThemeFeatureDescription } ```
/content/code_sandbox/packages/features/src/Domain/Lists/Utilities/FillThemeComponentDefaults.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
136
```xml import { nanoid } from 'nanoid'; /* * Mongoose field options wrapper */ export const field = options => { const { pkey, type, optional } = options; if (type === String && !pkey && !optional) { options.validate = /\S+/; } // TODO: remove if (pkey) { options.type = String; options.default = () => nanoid(); } return options; }; export const schemaWrapper = schema => { schema.add({ scopeBrandIds: [String] }); return schema; }; ```
/content/code_sandbox/packages/plugin-emailtemplates-api/src/models/definitions/utils.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
125
```xml import * as React from 'react'; import ComponentExample from '../../../../components/ComponentDoc/ComponentExample'; import ExampleSection from '../../../../components/ComponentDoc/ExampleSection'; const Types = () => ( <ExampleSection title="Types"> <ComponentExample title="Size" description="The Text component supports a number of text sizes." examplePath="components/Text/Types/TextSizesExample" /> <ComponentExample title="Weight" description="The Text component supports a number of text weights." examplePath="components/Text/Types/TextWeightsExample" /> </ExampleSection> ); export default Types; ```
/content/code_sandbox/packages/fluentui/docs/src/examples/components/Text/Types/index.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
137
```xml import React, { useState, useCallback } from "react"; import { useSelector } from "react-redux"; import { Col } from "antd"; import { BillingTeamDetails } from "features/settings/components/BillingTeam/types"; import { getBillingTeamMemberById } from "store/features/billing/selectors"; import { RQButton } from "lib/design-system/components"; import { getFunctions, httpsCallable } from "firebase/functions"; import { MdCheck } from "@react-icons/all-files/md/MdCheck"; import { trackBillingTeamActionClicked } from "features/settings/analytics"; import Logger from "lib/logger"; import { toast } from "utils/Toast"; import "./index.scss"; interface Props { team: BillingTeamDetails; } export const BillingTeamCard: React.FC<Props> = ({ team }) => { const [isRequesting, setIsRequesting] = useState(false); const [isRequestSuccess, setIsRequestSuccess] = useState(false); const teamOwnerDetails = useSelector(getBillingTeamMemberById(team?.id, team?.owner)); const handleRequestAccess = useCallback(() => { trackBillingTeamActionClicked("request_to_join"); if (team?.id) { const sendRequest = httpsCallable<{ billingId: string }, null>( getFunctions(), "premiumNotifications-requestEnterprisePlanFromAdmin" ); setIsRequesting(true); sendRequest({ billingId: team.id }) .then(() => { setIsRequestSuccess(true); }) .catch((e) => { toast.error("Failed to send request. Please try again later"); Logger.log(e); }) .finally(() => setIsRequesting(false)); } else { Logger.log("Billing team id not found"); } }, [team?.id]); return ( <Col className="billing-team-card"> <div> <div className="text-white text-bold">{team.name}</div> <div className="text-gray caption">{Object.keys(team.members).length} members</div> </div> <div> <div className="text-gray">Billing manager</div> <div className="text-white">{teamOwnerDetails?.displayName}</div> </div> <div className="display-flex items-center flex-end billing-team-card-request-btn-wrapper"> {isRequestSuccess ? ( <div className="success display-flex items-center" style={{ gap: "4px" }}> <MdCheck /> Request sent </div> ) : ( <RQButton type="default" loading={isRequesting} onClick={handleRequestAccess}> Request access </RQButton> )} </div> </Col> ); }; ```
/content/code_sandbox/app/src/features/settings/components/BillingTeam/components/RequestTeamAccess/components/TeamCard/index.tsx
xml
2016-12-01T04:36:06
2024-08-16T19:12:19
requestly
requestly/requestly
2,121
567
```xml import { git } from './core' import { GitError } from 'dugite' import { Repository } from '../../models/repository' import { IRemote } from '../../models/remote' import { envForRemoteOperation } from './environment' import { getSymbolicRef } from './refs' import { gitNetworkArguments } from '.' /** * List the remotes, sorted alphabetically by `name`, for a repository. */ export async function getRemotes( repository: Repository ): Promise<ReadonlyArray<IRemote>> { const result = await git(['remote', '-v'], repository.path, 'getRemotes', { expectedErrors: new Set([GitError.NotAGitRepository]), }) if (result.gitError === GitError.NotAGitRepository) { return [] } return [...result.stdout.matchAll(/^(.+)\t(.+)\s\(fetch\)/gm)].map( ([, name, url]) => ({ name, url }) ) } /** Add a new remote with the given URL. */ export async function addRemote( repository: Repository, name: string, url: string ): Promise<IRemote> { await git(['remote', 'add', name, url], repository.path, 'addRemote') return { url, name } } /** Removes an existing remote, or silently errors if it doesn't exist */ export async function removeRemote( repository: Repository, name: string ): Promise<void> { const options = { successExitCodes: new Set([0, 2, 128]), } await git( ['remote', 'remove', name], repository.path, 'removeRemote', options ) } /** Changes the URL for the remote that matches the given name */ export async function setRemoteURL( repository: Repository, name: string, url: string ): Promise<true> { await git(['remote', 'set-url', name, url], repository.path, 'setRemoteURL') return true } /** * Get the URL for the remote that matches the given name. * * Returns null if the remote could not be found */ export async function getRemoteURL( repository: Repository, name: string ): Promise<string | null> { const result = await git( ['remote', 'get-url', name], repository.path, 'getRemoteURL', { successExitCodes: new Set([0, 2, 128]) } ) if (result.exitCode !== 0) { return null } return result.stdout } /** * Update the HEAD ref of the remote, which is the default branch. * * @param isBackgroundTask Whether the fetch is being performed as a * background task as opposed to being user initiated */ export async function updateRemoteHEAD( repository: Repository, remote: IRemote, isBackgroundTask: boolean ): Promise<void> { const options = { successExitCodes: new Set([0, 1, 128]), env: await envForRemoteOperation(remote.url), isBackgroundTask, } await git( [...gitNetworkArguments(), 'remote', 'set-head', '-a', remote.name], repository.path, 'updateRemoteHEAD', options ) } export async function getRemoteHEAD( repository: Repository, remote: string ): Promise<string | null> { const remoteNamespace = `refs/remotes/${remote}/` const match = await getSymbolicRef(repository, `${remoteNamespace}HEAD`) if ( match != null && match.length > remoteNamespace.length && match.startsWith(remoteNamespace) ) { // strip out everything related to the remote because this // is likely to be a tracked branch locally // e.g. `main`, `develop`, etc return match.substring(remoteNamespace.length) } return null } ```
/content/code_sandbox/app/src/lib/git/remote.ts
xml
2016-05-11T15:59:00
2024-08-16T17:00:41
desktop
desktop/desktop
19,544
837
```xml // package: pulumirpc.codegen // file: pulumi/codegen/hcl.proto /* tslint:disable */ /* eslint-disable */ import * as jspb from "google-protobuf"; export class Pos extends jspb.Message { getLine(): number; setLine(value: number): Pos; getColumn(): number; setColumn(value: number): Pos; getByte(): number; setByte(value: number): Pos; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Pos.AsObject; static toObject(includeInstance: boolean, msg: Pos): Pos.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; static serializeBinaryToWriter(message: Pos, writer: jspb.BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): Pos; static deserializeBinaryFromReader(message: Pos, reader: jspb.BinaryReader): Pos; } export namespace Pos { export type AsObject = { line: number, column: number, pb_byte: number, } } export class Range extends jspb.Message { getFilename(): string; setFilename(value: string): Range; hasStart(): boolean; clearStart(): void; getStart(): Pos | undefined; setStart(value?: Pos): Range; hasEnd(): boolean; clearEnd(): void; getEnd(): Pos | undefined; setEnd(value?: Pos): Range; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Range.AsObject; static toObject(includeInstance: boolean, msg: Range): Range.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; static serializeBinaryToWriter(message: Range, writer: jspb.BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): Range; static deserializeBinaryFromReader(message: Range, reader: jspb.BinaryReader): Range; } export namespace Range { export type AsObject = { filename: string, start?: Pos.AsObject, end?: Pos.AsObject, } } export class Diagnostic extends jspb.Message { getSeverity(): DiagnosticSeverity; setSeverity(value: DiagnosticSeverity): Diagnostic; getSummary(): string; setSummary(value: string): Diagnostic; getDetail(): string; setDetail(value: string): Diagnostic; hasSubject(): boolean; clearSubject(): void; getSubject(): Range | undefined; setSubject(value?: Range): Diagnostic; hasContext(): boolean; clearContext(): void; getContext(): Range | undefined; setContext(value?: Range): Diagnostic; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Diagnostic.AsObject; static toObject(includeInstance: boolean, msg: Diagnostic): Diagnostic.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; static serializeBinaryToWriter(message: Diagnostic, writer: jspb.BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): Diagnostic; static deserializeBinaryFromReader(message: Diagnostic, reader: jspb.BinaryReader): Diagnostic; } export namespace Diagnostic { export type AsObject = { severity: DiagnosticSeverity, summary: string, detail: string, subject?: Range.AsObject, context?: Range.AsObject, } } export enum DiagnosticSeverity { DIAG_INVALID = 0, DIAG_ERROR = 1, DIAG_WARNING = 2, } ```
/content/code_sandbox/sdk/nodejs/proto/codegen/hcl_pb.d.ts
xml
2016-10-31T21:02:47
2024-08-16T19:47:04
pulumi
pulumi/pulumi
20,743
790
```xml // See LICENSE.txt for license information. import {withDatabase, withObservables} from '@nozbe/watermelondb/react'; import {observeBookmarks, observeCanDeleteBookmarks, observeCanEditBookmarks} from '@queries/servers/channel_bookmark'; import {observeCanDownloadFiles, observeCanUploadFiles, observeConfigBooleanValue, observeCurrentUserId} from '@queries/servers/system'; import ChannelBookmarks from './channel_bookmarks'; import type {WithDatabaseArgs} from '@typings/database/database'; type Props = WithDatabaseArgs & { channelId: string; } const enhanced = withObservables([], ({channelId, database}: Props) => { return { bookmarks: observeBookmarks(database, channelId), canDeleteBookmarks: observeCanDeleteBookmarks(database, channelId), canDownloadFiles: observeCanDownloadFiles(database), canEditBookmarks: observeCanEditBookmarks(database, channelId), canUploadFiles: observeCanUploadFiles(database), currentUserId: observeCurrentUserId(database), publicLinkEnabled: observeConfigBooleanValue(database, 'EnablePublicLink'), }; }); export default withDatabase(enhanced(ChannelBookmarks)); ```
/content/code_sandbox/app/components/channel_bookmarks/index.ts
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
242
```xml import type { MemorablePasswordOptions } from './memorable'; import { generateMemorablePassword } from './memorable'; import type { RandomPasswordOptions } from './random'; import { generateRandomPassword } from './random'; export type GeneratePasswordMode = 'random' | 'memorable'; export type GeneratePasswordConfig<T extends GeneratePasswordMode = GeneratePasswordMode> = Extract< { type: 'random'; options: RandomPasswordOptions } | { type: 'memorable'; options: MemorablePasswordOptions }, { type: T } >; export const generatePassword = (data: GeneratePasswordConfig) => { switch (data.type) { case 'random': return generateRandomPassword(data.options); case 'memorable': return generateMemorablePassword(data.options); } }; ```
/content/code_sandbox/packages/pass/lib/password/generator.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
166
```xml import { PrimaryGeneratedColumnType } from "../../driver/types/ColumnTypes" /** * Describes all options for PrimaryGeneratedColumn decorator with identity generation strategy. */ export interface PrimaryGeneratedColumnIdentityOptions { /** * Column type. Must be one of the value from the ColumnTypes class. */ type?: PrimaryGeneratedColumnType /** * Column name in the database. */ name?: string /** * Column comment. Not supported by all database types. */ comment?: string /** * Identity column type. Supports only in Postgres 10+. */ generatedIdentity?: "ALWAYS" | "BY DEFAULT" /** * Name of the primary key constraint. */ primaryKeyConstraintName?: string } ```
/content/code_sandbox/src/decorator/options/PrimaryGeneratedColumnIdentityOptions.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
159
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE language SYSTEM "language.dtd"> <language name="Texinfo" extensions="*.texi" section="Markup" mimetype="application/x-texinfo" author="Daniel Franke (franke.daniel@gmail.com)" license="LGPL" version="1" kateversion="2.4"> <highlighting> <!-- In TEXINFO, commands start with "@" optionally followed by a command argument embraced by "{}", as in "@item" or "@emph{foo bar}". Some special commands embrace a region, e.g. "@menu" and "@end menu", these regions may be fold (beginRegion="foldingRegion"). Nodes to NOT end with "@end node", but a "@node" ends at the beginning of the next "@node". --> <contexts> <context name="Normal Text" attribute="Normal Text" lineEndContext="#stay"> <RegExpr attribute="Comment" context="singleLineComment" String="@c(omment)?\b" /> <RegExpr attribute="Comment" context="multiLineComment" String="@ignore\b" beginRegion="ignore" /> <RegExpr attribute="Command" context="nodeFolding" String="@node\b" beginRegion="node" /> <RegExpr attribute="Command" context="folding" beginRegion="foldingRegion" String="@(menu|smallexample|table|multitable)\b"/> <RegExpr attribute="Command" context="#stay" String="@[\w]+(\{([\w]+[\s]*)+\})?" /> </context> <context name="singleLineComment" attribute="Comment" lineEndContext="#pop"> <IncludeRules context="##Alerts" /> </context> <context name="multiLineComment" attribute="Comment" lineEndContext="#stay"> <StringDetect attribute="Comment" context="#pop" String="@end ignore" endRegion="ignore" /> <IncludeRules context="##Alerts" /> </context> <context name="nodeFolding" attribute="Normal Text" lineEndContext="#stay"> <RegExpr attribute="Command" context="#pop" String="@node\b" endRegion="node" lookAhead="true" /> <IncludeRules context="Normal Text" /> </context> <context name="folding" attribute="Normal Text" lineEndContext="#stay"> <RegExpr attribute="Command" context="#pop" endRegion="foldingRegion" String="@end (menu|smallexample|table|multitable)\b" /> <IncludeRules context="Normal Text" /> </context> </contexts> <itemDatas> <itemData name="Normal Text" defStyleNum="dsNormal" /> <itemData name="Comment" defStyleNum="dsComment" /> <itemData name="Command" defStyleNum="dsFunction" /> </itemDatas> </highlighting> <general> <comments> <comment name="singleLine" start="@comment " /> <comment name="multiLine" start="@ignore" end="@end ignore" region="ignore" /> </comments> </general> </language> ```
/content/code_sandbox/src/data/extra/syntax-highlighting/syntax/texinfo.xml
xml
2016-10-05T07:24:54
2024-08-16T05:03:40
vnote
vnotex/vnote
11,687
699
```xml import { IncomingMessage, ServerResponse } from "http"; import { useMemo } from "react"; import { ApolloClient, InMemoryCache, NormalizedCacheObject, } from "@apollo/client"; import resolvers from "./resolvers"; import typeDefs from "./schema"; let apolloClient: ApolloClient<NormalizedCacheObject> | undefined; export type ResolverContext = { req?: IncomingMessage; res?: ServerResponse; }; function createIsomorphLink(context: ResolverContext = {}) { if (typeof window === "undefined") { const { SchemaLink } = require("@apollo/client/link/schema"); const { makeExecutableSchema } = require("@graphql-tools/schema"); const schema = makeExecutableSchema({ typeDefs, resolvers, }); return new SchemaLink({ schema, context }); } else { const { HttpLink } = require("@apollo/client"); return new HttpLink({ uri: "/api/graphql", credentials: "same-origin", }); } } function createApolloClient(context?: ResolverContext) { return new ApolloClient({ ssrMode: typeof window === "undefined", link: createIsomorphLink(context), cache: new InMemoryCache(), }); } export function initializeApollo( initialState: any = null, // Pages with Next.js data fetching methods, like `getStaticProps`, can send // a custom context which will be used by `SchemaLink` to server render pages context?: ResolverContext, ) { const _apolloClient = apolloClient ?? createApolloClient(context); // If your page has Next.js data fetching methods that use Apollo Client, the initial state // get hydrated here if (initialState) { _apolloClient.cache.restore(initialState); } // For SSG and SSR always create a new Apollo Client if (typeof window === "undefined") return _apolloClient; // Create the Apollo Client once in the client if (!apolloClient) apolloClient = _apolloClient; return _apolloClient; } export function useApollo(initialState: any) { const store = useMemo(() => initializeApollo(initialState), [initialState]); return store; } ```
/content/code_sandbox/examples/with-typescript-graphql/lib/apollo.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
469
```xml <?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="path_to_url" xsi:noNamespaceSchemaLocation="path_to_url" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutTodoAnnotatedTests="true" convertDeprecationsToExceptions="true" failOnRisky="true" failOnWarning="true" verbose="true"> <testsuites> <testsuite name="scenarios"> <directory>example_code/*/*/tests/</directory> <directory>example_code/*/tests/</directory> </testsuite> <testsuite name="applications"> <directory>applications/*/tests/</directory> </testsuite> </testsuites> <coverage> <exclude> <directory suffix=".php">*vendor*</directory> <directory suffix=".php">tests</directory> </exclude> </coverage> </phpunit> ```
/content/code_sandbox/php/phpunit.xml
xml
2016-08-18T19:06:57
2024-08-16T18:59:44
aws-doc-sdk-examples
awsdocs/aws-doc-sdk-examples
9,298
212
```xml import * as React from "react"; import { LoaderStyles } from "./Loader.styles"; import { Image, ImageEnum } from "../image/Image"; export const Loader = (): JSX.Element => { const style = LoaderStyles(); return ( <div className={style.overlay}> <Image imageId={ImageEnum.spinner} className={style.rotate} /> </div> ); }; ```
/content/code_sandbox/samples/react-feedback-sidebar/src/webparts/feedback/components/loader/Loader.tsx
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
81
```xml import { CognitoIdentityProviderClient, InitiateAuthCommand, SignUpCommand, ConfirmSignUpCommand } from "@aws-sdk/client-cognito-identity-provider"; import config from "./config.json"; export const cognitoClient = new CognitoIdentityProviderClient({ region: config.region, }); export const signIn = async (username: string, password: string) => { const params = { AuthFlow: "USER_PASSWORD_AUTH", ClientId: config.clientId, AuthParameters: { USERNAME: username, PASSWORD: password, }, }; try { const command = new InitiateAuthCommand(params); const { AuthenticationResult } = await cognitoClient.send(command); if (AuthenticationResult) { sessionStorage.setItem("idToken", AuthenticationResult.IdToken || ''); sessionStorage.setItem("accessToken", AuthenticationResult.AccessToken || ''); sessionStorage.setItem("refreshToken", AuthenticationResult.RefreshToken || ''); return AuthenticationResult; } } catch (error) { console.error("Error signing in: ", error); throw error; } }; export const signUp = async (email: string, password: string) => { const params = { ClientId: config.clientId, Username: email, Password: password, UserAttributes: [ { Name: "email", Value: email, }, ], }; try { const command = new SignUpCommand(params); const response = await cognitoClient.send(command); console.log("Sign up success: ", response); return response; } catch (error) { console.error("Error signing up: ", error); throw error; } }; export const confirmSignUp = async (username: string, code: string) => { const params = { ClientId: config.clientId, Username: username, ConfirmationCode: code, }; try { const command = new ConfirmSignUpCommand(params); await cognitoClient.send(command); console.log("User confirmed successfully"); return true; } catch (error) { console.error("Error confirming sign up: ", error); throw error; } }; ```
/content/code_sandbox/javascriptv3/example_code/cognito-identity-provider/scenarios/cognito-developer-guide-react-example/frontend-client/src/authService.ts
xml
2016-08-18T19:06:57
2024-08-16T18:59:44
aws-doc-sdk-examples
awsdocs/aws-doc-sdk-examples
9,298
450
```xml <?xml version="1.0" encoding="UTF-8"?> <cobra document="path_to_url"> <name value="SQL Execute Functions"/> <language value="php"/> <match mode="function-param-controllable"><![CDATA[(mysqli_query|pg_execute|pg_insert|pg_query|pg_select|pg_update|sqlite_query|msql_query|mssql_query|odbc_exec|fbsql_query|sybase_query|ibase_query|dbx_query|ingres_query|ifx_query|oci_parse|sqlsrv_query|maxdb_query|db2_exec)]]></match> <level value="8"/> <test> <case assert="true"><![CDATA[ $username = $_POST['username']; $password = $_POST['password']; $query = "SELECT * FROM users WHERE user = $username AND password = $password "; mysqli_query($query); ]]></case> <case assert="false"><![CDATA[ $username = "user"; $password = "cobra123"; $query = "SELECT * FROM users WHERE user = $username AND password = $password "; mysqli_query($query); ]]></case> </test> <solution> ## ### SQL SQLSQL ### - - - - ## - - - : </solution> <status value="on"/> <author name="Feei" email="feei@feei.cn"/> </cobra> ```
/content/code_sandbox/rules/CVI-160004.xml
xml
2016-04-15T08:41:15
2024-08-16T10:33:17
Cobra
FeeiCN/Cobra
3,133
328
```xml export default function Page() { return <p>hello world</p> } export const metadata = { icons: { shortcut: '/shortcut-icon-nested.png', apple: '/apple-icon-nested.png', other: { rel: 'apple-touch-icon-precomposed-nested', url: '/apple-touch-icon-precomposed-nested.png', }, }, } ```
/content/code_sandbox/test/e2e/app-dir/metadata-icons/app/nested/page.tsx
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
81
```xml import path from 'path'; import { describe, expect, it } from 'vitest'; import neDbAdapter from './ne-db-adapter'; describe('neDbAdapter()', () => { const fixturesPath = path.join(__dirname, '../fixtures'); // These tests mount the nedb causing other tests which also hit the nedb to fail // it('should seed with nedb directory', async () => { // const workingDir = path.join(fixturesPath, 'nedb'); // const db = await neDbAdapter(workingDir); // expect(db?.ApiSpec.length).toBe(2); // expect(db?.Environment.length).toBe(3); // expect(db?.Request.length).toBe(2); // expect(db?.RequestGroup.length).toBe(1); // expect(db?.Workspace.length).toBe(2); // expect(db?.UnitTestSuite.length).toBe(2); // expect(db?.UnitTest.length).toBe(4); // }); // it('should seed with nedb directory with filter', async () => { // const workingDir = path.join(fixturesPath, 'nedb'); // const db = await neDbAdapter(workingDir, ['Environment']); // expect(db?.ApiSpec.length).toBe(0); // expect(db?.Environment.length).toBe(3); // expect(db?.Request.length).toBe(0); // expect(db?.RequestGroup.length).toBe(0); // expect(db?.Workspace.length).toBe(0); // expect(db?.UnitTestSuite.length).toBe(0); // expect(db?.UnitTest.length).toBe(0); // }); it('should return null if data directory is invalid', async () => { const workingDir = path.join(fixturesPath, 'git-repo'); const db = await neDbAdapter(workingDir); expect(db).toBe(null); }); }); ```
/content/code_sandbox/packages/insomnia-inso/src/db/adapters/ne-db-adapter.test.ts
xml
2016-04-23T03:54:26
2024-08-16T16:50:44
insomnia
Kong/insomnia
34,054
421
```xml import * as React from 'react'; import { useSwitch_unstable } from './useSwitch'; import { renderSwitch_unstable } from './renderSwitch'; import { useSwitchStyles_unstable } from './useSwitchStyles.styles'; import type { SwitchProps } from './Switch.types'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts'; /** * Switches enable users to trigger an option on or off through pressing the component. */ export const Switch: ForwardRefComponent<SwitchProps> = React.forwardRef((props, ref) => { const state = useSwitch_unstable(props, ref); useSwitchStyles_unstable(state); useCustomStyleHook_unstable('useSwitchStyles_unstable')(state); return renderSwitch_unstable(state); }); Switch.displayName = 'Switch'; ```
/content/code_sandbox/packages/react-components/react-switch/library/src/components/Switch/Switch.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
186
```xml import { field, schemaWrapper } from './utils'; import { Schema, Document } from 'mongoose'; export interface ITimeframe { name: string; description: string; percent: number; status: string; startTime: number; endTime: number; } export interface ITimeframeDocument extends ITimeframe, Document { _id: string; } export const timeframeSchema = schemaWrapper( new Schema({ _id: field({ pkey: true }), name: field({ type: String, label: 'Name' }), description: field({ type: String, label: 'Description' }), percent: field({ type: Number, label: 'Percent' }), status: field({ type: String, optional: true, label: 'Status' }), startTime: field({ type: Number, label: 'Start time' }), endTime: field({ type: Number, label: 'String' }) }) ); ```
/content/code_sandbox/packages/plugin-salesplans-api/src/models/definitions/timeframes.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
200
```xml <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.ButtonBar?> <?import javafx.scene.control.Separator?> <?import javafx.scene.layout.Pane?> <?import javafx.scene.layout.VBox?> <VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" xmlns="path_to_url" xmlns:fx="path_to_url"> <children> <Pane fx:id="searchPane"> <fx:include source="ComposedFormSearch.fxml" /> </Pane> <Pane fx:id="listPane" prefHeight="200.0" prefWidth="200.0"> <fx:include source="ComposedFormList.fxml" /> </Pane> <Separator prefWidth="200.0" /> <ButtonBar prefHeight="40.0" prefWidth="200.0"> <buttons> <Button defaultButton="true" mnemonicParsing="false" onAction="#ok" text="Ok" /> <Button cancelButton="true" mnemonicParsing="false" onAction="#cancel" text="Cancel" /> </buttons> </ButtonBar> </children> </VBox> ```
/content/code_sandbox/src/test/resources/tornadofx/tests/ComposedForm.fxml
xml
2016-01-06T15:38:14
2024-08-15T06:05:23
tornadofx
edvin/tornadofx
3,676
254
```xml <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="path_to_url" xmlns:flowable="path_to_url" targetNamespace="Examples" xmlns:tns="Examples"> <process id="processOne" name="The One Task Process"> <documentation>One task process description</documentation> <startEvent id="theStart" flowable:formKey="form1" /> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="processTask" /> <userTask id="processTask" name="Process task"> <documentation>Process task description</documentation> </userTask> <sequenceFlow id="flow2" sourceRef="processTask" targetRef="theEnd" /> <endEvent id="theEnd" /> </process> </definitions> ```
/content/code_sandbox/modules/flowable-rest/src/test/resources/org/flowable/rest/service/api/runtime/ProcessInstanceResourceTest.process-with-form.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
190
```xml // See LICENSE.txt for license information. import type {TextStyle, ViewStyle} from 'react-native'; export type SearchPattern = { pattern: RegExp; term: string; }; export type UserMentionKey = { key: string; caseSensitive?: boolean; }; export type HighlightWithoutNotificationKey = { key: string; }; export type MarkdownBlockStyles = { adjacentParagraph: ViewStyle; horizontalRule: ViewStyle; quoteBlockIcon: TextStyle; }; export type MarkdownTextStyles = { [key: string]: TextStyle; }; export type MarkdownAtMentionRenderer = { context: string[]; mentionName: string; } export type MarkdownBaseRenderer = { context: string[]; literal: string; } export type MarkdownChannelMentionRenderer = { context: string[]; channelName: string; } export type MarkdownEmojiRenderer = MarkdownBaseRenderer & { emojiName: string; } export type MarkdownImageRenderer = { linkDestination?: string; context: string[]; src: string; size?: { width?: number; height?: number; }; } export type MarkdownLatexRenderer = MarkdownBaseRenderer & { latexCode: string; } ```
/content/code_sandbox/types/global/markdown.ts
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
255
```xml #include <Security/Security.h> int main() { return static_cast<int>(kSecAccessControlBiometryCurrentSet); } ```
/content/code_sandbox/cmake/compiler-checks/macos/control_biometry_support.mm
xml
2016-02-28T15:52:40
2024-08-16T19:26:56
keepassxc
keepassxreboot/keepassxc
20,477
28
```xml import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; import { OAuthService } from 'angular-oauth2-oidc'; @Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'], }) export class HomeComponent { get hasLoggedIn(): boolean { return this.oAuthService.hasValidAccessToken(); } constructor(private oAuthService: OAuthService, private authService: AuthService) {} login() { this.authService.navigateToLogin(); } } ```
/content/code_sandbox/modules/openiddict/app/angular/src/app/home/home.component.ts
xml
2016-12-03T22:56:24
2024-08-16T16:24:05
abp
abpframework/abp
12,657
112
```xml import "module-alias/register"; import { NativeMessagingVersion } from "@bitwarden/common/enums"; import { LogUtils } from "../log-utils"; import NativeMessageService from "../native-message.service"; import * as config from "../variables"; // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. // eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const nativeMessageService = new NativeMessageService(NativeMessagingVersion.One); LogUtils.logInfo("Sending Handshake"); const handshakeResponse = await nativeMessageService.sendHandshake( config.testRsaPublicKey, config.applicationName, ); LogUtils.logSuccess("Received response to handshake request"); if (!handshakeResponse.status) { LogUtils.logError(" Handshake failed. Error was: " + handshakeResponse.error); nativeMessageService.disconnect(); return; } LogUtils.logSuccess("Handshake success response"); const status = await nativeMessageService.checkStatus(handshakeResponse.sharedKey); LogUtils.logSuccess("Status output is: ", status); nativeMessageService.disconnect(); })(); ```
/content/code_sandbox/apps/desktop/native-messaging-test-runner/src/commands/bw-status.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
246
```xml import * as React from 'react'; export interface IconContextProps { prefixCls?: string; } export const IconContext = React.createContext<IconContextProps>({}); ```
/content/code_sandbox/packages/zarm-icons/src/context.ts
xml
2016-07-13T11:45:37
2024-08-12T19:23:48
zarm
ZhongAnTech/zarm
1,707
36
```xml import { expect } from '@playwright/test'; import { parallelTest as test } from '../../../parallelTest'; import WpAdminPage from '../../../pages/wp-admin-page'; test.describe( 'Icon List', () => { test( 'Test vertical alignment of the icons', async ( { page, apiRequests }, testInfo ) => { // Arrange. const wpAdmin = new WpAdminPage( page, testInfo, apiRequests ); const editor = await wpAdmin.openNewPage(); // Act. await editor.addWidget( 'icon-list' ); await editor.openPanelTab( 'style' ); await editor.openSection( 'section_icon_style' ); await editor.setChooseControlValue( 'icon_self_vertical_align', 'eicon-v-align-top' ); await editor.setSliderControlValue( 'icon_vertical_offset', '10' ); // Assert. await expect( editor.getPreviewFrame().locator( '.elementor-icon-list-item' ).first() ).toHaveCSS( 'align-items', 'flex-start' ); await expect( editor.getPreviewFrame().locator( '.elementor-icon-list-icon' ).first() ).toHaveCSS( 'top', '10px' ); } ); } ); ```
/content/code_sandbox/tests/playwright/sanity/includes/widgets/icon-list.test.ts
xml
2016-05-30T13:05:46
2024-08-16T13:13:10
elementor
elementor/elementor
6,507
257
```xml import { optionalRequire } from '../../navigation/routeBuilder'; import ComponentListScreen, { ListElement } from '../ComponentListScreen'; export const ModulesCoreScreens = [ { name: 'Core module', route: 'modulescore/core-module', getComponent() { return optionalRequire(() => require('./CoreModuleScreen')); }, }, { name: 'Expo modules', route: 'modulescore/expo-modules', getComponent() { return optionalRequire(() => require('./ExpoModulesScreen')); }, }, ]; export default function ModulesCoreScreen() { const apis: ListElement[] = ModulesCoreScreens.map((screen) => { return { name: screen.name, isAvailable: true, route: `/apis/${screen.route}`, }; }); return <ComponentListScreen apis={apis} sort={false} />; } ```
/content/code_sandbox/apps/native-component-list/src/screens/ModulesCore/ModulesCoreScreen.tsx
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
186
```xml import * as React from 'react'; import { ExampleCard } from '../../ExampleCard/index'; import { IExample, IPageSectionPropsWithSectionName } from '../Page.types'; import * as styles from '../Page.module.scss'; export interface IExamplesSectionProps extends IPageSectionPropsWithSectionName { exampleKnobs?: React.ReactNode; // TODO: There seems to be a disparity between this type and IPageSectionProps as used in Page.tsx. // Making optional for now to workaround. examples?: IExample[]; } export const ExamplesSection: React.FunctionComponent<IExamplesSectionProps> = props => { const { className, examples, exampleKnobs, readableSectionName = props.sectionName, style, id } = props; const [activeEditorTitle, setActiveEditorTitle] = React.useState(''); return ( <div className={className} style={style}> <div className={styles.sectionHeader}> {/* This heading must be programmatically focusable for simulating jumping to an anchor */} <h2 className={styles.subHeading} id={id} tabIndex={-1}> {readableSectionName} </h2> </div> <div> {exampleKnobs && <div className={styles.subSection}>{exampleKnobs}</div>} {examples && examples.map((example: IExample) => { const { view, ...exampleProps } = example; return ( <div key={example.title + '-key'} className={styles.subSection}> <ExampleCard {...exampleProps} onToggleEditor={setActiveEditorTitle} isCodeVisible={exampleProps.title === activeEditorTitle} > {view} </ExampleCard> </div> ); })} </div> </div> ); }; ```
/content/code_sandbox/packages/react-docsite-components/src/components/Page/sections/ExamplesSection.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
381
```xml import { PrimaryGeneratedColumn } from "../../../../../src/decorator/columns/PrimaryGeneratedColumn" import { Entity } from "../../../../../src/decorator/entity/Entity" import { Column } from "../../../../../src/decorator/columns/Column" import { Generated } from "../../../../../src/decorator/Generated" @Entity() export class Post { @PrimaryGeneratedColumn() id: number @Column() @Generated("uuid") uuid: string } ```
/content/code_sandbox/test/functional/uuid/oracle/entity/Post.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
99
```xml <?xml version="1.0" encoding="utf-8"?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"> <file datatype="xml" source-language="en" target-language="it" original="../Strings.resx"> <body> <trans-unit id="ConcreteWorkloadHasNoDescription"> <source>Workload definition '{0}' is a concrete dev workload but has no description</source> <target state="translated">La definizione del carico di lavoro '{0}' un carico di lavoro di sviluppo concreto ma non include alcuna descrizione</target> <note /> </trans-unit> <trans-unit id="ConflictingWorkloadDefinition"> <source>Workload definition '{0}' in manifest '{1}' [{2}] conflicts with manifest '{3}' [{4}]</source> <target state="translated">La definizione del carico di lavoro '{0}' nel manifesto '{1}' [{2}] in conflitto con il manifesto '{3}' [{4}]</target> <note /> </trans-unit> <trans-unit id="ConflictingWorkloadPack"> <source>Workload pack '{0}' in manifest '{1}' [{2}] conflicts with manifest '{3}' [{4}]</source> <target state="translated">Il pacchetto del carico di lavoro '{0}' nel manifesto '{1}' [{2}] in conflitto con il manifesto '{3}' [{4}]</target> <note /> </trans-unit> <trans-unit id="CyclicWorkloadRedirect"> <source>Cyclic workload redirect '{0}' in manifest '{1}' [{2}]</source> <target state="translated">Reindirizzamento del carico di lavoro ciclico '{0}' nel manifesto '{1}' [{2}]</target> <note /> </trans-unit> <trans-unit id="DuplicateKeyAtOffset"> <source>Duplicate key '{0}' at offset {1}</source> <target state="translated">Chiave '{0}' duplicata alla posizione di offset {1}</target> <note /> </trans-unit> <trans-unit id="DuplicateManifestID"> <source>Manifest provider {0} returned a duplicate manifest ID '{1}' [{2}] that conflicts with existing manifest [{3}]</source> <target state="translated">Il provider del manifesto {0} ha restituito un ID manifesto duplicato '{1}' [{2}] in conflitto con il manifesto esistente [{3}]</target> <note /> </trans-unit> <trans-unit id="ExpectedBoolAtOffset"> <source>Expected boolean value at offset {0}</source> <target state="translated"> prevista un valore booleano alla posizione di offset {0}</target> <note /> </trans-unit> <trans-unit id="ExpectedIntegerAtOffset"> <source>Expected integer value at offset {0}</source> <target state="translated"> prevista un valore intero alla posizione di offset {0}</target> <note /> </trans-unit> <trans-unit id="ExpectedStringAtOffset"> <source>Expected string value at offset {0}</source> <target state="translated"> previsto un valore stringa alla posizione di offset {0}</target> <note /> </trans-unit> <trans-unit id="ExpectedTokenAtOffset"> <source>Expected {0} token at offset {1}</source> <target state="translated"> previsto il token {0} alla posizione di offset {1}</target> <note /> </trans-unit> <trans-unit id="IncompleteDocument"> <source>Document ended prematurely</source> <target state="translated">Il documento stato interrotto prima del completamento</target> <note /> </trans-unit> <trans-unit id="InvalidManifestVersion"> <source>Invalid version: {0}</source> <target state="translated">Versione non valida: {0}</target> <note /> </trans-unit> <trans-unit id="InvalidVersionForWorkload"> <source>Error parsing version '{1}' for workload manifest ID '{0}'</source> <target state="translated">Errore durante l'analisi della versione '{1}' per l'ID manifesto del carico di lavoro '{0}'</target> <note /> </trans-unit> <trans-unit id="ManifestDependencyMissing"> <source>Did not find workload manifest dependency '{0}' required by manifest '{1}' [{2}]</source> <target state="translated">La dipendenza del manifesto del carico di lavoro '{0}' richiesta dal manifesto '{1}' [{2}] non stata trovata</target> <note /> </trans-unit> <trans-unit id="ManifestDependencyVersionTooLow"> <source>Workload manifest dependency '{0}' version '{1}' is lower than version '{2}' required by manifest '{3}' [{4}]</source> <target state="translated">La dipendenza del manifesto del carico di lavoro '{0}' versione '{1}' inferiore alla versione '{2}' richiesta dal manifesto '{3}' [{4}]</target> <note /> </trans-unit> <trans-unit id="ManifestDoesNotExist"> <source>No manifest with ID {0} exists.</source> <target state="translated">Non esiste alcun manifesto con ID {0}.</target> <note /> </trans-unit> <trans-unit id="ManifestFromInstallStateNotFound"> <source>Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this.</source> <target state="translated">Il manifesto del carico di lavoro {0}, specificato in {1}, non stato trovato. L'esecuzione della "dotnet workload repair" pu risolvere questo errore.</target> <note>{Locked="dotnet workload repair"}</note> </trans-unit> <trans-unit id="ManifestFromWorkloadSetNotFound"> <source>Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this.</source> <target state="translated">Il manifesto del carico di lavoro {0} dalla versione {1} del carico di lavoro non stato installato. L'esecuzione della "dotnet workload repair" pu risolvere questo errore.</target> <note>{Locked="dotnet workload repair"}</note> </trans-unit> <trans-unit id="MissingBaseWorkload"> <source>Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}]</source> <target state="translated">Non stato possibile trovare il carico di lavoro '{0}' esteso dal carico di lavoro '{1}' nel manifesto '{2}' [{3}]</target> <note /> </trans-unit> <trans-unit id="MissingOrInvalidManifestVersion"> <source>Missing or invalid manifest version</source> <target state="translated">Versione del manifesto mancante o non valida</target> <note /> </trans-unit> <trans-unit id="MissingWorkloadPackKind"> <source>Missing kind for workload pack '{0}'</source> <target state="translated">Tipo mancante per il pacchetto '{0}' del carico di lavoro</target> <note /> </trans-unit> <trans-unit id="MissingWorkloadPackVersion"> <source>Missing version for workload pack '{0}'</source> <target state="translated">Versione mancante per il pacchetto '{0}' del carico di lavoro</target> <note /> </trans-unit> <trans-unit id="RedirectWorkloadHasOtherKeys"> <source>Redirect workload '{0}' has keys other than 'redirect-to'</source> <target state="translated">Il carico di lavoro '{0}' di reindirizzamento ha chiavi diverse da ' Redirect-to '</target> <note /> </trans-unit> <trans-unit id="UnexpectedTokenAtOffset"> <source>Unexpected token '{0}' at offset {1}</source> <target state="translated">Token '{0}' imprevisto alla posizione di offset {1}</target> <note /> </trans-unit> <trans-unit id="UnknownKeyAtOffset"> <source>Unknown key '{0}' at offset {1}</source> <target state="translated">Chiave '{0}' sconosciuta alla posizione di offset {1}</target> <note /> </trans-unit> <trans-unit id="UnknownWorkloadDefinitionKind"> <source>Unknown workload definition kind '{0}' at offset {1}</source> <target state="translated">Tipo di definizione di carico di lavoro '{0}' sconosciuto alla posizione di offset {1}</target> <note /> </trans-unit> <trans-unit id="UnknownWorkloadPackKind"> <source>Unknown workload pack kind '{0}' at offset {1}</source> <target state="translated">Tipo di pacchetto del carico di lavoro '{0}' sconosciuto alla posizione di offset {1}</target> <note /> </trans-unit> <trans-unit id="UnresolvedWorkloadRedirect"> <source>Unresolved target '{0}' for workload redirect '{1}' in manifest '{2}' [{3}]</source> <target state="translated">Destinazione non risolta '{0}' per il reindirizzamento del carico di lavoro '{1}' nel manifesto '{2}' [{3}]</target> <note /> </trans-unit> <trans-unit id="WorkloadVersionFromGlobalJsonNotFound"> <source>Workload version {0}, which was specified in {1}, was not found. Run "dotnet workload restore" to install this workload version.</source> <target state="translated">La versione del carico di lavoro {0}, specificata in {1}, non stata trovata. Eseguire "dotnet workload restore" per installare questa versione del carico di lavoro.</target> <note>{Locked="dotnet workload restore"}</note> </trans-unit> <trans-unit id="WorkloadVersionFromInstallStateNotFound"> <source>Workload version {0}, which was specified in {1}, was not found.</source> <target state="translated">La versione del carico di lavoro {0}, specificata in {1}, non stata trovata.</target> <note /> </trans-unit> <trans-unit id="WorkloadVersionNotFound"> <source>Workload version {0} was not found.</source> <target state="translated">La versione {0} del carico di lavoro non stata trovata.</target> <note /> </trans-unit> </body> </file> </xliff> ```
/content/code_sandbox/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.it.xlf
xml
2016-07-22T21:26:02
2024-08-16T17:23:58
sdk
dotnet/sdk
2,627
2,462
```xml import './vue' import Vue, { ComponentOptions, PluginFunction } from 'vue' type Component = ComponentOptions<Vue> | typeof Vue type CallbackFn = () => void type elements = HTMLElement[] export interface VueMetaOptionsRuntime { refreshOnceOnNavigation?: boolean debounceWait?: number waitOnDestroyed?: boolean } export interface VueMetaOptions extends VueMetaOptionsRuntime { keyName: string, // the component option name that vue-meta looks for meta info on. attribute: string, // the attribute name vue-meta adds to the tags it observes ssrAppId: string, // the app id used for ssr app ssrAttribute: string, // the attribute name that lets vue-meta know that meta info has already been server-rendered tagIDKeyName: string // the property name that vue-meta uses to determine whether to overwrite or append a tag } export declare class VueMeta { static version: string static install(vue: typeof Vue, options?: VueMetaOptions): PluginFunction<never> static hasMetaInfo(vm: Component): boolean static generate(metaInfo: MetaInfo, options?: Object): MetaInfoSSR } interface RefreshedTags { addedTags: elements removedTags: elements } interface Refreshed { vm: Component, metaInfo: MetaInfoOutput, tags: RefreshedTags } interface VueMetaApp { set(metaInfo: MetaInfo): void | RefreshedTags remove(): void } export interface VueMetaPlugin { getOptions(): VueMetaOptions setOptions(runtimeOptions: VueMetaOptionsRuntime): VueMetaOptions addApp(appName: string): VueMetaApp refresh(): Refreshed inject(): MetaInfoSSR pause(refresh: true): () => Refreshed pause(refresh?: boolean): () => void resume(refresh: true): Refreshed resume(refresh?: boolean): void } export interface AttributeProperty { [key: string]: string | string[] } export interface MetaDataProperty { vmid?: string, once?: boolean, skip?: boolean, body?: boolean, pbody?: boolean, [key: string]: any } export interface MetaPropertyCharset extends MetaDataProperty { charset: string, } export interface MetaPropertyEquiv extends MetaDataProperty { httpEquiv: string, content: string, template?: (chunk: string) => string } export interface MetaPropertyTrueEquiv extends MetaDataProperty { 'http-equiv': string, content: string, template?: (chunk: string) => string } export interface MetaPropertyName extends MetaDataProperty { name: string, content: string, template?: (chunk: string) => string } export interface MetaPropertyMicrodata extends MetaDataProperty { itemprop: string, content: string, template?: (chunk: string) => string } // non-w3c interface export interface MetaPropertyProperty extends MetaDataProperty { property: string, content: string, template?: (chunk: string) => string } export interface LinkPropertyBase extends MetaDataProperty { rel: string, crossOrigin?: string | null, media?: string, nonce?: string, referrerPolicy?: string, rev?: string, type?: string } export interface LinkPropertyHref extends LinkPropertyBase { href?: string, hreflang?: string, callback?: void } export interface LinkPropertyHrefCallback extends LinkPropertyBase { vmid: string, callback: CallbackFn, href?: string, hreflang?: string } export interface StyleProperty extends MetaDataProperty { cssText: string, callback?: CallbackFn media?: string, nonce?: string, type?: string, } export interface ScriptPropertyBase extends MetaDataProperty { type?: string, charset?: string, async?: boolean, defer?: boolean, crossOrigin?: string, nonce?: string } export interface ScriptPropertyText extends ScriptPropertyBase { innerHTML: string } export interface ScriptPropertySrc extends ScriptPropertyBase { src: string, callback?: void } export interface ScriptPropertySrcCallback extends ScriptPropertyBase { vmid: string, callback: CallbackFn } type JsonVal = string | number | boolean | JsonObj | JsonObj[] | null interface JsonObj { [key: string]: JsonVal | JsonVal[] } export interface ScriptPropertyJson extends ScriptPropertyBase { json: JsonObj } export interface NoScriptProperty extends MetaDataProperty { innerHTML: string, } export interface MetaInfo { title?: string titleTemplate?: string | ((titleChunk: string) => string) | null, htmlAttrs?: AttributeProperty headAttrs?: AttributeProperty bodyAttrs?: AttributeProperty base?: { target: string, href: string } meta?: (MetaPropertyCharset | MetaPropertyEquiv | MetaPropertyTrueEquiv | MetaPropertyName | MetaPropertyMicrodata | MetaPropertyProperty)[] link?: (LinkPropertyBase | LinkPropertyHref | LinkPropertyHrefCallback)[] style?: StyleProperty[] script?: (ScriptPropertyText | ScriptPropertySrc | ScriptPropertySrcCallback | ScriptPropertyJson)[] noscript?: NoScriptProperty[] __dangerouslyDisableSanitizers?: string[] __dangerouslyDisableSanitizersByTagID?: { [key: string]: string[] } changed?: <T extends MetaInfoOutput>(newInfo: T, addedTags: elements, removedTags: elements) => void afterNavigation?: <T extends MetaInfoOutput>(newInfo: T) => void } export interface MetaInfoOutput extends MetaInfo { titleChunk?: string } export type MetaInfoComputed = () => MetaInfo interface ToText { text(): string } interface ToTextBooleanArg { text(addSrrAttribute?: boolean): string } interface AddLineBreakOption { ln: boolean } interface ToBodyTextOption { body: boolean } interface ToPbodyTextOption { pbody: boolean } interface ToBodyText { text(options?: (ToBodyTextOption | ToPbodyTextOption | AddLineBreakOption)): string } export interface MetaInfoSSR { head(ln?: boolean): string bodyPrepend(ln?: boolean): string bodyAppend(ln?: boolean): string title?: ToText htmlAttrs?: ToTextBooleanArg headAttrs?: ToText bodyAttrs?: ToText base?: ToBodyText meta?: ToBodyText link?: ToBodyText style?: ToBodyText script?: ToBodyText noscript?: ToBodyText } ```
/content/code_sandbox/types/vue-meta.d.ts
xml
2016-10-29T22:00:54
2024-08-15T08:49:06
vue-meta
nuxt/vue-meta
4,070
1,455
```xml <vector android:height="24dp" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="path_to_url"> <path android:fillColor="@android:color/white" android:pathData="M12 2l-5.5 9h11zm1 15.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 1 1-9 0m-10-4h8v8H3z"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_genre_vector.xml
xml
2016-01-10T12:21:23
2024-08-16T13:03:46
Simple-Music-Player
SimpleMobileTools/Simple-Music-Player
1,277
127
```xml // Note: we cannot import these from `node-libcurl` like normal because they come from the native library and it's not possible to load it while testing because it was built to run with Electron. // That applies to these Enum type imports, but also applies to the members of the class below. import { CurlAuth } from '@getinsomnia/node-libcurl/dist/enum/CurlAuth'; import { CurlCode } from '@getinsomnia/node-libcurl/dist/enum/CurlCode'; import { CurlFeature } from '@getinsomnia/node-libcurl/dist/enum/CurlFeature'; import { CurlHttpVersion } from '@getinsomnia/node-libcurl/dist/enum/CurlHttpVersion'; import { CurlInfoDebug } from '@getinsomnia/node-libcurl/dist/enum/CurlInfoDebug'; import { CurlNetrc } from '@getinsomnia/node-libcurl/dist/enum/CurlNetrc'; import { CurlSslOpt } from '@getinsomnia/node-libcurl/dist/enum/CurlSslOpt'; import { EventEmitter } from 'events'; import fs from 'fs'; class Curl extends EventEmitter { _options: { [key: string]: any } = {}; _meta: { [key: string]: any } = {}; _features: { [key: string]: any } = {}; static info = { COOKIELIST: 'COOKIELIST', EFFECTIVE_URL: 'EFFECTIVE_URL', SIZE_DOWNLOAD: 'SIZE_DOWNLOAD', TOTAL_TIME: 'TOTAL_TIME', }; static option = { ACCEPT_ENCODING: 'ACCEPT_ENCODING', CAINFO: 'CAINFO', CAINFO_BLOB: 'CAINFO_BLOB', COOKIEFILE: 'COOKIEFILE', COOKIELIST: 'COOKIELIST', CUSTOMREQUEST: 'CUSTOMREQUEST', DEBUGFUNCTION: 'DEBUGFUNCTION', FOLLOWLOCATION: 'FOLLOWLOCATION', HTTPAUTH: 'HTTPAUTH', HTTPGET: 'HTTPGET', HTTPHEADER: 'HTTPHEADER', HTTPPOST: 'HTTPPOST', HTTP_VERSION: 'HTTP_VERSION', INFILESIZE_LARGE: 'INFILESIZE_LARGE', KEYPASSWD: 'KEYPASSWD', MAXREDIRS: 'MAXREDIRS', NETRC: 'NETRC', NOBODY: 'NOBODY', NOPROGRESS: 'NOPROGRESS', NOPROXY: 'NOPROXY', PASSWORD: 'PASSWORD', POST: 'POST', POSTFIELDS: 'POSTFIELDS', PROXY: 'PROXY', PROXYAUTH: 'PROXYAUTH', READDATA: 'READDATA', READFUNCTION: 'READFUNCTION', SSLCERT: 'SSLCERT', SSLCERTTYPE: 'SSLCERTTYPE', SSLKEY: 'SSLKEY', SSL_VERIFYHOST: 'SSL_VERIFYHOST', SSL_VERIFYPEER: 'SSL_VERIFYPEER', TIMEOUT_MS: 'TIMEOUT_MS', UNIX_SOCKET_PATH: 'UNIX_SOCKET_PATH', UPLOAD: 'UPLOAD', URL: 'URL', USERAGENT: 'USERAGENT', USERNAME: 'USERNAME', VERBOSE: 'VERBOSE', WRITEFUNCTION: 'WRITEFUNCTION', XFERINFOFUNCTION: 'XFERINFOFUNCTION', SSL_OPTIONS: 'SSL_OPTIONS', }; static getVersion() { return 'libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0'; } enable(name: string | number) { this._features[name] = true; } setOpt(name: string, value: number | ((arg0: Buffer) => any)) { if (!name) { throw new Error(`Invalid option ${name} ${value}`); } if (name === Curl.option.CAINFO_BLOB) { // Just ignore this because it's platform-specific return; } if (name === Curl.option.READFUNCTION && typeof value === 'function') { let body = ''; // Only limiting this to prevent infinite loops for (let i = 0; i < 1000; i++) { const buffer = Buffer.alloc(23); const bytes = value(buffer); if (bytes === 0) { break; } body += buffer.slice(0, bytes); } this._meta[`${name}_VALUE`] = body; } if (name === Curl.option.COOKIELIST) { // This can be set multiple times this._options[name] = this._options[name] || []; this._options[name].push(value); } else if (name === Curl.option.READDATA && typeof value === 'number') { const { size } = fs.fstatSync(value); const buffer = Buffer.alloc(size); fs.readSync(value, buffer, 0, size, 0); this._options[name] = buffer.toString(); } else { this._options[name] = value; } } getInfo(name: string) { switch (name) { case Curl.info.COOKIELIST: return [`#HttpOnly_.insomnia.rest\tTRUE\t/url/path\tTRUE\t${Date.now() / 1000}\tfoo\tbar`]; case Curl.info.EFFECTIVE_URL: return this._options[Curl.option.URL]; case Curl.info.TOTAL_TIME: return 700; case Curl.info.SIZE_DOWNLOAD: return 800; default: throw new Error(`Invalid info ${name}`); } } perform() { process.nextTick(() => { const data = Buffer.from( JSON.stringify({ options: this._options, meta: this._meta, features: this._features, }), ); this.emit('data', data); this._options.WRITEFUNCTION(data); process.nextTick(() => { this.emit( 'end', 'NOT_USED', 'NOT_USED', [ 'HTTP/1.1 200 OK', `Content-Length: ${data.length}`, 'Content-Type: application/json', '', ].join('\n'), ); }); }); } close() {} } /** * This is just to make it easier to test * node-libcurl Enum exports (CurlAuth, CurlCode, etc) are TypeScript enums, which are converted to an object with format: * ```ts * const myEnum = { * EnumKey: 0, * 0: EnumKey, * } * ``` * We only want the named members (non-number ones) */ const getTsEnumOnlyWithNamedMembers = (enumObj: any) => { let obj = {}; for (const member in enumObj) { if (typeof enumObj[member] === 'number') { obj = { ...obj, [member]: member }; } } return obj; }; // WARNING: changing this to `export default` will break the mock and be incredibly hard to debug. Ask me how I know. export const nodeLibcurlMock = { Curl, CurlAuth: getTsEnumOnlyWithNamedMembers(CurlAuth), CurlCode: getTsEnumOnlyWithNamedMembers(CurlCode), CurlInfoDebug: getTsEnumOnlyWithNamedMembers(CurlInfoDebug), CurlFeature: getTsEnumOnlyWithNamedMembers(CurlFeature), CurlNetrc: getTsEnumOnlyWithNamedMembers(CurlNetrc), CurlHttpVersion: getTsEnumOnlyWithNamedMembers(CurlHttpVersion), CurlSslOpt: getTsEnumOnlyWithNamedMembers(CurlSslOpt), }; ```
/content/code_sandbox/packages/insomnia/src/__mocks__/@getinsomnia/node-libcurl.ts
xml
2016-04-23T03:54:26
2024-08-16T16:50:44
insomnia
Kong/insomnia
34,054
1,623
```xml /* * Squidex Headless CMS * * @license */ import { HttpClient } from '@angular/common/http'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { CodeEditorComponent } from '@app/framework'; @Component({ standalone: true, selector: 'sqx-asset-text-editor', styleUrls: ['./asset-text-editor.component.scss'], templateUrl: './asset-text-editor.component.html', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ CodeEditorComponent, FormsModule, ], }) export class AssetTextEditorComponent implements OnInit { @Input() public fileSource = ''; @Input() public fileName = ''; @Input() public mimeType = ''; public text = ''; constructor( private readonly changeDetector: ChangeDetectorRef, private readonly httpClient: HttpClient, ) { } public ngOnInit() { this.httpClient.get(this.fileSource, { responseType: 'text' }) .subscribe(text => { this.text = text; this.changeDetector.detectChanges(); }); } public toFile(): Promise<File | null> { return new Promise<File | null>(resolve => { const blob = new Blob([this.text || ''], { type: this.mimeType, }); const file = new File([blob], 'content.txt', { type: this.mimeType, }); resolve(file); }); } } ```
/content/code_sandbox/frontend/src/app/shared/components/assets/asset-text-editor.component.ts
xml
2016-08-29T05:53:40
2024-08-16T17:39:38
squidex
Squidex/squidex
2,222
315
```xml // Convert router.asPath to a URLSearchParams object // example: /dynamic/[slug]?foo=bar -> { foo: 'bar' } export function asPathToSearchParams(asPath: string): URLSearchParams { return new URL(asPath, 'path_to_url } ```
/content/code_sandbox/packages/next/src/shared/lib/router/utils/as-path-to-search-params.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
58
```xml /** * @packageDocumentation * @module ui-components-extension */ import { JupyterFrontEnd, JupyterFrontEndPlugin } from '@jupyterlab/application'; import { FormRendererRegistry, IFormRendererRegistry, ILabIconManager } from '@jupyterlab/ui-components'; /** * Placeholder for future extension that will provide an icon manager class * to assist with overriding/replacing particular sets of icons */ const labiconManager: JupyterFrontEndPlugin<ILabIconManager> = { id: '@jupyterlab/ui-components-extension:labicon-manager', description: 'Provides the icon manager.', provides: ILabIconManager, autoStart: true, activate: (app: JupyterFrontEnd) => { return Object.create(null); } }; /** * Sets up the renderer registry to be used by the FormEditor component. */ const formRendererRegistryPlugin: JupyterFrontEndPlugin<IFormRendererRegistry> = { id: '@jupyterlab/ui-components-extension:form-renderer-registry', description: 'Provides the settings form renderer registry.', provides: IFormRendererRegistry, autoStart: true, activate: (app: JupyterFrontEnd): IFormRendererRegistry => { const formRendererRegistry = new FormRendererRegistry(); return formRendererRegistry; } }; export default [labiconManager, formRendererRegistryPlugin]; ```
/content/code_sandbox/packages/ui-components-extension/src/index.ts
xml
2016-06-03T20:09:17
2024-08-16T19:12:44
jupyterlab
jupyterlab/jupyterlab
14,019
299
```xml import { type InputMask, type InputMaskElement, type FactoryArg, type UpdateOpts } from 'imask'; import { isPlatformBrowser } from '@angular/common'; import { Directive, ElementRef, Input, Output, forwardRef, Provider, Renderer2, EventEmitter, OnDestroy, OnChanges, AfterViewInit, SimpleChanges, PLATFORM_ID, inject } from '@angular/core'; import { NG_VALUE_ACCESSOR, ControlValueAccessor, COMPOSITION_BUFFER_MODE } from '@angular/forms'; import { IMASK_FACTORY } from './imask-factory-token'; export type Falsy = false | 0 | "" | null | undefined; export const MASKEDINPUT_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => IMaskDirective), multi: true, }; export type Value<Opts extends FactoryArg, Unmask extends ('typed' | boolean)> = Unmask extends 'typed' ? InputMask<Opts>['typedValue'] : Unmask extends Falsy ? InputMask<Opts>['value'] : InputMask<Opts>['unmaskedValue'] ; export const DEFAULT_IMASK_ELEMENT = (elementRef: any) => elementRef.nativeElement; @Directive({ selector: '[imask]', standalone: true, exportAs: 'imask', host: { '(input)': '_handleInput($event.target.value)', '(blur)': 'onTouched()', '(compositionstart)': '_compositionStart()', '(compositionend)': '_compositionEnd($event.target.value)' }, providers: [MASKEDINPUT_VALUE_ACCESSOR], }) export class IMaskDirective< Opts extends FactoryArg, Unmask extends ('typed' | boolean) = false, V = Value<Opts, Unmask>, > implements ControlValueAccessor, AfterViewInit, OnDestroy, OnChanges { maskRef?: InputMask<Opts>; onTouched: any = () => {}; onChange: any = () => {}; private _viewInitialized = false; private _initialValue: any; private _composing = false; private _writingValue: any; private _writing = false; private _elementRef = inject(ElementRef); private _renderer = inject(Renderer2); private _factory = inject(IMASK_FACTORY); private _platformId = inject(PLATFORM_ID); private _compositionMode = inject(COMPOSITION_BUFFER_MODE, {optional: true}) ?? !this._isAndroid(); @Input() imask?: Opts; @Input() unmask?: Unmask; @Input() imaskElement: (elementRef: ElementRef, directiveRef: any) => InputMaskElement = DEFAULT_IMASK_ELEMENT; @Output() accept = new EventEmitter<V>(); @Output() complete = new EventEmitter<V>(); get element () { return this.imaskElement(this._elementRef, this); } get maskValue (): V { if (!this.maskRef) return ((this.element as any)?.value || '') as V; if (this.unmask === 'typed') return this.maskRef.typedValue as V; if (this.unmask) return this.maskRef.unmaskedValue as V; return this.maskRef.value as V; } set maskValue (value: V) { if (this.maskRef) { if (this.unmask === 'typed') this.maskRef.typedValue = value; else if (this.unmask) this.maskRef.unmaskedValue = value as string; else this.maskRef.value = value as string; } else { this._renderer.setProperty(this.element, 'value', value); } } ngAfterViewInit() { if (this.imask) this.initMask(); this._viewInitialized = true; } ngOnChanges(changes: SimpleChanges) { if (changes['elementRef'] && !this.imaskElement) this.imaskElement = DEFAULT_IMASK_ELEMENT; if (!changes['imask'] || !this._viewInitialized) return; if (this.imask) { if (this.maskRef) this.maskRef.updateOptions(this.imask as UpdateOpts<Opts>); else { this.initMask(); this.onChange(this.maskValue); } } else { this.destroyMask(); } } destroyMask () { if (this.maskRef) { this.maskRef.destroy(); delete this.maskRef; } } ngOnDestroy () { this.destroyMask(); this.accept.complete(); this.complete.complete(); } beginWrite (value: V): void { this._writing = true; this._writingValue = value; } endWrite (): V { this._writing = false; return this._writingValue; } writeValue(value: V) { value = (value == null && this.unmask !== 'typed' ? '' : value) as V; if (this.maskRef) { this.beginWrite(value); this.maskValue = value; this.endWrite(); } else { this._renderer.setProperty(this.element, 'value', value); this._initialValue = value; } } _onAccept () { const value = this.maskValue; // if value was not changed during writing don't fire events // for details see path_to_url if (this._writing && value === this.endWrite()) return; this.onChange(value); this.accept.emit(value); } _onComplete () { this.complete.emit(this.maskValue); } private initMask () { this.maskRef = this._factory.create(this.element, this.imask as Opts) .on('accept', this._onAccept.bind(this)) .on('complete', this._onComplete.bind(this)); if (this._initialValue != null) this.writeValue(this._initialValue); delete this._initialValue; } setDisabledState (isDisabled: boolean) { this._renderer.setProperty(this.element, 'disabled', isDisabled) } registerOnChange(fn: (_: any) => void): void { this.onChange = fn } registerOnTouched(fn: () => void): void { this.onTouched = fn } _handleInput(value: any): void { // if mask is attached all input goes throw mask if (this.maskRef) return; if (!this._compositionMode || (this._compositionMode && !this._composing)) { this.onChange(value); } } _compositionStart(): void { this._composing = true; } _compositionEnd(value: any): void { this._composing = false; this._compositionMode && this._handleInput(value); } private _isAndroid(): boolean { return isPlatformBrowser(this._platformId) && /android (\d+)/.test(navigator.userAgent.toLowerCase()); } } ```
/content/code_sandbox/packages/angular-imask/src/imask.directive.ts
xml
2016-11-10T13:04:29
2024-08-16T15:16:18
imaskjs
uNmAnNeR/imaskjs
4,881
1,462
```xml import AccessibilityIcon from './ic-accessibility.svg' import AccountCardDetailsOutlineIcon from './ic-account-card-details-outline.svg' import AccountCircleIcon from './ic-account-circle.svg' import AccountIllustration from './il-account.svg' import AccountVariantIcon from './ic-account-variant.svg' import AddBoldIcon from './ic-add-bold.svg' import AddIcon from './ic-add.svg' import AddTextIcon from './ic-add-text.svg' import AegisIcon from './ic-aegis.svg' import ArchiveIcon from './ic-archive.svg' import ArrowDownCheckmarkIcon from './arrow-down-checkmark.svg' import ArrowDownIcon from './ic-arrow-down.svg' import ArrowLeftIcon from './ic-arrow-left.svg' import ArrowRightIcon from './ic-arrow-right.svg' import ArrowsHorizontalIcon from './ic-arrows-horizontal.svg' import ArrowsSortDownIcon from './ic-arrows-sort-down.svg' import ArrowsSortUpIcon from './ic-arrows-sort-up.svg' import ArrowsVerticalIcon from './ic-arrows-vertical.svg' import ArrowUpIcon from './ic-arrow-up.svg' import AsteriskIcon from './ic-asterisk.svg' import AttachmentFileIcon from './ic-attachment-file.svg' import AuthenticatorIcon from './ic-authenticator.svg' import AuthenticatorVariantIcon from './ic-authenticator-variant.svg' import BackIosIcon from './ic-back-ios.svg' import BackspaceIcon from './ic-backspace.svg' import BlockIcon from './ic-block.svg' import BlueDotIcon from './blue-dot.svg' import BoldIcon from './ic-bold.svg' import BoxFilledIcon from './ic-box-filled.svg' import BoxIcon from './ic-box.svg' import CameraIcon from './ic-camera.svg' import CaretRightIcon from './ic-caret-right.svg' import CheckAllIcon from './ic-check-all.svg' import CheckBoldIcon from './ic-check-bold.svg' import CheckCircleFilledIcon from './ic-check-circle-filled.svg' import CheckCircleIcon from './ic-check-circle.svg' import CheckIcon from './ic-check.svg' import CheckListIcon from './ic-list-check.svg' import ChevronDownIcon from './ic-chevron-down.svg' import ChevronLeftIcon from './ic-chevron-left.svg' import ChevronRightIcon from './ic-chevron-right.svg' import ChevronUpIcon from './ic-chevron-up.svg' import CircleIcon from './circle-55.svg' import ClearCircleFilledIcon from './ic-clear-circle-filled.svg' import CloseCircleFilledIcon from './ic-close-circle-filled.svg' import ClockIcon from './ic-clock.svg' import CloseIcon from './ic-close.svg' import CloudOffIcon from './ic-cloud-off.svg' import CodeIcon from './ic-code.svg' import CodeTagsIcon from './ic-code-tags.svg' import ColorFillIcon from './ic-color-fill.svg' import CopyIcon from './ic-copy.svg' import CreateAccountIllustration from './create-account-illustration.svg' import DashboardIcon from './ic-dashboard.svg' import DiamondFilledIcon from './ic-diamond-filled.svg' import DiamondIcon from './diamond-with-horizontal-lines.svg' import DownloadIcon from './ic-download.svg' import DragIcon from './ic-drag.svg' import DrawIcon from './ic-draw.svg' import EditorFilledIcon from './ic-editor-filled.svg' import EditorIcon from './ic-editor.svg' import EmailFilledIcon from './ic-email-filled.svg' import EmailIcon from './ic-email.svg' import EnterIcon from './ic-enter.svg' import EvernoteIcon from './ic-evernote.svg' import EyeFilledIcon from './ic-eye-filled.svg' import EyeIcon from './ic-eye.svg' import EyeOffFilledIcon from './ic-eye-off-filled.svg' import EyeOffIcon from './ic-eye-off.svg' import FeedbackIcon from './ic-feedback.svg' import FileDocIcon from './ic-file-doc.svg' import FileErrorIcon from './ic-file-error.svg' import FileFilledIcon from './ic-file-filled.svg' import FileIcon from './ic-file.svg' import FileImageIcon from './ic-file-image.svg' import FileMovIcon from './ic-file-mov.svg' import FileMusicIcon from './ic-file-music.svg' import FileOtherIcon from './ic-file-other.svg' import FilePdfIcon from './ic-file-pdf.svg' import FilePptIcon from './ic-file-ppt.svg' import FileSelectedIcon from './ic-file-selected.svg' import FilesIllustration from './il-files.svg' import FileXlsIcon from './ic-file-xls.svg' import FileZipIcon from './ic-file-zip.svg' import FolderFilledIcon from './ic-folder-filled.svg' import FolderIcon from './ic-folder.svg' import FolderKeyFilledIcon from './ic-folder-key-filled.svg' import FormatAlignCenterIcon from './ic-format-align-center.svg' import FormatAlignJustifyIcon from './ic-format-align-justify.svg' import FormatAlignLeftIcon from './ic-format-align-left.svg' import FormatAlignRightIcon from './ic-format-align-right.svg' import ForwardIosIcon from './ic-forward-ios.svg' import FullscreenExitIcon from './ic-fullscreen-exit.svg' import FullscreenIcon from './ic-fullscreen.svg' import GiftOutlineIcon from './ic-gift-outline.svg' import GoogleKeepIcon from './ic-gkeep.svg' import GroupIcon from './ic-group.svg' import HashtagFilledIcon from './ic-hashtag-filled.svg' import HashtagIcon from './ic-hashtag.svg' import HashtagOffIcon from './ic-hashtag-off.svg' import HeartFilledIcon from './ic-heart-filled.svg' import HelpFilledIcon from './ic-help-filled.svg' import HelpIcon from './ic-help.svg' import HistoryIcon from './ic-history.svg' import HistoryLockedIllustration from './il-history-locked.svg' import IconsSpriteStylekit from './icons-sprite-stylekit.svg' import IlNotesIcon from './il-notes.svg' import ImageIcon from './ic-image.svg' import IndentIcon from './ic-indent.svg' import InfoIcon from './ic-info.svg' import ItalicIcon from './ic-italic.svg' import KeyboardCloseIcon from './ic-keyboard-close.svg' import KeyboardCommandIcon from './ic-keyboard-command.svg' import KeyboardFilledIcon from './ic-keyboard-filled.svg' import KeyboardIcon from './ic-keyboard.svg' import KeyboardOptionIcon from './ic-keyboard-option.svg' import KeyboardShiftIcon from './ic-keyboard-shift.svg' import KeyboardShowIcon from './ic-keyboard-show.svg' import LifebuoyIcon from './ic-lifebuoy.svg' import LineWidthIcon from './ic-line-width.svg' import LinkIcon from './ic-link.svg' import LinkOffIcon from './ic-link-off.svg' import ListBulleted from './ic-list-bulleted.svg' import ListedFilledIcon from './ic-listed-filled.svg' import ListedIcon from './ic-listed.svg' import ListNumbered from './ic-list-numbered.svg' import LockFilledIcon from './ic-lock-filled.svg' import LockIcon from './ic-lock.svg' import MarkdownIcon from './ic-markdown.svg' import MenuArrowDownAlt from './ic-menu-arrow-down-alt.svg' import MenuArrowDownIcon from './ic-menu-arrow-down.svg' import MenuArrowRightIcon from './ic-menu-arrow-right.svg' import MenuCloseIcon from './ic-menu-close.svg' import MenuOpenIcon from './ic-menu-open.svg' import MenuVariantIcon from './ic-menu-variant.svg' import MergeIcon from './ic-merge.svg' import MoreIcon from './ic-more.svg' import MoreVertIcon from './ic-more-vert.svg' import NoPreviewIllustration from './il-no-preview.svg' import NotesFilledIcon from './ic-notes-filled.svg' import NotesIcon from './ic-notes.svg' import OpenInIcon from './ic-open-in.svg' import OutdentIcon from './ic-outdent.svg' import PasswordIcon from './ic-textbox-password.svg' import PencilFilledIcon from './ic-pencil-filled.svg' import PencilIcon from './ic-pencil.svg' import PencilOffIcon from './ic-pencil-off.svg' import PinFilledIcon from './ic-pin-filled.svg' import PinIcon from './ic-pin.svg' import PlainTextIcon from './ic-text-paragraph.svg' import PlusCircleFilledIcon from './ic-plus-circle-filled.svg' import PlusCircleIcon from './ic-plus-circle.svg' import PremiumFeatureIcon from './ic-premium-feature.svg' import PremiumIllustration from './il-premium.svg' import PrintIcon from './ic-print.svg' import ProtectedIllustration from './il-protected.svg' import RedoIcon from './ic-redo.svg' import ReorderIcon from './ic-reorder.svg' import ReplaceAllIcon from './ic-replace-all.svg' import ReplaceIcon from './ic-replace.svg' import RestoreIcon from './ic-restore.svg' import RichTextIcon from './ic-text-rich.svg' import SafeIcon from './ic-safe.svg' import SafeSquareFilledIcon from './ic-safe-square-filled.svg' import SafeSquareIcon from './ic-safe-square.svg' import SaveIcon from './ic-save.svg' import SearchIcon from './ic-search.svg' import SearchIosIcon from './ic-search-ios.svg' import SecurityIcon from './ic-security.svg' import SelectAllIcon from './ic-select-all.svg' import SendIcon from './ic-send.svg' import ServerIcon from './ic-server.svg' import SettingsFilledIcon from './ic-settings-filled.svg' import SettingsIcon from './ic-settings.svg' import ShareIcon from './ic-share.svg' import ShortcutButtonIcon from './ic-shortcut-button.svg' import SignInIcon from './ic-signin.svg' import SignOutIcon from './ic-signout.svg' import SimplenoteIcon from './ic-simplenote.svg' import SNLogoAltIcon from './ic-standard-notes-2.svg' import SNLogoFull from './ic-sn-logo-full.svg' import SNLogoIcon from './ic-standard-notes.svg' import SortDescendingIcon from './ic-sort-descending.svg' import SpreadsheetsIcon from './ic-spreadsheets.svg' import StarCircleFilled from './ic-star-circle-filled.svg' import StarFilledIcon from './ic-star-filled.svg' import StarIcon from './ic-star.svg' import StarVariantFilledIcon from './ic-star-variant-filled.svg' import StrikethroughIcon from './ic-strikethrough.svg' import SubscriptIcon from './ic-subscript.svg' import SubtractIcon from './ic-subtract.svg' import SuperscriptIcon from './ic-superscript.svg' import SyncIcon from './ic-sync.svg' import TasksIcon from './ic-tasks.svg' import TextCircleIcon from './ic-text-circle.svg' import TextIcon from './ic-text.svg' import TextParagraphLongIcon from './ic-text-paragraph-long.svg' import ThemesFilledIcon from './ic-themes-filled.svg' import ThemesIcon from './ic-themes.svg' import TimerIcon from './ic-timer.svg' import TrashFilledIcon from './ic-trash-filled.svg' import TrashIcon from './ic-trash.svg' import TrashSweepFilledIcon from './ic-trash-sweep-filled.svg' import TrashSweepIcon from './ic-trash-sweep.svg' import TuneIcon from './ic-tune.svg' import UnarchiveIcon from './ic-unarchive.svg' import UnderlineIcon from './ic-underline.svg' import UndoIcon from './ic-undo.svg' import UnpinIcon from './ic-pin-off.svg' import UploadIcon from './ic-upload.svg' import UserAddIcon from './ic-user-add.svg' import UserFilledIcon from './ic-user-filled.svg' import UserIcon from './ic-user.svg' import UserSwitch from './ic-user-switch.svg' import ViewIcon from './ic-view.svg' import WarningIcon from './ic-warning.svg' import WindowIcon from './ic-window.svg' import DetailsBlockIcon from './ic-details-block.svg' import TableOfContentsIcon from './ic-toc.svg' export { AccessibilityIcon, AccountCardDetailsOutlineIcon, AccountCircleIcon, AccountIllustration, AccountVariantIcon, AddBoldIcon, AddIcon, AddTextIcon, AegisIcon, ArchiveIcon, ArrowDownCheckmarkIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowsHorizontalIcon, ArrowsSortDownIcon, ArrowsSortUpIcon, ArrowsVerticalIcon, ArrowUpIcon, AsteriskIcon, AttachmentFileIcon, AuthenticatorIcon, AuthenticatorVariantIcon, BackIosIcon, BackspaceIcon, BlockIcon, BlueDotIcon, BoldIcon, BoxFilledIcon, BoxIcon, CameraIcon, CaretRightIcon, CheckAllIcon, CheckBoldIcon, CheckCircleFilledIcon, CheckCircleIcon, CheckIcon, CheckListIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClearCircleFilledIcon, CloseCircleFilledIcon, ClockIcon, CloseIcon, CloudOffIcon, CodeIcon, CodeTagsIcon, ColorFillIcon, CopyIcon, CreateAccountIllustration, DashboardIcon, DetailsBlockIcon, DiamondFilledIcon, DiamondIcon, DownloadIcon, DragIcon, DrawIcon, EditorFilledIcon, EditorIcon, EmailFilledIcon, EmailIcon, EnterIcon, EvernoteIcon, EyeFilledIcon, EyeIcon, EyeOffFilledIcon, EyeOffIcon, FeedbackIcon, FileDocIcon, FileErrorIcon, FileFilledIcon, FileIcon, FileImageIcon, FileMovIcon, FileMusicIcon, FileOtherIcon, FilePdfIcon, FilePptIcon, FileSelectedIcon, FilesIllustration, FileXlsIcon, FileZipIcon, FolderFilledIcon, FolderIcon, FolderKeyFilledIcon, FormatAlignCenterIcon, FormatAlignJustifyIcon, FormatAlignLeftIcon, FormatAlignRightIcon, ForwardIosIcon, FullscreenExitIcon, FullscreenIcon, GiftOutlineIcon, GoogleKeepIcon, GroupIcon, HashtagFilledIcon, HashtagIcon, HashtagOffIcon, HeartFilledIcon, HelpFilledIcon, HelpIcon, HistoryIcon, HistoryLockedIllustration, IconsSpriteStylekit, IlNotesIcon, ImageIcon, IndentIcon, InfoIcon, ItalicIcon, KeyboardCloseIcon, KeyboardCommandIcon, KeyboardFilledIcon, KeyboardIcon, KeyboardOptionIcon, KeyboardShiftIcon, KeyboardShowIcon, LifebuoyIcon, LineWidthIcon, LinkIcon, LinkOffIcon, ListBulleted, ListedFilledIcon, ListedIcon, ListNumbered, LockFilledIcon, LockIcon, MarkdownIcon, MenuArrowDownAlt, MenuArrowDownIcon, MenuArrowRightIcon, MenuCloseIcon, MenuOpenIcon, MenuVariantIcon, MergeIcon, MoreIcon, MoreVertIcon, NoPreviewIllustration, NotesFilledIcon, NotesIcon, OpenInIcon, OutdentIcon, PasswordIcon, PencilFilledIcon, PencilIcon, PencilOffIcon, PinFilledIcon, PinIcon, PlainTextIcon, PlusCircleFilledIcon, PlusCircleIcon, PremiumFeatureIcon, PremiumIllustration, PrintIcon, ProtectedIllustration, RedoIcon, ReorderIcon, ReplaceAllIcon, ReplaceIcon, RestoreIcon, RichTextIcon, SafeIcon, SafeSquareFilledIcon, SafeSquareIcon, SaveIcon, SearchIcon, SearchIosIcon, SecurityIcon, SelectAllIcon, SendIcon, ServerIcon, SettingsFilledIcon, SettingsIcon, ShareIcon, ShortcutButtonIcon, SignInIcon, SignOutIcon, SimplenoteIcon, SNLogoAltIcon, SNLogoFull, SNLogoIcon, SortDescendingIcon, SpreadsheetsIcon, StarCircleFilled, StarFilledIcon, StarIcon, StarVariantFilledIcon, StrikethroughIcon, SubscriptIcon, SubtractIcon, SuperscriptIcon, SyncIcon, TableOfContentsIcon, TasksIcon, TextCircleIcon, TextIcon, TextParagraphLongIcon, ThemesFilledIcon, ThemesIcon, TimerIcon, TrashFilledIcon, TrashIcon, TrashSweepFilledIcon, TrashSweepIcon, TuneIcon, UnarchiveIcon, UnderlineIcon, UndoIcon, UnpinIcon, UploadIcon, UserAddIcon, UserFilledIcon, UserIcon, UserSwitch, ViewIcon, WarningIcon, WindowIcon, } ```
/content/code_sandbox/packages/icons/src/Icons/index.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
3,510
```xml /* eslint-disable class-methods-use-this */ /* eslint-disable @typescript-eslint/explicit-member-accessibility */ import { TransactionSignCommand } from 'lisk-commander'; import { Application, Types } from 'lisk-sdk'; import { getApplication } from '../../app/app'; type SignFlags = typeof TransactionSignCommand.flags & { [key: string]: Record<string, unknown> }; export class SignCommand extends TransactionSignCommand { static flags: SignFlags = { ...TransactionSignCommand.flags, }; static args = [...TransactionSignCommand.args]; public getApplication(config: Types.PartialApplicationConfig): Application { const app = getApplication(config); return app; } } ```
/content/code_sandbox/examples/interop/pos-sidechain-example-two/src/commands/transaction/sign.ts
xml
2016-02-01T21:45:35
2024-08-15T19:16:48
lisk-sdk
LiskArchive/lisk-sdk
2,721
142
```xml <?xml version="1.0" encoding="utf-8"?> <!-- ~ All Rights Reserved. --> <merge xmlns:android="path_to_url"> <ImageView android:id="@+id/backdrop" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" /> <View android:id="@+id/scrim" android:layout_width="match_parent" android:layout_height="@dimen/scrim_height" android:layout_gravity="bottom" /> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:clipChildren="false"> <me.zhanghai.android.douya.ui.SimpleCircleImageView android:id="@+id/fade_out_recent_one_avatar" android:layout_width="@dimen/touch_target_size" android:layout_height="@dimen/touch_target_size" android:layout_alignLeft="@+id/recent_one_avatar" android:layout_alignTop="@id/recent_one_avatar" android:padding="@dimen/avatar_padding" /> <me.zhanghai.android.douya.ui.SimpleCircleImageView android:id="@+id/recent_one_avatar" android:layout_width="@dimen/touch_target_size" android:layout_height="@dimen/touch_target_size" android:layout_toLeftOf="@+id/recent_two_avatar" android:layout_alignWithParentIfMissing="true" android:layout_marginRight="@dimen/screen_edge_horizontal_margin_with_8dp_padding" android:layout_marginTop="@dimen/screen_edge_horizontal_margin_with_4dp_padding" android:padding="@dimen/avatar_padding" /> <me.zhanghai.android.douya.ui.SimpleCircleImageView android:id="@+id/fade_out_recent_two_avatar" android:layout_width="@dimen/touch_target_size" android:layout_height="@dimen/touch_target_size" android:layout_alignLeft="@id/recent_two_avatar" android:layout_alignTop="@id/recent_two_avatar" android:padding="@dimen/avatar_padding" android:visibility="invisible" /> <me.zhanghai.android.douya.ui.SimpleCircleImageView android:id="@+id/recent_two_avatar" android:layout_width="@dimen/touch_target_size" android:layout_height="@dimen/touch_target_size" android:layout_alignParentRight="true" android:layout_marginRight="@dimen/screen_edge_horizontal_margin_with_4dp_padding" android:layout_marginTop="@dimen/screen_edge_horizontal_margin_with_4dp_padding" android:padding="@dimen/avatar_padding" /> <me.zhanghai.android.douya.ui.SimpleCircleImageView android:id="@+id/fade_out_avatar" android:layout_width="@dimen/navigation_header_avatar_size" android:layout_height="@dimen/navigation_header_avatar_size" android:layout_alignLeft="@+id/avatar" android:layout_alignTop="@id/avatar" android:visibility="invisible" /> <me.zhanghai.android.douya.ui.SimpleCircleImageView android:id="@+id/avatar" android:layout_width="@dimen/navigation_header_avatar_size" android:layout_height="@dimen/navigation_header_avatar_size" android:layout_marginLeft="@dimen/screen_edge_horizontal_margin" android:layout_marginTop="@dimen/screen_edge_horizontal_margin" /> </RelativeLayout> <LinearLayout android:id="@+id/info" android:layout_width="match_parent" android:layout_height="@dimen/single_line_list_item_height" android:layout_gravity="bottom" android:layout_marginBottom="@dimen/list_padding_vertical" android:paddingRight="@dimen/screen_edge_horizontal_margin" android:background="?selectableItemBackground" android:gravity="center_vertical" android:orientation="horizontal"> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:paddingLeft="@dimen/screen_edge_horizontal_margin" android:orientation="vertical"> <!-- ~ Use android:width="match_parent" for the two TextViews so that their bounds can ~ remain stable when transition start. Otherwise glitches will happen. --> <TextView android:id="@+id/name" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="end" android:maxLines="1" android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textStyle="bold" /> <TextView android:id="@+id/description" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="end" android:maxLines="1" android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textColor="?android:textColorSecondary" /> </LinearLayout> <ImageView android:id="@+id/dropDown" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/drop_down_icon_white_24dp" /> </LinearLayout> </FrameLayout> </merge> ```
/content/code_sandbox/app/src/main/res/layout/navigation_header_layout.xml
xml
2016-02-01T13:44:19
2024-08-15T05:23:34
Douya
zhanghai/Douya
4,549
1,162
```xml <!-- ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <dataset> <metadata> <column name="constraint_catalog"/> <column name="constraint_schema"/> <column name="constraint_name"/> <column name="unique_constraint_catalog"/> <column name="unique_constraint_schema"/> <column name="unique_constraint_name"/> <column name="match_option"/> <column name="update_rule"/> <column name="delete_rule"/> </metadata> </dataset> ```
/content/code_sandbox/test/e2e/sql/src/test/resources/cases/dql/dataset/empty_storage_units/opengauss/select_opengauss_information_schema_referential_constraints.xml
xml
2016-01-18T12:49:26
2024-08-16T15:48:11
shardingsphere
apache/shardingsphere
19,707
161
```xml import * as React from "react"; import { useContext } from "react"; import css from "./styling/HeaderBar.module.scss"; import { Button } from "react-common/components/controls/Button"; import { MenuBar } from "react-common/components/controls/MenuBar"; import { AppStateContext } from "../state/appStateContext"; import { Ticks } from "../constants"; import { UserAvatarDropdown } from "react-common/components/profile/UserAvatarDropdown"; import { SignInButton } from "react-common/components/profile/SignInButton"; import { logoutAsync } from "../services/authClient"; import { showModal } from "../state/actions"; interface HeaderBarProps {} export const HeaderBar: React.FC<HeaderBarProps> = () => { const { state } = useContext(AppStateContext); const appTheme = pxt.appTarget?.appTheme; const onBrandIconClick = () => { pxt.tickEvent(Ticks.BrandLink); if (appTheme?.logoUrl) { window.open(appTheme.logoUrl); } }; const onOrgClick = () => { pxt.tickEvent(Ticks.OrgLink); if (appTheme?.organizationUrl) { window.open(appTheme.organizationUrl); } }; const getOrganizationLogo = () => { return ( <div className={css["org"]} onClick={onOrgClick}> {appTheme.organizationWideLogo || appTheme.organizationLogo ? ( <img className={css["logo"]} src={appTheme.organizationWideLogo || appTheme.organizationLogo} alt={lf("{0} Logo", appTheme.organization)} /> ) : ( <span className="name">{appTheme.organization}</span> )} </div> ); }; const getTargetLogo = () => { return ( <div className={css["brand"]} aria-label={lf("{0} Logo", appTheme.boardName)} role="menuitem" onClick={onBrandIconClick} > {appTheme.useTextLogo ? ( [ <span className={css["name"]} key="org-name"> {appTheme.organizationText} </span>, <span className={css["name-short"]} key="org-name-short"> {appTheme.organizationShortText || appTheme.organizationText} </span>, ] ) : appTheme.logo || appTheme.portraitLogo ? ( <img className={css["logo"]} src={appTheme.logo || appTheme.portraitLogo} alt={lf("{0} Logo", appTheme.boardName)} /> ) : ( <span className={css["name"]}>{appTheme.boardName}</span> )} </div> ); }; const onHomeClicked = () => { pxt.tickEvent(Ticks.HomeLink); // relprefix looks like "/beta---", need to chop off the hyphens and slash let rel = pxt.webConfig?.relprefix.substr(0, pxt.webConfig.relprefix.length - 3); if (pxt.appTarget.appTheme.homeUrl && rel) { if (pxt.appTarget.appTheme.homeUrl?.lastIndexOf("/") === pxt.appTarget.appTheme.homeUrl?.length - 1) { rel = rel.substr(1); } window.open(pxt.appTarget.appTheme.homeUrl + rel); } else { window.open(pxt.appTarget.appTheme.homeUrl); } }; return ( <MenuBar className={css["header"]} ariaLabel={lf("Header")} role="navigation"> <div className={css["left-menu"]}> {getOrganizationLogo()} {getTargetLogo()} </div> <div className={css["right-menu"]}> <ProfileMenu /> <Button className="menu-button" leftIcon="fas fa-home large" title={lf("Open the MakeCode editor")} onClick={onHomeClicked} /> </div> </MenuBar> ); }; const ProfileMenu: React.FC = () => { const { state, dispatch } = useContext(AppStateContext); return ( <> {state.userProfile && <UserAvatarDropdown userProfile={state.userProfile} title={lf("Your Profile")} onSignOutClick={() => logoutAsync()} /> } {!state.userProfile && <SignInButton onSignInClick={() => dispatch(showModal({ modal: "signin"}))} /> } </> ) } ```
/content/code_sandbox/tutorialtool/src/components/HeaderBar.tsx
xml
2016-01-24T19:35:52
2024-08-16T16:39:39
pxt
microsoft/pxt
2,069
952
```xml /************************************************************* * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ /** * @fileoverview Implements utilities for notations for menclose elements * * @author dpvc@mathjax.org (Davide Cervone) */ import {AnyWrapper} from './Wrapper.js'; import {CommonMenclose} from './Wrappers/menclose.js'; /*****************************************************************/ export const ARROWX = 4, ARROWDX = 1, ARROWY = 2; // default relative arrowhead values export const THICKNESS = .067; // default rule thickness export const PADDING = .2; // default padding export const SOLID = THICKNESS + 'em solid'; // a solid border /*****************************************************************/ /** * Shorthand for CommonMenclose */ export type Menclose = CommonMenclose<any, any, any>; /** * Top, right, bottom, left padding data */ export type PaddingData = [number, number, number, number]; /** * The functions used for notation definitions * * @templare N The DOM node class */ export type Renderer<W extends AnyWrapper, N> = (node: W, child: N) => void; export type BBoxExtender<W extends AnyWrapper> = (node: W) => PaddingData; export type BBoxBorder<W extends AnyWrapper> = (node: W) => PaddingData; export type Initializer<W extends AnyWrapper> = (node: W) => void; /** * The definition of a notation * * @template W The menclose wrapper class * @templare N The DOM node class */ export type NotationDef<W extends AnyWrapper, N> = { renderer: Renderer<W, N>; // renders the DOM nodes for the notation bbox: BBoxExtender<W>; // gives the offsets to the child bounding box: [top, right, bottom, left] border?: BBoxBorder<W>; // gives the amount of the bbox offset that is due to borders on the child renderChild?: boolean; // true if the notation is used to render the child directly (e.g., radical) init?: Initializer<W>; // function to be called during wrapper construction remove?: string; // list of notations that are suppressed by this one }; /** * For defining notation maps * * @template W The menclose wrapper class * @templare N The DOM node class */ export type DefPair<W extends AnyWrapper, N> = [string, NotationDef<W, N>]; export type DefList<W extends AnyWrapper, N> = Map<string, NotationDef<W, N>>; export type DefPairF<T, W extends AnyWrapper, N> = (name: T) => DefPair<W, N>; /** * The list of notations for an menclose element * * @template W The menclose wrapper class * @templare N The DOM node class */ export type List<W extends AnyWrapper, N> = {[notation: string]: NotationDef<W, N>}; /*****************************************************************/ /** * The names and indices of sides for borders, padding, etc. */ export const sideIndex = {top: 0, right: 1, bottom: 2, left: 3}; export type Side = keyof typeof sideIndex; export const sideNames = Object.keys(sideIndex) as Side[]; /** * Common BBox and Border functions */ export const fullBBox = ((node) => new Array(4).fill(node.thickness + node.padding)) as BBoxExtender<Menclose>; export const fullPadding = ((node) => new Array(4).fill(node.padding)) as BBoxExtender<Menclose>; export const fullBorder = ((node) => new Array(4).fill(node.thickness)) as BBoxBorder<Menclose>; /*****************************************************************/ /** * The length of an arrowhead */ export const arrowHead = (node: Menclose) => { return Math.max(node.padding, node.thickness * (node.arrowhead.x + node.arrowhead.dx + 1)); }; /** * Adjust short bbox for tall arrow heads */ export const arrowBBoxHD = (node: Menclose, TRBL: PaddingData) => { if (node.childNodes[0]) { const {h, d} = node.childNodes[0].getBBox(); TRBL[0] = TRBL[2] = Math.max(0, node.thickness * node.arrowhead.y - (h + d) / 2); } return TRBL; }; /** * Adjust thin bbox for wide arrow heads */ export const arrowBBoxW = (node: Menclose, TRBL: PaddingData) => { if (node.childNodes[0]) { const {w} = node.childNodes[0].getBBox(); TRBL[1] = TRBL[3] = Math.max(0, node.thickness * node.arrowhead.y - w / 2); } return TRBL; }; /** * The data for horizontal and vertical arrow notations * [angle, double, isVertical, remove] */ export const arrowDef = { up: [-Math.PI / 2, false, true, 'verticalstrike'], down: [ Math.PI / 2, false, true, 'verticakstrike'], right: [ 0, false, false, 'horizontalstrike'], left: [ Math.PI, false, false, 'horizontalstrike'], updown: [ Math.PI / 2, true, true, 'verticalstrike uparrow downarrow'], leftright: [ 0, true, false, 'horizontalstrike leftarrow rightarrow'] } as {[name: string]: [number, boolean, boolean, string]}; /** * The data for diagonal arrow notations * [c, pi, double, remove] */ export const diagonalArrowDef = { updiagonal: [-1, 0, false, 'updiagonalstrike northeastarrow'], northeast: [-1, 0, false, 'updiagonalstrike updiagonalarrow'], southeast: [ 1, 0, false, 'downdiagonalstrike'], northwest: [ 1, Math.PI, false, 'downdiagonalstrike'], southwest: [-1, Math.PI, false, 'updiagonalstrike'], northeastsouthwest: [-1, 0, true, 'updiagonalstrike northeastarrow updiagonalarrow southwestarrow'], northwestsoutheast: [ 1, 0, true, 'downdiagonalstrike northwestarrow southeastarrow'] } as {[name: string]: [number, number, boolean, string]}; /** * The BBox functions for horizontal and vertical arrows */ export const arrowBBox = { up: (node) => arrowBBoxW(node, [arrowHead(node), 0, node.padding, 0]), down: (node) => arrowBBoxW(node, [node.padding, 0, arrowHead(node), 0]), right: (node) => arrowBBoxHD(node, [0, arrowHead(node), 0, node.padding]), left: (node) => arrowBBoxHD(node, [0, node.padding, 0, arrowHead(node)]), updown: (node) => arrowBBoxW(node, [arrowHead(node), 0, arrowHead(node), 0]), leftright: (node) => arrowBBoxHD(node, [0, arrowHead(node), 0, arrowHead(node)]) } as {[name: string]: BBoxExtender<Menclose>}; /*****************************************************************/ /** * @param {Renderer} render The function for adding the border to the node * @return {string => DefPair} The function returingn the notation definition * for the notation having a line on the given side */ export const CommonBorder = function<W extends Menclose, N>(render: Renderer<W, N>): DefPairF<Side, W, N> { /** * @param {string} side The side on which a border should appear * @return {DefPair} The notation definition for the notation having a line on the given side */ return (side: Side) => { const i = sideIndex[side]; return [side, { // // Add the border to the main child object // renderer: render, // // Indicate the extra space on the given side // bbox: (node) => { const bbox = [0, 0, 0, 0] as PaddingData; bbox[i] = node.thickness + node.padding; return bbox; }, // // Indicate the border on the given side // border: (node) => { const bbox = [0, 0, 0, 0] as PaddingData; bbox[i] = node.thickness; return bbox; } }]; }; }; /** * @param {Renderer} render The function for adding the borders to the node * @return {(sring, Side, Side) => DefPair} The function returning the notation definition * for the notation having lines on two sides */ export const CommonBorder2 = function<W extends Menclose, N>(render: Renderer<W, N>): (name: string, side1: Side, side2: Side) => DefPair<W, N> { /** * @param {string} name The name of the notation to define * @param {Side} side1 The first side to get a border * @param {Side} side2 The second side to get a border * @return {DefPair} The notation definition for the notation having lines on two sides */ return (name: string, side1: Side, side2: Side) => { const i1 = sideIndex[side1]; const i2 = sideIndex[side2]; return [name, { // // Add the border along the given sides // renderer: render, // // Mark the extra space along the two sides // bbox: (node) => { const t = node.thickness + node.padding; const bbox = [0, 0, 0, 0] as PaddingData; bbox[i1] = bbox[i2] = t; return bbox; }, // // Indicate the border on the two sides // border: (node) => { const bbox = [0, 0, 0, 0] as PaddingData; bbox[i1] = bbox[i2] = node.thickness; return bbox; }, // // Remove the single side notations, if present // remove: side1 + ' ' + side2 }]; }; }; /*****************************************************************/ /** * @param {string => Renderer} render The function for adding the strike to the node * @return {string => DefPair} The function returning the notation definition for the diagonal strike */ export const CommonDiagonalStrike = function<W extends Menclose, N>(render: (sname: string) => Renderer<W, N>): DefPairF<string, W, N> { /** * @param {string} name The name of the diagonal strike to define * @return {DefPair} The notation definition for the diagonal strike */ return (name: string) => { const cname = 'mjx-' + name.charAt(0) + 'strike'; return [name + 'diagonalstrike', { // // Find the angle and width from the bounding box size and create the diagonal line // renderer: render(cname), // // Add padding all around // bbox: fullBBox }]; }; }; /*****************************************************************/ /** * @param {Renderer} render The function to add the arrow to the node * @return {string => DefPair} The funciton returning the notation definition for the diagonal arrow */ export const CommonDiagonalArrow = function<W extends Menclose, N>(render: Renderer<W, N>): DefPairF<string, W, N> { /** * @param {string} name The name of the diagonal arrow to define * @return {DefPair} The notation definition for the diagonal arrow */ return (name: string) => { const [c, pi, double, remove] = diagonalArrowDef[name]; return [name + 'arrow', { // // Find the angle and width from the bounding box size and create // the arrow from them and the other arrow data // renderer: (node, _child) => { const [a, W] = node.arrowAW(); const arrow = node.arrow(W, c * (a - pi), double); render(node, arrow); }, // // Add space for the arrowhead all around // bbox: (node) => { const {a, x, y} = node.arrowData(); const [ax, ay, adx] = [node.arrowhead.x, node.arrowhead.y, node.arrowhead.dx]; const [b, ar] = node.getArgMod(ax + adx, ay); const dy = y + (b > a ? node.thickness * ar * Math.sin(b - a) : 0); const dx = x + (b > Math.PI / 2 - a ? node.thickness * ar * Math.sin(b + a - Math.PI / 2) : 0); return [dy, dx, dy, dx]; }, // // Remove redundant notations // remove: remove }]; }; }; /** * @param {Renderer} render The function to add the arrow to the node * @return {string => DefPair} The function returning the notation definition for the arrow */ export const CommonArrow = function<W extends Menclose, N>(render: Renderer<W, N>): DefPairF<string, W, N> { /** * @param {string} name The name of the horizontal or vertical arrow to define * @return {DefPair} The notation definition for the arrow */ return (name: string) => { const [angle, double, isVertical, remove] = arrowDef[name]; return [name + 'arrow', { // // Get the arrow height and depth from the bounding box and the arrow direction // then create the arrow from that and the other data // renderer: (node, _child) => { const {w, h, d} = node.getBBox(); const [W, offset] = (isVertical ? [h + d, 'X'] : [w, 'Y']); const dd = node.getOffset(offset); const arrow = node.arrow(W, angle, double, offset, dd); render(node, arrow); }, // // Add the padding to the proper sides // bbox: arrowBBox[name], // // Remove redundant notations // remove: remove }]; }; }; ```
/content/code_sandbox/ts/output/common/Notation.ts
xml
2016-02-23T09:52:03
2024-08-16T04:46:50
MathJax-src
mathjax/MathJax-src
2,017
3,347
```xml export { Constant } from './constant'; export { Transform } from './transform'; export { Field } from './field'; export { Column } from './column'; export type { ConstantOptions } from './constant'; export type { TransformOptions } from './transform'; export type { FieldOptions } from './field'; export type { ColumnOptions } from './column'; ```
/content/code_sandbox/src/encode/index.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
73
```xml import { InputOutputValue, INumberHash, ITrainingDatum } from '../lookup'; export type LookupTableProp = 'input' | 'output'; export class LookupTable { length: number; prop: LookupTableProp | null = null; table: INumberHash = {}; constructor( data: ITrainingDatum[] | InputOutputValue[] | InputOutputValue[][], prop?: LookupTableProp ) { this.length = 0; const table = this.table; if (prop) { this.prop = prop; for (let i = 0; i < data.length; i++) { const datum = (data as ITrainingDatum[])[i]; const object = datum[prop] as INumberHash; for (const p in object) { if (!object.hasOwnProperty(p)) continue; if (table.hasOwnProperty(p)) continue; table[p] = this.length++; } } } else if (Array.isArray(data) && Array.isArray(data[0])) { for (let i = 0; i < data.length; i++) { const array = (data as InputOutputValue[][])[i]; for (let j = 0; j < array.length; j++) { const object = array[j]; for (const p in object) { if (!object.hasOwnProperty(p)) continue; if (table.hasOwnProperty(p)) continue; table[p] = this.length++; } } } } else { for (let i = 0; i < data.length; i++) { const object = (data as INumberHash[])[i]; for (const p in object) { if (!object.hasOwnProperty(p)) continue; if (table.hasOwnProperty(p)) continue; table[p] = this.length++; } } } } } ```
/content/code_sandbox/src/utilities/lookup-table.ts
xml
2016-02-13T18:09:44
2024-08-15T20:41:49
brain.js
BrainJS/brain.js
14,300
392
```xml import { ConsumerPact, makeConsumerPact } from '@pact-foundation/pact-core'; import { UnconfiguredInteraction } from './http'; import { PactV4Options, V4UnconfiguredInteraction } from './http/types'; import { V4ConsumerPact } from './types'; import { version as pactPackageVersion } from '../../package.json'; import { V4UnconfiguredSynchronousMessage } from './message/types'; import { UnconfiguredSynchronousMessage } from './message'; import { SpecificationVersion } from '../v3'; export class PactV4 implements V4ConsumerPact { private pact: ConsumerPact; constructor(private opts: PactV4Options) { this.setup(); this.pact.addMetadata('pact-js', 'version', pactPackageVersion); } setup(): void { this.pact = makeConsumerPact( this.opts.consumer, this.opts.provider, this.opts.spec ?? SpecificationVersion.SPECIFICATION_VERSION_V4, this.opts.logLevel ?? 'info' ); } addInteraction(): V4UnconfiguredInteraction { return new UnconfiguredInteraction( this.pact, this.pact.newInteraction(''), this.opts, () => { // This function needs to be called if the PactV4 object is to be re-used (commonly expected by users) // Because of the type-state model used here, it's a bit awkward as we need to thread this through // to children, ultimately to be called on the "executeTest" stage. this.setup(); } ); } addSynchronousInteraction( description: string ): V4UnconfiguredSynchronousMessage { return new UnconfiguredSynchronousMessage( this.pact, this.pact.newSynchronousMessage(description), this.opts, () => { // This function needs to be called if the PactV4 object is to be re-used (commonly expected by users) // Because of the type-state model used here, it's a bit awkward as we need to thread this through // to children, ultimately to be called on the "executeTest" stage. this.setup(); } ); } } ```
/content/code_sandbox/src/v4/index.ts
xml
2016-06-03T12:02:17
2024-08-15T05:47:24
pact-js
pact-foundation/pact-js
1,596
465
```xml import * as crypto from "crypto"; import * as argon2 from "argon2"; import * as forge from "node-forge"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { DecryptParameters } from "@bitwarden/common/platform/models/domain/decrypt-parameters"; import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key"; import { CsprngArray } from "@bitwarden/common/types/csprng"; export class NodeCryptoFunctionService implements CryptoFunctionService { pbkdf2( password: string | Uint8Array, salt: string | Uint8Array, algorithm: "sha256" | "sha512", iterations: number, ): Promise<Uint8Array> { const len = algorithm === "sha256" ? 32 : 64; const nodePassword = this.toNodeValue(password); const nodeSalt = this.toNodeValue(salt); return new Promise<Uint8Array>((resolve, reject) => { crypto.pbkdf2(nodePassword, nodeSalt, iterations, len, algorithm, (error, key) => { if (error != null) { reject(error); } else { resolve(this.toUint8Buffer(key)); } }); }); } async argon2( password: string | Uint8Array, salt: string | Uint8Array, iterations: number, memory: number, parallelism: number, ): Promise<Uint8Array> { const nodePassword = this.toNodeValue(password); const nodeSalt = this.toNodeBuffer(this.toUint8Buffer(salt)); const hash = await argon2.hash(nodePassword, { salt: nodeSalt, raw: true, hashLength: 32, timeCost: iterations, memoryCost: memory, parallelism: parallelism, type: argon2.argon2id, }); return this.toUint8Buffer(hash); } // ref: path_to_url async hkdf( ikm: Uint8Array, salt: string | Uint8Array, info: string | Uint8Array, outputByteSize: number, algorithm: "sha256" | "sha512", ): Promise<Uint8Array> { const saltBuf = this.toUint8Buffer(salt); const prk = await this.hmac(ikm, saltBuf, algorithm); return this.hkdfExpand(prk, info, outputByteSize, algorithm); } // ref: path_to_url async hkdfExpand( prk: Uint8Array, info: string | Uint8Array, outputByteSize: number, algorithm: "sha256" | "sha512", ): Promise<Uint8Array> { const hashLen = algorithm === "sha256" ? 32 : 64; if (outputByteSize > 255 * hashLen) { throw new Error("outputByteSize is too large."); } const prkArr = new Uint8Array(prk); if (prkArr.length < hashLen) { throw new Error("prk is too small."); } const infoBuf = this.toUint8Buffer(info); const infoArr = new Uint8Array(infoBuf); let runningOkmLength = 0; let previousT = new Uint8Array(0); const n = Math.ceil(outputByteSize / hashLen); const okm = new Uint8Array(n * hashLen); for (let i = 0; i < n; i++) { const t = new Uint8Array(previousT.length + infoArr.length + 1); t.set(previousT); t.set(infoArr, previousT.length); t.set([i + 1], t.length - 1); previousT = await this.hmac(t, prk, algorithm); okm.set(previousT, runningOkmLength); runningOkmLength += previousT.length; if (runningOkmLength >= outputByteSize) { break; } } return okm.slice(0, outputByteSize); } hash( value: string | Uint8Array, algorithm: "sha1" | "sha256" | "sha512" | "md5", ): Promise<Uint8Array> { const nodeValue = this.toNodeValue(value); const hash = crypto.createHash(algorithm); hash.update(nodeValue); return Promise.resolve(this.toUint8Buffer(hash.digest())); } hmac( value: Uint8Array, key: Uint8Array, algorithm: "sha1" | "sha256" | "sha512", ): Promise<Uint8Array> { const nodeValue = this.toNodeBuffer(value); const nodeKey = this.toNodeBuffer(key); const hmac = crypto.createHmac(algorithm, nodeKey); hmac.update(nodeValue); return Promise.resolve(this.toUint8Buffer(hmac.digest())); } async compare(a: Uint8Array, b: Uint8Array): Promise<boolean> { const key = await this.randomBytes(32); const mac1 = await this.hmac(a, key, "sha256"); const mac2 = await this.hmac(b, key, "sha256"); if (mac1.byteLength !== mac2.byteLength) { return false; } const arr1 = new Uint8Array(mac1); const arr2 = new Uint8Array(mac2); for (let i = 0; i < arr2.length; i++) { if (arr1[i] !== arr2[i]) { return false; } } return true; } hmacFast( value: Uint8Array, key: Uint8Array, algorithm: "sha1" | "sha256" | "sha512", ): Promise<Uint8Array> { return this.hmac(value, key, algorithm); } compareFast(a: Uint8Array, b: Uint8Array): Promise<boolean> { return this.compare(a, b); } aesEncrypt(data: Uint8Array, iv: Uint8Array, key: Uint8Array): Promise<Uint8Array> { const nodeData = this.toNodeBuffer(data); const nodeIv = this.toNodeBuffer(iv); const nodeKey = this.toNodeBuffer(key); const cipher = crypto.createCipheriv("aes-256-cbc", nodeKey, nodeIv); const encBuf = Buffer.concat([cipher.update(nodeData), cipher.final()]); return Promise.resolve(this.toUint8Buffer(encBuf)); } aesDecryptFastParameters( data: string, iv: string, mac: string, key: SymmetricCryptoKey, ): DecryptParameters<Uint8Array> { const p = new DecryptParameters<Uint8Array>(); p.encKey = key.encKey; p.data = Utils.fromB64ToArray(data); p.iv = Utils.fromB64ToArray(iv); const macData = new Uint8Array(p.iv.byteLength + p.data.byteLength); macData.set(new Uint8Array(p.iv), 0); macData.set(new Uint8Array(p.data), p.iv.byteLength); p.macData = macData; if (key.macKey != null) { p.macKey = key.macKey; } if (mac != null) { p.mac = Utils.fromB64ToArray(mac); } return p; } async aesDecryptFast( parameters: DecryptParameters<Uint8Array>, mode: "cbc" | "ecb", ): Promise<string> { const decBuf = await this.aesDecrypt(parameters.data, parameters.iv, parameters.encKey, mode); return Utils.fromBufferToUtf8(decBuf); } aesDecrypt( data: Uint8Array, iv: Uint8Array, key: Uint8Array, mode: "cbc" | "ecb", ): Promise<Uint8Array> { const nodeData = this.toNodeBuffer(data); const nodeIv = mode === "ecb" ? null : this.toNodeBuffer(iv); const nodeKey = this.toNodeBuffer(key); const decipher = crypto.createDecipheriv(this.toNodeCryptoAesMode(mode), nodeKey, nodeIv); const decBuf = Buffer.concat([decipher.update(nodeData), decipher.final()]); return Promise.resolve(this.toUint8Buffer(decBuf)); } rsaEncrypt( data: Uint8Array, publicKey: Uint8Array, algorithm: "sha1" | "sha256", ): Promise<Uint8Array> { if (algorithm === "sha256") { throw new Error("Node crypto does not support RSA-OAEP SHA-256"); } const pem = this.toPemPublicKey(publicKey); const decipher = crypto.publicEncrypt(pem, this.toNodeBuffer(data)); return Promise.resolve(this.toUint8Buffer(decipher)); } rsaDecrypt( data: Uint8Array, privateKey: Uint8Array, algorithm: "sha1" | "sha256", ): Promise<Uint8Array> { if (algorithm === "sha256") { throw new Error("Node crypto does not support RSA-OAEP SHA-256"); } const pem = this.toPemPrivateKey(privateKey); const decipher = crypto.privateDecrypt(pem, this.toNodeBuffer(data)); return Promise.resolve(this.toUint8Buffer(decipher)); } rsaExtractPublicKey(privateKey: Uint8Array): Promise<Uint8Array> { const privateKeyByteString = Utils.fromBufferToByteString(privateKey); const privateKeyAsn1 = forge.asn1.fromDer(privateKeyByteString); const forgePrivateKey: any = forge.pki.privateKeyFromAsn1(privateKeyAsn1); const forgePublicKey = (forge.pki as any).setRsaPublicKey(forgePrivateKey.n, forgePrivateKey.e); const publicKeyAsn1 = forge.pki.publicKeyToAsn1(forgePublicKey); const publicKeyByteString = forge.asn1.toDer(publicKeyAsn1).data; const publicKeyArray = Utils.fromByteStringToArray(publicKeyByteString); return Promise.resolve(publicKeyArray); } async rsaGenerateKeyPair(length: 1024 | 2048 | 4096): Promise<[Uint8Array, Uint8Array]> { return new Promise<[Uint8Array, Uint8Array]>((resolve, reject) => { forge.pki.rsa.generateKeyPair( { bits: length, workers: -1, e: 0x10001, // 65537 }, (error, keyPair) => { if (error != null) { reject(error); return; } const publicKeyAsn1 = forge.pki.publicKeyToAsn1(keyPair.publicKey); const publicKeyByteString = forge.asn1.toDer(publicKeyAsn1).getBytes(); const publicKey = Utils.fromByteStringToArray(publicKeyByteString); const privateKeyAsn1 = forge.pki.privateKeyToAsn1(keyPair.privateKey); const privateKeyPkcs8 = forge.pki.wrapRsaPrivateKey(privateKeyAsn1); const privateKeyByteString = forge.asn1.toDer(privateKeyPkcs8).getBytes(); const privateKey = Utils.fromByteStringToArray(privateKeyByteString); resolve([publicKey, privateKey]); }, ); }); } aesGenerateKey(bitLength: 128 | 192 | 256 | 512): Promise<CsprngArray> { return this.randomBytes(bitLength / 8); } randomBytes(length: number): Promise<CsprngArray> { return new Promise<CsprngArray>((resolve, reject) => { crypto.randomBytes(length, (error, bytes) => { if (error != null) { reject(error); } else { resolve(this.toUint8Buffer(bytes) as CsprngArray); } }); }); } private toNodeValue(value: string | Uint8Array): string | Buffer { let nodeValue: string | Buffer; if (typeof value === "string") { nodeValue = value; } else { nodeValue = this.toNodeBuffer(value); } return nodeValue; } private toNodeBuffer(value: Uint8Array): Buffer { return Buffer.from(value); } private toUint8Buffer(value: Buffer | string | Uint8Array): Uint8Array { let buf: Uint8Array; if (typeof value === "string") { buf = Utils.fromUtf8ToArray(value); } else { buf = value; } return buf; } private toPemPrivateKey(key: Uint8Array): string { const byteString = Utils.fromBufferToByteString(key); const asn1 = forge.asn1.fromDer(byteString); const privateKey = forge.pki.privateKeyFromAsn1(asn1); const rsaPrivateKey = forge.pki.privateKeyToAsn1(privateKey); const privateKeyInfo = forge.pki.wrapRsaPrivateKey(rsaPrivateKey); return forge.pki.privateKeyInfoToPem(privateKeyInfo); } private toPemPublicKey(key: Uint8Array): string { const byteString = Utils.fromBufferToByteString(key); const asn1 = forge.asn1.fromDer(byteString); const publicKey = forge.pki.publicKeyFromAsn1(asn1); return forge.pki.publicKeyToPem(publicKey); } private toNodeCryptoAesMode(mode: "cbc" | "ecb"): string { return mode === "cbc" ? "aes-256-cbc" : "aes-256-ecb"; } } ```
/content/code_sandbox/libs/node/src/services/node-crypto-function.service.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
3,001
```xml <dict> <key>CommonPeripheralDSP</key> <array> <dict> <key>DeviceID</key> <integer>0</integer> <key>DeviceType</key> <string>Headphone</string> </dict> <dict> <key>DeviceID</key> <integer>0</integer> <key>DeviceType</key> <string>Microphone</string> </dict> </array> <key>PathMaps</key> <array> <dict> <key>PathMap</key> <array> <array> <array> <array> <dict> <key>NodeID</key> <integer>27</integer> <key>ProcessingState</key> <true/> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <true/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <true/> </dict> <key>NodeID</key> <integer>33</integer> </dict> <dict> <key>Boost</key> <integer>1</integer> <key>NodeID</key> <integer>14</integer> </dict> </array> </array> <array> <array> <dict> <key>NodeID</key> <integer>27</integer> <key>ProcessingState</key> <true/> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <true/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <true/> </dict> <key>NodeID</key> <integer>33</integer> </dict> <dict> <key>Boost</key> <integer>1</integer> <key>NodeID</key> <integer>11</integer> </dict> </array> </array> </array> <array> <array> <array> <dict> <key>NodeID</key> <integer>26</integer> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <true/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <true/> </dict> <key>NodeID</key> <integer>32</integer> </dict> <dict> <key>NodeID</key> <integer>13</integer> </dict> </array> </array> </array> <array> <array> <array> <dict> <key>NodeID</key> <integer>12</integer> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <false/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <false/> </dict> <key>NodeID</key> <integer>21</integer> </dict> </array> </array> <array> <array> <dict> <key>NodeID</key> <integer>10</integer> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <false/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <false/> </dict> <key>NodeID</key> <integer>25</integer> </dict> </array> </array> </array> <array> <array> <array> <dict> <key>NodeID</key> <integer>15</integer> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <false/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <false/> </dict> <key>NodeID</key> <integer>22</integer> </dict> </array> </array> </array> <array> <array> <array> <dict> <key>NodeID</key> <integer>16</integer> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <false/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <false/> </dict> <key>NodeID</key> <integer>23</integer> </dict> </array> </array> </array> <array> <array> <array> <dict> <key>NodeID</key> <integer>17</integer> </dict> <dict> <key>Amp</key> <dict> <key>Channels</key> <array> <dict> <key>Bind</key> <integer>1</integer> <key>Channel</key> <integer>1</integer> </dict> <dict> <key>Bind</key> <integer>2</integer> <key>Channel</key> <integer>2</integer> </dict> </array> <key>MuteInputAmp</key> <false/> <key>PublishMute</key> <true/> <key>PublishVolume</key> <true/> <key>VolumeInputAmp</key> <false/> </dict> <key>NodeID</key> <integer>24</integer> </dict> </array> </array> </array> <array> <array> <array> <dict> <key>NodeID</key> <integer>34</integer> </dict> <dict> <key>NodeID</key> <integer>37</integer> </dict> </array> </array> </array> </array> <key>PathMapID</key> <integer>15</integer> </dict> </array> </dict> ```
/content/code_sandbox/Resources/IDT92HD73E1X5/Platforms15.xml
xml
2016-03-07T20:45:58
2024-08-14T08:57:03
AppleALC
acidanthera/AppleALC
3,420
2,673
```xml import '../../icon/style'; import '../../popup/style'; import '../../loading/style'; import '../../style'; import './index.scss'; ```
/content/code_sandbox/packages/zarm/src/toast/style/index.ts
xml
2016-07-13T11:45:37
2024-08-12T19:23:48
zarm
ZhongAnTech/zarm
1,707
25
```xml import { IModels } from '../../connectionResolver'; import { IConfig } from '../../interfaces/config'; import { CONTRACT_CLASSIFICATION } from '../definitions/constants'; import { IContractTypeDocument } from '../definitions/contractTypes'; import { IContractDocument } from '../definitions/contracts'; import { getDiffDay } from './utils'; export async function changeClassificationContract( contract: IContractDocument, currentDate: Date, newClassification: string, models: IModels ) { const classificationChange = { description: 'auto', invDate: currentDate, total: contract.loanBalanceAmount, classification: contract.classification, newClassification: newClassification, createdAt: new Date() }; await models.Contracts.updateOne({_id:contract._id},{$set:{classification:newClassification}}) await models.Classification.create(classificationChange); } export async function massChangeClassification( contracts: IContractDocument[], currentDate: Date, models: IModels ) { const contractTypes: IContractTypeDocument[] = await models.ContractTypes.find( { _id: contracts.map(a => a.contractTypeId) } ).lean(); for await (const contract of contracts) { const currentContractType = contractTypes.find( a => a._id === contract.contractTypeId ); let newClassification = contract.classification; const lastMainSchedule = await models.Schedules.getLastSchedule( contract._id, currentDate ); const diffDay = getDiffDay(lastMainSchedule.payDate, currentDate); if ((currentContractType?.config.normalExpirationDay ?? 0) >= diffDay) newClassification = CONTRACT_CLASSIFICATION.NORMAL; else if ((currentContractType?.config.expiredExpirationDay ?? 30) < diffDay) newClassification = CONTRACT_CLASSIFICATION.EXPIRED; else if ((currentContractType?.config.doubtExpirationDay ?? 90) < diffDay) newClassification = CONTRACT_CLASSIFICATION.DOUBTFUL; else if ( (currentContractType?.config.negativeExpirationDay ?? 180) < diffDay ) newClassification = CONTRACT_CLASSIFICATION.NEGATIVE; else if ((currentContractType?.config.badExpirationDay ?? 360) < diffDay) newClassification = CONTRACT_CLASSIFICATION.BAD; if (contract.classification !== newClassification) changeClassificationContract( contract, currentDate, newClassification, models ); } } export async function changeClassificationOneContract(contract: IContractDocument, currentDate: Date, models: IModels, config:IConfig) { let newClassification = contract.classification; const diffDay = getDiffDay(contract.mustPayDate, currentDate); if ((config.classificationNormal ?? 0) >= diffDay) newClassification = CONTRACT_CLASSIFICATION.NORMAL; else if ((config.classificationExpired ?? 30) < diffDay) newClassification = CONTRACT_CLASSIFICATION.EXPIRED; else if ((config.classificationDoubt ?? 90) < diffDay) newClassification = CONTRACT_CLASSIFICATION.DOUBTFUL; else if ( (config.classificationNegative ?? 180) < diffDay ) newClassification = CONTRACT_CLASSIFICATION.NEGATIVE; else if ((config.classificationBad ?? 360) < diffDay) newClassification = CONTRACT_CLASSIFICATION.BAD; if (contract.classification !== newClassification) changeClassificationContract( contract, currentDate, newClassification, models ); } ```
/content/code_sandbox/packages/plugin-loans-api/src/models/utils/changeClassificationUtils.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
739
```xml import { MigrationInterface } from "../../../../../src/migration/MigrationInterface" import { QueryRunner } from "../../../../../src/query-runner/QueryRunner" export class ExampleMigrationTwo1530542855524 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise<void> {} public async down(queryRunner: QueryRunner): Promise<void> {} } ```
/content/code_sandbox/test/functional/migrations/show-command/migration/1530542855524-ExampleMigrationTwo.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
74
```xml <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <AssemblyName>AnthropicClaude.$(MSBuildProjectName)</AssemblyName> </PropertyGroup> <ItemGroup> <PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.3" /> <PackageReference Include="AWSSDK.Core" Version="3.7.304.12" /> </ItemGroup> </Project> ```
/content/code_sandbox/dotnetv3/Bedrock-runtime/Models/AnthropicClaude/InvokeModelWithResponseStream/InvokeModelWithResponseStream.csproj
xml
2016-08-18T19:06:57
2024-08-16T18:59:44
aws-doc-sdk-examples
awsdocs/aws-doc-sdk-examples
9,298
126
```xml <?xml version="1.0" encoding="UTF-8"?> <!-- ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-test-it</artifactId> <version>5.5.1-SNAPSHOT</version> </parent> <artifactId>shardingsphere-test-it-parser</artifactId> <name>${project.artifactId}</name> <properties> <maven.deploy.skip>true</maven.deploy.skip> </properties> <dependencies> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-parser-sql-engine</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-data-pipeline-distsql-statement</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-data-pipeline-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-parser-distsql-engine</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-sharding-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-broadcast-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-readwrite-splitting-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-encrypt-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-mask-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-authority-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-global-clock-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-transaction-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-single-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-sql-parser-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-sql-translator-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-shadow-distsql-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-test-util</artifactId> <version>${project.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-params</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-junit-jupiter</artifactId> <version>${mockito.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-csv</artifactId> <version>${commons-csv.version}</version> </dependency> </dependencies> </project> ```
/content/code_sandbox/test/it/parser/pom.xml
xml
2016-01-18T12:49:26
2024-08-16T15:48:11
shardingsphere
apache/shardingsphere
19,707
1,363