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 { Meta } from '@storybook/react'; import { Toolbar } from '@fluentui/react-northstar'; import ToolbarExampleCustomContentShorthand from '../../examples/components/Toolbar/Content/ToolbarExampleCustomContent.shorthand'; import ToolbarExampleMenuItemToggle from '../../examples/components/Toolbar/Content/ToolbarExampleMenuItemToggle.shorthand'; import ToolbarExampleMenuRadioGroup from '../../examples/components/Toolbar/Content/ToolbarExampleMenuRadioGroup.shorthand'; import ToolbarExample from '../../examples/components/Toolbar/Types/ToolbarExample'; export default { component: Toolbar, title: 'Toolbar' } as Meta<typeof Toolbar>; export { ToolbarExampleCustomContentShorthand, ToolbarExampleMenuItemToggle, ToolbarExampleMenuRadioGroup, ToolbarExample, }; ```
/content/code_sandbox/packages/fluentui/docs/src/vr-tests/Toolbar/Toolbar.stories.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
152
```xml import { DIALOG_DATA, DialogConfig } from "@angular/cdk/dialog"; import { Component, Inject, OnInit } from "@angular/core"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { OrganizationUserService } from "@bitwarden/common/admin-console/abstractions/organization-user/organization-user.service"; import { OrganizationUserBulkConfirmRequest } from "@bitwarden/common/admin-console/abstractions/organization-user/requests"; import { OrganizationUserStatusType } from "@bitwarden/common/admin-console/enums"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key"; import { DialogService } from "@bitwarden/components"; import { BulkUserDetails } from "./bulk-status.component"; type BulkConfirmDialogData = { organizationId: string; users: BulkUserDetails[]; }; @Component({ selector: "app-bulk-confirm", templateUrl: "bulk-confirm.component.html", }) export class BulkConfirmComponent implements OnInit { organizationId: string; users: BulkUserDetails[]; excludedUsers: BulkUserDetails[]; filteredUsers: BulkUserDetails[]; publicKeys: Map<string, Uint8Array> = new Map(); fingerprints: Map<string, string> = new Map(); statuses: Map<string, string> = new Map(); loading = true; done = false; error: string; constructor( @Inject(DIALOG_DATA) protected data: BulkConfirmDialogData, protected cryptoService: CryptoService, protected apiService: ApiService, private organizationUserService: OrganizationUserService, private i18nService: I18nService, ) { this.organizationId = data.organizationId; this.users = data.users; } async ngOnInit() { this.excludedUsers = this.users.filter((u) => !this.isAccepted(u)); this.filteredUsers = this.users.filter((u) => this.isAccepted(u)); if (this.filteredUsers.length <= 0) { this.done = true; } const response = await this.getPublicKeys(); for (const entry of response.data) { const publicKey = Utils.fromB64ToArray(entry.key); const fingerprint = await this.cryptoService.getFingerprint(entry.userId, publicKey); if (fingerprint != null) { this.publicKeys.set(entry.id, publicKey); this.fingerprints.set(entry.id, fingerprint.join("-")); } } this.loading = false; } async submit() { this.loading = true; try { const key = await this.getCryptoKey(); const userIdsWithKeys: any[] = []; for (const user of this.filteredUsers) { const publicKey = this.publicKeys.get(user.id); if (publicKey == null) { continue; } const encryptedKey = await this.cryptoService.rsaEncrypt(key.key, publicKey); userIdsWithKeys.push({ id: user.id, key: encryptedKey.encryptedString, }); } const response = await this.postConfirmRequest(userIdsWithKeys); response.data.forEach((entry) => { const error = entry.error !== "" ? entry.error : this.i18nService.t("bulkConfirmMessage"); this.statuses.set(entry.id, error); }); this.done = true; } catch (e) { this.error = e.message; } this.loading = false; } protected isAccepted(user: BulkUserDetails) { return user.status === OrganizationUserStatusType.Accepted; } protected async getPublicKeys() { return await this.organizationUserService.postOrganizationUsersPublicKey( this.organizationId, this.filteredUsers.map((user) => user.id), ); } protected getCryptoKey(): Promise<SymmetricCryptoKey> { return this.cryptoService.getOrgKey(this.organizationId); } protected async postConfirmRequest(userIdsWithKeys: any[]) { const request = new OrganizationUserBulkConfirmRequest(userIdsWithKeys); return await this.organizationUserService.postOrganizationUserBulkConfirm( this.organizationId, request, ); } static open(dialogService: DialogService, config: DialogConfig<BulkConfirmDialogData>) { return dialogService.open(BulkConfirmComponent, config); } } ```
/content/code_sandbox/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-confirm.component.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
953
```xml import { getId } from '@fluentui/react/lib/Utilities'; export interface IExample { key: string; title: string; onRender?: () => JSX.Element; } export class ExampleGroup { private _title: string; private _examples: IExample[]; constructor(title: string) { this._title = title; this._examples = []; } public get title(): string { return this._title; } public get examples(): IExample[] { return this._examples; } public add(title: string, onRender: () => JSX.Element): ExampleGroup { this._examples.push({ key: getId(), title, onRender, }); return this; } } export function examplesOf(title: string): ExampleGroup { return new ExampleGroup(title); } ```
/content/code_sandbox/packages/react-docsite-components/src/utilities/examplesOf.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
178
```xml <!-- or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file path_to_url Unless required by applicable law or agreed to in writing, "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY specific language governing permissions and limitations --> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.pulsar</groupId> <artifactId>tiered-storage-parent</artifactId> <version>4.0.0-SNAPSHOT</version> </parent> <artifactId>tiered-storage-file-system</artifactId> <name>Apache Pulsar :: Tiered Storage :: File System</name> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>managed-ledger</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>${hdfs-offload-version3}</version> <exclusions> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-hdfs-client</artifactId> <version>${hdfs-offload-version3}</version> <exclusions> <exclusion> <groupId>org.apache.avro</groupId> <artifactId>avro</artifactId> </exclusion> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> </exclusion> <exclusion> <groupId>com.sun.jersey</groupId> <artifactId>jersey-core</artifactId> </exclusion> <exclusion> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server</artifactId> </exclusion> <exclusion> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </exclusion> </exclusions> </dependency> <!-- fix hadoop-commons vulnerable dependencies --> <dependency> <groupId>org.apache.avro</groupId> <artifactId>avro</artifactId> <version>${avro.version}</version> </dependency> <!-- fix hadoop-commons vulnerable dependencies --> <dependency> <groupId>net.minidev</groupId> <artifactId>json-smart</artifactId> <version>${json-smart.version}</version> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>testmocks</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-minicluster</artifactId> <version>${hdfs-offload-version3}</version> <scope>test</scope> <exclusions> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> </exclusion> <exclusion> <groupId>org.bouncycastle</groupId> <artifactId>*</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcpkix-jdk18on</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-codec-http</artifactId> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-alpn-conscrypt-server</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-util</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.nifi</groupId> <artifactId>nifi-nar-maven-plugin</artifactId> </plugin> <plugin> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> <version>${spotbugs-maven-plugin.version}</version> <configuration> <excludeFilterFile>${basedir}/src/main/resources/findbugsExclude.xml</excludeFilterFile> </configuration> <executions> <execution> <id>spotbugs</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <executions> <execution> <id>checkstyle</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <profiles> <!-- The only working way for OWASP dependency checker plugin to exclude module when failBuildOnCVSS is used in the root pom's plugin. --> <profile> <id>owasp-dependency-check</id> <build> <plugins> <plugin> <groupId>org.owasp</groupId> <artifactId>dependency-check-maven</artifactId> <executions> <execution> <goals> <goal>aggregate</goal> </goals> <phase>none</phase> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project> ```
/content/code_sandbox/tiered-storage/file-system/pom.xml
xml
2016-06-28T07:00:03
2024-08-16T17:12:43
pulsar
apache/pulsar
14,047
1,565
```xml import Datetime from '@nateradebaugh/react-datetime'; import React from 'react'; import { FlexWrapper } from './styles'; type Props = { onChange?: (e: React.FormEvent<HTMLElement>) => void; defaultValue?: any; value?: any; placeholder?: string; name?: string; errors?: any; dateFormat?: string; required?: boolean; timeFormat?: boolean; registerChild?: (child: any) => void; }; class DateControl extends React.Component<Props> { static defaultProps = { dateFormat: 'MMM,DD YYYY', }; componentDidMount() { const { registerChild } = this.props; if (registerChild) { registerChild(this); } } render() { const { errors, value, name, placeholder, dateFormat, timeFormat, required, } = this.props; const errorMessage = errors && errors[name || '']; // cancel custom browser default form validation error const onChange = (e) => { if (this.props.onChange) { this.props.onChange(e); } }; const inputProps = { name, placeholder: placeholder || '', required: required || false, autoComplete: 'off', }; const attributes = { inputProps, dateFormat, timeFormat: timeFormat || false, value, closeOnSelect: true, onChange, utc: true, }; return ( <FlexWrapper> <Datetime {...attributes} /> {errorMessage} </FlexWrapper> ); } } export default DateControl; ```
/content/code_sandbox/exm/modules/common/form/DateControl.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
345
```xml <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="path_to_url" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" > <shape android:innerRadiusRatio="3" android:shape="ring" android:thicknessRatio="8" android:useLevel="false" > <gradient android:centerColor="#12ff0e" android:centerX="0.50" android:centerY="0.50" android:endColor="#09bb07" android:startColor="#ffffff" android:type="sweep" android:useLevel="false" /> </shape> </rotate> ```
/content/code_sandbox/library/oneKeyShareSDK/src/main/res/drawable/ssdk_oks_classic_progressbar.xml
xml
2016-09-26T09:42:41
2024-08-12T07:09:06
AndroidFire
jaydenxiao2016/AndroidFire
2,634
167
```xml <?xml version="1.0"?> <wayfire> <plugin name="fisheye"> <_short>Fisheye</_short> <_long>A plugin which provides fisheye effect.</_long> <category>Effects</category> <option name="toggle" type="activator"> <_short>Toggle</_short> <_long>Toggles fisheye with the specified activator.</_long> <default>&lt;super&gt; &lt;ctrl&gt; KEY_F</default> </option> <option name="radius" type="double"> <_short>Radius</_short> <_long>Sets the border radius in pixels.</_long> <default>450.0</default> <min>1.0</min> </option> <option name="zoom" type="double"> <_short>Zoom</_short> <_long>Sets the zoom factor.</_long> <default>7.0</default> <min>1.0</min> <max>20.0</max> <precision>0.01</precision> </option> </plugin> </wayfire> ```
/content/code_sandbox/metadata/fisheye.xml
xml
2016-03-04T15:00:44
2024-08-16T19:04:29
wayfire
WayfireWM/wayfire
2,346
280
```xml import React, { useEffect } from "react"; import { GraphQLError } from "graphql"; import gql from "graphql-tag"; import { act } from "@testing-library/react"; import { render, waitFor, screen, renderHook } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import fetchMock from "fetch-mock"; import { ApolloClient, ApolloError, ApolloLink, ApolloQueryResult, Cache, NetworkStatus, Observable, ObservableQuery, TypedDocumentNode, } from "../../../core"; import { InMemoryCache } from "../../../cache"; import { itAsync, MockedProvider, MockSubscriptionLink, mockSingleLink, subscribeAndCount, MockedResponse, } from "../../../testing"; import { ApolloProvider } from "../../context"; import { useQuery } from "../useQuery"; import { useMutation } from "../useMutation"; import { BatchHttpLink } from "../../../link/batch-http"; import { FetchResult } from "../../../link/core"; import { profileHook, spyOnConsole } from "../../../testing/internal"; describe("useMutation Hook", () => { interface Todo { id: number; description: string; priority: string; } const CREATE_TODO_MUTATION = gql` mutation createTodo($description: String!, $priority: String) { createTodo(description: $description, priority: $priority) { id description priority } } `; const CREATE_TODO_RESULT = { createTodo: { id: 1, description: "Get milk!", priority: "High", __typename: "Todo", }, }; const CREATE_TODO_ERROR = "Failed to create item"; describe("General use", () => { it("should handle a simple mutation properly", async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; const { result } = renderHook(() => useMutation(CREATE_TODO_MUTATION), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), }); expect(result.current[1].loading).toBe(false); expect(result.current[1].data).toBe(undefined); const createTodo = result.current[0]; act(() => void createTodo({ variables })); expect(result.current[1].loading).toBe(true); expect(result.current[1].data).toBe(undefined); await waitFor( () => { expect(result.current[1].loading).toBe(false); }, { interval: 1 } ); expect(result.current[1].data).toEqual(CREATE_TODO_RESULT); }); it("should be able to call mutations as an effect", async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; const useCreateTodo = () => { const [createTodo, { loading, data }] = useMutation(CREATE_TODO_MUTATION); useEffect(() => { createTodo({ variables }); }, [variables]); return { loading, data }; }; const { result } = renderHook(() => useCreateTodo(), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), }); expect(result.current.loading).toBe(true); expect(result.current.data).toBe(undefined); await waitFor( () => { expect(result.current.loading).toBe(false); }, { interval: 1 } ); expect(result.current.data).toEqual(CREATE_TODO_RESULT); }); it("should ensure the mutation callback function has a stable identity no matter what", async () => { const variables1 = { description: "Get milk", }; const data1 = { createTodo: { id: 1, description: "Get milk!", priority: "High", __typename: "Todo", }, }; const variables2 = { description: "Write blog post", }; const data2 = { createTodo: { id: 1, description: "Write blog post", priority: "High", __typename: "Todo", }, }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables: variables1, }, result: { data: data1 }, }, { request: { query: CREATE_TODO_MUTATION, variables: variables2, }, result: { data: data2 }, }, ]; const { result, rerender } = renderHook( ({ variables }) => useMutation(CREATE_TODO_MUTATION, { variables }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), initialProps: { variables: variables1, }, } ); const createTodo = result.current[0]; expect(result.current[1].loading).toBe(false); expect(result.current[1].data).toBe(undefined); act(() => void createTodo()); expect(createTodo).toBe(result.current[0]); expect(result.current[1].loading).toBe(true); expect(result.current[1].data).toBe(undefined); await waitFor( () => { expect(result.current[1].loading).toBe(false); }, { interval: 1 } ); expect(result.current[0]).toBe(createTodo); expect(result.current[1].data).toEqual(data1); rerender({ variables: variables2 }); act(() => void createTodo()); await waitFor( () => { expect(result.current[1].loading).toBe(false); }, { interval: 1 } ); expect(result.current[0]).toBe(createTodo); expect(result.current[1].data).toEqual(data2); }); it("should not call setResult on an unmounted component", async () => { using consoleSpies = spyOnConsole("error"); const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; const useCreateTodo = () => { const [createTodo, { reset }] = useMutation(CREATE_TODO_MUTATION); return { reset, createTodo }; }; const { result, unmount } = renderHook(() => useCreateTodo(), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), }); unmount(); await act(async () => { await result.current.createTodo({ variables }); await result.current.reset(); }); expect(consoleSpies.error).not.toHaveBeenCalled(); }); it("should resolve mutate function promise with mutation results", async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; const { result } = renderHook(() => useMutation(CREATE_TODO_MUTATION), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), }); await act(async () => { await expect(result.current[0]({ variables })).resolves.toEqual({ data: CREATE_TODO_RESULT, }); }); }); describe("mutate function upon error", () => { it("resolves with the resulting data and errors", async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT, errors: [new GraphQLError(CREATE_TODO_ERROR)], }, }, ]; const onError = jest.fn(); const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { onError }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables }); }); expect(fetchResult.data).toBe(undefined); expect(fetchResult.errors.message).toBe(CREATE_TODO_ERROR); expect(onError).toHaveBeenCalledTimes(1); expect(onError.mock.calls[0][0].message).toBe(CREATE_TODO_ERROR); }); it("should reject when theres only an error and no error policy is set", async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { errors: [{ message: CREATE_TODO_ERROR }], }, }, ]; const { result } = renderHook(() => useMutation(CREATE_TODO_MUTATION), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), }); const createTodo = result.current[0]; let fetchError: any; await act(async () => { // need to call createTodo this way to get act warnings to go away. try { await createTodo({ variables }); } catch (err) { fetchError = err; return; } throw new Error("function did not error"); }); expect(fetchError).toEqual( new ApolloError({ graphQLErrors: [{ message: CREATE_TODO_ERROR }] }) ); }); it(`should reject when errorPolicy is 'none'`, async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT, errors: [new GraphQLError(CREATE_TODO_ERROR)], }, }, ]; const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { errorPolicy: "none" }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; await act(async () => { await expect(createTodo({ variables })).rejects.toThrow( CREATE_TODO_ERROR ); }); }); it(`should resolve with 'data' and 'error' properties when errorPolicy is 'all'`, async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT, errors: [new GraphQLError(CREATE_TODO_ERROR)], }, }, ]; const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { errorPolicy: "all" }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables }); }); expect(fetchResult.data).toEqual(CREATE_TODO_RESULT); expect(fetchResult.errors[0].message).toEqual(CREATE_TODO_ERROR); }); it(`should call onError when errorPolicy is 'all'`, async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT, errors: [new GraphQLError(CREATE_TODO_ERROR)], }, }, ]; const onError = jest.fn(); const onCompleted = jest.fn(); const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { errorPolicy: "all", onError, onCompleted, }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables }); }); expect(fetchResult.data).toEqual(CREATE_TODO_RESULT); expect(fetchResult.errors[0].message).toEqual(CREATE_TODO_ERROR); expect(onError).toHaveBeenCalledTimes(1); expect(onError.mock.calls[0][0].message).toBe(CREATE_TODO_ERROR); expect(onCompleted).not.toHaveBeenCalled(); }); it(`should ignore errors when errorPolicy is 'ignore'`, async () => { using consoleSpy = spyOnConsole("error"); const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { errors: [new GraphQLError(CREATE_TODO_ERROR)], }, }, ]; const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { errorPolicy: "ignore" }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables }); }); expect(fetchResult).toEqual({}); expect(consoleSpy.error).toHaveBeenCalledTimes(1); expect(consoleSpy.error.mock.calls[0][0]).toMatch("Missing field"); }); it(`should not call onError when errorPolicy is 'ignore'`, async () => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { errors: [new GraphQLError(CREATE_TODO_ERROR)], }, }, ]; const onError = jest.fn(); const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { errorPolicy: "ignore", onError, }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables }); }); expect(fetchResult).toEqual({}); expect(onError).not.toHaveBeenCalled(); }); }); it("should return the current client instance in the result object", async () => { const { result } = renderHook(() => useMutation(CREATE_TODO_MUTATION), { wrapper: ({ children }) => <MockedProvider>{children}</MockedProvider>, }); expect(result.current[1].client).toBeInstanceOf(ApolloClient); }); it("should call client passed to execute function", async () => { const { result } = renderHook(() => useMutation(CREATE_TODO_MUTATION), { wrapper: ({ children }) => <MockedProvider>{children}</MockedProvider>, }); const link = mockSingleLink(); const cache = new InMemoryCache(); const client = new ApolloClient({ cache, link, }); const mutateSpy = jest.spyOn(client, "mutate").mockImplementation( () => new Promise((resolve) => { resolve({ data: CREATE_TODO_RESULT }); }) ); const createTodo = result.current[0]; await act(async () => { await createTodo({ client }); }); expect(mutateSpy).toHaveBeenCalledTimes(1); }); it("should merge provided variables", async () => { const CREATE_TODO_DATA = { createTodo: { id: 1, description: "Get milk!", priority: "Low", __typename: "Todo", }, }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables: { priority: "Low", description: "Get milk.", }, }, result: { data: CREATE_TODO_DATA, }, }, ]; const { result } = renderHook( () => useMutation< { createTodo: Todo }, { priority?: string; description?: string } >(CREATE_TODO_MUTATION, { variables: { priority: "Low" }, }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables: { description: "Get milk." }, }); }); expect(fetchResult).toEqual({ data: CREATE_TODO_DATA }); }); it("should be possible to reset the mutation", async () => { const CREATE_TODO_DATA = { createTodo: { id: 1, priority: "Low", description: "Get milk!", __typename: "Todo", }, }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables: { priority: "Low", description: "Get milk.", }, }, result: { data: CREATE_TODO_DATA, }, }, ]; const { result } = renderHook( () => useMutation< { createTodo: Todo }, { priority: string; description: string } >(CREATE_TODO_MUTATION), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables: { priority: "Low", description: "Get milk." }, }); }); expect(fetchResult).toEqual({ data: CREATE_TODO_DATA }); expect(result.current[1].data).toEqual(CREATE_TODO_DATA); setTimeout(() => { result.current[1].reset(); }); await waitFor( () => { expect(result.current[1].data).toBe(undefined); }, { interval: 1 } ); }); it("resetting while a mutation is running: ensure that the result doesn't end up in the hook", async () => { const CREATE_TODO_DATA = { createTodo: { id: 1, priority: "Low", description: "Get milk!", __typename: "Todo", }, }; const mocks: MockedResponse[] = [ { request: { query: CREATE_TODO_MUTATION, variables: { priority: "Low", description: "Get milk.", }, }, result: { data: CREATE_TODO_DATA, }, delay: 20, }, ]; const ProfiledHook = profileHook(() => useMutation< { createTodo: Todo }, { priority: string; description: string } >(CREATE_TODO_MUTATION) ); render(<ProfiledHook />, { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), }); let createTodo: Awaited<ReturnType<typeof ProfiledHook.takeSnapshot>>[0]; let reset: Awaited< ReturnType<typeof ProfiledHook.takeSnapshot> >[1]["reset"]; { const [mutate, result] = await ProfiledHook.takeSnapshot(); createTodo = mutate; reset = result.reset; //initial value expect(result.data).toBe(undefined); expect(result.loading).toBe(false); expect(result.called).toBe(false); } let fetchResult: any; act(() => { fetchResult = createTodo({ variables: { priority: "Low", description: "Get milk." }, }); }); { const [, result] = await ProfiledHook.takeSnapshot(); // started loading expect(result.data).toBe(undefined); expect(result.loading).toBe(true); expect(result.called).toBe(true); } act(() => reset()); { const [, result] = await ProfiledHook.takeSnapshot(); // reset to initial value expect(result.data).toBe(undefined); expect(result.loading).toBe(false); expect(result.called).toBe(false); } expect(await fetchResult).toEqual({ data: CREATE_TODO_DATA }); await expect(ProfiledHook).not.toRerender(); }); }); describe("Callbacks", () => { it("should allow passing an onCompleted handler to the execution function", async () => { const CREATE_TODO_DATA = { createTodo: { id: 1, priority: "Low", description: "Get milk!", __typename: "Todo", }, }; const variables = { priority: "Low", description: "Get milk.", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_DATA, }, }, ]; const { result } = renderHook( () => useMutation< { createTodo: Todo }, { priority: string; description: string } >(CREATE_TODO_MUTATION), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; const onCompleted = jest.fn(); const onError = jest.fn(); await act(async () => { fetchResult = await createTodo({ variables, onCompleted, onError, }); }); expect(fetchResult).toEqual({ data: CREATE_TODO_DATA }); expect(result.current[1].data).toEqual(CREATE_TODO_DATA); expect(onCompleted).toHaveBeenCalledTimes(1); expect(onCompleted).toHaveBeenCalledWith( CREATE_TODO_DATA, expect.objectContaining({ variables }) ); expect(onError).toHaveBeenCalledTimes(0); }); it("prefers the onCompleted handler passed to the execution function rather than the hook", async () => { const CREATE_TODO_DATA = { createTodo: { id: 1, priority: "Low", description: "Get milk!", __typename: "Todo", }, }; const variables = { priority: "Low", description: "Get milk.", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_DATA, }, }, ]; const hookOnCompleted = jest.fn(); const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { onCompleted: hookOnCompleted }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const [createTodo] = result.current; const onCompleted = jest.fn(); await act(async () => { await createTodo({ variables, onCompleted }); }); expect(onCompleted).toHaveBeenCalledTimes(1); expect(hookOnCompleted).not.toHaveBeenCalled(); }); it("should allow passing an onError handler to the execution function", async () => { const errors = [new GraphQLError(CREATE_TODO_ERROR)]; const variables = { priority: "Low", description: "Get milk.", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { errors, }, }, ]; const { result } = renderHook( () => useMutation< { createTodo: Todo }, { priority: string; description: string } >(CREATE_TODO_MUTATION), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; const onCompleted = jest.fn(); const onError = jest.fn(); await act(async () => { fetchResult = await createTodo({ variables, onCompleted, onError, }); }); expect(fetchResult).toEqual({ data: undefined, errors: new ApolloError({ graphQLErrors: errors }), }); expect(onCompleted).toHaveBeenCalledTimes(0); expect(onError).toHaveBeenCalledTimes(1); expect(onError).toHaveBeenCalledWith( new ApolloError({ graphQLErrors: errors }), expect.objectContaining({ variables }) ); }); it("prefers the onError handler passed to the execution function instead of the hook", async () => { const variables = { priority: "Low", description: "Get milk.", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { errors: [new GraphQLError(CREATE_TODO_ERROR)], }, }, ]; const hookOnError = jest.fn(); const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION, { onError: hookOnError }), { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), } ); const [createTodo] = result.current; const onError = jest.fn(); await act(async () => { await createTodo({ variables, onError }); }); expect(onError).toHaveBeenCalledTimes(1); expect(hookOnError).not.toHaveBeenCalled(); }); it("should allow updating onError while mutation is executing", async () => { const errors = [{ message: CREATE_TODO_ERROR }]; const variables = { priority: "Low", description: "Get milk.", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { errors, }, }, ]; const onCompleted = jest.fn(); const onError = jest.fn(); const { result, rerender } = renderHook( ({ onCompleted, onError }) => { return useMutation< { createTodo: Todo }, { priority: string; description: string } >(CREATE_TODO_MUTATION, { onCompleted, onError }); }, { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), initialProps: { onCompleted, onError }, } ); const createTodo = result.current[0]; let fetchResult: any; const onError1 = jest.fn(); rerender({ onCompleted, onError: onError1 }); await act(async () => { fetchResult = await createTodo({ variables, }); }); expect(fetchResult).toEqual({ data: undefined, errors: new ApolloError({ graphQLErrors: errors }), }); expect(onCompleted).toHaveBeenCalledTimes(0); expect(onError).toHaveBeenCalledTimes(0); expect(onError1).toHaveBeenCalledTimes(1); expect(onError1).toHaveBeenCalledWith( new ApolloError({ graphQLErrors: errors }), expect.objectContaining({ variables }) ); }); it("should never allow onCompleted handler to be stale", async () => { const CREATE_TODO_DATA = { createTodo: { id: 1, priority: "Low", description: "Get milk!", __typename: "Todo", }, }; const variables = { priority: "Low", description: "Get milk2.", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_DATA, }, }, ]; const onCompleted = jest.fn(); const { result, rerender } = renderHook( ({ onCompleted }) => { return useMutation< { createTodo: Todo }, { priority: string; description: string } >(CREATE_TODO_MUTATION, { onCompleted }); }, { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), initialProps: { onCompleted }, } ); const onCompleted1 = jest.fn(); rerender({ onCompleted: onCompleted1 }); const createTodo = result.current[0]; let fetchResult: any; await act(async () => { fetchResult = await createTodo({ variables, }); }); expect(fetchResult).toEqual({ data: CREATE_TODO_DATA }); expect(result.current[1].data).toEqual(CREATE_TODO_DATA); expect(onCompleted).toHaveBeenCalledTimes(0); expect(onCompleted1).toHaveBeenCalledTimes(1); expect(onCompleted1).toHaveBeenCalledWith( CREATE_TODO_DATA, expect.objectContaining({ variables }) ); }); it("should allow updating onCompleted while mutation is executing", async () => { const CREATE_TODO_DATA = { createTodo: { id: 1, priority: "Low", description: "Get milk!", __typename: "Todo", }, }; const variables = { priority: "Low", description: "Get milk2.", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_DATA, }, }, ]; const onCompleted = jest.fn(); const { result, rerender } = renderHook( ({ onCompleted }) => { return useMutation< { createTodo: Todo }, { priority: string; description: string } >(CREATE_TODO_MUTATION, { onCompleted }); }, { wrapper: ({ children }) => ( <MockedProvider mocks={mocks}>{children}</MockedProvider> ), initialProps: { onCompleted }, } ); const createTodo = result.current[0]; let fetchResult: any; const onCompleted1 = jest.fn(); rerender({ onCompleted: onCompleted1 }); await act(async () => { fetchResult = await createTodo({ variables, }); }); expect(fetchResult).toEqual({ data: CREATE_TODO_DATA }); expect(result.current[1].data).toEqual(CREATE_TODO_DATA); expect(onCompleted).toHaveBeenCalledTimes(0); expect(onCompleted1).toHaveBeenCalledTimes(1); expect(onCompleted1).toHaveBeenCalledWith( CREATE_TODO_DATA, expect.objectContaining({ variables }) ); }); }); describe("ROOT_MUTATION cache data", () => { const startTime = Date.now(); const link = new ApolloLink( (operation) => new Observable((observer) => { observer.next({ data: { __typename: "Mutation", doSomething: { __typename: "MutationPayload", time: startTime, }, }, }); observer.complete(); }) ); const mutation = gql` mutation DoSomething { doSomething { time } } `; it("should be removed by default after the mutation", async () => { let timeReadCount = 0; let timeMergeCount = 0; const client = new ApolloClient({ link, cache: new InMemoryCache({ typePolicies: { MutationPayload: { fields: { time: { read(ms: number = Date.now()) { ++timeReadCount; return new Date(ms); }, merge(existing, incoming: number) { ++timeMergeCount; expect(existing).toBeUndefined(); return incoming; }, }, }, }, }, }), }); const { result } = renderHook(() => useMutation(mutation), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), }); expect(result.current[1].loading).toBe(false); expect(result.current[1].called).toBe(false); expect(result.current[1].data).toBe(undefined); const mutate = result.current[0]; let mutationResult: any; act(() => { mutationResult = mutate({ update( cache, { data: { doSomething: { __typename, time }, }, } ) { expect(__typename).toBe("MutationPayload"); expect(time).toBeInstanceOf(Date); expect(time.getTime()).toBe(startTime); expect(timeReadCount).toBe(1); expect(timeMergeCount).toBe(1); // The contents of the ROOT_MUTATION object exist only briefly, // for the duration of the mutation update, and are removed // after the mutation write is finished. expect(cache.extract()).toEqual({ ROOT_MUTATION: { __typename: "Mutation", doSomething: { __typename: "MutationPayload", time: startTime, }, }, }); }, }).then( ({ data: { doSomething: { __typename, time }, }, }) => { expect(__typename).toBe("MutationPayload"); expect(time).toBeInstanceOf(Date); expect(time.getTime()).toBe(startTime); expect(timeReadCount).toBe(1); expect(timeMergeCount).toBe(1); // The contents of the ROOT_MUTATION object exist only briefly, // for the duration of the mutation update, and are removed after // the mutation write is finished. expect(client.cache.extract()).toEqual({ ROOT_MUTATION: { __typename: "Mutation", }, }); } ); mutationResult.catch(() => {}); }); expect(result.current[1].loading).toBe(true); expect(result.current[1].called).toBe(true); expect(result.current[1].data).toBe(undefined); await waitFor(() => { expect(result.current[1].loading).toBe(false); }); expect(result.current[1].called).toBe(true); expect(result.current[1].data).toBeDefined(); const { doSomething: { __typename, time }, } = result.current[1].data; expect(__typename).toBe("MutationPayload"); expect(time).toBeInstanceOf(Date); expect(time.getTime()).toBe(startTime); await expect(mutationResult).resolves.toBe(undefined); }); it("can be preserved by passing keepRootFields: true", async () => { let timeReadCount = 0; let timeMergeCount = 0; const client = new ApolloClient({ link, cache: new InMemoryCache({ typePolicies: { MutationPayload: { fields: { time: { read(ms: number = Date.now()) { ++timeReadCount; return new Date(ms); }, merge(existing, incoming: number) { ++timeMergeCount; expect(existing).toBeUndefined(); return incoming; }, }, }, }, }, }), }); const { result } = renderHook( () => useMutation(mutation, { keepRootFields: true, }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); expect(result.current[1].loading).toBe(false); expect(result.current[1].called).toBe(false); expect(result.current[1].data).toBe(undefined); const mutate = result.current[0]; let mutationResult: any; act(() => { mutationResult = mutate({ update( cache, { data: { doSomething: { __typename, time }, }, } ) { expect(__typename).toBe("MutationPayload"); expect(time).toBeInstanceOf(Date); expect(time.getTime()).toBe(startTime); expect(timeReadCount).toBe(1); expect(timeMergeCount).toBe(1); expect(cache.extract()).toEqual({ ROOT_MUTATION: { __typename: "Mutation", doSomething: { __typename: "MutationPayload", time: startTime, }, }, }); }, }).then( ({ data: { doSomething: { __typename, time }, }, }) => { expect(__typename).toBe("MutationPayload"); expect(time).toBeInstanceOf(Date); expect(time.getTime()).toBe(startTime); expect(timeReadCount).toBe(1); expect(timeMergeCount).toBe(1); expect(client.cache.extract()).toEqual({ ROOT_MUTATION: { __typename: "Mutation", doSomething: { __typename: "MutationPayload", time: startTime, }, }, }); } ); }); mutationResult.catch(() => {}); expect(result.current[1].loading).toBe(true); expect(result.current[1].called).toBe(true); expect(result.current[1].data).toBe(undefined); await waitFor(() => { expect(result.current[1].loading).toBe(false); }); expect(result.current[1].called).toBe(true); expect(result.current[1].data).toBeDefined(); const { doSomething: { __typename, time }, } = result.current[1].data; expect(__typename).toBe("MutationPayload"); expect(time).toBeInstanceOf(Date); expect(time.getTime()).toBe(startTime); await expect(mutationResult).resolves.toBe(undefined); }); }); describe("Update function", () => { it("should be called with the provided variables", async () => { const variables = { description: "Get milk!" }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; let variablesMatched = false; const Component = () => { const [createTodo] = useMutation(CREATE_TODO_MUTATION, { update(_, __, options) { expect(options.variables).toEqual(variables); variablesMatched = true; }, }); useEffect(() => { createTodo({ variables }); }, []); return null; }; render( <MockedProvider mocks={mocks}> <Component /> </MockedProvider> ); await waitFor(() => expect(variablesMatched).toBe(true)); }); itAsync("should be called with the provided context", (resolve, reject) => { const context = { id: 3 }; const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; let foundContext = false; const Component = () => { const [createTodo] = useMutation< Todo, { description: string }, { id: number } >(CREATE_TODO_MUTATION, { context, update(_, __, options) { expect(options.context).toEqual(context); foundContext = true; }, }); useEffect(() => { createTodo({ variables }); }, []); return null; }; render( <MockedProvider mocks={mocks}> <Component /> </MockedProvider> ); return waitFor(() => { expect(foundContext).toBe(true); }).then(resolve, reject); }); describe("If context is not provided", () => { itAsync("should be undefined", (resolve, reject) => { const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; let checkedContext = false; const Component = () => { const [createTodo] = useMutation(CREATE_TODO_MUTATION, { update(_, __, options) { expect(options.context).toBeUndefined(); checkedContext = true; }, }); useEffect(() => { createTodo({ variables }); }, []); return null; }; render( <MockedProvider mocks={mocks}> <Component /> </MockedProvider> ); return waitFor(() => { expect(checkedContext).toBe(true); }).then(resolve, reject); }); }); }); describe("Optimistic response", () => { itAsync( "should support optimistic response handling", async (resolve, reject) => { const optimisticResponse = { __typename: "Mutation", createTodo: { id: 1, description: "TEMPORARY", priority: "High", __typename: "Todo", }, }; const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; const link = mockSingleLink(...mocks).setOnError(reject); const cache = new InMemoryCache(); const client = new ApolloClient({ cache, link, }); let renderCount = 0; const Component = () => { const [createTodo, { loading, data }] = useMutation( CREATE_TODO_MUTATION, { optimisticResponse } ); switch (renderCount) { case 0: expect(loading).toBeFalsy(); expect(data).toBeUndefined(); createTodo({ variables }); const dataInStore = client.cache.extract(true); expect(dataInStore["Todo:1"]).toEqual( optimisticResponse.createTodo ); break; case 1: expect(loading).toBeTruthy(); expect(data).toBeUndefined(); break; case 2: expect(loading).toBeFalsy(); expect(data).toEqual(CREATE_TODO_RESULT); break; default: } renderCount += 1; return null; }; render( <ApolloProvider client={client}> <Component /> </ApolloProvider> ); return waitFor(() => { expect(renderCount).toBe(3); }).then(resolve, reject); } ); it("should be called with the provided context", async () => { const optimisticResponse = { __typename: "Mutation", createTodo: { id: 1, description: "TEMPORARY", priority: "High", __typename: "Todo", }, }; const context = { id: 3 }; const variables = { description: "Get milk!", }; const mocks = [ { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, }, ]; const contextFn = jest.fn(); const Component = () => { const [createTodo] = useMutation(CREATE_TODO_MUTATION, { optimisticResponse, context, update(_, __, options) { contextFn(options.context); }, }); useEffect(() => { createTodo({ variables }); }, []); return null; }; render( <MockedProvider mocks={mocks}> <Component /> </MockedProvider> ); await waitFor(() => { expect(contextFn).toHaveBeenCalledTimes(2); }); expect(contextFn).toHaveBeenCalledWith(context); }); }); describe("refetching queries", () => { const GET_TODOS_QUERY = gql` query getTodos { todos { id description priority } } `; const GET_TODOS_RESULT_1 = { todos: [ { id: 2, description: "Walk the dog", priority: "Medium", __typename: "Todo", }, { id: 3, description: "Call mom", priority: "Low", __typename: "Todo", }, ], }; const GET_TODOS_RESULT_2 = { todos: [ { id: 1, description: "Get milk!", priority: "High", __typename: "Todo", }, { id: 2, description: "Walk the dog", priority: "Medium", __typename: "Todo", }, { id: 3, description: "Call mom", priority: "Low", __typename: "Todo", }, ], }; it("can pass onQueryUpdated to useMutation", async () => { interface TData { todoCount: number; } const countQuery: TypedDocumentNode<TData> = gql` query Count { todoCount @client } `; const optimisticResponse = { __typename: "Mutation", createTodo: { id: 1, description: "TEMPORARY", priority: "High", __typename: "Todo", }, }; const variables = { description: "Get milk!", }; const client = new ApolloClient({ cache: new InMemoryCache({ typePolicies: { Query: { fields: { todoCount(count = 0) { return count; }, }, }, }, }), link: mockSingleLink({ request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT }, delay: 20, }), }); // The goal of this test is to make sure onQueryUpdated gets called as // part of the createTodo mutation, so we use this reobservePromise to // await the calling of onQueryUpdated. interface OnQueryUpdatedResults { obsQuery: ObservableQuery; diff: Cache.DiffResult<TData>; result: ApolloQueryResult<TData>; } let resolveOnUpdate: (results: OnQueryUpdatedResults) => any; const onUpdatePromise = new Promise<OnQueryUpdatedResults>((resolve) => { resolveOnUpdate = resolve; }).then((onUpdateResult) => { expect(finishedReobserving).toBe(true); expect(onUpdateResult.diff).toEqual({ complete: true, result: { todoCount: 1, }, }); expect(onUpdateResult.result).toEqual({ loading: false, networkStatus: NetworkStatus.ready, data: { todoCount: 1, }, }); }); onUpdatePromise.catch(() => {}); let finishedReobserving = false; const { result } = renderHook( () => ({ query: useQuery(countQuery), mutation: useMutation(CREATE_TODO_MUTATION, { optimisticResponse, update(cache) { const result = cache.readQuery({ query: countQuery }); cache.writeQuery({ query: countQuery, data: { todoCount: (result ? result.todoCount : 0) + 1, }, }); }, }), }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); expect(result.current.query.loading).toBe(false); expect(result.current.query.data).toEqual({ todoCount: 0 }); expect(result.current.mutation[1].loading).toBe(false); expect(result.current.mutation[1].data).toBe(undefined); const createTodo = result.current.mutation[0]; act(() => { createTodo({ variables, async onQueryUpdated(obsQuery, diff) { const result = await obsQuery.reobserve(); finishedReobserving = true; resolveOnUpdate({ obsQuery, diff, result }); return result; }, }); }); expect(result.current.query.loading).toBe(false); expect(result.current.query.data).toEqual({ todoCount: 0 }); expect(result.current.mutation[1].loading).toBe(true); expect(result.current.mutation[1].data).toBe(undefined); expect(finishedReobserving).toBe(false); await waitFor( () => { expect(result.current.query.data).toEqual({ todoCount: 1 }); }, { interval: 1 } ); expect(result.current.query.loading).toBe(false); expect(result.current.mutation[1].loading).toBe(true); expect(result.current.mutation[1].data).toBe(undefined); await waitFor( () => { expect(result.current.mutation[1].loading).toBe(false); }, { interval: 1 } ); expect(result.current.query.loading).toBe(false); expect(result.current.query.data).toEqual({ todoCount: 1 }); expect(result.current.mutation[1].data).toEqual(CREATE_TODO_RESULT); expect(finishedReobserving).toBe(true); await expect(onUpdatePromise).resolves.toBe(undefined); }); it("refetchQueries with operation names should update cache", async () => { const variables = { description: "Get milk!" }; const mocks = [ { request: { query: GET_TODOS_QUERY, }, result: { data: GET_TODOS_RESULT_1 }, }, { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT, }, }, { request: { query: GET_TODOS_QUERY, }, result: { data: GET_TODOS_RESULT_2 }, }, ]; const link = mockSingleLink(...mocks); const client = new ApolloClient({ link, cache: new InMemoryCache(), }); const { result } = renderHook( () => ({ query: useQuery(GET_TODOS_QUERY), mutation: useMutation(CREATE_TODO_MUTATION), }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); expect(result.current.query.loading).toBe(true); expect(result.current.query.data).toBe(undefined); await waitFor( () => { expect(result.current.query.loading).toBe(false); }, { interval: 1 } ); expect(result.current.query.data).toEqual(mocks[0].result.data); const mutate = result.current.mutation[0]; act(() => { mutate({ variables, refetchQueries: ["getTodos"], }); }); await waitFor( () => { expect(result.current.query.data).toEqual(mocks[2].result.data); }, { interval: 1 } ); expect(result.current.query.loading).toBe(false); expect(client.readQuery({ query: GET_TODOS_QUERY })).toEqual( mocks[2].result.data ); }); it("refetchQueries with document nodes should update cache", async () => { const variables = { description: "Get milk!" }; const mocks = [ { request: { query: GET_TODOS_QUERY, }, result: { data: GET_TODOS_RESULT_1 }, }, { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT, }, delay: 10, }, { request: { query: GET_TODOS_QUERY, }, result: { data: GET_TODOS_RESULT_2 }, delay: 10, }, ]; const link = mockSingleLink(...mocks); const client = new ApolloClient({ link, cache: new InMemoryCache(), }); const { result } = renderHook( () => ({ query: useQuery(GET_TODOS_QUERY), mutation: useMutation(CREATE_TODO_MUTATION), }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); expect(result.current.query.loading).toBe(true); expect(result.current.query.data).toBe(undefined); await waitFor( () => { expect(result.current.query.loading).toBe(false); }, { interval: 1 } ); expect(result.current.query.data).toEqual(mocks[0].result.data); const mutate = result.current.mutation[0]; let mutation: Promise<unknown>; act(() => { mutation = mutate({ variables, refetchQueries: [GET_TODOS_QUERY], }); }); expect(result.current.query.loading).toBe(false); expect(result.current.query.data).toEqual(mocks[0].result.data); await act(async () => { await mutation; }); expect(result.current.query.loading).toBe(false); expect(result.current.query.data).toEqual(mocks[0].result.data); await waitFor( () => { expect(result.current.query.data).toEqual(mocks[2].result.data); }, { interval: 1 } ); expect(result.current.query.loading).toBe(false); expect(client.readQuery({ query: GET_TODOS_QUERY })).toEqual( mocks[2].result.data ); }); it("refetchQueries should update cache after unmount", async () => { const variables = { description: "Get milk!" }; const mocks = [ { request: { query: GET_TODOS_QUERY, }, result: { data: GET_TODOS_RESULT_1 }, }, { request: { query: CREATE_TODO_MUTATION, variables, }, result: { data: CREATE_TODO_RESULT, }, }, { request: { query: GET_TODOS_QUERY, }, result: { data: GET_TODOS_RESULT_2 }, }, ]; const link = mockSingleLink(...mocks); const client = new ApolloClient({ link, cache: new InMemoryCache(), }); const { result, unmount } = renderHook( () => ({ query: useQuery(GET_TODOS_QUERY), mutation: useMutation(CREATE_TODO_MUTATION), }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); expect(result.current.query.loading).toBe(true); expect(result.current.query.data).toBe(undefined); await waitFor( () => { expect(result.current.query.loading).toBe(false); }, { interval: 1 } ); expect(result.current.query.data).toEqual(mocks[0].result.data); const mutate = result.current.mutation[0]; let onMutationDone: Function; const mutatePromise = new Promise( (resolve) => (onMutationDone = resolve) ); setTimeout(() => { act(() => { mutate({ variables, refetchQueries: ["getTodos"], update() { unmount(); }, }).then((result) => { expect(result.data).toEqual(CREATE_TODO_RESULT); onMutationDone(); }); }); }); expect(result.current.query.loading).toBe(false); expect(result.current.query.data).toEqual(mocks[0].result.data); await mutatePromise; await waitFor(() => { expect(client.readQuery({ query: GET_TODOS_QUERY })).toEqual( mocks[2].result.data ); }); }); itAsync( "using onQueryUpdated callback should not prevent cache broadcast", async (resolve, reject) => { // Mutating this array makes the tests below much more difficult to reason // about, so instead we reassign the numbersArray variable to remove // elements, without mutating the previous array object. let numbersArray: ReadonlyArray<{ id: string; value: number }> = [ { id: "1", value: 324 }, { id: "2", value: 729 }, { id: "3", value: 987 }, { id: "4", value: 344 }, { id: "5", value: 72 }, { id: "6", value: 899 }, { id: "7", value: 222 }, ]; type TNumbersQuery = { numbers: { __typename: "NumbersResult"; id: string; sum: number; numbersArray: ReadonlyArray<{ id: string; value: number; }>; }; }; function getNumbersData(): TNumbersQuery { return { numbers: { __typename: "NumbersResult", id: "numbersId", numbersArray, sum: numbersArray.reduce((sum, b) => sum + b.value, 0), }, }; } const link = new ApolloLink((operation) => { return new Observable((observer) => { const { operationName } = operation; if (operationName === "NumbersQuery") { observer.next({ data: getNumbersData(), }); } else if (operationName === "RemoveNumberMutation") { const last = numbersArray[numbersArray.length - 1]; numbersArray = numbersArray.slice(0, -1); observer.next({ data: { removeLastNumber: last, }, }); } setTimeout(() => { observer.complete(); }, 50); }); }); const client = new ApolloClient({ link, cache: new InMemoryCache({ typePolicies: { NumbersResult: { fields: { numbersArray: { merge: false }, sum(_, { readField }) { const numbersArray = readField<TNumbersQuery["numbers"]["numbersArray"]>( "numbersArray" ); return (numbersArray || []).reduce( (sum, item) => sum + item.value, 0 ); }, }, }, }, }), }); const NumbersQuery: TypedDocumentNode<TNumbersQuery> = gql` query NumbersQuery { numbers { id sum numbersArray { id value } } } `; const RemoveNumberMutation = gql` mutation RemoveNumberMutation { removeLastNumber { id } } `; const { result } = renderHook( () => ({ query: useQuery(NumbersQuery, { notifyOnNetworkStatusChange: true, }), mutation: useMutation(RemoveNumberMutation, { update(cache) { const oldData = cache.readQuery({ query: NumbersQuery }); cache.writeQuery({ query: NumbersQuery, data: oldData ? { ...oldData, numbers: { ...oldData.numbers, numbersArray: oldData.numbers.numbersArray.slice( 0, -1 ), }, } : { numbers: { __typename: "NumbersResult", id: "numbersId", sum: 0, numbersArray: [], }, }, }); }, }), }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); const obsQueryMap = client.getObservableQueries(); expect(obsQueryMap.size).toBe(1); const observedResults: Array<{ data: TNumbersQuery }> = []; subscribeAndCount( reject, obsQueryMap.values().next().value, (count, result: { data: TNumbersQuery }) => { observedResults.push(result); expect(observedResults.length).toBe(count); const data = getNumbersData(); if (count === 1) { expect(result).toEqual({ loading: true, networkStatus: NetworkStatus.loading, partial: true, }); } else if (count === 2) { expect(data.numbers.numbersArray.length).toBe(7); expect(result).toEqual({ loading: false, networkStatus: NetworkStatus.ready, data, }); } else if (count === 3) { expect(data.numbers.numbersArray.length).toBe(6); expect(result).toEqual({ loading: false, networkStatus: NetworkStatus.ready, data, }); } else if (count === 4) { expect(data.numbers.numbersArray.length).toBe(5); expect(result).toEqual({ loading: false, networkStatus: NetworkStatus.ready, data, }); // This line is the only way to finish this test successfully. setTimeout(resolve, 50); } else { // If we did not return false from the final onQueryUpdated function, // we would receive an additional result here. reject( `too many renders (${count}); final result: ${JSON.stringify( result )}` ); } } ); expect(observedResults).toEqual([]); expect(result.current.query.loading).toBe(true); expect(result.current.query.networkStatus).toBe(NetworkStatus.loading); expect(result.current.mutation[1].loading).toBe(false); expect(result.current.mutation[1].called).toBe(false); await waitFor( () => { expect(result.current.query.loading).toBe(false); }, { interval: 1 } ); expect(result.current.query.networkStatus).toBe(NetworkStatus.ready); expect(result.current.mutation[1].loading).toBe(false); expect(result.current.mutation[1].called).toBe(false); expect(numbersArray[numbersArray.length - 1]).toEqual({ id: "7", value: 222, }); const [mutate] = result.current.mutation; await act(async () => { expect( await mutate() // Not passing an onQueryUpdated callback should allow cache // broadcasts to propagate as normal. The point of this test is to // demonstrate that *adding* onQueryUpdated should not prevent cache // broadcasts (see below for where we test that). ).toEqual({ data: { removeLastNumber: { id: "7", }, }, }); }); expect(numbersArray[numbersArray.length - 1]).toEqual({ id: "6", value: 899, }); expect(result.current.query.loading).toBe(false); expect(result.current.query.networkStatus).toBe(NetworkStatus.ready); expect(result.current.mutation[1].loading).toBe(false); expect(result.current.mutation[1].called).toBe(true); await act(async () => { expect( await mutate({ // Adding this onQueryUpdated callback, which merely examines the // updated query and its DiffResult, should not change the broadcast // behavior of the ObservableQuery. onQueryUpdated(oq, diff) { expect(oq.queryName).toBe("NumbersQuery"); expect(diff.result.numbers.numbersArray.length).toBe(5); expect(diff.result.numbers.sum).toBe(2456); }, }) ).toEqual({ data: { removeLastNumber: { id: "6", }, }, }); }); expect(numbersArray[numbersArray.length - 1]).toEqual({ id: "5", value: 72, }); expect(result.current.query.loading).toBe(false); expect(result.current.query.networkStatus).toBe(NetworkStatus.ready); expect(result.current.mutation[1].loading).toBe(false); expect(result.current.mutation[1].called).toBe(true); await act(async () => { expect( await mutate({ onQueryUpdated(oq, diff) { expect(oq.queryName).toBe("NumbersQuery"); expect(diff.result.numbers.numbersArray.length).toBe(4); expect(diff.result.numbers.sum).toBe(2384); // Returning false from onQueryUpdated prevents the cache broadcast. return false; }, }) ).toEqual({ data: { removeLastNumber: { id: "5", }, }, }); }); expect(numbersArray[numbersArray.length - 1]).toEqual({ id: "4", value: 344, }); expect(result.current.query.loading).toBe(false); expect(result.current.query.networkStatus).toBe(NetworkStatus.ready); expect(result.current.mutation[1].loading).toBe(false); expect(result.current.mutation[1].called).toBe(true); } ); it("refetchQueries should work with BatchHttpLink", async () => { const MUTATION_1 = gql` mutation DoSomething { doSomething { message } } `; const QUERY_1 = gql` query Items { items { id } } `; fetchMock.restore(); const responseBodies = [ { data: { items: [{ id: 1 }, { id: 2 }] } }, { data: { doSomething: { message: "success" } } }, { data: { items: [{ id: 1 }, { id: 2 }, { id: 3 }] } }, ]; fetchMock.post( "/graphql", (url, opts) => new Promise((resolve) => { resolve({ body: responseBodies.shift(), }); }) ); const Test = () => { const { data } = useQuery(QUERY_1); const [mutate] = useMutation(MUTATION_1, { awaitRefetchQueries: true, refetchQueries: [QUERY_1], }); const { items = [] } = data || {}; return ( <> <button onClick={() => { return mutate(); }} type="button" > mutate </button> {items.map((c: any) => ( <div key={c.id}>item {c.id}</div> ))} </> ); }; const client = new ApolloClient({ link: new BatchHttpLink({ uri: "/graphql", batchMax: 10, }), cache: new InMemoryCache(), }); render( <ApolloProvider client={client}> <Test /> </ApolloProvider> ); await waitFor(() => screen.findByText("item 1")); await userEvent.click(screen.getByRole("button", { name: /mutate/i })); await waitFor(() => screen.findByText("item 3")); }); }); describe("defer", () => { const CREATE_TODO_MUTATION_DEFER = gql` mutation createTodo($description: String!, $priority: String) { createTodo(description: $description, priority: $priority) { id ... @defer { description priority } } } `; const variables = { description: "Get milk!", }; it("resolves a deferred mutation with the full result", async () => { using consoleSpies = spyOnConsole("error"); const link = new MockSubscriptionLink(); const client = new ApolloClient({ link, cache: new InMemoryCache(), }); const useCreateTodo = () => { const [createTodo, { loading, data }] = useMutation( CREATE_TODO_MUTATION_DEFER ); useEffect(() => { createTodo({ variables }); }, [variables]); return { loading, data }; }; const { result } = renderHook(() => useCreateTodo(), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), }); expect(result.current.loading).toBe(true); expect(result.current.data).toBe(undefined); setTimeout(() => { link.simulateResult({ result: { data: { createTodo: { id: 1, __typename: "Todo", }, }, hasNext: true, }, }); }); setTimeout(() => { link.simulateResult( { result: { incremental: [ { data: { description: "Get milk!", priority: "High", __typename: "Todo", }, path: ["createTodo"], }, ], hasNext: false, }, }, true ); }); // When defer is used in a mutation, the final value resolves // in a single result await waitFor( () => { expect(result.current.loading).toBe(false); }, { interval: 1 } ); expect(result.current.data).toEqual({ createTodo: { id: 1, description: "Get milk!", priority: "High", __typename: "Todo", }, }); expect(consoleSpies.error).not.toHaveBeenCalled(); }); it("resolves with resulting errors and calls onError callback", async () => { using consoleSpies = spyOnConsole("error"); const link = new MockSubscriptionLink(); const client = new ApolloClient({ link, cache: new InMemoryCache(), }); const onError = jest.fn(); const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION_DEFER, { onError }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); const createTodo = result.current[0]; let fetchResult: any; setTimeout(() => { link.simulateResult({ result: { data: { createTodo: { id: 1, __typename: "Todo", }, }, hasNext: true, }, }); }); setTimeout(() => { link.simulateResult( { result: { incremental: [ { data: null, errors: [new GraphQLError(CREATE_TODO_ERROR)], path: ["createTodo"], }, ], hasNext: false, }, }, true ); }); await act(async () => { fetchResult = await createTodo({ variables }); }); await waitFor(() => { expect(fetchResult.errors.message).toBe(CREATE_TODO_ERROR); }); await waitFor(() => { expect(fetchResult.data).toBe(undefined); }); await waitFor(() => { expect(onError).toHaveBeenCalledTimes(1); }); await waitFor(() => { expect(onError.mock.calls[0][0].message).toBe(CREATE_TODO_ERROR); }); await waitFor(() => { expect(consoleSpies.error).not.toHaveBeenCalled(); }); }); it("calls the update function with the final merged result data", async () => { using consoleSpies = spyOnConsole("error"); const link = new MockSubscriptionLink(); const update = jest.fn(); const client = new ApolloClient({ link, cache: new InMemoryCache(), }); const { result } = renderHook( () => useMutation(CREATE_TODO_MUTATION_DEFER, { update }), { wrapper: ({ children }) => ( <ApolloProvider client={client}>{children}</ApolloProvider> ), } ); const [createTodo] = result.current; let promiseReturnedByMutate: Promise<FetchResult>; await act(async () => { promiseReturnedByMutate = createTodo({ variables }); }); link.simulateResult({ result: { data: { createTodo: { id: 1, __typename: "Todo", }, }, hasNext: true, }, }); link.simulateResult( { result: { incremental: [ { data: { description: "Get milk!", priority: "High", __typename: "Todo", }, path: ["createTodo"], }, ], hasNext: false, }, }, true ); await act(async () => { await promiseReturnedByMutate; }); expect(update).toHaveBeenCalledTimes(1); expect(update).toHaveBeenCalledWith( // the first item is the cache, which we don't need to make any // assertions against in this test expect.anything(), // second argument is the result expect.objectContaining({ data: { createTodo: { id: 1, description: "Get milk!", priority: "High", __typename: "Todo", }, }, }), // third argument is an object containing context and variables // but we only care about variables here expect.objectContaining({ variables }) ); await waitFor(() => { expect(consoleSpies.error).not.toHaveBeenCalled(); }); }); }); }); describe.skip("Type Tests", () => { test("NoInfer prevents adding arbitrary additional variables", () => { const typedNode = {} as TypedDocumentNode<{ foo: string }, { bar: number }>; useMutation(typedNode, { variables: { bar: 4, // @ts-expect-error nonExistingVariable: "string", }, }); }); }); ```
/content/code_sandbox/src/react/hooks/__tests__/useMutation.test.tsx
xml
2016-02-26T20:25:00
2024-08-16T10:56:57
apollo-client
apollographql/apollo-client
19,304
15,777
```xml import { jsx } from '@antv/f-engine'; import { vec2 } from 'gl-matrix'; import { PolarProps } from '../types'; export default (props: PolarProps) => { const { ticks: originTicks, coord, style, grid: gridType } = props; const { center } = coord; const { grid, tickLine, line, labelOffset, label } = style; const ticks = originTicks.filter((d) => !isNaN(d.value)); return ( <group> {grid ? ticks.map((tick) => { const { points, gridStyle, gridPoints } = tick; const end = points[points.length - 1]; if (gridType !== 'line') { return ( <arc style={{ cx: center.x, cy: center.y, startAngle: 0, endAngle: 360, r: vec2.length([end.x - center.x, end.y - center.y]), ...grid, ...gridStyle, }} /> ); } return ( <polyline attrs={{ points: gridPoints.map((d) => [d.x, d.y]), ...grid, ...gridStyle, }} /> ); }) : null} {tickLine && tickLine.length ? ticks.map((tick) => { const { points } = tick; const end = points[points.length - 1]; return ( <line attrs={{ x1: end.x, y1: end.y, x2: end.x - tickLine.length, y2: end.y, ...tickLine, }} /> ); }) : null} {line ? ( <line attrs={{ x1: ticks[0].points[0].x, y1: ticks[0].points[0].y, x2: ticks[ticks.length - 1].points[0].x, y2: ticks[ticks.length - 1].points[0].y, ...line, }} /> ) : null} {label ? ticks.map((tick) => { const { points, text, labelStyle } = tick; const end = points[points.length - 1]; return ( <text attrs={{ x: end.x - labelOffset, y: end.y, text, textAlign: 'right', textBaseline: 'middle', ...label, ...labelStyle, }} /> ); }) : null} </group> ); }; ```
/content/code_sandbox/packages/f2/src/components/axis/polar/polar-y.tsx
xml
2016-08-29T06:26:23
2024-08-16T15:50:14
F2
antvis/F2
7,877
574
```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 { ComponentHarness, ComponentHarnessConstructor, handleAutoChangeDetectionStatus, HarnessEnvironment, HarnessLoader, stopHandlingAutoChangeDetectionStatus, TestElement, } from '@angular/cdk/testing'; import {ComponentFixture, flush} from '@angular/core/testing'; import {Observable} from 'rxjs'; import {takeWhile} from 'rxjs/operators'; import {TaskState, TaskStateZoneInterceptor} from './task-state-zone-interceptor'; import {UnitTestElement} from './unit-test-element'; /** Options to configure the environment. */ export interface TestbedHarnessEnvironmentOptions { /** The query function used to find DOM elements. */ queryFn: (selector: string, root: Element) => Iterable<Element> | ArrayLike<Element>; } /** The default environment options. */ const defaultEnvironmentOptions: TestbedHarnessEnvironmentOptions = { queryFn: (selector: string, root: Element) => root.querySelectorAll(selector), }; /** Whether auto change detection is currently disabled. */ let disableAutoChangeDetection = false; /** * The set of non-destroyed fixtures currently being used by `TestbedHarnessEnvironment` instances. */ const activeFixtures = new Set<ComponentFixture<unknown>>(); /** * Installs a handler for change detection batching status changes for a specific fixture. * @param fixture The fixture to handle change detection batching for. */ function installAutoChangeDetectionStatusHandler(fixture: ComponentFixture<unknown>) { if (!activeFixtures.size) { handleAutoChangeDetectionStatus(({isDisabled, onDetectChangesNow}) => { disableAutoChangeDetection = isDisabled; if (onDetectChangesNow) { Promise.all(Array.from(activeFixtures).map(detectChanges)).then(onDetectChangesNow); } }); } activeFixtures.add(fixture); } /** * Uninstalls a handler for change detection batching status changes for a specific fixture. * @param fixture The fixture to stop handling change detection batching for. */ function uninstallAutoChangeDetectionStatusHandler(fixture: ComponentFixture<unknown>) { activeFixtures.delete(fixture); if (!activeFixtures.size) { stopHandlingAutoChangeDetectionStatus(); } } /** Whether we are currently in the fake async zone. */ function isInFakeAsyncZone() { return typeof Zone !== 'undefined' && Zone!.current.get('FakeAsyncTestZoneSpec') != null; } /** * Triggers change detection for a specific fixture. * @param fixture The fixture to trigger change detection for. */ async function detectChanges(fixture: ComponentFixture<unknown>) { fixture.detectChanges(); if (isInFakeAsyncZone()) { flush(); } else { await fixture.whenStable(); } } /** A `HarnessEnvironment` implementation for Angular's Testbed. */ export class TestbedHarnessEnvironment extends HarnessEnvironment<Element> { /** Whether the environment has been destroyed. */ private _destroyed = false; /** Observable that emits whenever the test task state changes. */ private _taskState?: Observable<TaskState>; /** The options for this environment. */ private _options: TestbedHarnessEnvironmentOptions; /** Environment stabilization callback passed to the created test elements. */ private _stabilizeCallback: () => Promise<void>; protected constructor( rawRootElement: Element, private _fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions, ) { super(rawRootElement); this._options = {...defaultEnvironmentOptions, ...options}; if (typeof Zone !== 'undefined') { this._taskState = TaskStateZoneInterceptor.setup(); } this._stabilizeCallback = () => this.forceStabilize(); installAutoChangeDetectionStatusHandler(_fixture); _fixture.componentRef.onDestroy(() => { uninstallAutoChangeDetectionStatusHandler(_fixture); this._destroyed = true; }); } /** Creates a `HarnessLoader` rooted at the given fixture's root element. */ static loader( fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions, ): HarnessLoader { return new TestbedHarnessEnvironment(fixture.nativeElement, fixture, options); } /** * Creates a `HarnessLoader` at the document root. This can be used if harnesses are * located outside of a fixture (e.g. overlays appended to the document body). */ static documentRootLoader( fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions, ): HarnessLoader { return new TestbedHarnessEnvironment(document.body, fixture, options); } /** Gets the native DOM element corresponding to the given TestElement. */ static getNativeElement(el: TestElement): Element { if (el instanceof UnitTestElement) { return el.element; } throw Error('This TestElement was not created by the TestbedHarnessEnvironment'); } /** * Creates an instance of the given harness type, using the fixture's root element as the * harness's host element. This method should be used when creating a harness for the root element * of a fixture, as components do not have the correct selector when they are created as the root * of the fixture. */ static async harnessForFixture<T extends ComponentHarness>( fixture: ComponentFixture<unknown>, harnessType: ComponentHarnessConstructor<T>, options?: TestbedHarnessEnvironmentOptions, ): Promise<T> { const environment = new TestbedHarnessEnvironment(fixture.nativeElement, fixture, options); await environment.forceStabilize(); return environment.createComponentHarness(harnessType, fixture.nativeElement); } /** * Flushes change detection and async tasks captured in the Angular zone. * In most cases it should not be necessary to call this manually. However, there may be some edge * cases where it is needed to fully flush animation events. */ async forceStabilize(): Promise<void> { if (!disableAutoChangeDetection) { if (this._destroyed) { throw Error('Harness is attempting to use a fixture that has already been destroyed.'); } await detectChanges(this._fixture); } } /** * Waits for all scheduled or running async tasks to complete. This allows harness * authors to wait for async tasks outside of the Angular zone. */ async waitForTasksOutsideAngular(): Promise<void> { // If we run in the fake async zone, we run "flush" to run any scheduled tasks. This // ensures that the harnesses behave inside of the FakeAsyncTestZone similar to the // "AsyncTestZone" and the root zone (i.e. neither fakeAsync or async). Note that we // cannot just rely on the task state observable to become stable because the state will // never change. This is because the task queue will be only drained if the fake async // zone is being flushed. if (isInFakeAsyncZone()) { flush(); } // Wait until the task queue has been drained and the zone is stable. Note that // we cannot rely on "fixture.whenStable" since it does not catch tasks scheduled // outside of the Angular zone. For test harnesses, we want to ensure that the // app is fully stabilized and therefore need to use our own zone interceptor. await this._taskState?.pipe(takeWhile(state => !state.stable)).toPromise(); } /** Gets the root element for the document. */ protected getDocumentRoot(): Element { return document.body; } /** Creates a `TestElement` from a raw element. */ protected createTestElement(element: Element): TestElement { return new UnitTestElement(element, this._stabilizeCallback); } /** Creates a `HarnessLoader` rooted at the given raw element. */ protected createEnvironment(element: Element): HarnessEnvironment<Element> { return new TestbedHarnessEnvironment(element, this._fixture, this._options); } /** * Gets a list of all elements matching the given selector under this environment's root element. */ protected async getAllRawElements(selector: string): Promise<Element[]> { await this.forceStabilize(); return Array.from(this._options.queryFn(selector, this.rawRootElement)); } } ```
/content/code_sandbox/src/cdk/testing/testbed/testbed-harness-environment.ts
xml
2016-01-04T18:50:02
2024-08-16T11:21:13
components
angular/components
24,263
1,762
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="path_to_url"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectGuid>{B297008B-C313-455E-B230-E119589D2D79}</ProjectGuid> <OutputType>Library</OutputType> <AssemblyName>Xamarin.Android.BindingResolveImports-Tests</AssemblyName> <AndroidApplication>True</AndroidApplication> <RootNamespace>Xamarin.Android.BindingResolveImportsTests</RootNamespace> <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile> <AndroidResgenClass>Resource</AndroidResgenClass> <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> <AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk> <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> <AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis> </PropertyGroup> <Import Project="..\..\..\Configuration.props" /> <PropertyGroup> <TargetFrameworkVersion>$(AndroidFrameworkVersion)</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <Optimize>false</Optimize> <OutputPath>bin\Debug</OutputPath> <DefineConstants>DEBUG;</DefineConstants> <WarningLevel>4</WarningLevel> <AndroidLinkMode>None</AndroidLinkMode> <ConsolePause>false</ConsolePause> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <Optimize>true</Optimize> <OutputPath>bin\Release</OutputPath> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> </PropertyGroup> <ItemGroup> <None Include="Assets\AboutAssets.txt" /> <None Include="Resources\AboutResources.txt" /> <None Include="Properties\AndroidManifest.xml" /> </ItemGroup> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> <ItemGroup> <Compile Include="MainActivity.cs" /> <Compile Include="Resources\Resource.designer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Xml" /> <Reference Include="System.Core" /> <Reference Include="Mono.Android" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\layout\Main.axml" /> <AndroidResource Include="Resources\values\Strings.xml" /> <AndroidResource Include="Resources\drawable\Icon.png" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Xamarin.Android.BindingResolveImportLib1\Xamarin.Android.BindingResolveImportLib1.csproj"> <Project>{2A0519DF-0DDA-45F7-AC3C-E2992748D364}</Project> <Name>Xamarin.Android.BindingResolveImportLib1</Name> </ProjectReference> <ProjectReference Include="..\Xamarin.Android.BindingResolveImportLib2\Xamarin.Android.BindingResolveImportLib2.csproj"> <Project>{DD4E2A49-730C-41FD-B6D4-AFB73F94271F}</Project> <Name>Xamarin.Android.BindingResolveImportLib2</Name> </ProjectReference> <ProjectReference Include="..\Xamarin.Android.BindingResolveImportLib3\Xamarin.Android.BindingResolveImportLib3.csproj"> <Project>{9802CB35-0BC0-4EE1-9A81-BB40BD97945A}</Project> <Name>Xamarin.Android.BindingResolveImportLib3</Name> </ProjectReference> <ProjectReference Include="..\Xamarin.Android.BindingResolveImportLib4\Xamarin.Android.BindingResolveImportLib4.csproj"> <Project>{5BDCEF07-E3D7-4E73-B025-6E43A5A7D7F1}</Project> <Name>Xamarin.Android.BindingResolveImportLib4</Name> </ProjectReference> </ItemGroup> </Project> ```
/content/code_sandbox/tests/ResolveImports/Xamarin.Android.BindingResolveImports-Tests/Xamarin.Android.BindingResolveImports-Tests.csproj
xml
2016-03-30T15:37:14
2024-08-16T19:22:13
android
dotnet/android
1,905
1,056
```xml <Documentation> <Docs DocId="T:SpriteKit.SKNode"> <summary>The building block out of which scene-graphs are made. The root of the tree is an <see cref="T:SpriteKit.SKScene" />.</summary> <remarks> <para> <img href="~/SpriteKit/_images/SKNode.Hierarchy.png" alt="Class diagram of the SKNode hierarchy" /> </para> <para> <list type="table"> <listheader> <term>Class</term> <description>Description</description> </listheader> <item> <term> <see cref="T:SpriteKit.SKCropNode" /> </term> <description>Uses a mask to crop its children.</description> </item> <item> <term> <see cref="T:SpriteKit.SKEffectNode" /> </term> <description>Applies a <see cref="T:CoreImage.CIFilter" /> to its children.</description> </item> <item> <term> <see cref="T:SpriteKit.SKEmitterNode" /> </term> <description>Produces and displays particles.</description> </item> <item> <term> <see cref="T:SpriteKit.SKLabelNode" /> </term> <description>Displays text.</description> </item> <item> <term> <format type="text/html"> <a href="path_to_url" title="T:SpriteKit.SKSceneNode">T:SpriteKit.SKSceneNode</a> </format> </term> <description>Runs an animation loop, including display, actions, and physics.</description> </item> <item> <term> <see cref="T:SpriteKit.SKShapeNode" /> </term> <description>Displays a <see cref="T:CoreGraphics.CGPath" />-based shape.</description> </item> <item> <term> <see cref="T:SpriteKit.SKSpriteNode" /> </term> <description>Displays a textured sprite.</description> </item> </list> </para> </remarks> <related type="externalDocumentation" href="path_to_url">Apple documentation for <c>SKNode</c></related> </Docs> </Documentation> ```
/content/code_sandbox/docs/api/SpriteKit/SKNode.xml
xml
2016-04-20T18:24:26
2024-08-16T13:29:19
xamarin-macios
xamarin/xamarin-macios
2,436
529
```xml export interface AddedOAuthParams { inviteId?: string redirectTo?: string openInviteSlug?: string } ```
/content/code_sandbox/src/cloud/api/auth/index.ts
xml
2016-11-19T14:30:34
2024-08-16T03:13:45
BoostNote-App
BoostIO/BoostNote-App
3,745
26
```xml import {JumpNavigationHistoryEntity} from '../Library/Type/JumpNavigationHistoryEntity'; import {DB} from '../Library/Infra/DB'; import {DateUtil} from '../Library/Util/DateUtil'; class _JumpNavigationHistoryRepo { async getHistories(maxCount: number): Promise<{error?: Error; histories?: JumpNavigationHistoryEntity[]}> { const {error, rows: histories} = await DB.select<JumpNavigationHistoryEntity>(`select * from jump_navigation_histories order by created_at desc limit ${maxCount}`); if (error) return {error}; return {histories}; } async getHistory(historyId: number): Promise<{error?: Error; history?: JumpNavigationHistoryEntity}> { const {error, row: history} = await DB.selectSingle<JumpNavigationHistoryEntity>(`select * from jump_navigation_histories where id = ?`, [historyId]); if (error) return {error}; return {history}; } async addHistory(keyword: string): Promise<{error?: Error; history?: JumpNavigationHistoryEntity}> { // delete same histories const {error: e1} = await DB.exec('delete from jump_navigation_histories where keyword = ?', [keyword.trim()]); if (e1) return {error: e1}; // insert history const createdAt = DateUtil.localToUTCString(new Date()); const {error: e2, insertedId} = await DB.exec('insert into jump_navigation_histories (keyword, created_at) values(?, ?)', [keyword.trim(), createdAt]); if (e2) return {error: e2}; // delete limitation const {error: e3} = await DB.exec(` delete from jump_navigation_histories where id in (select id from jump_navigation_histories order by created_at desc limit 100, 100) `); if (e3) return {error: e3}; return this.getHistory(insertedId); } async deleteHistory(historyId: number): Promise<{error?: Error}> { const {error} = await DB.exec('delete from jump_navigation_histories where id = ?', [historyId]); if (error) return {error}; return {}; } } export const JumpNavigationHistoryRepo = new _JumpNavigationHistoryRepo() ```
/content/code_sandbox/src/Renderer/Repository/JumpNavigationHistoryRepo.ts
xml
2016-05-10T12:55:31
2024-08-11T04:32:50
jasper
jasperapp/jasper
1,318
496
```xml import useTranscriptFocusContext from './private/useContext'; export default function useActiveDescendantId(): readonly [string] { return useTranscriptFocusContext().activeDescendantIdState; } ```
/content/code_sandbox/packages/component/src/providers/TranscriptFocus/useActiveDescendantId.ts
xml
2016-07-07T23:16:57
2024-08-16T00:12:37
BotFramework-WebChat
microsoft/BotFramework-WebChat
1,567
42
```xml import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing'; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [HttpClientTestingModule], }).compileComponents(); }); beforeEach(() => { component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); }); ```
/content/code_sandbox/src/portal/src/app/license/license.component.spec.ts
xml
2016-01-28T21:10:28
2024-08-16T15:28:34
harbor
goharbor/harbor
23,335
84
```xml import { findModulesAsync } from './findModules'; import { getProjectPackageJsonPathAsync, mergeLinkingOptionsAsync, resolveSearchPathsAsync, } from './mergeLinkingOptions'; import { resolveExtraBuildDependenciesAsync, resolveModulesAsync } from './resolveModules'; import type { ModuleDescriptor, SearchOptions } from '../types'; export { findModulesAsync, getProjectPackageJsonPathAsync, mergeLinkingOptionsAsync, resolveExtraBuildDependenciesAsync, resolveModulesAsync, resolveSearchPathsAsync, }; export { generatePackageListAsync } from './generatePackageList'; export { verifySearchResults } from './verifySearchResults'; export * from '../types'; /** * Programmatic API to query autolinked modules for a project. */ export async function queryAutolinkingModulesFromProjectAsync( projectRoot: string, options: Pick<SearchOptions, 'platform' | 'exclude' | 'onlyProjectDeps'> ): Promise<ModuleDescriptor[]> { const searchPaths = await resolveSearchPathsAsync(null, projectRoot); const linkOptions = await mergeLinkingOptionsAsync({ ...options, projectRoot, searchPaths }); const searchResults = await findModulesAsync(linkOptions); return await resolveModulesAsync(searchResults, linkOptions); } ```
/content/code_sandbox/packages/expo-modules-autolinking/src/autolinking/index.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
270
```xml import { configureStore } from '@reduxjs/toolkit'; import { featuresReducer } from '@proton/features'; import { elementsReducer } from '../elements/elementsSlice'; import eo from './eoSlice'; export const setupStore = () => { return configureStore({ devTools: process.env.NODE_ENV !== 'production', reducer: { eo, ...elementsReducer, features: featuresReducer.reducer, }, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: { ignoreState: true, // Ignore these field paths in all actions ignoredActionPaths: ['payload', 'meta'], }, }), }); }; export type EOStore = ReturnType<typeof setupStore>; export type EODispatch = EOStore['dispatch']; export type EOStoreState = ReturnType<EOStore['getState']>; ```
/content/code_sandbox/applications/mail/src/app/store/eo/eoStore.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
176
```xml import { getSystemNodeVersionNonCached } from '../lib/getSystemNodeVersion' import * as execa from 'execa' jest.mock('execa', () => ({ sync: jest.fn(() => ({ stdout: 'v10.0.0', })), })) test('getSystemNodeVersion() executed from an executable pnpm CLI', () => { // @ts-expect-error process['pkg'] = {} expect(getSystemNodeVersionNonCached()).toBe('v10.0.0') expect(execa.sync).toHaveBeenCalledWith('node', ['--version']) }) test('getSystemNodeVersion() from a non-executable pnpm CLI', () => { // @ts-expect-error delete process['pkg'] expect(getSystemNodeVersionNonCached()).toBe(process.version) }) ```
/content/code_sandbox/config/package-is-installable/test/getSystemNodeVersion.test.ts
xml
2016-01-28T07:40:43
2024-08-16T12:38:47
pnpm
pnpm/pnpm
28,869
172
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>com.reactnativeaudiotoolkit.exampleapp</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> </dict> </plist> ```
/content/code_sandbox/ExampleApp/ios/ExampleApp-tvOSTests/Info.plist
xml
2016-06-27T07:13:04
2024-08-16T07:17:35
react-native-audio-toolkit
react-native-audio-toolkit/react-native-audio-toolkit
1,047
232
```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"; export interface TypeWithAssetsArgs { archive?: pulumi.Input<pulumi.asset.Archive>; asset: pulumi.Input<pulumi.asset.Asset | pulumi.asset.Archive>; plainArchive: pulumi.asset.Archive; plainAsset?: pulumi.asset.Asset | pulumi.asset.Archive; } ```
/content/code_sandbox/tests/testdata/codegen/assets-and-archives/nodejs/types/input.ts
xml
2016-10-31T21:02:47
2024-08-16T19:47:04
pulumi
pulumi/pulumi
20,743
118
```xml <?xml version="1.0" encoding="utf-8"?> <sync-adapter xmlns:android="path_to_url" android:contentAuthority="@string/mauron85_bgloc_content_authority" android:accountType="@string/mauron85_bgloc_account_type" android:userVisible="false" android:supportsUploading="true" android:allowParallelSyncs="false" android:isAlwaysSyncable="true"/> ```
/content/code_sandbox/android/lib/src/main/res/xml/syncadapter.xml
xml
2016-05-31T22:09:08
2024-08-16T08:47:22
react-native-background-geolocation
mauron85/react-native-background-geolocation
1,326
99
```xml import { codec, cryptography, apiClient, Transaction, registrationSignatureMessageSchema, mainchainRegParams as mainchainRegParamsSchema, MESSAGE_TAG_CHAIN_REG, } from 'lisk-sdk'; /** * Registers the mainchain to a specific sidechain node. * * @example * ```js * // Update path to point to the dev-validators.json file of the sidechain which shall be registered on the mainchain import { keys as sidechainDevValidators } from '../default/dev-validators.json'; * (async () => { * await registerMainchain("lisk-core","my-lisk-app",sidechainDevValidators); *})(); * ``` * * @param mc mainchain alias of the mainchain to be registered. * @param sc sidechain alias of the sidechain, where the mainchain shall be registered. * @param sidechainDevValidators the `key` property of the `dev-validators.json` file. * Includes all keys of the sidechain validators to create the aggregated signature. */ export const registerMainchain = async (mc: string, sc: string, sidechainDevValidators: any[]) => { const { bls, address } = cryptography; // Connect to the mainchain node const mainchainClient = await apiClient.createIPCClient(`~/.lisk/${mc}`); // Connect to the sidechain node const sidechainClient = await apiClient.createIPCClient(`~/.lisk/${sc}`); // Get node info from sidechain and mainchain const mainchainNodeInfo = await mainchainClient.invoke('system_getNodeInfo'); const sidechainNodeInfo = await sidechainClient.invoke('system_getNodeInfo'); // Get active validators from mainchain const { validators: mainchainActiveValidators, certificateThreshold: mainchainCertificateThreshold, } = await mainchainClient.invoke('consensus_getBFTParameters', { height: mainchainNodeInfo.height, }); // Sort validator list lexicographically after their BLS key const paramsJSON = { ownChainID: sidechainNodeInfo.chainID, ownName: sc.replace(/-/g, '_'), mainchainValidators: (mainchainActiveValidators as { blsKey: string; bftWeight: string }[]) .map(v => ({ blsKey: v.blsKey, bftWeight: v.bftWeight })) .sort((a, b) => Buffer.from(a.blsKey, 'hex').compare(Buffer.from(b.blsKey, 'hex'))), mainchainCertificateThreshold, }; // Define parameters for the mainchain registration const params = { ownChainID: Buffer.from(paramsJSON.ownChainID as string, 'hex'), ownName: paramsJSON.ownName, mainchainValidators: paramsJSON.mainchainValidators.map(v => ({ blsKey: Buffer.from(v.blsKey, 'hex'), bftWeight: BigInt(v.bftWeight), })), mainchainCertificateThreshold: paramsJSON.mainchainCertificateThreshold, }; // Encode parameters const message = codec.encode(registrationSignatureMessageSchema, params); // Get active validators from sidechain const { validators: sidechainActiveValidators } = await sidechainClient.invoke( 'consensus_getBFTParameters', { height: sidechainNodeInfo.height }, ); // Add validator private keys to the sidechain validator list const activeValidatorsBLSKeys: { blsPublicKey: Buffer; blsPrivateKey: Buffer }[] = []; for (const activeValidator of sidechainActiveValidators as { blsKey: string; bftWeight: string; }[]) { const sidechainDevValidator = sidechainDevValidators.find( devValidator => devValidator.plain.blsKey === activeValidator.blsKey, ); if (sidechainDevValidator) { activeValidatorsBLSKeys.push({ blsPublicKey: Buffer.from(activeValidator.blsKey, 'hex'), blsPrivateKey: Buffer.from(sidechainDevValidator.plain.blsPrivateKey, 'hex'), }); } } console.log('Total activeValidatorsBLSKeys:', activeValidatorsBLSKeys.length); // Sort active validators from sidechain lexicographically after their BLS public key activeValidatorsBLSKeys.sort((a, b) => a.blsPublicKey.compare(b.blsPublicKey)); const sidechainValidatorsSignatures: { publicKey: Buffer; signature: Buffer }[] = []; // Sign parameters with each active sidechain validator for (const validator of activeValidatorsBLSKeys) { const signature = bls.signData( MESSAGE_TAG_CHAIN_REG, params.ownChainID, message, validator.blsPrivateKey, ); sidechainValidatorsSignatures.push({ publicKey: validator.blsPublicKey, signature }); } const publicBLSKeys = activeValidatorsBLSKeys.map(v => v.blsPublicKey); console.log('Total active sidechain validators:', sidechainValidatorsSignatures.length); // Create an aggregated signature const { aggregationBits, signature } = bls.createAggSig( publicBLSKeys, sidechainValidatorsSignatures, ); // Get public key and nonce of the sender account const relayerKeyInfo = sidechainDevValidators[0]; const { nonce } = await sidechainClient.invoke<{ nonce: string }>('auth_getAuthAccount', { address: address.getLisk32AddressFromPublicKey(Buffer.from(relayerKeyInfo.publicKey, 'hex')), }); // Add aggregated signature to the parameters of the mainchain registration const mainchainRegParams = { ...paramsJSON, signature: signature.toString('hex'), aggregationBits: aggregationBits.toString('hex'), }; // Create registerMainchain transaction const tx = new Transaction({ module: 'interoperability', command: 'registerMainchain', fee: BigInt(2000000000), params: codec.encodeJSON(mainchainRegParamsSchema, mainchainRegParams), nonce: BigInt(nonce), senderPublicKey: Buffer.from(relayerKeyInfo.publicKey, 'hex'), signatures: [], }); // Sign the transaction tx.sign( Buffer.from(sidechainNodeInfo.chainID as string, 'hex'), Buffer.from(relayerKeyInfo.privateKey, 'hex'), ); // Post the transaction to a sidechain node const result = await sidechainClient.invoke<{ transactionId: string; }>('txpool_postTransaction', { transaction: tx.getBytes().toString('hex'), }); console.log('Sent mainchain registration transaction. Result from transaction pool is: ', result); const authorizeMainchainResult = await mainchainClient.invoke<{ transactionId: string; }>('chainConnector_authorize', { enable: true, password: 'lisk', }); console.log('Authorize Mainchain completed, result:', authorizeMainchainResult); process.exit(0); }; ```
/content/code_sandbox/examples/interop/common/mainchain_registration.ts
xml
2016-02-01T21:45:35
2024-08-15T19:16:48
lisk-sdk
LiskArchive/lisk-sdk
2,721
1,481
```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. --> <view xmlns:android="path_to_url" style="@style/Widget.Design.Snackbar" class="com.google.android.material.snackbar.Snackbar$SnackbarLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:theme="@style/ThemeOverlay.AppCompat.Dark"/> ```
/content/code_sandbox/lib/java/com/google/android/material/snackbar/res/layout/design_layout_snackbar.xml
xml
2016-12-05T16:11:29
2024-08-16T17:51:42
material-components-android
material-components/material-components-android
16,176
138
```xml declare interface INoFrameworkCrudWebPartStrings { PropertyPaneDescription: string; DataGroupName: string; ListNameFieldLabel: string; } declare module 'NoFrameworkCrudWebPartStrings' { const strings: INoFrameworkCrudWebPartStrings; export = strings; } ```
/content/code_sandbox/samples/sharepoint-crud/src/webparts/noFrameworkCrud/loc/mystrings.d.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
62
```xml import React, {FC} from 'react' const HandlerActions: FC<{ onGoToConfig: () => void onTest: () => void validationError: string }> = ({onGoToConfig, onTest, validationError}) => ( <div style={{display: 'flex'}}> <div className="btn btn-primary btn-sm" onClick={e => { e.preventDefault() onTest() }} > <span className="icon pulse-c" /> Send Test Alert </div> <div className="btn btn-default btn-sm" onClick={onGoToConfig}> <span className="icon cog-thick" /> {validationError ? 'Exit this Rule and Edit Configuration' : 'Save this Rule and Edit Configuration'} </div> </div> ) export default HandlerActions ```
/content/code_sandbox/ui/src/kapacitor/components/handlers/HandlerActions.tsx
xml
2016-08-24T23:28:56
2024-08-13T19:50:03
chronograf
influxdata/chronograf
1,494
185
```xml import type { BeforeAll, Canvas, CleanupCallback, ProjectAnnotations as CsfProjectAnnotations, DecoratorFunction, Globals, LoaderFunction, Renderer, StepRunner, } from '@storybook/csf'; import type { ComponentAnnotations, ComponentId, ComponentTitle, LegacyStoryFn, PartialStoryFn, Path, StoryAnnotations, StoryContext, StoryContextForEnhancers, StoryFn, StoryId, StoryIdentifier, StoryName, StrictArgTypes, StrictGlobalTypes, } from './csf'; // Store Types export interface WebRenderer extends Renderer { canvasElement: HTMLElement; } export type ModuleExport = any; export type ModuleExports = Record<string, ModuleExport>; export type ModuleImportFn = (path: Path) => Promise<ModuleExports>; type MaybePromise<T> = Promise<T> | T; export type TeardownRenderToCanvas = () => MaybePromise<void>; export type RenderToCanvas<TRenderer extends Renderer> = ( context: RenderContext<TRenderer>, element: TRenderer['canvasElement'] ) => MaybePromise<void | TeardownRenderToCanvas>; export interface ProjectAnnotations<TRenderer extends Renderer> extends CsfProjectAnnotations<TRenderer> { testingLibraryRender?: (...args: never[]) => { unmount: () => void }; renderToCanvas?: RenderToCanvas<TRenderer>; /* @deprecated use renderToCanvas */ renderToDOM?: RenderToCanvas<TRenderer>; } type NamedExportsOrDefault<TExport> = TExport | { default: TExport }; export type NamedOrDefaultProjectAnnotations<TRenderer extends Renderer = Renderer> = NamedExportsOrDefault<ProjectAnnotations<TRenderer>>; export type NormalizedProjectAnnotations<TRenderer extends Renderer = Renderer> = Omit< ProjectAnnotations<TRenderer>, 'decorators' | 'loaders' | 'runStep' | 'beforeAll' > & { argTypes?: StrictArgTypes; globalTypes?: StrictGlobalTypes; decorators?: DecoratorFunction<TRenderer>[]; loaders?: LoaderFunction<TRenderer>[]; runStep: StepRunner<TRenderer>; beforeAll: BeforeAll; }; export type NormalizedComponentAnnotations<TRenderer extends Renderer = Renderer> = Omit< ComponentAnnotations<TRenderer>, 'decorators' | 'loaders' > & { // Useful to guarantee that id & title exists id: ComponentId; title: ComponentTitle; argTypes?: StrictArgTypes; decorators?: DecoratorFunction<TRenderer>[]; loaders?: LoaderFunction<TRenderer>[]; }; export type NormalizedStoryAnnotations<TRenderer extends Renderer = Renderer> = Omit< StoryAnnotations<TRenderer>, 'storyName' | 'story' | 'decorators' | 'loaders' > & { moduleExport: ModuleExport; // You cannot actually set id on story annotations, but we normalize it to be there for convenience id: StoryId; argTypes?: StrictArgTypes; name: StoryName; userStoryFn?: StoryFn<TRenderer>; decorators?: DecoratorFunction<TRenderer>[]; loaders?: LoaderFunction<TRenderer>[]; }; export type CSFFile<TRenderer extends Renderer = Renderer> = { meta: NormalizedComponentAnnotations<TRenderer>; stories: Record<StoryId, NormalizedStoryAnnotations<TRenderer>>; moduleExports: ModuleExports; }; export type PreparedStory<TRenderer extends Renderer = Renderer> = StoryContextForEnhancers<TRenderer> & { moduleExport: ModuleExport; originalStoryFn: StoryFn<TRenderer>; undecoratedStoryFn: LegacyStoryFn<TRenderer>; unboundStoryFn: LegacyStoryFn<TRenderer>; applyLoaders: (context: StoryContext<TRenderer>) => Promise<StoryContext<TRenderer>['loaded']>; applyBeforeEach: (context: StoryContext<TRenderer>) => Promise<CleanupCallback[]>; playFunction?: (context: StoryContext<TRenderer>) => Promise<void> | void; runStep: StepRunner<TRenderer>; mount: (context: StoryContext<TRenderer>) => () => Promise<Canvas>; testingLibraryRender?: (...args: never[]) => unknown; renderToCanvas?: ProjectAnnotations<TRenderer>['renderToCanvas']; usesMount: boolean; storyGlobals: Globals; }; export type PreparedMeta<TRenderer extends Renderer = Renderer> = Omit< StoryContextForEnhancers<TRenderer>, 'name' | 'story' > & { moduleExport: ModuleExport; }; export type BoundStory<TRenderer extends Renderer = Renderer> = PreparedStory<TRenderer> & { storyFn: PartialStoryFn<TRenderer>; }; // TODO Consolidate this with context for 9.0 export declare type RenderContext<TRenderer extends Renderer = Renderer> = StoryIdentifier & { showMain: () => void; showError: (error: { title: string; description: string }) => void; showException: (err: Error) => void; forceRemount: boolean; storyContext: StoryContext<TRenderer>; storyFn: PartialStoryFn<TRenderer>; unboundStoryFn: LegacyStoryFn<TRenderer>; }; ```
/content/code_sandbox/code/core/src/types/modules/story.ts
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
1,178
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIcons</key> <dict/> <key>CFBundleIcons~ipad</key> <dict/> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLName</key> <string>Client</string> <key>CFBundleURLSchemes</key> <array> <string>REVERSED_CLIENT_ID</string> </array> </dict> </array> <key>CFBundleVersion</key> <string>1</string> <key>LSRequiresIPhoneOS</key> <true/> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UIMainStoryboardFile</key> <string>Main</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> </array> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist> ```
/content/code_sandbox/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
xml
2016-04-26T17:13:37
2024-08-15T05:40:16
quickstart-ios
firebase/quickstart-ios
2,773
571
```xml import { Update } from '../../src/apprun'; let startTime; let lastName; export const startMeasure = function (name: string) { lastName = name startTime = performance.now(); } export const stopMeasure = function () { window.setTimeout(function () { const stop = performance.now(); const measure = lastName + ' took ' + (stop - startTime).toFixed(2); // console.log(measure); const el = document.getElementById('measure'); el && (el.innerHTML = measure); }); } function _random(max: number) { return Math.round(Math.random()*1000)%max; } const adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; const colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; export type Data = { id: number label: string } export type State = { data: Array<Data>; selected: number; } export type Events = '.' | 'run' | 'runlost' | 'add' | 'udate' | 'swaprows' | 'clear' | 'delete' | 'select'; export const state: State = { data: [], selected: 0 } let id = 1 function buildData(count: number): Array<Data> { return new Array(count).fill(0).map(_ => ({ id: id++, label: `${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${nouns[_random(nouns.length)]}` })) } export const update: Update<State, Events> = { run: () => ({ data: buildData(1000), selected: 0 }), add: state => ({ data: state.data.concat(buildData(1000)), selected: state.selected, }), runlots: () => ({ data: buildData(10000), selected: 0 }), clear: () => ({ data: [], selected: 0 }), update: state => ({ data: state.data.map((d, i) => { if (i % 10 === 0) { d.label = `${d.label} !!!` } return d }), selected: state.selected }), swaprows: state => { if (state.data.length > 4) { const idx = state.data.length - 2; const a = state.data[1]; state.data[1] = state.data[idx]; state.data[idx] = a; } return state; }, select: (state, selected) => ({ ...state, selected }), delete: (state, id) => { if (state.selected == id) state.selected = 0; state.data = state.data.filter(d => d.id != id); return state; }, } ```
/content/code_sandbox/demo/components/store.ts
xml
2016-10-07T02:07:44
2024-08-16T16:03:13
apprun
yysun/apprun
1,177
757
```xml <EventContainer xmlns="clr-namespace:MonoTests.System.Xaml;assembly=System.Xaml.TestCases" /> ```
/content/code_sandbox/src/Test/System.Xaml.TestCases/XmlFiles/EventContainer.xml
xml
2016-08-25T20:07:20
2024-08-13T22:23:35
CoreWF
UiPath/CoreWF
1,126
22
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="debug|x64"> <Configuration>debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="checked|x64"> <Configuration>checked</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="profile|x64"> <Configuration>profile</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="release|x64"> <Configuration>release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{31A4AC31-DF55-4780-C2C7-F540684C09B5}</ProjectGuid> <RootNamespace>SnippetVehicleTank</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> <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)'=='checked|x64'"> <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)'=='profile|x64'"> <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|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/SnippetVehicleTank/debug\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)DEBUG</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;_DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/LIBPATH:../../../Lib/vc14win64 PhysX3CommonDEBUG_x64.lib PhysX3DEBUG_x64.lib PhysX3CookingDEBUG_x64.lib PhysX3CharacterKinematicDEBUG_x64.lib PhysX3ExtensionsDEBUG.lib PhysX3VehicleDEBUG.lib PxTaskDEBUG_x64.lib PxFoundationDEBUG_x64.lib PsFastXmlDEBUG_x64.lib PxPvdSDKDEBUG_x64.lib /LIBPATH:../../lib/vc14win64 SnippetUtilsDEBUG.lib /DEBUG</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)DEBUG.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc14win64;./../../lib/vc14win64;./../../../../PxShared/lib/vc14win64;./../../Graphics/lib/win64/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc14win64\PxFoundationDEBUG_x64.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc14win64\PxPvdSDKDEBUG_x64.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/SnippetVehicleTank/checked\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)CHECKED</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/LIBPATH:../../../Lib/vc14win64 PhysX3CommonCHECKED_x64.lib PhysX3CHECKED_x64.lib PhysX3CookingCHECKED_x64.lib PhysX3CharacterKinematicCHECKED_x64.lib PhysX3ExtensionsCHECKED.lib PhysX3VehicleCHECKED.lib PxTaskCHECKED_x64.lib PxFoundationCHECKED_x64.lib PsFastXmlCHECKED_x64.lib PxPvdSDKCHECKED_x64.lib /LIBPATH:../../lib/vc14win64 SnippetUtilsCHECKED.lib</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)CHECKED.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc14win64;./../../lib/vc14win64;./../../../../PxShared/lib/vc14win64;./../../Graphics/lib/win64/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc14win64\PxFoundationCHECKED_x64.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc14win64\PxPvdSDKCHECKED_x64.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/SnippetVehicleTank/profile\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)PROFILE</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_PROFILE=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win64 PhysX3CommonPROFILE_x64.lib PhysX3PROFILE_x64.lib PhysX3CookingPROFILE_x64.lib PhysX3CharacterKinematicPROFILE_x64.lib PhysX3ExtensionsPROFILE.lib PhysX3VehiclePROFILE.lib PxTaskPROFILE_x64.lib PxFoundationPROFILE_x64.lib PsFastXmlPROFILE_x64.lib PxPvdSDKPROFILE_x64.lib /LIBPATH:../../lib/vc14win64 SnippetUtilsPROFILE.lib /DEBUG</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)PROFILE.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc14win64;./../../lib/vc14win64;./../../../../PxShared/lib/vc14win64;./../../Graphics/lib/win64/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc14win64\PxFoundationPROFILE_x64.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc14win64\PxPvdSDKPROFILE_x64.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/SnippetVehicleTank/release\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_SUPPORT_PVD=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win64 PhysX3Common_x64.lib PhysX3_x64.lib PhysX3Cooking_x64.lib PhysX3CharacterKinematic_x64.lib PhysX3Extensions.lib PhysX3Vehicle.lib PxTask_x64.lib PxFoundation_x64.lib PsFastXml_x64.lib PxPvdSDK_x64.lib /LIBPATH:../../lib/vc14win64 SnippetUtils.lib</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc14win64;./../../lib/vc14win64;./../../../../PxShared/lib/vc14win64;./../../Graphics/lib/win64/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc14win64\PxFoundation_x64.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc14win64\PxPvdSDK_x64.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\SnippetCommon\ClassicMain.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\SnippetVehicleTank\SnippetVehicleTank.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetVehicleTank\SnippetVehicleTankRender.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\SnippetVehicleCommon\SnippetVehicle4WCreate.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetVehicleCommon\SnippetVehicleCreate.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetVehicleCommon\SnippetVehicleFilterShader.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetVehicleCommon\SnippetVehicleNoDriveCreate.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetVehicleCommon\SnippetVehicleSceneQuery.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetVehicleCommon\SnippetVehicleTankCreate.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetVehicleCommon\SnippetVehicleTireFriction.cpp"> </ClCompile> <ClInclude Include="..\..\SnippetVehicleCommon\SnippetVehicleConcurrency.h"> </ClInclude> <ClInclude Include="..\..\SnippetVehicleCommon\SnippetVehicleCreate.h"> </ClInclude> <ClInclude Include="..\..\SnippetVehicleCommon\SnippetVehicleFilterShader.h"> </ClInclude> <ClInclude Include="..\..\SnippetVehicleCommon\SnippetVehicleSceneQuery.h"> </ClInclude> <ClInclude Include="..\..\SnippetVehicleCommon\SnippetVehicleTireFriction.h"> </ClInclude> <ClInclude Include="..\..\SnippetVehicleCommon\SnippetVehicleWheelQueryResult.h"> </ClInclude> </ItemGroup> <ItemGroup> <ProjectReference Include="./SnippetUtils.vcxproj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <ItemGroup> <ProjectReference Include="./SnippetRender.vcxproj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"></ImportGroup> </Project> ```
/content/code_sandbox/PhysX_3.4/Snippets/compiler/vc14win64/SnippetVehicleTank.vcxproj
xml
2016-10-12T16:34:31
2024-08-16T09:40:38
PhysX-3.4
NVIDIAGameWorks/PhysX-3.4
2,343
5,088
```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 zeros = require( '@stdlib/ndarray/zeros' ); import nditerMatrixEntries = require( './index' ); // TESTS // // The function returns an iterator... { const x = zeros( [ 2, 2, 2 ] ); nditerMatrixEntries( x ); // $ExpectType Iterator<[(number | null)[], typedndarray<number>]> nditerMatrixEntries( x, {} ); // $ExpectType Iterator<[(number | null)[], typedndarray<number>]> } // The compiler throws an error if the function is provided a first argument which is not an ndarray... { nditerMatrixEntries( '123' ); // $ExpectError nditerMatrixEntries( 123 ); // $ExpectError nditerMatrixEntries( true ); // $ExpectError nditerMatrixEntries( false ); // $ExpectError nditerMatrixEntries( null ); // $ExpectError nditerMatrixEntries( undefined ); // $ExpectError nditerMatrixEntries( {} ); // $ExpectError nditerMatrixEntries( ( x: number ): number => x ); // $ExpectError nditerMatrixEntries( '123', {} ); // $ExpectError nditerMatrixEntries( 123, {} ); // $ExpectError nditerMatrixEntries( true, {} ); // $ExpectError nditerMatrixEntries( false, {} ); // $ExpectError nditerMatrixEntries( null, {} ); // $ExpectError nditerMatrixEntries( undefined, {} ); // $ExpectError nditerMatrixEntries( {}, {} ); // $ExpectError nditerMatrixEntries( ( x: number ): number => x, {} ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not an object... { const x = zeros( [ 2, 2, 2 ] ); nditerMatrixEntries( x, 'abc' ); // $ExpectError nditerMatrixEntries( x, 123 ); // $ExpectError nditerMatrixEntries( x, true ); // $ExpectError nditerMatrixEntries( x, false ); // $ExpectError nditerMatrixEntries( x, null ); // $ExpectError nditerMatrixEntries( x, [] ); // $ExpectError nditerMatrixEntries( x, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided a `readonly` option which is boolean... { const x = zeros( [ 2, 2, 2 ] ); nditerMatrixEntries( x, { 'readonly': 'abc' } ); // $ExpectError nditerMatrixEntries( x, { 'readonly': 123 } ); // $ExpectError nditerMatrixEntries( x, { 'readonly': null } ); // $ExpectError nditerMatrixEntries( x, { 'readonly': [] } ); // $ExpectError nditerMatrixEntries( x, { 'readonly': {} } ); // $ExpectError nditerMatrixEntries( x, { 'readonly': ( x: number ): number => x } ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { const x = zeros( [ 2, 2, 2 ] ); nditerMatrixEntries(); // $ExpectError nditerMatrixEntries( x, {}, {} ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/ndarray/iter/matrix-entries/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
808
```xml /** * @license * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ export * from './adapter'; export * from './component'; export * from './constants'; export * from './foundation'; export * from './types'; ```
/content/code_sandbox/packages/mdc-chips/chip-set/index.ts
xml
2016-12-05T16:04:09
2024-08-16T15:42:22
material-components-web
material-components/material-components-web
17,119
257
```xml <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="path_to_url"> <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{64bed835-70a3-4780-817a-37550f9beafe}</UniqueIdentifier> <Extensions>cpp</Extensions> </Filter> <Filter Include="Header Files"> <UniqueIdentifier>{bfe6b5ec-94ca-4771-b4ae-6d29a8e62dc6}</UniqueIdentifier> <Extensions>h</Extensions> </Filter> <Filter Include="Resource Files"> <UniqueIdentifier>{f483e665-b347-4776-8c97-9c8eae695c22}</UniqueIdentifier> <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions> </Filter> <Filter Include="Scripts"> <UniqueIdentifier>{d1fedab4-998c-44f8-86b5-3863df5d8a73}</UniqueIdentifier> </Filter> <Filter Include="Texts"> <UniqueIdentifier>{332d9393-d918-4caf-86b2-2e63c2cca9bd}</UniqueIdentifier> </Filter> <Filter Include="Header Files\GUI headers"> <UniqueIdentifier>{b1fe2cd0-889c-48dd-897c-cdbbdcb0a131}</UniqueIdentifier> </Filter> <Filter Include="Header Files\GUI headers\Gadgets headers"> <UniqueIdentifier>{3bc65fe2-8c15-4ecd-bf59-de962bb42275}</UniqueIdentifier> </Filter> <Filter Include="Header Files\GUI headers\Menus headers"> <UniqueIdentifier>{df54d6d1-39c3-4f26-93f8-116311f5a0eb}</UniqueIdentifier> </Filter> <Filter Include="Source Files\GUI"> <UniqueIdentifier>{4c95322d-560a-4738-a631-e3e860b59560}</UniqueIdentifier> </Filter> <Filter Include="Source Files\GUI\Menus"> <UniqueIdentifier>{9a04e8a8-ecfc-42c3-bf28-fe3d8b49e626}</UniqueIdentifier> </Filter> <Filter Include="Source Files\GUI\Gadgets"> <UniqueIdentifier>{47ffb7e3-433b-480c-a22a-849524a5bd1e}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="CmdLine.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="Credits.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="GLSettings.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="LCDDrawing.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="LevelInfo.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="MainWindow.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="SeriousSam.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="SplashScreen.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="StdH.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="VarList.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGHighScore.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGServerList.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGButton.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGFileButton.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGKeyDefinition.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGModel.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGSlider.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGTitle.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGTrigger.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGVarButton.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MenuGadget.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGChangePlayer.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGLevelButton.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGArrow.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Components\MGEdit.cpp"> <Filter>Source Files\GUI\Gadgets</Filter> </ClCompile> <ClCompile Include="GUI\Menus\Menu.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MenuStuff.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\GameMenu.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MConfirm.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MPlayerProfile.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MOptions.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MLoadSave.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MVideoOptions.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MSelectPlayers.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MSplitStart.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MNetworkStart.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MCustomizeAxis.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MControls.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MAudioOptions.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MCustomizeKeyboard.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MServers.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MHighScore.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MNetwork.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MSplitScreen.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MNetworkJoin.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MNetworkOpen.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MVar.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MLevels.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MDisabled.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MSinglePlayerNew.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MSinglePlayer.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MInGame.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MMain.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MenuPrinting.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MenuManager.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MenuStarters.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MenuStartersAF.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> <ClCompile Include="GUI\Menus\MenuActions.cpp"> <Filter>Source Files\GUI\Menus</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="CmdLine.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="Credits.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="GLSettings.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="LCDDrawing.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="LevelInfo.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="MainWindow.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="resource.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="SeriousSam.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="SplashScreen.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="StdH.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="VarList.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="ArrowDir.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="FileInfo.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGModel.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGVarButton.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGTrigger.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGTitle.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGSlider.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGServerList.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGLevelButton.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGKeyDefinition.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGHighScore.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGEdit.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGButton.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGArrow.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGFileButton.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MGChangePlayer.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Components\MenuGadget.h"> <Filter>Header Files\GUI headers\Gadgets headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MControls.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MInGame.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MLevels.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MNetwork.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MCustomizeKeyboard.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MDisabled.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MHighScore.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MLoadSave.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MMain.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MNetworkJoin.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MNetworkOpen.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MNetworkStart.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MOptions.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MPlayerProfile.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MSelectPlayers.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MServers.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MSinglePlayer.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MSplitStart.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MSplitScreen.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MSinglePlayerNew.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MVar.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MCustomizeAxis.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MConfirm.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MAudioOptions.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MenuStuff.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MVideoOptions.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\Menu.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MRenderingOptions.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MCredits.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\GameMenu.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MenuPrinting.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MenuManager.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MenuStarters.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MenuStartersAF.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> <ClInclude Include="GUI\Menus\MenuActions.h"> <Filter>Header Files\GUI headers\Menus headers</Filter> </ClInclude> </ItemGroup> <ItemGroup> <ResourceCompile Include="SeriousSam.rc"> <Filter>Resource Files</Filter> </ResourceCompile> </ItemGroup> <ItemGroup> <CustomBuild Include="nocursor.cur"> <Filter>Resource Files</Filter> </CustomBuild> <CustomBuild Include="nodrop.cur"> <Filter>Resource Files</Filter> </CustomBuild> <CustomBuild Include="res\SeriousSam.ico"> <Filter>Resource Files</Filter> </CustomBuild> <CustomBuild Include="Splash.bmp"> <Filter>Resource Files</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\Menu\ApplyShadowmaps.ini"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\Menu\ApplyTextures.ini"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\Menu\ApplyVideo.ini"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\CustomOptions\GameOptions.cfg"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\Menu\GameOptions.cfg"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\CustomOptions\GameOptions.des"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\CustomOptions\GFX-AdvancedRendering.cfg"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\CustomOptions\GFX-AdvancedRendering.des"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\CustomOptions\PredictionOptions.cfg"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\CustomOptions\PredictionOptions.des"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\Menu\RenderingOptions.cfg"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Scripts\Addons\SFX-AutoAdjust.des"> <Filter>Scripts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Data\Credits.txt"> <Filter>Texts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Data\Credits_Demo.txt"> <Filter>Texts</Filter> </CustomBuild> <CustomBuild Include="..\..\Flesh\Data\Credits_End.txt"> <Filter>Texts</Filter> </CustomBuild> </ItemGroup> </Project> ```
/content/code_sandbox/Sources/SeriousSam/SeriousSam.vcxproj.filters
xml
2016-03-11T13:28:40
2024-08-15T13:54:18
Serious-Engine
Croteam-official/Serious-Engine
3,021
5,121
```xml import * as React from 'react'; import { applyTriggerPropsToChildren, type FluentTriggerComponent, getTriggerChild, useMergedRefs, } from '@fluentui/react-utilities'; import { useOverflowItem } from '../../useOverflowItem'; import { OverflowItemProps } from './OverflowItem.types'; /** * Attaches overflow item behavior to its child registered with the OverflowContext. * It does not render an element of its own. * * Behaves similarly to other `*Trigger` components in Fluent UI React. */ export const OverflowItem = React.forwardRef((props: OverflowItemProps, ref) => { const { id, groupId, priority, children } = props; const containerRef = useOverflowItem(id, priority, groupId); const child = getTriggerChild(children); return applyTriggerPropsToChildren(children, { ref: useMergedRefs(containerRef, ref, child?.ref), }); }); // type casting here is required to ensure internal type FluentTriggerComponent is not leaked (OverflowItem as FluentTriggerComponent).isFluentTriggerComponent = true; ```
/content/code_sandbox/packages/react-components/react-overflow/library/src/components/OverflowItem/OverflowItem.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
232
```xml <?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <LangVersion>8.0</LangVersion> <!-- Publishing configuration --> <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> <!-- We publish these for lots of different runtimes, so leave these empty and then specify them in scripts/build/build-release-cli-exes.sh. The regular build works fine with the defaults (and will pick a runtime automatically) --> <!-- <PublishTrimmed>true</PublishTrimmed> --> <!-- <PublishSingleFile>true</PublishSingleFile> --> <!-- <PublishReadyToRun>false</PublishReadyToRun> --> <!-- <SelfContained>true</SelfContained> --> </PropertyGroup> <!-- +++++++++++++++++++++++++++ This creates build-time values that we use to make version info +++++++++++++++++++++++++++ --> <!-- Creates a GitHash property --> <Target Name="GitHash" BeforeTargets="AddCliAssemblyMetadata"> <Exec Command="git describe --long --always --dirty --exclude=* --abbrev=8" ConsoleToMSBuild="True" IgnoreExitCode="False"> <Output PropertyName="GitHash" TaskParameter="ConsoleOutput" /> </Exec> </Target> <!-- Creates a BuildDate property --> <Target Name="BuildDate" BeforeTargets="AddCliAssemblyMetadata"> <Exec Command="date" ConsoleToMSBuild="True" IgnoreExitCode="False"> <Output PropertyName="BuildDate" TaskParameter="ConsoleOutput" /> </Exec> </Target> <!-- Creates AssemblyMetadataAttributes which can be used via `System.Reflection.Assembly.GetEntryAssembly.GetCustomAttributes< System.Reflection.AssemblyMetadataAttribute>()` --> <Target Name="AddCliAssemblyMetadata" BeforeTargets="CoreGenerateAssemblyInfo"> <ItemGroup> <AssemblyAttribute Include="AssemblyMetadata"> <_Parameter1>$(BuildDate)</_Parameter1> <_Parameter2>$(GitHash)</_Parameter2> </AssemblyAttribute> </ItemGroup> </Target> <ItemGroup> <None Include="paket.references" /> </ItemGroup> <Target Name="PrintRuntimeIdentifierCli" BeforeTargets="BeforeBuild"> <Message Importance="high" Text="RuntimeIdentifier in Cli is '$(RuntimeIdentifier)'" /> </Target> <ItemGroup> <ProjectReference Include="../LibExecution/LibExecution.fsproj" /> <ProjectReference Include="../LibPackageManager/LibPackageManager.fsproj" /> <ProjectReference Include="../BuiltinCliHost/BuiltinCliHost.fsproj" /> </ItemGroup> <ItemGroup> <Compile Include="Cli.fs" /> </ItemGroup> <Import Project="..\..\.paket\Paket.Restore.targets" /> </Project> ```
/content/code_sandbox/backend/src/Cli/Cli.fsproj
xml
2016-12-04T23:15:08
2024-08-16T03:57:32
dark
darklang/dark
1,652
641
```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. --> <resources> <string name="character_counter_content_description">%1$d/%2$d karaktere idatzi dira</string> <string name="character_counter_overflowed_content_description">Karaktere-muga gainditu da: %1$d/%2$d</string> <string name="password_toggle_content_description">Erakutsi pasahitza</string> <string name="clear_text_end_icon_content_description">Garbitu testua</string> <string name="exposed_dropdown_menu_content_description">Erakutsi goitibeherako menua</string> <string name="error_icon_content_description">Errorea</string> </resources> ```
/content/code_sandbox/lib/java/com/google/android/material/textfield/res/values-eu/strings.xml
xml
2016-12-05T16:11:29
2024-08-16T17:51:42
material-components-android
material-components/material-components-android
16,176
207
```xml <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>QualityChecker</class> <widget class="QDockWidget" name="QualityChecker"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>567</width> <height>403</height> </rect> </property> <property name="windowTitle"> <string>Quality Checker</string> </property> <widget class="QWidget" name="dockWidgetContents"> <widget class="QPushButton" name="createImageSpacePushButton"> <property name="geometry"> <rect> <x>20</x> <y>50</y> <width>121</width> <height>23</height> </rect> </property> <property name="text"> <string>Take Views</string> </property> <property name="checkable"> <bool>false</bool> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> <widget class="QPushButton" name="comparePushButton"> <property name="geometry"> <rect> <x>20</x> <y>80</y> <width>121</width> <height>23</height> </rect> </property> <property name="text"> <string>Compare </string> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> <widget class="QPushButton" name="useCurrentLayerPushButton"> <property name="geometry"> <rect> <x>20</x> <y>10</y> <width>121</width> <height>23</height> </rect> </property> <property name="toolTip"> <string extracomment="Use the vertices in the current mesh layer as sampling points for taking model shots"/> </property> <property name="text"> <string>Use Current Layer </string> </property> </widget> </widget> <action name="actionCreateImageSpace"> <property name="checkable"> <bool>true</bool> </property> <property name="text"> <string>createImageSpace</string> </property> </action> </widget> <resources> <include location="edit_paint.qrc"/> </resources> <connections/> </ui> ```
/content/code_sandbox/unsupported/plugins_experimental/edit_panosample/QualityChecker.ui
xml
2016-11-07T00:03:21
2024-08-16T16:55:49
meshlab
cnr-isti-vclab/meshlab
4,633
568
```xml import { HttpServiceInterface } from '../../Http/HttpServiceInterface' import { RecoveryKeyParamsRequestParams, SignInWithRecoveryCodesRequestParams } from '../../Request' import { HttpResponse } from '@standardnotes/responses' import { GenerateRecoveryCodesResponseBody, RecoveryKeyParamsResponseBody, SignInWithRecoveryCodesResponseBody, } from '../../Response' import { AuthServerInterface } from './AuthServerInterface' import { Paths } from './Paths' export class AuthServer implements AuthServerInterface { constructor(private httpService: HttpServiceInterface) {} async generateRecoveryCodes(): Promise<HttpResponse<GenerateRecoveryCodesResponseBody>> { return this.httpService.post(Paths.v1.generateRecoveryCodes) } async recoveryKeyParams( params: RecoveryKeyParamsRequestParams, ): Promise<HttpResponse<RecoveryKeyParamsResponseBody>> { return this.httpService.post(Paths.v1.recoveryKeyParams, params) } async signInWithRecoveryCodes( params: SignInWithRecoveryCodesRequestParams, ): Promise<HttpResponse<SignInWithRecoveryCodesResponseBody>> { return this.httpService.post(Paths.v1.signInWithRecoveryCodes, params) } } ```
/content/code_sandbox/packages/api/src/Domain/Server/Auth/AuthServer.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
250
```xml import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import { App } from './App'; createRoot(document.getElementById('root')!).render( <StrictMode> <App /> </StrictMode> ); ```
/content/code_sandbox/examples/ci/src/index.tsx
xml
2016-06-17T22:03:19
2024-08-16T10:28:42
react-querybuilder
react-querybuilder/react-querybuilder
1,131
54
```xml import React from 'react'; type IconProps = React.SVGProps<SVGSVGElement>; export declare const IcEnvelopeOpen: (props: IconProps) => React.JSX.Element; export {}; ```
/content/code_sandbox/packages/icons/lib/icEnvelopeOpen.d.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
43
```xml import { interfaces } from '@botpress/sdk' export default interfaces.llm ```
/content/code_sandbox/interfaces/llm/interface.definition.ts
xml
2016-11-16T21:57:59
2024-08-16T18:45:35
botpress
botpress/botpress
12,401
17
```xml /*! */ const path = require('path') export class MultiLanguageRecognizer { public recognizers: any private readonly id: string private readonly dialogPath: string private readonly $schema: string | undefined constructor(dialogPath: string, recognizers: any, schema?: string) { this.id = `QnA_${path.basename(dialogPath).split('.')[0]}` this.dialogPath = dialogPath this.recognizers = recognizers this.$schema = schema } save(): string { let output: any = { $kind: 'Microsoft.MultiLanguageRecognizer', id: this.id, recognizers: this.recognizers } if (this.$schema) { output = {$schema: this.$schema, ...output} } return JSON.stringify(output, null, 4) } getDialogPath(): string { return this.dialogPath } } ```
/content/code_sandbox/parsers/LU/JS/packages/lu/src/parser/qnabuild/multi-language-recognizer.ts
xml
2016-03-03T23:47:03
2024-08-14T08:40:45
botframework-sdk
microsoft/botframework-sdk
7,459
201
```xml import { Column, Entity, OneToMany, PrimaryColumn } from "../../../../src" import { Photo } from "./Photo" @Entity() export class Author { @PrimaryColumn() id: number @Column() firstName: string @Column() lastName: string @Column() age: number @OneToMany(() => Photo, (photo) => photo.author) photos: Photo[] } ```
/content/code_sandbox/test/github-issues/9977/entity/Author.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
88
```xml import { inject, injectable } from 'inversify'; import { ServiceIdentifiers } from '../container/ServiceIdentifiers'; import { ICodeTransformer } from '../interfaces/code-transformers/ICodeTransformer'; import { IOptions } from '../interfaces/options/IOptions'; import { IRandomGenerator } from '../interfaces/utils/IRandomGenerator'; import { CodeTransformer } from '../enums/code-transformers/CodeTransformer'; import { CodeTransformationStage } from '../enums/code-transformers/CodeTransformationStage'; @injectable() export abstract class AbstractCodeTransformer implements ICodeTransformer { /** * @type {CodeTransformer[]} */ public readonly runAfter: CodeTransformer[] | undefined; /** * @type {IOptions} */ protected readonly options: IOptions; /** * @type {IRandomGenerator} */ protected readonly randomGenerator: IRandomGenerator; /** * @param {IRandomGenerator} randomGenerator * @param {IOptions} options */ public constructor ( @inject(ServiceIdentifiers.IRandomGenerator) randomGenerator: IRandomGenerator, @inject(ServiceIdentifiers.IOptions) options: IOptions ) { this.randomGenerator = randomGenerator; this.options = options; } /** * @param {string} code * @param {CodeTransformationStage} codeTransformationStage * @returns {string} */ public abstract transformCode (code: string, codeTransformationStage: CodeTransformationStage): string; } ```
/content/code_sandbox/src/code-transformers/AbstractCodeTransformer.ts
xml
2016-05-09T08:16:53
2024-08-16T19:43:07
javascript-obfuscator
javascript-obfuscator/javascript-obfuscator
13,358
321
```xml /*your_sha256_hash----------------------------- *your_sha256_hash----------------------------*/ export function getLoadedMonaco(): typeof monaco { if (!monaco) { throw new Error("monaco is not loaded yet"); } return monaco; } export function getMonaco(): typeof monaco | undefined { return (window as any).monaco; } export interface IMonacoSetup { loaderUrl: string; loaderConfigPaths: Record<string, string>; codiconUrl: string; monacoTypesUrl: string | undefined; } let loading = false; let resolve: (value: typeof monaco) => void; let reject: (error: unknown) => void; let loadMonacoPromise = new Promise<typeof monaco>((res, rej) => { resolve = res; reject = rej; }); export async function waitForLoadedMonaco(): Promise<typeof monaco> { return loadMonacoPromise; } export async function loadMonaco( setup: IMonacoSetup = prodMonacoSetup ): Promise<typeof monaco> { if (!loading) { loading = true; _loadMonaco(setup).then(resolve, reject); } return loadMonacoPromise; } async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> { const global = self as any; if (!(global as any).require) { await loadScript(setup.loaderUrl); } global.AMD = true; global.getCodiconPath = () => { return setup.codiconUrl; }; /** @type {any} */ const req = global.require as any; req.config({ paths: setup.loaderConfigPaths }); return new Promise((res) => { // First load editor.main. If it inlines the plugins, we don't want to try to load them from the server. req(["vs/editor/editor.main"], () => { if ((setup as any).onlyCore) { res(monaco); return; } req( [ "vs/basic-languages/monaco.contribution", "vs/language/css/monaco.contribution", "vs/language/html/monaco.contribution", "vs/language/json/monaco.contribution", "vs/language/typescript/monaco.contribution", ], () => { res(monaco); } ); }); }); } function loadScript(path: string): Promise<void> { return new Promise((res) => { const script = document.createElement("script"); script.onload = () => res(); script.async = true; script.type = "text/javascript"; script.src = path; // CodeQL [SM01507] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration. // CodeQL [SM03712] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration. document.head.appendChild(script); }); } export const prodMonacoSetup = getMonacoSetup( "node_modules/monaco-editor/min/vs" ); export function getMonacoSetup(corePath: string): IMonacoSetup { const loaderConfigPaths = { vs: `${corePath}`, }; return { loaderUrl: `${corePath}/loader.js`, loaderConfigPaths, codiconUrl: `${corePath}/base/browser/ui/codicons/codicon/codicon.ttf`, monacoTypesUrl: undefined, }; } ```
/content/code_sandbox/website/src/monaco-loader.ts
xml
2016-06-07T16:56:31
2024-08-16T17:17:05
monaco-editor
microsoft/monaco-editor
39,508
760
```xml import type { H3Event } from 'h3' import { klona } from 'klona' // @ts-expect-error virtual file import _inlineAppConfig from '#internal/nuxt/app-config' // App config const _sharedAppConfig = _deepFreeze(klona(_inlineAppConfig)) export function useAppConfig (event?: H3Event) { // Backwards compatibility with ambient context if (!event) { return _sharedAppConfig } if (!event.context.nuxt) { event.context.nuxt = {} } // Reuse cached app config from event context if (event.context.nuxt.appConfig) { return event.context.nuxt.appConfig } // Prepare app config for event context const appConfig = klona(_inlineAppConfig) event.context.nuxt.appConfig = appConfig return appConfig } // --- Utils --- function _deepFreeze (object: Record<string, any>) { const propNames = Object.getOwnPropertyNames(object) for (const name of propNames) { const value = object[name] if (value && typeof value === 'object') { _deepFreeze(value) } } return Object.freeze(object) } ```
/content/code_sandbox/packages/nuxt/src/core/runtime/nitro/app-config.ts
xml
2016-10-26T11:18:47
2024-08-16T19:32:46
nuxt
nuxt/nuxt
53,705
269
```xml import Burger from "./Burger"; class VegBurger extends Burger { public price(): number { return 11; } public name(): string { return "Veg Burger"; } } export default VegBurger; ```
/content/code_sandbox/samples/react-designpatterns-typescript/Builder/src/webparts/builder/components/VegBurger.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
50
```xml import React from 'react'; import { View, Text, TouchableOpacity, StyleSheet, ViewStyle, TextStyle, EmitterSubscription, } from 'react-native'; import { Navigation, NavigationProps, EventSubscription, Options } from 'react-native-navigation'; import TestIDs from '../testIDs'; type Event = { componentId?: string; componentName?: string; componentType?: string; passProps?: object; event?: string; commandName?: string; commandId?: string; buttonId?: string; text?: string; }; let _overlayInstance: any; export const logLifecycleEvent = (event: Event) => { _overlayInstance.addEvent(event); }; type State = { text: string; events: Event[]; }; interface OverlayProps extends NavigationProps { showOnTop: boolean; } export default class StaticLifecycleOverlay extends React.Component<OverlayProps, State> { events: Event[]; static options(): Options { return { layout: { componentBackgroundColor: 'transparent', }, }; } listeners: (EmitterSubscription | EventSubscription)[] = []; componentDidMount() { // eslint-disable-next-line consistent-this _overlayInstance = this; } componentWillUnmount() { _overlayInstance = null; this.listeners.forEach((listener) => listener.remove()); this.listeners = []; // eslint-disable-next-line no-alert alert('Overlay Unmounted'); } addEvent(event: Event) { this.events.push(event); this.setState({ events: this.events, }); } clearEvents() { this.events = []; this.setState({ events: this.events, }); } constructor(props: OverlayProps) { super(props); this.events = []; this.state = { text: 'nothing yet', events: [], }; this.listeners.push( Navigation.events().registerComponentWillAppearListener((event) => { this.addEvent({ ...event, event: 'componentWillAppear' }); }) ); this.listeners.push( Navigation.events().registerComponentDidAppearListener((event) => { this.addEvent({ ...event, event: 'componentDidAppear' }); }) ); this.listeners.push( Navigation.events().registerComponentDidDisappearListener((event) => { this.addEvent({ ...event, event: 'componentDidDisappear' }); }) ); this.listeners.push( Navigation.events().registerCommandListener((commandName) => { this.addEvent({ event: 'command started', commandName }); }) ); this.listeners.push( Navigation.events().registerCommandCompletedListener(({ commandName }) => { this.addEvent({ event: 'command completed', commandName }); }) ); this.listeners.push( Navigation.events().registerNavigationButtonPressedListener(({ componentId, buttonId }) => { this.addEvent({ event: 'navigationButtonPressed', buttonId, componentId }); }) ); this.listeners.push( Navigation.events().registerModalDismissedListener(({ componentId }) => { this.addEvent({ event: 'modalDismissed', componentId }); }) ); } renderEvent(event: Event) { if (event.commandId) { return <Text style={styles.h2}>{`${event.commandId}`}</Text>; } else if (event.commandName) { return <Text style={styles.h2}>{`${event.event}: ${event.commandName}`}</Text>; } else if (event.componentName) { return ( <Text style={styles.h2} >{`${event.event} | ${event.componentName} | ${event.componentType}`}</Text> ); } else if (event.buttonId) { return <Text style={styles.h2}>{`${event.event} | ${event.buttonId}`}</Text>; } else if (event.text) { return <Text style={styles.h2}>{`${event.text}`}</Text>; } else { return <Text style={styles.h2}>{`${event.event} | ${event.componentId}`}</Text>; } } render() { const events = this.state.events.map((event, idx) => ( <View key={`${event.componentId}${idx}`}>{this.renderEvent(event)}</View> )); return ( <View style={[styles.root, this.props.showOnTop && { top: 50, bottom: undefined }]}> <Text style={styles.h1}>{`Static Lifecycle Events Overlay`}</Text> <View style={styles.events}>{events}</View> {this.renderDismissButton()} {this.renderClearButton()} </View> ); } renderDismissButton = () => { return ( <TouchableOpacity style={styles.dismissBtn} onPress={() => Navigation.dismissOverlay(this.props.componentId)} > <Text testID={TestIDs.DISMISS_BTN} style={styles.btnText}> X </Text> </TouchableOpacity> ); }; renderClearButton = () => { return ( <TouchableOpacity style={styles.clearBtn} onPress={() => this.clearEvents()}> <Text testID={TestIDs.CLEAR_OVERLAY_EVENTS_BTN} style={styles.btnText}> Clear </Text> </TouchableOpacity> ); }; } type Style = { root: ViewStyle; dismissBtn: ViewStyle; clearBtn: ViewStyle; btnText: TextStyle; events: ViewStyle; h1: TextStyle; h2: TextStyle; }; const styles = StyleSheet.create<Style>({ root: { position: 'absolute', bottom: 0, left: 0, right: 0, height: 150, backgroundColor: '#c1d5e0ae', flexDirection: 'column', }, dismissBtn: { position: 'absolute', width: 35, height: 35, backgroundColor: 'white', justifyContent: 'center', }, clearBtn: { position: 'absolute', right: 0, width: 35, height: 35, backgroundColor: 'white', justifyContent: 'center', }, btnText: { color: 'red', alignSelf: 'center', }, events: { flexDirection: 'column', alignItems: 'center', marginHorizontal: 2, }, h1: { fontSize: 14, textAlign: 'center', margin: 4, }, h2: { fontSize: 10, }, }); ```
/content/code_sandbox/playground/src/screens/StaticLifecycleOverlay.tsx
xml
2016-03-11T11:22:54
2024-08-15T09:05:44
react-native-navigation
wix/react-native-navigation
13,021
1,397
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE language SYSTEM "language.dtd"> <language name="ANSI C89" section="Sources" version="5" kateversion="5.0" indenter="cstyle" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="2" author="Dominik Haumann (dhaumann@kde.org)" license="MIT"> <highlighting> <list name="keywords"> <item>break</item> <item>case</item> <item>continue</item> <item>default</item> <item>do</item> <item>else</item> <item>enum</item> <item>extern</item> <item>for</item> <item>goto</item> <item>if</item> <item>return</item> <item>sizeof</item> <item>struct</item> <item>switch</item> <item>typedef</item> <item>union</item> <item>while</item> </list> <list name="types"> <item>auto</item> <item>char</item> <item>const</item> <item>double</item> <item>float</item> <item>int</item> <item>long</item> <item>register</item> <item>short</item> <item>signed</item> <item>static</item> <item>unsigned</item> <item>void</item> <item>volatile</item> </list> <contexts> <context attribute="Normal Text" lineEndContext="#stay" name="Normal"> <DetectSpaces /> <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" /> <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" /> <keyword attribute="Keyword" context="#stay" String="keywords"/> <keyword attribute="Data Type" context="#stay" String="types"/> <DetectIdentifier /> <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" /> <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" /> <Float attribute="Float" context="Float Suffixes"/> <HlCOct attribute="Octal" context="#stay"/> <HlCHex attribute="Hex" context="#stay"/> <Int attribute="Decimal" context="Int Suffixes"/> <HlCChar attribute="Char" context="#stay"/> <DetectChar attribute="String" context="String" char="&quot;"/> <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="blockcomment"/> <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/> </context> <context name="Float Suffixes" attribute="Float" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <AnyChar String="fF" attribute="Float" context="#pop"/> </context> <context name="Int Suffixes" attribute="Decimal" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <StringDetect attribute="Decimal" context="#pop" String="ULL" insensitive="true"/> <StringDetect attribute="Decimal" context="#pop" String="LUL" insensitive="true"/> <StringDetect attribute="Decimal" context="#pop" String="LLU" insensitive="true"/> <StringDetect attribute="Decimal" context="#pop" String="UL" insensitive="true"/> <StringDetect attribute="Decimal" context="#pop" String="LU" insensitive="true"/> <StringDetect attribute="Decimal" context="#pop" String="LL" insensitive="true"/> <StringDetect attribute="Decimal" context="#pop" String="U" insensitive="true"/> <StringDetect attribute="Decimal" context="#pop" String="L" insensitive="true"/> </context> <context attribute="String" lineEndContext="#pop" name="String"> <LineContinue attribute="String" context="#stay"/> <HlCStringChar attribute="String Char" context="#stay"/> <DetectChar attribute="String" context="#pop" char="&quot;"/> </context> <context attribute="Comment" lineEndContext="#stay" name="comment"> <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="blockcomment"/> <IncludeRules context="##Alerts" /> </context> <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor"> <LineContinue attribute="Preprocessor" context="#stay"/> <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/> <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/> <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/> <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/> <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="blockcomment"/> </context> <context attribute="Preprocessor" lineEndContext="#pop" name="Define"> <LineContinue attribute="Preprocessor" context="#stay"/> </context> <context attribute="Comment" lineEndContext="#stay" name="Outscoped" > <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="Comment"/> <IncludeRules context="##Alerts" /> <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" /> <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" /> </context> <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern"> <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="Comment"/> <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" /> <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true" /> </context> </contexts> <itemDatas> <itemData name="Normal Text" defStyleNum="dsNormal"/> <itemData name="Keyword" defStyleNum="dsKeyword"/> <itemData name="Data Type" defStyleNum="dsDataType"/> <itemData name="Decimal" defStyleNum="dsDecVal"/> <itemData name="Octal" defStyleNum="dsBaseN"/> <itemData name="Hex" defStyleNum="dsBaseN"/> <itemData name="Float" defStyleNum="dsFloat"/> <itemData name="Char" defStyleNum="dsChar"/> <itemData name="String" defStyleNum="dsString"/> <itemData name="String Char" defStyleNum="dsSpecialChar"/> <itemData name="Comment" defStyleNum="dsComment"/> <itemData name="Symbol" defStyleNum="dsNormal"/> <itemData name="Preprocessor" defStyleNum="dsPreprocessor"/> <itemData name="Prep. Lib" defStyleNum="dsImport"/> </itemDatas> </highlighting> <general> <comments> <comment name="multiLine" start="/*" end="*/" /> </comments> <keywords casesensitive="1" /> </general> </language> ```
/content/code_sandbox/src/data/extra/syntax-highlighting/syntax/ansic89.xml
xml
2016-10-05T07:24:54
2024-08-16T05:03:40
vnote
vnotex/vnote
11,687
1,807
```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> <groupId>com.microsoft.bot.sample</groupId> <artifactId>echoSkillbot</artifactId> <version>sample</version> <packaging>jar</packaging> <name>${project.groupId}:${project.artifactId}</name> <description>This package contains a Java Echo Skill Bot sample using Spring Boot.</description> <url>path_to_url <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.0</version> <relativePath/> </parent> <licenses> <license> <url>path_to_url </license> </licenses> <developers> <developer> <name>Bot Framework Development</name> <email></email> <organization>Microsoft</organization> <organizationUrl>path_to_url </developer> </developers> <properties> <java.version>1.8</java.version> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> <start-class>com.microsoft.bot.sample.echoskillbot.Application</start-class> </properties> <repositories> <repository> <id>oss-sonatype</id> <name>oss-sonatype</name> <url> path_to_url </url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>2.4.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.17.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.17.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-to-slf4j</artifactId> <version>2.17.1</version> <scope>test</scope> </dependency> <dependency> <groupId>com.microsoft.bot</groupId> <artifactId>bot-integration-spring</artifactId> <version>4.14.1</version> <scope>compile</scope> </dependency> </dependencies> <profiles> <profile> <id>build</id> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <resources> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> </resource> </resources> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>3.2.3</version> <configuration> <warSourceDirectory>src/main/webapp</warSourceDirectory> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> <configuration> <mainClass>com.microsoft.bot.sample.echoskillbot.Application</mainClass> </configuration> </execution> </executions> </plugin> <plugin> <groupId>com.microsoft.azure</groupId> <artifactId>azure-webapp-maven-plugin</artifactId> <version>1.12.0</version> <configuration> <schemaVersion>V2</schemaVersion> <resourceGroup>${groupname}</resourceGroup> <appName>${botname}</appName> <appSettings> <property> <name>JAVA_OPTS</name> <value>-Dserver.port=80</value> </property> </appSettings> <runtime> <os>linux</os> <javaVersion>Java 8</javaVersion> <webContainer>Java SE</webContainer> </runtime> <deployment> <resources> <resource> <directory>${project.basedir}/target</directory> <includes> <include>*.jar</include> </includes> </resource> </resources> </deployment> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>publish</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>3.2.3</version> <configuration> <warSourceDirectory>src/main/webapp</warSourceDirectory> </configuration> </plugin> <plugin> <groupId>org.sonatype.plugins</groupId> <artifactId>nexus-staging-maven-plugin</artifactId> <version>1.6.8</version> <extensions>true</extensions> <configuration> <skipRemoteStaging>true</skipRemoteStaging> <serverId>ossrh</serverId> <nexusUrl>path_to_url <autoReleaseAfterClose>true</autoReleaseAfterClose> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <source>8</source> <failOnError>false</failOnError> </configuration> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project> ```
/content/code_sandbox/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/pom.xml
xml
2016-09-20T16:17:28
2024-08-16T02:44:00
BotBuilder-Samples
microsoft/BotBuilder-Samples
4,323
1,761
```xml export { default } from './Forbidden'; ```
/content/code_sandbox/packages/ui-components/src/components/Forbidden/index.ts
xml
2016-04-15T16:21:12
2024-08-16T09:38:01
verdaccio
verdaccio/verdaccio
16,189
9
```xml const textEncoder = new TextEncoder(); export async function computeHash(str: string): Promise<string> { const data = textEncoder.encode(str); const hashBuffer = await crypto.subtle.digest('SHA-256', data); const hashArray = Array.from(new Uint8Array(hashBuffer)); const hashHex = hashArray .map((b) => b.toString(16).padStart(2, '0')) .join(''); return hashHex; } ```
/content/code_sandbox/src/utils/compute-hash.ts
xml
2016-11-29T14:26:53
2024-08-15T11:05:30
graphql-voyager
graphql-kit/graphql-voyager
7,720
100
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="debug|Win32"> <Configuration>debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="checked|Win32"> <Configuration>checked</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="profile|Win32"> <Configuration>profile</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="release|Win32"> <Configuration>release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{85514BB1-43A6-1265-D4FB-DAFC843D2497}</ProjectGuid> <RootNamespace>SnippetContactModification</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <PlatformToolset>v120</PlatformToolset> </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 Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='checked|Win32'"> <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)'=='profile|Win32'"> <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> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> <OutDir>./../../../bin/vc12win32\</OutDir> <IntDir>./Win32/SnippetContactModification/debug\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)DEBUG</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;_DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/LIBPATH:../../../Lib/vc12win32 PhysX3CommonDEBUG_x86.lib PhysX3DEBUG_x86.lib PhysX3CookingDEBUG_x86.lib PhysX3CharacterKinematicDEBUG_x86.lib PhysX3ExtensionsDEBUG.lib PhysX3VehicleDEBUG.lib PxPvdSDKDEBUG_x86.lib PxTaskDEBUG_x86.lib PxFoundationDEBUG_x86.lib PsFastXmlDEBUG_x86.lib /LIBPATH:../../lib/vc12win32 SnippetUtilsDEBUG.lib /DEBUG</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)DEBUG.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc12win32;./../../lib/vc12win32;./../../../../PxShared/lib/vc12win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc12win32\PxFoundationDEBUG_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc12win32\PxPvdSDKDEBUG_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'"> <OutDir>./../../../bin/vc12win32\</OutDir> <IntDir>./Win32/SnippetContactModification/checked\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)CHECKED</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/LIBPATH:../../../Lib/vc12win32 PhysX3CommonCHECKED_x86.lib PhysX3CHECKED_x86.lib PhysX3CookingCHECKED_x86.lib PhysX3CharacterKinematicCHECKED_x86.lib PhysX3ExtensionsCHECKED.lib PhysX3VehicleCHECKED.lib PxPvdSDKCHECKED_x86.lib PxTaskCHECKED_x86.lib PxFoundationCHECKED_x86.lib PsFastXmlCHECKED_x86.lib /LIBPATH:../../lib/vc12win32 SnippetUtilsCHECKED.lib</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)CHECKED.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc12win32;./../../lib/vc12win32;./../../../../PxShared/lib/vc12win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc12win32\PxFoundationCHECKED_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc12win32\PxPvdSDKCHECKED_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'"> <OutDir>./../../../bin/vc12win32\</OutDir> <IntDir>./Win32/SnippetContactModification/profile\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)PROFILE</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_PROFILE=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc12win32 PhysX3CommonPROFILE_x86.lib PhysX3PROFILE_x86.lib PhysX3CookingPROFILE_x86.lib PhysX3CharacterKinematicPROFILE_x86.lib PhysX3ExtensionsPROFILE.lib PhysX3VehiclePROFILE.lib PxPvdSDKPROFILE_x86.lib PxTaskPROFILE_x86.lib PxFoundationPROFILE_x86.lib PsFastXmlPROFILE_x86.lib /LIBPATH:../../lib/vc12win32 SnippetUtilsPROFILE.lib /DEBUG</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName)PROFILE.exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc12win32;./../../lib/vc12win32;./../../../../PxShared/lib/vc12win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc12win32\PxFoundationPROFILE_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc12win32\PxPvdSDKPROFILE_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> <OutDir>./../../../bin/vc12win32\</OutDir> <IntDir>./Win32/SnippetContactModification/release\</IntDir> <TargetExt>.exe</TargetExt> <TargetName>$(ProjectName)</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_SUPPORT_PVD=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc12win32 PhysX3Common_x86.lib PhysX3_x86.lib PhysX3Cooking_x86.lib PhysX3CharacterKinematic_x86.lib PhysX3Extensions.lib PhysX3Vehicle.lib PxPvdSDK_x86.lib PxTask_x86.lib PxFoundation_x86.lib PsFastXml_x86.lib /LIBPATH:../../lib/vc12win32 SnippetUtils.lib</AdditionalOptions> <AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile> <AdditionalLibraryDirectories>./../../../Common/lib/vc12win32;./../../lib/vc12win32;./../../../../PxShared/lib/vc12win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX86</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> <PostBuildEvent> <Command>XCOPY "../../../../PxShared/bin\vc12win32\PxFoundation_x86.dll" "$(OutDir)" /D /Y&#x0D;&#x0A; XCOPY "../../../../PxShared/bin\vc12win32\PxPvdSDK_x86.dll" "$(OutDir)" /D /Y</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\SnippetCommon\ClassicMain.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\SnippetContactModification\SnippetContactModification.cpp"> </ClCompile> <ClCompile Include="..\..\SnippetContactModification\SnippetContactModificationRender.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ProjectReference Include="./SnippetUtils.vcxproj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <ItemGroup> <ProjectReference Include="./SnippetRender.vcxproj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"></ImportGroup> </Project> ```
/content/code_sandbox/PhysX_3.4/Snippets/compiler/vc12win32/SnippetContactModification.vcxproj
xml
2016-10-12T16:34:31
2024-08-16T09:40:38
PhysX-3.4
NVIDIAGameWorks/PhysX-3.4
2,343
4,813
```xml import Link from '@docusaurus/Link'; import classNames from 'classnames'; import React from 'react'; import { Button } from '../../components/Button'; import { CodeSection } from '../../components/CodeSection'; import { FormWrapper } from '../../components/FormWrapper'; import styles from '../../index.module.css'; import { themeContext } from '../../lib/universal'; import { ShippingForm } from '../CommonForms/ShippingForm'; type SystemWindowProps = JSX.IntrinsicElements['div']; function SystemWindow({ children, className, ...props }: SystemWindowProps) { return ( <div {...props} className={classNames( styles['system-window'], styles['blue-accent'], styles['preview-border'], className, )} > <div className={styles['system-top-bar']}> <span className={styles['system-top-bar-circle']} style={{ backgroundColor: 'var(--periwinkle)' }} /> <span className={styles['system-top-bar-circle']} style={{ backgroundColor: 'var(--bright-cyan)' }} /> <span className={styles['system-top-bar-circle']} style={{ backgroundColor: 'var(--sea-green)' }} /> </div> {children} </div> ); } function Showcase() { return ( <div className={classNames(styles['floating-example'])}> <SystemWindow> <CodeSection language="tsx" section="schema" source={require('!!raw-loader!../CommonForms/ShippingSchema')} /> </SystemWindow> <SystemWindow> <themeContext.Provider value="semantic"> <FormWrapper> <ShippingForm /> </FormWrapper> </themeContext.Provider> </SystemWindow> </div> ); } const themes = [ { alt: 'Semantic UI', src: 'themes/semantic.svg', to: 'path_to_url }, { alt: 'Ant Design', src: 'themes/antd.png', to: 'path_to_url }, { alt: 'MUI', src: 'themes/mui.png', to: 'path_to_url }, { alt: 'Bootstrap', src: 'themes/bootstrap.svg', to: 'path_to_url }, ]; export function Header() { return ( <div className="hero hero--primary"> <div className="container"> <div className="row"> <div className="col"> <span className={classNames( styles.text, styles['text-big'], styles.title, )} > uniforms </span> <h1 className={classNames( styles.description, styles.text, styles['text-huge'], )} > A React library for building forms from any schema </h1> <ul className={classNames(styles.text, styles.bullets)}> <li>support of all schemas and themes</li> <li>instant prototyping</li> <li>simplifies separation of concerns</li> </ul> <div className={styles['center-if-sm']}> <p className={classNames(styles.text, styles.supported)}> Supported design libraries: </p> {themes.map(({ alt, src, to }) => ( <Link className={styles['theme-icon']} key={alt} to={to}> <img alt={alt} src={`assets/${src}`} /> </Link> ))} </div> <div className={styles['center-if-sm']}> <Button to="/docs/tutorials-basic-uniforms-usage"> Get Started </Button> </div> </div> <div className="col"> <Showcase /> </div> </div> </div> </div> ); } ```
/content/code_sandbox/website/pages-parts/LandingPage/Header.tsx
xml
2016-05-10T13:08:50
2024-08-13T11:27:18
uniforms
vazco/uniforms
1,934
827
```xml import { IUserDocument } from '@erxes/api-utils/src/types'; import { Model } from 'mongoose'; import { ASSET_KB_ARTICLE_HISTORY_ACTIONS } from '../common/constant/asset'; import { IAssetDocument, IKBArticleHistoryDocument } from '../common/types/asset'; import { IModels } from '../connectionResolver'; import { assetKbArticlesHistoriesSchema } from './definitions/assets'; type KbArticleHistoryAction = | typeof ASSET_KB_ARTICLE_HISTORY_ACTIONS.ADDED | typeof ASSET_KB_ARTICLE_HISTORY_ACTIONS.REMOVED; type SuccessMessage = { status: 'success' }; type AddAssetsKbArticleHistories = { assetIds: string[]; kbArticleIds: string[]; user: IUserDocument; action: string; }; type AddKbArticleHistories = { asset: IAssetDocument; kbArticleIds: string[]; user: IUserDocument; action: KbArticleHistoryAction; }; export interface IAssetKbArticlHistoriesModel extends Model<IKBArticleHistoryDocument> { addAssetsKbArticleHistories( props: AddAssetsKbArticleHistories ): Promise<SuccessMessage>; addKbArticleHistories(props: AddKbArticleHistories): Promise<SuccessMessage>; } export const loadKBArticlHistoriesClass = ( models: IModels, _subdomain: string ) => { // The _subdomain parameter is unused but required for function signature compatibility. class KBArticlHistories { public static async addAssetsKbArticleHistories({ assetIds, action, kbArticleIds, user }: AddAssetsKbArticleHistories): Promise<SuccessMessage> { const assets = await models.Assets.find({ _id: { $in: assetIds } }); const historyAction = action === 'add' ? ASSET_KB_ARTICLE_HISTORY_ACTIONS.ADDED : ASSET_KB_ARTICLE_HISTORY_ACTIONS.REMOVED; await Promise.all( assets.map(async (asset) => { await models.AssetsKbArticlesHistories.addKbArticleHistories({ asset, kbArticleIds, user, action: historyAction }); }) ); return { status: 'success' }; } public static async addKbArticleHistories({ asset, kbArticleIds, user, action }: AddKbArticleHistories): Promise<SuccessMessage> { const commonDoc = { userId: user._id, assetId: asset._id, action }; let removedArticleIds: string[] = []; if (action === 'added') { kbArticleIds = kbArticleIds.filter( (kbArticleId) => !(asset?.kbArticleIds || []).includes(kbArticleId) ); removedArticleIds = (asset?.kbArticleIds || []).filter( (kbArticleId) => !kbArticleIds.includes(kbArticleId) ); } const docs = [ ...kbArticleIds.map((kbArticleId) => ({ ...commonDoc, kbArticleId })), ...removedArticleIds.map((kbArticleId) => ({ ...commonDoc, kbArticleId, action: ASSET_KB_ARTICLE_HISTORY_ACTIONS.REMOVED })) ]; await models.AssetsKbArticlesHistories.insertMany(docs); return { status: 'success' }; } } assetKbArticlesHistoriesSchema.loadClass(KBArticlHistories); return assetKbArticlesHistoriesSchema; }; ```
/content/code_sandbox/packages/plugin-assets-api/src/models/KBArticleHistories.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
776
```xml <?xml version="1.0" encoding="utf-8" standalone="yes"?> <settings> <category label="40000"> <setting type="lsep" /> <setting id="Port" type="number" label="40040" default="21" /> <setting id="MaxClients" type="number" label="40050" default="10" /> <setting id="MaxClientsPerHost" type="number" label="40060" default="5" /> <setting id="MaxHostsPerUser" type="number" label="40070" default="5" /> <setting id="MaxInstances" type="number" label="40080" default="30" /> <setting id="Umask" type="number" label="40090" default="022" /> <setting id="ServerName" type="text" label="40100" default="ProFTPD on LibreELEC"/> <setting id="ServerIdent" type="bool" label="40110" default="true" /> <setting id="ServerIdentText" type="text" label="40120" default="LibreELEC" visible="eq(-1,true)" /> <setting id="AllowOverwrite" type="bool" label="40030" default="true" /> <setting id="AllowStoreRestart" type="bool" label="40180" default="true" /> <setting id="AllowRetrieveRestart" type="bool" label="40190" default="true" /> <setting id="RootLogin" type="bool" label="40200" default="true" /> <setting id="Debuglevel" type="labelenum" label="40210" default="0" values="0|1|2|3|4|5|6|7|8|9|10" /> </category> <category label="60000"> <setting type="lsep" /> <setting id="TLSEngine" type="bool" label="60010" default="true" /> <setting id="TLSRequired" type="bool" label="60020" default="false" visible="eq(-1,true)" /> <setting id="CertTTL" type="number" label="60030" default="36500" /> <setting id="CertHash" type="enum" label="60040" default="sha1" values="sha1" /> <setting id="CertCrypto" type="enum" label="60050" default="x509" values="rsa|x509" /> <setting id="CertBitStrength" type="number" label="60060" default="2048" /> </category> <category label="70000"> <setting type="lsep" /> <setting id="AllowForeignAddress" type="bool" label="70010" default="true" /> <setting id="PassivePorts" type="number" label="70020" default="45000" /> <setting id="PassivePorts2" type="number" label="70030" default="45100" /> <setting id="MasqueradeAddress" type="bool" label="70040" default="true" /> <setting id="MasqueradeAddress2" type="text" label="70050" default="127.0.0.1" visible="eq(-1,true)" /> </category> <category label="50000"> <setting type="lsep" /> <setting id="CryptoHash" type="enum" label="50010" default="sha-512" values="sha-512|sha-256|md5" /> <setting type="lsep" /> <setting id="Username1" type="text" label="50020" default="" /> <setting id="Userpass1" type="text" label="50030" default="" enable="!eq(-1,)" /> <setting id="Userpath1" type="folder" label="50040" default="/storage" enable="!eq(-1,)" option="writeable" /> <setting type="lsep" /> <setting id="Username2" type="text" label="50050" default="" visible="!eq(-3,)" /> <setting id="Userpass2" type="text" label="50060" default="" visible="!eq(-4,)" enable="!eq(-1,)" /> <setting id="Userpath2" type="folder" label="50070" default="/storage" visible="!eq(-5,)" enable="!eq(-1,)" option="writeable" /> <setting type="lsep" /> <setting id="Username3" type="text" label="50080" default="" visible="!eq(-3,)" /> <setting id="Userpass3" type="text" label="50090" default="" visible="!eq(-4,)" enable="!eq(-1,)" /> <setting id="Userpath3" type="folder" label="50100" default="/storage" visible="!eq(-5,)" enable="!eq(-1,)" option="writeable" /> <setting type="lsep" /> <setting id="Username4" type="text" label="50110" default="" visible="!eq(-3,)" /> <setting id="Userpass4" type="text" label="50120" default="" visible="!eq(-4,)" enable="!eq(-1,)" /> <setting id="Userpath4" type="folder" label="50130" default="/storage" visible="!eq(-5,)" enable="!eq(-1,)" option="writeable" /> <setting type="lsep" /> <setting id="Username5" type="text" label="50140" default="" visible="!eq(-3,)" /> <setting id="Userpass5" type="text" label="50150" default="" visible="!eq(-4,)" enable="!eq(-1,)" /> <setting id="Userpath5" type="folder" label="50160" default="/storage" visible="!eq(-5,)" enable="!eq(-1,)" option="writeable" /> </category> </settings> ```
/content/code_sandbox/packages/addons/service/proftpd/source/resources/settings.xml
xml
2016-03-13T01:46:18
2024-08-16T11:58:29
LibreELEC.tv
LibreELEC/LibreELEC.tv
2,216
1,439
```xml import React from "react"; import { Divider, Radio } from "antd"; import { ResourceTypeFilterValue } from "./types"; import "./resourceTypeFilter.scss"; interface Props { value?: ResourceTypeFilterValue; onChange: (value: ResourceTypeFilterValue) => void; } const ResourceTypeFilter: React.FC<Props> = ({ value, onChange }) => { return ( <Radio.Group size="small" className="resource-type-filter" value={value} onChange={(e) => onChange(e.target.value)}> <Radio.Button value={ResourceTypeFilterValue.ALL}>All</Radio.Button> <Divider type="vertical" className="divider" /> <Radio.Button value={ResourceTypeFilterValue.AJAX}>Fetch/XHR</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.JS}>JS</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.CSS}>CSS</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.IMG}>Img</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.MEDIA}>Media</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.FONT}>Font</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.DOC}>Doc</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.WS}>WS</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.WASM}>Wasm</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.MANIFEST}>Manifest</Radio.Button> <Radio.Button value={ResourceTypeFilterValue.OTHER}>Other</Radio.Button> </Radio.Group> ); }; export default ResourceTypeFilter; ```
/content/code_sandbox/browser-extension/common/src/devtools/components/ResourceTypeFilter/ResourceTypeFilter.tsx
xml
2016-12-01T04:36:06
2024-08-16T19:12:19
requestly
requestly/requestly
2,121
347
```xml import { ReactNode } from 'react'; import { Option } from '@@/form-components/Input/Select'; import { Annotation, AnnotationErrors } from '../../annotations/types'; export interface Path { Key: string; Route: string; ServiceName: string; ServicePort: number; PathType?: string; } export interface Host { Key: string; Host: string; Secret: string; Paths: Path[]; NoHost?: boolean; } export interface Rule { Key: string; IngressName: string; Namespace: string; IngressClassName: string; Hosts: Host[]; Annotations?: Annotation[]; IngressType?: string; Labels?: Record<string, string>; } export interface ServicePorts { [serviceName: string]: Option<string>[]; } interface ServiceOption extends Option<string> { selectedLabel: string; } export type GroupedServiceOptions = { label: string; options: ServiceOption[]; }[]; export type IngressErrors = Record<string, ReactNode> & { annotations?: AnnotationErrors; }; ```
/content/code_sandbox/app/react/kubernetes/ingresses/CreateIngressView/types.ts
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
228
```xml import { test, liquid } from '../../stub/render' describe('filters/math', function () { describe('abs', function () { it('should return 3 for -3', () => test('{{ -3 | abs }}', '3')) it('should return 2 for arr[0]', () => test('{{ arr[0] | abs }}', { arr: [-2, 'a'] }, '2')) it('should return convert string', () => test('{{ "-3" | abs }}', '3')) }) describe('at_least', function () { it('{{4 | at_least: 5}} == 5', () => test('{{ 4 | at_least: 5 }}', '5')) it('{{4 | at_least: 3}} == 4', () => test('{{ 4 | at_least: 3 }}', '4')) }) describe('at_most', function () { it('{{4 | at_most: 5}} == 4', () => test('{{ 4 | at_most: 5 }}', '4')) it('{{4 | at_most: 3}} == 3', () => test('{{ 4 | at_most: 3 }}', '3')) }) describe('ceil', function () { it('should return "2" for 1.2', () => test('{{ 1.2 | ceil }}', '2')) it('should return "2" for 2.0', () => test('{{ 2.0 | ceil }}', '2')) it('should return "4" for 3.5', () => test('{{ "3.5" | ceil }}', '4')) it('should return "184" for 183.357', () => test('{{ 183.357 | ceil }}', '184')) }) describe('divided_by', function () { it('should return 2 for 4,2', () => test('{{4 | divided_by: 2}}', '2')) it('should return 4 for 16,4', () => test('{{16 | divided_by: 4}}', '4')) it('should return 1 for 5,3', () => test('{{5 | divided_by: 3}}', (5 / 3).toString())) it('should support integer arithmetic', () => test('{{5 | divided_by: 3, true}}', '1')) it('should floor the result in integer arithmetic', () => test('{{ -5 | divided_by: 3, true}}', '-2')) it('should convert string to number', () => test('{{"6" | divided_by: "3"}}', '2')) }) describe('floor', function () { it('should return "1" for 1.2', () => test('{{ 1.2 | floor }}', '1')) it('should return "2" for 2.0', () => test('{{ 2.0 | floor }}', '2')) it('should return "183" for 183.357', () => test('{{ 183.357 | floor }}', '183')) it('should return "3" for 3.5', () => test('{{ "3.5" | floor }}', '3')) }) describe('minus', function () { it('should return "2" for 4,2', () => test('{{ 4 | minus: 2 }}', '2')) it('should return "12" for 16,4', () => test('{{ 16 | minus: 4 }}', '12')) it('should return "171.357" for 183.357,12', () => test('{{ 183.357 | minus: 12 }}', '171.357')) it('should convert first arg as number', () => test('{{ "4" | minus: 1 }}', '3')) it('should convert both args as number', () => test('{{ "4" | minus: "1" }}', '3')) }) describe('modulo', function () { it('should return "1" for 3,2', () => test('{{ 3 | modulo: 2 }}', '1')) it('should return "3" for 24,7', () => test('{{ 24 | modulo: 7 }}', '3')) it('should return "3.357" for 183.357,12', async () => { const html = await liquid.parseAndRender('{{ 183.357 | modulo: 12 }}') expect(Number(html)).toBeCloseTo(3.357, 3) }) it('should convert string', () => test('{{ "24" | modulo: "7" }}', '3')) }) describe('plus', function () { it('should return "6" for 4,2', () => test('{{ 4 | plus: 2 }}', '6')) it('should return "20" for 16,4', () => test('{{ 16 | plus: 4 }}', '20')) it('should return "195.357" for 183.357,12', () => test('{{ 183.357 | plus: 12 }}', '195.357')) it('should convert first arg as number', () => test('{{ "4" | plus: 2 }}', '6')) it('should convert both args as number', () => test('{{ "4" | plus: "2" }}', '6')) it('should support variable', () => test('{{ 4 | plus: b }}', { b: 2 }, '6')) }) describe('round', function () { it('should return "1" for 1.2', () => test('{{1.2|round}}', '1')) it('should return "3" for 2.7', () => test('{{2.7|round}}', '3')) it('should return "183.36" for 183.357,2', () => test('{{183.357|round: 2}}', '183.36')) it('should convert string to number', () => test('{{"2.7"|round}}', '3')) }) describe('times', function () { it('should return "6" for 3,2', () => test('{{ 3 | times: 2 }}', '6')) it('should return "168" for 24,7', () => test('{{ 24 | times: 7 }}', '168')) it('should return "2200.284" for 183.357,12', () => test('{{ 183.357 | times: 12 }}', '2200.284')) it('should convert string to number', () => test('{{ "24" | times: "7" }}', '168')) }) }) ```
/content/code_sandbox/test/integration/filters/math.spec.ts
xml
2016-06-13T07:39:30
2024-08-16T16:56:50
liquidjs
harttle/liquidjs
1,485
1,483
```xml import { map, Observable, firstValueFrom } from "rxjs"; import { Jsonify } from "type-fest"; import { ORGANIZATIONS_DISK, StateProvider, UserKeyDefinition } from "../../../platform/state"; import { UserId } from "../../../types/guid"; import { InternalOrganizationServiceAbstraction } from "../../abstractions/organization/organization.service.abstraction"; import { OrganizationData } from "../../models/data/organization.data"; import { Organization } from "../../models/domain/organization"; /** * The `KeyDefinition` for accessing organization lists in application state. * @todo Ideally this wouldn't require a `fromJSON()` call, but `OrganizationData` * has some properties that contain functions. This should probably get * cleaned up. */ export const ORGANIZATIONS = UserKeyDefinition.record<OrganizationData>( ORGANIZATIONS_DISK, "organizations", { deserializer: (obj: Jsonify<OrganizationData>) => OrganizationData.fromJSON(obj), clearOn: ["logout"], }, ); /** * Filter out organizations from an observable that __do not__ offer a * families-for-enterprise sponsorship to members. * @returns a function that can be used in `Observable<Organization[]>` pipes, * like `organizationService.organizations$` */ function mapToExcludeOrganizationsWithoutFamilySponsorshipSupport() { return map<Organization[], Organization[]>((orgs) => orgs.filter((o) => o.canManageSponsorships)); } /** * Filter out organizations from an observable that the organization user * __is not__ a direct member of. This will exclude organizations only * accessible as a provider. * @returns a function that can be used in `Observable<Organization[]>` pipes, * like `organizationService.organizations$` */ function mapToExcludeProviderOrganizations() { return map<Organization[], Organization[]>((orgs) => orgs.filter((o) => o.isMember)); } /** * Map an observable stream of organizations down to a boolean indicating * if any organizations exist (`orgs.length > 0`). * @returns a function that can be used in `Observable<Organization[]>` pipes, * like `organizationService.organizations$` */ function mapToBooleanHasAnyOrganizations() { return map<Organization[], boolean>((orgs) => orgs.length > 0); } /** * Map an observable stream of organizations down to a single organization. * @param `organizationId` The ID of the organization you'd like to subscribe to * @returns a function that can be used in `Observable<Organization[]>` pipes, * like `organizationService.organizations$` */ function mapToSingleOrganization(organizationId: string) { return map<Organization[], Organization>((orgs) => orgs?.find((o) => o.id === organizationId)); } export class OrganizationService implements InternalOrganizationServiceAbstraction { organizations$: Observable<Organization[]> = this.getOrganizationsFromState$(); memberOrganizations$: Observable<Organization[]> = this.organizations$.pipe( mapToExcludeProviderOrganizations(), ); constructor(private stateProvider: StateProvider) {} get$(id: string): Observable<Organization | undefined> { return this.organizations$.pipe(mapToSingleOrganization(id)); } getAll$(userId?: UserId): Observable<Organization[]> { return this.getOrganizationsFromState$(userId); } async getAll(userId?: string): Promise<Organization[]> { return await firstValueFrom(this.getOrganizationsFromState$(userId as UserId)); } canManageSponsorships$ = this.organizations$.pipe( mapToExcludeOrganizationsWithoutFamilySponsorshipSupport(), mapToBooleanHasAnyOrganizations(), ); async hasOrganizations(): Promise<boolean> { return await firstValueFrom(this.organizations$.pipe(mapToBooleanHasAnyOrganizations())); } async upsert(organization: OrganizationData, userId?: UserId): Promise<void> { await this.stateFor(userId).update((existingOrganizations) => { const organizations = existingOrganizations ?? {}; organizations[organization.id] = organization; return organizations; }); } async get(id: string): Promise<Organization> { return await firstValueFrom(this.organizations$.pipe(mapToSingleOrganization(id))); } /** * @deprecated For the CLI only * @param id id of the organization */ async getFromState(id: string): Promise<Organization> { return await firstValueFrom(this.organizations$.pipe(mapToSingleOrganization(id))); } async replace(organizations: { [id: string]: OrganizationData }, userId?: UserId): Promise<void> { await this.stateFor(userId).update(() => organizations); } // Ideally this method would be renamed to organizations$() and the // $organizations observable as it stands would be removed. This will // require updates to callers, and so this method exists as a temporary // workaround until we have time & a plan to update callers. // // It can be thought of as "organizations$ but with a userId option". private getOrganizationsFromState$(userId?: UserId): Observable<Organization[] | undefined> { return this.stateFor(userId).state$.pipe(this.mapOrganizationRecordToArray()); } /** * Accepts a record of `OrganizationData`, which is how we store the * organization list as a JSON object on disk, to an array of * `Organization`, which is how the data is published to callers of the * service. * @returns a function that can be used to pipe organization data from * stored state to an exposed object easily consumable by others. */ private mapOrganizationRecordToArray() { return map<Record<string, OrganizationData>, Organization[]>((orgs) => Object.values(orgs ?? {})?.map((o) => new Organization(o)), ); } /** * Fetches the organization list from on disk state for the specified user. * @param userId the user ID to fetch the organization list for. Defaults to * the currently active user. * @returns an observable of organization state as it is stored on disk. */ private stateFor(userId?: UserId) { return userId ? this.stateProvider.getUser(userId, ORGANIZATIONS) : this.stateProvider.getActive(ORGANIZATIONS); } } ```
/content/code_sandbox/libs/common/src/admin-console/services/organization/organization.service.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
1,343
```xml import { createContext, useContext } from "react" import RootStore from "../stores/RootStore.js" export const StoreContext = createContext<RootStore>( null as unknown as RootStore, // never use default value ) export const useStores = () => useContext(StoreContext) ```
/content/code_sandbox/packages/community/src/hooks/useStores.ts
xml
2016-03-06T15:19:53
2024-08-15T14:27:10
signal
ryohey/signal
1,238
59
```xml <vector xmlns:android="path_to_url" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:pathData="M14.763,9.177C15.446,8.493 16.554,8.493 17.237,9.177L22.03,13.97C22.323,14.262 22.323,14.737 22.03,15.03C21.737,15.323 21.263,15.323 20.97,15.03L16.177,10.237C16.079,10.14 15.921,10.14 15.823,10.237L6.03,20.03C5.737,20.323 5.263,20.323 4.97,20.03C4.677,19.737 4.677,19.263 4.97,18.97L14.763,9.177Z" android:fillColor="#ffffff" android:fillAlpha="0.87" android:fillType="evenOdd"/> <path android:pathData="M16,5L19,2M19,2L22,5M19,2V8" android:strokeAlpha="0.87" android:strokeLineJoin="round" android:strokeWidth="1.5" android:fillColor="#00000000" android:strokeColor="#ffffff" android:strokeLineCap="round"/> <path android:pathData="M9,6.75C8.31,6.75 7.75,7.31 7.75,8C7.75,8.69 8.31,9.25 9,9.25C9.69,9.25 10.25,8.69 10.25,8C10.25,7.31 9.69,6.75 9,6.75ZM6.25,8C6.25,6.481 7.481,5.25 9,5.25C10.519,5.25 11.75,6.481 11.75,8C11.75,9.519 10.519,10.75 9,10.75C7.481,10.75 6.25,9.519 6.25,8Z" android:fillColor="#ffffff" android:fillAlpha="0.87" android:fillType="evenOdd"/> <path android:pathData="M12,2.75C6.891,2.75 2.75,6.891 2.75,12C2.75,17.109 6.891,21.25 12,21.25C16.262,21.25 19.852,18.367 20.924,14.443C21.033,14.044 21.446,13.809 21.845,13.918C22.245,14.027 22.48,14.439 22.371,14.839C21.126,19.398 16.955,22.75 12,22.75C6.063,22.75 1.25,17.937 1.25,12C1.25,6.063 6.063,1.25 12,1.25C12.583,1.25 13.156,1.296 13.715,1.386C14.124,1.452 14.402,1.836 14.337,2.245C14.271,2.654 13.886,2.933 13.477,2.867C12.997,2.79 12.503,2.75 12,2.75Z" android:fillColor="#ffffff" android:fillAlpha="0.87" android:fillType="evenOdd"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable-night/ic_cu_status.xml
xml
2016-05-04T11:46:20
2024-08-15T16:29:10
android
meganz/android
1,537
899
```xml <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="uk_UA"> <context> <name>AddressBookDialog</name> <message> <location filename="../address_book_dialog.ui" line="17"/> <source>Address Book Properties</source> <translation> </translation> </message> <message> <location filename="../address_book_dialog.ui" line="27"/> <source>General</source> <translation></translation> </message> <message> <location filename="../address_book_dialog.ui" line="37"/> <source>Name:</source> <translation>&apos;:</translation> </message> <message> <location filename="../address_book_dialog.ui" line="44"/> <source>File:</source> <translation>:</translation> </message> <message> <location filename="../address_book_dialog.ui" line="51"/> <source>Encryption:</source> <translation>:</translation> </message> <message> <location filename="../address_book_dialog.ui" line="58"/> <location filename="../address_book_dialog.ui" line="175"/> <source>Password:</source> <translation>:</translation> </message> <message> <location filename="../address_book_dialog.ui" line="65"/> <source>Password (repeat):</source> <translation> ():</translation> </message> <message> <location filename="../address_book_dialog.ui" line="119"/> <source>Comment:</source> <translation>:</translation> </message> <message> <location filename="../address_book_dialog.ui" line="132"/> <source>Router</source> <translation></translation> </message> <message> <location filename="../address_book_dialog.ui" line="138"/> <source>Use a router</source> <translation> </translation> </message> <message> <location filename="../address_book_dialog.ui" line="147"/> <source>Address:</source> <translation>:</translation> </message> <message> <location filename="../address_book_dialog.ui" line="161"/> <source>User Name:</source> <translation>&apos; :</translation> </message> <message> <location filename="../address_book_dialog.ui" line="225"/> <source>A router is required to connect to a computer if there is no direct connection (bypass NAT). Aspia does not provide a public router, but you can install your own. You can download the router on the &lt;a href=&quot;path_to_url website&lt;/a&gt;.</source> <translation> &apos; ( NAT). Aspia , . &lt;a href=&quot;path_to_url -&lt;/a&gt;.</translation> </message> <message> <location filename="../address_book_dialog.ui" line="242"/> <source>Default Configuration</source> <translation> </translation> </message> <message> <location filename="../address_book_dialog.ui" line="300"/> <source>Other</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_dialog.ui" line="308"/> <source>Display name when connected:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_dialog.ui" line="318"/> <source>Enter a name or leave the field empty</source> <translation type="unfinished"></translation> </message> </context> <context> <name>AddressBookTab</name> <message> <location filename="../address_book_tab.ui" line="98"/> <source>Computer Name</source> <translation>&apos; &apos;</translation> </message> <message> <location filename="../address_book_tab.ui" line="103"/> <source>Address / ID</source> <translation> / ID</translation> </message> <message> <location filename="../address_book_tab.ui" line="108"/> <source>Comment</source> <translation></translation> </message> <message> <location filename="../address_book_tab.ui" line="113"/> <source>Created</source> <translation></translation> </message> <message> <location filename="../address_book_tab.ui" line="118"/> <source>Modified</source> <translation></translation> </message> <message> <location filename="../address_book_tab.ui" line="123"/> <source>Status</source> <translation type="unfinished"></translation> </message> </context> <context> <name>ComputerDialog</name> <message> <location filename="../computer_dialog.ui" line="17"/> <source>Computer Properties</source> <translation> &apos;</translation> </message> </context> <context> <name>ComputerDialogDesktop</name> <message> <location filename="../computer_dialog_desktop.ui" line="55"/> <source>Codec</source> <translation></translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="214"/> <source>Disable font smoothing</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="250"/> <source>Block remote input</source> <translation> </translation> </message> <message> <source>Enable cursor shape</source> <translation type="vanished"> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="66"/> <source>Color depth:</source> <translation> :</translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="87"/> <source>Fast</source> <translation></translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="113"/> <source>Best</source> <translation></translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="131"/> <source>Features</source> <translation></translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="137"/> <source>Enable audio</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="144"/> <source>Enable clipboard</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="151"/> <source>Show shape of remote cursor</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="158"/> <source>Show position of remote cursor</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="194"/> <source>Appearance</source> <translation></translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="200"/> <source>Disable desktop effects</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="207"/> <source>Disable desktop wallpaper</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="182"/> <location filename="../computer_dialog_desktop.ui" line="230"/> <source>Other</source> <translation></translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="36"/> <source>General</source> <translation></translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="42"/> <source>Inherit configuration from parent</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="236"/> <source>Clear clipboard at disconnect</source> <translation> &apos;</translation> </message> <message> <location filename="../computer_dialog_desktop.ui" line="243"/> <source>Lock computer at disconnect</source> <translation> &apos; &apos;</translation> </message> </context> <context> <name>ComputerDialogGeneral</name> <message> <location filename="../computer_dialog_general.ui" line="34"/> <source>Name:</source> <translation>&apos;:</translation> </message> <message> <location filename="../computer_dialog_general.ui" line="48"/> <source>Parent Group:</source> <translation> :</translation> </message> <message> <location filename="../computer_dialog_general.ui" line="65"/> <source>Address / ID:</source> <translation> / ID:</translation> </message> <message> <location filename="../computer_dialog_general.ui" line="81"/> <source>Inherit from parent</source> <translation> </translation> </message> <message> <location filename="../computer_dialog_general.ui" line="93"/> <source>User Name:</source> <translation>&apos; :</translation> </message> <message> <location filename="../computer_dialog_general.ui" line="107"/> <source>Password:</source> <translation>:</translation> </message> <message> <location filename="../computer_dialog_general.ui" line="153"/> <source>Comment:</source> <translation>:</translation> </message> </context> <context> <name>ComputerDialogParent</name> <message> <location filename="../computer_dialog_parent.ui" line="20"/> <source>Select child item</source> <translation> </translation> </message> </context> <context> <name>ComputerGroupDialog</name> <message> <location filename="../computer_group_dialog.ui" line="17"/> <source>Computer Group Properties</source> <translation> &apos;</translation> </message> <message> <location filename="../computer_group_dialog.ui" line="27"/> <source>General</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog.ui" line="37"/> <source>Name:</source> <translation>&apos;:</translation> </message> <message> <location filename="../computer_group_dialog.ui" line="44"/> <source>Parent Group:</source> <translation> :</translation> </message> <message> <location filename="../computer_group_dialog.ui" line="78"/> <source>Comment:</source> <translation>:</translation> </message> <message> <location filename="../computer_group_dialog.ui" line="91"/> <source>Default Configuration</source> <translation> </translation> </message> </context> <context> <name>ComputerGroupDialogDesktop</name> <message> <location filename="../computer_group_dialog_desktop.ui" line="55"/> <source>Codec</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="66"/> <source>Color depth:</source> <translation> :</translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="87"/> <source>Fast</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="113"/> <source>Best</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="131"/> <source>Features</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="137"/> <source>Enable audio</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="144"/> <source>Enable clipboard</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="151"/> <source>Show shape of remote cursor</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="158"/> <source>Show position of remote cursor</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="194"/> <source>Appearance</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="200"/> <source>Disable desktop effects</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="207"/> <source>Disable desktop wallpaper</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="214"/> <source>Disable font smoothing</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="182"/> <location filename="../computer_group_dialog_desktop.ui" line="230"/> <source>Other</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="36"/> <source>General</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="42"/> <source>Inherit configuration from parent</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="236"/> <source>Clear clipboard at disconnect</source> <translation> &apos;</translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="243"/> <source>Lock computer at disconnect</source> <translation> &apos; &apos;</translation> </message> <message> <location filename="../computer_group_dialog_desktop.ui" line="250"/> <source>Block remote input</source> <translation> </translation> </message> </context> <context> <name>ComputerGroupDialogGeneral</name> <message> <source>Name:</source> <translation type="obsolete">&apos;:</translation> </message> <message> <source>Parent Group:</source> <translation type="obsolete"> :</translation> </message> <message> <source>Address / ID:</source> <translation type="obsolete"> / ID:</translation> </message> <message> <location filename="../computer_group_dialog_general.ui" line="20"/> <source>Inherit from parent</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_general.ui" line="32"/> <source>User Name:</source> <translation>&apos; :</translation> </message> <message> <location filename="../computer_group_dialog_general.ui" line="46"/> <source>Password:</source> <translation>:</translation> </message> <message> <source>Comment:</source> <translation type="obsolete">:</translation> </message> </context> <context> <name>ComputerGroupDialogParent</name> <message> <location filename="../computer_group_dialog_parent.ui" line="20"/> <source>Select child item</source> <translation> </translation> </message> </context> <context> <name>ComputerGroupItem</name> <message> <location filename="../computer_group_item.cc" line="141"/> <source>Root Group</source> <translation> </translation> </message> </context> <context> <name>Console</name> <message> <location filename="../main.cc" line="70"/> <source>Aspia Console</source> <translation> Aspia</translation> </message> <message> <location filename="../main.cc" line="73"/> <source>file</source> <translation></translation> </message> <message> <location filename="../main.cc" line="74"/> <source>The file to open.</source> <translation> .</translation> </message> </context> <context> <name>ConsoleMainWindow</name> <message> <location filename="../main_window.ui" line="14"/> <source>Aspia Console</source> <translation> Aspia</translation> </message> <message> <location filename="../main_window.ui" line="62"/> <source>&amp;File</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="66"/> <source>Recent open</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="85"/> <source>&amp;Edit</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="103"/> <source>&amp;Session Type</source> <translation>&amp; </translation> </message> <message> <location filename="../main_window.ui" line="113"/> <source>&amp;Help</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="124"/> <source>&amp;View</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="128"/> <source>&amp;Language</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="148"/> <source>Tools</source> <translation></translation> </message> <message> <location filename="../main_window.ui" line="163"/> <location filename="../main_window.ui" line="463"/> <source>Tool Bar</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="211"/> <source>&amp;New address book</source> <translation>&amp; </translation> </message> <message> <location filename="../main_window.ui" line="214"/> <source>Ctrl+N</source> <translation>Ctrl+N</translation> </message> <message> <location filename="../main_window.ui" line="223"/> <source>&amp;Open address book...</source> <translation>&amp; ...</translation> </message> <message> <location filename="../main_window.ui" line="226"/> <source>Ctrl+O</source> <translation>Ctrl+O</translation> </message> <message> <location filename="../main_window.ui" line="238"/> <source>&amp;Save</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="241"/> <source>Ctrl+S</source> <translation>Ctrl+S</translation> </message> <message> <location filename="../main_window.ui" line="249"/> <source>Save &amp;as...</source> <translation> &amp;...</translation> </message> <message> <location filename="../main_window.ui" line="252"/> <source>Ctrl+Alt+S</source> <translation>Ctrl+Alt+S</translation> </message> <message> <location filename="../main_window.ui" line="260"/> <source>&amp;Close</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="263"/> <source>Ctrl+W</source> <translation>Ctrl+W</translation> </message> <message> <location filename="../main_window.ui" line="272"/> <source>&amp;Exit</source> <translation>&amp;</translation> </message> <message> <location filename="../main_window.ui" line="284"/> <source>Add Computer Group</source> <translation> &apos;</translation> </message> <message> <location filename="../main_window.ui" line="296"/> <source>Modify Computer Group</source> <translation> &apos;</translation> </message> <message> <location filename="../main_window.ui" line="308"/> <source>Delete Computer Group</source> <translation> &apos;</translation> </message> <message> <location filename="../main_window.ui" line="320"/> <source>Add Computer</source> <translation> &apos;</translation> </message> <message> <location filename="../main_window.ui" line="332"/> <source>Modify Computer</source> <translation> &apos;</translation> </message> <message> <location filename="../main_window.ui" line="344"/> <source>Delete Computer</source> <translation> &apos;</translation> </message> <message> <location filename="../main_window.ui" line="359"/> <source>Desktop &amp;Manage</source> <translation> &amp;</translation> </message> <message> <location filename="../main_window.ui" line="371"/> <source>Desktop &amp;View</source> <translation> &amp;</translation> </message> <message> <location filename="../main_window.ui" line="383"/> <source>&amp;File Transfer</source> <translation> &amp;</translation> </message> <message> <location filename="../main_window.ui" line="392"/> <source>&amp;Online Help...</source> <translation> &amp;...</translation> </message> <message> <location filename="../main_window.ui" line="395"/> <source>F1</source> <translation>F1</translation> </message> <message> <location filename="../main_window.ui" line="404"/> <source>&amp;About</source> <translation> &amp;</translation> </message> <message> <location filename="../main_window.ui" line="416"/> <source>Address Book Properties</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="425"/> <location filename="../main_window.ui" line="428"/> <source>Desktop Manage</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="437"/> <location filename="../main_window.ui" line="440"/> <source>Desktop View</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="449"/> <location filename="../main_window.ui" line="452"/> <source>File Transfer</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="474"/> <source>Status Bar</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="486"/> <source>Fast Connect</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="489"/> <source>F8</source> <translation>F8</translation> </message> <message> <location filename="../main_window.ui" line="586"/> <source>Router Manage</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="594"/> <source>Show icons in menus</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="606"/> <source>&amp;System Information</source> <translation>&amp; </translation> </message> <message> <location filename="../main_window.ui" line="609"/> <location filename="../main_window.ui" line="618"/> <location filename="../main_window.ui" line="621"/> <source>System Information</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="633"/> <source>&amp;Text Chat</source> <translation> &amp;</translation> </message> <message> <location filename="../main_window.ui" line="636"/> <location filename="../main_window.ui" line="645"/> <location filename="../main_window.ui" line="648"/> <source>Text Chat</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="660"/> <source>Update Status</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.ui" line="663"/> <source>Update the status of computers in the list</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.ui" line="666"/> <source>F5</source> <translation type="unfinished">F5</translation> </message> <message> <location filename="../main_window.ui" line="678"/> <source>Import Computers/Groups</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.ui" line="681"/> <source>Import computers from file</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.ui" line="693"/> <source>Export Computer Group</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.ui" line="696"/> <source>Export computer group to file</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.ui" line="497"/> <source>Show tray icon</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="505"/> <source>Minimize to tray</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="510"/> <source>Hide</source> <translation></translation> </message> <message> <location filename="../main_window.ui" line="522"/> <source>Save all</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="525"/> <source>Ctrl+Shift+S</source> <translation>Ctrl+Shift+S</translation> </message> <message> <location filename="../main_window.ui" line="533"/> <source>Close all</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="536"/> <source>Ctrl+Shift+W</source> <translation>Ctrl+Shift+W</translation> </message> <message> <location filename="../main_window.ui" line="541"/> <source>Check for updates...</source> <translation> ...</translation> </message> <message> <location filename="../main_window.ui" line="546"/> <source>Update Settings</source> <translation> </translation> </message> <message> <location filename="../main_window.ui" line="551"/> <source>Clear</source> <translation></translation> </message> <message> <location filename="../main_window.ui" line="562"/> <source>Remember latest</source> <translation>&apos; </translation> </message> <message> <location filename="../main_window.ui" line="574"/> <source>Copy Computer</source> <translation> &apos;</translation> </message> </context> <context> <name>FastConnectDialog</name> <message> <location filename="../fast_connect_dialog.ui" line="20"/> <source>Fast Connect</source> <translation> </translation> </message> <message> <location filename="../fast_connect_dialog.ui" line="32"/> <source>Address / ID</source> <translation> / ID</translation> </message> <message> <location filename="../fast_connect_dialog.ui" line="70"/> <source>Session Type</source> <translation> </translation> </message> <message> <location filename="../fast_connect_dialog.ui" line="104"/> <source>Default configuration from address book</source> <translation> </translation> </message> <message> <location filename="../fast_connect_dialog.ui" line="110"/> <source>Use credentials from address book</source> <translation> </translation> </message> <message> <location filename="../fast_connect_dialog.ui" line="117"/> <source>Use session parameters from address book</source> <translation> </translation> </message> </context> <context> <name>OpenAddressBookDialog</name> <message> <location filename="../open_address_book_dialog.ui" line="23"/> <source>Open Address Book</source> <translation> </translation> </message> <message> <location filename="../open_address_book_dialog.ui" line="53"/> <source>Address book is encrypted. To open, you must enter a password.</source> <translation> . .</translation> </message> <message> <location filename="../open_address_book_dialog.ui" line="66"/> <source>File:</source> <translation>:</translation> </message> <message> <location filename="../open_address_book_dialog.ui" line="73"/> <source>Encryption Type:</source> <translation> :</translation> </message> <message> <location filename="../open_address_book_dialog.ui" line="80"/> <source>Password:</source> <translation>:</translation> </message> </context> <context> <name>UpdateSettingsDialog</name> <message> <location filename="../update_settings_dialog.ui" line="14"/> <source>Update Settings</source> <translation> </translation> </message> <message> <location filename="../update_settings_dialog.ui" line="26"/> <source>Check for updates on startup</source> <translation> </translation> </message> <message> <location filename="../update_settings_dialog.ui" line="33"/> <source>Use custom update server</source> <translation> </translation> </message> <message> <location filename="../update_settings_dialog.ui" line="42"/> <source>Server:</source> <translation>:</translation> </message> </context> <context> <name>console::AddressBookDialog</name> <message> <location filename="../address_book_dialog.cc" line="113"/> <source>Without Encryption</source> <translation> </translation> </message> <message> <location filename="../address_book_dialog.cc" line="115"/> <source>ChaCha20 + Poly1305 (256-bit key)</source> <translation>ChaCha20 + Poly1305 (256- )</translation> </message> <message> <location filename="../address_book_dialog.cc" line="144"/> <source>Double-click to change</source> <translation> </translation> </message> <message> <location filename="../address_book_dialog.cc" line="127"/> <source>Address Book</source> <translation> </translation> </message> <message> <location filename="../address_book_dialog.cc" line="100"/> <source>Cancel</source> <translation></translation> </message> <message> <location filename="../address_book_dialog.cc" line="226"/> <source>General</source> <translation></translation> </message> <message> <location filename="../address_book_dialog.cc" line="230"/> <source>Sessions</source> <translation></translation> </message> <message> <location filename="../address_book_dialog.cc" line="237"/> <source>Manage</source> <translation></translation> </message> <message> <location filename="../address_book_dialog.cc" line="241"/> <source>View</source> <translation></translation> </message> <message numerus="yes"> <location filename="../address_book_dialog.cc" line="455"/> <source>Too long name. The maximum length of the name is %n characters.</source> <translation> <numerusform> &apos;. : %n .</numerusform> <numerusform> &apos;. : %n .</numerusform> <numerusform> &apos;. : %n .</numerusform> </translation> </message> <message> <location filename="../address_book_dialog.cc" line="461"/> <source>Name can not be empty.</source> <translation>&apos; .</translation> </message> <message numerus="yes"> <location filename="../address_book_dialog.cc" line="468"/> <source>Too long comment. The maximum length of the comment is %n characters.</source> <translation> <numerusform> . : %n .</numerusform> <numerusform> . : %n .</numerusform> <numerusform> . : %n .</numerusform> </translation> </message> <message numerus="yes"> <location filename="../address_book_dialog.cc" line="476"/> <source>Too long display name. The maximum length of the display name is %n characters.</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location filename="../address_book_dialog.cc" line="502"/> <source>The passwords you entered do not match.</source> <translation> .</translation> </message> <message numerus="yes"> <location filename="../address_book_dialog.cc" line="508"/> <source>Password can not be empty and should not exceed %n characters.</source> <translation> <numerusform> %n .</numerusform> <numerusform> %n .</numerusform> <numerusform> %n .</numerusform> </translation> </message> <message> <location filename="../address_book_dialog.cc" line="516"/> <source>Password you entered does not meet the security requirements!</source> <translation> !</translation> </message> <message numerus="yes"> <location filename="../address_book_dialog.cc" line="519"/> <source>The password must contain lowercase and uppercase characters, numbers and should not be shorter than %n characters.</source> <translation> <numerusform> , %n .</numerusform> <numerusform> , %n .</numerusform> <numerusform> , %n .</numerusform> </translation> </message> <message> <location filename="../address_book_dialog.cc" line="523"/> <source>Do you want to enter a different password?</source> <translation> ?</translation> </message> <message> <location filename="../address_book_dialog.cc" line="433"/> <location filename="../address_book_dialog.cc" line="526"/> <source>Warning</source> <translation></translation> </message> <message> <location filename="../address_book_dialog.cc" line="530"/> <source>Yes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_dialog.cc" line="531"/> <source>No</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_dialog.cc" line="564"/> <source>An invalid router address was entered.</source> <translation> .</translation> </message> <message> <location filename="../address_book_dialog.cc" line="575"/> <source>The user name can not be empty and can contain only alphabet characters, numbers and _, -, . characters.</source> <translation>&apos; , , _, ,.</translation> </message> <message> <location filename="../address_book_dialog.cc" line="584"/> <source>Router password cannot be empty.</source> <translation> .</translation> </message> </context> <context> <name>console::AddressBookTab</name> <message> <location filename="../address_book_tab.cc" line="216"/> <source>Unable to open address book file &quot;%1&quot;.</source> <translation> &quot;%1&quot;.</translation> </message> <message> <location filename="../address_book_tab.cc" line="224"/> <source>Unable to read address book file &quot;%1&quot;.</source> <translation> &quot;%1&quot;.</translation> </message> <message> <location filename="../address_book_tab.cc" line="234"/> <source>The address book file &quot;%1&quot; is corrupted or has an unknown format.</source> <translation> &quot;%1&quot; .</translation> </message> <message> <location filename="../address_book_tab.cc" line="281"/> <source>Unable to decrypt the address book with the specified password.</source> <translation> .</translation> </message> <message> <location filename="../address_book_tab.cc" line="288"/> <source>The address book file is corrupted or has an unknown format.</source> <translation> .</translation> </message> <message> <location filename="../address_book_tab.cc" line="273"/> <source>The address book file is encrypted with an unsupported encryption type.</source> <translation> .</translation> </message> <message> <location filename="../address_book_tab.cc" line="684"/> <source>Are you sure you want to delete computer group &quot;%1&quot; and all child items?</source> <translation> , &apos; \&quot;%1\&quot; &apos;?</translation> </message> <message> <location filename="../address_book_tab.cc" line="688"/> <location filename="../address_book_tab.cc" line="726"/> <source>Confirmation</source> <translation></translation> </message> <message> <location filename="../address_book_tab.cc" line="692"/> <location filename="../address_book_tab.cc" line="730"/> <source>Yes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_tab.cc" line="693"/> <location filename="../address_book_tab.cc" line="731"/> <source>No</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_tab.cc" line="722"/> <source>Are you sure you want to delete computer &quot;%1&quot;?</source> <translation> , &apos;\&quot;%1\&quot;?</translation> </message> <message> <location filename="../address_book_tab.cc" line="1075"/> <source>Online</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_tab.cc" line="1080"/> <source>Offline</source> <translation type="unfinished"></translation> </message> <message> <location filename="../address_book_tab.cc" line="1222"/> <source>Save Address Book</source> <translation> </translation> </message> <message> <location filename="../address_book_tab.cc" line="1224"/> <source>Aspia Address Book (*.aab)</source> <translation> Aspia (*.aab)</translation> </message> <message> <location filename="../address_book_tab.cc" line="1239"/> <source>Unable to create or open address book file.</source> <translation> .</translation> </message> <message> <location filename="../address_book_tab.cc" line="1253"/> <source>Unable to write address book file.</source> <translation> .</translation> </message> <message> <location filename="../address_book_tab.cc" line="1284"/> <source>Root Group</source> <translation> </translation> </message> <message> <location filename="../address_book_tab.cc" line="1296"/> <location filename="../address_book_tab.cc" line="1311"/> <source>Warning</source> <translation></translation> </message> <message> <location filename="../address_book_tab.cc" line="1298"/> <source>Could not open address book</source> <translation> </translation> </message> <message> <location filename="../address_book_tab.cc" line="1313"/> <source>Failed to save address book</source> <translation> </translation> </message> </context> <context> <name>console::ComputerDialog</name> <message> <location filename="../computer_dialog.cc" line="60"/> <source>Cancel</source> <translation></translation> </message> <message> <location filename="../computer_dialog.cc" line="69"/> <source>(copy)</source> <translation>()</translation> </message> <message> <location filename="../computer_dialog.cc" line="80"/> <source>General</source> <translation></translation> </message> <message> <location filename="../computer_dialog.cc" line="84"/> <source>Sessions</source> <translation></translation> </message> <message> <location filename="../computer_dialog.cc" line="91"/> <source>Manage</source> <translation></translation> </message> <message> <location filename="../computer_dialog.cc" line="95"/> <source>View</source> <translation></translation> </message> </context> <context> <name>console::ComputerDialogDesktop</name> <message> <location filename="../computer_dialog_desktop.cc" line="127"/> <source>True color (32 bit)</source> <translation>True color (32 )</translation> </message> <message> <location filename="../computer_dialog_desktop.cc" line="128"/> <source>High color (16 bit)</source> <translation>High color (16 )</translation> </message> <message> <location filename="../computer_dialog_desktop.cc" line="129"/> <source>256 colors (8 bit)</source> <translation>256 (8 )</translation> </message> <message> <location filename="../computer_dialog_desktop.cc" line="130"/> <source>64 colors (6 bit)</source> <translation>64 (6 )</translation> </message> <message> <location filename="../computer_dialog_desktop.cc" line="131"/> <source>8 colors (3 bit)</source> <translation>8 (3 )</translation> </message> <message> <location filename="../computer_dialog_desktop.cc" line="322"/> <source>Compression ratio: %1</source> <translation>: %1</translation> </message> </context> <context> <name>console::ComputerDialogGeneral</name> <message numerus="yes"> <location filename="../computer_dialog_general.cc" line="135"/> <source>Too long name. The maximum length of the name is %n characters.</source> <translation> <numerusform> &apos;. %n .</numerusform> <numerusform> &apos;. %n .</numerusform> <numerusform> &apos;. %n .</numerusform> </translation> </message> <message> <location filename="../computer_dialog_general.cc" line="144"/> <source>Name can not be empty.</source> <translation>&apos; .</translation> </message> <message> <location filename="../computer_dialog_general.cc" line="155"/> <source>The user name can not be empty and can contain only alphabet characters, numbers and _, -, . characters.</source> <translation>&apos; , , &quot;&quot;_&quot;&quot;, &quot;&quot;-&quot;&quot;, &quot;&quot;.&quot;&quot;.</translation> </message> <message numerus="yes"> <location filename="../computer_dialog_general.cc" line="166"/> <source>Too long comment. The maximum length of the comment is %n characters.</source> <translation> <numerusform> . %n .</numerusform> <numerusform> . %n .</numerusform> <numerusform> . %n .</numerusform> </translation> </message> <message> <location filename="../computer_dialog_general.cc" line="184"/> <source>An invalid computer address was entered.</source> <translation> &apos;.</translation> </message> <message> <location filename="../computer_dialog_general.cc" line="224"/> <source>Warning</source> <translation></translation> </message> </context> <context> <name>console::ComputerGroupDialog</name> <message> <location filename="../computer_group_dialog.cc" line="63"/> <source>Cancel</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog.cc" line="79"/> <source>General</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog.cc" line="83"/> <source>Sessions</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog.cc" line="90"/> <source>Manage</source> <translation></translation> </message> <message> <location filename="../computer_group_dialog.cc" line="94"/> <source>View</source> <translation></translation> </message> <message numerus="yes"> <location filename="../computer_group_dialog.cc" line="235"/> <source>Too long name. The maximum length of the name is %n characters.</source> <translation> <numerusform> &apos;. %n .</numerusform> <numerusform> &apos;. %n .</numerusform> <numerusform> &apos;. %n .</numerusform> </translation> </message> <message> <location filename="../computer_group_dialog.cc" line="244"/> <source>Name can not be empty.</source> <translation>&apos; .</translation> </message> <message numerus="yes"> <location filename="../computer_group_dialog.cc" line="253"/> <source>Too long comment. The maximum length of the comment is %n characters.</source> <translation> <numerusform> . %n .</numerusform> <numerusform> . %n .</numerusform> <numerusform> . %n .</numerusform> </translation> </message> <message> <location filename="../computer_group_dialog.cc" line="212"/> <source>Warning</source> <translation></translation> </message> </context> <context> <name>console::ComputerGroupDialogDesktop</name> <message> <location filename="../computer_group_dialog_desktop.cc" line="143"/> <source>True color (32 bit)</source> <translation>True color (32 )</translation> </message> <message> <location filename="../computer_group_dialog_desktop.cc" line="144"/> <source>High color (16 bit)</source> <translation>High color (16 )</translation> </message> <message> <location filename="../computer_group_dialog_desktop.cc" line="145"/> <source>256 colors (8 bit)</source> <translation>256 (8 )</translation> </message> <message> <location filename="../computer_group_dialog_desktop.cc" line="146"/> <source>64 colors (6 bit)</source> <translation>64 (6 )</translation> </message> <message> <location filename="../computer_group_dialog_desktop.cc" line="147"/> <source>8 colors (3 bit)</source> <translation>8 (3 )</translation> </message> <message> <location filename="../computer_group_dialog_desktop.cc" line="338"/> <source>Compression ratio: %1</source> <translation>: %1</translation> </message> </context> <context> <name>console::ComputerGroupDialogGeneral</name> <message> <source>Name can not be empty.</source> <translation type="obsolete">&apos; .</translation> </message> <message> <location filename="../computer_group_dialog_general.cc" line="44"/> <source>Credentials</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_general.cc" line="49"/> <source>Inherit from parent</source> <translation> </translation> </message> <message> <location filename="../computer_group_dialog_general.cc" line="102"/> <source>The user name can not be empty and can contain only alphabet characters, numbers and _, -, . characters.</source> <translation>&apos; , _, ., -.</translation> </message> <message> <source>An invalid computer address was entered.</source> <translation type="obsolete"> &apos;.</translation> </message> <message> <location filename="../computer_group_dialog_general.cc" line="142"/> <source>Warning</source> <translation></translation> </message> </context> <context> <name>console::FastConnectDialog</name> <message> <location filename="../fast_connect_dialog.cc" line="58"/> <source>Cancel</source> <translation></translation> </message> <message> <location filename="../fast_connect_dialog.cc" line="102"/> <source>Confirmation</source> <translation></translation> </message> <message> <location filename="../fast_connect_dialog.cc" line="103"/> <source>The list of entered addresses will be cleared. Continue?</source> <translation> . ?</translation> </message> <message> <location filename="../fast_connect_dialog.cc" line="106"/> <source>Yes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../fast_connect_dialog.cc" line="107"/> <source>No</source> <translation type="unfinished"></translation> </message> <message> <location filename="../fast_connect_dialog.cc" line="243"/> <location filename="../fast_connect_dialog.cc" line="264"/> <source>Warning</source> <translation></translation> </message> <message> <location filename="../fast_connect_dialog.cc" line="244"/> <source>Connection by ID is specified but the router is not configured. Check the parameters of the router in the properties of the address book.</source> <translation> ID, . .</translation> </message> <message> <location filename="../fast_connect_dialog.cc" line="265"/> <source>An invalid computer address was entered.</source> <translation> &apos;.</translation> </message> </context> <context> <name>console::MainWindow</name> <message> <location filename="../main_window.cc" line="201"/> <location filename="../main_window.cc" line="590"/> <location filename="../main_window.cc" line="601"/> <location filename="../main_window.cc" line="613"/> <location filename="../main_window.cc" line="667"/> <location filename="../main_window.cc" line="680"/> <location filename="../main_window.cc" line="1663"/> <source>Warning</source> <translation></translation> </message> <message> <location filename="../main_window.cc" line="202"/> <source>Pinned address book file &quot;%1&quot; was not found.&lt;br/&gt;This file will be unpinned.</source> <translation> &quot;%1&quot; . &lt;br/&gt; .</translation> </message> <message> <location filename="../main_window.cc" line="315"/> <source>Open Address Book</source> <translation> </translation> </message> <message> <location filename="../main_window.cc" line="317"/> <source>Aspia Address Book (*.aab)</source> <translation> Aspia (*.aab)</translation> </message> <message> <location filename="../main_window.cc" line="575"/> <source>Open File</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="577"/> <location filename="../main_window.cc" line="654"/> <source>JSON files (*.json)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="591"/> <source>Could not open file for reading.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="602"/> <source>Import file is empty.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="614"/> <source>Failed to parse JSON document: %1.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="627"/> <source>Import completed successfully.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="652"/> <source>Save File</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="668"/> <source>Could not open file for writing.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="681"/> <source>Unable to write file.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="689"/> <source>Export completed successfully.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="954"/> <location filename="../main_window.cc" line="1300"/> <location filename="../main_window.cc" line="1385"/> <source>Confirmation</source> <translation></translation> </message> <message> <location filename="../main_window.cc" line="955"/> <location filename="../main_window.cc" line="1386"/> <source>Address book &quot;%1&quot; has been changed. Save changes?</source> <translation> &quot;%1&quot; . ?</translation> </message> <message> <location filename="../main_window.cc" line="959"/> <location filename="../main_window.cc" line="1304"/> <location filename="../main_window.cc" line="1390"/> <source>Yes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="960"/> <location filename="../main_window.cc" line="1305"/> <location filename="../main_window.cc" line="1391"/> <source>No</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="961"/> <location filename="../main_window.cc" line="1392"/> <source>Cancel</source> <translation type="unfinished"></translation> </message> <message> <location filename="../main_window.cc" line="1194"/> <source>Close other tabs</source> <translation> </translation> </message> <message> <location filename="../main_window.cc" line="1201"/> <source>Close tab</source> <translation> </translation> </message> <message> <location filename="../main_window.cc" line="1202"/> <location filename="../main_window.cc" line="1207"/> <source>Pin tab</source> <translation> </translation> </message> <message> <location filename="../main_window.cc" line="1301"/> <source>The list of recently opened address books will be cleared. Continue?</source> <translation> . ?</translation> </message> <message> <location filename="../main_window.cc" line="1338"/> <source>Hide</source> <translation></translation> </message> <message> <location filename="../main_window.cc" line="1353"/> <source>Show</source> <translation></translation> </message> <message> <location filename="../main_window.cc" line="1664"/> <source>Connection by ID is specified in the properties of the computer, but the router is not configured. Check the parameters of the router in the properties of the address book.</source> <translation> &apos; ID, . .</translation> </message> <message> <location filename="../main_window.cc" line="734"/> <location filename="../main_window.cc" line="1527"/> <source>Aspia Console</source> <translation> Aspia</translation> </message> <message> <location filename="../main_window.cc" line="282"/> <location filename="../main_window.cc" line="626"/> <location filename="../main_window.cc" line="688"/> <source>Information</source> <translation></translation> </message> <message> <location filename="../main_window.cc" line="283"/> <source>Address Book &quot;%1&quot; is already open.</source> <translation> &quot;%1&quot; .</translation> </message> </context> <context> <name>console::MruAction</name> <message> <location filename="../mru_action.cc" line="30"/> <source>&lt;empty&gt;</source> <translation>&lt;&gt;</translation> </message> </context> <context> <name>console::OpenAddressBookDialog</name> <message> <location filename="../open_address_book_dialog.cc" line="36"/> <source>Cancel</source> <translation></translation> </message> <message> <location filename="../open_address_book_dialog.cc" line="49"/> <source>Without Encryption</source> <translation> </translation> </message> <message> <location filename="../open_address_book_dialog.cc" line="53"/> <source>ChaCha20 + Poly1305 (256-bit key)</source> <translation>ChaCha20 + Poly1305 (256- )</translation> </message> </context> <context> <name>console::StatusBar</name> <message numerus="yes"> <location filename="../statusbar.cc" line="76"/> <source>%n child group(s)</source> <translation> <numerusform>%n </numerusform> <numerusform>%n </numerusform> <numerusform>%n </numerusform> </translation> </message> <message numerus="yes"> <location filename="../statusbar.cc" line="77"/> <source>%n child computer(s)</source> <translation> <numerusform>%n &apos;</numerusform> <numerusform>%n &apos;</numerusform> <numerusform>%n &apos;</numerusform> </translation> </message> <message> <location filename="../statusbar.cc" line="63"/> <source>Status update...</source> <translation type="unfinished"></translation> </message> </context> <context> <name>console::UpdateSettingsDialog</name> <message> <location filename="../update_settings_dialog.cc" line="38"/> <source>Cancel</source> <translation></translation> </message> </context> </TS> ```
/content/code_sandbox/source/console/translations/aspia_console_uk.ts
xml
2016-10-26T16:17:31
2024-08-16T13:37:42
aspia
dchapyshev/aspia
1,579
13,841
```xml <?xml version="1.0" encoding="UTF-8"?> <!-- ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-parser-sql-dialect</artifactId> <version>5.5.1-SNAPSHOT</version> </parent> <artifactId>shardingsphere-parser-sql-sql92</artifactId> <name>${project.artifactId}</name> <properties> <dialect.parser>sql92</dialect.parser> </properties> <dependencies> <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>shardingsphere-infra-database-sql92</artifactId> <version>${project.version}</version> </dependency> </dependencies> </project> ```
/content/code_sandbox/parser/sql/dialect/sql92/pom.xml
xml
2016-01-18T12:49:26
2024-08-16T15:48:11
shardingsphere
apache/shardingsphere
19,707
296
```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 FLOAT16_EPS = require( './index' ); // TESTS // // The export is a number... { // eslint-disable-next-line @typescript-eslint/no-unused-expressions FLOAT16_EPS; // $ExpectType number } ```
/content/code_sandbox/lib/node_modules/@stdlib/constants/float16/eps/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
99
```xml import { c } from 'ttag'; import type { useDetailsModal } from '../../../modals/DetailsModal'; import type { useFilesDetailsModal } from '../../../modals/FilesDetailsModal'; import ContextMenuButton from '../ContextMenuButton'; interface Props { selectedBrowserItems: { rootShareId: string; linkId: string }[]; showDetailsModal: ReturnType<typeof useDetailsModal>[1]; showFilesDetailsModal: ReturnType<typeof useFilesDetailsModal>[1]; close: () => void; } const DetailsButton = ({ selectedBrowserItems, showDetailsModal, showFilesDetailsModal, close }: Props) => { return ( <ContextMenuButton name={c('Action').t`Details`} icon="info-circle" testId="context-menu-details" action={() => { if (selectedBrowserItems.length === 1) { void showDetailsModal({ shareId: selectedBrowserItems[0].rootShareId, linkId: selectedBrowserItems[0].linkId, }); } else if (selectedBrowserItems.length > 1) { void showFilesDetailsModal({ selectedItems: selectedBrowserItems }); } }} close={close} /> ); }; export default DetailsButton; ```
/content/code_sandbox/applications/drive/src/app/components/sections/ContextMenu/buttons/DetailsButton.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
264
```xml /* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable no-underscore-dangle */ import { type RunnerTask, type TaskContext, type TaskMeta, type TestContext } from 'vitest'; import { composeStory } from 'storybook/internal/preview-api'; import type { ComponentAnnotations, ComposedStoryFn } from 'storybook/internal/types'; import { setViewport } from './viewports'; export const testStory = ( exportName: string, story: ComposedStoryFn, meta: ComponentAnnotations, skipTags: string[] ) => { const composedStory = composeStory(story, meta, undefined, undefined, exportName); return async (context: TestContext & TaskContext & { story: ComposedStoryFn }) => { if (composedStory === undefined || skipTags?.some((tag) => composedStory.tags.includes(tag))) { context.skip(); } context.story = composedStory; const _task = context.task as RunnerTask & { meta: TaskMeta & { storyId: string } }; _task.meta.storyId = composedStory.id; await setViewport(composedStory.parameters.viewport); await composedStory.run(); }; }; ```
/content/code_sandbox/code/addons/vitest/src/plugin/test-utils.ts
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
250
```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 LN_TWO_PI = require( './index' ); // TESTS // // The export is a number... { // eslint-disable-next-line @typescript-eslint/no-unused-expressions LN_TWO_PI; // $ExpectType number } ```
/content/code_sandbox/lib/node_modules/@stdlib/constants/float64/ln-two-pi/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
99
```xml <!-- ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <dataset> <metadata> <column name="datname"/> <column name="datdba"/> <column name="encoding"/> <column name="datcollate"/> <column name="datctype"/> <column name="datistemplate"/> <column name="datallowconn"/> <column name="datconnlimit"/> <column name="datlastsysoid"/> <column name="datfrozenxid"/> <column name="dattablespace"/> <column name="datcompatibility"/> <column name="datacl"/> <column name="datfrozenxid64"/> <column name="datminmxid"/> </metadata> </dataset> ```
/content/code_sandbox/test/e2e/sql/src/test/resources/cases/dql/dataset/empty_storage_units/opengauss/select_opengauss_pg_catalog_pg_database.xml
xml
2016-01-18T12:49:26
2024-08-16T15:48:11
shardingsphere
apache/shardingsphere
19,707
223
```xml export * as HeadManagerContext from '../../../../../shared/lib/head-manager-context.shared-runtime' export * as ServerInsertedHtml from '../../../../../shared/lib/server-inserted-html.shared-runtime' export * as AppRouterContext from '../../../../../shared/lib/app-router-context.shared-runtime' export * as HooksClientContext from '../../../../../shared/lib/hooks-client-context.shared-runtime' export * as RouterContext from '../../../../../shared/lib/router-context.shared-runtime' export * as AmpContext from '../../../../../shared/lib/amp-context.shared-runtime' export * as ImageConfigContext from '../../../../../shared/lib/image-config-context.shared-runtime' ```
/content/code_sandbox/packages/next/src/server/route-modules/app-page/vendored/contexts/entrypoints.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
111
```xml <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="path_to_url" xmlns:app="path_to_url"> <data> <variable name="viewModel" type="com.kelin.mvvmlight.zhihu.newsdetail.NewsDetailViewModel" /> </data> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipe_refresh_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="fill_vertical" app:layout_behavior="@string/appbar_scrolling_view_behavior" app:onRefreshCommand="@{viewModel.onRefreshCommand}" app:setRefreshing="@{viewModel.viewStyle.isRefreshing}"> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="fill_vertical" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <WebView android:id="@+id/webview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="-200dp" app:render="@{viewModel.html}"></WebView> </android.support.v4.widget.NestedScrollView> </android.support.v4.widget.SwipeRefreshLayout> </layout> ```
/content/code_sandbox/sample/src/main/res/layout/activity_news_detail_content.xml
xml
2016-06-02T09:26:56
2024-08-15T10:52:54
MVVMLight
Kelin-Hong/MVVMLight
1,847
292
```xml <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <RootNamespace>ClassLib</RootNamespace> <TargetFramework>net7.0</TargetFramework> <LangVersion>latest</LangVersion> </PropertyGroup> </Project> ```
/content/code_sandbox/test/dotnet-new.Tests/Approvals/DotnetVisualBasicClassTemplatesTest.class.langVersion=latest.targetFramework=net7.0.verified/ClassLib.vbproj
xml
2016-07-22T21:26:02
2024-08-16T17:23:58
sdk
dotnet/sdk
2,627
56
```xml <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/darkblue</item> <item name="colorPrimaryDark">@color/darkblue</item> <item name="colorAccent">@color/darkblue</item> </style> </resources> ```
/content/code_sandbox/MyTracker/app/src/main/res/values/styles.xml
xml
2016-09-26T16:36:28
2024-08-13T08:59:01
AndroidTutorialForBeginners
hussien89aa/AndroidTutorialForBeginners
4,360
87
```xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="path_to_url"> <item android:id="@+id/about_item" android:title="About" /> </menu> ```
/content/code_sandbox/app/src/main/res/menu/menu.xml
xml
2016-08-17T12:14:07
2024-08-14T11:15:26
SpeedView
anastr/SpeedView
1,283
48
```xml import type { RecordOf } from 'immutable'; import { List, Record as ImmutableRecord } from 'immutable'; import escapeTextContentForBrowser from 'escape-html'; import type { ApiAccountFieldJSON, ApiAccountRoleJSON, ApiAccountJSON, } from 'mastodon/api_types/accounts'; import type { ApiCustomEmojiJSON } from 'mastodon/api_types/custom_emoji'; import emojify from 'mastodon/features/emoji/emoji'; import { unescapeHTML } from 'mastodon/utils/html'; import { CustomEmojiFactory } from './custom_emoji'; import type { CustomEmoji } from './custom_emoji'; // AccountField interface AccountFieldShape extends Required<ApiAccountFieldJSON> { name_emojified: string; value_emojified: string; value_plain: string | null; } type AccountField = RecordOf<AccountFieldShape>; const AccountFieldFactory = ImmutableRecord<AccountFieldShape>({ name: '', value: '', verified_at: null, name_emojified: '', value_emojified: '', value_plain: null, }); // AccountRole export type AccountRoleShape = ApiAccountRoleJSON; export type AccountRole = RecordOf<AccountRoleShape>; const AccountRoleFactory = ImmutableRecord<AccountRoleShape>({ color: '', id: '', name: '', }); // Account export interface AccountShape extends Required< Omit<ApiAccountJSON, 'emojis' | 'fields' | 'roles' | 'moved'> > { emojis: List<CustomEmoji>; fields: List<AccountField>; roles: List<AccountRole>; display_name_html: string; note_emojified: string; note_plain: string | null; hidden: boolean; moved: string | null; } export type Account = RecordOf<AccountShape>; export const accountDefaultValues: AccountShape = { acct: '', avatar: '', avatar_static: '', bot: false, created_at: '', discoverable: false, indexable: false, display_name: '', display_name_html: '', emojis: List<CustomEmoji>(), fields: List<AccountField>(), group: false, header: '', header_static: '', id: '', last_status_at: '', locked: false, noindex: false, note: '', note_emojified: '', note_plain: 'string', roles: List<AccountRole>(), uri: '', url: '', username: '', followers_count: 0, following_count: 0, statuses_count: 0, hidden: false, suspended: false, memorial: false, limited: false, moved: null, hide_collections: false, }; const AccountFactory = ImmutableRecord<AccountShape>(accountDefaultValues); type EmojiMap = Record<string, ApiCustomEmojiJSON>; function makeEmojiMap(emojis: ApiCustomEmojiJSON[]) { return emojis.reduce<EmojiMap>((obj, emoji) => { obj[`:${emoji.shortcode}:`] = emoji; return obj; }, {}); } function createAccountField( jsonField: ApiAccountFieldJSON, emojiMap: EmojiMap, ) { return AccountFieldFactory({ ...jsonField, name_emojified: emojify( escapeTextContentForBrowser(jsonField.name), emojiMap, ), value_emojified: emojify(jsonField.value, emojiMap), value_plain: unescapeHTML(jsonField.value), }); } export function createAccountFromServerJSON(serverJSON: ApiAccountJSON) { const { moved, ...accountJSON } = serverJSON; const emojiMap = makeEmojiMap(accountJSON.emojis); const displayName = accountJSON.display_name.trim().length === 0 ? accountJSON.username : accountJSON.display_name; return AccountFactory({ ...accountJSON, moved: moved?.id, fields: List( serverJSON.fields.map((field) => createAccountField(field, emojiMap)), ), emojis: List(serverJSON.emojis.map((emoji) => CustomEmojiFactory(emoji))), roles: List(serverJSON.roles?.map((role) => AccountRoleFactory(role))), display_name_html: emojify( escapeTextContentForBrowser(displayName), emojiMap, ), note_emojified: emojify(accountJSON.note, emojiMap), note_plain: unescapeHTML(accountJSON.note), }); } ```
/content/code_sandbox/app/javascript/mastodon/models/account.ts
xml
2016-02-22T15:01:25
2024-08-16T19:27:35
mastodon
mastodon/mastodon
46,560
959
```xml /* * one or more contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright ownership. */ import {MemoryRouter} from 'react-router-dom'; import {act, render, screen} from 'modules/testing-library'; import {modificationsStore} from 'modules/stores/modifications'; import {Layout} from '.'; import {useEffect} from 'react'; type Props = { children?: React.ReactNode; }; function getWrapper(initialPath: string = '/') { const Wrapper: React.FC<Props> = ({children}) => { useEffect(() => { return () => { modificationsStore.reset(); }; }, []); return ( <MemoryRouter initialEntries={[initialPath]}>{children}</MemoryRouter> ); }; return Wrapper; } const OperationsPanelMock: React.FC = () => <div>OperationsPanelMock</div>; jest.mock('modules/components/OperationsPanel', () => ({ OperationsPanel: OperationsPanelMock, })); describe.skip('Layout', () => { it('should not display footer when modification mode is enabled', async () => { render(<Layout />, {wrapper: getWrapper('/processes/1')}); expect(screen.getByText(/All rights reserved/)).toBeInTheDocument(); act(() => { modificationsStore.enableModificationMode(); }); expect(screen.queryByText(/All rights reserved/)).not.toBeInTheDocument(); }); it('should render processes page', async () => { render(<Layout />, {wrapper: getWrapper('/processes')}); expect(screen.queryByText(/All rights reserved/)).not.toBeInTheDocument(); expect(screen.getByText('OperationsPanelMock')).toBeInTheDocument(); }); it('should render decisions page', async () => { render(<Layout />, {wrapper: getWrapper('/decisions')}); expect(screen.queryByText(/All rights reserved/)).not.toBeInTheDocument(); expect(screen.getByText('OperationsPanelMock')).toBeInTheDocument(); }); it('should render process instance page', async () => { render(<Layout />, {wrapper: getWrapper('/processes/1')}); expect(screen.getByText(/All rights reserved/)).toBeInTheDocument(); expect(screen.queryByText('OperationsPanelMock')).not.toBeInTheDocument(); }); it('should render decision instance page', async () => { render(<Layout />, {wrapper: getWrapper('/decisions/1')}); expect(screen.getByText(/All rights reserved/)).toBeInTheDocument(); expect(screen.queryByText('OperationsPanelMock')).not.toBeInTheDocument(); }); it('should render dashboard page', async () => { render(<Layout />, {wrapper: getWrapper()}); expect(screen.getByText(/All rights reserved/)).toBeInTheDocument(); expect(screen.queryByText('OperationsPanelMock')).not.toBeInTheDocument(); }); }); ```
/content/code_sandbox/operate/client/src/App/Layout/index.test.tsx
xml
2016-03-20T03:38:04
2024-08-16T19:59:58
camunda
camunda/camunda
3,172
575
```xml import { render } from '@testing-library/react'; import type { Props } from './CheckoutRow'; import CheckoutRow from './CheckoutRow'; let props: Props; beforeEach(() => { props = { title: 'My Checkout Title', amount: 999, }; }); it('should render', () => { const { container } = render(<CheckoutRow {...props} />); expect(container).not.toBeEmptyDOMElement(); }); it('should render free if amount is 0 and there is no currency', () => { props.amount = 0; props.currency = undefined; const { container } = render(<CheckoutRow {...props} />); expect(container).toHaveTextContent(props.title as string); expect(container).toHaveTextContent('Free'); }); it('should render loading state', () => { props.loading = true; const { container } = render(<CheckoutRow {...props} />); expect(container).toHaveTextContent(props.title as string); expect(container).toHaveTextContent('Loading'); }); it('should render price with suffix', () => { props.suffix = '/year'; props.currency = 'CHF'; const { container } = render(<CheckoutRow {...props} />); expect(container).toHaveTextContent(`My Checkout TitleCHF 9.99/year`); }); it('should render price with suffix on next line', () => { props.suffix = '/year'; props.currency = 'CHF'; // that's the default behavior now. No need to set it explicitly. // props.suffixNextLine = true; const { getByTestId } = render(<CheckoutRow {...props} />); expect(getByTestId('next-line-suffix')).toHaveTextContent('/year'); }); ```
/content/code_sandbox/packages/components/containers/payments/subscription/modal-components/helpers/CheckoutRow.test.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
370
```xml <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="path_to_url"> <ItemGroup> <ClCompile Include="main.cpp" /> <ClCompile Include="script.cpp" /> <ClCompile Include="utils.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\inc\enums.h"> <Filter>include</Filter> </ClInclude> <ClInclude Include="..\..\inc\natives.h"> <Filter>include</Filter> </ClInclude> <ClInclude Include="..\..\inc\types.h"> <Filter>include</Filter> </ClInclude> <ClInclude Include="script.h" /> <ClInclude Include="utils.h" /> <ClInclude Include="..\..\inc\main.h"> <Filter>include</Filter> </ClInclude> </ItemGroup> <ItemGroup> <Filter Include="include"> <UniqueIdentifier>{5d58942b-ebbf-4d0a-9526-359e3a556796}</UniqueIdentifier> </Filter> </ItemGroup> </Project> ```
/content/code_sandbox/DeepGTAV.filters
xml
2016-09-05T05:49:38
2024-08-13T21:27:29
DeepGTAV
aitorzip/DeepGTAV
1,107
259
```xml declare class MyArray<T> extends Array<T> { sort(compareFn?: (a: T, b: T) => number): this; } ```
/content/code_sandbox/tests/format/typescript/conformance/types/thisType/thisType.ts
xml
2016-11-29T17:13:37
2024-08-16T17:29:57
prettier
prettier/prettier
48,913
32
```xml "use client" import * as React from "react" import { Checkbox } from "@/components/ui/checkbox" import { LinkIcon, Trash2Icon } from "lucide-react" import Link from "next/link" import Image from "next/image" import { useSortable } from "@dnd-kit/sortable" import { CSS } from "@dnd-kit/utilities" import { PersonalLink } from "@/lib/schema/personal-link" import { cn } from "@/lib/utils" import { LinkForm } from "./form/manage" import { Button } from "@/components/ui/button" import { ConfirmOptions } from "@omit/react-confirm-dialog" import { Badge } from "@/components/ui/badge" interface ListItemProps { confirm: (options: ConfirmOptions) => Promise<boolean> personalLink: PersonalLink disabled?: boolean isEditing: boolean setEditId: (id: string | null) => void isDragging: boolean isFocused: boolean setFocusedId: (id: string | null) => void registerRef: (id: string, ref: HTMLLIElement | null) => void onDelete?: (personalLink: PersonalLink) => void } export const ListItem: React.FC<ListItemProps> = ({ confirm, isEditing, setEditId, personalLink, disabled = false, isDragging, isFocused, setFocusedId, registerRef, onDelete }) => { const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: personalLink.id, disabled }) const formRef = React.useRef<HTMLFormElement>(null) const [showDeleteIcon, setShowDeleteIcon] = React.useState(false) const style = { transform: CSS.Transform.toString(transform), transition, pointerEvents: isDragging ? "none" : "auto" } React.useEffect(() => { if (isEditing) { formRef.current?.focus() } }, [isEditing]) const refCallback = React.useCallback( (node: HTMLLIElement | null) => { setNodeRef(node) registerRef(personalLink.id, node) }, [setNodeRef, registerRef, personalLink.id] ) const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Enter") { e.preventDefault() setEditId(personalLink.id) } } const handleSuccess = () => { setEditId(null) } const handleCancel = () => { setEditId(null) } // const handleRowClick = () => { // console.log("Row clicked", personalLink.id) // setEditId(personalLink.id) // } const handleRowClick = () => { setShowDeleteIcon(!showDeleteIcon) } const handleDoubleClick = () => { setEditId(personalLink.id) } const handleDelete = async (e: React.MouseEvent, personalLink: PersonalLink) => { e.stopPropagation() const result = await confirm({ title: `Delete "${personalLink.title}"?`, description: "This action cannot be undone.", alertDialogTitle: { className: "text-base" }, customActions: (onConfirm, onCancel) => ( <> <Button variant="outline" onClick={onCancel}> Cancel </Button> <Button variant="destructive" onClick={onConfirm}> Delete </Button> </> ) }) if (result) { onDelete?.(personalLink) } } if (isEditing) { return <LinkForm ref={formRef} personalLink={personalLink} onSuccess={handleSuccess} onCancel={handleCancel} /> } return ( <li ref={refCallback} style={style as React.CSSProperties} {...attributes} {...listeners} tabIndex={0} onFocus={() => setFocusedId(personalLink.id)} onBlur={() => setFocusedId(null)} onKeyDown={handleKeyDown} className={cn("hover:bg-muted/50 relative flex h-14 cursor-default items-center outline-none xl:h-11", { "bg-muted/50": isFocused })} onClick={handleRowClick} onDoubleClick={handleDoubleClick} > <div className="flex grow justify-between gap-x-6 px-6 max-lg:px-4"> <div className="flex min-w-0 items-center gap-x-4"> <Checkbox checked={personalLink.completed} onClick={e => e.stopPropagation()} onCheckedChange={() => { personalLink.completed = !personalLink.completed }} className="border-muted-foreground border" /> {personalLink.isLink && personalLink.meta && ( <Image src={personalLink.meta.favicon} alt={personalLink.title} className="size-5 rounded-full" width={16} height={16} /> )} <div className="w-full min-w-0 flex-auto"> <div className="gap-x-2 space-y-0.5 xl:flex xl:flex-row"> <p className="text-primary hover:text-primary line-clamp-1 text-sm font-medium xl:truncate"> {personalLink.title} </p> {personalLink.isLink && personalLink.meta && ( <div className="group flex items-center gap-x-1"> <LinkIcon aria-hidden="true" className="text-muted-foreground group-hover:text-primary size-3 flex-none" /> <Link href={personalLink.meta.url} passHref prefetch={false} target="_blank" onClick={e => { e.stopPropagation() }} className="text-muted-foreground hover:text-primary text-xs" > <span className="xl:truncate">{personalLink.meta.url}</span> </Link> </div> )} </div> </div> </div> <div className="flex shrink-0 items-center gap-x-4"> <Badge variant="secondary">Topic Name</Badge> {showDeleteIcon && ( <Button size="icon" className="text-destructive h-auto w-auto bg-transparent hover:bg-transparent hover:text-red-500" onClick={e => handleDelete(e, personalLink)} > <Trash2Icon size={16} /> </Button> )} </div> </div> </li> ) } ```
/content/code_sandbox/web/components/routes/link/list-item.tsx
xml
2016-08-08T16:09:17
2024-08-16T16:23:04
learn-anything.xyz
learn-anything/learn-anything.xyz
15,943
1,436
```xml import { useContext } from 'react'; import ConfigContext from '../containers/config/configContext'; const useConfig = () => { return useContext(ConfigContext); }; export default useConfig; ```
/content/code_sandbox/packages/components/hooks/useConfig.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
38
```xml import { HasManyOptions } from 'sequelize'; import { HasAssociation } from './has-association'; import { ModelClassGetter } from '../../model/shared/model-class-getter'; import { addAssociation, getPreparedAssociationOptions } from '../shared/association-service'; import { Association } from '../shared/association'; export function HasMany<TCreationAttributes extends {}, TModelAttributes extends {}>( associatedClassGetter: ModelClassGetter<TCreationAttributes, TModelAttributes>, foreignKey?: string ): Function; export function HasMany<TCreationAttributes extends {}, TModelAttributes extends {}>( associatedClassGetter: ModelClassGetter<TCreationAttributes, TModelAttributes>, options?: HasManyOptions ): Function; export function HasMany<TCreationAttributes extends {}, TModelAttributes extends {}>( associatedClassGetter: ModelClassGetter<TCreationAttributes, TModelAttributes>, optionsOrForeignKey?: string | HasManyOptions ): Function { return (target: any, propertyName: string) => { const options: HasManyOptions = getPreparedAssociationOptions(optionsOrForeignKey); if (!options.as) options.as = propertyName; addAssociation(target, new HasAssociation(associatedClassGetter, options, Association.HasMany)); }; } ```
/content/code_sandbox/src/associations/has/has-many.ts
xml
2016-01-27T11:25:52
2024-08-13T16:56:45
sequelize-typescript
sequelize/sequelize-typescript
2,768
254
```xml export * from './ChoiceGroupOption'; export * from './ChoiceGroupOption.types'; ```
/content/code_sandbox/packages/react/src/components/ChoiceGroup/ChoiceGroupOption/index.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
18
```xml <resources> <string name="version">v1.2.7</string> <string name="app_name">APlayer</string> <string name="tab_song"></string> <string name="tab_album"></string> <string name="tab_artist"></string> <string name="tab_playlist"></string> <string name="tab_folder"></string> <string name="tab_genre"></string> <string name="tab_remote"></string> <string name="drawer_song"></string> <string name="drawer_recently_add"></string> <string name="drawer_folder"></string> <string name="drawer_setting"></string> <string name="drawer_history"></string> <string name="from_aplayer"> APlayer </string> <string name="about"> APlayer</string> <string name="model_random"></string> <string name="model_repeat"></string> <string name="model_normal"></string> <string name="unknown_song"></string> <string name="unknown_artist"></string> <string name="unknown_album"></string> <string name="eq_initial_failed"></string> <string name="use_eq"></string> <string name="plz_earphone"></string> <string name="back"></string> <string name="feedback">APlayer </string> <string name="my_favorite"></string> <string name="list_is_empty"></string> <string name="folder"></string> <string name="recently"></string> <string name="continue_play"></string> <string name="pause_play"></string> <string name="no_song"></string> <string name="share_error"></string> <string name="share_success"></string> <string name="share_cancel"></string> <string name="plz_input_sharecontent"></string> <string name="confirm"></string> <string name="cancel"></string> <string name="new_playlist"></string> <string name="create"></string> <string name="input_playlist_name"></string> <string name="song_lose_effect"></string> <string name="add_playlist_success"></string> <string name="add_playlist_error"></string> <string name="playlist_already_exist"></string> <string name="more"></string> <string name="select_all"></string> <string name="add_error"></string> <string name="add_to_playlist"></string> <string name="add_song_playlist_success">%1$d%2$s</string> <string name="delete_multi_song">%d</string> <string name="add_song_playqueue_success">%d</string> <string name="add_song_playlist_error"></string> <string name="load_playlist_error"></string> <string name="confirm_delete_from_playlist_or_library">%s</string> <string name="delete_success"></string> <string name="delete_error"></string> <string name="set_ringtone_success"></string> <string name="set_ringtone_error"></string> <string name="set_success"></string> <string name="plz_set_correct_time"></string> <string name="cancel_success"></string> <string name="play_random">(%d)</string> <string name="scan_tip"></string> <string name="search_hint"> </string> <string name="no_search_result"></string> <string name="create_playlist">...</string> <string name="use_system_color"></string> <string name="use_black_color"></string> <string name="play_queue">(%d)</string> <string name="choose_song"></string> <string name="choose_no_song"></string> <string name="set_album_cover_error"></string> <string name="set_artist_cover_error"></string> <string name="set_playlist_cover_error"></string> <string name="new_folder"></string> <string name="choose_folder"></string> <string name="setting_success"></string> <string name="setting_error"></string> <string name="search_error"></string> <string name="song_not_empty"></string> <string name="save_success"></string> <string name="save_error"></string> <string name="save_error_arg">: %s</string> <string name="arg_illegal">: %d</string> <string name="send_success"> !</string> <string name="send_error">: %s</string> <string name="screenshot_save_at">%s</string> <string name="not_install_weibo"></string> <string name="create_dir_error"></string> <string name="need_permission"></string> <string name="play_now">: %s</string> <string name="default_lrc_path"></string> <string name="lrc_tip">%s</string> <string name="cache_size">%1$2.2f MB</string> <string name="confirm_clear_cache"></string> <string name="mylove_cant_edit"></string> <string name="error"></string> <string name="share_to"></string> <string name="qq">QQ</string> <string name="weibo"></string> <string name="wechat">WeChat</string> <string name="circlefriend">WeChat </string> <string name="record_share"></string> <string name="share"></string> <string name="timer"></string> <string name="as_default"></string> <string name="close"></string> <string name="timer_default_info_title"></string> <string name="timer_default_info_content">\n\n</string> <string name="input_feedback_content"></string> <string name="timer_pending_close"></string> <string name="playing"></string> <string name="set_filter_size"></string> <string name="delete"></string> <string name="ring"></string> <string name="join"></string> <string name="update_error">: %s</string> <string name="update_ignore"></string> <string name="no_update"></string> <string name="search"></string> <string name="timer_close"></string> <string name="feedback_contact_hint"> WeChat ID/QQ ID</string> <string name="lrc_choose"></string> <string name="song_detail"></string> <string name="song_edit"></string> <string name="common"></string> <string name="lrc"></string> <string name="music_filter"></string> <string name="lrc_scan"></string> <string name="lockscreen_show"></string> <string name="manual_scan"></string> <string name="lrc_priority"></string> <string name="lrc_priority_tip">()</string> <string name="navigation_color"></string> <string name="navigation_is_show"></string> <string name="shake"></string> <string name="shake_tip"></string> <string name="color"></string> <string name="primary_color"></string> <string name="primary_color_tip"></string> <string name="notify_bg_color"></string> <string name="notify_bg_color_info"></string> <string name="other"></string> <string name="eq_setting"></string> <string name="feedback_info"></string> <string name="about_info"></string> <string name="check_update"></string> <string name="clear_cache"></string> <string name="support_develop"></string> <string name="choose"></string> <string name="donate_tip"></string> <string name="jump_alipay_account"></string> <string name="already_copy"></string> <string name="confirm_delete_playlist"></string> <string name="confirm_delete_from_playlist"></string> <string name="confirm_delete_from_library"></string> <string name="sleep_timer"></string> <string name="eq"></string> <string name="collect"></string> <string name="only_lollopop"> Android 5.0 </string> <string name="aplayer_lockscreen">APlayer </string> <string name="system_lockscreen"></string> <string name="aplayer_lockscreen_tip"> APlayer</string> <string name="system_lockscreen_tip"></string> <string name="lockscreen_off_tip"></string> <string name="choose_or_close_lockscreen"></string> <string name="cant_play_this_sont"></string> <string name="illegal_arg"></string> <string name="song_count">%d</string> <string name="song_count_1">%d</string> <string name="song_count_2">%1$s %2$d</string> <string name="searching"></string> <string name="no_lrc"></string> <string name="local_list"></string> <string name="next_song">: %s</string> <string name="please_wait"></string> <string name="processing_picture"></string> <string name="clear_success"></string> <string name="setting"></string> <string name="reset"></string> <string name="submit"></string> <string name="add_local_list"></string> <string name="new_list">...</string> <string name="song_path">:</string> <string name="song_name">:</string> <string name="file_size">:</string> <string name="format">:</string> <string name="length">:</string> <string name="bitrate">:</string> <string name="sample_rate">:</string> <string name="song_name_input_hint"></string> <string name="album_input_hint"></string> <string name="artist_input_hint"></string> <string name="year_input_hint"></string> <string name="track_number_input_hint"></string> <string name="genre_input_hint"></string> <string name="grant_write_permission_tip"></string> <string name="write_something"></string> <string name="song_sheet"></string> <string name="play_failed">:</string> <string name="cant_request_audio_focus"></string> <string name="float_lrc"></string> <string name="closed_desktop_lrc"></string> <string name="opened_desktop_lrc"></string> <string name="confirm_ignore_lrc"></string> <string name="statusbar_lrc"></string> <string name="confirm_cancel_ignore_lrc"></string> <string name="ignore_lrc"></string> <string name="cancel_ignore_lrc"></string> <string name="select_lrc"></string> <string name="path_empty"></string> <string name="file_not_exist"></string> <string name="desktop_lyric_lock"></string> <string name="desktop_lyric__lock_ticker"></string> <string name="desktop_lyric__unlock"></string> <string name="mediaplayer_error">MediaPlayer{what:%1$d,extra:%2$d}\n</string> <string name="mediaplayer_error_ignore">!\n : MediaPlayer{what:%1$d,extra:%2$d}!</string> <string name="screen_always_on_title"></string> <string name="screen_always_on_tip"></string> <string name="plz_give_float_permission"></string> <string name="jump_alipay_error">\n(*)</string> <string name="plz_give_access_external_storage_permission"></string> <string name="show_recently"></string> <string name="no_audio_ID"></string> <string name="need_earphone"></string> <string name="load_overtime"></string> <string name="scan_failed">:%s</string> <string name="scanning"></string> <string name="scanned_finish"></string> <string name="scaning"></string> <string name="no_audio_file"></string> <string name="manual_scan_tip"> .nomedia </string> <string name="playing_notification"></string> <string name="playing_notification_description">/</string> <string name="unlock_notification_description"></string> <string name="previous"></string> <string name="next"></string> <string name="play_pause">/</string> <string name="notify"></string> <string name="notify_style"></string> <string name="notify_style_tip"></string> <string name="notify_bg_color_warnning"></string> <string name="unlock_notification"></string> <string name="click_to_unlock"></string> <string name="please_give_write_settings_permission"></string> <string name="loading"></string> <string name="cover"></string> <string name="always"></string> <string name="never"></string> <string name="wifi_only"> WiFi </string> <string name="auto_download_album_artist_cover"></string> <string name="zero_size">0MB</string> <string name="library"></string> <string name="library_category"></string> <string name="configure_library_category"></string> <string name="load_failed"></string> <string name="plz_choose_at_least_one_category"></string> <string name="play"></string> <string name="add_to_play_queue"></string> <string name="set_album_cover"></string> <string name="set_artist_cover"></string> <string name="set_playlist_cover"></string> <string name="already_add_to_next_song"></string> <string name="add_to_next_song"></string> <string name="immersive"></string> <string name="immersive_tip"></string> <string name="delete_source"></string> <string name="kugou"></string> <string name="netease">Netease</string> <string name="lastfm">Last FM</string> <string name="cancel_timer"></string> <string name="start_timer"></string> <string name="sort_order"></string> <string name="album"></string> <string name="album_desc"></string> <string name="title"></string> <string name="title_desc"></string> <string name="display_title"></string> <string name="display_title_desc"></string> <string name="artist"></string> <string name="artist_desc"></string> <string name="genre"></string> <string name="genre_desc"></string> <string name="date_modify"></string> <string name="date_modify_desc"></string> <string name="count"></string> <string name="count_desc"></string> <string name="duration"></string> <string name="year"></string> <string name="number_of_album"></string> <string name="name"></string> <string name="name_desc"></string> <string name="create_time"></string> <string name="custom"></string> <string name="lyric"></string> <string name="track_number"></string> <string name="playlist_import"></string> <string name="playlist_import_tip"></string> <string name="import_playlist_to"></string> <string name="import_playlist_to_count">%1$s %2$d</string> <string name="import_fail">: %s</string> <string name="new_create"></string> <string name="choose_import_way"></string> <string name="import_from_external_storage">(m3u)</string> <string name="import_from_others"></string> <string name="no_playlist_can_import"></string> <string name="choose_import_playlist"></string> <string name="import_count">%s</string> <string name="alipay"></string> <string name="cant_share_song"></string> <string name="save_wechat_qrcode_success"> WeChat QR WeChat QR</string> <string name="play_breakpoint"></string> <string name="play_breakpoint_tip"></string> <string name="will_stop_at_x">%d</string> <string name="saveing"></string> <string name="ignore_mediastore_artwork"></string> <string name="ignore_mediastore_artwork_tips"></string> <string name="error_setup_inapp_billing">: %s</string> <string name="error_occur">: %s</string> <string name="thank_you">!</string> <string name="payment_failure"></string> <string name="restored_previous_purchases"></string> <string name="paypal">Paypal</string> <string name="exit"></string> <string name="plz_set_default_time"></string> <string name="app_widget_big_name">APlayer-</string> <string name="app_widget_medium_name">APlayer-</string> <string name="app_widget_small_name">APlayer-</string> <string name="app_widget_medium_transparent_name">APlayer--</string> <string name="app_widget_small_transparent_name">APlayer--</string> <string name="create_playlist_fail">: </string> <string name="export_playlist"></string> <string name="export_play_list_tip"></string> <string name="choose_playlist_to_export"></string> <string name="export_fail">:%s</string> <string name="export_success"></string> <string name="cover_download_source"></string> <string name="cover_download_from_lastfm"> Last.FM </string> <string name="cover_download_from_netease"> Netease </string> <string name="update_notification"></string> <string name="update_notification_description"></string> <string name="downloading"></string> <string name="download_complete"></string> <string name="download_complete_to_do"></string> <string name="plz_give_install_permission"></string> <string name="update"></string> <string name="new_version_found"></string> <string name="ignore_this_version"></string> <string name="ignore_check_update_forever"></string> <string name="empty_path_report_to_developer"></string> <string name="rename"></string> <string name="no_equalizer"></string> <string name="clear_download_cover"></string> <string name="updating"></string> <string name="player"></string> <string name="show_on_bottom"></string> <string name="show_of_bottom_tip"></string> <string name="show_next_song_only"></string> <string name="show_vol_control_only"></string> <string name="tap_to_toggle"></string> <string name="change_offset"></string> <string name="lyric_offset_reset"></string> <string name="lyric_advance_x_second">%1$s</string> <string name="lyric_delay_x_second">%1$s</string> <string name="lyric_adjust_font_size"></string> <string name="speed"></string> <string name="whether_change_theme"></string> <string name="embedded_lyric"></string> <string name="default_lyric_priority"></string> <string name="local"></string> <string name="restore_songs"></string> <string name="restore_songs_tip"></string> <string name="alread_restore_songs"></string> <string name="speed_range_tip">0.5-2</string> <string name="show_displayname"></string> <string name="show_displayname_tip"></string> <string name="force_sort"></string> <string name="force_sort_tip">\n</string> <string name="accent_color"></string> <string name="accent_color_tip"></string> <string name="dark_theme"></string> <string name="always_off"></string> <string name="always_on"></string> <string name="follow_system"></string> <string name="black_theme"></string> <string name="black_theme_tip"></string> <string name="md_back_label"></string> <string name="md_done_label"></string> <string name="md_cancel_label"></string> <string name="md_custom_label"></string> <string name="md_presets_label"></string> <string name="init_failed">%s</string> <string name="select_language"></string> <string name="select_language_tips"></string> <string name="auto"></string> <string name="zh_simple"></string> <string name="zh_traditional"></string> <string name="english"></string> <string name="japanese"></string> <string name="bass_boost"></string> <string name="virtualizer"></string> <string name="audio_focus"></string> <string name="audio_focus_tip"></string> <string name="auto_play"></string> <string name="auto_play_tip"></string> <string name="auto_play_headset_plug"></string> <string name="auto_play_open_software"></string> <string name="auto_play_none"></string> <string name="deleting"></string> <string name="adding"></string> <string name="send_log"></string> <string name="clear"></string> <string name="add"></string> <string name="clear_blacklist_title"></string> <string name="clear_blacklist_content"></string> <string name="blacklist"></string> <string name="remove_from_blacklist"></string> <string name="do_you_want_remove_from_blacklist">%s</string> <string name="blacklist_tip"></string> <string name="yes"></string> <string name="no"></string> <string name="now_playing_screen_background"></string> <string name="now_playing_screen_theme"></string> <string name="now_playing_screen_cover"></string> <string name="now_playing_screen_custom"></string> <string name="song_list_select_title_format"> %1$,d</string> <string name="grant_delete_permission_tip"></string> <string name="delete_source_fail_tip">%s</string> <string name="activity_not_found_tip"> Activity</string> <string name="lyric_font_size_normal"></string> <string name="lyric_font_size_big"></string> <string name="lyric_font_size_huge"></string> <string name="donation"></string> <string name="support_developer"></string> <string name="no_more_prompt"></string> <string name="go"></string> <string name="webdav">WebDav</string> <string name="dlna">DLNA</string> <string name="alias"></string> <string name="account"></string> <string name="pwd"></string> <string name="webdav_hint_server"></string> <string name="webdav_hint_path">()</string> <string name="can_t_be_empty">%s</string> <string name="connect"></string> <string name="edit"></string> <string name="speed_at_2x">2x</string> <string name="local_lyric_tip">Android11(DownloadsMusic)</string> <string name="buffering_wait"></string> </resources> ```
/content/code_sandbox/app/src/main/res/values-zh-rTW/strings.xml
xml
2016-01-14T13:38:47
2024-08-16T13:03:46
APlayer
rRemix/APlayer
1,308
5,180
```xml import { DOMUtils } from '@jupyterlab/apputils'; describe('@jupyterlab/apputils', () => { describe('DOMUtils', () => { describe('hasActiveEditableElement', () => { const testCases = [ // editable elements ['.input', true], ['.textarea', true], ['.div-editable', true], // non-editable elements ['.input-readonly', false], ['.textarea-readonly', false], ['.div', false] ]; const div = document.createElement('div'); div.innerHTML = ` <div class="light-host"> <input class="input" /> <input class="input-readonly" readonly /> <textarea class="textarea"></textarea> <textarea class="textarea-readonly" readonly></textarea> <div class="div" tabindex="1"></div> <div class="div-editable" contenteditable="true" tabindex="1"></div> </div> <div class="shadow-host"> </div> `; document.body.appendChild(div); const lightHost = div.querySelector('.light-host')!; const shadowHost = div.querySelector('.shadow-host')!; const shadowRoot = shadowHost.attachShadow({ mode: 'open' }); // mirror test cases from light DOM in the shadow DOM shadowRoot.innerHTML = lightHost.innerHTML; it.each(testCases)( 'should work in light DOM: `%s` element should result in `%s`', (selector, expected) => { const element = lightHost.querySelector( selector as string ) as HTMLElement; element.focus(); const result = DOMUtils.hasActiveEditableElement(div); expect(result).toBe(expected); } ); it.each(testCases)( 'should work in shadow DOM: `%s` element should result in `%s`', (selector, expected) => { const element = shadowRoot.querySelector( selector as string ) as HTMLElement; element.focus(); const result = DOMUtils.hasActiveEditableElement(div); expect(result).toBe(expected); } ); }); }); }); ```
/content/code_sandbox/packages/apputils/test/domutils.spec.ts
xml
2016-06-03T20:09:17
2024-08-16T19:12:44
jupyterlab
jupyterlab/jupyterlab
14,019
453
```xml import { EventEmitter2 } from "eventemitter2"; import React from "react"; import withContext from "./withContext"; interface Props { eventEmitter: EventEmitter2; } /** * SendReady will notify the embed that * we are ready and have setup all listeners. */ class SendReady extends React.Component<Props> { private sent = false; public componentDidMount() { if (!this.sent) { this.sent = true; this.props.eventEmitter.emit("ready", ""); } } public render() { return null; } } const enhanced = withContext(({ eventEmitter }) => ({ eventEmitter }))( SendReady ); export default enhanced; ```
/content/code_sandbox/client/src/core/client/framework/lib/bootstrap/SendReady.tsx
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
142
```xml <vector android:height="160dp" android:viewportHeight="600" android:viewportWidth="900" android:width="240dp" xmlns:android="path_to_url"> <path android:fillColor="#000" android:pathData="M0,0h900v600h-900z"/> <path android:fillColor="#fff" android:pathData="M0,0h900v400h-900z"/> <path android:fillColor="#ce1126" android:pathData="M0,0h900v200h-900z"/> <path android:fillColor="#fff" android:pathData="M450.81,302.4 L519.298,365.979 514.422,250.509C513.706,233.009 498.498,237.024 487.451,243.337 476.26,250.509 463.493,250.509 450.005,245.774 436.52,250.509 423.752,250.509 412.561,243.337 401.515,237.024 386.309,233.009 385.591,250.509L380.712,365.979 450.81,302.4Z" android:strokeColor="#c09300" android:strokeLineJoin="round" android:strokeWidth="1.27030003"/> <path android:fillColor="#c09300" android:pathData="M472.237,321.377 L478.692,327.69 476.253,266.438C474.677,266.437 470.659,266.437 470.299,266.079ZM481.846,332.507 L488.159,337.626 485.003,263.282C483.424,263.999 479.484,265.736 478.695,265.736ZM491.315,340.062 L497.77,346.371 493.752,256.966C492.178,258.544 488.16,261.7 488.16,261.7ZM500.927,348.485 L508.959,356.705 504.082,248.215C502.503,249.792 496.91,254.528 496.91,254.528ZM511.264,358.81 L519.299,365.978 514.42,250.508C512.126,248.93 507.354,246.522 506.566,246.522ZM427.763,321.377 L421.308,327.69 423.747,266.438C425.323,266.437 429.341,266.437 429.701,266.079ZM418.154,332.507 L411.841,337.626 414.997,263.282C416.576,263.999 421.31,265.72 421.31,265.72ZM408.685,340.062 L402.23,346.371 406.248,256.966C407.822,258.544 411.84,261.7 411.84,261.7ZM399.073,348.485 L391.041,356.705 395.918,248.215C397.497,249.792 403.09,254.528 403.09,254.528ZM388.736,358.81 L380.701,365.978 385.579,250.508C387.874,248.93 392.824,246.491 393.513,246.49Z"/> <path android:fillColor="#fff" android:pathData="M450,393.81C469.943,393.81 489.024,392.232 500.213,389.076 504.948,388.217 504.948,385.778 504.948,382.621 509.684,381.043 507.243,375.45 510.543,375.45 507.243,376.313 506.527,369.856 502.51,370.719 502.51,365.122 496.914,364.406 492.18,365.981 482.71,369.139 465.925,369.856 450,369.856 434.076,369.139 417.433,369.139 407.821,365.981 403.087,364.406 397.494,365.122 397.494,370.719 393.475,369.856 392.758,376.313 389.46,375.45 392.759,375.45 390.319,381.043 395.054,382.621 395.054,385.778 395.054,388.217 399.932,389.076 410.977,392.232 430.06,393.81 450,393.81Z" android:strokeColor="#c09300" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="2.37770009"/> <path android:fillColor="#c09300" android:pathData="M441.19,379.84C438.04,379.84 442.078,385.208 438.627,384.152 438.286,382.237 436.866,379.84 435.627,382.746 438.743,385.572 435.048,388.253 433.002,388.613 436.978,390.822 438.009,384.584 441.908,386.434 444.354,386.457 446.602,386.508 447.615,388.937 450.489,390.432 450.489,385.275 453.549,386.675 457.4,387.974 456.898,383.869 455.971,381.59 453.55,381.256 452.342,383.693 451.169,384.8 451.103,380.293 445.322,382.791 442.301,381.592 441.602,381.112 442.353,379.719 441.19,379.84ZM443.19,383.527C445.819,383.681 450.622,382.941 448.909,387.027 447.324,387.084 448.598,383.952 446.018,384.967 444.987,385.106 439.089,384.692 443.19,383.527ZM454.471,383.777C456.238,385.735 451.658,384.709 454.471,383.777ZM461.01,388.74C460.091,386.08 463.612,388.473 464.625,387.185 466.341,388.901 463.601,389.084 463.001,388.408 462.4,388.683 461.625,389.507 461.01,388.74ZM467.86,388.29C470.025,387.292 471.543,383.981 468.725,382.311 470.056,377.359 473.109,384.386 472.038,386.538 471.112,387.892 469.512,388.807 467.86,388.29ZM490.5,370.94C488.204,370.16 486.671,373.326 489.397,373.186 492.951,371.056 492.381,376.953 493.313,378.94 493.811,382.423 489.197,376.438 488.316,380.266 486.464,383.308 485.486,377.534 482.906,378.284 483.278,375.803 480.453,374.433 480.526,377.418 482.601,379.123 477.827,380.319 478.875,382.721 476.699,383.543 477.675,378.086 474.896,381.003 472.448,382.389 473.045,386.285 476.106,385.084 476.875,386.835 471.47,387.717 475.469,387.659 477.921,386.488 479.07,382.717 482.526,384.478 484.092,388.087 487.156,385.037 487.649,382.888 491.134,385.451 493.397,380.317 497.192,380.688 499.677,381.006 500.585,378.388 497.839,378.362 494.451,381.083 494.102,375.331 493.765,373.165 493.438,371.662 492.003,370.76 490.5,370.94ZM483.688,380.409C487.282,382.116 481.909,382.602 483.688,380.409ZM490.219,380.753C493.111,382.174 487.522,382.172 490.219,380.753ZM481.281,380.846C484.23,383.115 478.498,382.883 481.281,380.846ZM475.781,382.284C477.416,383.987 473.207,383.167 475.781,382.284ZM485.031,383.471C487.194,384.893 482.202,384.122 485.031,383.471ZM431.25,374.66C428.051,375.507 430.79,379.013 429.344,381.601 429.566,383.01 428.262,387.625 427.625,384.254 427.737,383.096 423.81,382.241 426.767,381.685 429.79,381.285 425.371,378.335 425.466,376.773 423.484,375.818 422.173,378.843 420.308,379.426 419.547,380.943 424.091,381.08 421.188,382.355 417.588,384.035 419.087,375.942 416.599,379.426 417.681,382.022 416.289,384.683 413.463,384.864 416.444,387.127 418.609,382.021 421.9,384.062 422.969,383.263 424.055,382.343 424.434,384.383 426.97,383.986 425.716,388.856 428.843,387.365 431.393,385.442 430.621,381.466 431.29,378.607 431.119,377.525 432.423,375.093 431.25,374.66ZM424.469,378.816C426.497,380.427 423.565,381.251 423.167,379.799 423.665,379.565 423.91,378.925 424.469,378.816ZM461.84,375.69C458.58,376.976 463.105,379.997 461.032,382.057 458.008,382.728 457.9,388.681 461.937,386.347 464.778,386.283 469.428,386.629 467.311,382.391 468.413,379.739 464.571,379.978 465.187,381.869 468.217,383.994 462.431,386.374 463.152,382.69 462.559,380.641 463.317,377.038 461.84,375.69ZM461.215,383.94C462.787,385.054 458.967,385.03 461.215,383.94ZM432.14,385.49C431.774,382.257 432.947,378.438 433.281,375.039 436.733,376.075 433.405,379.097 433.848,381.876 433.584,382.903 434.189,386.684 432.14,385.49ZM410.22,384.51C407.877,382.409 413.449,382.799 410.897,384.541L410.22,384.51ZM495.28,383.36C494.121,380.444 499.41,382.634 496.099,383.581L495.594,383.551 495.28,383.36ZM406.17,383.28C403.38,380.461 410.016,382.028 406.17,383.28ZM403.12,382.36C402.241,378.471 407.186,383.329 403.12,382.36ZM407.75,370.09C406.681,371.481 401.88,369.706 403.758,372.105 404.939,371.8 407.258,370.884 405.954,373.215 406.501,376.566 399.644,375.868 401.806,379.458 405.752,380.5 409.703,381.88 413.75,382.392 414.469,380.933 416.069,377.5 414.875,376.528 413.019,377.202 412.619,377.751 413.175,379.575 412.141,381.799 408.233,379.614 410.281,377.371 411.862,374.728 409.288,375.042 408.178,376.511 410.462,379.607 404.032,380.203 406.275,376.772 406.453,374.693 408.682,371.844 407.75,370.09ZM404.156,377.34C405.519,378.261 402.161,378.005 404.156,377.34ZM458.63,380.98C455.877,377.272 462.973,380.232 458.63,380.98ZM458.27,378.5C456.243,374.922 462.579,378.14 458.27,378.5ZM403.34,374.58C400.718,372.912 406.138,372.059 404.02,374.456L403.743,374.581 403.34,374.58Z" /> <path android:fillColor="#fff" android:pathData="M462.31,253.09 L461.408,249.522C463.549,251.514 469.838,251.757 469.838,251.757 465.839,249.991 461.84,236.661 462.31,226.036 462.742,215.372 460.782,211.177 459.213,209.608 457.213,207.608 450.783,205.844 446.549,205.609 444.157,205.491 444.549,207.412 444.549,207.412 440.119,206.275 435.689,205.844 433.688,207.177 431.806,208.432 431.414,214.705 432.787,213.607 436.119,210.941 439.021,213.372 441.02,216.273 442.784,218.822 442.667,226.036 440.118,234.465 437.452,243.326 430.159,252.187 430.159,252.187 434.119,252.187 439.687,248.658 439.687,248.658L438.354,254.187C442.549,252.187 445.882,249.09 445.882,249.09L449.881,253.285C451.214,251.521 453.88,249.09 453.88,249.09 456.503,250.557 458.326,251.997 462.31,253.089ZM490.6,363.545 L464.345,367.563 453.157,316.639 471.52,295.84ZM409.4,363.545 L435.655,367.563 446.843,316.639 428.48,295.84Z" android:strokeColor="#c09300" android:strokeWidth="1.21790004"/> <path android:pathData="M456.74,228.71C456.74,228.71 457.642,244.001 461.406,249.529M452.78,227.81C452.78,227.81 452.78,246.002 453.878,249.099M449.65,227.14C449.65,227.14 448.787,243.763 445.886,249.096M446.12,227.57C446.12,227.57 443.885,243.998 439.69,248.664M485.01,361.97 L479.71,354.526 476.258,365.983 471.523,357.951 468.366,367.565M455.91,332.36 L464.628,345.601M461.909,358.817 L464.699,345.619 467.135,332.196 472.975,340.105 475.536,330.986 483.711,339.371 479.554,354.622 473.816,345.187 470.66,354.799 464.77,345.637M461.91,322.95 L457.6,337.825M469.24,304.92 L466.644,329.266 458.754,318.938M477.83,318.94 L475.534,324.533 463.129,312.685M414.99,361.97 L420.29,354.526 423.742,365.983 428.477,357.951 431.634,367.565M444.09,332.36 L435.372,345.601M438.091,358.817 L435.301,345.619 432.865,332.196 427.025,340.105 424.464,330.986 416.289,339.371 420.446,354.622 426.184,345.187 429.34,354.799 435.23,345.637M438.09,322.95 L442.4,337.825M430.76,304.92 L433.356,329.266 441.246,318.938M422.17,318.94 L424.466,324.533 436.871,312.685" android:strokeColor="#c09300" android:strokeWidth="1.27040005"/> <path android:fillColor="#c09300" android:pathData="M432.44,209.26C432.714,208.358 433.146,207.535 433.695,207.182 435.694,205.849 440.125,206.28 444.555,207.417 444.555,207.417 444.163,205.496 446.554,205.614 450.789,205.849 457.219,207.613 459.218,209.613 459.689,210.123 460.238,210.868 460.708,212.004H460.63C459.65,210.632 456.866,210.711 456.199,210.789 455.14,210.907 454.474,210.867 453.062,211.22 452.396,211.377 451.376,211.573 450.828,212.004 450.396,212.357 450.043,213.651 449.377,213.651 448.318,213.651 448.397,213.377 448.122,213.063 447.769,212.632 447.573,212.004 447.22,212.044 446.123,212.24 444.358,211.377 442.124,209.613 439.889,207.848 439.026,207.417 436.125,207.613 433.263,207.848 432.361,209.456 432.361,209.456L432.44,209.26ZM442.08,219.61C441.884,218.159 441.531,217.022 441.021,216.277 439.022,213.376 436.121,210.945 432.788,213.611 432.788,213.611 433.925,210.082 436.356,209.965 438.238,209.847 442.511,211.376 446.275,217.806 446.275,217.806 443.492,217.179 442.825,217.767 441.57,218.865 442.08,219.61 442.08,219.61ZM462.773,358.815 L459.615,361.97 456.316,359.531 450.864,320.513 453.159,359.531 450.003,363.547 446.846,359.531 449.142,320.513 443.692,359.531 440.389,361.97 437.235,358.815 446.846,315.06H453.16Z" android:strokeColor="#c09300" android:strokeWidth="0.35420001"/> <path android:fillColor="#fff" android:pathData="M448.824,210.672m-1.176,0a1.176,1.176 0,1 1,2.352 0a1.176,1.176 0,1 1,-2.352 0"/> <path android:fillColor="#fff" android:pathData="M449.98,327.23C482.622,302.124 479.823,265.347 479.823,265.347 478.962,265.519 478.143,265.605 477.282,265.605 470.435,265.605 454.104,261.688 450.294,256.713 446.213,261.216 429.524,265.605 422.72,265.605 421.859,265.605 420.998,265.519 420.18,265.347 420.18,265.347 417.337,302.123 449.979,327.23Z" android:strokeColor="#c09300" android:strokeWidth="1.15020001"/> <path android:fillColor="#fff" android:pathData="M477.22,268.04C476.939,268.058 476.657,268.066 476.372,268.066 470.167,268.066 455.753,264.883 450.197,260.109 444.378,264.519 429.726,268.066 423.621,268.066 423.335,268.066 423.052,268.031 422.772,267.98 422.757,269.371 422.83,270.812 422.916,272.124 423.239,277.024 424.099,281.943 425.404,286.676 429.512,301.57 437.92,314.228 449.976,323.831 462.042,314.22 470.46,301.551 474.577,286.645 475.884,281.913 476.746,276.995 477.072,272.095 477.158,270.81 477.229,269.403 477.22,268.04Z" android:strokeColor="#c09300" android:strokeWidth="0.91570002"/> <path android:fillColor="#c09300" android:pathData="M460,314.19C466.794,306.269 471.733,296.984 474.594,286.628 475.901,281.896 476.737,276.997 477.063,272.097 477.148,270.813 477.229,269.397 477.219,268.034 476.938,268.052 476.66,268.066 476.375,268.066 472.645,268.066 460,264.94 460,264.94ZM423.63,268.061C423.344,268.061 423.067,268.019 422.786,267.967 422.772,269.358 422.856,270.813 422.943,272.124 423.265,277.024 424.106,281.923 425.411,286.655 428.176,296.68 432.918,305.687 439.38,313.436L439.38,265.03C439.38,265.03 427.151,268.061 423.63,268.061Z"/> <path android:fillColor="#fff" android:pathData="M455.12,365.98C450.388,365.98 450.857,372.294 453.153,375.45 453.153,373.155 457.168,372.294 457.168,370.718 457.169,368.276 453.542,368.276 455.12,365.98ZM477.83,375.06C477.83,371.907 474.677,372.295 474.677,369.138 474.677,367.561 475.536,365.121 477.115,365.121 478.692,365.121 480.271,366.699 480.271,368.277 480.989,371.434 477.83,371.908 477.83,375.06ZM496.91,360.39C501.788,359.529 504.084,365.122 502.505,368.277 501.787,366.699 498.488,366.699 497.771,365.122 496.91,362.685 498.489,362.685 496.91,360.39ZM444.88,365.98C449.611,365.98 449.142,372.294 446.846,375.45 446.846,373.155 442.829,372.294 442.829,370.718 442.829,368.276 446.455,368.276 444.88,365.98ZM422.17,375.06C422.17,371.907 425.324,372.295 425.324,369.138 425.324,367.561 424.466,365.121 422.888,365.121 421.309,365.121 419.73,366.699 419.73,368.277 419.013,371.434 422.17,371.908 422.17,375.06ZM403.09,360.39C398.213,359.529 395.918,365.122 397.497,368.277 398.214,366.699 401.514,366.699 402.232,365.122 403.09,362.685 401.514,362.685 403.09,360.39Z" android:strokeColor="#c09300" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.27049994"/> <path android:fillColor="#fff" android:pathData="M458.039,364.401C454.738,364.401 452.443,369.852 458.756,370.714 464.352,371.429 473.103,370.714 477.834,369.852 481.853,369.134 490.603,367.557 496.198,365.976 501.795,363.54 497.778,358.808 494.621,359.524 489.743,361.101 483.431,362.681 477.047,363.541 470.663,364.401 463.492,365.118 458.039,364.401ZM442.115,364.401C445.268,364.401 447.564,369.852 441.252,370.714 435.659,371.429 426.907,370.714 422.172,369.852 418.155,369.134 409.404,367.557 403.808,365.976 398.214,363.54 402.232,358.808 405.386,359.524 410.265,361.101 416.578,362.681 422.961,363.541 429.344,364.401 436.518,365.118 442.115,364.401Z" android:strokeColor="#c09300" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.27049994"/> <path android:fillColor="#fff" android:pathData="M473.095,367.56 L467.928,367.129C468.36,366.698 471.518,366.698 473.095,367.56ZM464.345,368.275 L459.537,367.558C460.329,367.56 463.485,367.56 464.345,368.275ZM481.855,365.985 L487.022,364.408C486.59,364.41 483.433,365.126 481.855,365.985ZM495.34,361.97C493.762,361.97 491.465,362.688 490.605,363.547ZM426.906,367.56 L432.069,367.129C431.641,366.698 428.483,366.698 426.906,367.56ZM435.657,368.275 L440.46,367.558C439.672,367.56 436.516,367.56 435.657,368.275ZM418.146,365.985 L412.979,364.408C413.412,364.41 416.568,365.126 418.146,365.985ZM409.405,363.547 L405.458,361.969C406.25,361.97 408.688,362.688 409.405,363.547Z" android:strokeColor="#c09300" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="0.8915"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_flag_eg.xml
xml
2016-07-02T10:44:04
2024-08-16T18:55:54
StreetComplete
streetcomplete/StreetComplete
3,781
7,263
```xml import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities'; import { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types'; export type ColorSwatchSlots = { root: NonNullable<Slot<'button'>>; icon?: Slot<'span'>; disabledIcon?: Slot<'span'>; }; /** * ColorSwatch Props */ export type ColorSwatchProps = ComponentProps<ColorSwatchSlots> & Pick<SwatchPickerProps, 'size' | 'shape'> & { /** * Border color when contrast is low */ borderColor?: string; /** * Swatch color */ color: string; /** * Whether the swatch is disabled */ disabled?: boolean; /** * Swatch value */ value: string; }; /** * State used in rendering ColorSwatch */ export type ColorSwatchState = ComponentState<ColorSwatchSlots> & Pick<ColorSwatchProps, 'color' | 'disabled' | 'size' | 'shape' | 'value'> & { selected: boolean; }; ```
/content/code_sandbox/packages/react-components/react-swatch-picker/library/src/components/ColorSwatch/ColorSwatch.types.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
244
```xml import { pathExists } from '../../ui/lib/path-exists' import { IFoundEditor } from './found-editor' import appPath from 'app-path' /** Represents an external editor on macOS */ interface IDarwinExternalEditor { /** Name of the editor. It will be used both as identifier and user-facing. */ readonly name: string /** * List of bundle identifiers that are used by the app in its multiple * versions. **/ readonly bundleIdentifiers: string[] } /** * This list contains all the external editors supported on macOS. Add a new * entry here to add support for your favorite editor. **/ const editors: IDarwinExternalEditor[] = [ { name: 'Atom', bundleIdentifiers: ['com.github.atom'], }, { name: 'Aptana Studio', bundleIdentifiers: ['aptana.studio'], }, { name: 'Eclipse IDE for Java Developers', bundleIdentifiers: ['epp.package.java'], }, { name: 'Eclipse IDE for Enterprise Java and Web Developers', bundleIdentifiers: ['epp.package.jee'], }, { name: 'Eclipse IDE for C/C++ Developers', bundleIdentifiers: ['epp.package.cpp'], }, { name: 'Eclipse IDE for Eclipse Committers', bundleIdentifiers: ['epp.package.committers'], }, { name: 'Eclipse IDE for Embedded C/C++ Developers', bundleIdentifiers: ['epp.package.embedcpp'], }, { name: 'Eclipse IDE for PHP Developers', bundleIdentifiers: ['epp.package.php'], }, { name: 'Eclipse IDE for Java and DSL Developers', bundleIdentifiers: ['epp.package.dsl'], }, { name: 'Eclipse IDE for RCP and RAP Developers', bundleIdentifiers: ['epp.package.rcp'], }, { name: 'Eclipse Modeling Tools', bundleIdentifiers: ['epp.package.modeling'], }, { name: 'Eclipse IDE for Scientific Computing', bundleIdentifiers: ['epp.package.parallel'], }, { name: 'Eclipse IDE for Scout Developers', bundleIdentifiers: ['epp.package.scout'], }, { name: 'MacVim', bundleIdentifiers: ['org.vim.MacVim'], }, { name: 'Neovide', bundleIdentifiers: ['com.neovide.neovide'], }, { name: 'VimR', bundleIdentifiers: ['com.qvacua.VimR'], }, { name: 'Visual Studio Code', bundleIdentifiers: ['com.microsoft.VSCode'], }, { name: 'Visual Studio Code (Insiders)', bundleIdentifiers: ['com.microsoft.VSCodeInsiders'], }, { name: 'VSCodium', bundleIdentifiers: ['com.visualstudio.code.oss', 'com.vscodium'], }, { name: 'Sublime Text', bundleIdentifiers: [ 'com.sublimetext.4', 'com.sublimetext.3', 'com.sublimetext.2', ], }, { name: 'BBEdit', bundleIdentifiers: ['com.barebones.bbedit'], }, { name: 'PhpStorm', bundleIdentifiers: ['com.jetbrains.PhpStorm'], }, { name: 'PyCharm', bundleIdentifiers: ['com.jetbrains.PyCharm'], }, { name: 'PyCharm Community Edition', bundleIdentifiers: ['com.jetbrains.pycharm.ce'], }, { name: 'DataSpell', bundleIdentifiers: ['com.jetbrains.DataSpell'], }, { name: 'RubyMine', bundleIdentifiers: ['com.jetbrains.RubyMine'], }, { name: 'RustRover', bundleIdentifiers: ['com.jetbrains.RustRover'], }, { name: 'RStudio', bundleIdentifiers: ['org.rstudio.RStudio', 'com.rstudio.desktop'], }, { name: 'TextMate', bundleIdentifiers: ['com.macromates.TextMate'], }, { name: 'Brackets', bundleIdentifiers: ['io.brackets.appshell'], }, { name: 'WebStorm', bundleIdentifiers: ['com.jetbrains.WebStorm'], }, { name: 'CLion', bundleIdentifiers: ['com.jetbrains.CLion'], }, { name: 'Typora', bundleIdentifiers: ['abnerworks.Typora'], }, { name: 'CodeRunner', bundleIdentifiers: ['com.krill.CodeRunner'], }, { name: 'SlickEdit', bundleIdentifiers: [ 'com.slickedit.SlickEditPro2018', 'com.slickedit.SlickEditPro2017', 'com.slickedit.SlickEditPro2016', 'com.slickedit.SlickEditPro2015', ], }, { name: 'IntelliJ', bundleIdentifiers: ['com.jetbrains.intellij'], }, { name: 'IntelliJ Community Edition', bundleIdentifiers: ['com.jetbrains.intellij.ce'], }, { name: 'Xcode', bundleIdentifiers: ['com.apple.dt.Xcode'], }, { name: 'GoLand', bundleIdentifiers: ['com.jetbrains.goland'], }, { name: 'Android Studio', bundleIdentifiers: ['com.google.android.studio'], }, { name: 'Rider', bundleIdentifiers: ['com.jetbrains.rider'], }, { name: 'Nova', bundleIdentifiers: ['com.panic.Nova'], }, { name: 'Emacs', bundleIdentifiers: ['org.gnu.Emacs'], }, { name: 'Lite XL', bundleIdentifiers: ['com.lite-xl'], }, { name: 'Fleet', bundleIdentifiers: ['Fleet.app'], }, { name: 'Pulsar', bundleIdentifiers: ['dev.pulsar-edit.pulsar'], }, { name: 'Zed', bundleIdentifiers: ['dev.zed.Zed'], }, { name: 'Zed (Preview)', bundleIdentifiers: ['dev.zed.Zed-Preview'], }, { name: 'Cursor', bundleIdentifiers: ['com.todesktop.230313mzl4w4u92'], }, ] async function findApplication( editor: IDarwinExternalEditor ): Promise<string | null> { for (const identifier of editor.bundleIdentifiers) { try { // app-path not finding the app isn't an error, it just means the // bundle isn't registered on the machine. // path_to_url#L7-L13 const installPath = await appPath(identifier).catch(e => e.message === "Couldn't find the app" ? Promise.resolve(null) : Promise.reject(e) ) if (installPath && (await pathExists(installPath))) { return installPath } log.debug( `App installation for ${editor.name} not found at '${installPath}'` ) } catch (error) { log.debug(`Unable to locate ${editor.name} installation`, error) } } return null } /** * Lookup known external editors using the bundle ID that each uses * to register itself on a user's machine when installing. */ export async function getAvailableEditors(): Promise< ReadonlyArray<IFoundEditor<string>> > { const results: Array<IFoundEditor<string>> = [] for (const editor of editors) { const path = await findApplication(editor) if (path) { results.push({ editor: editor.name, path }) } } return results } ```
/content/code_sandbox/app/src/lib/editors/darwin.ts
xml
2016-05-11T15:59:00
2024-08-16T17:00:41
desktop
desktop/desktop
19,544
1,743
```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. */ // TypeScript Version: 4.1 /// <reference types="node"/> /// <reference types="@stdlib/types"/> import { Readable } from 'stream'; import * as random from '@stdlib/types/random'; /** * Interface defining stream options. */ interface Options { /** * Specifies whether a stream should operate in object mode (default: `false`). */ objectMode?: boolean; /** * Specifies how `Buffer` objects should be decoded to strings (default: `null`). */ encoding?: string | null; /** * Specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers. */ highWaterMark?: number; /** * Separator used to join streamed data (default: `'\n'`). */ sep?: string; /** * Number of iterations. */ iter?: number; /** * Pseudorandom number generator which generates uniformly distributed pseudorandom numbers. */ prng?: random.PRNG; /** * Pseudorandom number generator seed. */ seed?: random.PRNGSeedMT19937; /** * Pseudorandom number generator state. */ state?: random.PRNGStateMT19937; /** * Specifies whether to copy a provided pseudorandom number generator state (default: `true`). */ copy?: boolean; /** * Number of iterations after which to emit the PRNG state. */ siter?: number; } /** * Class for creating readable streams which generate a stream of pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. */ declare class RandomStream extends Readable { /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. * * @param a - first shape parameter * @param b - second shape parameter * @param options - stream options * @throws `a` must be a positive number * @throws `b` must be a positive number * @throws must provide valid options * @throws must provide a valid state * @returns stream instance * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( chunk ) { * console.log( chunk.toString() ); * } * * var opts = { * 'iter': 10 * }; * * var stream = new RandomStream( 2.0, 5.0, opts ); * * stream.pipe( inspectStream( log ) ); */ constructor( a: number, b: number, options?: Options ); /** * Destruction state. */ private readonly _destroyed: boolean; /** * Flag indicating whether a stream is operating in object mode. */ private readonly _objectMode: boolean; /** * Data separator. */ private readonly _sep: string; /** * Total number of iterations. */ private readonly _iter: number; /** * Number of iterations after which to emit the underlying PRNG state. */ private readonly _siter: number; /** * Iteration counter. */ private _i: number; /** * Pseudorandom number generator for generating pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. */ private readonly _prng: random.PRNG; /** * Underlying PRNG. */ readonly PRNG: random.PRNG; /** * PRNG seed. */ readonly seed: random.PRNGSeedMT19937; /** * PRNG seed length. */ readonly seedLength: number; /** * PRNG state. */ state: random.PRNGStateMT19937; /** * PRNG state length. */ readonly stateLength: number; /** * PRNG state size (in bytes). */ readonly byteLength: number; /** * Implements the `_read` method. * * @param size - number (of bytes) to read */ _read( size: number ): void; /** * Gracefully destroys a stream, providing backward compatibility. * * @param error - error * * @example * var stream = new RandomStream( 2.0, 5.0 ); * stream.on( 'error', onError ); * * function onError( err ) { * stream.destroy( err ); * } */ destroy( error?: Error ): void; } /** * Interface defining a stream constructor which is both "newable" and "callable". */ interface Constructor { /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. * * @param a - first shape parameter * @param b - second shape parameter * @param options - stream options * @throws `a` must be a positive number * @throws `b` must be a positive number * @throws must provide valid options * @throws must provide a valid state * @returns stream instance * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( chunk ) { * console.log( chunk.toString() ); * } * * var opts = { * 'iter': 10 * }; * * var stream = new RandomStream( 2.0, 5.0, opts ); * * stream.pipe( inspectStream( log ) ); */ new( a: number, b: number, options?: Options ): RandomStream; // newable /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. * * @param a - first shape parameter * @param b - second shape parameter * @param options - stream options * @throws `a` must be a positive number * @throws `b` must be a positive number * @throws must provide valid options * @throws must provide a valid state * @returns stream instance * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( chunk ) { * console.log( chunk.toString() ); * } * * var opts = { * 'iter': 10 * }; * * var stream = randomStream( 2.0, 5.0, opts ); * * stream.pipe( inspectStream( log ) ); */ ( a: number, b: number, options?: Options ): RandomStream; // callable /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. * * @param a - first shape parameter * @param b - second shape parameter * @param options - stream options * @returns factory function * * @example * var opts = { * 'sep': ',', * 'objectMode': false, * 'encoding': 'utf8', * 'highWaterMark': 64 * }; * * var createStream = RandomStream.factory( 2.0, 5.0, opts ); * * // Create 10 identically configured streams... * var streams = []; * var i; * for ( i = 0; i < 10; i++ ) { * streams.push( createStream() ); * } */ factory( a: number, b: number, options?: Options ): ( ...args: Array<any> ) => RandomStream; /** * Returns a function for creating readable streams which generate pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. * * @param options - stream options * @returns factory function * * @example * var opts = { * 'sep': ',', * 'objectMode': false, * 'encoding': 'utf8', * 'highWaterMark': 64 * }; * * var createStream = RandomStream.factory( opts ); * * // Create 10 identically configured streams... * var streams = []; * var i; * for ( i = 0; i < 10; i++ ) { * streams.push( createStream( 2.0, 5.0 ) ); * } */ factory( options?: Options ): ( a: number, b: number ) => RandomStream; /** * Returns an "objectMode" readable stream for generating a stream of pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. * * @param a - first shape parameter * @param b - second shape parameter * @param options - stream options * @throws `a` must be a positive number * @throws `b` must be a positive number * @throws must provide valid options * @throws must provide a valid state * @returns stream instance * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( v ) { * console.log( v ); * } * * var opts = { * 'iter': 10 * }; * * var stream = RandomStream.objectMode( 2.0, 5.0, opts ); * * stream.pipe( inspectStream.objectMode( log ) ); */ objectMode( a: number, b: number, options?: Options ): RandomStream; } /** * Returns a readable stream for generating a stream of pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. * * @param a - first shape parameter * @param b - second shape parameter * @param options - stream options * @throws `a` must be a positive number * @throws `b` must be a positive number * @throws must provide valid options * @throws must provide a valid state * @returns stream instance * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( chunk ) { * console.log( chunk.toString() ); * } * * var opts = { * 'iter': 10 * }; * * var stream = randomStream( 2.0, 5.0, opts ); * * stream.pipe( inspectStream( log ) ); * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( chunk ) { * console.log( chunk.toString() ); * } * * var opts = { * 'iter': 10 * }; * * var RandomStream = randomStream; * var stream = new RandomStream( 2.0, 5.0, opts ); * * stream.pipe( inspectStream( log ) ); * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( v ) { * console.log( v ); * } * * var opts = { * 'iter': 10 * }; * * var stream = randomStream.objectMode( 2.0, 5.0, opts ); * * stream.pipe( inspectStream.objectMode( log ) ); * * @example * var opts = { * 'sep': ',', * 'objectMode': false, * 'encoding': 'utf8', * 'highWaterMark': 64 * }; * * var createStream = randomStream.factory( 2.0, 5.0, opts ); * * // Create 10 identically configured streams... * var streams = []; * var i; * for ( i = 0; i < 10; i++ ) { * streams.push( createStream() ); * } * * @example * var opts = { * 'sep': ',', * 'objectMode': false, * 'encoding': 'utf8', * 'highWaterMark': 64 * }; * * var createStream = randomStream.factory( opts ); * * // Create 10 identically configured streams... * var streams = []; * var i; * for ( i = 0; i < 10; i++ ) { * streams.push( createStream( 2.0, 5.0 ) ); * } */ declare var randomStream: Constructor; // EXPORTS // export = randomStream; ```
/content/code_sandbox/lib/node_modules/@stdlib/random/streams/kumaraswamy/docs/types/index.d.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
2,847
```xml import { FeatureStatus, FindNativeFeature, NoteType, GetIframeAndNativeEditors, ComponentArea, GetSuperNoteFeature, UIFeature, IframeComponentFeatureDescription, Uuid, NativeFeatureIdentifier, } from '@standardnotes/snjs' import { EditorMenuGroup } from '@/Components/NotesOptions/EditorMenuGroup' import { EditorMenuItem } from '@/Components/NotesOptions/EditorMenuItem' import { SuperEditorMetadata } from '@/Constants/Constants' import { WebApplicationInterface } from '@standardnotes/ui-services' type NoteTypeToEditorRowsMap = Record<NoteType, EditorMenuItem[]> const insertNativeEditorsInMap = (map: NoteTypeToEditorRowsMap, application: WebApplicationInterface): void => { for (const editorFeature of GetIframeAndNativeEditors()) { const isExperimental = application.features.isExperimentalFeature(editorFeature.identifier) if (isExperimental) { continue } if (editorFeature.deprecated) { continue } const noteType = editorFeature.note_type map[noteType].push({ isEntitled: application.features.getFeatureStatus(NativeFeatureIdentifier.create(editorFeature.identifier).getValue()) === FeatureStatus.Entitled, uiFeature: new UIFeature(editorFeature), }) } } const insertInstalledComponentsInMap = (map: NoteTypeToEditorRowsMap, application: WebApplicationInterface) => { const thirdPartyOrInstalledEditors = application.componentManager .thirdPartyComponentsForArea(ComponentArea.Editor) .sort((a, b) => { return a.displayName.toLowerCase() < b.displayName.toLowerCase() ? -1 : 1 }) for (const editor of thirdPartyOrInstalledEditors) { const nativeFeature = FindNativeFeature(editor.identifier) as IframeComponentFeatureDescription if (nativeFeature) { map[nativeFeature.note_type].push({ isEntitled: application.features.getFeatureStatus(NativeFeatureIdentifier.create(nativeFeature.identifier).getValue()) === FeatureStatus.Entitled, uiFeature: new UIFeature(nativeFeature), }) continue } const noteType = editor.noteType const editorItem: EditorMenuItem = { uiFeature: new UIFeature<IframeComponentFeatureDescription>(editor), isEntitled: application.features.getFeatureStatus(Uuid.create(editor.uuid).getValue()) === FeatureStatus.Entitled, } map[noteType].push(editorItem) } } const createGroupsFromMap = (map: NoteTypeToEditorRowsMap): EditorMenuGroup[] => { const superNote = GetSuperNoteFeature() const groups: EditorMenuGroup[] = [ { icon: SuperEditorMetadata.icon, iconClassName: SuperEditorMetadata.iconClassName, title: superNote.name, items: map[NoteType.Super], featured: true, }, { icon: 'rich-text', iconClassName: 'text-accessory-tint-1', title: 'Rich text', items: map[NoteType.RichText], }, { icon: 'markdown', iconClassName: 'text-accessory-tint-2', title: 'Markdown text', items: map[NoteType.Markdown], }, { icon: 'tasks', iconClassName: 'text-accessory-tint-3', title: 'Todo', items: map[NoteType.Task], }, { icon: 'code', iconClassName: 'text-accessory-tint-4', title: 'Code', items: map[NoteType.Code], }, { icon: 'spreadsheets', iconClassName: 'text-accessory-tint-5', title: 'Spreadsheet', items: map[NoteType.Spreadsheet], }, { icon: 'authenticator', iconClassName: 'text-accessory-tint-6', title: 'Authentication', items: map[NoteType.Authentication], }, { icon: 'plain-text', iconClassName: 'text-accessory-tint-1', title: 'Plain text', items: map[NoteType.Plain], }, { icon: 'editor', iconClassName: 'text-neutral', title: 'Others', items: map[NoteType.Unknown], }, ] return groups } const createBaselineMap = (): NoteTypeToEditorRowsMap => { const map: NoteTypeToEditorRowsMap = { [NoteType.Plain]: [], [NoteType.Super]: [], [NoteType.RichText]: [], [NoteType.Markdown]: [], [NoteType.Task]: [], [NoteType.Code]: [], [NoteType.Spreadsheet]: [], [NoteType.Authentication]: [], [NoteType.Unknown]: [], } return map } export const createEditorMenuGroups = (application: WebApplicationInterface): EditorMenuGroup[] => { const map = createBaselineMap() insertNativeEditorsInMap(map, application) insertInstalledComponentsInMap(map, application) return createGroupsFromMap(map) } ```
/content/code_sandbox/packages/web/src/javascripts/Utils/createEditorMenuGroups.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
1,094
```xml import { foldTo } from 'fractal-objects'; import { merge } from 'lodash'; import { ApolloLink } from 'apollo-link'; import { ApolloClient } from 'apollo-client'; import { ConnectionParamsOptions } from 'subscriptions-transport-ws'; import { IResolvers } from 'graphql-tools'; import CommonModule, { CommonModuleShape } from './CommonModule'; /** * A function to create non-network Apollo Link that wraps in some way network link. * There can be multiple non-network links. * * @param getApolloClient a function that the link can call later to get instance of Apollo Client * * @returns Apollo Link instance */ export type CreateApolloLink = (getApolloClient: () => ApolloClient<any>) => ApolloLink; /** * A function to create Apollo GraphQL link which is used for network communication. * The network link can be only one. * * @param apiUrl the URL to GraphQL server endpoint * @param getApolloClient a function that the link can call later to get instance of Apollo Client * * @returns Apollo Link instance */ export type CreateNetLink = (apiUrl: string, getApolloClient: () => ApolloClient<any>) => ApolloLink; /** * Apollo Link State default state and client resolvers */ export interface ApolloLinkStateParams { // Default state defaults: { [key: string]: any }; // Client-side resolvers resolvers: IResolvers; } /** * Client-side GraphQL feature module interface. */ export interface GraphQLModuleShape extends CommonModuleShape { // Array of functions to create non-network Apollo Link createLink?: CreateApolloLink[]; // A singleton to create network link createNetLink?: CreateNetLink; // `subscription-transport-ws` WebSocket connection options connectionParam?: ConnectionParamsOptions[]; // Apollo Link State default state and client resolvers resolver?: ApolloLinkStateParams[]; } /** * Common GraphQL client-side modules ancestor for feature modules of a GraphQL application. */ class GraphQLModule extends CommonModule implements GraphQLModuleShape { // Array of functions to create non-network Apollo Link createLink?: CreateApolloLink[]; // A singleton to create network link createNetLink?: CreateNetLink; // `subscription-transport-ws` WebSocket connection options connectionParam?: ConnectionParamsOptions[]; // Apollo Link State default state and client resolvers resolver?: ApolloLinkStateParams[]; /** * Constructs GraphQL feature module representation, that folds all the feature modules * into a single module represented by this instance. * * @param modules feature modules */ constructor(...modules: GraphQLModuleShape[]) { super(...modules); foldTo(this, modules); } /** * @returns Apollo Link State client-side resolvers */ get resolvers() { return merge({}, ...(this.resolver || [])); } /** * @returns `subscription-transport-ws` WebSocket connection options */ get connectionParams() { return this.connectionParam || []; } } export default GraphQLModule; ```
/content/code_sandbox/modules/module/common/GraphQLModule.ts
xml
2016-09-08T16:44:45
2024-08-16T06:17:16
apollo-universal-starter-kit
sysgears/apollo-universal-starter-kit
1,684
646
```xml import path from "path"; const templates = Object.freeze({ indexTemplate: path.resolve( "./src/templates/IndexTemplate/IndexTemplate.tsx", ), notFoundTemplate: path.resolve( "./src/templates/NotFoundTemplate/NotFoundTemplate.tsx", ), categoryTemplate: path.resolve( "./src/templates/CategoryTemplate/CategoryTemplate.tsx", ), categoriesTemplate: path.resolve( "./src/templates/CategoriesTemplate/CategoriesTemplate.tsx", ), tagTemplate: path.resolve("./src/templates/TagTemplate/TagTemplate.tsx"), tagsTemplate: path.resolve("./src/templates/TagsTemplate/TagsTemplate.tsx"), pageTemplate: path.resolve("./src/templates/PageTemplate/PageTemplate.tsx"), postTemplate: path.resolve("./src/templates/PostTemplate/PostTemplate.tsx"), }); export default templates; ```
/content/code_sandbox/internal/gatsby/constants/templates.ts
xml
2016-03-11T21:02:37
2024-08-15T23:09:27
gatsby-starter-lumen
alxshelepenok/gatsby-starter-lumen
1,987
175
```xml <View frame="0, 0, sys.contW, sys.contH/5" css="{flex-direction='column'}" bg="0xffffff"> <Text id="item" css="{flex=1, margin=15}" fontSize="25"></Text> <Text id="subitem" css="{flex=1, margin-left=30, margin-right=15, margin-bottom=15}" fontSize="16"></Text> </View> ```
/content/code_sandbox/IOS/Playground/Playground/playground/demo.xml
xml
2016-01-07T08:55:50
2024-08-16T13:34:26
LuaViewSDK
alibaba/LuaViewSDK
3,733
93
```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="M18.05,33.61a1,1,0,0,1-1-1V3.37a1,1,0,1,1,1.95,0V32.63A1,1,0,0,1,18.05,33.61Z"/><path d="M18.06,10.07,14.52,6.54a1,1,0,0,1,0-1.41,1,1,0,0,1,1.41,0l2.13,2.12,2.12-2.12a1,1,0,0,1,1.41,0,1,1,0,0,1,0,1.41Z"/><path d="M20.85,31.17a1,1,0,0,1-.7-.29L18,28.76,15.9,30.88a1,1,0,0,1-1.41,0,1,1,0,0,1,0-1.42L18,25.93l3.54,3.53a1,1,0,0,1,0,1.42A1,1,0,0,1,20.85,31.17Z"/><path d="M30.92,26.5a1,1,0,0,1-.5-.13l-26-15A1,1,0,0,1,4.07,10a1,1,0,0,1,1.37-.36l26,15a1,1,0,0,1-.5,1.87Z"/><path d="M6,15.37a1,1,0,0,1-.26-2l2.9-.78L7.84,9.73a1,1,0,1,1,1.93-.52L11.07,14,6.24,15.33A.82.82,0,0,1,6,15.37Z"/><path d="M27.05,27.54a1,1,0,0,1-1-.75L24.8,22l4.82-1.3a1,1,0,1,1,.52,1.93l-2.9.78.78,2.9a1,1,0,0,1-.71,1.22A.75.75,0,0,1,27.05,27.54Z"/><path d="M4.94,26.5a1,1,0,0,1-.5-1.87l26-15a1,1,0,0,1,1.36.36,1,1,0,0,1-.36,1.37l-26,15A1,1,0,0,1,4.94,26.5Z"/><path d="M8.81,27.54a.75.75,0,0,1-.26,0,1,1,0,0,1-.71-1.22l.78-2.9-2.9-.78A1,1,0,0,1,5,21.38a1,1,0,0,1,1.23-.71L11.07,22l-1.3,4.82A1,1,0,0,1,8.81,27.54Z"/><path d="M29.88,15.37a.82.82,0,0,1-.26,0L24.8,14l1.29-4.83A1,1,0,1,1,28,9.73l-.78,2.89,2.9.78a1,1,0,0,1-.26,2Z"/>', }; export const snowflakeIconName = 'snowflake'; export const snowflakeIcon: IconShapeTuple = [snowflakeIconName, renderIcon(icon)]; ```
/content/code_sandbox/packages/core/src/icon/shapes/snowflake.ts
xml
2016-09-29T17:24:17
2024-08-11T17:06:15
clarity
vmware-archive/clarity
6,431
957
```xml import { Pipe, PipeTransform } from '@angular/core'; import * as _ from 'lodash'; @Pipe({ name: 'replace' }) export class ReplacePipe implements PipeTransform { transform(value: any, searchValue: string | RegExp, replaceValue: string): any { if (!_.isString(value) || _.isUndefined(searchValue) || _.isUndefined(replaceValue)) { return value; } return value.replace(searchValue, replaceValue); } } ```
/content/code_sandbox/deb/openmediavault/workbench/src/app/shared/pipes/replace.pipe.ts
xml
2016-05-03T10:35:34
2024-08-16T08:03:04
openmediavault
openmediavault/openmediavault
4,954
102
```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. --> <beans xmlns="path_to_url" xmlns:xsi="path_to_url" xmlns:motan="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"> <context:component-scan base-package="com.weibo.motan.demo"/> <motan:annotation package="com.weibo.motan.demo.client"/> </beans> ```
/content/code_sandbox/motan-demo/motan-demo-client/src/main/resources/motan_demo_client_annotation.xml
xml
2016-04-20T10:56:17
2024-08-16T01:20:43
motan
weibocom/motan
5,882
170
```xml /* eslint-disable @typescript-eslint/no-var-requires */ import * as Path from "path"; const webpack = require("webpack"); import { loadXarcOptions } from "../util/load-xarc-options"; module.exports = function() { const xarcOptions = loadXarcOptions(); const xarcCwd = xarcOptions.cwd; return { plugins: [ new webpack.DllPlugin({ name: "[name]_[hash]", path: Path.resolve(xarcCwd, "dll/js/[name]-manifest.[hash].json") }) ] }; }; ```
/content/code_sandbox/packages/xarc-webpack/src/partials/dll.ts
xml
2016-09-06T19:02:39
2024-08-11T11:43:11
electrode
electrode-io/electrode
2,103
123
```xml <dict> <key>LayoutID</key> <integer>2</integer> <key>PathMapRef</key> <array> <dict> <key>CodecID</key> <array> <integer>283904135</integer> </array> <key>Headphone</key> <dict/> <key>Inputs</key> <array> <string>Mic</string> <string>LineIn</string> </array> <key>IntSpeaker</key> <dict/> <key>LineIn</key> <dict> <key>MuteGPIO</key> <integer>1342242841</integer> </dict> <key>LineOut</key> <dict/> <key>Mic</key> <dict> <key>MuteGPIO</key> <integer>1342242840</integer> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspNoiseReduction</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>0</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>-1111411312</integer> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspEqualization32</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1120723891</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>0</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>1</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1133968303</integer> <key>7</key> <integer>1084477243</integer> <key>8</key> <integer>-1080988787</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>2</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1150664980</integer> <key>7</key> <integer>1098102506</integer> <key>8</key> <integer>-1073195820</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>3</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1148869092</integer> <key>7</key> <integer>1091475860</integer> <key>8</key> <integer>-1076223660</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1142287878</integer> <key>7</key> <integer>1085842969</integer> <key>8</key> <integer>-1079797505</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1171916736</integer> <key>7</key> <integer>1096762195</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>6</integer> <key>6</key> <integer>1184316119</integer> <key>7</key> <integer>1109056511</integer> <key>8</key> <integer>-1045200702</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>7</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1139168842</integer> <key>7</key> <integer>1089375144</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1169906445</integer> <key>7</key> <integer>1092320018</integer> <key>8</key> <integer>-1086994832</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1174300519</integer> <key>7</key> <integer>1100485297</integer> <key>8</key> <integer>-1084612268</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>10</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1153948405</integer> <key>7</key> <integer>1086231536</integer> <key>8</key> <integer>-1079797505</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1120723891</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>0</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>1</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1133968303</integer> <key>7</key> <integer>1084477243</integer> <key>8</key> <integer>-1080988787</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>2</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1150664980</integer> <key>7</key> <integer>1098102506</integer> <key>8</key> <integer>-1073195820</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>3</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1148869092</integer> <key>7</key> <integer>1091475860</integer> <key>8</key> <integer>-1076223660</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1142287878</integer> <key>7</key> <integer>1085842969</integer> <key>8</key> <integer>-1079797505</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1171916736</integer> <key>7</key> <integer>1096762195</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>6</integer> <key>6</key> <integer>1184316119</integer> <key>7</key> <integer>1109056511</integer> <key>8</key> <integer>-1045200702</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>7</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1139168842</integer> <key>7</key> <integer>1089375144</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1169906445</integer> <key>7</key> <integer>1092320018</integer> <key>8</key> <integer>-1086994832</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1174300519</integer> <key>7</key> <integer>1100485297</integer> <key>8</key> <integer>-1084612268</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>10</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1153948405</integer> <key>7</key> <integer>1086231536</integer> <key>8</key> <integer>-1079797505</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>2</integer> <key>DspFuncName</key> <string>DspGainStage</string> <key>DspFuncProcessingIndex</key> <integer>2</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1065353216</integer> <key>3</key> <integer>1065353216</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction3</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>3</integer> <key>DspFuncName</key> <string>DspMultibandDRC</string> <key>DspFuncProcessingIndex</key> <integer>3</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Crossover</key> <dict> <key>4</key> <integer>1</integer> <key>5</key> <integer>0</integer> <key>6</key> <integer>1128792064</integer> </dict> <key>Limiter</key> <array> <dict> <key>10</key> <integer>-1068807345</integer> <key>11</key> <integer>1097982434</integer> <key>12</key> <integer>-1038380141</integer> <key>13</key> <integer>1068906038</integer> <key>14</key> <integer>-1036233644</integer> <key>15</key> <integer>1065353216</integer> <key>16</key> <integer>1101004800</integer> <key>17</key> <integer>1101004800</integer> <key>18</key> <integer>1128792064</integer> <key>19</key> <integer>1101004800</integer> <key>2</key> <integer>1</integer> <key>20</key> <integer>1127866850</integer> <key>21</key> <integer>0</integer> <key>22</key> <integer>0</integer> <key>23</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>7</key> <integer>0</integer> <key>8</key> <integer>0</integer> <key>9</key> <integer>0</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>2</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>2</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>Outputs</key> <array> <string>Headphone</string> <string>IntSpeaker</string> <string>LineOut</string> <string>SPDIFOut</string> </array> <key>PathMapID</key> <integer>200</integer> <key>SPDIFOut</key> <dict/> </dict> </array> </dict> ```
/content/code_sandbox/Resources/ALC887/layout2.xml
xml
2016-03-07T20:45:58
2024-08-14T08:57:03
AppleALC
acidanthera/AppleALC
3,420
5,404