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 import { O } from 'ts-toolbelt'; import { BaseRO } from './base.define'; export type ViewDetailsRO = O.Merge< BaseRO, { viewId: string; properties: Record<string, any>[]; } >; export type StrictViewDetailsRO = O.Required< ViewDetailsRO, 'id' | 'creationDate' >; ```
/content/code_sandbox/src/renderer/defenitions/record-object/view-details.define.ts
xml
2016-05-14T02:18:49
2024-08-16T02:46:28
ElectroCRUD
garrylachman/ElectroCRUD
1,538
79
```xml import { inject } from "@vercel/analytics"; import { createApp } from "vue"; import { createPinia } from "pinia"; import Demo from "./Demo.vue"; const SAMPLE_RATE = 0.5; inject({ beforeSend: event => { if (Math.random() > SAMPLE_RATE) { return null; } return event; } }); const pinia = createPinia(); const app = createApp(Demo); app.use(pinia); app.mount("#app"); ```
/content/code_sandbox/src/demo/main.ts
xml
2016-06-17T09:55:24
2024-08-16T15:32:02
vue-echarts
ecomfe/vue-echarts
9,553
106
```xml import { test, expect, vi } from 'vitest' import { mount } from '@vue/test-utils' import VueCodemirror, { Codemirror, install } from '../src/index' // path_to_url test('export type', async () => { expect(Codemirror).toBeDefined() expect(install).toBeTypeOf('function') expect(VueCodemirror).toBeDefined() expect(VueCodemirror.install).toBeTypeOf('function') expect(VueCodemirror.Codemirror).toBeDefined() expect(VueCodemirror.Codemirror).toEqual(Codemirror) expect(VueCodemirror.install).toEqual(install) }) test('mount component', async () => { const wrapper = mount(Codemirror, { props: { modelValue: 'Hello, world!' } }) expect(wrapper.emitted()).toHaveProperty('ready') // TODO: test case }) ```
/content/code_sandbox/test/index.test.ts
xml
2016-09-22T12:33:12
2024-08-15T07:57:52
vue-codemirror
surmon-china/vue-codemirror
3,239
194
```xml // See LICENSE.txt for license information. import {field, immutableRelation} from '@nozbe/watermelondb/decorators'; import Model, {type Associations} from '@nozbe/watermelondb/Model'; import {MM_TABLES} from '@constants/database'; import type {Relation} from '@nozbe/watermelondb'; import type GroupModel from '@typings/database/models/servers/group'; import type GroupMembershipInterface from '@typings/database/models/servers/group_membership'; import type UserModel from '@typings/database/models/servers/user'; const {USER, GROUP, GROUP_MEMBERSHIP} = MM_TABLES.SERVER; /** * The GroupMembership model represents the 'association table' where many groups have users and many users are in * groups (relationship type N:N) */ export default class GroupMembershipModel extends Model implements GroupMembershipInterface { /** table (name) : GroupMembership */ static table = GROUP_MEMBERSHIP; /** associations : Describes every relationship to this table. */ static associations: Associations = { /** A GroupMembership belongs to a Group */ [GROUP]: {type: 'belongs_to', key: 'group_id'}, /** A GroupMembership has a User */ [USER]: {type: 'belongs_to', key: 'user_id'}, }; /** group_id : The foreign key to the related Group record */ @field('group_id') groupId!: string; /** user_id : The foreign key to the related User record */ @field('user_id') userId!: string; /** created_at : The creation date for this row */ @field('created_at') createdAt!: number; /** updated_at : The update date for this row */ @field('updated_at') updatedAt!: number; /** deleted_at : The delete date for this row */ @field('deleted_at') deletedAt!: number; /** group : The related group */ @immutableRelation(GROUP, 'group_id') group!: Relation<GroupModel>; /** member : The related member */ @immutableRelation(USER, 'user_id') member!: Relation<UserModel>; } ```
/content/code_sandbox/app/database/models/server/group_membership.ts
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
439
```xml const getCreditsInfo = ` query getCreditsInfo { getCreditsInfo { name type initialCount growthInitialCount unit comingSoon unLimited price { monthly yearly oneTime } usage { totalAmount purchasedAmount freeAmount promoCodeAmount remainingAmount usedAmount } title } } `; export default { getCreditsInfo, }; ```
/content/code_sandbox/packages/core-ui/src/modules/saas/settings/plans/graphql/queries.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
106
```xml import type { Meta, StoryObj } from '@storybook/react'; import { SlackButton } from './SlackButton'; const meta: Meta<typeof SlackButton> = { title: 'Basics/Buttons/Slack', component: SlackButton, }; export default meta; type Story = StoryObj<typeof SlackButton>; export const Primary: Story = { name: 'Default Slack Button', }; ```
/content/code_sandbox/web/src/components/buttons/SlackButton.stories.tsx
xml
2016-05-21T16:36:17
2024-08-16T17:56:07
electricitymaps-contrib
electricitymaps/electricitymaps-contrib
3,437
83
```xml /* eslint-disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ /** * Number of comments failed to be uploaded to server */ export interface HttpsProtonMeDocsCommentsErrorTotalV1SchemaJson { Labels: { reason: "network_error" | "server_error" | "encryption_error" | "unknown"; }; Value: number; } ```
/content/code_sandbox/packages/metrics/types/docs_comments_error_total_v1.schema.d.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
112
```xml /// <reference path="../built/pxtlib.d.ts" /> /// <reference path="./projectheader.d.ts" /> /// <reference path="./validatorPlan.d.ts" /> declare namespace pxt.editor { export interface EditorMessage { /** * Constant identifier */ type: "pxteditor" | "pxthost" | "pxtpkgext" | "pxtsim", /** * Original request id */ id?: string; /** * flag to request response */ response?: boolean; /** * Frame identifier that can be passed to the iframe by adding the frameId query parameter */ frameId?: string; } export interface EditorMessageResponse extends EditorMessage { /** * Additional response payload provided by the command */ resp?: any; /** * indicate if operation started or completed successfully */ success: boolean; /** * Error object if any */ error?: any; } export interface EditorMessageRequest extends EditorMessage { /** * Request action */ action: "switchblocks" | "switchjavascript" | "switchpython" | "startsimulator" | "restartsimulator" | "stopsimulator" // EditorMessageStopRequest | "hidesimulator" | "showsimulator" | "closeflyout" | "newproject" | "importproject" | "importexternalproject" | "importtutorial" | "openheader" | "proxytosim" // EditorMessageSimulatorMessageProxyRequest | "undo" | "redo" | "renderblocks" | "renderpython" | "renderxml" | "renderbyblockid" | "setscale" | "startactivity" | "saveproject" | "compile" | "unloadproject" | "shareproject" | "savelocalprojectstocloud" | "projectcloudstatus" | "requestprojectcloudstatus" | "convertcloudprojectstolocal" | "setlanguagerestriction" | "gettoolboxcategories" | "toggletrace" // EditorMessageToggleTraceRequest | "togglehighcontrast" | "sethighcontrast" // EditorMessageSetHighContrastRequest | "togglegreenscreen" | "settracestate" // | "setsimulatorfullscreen" // EditorMessageSimulatorFullScreenRequest | "print" // print code | "pair" // pair device | "workspacesync" // EditorWorspaceSyncRequest | "workspacereset" | "workspacesave" // EditorWorkspaceSaveRequest | "workspaceloaded" | "workspaceevent" // EditorWorspaceEvent | "workspacediagnostics" // compilation results | "event" | "simevent" | "info" // return info data` | "tutorialevent" | "editorcontentloaded" | "runeval" // package extension messasges | ExtInitializeType | ExtDataStreamType | ExtUserCodeType | ExtReadCodeType | ExtWriteCodeType ; } /** * Request sent by the editor when a tick/error/expection is registered */ export interface EditorMessageEventRequest extends EditorMessageRequest { action: "event"; // metric identifier tick: string; // error category if any category?: string; // error message if any message?: string; // custom data data?: pxt.Map<string | number>; } export type EditorMessageTutorialEventRequest = EditorMessageTutorialProgressEventRequest | EditorMessageTutorialCompletedEventRequest | EditorMessageTutorialLoadedEventRequest | EditorMessageTutorialExitEventRequest; export interface EditorMessageTutorialProgressEventRequest extends EditorMessageRequest { action: "tutorialevent"; tutorialEvent: "progress" currentStep: number; totalSteps: number; isCompleted: boolean; tutorialId: string; projectHeaderId: string; } export interface EditorMessageTutorialCompletedEventRequest extends EditorMessageRequest { action: "tutorialevent"; tutorialEvent: "completed"; tutorialId: string; projectHeaderId: string; } export interface EditorMessageTutorialLoadedEventRequest extends EditorMessageRequest { action: "tutorialevent"; tutorialEvent: "loaded"; tutorialId: string; projectHeaderId: string; } export interface EditorMessageTutorialExitEventRequest extends EditorMessageRequest { action: "tutorialevent"; tutorialEvent: "exit"; tutorialId: string; projectHeaderId: string; } export interface EditorMessageStopRequest extends EditorMessageRequest { action: "stopsimulator"; /** * Indicates if simulator iframes should be unloaded or kept hot. */ unload?: boolean; } export interface EditorMessageNewProjectRequest extends EditorMessageRequest { action: "newproject"; /** * Additional optional to create new project */ options?: ProjectCreationOptions; } export interface EditorContentLoadedRequest extends EditorMessageRequest { action: "editorcontentloaded"; } export interface EditorMessageSetScaleRequest extends EditorMessageRequest { action: "setscale"; scale: number; } export interface EditorMessageSimulatorMessageProxyRequest extends EditorMessageRequest { action: "proxytosim"; /** * Content to send to the simulator */ content: any; } export interface EditorWorkspaceSyncRequest extends EditorMessageRequest { /** * Synching projects from host into */ action: "workspacesync" | "workspacereset" | "workspaceloaded"; } export interface EditorWorkspaceEvent extends EditorMessageRequest { action: "workspaceevent"; event: EditorEvent; } export interface EditorWorkspaceDiagnostics extends EditorMessageRequest { action: "workspacediagnostics"; operation: "compile" | "decompile" | "typecheck"; output: string; diagnostics: { code: number; category: "error" | "warning" | "message"; fileName?: string; start?: number; length?: number; line?: number; column?: number; endLine?: number; endColumn?: number; }[]; } // UI properties to sync on load export interface EditorSyncState { // (optional) filtering argument filters?: ProjectFilters; // (optional) show or hide the search bar searchBar?: boolean; } export interface EditorWorkspaceSyncResponse extends EditorMessageResponse { /* * Full list of project, required for init */ projects: pxt.workspace.Project[]; // (optional) filtering argument editor?: EditorSyncState; // (optional) controller id, used for determining what the parent controller is controllerId?: string; } export interface EditorWorkspaceSaveRequest extends EditorMessageRequest { action: "workspacesave"; /* * Modified project */ project: pxt.workspace.Project; } export interface EditorMessageImportProjectRequest extends EditorMessageRequest { action: "importproject"; // project to load project: pxt.workspace.Project; // (optional) filtering argument filters?: ProjectFilters; searchBar?: boolean; } export interface EditorMessageImportExternalProjectRequest extends EditorMessageRequest { action: "importexternalproject"; // project to load project: pxt.workspace.Project; } export interface EditorMessageImportExternalProjectResponse extends EditorMessageResponse { action: "importexternalproject"; resp: { importUrl: string; }; } export interface EditorMessageSaveLocalProjectsToCloud extends EditorMessageRequest { action: "savelocalprojectstocloud"; headerIds: string[]; } export interface EditorMessageSaveLocalProjectsToCloudResponse extends EditorMessageResponse { action: "savelocalprojectstocloud"; headerIdMap?: pxt.Map<string>; } export interface EditorMessageProjectCloudStatus extends EditorMessageRequest { action: "projectcloudstatus"; headerId: string; status: pxt.cloud.CloudStatus; } export interface EditorMessageRequestProjectCloudStatus extends EditorMessageRequest { action: "requestprojectcloudstatus"; headerIds: string[]; } export interface EditorMessageConvertCloudProjectsToLocal extends EditorMessageRequest { action: "convertcloudprojectstolocal"; userId: string; } export interface EditorMessageImportTutorialRequest extends EditorMessageRequest { action: "importtutorial"; // markdown to load markdown: string; } export interface EditorMessageOpenHeaderRequest extends EditorMessageRequest { action: "openheader"; headerId: string; } export interface EditorMessageRenderBlocksRequest extends EditorMessageRequest { action: "renderblocks"; // typescript code to render ts: string; // rendering options snippetMode?: boolean; layout?: BlockLayout; } export interface EditorMessageRenderXmlRequest extends EditorMessageRequest { action: "renderxml"; // xml to render xml: string; snippetMode?: boolean; layout?: BlockLayout; } export interface EditorMessageRenderByBlockIdRequest extends EditorMessageRequest { action: "renderbyblockid"; blockId: string; snippetMode?: boolean; layout?: BlockLayout; } export interface EditorMessageRunEvalRequest extends EditorMessageRequest { action: "runeval"; validatorPlan: pxt.blocks.ValidatorPlan; planLib: pxt.blocks.ValidatorPlan[]; } export interface EditorMessageRenderBlocksResponse { svg: SVGSVGElement; xml: Promise<any>; } export interface EditorMessageRenderXmlResponse { svg: SVGSVGElement; resultXml: Promise<any>; } export interface EditorMessageRenderByBlockIdResponse { svg: SVGSVGElement; resultXml: Promise<any>; } export interface EditorMessageRenderPythonRequest extends EditorMessageRequest { action: "renderpython"; // typescript code to render ts: string; } export interface EditorMessageRenderPythonResponse { python: string; } export interface EditorSimulatorEvent extends EditorMessageRequest { action: "simevent"; subtype: "toplevelfinished" | "started" | "stopped" | "resumed" } export interface EditorSimulatorStoppedEvent extends EditorSimulatorEvent { subtype: "stopped"; exception?: string; } export interface EditorMessageToggleTraceRequest extends EditorMessageRequest { action: "toggletrace"; // interval speed for the execution trace intervalSpeed?: number; } export interface EditorMessageSetTraceStateRequest extends EditorMessageRequest { action: "settracestate"; enabled: boolean; // interval speed for the execution trace intervalSpeed?: number; } export interface EditorMessageSetSimulatorFullScreenRequest extends EditorMessageRequest { action: "setsimulatorfullscreen"; enabled: boolean; } export interface EditorMessageSetHighContrastRequest extends EditorMessageRequest { action: "sethighcontrast"; on: boolean; } export interface EditorMessageStartActivity extends EditorMessageRequest { action: "startactivity"; activityType: "tutorial" | "example" | "recipe"; path: string; title?: string; previousProjectHeaderId?: string; carryoverPreviousCode?: boolean; } export interface InfoMessage { versions: pxt.TargetVersions; locale: string; availableLocales?: string[]; } export interface PackageExtensionData { ts: string; json?: any; } export interface EditorPkgExtMessageRequest extends EditorMessageRequest { // extension identifier package: string; } export interface EditorPkgExtMessageResponse extends EditorMessageResponse { // extension identifier package: string; } export interface EditorSimulatorTickEvent extends EditorMessageEventRequest { type: "pxtsim"; } export interface EditorShareRequest extends EditorMessageRequest { action: "shareproject"; headerId: string; projectName: string; } export interface EditorShareResponse extends EditorMessageRequest { action: "shareproject"; script: pxt.Cloud.JsonScript; } export interface EditorSetLanguageRestriction extends EditorMessageRequest { action: "setlanguagerestriction"; restriction: pxt.editor.LanguageRestriction; } export interface EditorMessageGetToolboxCategoriesRequest extends EditorMessageRequest { action: "gettoolboxcategories"; advanced?: boolean; } export interface EditorMessageGetToolboxCategoriesResponse { categories: pxt.editor.ToolboxCategoryDefinition[]; } export interface DataStreams<T> { console?: T; messages?: T; } export interface ExtensionFiles { code?: string; json?: string; jres?: string; asm?: string; } export interface WriteExtensionFiles extends ExtensionFiles { dependencies?: pxt.Map<string>; } export interface ExtensionMessage extends EditorMessage { type: "pxtpkgext"; } export interface ExtensionResponse extends EditorMessageResponse { type: "pxtpkgext"; extId: string; } export interface ExtensionRequest extends EditorMessageRequest { type: "pxtpkgext"; extId: string; body?: any; } /** * Events are fired by the editor on the extension iFrame. Extensions * receive events, they don't send them. */ export interface ExtensionEvent extends ExtensionMessage { event: string; target: string; } /** * Event fired when the extension is loaded. */ export interface LoadedEvent extends ExtensionEvent { event: "extloaded"; } /** * Event fired when the extension becomes visible. */ export interface ShownEvent extends ExtensionEvent { event: "extshown"; } /** * Event fired when the extension becomes hidden. */ export interface HiddenEvent extends ExtensionEvent { event: "exthidden"; body: HiddenReason; } export type HiddenReason = "useraction" | "other"; /** * Event fired when console data is received */ export interface ConsoleEvent extends ExtensionEvent { event: "extconsole"; body: { source: string; sim: boolean; data: string; } } /** * Event fired when a message packet is received */ export interface MessagePacketEvent extends ExtensionEvent { event: "extmessagepacket"; body: { source?: string; channel: string; data: Uint8Array; } } /** * Event fired when extension is first shown. Extension * should send init request in response */ export type ExtInitializeType = "extinit"; export interface InitializeRequest extends ExtensionRequest { action: ExtInitializeType; body: string; } export interface InitializeResponse extends ExtensionResponse { target?: pxt.AppTarget; } /** * Requests data stream event to be fired. Permission will * be requested if not already received. */ export type ExtDataStreamType = "extdatastream"; export interface DataStreamRequest extends ExtensionRequest { action: ExtDataStreamType; body: DataStreams<boolean>; } export interface DataStreamResponse extends ExtensionResponse { resp: DataStreams<boolean>; } /** * Request to read the user's code. Will request permission if * not already granted */ export type ExtUserCodeType = "extusercode"; export interface UserCodeRequest extends ExtensionRequest { action: ExtUserCodeType; } export interface UserCodeResponse extends ExtensionResponse { /* A mapping of file names to their contents */ resp?: { [index: string]: string }; } /** * Request to read the files saved by this extension */ export type ExtReadCodeType = "extreadcode"; export interface ReadCodeRequest extends ExtensionRequest { action: ExtReadCodeType; } export interface ReadCodeResponse extends ExtensionResponse { action: ExtReadCodeType; body?: ExtensionFiles; } /** * Request to write the JSON and/or TS files saved * by this extension */ export type ExtWriteCodeType = "extwritecode"; export interface WriteCodeRequest extends ExtensionRequest { action: ExtWriteCodeType; body?: WriteExtensionFiles; } export interface WriteCodeResponse extends ExtensionResponse { } export interface ProjectCreationOptions { prj?: pxt.ProjectTemplate; name?: string; documentation?: string; filesOverride?: pxt.Map<string>; filters?: ProjectFilters; temporary?: boolean; tutorial?: pxt.tutorial.TutorialOptions; dependencies?: pxt.Map<string>; tsOnly?: boolean; // DEPRECATED: use LanguageRestriction.NoBlocks or LanguageRestriction.JavaScriptOnly instead languageRestriction?: pxt.editor.LanguageRestriction; preferredEditor?: string; // preferred editor to open, pxt.BLOCKS_PROJECT_NAME, ... extensionUnderTest?: string; // workspace id of the extension under test skillmapProject?: boolean; simTheme?: Partial<pxt.PackageConfig>; firstProject?: boolean; } export interface ProjectFilters { namespaces?: { [index: string]: FilterState; }; // Disabled = 2, Hidden = 0, Visible = 1 blocks?: { [index: string]: FilterState; }; // Disabled = 2, Hidden = 0, Visible = 1 fns?: { [index: string]: FilterState; }; // Disabled = 2, Hidden = 0, Visible = 1 defaultState?: FilterState; // hide, show or disable all by default } export const enum FilterState { Hidden = 0, Visible = 1, Disabled = 2 } export const enum BlockLayout { None = 0, Align = 1, // Shuffle deprecated Clean = 3, Flow = 4 } export type EditorType = 'blocks' | 'ts'; export interface EditorEvent { type: string; editor: EditorType; } export interface CreateEvent extends EditorEvent { type: "create"; blockId: string; } export interface UIEvent extends EditorEvent { type: "ui"; action: "groupHelpClicked"; data?: pxt.Map<string>; } export interface IEditor { undo(): void; redo(): void; hasUndo(): boolean; hasRedo(): boolean; zoomIn(): void; zoomOut(): void; resize(): void; setScale(scale: number): void; } export interface IFile { name: string; virtual?: boolean; // gimmick to switch views } export interface FileHistoryEntry { id: string; name: string; pos: any; } export interface EditorSettings { editorFontSize: number; fileHistory: FileHistoryEntry[]; } export const enum ErrorListState { HeaderOnly = "errorListHeader", Expanded = "errorListExpanded" } export const enum MuteState { Muted = "muted", Unmuted = "unmuted", Disabled = "disabled" } export const enum SimState { Stopped, // waiting to be started Pending, Starting, Running } export interface NativeHostMessage { name?: string; download?: string; save?: string; cmd?: string; } export interface IAppProps { } export interface IAppState { active?: boolean; // is this tab visible at all header?: pxt.workspace.Header; editorState?: EditorState; currFile?: IFile; fileState?: string; showFiles?: boolean; sideDocsLoadUrl?: string; // set once to load the side docs frame sideDocsCollapsed?: boolean; projectName?: string; suppressPackageWarning?: boolean; tutorialOptions?: pxt.tutorial.TutorialOptions; lightbox?: boolean; keymap?: boolean; simState?: SimState; autoRun?: boolean; resumeOnVisibility?: boolean; compiling?: boolean; isSaving?: boolean; publishing?: boolean; hideEditorFloats?: boolean; collapseEditorTools?: boolean; showBlocks?: boolean; showParts?: boolean; fullscreen?: boolean; showMiniSim?: boolean; mute?: MuteState; embedSimView?: boolean; editorPosition?: { lineNumber: number; column: number; file: IFile; }; // ensure that this line is visible when loading the editor tracing?: boolean; debugging?: boolean; debugFirstRun?: boolean; bannerVisible?: boolean; pokeUserComponent?: string; flashHint?: boolean; editorOffset?: string; print?: boolean; greenScreen?: boolean; accessibleBlocks?: boolean; home?: boolean; hasError?: boolean; cancelledDownload?: boolean; simSerialActive?: boolean; deviceSerialActive?: boolean; errorListState?: ErrorListState; screenshoting?: boolean; extensionsVisible?: boolean; isMultiplayerGame?: boolean; // Arcade: Does the current project contain multiplayer blocks? onboarding?: pxt.tour.BubbleStep[]; } export interface EditorState { filters?: pxt.editor.ProjectFilters; searchBar?: boolean; // show the search bar in editor hasCategories?: boolean; // show categories in toolbox } export interface ExampleImportOptions { name: string; path: string; loadBlocks?: boolean; prj?: pxt.ProjectTemplate; preferredEditor?: string; } export interface StartActivityOptions { activity: Activity; path: string; title?: string; editor?: string; focus?: boolean; importOptions?: ExampleImportOptions; previousProjectHeaderId?: string; carryoverPreviousCode?: boolean; } export interface ModalDialogButton { label: string; url?: string; } export interface ModalDialogOptions { header: string; body: string; buttons?: ModalDialogButton[]; } export interface ScreenshotData { data?: ImageData; delay?: number; event?: "start" | "stop"; } export interface SimulatorStartOptions { clickTrigger?: boolean; } export interface ImportFileOptions { extension?: boolean; openHomeIfFailed?: boolean; } export interface UserInfo { id: string; userName?: string; name: string; profile?: string; loginHint?: string; initials?: string; photo?: string; } export interface ShareData { url: string; embed: { code?: string; editor?: string; simulator?: string; url?: string; } qr?: string; error?: any; } export type Activity = "tutorial" | "recipe" | "example"; export interface IProjectView { state: IAppState; setState(st: IAppState): void; forceUpdate(): void; reloadEditor(): void; openBlocks(): void; openJavaScript(giveFocusOnLoading?: boolean): void; openPython(giveFocusOnLoading?: boolean): void; openAssets(): void; openSettings(): void; openSimView(): void; openSimSerial(): void; openDeviceSerial(): void; openPreviousEditor(): void; switchTypeScript(): void; openTypeScriptAsync(): Promise<void>; openPythonAsync(): Promise<void>; saveBlocksToTypeScriptAsync(): Promise<string>; saveFileAsync(): Promise<void>; saveCurrentSourceAsync(): Promise<void>; saveProjectAsync(): Promise<void>; loadHeaderAsync(h: pxt.workspace.Header): Promise<void>; reloadHeaderAsync(): Promise<void>; importProjectAsync(prj: pxt.workspace.Project, editorState?: EditorState): Promise<void>; importTutorialAsync(markdown: string): Promise<void>; openProjectByHeaderIdAsync(headerId: string): Promise<void>; overrideTypescriptFile(text: string): void; overrideBlocksFile(text: string): void; resetTutorialTemplateCode(keepAssets: boolean): Promise<void>; exportAsync(): Promise<string>; newEmptyProject(name?: string, documentation?: string, preferredEditor?: string): void; newProject(options?: pxt.editor.ProjectCreationOptions): void; createProjectAsync(options: pxt.editor.ProjectCreationOptions): Promise<void>; importExampleAsync(options: ExampleImportOptions): Promise<void>; showScriptManager(): void; importProjectDialog(): void; removeProject(): void; editText(): void; hasCloudSync(): boolean; getPreferredEditor(): string; saveAndCompile(): void; updateHeaderName(name: string): void; updateHeaderNameAsync(name: string): Promise<void>; compile(): void; setFile(fn: IFile, line?: number): void; setSideFile(fn: IFile, line?: number): void; navigateToError(diag: pxtc.KsDiagnostic): void; setSideDoc(path: string, blocksEditor?: boolean): void; setSideMarkdown(md: string): void; setSideDocCollapsed(shouldCollapse?: boolean): void; removeFile(fn: IFile, skipConfirm?: boolean): void; updateFileAsync(name: string, content: string, open?: boolean): Promise<void>; openHome(): void; unloadProjectAsync(home?: boolean): Promise<void>; setTutorialStep(step: number): void; setTutorialInstructionsExpanded(value: boolean): void; exitTutorial(): void; completeTutorialAsync(): Promise<void>; showTutorialHint(): void; isTutorial(): boolean; onEditorContentLoaded(): void; pokeUserActivity(): void; stopPokeUserActivity(): void; clearUserPoke(): void; setHintSeen(step: number): void; setEditorOffset(): void; anonymousPublishHeaderByIdAsync(headerId: string, projectName?: string): Promise<ShareData>; publishCurrentHeaderAsync(persistent: boolean, screenshotUri?: string): Promise<string>; publishAsync (name: string, screenshotUri?: string, forceAnonymous?: boolean): Promise<ShareData>; startStopSimulator(opts?: SimulatorStartOptions): void; stopSimulator(unload?: boolean, opts?: SimulatorStartOptions): void; restartSimulator(): void; startSimulator(opts?: SimulatorStartOptions): void; runSimulator(): void; isSimulatorRunning(): boolean; expandSimulator(): void; collapseSimulator(): void; toggleSimulatorCollapse(): void; toggleSimulatorFullscreen(): void; setSimulatorFullScreen(enabled: boolean): void; proxySimulatorMessage(content: string): void; toggleTrace(intervalSpeed?: number): void; setTrace(enabled: boolean, intervalSpeed?: number): void; toggleMute(): void; setMute(state: MuteState): void; openInstructions(): void; closeFlyout(): void; printCode(): void; requestScreenshotAsync(): Promise<string>; downloadScreenshotAsync(): Promise<void>; toggleDebugging(): void; dbgPauseResume(): void; dbgStepInto(): void; dbgStepOver(): void; dbgInsertBreakpoint(): void; setBannerVisible(b: boolean): void; typecheckNow(): void; shouldPreserveUndoStack(): boolean; openExtension(extension: string, url: string, consentRequired?: boolean, trusted?: boolean): void; handleExtensionRequest(request: pxt.editor.ExtensionRequest): void; fireResize(): void; updateEditorLogo(left: number, rgba?: string): number; loadBlocklyAsync(): Promise<void>; isBlocksEditor(): boolean; isTextEditor(): boolean; isPxtJsonEditor(): boolean; blocksScreenshotAsync(pixelDensity?: number, encodeBlocks?: boolean): Promise<string>; renderBlocksAsync(req: pxt.editor.EditorMessageRenderBlocksRequest): Promise<pxt.editor.EditorMessageRenderBlocksResponse>; renderPythonAsync(req: pxt.editor.EditorMessageRenderPythonRequest): Promise<pxt.editor.EditorMessageRenderPythonResponse>; renderXml(req: pxt.editor.EditorMessageRenderXmlRequest): pxt.editor.EditorMessageRenderXmlResponse; renderByBlockIdAsync(req: pxt.editor.EditorMessageRenderByBlockIdRequest): Promise<pxt.editor.EditorMessageRenderByBlockIdResponse>; // FIXME (riknoll) need to figure out how to type this better // getBlocks(): Blockly.Block[]; getBlocks(): any[]; getToolboxCategories(advanced?: boolean): pxt.editor.EditorMessageGetToolboxCategoriesResponse; toggleHighContrast(): void; setHighContrast(on: boolean): void; toggleGreenScreen(): void; toggleAccessibleBlocks(): void; setAccessibleBlocks(enabled: boolean): void; launchFullEditor(): void; resetWorkspace(): void; settings: EditorSettings; isEmbedSimActive(): boolean; isBlocksActive(): boolean; isJavaScriptActive(): boolean; isPythonActive(): boolean; isAssetsActive(): boolean; editor: IEditor; startActivity(options: StartActivityOptions): void; showLightbox(): void; hideLightbox(): void; showOnboarding(): void; hideOnboarding(): void; showKeymap(show: boolean): void; toggleKeymap(): void; signOutGithub(): void; showReportAbuse(): void; showLanguagePicker(): void; showShareDialog(title?: string, kind?: "multiplayer" | "vscode" | "share"): void; showAboutDialog(): void; showTurnBackTimeDialogAsync(): Promise<void>; showLoginDialog(continuationHash?: string): void; showProfileDialog(location?: string): void; showImportUrlDialog(): void; showImportFileDialog(options?: ImportFileOptions): void; showImportGithubDialog(): void; showResetDialog(): void; showExitAndSaveDialog(): void; showChooseHwDialog(skipDownload?: boolean): void; showExperimentsDialog(): void; showPackageDialog(query?: string): void; showBoardDialogAsync(features?: string[], closeIcon?: boolean): Promise<void>; checkForHwVariant(): boolean; pairAsync(): Promise<boolean>; createModalClasses(classes?: string): string; showModalDialogAsync(options: ModalDialogOptions): Promise<void>; askForProjectCreationOptionsAsync(): Promise<pxt.editor.ProjectCreationOptions>; pushScreenshotHandler(handler: (msg: ScreenshotData) => void): void; popScreenshotHandler(): void; openNewTab(header: pxt.workspace.Header, dependent: boolean): void; createGitHubRepositoryAsync(): Promise<void>; saveLocalProjectsToCloudAsync(headerIds: string[]): Promise<pxt.Map<string> | undefined>; requestProjectCloudStatus(headerIds: string[]): Promise<void>; convertCloudProjectsToLocal(userId: string): Promise<void>; setLanguageRestrictionAsync(restriction: pxt.editor.LanguageRestriction): Promise<void>; hasHeaderBeenPersistentShared(): boolean; getSharePreferenceForHeader(): boolean; saveSharePreferenceForHeaderAsync(anonymousByDefault: boolean): Promise<void>; } export interface IHexFileImporter { id: string; canImport(data: pxt.cpp.HexFile): boolean; importAsync(project: IProjectView, data: pxt.cpp.HexFile): Promise<void>; } export interface IResourceImporter { id: string; canImport(data: File): boolean; importAsync(project: IProjectView, data: File): Promise<void>; } export interface ISettingsProps { parent: IProjectView; visible?: boolean; collapsed?: boolean; simSerialActive?: boolean; devSerialActive?: boolean; } export interface IFieldCustomOptions { selector: string; // FIXME (riknoll) need to figure out how to type this better. Also this type is from pxtblocks, but // it uses types dervied from Blockly // editor: Blockly.FieldCustomConstructor; editor: any; text?: string; validator?: any; } export interface ExtensionOptions { blocklyToolbox: ToolboxDefinition; monacoToolbox: ToolboxDefinition; projectView: IProjectView; } export interface IToolboxOptions { blocklyToolbox?: ToolboxDefinition; monacoToolbox?: ToolboxDefinition; } export interface ExtensionResult { hexFileImporters?: IHexFileImporter[]; resourceImporters?: IResourceImporter[]; beforeCompile?: () => void; patchCompileResultAsync?: (r: pxtc.CompileResult) => Promise<void>; deployAsync?: (r: pxtc.CompileResult) => Promise<void>; saveOnlyAsync?: (r: ts.pxtc.CompileResult) => Promise<void>; saveProjectAsync?: (project: pxt.cpp.HexFile) => Promise<void>; renderBrowserDownloadInstructions?: () => any /* JSX.Element */; renderUsbPairDialog?: (firmwareUrl?: string, failedOnce?: boolean) => any /* JSX.Element */; renderIncompatibleHardwareDialog?: (unsupportedParts: string[]) => any /* JSX.Element */; showUploadInstructionsAsync?: (fn: string, url: string, confirmAsync: (options: any) => Promise<number>) => Promise<void>; showProgramTooLargeErrorAsync?: (variants: string[], confirmAsync: (options: any) => Promise<number>) => Promise<pxt.commands.RecompileOptions>; toolboxOptions?: IToolboxOptions; blocklyPatch?: (pkgTargetVersion: string, dom: Element) => void; webUsbPairDialogAsync?: (pairAsync: () => Promise<boolean>, confirmAsync: (options: any) => Promise<number>) => Promise<number>; mkPacketIOWrapper?: (io: pxt.packetio.PacketIO) => pxt.packetio.PacketIOWrapper; // Used with the @tutorialCompleted macro. See docs/writing-docs/tutorials.md for more info onTutorialCompleted?: () => void; // Used with @codeStart, @codeStop metadata (MINECRAFT HOC ONLY) onCodeStart?: () => void; onCodeStop?: () => void; } export interface FieldExtensionOptions { } export interface FieldExtensionResult { fieldEditors?: IFieldCustomOptions[]; } export interface ToolboxDefinition { loops?: ToolboxCategoryDefinition; logic?: ToolboxCategoryDefinition; variables?: ToolboxCategoryDefinition; maths?: ToolboxCategoryDefinition; text?: ToolboxCategoryDefinition; arrays?: ToolboxCategoryDefinition; functions?: ToolboxCategoryDefinition; } export interface ToolboxCategoryDefinition { /** * The display name for the category */ name?: string; /** * The icon of this category */ icon?: string; /** * The color of this category */ color?: string; /** * The weight of the category relative to other categories in the toolbox */ weight?: number; /** * Whether or not the category should be placed in the advanced category */ advanced?: boolean; /** * Blocks to appear in the category. Specifying this field will override * all existing blocks in the category. The ordering of the blocks is * determined by the ordering of this array. */ blocks?: ToolboxBlockDefinition[]; /** * Ordering of category groups */ groups?: string[], } export interface ToolboxBlockDefinition { /** * Internal id used to refer to this block or snippet, must be unique */ name: string; /** * Group label used to categorize block. Blocks are arranged with other * blocks that share the same group. */ group?: string, /** * Indicates an advanced API. Advanced APIs appear after basic ones in the * toolbox */ advanced?: boolean; /** * The weight for the block. Blocks are arranged in order of they appear in the category * definition's array but the weight can be specified in the case that other APIs are * dynamically added to the category (eg. loops.forever()) */ weight?: number; /** * Description of code to appear in the hover text */ jsDoc?: string /** * TypeScript snippet of code to insert when dragged into editor */ snippet?: string; /** * Python snippet of code to insert when dragged into editor */ pySnippet?: string; /** * TypeScript name used for highlighting the snippet, uses name if not defined */ snippetName?: string; /** * Python name used for highlighting the snippet, uses name if not defined */ pySnippetName?: string; /** * Display just the snippet and nothing else. Should be set to true for * language constructs (eg. for-loops) and to false for function * calls (eg. Math.random()) */ snippetOnly?: boolean; /** * The return type of the block. This is used to determine the shape of the block rendered. */ retType?: string; /** * The block definition in XML for the blockly toolbox. */ blockXml?: string; /** * The Blockly block id used to identify this block. */ blockId?: string; } interface BaseAssetEditorRequest { id?: number; files: pxt.Map<string>; palette?: string[]; } interface OpenAssetEditorRequest extends BaseAssetEditorRequest { type: "open"; assetId: string; assetType: pxt.AssetType; } interface CreateAssetEditorRequest extends BaseAssetEditorRequest { type: "create"; assetType: pxt.AssetType; displayName?: string; } interface SaveAssetEditorRequest extends BaseAssetEditorRequest { type: "save"; } interface DuplicateAssetEditorRequest extends BaseAssetEditorRequest { type: "duplicate"; assetId: string; assetType: pxt.AssetType; } type AssetEditorRequest = OpenAssetEditorRequest | CreateAssetEditorRequest | SaveAssetEditorRequest | DuplicateAssetEditorRequest; interface BaseAssetEditorResponse { id?: number; } interface OpenAssetEditorResponse extends BaseAssetEditorResponse { type: "open"; } interface CreateAssetEditorResponse extends BaseAssetEditorResponse { type: "create"; } interface SaveAssetEditorResponse extends BaseAssetEditorResponse { type: "save"; files: pxt.Map<string>; } interface DuplicateAssetEditorResponse extends BaseAssetEditorResponse { type: "duplicate"; } type AssetEditorResponse = OpenAssetEditorResponse | CreateAssetEditorResponse | SaveAssetEditorResponse | DuplicateAssetEditorResponse; interface AssetEditorRequestSaveEvent { type: "event"; kind: "done-clicked"; } interface AssetEditorReadyEvent { type: "event"; kind: "ready"; } type AssetEditorEvent = AssetEditorRequestSaveEvent | AssetEditorReadyEvent; } declare namespace pxt.workspace { export interface WorkspaceProvider { listAsync(): Promise<pxt.workspace.Header[]>; // called from workspace.syncAsync (including upon startup) getAsync(h: pxt.workspace.Header): Promise<File>; setAsync(h: pxt.workspace.Header, prevVersion: pxt.workspace.Version, text?: pxt.workspace.ScriptText): Promise<pxt.workspace.Version>; deleteAsync?: (h: pxt.workspace.Header, prevVersion: pxt.workspace.Version) => Promise<void>; resetAsync(): Promise<void>; loadedAsync?: () => Promise<void>; getSyncState?: () => pxt.editor.EditorSyncState; // optional screenshot support saveScreenshotAsync?: (h: pxt.workspace.Header, screenshot: string, icon: string) => Promise<void>; // optional asset (large binary file) support saveAssetAsync?: (id: string, filename: string, data: Uint8Array) => Promise<void>; listAssetsAsync?: (id: string) => Promise<Asset[]>; fireEvent?: (ev: pxt.editor.EditorEvent) => void; } } ```
/content/code_sandbox/localtypings/pxteditor.d.ts
xml
2016-01-24T19:35:52
2024-08-16T16:39:39
pxt
microsoft/pxt
2,069
8,757
```xml <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>Dialog</class> <widget class="QDialog" name="Dialog"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>197</width> <height>72</height> </rect> </property> <property name="windowTitle"> <string>Dialog</string> </property> <widget class="QDialogButtonBox" name="buttonBox"> <property name="geometry"> <rect> <x>-160</x> <y>20</y> <width>341</width> <height>32</height> </rect> </property> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="standardButtons"> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> </widget> </widget> <resources/> <connections> <connection> <sender>buttonBox</sender> <signal>accepted()</signal> <receiver>Dialog</receiver> <slot>accept()</slot> <hints> <hint type="sourcelabel"> <x>248</x> <y>254</y> </hint> <hint type="destinationlabel"> <x>157</x> <y>274</y> </hint> </hints> </connection> <connection> <sender>buttonBox</sender> <signal>rejected()</signal> <receiver>Dialog</receiver> <slot>reject()</slot> <hints> <hint type="sourcelabel"> <x>316</x> <y>260</y> </hint> <hint type="destinationlabel"> <x>286</x> <y>274</y> </hint> </hints> </connection> </connections> </ui> ```
/content/code_sandbox/src/05 Qt Designer Python/dialog.ui
xml
2016-10-13T07:03:35
2024-08-15T15:36:27
examples
pyqt/examples
2,313
464
```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. --> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <groupId>com.google.training</groupId> <artifactId>appdev</artifactId> <version>0.0.1</version> <packaging>jar</packaging> <name>appdev</name> <description>Quiz Application</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.6.RELEASE</version> <relativePath/> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <google.datastore.version>1.6.0</google.datastore.version> <google.pubsub.version>0.24.0-beta</google.pubsub.version> <google.languageapi.version>0.24.0-beta</google.languageapi.version> <google.soanner.version>0.24.0-beta</google.soanner.version> <google.cloudstorage.version>1.6.0</google.cloudstorage.version> <google-api-pubsub.version>v1-rev8-1.21.0</google-api-pubsub.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!-- Following dependency breaks App Engine deployment. --> <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> </dependency> --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>com.vaadin.external.google</groupId> <artifactId>android-json</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-datastore</artifactId> <version>${google.datastore.version}</version> <exclusions> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-storage</artifactId> <version>${google.cloudstorage.version}</version> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-pubsub</artifactId> <version>${google.pubsub.version}</version> <exclusions> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.3.Final</version> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-language</artifactId> <version>${google.languageapi.version}</version> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-spanner</artifactId> <version>${google.soanner.version}</version> </dependency> <dependency> <groupId>com.google.apis</groupId> <artifactId>google-api-services-pubsub</artifactId> <version>${google-api-pubsub.version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${java.version}</source> <target>${java.version}</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>worker</id> <goals> <goal>java</goal> </goals> <configuration> <mainClass>com.google.training.appdev.console.ConsoleApp</mainClass> </configuration> </execution> <execution> <id>create-entities</id> <goals> <goal>java</goal> </goals> <configuration> <mainClass>com.google.training.appdev.setup.QuestionBuilder</mainClass> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> ```
/content/code_sandbox/courses/developingapps/java/firebase/start/pom.xml
xml
2016-04-17T21:39:27
2024-08-16T17:22:27
training-data-analyst
GoogleCloudPlatform/training-data-analyst
7,726
1,323
```xml import { describe, expect, test, vi } from 'vitest'; import { printMessage } from '../src/formatter'; import { LevelCode } from '../src/levels'; vi.mock('dayjs', () => ({ __esModule: true, default: () => ({ format: () => 'formatted-date', }), })); describe('formatter', () => { const prettyfierOptions = { messageKey: 'msg', levelFirst: true, prettyStamp: false }; describe('printMessage', () => { test('should display config file', () => { const log = { level: 40, time: 1585410824129, v: 1, pid: 27029, hostname: 'localhost', file: '/Users/user/.config/verdaccio/config/config.yaml', msg: 'config file - @{file}', }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display trace level', () => { const log = { level: 10, foo: 'foo', msg: '[trace] - @{foo}', }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display trace level with pretty stamp', () => { const log = { level: 10, foo: 'foo', time: 1585411248203, msg: '[trace] - @{foo}', }; expect( printMessage( log, Object.assign({}, prettyfierOptions, { prettyStamp: true, }), false ) ).toMatchSnapshot(); }); test('should display a bytes request', () => { const log = { level: 35, time: 1585411248203, v: 1, pid: 27029, hostname: 'macbook-touch', sub: 'in', request: { method: 'GET', url: '/verdaccio' }, user: null, remoteIP: '127.0.0.1', status: 200, error: undefined, bytes: { in: 0, out: 150186 }, msg: "@{status}, user: @{user}(@{remoteIP}), req: '@{request.method} @{request.url}', " + 'bytes: @{bytes.in}/@{bytes.out}', }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display an error request', () => { const log = { level: 54, time: 1585416029123, v: 1, pid: 30032, hostname: 'macbook-touch', sub: 'out', err: { type: 'Error', message: 'getaddrinfo ENOTFOUND registry.fake.org', stack: 'Error: getaddrinfo ENOTFOUND registry.fake.org\n' + ' at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)', errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'registry.fake.org', }, request: { method: 'GET', url: 'path_to_url }, status: 'ERR', error: 'getaddrinfo ENOTFOUND registry.fake.org', bytes: { in: 0, out: 0 }, msg: "@{!status}, req: '@{request.method} @{request.url}', error: @{!error}", }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display an fatal request', () => { const log = { level: 60, time: 1585416029123, v: 1, pid: 30032, hostname: 'macbook-touch', sub: 'out', err: { type: 'Error', message: 'fatal error', stack: '....', errno: -3008, code: 'ENOTFOUND', }, request: { method: 'GET', url: 'path_to_url }, status: 'ERR', error: 'fatal error', bytes: { in: 0, out: 0 }, msg: "@{!status}, req: '@{request.method} @{request.url}', error: @{!error}", }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display a streaming request', () => { const log = { level: 35, time: 1585411247920, v: 1, pid: 27029, hostname: 'macbook-touch', sub: 'out', request: { method: 'GET', url: 'path_to_url }, status: 304, msg: "@{!status}, req: '@{request.method} @{request.url}' (streaming)", }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display version and http address', () => { const log = { level: 40, time: 1585410824322, v: 1, pid: 27029, hostname: 'macbook-touch', addr: 'path_to_url version: 'verdaccio/5.0.0', msg: 'http address - @{addr} - @{version}', }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display custom log message', () => { const level: LevelCode = 15; const log = { level, something: 'foo', msg: 'custom - @{something} - @{missingParam}', }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); test('should display a resource request', () => { const log = { level: 30, time: 1585411247622, v: 1, pid: 27029, hostname: 'macbook-touch', sub: 'in', req: { id: undefined, method: 'GET', url: '/verdaccio', headers: { connection: 'keep-alive', 'user-agent': 'npm/6.13.2 node/v13.1.0 darwin x64', 'npm-in-ci': 'false', 'npm-scope': '', 'npm-session': 'afebb4748178bd4b', referer: 'view verdaccio', 'pacote-req-type': 'packument', 'pacote-pkg-id': 'registry:verdaccio', accept: 'application/json', authorization: '<Classified>', 'if-none-match': '"fd6440ba2ad24681077664d8f969e5c3"', 'accept-encoding': 'gzip,deflate', host: 'localhost:4873', }, remoteAddress: '127.0.0.1', remotePort: 57968, }, ip: '127.0.0.1', msg: "@{ip} requested '@{req.method} @{req.url}'", }; expect(printMessage(log, prettyfierOptions, false)).toMatchSnapshot(); }); }); }); ```
/content/code_sandbox/packages/logger/logger-prettify/test/formatter.spec.ts
xml
2016-04-15T16:21:12
2024-08-16T09:38:01
verdaccio
verdaccio/verdaccio
16,189
1,618
```xml import "reflect-metadata" import { DataSource } from "../../../../src" import { closeTestingConnections, createTestingConnections, } from "../../../utils/test-utils" import { expect } from "chai" describe("indices > conditional index", () => { let connections: DataSource[] before(async () => { connections = await createTestingConnections({ entities: [__dirname + "/entity/*{.js,.ts}"], enabledDrivers: ["mssql", "postgres", "sqlite", "better-sqlite3"], // only these drivers supports conditional indices schemaCreate: true, dropSchema: true, }) }) after(() => closeTestingConnections(connections)) it("should correctly create conditional indices with WHERE condition", () => Promise.all( connections.map(async (connection) => { const queryRunner = connection.createQueryRunner() let table = await queryRunner.getTable("post") table!.indices.length.should.be.equal(2) expect(table!.indices[0].where).to.be.not.empty expect(table!.indices[1].where).to.be.not.empty await queryRunner.release() }), )) it("should correctly drop conditional indices and revert drop", () => Promise.all( connections.map(async (connection) => { const queryRunner = connection.createQueryRunner() let table = await queryRunner.getTable("post") table!.indices.length.should.be.equal(2) expect(table!.indices[0].where).to.be.not.empty expect(table!.indices[1].where).to.be.not.empty await queryRunner.dropIndices(table!, [...table!.indices]) table = await queryRunner.getTable("post") table!.indices.length.should.be.equal(0) await queryRunner.executeMemoryDownSql() table = await queryRunner.getTable("post") table!.indices.length.should.be.equal(2) expect(table!.indices[0].where).to.be.not.empty expect(table!.indices[1].where).to.be.not.empty await queryRunner.release() }), )) }) ```
/content/code_sandbox/test/functional/indices/conditional-index/conditional-index.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
434
```xml <resources> <string name="app_name">jianxi_record1</string> <string-array name="velocity"> <item>none</item> <item>ultrafast</item> <item>superfast</item> <item>veryfast</item> <item>faster</item> <item>fast</item> <item>medium</item> <item>slow</item> <item>slower</item> <item>veryslow</item> <item>placebo</item> </string-array> </resources> ```
/content/code_sandbox/SmallVideoRecord1/sample/src/main/res/values/strings.xml
xml
2016-08-25T09:20:09
2024-08-11T05:54:45
small-video-record
mabeijianxi/small-video-record
3,455
131
```xml /* * Wire * * This program is free software: you can redistribute it and/or modify * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * along with this program. If not, see path_to_url * */ import {render} from '@testing-library/react'; import type {Location} from 'src/script/entity/message/Location'; import {LocationAsset} from './LocationAsset'; describe('LocationAsset', () => { const location: Partial<Location> = {latitude: '52.31', longitude: '13.24', name: 'Berlin', zoom: '0'}; it('sets the correct Google Maps link', () => { const {getByTestId} = render(<LocationAsset asset={location as Location} />); const mapsElement = getByTestId('location-asset-link'); const mapsLink = mapsElement.getAttribute('href'); expect(mapsLink).toContain(`${location.latitude},${location.longitude}`); }); it('sets the correct location name', () => { const {queryByText} = render(<LocationAsset asset={location as Location} />); expect(queryByText(location.name!)).not.toBeNull(); }); }); ```
/content/code_sandbox/src/script/components/MessagesList/Message/ContentMessage/asset/LocationAsset.test.tsx
xml
2016-07-21T15:34:05
2024-08-16T11:40:13
wire-webapp
wireapp/wire-webapp
1,125
282
```xml export * from 'storybook/internal/csf-tools'; export type * from 'storybook/internal/csf-tools'; ```
/content/code_sandbox/code/deprecated/csf-tools/shim.d.ts
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
22
```xml import { ICoronaInfoHistory } from "../../../../models/ICoronaInfoHistory"; export interface IHistoryModalProps { countryCode: string; confirmedColor: string; deathColor: string; recoveredColor: string; _loadHistoryData(): Promise<ICoronaInfoHistory>; } ```
/content/code_sandbox/samples/react-covid19-info/src/webparts/covid19Info/components/HistoryModal/IHistoryModalProps.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
64
```xml import { describe, expect, it, vi } from 'vitest'; import { Channel } from '@storybook/core/channels'; import { EventEmitter } from 'events'; import type { Server } from 'http'; import { stringify } from 'telejson'; import { ServerChannelTransport, getServerChannel } from '../get-server-channel'; describe('getServerChannel', () => { it('should return a channel', () => { const server = { on: vi.fn() } as any as Server; const result = getServerChannel(server); expect(result).toBeInstanceOf(Channel); }); it('should attach to the http server', () => { const server = { on: vi.fn() } as any as Server; getServerChannel(server); expect(server.on).toHaveBeenCalledWith('upgrade', expect.any(Function)); }); }); describe('ServerChannelTransport', () => { it('parses simple JSON', () => { const server = new EventEmitter() as any as Server; const socket = new EventEmitter(); const transport = new ServerChannelTransport(server); const handler = vi.fn(); transport.setHandler(handler); // @ts-expect-error (an internal API) transport.socket.emit('connection', socket); socket.emit('message', '"hello"'); expect(handler).toHaveBeenCalledWith('hello'); }); it('parses object JSON', () => { const server = new EventEmitter() as any as Server; const socket = new EventEmitter(); const transport = new ServerChannelTransport(server); const handler = vi.fn(); transport.setHandler(handler); // @ts-expect-error (an internal API) transport.socket.emit('connection', socket); socket.emit('message', JSON.stringify({ type: 'hello' })); expect(handler).toHaveBeenCalledWith({ type: 'hello' }); }); it('supports telejson cyclical data', () => { const server = new EventEmitter() as any as Server; const socket = new EventEmitter(); const transport = new ServerChannelTransport(server); const handler = vi.fn(); transport.setHandler(handler); // @ts-expect-error (an internal API) transport.socket.emit('connection', socket); const input: any = { a: 1 }; input.b = input; socket.emit('message', stringify(input)); expect(handler.mock.calls[0][0]).toMatchInlineSnapshot(` { "a": 1, "b": [Circular], } `); }); it('skips telejson classes and functions in data', () => { const server = new EventEmitter() as any as Server; const socket = new EventEmitter(); const transport = new ServerChannelTransport(server); const handler = vi.fn(); transport.setHandler(handler); // @ts-expect-error (an internal API) transport.socket.emit('connection', socket); const input = { a() {}, b: class {} }; socket.emit('message', stringify(input)); expect(handler.mock.calls[0][0].a).toEqual(expect.any(String)); expect(handler.mock.calls[0][0].b).toEqual(expect.any(String)); }); }); ```
/content/code_sandbox/code/core/src/core-server/utils/__tests__/server-channel.test.ts
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
659
```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 A visitor to serialize MathML taking menu settings into account * * @author dpvc@mathjax.org (Davide Cervone) */ import {MathItem} from '../../core/MathItem.js'; import {MmlNode} from '../../core/MmlTree/MmlNode.js'; import {SerializedMmlVisitor} from '../../core/MmlTree/SerializedMmlVisitor.js'; import {OptionList, userOptions} from '../../util/Options.js'; /*==========================================================================*/ /** * The visitor to serialize MathML * * @template N The HTMLElement node class * @template T The Text node class * @template D The Document class */ export class MmlVisitor<N, T, D> extends SerializedMmlVisitor { /** * The options controlling the serialization */ public options: OptionList = { texHints: true, // True means include classes for TeXAtom elements semantics: false, // True means include original form as annotation in a semantics element }; /** * The MathItem currently being processed */ public mathItem: MathItem<N, T, D> = null; /** * @param {MmlNode} node The internal MathML node to serialize * @param {MathItem} math The MathItem for this node * @param {OptionList} options The options controlling the processing * @override */ public visitTree(node: MmlNode, math: MathItem<N, T, D> = null, options: OptionList = {}) { this.mathItem = math; userOptions(this.options, options); return this.visitNode(node, ''); } /** * @override */ public visitTeXAtomNode(node: MmlNode, space: string) { if (this.options.texHints) { return super.visitTeXAtomNode(node, space); } if (node.childNodes[0] && node.childNodes[0].childNodes.length === 1) { return this.visitNode(node.childNodes[0], space); } return space + '<mrow' + this.getAttributes(node) + '>\n' + this.childNodeMml(node, space + ' ', '\n') + space + '</mrow>'; } /** * @param {MmlNode} node The math node to visit * @param {string} space The number of spaces to use for indentation * @returns {string} The serialized math element */ public visitMathNode(node: MmlNode, space: string): string { if (!this.options.semantics || this.mathItem.inputJax.name !== 'TeX') { return super.visitDefault(node, space); } const addRow = node.childNodes.length && node.childNodes[0].childNodes.length > 1; return space + '<math' + this.getAttributes(node) + '>\n' + space + ' <semantics>\n' + (addRow ? space + ' <mrow>\n' : '') + this.childNodeMml(node, space + (addRow ? ' ' : ' '), '\n') + (addRow ? space + ' </mrow>\n' : '') + space + ' <annotation encoding="application/x-tex">' + this.mathItem.math + '</annotation>\n' + space + ' </semantics>\n' + space + '</math>'; } } ```
/content/code_sandbox/ts/ui/menu/MmlVisitor.ts
xml
2016-02-23T09:52:03
2024-08-16T04:46:50
MathJax-src
mathjax/MathJax-src
2,017
799
```xml import { IServerFiltersInRequest } from 'services/serverModel/Filters/converters'; import { IFilterData } from 'shared/models/Filters'; import { IPagination } from 'shared/models/Pagination'; import { IWorkspace } from 'shared/models/Workspace'; import { makeAddFiltersToRequest } from 'services/serverModel/Filters/converters'; import { addPaginationToRequest } from 'services/serverModel/Pagination/converters'; import { IServerPaginationInRequest } from 'services/serverModel/Pagination/Pagination'; import { IServerEntityWithWorkspaceName, addWorkspaceName, } from 'services/serverModel/Workspace/converters'; import { ISorting } from 'shared/models/Sorting'; import { addSorting } from 'services/serverModel/Sorting/Sorting'; export type ILoadDatasetsRequest = { dataset_ids: string[]; } & IServerPaginationInRequest & IServerFiltersInRequest & IServerEntityWithWorkspaceName; type ITransformedLoadDatasetsRequest = Partial<ILoadDatasetsRequest>; type TransformLoadDatasetsRequest = ( request: ITransformedLoadDatasetsRequest ) => Promise<ITransformedLoadDatasetsRequest>; const addPagination = ( pagination: IPagination ): TransformLoadDatasetsRequest => request => Promise.resolve(addPaginationToRequest(pagination)(request)); const addFilters = makeAddFiltersToRequest(); const makeLoadDatasetsRequest = ( filters: IFilterData[], pagination: IPagination, workspaceName?: IWorkspace['name'], sorting?: ISorting ): Promise<ILoadDatasetsRequest> => { return Promise.resolve({}) .then(addPagination(pagination)) .then(workspaceName ? addWorkspaceName(workspaceName) : request => request) .then(addFilters(filters)) .then(sorting ? addSorting(sorting) : request => request) as Promise< ILoadDatasetsRequest >; }; export default makeLoadDatasetsRequest; ```
/content/code_sandbox/webapp/client/src/services/datasets/responseRequest/makeLoadDatasetsRequest.ts
xml
2016-10-19T01:07:26
2024-08-14T03:53:55
modeldb
VertaAI/modeldb
1,689
416
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\programs\ssl\ssl_fork_server.c" /> </ItemGroup> <ItemGroup> <ProjectReference Include="mbedTLS.vcxproj"> <Project>{46cf2d25-6a36-4189-b59c-e4815388e554}</Project> <LinkLibraryDependencies>true</LinkLibraryDependencies> </ProjectReference> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{918CD402-047D-8467-E11C-E1132053F916}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>ssl_fork_server</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <LinkIncremental>true</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <LinkIncremental>true</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>false</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <LinkIncremental>false</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <PrecompiledHeader> </PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <ShowProgress>NotSet</ShowProgress> <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories> </Link> <ProjectReference> <LinkLibraryDependencies>false</LinkLibraryDependencies> </ProjectReference> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <PrecompiledHeader> </PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <ShowProgress>NotSet</ShowProgress> <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories> </Link> <ProjectReference> <LinkLibraryDependencies>false</LinkLibraryDependencies> </ProjectReference> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader> </PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories> <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader> </PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories> <AdditionalDependencies>%(AdditionalDependencies);</AdditionalDependencies> </Link> </ItemDefinitionGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project> ```
/content/code_sandbox/components/security/mbedtls/mbedtls-2.16.8/visualc/VS2010/ssl_fork_server.vcxproj
xml
2016-09-11T14:25:51
2024-08-16T10:12:43
LiteOS
LiteOS/LiteOS
4,794
2,155
```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 { assert } from "chai"; import { mount, type ReactWrapper } from "enzyme"; import * as React from "react"; import { spy } from "sinon"; import { Classes, NumericInput, type Panel, type PanelProps, PanelStack2, type PanelStack2Props } from "../../src"; // eslint-disable-next-line @typescript-eslint/ban-types type TestPanelInfo = {}; type TestPanelType = Panel<TestPanelInfo>; const TestPanel: React.FC<PanelProps<TestPanelInfo>> = props => { const [counter, setCounter] = React.useState(0); const newPanel = { renderPanel: TestPanel, title: "New Panel 1" }; return ( <div> <button id="new-panel-button" onClick={() => props.openPanel(newPanel)} /> {/* eslint-disable-next-line @typescript-eslint/unbound-method */} <button id="close-panel-button" onClick={props.closePanel} /> <span aria-label="counter value">{counter}</span> <NumericInput value={counter} stepSize={1} onValueChange={setCounter} /> </div> ); }; describe("<PanelStack2>", () => { let testsContainerElement: HTMLElement; let panelStackWrapper: PanelStack2Wrapper<TestPanelType>; const initialPanel: Panel<TestPanelInfo> = { props: {}, renderPanel: TestPanel, title: "Test Title", }; const emptyTitleInitialPanel: Panel<TestPanelInfo> = { props: {}, renderPanel: TestPanel, }; beforeEach(() => { testsContainerElement = document.createElement("div"); document.body.appendChild(testsContainerElement); }); afterEach(() => { panelStackWrapper?.unmount(); panelStackWrapper?.detach(); testsContainerElement.remove(); }); describe("uncontrolled mode", () => { it("renders a basic panel and allows opening and closing", () => { panelStackWrapper = renderPanelStack({ initialPanel }); assert.exists(panelStackWrapper); const newPanelButton = panelStackWrapper.find("#new-panel-button"); assert.exists(newPanelButton); newPanelButton.simulate("click"); const newPanelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.exists(newPanelHeader); assert.equal(newPanelHeader.at(0).text(), "New Panel 1"); const backButton = panelStackWrapper.findClass(Classes.PANEL_STACK2_HEADER_BACK); assert.exists(backButton); backButton.simulate("click"); const oldPanelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.exists(oldPanelHeader); assert.equal(oldPanelHeader.at(1).text(), "Test Title"); }); it("renders a panel stack without header and allows opening and closing", () => { panelStackWrapper = renderPanelStack({ initialPanel, showPanelHeader: false }); assert.exists(panelStackWrapper); const newPanelButton = panelStackWrapper.find("#new-panel-button"); assert.exists(newPanelButton); newPanelButton.simulate("click"); const newPanelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.lengthOf(newPanelHeader, 0); const backButton = panelStackWrapper.findClass(Classes.PANEL_STACK2_HEADER_BACK); assert.lengthOf(backButton, 0); const closePanel = panelStackWrapper.find("#close-panel-button"); assert.exists(closePanel); closePanel.last().simulate("click"); const oldPanelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.lengthOf(oldPanelHeader, 0); }); it("does not call the callback handler onClose when there is only a single panel on the stack", () => { const onClose = spy(); panelStackWrapper = renderPanelStack({ initialPanel, onClose }); const closePanel = panelStackWrapper.find("#close-panel-button"); assert.exists(closePanel); closePanel.simulate("click"); assert.equal(onClose.callCount, 0); }); it("calls the callback handlers onOpen and onClose", () => { const onOpen = spy(); const onClose = spy(); panelStackWrapper = renderPanelStack({ initialPanel, onClose, onOpen }); const newPanelButton = panelStackWrapper.find("#new-panel-button"); assert.exists(newPanelButton); newPanelButton.simulate("click"); assert.isTrue(onOpen.calledOnce); assert.isFalse(onClose.calledOnce); const backButton = panelStackWrapper.findClass(Classes.PANEL_STACK2_HEADER_BACK); assert.exists(backButton); backButton.simulate("click"); assert.isTrue(onClose.calledOnce); assert.isTrue(onOpen.calledOnce); }); it("does not have the back button when only a single panel is on the stack", () => { panelStackWrapper = renderPanelStack({ initialPanel }); const backButton = panelStackWrapper.findClass(Classes.PANEL_STACK2_HEADER_BACK); assert.equal(backButton.length, 0); }); it("assigns the class to TransitionGroup", () => { const TEST_CLASS_NAME = "TEST_CLASS_NAME"; panelStackWrapper = renderPanelStack({ initialPanel, className: TEST_CLASS_NAME }); assert.isTrue(panelStackWrapper.hasClass(TEST_CLASS_NAME)); const transitionGroupClassName = panelStackWrapper.findClass(TEST_CLASS_NAME).props().className; assert.exists(transitionGroupClassName); assert.equal(transitionGroupClassName!.indexOf(Classes.PANEL_STACK2), 0); }); it("can render a panel without a title", () => { panelStackWrapper = renderPanelStack({ initialPanel: emptyTitleInitialPanel }); assert.exists(panelStackWrapper); const newPanelButton = panelStackWrapper.find("#new-panel-button"); assert.exists(newPanelButton); newPanelButton.simulate("click"); const backButtonWithoutTitle = panelStackWrapper.findClass(Classes.PANEL_STACK2_HEADER_BACK); assert.equal( backButtonWithoutTitle.prop("aria-label"), "Back", "expected icon-only back button to have accessible label", ); const newPanelButtonOnNotEmpty = panelStackWrapper.find("#new-panel-button").hostNodes().at(1); assert.exists(newPanelButtonOnNotEmpty); newPanelButtonOnNotEmpty.simulate("click"); const backButtonWithTitle = panelStackWrapper.findClass(Classes.PANEL_STACK2_HEADER_BACK).hostNodes().at(1); assert.equal( backButtonWithTitle.prop("aria-label"), "Back", "expected icon-only back button to have accessible label", ); }); }); describe("controlled mode", () => { it("can render a panel stack in controlled mode", () => { const stack = [initialPanel]; panelStackWrapper = renderPanelStack({ stack }); assert.exists(panelStackWrapper); const newPanelButton = panelStackWrapper.find("#new-panel-button"); assert.exists(newPanelButton); newPanelButton.simulate("click"); // Expect the same panel as before since onOpen is not handled const newPanelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.exists(newPanelHeader); assert.equal(newPanelHeader.at(0).text(), "Test Title"); }); it("can open a panel in controlled mode", () => { let stack = [initialPanel]; panelStackWrapper = renderPanelStack({ onOpen: panel => { stack = [...stack, panel]; }, stack, }); assert.exists(panelStackWrapper); const newPanelButton = panelStackWrapper.find("#new-panel-button"); assert.exists(newPanelButton); newPanelButton.simulate("click"); panelStackWrapper.setProps({ stack }); const newPanelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.exists(newPanelHeader); assert.equal(newPanelHeader.at(0).text(), "New Panel 1"); }); it("can render a panel stack with multiple initial panels and close one", () => { let stack: Array<Panel<TestPanelInfo>> = [initialPanel, { renderPanel: TestPanel, title: "New Panel 1" }]; panelStackWrapper = renderPanelStack({ onClose: () => { stack = stack.slice(0, -1); }, stack, }); assert.exists(panelStackWrapper); const panelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.exists(panelHeader); assert.equal(panelHeader.at(0).text(), "New Panel 1"); const backButton = panelStackWrapper.findClass(Classes.PANEL_STACK2_HEADER_BACK); assert.exists(backButton); backButton.simulate("click"); panelStackWrapper.setProps({ stack }); const firstPanelHeader = panelStackWrapper.findClass(Classes.HEADING); assert.exists(firstPanelHeader); assert.equal(firstPanelHeader.at(0).text(), "Test Title"); }); it("renders only one panel by default", () => { const stack = [ { renderPanel: TestPanel, title: "Panel A" }, { renderPanel: TestPanel, title: "Panel B" }, ]; panelStackWrapper = renderPanelStack({ stack }); const panelHeaders = panelStackWrapper.findClass(Classes.HEADING); assert.exists(panelHeaders); assert.equal(panelHeaders.length, 1); assert.equal(panelHeaders.at(0).text(), stack[1].title); }); describe("with renderActivePanelOnly={false}", () => { it("renders all panels", () => { const stack = [ { renderPanel: TestPanel, title: "Panel A" }, { renderPanel: TestPanel, title: "Panel B" }, ]; panelStackWrapper = renderPanelStack({ renderActivePanelOnly: false, stack }); const panelHeaders = panelStackWrapper.findClass(Classes.HEADING); assert.exists(panelHeaders); assert.equal(panelHeaders.length, 2); assert.equal(panelHeaders.at(0).text(), stack[0].title); assert.equal(panelHeaders.at(1).text(), stack[1].title); }); it("keeps panels mounted", () => { let stack = [initialPanel]; panelStackWrapper = renderPanelStack({ onClose: () => { stack = stack.slice(0, -1); }, onOpen: panel => { stack = [...stack, panel]; }, renderActivePanelOnly: false, stack, }); const incrementButton = panelStackWrapper.find(`[aria-label="increment"]`); assert.exists(incrementButton); incrementButton.hostNodes().simulate("mousedown"); assert.equal(getFirstPanelCounterValue(), 1, "clicking increment button should increase counter"); const newPanelButton = panelStackWrapper.find("#new-panel-button"); newPanelButton.hostNodes().simulate("click"); panelStackWrapper.setProps({ stack }); const backButton = panelStackWrapper.find(`[aria-label="Back"]`); backButton.hostNodes().simulate("click"); panelStackWrapper.setProps({ stack }); assert.equal( getFirstPanelCounterValue(), 1, "first panel should retain its counter state when we return to it", ); }); function getFirstPanelCounterValue() { const counterValue = panelStackWrapper.find(`[aria-label="counter value"]`); assert.exists(counterValue); return parseInt(counterValue.hostNodes().first().text().trim(), 10); } }); }); // eslint-disable-next-line @typescript-eslint/ban-types interface PanelStack2Wrapper<T extends Panel<object>> extends ReactWrapper<PanelStack2Props<T>, any> { findClass(className: string): ReactWrapper<React.HTMLAttributes<HTMLElement>, any>; } function renderPanelStack(props: PanelStack2Props<TestPanelType>): PanelStack2Wrapper<TestPanelType> { panelStackWrapper = mount(<PanelStack2 {...props} />, { attachTo: testsContainerElement, }) as PanelStack2Wrapper<TestPanelType>; panelStackWrapper.findClass = (className: string) => panelStackWrapper.find(`.${className}`).hostNodes(); return panelStackWrapper; } }); ```
/content/code_sandbox/packages/core/test/panel-stack2/panelStack2Tests.tsx
xml
2016-10-25T21:17:50
2024-08-16T15:14:48
blueprint
palantir/blueprint
20,593
2,604
```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. --> <window xmlns="path_to_url"> <actions> <action id="dialogAction"/> </actions> <facets> <optionDialog id="optionDialog" caption="OptionDialog Facet" message="OptionDialog Test" type="CONFIRMATION" contentMode="HTML" height="200" width="350" styleName="opt-dialog-style" modal="true" maximized="true"> <actions> <action id="ok" caption="OK" description="OK" icon="CHECK" primary="true"/> <action id="discard" description="Discard" icon="theme://themeIcon"/> <action id="cancel" caption="Cancel" description="Cancel" icon="icons/ok.png"/> </actions> </optionDialog> <optionDialog id="dialogActionSub" caption="Dialog Action Subscription" onAction="dialogAction"/> <optionDialog id="dialogButtonSub" caption="Dialog Button Subscription" onButton="dialogButton"/> </facets> <layout> <button id="dialogButton"/> </layout> </window> ```
/content/code_sandbox/modules/web/test/spec/cuba/web/optiondialog/screens/option-dialog-screen.xml
xml
2016-03-24T07:55:56
2024-07-14T05:13:48
cuba
cuba-platform/cuba
1,342
303
```xml import { strict as assert } from "assert"; import * as path from "path"; import * as vs from "vscode"; import { DebuggerType, VmService } from "../../../shared/enums"; import { fsPath } from "../../../shared/utils/fs"; import { DartDebugClient } from "../../dart_debug_client"; import { createDebugClient, ensureVariable, startDebugger, waitAllThrowIfTerminates } from "../../debug_helpers"; import { activate, closeAllOpenFiles, customScriptExt, defer, delay, ensureHasRunWithArgsStarting, extApi, getLaunchConfiguration, getPackages, logger, openFile, positionOf, prepareHasRunFile, sb, setConfigForTest, waitForResult, watchPromise, webBrokenIndexFile, webBrokenMainFile, webHelloWorldExampleSubFolder, webHelloWorldExampleSubFolderIndexFile, webHelloWorldFolder, webHelloWorldIndexFile, webHelloWorldMainFile, webProjectContainerFolder } from "../../helpers"; describe("web debugger", () => { before("get packages (0)", () => getPackages(webHelloWorldIndexFile)); before("get packages (1)", () => getPackages(webBrokenIndexFile)); beforeEach("activate webHelloWorldIndexFile", () => activate(webHelloWorldIndexFile)); let dc: DartDebugClient; beforeEach("create debug client", () => { dc = createDebugClient(DebuggerType.Web); }); it("runs a web application and remains active until told to quit", async () => { const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, watchPromise("assertOutputContains(serving web on)", dc.assertOutputContains("console", "Serving `web` on path_to_url")), watchPromise("configurationSequence", dc.configurationSequence()), watchPromise("launch", dc.launch(config)), ); // Ensure we're still responsive after 3 seconds. await delay(3000); await watchPromise("threadsRequest", dc.threadsRequest()); await waitAllThrowIfTerminates(dc, watchPromise("waitForEvent(terminated)", dc.waitForEvent("terminated")), watchPromise("terminateRequest", dc.terminateRequest()), ); }); it("can run using a custom tool", async () => { const root = fsPath(webHelloWorldFolder); const hasRunFile = prepareHasRunFile(root, "web"); const config = await startDebugger(dc, webHelloWorldIndexFile, { customTool: path.join(root, `scripts/custom_web.${customScriptExt}`), // (dart) pub global run webdev daemon customToolReplacesArgs: 5, toolArgs: "--", }); await waitAllThrowIfTerminates(dc, watchPromise("assertOutputContains(serving web on)", dc.assertOutputContains("console", "Serving `web` on path_to_url")), watchPromise("configurationSequence", dc.configurationSequence()), watchPromise("launch", dc.launch(config)), ); await waitAllThrowIfTerminates(dc, watchPromise("waitForEvent(terminated)", dc.waitForEvent("terminated")), watchPromise("terminateRequest", dc.terminateRequest()), ); ensureHasRunWithArgsStarting(root, hasRunFile, "--"); }); it("expected debugger services are available in debug mode", async () => { const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, dc.configurationSequence(), dc.launch(config), ); await waitForResult(() => extApi.debugCommands.vmServices.serviceIsRegistered(VmService.HotReload) === false); // TODO: Make true when supported! await waitAllThrowIfTerminates(dc, dc.waitForEvent("terminated"), dc.terminateRequest(), ); await waitForResult(() => extApi.debugCommands.vmServices.serviceIsRegistered(VmService.HotReload) === false); }); it("expected debugger services are available in noDebug mode", async () => { const config = await startDebugger(dc, webHelloWorldIndexFile); config.noDebug = true; await waitAllThrowIfTerminates(dc, dc.configurationSequence(), dc.launch(config), ); await waitForResult(() => extApi.debugCommands.vmServices.serviceIsRegistered(VmService.HotReload) === false); // TODO: Make true when supported! await waitAllThrowIfTerminates(dc, dc.waitForEvent("terminated"), dc.terminateRequest(), ); await waitForResult(() => extApi.debugCommands.vmServices.serviceIsRegistered(VmService.HotReload) === false); }); // Skipped because this is super-flaky. If we quit to early, the processes are not // cleaned up properly. This should be fixed when we move to the un-forked version. it.skip("can quit during a build", async () => { const config = await startDebugger(dc, webHelloWorldIndexFile); // Kick off a build, but do not await it... // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.all([ dc.configurationSequence(), dc.launch(config), ]); // Wait 5 seconds to ensure the build is in progress... await delay(5000); // Send a disconnect request and ensure it happens within 5 seconds. await Promise.race([ Promise.all([ dc.waitForEvent("terminated"), dc.terminateRequest(), ]), new Promise((resolve, reject) => setTimeout(() => reject(new Error("Did not complete terminateRequest within 5s")), 5000)), ]); }); it("resolves relative paths", async () => { const config = await getLaunchConfiguration( path.relative(fsPath(webProjectContainerFolder), fsPath(webHelloWorldMainFile)), ); assert.equal(config!.program, fsPath(webHelloWorldMainFile)); }); it("hot reloads successfully", async function () { if (!extApi.dartCapabilities.webSupportsHotReload) { this.skip(); return; } const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, watchPromise("hot_reloads_successfully->configurationSequence", dc.configurationSequence()), watchPromise("hot_reloads_successfully->launch", dc.launch(config)), ); await watchPromise("hot_reloads_successfully->hotReload", dc.hotReload()); await waitAllThrowIfTerminates(dc, watchPromise("hot_reloads_successfully->waitForEvent:terminated", dc.waitForEvent("terminated")), watchPromise("hot_reloads_successfully->terminateRequest", dc.terminateRequest()), ); }); it("hot restarts successfully", async () => { const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, dc.configurationSequence(), dc.launch(config), ); // If we restart too fast, things fail :-/ await delay(1000); await waitAllThrowIfTerminates(dc, dc.assertOutputContains("stdout", "Restarted app"), dc.customRequest("hotRestart"), ); await waitAllThrowIfTerminates(dc, dc.waitForEvent("terminated"), dc.terminateRequest(), ); }); it.skip("resolves project program/cwds in sub-folders when the open file is in a project sub-folder", async () => { await openFile(webHelloWorldExampleSubFolderIndexFile); const config = await getLaunchConfiguration(); assert.equal(config!.program, fsPath(webHelloWorldExampleSubFolderIndexFile)); assert.equal(config!.cwd, fsPath(webHelloWorldExampleSubFolder)); }); it.skip("can run projects in sub-folders when cwd is set to a project sub-folder", async () => { await closeAllOpenFiles(); const config = await getLaunchConfiguration(undefined, { cwd: "example" }); assert.equal(config!.program, fsPath(webHelloWorldExampleSubFolderIndexFile)); assert.equal(config!.cwd, fsPath(webHelloWorldExampleSubFolder)); }); it("can launch DevTools externally", async () => { await setConfigForTest("dart", "devToolsLocation", "external"); const openBrowserCommand = sb.stub(extApi.envUtils, "openInBrowser").resolves(); const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, watchPromise("launchDevTools->start->configurationSequence", dc.configurationSequence()), watchPromise("launchDevTools->start->launch", dc.launch(config)), ); logger.info("Executing dart.openDevTools"); const devTools = await vs.commands.executeCommand<{ url: string, dispose: () => void }>("dart.openDevTools"); assert.ok(openBrowserCommand.calledOnce); assert.ok(devTools); assert.ok(devTools.url); defer("Dispose DevTools", devTools.dispose); const serverResponse = await extApi.webClient.fetch(devTools.url); assert.notEqual(serverResponse.indexOf("Dart DevTools"), -1); await waitAllThrowIfTerminates(dc, dc.waitForEvent("terminated"), dc.terminateRequest(), ); }); const numReloads = 1; it(`stops at a breakpoint after each reload (${numReloads})`, async function () { if (!extApi.dartCapabilities.webSupportsHotReload) { this.skip(); return; } await openFile(webHelloWorldMainFile); const config = await startDebugger(dc, webHelloWorldIndexFile); const expectedLocation = { line: positionOf("^// BREAKPOINT1").line, path: dc.isUsingUris ? webHelloWorldMainFile.toString() : fsPath(webHelloWorldMainFile), }; // TODO: Remove the last parameter here (and the other things below) when we are mapping breakpoints in org-dartland-app // URIs back to the correct file system paths. await watchPromise("stops_at_a_breakpoint->hitBreakpoint", dc.hitBreakpoint(config, expectedLocation, {})); // TODO: Put these back (and the ones below) when the above is fixed. // const stack = await dc.getStack(); // const frames = stack.body.stackFrames; // assert.equal(frames[0].name, "main"); // dc.assertPath(frames[0].source!.path, expectedLocation.path); // assert.equal(frames[0].source!.name, "package:hello_world/main.dart"); await watchPromise("stops_at_a_breakpoint->resume", dc.resume()); // Add some invalid breakpoints because in the past they've caused us issues // path_to_url // We need to also include expectedLocation since this overwrites all BPs. await dc.setBreakpointsRequest({ breakpoints: [{ line: 0 }, expectedLocation], source: { path: fsPath(webHelloWorldMainFile) }, }); // Reload and ensure we hit the breakpoint on each one. for (let i = 0; i < numReloads; i++) { await delay(2000); // TODO: Remove this attempt to see if reloading too fast is causing our flakes... await waitAllThrowIfTerminates(dc, // TODO: Remove the last parameter here (and the other things above and below) when we are mapping breakpoints in org-dartland-app // URIs back to the correct file system paths. watchPromise(`stops_at_a_breakpoint->reload:${i}->assertStoppedLocation:breakpoint`, dc.assertStoppedLocation("breakpoint", /* expectedLocation,*/ {})) .then(async () => { // TODO: Put these back (and the ones below) when the above is fixed. // const stack = await watchPromise(`stops_at_a_breakpoint->reload:${i}->getStack`, dc.getStack()); // const frames = stack.body.stackFrames; // assert.equal(frames[0].name, "MyHomePage.build"); // dc.assertPath(frames[0].source!.path, expectedLocation.path); // assert.equal(frames[0].source!.name, "package:hello_world/main.dart"); }) .then(() => watchPromise(`stops_at_a_breakpoint->reload:${i}->resume`, dc.resume())), watchPromise(`stops_at_a_breakpoint->reload:${i}->hotReload:breakpoint`, dc.hotReload()), ); } }); describe("can evaluate at breakpoint", () => { it("simple expressions", async () => { await openFile(webHelloWorldMainFile); const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, dc.hitBreakpoint(config, { line: positionOf("^// BREAKPOINT1").line, // positionOf is 0-based, and seems to want 1-based, BUT comment is on next line! path: dc.isUsingUris ? webHelloWorldMainFile.toString() : fsPath(webHelloWorldMainFile), }, {}), ); const evaluateResult = await dc.evaluateForFrame(`"test"`); assert.ok(evaluateResult); assert.equal(evaluateResult.result, `"test"`); assert.equal(evaluateResult.variablesReference, 0); }); it("complex expressions", async () => { await openFile(webHelloWorldMainFile); const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, dc.hitBreakpoint(config, { line: positionOf("^// BREAKPOINT1").line, // positionOf is 0-based, and seems to want 1-based, BUT comment is on next line! path: dc.isUsingUris ? webHelloWorldMainFile.toString() : fsPath(webHelloWorldMainFile), }, {}), ); const evaluateResult = await dc.evaluateForFrame(`(new DateTime.now()).year`); assert.ok(evaluateResult); assert.equal(evaluateResult.result, (new Date()).getFullYear().toString()); assert.equal(evaluateResult.variablesReference, 0); }); it("an expression that returns a variable", async () => { await openFile(webHelloWorldMainFile); const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, dc.hitBreakpoint(config, { line: positionOf("^// BREAKPOINT1").line, // positionOf is 0-based, and seems to want 1-based, BUT comment is on next line! path: dc.isUsingUris ? webHelloWorldMainFile.toString() : fsPath(webHelloWorldMainFile), }, {}), ); const evaluateResult = await dc.evaluateForFrame(`new DateTime.now()`); const thisYear = new Date().getFullYear().toString(); assert.ok(evaluateResult); assert.ok(evaluateResult.result.startsWith("DateTime (" + thisYear), `Result '${evaluateResult.result}' did not start with ${thisYear}`); assert.ok(evaluateResult.variablesReference); }); it("complex expressions when in a top level function", async () => { await openFile(webHelloWorldMainFile); const config = await startDebugger(dc, webHelloWorldIndexFile); await waitAllThrowIfTerminates(dc, dc.hitBreakpoint(config, { line: positionOf("^// BREAKPOINT2").line, path: dc.isUsingUris ? webHelloWorldMainFile.toString() : fsPath(webHelloWorldMainFile), }, {}), ); const evaluateResult = await dc.evaluateForFrame(`(new DateTime.now()).year`); assert.ok(evaluateResult); assert.equal(evaluateResult.result, (new Date()).getFullYear().toString()); assert.equal(evaluateResult.variablesReference, 0); }); }); // Skipped because of: // - path_to_url // - path_to_url it.skip("stops on exception", async () => { await openFile(webBrokenMainFile); const config = await startDebugger(dc, webBrokenIndexFile); await waitAllThrowIfTerminates(dc, dc.configurationSequence(), dc.assertStoppedLocation("exception", { line: positionOf("^Oops").line + 1, // positionOf is 0-based, but seems to want 1-based path: dc.isUsingUris ? webBrokenMainFile.toString() : fsPath(webBrokenMainFile), }), dc.launch(config), ); }); // Skipped because of: // - path_to_url // - path_to_url it.skip("provides exception details when stopped on exception", async () => { await openFile(webBrokenMainFile); const config = await startDebugger(dc, webBrokenIndexFile); await waitAllThrowIfTerminates(dc, dc.configurationSequence(), dc.assertStoppedLocation("exception", { line: positionOf("^Oops").line + 1, // positionOf is 0-based, but seems to want 1-based path: dc.isUsingUris ? webBrokenMainFile.toString() : fsPath(webBrokenMainFile), }), dc.launch(config), ); const variables = await dc.getTopFrameVariables("Exceptions"); ensureVariable(variables, "$_threadException.message", "message", `"(TODO WHEN UNSKIPPING)"`); }); it("logs expected text (and does not stop) at a logpoint", async () => { await openFile(webHelloWorldMainFile); const config = await watchPromise("logs_expected_text->startDebugger", startDebugger(dc, webHelloWorldIndexFile)); await waitAllThrowIfTerminates(dc, watchPromise("logs_expected_text->waitForEvent:initialized", dc.waitForEvent("initialized")) .then(() => watchPromise("logs_expected_text->setBreakpointsRequest", dc.setBreakpointsRequest({ breakpoints: [{ line: positionOf("^// BREAKPOINT1").line, // VS Code says to use {} for expressions, but we want to support Dart's native too, so // we have examples of both (as well as "escaped" brackets). logMessage: "The \\{year} is {(new DateTime.now()).year}", }], source: { path: fsPath(webHelloWorldMainFile) }, }))).then(() => watchPromise("logs_expected_text->configurationDoneRequest", dc.configurationDoneRequest())), watchPromise("logs_expected_text->assertOutputContainsYear", dc.assertOutputContains("stdout", `The {year} is ${(new Date()).getFullYear()}\n`)), watchPromise("logs_expected_text->launch", dc.launch(config)), ); }); // Skipped due to path_to_url it.skip("writes failure output", async () => { // This test really wants to check stderr, but since the widgets library catches the exception is // just comes via stdout. await openFile(webBrokenMainFile); const config = await startDebugger(dc, webBrokenIndexFile); await waitAllThrowIfTerminates(dc, watchPromise("writes_failure_output->configurationSequence", dc.configurationSequence()), watchPromise("writes_failure_output->assertOutputContains", dc.assertOutputContains("stderr", "Exception: Oops\n")), watchPromise("writes_failure_output->launch", dc.launch(config)), ); }); // Skipped due to path_to_url it.skip("moves known files from call stacks to metadata", async () => { await openFile(webBrokenMainFile); const config = await startDebugger(dc, webBrokenIndexFile); await waitAllThrowIfTerminates(dc, watchPromise("writes_failure_output->configurationSequence", dc.configurationSequence()), watchPromise( "writes_failure_output->assertOutputContains", dc.assertOutputContains("stderr", "methodThatThrows") .then((event) => { assert.equal(event.body.output.indexOf("package:broken/main.dart"), -1); assert.equal(event.body.source!.name, "package:broken/main.dart"); dc.assertPath(event.body.source!.path, dc.isUsingUris ? webBrokenMainFile.toString() : fsPath(webBrokenMainFile)); assert.equal(event.body.line, positionOf("^Oops").line + 1); // positionOf is 0-based, but seems to want 1-based assert.equal(event.body.column, 5); }), ), watchPromise("writes_failure_output->launch", dc.launch(config)), ); }); }); ```
/content/code_sandbox/src/test/web_debug/debug/web.test.ts
xml
2016-07-30T13:49:11
2024-08-10T16:23:15
Dart-Code
Dart-Code/Dart-Code
1,472
4,431
```xml import {PlatformTest, View} from "@tsed/common"; import {EndpointMetadata, Get, Returns} from "@tsed/schema"; import {getContentType} from "./getContentType.js"; describe("getContentType", () => { beforeEach(() => PlatformTest.create()); afterEach(() => PlatformTest.reset()); it("should return the content type (undefined)", () => { class TestController { @Get("/") get() {} } const ctx = PlatformTest.createRequestContext(); ctx.endpoint = EndpointMetadata.get(TestController, "get"); const result = getContentType( { test: "test" }, ctx ); expect(result).toEqual(undefined); }); it("should return the content type (object - application/json)", () => { class TestController { @Get("/") @Returns(200).ContentType("application/json") get() {} } const ctx = PlatformTest.createRequestContext(); ctx.endpoint = EndpointMetadata.get(TestController, "get"); ctx.response.getRes().statusCode = 200; jest.spyOn(ctx.response, "getContentType").mockReturnValue("application/json"); const result = getContentType( { test: "test" }, ctx ); expect(result).toEqual("application/json"); }); it("should return the content type (string - application/json)", () => { class TestController { @Get("/") @Returns(200).ContentType("application/json") get() {} } const ctx = PlatformTest.createRequestContext(); ctx.endpoint = EndpointMetadata.get(TestController, "get"); ctx.response.getRes().statusCode = 200; jest.spyOn(ctx.response, "getContentType").mockReturnValue("application/json"); const result = getContentType( { test: "test" }, ctx ); expect(result).toEqual("application/json"); }); it("should return the content type (string - text/html)", () => { class TestController { @Get("/") @Returns(200).ContentType("text/html") get() {} } const ctx = PlatformTest.createRequestContext(); ctx.endpoint = EndpointMetadata.get(TestController, "get"); ctx.response.getRes().statusCode = 200; jest.spyOn(ctx.response, "getContentType").mockReturnValue("text/html"); const result = getContentType( { test: "test" }, ctx ); expect(result).toEqual("text/html"); }); it("should return the content type (string - view)", () => { class TestController { @Get("/") @Returns(200) @View("view.html") get() {} } const ctx = PlatformTest.createRequestContext(); ctx.endpoint = EndpointMetadata.get(TestController, "get"); ctx.response.getRes().statusCode = 200; ctx.view = "true"; const result = getContentType( { test: "test" }, ctx ); expect(result).toEqual("text/html"); }); }); ```
/content/code_sandbox/packages/platform/platform-response-filter/src/utils/getContentType.spec.ts
xml
2016-02-21T18:38:47
2024-08-14T21:19:48
tsed
tsedio/tsed
2,817
647
```xml import { G2Spec } from '../../../src'; export function speciesViolinBasicPolar(): G2Spec { return { type: 'view', data: { type: 'fetch', value: 'data/species.json', }, coordinate: { type: 'polar', }, children: [ { type: 'density', data: { transform: [ { type: 'kde', field: 'y', groupBy: ['x', 'species'], }, ], }, encode: { x: 'x', y: 'y', series: 'species', color: 'species', size: 'size', }, tooltip: false, }, { type: 'boxplot', encode: { x: 'x', y: 'y', series: 'species', color: 'species', size: 8, shape: 'violin', }, style: { opacity: 0.5, point: false, }, }, ], }; } ```
/content/code_sandbox/__tests__/plots/static/species-violin-basic-polar.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
239
```xml /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at path_to_url */ import {BaseHarnessFilters} from '@angular/cdk/testing'; /** A set of criteria that can be used to filter a list of `MatProgressSpinnerHarness` instances. */ export interface ProgressSpinnerHarnessFilters extends BaseHarnessFilters {} ```
/content/code_sandbox/src/material/progress-spinner/testing/progress-spinner-harness-filters.ts
xml
2016-01-04T18:50:02
2024-08-16T11:21:13
components
angular/components
24,263
83
```xml import { ApolloServer } from '../../..'; import { ApolloServerPluginUsageReportingDisabled } from '../../../plugin/disabled'; import { ApolloServerPluginSchemaReporting } from '../../../plugin/schemaReporting'; import { describe, it, expect } from '@jest/globals'; describe('end-to-end', () => { it('fails for unparsable overrideReportedSchema', async () => { await expect( new ApolloServer({ typeDefs: 'type Query { foo: Int }', apollo: { key: 'foo', graphRef: 'bar' }, plugins: [ ApolloServerPluginUsageReportingDisabled(), ApolloServerPluginSchemaReporting({ overrideReportedSchema: 'type Query {', }), ], }).start(), ).rejects.toThrowErrorMatchingInlineSnapshot( `"The schema provided to overrideReportedSchema failed to parse or validate: Syntax Error: Expected Name, found <EOF>."`, ); }); it('fails for invalid overrideReportedSchema', async () => { await expect( new ApolloServer({ typeDefs: 'type Query { foo: Int }', apollo: { key: 'foo', graphRef: 'bar' }, plugins: [ ApolloServerPluginUsageReportingDisabled(), ApolloServerPluginSchemaReporting({ overrideReportedSchema: 'type Query', }), ], }).start(), ).rejects.toThrowErrorMatchingInlineSnapshot( `"The schema provided to overrideReportedSchema failed to parse or validate: Type Query must define one or more fields."`, ); }); }); ```
/content/code_sandbox/packages/server/src/__tests__/plugin/schemaReporting/index.test.ts
xml
2016-04-21T09:26:01
2024-08-16T19:32:15
apollo-server
apollographql/apollo-server
13,742
332
```xml /** */ export interface MonospaceFontMetrics { readonly fontSizePx: number, readonly fontFamily: string, readonly fillTextYOffset: number; // Offset to add to y when rendering text. readonly fillTextXOffset: number; // Offset to add to x when rendering text. readonly widthPx: number; readonly heightPx: number; readonly boldItalicWidthPx: number; readonly strikethroughY: number; readonly strikethroughHeight: number; readonly underlineY: number; readonly underlineHeight: number; readonly secondUnderlineY: number; readonly overlineY: number; readonly overlineHeight: number; readonly curlyHeight: number; readonly curlyThickness: number; readonly curlyY: number; } ```
/content/code_sandbox/packages/extraterm-char-render-canvas/src/font_metrics/MonospaceFontMetrics.ts
xml
2016-03-04T12:39:59
2024-08-16T18:44:37
extraterm
sedwards2009/extraterm
2,501
167
```xml import { type ProjectManifest, type DependenciesOrPeersField } from '@pnpm/types' export function getSpecFromPackageManifest ( manifest: Pick<ProjectManifest, DependenciesOrPeersField>, depName: string ): string { return manifest.optionalDependencies?.[depName] ?? manifest.dependencies?.[depName] ?? manifest.devDependencies?.[depName] ?? manifest.peerDependencies?.[depName] ?? '' } ```
/content/code_sandbox/pkg-manifest/manifest-utils/src/getSpecFromPackageManifest.ts
xml
2016-01-28T07:40:43
2024-08-16T12:38:47
pnpm
pnpm/pnpm
28,869
97
```xml import { BlockPickerOption } from '../BlockPickerPlugin/BlockPickerOption' import { LexicalEditor } from 'lexical' import { INSERT_TABLE_COMMAND } from '@lexical/table' import { LexicalIconName } from '@/Components/Icon/LexicalIcons' export function GetTableBlockOption(onSelect: () => void) { return new BlockPickerOption('Table', { iconName: 'table' as LexicalIconName, keywords: ['table', 'grid', 'spreadsheet', 'rows', 'columns'], onSelect: onSelect, }) } export function GetDynamicTableBlocks(editor: LexicalEditor, queryString: string) { const options: Array<BlockPickerOption> = [] if (queryString == null) { return options } const fullTableRegex = new RegExp(/^([1-9]|10)x([1-9]|10)$/) const partialTableRegex = new RegExp(/^([1-9]|10)x?$/) const fullTableMatch = fullTableRegex.exec(queryString) const partialTableMatch = partialTableRegex.exec(queryString) if (fullTableMatch) { const [rows, columns] = fullTableMatch[0].split('x').map((n: string) => parseInt(n, 10)) options.push( new BlockPickerOption(`${rows}x${columns} Table`, { iconName: 'table', keywords: ['table'], onSelect: () => editor.dispatchCommand(INSERT_TABLE_COMMAND, { columns: String(columns), rows: String(rows) }), }), ) } else if (partialTableMatch) { const rows = parseInt(partialTableMatch[0], 10) options.push( ...Array.from({ length: 5 }, (_, i) => i + 1).map( (columns) => new BlockPickerOption(`${rows}x${columns} Table`, { iconName: 'table', keywords: ['table'], onSelect: () => editor.dispatchCommand(INSERT_TABLE_COMMAND, { columns: String(columns), rows: String(rows) }), }), ), ) } return options } ```
/content/code_sandbox/packages/web/src/javascripts/Components/SuperEditor/Plugins/Blocks/Table.tsx
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
449
```xml import React from 'react'; import { Form } from 'semantic-ui-react'; import { FormInput } from '../..'; export default { title: 'Components/Form Input' }; export const Empty = () => <div className='bg'> <FormInput /> </div>; export const AsFormField = () => <div className='bg'> <Form> <Form.Input label='Username' as={FormInput} /> </Form> </div>; ```
/content/code_sandbox/packages/ui/stories/components/input.stories.tsx
xml
2016-09-22T22:58:21
2024-08-16T15:47:39
nuclear
nukeop/nuclear
11,862
96
```xml <?xml version="1.0" encoding="UTF-8"?> <definitions id="definitions" xmlns="path_to_url" targetNamespace="Examples"> <process id="changeStateForEventSubProcess"> <startEvent id="theStart"/> <sequenceFlow sourceRef="theStart" targetRef="processTask"/> <userTask id="processTask" name="processTask"/> <sequenceFlow sourceRef="processTask" targetRef="subProcess"/> <boundaryEvent id="spawnParallelTask" attachedToRef="processTask" cancelActivity="false"> <timerEventDefinition> <timeDuration>PT15M</timeDuration> </timerEventDefinition> </boundaryEvent> <sequenceFlow sourceRef="spawnParallelTask" targetRef="parallelTask"/> <userTask id="parallelTask" name="parallelTask"/> <sequenceFlow sourceRef="parallelTask" targetRef="theEnd"/> <endEvent id="theEnd"/> <subProcess id="subProcess"> <startEvent id="subProcessStart"/> <sequenceFlow sourceRef="subProcessStart" targetRef="subProcessTask"/> <userTask id="subProcessTask"/> <sequenceFlow sourceRef="subProcessTask" targetRef="subProcessEnd"/> <endEvent id="subProcessEnd"/> <subProcess id="timerEventSubProcess" triggeredByEvent="true"> <startEvent id="timerEventSubProcessStart" isInterrupting="false"> <timerEventDefinition> <timeCycle>R/PT15M</timeCycle> </timerEventDefinition> </startEvent> <sequenceFlow sourceRef="timerEventSubProcessStart" targetRef="timerEventSubProcessTask"/> <userTask id="timerEventSubProcessTask"/> <sequenceFlow sourceRef="timerEventSubProcessTask" targetRef="eventSubProcessEnd"/> <endEvent id="eventSubProcessEnd"/> </subProcess> </subProcess> </process> </definitions> ```
/content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/api/runtime/changestate/RuntimeServiceChangeStateTest.TimerParallelNestedNonInterruptingTimerEventSubProcess.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
431
```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 isArray = require( './index' ); // TESTS // // The function returns a boolean... { isArray( {} ); // $ExpectType boolean isArray( [] ); // $ExpectType boolean } // The compiler throws an error if the function is provided an unsupported number of arguments... { isArray(); // $ExpectError isArray( [], 123 ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/assert/is-array/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
133
```xml // *** WARNING: this file was generated by test. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; import * as utilities from "./utilities"; import * as pulumiKubernetes from "@pulumi/kubernetes"; export class Component extends pulumi.ComponentResource { /** @internal */ public static readonly __pulumiType = 'foo:index:Component'; /** * Returns true if the given object is an instance of Component. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is Component { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Component.__pulumiType; } public readonly eniConfig!: pulumi.Output<{[key: string]: outputs.crd.k8s.amazonaws.com.v1alpha1.ENIConfigSpec} | undefined>; public readonly pod!: pulumi.Output<pulumiKubernetes.types.output.core.v1.Pod | undefined>; /** * Create a Component resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: ComponentArgs, opts?: pulumi.ComponentResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (!opts.id) { resourceInputs["eniConfig"] = args ? args.eniConfig : undefined; resourceInputs["pod"] = args ? args.pod : undefined; } else { resourceInputs["eniConfig"] = undefined /*out*/; resourceInputs["pod"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Component.__pulumiType, name, resourceInputs, opts, true /*remote*/); } } /** * The set of arguments for constructing a Component resource. */ export interface ComponentArgs { eniConfig?: pulumi.Input<{[key: string]: pulumi.Input<inputs.crd.k8s.amazonaws.com.v1alpha1.ENIConfigSpecArgs>}>; pod?: pulumi.Input<pulumiKubernetes.types.input.core.v1.Pod>; } ```
/content/code_sandbox/tests/testdata/codegen/embedded-crd-types/nodejs/component.ts
xml
2016-10-31T21:02:47
2024-08-16T19:47:04
pulumi
pulumi/pulumi
20,743
538
```xml import * as React from "rehackt"; import type * as ReactTypes from "react"; import type { DocumentNode } from "graphql"; import hoistNonReactStatics from "hoist-non-react-statics"; import { parser } from "../parser/index.js"; import type { BaseQueryOptions } from "../types/types.js"; import { Query } from "../components/index.js"; import { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip, } from "./hoc-utils.js"; import type { OperationOption, OptionProps, DataProps } from "./types.js"; /** * @deprecated * Official support for React Apollo higher order components ended in March 2020. * This library is still included in the `@apollo/client` package, but it no longer receives feature updates or bug fixes. */ export function withQuery< TProps extends TGraphQLVariables | Record<string, any> = Record<string, any>, TData extends object = {}, TGraphQLVariables extends object = {}, TChildProps extends object = DataProps<TData, TGraphQLVariables>, >( document: DocumentNode, operationOptions: OperationOption< TProps, TData, TGraphQLVariables, TChildProps > = {} ) { // this is memoized so if coming from `graphql` there is nearly no extra cost const operation = parser(document); // extract options const { options = defaultMapPropsToOptions, skip = defaultMapPropsToSkip, alias = "Apollo", } = operationOptions; let mapPropsToOptions = options as (props: any) => BaseQueryOptions; if (typeof mapPropsToOptions !== "function") { mapPropsToOptions = () => options as BaseQueryOptions; } let mapPropsToSkip = skip as (props: any) => boolean; if (typeof mapPropsToSkip !== "function") { mapPropsToSkip = () => skip as any; } // allow for advanced referential equality checks let lastResultProps: TChildProps | void; return ( WrappedComponent: ReactTypes.ComponentType<TProps & TChildProps> ): ReactTypes.ComponentClass<TProps> => { const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`; class GraphQL extends GraphQLBase<TProps, TChildProps> { static displayName = graphQLDisplayName; static WrappedComponent = WrappedComponent; render() { let props = this.props; const shouldSkip = mapPropsToSkip(props); const opts = shouldSkip ? Object.create(null) : { ...mapPropsToOptions(props) }; if (!shouldSkip && !opts.variables && operation.variables.length > 0) { opts.variables = calculateVariablesFromProps(operation, props); } return ( <Query {...opts} displayName={graphQLDisplayName} skip={shouldSkip} query={document} > {({ client: _, data, ...r }: any) => { if (operationOptions.withRef) { this.withRef = true; props = Object.assign({}, props, { ref: this.setWrappedInstance, }); } // if we have skipped, no reason to manage any reshaping if (shouldSkip) { return ( <WrappedComponent {...(props as TProps)} {...({} as TChildProps)} /> ); } // the HOC's historically hoisted the data from the execution result // up onto the result since it was passed as a nested prop // we massage the Query components shape here to replicate that const result = Object.assign(r, data || {}); const name = operationOptions.name || "data"; let childProps = { [name]: result }; if (operationOptions.props) { const newResult: OptionProps<TProps, TData, TGraphQLVariables> = { [name]: result, ownProps: props as TProps, }; lastResultProps = operationOptions.props( newResult, lastResultProps ); childProps = lastResultProps; } return ( <WrappedComponent {...(props as TProps)} {...(childProps as TChildProps)} /> ); }} </Query> ); } } // Make sure we preserve any custom statics on the original component. return hoistNonReactStatics(GraphQL, WrappedComponent, {}); }; } ```
/content/code_sandbox/src/react/hoc/query-hoc.tsx
xml
2016-02-26T20:25:00
2024-08-16T10:56:57
apollo-client
apollographql/apollo-client
19,304
967
```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. --> <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.thingsboard</groupId> <version>3.7.1-SNAPSHOT</version> <artifactId>msa</artifactId> </parent> <groupId>org.thingsboard.msa</groupId> <artifactId>monitoring</artifactId> <packaging>pom</packaging> <name>ThingsBoard Monitoring Microservice</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <main.dir>${basedir}/../..</main.dir> <pkg.name>tb-monitoring</pkg.name> <docker.name>tb-monitoring</docker.name> <pkg.logFolder>/var/log/${pkg.name}</pkg.logFolder> <pkg.installFolder>/usr/share/${pkg.name}</pkg.installFolder> <docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase> </properties> <dependencies> <dependency> <groupId>org.thingsboard</groupId> <artifactId>monitoring</artifactId> <version>${project.version}</version> <classifier>deb</classifier> <type>deb</type> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-tb-monitoring-deb</id> <phase>package</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.thingsboard</groupId> <artifactId>monitoring</artifactId> <classifier>deb</classifier> <type>deb</type> <destFileName>${pkg.name}.deb</destFileName> <outputDirectory>${project.build.directory}</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-docker-config</id> <phase>process-resources</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}</outputDirectory> <resources> <resource> <directory>docker</directory> <filtering>true</filtering> </resource> </resources> </configuration> </execution> </executions> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <executions> <execution> <id>build-docker-image</id> <phase>pre-integration-test</phase> <goals> <goal>build</goal> </goals> <configuration> <skip>${dockerfile.skip}</skip> <repository>${docker.repo}/${docker.name}</repository> <verbose>true</verbose> <googleContainerRegistryEnabled>false</googleContainerRegistryEnabled> <contextDirectory>${project.build.directory}</contextDirectory> </configuration> </execution> <execution> <id>tag-docker-image</id> <phase>pre-integration-test</phase> <goals> <goal>tag</goal> </goals> <configuration> <skip>${dockerfile.skip}</skip> <repository>${docker.repo}/${docker.name}</repository> <tag>${project.version}</tag> </configuration> </execution> </executions> </plugin> </plugins> </build> <profiles> <profile> <id>push-docker-image</id> <activation> <property> <name>push-docker-image</name> </property> </activation> <build> <plugins> <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <executions> <execution> <id>push-latest-docker-image</id> <phase>pre-integration-test</phase> <goals> <goal>push</goal> </goals> <configuration> <tag>latest</tag> <repository>${docker.repo}/${docker.name}</repository> </configuration> </execution> <execution> <id>push-version-docker-image</id> <phase>pre-integration-test</phase> <goals> <goal>push</goal> </goals> <configuration> <tag>${project.version}</tag> <repository>${docker.repo}/${docker.name}</repository> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> <repositories> <repository> <id>jenkins</id> <name>Jenkins Repository</name> <url>path_to_url <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> </project> ```
/content/code_sandbox/msa/monitoring/pom.xml
xml
2016-12-01T09:33:30
2024-08-16T19:58:25
thingsboard
thingsboard/thingsboard
16,820
1,265
```xml import clsx from 'clsx'; import { Fragment } from 'react'; import { Taint } from 'kubernetes-types/core/v1'; import { nodeAffinityValues } from '@/kubernetes/filters/application'; import { useAuthorizations } from '@/react/hooks/useUser'; import { Affinity, Label, NodePlacementRowData } from '../types'; interface SubRowProps { node: NodePlacementRowData; cellCount: number; } export function SubRow({ node, cellCount }: SubRowProps) { const { authorized } = useAuthorizations( 'K8sApplicationErrorDetailsR', undefined, true ); if (!authorized) { <> {isDefined(node.unmetTaints) && ( <tr className={clsx({ 'datatable-highlighted': node.highlighted, 'datatable-unhighlighted': !node.highlighted, })} > <td colSpan={cellCount}> Placement constraint not respected for that node. </td> </tr> )} {(isDefined(node.unmatchedNodeSelectorLabels) || isDefined(node.unmatchedNodeAffinities)) && ( <tr className={clsx({ 'datatable-highlighted': node.highlighted, 'datatable-unhighlighted': !node.highlighted, })} > <td colSpan={cellCount}> Placement label not respected for that node. </td> </tr> )} </>; } return ( <> {isDefined(node.unmetTaints) && ( <UnmetTaintsInfo taints={node.unmetTaints} cellCount={cellCount} isHighlighted={node.highlighted} /> )} {isDefined(node.unmatchedNodeSelectorLabels) && ( <UnmatchedLabelsInfo labels={node.unmatchedNodeSelectorLabels} cellCount={cellCount} isHighlighted={node.highlighted} /> )} {isDefined(node.unmatchedNodeAffinities) && ( <UnmatchedAffinitiesInfo affinities={node.unmatchedNodeAffinities} cellCount={cellCount} isHighlighted={node.highlighted} /> )} </> ); } function isDefined<T>(arr?: Array<T>): arr is Array<T> { return !!arr && arr.length > 0; } function UnmetTaintsInfo({ taints, isHighlighted, cellCount, }: { taints: Array<Taint>; isHighlighted: boolean; cellCount: number; }) { return ( <> {taints.map((taint) => ( <tr className={clsx({ 'datatable-highlighted': isHighlighted, 'datatable-unhighlighted': !isHighlighted, })} key={taint.key} > <td colSpan={cellCount}> This application is missing a toleration for the taint <code className="space-left"> {taint.key} {taint.value ? `=${taint.value}` : ''}:{taint.effect} </code> </td> </tr> ))} </> ); } function UnmatchedLabelsInfo({ labels, isHighlighted, cellCount, }: { labels: Array<Label>; isHighlighted: boolean; cellCount: number; }) { return ( <> {labels.map((label) => ( <tr className={clsx({ 'datatable-highlighted': isHighlighted, 'datatable-unhighlighted': !isHighlighted, })} key={label.key} > <td colSpan={cellCount}> This application can only be scheduled on a node where the label{' '} <code>{label.key}</code> is set to <code>{label.value}</code> </td> </tr> ))} </> ); } function UnmatchedAffinitiesInfo({ affinities, isHighlighted, cellCount, }: { affinities: Array<Affinity>; isHighlighted: boolean; cellCount: number; }) { return ( <> <tr className={clsx({ 'datatable-highlighted': isHighlighted, 'datatable-unhighlighted': !isHighlighted, })} > <td colSpan={cellCount}> This application can only be scheduled on nodes respecting one of the following labels combination: </td> </tr> {affinities.map((aff) => ( <tr className={clsx({ 'datatable-highlighted': isHighlighted, 'datatable-unhighlighted': !isHighlighted, })} key={aff.map((term) => term.key).join('')} > <td /> <td colSpan={cellCount - 1}> {aff.map((term, index) => ( <Fragment key={index}> <code> {term.key} {term.operator}{' '} {nodeAffinityValues(term.values, term.operator)} </code> <span>{index === aff.length - 1 ? '' : ' + '}</span> </Fragment> ))} </td> </tr> ))} </> ); } ```
/content/code_sandbox/app/react/kubernetes/applications/DetailsView/PlacementsDatatable/PlacementsDatatableSubRow.tsx
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
1,131
```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="pl" original="../LocalizableStrings.resx"> <body> <trans-unit id="AppFullName"> <source>.NET SDK Check Command</source> <target state="translated">Polecenie sprawdzania zestawu .NET SDK</target> <note /> </trans-unit> <trans-unit id="AppDescription"> <source>Check for SDK updates.</source> <target state="translated">Sprawd dostpno aktualizacji zestawu SDK.</target> <note /> </trans-unit> <trans-unit id="BundleUpToDateMessage"> <source>Up to date.</source> <target state="translated">Aktualne.</target> <note /> </trans-unit> <trans-unit id="CommandFooter"> <source>The latest versions of .NET can be installed from path_to_url For more information about .NET lifecycles, see path_to_url <target state="translated">Najnowsze wersje platformy .NET mona zainstalowa ze strony path_to_url Wicej informacji o cyklach ycia platformy .NET mona znale na stronie path_to_url <note /> </trans-unit> <trans-unit id="HostFxrCouldNotBeLoaded"> <source>Could not load hostfxr from '{0}'.</source> <target state="translated">Nie mona zaadowa pliku hostfxr z lokalizacji {0}.</target> <note /> </trans-unit> <trans-unit id="MaintenanceMessage"> <source>.NET {0} is going out of support soon.</source> <target state="translated">Platforma .NET {0} wkrtce przestanie by wspierana.</target> <note /> </trans-unit> <trans-unit id="NameColumnHeader"> <source>Name</source> <target state="translated">Nazwa</target> <note /> </trans-unit> <trans-unit id="NewFeatureBandMessage"> <source>Try out the newest .NET SDK features with .NET {0}.</source> <target state="translated">Wyprbuj najnowsze funkcje zestawu .NET SDK, uywajc platformy .NET {0}.</target> <note /> </trans-unit> <trans-unit id="NewPatchAvailableMessage"> <source>Patch {0} is available.</source> <target state="translated">Poprawka {0} jest dostpna.</target> <note /> </trans-unit> <trans-unit id="OutOfSupportMessage"> <source>.NET {0} is out of support.</source> <target state="translated">Platforma .NET {0} nie jest ju wspierana.</target> <note /> </trans-unit> <trans-unit id="VersionCheckFailure"> <source>No version found to check if this is up to date. Please check for updates manually.</source> <target state="translated">Nie znaleziono wersji do sprawdzenia, czy jest ona aktualna. Sprawd aktualizacje rcznie.</target> <note /> </trans-unit> <trans-unit id="ReleasesLibraryFailed"> <source>Unable to get releases information: {0}</source> <target state="translated">Nie mona uzyska informacji o wersjach: {0}</target> <note /> </trans-unit> <trans-unit id="RuntimePropertyNotFound"> <source>Runtime property 'HOSTFXR_PATH' was not set or empty.</source> <target state="translated">Waciwo rodowiska uruchomieniowego HOSTFXR_PATH nie zostaa okrelona lub jest pusta.</target> <note /> </trans-unit> <trans-unit id="RuntimeSectionHeader"> <source>.NET Runtimes:</source> <target state="translated">rodowiska uruchomieniowe platformy .NET:</target> <note /> </trans-unit> <trans-unit id="SdkSectionHeader"> <source>.NET SDKs:</source> <target state="translated">Zestawy .NET SDK:</target> <note /> </trans-unit> <trans-unit id="StatusColumnHeader"> <source>Status</source> <target state="translated">Stan</target> <note /> </trans-unit> <trans-unit id="VersionColumnHeader"> <source>Version</source> <target state="translated">Wersja</target> <note /> </trans-unit> </body> </file> </xliff> ```
/content/code_sandbox/src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.pl.xlf
xml
2016-07-22T21:26:02
2024-08-16T17:23:58
sdk
dotnet/sdk
2,627
1,124
```xml import { isDate, isString } from '@antv/util'; function toTimeStamp(value) { if (isString(value)) { if (value.indexOf('T') > 0) { value = new Date(value).getTime(); } else { // new Date('2010/01/10') new Date('2010-01-10') : // : Fri Jan 10 2020 02:40:13 GMT+0800 () // Sun Jan 10 2010 08:00:00 GMT+0800 () value = new Date(value.replace(/-/gi, '/')).getTime(); } } if (isDate(value)) { value = value.getTime(); } return value; } function isInBBox(bbox, point) { // const { minX, maxX, minY, maxY } = bbox; const { left, top, width, height } = bbox; const minX = left; const maxX = left + width; const minY = top; const maxY = top + height; const { x, y } = point; return minX <= x && maxX >= x && minY <= y && maxY >= y; } export { toTimeStamp, isInBBox }; ```
/content/code_sandbox/packages/f2/src/util/index.ts
xml
2016-08-29T06:26:23
2024-08-16T15:50:14
F2
antvis/F2
7,877
265
```xml export enum FormStates { IDLE = 'idle', LOADING = 'loading', SUCCESS = 'success', ERRORED = 'errored', } ```
/content/code_sandbox/apps/expo-go/src/constants/FormStates.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
36
```xml import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; import {MySocketService} from "../services/MySocketService"; @Controller("/") export class MyCtrl { constructor(private mySocketService: MySocketService) {} @Get("/allo") allo() { this.mySocketService.helloAll(); return "is sent"; } } ```
/content/code_sandbox/docs/tutorials/snippets/socketio/socket-service-di.ts
xml
2016-02-21T18:38:47
2024-08-14T21:19:48
tsed
tsedio/tsed
2,817
83
```xml /// <reference types="node" /> import net from 'net'; import http from 'http'; import https from 'https'; import { Duplex } from 'stream'; import { EventEmitter } from 'events'; declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent; declare namespace createAgent { interface ClientRequest extends http.ClientRequest { _last?: boolean; _hadError?: boolean; method: string; } interface AgentRequestOptions { host?: string; path?: string; port: number; } interface HttpRequestOptions extends AgentRequestOptions, Omit<http.RequestOptions, keyof AgentRequestOptions> { secureEndpoint: false; } interface HttpsRequestOptions extends AgentRequestOptions, Omit<https.RequestOptions, keyof AgentRequestOptions> { secureEndpoint: true; } type RequestOptions = HttpRequestOptions | HttpsRequestOptions; type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent; type AgentCallbackReturn = Duplex | AgentLike; type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void; type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>; type AgentCallback = typeof Agent.prototype.callback; type AgentOptions = { timeout?: number; }; /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends EventEmitter { timeout: number | null; maxFreeSockets: number; maxTotalSockets: number; maxSockets: number; sockets: { [key: string]: net.Socket[]; }; freeSockets: { [key: string]: net.Socket[]; }; requests: { [key: string]: http.IncomingMessage[]; }; options: https.AgentOptions; private promisifiedCallback?; private explicitDefaultPort?; private explicitProtocol?; constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions); get defaultPort(): number; set defaultPort(v: number); get protocol(): string; set protocol(v: string); callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void; callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>; /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req: ClientRequest, _opts: RequestOptions): void; freeSocket(socket: net.Socket, opts: AgentOptions): void; destroy(): void; } } export = createAgent; ```
/content/code_sandbox/node_modules/agent-base/dist/src/index.d.ts
xml
2016-03-11T09:28:00
2024-08-16T17:55:54
antSword
AntSwordProject/antSword
3,579
667
```xml <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent"> <io.github.javiewer.view.PinchImageView android:id="@+id/image" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:adjustViewBounds="true" android:scaleType="fitCenter" /> <ProgressBar android:id="@+id/progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> <TextView android:id="@+id/gallery_text_error" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="" android:textColor="@android:color/holo_red_dark" android:textSize="16sp" android:visibility="gone" /> </FrameLayout> ```
/content/code_sandbox/app/src/main/res/layout/content_gallery.xml
xml
2016-05-21T08:47:10
2024-08-14T04:13:43
JAViewer
SplashCodes/JAViewer
4,597
230
```xml import * as pulumi from "@pulumi/pulumi"; import * as config from "@pulumi/config"; const prov = new config.Provider("prov", { name: "my config", pluginDownloadURL: "not the same as the pulumi resource option", }); // Note this isn't _using_ the explicit provider, it's just grabbing a value from it. const res = new config.Resource("res", {text: prov.version}); export const pluginDownloadURL = prov.pluginDownloadURL; ```
/content/code_sandbox/sdk/nodejs/cmd/pulumi-language-nodejs/testdata/tsc/projects/l2-resource-config/index.ts
xml
2016-10-31T21:02:47
2024-08-16T19:47:04
pulumi
pulumi/pulumi
20,743
102
```xml import { StyleSheet } from 'react-native'; import { useColorMode } from '@docusaurus/theme-common'; export const RADIUS = 100; const lightStyles = StyleSheet.create({ circle: { backgroundColor: 'var(--swm-purple-light-100)', border: '8px solid var(--swm-purple-light-80)', }, }); const darkStyles = StyleSheet.create({ circle: { backgroundColor: 'var(--swm-purple-light-100)', border: '8px solid var(--swm-purple-dark-100)', }, }); export const useStylesForExample = () => { return useColorMode().colorMode === 'dark' ? darkStyles : lightStyles; }; export function isInsideCircle(offsetX, offsetY, centerX?, centerY?) { if (centerX !== undefined && centerY !== undefined) { const dx = offsetX - centerX; const dy = offsetY - centerY; return dx * dx + dy * dy <= RADIUS * RADIUS; } else { return offsetX * offsetX + offsetY * offsetY <= RADIUS * RADIUS; } } ```
/content/code_sandbox/docs/src/components/GestureExamples/utils.tsx
xml
2016-10-27T08:31:38
2024-08-16T12:03:40
react-native-gesture-handler
software-mansion/react-native-gesture-handler
5,989
230
```xml <?xml version="1.0" encoding="UTF-8"?> <definitions id="taskListenerExample" xmlns="path_to_url" xmlns:activiti="path_to_url" targetNamespace="Examples"> <process id="businessKeyProcess" name="Update business key Example"> <extensionElements> <activiti:executionListener event="start" class="org.activiti.engine.test.api.runtime.ProcessInstanceUpdateBusinessKeyTest$UpdateBusinessKeyExecutionListener" /> </extensionElements> <startEvent id="theStart" /> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="task1" /> <userTask id="task1" activiti:assignee="kermit"/> <sequenceFlow id="flow2" sourceRef="task1" targetRef="task2" /> <userTask id="task2" /> <sequenceFlow id="flow3" sourceRef="task2" targetRef="theEnd" /> <endEvent id="theEnd" /> </process> </definitions> ```
/content/code_sandbox/modules/flowable5-test/src/test/resources/org/activiti/engine/test/api/runtime/ProcessInstanceUpdateBusinessKeyTest.testProcessInstanceUpdateBusinessKey.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
236
```xml import {htmlEscape} from 'escape-goat'; export async function initPdfViewer() { const els = document.querySelectorAll('.pdf-content'); if (!els.length) return; const pdfobject = await import(/* webpackChunkName: "pdfobject" */'pdfobject'); for (const el of els) { const src = el.getAttribute('data-src'); const fallbackText = el.getAttribute('data-fallback-button-text'); pdfobject.embed(src, el, { fallbackLink: htmlEscape` <a role="button" class="ui basic button pdf-fallback-button" href="[url]">${fallbackText}</a> `, }); el.classList.remove('is-loading'); } } ```
/content/code_sandbox/web_src/js/render/pdf.ts
xml
2016-11-01T02:13:26
2024-08-16T19:51:49
gitea
go-gitea/gitea
43,694
150
```xml import { Component } from '@angular/core'; @Component({ selector: 'app-rtl-guide', templateUrl: './rtl-guide.component.html', styleUrls: ['./rtl-guide.component.scss'] }) export class RtlGuideComponent { html = `<tree-root [focused]="true" [nodes]="nodes" [options]="options"></tree-root>`; javascript = ` options = { rtl: true }; `; } ```
/content/code_sandbox/projects/docs-app/src/app/guides/rtl-guide/rtl-guide.component.ts
xml
2016-03-10T21:29:15
2024-08-15T07:07:30
angular-tree-component
CirclonGroup/angular-tree-component
1,093
86
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug-Dynamic|ARM"> <Configuration>Debug-Dynamic</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug-Dynamic|ARM64"> <Configuration>Debug-Dynamic</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug-Dynamic|Win32"> <Configuration>Debug-Dynamic</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug-Dynamic|x64"> <Configuration>Debug-Dynamic</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug-Static|ARM"> <Configuration>Debug-Static</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug-Static|ARM64"> <Configuration>Debug-Static</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug-Static|Win32"> <Configuration>Debug-Static</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug-Static|x64"> <Configuration>Debug-Static</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|ARM"> <Configuration>Debug</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|ARM64"> <Configuration>Debug</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Dynamic|ARM"> <Configuration>Release-Dynamic</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Dynamic|ARM64"> <Configuration>Release-Dynamic</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Dynamic|Win32"> <Configuration>Release-Dynamic</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Dynamic|x64"> <Configuration>Release-Dynamic</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Static|ARM"> <Configuration>Release-Static</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Static|ARM64"> <Configuration>Release-Static</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Static|Win32"> <Configuration>Release-Static</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release-Static|x64"> <Configuration>Release-Static</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|ARM"> <Configuration>Release</Configuration> <Platform>ARM</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|ARM64"> <Configuration>Release</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <!-- Import common config --> <Import Project="..\..\..\build\vs\pjproject-vs14-common-config.props" /> <PropertyGroup Label="Globals"> <ProjectGuid>{F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}</ProjectGuid> <RootNamespace>libsrtp</RootNamespace> <Keyword>Win32Proj</Keyword> <!-- Specific UWP property --> <DefaultLanguage>en-US</DefaultLanguage> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <!-- Override the PlatformToolset --> <PropertyGroup> <PlatformToolset>$(BuildToolset)</PlatformToolset> <CharacterSet Condition="'$(API_Family)'!='WinDesktop'"> </CharacterSet> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win32-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win32-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win32-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win32-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win32-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win32-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win64-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm64-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win64-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm64-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win64-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm64-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win64-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm64-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win64-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm64-common-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-win64-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\..\build\vs\pjproject-vs14-arm64-release-defaults.props" /> <Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <_ProjectFileVersion>14.0.22823.1</_ProjectFileVersion> <OutDir>..\..\lib\</OutDir> </PropertyGroup> <!-- Compile and link option definition --> <ItemDefinitionGroup> <ClCompile> <RuntimeLibrary Condition="'$(API_Family)'=='UWP'">MultiThreadedDebugDLL</RuntimeLibrary> </ClCompile> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Midl> <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <Midl /> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Midl> <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <Midl /> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'"> <Midl> <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'"> <Midl /> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'"> <Midl> <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'"> <Midl /> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'"> <Midl> <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'"> <Midl /> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'"> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'"> <Midl> <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile /> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'"> <Midl /> <ClCompile> <AdditionalIncludeDirectories>.;../../srtp/include;../../srtp/crypto/include;../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile> </ClCompile> <Lib> <OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile> </Lib> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\srtp\crypto\cipher\aes.c" /> <ClCompile Include="..\..\srtp\crypto\cipher\aes_gcm_ossl.c"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\srtp\crypto\cipher\aes_icm.c" /> <ClCompile Include="..\..\srtp\crypto\cipher\aes_icm_ossl.c"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\srtp\crypto\cipher\cipher.c" /> <ClCompile Include="..\..\srtp\crypto\cipher\cipher_test_cases.c" /> <ClCompile Include="..\..\srtp\crypto\cipher\null_cipher.c" /> <ClCompile Include="..\..\srtp\crypto\hash\auth.c" /> <ClCompile Include="..\..\srtp\crypto\hash\auth_test_cases.c" /> <ClCompile Include="..\..\srtp\crypto\hash\hmac.c" /> <ClCompile Include="..\..\srtp\crypto\hash\hmac_ossl.c"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'">true</ExcludedFromBuild> </ClCompile> <ClCompile Include="..\..\srtp\crypto\hash\null_auth.c" /> <ClCompile Include="..\..\srtp\crypto\hash\sha1.c" /> <ClCompile Include="..\..\srtp\crypto\kernel\alloc.c" /> <ClCompile Include="..\..\srtp\crypto\kernel\crypto_kernel.c"> <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> </DisableSpecificWarnings> </ClCompile> <ClCompile Include="..\..\srtp\crypto\kernel\key.c" /> <ClCompile Include="..\..\srtp\crypto\math\datatypes.c" /> <ClCompile Include="..\..\srtp\crypto\replay\rdb.c" /> <ClCompile Include="..\..\srtp\crypto\replay\rdbx.c" /> <ClCompile Include="..\..\srtp\pjlib\srtp_err.c" /> <ClCompile Include="..\..\srtp\srtp\srtp.c" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\srtp\crypto\include\aes.h" /> <ClInclude Include="..\..\srtp\crypto\include\aes_icm.h" /> <ClInclude Include="..\..\srtp\crypto\include\alloc.h" /> <ClInclude Include="..\..\srtp\crypto\include\auth.h" /> <ClInclude Include="..\..\srtp\crypto\include\cipher.h" /> <ClInclude Include="..\..\srtp\crypto\include\crypto_kernel.h" /> <ClInclude Include="..\..\srtp\crypto\include\crypto_types.h" /> <ClInclude Include="..\..\srtp\crypto\include\datatypes.h" /> <ClInclude Include="..\..\srtp\crypto\include\err.h" /> <ClInclude Include="..\..\srtp\crypto\include\hmac.h" /> <ClInclude Include="..\..\srtp\crypto\include\integers.h" /> <ClInclude Include="..\..\srtp\crypto\include\key.h" /> <ClInclude Include="..\..\srtp\crypto\include\null_auth.h" /> <ClInclude Include="..\..\srtp\crypto\include\null_cipher.h" /> <ClInclude Include="..\..\srtp\crypto\include\rdb.h" /> <ClInclude Include="..\..\srtp\crypto\include\rdbx.h" /> <ClInclude Include="..\..\srtp\crypto\include\sha1.h" /> <ClInclude Include="..\..\srtp\crypto\include\stat.h" /> <ClInclude Include="..\..\srtp\include\ekt.h" /> <ClInclude Include="..\..\srtp\include\srtp.h" /> <ClInclude Include="..\..\srtp\include\ut_sim.h" /> <ClInclude Include="srtp_config.h" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project> ```
/content/code_sandbox/third_party/build/srtp/libsrtp.vcxproj
xml
2016-01-24T05:00:33
2024-08-16T03:31:21
pjproject
pjsip/pjproject
1,960
12,266
```xml <?xml version="1.0" encoding="utf-8"?> Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> <!-- The widget at the tail of the SignInPreference in settings screen to indicate sync error --> <ImageView xmlns:android="path_to_url" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/sync_error" android:contentDescription="@string/sign_in_sync_error_widget"/> ```
/content/code_sandbox/libraries_res/chrome_res/src/main/res/layout/sync_error_widget.xml
xml
2016-07-04T07:28:36
2024-08-15T05:20:42
AndroidChromium
JackyAndroid/AndroidChromium
3,090
112
```xml import { wait } from '@proton/shared/lib/helpers/promise'; import retryOnError from './retryOnError'; jest.mock('@proton/shared/lib/helpers/promise'); const errorMessage = 'STRI-I-I-I-I-I-ING'; describe('retryOnError', () => { let throwingFunction: () => Promise<void>; let throwingFunction2: () => Promise<void>; const mockedWait = jest.mocked(wait); beforeEach(() => { throwingFunction = jest.fn().mockImplementation(() => { throw new Error(errorMessage); }); throwingFunction2 = jest.fn().mockImplementation(() => { throw new Error(errorMessage); }); mockedWait.mockReset(); }); it("runs main function once if there's no error", () => { const runFunction = jest.fn(); void retryOnError({ fn: runFunction, shouldRetryBasedOnError: () => true, maxRetriesNumber: 1000, })(); expect(runFunction).toBeCalledTimes(1); }); it('retries run function n times', async () => { const promise = retryOnError<unknown>({ fn: throwingFunction, shouldRetryBasedOnError: () => true, maxRetriesNumber: 1, })(); await expect(promise).rejects.toThrow(); expect(throwingFunction).toBeCalledTimes(2); expect(retryOnError).toThrow(); }); it('validates incoming error', async () => { const promise = retryOnError<unknown>({ fn: throwingFunction, shouldRetryBasedOnError: (error: unknown) => { return (error as Error).message === errorMessage; }, maxRetriesNumber: 1, })(); await expect(promise).rejects.toThrow(); expect(throwingFunction).toBeCalledTimes(2); const promise2 = retryOnError<unknown>({ fn: throwingFunction2, shouldRetryBasedOnError: (error: unknown) => { return (error as Error).message === 'another string'; }, maxRetriesNumber: 1, })(); expect(throwingFunction2).toBeCalledTimes(1); await expect(promise2).rejects.toThrow(); }); it('executes preparation function on retry', async () => { const preparationFunction = jest.fn(); const promise = retryOnError<unknown>({ fn: throwingFunction, shouldRetryBasedOnError: (error: unknown) => { return (error as Error).message === errorMessage; }, beforeRetryCallback: preparationFunction, maxRetriesNumber: 1, })(); expect(preparationFunction).toBeCalledTimes(1); await expect(promise).rejects.toThrow(); }); it('returns value on successful retry attempt', async () => { const returnValue = Symbol('returnValue'); let execCount = 0; const runFunc = jest.fn().mockImplementation(() => { if (execCount > 1) { return Promise.resolve(returnValue); } execCount++; throw new Error(); }); const result = await retryOnError<unknown>({ fn: runFunc, shouldRetryBasedOnError: () => true, maxRetriesNumber: 2, })().catch(() => {}); expect(result).toBe(returnValue); }); it('retries run function n times with backoff', async () => { const promise = retryOnError<unknown>({ fn: throwingFunction, shouldRetryBasedOnError: () => true, maxRetriesNumber: 4, backoff: true, })(); await expect(promise).rejects.toThrow(); expect(retryOnError).toThrow(); expect(mockedWait.mock.calls.flat()).toEqual([30000, 60000, 90000, 150000]); }); it('retries run function n times with new params', async () => { const params = { params: 1 }; const preparationFunction = jest.fn().mockReturnValueOnce(params); const promise = retryOnError<unknown>({ fn: throwingFunction, shouldRetryBasedOnError: () => true, beforeRetryCallback: preparationFunction, maxRetriesNumber: 1, })(); await expect(promise).rejects.toThrow(); expect(throwingFunction).toHaveBeenCalledWith(params); }); it('retries run function n times with new params and backoff', async () => { const params = { params: 1 }; const preparationFunction = jest.fn().mockReturnValueOnce(params); const promise = retryOnError<unknown>({ fn: throwingFunction, shouldRetryBasedOnError: () => true, beforeRetryCallback: preparationFunction, maxRetriesNumber: 1, backoff: true, })(); await expect(promise).rejects.toThrow(); expect(throwingFunction).toHaveBeenCalledWith(params); expect(mockedWait.mock.calls.flat()).toEqual([30000]); }); }); ```
/content/code_sandbox/packages/drive-store/utils/retryOnError.test.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
1,046
```xml <manifest package="com.waynell.videolist"> <application /> </manifest> ```
/content/code_sandbox/video-list-player/src/main/AndroidManifest.xml
xml
2016-03-18T10:49:00
2024-07-29T02:09:13
VideoListPlayer
waynell/VideoListPlayer
1,330
19
```xml import { ColorSet, prepareColorSet } from './color-set/index.js'; import { BuiltInColorSet, resolveColorSet } from './color-set/all.js'; import type { Template, OutputFile, RenderOptions } from './template/index.js'; import { BuiltInTemplate, resolveTemplate } from './template/all.js'; import { OutputFileTransform, noopTransform } from './transform/index.js'; export async function* themer<T extends { path: string } = OutputFile>( colorSets: (BuiltInColorSet | ColorSet)[], templates: (BuiltInTemplate | Template)[], options: RenderOptions, transform: OutputFileTransform<T> = noopTransform, ): AsyncGenerator<T | OutputFile> { for (const colorSet of colorSets) { const resolvedColorSet = resolveColorSet(colorSet); const fullColorSet = prepareColorSet(resolvedColorSet); const resolvedTemplates = templates.map(resolveTemplate); const instructions: string[] = [`# themer - ${fullColorSet.name}`]; const rootDir = fullColorSet.name; for (const template of resolvedTemplates) { const templatePaths: string[] = []; for await (const renderedFile of template.render(fullColorSet, options)) { for await (const file of transform(renderedFile)) { const path = `${template.name}/${file.path}`; yield { ...file, path: `${rootDir}/${path}`, }; templatePaths.push(path); } } instructions.push(`## ${template.name}`); instructions.push( template.renderInstructions(templatePaths, fullColorSet).trim(), ); } yield { path: `${rootDir}/README.md`, content: instructions.join('\n\n'), }; } } ```
/content/code_sandbox/cli/src/themer.ts
xml
2016-11-21T13:42:28
2024-08-16T10:14:09
themer
themerdev/themer
5,463
372
```xml import { useSubscribeEventManager } from '@proton/components'; import { EVENT_ACTIONS } from '@proton/shared/lib/constants'; import type { Message } from '@proton/shared/lib/interfaces/mail/Message'; import { useMailDispatch } from 'proton-mail/store/hooks'; import { parseLabelIDsInEvent } from '../../helpers/elements'; import type { Conversation } from '../../models/conversation'; import type { Event, LabelIDsChanges } from '../../models/event'; import { eventConversationUpdate, eventDelete, eventMessageUpdate, load as loadAction, } from '../../store/conversations/conversationsActions'; import { useGetConversation } from '../conversation/useConversation'; export const useConversationsEvent = () => { const dispatch = useMailDispatch(); const getConversation = useGetConversation(); useSubscribeEventManager(async ({ Conversations = [], Messages = [] }: Event) => { // Conversation messages event const { toCreate, toUpdate, toDelete } = Messages.reduce<{ toCreate: Message[]; toUpdate: Message[]; toDelete: { [ID: string]: boolean }; }>( ({ toCreate, toUpdate, toDelete }, { ID, Action, Message }) => { const data = Message && getConversation(Message.ConversationID); if (Action === EVENT_ACTIONS.CREATE && data) { toCreate.push(Message as Message); } else if ((Action === EVENT_ACTIONS.UPDATE_DRAFT || Action === EVENT_ACTIONS.UPDATE_FLAGS) && data) { toUpdate.push({ ID, ...(Message as Omit<Message, 'ID'>) }); } else if (Action === EVENT_ACTIONS.DELETE) { toDelete[ID] = true; } return { toCreate, toUpdate, toDelete }; }, { toCreate: [], toUpdate: [], toDelete: {} } ); const isStateEqual = toCreate.length === 0 && toUpdate.length === 0 && Object.keys(toDelete).length === 0; if (!isStateEqual) { void dispatch(eventMessageUpdate({ toCreate, toUpdate, toDelete })); } // Conversation events for (const { ID, Action, Conversation } of Conversations) { const currentConversation = getConversation(ID); if (!currentConversation) { return; } if (Action === EVENT_ACTIONS.DELETE) { void dispatch(eventDelete(ID)); } if ( Action === EVENT_ACTIONS.UPDATE_DRAFT || Action === EVENT_ACTIONS.UPDATE_FLAGS || Action === EVENT_ACTIONS.CREATE ) { // Try to update the conversation from event data without reloading it try { const updatedConversation: Conversation = parseLabelIDsInEvent( currentConversation?.Conversation || ({} as Conversation), Conversation as Conversation & LabelIDsChanges ); dispatch(eventConversationUpdate({ ID, updatedConversation })); } catch (error: any) { console.warn('Something went wrong on updating a conversation from an event.', error); void dispatch(loadAction({ conversationID: ID, messageID: undefined })); } } } }); }; ```
/content/code_sandbox/applications/mail/src/app/hooks/events/useConversationsEvents.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
643
```xml <Project Sdk="Microsoft.NET.Sdk"> <Import Project="..\..\..\buildtools\common.props" /> <PropertyGroup> <Description>Amazon Lambda .NET Core support - Serialization.Json package.</Description> <TargetFramework>netstandard2.0</TargetFramework> <AssemblyTitle>Amazon.Lambda.Serialization.Json</AssemblyTitle> <AssemblyName>Amazon.Lambda.Serialization.Json</AssemblyName> <PackageId>Amazon.Lambda.Serialization.Json</PackageId> <PackageTags>AWS;Amazon;Lambda</PackageTags> <VersionPrefix>2.2.3</VersionPrefix> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\Amazon.Lambda.Core\Amazon.Lambda.Core.csproj" /> </ItemGroup> <ItemGroup> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> </ItemGroup> </Project> ```
/content/code_sandbox/Libraries/src/Amazon.Lambda.Serialization.Json/Amazon.Lambda.Serialization.Json.csproj
xml
2016-11-11T20:43:34
2024-08-15T16:57:53
aws-lambda-dotnet
aws/aws-lambda-dotnet
1,558
196
```xml import { useEffect, useState } from 'react'; import type { DecryptedKey } from '@proton/shared/lib/interfaces'; import { INDEXING_STATUS, defaultESStatus } from './constants'; import { getIndexKey } from './esHelpers'; import { checkVersionedESDB, contentIndexingProgress, metadataIndexingProgress, readEnabled, readLimited, } from './esIDB'; import type { ESCache, ESStatus } from './models'; /** * @returns a tuple composed of both the _esStatus_ and a setter for it */ export const useEncryptedSearchStatus = <ESItemMetadata extends Object, ESSearchParameters, ESItemContent = void>({ esCacheRef, getUserKeys, userID, }: { esCacheRef: React.MutableRefObject<ESCache<ESItemMetadata, ESItemContent>>; getUserKeys: () => Promise<DecryptedKey[]>; userID: string; }): [ ESStatus<ESItemMetadata, ESItemContent, ESSearchParameters>, React.Dispatch<React.SetStateAction<ESStatus<ESItemMetadata, ESItemContent, ESSearchParameters>>>, ] => { const [esStatus, setESStatus] = useState<ESStatus<ESItemMetadata, ESItemContent, ESSearchParameters>>(defaultESStatus); useEffect(() => { const initEsStatus = async () => { try { const esdbExists = await checkVersionedESDB(userID); if (esdbExists) { const indexKey = await getIndexKey(getUserKeys, userID); const esEnabled = await readEnabled(userID); const isDBLimited = await readLimited(userID); const metadataIndexingProgressState = await metadataIndexingProgress.read(userID); const contentIndexingProgressState = await contentIndexingProgress.read(userID); setESStatus((esStatus) => ({ ...esStatus, cachedIndexKey: indexKey, esEnabled: esEnabled ?? false, isDBLimited: isDBLimited ?? false, isMetadataIndexingPaused: metadataIndexingProgressState?.status === INDEXING_STATUS.PAUSED, isContentIndexingPaused: contentIndexingProgressState?.status === INDEXING_STATUS.PAUSED, })); } } catch (error) { console.warn('an error occurred on init es status', error); } /** * We need to set those variables whether we have already existing esdb or not */ setESStatus((esStatus) => ({ ...esStatus, isConfigFromESDBLoaded: true, getCacheStatus: () => ({ isCacheReady: esCacheRef.current.isCacheReady, isCacheLimited: esCacheRef.current.isCacheLimited, }), })); }; void initEsStatus(); }, []); return [esStatus, setESStatus]; }; ```
/content/code_sandbox/packages/encrypted-search/lib/useEncryptedSearchStatus.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
609
```xml <Project Sdk="Microsoft.NET.Sdk"> <Import Project="..\..\..\configureawait.props" /> <Import Project="..\..\..\common.props" /> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> </PropertyGroup> <ItemGroup> <None Remove="Volo.Docs.SourceCode.zip" /> <Content Include="Volo.Docs.SourceCode.zip"> <Pack>true</Pack> <PackagePath>content\</PackagePath> </Content> </ItemGroup> </Project> ```
/content/code_sandbox/studio/source-codes/Volo.Docs.SourceCode/Volo.Docs.SourceCode.csproj
xml
2016-12-03T22:56:24
2024-08-16T16:24:05
abp
abpframework/abp
12,657
119
```xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="path_to_url" xmlns:task="path_to_url" xmlns:mvc="path_to_url" xmlns:xsi="path_to_url" xmlns:p="path_to_url" xmlns:context="path_to_url" xsi:schemaLocation="path_to_url path_to_url path_to_url path_to_url path_to_url path_to_url path_to_url path_to_url"> <task:executor id="executor" pool-size="5" /> <task:scheduler id="scheduler" pool-size="10" /> <task:annotation-driven executor="executor" scheduler="scheduler" /> </beans> ```
/content/code_sandbox/src/main/resources/spring-timer.xml
xml
2016-11-25T10:12:46
2024-08-16T07:26:41
SpringMVC-Mybatis-Shiro-redis-0.2
baichengzhou/SpringMVC-Mybatis-Shiro-redis-0.2
1,787
154
```xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="path_to_url" xmlns:tools="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" android:orientation="vertical" android:paddingBottom="1dp" android:paddingLeft="6dp" android:paddingRight="6dp" android:paddingTop="1dp" tools:context=".KeypadInputActivity" tools:deviceIds="wear_rect"> <TextView android:id="@+id/dialed_no_textview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:fontFamily="sans-serif-condensed" android:gravity="center" android:textColor="@android:color/black" android:textSize="25sp" android:background="@drawable/tick_thing" android:layout_marginRight="5dp" android:layout_marginLeft="5dp" tools:text="25.5 mmol/l" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="0.7" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="horizontal"> <Button android:id="@+id/one_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/one" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/two_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/two" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/three_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/three" android:textColor="@android:color/black" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="horizontal"> <Button android:id="@+id/four_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/four" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/five_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/five" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/six_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/six" android:textColor="@android:color/black" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="horizontal"> <Button android:id="@+id/seven_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/seven" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/eight_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/eight" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/nine_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/nine" android:textColor="@android:color/black" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="horizontal"> <Button android:id="@+id/star_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/dot" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/zero_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/zero" android:textColor="@android:color/black" android:textSize="20sp" /> <Button android:id="@+id/backspace_button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ripple_blue" android:fontFamily="sans-serif-thin" android:text="@string/backarrow" android:textColor="@android:color/black" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="horizontal"> <ImageButton android:layout_width="36dp" android:layout_height="36dp" android:src="@drawable/ic_touch_app_white_48dp" android:scaleType="centerCrop" android:id="@+id/bloodtesttabbutton" /> <ImageButton android:layout_width="36dp" android:layout_height="36dp" android:src="@drawable/ic_local_dining_white_48dp" android:scaleType="centerCrop" android:id="@+id/carbstabbutton" /> <ImageButton android:layout_width="36dp" android:layout_height="36dp" android:src="@drawable/ic_colorize_white_48dp" android:scaleType="centerCrop" android:id="@+id/insulintabbutton" /> <ImageButton android:layout_width="36dp" android:layout_height="36dp" android:src="@drawable/ic_av_timer_white_36dp" android:scaleType="centerCrop" android:id="@+id/timetabbutton" /> </LinearLayout> </LinearLayout> </LinearLayout> ```
/content/code_sandbox/wear/src/main/res/layout/rect_activity_main.xml
xml
2016-09-23T13:33:17
2024-08-15T09:51:19
xDrip
NightscoutFoundation/xDrip
1,365
1,787
```xml export { VBadge } from './VBadge' ```
/content/code_sandbox/packages/vuetify/src/components/VBadge/index.ts
xml
2016-09-12T00:39:35
2024-08-16T20:06:39
vuetify
vuetifyjs/vuetify
39,539
11
```xml <!-- ~ Nextcloud - Android Client ~ --> <vector xmlns:android="path_to_url" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960"> <path android:fillColor="@color/foreground_highlight" android:pathData="M320,760v-560l440,280 -440,280Z"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_global_resume.xml
xml
2016-06-06T21:23:36
2024-08-16T18:22:36
android
nextcloud/android
4,122
95
```xml import clsx from 'clsx'; import type { ReactElement } from 'react'; import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/20/solid'; type Props = Readonly<{ current: number; end: number; label: string; onSelect: (page: number, event: React.MouseEvent<HTMLElement>) => void; pagePadding?: number; start: number; }>; function PaginationPage({ isCurrent = false, label, onClick, }: Readonly<{ isCurrent?: boolean; label: number; onClick: (event: React.MouseEvent<HTMLElement>) => void; }>) { return ( <button aria-current={isCurrent} className={clsx( 'focus:ring-primary-500 focus:border-primary-500 relative inline-flex items-center border px-4 py-2 text-sm font-medium focus:z-20 focus:outline-none focus:ring-1', isCurrent ? 'border-primary-500 bg-primary-50 text-primary-600 z-10' : 'border-slate-300 bg-white text-slate-500 hover:bg-slate-50', )} disabled={isCurrent} type="button" onClick={onClick}> {label} </button> ); } function PaginationEllipsis() { return ( <span className="relative inline-flex items-center border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700"> ... </span> ); } export default function Pagination({ current, end, label, onSelect, pagePadding = 1, start = 1, }: Props) { const pageNumberSet = new Set(); const pageNumberList: Array<number | string> = []; const elements: Array<ReactElement> = []; let lastAddedPage = 0; function addPage(page: number) { if (page < start || page > end) { return; } if (!pageNumberSet.has(page)) { lastAddedPage = page; pageNumberList.push(page); pageNumberSet.add(page); elements.push( <PaginationPage key={page} isCurrent={current === page} label={page} onClick={(event) => { onSelect(page, event); }} />, ); } } for (let i = start; i <= start + pagePadding; i++) { addPage(i); } if (lastAddedPage < current - pagePadding - 1) { elements.push(<PaginationEllipsis key="ellipse-1" />); } for (let i = current - pagePadding; i <= current + pagePadding; i++) { addPage(i); } if (lastAddedPage < end - pagePadding - 1) { elements.push(<PaginationEllipsis key="ellipse-2" />); } for (let i = end - pagePadding; i <= end; i++) { addPage(i); } const isPrevButtonDisabled = current === start; const isNextButtonDisabled = current === end; return ( <nav aria-label={label} className="isolate inline-flex -space-x-px rounded-md shadow-sm"> <button aria-label="Previous" className={clsx( 'relative inline-flex items-center rounded-l-md border border-slate-300 px-2 py-2 text-sm font-medium focus:z-20', isPrevButtonDisabled ? 'text-slate-300' : 'focus:ring-primary-500 focus:border-primary-500 bg-white text-slate-500 hover:bg-slate-50 focus:outline-none focus:ring-1', )} disabled={isPrevButtonDisabled} type="button" onClick={(event) => { onSelect(current - 1, event); }}> <ChevronLeftIcon aria-hidden="true" className="h-5 w-5" /> </button> {elements} <button aria-label="Next" className={clsx( 'relative inline-flex items-center rounded-r-md border border-slate-300 px-2 py-2 text-sm font-medium focus:z-20', isNextButtonDisabled ? 'text-slate-300' : 'focus:ring-primary-500 focus:border-primary-500 bg-white text-slate-500 hover:bg-slate-50 focus:outline-none focus:ring-1', )} disabled={isNextButtonDisabled} type="button" onClick={(event) => { onSelect(current + 1, event); }}> <ChevronRightIcon aria-hidden="true" className="h-5 w-5" /> </button> </nav> ); } ```
/content/code_sandbox/apps/portal/src/ui/Pagination/Pagination.tsx
xml
2016-07-05T05:00:48
2024-08-16T19:01:19
tech-interview-handbook
yangshun/tech-interview-handbook
115,302
1,026
```xml <shapes name="mxgraph.aws.networking"> <shape name="AWS Direct Connect" h="54.61" w="54.61" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0" y="0.5" perimeter="0" name="W"/> <constraint x="1" y="0.5" perimeter="0" name="E"/> <constraint x="0.145" y="0.145" perimeter="0" name="NW"/> <constraint x="0.145" y="0.855" perimeter="0" name="SW"/> <constraint x="0.855" y="0.145" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <background> <path> <move x="27.3" y="0"/> <curve x1="12.23" y1="0" x2="0" y2="12.22" x3="0" y3="27.3"/> <curve x1="0" y1="42.38" x2="12.23" y2="54.61" x3="27.3" y3="54.61"/> <curve x1="42.38" y1="54.61" x2="54.61" y2="42.38" x3="54.61" y3="27.3"/> <curve x1="54.61" y1="12.22" x2="42.38" y2="0" x3="27.3" y3="0"/> <close/> <move x="35.14" y="49.77"/> <line x="19.26" y="25.01"/> <line x="26.72" y="23.76"/> <line x="20.25" y="6.02"/> <line x="36.85" y="30.51"/> <line x="28.86" y="30.66"/> <line x="35.14" y="49.77"/> <close/> </path> </background> <foreground> <fillstroke/> </foreground> </shape> <shape name="Elastic Load Balancer" h="57.33" w="57.33" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0" y="0.5" perimeter="0" name="W"/> <constraint x="1" y="0.5" perimeter="0" name="E"/> <constraint x="0.145" y="0.145" perimeter="0" name="NW"/> <constraint x="0.145" y="0.855" perimeter="0" name="SW"/> <constraint x="0.855" y="0.145" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <background> <path> <move x="28.67" y="0"/> <curve x1="12.83" y1="0" x2="0" y2="12.83" x3="0" y3="28.67"/> <curve x1="0" y1="44.5" x2="12.83" y2="57.33" x3="28.67" y3="57.33"/> <curve x1="44.5" y1="57.33" x2="57.33" y2="44.5" x3="57.33" y3="28.67"/> <curve x1="57.33" y1="12.83" x2="44.5" y2="0" x3="28.67" y3="0"/> <close/> <move x="46.67" y="19.67"/> <line x="37.67" y="19.67"/> <line x="37.67" y="17.88"/> <line x="34.87" y="21.4"/> <line x="33.59" y="19.58"/> <line x="20.9" y="27.67"/> <line x="31.67" y="27.67"/> <line x="31.67" y="25.74"/> <line x="37.67" y="27.99"/> <line x="37.67" y="24.67"/> <line x="46.67" y="24.67"/> <line x="46.67" y="33.67"/> <line x="37.67" y="33.67"/> <line x="37.67" y="30.34"/> <line x="31.67" y="32.59"/> <line x="31.67" y="30.67"/> <line x="20.9" y="30.67"/> <line x="33.7" y="38.75"/> <line x="34.87" y="36.87"/> <line x="37.67" y="40.46"/> <line x="37.67" y="38.67"/> <line x="46.67" y="38.67"/> <line x="46.67" y="47.67"/> <line x="37.67" y="47.67"/> <line x="37.67" y="44.07"/> <line x="31.45" y="42.57"/> <line x="32.3" y="40.77"/> <line x="16.67" y="30.66"/> <line x="16.67" y="36.67"/> <line x="6.67" y="36.67"/> <line x="6.67" y="21.67"/> <line x="16.67" y="21.67"/> <line x="16.67" y="27.68"/> <line x="32.41" y="17.57"/> <line x="31.45" y="15.76"/> <line x="37.67" y="14.26"/> <line x="37.67" y="10.67"/> <line x="46.67" y="10.67"/> <line x="46.67" y="19.67"/> <close/> </path> </background> <foreground> <fillstroke/> </foreground> </shape> <shape name="Route 53" h="56.72" w="60.3" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.51" y="0" perimeter="0" name="N"/> <constraint x="0.517" y="0.995" perimeter="0" name="S"/> <constraint x="0.06" y="0.5" perimeter="0" name="W"/> <constraint x="0.93" y="0.5" perimeter="0" name="E"/> <constraint x="0.02" y="0.215" perimeter="0" name="NW"/> <constraint x="0.13" y="0.855" perimeter="0" name="SW"/> <constraint x="0.96" y="0.195" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <background> <path> <move x="58.75" y="38.98"/> <curve x1="55.95" y1="52.8" x2="42.56" y2="47.21" x3="31.7" y3="56.21"/> <curve x1="31.08" y1="56.72" x2="30.78" y2="56.21" x3="30.78" y3="56.21"/> <curve x1="24.2" y1="48.2" x2="3.9" y2="54.88" x3="1.38" y3="38.98"/> <curve x1="0" y1="30.28" x2="5.22" y2="29.21" x3="5.51" y3="22.67"/> <curve x1="5.74" y1="17.61" x2="1.38" y2="12.1" x3="1.38" y3="12.1"/> <line x="11.03" y="0.39"/> <curve x1="11.03" y1="0.39" x2="20.53" y2="9.98" x3="30.06" y3="0.39"/> <curve x1="30.45" y1="0" x2="31.19" y2="0.28" x3="31.3" y3="0.41"/> <curve x1="40.37" y1="10.75" x2="49.62" y2="0.39" x3="49.62" y3="0.39"/> <line x="57.89" y="11.18"/> <curve x1="57.89" y1="11.18" x2="53.52" y2="16.35" x3="53.75" y3="22.09"/> <curve x1="54.02" y1="28.87" x2="60.3" y2="31.31" x3="58.75" y3="38.98"/> <close/> </path> </background> <foreground> <fillstroke/> </foreground> </shape> <shape name="Route 53 HostedZone" h="54.56" w="58.01" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.51" y="0" perimeter="0" name="N"/> <constraint x="0.517" y="0.995" perimeter="0" name="S"/> <constraint x="0.06" y="0.5" perimeter="0" name="W"/> <constraint x="0.93" y="0.5" perimeter="0" name="E"/> <constraint x="0.02" y="0.215" perimeter="0" name="NW"/> <constraint x="0.13" y="0.855" perimeter="0" name="SW"/> <constraint x="0.96" y="0.195" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <background> <path> <move x="56.51" y="37.49"/> <curve x1="53.83" y1="50.79" x2="40.94" y2="45.42" x3="30.49" y3="54.06"/> <curve x1="29.9" y1="54.56" x2="29.61" y2="54.06" x3="29.61" y3="54.06"/> <curve x1="23.28" y1="46.36" x2="3.75" y2="52.79" x3="1.33" y3="37.49"/> <curve x1="0" y1="29.12" x2="5.02" y2="28.1" x3="5.3" y3="21.8"/> <curve x1="5.53" y1="16.94" x2="1.33" y2="11.64" x3="1.33" y3="11.64"/> <line x="10.61" y="0.37"/> <curve x1="10.61" y1="0.37" x2="19.75" y2="9.6" x3="28.92" y3="0.37"/> <curve x1="29.29" y1="0" x2="30" y2="0.27" x3="30.11" y3="0.4"/> <curve x1="38.84" y1="10.34" x2="47.73" y2="0.37" x3="47.73" y3="0.37"/> <line x="55.69" y="10.75"/> <curve x1="55.69" y1="10.75" x2="51.49" y2="15.72" x3="51.71" y3="21.25"/> <curve x1="51.97" y1="27.76" x2="58.01" y2="30.12" x3="56.51" y3="37.49"/> <close/> </path> </background> <foreground> <fillstroke/> </foreground> </shape> <shape name="Route 53 RouteTable" h="49.57" w="58.62" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0" y="0.5" perimeter="0" name="W"/> <constraint x="1" y="0.5" perimeter="0" name="E"/> <constraint x="0" y="0" perimeter="0" name="NW"/> <constraint x="0" y="1" perimeter="0" name="SW"/> <constraint x="1" y="0" perimeter="0" name="NE"/> <constraint x="1" y="1" perimeter="0" name="SE"/> </connections> <foreground> <path> <move x="0" y="0"/> <line x="0" y="14.12"/> <line x="58.62" y="14.12"/> <line x="58.62" y="0"/> <line x="0" y="0"/> <close/> <move x="6.85" y="11.3"/> <line x="5.5" y="11.3"/> <line x="5.5" y="5.06"/> <line x="3.76" y="5.06"/> <line x="3.76" y="4.16"/> <line x="3.89" y="4.16"/> <curve x1="4.7" y1="4.16" x2="5.63" y2="3.96" x3="5.87" y3="2.87"/> <line x="5.87" y="2.7"/> <line x="6.85" y="2.7"/> <line x="6.85" y="11.3"/> <close/> <move x="14.39" y="3.96"/> <curve x1="13.08" y1="5.72" x2="11.95" y2="8.71" x3="11.76" y3="11.3"/> <line x="10.34" y="11.3"/> <curve x1="10.53" y1="8.73" x2="11.76" y2="5.87" x3="13.09" y3="4.11"/> <line x="9.43" y="4.11"/> <line x="9.43" y="2.87"/> <line x="14.39" y="2.87"/> <line x="14.39" y="3.96"/> <close/> <move x="20.38" y="11.3"/> <line x="15.49" y="11.3"/> <curve x1="15.49" y1="7.56" x2="19" y2="7.64" x3="19" y3="4.97"/> <curve x1="19" y1="4.27" x2="18.7" y2="3.67" x3="17.96" y3="3.67"/> <curve x1="16.95" y1="3.67" x2="16.79" y2="4.59" x3="16.79" y3="5.47"/> <line x="15.51" y="5.47"/> <curve x1="15.51" y1="3.76" x2="16.2" y2="2.7" x3="17.98" y3="2.7"/> <curve x1="19.7" y1="2.7" x2="20.35" y2="3.75" x3="20.35" y3="5"/> <curve x1="20.35" y1="7.85" x2="17.63" y2="8.03" x3="16.99" y3="10.13"/> <line x="20.38" y="10.13"/> <line x="20.38" y="11.3"/> <close/> <move x="23.21" y="11.3"/> <line x="21.87" y="11.3"/> <line x="21.87" y="9.69"/> <line x="23.21" y="9.69"/> <line x="23.21" y="11.3"/> <close/> <move x="28.1" y="11.3"/> <line x="26.75" y="11.3"/> <line x="26.75" y="5.06"/> <line x="25.02" y="5.06"/> <line x="25.02" y="4.16"/> <line x="25.15" y="4.16"/> <curve x1="25.95" y1="4.16" x2="26.89" y2="3.96" x3="27.12" y3="2.87"/> <line x="27.12" y="2.7"/> <line x="28.1" y="2.7"/> <line x="28.1" y="11.3"/> <close/> <move x="33.14" y="11.47"/> <curve x1="31.03" y1="11.47" x2="30.63" y2="9.82" x3="30.63" y3="7.35"/> <curve x1="30.63" y1="4.78" x2="31.09" y2="2.7" x3="33.3" y3="2.7"/> <curve x1="34.76" y1="2.7" x2="35.55" y2="3.38" x3="35.55" y3="4.79"/> <line x="34.21" y="4.79"/> <curve x1="34.21" y1="4.29" x2="33.98" y2="3.67" x3="33.31" y3="3.67"/> <curve x1="32.05" y1="3.67" x2="31.98" y2="5.38" x3="31.98" y3="6.64"/> <line x="32.01" y="6.66"/> <curve x1="32.34" y1="6.04" x2="32.91" y2="5.75" x3="33.64" y3="5.75"/> <curve x1="34.79" y1="5.75" x2="35.71" y2="6.6" x3="35.71" y3="8.31"/> <curve x1="35.71" y1="10.29" x2="34.92" y2="11.47" x3="33.14" y3="11.47"/> <close/> <move x="38.45" y="11.3"/> <line x="37.1" y="11.3"/> <line x="37.1" y="9.69"/> <line x="38.45" y="9.69"/> <line x="38.45" y="11.3"/> <close/> <move x="42.38" y="11.47"/> <curve x1="40.77" y1="11.47" x2="39.87" y2="10.42" x3="39.87" y3="7.08"/> <curve x1="39.87" y1="3.74" x2="40.77" y2="2.7" x3="42.38" y3="2.7"/> <curve x1="43.99" y1="2.7" x2="44.89" y2="3.74" x3="44.89" y3="7.08"/> <curve x1="44.88" y1="10.42" x2="43.99" y2="11.47" x3="42.38" y3="11.47"/> <close/> <move x="47.66" y="11.3"/> <line x="46.31" y="11.3"/> <line x="46.31" y="9.69"/> <line x="47.66" y="9.69"/> <line x="47.66" y="11.3"/> <close/> <move x="51.59" y="11.47"/> <curve x1="49.98" y1="11.47" x2="49.09" y2="10.42" x3="49.09" y3="7.08"/> <curve x1="49.09" y1="3.74" x2="49.98" y2="2.7" x3="51.59" y3="2.7"/> <curve x1="53.2" y1="2.7" x2="54.1" y2="3.74" x3="54.1" y3="7.08"/> <curve x1="54.1" y1="10.42" x2="53.2" y2="11.47" x3="51.59" y3="11.47"/> <close/> </path> <fillstroke/> <path> <move x="0" y="32.26"/> <line x="58.62" y="32.26"/> <line x="58.62" y="18.14"/> <line x="0" y="18.14"/> <line x="0" y="32.26"/> <close/> <move x="51.59" y="20.84"/> <curve x1="53.2" y1="20.84" x2="54.1" y2="21.89" x3="54.1" y3="25.23"/> <curve x1="54.1" y1="28.57" x2="53.2" y2="29.61" x3="51.59" y3="29.61"/> <curve x1="49.98" y1="29.61" x2="49.09" y2="28.57" x3="49.09" y3="25.23"/> <curve x1="49.09" y1="21.89" x2="49.98" y2="20.84" x3="51.59" y3="20.84"/> <close/> <move x="46.31" y="27.84"/> <line x="47.66" y="27.84"/> <line x="47.66" y="29.44"/> <line x="46.31" y="29.44"/> <line x="46.31" y="27.84"/> <close/> <move x="40.25" y="22.3"/> <line x="40.38" y="22.3"/> <curve x1="41.19" y1="22.3" x2="42.12" y2="22.11" x3="42.36" y3="21.01"/> <line x="42.36" y="20.84"/> <line x="43.34" y="20.84"/> <line x="43.34" y="29.44"/> <line x="41.99" y="29.44"/> <line x="41.99" y="23.2"/> <line x="40.25" y="23.2"/> <line x="40.25" y="22.3"/> <close/> <move x="37.1" y="27.84"/> <line x="38.45" y="27.84"/> <line x="38.45" y="29.44"/> <line x="37.1" y="29.44"/> <line x="37.1" y="27.84"/> <close/> <move x="33.3" y="20.84"/> <curve x1="34.76" y1="20.84" x2="35.55" y2="21.52" x3="35.55" y3="22.93"/> <line x="34.21" y="22.93"/> <curve x1="34.21" y1="22.44" x2="33.98" y2="21.82" x3="33.31" y3="21.82"/> <curve x1="32.05" y1="21.82" x2="31.98" y2="23.53" x3="31.98" y3="24.78"/> <line x="32.01" y="24.8"/> <curve x1="32.34" y1="24.18" x2="32.91" y2="23.89" x3="33.64" y3="23.89"/> <curve x1="34.79" y1="23.89" x2="35.71" y2="24.74" x3="35.71" y3="26.46"/> <curve x1="35.71" y1="28.43" x2="34.92" y2="29.61" x3="33.15" y3="29.61"/> <curve x1="31.03" y1="29.61" x2="30.63" y2="27.96" x3="30.63" y3="25.5"/> <curve x1="30.63" y1="22.92" x2="31.09" y2="20.84" x3="33.3" y3="20.84"/> <close/> <move x="25.02" y="22.3"/> <line x="25.15" y="22.3"/> <curve x1="25.95" y1="22.3" x2="26.88" y2="22.11" x3="27.12" y3="21.01"/> <line x="27.12" y="20.84"/> <line x="28.1" y="20.84"/> <line x="28.1" y="29.44"/> <line x="26.75" y="29.44"/> <line x="26.75" y="23.2"/> <line x="25.02" y="23.2"/> <line x="25.02" y="22.3"/> <close/> <move x="21.87" y="27.84"/> <line x="23.21" y="27.84"/> <line x="23.21" y="29.44"/> <line x="21.87" y="29.44"/> <line x="21.87" y="27.84"/> <close/> <move x="17.96" y="21.82"/> <curve x1="16.95" y1="21.82" x2="16.79" y2="22.74" x3="16.79" y3="23.61"/> <line x="15.51" y="23.61"/> <curve x1="15.51" y1="21.9" x2="16.2" y2="20.85" x3="17.98" y3="20.85"/> <curve x1="19.7" y1="20.85" x2="20.35" y2="21.89" x3="20.35" y3="23.14"/> <curve x1="20.35" y1="25.99" x2="17.63" y2="26.18" x3="16.99" y3="28.28"/> <line x="20.38" y="28.28"/> <line x="20.38" y="29.44"/> <line x="15.49" y="29.44"/> <curve x1="15.49" y1="25.7" x2="19" y2="25.79" x3="19" y3="23.12"/> <curve x1="19" y1="22.41" x2="18.7" y2="21.82" x3="17.96" y3="21.82"/> <close/> <move x="9.43" y="21.01"/> <line x="14.4" y="21.01"/> <line x="14.4" y="22.11"/> <curve x1="13.08" y1="23.87" x2="11.95" y2="26.86" x3="11.76" y3="29.44"/> <line x="10.34" y="29.44"/> <curve x1="10.53" y1="26.88" x2="11.76" y2="24.01" x3="13.1" y3="22.25"/> <line x="9.43" y="22.25"/> <line x="9.43" y="21.01"/> <close/> <move x="3.76" y="22.3"/> <line x="3.89" y="22.3"/> <curve x1="4.7" y1="22.3" x2="5.63" y2="22.11" x3="5.87" y3="21.01"/> <line x="5.87" y="20.84"/> <line x="6.85" y="20.84"/> <line x="6.85" y="29.44"/> <line x="5.5" y="29.44"/> <line x="5.5" y="23.2"/> <line x="3.76" y="23.2"/> <line x="3.76" y="22.3"/> <close/> </path> <fillstroke/> <path> <move x="0" y="49.57"/> <line x="58.62" y="49.57"/> <line x="58.62" y="35.45"/> <line x="0" y="35.45"/> <line x="0" y="49.57"/> <close/> <move x="51.59" y="38.15"/> <curve x1="53.2" y1="38.15" x2="54.1" y2="39.2" x3="54.1" y3="42.54"/> <curve x1="54.1" y1="45.88" x2="53.2" y2="46.92" x3="51.59" y3="46.92"/> <curve x1="49.98" y1="46.92" x2="49.09" y2="45.88" x3="49.09" y3="42.54"/> <curve x1="49.09" y1="39.2" x2="49.98" y2="38.15" x3="51.59" y3="38.15"/> <close/> <move x="46.31" y="45.15"/> <line x="47.66" y="45.15"/> <line x="47.66" y="46.75"/> <line x="46.31" y="46.75"/> <line x="46.31" y="45.15"/> <close/> <move x="42.4" y="39.12"/> <curve x1="41.4" y1="39.12" x2="41.23" y2="40.05" x3="41.23" y3="40.92"/> <line x="39.96" y="40.92"/> <curve x1="39.96" y1="39.21" x2="40.64" y2="38.15" x3="42.43" y3="38.15"/> <curve x1="44.14" y1="38.15" x2="44.79" y2="39.2" x3="44.79" y3="40.45"/> <curve x1="44.79" y1="43.3" x2="42.07" y2="43.48" x3="41.43" y3="45.59"/> <line x="44.83" y="45.59"/> <line x="44.83" y="46.75"/> <line x="39.93" y="46.75"/> <curve x1="39.93" y1="43.01" x2="43.44" y2="43.1" x3="43.44" y3="40.43"/> <curve x1="43.44" y1="39.72" x2="43.15" y2="39.12" x3="42.4" y3="39.12"/> <close/> <move x="37.1" y="45.15"/> <line x="38.45" y="45.15"/> <line x="38.45" y="46.75"/> <line x="37.1" y="46.75"/> <line x="37.1" y="45.15"/> <close/> <move x="33.3" y="38.15"/> <curve x1="34.76" y1="38.15" x2="35.55" y2="38.83" x3="35.55" y3="40.24"/> <line x="34.21" y="40.24"/> <curve x1="34.21" y1="39.74" x2="33.98" y2="39.12" x3="33.31" y3="39.12"/> <curve x1="32.05" y1="39.12" x2="31.98" y2="40.84" x3="31.98" y3="42.09"/> <line x="32.01" y="42.11"/> <curve x1="32.34" y1="41.49" x2="32.91" y2="41.2" x3="33.64" y3="41.2"/> <curve x1="34.79" y1="41.2" x2="35.71" y2="42.05" x3="35.71" y3="43.76"/> <curve x1="35.71" y1="45.74" x2="34.92" y2="46.92" x3="33.15" y3="46.92"/> <curve x1="31.03" y1="46.92" x2="30.63" y2="45.27" x3="30.63" y3="42.81"/> <curve x1="30.63" y1="40.23" x2="31.09" y2="38.15" x3="33.3" y3="38.15"/> <close/> <move x="25.02" y="39.61"/> <line x="25.15" y="39.61"/> <curve x1="25.95" y1="39.61" x2="26.88" y2="39.42" x3="27.12" y3="38.32"/> <line x="27.12" y="38.15"/> <line x="28.1" y="38.15"/> <line x="28.1" y="46.75"/> <line x="26.75" y="46.75"/> <line x="26.75" y="40.51"/> <line x="25.02" y="40.51"/> <line x="25.02" y="39.61"/> <close/> <move x="21.87" y="45.15"/> <line x="23.21" y="45.15"/> <line x="23.21" y="46.75"/> <line x="21.87" y="46.75"/> <line x="21.87" y="45.15"/> <close/> <move x="17.96" y="39.12"/> <curve x1="16.95" y1="39.12" x2="16.79" y2="40.05" x3="16.79" y3="40.92"/> <line x="15.51" y="40.92"/> <curve x1="15.51" y1="39.21" x2="16.2" y2="38.15" x3="17.98" y3="38.15"/> <curve x1="19.7" y1="38.15" x2="20.35" y2="39.2" x3="20.35" y3="40.45"/> <curve x1="20.35" y1="43.3" x2="17.63" y2="43.48" x3="16.99" y3="45.59"/> <line x="20.38" y="45.59"/> <line x="20.38" y="46.75"/> <line x="15.49" y="46.75"/> <curve x1="15.49" y1="43.01" x2="19" y2="43.1" x3="19" y3="40.43"/> <curve x1="19" y1="39.72" x2="18.7" y2="39.12" x3="17.96" y3="39.12"/> <close/> <move x="9.43" y="38.32"/> <line x="14.4" y="38.32"/> <line x="14.4" y="39.42"/> <curve x1="13.08" y1="41.18" x2="11.95" y2="44.16" x3="11.76" y3="46.75"/> <line x="10.34" y="46.75"/> <curve x1="10.53" y1="44.19" x2="11.76" y2="41.32" x3="13.1" y3="39.56"/> <line x="9.43" y="39.56"/> <line x="9.43" y="38.32"/> <close/> <move x="3.76" y="39.61"/> <line x="3.89" y="39.61"/> <curve x1="4.7" y1="39.61" x2="5.63" y2="39.42" x3="5.87" y3="38.32"/> <line x="5.87" y="38.15"/> <line x="6.85" y="38.15"/> <line x="6.85" y="46.75"/> <line x="5.5" y="46.75"/> <line x="5.5" y="40.51"/> <line x="3.76" y="40.51"/> <line x="3.76" y="39.61"/> <close/> </path> <fillstroke/> <path> <move x="42.38" y="3.8"/> <curve x1="41.46" y1="3.8" x2="41.22" y2="4.71" x3="41.22" y3="7.21"/> <curve x1="41.22" y1="9.71" x2="41.46" y2="10.62" x3="42.38" y3="10.62"/> <curve x1="43.3" y1="10.62" x2="43.54" y2="9.71" x3="43.54" y3="7.21"/> <curve x1="43.54" y1="4.71" x2="43.3" y2="3.8" x3="42.38" y3="3.8"/> <close/> </path> <fillstroke/> <path> <move x="51.59" y="3.8"/> <curve x1="50.67" y1="3.8" x2="50.43" y2="4.71" x3="50.43" y3="7.21"/> <curve x1="50.43" y1="9.71" x2="50.67" y2="10.62" x3="51.59" y3="10.62"/> <curve x1="52.51" y1="10.62" x2="52.75" y2="9.71" x3="52.75" y3="7.21"/> <curve x1="52.75" y1="4.71" x2="52.51" y2="3.8" x3="51.59" y3="3.8"/> <close/> </path> <fillstroke/> <path> <move x="51.59" y="28.77"/> <curve x1="52.51" y1="28.77" x2="52.75" y2="27.86" x3="52.75" y3="25.35"/> <curve x1="52.75" y1="22.85" x2="52.51" y2="21.94" x3="51.59" y3="21.94"/> <curve x1="50.67" y1="21.94" x2="50.43" y2="22.85" x3="50.43" y3="25.35"/> <curve x1="50.43" y1="27.86" x2="50.67" y2="28.77" x3="51.59" y3="28.77"/> <close/> </path> <fillstroke/> <path> <move x="33.25" y="28.77"/> <curve x1="34.08" y1="28.77" x2="34.36" y2="27.93" x3="34.36" y3="26.92"/> <curve x1="34.36" y1="25.73" x2="34.02" y2="25.06" x3="33.25" y3="25.06"/> <curve x1="32.27" y1="25.06" x2="32.09" y2="25.95" x3="32.09" y3="26.98"/> <curve x1="32.09" y1="27.98" x2="32.46" y2="28.77" x3="33.25" y3="28.77"/> <close/> </path> <fillstroke/> <path> <move x="51.59" y="46.08"/> <curve x1="52.51" y1="46.08" x2="52.75" y2="45.17" x3="52.75" y3="42.66"/> <curve x1="52.75" y1="40.16" x2="52.51" y2="39.25" x3="51.59" y3="39.25"/> <curve x1="50.67" y1="39.25" x2="50.43" y2="40.16" x3="50.43" y3="42.66"/> <curve x1="50.43" y1="45.17" x2="50.67" y2="46.08" x3="51.59" y3="46.08"/> <close/> </path> <fillstroke/> <path> <move x="33.25" y="46.08"/> <curve x1="34.08" y1="46.08" x2="34.36" y2="45.24" x3="34.36" y3="44.23"/> <curve x1="34.36" y1="43.04" x2="34.02" y2="42.37" x3="33.25" y3="42.37"/> <curve x1="32.27" y1="42.37" x2="32.09" y2="43.26" x3="32.09" y3="44.29"/> <curve x1="32.09" y1="45.29" x2="32.46" y2="46.08" x3="33.25" y3="46.08"/> <close/> </path> <fillstroke/> <path> <move x="33.25" y="10.62"/> <curve x1="34.08" y1="10.62" x2="34.36" y2="9.78" x3="34.36" y3="8.78"/> <curve x1="34.36" y1="7.59" x2="34.02" y2="6.92" x3="33.25" y3="6.92"/> <curve x1="32.27" y1="6.92" x2="32.09" y2="7.81" x3="32.09" y3="8.84"/> <curve x1="32.09" y1="9.83" x2="32.46" y2="10.62" x3="33.25" y3="10.62"/> <close/> </path> <fillstroke/> </foreground> </shape> <shape name="VPC" h="42.46" w="68.09" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.38" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0.05" y="0.5" perimeter="0" name="W"/> <constraint x="0.945" y="0.5" perimeter="0" name="E"/> <constraint x="0.185" y="0.145" perimeter="0" name="NW"/> <constraint x="0.19" y="1" perimeter="0" name="SW"/> <constraint x="0.775" y="0.25" perimeter="0" name="NE"/> <constraint x="0.81" y="1" perimeter="0" name="SE"/> </connections> <background> <path> <move x="0" y="29.84"/> <line x="0" y="30.98"/> <curve x1="0" y1="36.69" x2="6.17" y2="42.46" x3="13.77" y3="42.46"/> <line x="54.32" y="42.46"/> <curve x1="61.93" y1="42.46" x2="68.09" y2="36.69" x3="68.09" y3="30.98"/> <line x="68.09" y="29.84"/> <curve x1="68.09" y1="24.53" x2="62.75" y2="17.87" x3="55.89" y3="17.28"/> <curve x1="55.74" y1="12.54" x2="51.86" y2="8.75" x3="47.08" y3="8.75"/> <curve x1="45.22" y1="8.75" x2="43.51" y2="9.32" x3="42.08" y3="10.3"/> <curve x1="39.36" y1="4.24" x2="33.28" y2="0" x3="26.2" y3="0"/> <curve x1="16.59" y1="0" x2="8.8" y2="7.79" x3="8.8" y3="17.41"/> <curve x1="8.8" y1="17.58" x2="8.82" y2="17.74" x3="8.82" y3="17.91"/> <curve x1="3.67" y1="19.4" x2="0" y2="25.44" x3="0" y3="29.84"/> <close/> <move x="25.01" y="23.86"/> <line x="27.56" y="23.86"/> <line x="27.56" y="19.97"/> <line x="27.56" y="19.97"/> <curve x1="27.83" y1="17.43" x2="30.01" y2="15.46" x3="32.62" y3="15.46"/> <curve x1="35.24" y1="15.46" x2="37.42" y2="17.42" x3="37.69" y3="19.97"/> <line x="37.69" y="19.97"/> <line x="37.69" y="23.86"/> <line x="40.31" y="23.86"/> <line x="40.31" y="32.43"/> <line x="25.01" y="32.43"/> <line x="25.01" y="23.86"/> <close/> </path> </background> <foreground> <fillstroke/> <path> <move x="30.02" y="19.99"/> <curve x1="30.02" y1="19.99" x2="30.13" y2="17.63" x3="32.62" y3="17.63"/> <curve x1="35.23" y1="17.62" x2="35.23" y2="19.99" x3="35.23" y3="19.99"/> <line x="35.23" y="23.86"/> <line x="30.02" y="23.86"/> <line x="30.02" y="19.99"/> <close/> </path> <fillstroke/> </foreground> </shape> <shape name="VPC Customer Gateway" h="35.75" w="35.75" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0" y="0.5" perimeter="0" name="W"/> <constraint x="1" y="0.5" perimeter="0" name="E"/> <constraint x="0.145" y="0.145" perimeter="0" name="NW"/> <constraint x="0.145" y="0.855" perimeter="0" name="SW"/> <constraint x="0.855" y="0.145" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <foreground> <path> <move x="35.75" y="18.39"/> <line x="29.65" y="20.81"/> <line x="29.65" y="19.13"/> <line x="19.11" y="19.13"/> <line x="19.11" y="29.87"/> <line x="20.92" y="29.87"/> <line x="18.58" y="35.75"/> <curve x1="27.97" y1="35.38" x2="35.48" y2="27.8" x3="35.75" y3="18.39"/> <close/> </path> <fillstroke/> <path> <move x="19.11" y="6.12"/> <line x="19.11" y="16.63"/> <line x="29.66" y="16.63"/> <line x="29.66" y="14.43"/> <line x="35.72" y="16.85"/> <curve x1="35.19" y1="7.64" x2="27.74" y2="0.32" x3="18.49" y3="0"/> <line x="20.92" y="6.12"/> <line x="19.11" y="6.12"/> <close/> </path> <fillstroke/> <path> <move x="16.61" y="29.87"/> <line x="16.61" y="19.13"/> <line x="5.53" y="19.13"/> <line x="5.53" y="21"/> <line x="0" y="18.8"/> <curve x1="0.47" y1="28.02" x2="7.9" y2="35.38" x3="17.14" y3="35.75"/> <line x="14.8" y="29.87"/> <line x="16.61" y="29.87"/> <close/> </path> <fillstroke/> <path> <move x="5.53" y="16.63"/> <line x="16.61" y="16.63"/> <line x="16.61" y="6.12"/> <line x="14.8" y="6.12"/> <line x="17.24" y="0"/> <curve x1="7.95" y1="0.32" x2="0.47" y2="7.7" x3="0" y3="16.95"/> <line x="5.53" y="14.75"/> <line x="5.53" y="16.63"/> <close/> </path> <fillstroke/> </foreground> </shape> <shape name="VPC Internet Gateway" h="35.82" w="35.82" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0" y="0.5" perimeter="0" name="W"/> <constraint x="1" y="0.5" perimeter="0" name="E"/> <constraint x="0.145" y="0.145" perimeter="0" name="NW"/> <constraint x="0.145" y="0.855" perimeter="0" name="SW"/> <constraint x="0.855" y="0.145" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <background> <path> <move x="0" y="17.91"/> <curve x1="0" y1="27.8" x2="8.02" y2="35.82" x3="17.91" y3="35.82"/> <curve x1="27.8" y1="35.82" x2="35.82" y2="27.8" x3="35.82" y3="17.91"/> <curve x1="35.82" y1="8.02" x2="27.8" y2="0" x3="17.91" y3="0"/> <curve x1="8.02" y1="0" x2="0" y2="8.02" x3="0" y3="17.91"/> <close/> <move x="3.51" y="20.38"/> <line x="3.51" y="19.91"/> <curve x1="3.51" y1="17.99" x2="4.96" y2="15.45" x3="7.1" y3="14.52"/> <curve x1="7.27" y1="10.34" x2="10.72" y2="6.99" x3="14.95" y3="6.99"/> <curve x1="17.76" y1="6.99" x2="20.34" y2="8.51" x3="21.74" y3="10.91"/> <curve x1="22.28" y1="10.68" x2="22.86" y2="10.56" x3="23.46" y3="10.56"/> <curve x1="25.6" y1="10.56" x2="27.37" y2="12.08" x3="27.74" y3="14.13"/> <curve x1="30.66" y1="14.71" x2="32.78" y2="17.53" x3="32.78" y3="19.91"/> <line x="32.78" y="20.38"/> <curve x1="32.78" y1="23.27" x2="29.8" y2="25.81" x3="26.41" y3="25.81"/> <line x="9.88" y="25.81"/> <curve x1="6.48" y1="25.81" x2="3.51" y2="23.27" x3="3.51" y3="20.38"/> <close/> </path> </background> <foreground> <fillstroke/> <path> <move x="22.13" y="12.97"/> <line x="20.9" y="13.83"/> <line x="20.28" y="12.45"/> <curve x1="19.34" y1="10.35" x2="17.24" y2="8.99" x3="14.95" y3="8.99"/> <curve x1="13.38" y1="8.99" x2="11.92" y2="9.6" x3="10.81" y3="10.71"/> <curve x1="9.71" y1="11.83" x2="9.1" y2="13.31" x3="9.1" y3="14.89"/> <line x="9.12" y="15.98"/> <line x="8.2" y="16.25"/> <curve x1="6.71" y1="16.68" x2="5.51" y2="18.6" x3="5.51" y3="19.91"/> <line x="5.51" y="20.38"/> <curve x1="5.51" y1="21.96" x2="7.42" y2="23.81" x3="9.88" y3="23.81"/> <line x="26.41" y="23.81"/> <curve x1="28.87" y1="23.81" x2="30.78" y2="21.96" x3="30.78" y3="20.38"/> <line x="30.78" y="19.91"/> <curve x1="30.78" y1="18.31" x2="29.01" y2="16.21" x3="26.95" y3="16.04"/> <line x="25.84" y="15.94"/> <line x="25.8" y="14.83"/> <curve x1="25.76" y1="13.56" x2="24.73" y2="12.56" x3="23.46" y3="12.56"/> <curve x1="22.98" y1="12.56" x2="22.52" y2="12.7" x3="22.13" y3="12.97"/> <close/> </path> <fillstroke/> </foreground> </shape> <shape name="VPC Router" h="35.45" w="35.47" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0" y="0.5" perimeter="0" name="W"/> <constraint x="1" y="0.5" perimeter="0" name="E"/> <constraint x="0.145" y="0.145" perimeter="0" name="NW"/> <constraint x="0.145" y="0.855" perimeter="0" name="SW"/> <constraint x="0.855" y="0.145" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <foreground> <path> <move x="16.54" y="30.04"/> <line x="16.54" y="5.75"/> <line x="14.76" y="5.75"/> <line x="16.92" y="0"/> <curve x1="7.69" y1="0.42" x2="0.32" y2="7.86" x3="0" y3="17.11"/> <line x="9" y="17.11"/> <line x="9" y="15.26"/> <line x="16.24" y="18.36"/> <line x="9" y="21.46"/> <line x="9" y="19.61"/> <line x="0.07" y="19.61"/> <curve x1="0.98" y1="28.25" x2="8.09" y2="35.02" x3="16.88" y3="35.45"/> <line x="14.85" y="30.04"/> <line x="16.54" y="30.04"/> <close/> </path> <fillstroke/> <path> <move x="26.43" y="21.46"/> <line x="19.19" y="18.36"/> <line x="26.43" y="15.26"/> <line x="26.43" y="17.11"/> <line x="35.47" y="17.11"/> <curve x1="35.15" y1="7.89" x2="27.83" y2="0.48" x3="18.66" y3="0.01"/> <line x="20.82" y="5.75"/> <line x="19.04" y="5.75"/> <line x="19.04" y="30.04"/> <line x="20.73" y="30.04"/> <line x="18.7" y="35.44"/> <curve x1="27.43" y1="34.97" x2="34.49" y2="28.22" x3="35.4" y3="19.61"/> <line x="26.43" y="19.61"/> <line x="26.43" y="21.46"/> <close/> </path> <fillstroke/> </foreground> </shape> <shape name="VPC VPN Connection" h="51.99" w="64.71" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0.165" y="0.56" perimeter="0" name="W"/> <constraint x="0.835" y="0.56" perimeter="0" name="E"/> <constraint x="0" y="0.317" perimeter="0" name="NW"/> <constraint x="0.165" y="1" perimeter="0" name="SW"/> <constraint x="1" y="0.317" perimeter="0" name="NE"/> <constraint x="0.835" y="1" perimeter="0" name="SE"/> </connections> <foreground> <rect x="16.75" y="13.62" w="7.61" h="15.09"/> <fillstroke/> <path> <move x="49.77" y="26.93"/> <line x="49.77" y="20.78"/> <line x="14.97" y="20.78"/> <line x="14.97" y="26.93"/> <line x="0" y="16.6"/> <line x="14.97" y="6.26"/> <line x="14.97" y="12.24"/> <line x="49.77" y="12.24"/> <line x="49.77" y="6.26"/> <line x="64.71" y="16.6"/> <line x="49.77" y="26.93"/> <close/> <move x="3.23" y="16.6"/> <line x="13.13" y="23.43"/> <line x="13.13" y="18.94"/> <line x="51.6" y="18.94"/> <line x="51.6" y="23.43"/> <line x="61.48" y="16.6"/> <line x="51.6" y="9.76"/> <line x="51.6" y="14.08"/> <line x="13.13" y="14.08"/> <line x="13.13" y="9.76"/> <line x="3.23" y="16.6"/> <close/> </path> <fillstroke/> <path> <move x="47.74" y="28.99"/> <line x="47.74" y="13.99"/> <line x="48.12" y="13.99"/> <curve x1="47.27" y1="4.99" x2="40.53" y2="0" x3="32.44" y3="0"/> <curve x1="24.32" y1="0" x2="17.56" y2="4.99" x3="16.76" y3="13.99"/> <line x="24.37" y="13.99"/> <curve x1="24.37" y1="13.99" x2="24.49" y2="6.49" x3="32.56" y3="6.52"/> <curve x1="40.29" y1="6.54" x2="40.74" y2="13.67" x3="40.74" y3="13.67"/> <line x="40.74" y="28.99"/> <line x="10.74" y="28.99"/> <line x="10.74" y="51.99"/> <line x="53.74" y="51.99"/> <line x="53.74" y="28.99"/> <line x="47.74" y="28.99"/> <close/> </path> <fillstroke/> </foreground> </shape> <shape name="VPC VPN Gateway" h="35.82" w="35.82" aspect="variable" strokewidth="inherit"> <connections> <constraint x="0.5" y="0" perimeter="0" name="N"/> <constraint x="0.5" y="1" perimeter="0" name="S"/> <constraint x="0" y="0.5" perimeter="0" name="W"/> <constraint x="1" y="0.5" perimeter="0" name="E"/> <constraint x="0.145" y="0.145" perimeter="0" name="NW"/> <constraint x="0.145" y="0.855" perimeter="0" name="SW"/> <constraint x="0.855" y="0.145" perimeter="0" name="NE"/> <constraint x="0.855" y="0.855" perimeter="0" name="SE"/> </connections> <background> <path> <move x="17.91" y="0"/> <curve x1="8.02" y1="0" x2="0" y2="8.02" x3="0" y3="17.91"/> <curve x1="0" y1="27.8" x2="8.02" y2="35.82" x3="17.91" y3="35.82"/> <curve x1="27.8" y1="35.82" x2="35.82" y2="27.8" x3="35.82" y3="17.91"/> <curve x1="35.82" y1="8.02" x2="27.8" y2="0" x3="17.91" y3="0"/> <close/> <move x="26.21" y="26.11"/> <line x="9.61" y="26.11"/> <line x="9.61" y="16.81"/> <line x="12.45" y="16.81"/> <line x="12.45" y="12.62"/> <curve x1="12.73" y1="9.85" x2="15.1" y2="7.71" x3="17.95" y3="7.71"/> <curve x1="20.79" y1="7.71" x2="23.15" y2="9.86" x3="23.44" y3="12.62"/> <line x="23.44" y="16.81"/> <line x="26.21" y="16.81"/> <line x="26.21" y="26.11"/> <close/> </path> </background> <foreground> <fillstroke/> <path> <move x="17.95" y="10.06"/> <curve x1="15.12" y1="10.05" x2="15.12" y2="12.62" x3="15.12" y3="12.62"/> <line x="15.1" y="16.81"/> <line x="20.76" y="16.81"/> <line x="20.78" y="12.62"/> <curve x1="20.78" y1="12.62" x2="20.66" y2="10.06" x3="17.95" y3="10.06"/> <close/> </path> <fillstroke/> </foreground> </shape> </shapes> ```
/content/code_sandbox/src/main/webapp/stencils/aws/networking.xml
xml
2016-09-06T12:59:15
2024-08-16T13:28:41
drawio
jgraph/drawio
40,265
16,057
```xml /* * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ import { renderIcon } from '../icon.renderer.js'; import { IconShapeTuple } from '../interfaces/icon.interfaces.js'; const icon = { outline: '<path d="M 32 5 L 4 5 C 2.895 5 2 5.895 2 7 L 2 29 C 2 30.105 2.895 31 4 31 L 32 31 C 33.105 31 34 30.105 34 29 L 34 7 C 34 5.895 33.105 5 32 5 Z M 4 29 L 4 7 L 32 7 L 32 29 Z"/><path d="M 8 10 L 28 10 L 28 26 L 8 26 Z M 9.6 24 L 14.1 24 L 14.1 18.8 L 9.6 18.8 Z M 14.1 11.6 L 9.6 11.6 L 9.6 17.2 L 14.1 17.2 Z M 26 24 L 26 18.8 L 21.9 18.8 L 21.9 24 Z M 26 11.6 L 21.9 11.6 L 21.9 17.2 L 26 17.2 Z M 15.7 11.6 L 15.7 17.2 L 20.3 17.2 L 20.3 11.6 Z M 15.7 24 L 20.3 24 L 20.3 18.8 L 15.7 18.8 Z"/>', outlineAlerted: '<path d="M 34 29 C 34 30.105 33.105 31 32 31 L 4 31 C 2.895 31 2 30.105 2 29 L 2 7 C 2 5.895 2.895 5 4 5 L 21.958 5 L 20.786 7 L 4 7 L 4 29 L 32 29 L 32 15.357 L 34 15.357 Z"/><path d="M 8 10 L 19.028 10 L 18.091 11.6 L 15.7 11.6 L 15.7 17.2 L 20.3 17.2 L 20.3 15.357 L 21.9 15.357 L 21.9 17.2 L 26 17.2 L 26 15.357 L 28 15.357 L 28 26 L 8 26 Z M 9.6 24 L 14.1 24 L 14.1 18.8 L 9.6 18.8 Z M 14.1 11.6 L 9.6 11.6 L 9.6 17.2 L 14.1 17.2 Z M 26 24 L 26 18.8 L 21.9 18.8 L 21.9 24 Z M 15.7 24 L 20.3 24 L 20.3 18.8 L 15.7 18.8 Z"/>', outlineBadged: '<path d="M 32 13.22 L 32 29 L 4 29 L 4 7 L 22.57 7 C 22.524 6.668 22.501 6.334 22.5 6 C 22.501 5.665 22.524 5.331 22.57 5 L 4 5 C 2.895 5 2 5.895 2 7 L 2 29 C 2 30.104 2.895 31 4 31 L 32 31 C 33.104 31 34 30.104 34 29 L 34 12.34 C 33.38 12.73 32.706 13.026 32 13.22 Z"/><path d="M 8 10 L 23.728 10 C 24.105 10.596 24.564 11.135 25.09 11.6 L 21.9 11.6 L 21.9 17.2 L 26 17.2 L 26 12.287 C 26.611 12.679 27.284 12.983 28 13.182 L 28 26 L 8 26 Z M 9.6 24 L 14.1 24 L 14.1 18.8 L 9.6 18.8 Z M 14.1 11.6 L 9.6 11.6 L 9.6 17.2 L 14.1 17.2 Z M 26 24 L 26 18.8 L 21.9 18.8 L 21.9 24 Z M 15.7 11.6 L 15.7 17.2 L 20.3 17.2 L 20.3 11.6 Z M 15.7 24 L 20.3 24 L 20.3 18.8 L 15.7 18.8 Z"/>', solid: '<path d="M 34 7 L 34 29 C 34 30.105 33.105 31 32 31 L 4 31 C 2.896 31 2 30.105 2 29 L 2 7 C 2 5.896 2.896 5 4 5 L 32 5 C 33.105 5 34 5.896 34 7 Z M 8 26 L 28 26 L 28 10 L 8 10 Z M 10 19 L 14 19 L 14 24 L 10 24 Z M 22 24 L 22 19 L 26 19 L 26 24 Z M 20 19 L 20 24 L 16 24 L 16 19 Z M 26 17 L 22 17 L 22 12 L 26 12 Z M 20 12 L 20 17 L 16 17 L 16 12 Z M 14 12 L 14 17 L 10 17 L 10 12 Z"/>', solidAlerted: '<path d="M 34 29 C 34 30.105 33.105 31 32 31 L 4 31 C 2.896 31 2 30.105 2 29 L 2 7 C 2 5.896 2.896 5 4 5 L 21.958 5 L 19.028 10 L 8 10 L 8 26 L 28 26 L 28 15.357 L 34 15.357 Z M 10 19 L 14 19 L 14 24 L 10 24 Z M 22 24 L 22 19 L 26 19 L 26 24 Z M 20 19 L 20 24 L 16 24 L 16 19 Z M 26 17 L 22 17 L 22 15.357 L 26 15.357 Z M 20 17 L 16 17 L 16 12 L 17.856 12 L 17.625 12.395 C 16.795 13.601 17.594 15.245 19.064 15.351 C 19.134 15.357 19.201 15.359 19.27 15.357 L 20 15.357 Z M 14 12 L 14 17 L 10 17 L 10 12 Z"/>', solidBadged: '<path d="M 34 12.34 L 34 29 C 34 30.105 33.105 31 32 31 L 4 31 C 2.896 31 2 30.105 2 29 L 2 7 C 2 5.896 2.896 5 4 5 L 22.57 5 C 22.312 6.817 22.732 8.566 23.633 10 L 8 10 L 8 26 L 28 26 L 28 13.232 C 28.421 13.345 28.859 13.422 29.31 13.46 L 30.32 13.48 C 31.626 13.429 32.895 13.036 34 12.34 Z M 10 19 L 14 19 L 14 24 L 10 24 Z M 22 24 L 22 19 L 26 19 L 26 24 Z M 20 19 L 20 24 L 16 24 L 16 19 Z M 26 17 L 22 17 L 22 12 L 25.584 12 C 25.719 12.1 25.858 12.196 26 12.287 Z M 20 12 L 20 17 L 16 17 L 16 12 Z M 14 12 L 14 17 L 10 17 L 10 12 Z"/>', }; export const heatMapIconName = 'heat-map'; export const heatMapIcon: IconShapeTuple = [heatMapIconName, renderIcon(icon)]; ```
/content/code_sandbox/packages/core/src/icon/shapes/heat-map.ts
xml
2016-09-29T17:24:17
2024-08-11T17:06:15
clarity
vmware-archive/clarity
6,431
2,184
```xml import React from 'react'; import { storiesOf } from '@storybook/react-native'; import { withKnobs } from '@storybook/addon-knobs'; import Wrapper from './../../Wrapper'; import { Example as Playground } from './knobEnabled'; import { Example as Usage } from './usage'; import { Example as Size } from './size'; import { Example as Fallback } from './Fallback'; import { Example as AvatarBadge } from './AvatarBadge'; import { Example as AvatarGroup } from './AvatarGroup'; storiesOf('Avatar', module) .addDecorator(withKnobs) .addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>) .add('Playground', () => <Playground />) .add('Usage', () => <Usage />) .add('Size', () => <Size />) .add('Fallback', () => <Fallback />) .add('AvatarBadge', () => <AvatarBadge />) .add('AvatarGroup', () => <AvatarGroup />); ```
/content/code_sandbox/example/storybook/stories/components/composites/Avatar/index.tsx
xml
2016-04-15T11:37:23
2024-08-14T16:16:44
NativeBase
GeekyAnts/NativeBase
20,132
212
```xml /** @jsx jsx */ import { Transforms } from 'slate' import { jsx } from '../../..' export const run = editor => { Transforms.delete(editor) } export const input = ( <editor> <block> <block> word <cursor /> </block> <block>another</block> </block> </editor> ) export const output = ( <editor> <block> <block> word <cursor /> another </block> </block> </editor> ) ```
/content/code_sandbox/packages/slate/test/transforms/delete/point/nested.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
123
```xml import type { ReactNode } from 'react'; import { useMemo } from 'react'; import { c, msgid } from 'ttag'; import type { Breakpoints } from '@proton/components/hooks'; import { DENSITY } from '@proton/shared/lib/constants'; import type { UserSettings } from '@proton/shared/lib/interfaces'; import type { Label } from '@proton/shared/lib/interfaces/Label'; import type { AttachmentsMetadata } from '@proton/shared/lib/interfaces/mail/Message'; import { getHasOnlyIcsAttachments } from '@proton/shared/lib/mail/messages'; import clsx from '@proton/utils/clsx'; import ItemAttachmentThumbnails from 'proton-mail/components/list/ItemAttachmentThumbnails'; import { canShowAttachmentThumbnails } from 'proton-mail/helpers/attachment/attachmentThumbnails'; import { useMailSelector } from 'proton-mail/store/hooks'; import { useEncryptedSearchContext } from '../../containers/EncryptedSearchProvider'; import { getLabelIDs, isStarred as testIsStarred } from '../../helpers/elements'; import { useExpiringElement } from '../../hooks/useExpiringElement'; import type { Element } from '../../models/element'; import type { ESMessage } from '../../models/encryptedSearch'; import { selectSnoozeDropdownState, selectSnoozeElement } from '../../store/snooze/snoozeSliceSelectors'; import NumMessages from '../conversation/NumMessages'; import ItemAction from './ItemAction'; import ItemAttachmentIcon from './ItemAttachmentIcon'; import ItemDate from './ItemDate'; import ItemHoverButtons from './ItemHoverButtons'; import ItemLabels from './ItemLabels'; import ItemLocation from './ItemLocation'; import ItemStar from './ItemStar'; import ItemUnread from './ItemUnread'; import ItemExpiration from './item-expiration/ItemExpiration'; interface Props { labelID: string; elementID?: string; labels?: Label[]; element: Element; conversationMode: boolean; showIcon: boolean; senders?: ReactNode; breakpoints: Breakpoints; unread: boolean; onBack?: () => void; isSelected: boolean; attachmentsMetadata?: AttachmentsMetadata[]; userSettings?: UserSettings; showAttachmentThumbnails?: boolean; } const ItemColumnLayout = ({ labelID, elementID, labels, element, conversationMode, showIcon, breakpoints, unread, onBack = () => {}, isSelected, senders, attachmentsMetadata = [], userSettings, showAttachmentThumbnails, }: Props) => { const { shouldHighlight, highlightMetadata, esStatus } = useEncryptedSearchContext(); const highlightData = shouldHighlight(); const { contentIndexingDone } = esStatus; const snoozedElement = useMailSelector(selectSnoozeElement); const snoozeDropdownState = useMailSelector(selectSnoozeDropdownState); const { expirationTime, hasExpiration } = useExpiringElement(element, labelID, conversationMode); const body = contentIndexingDone ? (element as ESMessage).decryptedBody : undefined; const { Subject } = element; const subjectContent = useMemo( () => (highlightData && Subject ? highlightMetadata(Subject, unread, true).resultJSX : Subject), [Subject, highlightData, highlightMetadata, unread] ); const { resultJSX, numOccurrences } = useMemo( () => body && highlightData ? highlightMetadata(body, unread, true) : { resultJSX: undefined, numOccurrences: 0 }, [body, unread, highlightData, highlightMetadata] ); // translator: This text is displayed in an Encrypted Search context. The user has searched for a specific keyword. // In the message list, the user should see the part of the message "body" which contains the keyword. On hover, this text is displayed. // The variable "numOccurrences" corresponds to the number of times the keyword has been found in the email content const bodyTitle = c('Info').ngettext( msgid`${numOccurrences} occurrence found in the mail content`, `${numOccurrences} occurrences found in the mail content`, numOccurrences ); const hasOnlyIcsAttachments = getHasOnlyIcsAttachments(element?.AttachmentInfo); const hasLabels = useMemo(() => { const allLabelIDs = Object.keys(getLabelIDs(element, labelID)); const labelIDs = allLabelIDs.filter((ID) => labels?.find((label) => ID === label.ID)); return !!labelIDs.length; }, [element, labels, labelID]); const isStarred = testIsStarred(element || ({} as Element)); const isCompactView = userSettings?.Density === DENSITY.COMPACT; const isSnoozeDropdownOpen = snoozeDropdownState === 'open' && snoozedElement?.ID === element.ID; const showThumbnails = canShowAttachmentThumbnails( isCompactView, element, attachmentsMetadata, showAttachmentThumbnails ); return ( <div className="item-column flex-1 flex flex-nowrap flex-column justify-center item-titlesender" data-testid="message-list:message" > <div className="flex items-center flex-nowrap"> <div className="flex-1"> <div className="flex items-center item-firstline"> <div className={clsx( 'item-senders flex-1 flex items-center flex-nowrap pr-4', unread && 'text-semibold' )} > <ItemUnread element={element} labelID={labelID} className="item-unread-dot sr-only" isSelected={isSelected} /> <ItemAction element={element} className="mr-1 my-auto shrink-0" /> <span className="inline-flex max-w-full text-ellipsis" data-testid="message-column:sender-address" > {senders} </span> </div> <span className={clsx( 'item-firstline-infos shrink-0 flex flex-nowrap items-center', isSnoozeDropdownOpen && 'invisible' )} > <ItemDate element={element} labelID={labelID} className={clsx('item-senddate-col text-sm', unread && 'text-semibold')} isInListView /> </span> </div> <div className="flex flex-nowrap items-center item-secondline max-w-full"> <div className={clsx( 'item-subject flex-1 flex flex-nowrap items-center', unread && 'text-semibold' )} > {showIcon && ( <span className="flex shrink-0"> <ItemLocation element={element} labelID={labelID} /> </span> )} {conversationMode && <NumMessages className="mr-1 shrink-0" conversation={element} />} <span role="heading" aria-level={2} className="inline-block max-w-full mr-1 text-ellipsis" title={Subject} data-testid="message-column:subject" > {subjectContent} </span> </div> <div className="item-icons shrink-0 flex-nowrap hidden md:flex"> <span className="flex item-meta-infos gap-1"> {hasLabels && isCompactView && !isSnoozeDropdownOpen && ( <ItemLabels className="ml-1" labels={labels} element={element} labelID={labelID} maxNumber={1} /> )} {hasExpiration && !isSnoozeDropdownOpen && ( <ItemExpiration expirationTime={expirationTime} className="self-center" element={element} labelID={labelID} /> )} {!isSnoozeDropdownOpen && ( <ItemAttachmentIcon icon={hasOnlyIcsAttachments ? 'calendar-grid' : undefined} element={element} className="self-center" /> )} <span className="flex *:flex self-center my-auto empty:hidden"> {isStarred && !isSnoozeDropdownOpen && <ItemStar element={element} />} </span> </span> </div> <div className="item-icons flex flex-row shrink-0 flex-nowrap flex md:hidden"> {hasExpiration && ( <ItemExpiration element={element} expirationTime={expirationTime} className="ml-1 self-center" labelID={labelID} /> )} <ItemAttachmentIcon icon={hasOnlyIcsAttachments ? 'calendar-grid' : undefined} element={element} className="ml-1 self-center" /> <span className="ml-1 flex *:flex self-center my-auto empty:hidden"> <ItemStar element={element} /> </span> </div> </div> </div> <ItemHoverButtons element={element} labelID={labelID} elementID={elementID} onBack={onBack} size="small" /> </div> {hasLabels && !isCompactView && ( <div className="flex flex-nowrap items-center max-w-full overflow-hidden"> <div className="item-icons flex shrink-0 flex-nowrap mt-1"> <ItemLabels className="ml-2" labels={labels} element={element} labelID={labelID} maxNumber={breakpoints.viewportWidth['<=small'] ? 1 : 5} isCollapsed={false} /> </div> </div> )} {showThumbnails && <ItemAttachmentThumbnails attachmentsMetadata={attachmentsMetadata} className="mt-1" />} {!!resultJSX && ( <> <div className={clsx([ 'flex flex-nowrap items-center item-secondline item-es-result max-w-8/10 overflow-hidden', isCompactView && 'mb-3', ])} aria-hidden="true" > <div className="item-subject flex-1 flex flex-nowrap items-center"> <span className="inline-block max-w-full text-ellipsis" title={bodyTitle}> {resultJSX} </span> </div> </div> <div className="sr-only">{bodyTitle}</div> </> )} </div> ); }; export default ItemColumnLayout; ```
/content/code_sandbox/applications/mail/src/app/components/list/ItemColumnLayout.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
2,246
```xml import { MessageArgs, MessageArgsOmitService, sendMessage, } from '@erxes/api-utils/src/core'; import { generateModels } from './connectionResolver'; import { consumeRPCQueue } from '@erxes/api-utils/src/messageBroker'; export const setupMessageConsumers = async () => { consumeRPCQueue('reactions:comments.count', async ({ subdomain, data }) => { const models = await generateModels(subdomain); return { status: 'success', data: await models.Comments.find(data).countDocuments(), }; }); consumeRPCQueue( 'reactions:emojies.likeCount', async ({ subdomain, data }) => { const models = await generateModels(subdomain); return { status: 'success', data: await models.Emojis.find(data).countDocuments(), }; }, ); consumeRPCQueue( 'reactions:emojies.heartCount', async ({ subdomain, data }) => { const models = await generateModels(subdomain); return { status: 'success', data: await models.Emojis.find(data).countDocuments(), }; }, ); consumeRPCQueue( 'reactions:emojies.isHearted', async ({ subdomain, data }) => { const models = await generateModels(subdomain); return { status: 'success', data: await models.Emojis.exists(data), }; }, ); consumeRPCQueue('reactions:emojies.isLiked', async ({ subdomain, data }) => { const models = await generateModels(subdomain); return { status: 'success', data: await models.Emojis.exists(data), }; }); }; export const sendCoreMessage = async ( args: MessageArgsOmitService, ): Promise<any> => { return sendMessage({ serviceName: 'core', ...args, }); }; export const sendCommonMessage = async (args: MessageArgs): Promise<any> => { return sendMessage({ ...args, }); }; ```
/content/code_sandbox/packages/plugin-reactions-api/src/messageBroker.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
441
```xml import { assert, use as chaiUse } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as fs from 'fs-extra'; import * as sinon from 'sinon'; import { Uri } from 'vscode'; import * as path from 'path'; import * as windowApis from '../../../../client/common/vscodeApis/windowApis'; import * as workspaceApis from '../../../../client/common/vscodeApis/workspaceApis'; import { ExistingVenvAction, OPEN_REQUIREMENTS_BUTTON, pickExistingVenvAction, pickPackagesToInstall, } from '../../../../client/pythonEnvironments/creation/provider/venvUtils'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../../constants'; import { CreateEnv } from '../../../../client/common/utils/localize'; import { createDeferred } from '../../../../client/common/utils/async'; chaiUse(chaiAsPromised); suite('Venv Utils test', () => { let findFilesStub: sinon.SinonStub; let showQuickPickWithBackStub: sinon.SinonStub; let pathExistsStub: sinon.SinonStub; let readFileStub: sinon.SinonStub; let showTextDocumentStub: sinon.SinonStub; const workspace1 = { uri: Uri.file(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'testMultiRootWkspc', 'workspace1')), name: 'workspace1', index: 0, }; setup(() => { findFilesStub = sinon.stub(workspaceApis, 'findFiles'); showQuickPickWithBackStub = sinon.stub(windowApis, 'showQuickPickWithBack'); pathExistsStub = sinon.stub(fs, 'pathExists'); readFileStub = sinon.stub(fs, 'readFile'); showTextDocumentStub = sinon.stub(windowApis, 'showTextDocument'); }); teardown(() => { sinon.restore(); }); test('No requirements or toml found', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(false); const actual = await pickPackagesToInstall(workspace1); assert.isTrue(showQuickPickWithBackStub.notCalled); assert.deepStrictEqual(actual, []); }); test('Toml found with no build system', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(true); readFileStub.resolves('[project]\nname = "spam"\nversion = "2020.0.0"\n'); const actual = await pickPackagesToInstall(workspace1); assert.isTrue(showQuickPickWithBackStub.notCalled); assert.deepStrictEqual(actual, []); }); test('Toml found with no project table', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(true); readFileStub.resolves( '[tool.poetry]\nname = "spam"\nversion = "2020.0.0"\n[build-system]\nrequires = ["setuptools ~= 58.0", "cython ~= 0.29.0"]', ); const actual = await pickPackagesToInstall(workspace1); assert.isTrue(showQuickPickWithBackStub.notCalled); assert.deepStrictEqual(actual, []); }); test('Toml found with no optional deps', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(true); readFileStub.resolves( '[project]\nname = "spam"\nversion = "2020.0.0"\n[build-system]\nrequires = ["setuptools ~= 58.0", "cython ~= 0.29.0"]', ); const actual = await pickPackagesToInstall(workspace1); assert.isTrue(showQuickPickWithBackStub.notCalled); assert.deepStrictEqual(actual, [ { installType: 'toml', source: path.join(workspace1.uri.fsPath, 'pyproject.toml'), }, ]); }); test('Toml found with deps, but user presses escape', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(true); readFileStub.resolves( '[project]\nname = "spam"\nversion = "2020.0.0"\n[build-system]\nrequires = ["setuptools ~= 58.0", "cython ~= 0.29.0"]\n[project.optional-dependencies]\ntest = ["pytest"]\ndoc = ["sphinx", "furo"]', ); showQuickPickWithBackStub.resolves(undefined); await assert.isRejected(pickPackagesToInstall(workspace1)); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [{ label: 'test' }, { label: 'doc' }], { placeHolder: CreateEnv.Venv.tomlExtrasQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, ), ); }); test('Toml found with dependencies and user selects None', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(true); readFileStub.resolves( '[project]\nname = "spam"\nversion = "2020.0.0"\n[build-system]\nrequires = ["setuptools ~= 58.0", "cython ~= 0.29.0"]\n[project.optional-dependencies]\ntest = ["pytest"]\ndoc = ["sphinx", "furo"]', ); showQuickPickWithBackStub.resolves([]); const actual = await pickPackagesToInstall(workspace1); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [{ label: 'test' }, { label: 'doc' }], { placeHolder: CreateEnv.Venv.tomlExtrasQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, ), ); assert.deepStrictEqual(actual, [ { installType: 'toml', source: path.join(workspace1.uri.fsPath, 'pyproject.toml'), }, ]); }); test('Toml found with dependencies and user selects One', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(true); readFileStub.resolves( '[project]\nname = "spam"\nversion = "2020.0.0"\n[build-system]\nrequires = ["setuptools ~= 58.0", "cython ~= 0.29.0"]\n[project.optional-dependencies]\ntest = ["pytest"]\ndoc = ["sphinx", "furo"]', ); showQuickPickWithBackStub.resolves([{ label: 'doc' }]); const actual = await pickPackagesToInstall(workspace1); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [{ label: 'test' }, { label: 'doc' }], { placeHolder: CreateEnv.Venv.tomlExtrasQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, ), ); assert.deepStrictEqual(actual, [ { installType: 'toml', installItem: 'doc', source: path.join(workspace1.uri.fsPath, 'pyproject.toml'), }, { installType: 'toml', source: path.join(workspace1.uri.fsPath, 'pyproject.toml'), }, ]); }); test('Toml found with dependencies and user selects Few', async () => { findFilesStub.resolves([]); pathExistsStub.resolves(true); readFileStub.resolves( '[project]\nname = "spam"\nversion = "2020.0.0"\n[build-system]\nrequires = ["setuptools ~= 58.0", "cython ~= 0.29.0"]\n[project.optional-dependencies]\ntest = ["pytest"]\ndoc = ["sphinx", "furo"]\ncov = ["pytest-cov"]', ); showQuickPickWithBackStub.resolves([{ label: 'test' }, { label: 'cov' }]); const actual = await pickPackagesToInstall(workspace1); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [{ label: 'test' }, { label: 'doc' }, { label: 'cov' }], { placeHolder: CreateEnv.Venv.tomlExtrasQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, ), ); assert.deepStrictEqual(actual, [ { installType: 'toml', installItem: 'test', source: path.join(workspace1.uri.fsPath, 'pyproject.toml'), }, { installType: 'toml', installItem: 'cov', source: path.join(workspace1.uri.fsPath, 'pyproject.toml'), }, { installType: 'toml', source: path.join(workspace1.uri.fsPath, 'pyproject.toml'), }, ]); }); test('Requirements found, but user presses escape', async () => { pathExistsStub.resolves(true); readFileStub.resolves('[project]\nname = "spam"\nversion = "2020.0.0"\n'); let allow = true; findFilesStub.callsFake(() => { if (allow) { allow = false; return Promise.resolve([ Uri.file(path.join(workspace1.uri.fsPath, 'requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'dev-requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'test-requirements.txt')), ]); } return Promise.resolve([]); }); showQuickPickWithBackStub.resolves(undefined); await assert.isRejected(pickPackagesToInstall(workspace1)); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [ { label: 'requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'dev-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'test-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, ], { placeHolder: CreateEnv.Venv.requirementsQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, sinon.match.func, ), ); assert.isTrue(readFileStub.calledOnce); assert.isTrue(pathExistsStub.calledOnce); }); test('Requirements found and user selects None', async () => { let allow = true; findFilesStub.callsFake(() => { if (allow) { allow = false; return Promise.resolve([ Uri.file(path.join(workspace1.uri.fsPath, 'requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'dev-requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'test-requirements.txt')), ]); } return Promise.resolve([]); }); pathExistsStub.resolves(false); showQuickPickWithBackStub.resolves([]); const actual = await pickPackagesToInstall(workspace1); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [ { label: 'requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'dev-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'test-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, ], { placeHolder: CreateEnv.Venv.requirementsQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, sinon.match.func, ), ); assert.deepStrictEqual(actual, []); assert.isTrue(readFileStub.notCalled); }); test('Requirements found and user selects One', async () => { let allow = true; findFilesStub.callsFake(() => { if (allow) { allow = false; return Promise.resolve([ Uri.file(path.join(workspace1.uri.fsPath, 'requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'dev-requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'test-requirements.txt')), ]); } return Promise.resolve([]); }); pathExistsStub.resolves(false); showQuickPickWithBackStub.resolves([{ label: 'requirements.txt' }]); const actual = await pickPackagesToInstall(workspace1); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [ { label: 'requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'dev-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'test-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, ], { placeHolder: CreateEnv.Venv.requirementsQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, sinon.match.func, ), ); assert.deepStrictEqual(actual, [ { installType: 'requirements', installItem: path.join(workspace1.uri.fsPath, 'requirements.txt'), }, ]); assert.isTrue(readFileStub.notCalled); }); test('Requirements found and user selects Few', async () => { let allow = true; findFilesStub.callsFake(() => { if (allow) { allow = false; return Promise.resolve([ Uri.file(path.join(workspace1.uri.fsPath, 'requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'dev-requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'test-requirements.txt')), ]); } return Promise.resolve([]); }); pathExistsStub.resolves(false); showQuickPickWithBackStub.resolves([{ label: 'dev-requirements.txt' }, { label: 'test-requirements.txt' }]); const actual = await pickPackagesToInstall(workspace1); assert.isTrue( showQuickPickWithBackStub.calledWithExactly( [ { label: 'requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'dev-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, { label: 'test-requirements.txt', buttons: [OPEN_REQUIREMENTS_BUTTON] }, ], { placeHolder: CreateEnv.Venv.requirementsQuickPickTitle, ignoreFocusOut: true, canPickMany: true, }, undefined, sinon.match.func, ), ); assert.deepStrictEqual(actual, [ { installType: 'requirements', installItem: path.join(workspace1.uri.fsPath, 'dev-requirements.txt'), }, { installType: 'requirements', installItem: path.join(workspace1.uri.fsPath, 'test-requirements.txt'), }, ]); assert.isTrue(readFileStub.notCalled); }); test('User clicks button to open requirements.txt', async () => { let allow = true; findFilesStub.callsFake(() => { if (allow) { allow = false; return Promise.resolve([ Uri.file(path.join(workspace1.uri.fsPath, 'requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'dev-requirements.txt')), Uri.file(path.join(workspace1.uri.fsPath, 'test-requirements.txt')), ]); } return Promise.resolve([]); }); pathExistsStub.resolves(false); const deferred = createDeferred(); showQuickPickWithBackStub.callsFake(async (_items, _options, _token, callback) => { callback({ button: OPEN_REQUIREMENTS_BUTTON, item: { label: 'requirements.txt' }, }); await deferred.promise; return [{ label: 'requirements.txt' }]; }); let uri: Uri | undefined; showTextDocumentStub.callsFake((arg: Uri) => { uri = arg; deferred.resolve(); return Promise.resolve(); }); await pickPackagesToInstall(workspace1); assert.deepStrictEqual( uri?.toString(), Uri.file(path.join(workspace1.uri.fsPath, 'requirements.txt')).toString(), ); }); }); suite('Test pick existing venv action', () => { let withProgressStub: sinon.SinonStub; let showQuickPickWithBackStub: sinon.SinonStub; let pathExistsStub: sinon.SinonStub; const workspace1 = { uri: Uri.file(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'testMultiRootWkspc', 'workspace1')), name: 'workspace1', index: 0, }; setup(() => { pathExistsStub = sinon.stub(fs, 'pathExists'); withProgressStub = sinon.stub(windowApis, 'withProgress'); showQuickPickWithBackStub = sinon.stub(windowApis, 'showQuickPickWithBack'); }); teardown(() => { sinon.restore(); }); test('User selects existing venv', async () => { pathExistsStub.resolves(true); showQuickPickWithBackStub.resolves({ label: CreateEnv.Venv.useExisting, description: CreateEnv.Venv.useExistingDescription, }); const actual = await pickExistingVenvAction(workspace1); assert.deepStrictEqual(actual, ExistingVenvAction.UseExisting); }); test('User presses escape', async () => { pathExistsStub.resolves(true); showQuickPickWithBackStub.resolves(undefined); await assert.isRejected(pickExistingVenvAction(workspace1)); }); test('User selects delete venv', async () => { pathExistsStub.resolves(true); showQuickPickWithBackStub.resolves({ label: CreateEnv.Venv.recreate, description: CreateEnv.Venv.recreateDescription, }); withProgressStub.resolves(true); const actual = await pickExistingVenvAction(workspace1); assert.deepStrictEqual(actual, ExistingVenvAction.Recreate); }); test('User clicks on back', async () => { pathExistsStub.resolves(true); // We use reject with "Back" to simulate the user clicking on back. showQuickPickWithBackStub.rejects(windowApis.MultiStepAction.Back); withProgressStub.resolves(false); await assert.isRejected(pickExistingVenvAction(workspace1)); }); test('No venv found', async () => { pathExistsStub.resolves(false); const actual = await pickExistingVenvAction(workspace1); assert.deepStrictEqual(actual, ExistingVenvAction.Create); }); }); ```
/content/code_sandbox/src/test/pythonEnvironments/creation/provider/venvUtils.unit.test.ts
xml
2016-01-19T10:50:01
2024-08-12T21:05:24
pythonVSCode
DonJayamanne/pythonVSCode
2,078
3,931
```xml import react from '@vitejs/plugin-react-swc'; import path from 'path'; import wasm from 'vite-plugin-wasm'; import { defineConfig } from 'vitest/config'; export default defineConfig({ plugins: [react(), wasm()], test: { globals: true, environment: 'happy-dom', poolOptions: { threads: { singleThread: true }, }, reporters: ['basic'], setupFiles: './vitest.setup.ts', maxWorkers: 1, }, resolve: { alias: { 'proton-wallet': path.resolve(__dirname, './src/app'), }, }, }); ```
/content/code_sandbox/applications/wallet/vitest.config.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
139
```xml import * as React from 'react'; import { isConformant } from '../../testing/isConformant'; import { AppItemStatic } from './AppItemStatic'; import { appItemStaticClassNames } from './useAppItemStaticStyles.styles'; import { AppItemStaticProps } from './AppItemStatic.types'; describe('AppItemStatic', () => { isConformant({ Component: AppItemStatic as React.FunctionComponent<AppItemStaticProps>, displayName: 'AppItemStatic', testOptions: { 'has-static-classnames': [ { props: { icon: 'Test Icon', content: 'Some Content' }, expectedClassNames: { root: appItemStaticClassNames.root, icon: appItemStaticClassNames.icon, }, }, ], }, }); }); ```
/content/code_sandbox/packages/react-components/react-nav-preview/library/src/components/AppItemStatic/AppItemStatic.test.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
174
```xml <ExampleDesign> <Vendor>xilinx.com</Vendor> <Library>design</Library> <Name>cl_hls_dds</Name> <Version>1.0</Version> <Design>init.tcl</Design> <DisplayName>cl_hls_dds (IPI)</DisplayName> <Description>cl_hls_dds (IPI)</Description> <Image>ccl_hls_dds.png</Image> </ExampleDesign> ```
/content/code_sandbox/hdk/common/shell_v04261818/hlx/hlx_examples/build/IPI/cl_hls_dds/design.xml
xml
2016-11-04T22:04:05
2024-08-13T03:36:47
aws-fpga
aws/aws-fpga
1,499
92
```xml <?xml version="1.0" encoding="UTF-8"?> <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.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.4.0-M1</version> <relativePath /> <!-- lookup parent from repository --> </parent> <groupId>io.spring.sample</groupId> <artifactId>function-sample-aws-custom-bean</artifactId> <version>0.0.1-SNAPSHOT</version><!-- @releaser:version-check-off --> <name>AWS Custom Runtime - @Bean sample</name> <description>Demo project for Spring Cloud Function with custom AWS Lambda runtime using @Bean style</description> <properties> <wrapper.version>1.0.27.RELEASE</wrapper.version> <spring-cloud-function.version>4.2.0-SNAPSHOT</spring-cloud-function.version> </properties> <dependencies> <dependency> <!-- We don't need this dependency unless explicitly using APIGatewayProxyRequestEvent (as on of the function in this example) --> <groupId>com.amazonaws</groupId> <artifactId>aws-lambda-java-events</artifactId> <version>3.9.0</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-function-adapter-aws</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-function-dependencies</artifactId> <version>${spring-cloud-function.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <dependency> <groupId>org.springframework.boot.experimental</groupId> <artifactId>spring-boot-thin-layout</artifactId> <version>${wrapper.version}</version> </dependency> </dependencies> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <id>zip</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <inherited>false</inherited> </execution> </executions> <configuration> <descriptors> <descriptor>src/assembly/zip.xml</descriptor> </descriptors> </configuration> </plugin> </plugins> </build> <repositories> <repository> <id>spring-snapshots</id> <name>Spring Snapshots</name> <url>path_to_url </repository> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>path_to_url </repository> <repository> <id>spring-releases</id> <name>Spring Releases</name> <url>path_to_url </repository> </repositories> <pluginRepositories> <pluginRepository> <id>spring-snapshots</id> <name>Spring Snapshots</name> <url>path_to_url </pluginRepository> <pluginRepository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>path_to_url </pluginRepository> <pluginRepository> <id>spring-releases</id> <name>Spring Releases</name> <url>path_to_url </pluginRepository> </pluginRepositories> </project> ```
/content/code_sandbox/spring-cloud-function-samples/function-sample-aws-custom-bean/pom.xml
xml
2016-09-22T02:34:34
2024-08-16T08:19:07
spring-cloud-function
spring-cloud/spring-cloud-function
1,032
1,179
```xml <clickhouse> <keeper_server> <tcp_port>9181</tcp_port> <server_id>3</server_id> <log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path> <snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path> <coordination_settings> <operation_timeout_ms>5000</operation_timeout_ms> <session_timeout_ms>10000</session_timeout_ms> <raft_logs_level>trace</raft_logs_level> </coordination_settings> <raft_configuration> <server> <id>1</id> <hostname>node1</hostname> <port>9234</port> </server> <server> <id>2</id> <hostname>node2</hostname> <port>9234</port> </server> <server> <id>3</id> <hostname>node3</hostname> <port>9234</port> <start_as_follower>1</start_as_follower> </server> </raft_configuration> </keeper_server> </clickhouse> ```
/content/code_sandbox/tests/integration/test_keeper_three_nodes_two_alive/configs/enable_keeper3.xml
xml
2016-06-02T08:28:18
2024-08-16T18:39:33
ClickHouse
ClickHouse/ClickHouse
36,234
258
```xml import { IRadarrCombined } from "../../interfaces"; import { StateToken } from "@ngxs/store"; export const RADARR_STATE_TOKEN = new StateToken<RadarrState>('RadarrState'); export interface RadarrState { settings: IRadarrCombined; } ```
/content/code_sandbox/src/Ombi/ClientApp/src/app/state/radarr/types.ts
xml
2016-02-25T12:14:54
2024-08-14T22:56:44
Ombi
Ombi-app/Ombi
3,674
57
```xml /* eslint-disable storybook/story-exports */ const component = {}; export default { component, }; ```
/content/code_sandbox/code/core/src/core-server/utils/__mockdata__/errors/NoStories.stories.ts
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
21
```xml <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="idCellContactBirthday" rowHeight="80" id="VQX-SS-fj0" customClass="ContactBirthdayCell" customModule="Birthdays" customModuleProvider="target"> <rect key="frame" x="0.0" y="0.0" width="320" height="100"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="VQX-SS-fj0" id="4H4-gH-qIB"> <rect key="frame" x="0.0" y="0.0" width="287" height="99.5"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="749" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IL1-2K-CCw"> <rect key="frame" x="66" y="15" width="213" height="23"/> <fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="17"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AiX-ml-WcQ"> <rect key="frame" x="66" y="45" width="213" height="20"/> <fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="15"/> <color key="textColor" red="0.94509803920000002" green="0.41960784309999999" blue="0.14901960780000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zp7-Ka-Zyr"> <rect key="frame" x="66" y="71" width="213" height="20"/> <fontDescription key="fontDescription" name="Futura-MediumItalic" family="Futura" pointSize="15"/> <color key="textColor" red="0.94509803920000002" green="0.41960784309999999" blue="0.14901960780000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="oo7-cM-mPH"> <rect key="frame" x="8" y="25" width="50" height="50"/> <color key="backgroundColor" red="0.90196079019999997" green="0.90196079019999997" blue="0.90196079019999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="width" constant="50" id="V8A-vC-DYL"/> <constraint firstAttribute="height" constant="50" id="ae3-DS-O3E"/> </constraints> </imageView> </subviews> <constraints> <constraint firstAttribute="trailingMargin" secondItem="zp7-Ka-Zyr" secondAttribute="trailing" id="6IW-Cj-2xY"/> <constraint firstItem="IL1-2K-CCw" firstAttribute="leading" secondItem="oo7-cM-mPH" secondAttribute="trailing" constant="8" id="7gw-4s-cqq"/> <constraint firstItem="IL1-2K-CCw" firstAttribute="top" secondItem="4H4-gH-qIB" secondAttribute="topMargin" constant="7" id="IVu-45-M9G"/> <constraint firstItem="AiX-ml-WcQ" firstAttribute="leading" secondItem="oo7-cM-mPH" secondAttribute="trailing" constant="8" id="OYB-9T-Wg7"/> <constraint firstItem="zp7-Ka-Zyr" firstAttribute="leading" secondItem="4H4-gH-qIB" secondAttribute="leadingMargin" constant="58" id="RPf-LX-thX"/> <constraint firstItem="oo7-cM-mPH" firstAttribute="leading" secondItem="4H4-gH-qIB" secondAttribute="leadingMargin" id="bjK-Vp-vlE"/> <constraint firstItem="AiX-ml-WcQ" firstAttribute="top" secondItem="IL1-2K-CCw" secondAttribute="bottom" constant="7" id="fo5-VN-Ean"/> <constraint firstItem="zp7-Ka-Zyr" firstAttribute="bottom" secondItem="4H4-gH-qIB" secondAttribute="bottomMargin" id="mkE-Rd-VfI"/> <constraint firstItem="AiX-ml-WcQ" firstAttribute="trailing" secondItem="4H4-gH-qIB" secondAttribute="trailingMargin" id="q1c-5U-Fvq"/> <constraint firstAttribute="bottomMargin" secondItem="AiX-ml-WcQ" secondAttribute="bottom" constant="26" id="qOB-d5-6mU"/> <constraint firstItem="oo7-cM-mPH" firstAttribute="top" secondItem="4H4-gH-qIB" secondAttribute="topMargin" constant="17" id="qcY-df-y4t"/> <constraint firstItem="zp7-Ka-Zyr" firstAttribute="top" secondItem="AiX-ml-WcQ" secondAttribute="bottom" constant="6" id="vyZ-KC-jjK"/> <constraint firstItem="IL1-2K-CCw" firstAttribute="trailing" secondItem="4H4-gH-qIB" secondAttribute="trailingMargin" id="wLx-OL-eyK"/> </constraints> </tableViewCellContentView> <connections> <outlet property="imgContactImage" destination="oo7-cM-mPH" id="jWt-RT-xva"/> <outlet property="lblBirthday" destination="AiX-ml-WcQ" id="IQA-Qz-uiV"/> <outlet property="lblEmail" destination="zp7-Ka-Zyr" id="dKt-jv-nHr"/> <outlet property="lblFullname" destination="IL1-2K-CCw" id="MeT-WS-5yZ"/> </connections> <point key="canvasLocation" x="444" y="366"/> </tableViewCell> </objects> </document> ```
/content/code_sandbox/Project 23 - Birthdays/Birthdays/ContactBirthdayCell.xib
xml
2016-02-14T20:14:21
2024-08-15T20:49:08
Swift-30-Projects
soapyigu/Swift-30-Projects
8,036
1,981
```xml // See LICENSE.txt for license information. import {tableSchema} from '@nozbe/watermelondb'; import {MM_TABLES} from '@constants/database'; const {USER} = MM_TABLES.SERVER; export default tableSchema({ name: USER, columns: [ {name: 'auth_service', type: 'string'}, {name: 'delete_at', type: 'number'}, {name: 'email', type: 'string'}, {name: 'first_name', type: 'string'}, {name: 'is_bot', type: 'boolean'}, {name: 'is_guest', type: 'boolean'}, {name: 'last_name', type: 'string'}, {name: 'last_picture_update', type: 'number'}, {name: 'locale', type: 'string'}, {name: 'nickname', type: 'string'}, {name: 'notify_props', type: 'string'}, {name: 'position', type: 'string'}, {name: 'props', type: 'string'}, {name: 'remote_id', type: 'string', isOptional: true}, {name: 'roles', type: 'string'}, {name: 'status', type: 'string'}, {name: 'timezone', type: 'string'}, {name: 'update_at', type: 'number'}, {name: 'username', type: 'string'}, {name: 'terms_of_service_id', type: 'string'}, {name: 'terms_of_service_create_at', type: 'number'}, ], }); ```
/content/code_sandbox/app/database/schema/server/table_schemas/user.ts
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
337
```xml <launch> <!-- Arguments --> <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/> <arg name="configuration_basename" default="turtlebot3_lds_2d.lua"/> <arg name="sensor_range" default="1.0"/> <arg name="cmd_vel_topic" default="/cmd_vel" /> <arg name="odom_topic" default="odom" /> <!-- TurtleBot3 and Gmapping --> <include file="$(find turtlebot3_slam)/launch/turtlebot3_gmapping.launch"> <arg name="model" value="$(arg model)" /> </include> <!-- AMCL --> <include file="$(find turtlebot3_navigation)/launch/amcl.launch"/> <!-- move_base --> <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen"> <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" /> <rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="global_costmap" /> <rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="local_costmap" /> <rosparam file="$(find turtlebot3_navigation)/param/local_costmap_params.yaml" command="load" /> <rosparam file="$(find turtlebot3_navigation)/param/global_costmap_params.yaml" command="load" /> <rosparam file="$(find turtlebot3_navigation)/param/move_base_params.yaml" command="load" /> <rosparam file="$(find turtlebot3_navigation)/param/dwa_local_planner_params_$(arg model).yaml" command="load" /> <remap from="cmd_vel" to="$(arg cmd_vel_topic)"/> <remap from="odom" to="$(arg odom_topic)"/> </node> <!-- frontier_exploration --> <node pkg="frontier_exploration" type="explore_client" name="explore_client" output="screen"/> <node pkg="frontier_exploration" type="explore_server" name="explore_server" output="screen" > <param name="frequency" type="double" value="1.0"/> <param name="goal_aliasing" type="double" value="$(arg sensor_range)"/> <rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="explore_costmap" /> <rosparam file="$(find turtlebot3_slam)/config/frontier_exploration.yaml" command="load" ns="explore_costmap" /> </node> </launch> ```
/content/code_sandbox/turtlebot3_slam/launch/turtlebot3_frontier_exploration.launch
xml
2016-06-21T07:14:22
2024-08-16T09:12:21
turtlebot3
ROBOTIS-GIT/turtlebot3
1,457
612
```xml import type { ButtonHTMLAttributes, ReactElement, ReactNode, Ref } from 'react'; import { cloneElement, forwardRef } from 'react'; import clsx from '@proton/utils/clsx'; import noop from '@proton/utils/noop'; import { Tooltip } from '../tooltip'; interface Props extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> { icon?: ReactElement; children?: ReactNode; title?: ReactNode; } const ToolbarButton = ( { icon, children, className, disabled, tabIndex, title, onClick, ...rest }: Props, ref: Ref<HTMLButtonElement> ) => { const content = ( <button type="button" className={clsx([className, 'flex shrink-0 toolbar-button'])} onClick={disabled ? noop : onClick} tabIndex={disabled ? -1 : tabIndex} disabled={disabled} ref={ref} {...rest} > {icon && cloneElement(icon, { className: clsx([icon.props.className, 'toolbar-icon m-auto']), })} {children} </button> ); if (title) { return <Tooltip title={title}>{content}</Tooltip>; } return content; }; export default forwardRef<HTMLButtonElement, Props>(ToolbarButton); ```
/content/code_sandbox/packages/components/components/toolbar/ToolbarButton.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
276
```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. --> <RelativeLayout xmlns:android="path_to_url" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?windowBackground" > <View android:layout_width="match_parent" android:layout_height="0dp" android:id="@+id/status_bar" android:background="@android:color/black" /> <RelativeLayout android:id="@+id/buttons" android:layout_height="wrap_content" android:layout_width="match_parent"> <LinearLayout style="?android:attr/buttonBarStyle" android:id="@+id/selectDate" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingTop="5dp" android:paddingLeft="15dp" android:paddingRight="15dp"> <Button style="?android:attr/buttonBarButtonStyle" android:id="@+id/setDate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="?textColor" android:layout_weight="1" android:text="@string/pick_date"/> <Button style="?android:attr/buttonBarButtonStyle" android:id="@+id/setTime" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="?textColor" android:layout_weight="1" android:text="@string/pick_time"/> </LinearLayout> <LinearLayout android:id="@+id/time_and_date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/selectDate" android:orientation="horizontal" android:paddingBottom="5dp" android:paddingLeft="15dp" android:paddingRight="15dp"> <TextView android:id="@+id/currentDate" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" android:textSize="25sp" android:textColor="?dateColor" android:gravity="center"/> <TextView android:id="@+id/currentTime" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" android:textSize="25sp" android:textColor="?dateColor" android:gravity="center"/> </LinearLayout> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/sendBar" android:layout_alignParentBottom="true"> <ImageButton android:id="@+id/emojiButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignTop="@+id/messageEntry2" android:layout_alignBottom="@+id/messageEntry2" android:src="?emoji_button" android:background="?android:selectableItemBackground" android:paddingLeft="10dp" android:paddingRight="10dp" android:layout_marginRight="-7dp" android:scaleType="fitCenter"/> <LinearLayout android:id="@+id/messageEntry2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="horizontal" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/emojiButton"> <EditText android:id="@+id/tweet_content" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:paddingRight="10dp" android:ems="10" android:hint="@string/compose_tweet_hint" android:inputType="textCapSentences|textMultiLine|textShortMessage" android:maxLines="8" android:minHeight="50dp" android:minLines="2" android:textColor="?textColor" android:fontFamily="sans-serif-light" android:textSize="17sp" /> <TextView android:id="@+id/char_remaining" android:layout_width="48dp" android:layout_height="wrap_content" android:textSize="10dp" android:textColor="?dateColor" android:fontFamily="sans-serif-light" android:gravity="center"/> </LinearLayout> <include layout="@layout/emoji_keyboard" android:layout_below="@+id/messageEntry2"/> </RelativeLayout> </RelativeLayout> ```
/content/code_sandbox/app/src/main/res/layout/scheduled_new_tweet_activity.xml
xml
2016-07-08T03:18:40
2024-08-14T02:54:51
talon-for-twitter-android
klinker24/talon-for-twitter-android
1,189
1,056
```xml import { getOperationManifestFromProject } from "../getOperationManifestFromProject"; import { GraphQLClientProject } from "apollo-language-server"; const mergedOperationsAndFragmentsForService = require("./fixtures/mockOperations.json"); describe("getOperationManifestFromProject", () => { const mockProject = { mergedOperationsAndFragmentsForService, } as GraphQLClientProject; it("builds an operation manifest", () => { // XXX // This is mostly a sanity check, and should prevent someone from unintentionally changing the way // that operations are normalized. expect(getOperationManifestFromProject(mockProject)).toMatchSnapshot(); }); }); ```
/content/code_sandbox/packages/apollo/src/utils/__tests__/getOperationManifestFromProject.test.ts
xml
2016-08-12T15:28:09
2024-08-03T08:25:34
apollo-tooling
apollographql/apollo-tooling
3,040
136
```xml /* eslint global-require: 0 */ import { AccountStore } from '../stores/account-store'; import { Task } from './task'; import * as Actions from '../actions'; import * as Attributes from '../attributes'; import { Message } from '../models/message'; import SoundRegistry from '../../registries/sound-registry'; import { Composer as ComposerExtensionRegistry } from '../../registries/extension-registry'; import { LocalizedErrorStrings } from '../../mailsync-process'; import { localized } from '../../intl'; import { AttributeValues } from '../models/model'; import { Contact } from '../models/contact'; import { ZERO_WIDTH_SPACE } from '../../components/composer-editor/plaintext'; function applyExtensionTransforms(draft: Message, recipient: Contact) { // Note / todo: This code assumes that: // - any changes made to the draft (eg: metadata) should be saved. // - any changes made to a HTML body will be made to draftBodyRootNode NOT to the draft.body // - any changes made to a plaintext body will be made to draft.body. const before = draft.body; const extensions = ComposerExtensionRegistry.extensions().filter( ext => !!ext.applyTransformsForSending ); if (draft.plaintext) { for (const ext of extensions) { ext.applyTransformsForSending({ draft, recipient }); } const after = draft.body; draft.body = before; return after; } else { const fragment = document.createDocumentFragment(); const draftBodyRootNode = document.createElement('root'); fragment.appendChild(draftBodyRootNode); draftBodyRootNode.innerHTML = draft.body; for (const ext of extensions) { ext.applyTransformsForSending({ draft, draftBodyRootNode, recipient }); if (draft.body !== before) { throw new Error( 'applyTransformsForSending should modify the HTML body DOM (draftBodyRootNode) not the draft.body.' ); } } return draftBodyRootNode.innerHTML; } } export class SendDraftTask extends Task { static forSending(d: Message, { silent }: { silent?: boolean } = {}) { const task = new SendDraftTask({}); task.draft = d.clone(); task.headerMessageId = task.draft.headerMessageId; task.silent = silent; const separateBodies = ComposerExtensionRegistry.extensions().some( ext => ext.needsPerRecipientBodies && ext.needsPerRecipientBodies(task.draft) ); if (task.draft.plaintext) { // Our editor uses zero-width spaces to differentiate between soft and hard newlines // when you're editing, and we don't want to send these characters. task.draft.body = task.draft.body.replace(new RegExp(ZERO_WIDTH_SPACE, 'g'), ''); } if (separateBodies) { task.perRecipientBodies = { self: task.draft.body, }; task.draft.participants({ includeFrom: false, includeBcc: true }).forEach(recipient => { task.perRecipientBodies[recipient.email] = applyExtensionTransforms(task.draft, recipient); }); } else { task.draft.body = applyExtensionTransforms(task.draft, null); } return task; } static attributes = { ...Task.attributes, draft: Attributes.Obj({ modelKey: 'draft', itemClass: Message, }), headerMessageId: Attributes.String({ modelKey: 'headerMessageId', }), perRecipientBodies: Attributes.Obj({ modelKey: 'perRecipientBodies', }), silent: Attributes.Boolean({ modelKey: 'silent', }), }; draft: Message; perRecipientBodies: { [email: string]: string }; silent: boolean; constructor(data: AttributeValues<typeof SendDraftTask.attributes> = {}) { super(data); } get accountId() { return this.draft.accountId; } set accountId(a) { // no-op } get headerMessageId() { return this.draft.headerMessageId; } set headerMessageId(h) { // no-op } label() { return this.silent ? null : localized('Sending message'); } willBeQueued() { const account = AccountStore.accountForEmail(this.draft.from[0].email); if (!this.draft.from[0]) { throw new Error('SendDraftTask - you must populate `from` before sending.'); } if (!account) { throw new Error('SendDraftTask - you can only send drafts from a configured account.'); } if (this.draft.accountId !== account.id) { throw new Error( localized( "The from address has changed since you started sending this draft. Double-check the draft and click 'Send' again." ) ); } } onSuccess() { Actions.draftDeliverySucceeded({ headerMessageId: this.draft.headerMessageId, accountId: this.draft.accountId, }); // Play the sending sound if (AppEnv.config.get('core.sending.sounds') && !this.silent) { SoundRegistry.playSound('send'); } // Fire off events to record the usage of open and link tracking const extensions = ComposerExtensionRegistry.extensions(); for (const ext of extensions) { if (ext.onSendSuccess) { ext.onSendSuccess(this.draft); } } } onError({ key, debuginfo }) { let errorMessage = null; let errorDetail = null; if (key === 'no-sent-folder') { errorMessage = localized( 'Your `Sent Mail` folder could not be automatically detected. Visit Preferences > Folders to choose a Sent folder and then try again.' ); errorDetail = localized( 'In order to send mail through Mailspring, your email account must have a Sent Mail folder. You can specify a Sent folder manually by visiting Preferences > Folders and choosing a folder name from the dropdown menu.' ); } else if (key === 'no-trash-folder') { errorMessage = localized( 'Your `Trash` folder could not be automatically detected. Visit Preferences > Folders to choose a Trash folder and then try again.' ); errorDetail = localized( 'In order to send mail through Mailspring, your email account must have a Trash folder. You can specify a Trash folder manually by visiting Preferences > Folders and choosing a folder name from the dropdown menu.' ); } else if (key === 'send-partially-failed') { const [smtpError, emails] = debuginfo.split(':::'); errorMessage = localized( "We were unable to deliver this message to some recipients. Click 'See Details' for more information." ); errorDetail = localized( `We encountered an SMTP Gateway error that prevented this message from being delivered to all recipients. The message was only sent successfully to these recipients:\n%@\n\nError: %@`, emails, LocalizedErrorStrings[smtpError] ); } else if (key === 'send-failed') { errorMessage = localized( `Sorry, Mailspring was unable to deliver this message: %@`, LocalizedErrorStrings[debuginfo] || debuginfo ); } else { errorMessage = localized('We were unable to deliver this message.'); errorDetail = `${localized(`An unknown error has occurred`)}: ${JSON.stringify({ key, debuginfo, })}`; } Actions.draftDeliveryFailed({ threadId: this.draft.threadId, headerMessageId: this.draft.headerMessageId, errorMessage, errorDetail, }); } } ```
/content/code_sandbox/app/src/flux/tasks/send-draft-task.ts
xml
2016-10-13T06:45:50
2024-08-16T18:14:37
Mailspring
Foundry376/Mailspring
15,331
1,659
```xml <vector xmlns:android="path_to_url" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="#FFF" android:pathData="M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z" /> </vector> ```
/content/code_sandbox/custom-ui/src/main/res/drawable/ayp_ic_fullscreen_exit_24dp.xml
xml
2016-08-29T12:04:03
2024-08-16T13:03:46
android-youtube-player
PierfrancescoSoffritti/android-youtube-player
3,391
126
```xml import type { RuleProcessor } from '../../types/index.noReact'; import { defaultValueProcessorByRule } from './defaultValueProcessorByRule'; import { mapSQLOperator, quoteFieldNamesWithArray } from './utils'; /** * Default rule processor used by {@link formatQuery} for "sql" format. */ export const defaultRuleProcessorSQL: RuleProcessor = (rule, opts) => { const { parseNumbers, escapeQuotes, quoteFieldNamesWith = ['', ''] as [string, string], quoteValuesWith = `'`, valueProcessor = defaultValueProcessorByRule, } = opts ?? {}; const value = valueProcessor(rule, { parseNumbers, escapeQuotes, quoteFieldNamesWith, quoteValuesWith, }); const operator = mapSQLOperator(rule.operator); const operatorLowerCase = operator.toLowerCase(); if ( (operatorLowerCase === 'in' || operatorLowerCase === 'not in' || operatorLowerCase === 'between' || operatorLowerCase === 'not between') && !value ) { return ''; } const [qPre, qPost] = quoteFieldNamesWithArray(quoteFieldNamesWith); return `${qPre}${rule.field}${qPost} ${operator} ${value}`.trim(); }; ```
/content/code_sandbox/packages/react-querybuilder/src/utils/formatQuery/defaultRuleProcessorSQL.ts
xml
2016-06-17T22:03:19
2024-08-16T10:28:42
react-querybuilder
react-querybuilder/react-querybuilder
1,131
271
```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. --> <!-- This layout defines the main screen and will display the list of weather or an error --> <FrameLayout xmlns:android="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This RecyclerView will be responsible for displaying our list of weather data. All of - - its layout attributes should make sense to you, perhaps except for - - android:clipToPadding="false". When we set clipToPadding to false, we are telling - - RecyclerView to not resize the over-scrolling effect that happens when you attempt to - - scroll past the end of the content. - - - - Go ahead and test it out yourself. Set clipToPadding to "true" and scroll to the very - - bottom of the list. Then, keep scrolling. You'll see the "glow" that happens. That is - - called an EdgeEffect in Android. The problem when clipToPadding is set to "true" is - - that there is a gap between the bottom of the screen and the EdgeEffect. Set - - clipToPadding to "false" again and observe how the gap is gone. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerview_forecast" android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" android:paddingBottom="8dp"/> <TextView android:id="@+id/tv_error_message_display" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="16dp" android:text="@string/error_message" android:textSize="20sp" android:visibility="invisible" /> <!-- A progress bar that will be shown to users to indicate that weather data is loading --> <ProgressBar android:id="@+id/pb_loading_indicator" android:layout_width="42dp" android:layout_height="42dp" android:layout_gravity="center" android:visibility="invisible" /> </FrameLayout> ```
/content/code_sandbox/S09.03-Exercise-ContentProviderDelete/app/src/main/res/layout/activity_forecast.xml
xml
2016-11-02T04:42:26
2024-08-12T19:38:06
ud851-Sunshine
udacity/ud851-Sunshine
1,999
596
```xml <?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="path_to_url"> <sitemap> <loc>path_to_url <lastmod>2016-01-01T00:00:00+00:00</lastmod> </sitemap> <sitemap> <loc>path_to_url <lastmod>2016-01-01T00:00:00+00:00</lastmod> </sitemap> </sitemapindex> ```
/content/code_sandbox/tests/__snapshots__/SitemapIndexTest__multiple_sitemaps_can_be_added_to_the_index__1.xml
xml
2016-08-12T11:56:26
2024-08-15T17:05:59
laravel-sitemap
spatie/laravel-sitemap
2,254
110
```xml import {test, expect} from 'vitest'; import parse from '@commitlint/parse'; import {bodyFullStop} from './body-full-stop.js'; const messages = { empty: 'test:\n', with: `test: subject\n\nbody.`, without: `test: subject\n\nbody`, }; const parsed = { empty: parse(messages.empty), with: parse(messages.with), without: parse(messages.without), }; test('empty against "always" should succeed', async () => { const [actual] = bodyFullStop(await parsed.empty, 'always', '.'); const expected = true; expect(actual).toEqual(expected); }); test('empty against "never ." should succeed', async () => { const [actual] = bodyFullStop(await parsed.empty, 'never', '.'); const expected = true; expect(actual).toEqual(expected); }); test('with against "always ." should succeed', async () => { const [actual] = bodyFullStop(await parsed.with, 'always', '.'); const expected = true; expect(actual).toEqual(expected); }); test('with against "never ." should fail', async () => { const [actual] = bodyFullStop(await parsed.with, 'never', '.'); const expected = false; expect(actual).toEqual(expected); }); test('without against "always ." should fail', async () => { const [actual] = bodyFullStop(await parsed.without, 'always', '.'); const expected = false; expect(actual).toEqual(expected); }); test('without against "never ." should succeed', async () => { const [actual] = bodyFullStop(await parsed.without, 'never', '.'); const expected = true; expect(actual).toEqual(expected); }); ```
/content/code_sandbox/@commitlint/rules/src/body-full-stop.test.ts
xml
2016-02-12T08:37:56
2024-08-16T13:28:33
commitlint
conventional-changelog/commitlint
16,499
354
```xml import * as React from 'react'; import { DemoPage } from '../DemoPage'; import { MessageBarPageProps } from '@fluentui/react-examples/lib/react/MessageBar/MessageBar.doc'; export const MessageBarPage = (props: { isHeaderVisible: boolean }) => ( <DemoPage jsonDocs={require('../../../dist/api/react/MessageBar.page.json')} {...{ ...MessageBarPageProps, ...props }} /> ); ```
/content/code_sandbox/apps/public-docsite-resources/src/components/pages/MessageBarPage.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
97
```xml import type { FC } from 'react'; import React from 'react'; interface ItemInterface { text: string; value: string; } interface GenericInterface<T> { value: T; } interface Props { interface: ItemInterface; genericInterface: GenericInterface<string>; } export const Component: FC<Props> = (props: Props) => <>JSON.stringify(props)</>; ```
/content/code_sandbox/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/interfaces.tsx
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
81
```xml import * as lunr from "lunr"; import { Observable, firstValueFrom, map } from "rxjs"; import { Jsonify } from "type-fest"; import { SearchService as SearchServiceAbstraction } from "../abstractions/search.service"; import { UriMatchStrategy } from "../models/domain/domain-service"; import { I18nService } from "../platform/abstractions/i18n.service"; import { LogService } from "../platform/abstractions/log.service"; import { ActiveUserState, StateProvider, UserKeyDefinition, VAULT_SEARCH_MEMORY, } from "../platform/state"; import { SendView } from "../tools/send/models/view/send.view"; import { IndexedEntityId } from "../types/guid"; import { FieldType } from "../vault/enums"; import { CipherType } from "../vault/enums/cipher-type"; import { CipherView } from "../vault/models/view/cipher.view"; export type SerializedLunrIndex = { version: string; fields: string[]; fieldVectors: [string, number[]]; invertedIndex: any[]; pipeline: string[]; }; /** * The `KeyDefinition` for accessing the search index in application state. * The key definition is configured to clear the index when the user locks the vault. */ export const LUNR_SEARCH_INDEX = new UserKeyDefinition<SerializedLunrIndex>( VAULT_SEARCH_MEMORY, "searchIndex", { deserializer: (obj: Jsonify<SerializedLunrIndex>) => obj, clearOn: ["lock", "logout"], }, ); /** * The `KeyDefinition` for accessing the ID of the entity currently indexed by Lunr search. * The key definition is configured to clear the indexed entity ID when the user locks the vault. */ export const LUNR_SEARCH_INDEXED_ENTITY_ID = new UserKeyDefinition<IndexedEntityId>( VAULT_SEARCH_MEMORY, "searchIndexedEntityId", { deserializer: (obj: Jsonify<IndexedEntityId>) => obj, clearOn: ["lock", "logout"], }, ); /** * The `KeyDefinition` for accessing the state of Lunr search indexing, indicating whether the Lunr search index is currently being built or updating. * The key definition is configured to clear the indexing state when the user locks the vault. */ export const LUNR_SEARCH_INDEXING = new UserKeyDefinition<boolean>( VAULT_SEARCH_MEMORY, "isIndexing", { deserializer: (obj: Jsonify<boolean>) => obj, clearOn: ["lock", "logout"], }, ); export class SearchService implements SearchServiceAbstraction { private static registeredPipeline = false; private searchIndexState: ActiveUserState<SerializedLunrIndex> = this.stateProvider.getActive(LUNR_SEARCH_INDEX); private readonly index$: Observable<lunr.Index | null> = this.searchIndexState.state$.pipe( map((searchIndex) => (searchIndex ? lunr.Index.load(searchIndex) : null)), ); private searchIndexEntityIdState: ActiveUserState<IndexedEntityId> = this.stateProvider.getActive( LUNR_SEARCH_INDEXED_ENTITY_ID, ); readonly indexedEntityId$: Observable<IndexedEntityId | null> = this.searchIndexEntityIdState.state$.pipe(map((id) => id)); private searchIsIndexingState: ActiveUserState<boolean> = this.stateProvider.getActive(LUNR_SEARCH_INDEXING); private readonly searchIsIndexing$: Observable<boolean> = this.searchIsIndexingState.state$.pipe( map((indexing) => indexing ?? false), ); private readonly immediateSearchLocales: string[] = ["zh-CN", "zh-TW", "ja", "ko", "vi"]; private readonly defaultSearchableMinLength: number = 2; private searchableMinLength: number = this.defaultSearchableMinLength; constructor( private logService: LogService, private i18nService: I18nService, private stateProvider: StateProvider, ) { this.i18nService.locale$.subscribe((locale) => { if (this.immediateSearchLocales.indexOf(locale) !== -1) { this.searchableMinLength = 1; } else { this.searchableMinLength = this.defaultSearchableMinLength; } }); // Currently have to ensure this is only done a single time. Lunr allows you to register a function // multiple times but they will add a warning message to the console. The way they do that breaks when ran on a service worker. if (!SearchService.registeredPipeline) { SearchService.registeredPipeline = true; //register lunr pipeline function lunr.Pipeline.registerFunction(this.normalizeAccentsPipelineFunction, "normalizeAccents"); } } async clearIndex(): Promise<void> { await this.searchIndexEntityIdState.update(() => null); await this.searchIndexState.update(() => null); await this.searchIsIndexingState.update(() => null); } async isSearchable(query: string): Promise<boolean> { query = SearchService.normalizeSearchQuery(query); const index = await this.getIndexForSearch(); const notSearchable = query == null || (index == null && query.length < this.searchableMinLength) || (index != null && query.length < this.searchableMinLength && query.indexOf(">") !== 0); return !notSearchable; } async indexCiphers(ciphers: CipherView[], indexedEntityId?: string): Promise<void> { if (await this.getIsIndexing()) { return; } await this.setIsIndexing(true); await this.setIndexedEntityIdForSearch(indexedEntityId as IndexedEntityId); const builder = new lunr.Builder(); builder.pipeline.add(this.normalizeAccentsPipelineFunction); builder.ref("id"); builder.field("shortid", { boost: 100, extractor: (c: CipherView) => c.id.substr(0, 8) }); builder.field("name", { boost: 10, }); builder.field("subtitle", { boost: 5, extractor: (c: CipherView) => { if (c.subTitle != null && c.type === CipherType.Card) { return c.subTitle.replace(/\*/g, ""); } return c.subTitle; }, }); builder.field("notes"); builder.field("login.username", { extractor: (c: CipherView) => c.type === CipherType.Login && c.login != null ? c.login.username : null, }); builder.field("login.uris", { boost: 2, extractor: (c: CipherView) => this.uriExtractor(c) }); builder.field("fields", { extractor: (c: CipherView) => this.fieldExtractor(c, false) }); builder.field("fields_joined", { extractor: (c: CipherView) => this.fieldExtractor(c, true) }); builder.field("attachments", { extractor: (c: CipherView) => this.attachmentExtractor(c, false), }); builder.field("attachments_joined", { extractor: (c: CipherView) => this.attachmentExtractor(c, true), }); builder.field("organizationid", { extractor: (c: CipherView) => c.organizationId }); ciphers = ciphers || []; ciphers.forEach((c) => builder.add(c)); const index = builder.build(); await this.setIndexForSearch(index.toJSON() as SerializedLunrIndex); await this.setIsIndexing(false); this.logService.info("Finished search indexing"); } async searchCiphers( query: string, filter: ((cipher: CipherView) => boolean) | ((cipher: CipherView) => boolean)[] = null, ciphers: CipherView[], ): Promise<CipherView[]> { const results: CipherView[] = []; if (query != null) { query = SearchService.normalizeSearchQuery(query.trim().toLowerCase()); } if (query === "") { query = null; } if (ciphers == null) { ciphers = []; } if (filter != null && Array.isArray(filter) && filter.length > 0) { ciphers = ciphers.filter((c) => filter.every((f) => f == null || f(c))); } else if (filter != null) { ciphers = ciphers.filter(filter as (cipher: CipherView) => boolean); } if (!(await this.isSearchable(query))) { return ciphers; } if (await this.getIsIndexing()) { await new Promise((r) => setTimeout(r, 250)); if (await this.getIsIndexing()) { await new Promise((r) => setTimeout(r, 500)); } } const index = await this.getIndexForSearch(); if (index == null) { // Fall back to basic search if index is not available return this.searchCiphersBasic(ciphers, query); } const ciphersMap = new Map<string, CipherView>(); ciphers.forEach((c) => ciphersMap.set(c.id, c)); let searchResults: lunr.Index.Result[] = null; const isQueryString = query != null && query.length > 1 && query.indexOf(">") === 0; if (isQueryString) { try { searchResults = index.search(query.substr(1).trim()); } catch (e) { this.logService.error(e); } } else { const soWild = lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING; searchResults = index.query((q) => { lunr.tokenizer(query).forEach((token) => { const t = token.toString(); q.term(t, { fields: ["name"], wildcard: soWild }); q.term(t, { fields: ["subtitle"], wildcard: soWild }); q.term(t, { fields: ["login.uris"], wildcard: soWild }); q.term(t, {}); }); }); } if (searchResults != null) { searchResults.forEach((r) => { if (ciphersMap.has(r.ref)) { results.push(ciphersMap.get(r.ref)); } }); } return results; } searchCiphersBasic(ciphers: CipherView[], query: string, deleted = false) { query = SearchService.normalizeSearchQuery(query.trim().toLowerCase()); return ciphers.filter((c) => { if (deleted !== c.isDeleted) { return false; } if (c.name != null && c.name.toLowerCase().indexOf(query) > -1) { return true; } if (query.length >= 8 && c.id.startsWith(query)) { return true; } if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(query) > -1) { return true; } if ( c.login && c.login.hasUris && c.login.uris.some((loginUri) => loginUri?.uri?.toLowerCase().indexOf(query) > -1) ) { return true; } return false; }); } searchSends(sends: SendView[], query: string) { query = SearchService.normalizeSearchQuery(query.trim().toLocaleLowerCase()); if (query === null) { return sends; } const sendsMatched: SendView[] = []; const lowPriorityMatched: SendView[] = []; sends.forEach((s) => { if (s.name != null && s.name.toLowerCase().indexOf(query) > -1) { sendsMatched.push(s); } else if ( query.length >= 8 && (s.id.startsWith(query) || s.accessId.toLocaleLowerCase().startsWith(query) || (s.file?.id != null && s.file.id.startsWith(query))) ) { lowPriorityMatched.push(s); } else if (s.notes != null && s.notes.toLowerCase().indexOf(query) > -1) { lowPriorityMatched.push(s); } else if (s.text?.text != null && s.text.text.toLowerCase().indexOf(query) > -1) { lowPriorityMatched.push(s); } else if (s.file?.fileName != null && s.file.fileName.toLowerCase().indexOf(query) > -1) { lowPriorityMatched.push(s); } }); return sendsMatched.concat(lowPriorityMatched); } async getIndexForSearch(): Promise<lunr.Index | null> { return await firstValueFrom(this.index$); } private async setIndexForSearch(index: SerializedLunrIndex): Promise<void> { await this.searchIndexState.update(() => index); } private async setIndexedEntityIdForSearch(indexedEntityId: IndexedEntityId): Promise<void> { await this.searchIndexEntityIdState.update(() => indexedEntityId); } private async setIsIndexing(indexing: boolean): Promise<void> { await this.searchIsIndexingState.update(() => indexing); } private async getIsIndexing(): Promise<boolean> { return await firstValueFrom(this.searchIsIndexing$); } private fieldExtractor(c: CipherView, joined: boolean) { if (!c.hasFields) { return null; } let fields: string[] = []; c.fields.forEach((f) => { if (f.name != null) { fields.push(f.name); } if (f.type === FieldType.Text && f.value != null) { fields.push(f.value); } }); fields = fields.filter((f) => f.trim() !== ""); if (fields.length === 0) { return null; } return joined ? fields.join(" ") : fields; } private attachmentExtractor(c: CipherView, joined: boolean) { if (!c.hasAttachments) { return null; } let attachments: string[] = []; c.attachments.forEach((a) => { if (a != null && a.fileName != null) { if (joined && a.fileName.indexOf(".") > -1) { attachments.push(a.fileName.substr(0, a.fileName.lastIndexOf("."))); } else { attachments.push(a.fileName); } } }); attachments = attachments.filter((f) => f.trim() !== ""); if (attachments.length === 0) { return null; } return joined ? attachments.join(" ") : attachments; } private uriExtractor(c: CipherView) { if (c.type !== CipherType.Login || c.login == null || !c.login.hasUris) { return null; } const uris: string[] = []; c.login.uris.forEach((u) => { if (u.uri == null || u.uri === "") { return; } if (u.hostname != null) { uris.push(u.hostname); return; } let uri = u.uri; if (u.match !== UriMatchStrategy.RegularExpression) { const protocolIndex = uri.indexOf("://"); if (protocolIndex > -1) { uri = uri.substr(protocolIndex + 3); } const queryIndex = uri.search(/\?|&|#/); if (queryIndex > -1) { uri = uri.substring(0, queryIndex); } } uris.push(uri); }); return uris.length > 0 ? uris : null; } private normalizeAccentsPipelineFunction(token: lunr.Token): any { const searchableFields = ["name", "login.username", "subtitle", "notes"]; const fields = (token as any).metadata["fields"]; const checkFields = fields.every((i: any) => searchableFields.includes(i)); if (checkFields) { return SearchService.normalizeSearchQuery(token.toString()); } return token; } // Remove accents/diacritics characters from text. This regex is equivalent to the Diacritic unicode property escape, i.e. it will match all diacritic characters. static normalizeSearchQuery(query: string): string { return query?.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); } } ```
/content/code_sandbox/libs/common/src/services/search.service.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
3,467
```xml import { describe, expect, test } from 'vitest'; import { createSessionToken, getAuthenticatedMessage } from '../src'; describe('Auth Utilities', () => { describe('createSessionToken', () => { test('should generate session token', () => { expect(createSessionToken()).toHaveProperty('expires'); expect(createSessionToken().expires).toBeInstanceOf(Date); }); }); describe('getAuthenticatedMessage', () => { test('should generate user message token', () => { expect(getAuthenticatedMessage('foo')).toEqual("you are authenticated as 'foo'"); }); }); }); ```
/content/code_sandbox/packages/utils/test/auth-utils.spec.ts
xml
2016-04-15T16:21:12
2024-08-16T09:38:01
verdaccio
verdaccio/verdaccio
16,189
128
```xml import { ThemeComponent as TC, Theme } from '../runtime'; import { Dark } from './dark'; export type ClassicDarkOptions = Theme; /** * Dark theme. */ export const ClassicDark: TC<ClassicDarkOptions> = (options) => { return Object.assign( {}, Dark(), { category10: 'category10', category20: 'category20', }, options, ); }; ClassicDark.props = {}; ```
/content/code_sandbox/src/theme/classicDark.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
94
```xml /* * * See the LICENSE file at the top-level directory of this distribution * for licensing information. * * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation, * no part of this software, including this file, may be copied, modified, * propagated, or distributed except according to the terms contained in the * LICENSE file. * * Removal or modification of this copyright notice is prohibited. */ export { BaseChannel } from './base_channel'; export { IPCChannel } from './ipc_channel'; export { InMemoryChannel } from './in_memory_channel'; ```
/content/code_sandbox/framework/src/controller/channels/index.ts
xml
2016-02-01T21:45:35
2024-08-15T19:16:48
lisk-sdk
LiskArchive/lisk-sdk
2,721
118
```xml /* * Wire * * This program is free software: you can redistribute it and/or modify * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * along with this program. If not, see path_to_url * */ import React, {useEffect, useState} from 'react'; import {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; import {ClientEntity} from 'src/script/client/ClientEntity'; import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {useUserIdentity} from 'src/script/hooks/useDeviceIdentities'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {DetailedDevice} from './components/DetailedDevice'; import {Device} from './components/Device'; import {DeviceDetailsPreferences} from './components/DeviceDetailsPreferences'; import {ClientState} from '../../../../../client/ClientState'; import {ConversationState} from '../../../../../conversation/ConversationState'; import {PreferencesPage} from '../components/PreferencesPage'; interface DevicesPreferencesProps { clientState: ClientState; conversationState: ConversationState; cryptographyRepository: CryptographyRepository; selfUser: User; removeDevice: (device: ClientEntity) => Promise<unknown>; resetSession: (userId: QualifiedId, device: ClientEntity, conversation: Conversation) => Promise<void>; verifyDevice: (userId: QualifiedId, device: ClientEntity, isVerified: boolean) => void; } export const DevicesPreferences: React.FC<DevicesPreferencesProps> = ({ clientState = container.resolve(ClientState), conversationState = container.resolve(ConversationState), cryptographyRepository, selfUser, removeDevice, verifyDevice, resetSession, }) => { const [selectedDevice, setSelectedDevice] = useState<ClientEntity | undefined>(); const [localFingerprint, setLocalFingerprint] = useState(''); const {devices} = useKoSubscribableChildren(selfUser, ['devices']); const {getDeviceIdentity} = useUserIdentity( selfUser.qualifiedId, conversationState.selfMLSConversation()?.groupId, true, ); const currentClient = clientState.currentClient; const isSSO = selfUser.isNoPasswordSSO; const getFingerprint = (device: ClientEntity) => cryptographyRepository.getRemoteFingerprint(selfUser.qualifiedId, device.id); useEffect(() => { void cryptographyRepository.getLocalFingerprint().then(setLocalFingerprint); }, [cryptographyRepository]); if (selectedDevice) { return ( <DeviceDetailsPreferences getDeviceIdentity={getDeviceIdentity} device={selectedDevice} getFingerprint={getFingerprint} onRemove={async device => { await removeDevice(device); setSelectedDevice(undefined); }} onClose={() => setSelectedDevice(undefined)} onVerify={(device, verified) => verifyDevice(selfUser.qualifiedId, device, verified)} onResetSession={device => resetSession(selfUser.qualifiedId, device, conversationState.getSelfProteusConversation()) } /> ); } return ( <PreferencesPage title={t('preferencesDevices')}> <fieldset className="preferences-section" data-uie-name="preferences-device-current"> <legend className="preferences-header">{t('preferencesDevicesCurrent')}</legend> {currentClient && ( <DetailedDevice isCurrentDevice device={currentClient} fingerprint={localFingerprint} getDeviceIdentity={getDeviceIdentity} /> )} </fieldset> <hr className="preferences-devices-separator preferences-separator" /> {devices.length > 0 && ( <fieldset className="preferences-section"> <legend className="preferences-header">{t('preferencesDevicesActive')}</legend> {devices.map((device, index) => ( <Device device={device} key={device.id} isSSO={isSSO} onSelect={setSelectedDevice} onRemove={removeDevice} deviceNumber={++index} getDeviceIdentity={getDeviceIdentity} /> ))} <p className="preferences-detail">{t('preferencesDevicesActiveDetail')}</p> </fieldset> )} </PreferencesPage> ); }; ```
/content/code_sandbox/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx
xml
2016-07-21T15:34:05
2024-08-16T11:40:13
wire-webapp
wireapp/wire-webapp
1,125
974
```xml import { computeArcBoundingBox } from '../src/boundingBox' const boundingBoxCases = [ { args: [0, 0, 100, 0, 360], expected: { x: -100, y: -100, width: 200, height: 200, }, }, { args: [0, 0, 100, 0, 90], expected: { x: 0, y: 0, width: 100, height: 100, }, }, { args: [0, 0, 100, -90, 0], expected: { x: 0, y: -100, width: 100, height: 100, }, }, { args: [0, 0, 100, 90, 180], expected: { x: -100, y: 0, width: 100, height: 100, }, }, ] for (const boundingBoxCase of boundingBoxCases) { const { args, expected } = boundingBoxCase test(`computeArcBoundingBox() for position ${args[0]}, ${args[1]} with radius ${args[2]}, starting at ${args[3]}, ending at ${args[4]}`, () => { const box = computeArcBoundingBox(...args) for (const prop in expected) { expect(box).toHaveProperty(prop, expected[prop]) } }) } ```
/content/code_sandbox/packages/arcs/tests/boundingBox.test.ts
xml
2016-04-16T03:27:56
2024-08-16T03:38:37
nivo
plouc/nivo
13,010
331
```xml export const rangeMap = ( n: number, start1: number, stop1: number, start2: number, stop2: number ): number => { return ((n - start1) / (stop1 - start1)) * (stop2 - start2) + start2; }; export const closestNumber = (number: number, numbers: Array<number>) => numbers.sort((a, b) => a - b).find((item) => item > number); export const randomInRange = (min: number, max: number) => Math.random() * (max - min) + min; ```
/content/code_sandbox/source/renderer/app/utils/numbers.ts
xml
2016-10-05T13:48:54
2024-08-13T22:03:19
daedalus
input-output-hk/daedalus
1,230
135
```xml import { promisify } from 'util'; /** * Wait `n` ticks. This allows async tasks to progress. * @param n The number of ticks to wait */ export async function tick(n = 1): Promise<void> { const nextTickAsPromised = promisify(process.nextTick); for await (const _ of Array.from({ length: n })) { await nextTickAsPromised(); } } ```
/content/code_sandbox/packages/test-helpers/src/tick.ts
xml
2016-02-12T13:14:28
2024-08-15T18:38:25
stryker-js
stryker-mutator/stryker-js
2,561
90
```xml export * from './components/DialogActions/index'; ```
/content/code_sandbox/packages/react-components/react-dialog/library/src/DialogActions.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
11
```xml export const foo = () => 'not mocked'; ```
/content/code_sandbox/code/core/template/stories/utils.ts
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
11