text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="tag_first"></item>
</resources>
``` | /content/code_sandbox/library/photoPicker/src/main/res/values/ids.xml | xml | 2016-09-26T09:42:41 | 2024-08-12T07:09:06 | AndroidFire | jaydenxiao2016/AndroidFire | 2,634 | 35 |
```xml
import { Range } from 'slate'
export const input = true
export const test = value => {
return Range.isRange(value)
}
export const output = false
``` | /content/code_sandbox/packages/slate/test/interfaces/Range/isRange/boolean.tsx | xml | 2016-06-18T01:52:42 | 2024-08-16T18:43:42 | slate | ianstormtaylor/slate | 29,492 | 37 |
```xml
<?xml version="1.0" ?>
<protocol>
<decodings/>
<participants>
<participant address_hex="313370" color_index="0" id="2578de59-87e2-4545-8b81-292751355445" name="Alice" relative_rssi="0" shortname="A" simulate="0"/>
<participant address_hex="031337" color_index="0" id="7e3df95a-3351-4587-bae1-63aa68c777a8" name="Bob" relative_rssi="0" shortname="B" simulate="0"/>
<participant address_hex="110000" color_index="0" id="6949072a-7077-4218-8abe-e558c89871b8" name="Charly" relative_rssi="0" shortname="C" simulate="0"/>
<participant address_hex="001100" color_index="0" id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" name="Daniel" relative_rssi="0" shortname="D" simulate="0"/>
</participants>
<messages>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hash11000000" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7447739"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7448528"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hash0100111011001110100000111111000101101110" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7453322"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.745404"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hash10011100" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.745555"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7456198"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hash1110011011111111110111101101110101010101" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7460933"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7461617"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hash00101001" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7463086"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7463715"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hash1110001111110110100101101111101111001100" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7468488"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.7469163"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hash01111110" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.747066"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7471309"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hash1110011010111111101001001000011111100011" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7476048"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7476716"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hash00001001" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.7478194"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.7478826"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hash0101100000010111000110001011100101010001" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="7e3df95a-3351-4587-bae1-63aa68c777a8" pause="0" timestamp="1555684618.748354"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.748421"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hash01101101" message_type_id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" modulator_index="0" participant_id="6949072a-7077-4218-8abe-e558c89871b8" pause="0" timestamp="1555684618.7485673"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7486312"/>
<message bits=your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hash0100110100101011000110111100001010110010" message_type_id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" modulator_index="0" participant_id="17d6bce9-d7aa-4e80-87f8-352dbabd6029" pause="0" timestamp="1555684618.7491055"/>
<message bits=your_sha256_hash message_type_id="6479c599-6f89-488f-ae56-8fae07b0d9b0" modulator_index="0" participant_id="2578de59-87e2-4545-8b81-292751355445" pause="0" timestamp="1555684618.749173"/>
</messages>
<message_types>
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="5194fc77-7da3-4e08-a61c-1c8f980a9fc3" name="data">
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="16" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="32" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="16"/>
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="40" fuzz_me="2" fuzz_values="" name="length" show="2" start="32"/>
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="source address" show="2" start="64"/>
<label apply_decoding="True" auto_created="False" color_index="5" display_bit_order_index="0" display_endianness="big" display_format_index="3" end="120" fuzz_me="2" fuzz_values="" name="sequence number" show="2" start="88"/>
<label apply_decoding="True" auto_created="False" color_index="6" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="184" fuzz_me="2" fuzz_values="" name="data" show="2" start="120"/>
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="7" data_ranges="[(32, 184)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="200" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="184">
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
</checksum_label>
<ruleset mode="0"/>
</message_type>
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="6479c599-6f89-488f-ae56-8fae07b0d9b0" name="ack">
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="8" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="24" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="8"/>
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="48" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="24"/>
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="3" data_ranges="[(24, 48)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="48">
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
</checksum_label>
<ruleset mode="0"/>
</message_type>
<message_type assigned_by_logic_analyzer="0" assigned_by_ruleset="0" id="88ce6fdc-5286-4ebb-8394-5e79a48614ba" name="kex">
<label apply_decoding="True" auto_created="False" color_index="0" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="24" fuzz_me="2" fuzz_values="" name="preamble" show="2" start="0"/>
<label apply_decoding="True" auto_created="False" color_index="1" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="40" fuzz_me="2" fuzz_values="" name="synchronization" show="2" start="24"/>
<label apply_decoding="True" auto_created="False" color_index="2" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="64" fuzz_me="2" fuzz_values="" name="destination address" show="2" start="40"/>
<label apply_decoding="True" auto_created="False" color_index="3" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="88" fuzz_me="2" fuzz_values="" name="source address" show="2" start="64"/>
<label apply_decoding="True" auto_created="False" color_index="4" display_bit_order_index="0" display_endianness="big" display_format_index="0" end="600" fuzz_me="2" fuzz_values="" name="data" show="2" start="88"/>
<checksum_label apply_decoding="True" auto_created="False" category="generic" color_index="5" data_ranges="[(40, 600)]" display_bit_order_index="0" display_endianness="big" display_format_index="1" end="616" fuzz_me="2" fuzz_values="" name="checksum" show="2" start="600">
<crc final_xor="0000000000000000" polynomial="11000000000000101" ref_in="0" ref_out="0" start_value="1111111111111111"/>
</checksum_label>
<ruleset mode="0"/>
</message_type>
</message_types>
</protocol>
``` | /content/code_sandbox/tests/data/four_participants.proto.xml | xml | 2016-04-01T19:43:07 | 2024-08-16T09:11:09 | urh | jopohl/urh | 10,727 | 4,175 |
```xml
import * as $ from 'jquery';
export default class spservices{
constructor(){
}
/*check if user is a member of the group, using SP rest
*/
public async isMember(groupName: string, userId: string, webAbsoluteUrl): Promise<any> {
var p = new Promise<any>((resolve, reject) => {
$.ajax({
url: webAbsoluteUrl + "/_api/web/sitegroups/getByName('" + groupName + "')/Users?$filter=Id eq " + userId,
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: (data) => {
if (data.d.results[0] != undefined) {
resolve(true);
}
else {
reject(false);
}
},
error: (error) => {
reject(false);
},
});
});
return p;
}
}
``` | /content/code_sandbox/samples/react-target-audience/src/service/spservices.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 195 |
```xml
import { deepMix } from '@antv/util';
type Adapter<T> = (options: T, ...rest: any[]) => T;
/**
* Adaptor return default options for raw options.
*/
export function useDefaultAdaptor<T>(adaptor: Adapter<T>): Adapter<T> {
return (options?, ...rest) => deepMix({}, adaptor(options, ...rest), options);
}
/**
* Adaptor return options override raw options.
*/
export function useOverrideAdaptor<T>(adaptor: Adapter<T>): Adapter<T> {
return (options?, ...rest) => deepMix({}, options, adaptor(options, ...rest));
}
export function isObject(d) {
if (d instanceof Date) return false;
return typeof d === 'object';
}
export function mergeData(
dataDescriptor: any[] | { value: any; [key: string]: any },
dataValue: any[],
) {
if (!dataDescriptor) return dataValue;
if (Array.isArray(dataDescriptor)) return dataDescriptor;
if (isObject(dataDescriptor)) {
const { value = dataValue, ...rest } = dataDescriptor;
return { ...rest, value };
}
return dataDescriptor;
}
``` | /content/code_sandbox/src/composition/utils.ts | xml | 2016-05-26T09:21:04 | 2024-08-15T16:11:17 | G2 | antvis/G2 | 12,060 | 250 |
```xml
export type LoadableMeta = Partial<
Record<'isLoading' | 'isReady' | 'hasError', boolean>
> &
Partial<{
error: string;
}>;
export type Loadable<T> = LoadableMeta & {
data?: T;
};
export type EmptyPayloadKeyCreator = () => string;
export type KeyCreator<P> = (payload: P) => string;
``` | /content/code_sandbox/packages/app/app/reducers/types.ts | xml | 2016-09-22T22:58:21 | 2024-08-16T15:47:39 | nuclear | nukeop/nuclear | 11,862 | 83 |
```xml
import { hooks } from 'botframework-webchat-api';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React, { FC, MouseEventHandler, ReactNode, useRef } from 'react';
import AccessibleButton from '../Utils/AccessibleButton';
import useFocusVisible from '../hooks/internal/useFocusVisible';
import useStyleSet from '../hooks/useStyleSet';
const { useStyleOptions } = hooks;
type IconButtonProps = {
alt?: string;
children?: ReactNode;
className?: string;
disabled?: boolean;
onClick?: MouseEventHandler<HTMLButtonElement>;
};
const IconButton: FC<IconButtonProps> = ({ alt, children, className, disabled, onClick }) => {
const [{ sendBoxButton: sendBoxButtonStyleSet }] = useStyleSet();
const [{ sendBoxButtonAlignment }] = useStyleOptions();
const buttonRef = useRef<HTMLButtonElement>();
const [focusVisible] = useFocusVisible(buttonRef);
return (
<AccessibleButton
className={classNames(
sendBoxButtonStyleSet + '',
'webchat__icon-button',
{
'webchat__icon-button--focus-visible': focusVisible,
'webchat__icon-button--stretch': sendBoxButtonAlignment !== 'bottom' && sendBoxButtonAlignment !== 'top'
},
className + ''
)}
disabled={disabled}
onClick={disabled ? undefined : onClick}
ref={buttonRef}
title={alt}
type="button"
>
<div className="webchat__icon-button__shade" />
{children}
<div className="webchat__icon-button__keyboard-focus-indicator" />
</AccessibleButton>
);
};
IconButton.defaultProps = {
alt: '',
children: undefined,
className: '',
disabled: false,
onClick: undefined
};
IconButton.propTypes = {
alt: PropTypes.string,
children: PropTypes.any,
className: PropTypes.string,
disabled: PropTypes.bool,
onClick: PropTypes.func
};
export default IconButton;
``` | /content/code_sandbox/packages/component/src/SendBox/IconButton.tsx | xml | 2016-07-07T23:16:57 | 2024-08-16T00:12:37 | BotFramework-WebChat | microsoft/BotFramework-WebChat | 1,567 | 421 |
```xml
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatCardModule } from '@angular/material/card';
import { MatDividerModule } from '@angular/material/divider';
import { CovalentMessageModule } from '@covalent/core/message';
import { CovalentHighlightModule } from '@covalent/highlight';
import { ComponentDetailsModule } from '../../../../components/shared/component-details/component-details.module';
import { setComponentRoutes } from '../../../../content/components/components';
import { MessageDemoBasicSharedModule } from './demos/message-demo-basic/message-demo-basic-shared';
import { MessageDemoBasicComponent } from './demos/message-demo-basic/message-demo-basic.component';
import { DocumentationToolsModule } from '../../../../documentation-tools';
import { CovalentDialogsModule } from '@covalent/core/dialogs';
const routes: Routes = setComponentRoutes({
overviewDemoComponent: MessageDemoBasicComponent,
id: 'message',
});
@NgModule({
imports: [
MessageDemoBasicSharedModule,
CommonModule,
DocumentationToolsModule,
// Material
MatIconModule,
MatButtonModule,
MatCardModule,
MatDividerModule,
ComponentDetailsModule,
// Covalent
CovalentDialogsModule,
CovalentMessageModule,
CovalentHighlightModule,
// Docs
// Routes
RouterModule.forChild(routes),
],
exports: [],
providers: [],
})
export class MessageDemoModule {}
``` | /content/code_sandbox/apps/docs-app/src/app/content/components/component-demos/message/message.module.ts | xml | 2016-07-11T23:30:52 | 2024-08-15T15:20:45 | covalent | Teradata/covalent | 2,228 | 335 |
```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>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{2EEDEBA4-9A84-4CD3-A66F-01379993A637}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>UnifiedExample</RootNamespace>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
<AssemblyName>%NAME%</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug</OutputPath>
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>false</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
REPLACE_CODE_REPLACE
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>true</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<LinkMode>SdkOnly</LinkMode>
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
%REFERENCES_BEFORE_PLATFORM%
<Reference Include="Xamarin.Mac" />
%REFERENCES%
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
%ITEMGROUP%
</Project>
``` | /content/code_sandbox/tests/common/mac/UnifiedExample.csproj | xml | 2016-04-20T18:24:26 | 2024-08-16T13:29:19 | xamarin-macios | xamarin/xamarin-macios | 2,436 | 681 |
```xml
export type LegacyMessage = {
command: string;
userId?: string;
timestamp?: number;
publicKey?: string;
};
``` | /content/code_sandbox/apps/desktop/src/models/native-messaging/legacy-message.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 28 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="backgroundColor" format="color"/>
<attr name="textColor" format="color"/>
</resources>
``` | /content/code_sandbox/android/app/src/main/res/values/theme.xml | xml | 2016-02-22T21:48:48 | 2024-08-16T19:01:49 | status-mobile | status-im/status-mobile | 3,877 | 44 |
```xml
import * as React from 'react';
import { Slider } from '@fluentui/react';
const Scenario = () => <Slider />;
export default Scenario;
``` | /content/code_sandbox/apps/perf-test/src/scenarios/Slider.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 33 |
```xml
// See LICENSE.txt for license information.
import {Q} from '@nozbe/watermelondb';
import {MM_TABLES} from '@constants/database';
import DatabaseManager from '@database/manager';
import type InfoModel from '@typings/database/models/app/info';
const {APP: {INFO}} = MM_TABLES;
export const getLastInstalledVersion = async () => {
try {
const {database} = DatabaseManager.getAppDatabaseAndOperator();
const infos = await database.get<InfoModel>(INFO).query(
Q.sortBy('created_at', Q.desc),
Q.take(1),
).fetch();
return infos[0];
} catch {
return undefined;
}
};
``` | /content/code_sandbox/app/queries/app/info.ts | xml | 2016-10-07T16:52:32 | 2024-08-16T12:08:38 | mattermost-mobile | mattermost/mattermost-mobile | 2,155 | 146 |
```xml
import { StrykerError } from '@stryker-mutator/util';
export class ChildProcessCrashedError extends StrykerError {
constructor(
public readonly pid: number | undefined,
message: string,
public readonly exitCode?: number,
public readonly signal?: string,
innerError?: Error,
) {
super(message, innerError);
Error.captureStackTrace(this, ChildProcessCrashedError);
// TS recommendation: path_to_url#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(this, ChildProcessCrashedError.prototype);
}
}
``` | /content/code_sandbox/packages/core/src/child-proxy/child-process-crashed-error.ts | xml | 2016-02-12T13:14:28 | 2024-08-15T18:38:25 | stryker-js | stryker-mutator/stryker-js | 2,561 | 130 |
```xml
<?xml version="1.0"?>
<!--
~ 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.
-->
<configuration>
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.apache.shardingsphere" level="warn" additivity="false">
<appender-ref ref="console" />
</logger>
<logger name="com.zaxxer.hikari" level="off" />
<root>
<level value="error" />
<appender-ref ref="console" />
</root>
</configuration>
``` | /content/code_sandbox/infra/data-source-pool/core/src/test/resources/logback-test.xml | xml | 2016-01-18T12:49:26 | 2024-08-16T15:48:11 | shardingsphere | apache/shardingsphere | 19,707 | 256 |
```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 xmlns:android="path_to_url"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- <string name="english_ime_name" msgid="7252517407088836577">"Klvesnice Android"</string> -->
<!-- <string name="english_ime_settings" msgid="6661589557206947774">"Nastaven klvesnice Android"</string> -->
<string name="english_ime_input_options" msgid="3909945612939668554">"Monosti zadvn textu a dat"</string>
<string name="vibrate_on_keypress" msgid="5258079494276955460">"Pi stisku klvesy vibrovat"</string>
<string name="sound_on_keypress" msgid="6093592297198243644">"Zvuk pi stisku klvesy"</string>
<string name="popup_on_keypress" msgid="123894815723512944">"Zobrazit znaky pi stisku klvesy"</string>
<string name="hit_correction" msgid="4855351009261318389">"Opravovat peklepy"</string>
<string name="hit_correction_summary" msgid="8761701873008070796">"Povolit opravu chyb vstupu"</string>
<string name="hit_correction_land" msgid="2567691684825205448">"Chyby vstupu v zobrazen na ku"</string>
<string name="hit_correction_land_summary" msgid="4076803842198368328">"Povolit opravu chyb vstupu"</string>
<string name="auto_correction" msgid="7911639788808958255">"Nvrhy slov"</string>
<string name="auto_correction_summary" msgid="6881047311475758267">"Automaticky opravit pedchoz slovo"</string>
<string name="prediction" msgid="466220283138359837">"Nvrhy slov"</string>
<string name="prediction_category" msgid="7027100625580696660">"Nastaven nvrh slov"</string>
<string name="prediction_summary" msgid="459788228830873110">"Povolit automatick dokonovn pi psan"</string>
<string name="auto_complete_dialog_title" msgid="2172048590607201920">"Automatick dokonovn"</string>
<string name="prediction_landscape" msgid="4874601565593216183">"Zvtit textov pole"</string>
<string name="prediction_landscape_summary" msgid="6736551095997839472">"Skrt nvrhy slov v zobrazen na ku"</string>
<string name="auto_cap" msgid="1719746674854628252">"Velk psmena automaticky"</string>
<string name="auto_cap_summary" msgid="3260681697600786825">"Zahjit vtu velkm psmenem"</string>
<string name="auto_punctuate" msgid="7276672334264521751">"Automatick interpunkce"</string>
<string name="auto_punctuate_summary" msgid="6589441565817502132"></string>
<string name="quick_fixes" msgid="5353213327680897927">"Rychl opravy"</string>
<string name="quick_fixes_summary" msgid="3405028402510332373">"Opravuje nejastj chyby pi psan"</string>
<string name="show_suggestions" msgid="507074425254289133">"Zobrazit nvrhy"</string>
<string name="show_suggestions_summary" msgid="1989672863935759654">"Zobrazovat navren slova bhem psan"</string>
<string name="auto_complete" msgid="1103196318775486023">"Automatick dokonovn"</string>
<string name="auto_complete_summary" msgid="6113149638718274624">"Stisknutm mezernku nebo interpunknho znamnka automaticky vlote zvraznn slovo."</string>
<string name="prefs_settings_key" msgid="4623341240804046498">"Zobrazit klvesu Nastaven"</string>
<string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automaticky"</string>
<string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Vdy zobrazovat"</string>
<string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Vdy skrvat"</string>
<!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
<!-- no translation found for settings_key_modes:1 (881280041213210923) -->
<!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
<string name="bigram_suggestion" msgid="1323347224043514969">"Nvrh Bigram"</string>
<string name="bigram_suggestion_summary" msgid="4383845146070101531">"Pout pedchoz slovo ke zlepen nvrhu"</string>
<string-array name="prediction_modes">
<item msgid="4870266572388153286">"dn"</item>
<item msgid="1669461741568287396">"Zkladn"</item>
<item msgid="4894328801530136615">"Pokroil"</item>
</string-array>
<string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: Uloeno"</string>
<string name="tip_long_press" msgid="6101270866284343344">"Podrenm klvesy zobrazte diakritiku (, apod.)"</string>
<string name="tip_dismiss" msgid="7585579046862204381">"Stisknutm klvesy Zpt mete klvesnici kdykoli zavt."</string>
<string name="tip_access_symbols" msgid="6344098517525531652">"Pstup k slm a symbolm"</string>
<string name="tip_add_to_dictionary" msgid="1487293888469227817">"Stisknutm a podrenm slova zcela vlevo toto slovo pidte do slovnku."</string>
<string name="touch_to_continue" msgid="7869803257948414531">"Chcete-li pokraovat, dotknte se tohoto tipu "</string>
<string name="touch_to_finish" msgid="7990196086480585789">"Chcete-li tento tip zavt a zat pst, dotknte se zde."</string>
<string name="tip_to_open_keyboard" msgid="6821200275486950452"><b>"Klvesnice se oteve vdy, kdy se dotknete textovho pole."</b></string>
<string name="tip_to_view_accents" msgid="5433158573693308501"><b>"Pidrenm klvesy zobrazte diakritiku"\n"(, , , apod.)"</b></string>
<string name="tip_to_open_symbols" msgid="7345139325622444880"><b>"Chcete-li pepnout na reim zadvn slic a symbol, dotknte se tto klvesy."</b></string>
<string name="tip_to_close_symbols" msgid="5227724217206927185"><b>"Chcete-li pejt zpt k zadvn psmen, dotknte se tto klvesy znovu."</b></string>
<string name="tip_to_launch_settings" msgid="8402961128983196128"><b>"Pidrenm tto klvesy zmnte nastaven klvesnice (nap. automatick dokonovn)."</b></string>
<string name="tip_to_start_typing" msgid="7213843601369174313"><b>"Vyzkouejte si to."</b></string>
<string name="label_go_key" msgid="1635148082137219148">"Pejt"</string>
<string name="label_next_key" msgid="362972844525672568">"Dal"</string>
<string name="label_done_key" msgid="2441578748772529288">"Hotovo"</string>
<string name="label_send_key" msgid="2815056534433717444">"Odeslat"</string>
<string name="label_symbol_key" msgid="6175820506864489453">"?123"</string>
<string name="label_phone_key" msgid="4275497665515080551">"123"</string>
<string name="label_alpha_key" msgid="8864943487292437456">"ABC"</string>
<string name="label_alt_key" msgid="2846315350346694811">"Alt"</string>
<string name="voice_warning_title" msgid="4419354150908395008">"Hlasov vstup"</string>
<string name="voice_warning_locale_not_supported" msgid="637923019716442333">"Pro v jazyk aktuln nen hlasov vstup podporovn, ale funguje v anglitin."</string>
<string name="voice_warning_may_not_understand" msgid="4611518823070986445">"Hlasov vstup je experimentln funkce, kter vyuv sov rozpoznvn ei spolenosti Google."</string>
<string name="voice_warning_how_to_turn_off" msgid="5652369578498701761">"Chcete-li vypnout hlasov vstup, pejdte do nastaven klvesnice."</string>
<string name="voice_hint_dialog_message" msgid="6892342981545727994">"Chcete-li pout hlasov vstup, stisknte tlatko mikrofonu nebo pejete prstem pes klvesnici na obrazovce."</string>
<string name="voice_listening" msgid="467518160751321844">"Mluvte"</string>
<string name="voice_working" msgid="6666937792815731889">"Probh zpracovn"</string>
<string name="voice_initializing" msgid="661962047129906646"></string>
<string name="voice_error" msgid="5140896300312186162">"Chyba. Zkuste to prosm znovu."</string>
<string name="voice_network_error" msgid="6649556447401862563">"Pipojen se nezdailo."</string>
<string name="voice_too_much_speech" msgid="5746973620134227376">"Chyba, e je pli dlouh."</string>
<string name="voice_audio_error" msgid="5072707727016414454">"Problm se zvukem"</string>
<string name="voice_server_error" msgid="7807129913977261644">"Chyba serveru"</string>
<string name="voice_speech_timeout" msgid="8461817525075498795">"Nebyla detekovna dn e."</string>
<string name="voice_no_match" msgid="4285117547030179174">"Nebyly nalezeny dn shody"</string>
<string name="voice_not_installed" msgid="5552450909753842415">"Hlasov vyhledvn nen nainstalovno"</string>
<string name="voice_swipe_hint" msgid="6943546180310682021"><b>"Npovda:"</b>" Chcete-li aktivovat hlasov vstup, pejete prstem pes klvesnici."</string>
<string name="voice_punctuation_hint" msgid="1611389463237317754"><b>"Npovda:"</b>" Pt zkuste vyslovit interpunkci, napklad teka, rka nebo otaznk."</string>
<string name="cancel" msgid="6830980399865683324">"Zruit"</string>
<string name="ok" msgid="7898366843681727667">"OK"</string>
<string name="voice_input" msgid="2466640768843347841">"Hlasov vstup"</string>
<string-array name="voice_input_modes">
<item msgid="1349082139076086774">"Na hlavn klvesnici"</item>
<item msgid="8529385602829095903">"Na klvesnici se symboly"</item>
<item msgid="7283103513488381103">"Vypnout"</item>
</string-array>
<string-array name="voice_input_modes_summary">
<item msgid="554248625705084903">"Mikrofon na hlavn klvesnici"</item>
<item msgid="6907837061058876770">"Mikrofon na klvesnici se symboly"</item>
<item msgid="3664304608587798036">"Hlasov vstup je deaktivovn"</item>
</string-array>
<string name="auto_submit" msgid="9151008027068358518">"Po hlasovm vstupu automaticky odeslat"</string>
<string name="auto_submit_summary" msgid="4961875269610384226">"Pi vyhledvn nebo pechodu na dal pole automaticky stisknout Enter."</string>
<string name="open_the_keyboard" msgid="2215920976029260466"><font size="17"><b>"Otevete klvesnici"\n</b></font><font size="3">\n</font>"Dotknte se libovolnho textovho pole."</string>
<string name="close_the_keyboard" msgid="6251022259044940103"><font size="17"><b>"Zavete klvesnici"\n</b></font><font size="3">\n</font>"Stisknte tlatko Zpt."</string>
<string name="touch_and_hold" msgid="6154166367273010534"><font size="17"><b>"Pidrenm klvesy zobrazte monosti"\n</b></font><font size="3">\n</font>"Pstup k interpunknm znamnkm a diakritice."</string>
<string name="keyboard_settings" msgid="4585753477617374032"><font size="17"><b>"Nastaven klvesnice"\n</b></font><font size="3">\n</font>"Dotknte se klvesy "<b>"?123"</b>" a pidrte ji."</string>
<string name="popular_domain_0" msgid="3745279225122472969">".com"</string>
<string name="popular_domain_1" msgid="1370572248164278467">".cz"</string>
<string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
<string name="popular_domain_3" msgid="8718639560809452028">".net"</string>
<string name="popular_domain_4" msgid="35359437471311470">".eu"</string>
<string name="selectInputMethod" msgid="315076553378705821">"Vbr metody zadvn dat"</string>
<string name="language_selection_title" msgid="1651299598555326750">"Vstupn jazyky"</string>
<string name="language_selection_summary" msgid="187110938289512256">"Jazyk mete zmnit posunutm prstu po mezernku."</string>
<string name="hint_add_to_dictionary" msgid="9006292060636342317">" Dalm dotykem slovo ulote"</string>
<string name="has_dictionary" msgid="6071847973466625007">"K dispozici je slovnk"</string>
<string name="prefs_enable_log" msgid="6620424505072963557">"Aktivovat zasln statistik uvn a zprv o selhn"</string>
<string name="prefs_description_log" msgid="5827825607258246003">"Automatickm zaslnm statistik o uvn editoru zadvn dat a zprv o jeho selhn do Googlu mete pispt k vylepen tohoto nstroje."</string>
<string name="prefs_enable_recorrection" msgid="4588408906649533582">"Aktivovat opravy dotykem"</string>
<string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Opravy napsanch slov dotykem"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Motiv klvesnice"</string>
<string name="subtype_mode_keyboard" msgid="2242090416595003881">"klvesnice"</string>
<string name="subtype_mode_voice" msgid="4394113125441627771">"hlas"</string>
</resources>
``` | /content/code_sandbox/app/src/main/res/values-cs/strings.xml | xml | 2016-01-22T21:40:54 | 2024-08-16T11:54:30 | hackerskeyboard | klausw/hackerskeyboard | 1,807 | 3,819 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FirmwareSettingsDialog</class>
<widget class="QDialog" name="FirmwareSettingsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>511</width>
<height>357</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Firmware settings - melonDS</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item>
<widget class="QLabel" name="lblInstanceNum">
<property name="text">
<string>Configuring settings for instance X</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="grpGeneral">
<property name="title">
<string>General</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="overrideFirmwareBox">
<property name="text">
<string>Override settings from external firmware</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="grpUserSettings">
<property name="title">
<string>User settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="2" column="1">
<widget class="QComboBox" name="cbxBirthdayDay"/>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="cbxBirthdayMonth"/>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="usernameEdit">
<property name="text">
<string>melonDS</string>
</property>
<property name="maxLength">
<number>10</number>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="usernameLabel">
<property name="text">
<string>Username:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Message:</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="colorsEdit"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Language:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Birthday:</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QLineEdit" name="messageEdit"/>
</item>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="languageBox"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="grpWifiSettings">
<property name="title">
<string>Network settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>MAC address:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txtMAC">
<property name="maxLength">
<number>17</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>(leave empty to use default MAC)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="dialogButtons">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>overrideFirmwareBox</tabstop>
<tabstop>usernameEdit</tabstop>
<tabstop>languageBox</tabstop>
<tabstop>cbxBirthdayDay</tabstop>
<tabstop>cbxBirthdayMonth</tabstop>
<tabstop>colorsEdit</tabstop>
<tabstop>messageEdit</tabstop>
<tabstop>txtMAC</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>dialogButtons</sender>
<signal>accepted()</signal>
<receiver>FirmwareSettingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>255</x>
<y>250</y>
</hint>
<hint type="destinationlabel">
<x>255</x>
<y>135</y>
</hint>
</hints>
</connection>
<connection>
<sender>dialogButtons</sender>
<signal>rejected()</signal>
<receiver>FirmwareSettingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>255</x>
<y>250</y>
</hint>
<hint type="destinationlabel">
<x>255</x>
<y>135</y>
</hint>
</hints>
</connection>
</connections>
</ui>
``` | /content/code_sandbox/src/frontend/qt_sdl/FirmwareSettingsDialog.ui | xml | 2016-05-16T01:34:13 | 2024-08-16T19:28:31 | melonDS | melonDS-emu/melonDS | 3,080 | 1,677 |
```xml
/**
* @license
*
* 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 type { MakeIconOptions } from "#src/widget/icon.js";
import { makeIcon } from "#src/widget/icon.js";
export function makeHelpButton(options: MakeIconOptions = {}) {
return makeIcon({ text: "?", ...options });
}
``` | /content/code_sandbox/src/widget/help_button.ts | xml | 2016-05-27T02:37:25 | 2024-08-16T07:24:25 | neuroglancer | google/neuroglancer | 1,045 | 95 |
```xml
<dict>
<key>LayoutID</key>
<integer>13</integer>
<key>PathMapRef</key>
<array>
<dict>
<key>CodecID</key>
<array>
<integer>283902581</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>1342242840</integer>
<key>SignalProcessing</key>
<dict>
<key>SoftwareDSP</key>
<dict>
<key>DspFunction0</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>0</integer>
<key>DspFuncName</key>
<string>DspNoiseReduction</string>
<key>DspFuncProcessingIndex</key>
<integer>0</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>-1073029587</integer>
<key>5</key>
<data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data>
</dict>
<key>PatchbayInfo</key>
<dict/>
</dict>
<key>DspFunction1</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>1</integer>
<key>DspFuncName</key>
<string>DspGainStage</string>
<key>DspFuncProcessingIndex</key>
<integer>1</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1078616770</integer>
<key>3</key>
<integer>1078616770</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>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>DspEqualization</string>
<key>DspFuncProcessingIndex</key>
<integer>2</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>Filter</key>
<array>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>1</integer>
<key>6</key>
<integer>1132560510</integer>
<key>7</key>
<integer>1064190664</integer>
<key>8</key>
<integer>-1057196819</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>8</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1150544383</integer>
<key>7</key>
<integer>1068848526</integer>
<key>8</key>
<integer>-1073422534</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>15</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>0</integer>
<key>6</key>
<integer>1182094222</integer>
<key>7</key>
<integer>1063679547</integer>
<key>8</key>
<integer>-1048213171</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>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>Mic</key>
<dict>
<key>MuteGPIO</key>
<integer>1342242840</integer>
<key>SignalProcessing</key>
<dict>
<key>SoftwareDSP</key>
<dict>
<key>DspFunction0</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>0</integer>
<key>DspFuncName</key>
<string>DspNoiseReduction</string>
<key>DspFuncProcessingIndex</key>
<integer>0</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>-1073029587</integer>
<key>5</key>
<data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data>
</dict>
<key>PatchbayInfo</key>
<dict/>
</dict>
<key>DspFunction1</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>1</integer>
<key>DspFuncName</key>
<string>DspEqualization32</string>
<key>DspFuncProcessingIndex</key>
<integer>1</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>9</key>
<integer>0</integer>
<key>Filter</key>
<array>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>1</integer>
<key>6</key>
<integer>1119939268</integer>
<key>7</key>
<integer>1060439283</integer>
<key>8</key>
<integer>-1069504319</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>4</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1165674830</integer>
<key>7</key>
<integer>1106304591</integer>
<key>8</key>
<integer>-1073964333</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>5</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1141348835</integer>
<key>7</key>
<integer>1084737706</integer>
<key>8</key>
<integer>-1065063953</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>6</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1139052693</integer>
<key>7</key>
<integer>1080938866</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>8</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1161958655</integer>
<key>7</key>
<integer>1099668786</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>9</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1148922426</integer>
<key>7</key>
<integer>1086508776</integer>
<key>8</key>
<integer>-1076100424</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>10</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1169908270</integer>
<key>7</key>
<integer>1106659062</integer>
<key>8</key>
<integer>-1078236516</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>11</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1168889995</integer>
<key>7</key>
<integer>1103911084</integer>
<key>8</key>
<integer>-1082886964</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>12</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1160729473</integer>
<key>7</key>
<integer>1095247586</integer>
<key>8</key>
<integer>-1076100424</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>19</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1171440929</integer>
<key>7</key>
<integer>1103785747</integer>
<key>8</key>
<integer>-1075032379</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>21</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1163187837</integer>
<key>7</key>
<integer>1102690138</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>23</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1172459204</integer>
<key>7</key>
<integer>1098523915</integer>
<key>8</key>
<integer>-1062927862</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>24</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1175303133</integer>
<key>7</key>
<integer>1102375714</integer>
<key>8</key>
<integer>-1061058782</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>25</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1179874390</integer>
<key>7</key>
<integer>1097945441</integer>
<key>8</key>
<integer>-1054338996</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>26</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1167504019</integer>
<key>7</key>
<integer>1102555367</integer>
<key>8</key>
<integer>-1044515201</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>27</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1177335863</integer>
<key>7</key>
<integer>1102845396</integer>
<key>8</key>
<integer>-1054739513</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>31</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>0</integer>
<key>6</key>
<integer>1184146588</integer>
<key>7</key>
<integer>1060439283</integer>
<key>8</key>
<integer>-1069504319</integer>
</dict>
</array>
</dict>
<key>PatchbayInfo</key>
<dict>
<key>InputPort0</key>
<dict>
<key>PortInstance</key>
<integer>0</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>0</integer>
<key>SourcePortIndex</key>
<integer>0</integer>
</dict>
<key>InputPort1</key>
<dict>
<key>PortInstance</key>
<integer>1</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>0</integer>
<key>SourcePortIndex</key>
<integer>1</integer>
</dict>
</dict>
</dict>
<key>DspFunction2</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>2</integer>
<key>DspFuncName</key>
<string>DspGainStage</string>
<key>DspFuncProcessingIndex</key>
<integer>2</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1065353216</integer>
<key>3</key>
<integer>1065353216</integer>
</dict>
<key>PatchbayInfo</key>
<dict>
<key>InputPort0</key>
<dict>
<key>PortInstance</key>
<integer>0</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>1</integer>
<key>SourcePortIndex</key>
<integer>0</integer>
</dict>
<key>InputPort1</key>
<dict>
<key>PortInstance</key>
<integer>1</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>1</integer>
<key>SourcePortIndex</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</dict>
</dict>
</dict>
<key>Outputs</key>
<array>
<string>Headphone</string>
<string>IntSpeaker</string>
</array>
<key>PathMapID</key>
<integer>275</integer>
</dict>
</array>
</dict>
``` | /content/code_sandbox/Resources/ALC275/layout13.xml | xml | 2016-03-07T20:45:58 | 2024-08-14T08:57:03 | AppleALC | acidanthera/AppleALC | 3,420 | 6,640 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../LocalizableStrings.resx">
<body>
<trans-unit id="DownloadVersionFailed">
<source>Downloading {0} version {1} failed.</source>
<target state="translated">Stahovn {0} verze {1} selhalo.</target>
<note />
</trans-unit>
<trans-unit id="FailedToFindSourceUnderPackageSourceMapping">
<source>Package Source Mapping is enabled, but no source found under the specified package ID: {0}. See the documentation for Package Source Mapping at path_to_url for more details.</source>
<target state="translated">Mapovn zdroje balku je povoleno, ale pod zadanm ID balku nebyl nalezen dn zdroj: {0}. Dal podrobnosti najdete v dokumentaci k mapovn zdroj balk na path_to_url
<note />
</trans-unit>
<trans-unit id="FailedToLoadNuGetSource">
<source>Failed to load NuGet source {0}</source>
<target state="translated">Nepovedlo se nast zdroj NuGet {0}.</target>
<note />
</trans-unit>
<trans-unit id="FailedToLoadNuGetSourceSourceIsNotValid">
<source>Failed to load NuGet source {0}: the source is not valid. It will be skipped in further processing.</source>
<target state="translated">Nepovedlo se nast zdroj Nuget {0}: zdroj nen platn. Pi dalm zpracovn se pesko.</target>
<note />
</trans-unit>
<trans-unit id="FailedToMapSourceUnderPackageSourceMapping">
<source>Package Source Mapping is enabled, but no source mapped under the specified package ID: {0}. See the documentation for Package Source Mapping at path_to_url for more details.</source>
<target state="translated">Mapovn zdroje balku je povoleno, ale pod zadanm ID balku nen namapovn dn zdroj: {0}. Dal podrobnosti najdete v dokumentaci k mapovn zdroj balk na path_to_url
<note />
</trans-unit>
<trans-unit id="FailedToValidatePackageSigning">
<source>Failed to validate package signing.</source>
<target state="translated">Nepodailo se ovit podepisovn balku.</target>
<note />
</trans-unit>
<trans-unit id="IsNotFoundInNuGetFeeds">
<source>{0} is not found in NuGet feeds {1}.</source>
<target state="needs-review-translation">Balek {0} se nenael v informanch kanlech NuGet {1}.</target>
<note />
</trans-unit>
<trans-unit id="NuGetPackageSignatureVerificationSkipped">
<source>Skipping NuGet package signature verification.</source>
<target state="translated">Peskakuje se oven podpisu balku NuGet.</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionDefault">
<source>A version of {0} of package {1}</source>
<target state="translated">Verze {0} balku {1}</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForExactVersionMatch">
<source>Version {0} of package {1}</source>
<target state="translated">Verze {0} balku {1}</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForVersionWithLowerAndUpperBounds">
<source>A version between {0} and {1} of package {2}</source>
<target state="translated">Verze mezi {0} a {1} balku {2}</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForVersionWithLowerBound">
<source>A version higher than {0} of package {1}</source>
<target state="translated">Verze vy ne {0} balku {1}</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForVersionWithUpperBound">
<source>A version less than {0} of package {1}</source>
<target state="translated">Verze men ne {0} balku {1}</target>
<note />
</trans-unit>
<trans-unit id="SkipNuGetpackageSigningValidationmacOSLinux">
<source>Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS path_to_url .</source>
<target state="translated">Peskoit ovovn podepisovn balku NuGet. Ovovn podepisovn balku NuGet nen k dispozici na Linuxu nebo v macOS path_to_url
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/NugetPackageDownloader/xlf/LocalizableStrings.cs.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 1,175 |
```xml
// See LICENSE in the project root for license information.
import { objectsAreDeepEqual, cloneDeep, merge } from '../objectUtilities';
describe('objectUtilities', () => {
describe(objectsAreDeepEqual.name, () => {
it('can compare primitives', () => {
expect(objectsAreDeepEqual(1, 1)).toEqual(true);
expect(objectsAreDeepEqual(1, undefined)).toEqual(false);
expect(objectsAreDeepEqual(1, null)).toEqual(false);
expect(objectsAreDeepEqual(undefined, 1)).toEqual(false);
expect(objectsAreDeepEqual(null, 1)).toEqual(false);
expect(objectsAreDeepEqual(1, 2)).toEqual(false);
expect(objectsAreDeepEqual('a', 'a')).toEqual(true);
expect(objectsAreDeepEqual('a', undefined)).toEqual(false);
expect(objectsAreDeepEqual('a', null)).toEqual(false);
expect(objectsAreDeepEqual(undefined, 'a')).toEqual(false);
expect(objectsAreDeepEqual(null, 'a')).toEqual(false);
expect(objectsAreDeepEqual('a', 'b')).toEqual(false);
expect(objectsAreDeepEqual(true, true)).toEqual(true);
expect(objectsAreDeepEqual(true, undefined)).toEqual(false);
expect(objectsAreDeepEqual(true, null)).toEqual(false);
expect(objectsAreDeepEqual(undefined, true)).toEqual(false);
expect(objectsAreDeepEqual(null, true)).toEqual(false);
expect(objectsAreDeepEqual(true, false)).toEqual(false);
expect(objectsAreDeepEqual(undefined, undefined)).toEqual(true);
expect(objectsAreDeepEqual(undefined, null)).toEqual(false);
expect(objectsAreDeepEqual(null, null)).toEqual(true);
});
it('can compare arrays', () => {
expect(objectsAreDeepEqual([], [])).toEqual(true);
expect(objectsAreDeepEqual([], undefined)).toEqual(false);
expect(objectsAreDeepEqual([], null)).toEqual(false);
expect(objectsAreDeepEqual(undefined, [])).toEqual(false);
expect(objectsAreDeepEqual(null, [])).toEqual(false);
expect(objectsAreDeepEqual([1], [1])).toEqual(true);
expect(objectsAreDeepEqual([1], [2])).toEqual(false);
expect(objectsAreDeepEqual([1, 2], [1, 2])).toEqual(true);
expect(objectsAreDeepEqual([1, 2], [2, 1])).toEqual(false);
expect(objectsAreDeepEqual([1, 2, 3], [1, 2, 3])).toEqual(true);
expect(objectsAreDeepEqual([1, 2, 3], [1, 2, 4])).toEqual(false);
});
it('can compare objects', () => {
expect(objectsAreDeepEqual({}, {})).toEqual(true);
expect(objectsAreDeepEqual({}, undefined)).toEqual(false);
expect(objectsAreDeepEqual({}, null)).toEqual(false);
expect(objectsAreDeepEqual(undefined, {})).toEqual(false);
expect(objectsAreDeepEqual(null, {})).toEqual(false);
expect(objectsAreDeepEqual({ a: 1 }, { a: 1 })).toEqual(true);
expect(objectsAreDeepEqual({ a: 1 }, { a: 2 })).toEqual(false);
expect(objectsAreDeepEqual({ a: 1 }, {})).toEqual(false);
expect(objectsAreDeepEqual({}, { a: 1 })).toEqual(false);
expect(objectsAreDeepEqual({ a: 1 }, { b: 1 })).toEqual(false);
expect(objectsAreDeepEqual({ a: 1, b: 2 }, { a: 1, b: 2 })).toEqual(true);
expect(objectsAreDeepEqual({ a: 1, b: 2 }, { a: 1, b: 3 })).toEqual(false);
expect(objectsAreDeepEqual({ a: 1, b: 2 }, { a: 1, c: 2 })).toEqual(false);
expect(objectsAreDeepEqual({ a: 1, b: 2 }, { b: 2, a: 1 })).toEqual(true);
});
it('can compare nested objects', () => {
expect(objectsAreDeepEqual({ a: { b: 1 } }, { a: { b: 1 } })).toEqual(true);
expect(objectsAreDeepEqual({ a: { b: 1 } }, { a: { b: 2 } })).toEqual(false);
expect(objectsAreDeepEqual({ a: { b: 1 } }, { a: { c: 1 } })).toEqual(false);
expect(objectsAreDeepEqual({ a: { b: 1 } }, { a: { b: 1, c: 2 } })).toEqual(false);
expect(objectsAreDeepEqual({ a: { b: 1 } }, { a: { b: 1 }, c: 2 })).toEqual(false);
});
});
describe(cloneDeep.name, () => {
function testClone(source: unknown): void {
const clone: unknown = cloneDeep(source);
expect(clone).toEqual(source);
expect(clone).not.toBe(source);
}
it('can clone primitives', () => {
expect(cloneDeep(1)).toEqual(1);
expect(cloneDeep('a')).toEqual('a');
expect(cloneDeep(true)).toEqual(true);
expect(cloneDeep(undefined)).toEqual(undefined);
expect(cloneDeep(null)).toEqual(null);
});
it('can clone arrays', () => {
testClone([]);
testClone([1]);
testClone([1, 2]);
testClone([1, 2, 3]);
});
it('can clone objects', () => {
testClone({});
testClone({ a: 1 });
testClone({ a: 1, b: 1 });
testClone({ a: 1, b: 2 });
const a: Record<string, number> = { a: 1 };
testClone({ a, b: a });
});
it('can clone nested objects', () => {
testClone({ a: { b: 1 } });
});
it("can't clone objects with circular references", () => {
const a: Record<string, unknown> = { a: 1 };
a.b = a;
expect(() => cloneDeep(a)).toThrowErrorMatchingInlineSnapshot(`"Circular reference detected"`);
const b: unknown[] = [];
b.push(b);
expect(() => cloneDeep(b)).toThrowErrorMatchingInlineSnapshot(`"Circular reference detected"`);
});
});
describe(merge.name, () => {
it('will overwrite with primitives', () => {
expect(merge({}, 2)).toEqual(2);
expect(merge([], 2)).toEqual(2);
expect(merge({}, null)).toEqual(null);
expect(merge([], null)).toEqual(null);
expect(merge({}, undefined)).toEqual(undefined);
expect(merge([], undefined)).toEqual(undefined);
});
it('will overwrite with arrays', () => {
expect(merge({}, [1])).toEqual([1]);
expect(merge([], [1])).toEqual([1]);
expect(merge({ a: { b: 1 } }, { a: [1] })).toEqual({ a: [1] });
});
it('will merge with objects', () => {
expect(merge({}, { a: 1 })).toEqual({ a: 1 });
expect(merge({ a: 1 }, { b: 2 })).toEqual({ a: 1, b: 2 });
expect(merge({ a: 1 }, { a: 2 })).toEqual({ a: 2 });
expect(merge({ a: { b: 1 } }, { a: { c: 2 } })).toEqual({ a: { b: 1, c: 2 } });
});
});
});
``` | /content/code_sandbox/libraries/rush-lib/src/utilities/test/objectUtilities.test.ts | xml | 2016-09-30T00:28:20 | 2024-08-16T18:54:35 | rushstack | microsoft/rushstack | 5,790 | 1,637 |
```xml
import React, { useState, useEffect, useMemo, useCallback } from 'react'
import DatePicker from 'react-datepicker'
import PropertyValueButton from './PropertyValueButton'
import { format as formatDate, isValid } from 'date-fns'
import styled from '../../../../design/lib/styled'
import Button from '../../../../design/components/atoms/Button'
import { mdiArrowRight, mdiCalendarMonthOutline, mdiClose } from '@mdi/js'
import cc from 'classcat'
import { useModal } from '../../../../design/lib/stores/modal'
import Flexbox from '../../../../design/components/atoms/Flexbox'
import FormInput from '../../../../design/components/molecules/Form/atoms/FormInput'
import Switch from '../../../../design/components/atoms/Switch'
import MetadataContainer from '../../../../design/components/organisms/MetadataContainer'
import MetadataContainerRow from '../../../../design/components/organisms/MetadataContainer/molecules/MetadataContainerRow'
import MetadataContainerBreak from '../../../../design/components/organisms/MetadataContainer/atoms/MetadataContainerBreak'
import { filterIter } from '../../../lib/utils/iterator'
import Icon from '../../../../design/components/atoms/Icon'
interface DatePropPickerProps {
className?: string
sending?: boolean
emptyLabel?: string
isReadOnly: boolean
date?: Date | Date[] | null
onDueDateChange: (newDueDate: Date | Date[] | null) => void
disabled?: boolean
}
const DatePropPicker = ({
className,
sending,
disabled,
isReadOnly,
emptyLabel,
date: propDate,
onDueDateChange,
}: DatePropPickerProps) => {
const [date, setDate] = useState<Date | Date[] | null>(getValidDate(propDate))
const { openContextModal } = useModal()
const isDue = useMemo(() => {
const today = new Date()
today.setHours(0, 0, 0)
if (date == null) {
return true
}
return Array.isArray(date) ? date[date.length - 1] > today : date > today
}, [date])
useEffect(() => {
const dates = getValidDate(propDate)
setDate(dates)
}, [propDate])
return (
<Container className='item__due-date__select prop__margin'>
<PropertyValueButton
className={cc([
'date__prop-picker',
className,
isDue && 'due__date__expired',
])}
sending={sending}
empty={date == null && emptyLabel == null}
isReadOnly={isReadOnly}
disabled={sending || disabled}
iconPath={mdiCalendarMonthOutline}
onClick={(e) =>
openContextModal(
e,
<DatePropPickerModal
initialDate={date}
sendDateUpdate={onDueDateChange}
/>,
{
width: 300,
removePadding: true,
keepAll: true,
}
)
}
>
{date != null ? (
Array.isArray(date) ? (
<>
{formatDate(date[0], 'MMM dd, yyyy')}
<Icon
path={mdiArrowRight}
className='date-prop__duration-arrow'
size={12}
/>
{formatDate(date[1], 'MMM dd, yyyy')}
</>
) : (
formatDate(date, 'MMM dd, yyyy')
)
) : emptyLabel != null ? (
emptyLabel
) : (
'Add Date'
)}
</PropertyValueButton>
{date != null && !isReadOnly && (
<Button
variant='icon'
iconPath={mdiClose}
className='due__date__clear'
iconSize={16}
size='sm'
onClick={() => onDueDateChange(null)}
/>
)}
</Container>
)
}
interface DatePropPickerModalProps {
initialDate: Date | Date[] | null
sendDateUpdate: (newDueDate: Date | Date[] | null) => void
}
const DatePropPickerModal = ({
initialDate,
sendDateUpdate,
}: DatePropPickerModalProps) => {
const [date, setDate] = useState<Date | Date[] | null>(initialDate)
const [showRange, setShowRange] = useState(Array.isArray(initialDate))
const [sending, setSending] = useState(false)
const format = 'MMM dd, yyyy'
const onDateChange = useCallback(
async (val: Date | Date[] | null) => {
if (sending) {
return
}
setDate(val)
setSending(true)
const filteredProp = Array.isArray(val)
? filterIter((val) => val != null, val)
: val
await sendDateUpdate(
Array.isArray(filteredProp) && filteredProp.length === 1
? filteredProp[0]
: filteredProp
)
setSending(false)
},
[sending, sendDateUpdate]
)
const setSwitch = useCallback(
(checked: boolean) => {
setShowRange(checked)
if (!checked && Array.isArray(date)) {
return onDateChange(isValid(date[0]) ? date[0] : null)
}
return
},
[date, onDateChange]
)
return (
<ModalContainer>
<Flexbox
justifyContent='space-between'
className='date__prop-picker__header'
>
<FormInput
className='date__prop-picker__start-date'
readOnly={true}
value={
date == null
? ''
: Array.isArray(date)
? formatDate(date[0], format)
: formatDate(date, format)
}
placeholder={showRange ? 'Start Date..' : 'Date'}
/>
{Array.isArray(date) && date.length > 1 && (
<FormInput
className='date__prop-picker__end-date'
placeholder='End Date..'
readOnly={true}
value={
isValid(date[date.length - 1])
? formatDate(date[date.length - 1], format)
: ''
}
/>
)}
</Flexbox>
<DatePicker
selected={date != null ? (Array.isArray(date) ? date[0] : date) : null}
startDate={date != null ? (Array.isArray(date) ? date[0] : date) : null}
endDate={
date != null && Array.isArray(date) && date.length > 1
? date[date.length - 1]
: null
}
onChange={onDateChange}
inline={true}
selectsRange={showRange}
disabled={true}
disabledKeyboardNavigation={true}
/>
<MetadataContainerBreak />
<MetadataContainerRow
row={{
type: 'content',
label: 'End date',
content: (
<Switch
id='end-date-switch'
checked={showRange}
disabled={sending}
onChange={(checked) => setSwitch(checked)}
/>
),
}}
/>
<MetadataContainerRow
row={{
type: 'button',
props: {
label: 'Clear',
onClick: () => onDateChange(null),
disabled: sending,
},
}}
/>
</ModalContainer>
)
}
function getValidDate(
value: Date | Date[] | string | string[] | null | undefined
): Date | Date[] | null {
if (value == null) {
return null
}
if (Array.isArray(value)) {
if (value.length > 2) {
return null
}
const dates: Date[] = []
value.forEach((val) => {
const date = typeof val === 'string' ? new Date(val) : val
if (isValid(date)) {
return dates.push(date)
}
return dates
})
return dates.sort((a, b) => {
if (a < b) {
return -1
} else {
return 1
}
})
}
if (typeof value === 'string') {
const date = new Date(value)
if (!isValid(date)) {
return null
}
return date
} else {
return value
}
}
const ModalContainer = styled(MetadataContainer)`
padding: ${({ theme }) => theme.sizes.spaces.xsm}px 0;
.date__prop-picker__header {
padding: 0 ${({ theme }) => theme.sizes.spaces.sm}px;
margin-bottom: ${({ theme }) => theme.sizes.spaces.sm}px;
input {
width: 100%;
}
}
.date__prop-picker__end-date {
margin-left: ${({ theme }) => theme.sizes.spaces.df}px;
}
.date__prop-picker__header,
.react-datepicker {
width: 100%;
}
.react-datepicker {
border: 0 !important;
background: none !important;
.react-datepicker__header {
background: none !important;
border-bottom: 1px solid ${({ theme }) => theme.colors.border.second};
}
.react-datepicker__month-container {
width: 100%;
}
.react-datepicker__current-month,
.react-datepicker__day-name,
.react-datepicker__day {
color: ${({ theme }) => theme.colors.text.primary};
}
.react-datepicker__day--today {
color: ${({ theme }) => theme.colors.text.primary};
background: ${({ theme }) => theme.colors.background.tertiary};
border-radius: ${({ theme }) => theme.borders.radius}px;
}
.react-datepicker__day {
&.react-datepicker__day--selected {
background: ${({ theme }) => theme.colors.variants.primary.base};
color: ${({ theme }) => theme.colors.variants.primary.text};
}
&.react-datepicker__day--keyboard-selected {
background: ${({ theme }) => theme.colors.variants.primary.base};
color: ${({ theme }) => theme.colors.variants.primary.text};
filter: brightness(130%);
}
&:hover {
background: ${({ theme }) => theme.colors.background.secondary};
}
}
}
.metadata__button {
padding: 0;
}
.metadata__break {
margin-left: 0;
margin-right: 0;
margin-bottom: ${({ theme }) => theme.sizes.spaces.sm}px;
}
.metadata__item--row,
.metadata__item--row .metadata__content,
.metadata__item--row .switch__wrapper {
display: flex;
flex-direction: row;
align-items: center;
}
.metadata__content {
justify-content: end;
}
.button__label {
margin: 0 ${({ theme }) => theme.sizes.spaces.df}px;
}
`
const Container = styled.div`
width: 100%;
color: ${({ theme }) => theme.colors.text.primary};
position: relative;
.due__date__expired {
.doc__property__button__icon,
.doc__property__button__label {
color: #bd2929;
}
}
.due__date__expired {
&:hover,
&:active,
&:focus,
&.button__state--active {
.doc__property__button__icon,
.doc__property__button__label {
color: #de1e1e;
}
}
}
.due__date__clear {
display: none;
position: absolute;
right: -8px;
top: 0;
transform: translateY(-15%);
}
&:hover {
.due__date__clear {
display: block;
}
}
.date-prop__duration-arrow {
flex: 0 0 auto;
margin: 0 ${({ theme }) => theme.sizes.spaces.xsm}px;
}
`
export default DatePropPicker
``` | /content/code_sandbox/src/cloud/components/Props/Pickers/DatePropPicker.tsx | xml | 2016-11-19T14:30:34 | 2024-08-16T03:13:45 | BoostNote-App | BoostIO/BoostNote-App | 3,745 | 2,532 |
```xml
import { useCallback } from 'react';
import { FormattedMessage } from 'react-intl';
import ArrowBackIcon from '@/material-icons/400-24px/arrow_back.svg?react';
import { Icon } from 'mastodon/components/icon';
import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context';
import { useAppHistory } from './router';
type OnClickCallback = () => void;
function useHandleClick(onClick?: OnClickCallback) {
const history = useAppHistory();
return useCallback(() => {
if (onClick) {
onClick();
} else if (history.location.state?.fromMastodon) {
history.goBack();
} else {
history.push('/');
}
}, [history, onClick]);
}
export const ColumnBackButton: React.FC<{ onClick: OnClickCallback }> = ({
onClick,
}) => {
const handleClick = useHandleClick(onClick);
const component = (
<button onClick={handleClick} className='column-back-button'>
<Icon
id='chevron-left'
icon={ArrowBackIcon}
className='column-back-button__icon'
/>
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
</button>
);
return <ButtonInTabsBar>{component}</ButtonInTabsBar>;
};
``` | /content/code_sandbox/app/javascript/mastodon/components/column_back_button.tsx | xml | 2016-02-22T15:01:25 | 2024-08-16T19:27:35 | mastodon | mastodon/mastodon | 46,560 | 279 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug.DLL|Win32">
<Configuration>Debug.DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug.DLL|x64">
<Configuration>Debug.DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release.DLL|Win32">
<Configuration>Release.DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release.DLL|x64">
<Configuration>Release.DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BCF5E746-FDBF-4CAC-9B95-44FE9A498430}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>style_selector</RootNamespace>
<ProjectName>style_selector</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
<Message>Copy Debug DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
<Message>Copy Debug DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Copy Release DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(SolutionDir)..\..\src\external;$(SolutionDir)..\..\..\raylib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Copy Release DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\raylib\raylib.vcxproj">
<Project>{e89d61ac-55de-4482-afd4-df7242ebc859}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\examples\style_selector\style_selector.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\examples\raygui.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/projects/VS2022/examples/style_selector.vcxproj | xml | 2016-06-15T18:33:19 | 2024-08-16T06:40:57 | raygui | raysan5/raygui | 3,312 | 5,620 |
```xml
import React from 'react';
import { connect } from 'react-redux';
import { Spin, Button } from 'antd';
import RequestManager from '../../../utils/request_manager';
import { State } from '../../../state/index';
import { actionCreator } from '../../../action/index';
import { CancelRequestType } from '../../../action/record';
import Msg from '../../../locales';
import LocalesString from '../../../locales/string';
interface ResponseLoadingPanelStateProps {
activeKey: string;
}
interface ResponseLoadingPanelDispatchProps {
cancelRequest(id: string);
}
type ResponseLoadingPanelProps = ResponseLoadingPanelStateProps & ResponseLoadingPanelDispatchProps;
interface ResponseLoadingPanelState { }
class ResponseLoadingPanel extends React.Component<ResponseLoadingPanelProps, ResponseLoadingPanelState> {
private cancelRequest = () => {
const { activeKey } = this.props;
RequestManager.cancelRequest(activeKey);
this.props.cancelRequest(activeKey);
}
public render() {
return (
<div className="res-loading-content">
<Spin tip={`${LocalesString.get('Common.Loading')}...`} />
<div>
<Button onClick={this.cancelRequest}>{Msg('Collection.CancelRequest')}</Button>
</div>
</div>
);
}
}
const mapStateToProps = (state: State): ResponseLoadingPanelStateProps => {
return {
activeKey: state.displayRecordsState.activeKey
};
};
const mapDispatchToProps = (dispatch: any): ResponseLoadingPanelDispatchProps => {
return {
cancelRequest: (id) => dispatch(actionCreator(CancelRequestType, id)),
};
};
export default connect(
mapStateToProps,
mapDispatchToProps,
)(ResponseLoadingPanel);
``` | /content/code_sandbox/client/src/modules/collection/req_res_panel/response_loading_panel.tsx | xml | 2016-09-26T02:47:43 | 2024-07-24T09:32:20 | Hitchhiker | brookshi/Hitchhiker | 2,193 | 343 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
const MOCK_TIMESTAMP = '2018-12-12 00:00:00';
function formatDate(
dateString: Date | string | null,
placeholder: string | null = '--',
) {
return dateString ? MOCK_TIMESTAMP : placeholder;
}
export {formatDate, MOCK_TIMESTAMP};
``` | /content/code_sandbox/operate/client/src/modules/utils/date/__mocks__/formatDate.ts | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 87 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/push_root_view"
xmlns:android="path_to_url"
android:layout_width="match_parent"
android:layout_height="256dp">
<FrameLayout
android:id="@+id/v21"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/layout_version_2"
android:layout_width="0dp"
android:layout_height="0dp" />
<RelativeLayout
android:id="@+id/push_notification_style_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<LinearLayout
android:id="@+id/push_notification_layout_lefttop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/push_notification_big_icon"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/push_notification_small_icon"
android:layout_width="18dp"
android:layout_height="18dp"
android:scaleType="centerInside" />
<TextView
style="@android:style/TextAppearance.Material.Notification.Title"
android:id="@+id/push_notification_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:maxLines="1"
android:maxWidth="200dp"
android:maxLength="24"
android:textSize="12sp" />
<TextView
style="@android:style/TextAppearance.Material.Notification.Info"
android:id="@+id/push_notification_dot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:textStyle="bold"
android:text=""
android:textSize="16sp" />
<TextView
style="@android:style/TextAppearance.Material.Notification.Time"
android:maxLines="1"
android:id="@+id/push_notification_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp" />
</LinearLayout>
<FrameLayout
android:id="@+id/push_notification_for_bottom_margin"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="0dp"/>
<ImageView
android:id="@+id/push_notification_banner_icon"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_above="@+id/push_notification_for_bottom_margin"
android:layout_marginBottom="8dp"
android:visibility="visible"
android:scaleType="centerCrop" />
<LinearLayout
android:id="@+id/push_notification_main_layout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/push_notification_banner_icon"
android:gravity="center_vertical"
android:layout_marginRight="4dp"
android:layout_marginBottom="5dp"
android:layout_toLeftOf="@+id/push_notification_big_icon"
android:layout_below="@id/push_notification_layout_lefttop">
<TextView
style="@android:style/TextAppearance.Material.Notification.Title"
android:id="@+id/push_notification_sub_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:ellipsize="end"
android:textSize="13sp"
android:visibility="gone" />
<TextView
style="@android:style/TextAppearance.Material.Notification.Info"
android:id="@+id/push_notification_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:layout_marginTop="1dp"
android:maxLines="2"
android:textSize="13sp" />
<TextView
style="@android:style/TextAppearance.Material.Notification.Info"
android:id="@+id/push_notification_content_one_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:layout_marginTop="1dp"
android:textSize="13sp"
android:maxLines="1"
android:visibility="gone" />
</LinearLayout>
<ImageView
android:id="@+id/push_notification_big_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/push_notification_main_layout"
android:layout_alignBottom="@+id/push_notification_main_layout"
android:scaleType="centerInside" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/push_notification_style_1"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:visibility="gone">
<ImageView
android:id="@+id/push_notification_style_1_big_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:scaleType="centerInside" />
<LinearLayout
android:id="@+id/push_notification_style_1_main_layout"
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/push_notification_layout_time"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
style="@android:style/TextAppearance.Material.Notification.Title"
android:id="@+id/push_notification_style_1_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:layout_marginRight="8dp"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
style="@android:style/TextAppearance.Material.Notification.Time"
android:id="@+id/push_notification_style_1_date"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginRight="4dp"
android:gravity="right"
android:textSize="12sp" />
<TextView android:id="@+id/push_notification_null"
android:layout_width="24dp"
android:visibility="gone"
android:layout_height="20dp"/>
</LinearLayout>
<TextView
style="@android:style/TextAppearance.Material.Notification.Info"
android:id="@+id/push_notification_style_1_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:ellipsize="end"
android:layout_marginTop="1dp"
android:maxLines="1"
android:textSize="13sp" />
</LinearLayout>
<ImageView
android:id="@+id/push_notification_style_1_banner_icon"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_alignParentBottom="true"
android:visibility="gone"
android:layout_below="@id/push_notification_style_1_main_layout"
android:scaleType="centerInside" />
</RelativeLayout>
<FrameLayout
android:id="@+id/push_notification_banner_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/push_notification_banner_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:visibility="gone" />
</FrameLayout>
<RelativeLayout
android:id="@+id/push_notification_header_neg_fb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:visibility="gone">
<ImageView android:id="@+id/push_notification_header_expand"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:scaleType="centerInside"
android:background="#08000000"
android:src="@drawable/jpush_ic_action_close"
android:visibility="visible"/>
<LinearLayout
android:id="@+id/push_notification_fb_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:layout_below="@id/push_notification_header_expand"
android:orientation="horizontal"
android:visibility="invisible"
android:gravity="center">
<TextView
style="@android:style/TextAppearance.Material.Notification.Title"
android:id="@+id/push_notification_fb_content_no_like1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0f000000"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textSize="14sp"
android:gravity="center"
android:maxLines="1"
android:layout_margin="5dp"
android:text=""/>
<TextView
style="@android:style/TextAppearance.Material.Notification.Title"
android:id="@+id/push_notification_fb_content_no_like2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0f000000"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textSize="14sp"
android:gravity="center"
android:maxLines="1"
android:layout_margin="5dp"
android:text=""/>
<TextView
style="@android:style/TextAppearance.Material.Notification.Title"
android:id="@+id/push_notification_fb_content_no_like3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0f000000"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textSize="14sp"
android:gravity="center"
android:maxLines="1"
android:layout_margin="5dp"
android:text=""/>
<TextView
style="@android:style/TextAppearance.Material.Notification.Title"
android:id="@+id/push_notification_fb_content_no_like4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0f000000"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textSize="14sp"
android:gravity="center"
android:maxLines="1"
android:layout_margin="5dp"
android:text=""/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
``` | /content/code_sandbox/android/src/main/res/layout-v21/push_notification_large.xml | xml | 2016-02-15T08:18:56 | 2024-08-13T02:39:18 | jpush-react-native | jpush/jpush-react-native | 1,343 | 2,603 |
```xml
/* eslint-disable no-console */
/* eslint-disable no-invalid-this */
import { FastifyInstance } from 'fastify';
import { searchUtils } from '@verdaccio/core';
import { logger } from '@verdaccio/logger';
interface QueryInterface {
url: string;
query: searchUtils.SearchQuery;
}
async function searchRoute(fastify: FastifyInstance) {
fastify.get<{ Querystring: QueryInterface }>('/-/v1/search', async (request, reply) => {
// TODO: apply security layer here like in
// packages/api/src/v1/search.ts
// TODO: add validations for query, some parameters are mandatory
// TODO: review which query fields are mandatory
const abort = new AbortController();
request.socket.on('aborted', () => {
abort.abort();
});
const { url, query } = request.query;
const storage = fastify.storage;
const data = await storage.search({
query,
url,
abort,
});
logger.http('search endpoint');
reply.code(200).send(data);
});
}
export default searchRoute;
``` | /content/code_sandbox/packages/server/fastify/src/endpoints/search.ts | xml | 2016-04-15T16:21:12 | 2024-08-16T09:38:01 | verdaccio | verdaccio/verdaccio | 16,189 | 239 |
```xml
'use client'
import React, {
useRef,
useEffect,
useCallback,
useContext,
useMemo,
useState,
forwardRef,
use,
} from 'react'
import ReactDOM from 'react-dom'
import Head from '../shared/lib/head'
import { getImgProps } from '../shared/lib/get-img-props'
import type {
ImageProps,
ImgProps,
OnLoad,
OnLoadingComplete,
PlaceholderValue,
} from '../shared/lib/get-img-props'
import type {
ImageConfigComplete,
ImageLoaderProps,
} from '../shared/lib/image-config'
import { imageConfigDefault } from '../shared/lib/image-config'
import { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime'
import { warnOnce } from '../shared/lib/utils/warn-once'
import { RouterContext } from '../shared/lib/router-context.shared-runtime'
// @ts-ignore - This is replaced by webpack alias
import defaultLoader from 'next/dist/shared/lib/image-loader'
import { useMergedRef } from './use-merged-ref'
// This is replaced by webpack define plugin
const configEnv = process.env.__NEXT_IMAGE_OPTS as any as ImageConfigComplete
if (typeof window === 'undefined') {
;(globalThis as any).__NEXT_IMAGE_IMPORTED = true
}
export type { ImageLoaderProps }
export type ImageLoader = (p: ImageLoaderProps) => string
type ImgElementWithDataProp = HTMLImageElement & {
'data-loaded-src': string | undefined
}
type ImageElementProps = ImgProps & {
unoptimized: boolean
placeholder: PlaceholderValue
onLoadRef: React.MutableRefObject<OnLoad | undefined>
onLoadingCompleteRef: React.MutableRefObject<OnLoadingComplete | undefined>
setBlurComplete: (b: boolean) => void
setShowAltText: (b: boolean) => void
sizesInput: string | undefined
}
// See path_to_url for why we use this ref
// handler instead of the img's onLoad attribute.
function handleLoading(
img: ImgElementWithDataProp,
placeholder: PlaceholderValue,
onLoadRef: React.MutableRefObject<OnLoad | undefined>,
onLoadingCompleteRef: React.MutableRefObject<OnLoadingComplete | undefined>,
setBlurComplete: (b: boolean) => void,
unoptimized: boolean,
sizesInput: string | undefined
) {
const src = img?.src
if (!img || img['data-loaded-src'] === src) {
return
}
img['data-loaded-src'] = src
const p = 'decode' in img ? img.decode() : Promise.resolve()
p.catch(() => {}).then(() => {
if (!img.parentElement || !img.isConnected) {
// Exit early in case of race condition:
// - onload() is called
// - decode() is called but incomplete
// - unmount is called
// - decode() completes
return
}
if (placeholder !== 'empty') {
setBlurComplete(true)
}
if (onLoadRef?.current) {
// Since we don't have the SyntheticEvent here,
// we must create one with the same shape.
// See path_to_url
const event = new Event('load')
Object.defineProperty(event, 'target', { writable: false, value: img })
let prevented = false
let stopped = false
onLoadRef.current({
...event,
nativeEvent: event,
currentTarget: img,
target: img,
isDefaultPrevented: () => prevented,
isPropagationStopped: () => stopped,
persist: () => {},
preventDefault: () => {
prevented = true
event.preventDefault()
},
stopPropagation: () => {
stopped = true
event.stopPropagation()
},
})
}
if (onLoadingCompleteRef?.current) {
onLoadingCompleteRef.current(img)
}
if (process.env.NODE_ENV !== 'production') {
const origSrc = new URL(src, 'path_to_url || src
if (img.getAttribute('data-nimg') === 'fill') {
if (!unoptimized && (!sizesInput || sizesInput === '100vw')) {
let widthViewportRatio =
img.getBoundingClientRect().width / window.innerWidth
if (widthViewportRatio < 0.6) {
if (sizesInput === '100vw') {
warnOnce(
`Image with src "${origSrc}" has "fill" prop and "sizes" prop of "100vw", but image is not rendered at full viewport width. Please adjust "sizes" to improve page performance. Read more: path_to_url#sizes`
)
} else {
warnOnce(
`Image with src "${origSrc}" has "fill" but is missing "sizes" prop. Please add it to improve page performance. Read more: path_to_url#sizes`
)
}
}
}
if (img.parentElement) {
const { position } = window.getComputedStyle(img.parentElement)
const valid = ['absolute', 'fixed', 'relative']
if (!valid.includes(position)) {
warnOnce(
`Image with src "${origSrc}" has "fill" and parent element with invalid "position". Provided "${position}" should be one of ${valid
.map(String)
.join(',')}.`
)
}
}
if (img.height === 0) {
warnOnce(
`Image with src "${origSrc}" has "fill" and a height value of 0. This is likely because the parent element of the image has not been styled to have a set height.`
)
}
}
const heightModified =
img.height.toString() !== img.getAttribute('height')
const widthModified = img.width.toString() !== img.getAttribute('width')
if (
(heightModified && !widthModified) ||
(!heightModified && widthModified)
) {
warnOnce(
`Image with src "${origSrc}" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.`
)
}
}
})
}
function getDynamicProps(
fetchPriority?: string
): Record<string, string | undefined> {
if (Boolean(use)) {
// In React 19.0.0 or newer, we must use camelCase
// prop to avoid "Warning: Invalid DOM property".
// See path_to_url
return { fetchPriority }
}
// In React 18.2.0 or older, we must use lowercase prop
// to avoid "Warning: Invalid DOM property".
return { fetchpriority: fetchPriority }
}
const ImageElement = forwardRef<HTMLImageElement | null, ImageElementProps>(
(
{
src,
srcSet,
sizes,
height,
width,
decoding,
className,
style,
fetchPriority,
placeholder,
loading,
unoptimized,
fill,
onLoadRef,
onLoadingCompleteRef,
setBlurComplete,
setShowAltText,
sizesInput,
onLoad,
onError,
...rest
},
forwardedRef
) => {
const ownRef = useCallback(
(img: ImgElementWithDataProp | null) => {
if (!img) {
return
}
if (onError) {
// If the image has an error before react hydrates, then the error is lost.
// The workaround is to wait until the image is mounted which is after hydration,
// then we set the src again to trigger the error handler (if there was an error).
// eslint-disable-next-line no-self-assign
img.src = img.src
}
if (process.env.NODE_ENV !== 'production') {
if (!src) {
console.error(`Image is missing required "src" property:`, img)
}
if (img.getAttribute('alt') === null) {
console.error(
`Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.`
)
}
}
if (img.complete) {
handleLoading(
img,
placeholder,
onLoadRef,
onLoadingCompleteRef,
setBlurComplete,
unoptimized,
sizesInput
)
}
},
[
src,
placeholder,
onLoadRef,
onLoadingCompleteRef,
setBlurComplete,
onError,
unoptimized,
sizesInput,
]
)
const ref = useMergedRef(forwardedRef, ownRef)
return (
<img
{...rest}
{...getDynamicProps(fetchPriority)}
// It's intended to keep `loading` before `src` because React updates
// props in order which causes Safari/Firefox to not lazy load properly.
// See path_to_url
loading={loading}
width={width}
height={height}
decoding={decoding}
data-nimg={fill ? 'fill' : '1'}
className={className}
style={style}
// It's intended to keep `src` the last attribute because React updates
// attributes in order. If we keep `src` the first one, Safari will
// immediately start to fetch `src`, before `sizes` and `srcSet` are even
// updated by React. That causes multiple unnecessary requests if `srcSet`
// and `sizes` are defined.
// This bug cannot be reproduced in Chrome or Firefox.
sizes={sizes}
srcSet={srcSet}
src={src}
ref={ref}
onLoad={(event) => {
const img = event.currentTarget as ImgElementWithDataProp
handleLoading(
img,
placeholder,
onLoadRef,
onLoadingCompleteRef,
setBlurComplete,
unoptimized,
sizesInput
)
}}
onError={(event) => {
// if the real image fails to load, this will ensure "alt" is visible
setShowAltText(true)
if (placeholder !== 'empty') {
// If the real image fails to load, this will still remove the placeholder.
setBlurComplete(true)
}
if (onError) {
onError(event)
}
}}
/>
)
}
)
function ImagePreload({
isAppRouter,
imgAttributes,
}: {
isAppRouter: boolean
imgAttributes: ImgProps
}) {
const opts = {
as: 'image',
imageSrcSet: imgAttributes.srcSet,
imageSizes: imgAttributes.sizes,
crossOrigin: imgAttributes.crossOrigin,
referrerPolicy: imgAttributes.referrerPolicy,
...getDynamicProps(imgAttributes.fetchPriority),
}
if (isAppRouter && ReactDOM.preload) {
// See path_to_url
ReactDOM.preload(
imgAttributes.src,
// @ts-expect-error TODO: upgrade to `@types/react-dom@18.3.x`
opts
)
return null
}
return (
<Head>
<link
key={
'__nimg-' +
imgAttributes.src +
imgAttributes.srcSet +
imgAttributes.sizes
}
rel="preload"
// Note how we omit the `href` attribute, as it would only be relevant
// for browsers that do not support `imagesrcset`, and in those cases
// it would cause the incorrect image to be preloaded.
//
// path_to_url#attr-link-imagesrcset
href={imgAttributes.srcSet ? undefined : imgAttributes.src}
{...opts}
/>
</Head>
)
}
/**
* The `Image` component is used to optimize images.
*
* Read more: [Next.js docs: `Image`](path_to_url
*/
export const Image = forwardRef<HTMLImageElement | null, ImageProps>(
(props, forwardedRef) => {
const pagesRouter = useContext(RouterContext)
// We're in the app directory if there is no pages router.
const isAppRouter = !pagesRouter
const configContext = useContext(ImageConfigContext)
const config = useMemo(() => {
const c = configEnv || configContext || imageConfigDefault
const allSizes = [...c.deviceSizes, ...c.imageSizes].sort((a, b) => a - b)
const deviceSizes = c.deviceSizes.sort((a, b) => a - b)
return { ...c, allSizes, deviceSizes }
}, [configContext])
const { onLoad, onLoadingComplete } = props
const onLoadRef = useRef(onLoad)
useEffect(() => {
onLoadRef.current = onLoad
}, [onLoad])
const onLoadingCompleteRef = useRef(onLoadingComplete)
useEffect(() => {
onLoadingCompleteRef.current = onLoadingComplete
}, [onLoadingComplete])
const [blurComplete, setBlurComplete] = useState(false)
const [showAltText, setShowAltText] = useState(false)
const { props: imgAttributes, meta: imgMeta } = getImgProps(props, {
defaultLoader,
imgConf: config,
blurComplete,
showAltText,
})
return (
<>
{
<ImageElement
{...imgAttributes}
unoptimized={imgMeta.unoptimized}
placeholder={imgMeta.placeholder}
fill={imgMeta.fill}
onLoadRef={onLoadRef}
onLoadingCompleteRef={onLoadingCompleteRef}
setBlurComplete={setBlurComplete}
setShowAltText={setShowAltText}
sizesInput={props.sizes}
ref={forwardedRef}
/>
}
{imgMeta.priority ? (
<ImagePreload
isAppRouter={isAppRouter}
imgAttributes={imgAttributes}
/>
) : null}
</>
)
}
)
``` | /content/code_sandbox/packages/next/src/client/image-component.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 2,968 |
```xml
<phpunit
xmlns:xsi="path_to_url"
xsi:noNamespaceSchemaLocation="path_to_url"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stderr="true"
bootstrap="./bootstrap.php"
>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=2" />
</php>
<extensions>
<extension class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" />
</extensions>
<testsuites>
<testsuite name="DAMADoctrineTestBundle test suite">
<directory>../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../src</directory>
</whitelist>
</filter>
<listeners>
<listener class="\Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
``` | /content/code_sandbox/tests/phpunit.9.xml | xml | 2016-03-17T21:08:37 | 2024-08-14T19:53:55 | doctrine-test-bundle | dmaicher/doctrine-test-bundle | 1,074 | 241 |
```xml
import React, { FunctionComponent } from "react";
const NotificationBellIcon: FunctionComponent = () => {
return (
<svg viewBox="-0.75 0 21 21" xmlns="path_to_url">
<path
d="M8.33337 18.125C8.43922 18.4856 8.65901 18.8022 8.95983 19.0274C9.26066 19.2526 9.62634 19.3743 10.0021 19.3743C10.3779 19.3743 10.7436 19.2526 11.0444 19.0274C11.3452 18.8022 11.565 18.4856 11.6709 18.125"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M10 2.5V0.625"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M10 2.5C11.6576 2.5 13.2473 3.15848 14.4194 4.33058C15.5915 5.50268 16.25 7.0924 16.25 8.75C16.25 14.6217 17.5 15.625 17.5 15.625H2.5C2.5 15.625 3.75 14.0283 3.75 8.75C3.75 7.0924 4.40848 5.50268 5.58058 4.33058C6.75268 3.15848 8.3424 2.5 10 2.5Z"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};
export default NotificationBellIcon;
``` | /content/code_sandbox/client/src/core/client/ui/components/icons/NotificationBellIcon.tsx | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 449 |
```xml
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="path_to_url">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.7.1609.3, Culture=neutral, PublicKeyToken=3751622786b357c2" />
<pnp:Templates ID="CONTAINER-TEMPLATE-SOCKETIO-SPFX-DEMO">
<pnp:ProvisioningTemplate ID="TEMPLATE-SOCKETIO-SPFX-DEMO" Version="1" BaseSiteTemplate="STS#0">
<pnp:Lists>
<pnp:ListInstance Title="NewsList" Description="" DocumentTemplate="" OnQuickLaunch="true" TemplateType="100" Url="Lists/NewsList" MinorVersionLimit="0" MaxVersionLimit="0" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-de22-43b2-a848-c05709900100" ContentTypesEnabled="true" EnableFolderCreation="false">
<pnp:ContentTypeBindings>
<pnp:ContentTypeBinding ContentTypeID="0x01" Default="true" />
<pnp:ContentTypeBinding ContentTypeID="0x0120" />
</pnp:ContentTypeBindings>
<pnp:Views>
<View Name="{DE788C87-CF02-47BF-A0F1-F0C9991102BC}" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="All Items" Url="/sites/dev/Lists/NewsList/AllItems.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/15/images/generic.png?rev=44">
<Query>
<OrderBy>
<FieldRef Name="ID" />
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="LinkTitle" />
<FieldRef Name="Description" />
<FieldRef Name="PreviewImageUrl" />
</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<JSLink>clienttemplates.js</JSLink>
</View>
</pnp:Views>
<pnp:Fields>
<Field Type="Note" Title="Description" DisplayName="Description" Required="FALSE" ID="{d36bc9f3-9330-43cf-b8de-414abf9596f5}" SourceID="{{listid:NewsList}}" StaticName="Description" Name="Description" ColName="ntext2" RowOrdinal="0" Version="1" />
<Field Type="URL" DisplayName="PreviewImageUrl" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" Format="Image" ID="{53bc2547-9c8e-4b0b-b1ab-9c686d07ac1e}" SourceID="{{listid:NewsList}}" StaticName="PreviewImageUrl" Name="PreviewImageUrl" ColName="nvarchar3" RowOrdinal="0" ColName2="nvarchar4" RowOrdinal2="0" Version="1" />
</pnp:Fields>
</pnp:ListInstance>
</pnp:Lists>
</pnp:ProvisioningTemplate>
</pnp:Templates>
</pnp:Provisioning>
``` | /content/code_sandbox/samples/react-real-time/template.xml | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 715 |
```xml
<resources>
<string name="app_name">NineGridView</string>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/strings.xml | xml | 2016-01-28T12:16:02 | 2024-08-12T03:26:43 | NineGridView | jeasonlzy/NineGridView | 2,461 | 20 |
```xml
<clickhouse>
<interserver_http_port>9009</interserver_http_port>
</clickhouse>
``` | /content/code_sandbox/tests/integration/test_replication_credentials/configs/no_credentials.xml | xml | 2016-06-02T08:28:18 | 2024-08-16T18:39:33 | ClickHouse | ClickHouse/ClickHouse | 36,234 | 24 |
```xml
import * as path from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { argv } from 'yargs';
import webpack from 'webpack';
import { config } from '@fluentui/scripts-gulp';
import { getDefaultEnvironmentVars } from '@fluentui/scripts-monorepo';
import { packageDist, packageSrc, packageRoot } from './shared';
export const webpackConfig: webpack.Configuration = {
name: 'client',
target: 'web',
// eslint-disable-next-line no-extra-boolean-cast
mode: Boolean(argv.debug) ? 'development' : 'production',
entry: {
app: path.join(packageSrc, 'index'),
},
output: {
filename: `[name].js`,
path: packageDist,
pathinfo: true,
publicPath: config.compiler_public_path,
},
devtool: config.compiler_devtool,
node: {
global: true,
},
module: {
noParse: [/anchor-js/],
rules: [
{
test: /\.(js|ts|tsx)$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
cacheDirectory: true,
},
},
],
},
plugins: [
new webpack.DefinePlugin(getDefaultEnvironmentVars(!argv.debug)),
new CopyWebpackPlugin({
patterns: [
{
from: path.join(packageRoot, 'src/index.html'),
to: packageDist,
},
],
}),
],
resolve: {
fallback: {
path: require.resolve('path-browserify'),
},
extensions: ['.ts', '.tsx', '.js', '.json'],
alias: {
...config.webpackAliases,
// We are using React in production mode with tracing.
// path_to_url
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
},
},
performance: {
hints: false, // to (temporarily) disable "WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit")
},
optimization: {
// eslint-disable-next-line no-extra-boolean-cast
nodeEnv: !!argv.debug ? 'development' : 'production',
},
};
``` | /content/code_sandbox/packages/fluentui/perf/gulp/webpack.config.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 485 |
```xml
import * as Babel from '@babel/core';
import * as prettier from 'prettier';
import * as fs from 'fs';
import { modifyImportsPlugin } from './modifyImports';
import { removeStorybookParameters } from './removeStorybookParameters';
import { BabelPluginOptions } from './types';
export const PLUGIN_NAME = 'storybook-stories-fullsource';
/**
* This Babel plugin adds `context.parameters.fullSource` property to Storybook stories,
* which contains source of the file where story is present.
*
* Specifically, it finds this expression in a story file: Story.parameters = ...
* In case Story.parameters doesn't exist, it creates it.
* And adds the following expression after it: Story.parameters.fullSource = `...`;
*
* This plugin is utilized by Export to CodeSandbox.
*
* @param babel - babel instance
* @returns babel plugin
*/
export function fullSourcePlugin(babel: typeof Babel, options: BabelPluginOptions): Babel.PluginObj {
const { types: t } = babel;
let storyName: string;
let parametersAssignment: Babel.NodePath<Babel.types.AssignmentExpression> | undefined;
const createStoryParametersAssignmentExpression = () => {
const storyParameters = t.assignmentExpression(
'=',
t.memberExpression(t.identifier(storyName), t.identifier('parameters')),
t.objectExpression([]),
);
return t.expressionStatement(storyParameters);
};
const createFullSourceAssignmentExpression = (fullSource: string) => {
return t.expressionStatement(
t.assignmentExpression(
'=',
t.memberExpression(
t.memberExpression(t.identifier(storyName), t.identifier('parameters')),
t.identifier('fullSource'),
),
t.stringLiteral(fullSource),
),
);
};
return {
name: PLUGIN_NAME,
visitor: {
// eslint-disable-next-line @typescript-eslint/naming-convention
ExportNamedDeclaration(path) {
const declaration = path.node.declaration;
// Check if it's a function declaration
if (
t.isFunctionDeclaration(declaration) &&
t.isIdentifier(declaration.id) &&
isComponentLikeName(declaration.id.name)
) {
storyName = declaration.id.name;
return;
}
// Check if it's a variable declaration
if (
t.isVariableDeclaration(declaration) &&
declaration.declarations.length === 1 &&
t.isIdentifier(declaration.declarations[0].id) &&
isComponentLikeName(declaration.declarations[0].id.name)
) {
storyName = declaration.declarations[0].id.name;
return;
}
},
// eslint-disable-next-line @typescript-eslint/naming-convention
AssignmentExpression(path) {
if (
t.isMemberExpression(path.node.left) &&
t.isIdentifier(path.node.left.object) &&
path.node.left.object.name === storyName &&
t.isIdentifier(path.node.left.property) &&
path.node.left.property.name === 'parameters'
) {
parametersAssignment = path;
}
},
Program: {
enter() {
storyName = '';
parametersAssignment = undefined;
},
exit(path, state) {
if (!storyName || !state.filename) {
return;
}
const fileContents = fs.readFileSync(state.filename, 'utf-8');
const transformedCode = babel.transformSync(fileContents, {
...state.file.opts,
compact: false,
retainLines: true,
comments: false,
plugins: [[modifyImportsPlugin, options], removeStorybookParameters],
})?.code;
const code = prettier.format(transformedCode ?? '', { parser: 'babel-ts' });
if (!parametersAssignment) {
path.pushContainer('body', createStoryParametersAssignmentExpression());
}
path.pushContainer('body', createFullSourceAssignmentExpression(code));
},
},
},
};
}
/**
* Checks if the name is a component-like name.
*
* @param name - name to check
* @returns true if the name is a component-like name (starts with a capital letter)
*/
function isComponentLikeName(name: string) {
return name.charAt(0) === name.charAt(0).toUpperCase();
}
``` | /content/code_sandbox/packages/react-components/babel-preset-storybook-full-source/src/fullsource.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 889 |
```xml
import _ from 'lodash';
import { http, HttpResponse } from 'msw';
import { render } from '@testing-library/react';
import { createMockTeams, createMockUsers } from '@/react-tools/test-mocks';
import { server } from '@/setup-tests/server';
import { Role } from '@/portainer/users/types';
import { withUserProvider } from '@/react/test-utils/withUserProvider';
import { withTestRouter } from '@/react/test-utils/withRouter';
import { withTestQueryProvider } from '@/react/test-utils/withTestQuery';
import {
ResourceControlOwnership,
ResourceControlType,
TeamResourceAccess,
UserResourceAccess,
} from '../types';
import { ResourceControlViewModel } from '../models/ResourceControlViewModel';
import { AccessControlPanelDetails } from './AccessControlPanelDetails';
test.each([
[ResourceControlOwnership.ADMINISTRATORS],
[ResourceControlOwnership.PRIVATE],
[ResourceControlOwnership.PUBLIC],
[ResourceControlOwnership.RESTRICTED],
])(
'when resource control with ownership %s is supplied, show its ownership',
async (ownership) => {
const resourceControl = buildViewModel(ownership);
const { queryByLabelText } = await renderComponent(
ResourceControlType.Container,
resourceControl
);
expect(queryByLabelText('ownership')).toHaveTextContent(ownership);
}
);
test('when resource control is not supplied, show administrators', async () => {
const { queryByLabelText } = await renderComponent(
ResourceControlType.Container
);
expect(queryByLabelText('ownership')).toHaveTextContent(
ResourceControlOwnership.ADMINISTRATORS
);
});
const inheritanceTests = [
{
resourceType: ResourceControlType.Container,
parentType: ResourceControlType.Service,
},
{
resourceType: ResourceControlType.Volume,
parentType: ResourceControlType.Container,
},
...[
ResourceControlType.Config,
ResourceControlType.Container,
ResourceControlType.Network,
ResourceControlType.Secret,
ResourceControlType.Service,
ResourceControlType.Volume,
].map((resourceType) => ({
resourceType,
parentType: ResourceControlType.Stack,
})),
];
for (let i = 0; i < inheritanceTests.length; i += 1) {
const { resourceType, parentType } = inheritanceTests[i];
test(`when resource is ${ResourceControlType[resourceType]} and resource control is ${ResourceControlType[parentType]}, show message`, async () => {
const resourceControl = buildViewModel(
ResourceControlOwnership.ADMINISTRATORS,
parentType
);
const { queryByLabelText } = await renderComponent(
resourceType,
resourceControl
);
const inheritanceMessage = queryByLabelText('inheritance-message');
expect(inheritanceMessage).toBeVisible();
});
}
test('when resource is limited to specific users, show number of users', async () => {
const users = createMockUsers(10, Role.Standard);
server.use(http.get('/api/users', () => HttpResponse.json(users)));
const restrictedToUsers = _.sampleSize(users, 3);
const resourceControl = buildViewModel(
ResourceControlOwnership.RESTRICTED,
ResourceControlType.Service,
restrictedToUsers.map((user) => ({
UserId: user.Id,
AccessLevel: 1,
}))
);
const { queryByText, findByLabelText } = await renderComponent(
undefined,
resourceControl
);
expect(queryByText(/Authorized users/)).toBeVisible();
await expect(findByLabelText('authorized-users')).resolves.toHaveTextContent(
`${restrictedToUsers.length} users`
);
});
test('when resource is limited to specific teams, show comma separated list of their names', async () => {
const teams = createMockTeams(10);
server.use(http.get('/api/teams', () => HttpResponse.json(teams)));
const restrictedToTeams = _.sampleSize(teams, 3);
const resourceControl = buildViewModel(
ResourceControlOwnership.RESTRICTED,
ResourceControlType.Config,
[],
restrictedToTeams.map((team) => ({
TeamId: team.Id,
AccessLevel: 1,
}))
);
const { queryByText, findByLabelText } = await renderComponent(
undefined,
resourceControl
);
expect(queryByText(/Authorized teams/)).toBeVisible();
await expect(findByLabelText('authorized-teams')).resolves.toHaveTextContent(
restrictedToTeams.map((team) => team.Name).join(', ')
);
});
async function renderComponent(
resourceType: ResourceControlType = ResourceControlType.Container,
resourceControl?: ResourceControlViewModel
) {
const Wrapped = withTestQueryProvider(
withTestRouter(withUserProvider(AccessControlPanelDetails))
);
const queries = render(
<Wrapped resourceControl={resourceControl} resourceType={resourceType} />
);
await expect(queries.findByText('Ownership')).resolves.toBeVisible();
return queries;
}
function buildViewModel(
ownership: ResourceControlOwnership,
type: ResourceControlType = ResourceControlType.Config,
users: UserResourceAccess[] = [],
teams: TeamResourceAccess[] = []
): ResourceControlViewModel {
return {
Id: 0,
Public: false,
ResourceId: 0,
System: false,
TeamAccesses: teams,
Ownership: ownership,
Type: type,
UserAccesses: users,
};
}
``` | /content/code_sandbox/app/react/portainer/access-control/AccessControlPanel/AccessControlPaneDetails.test.tsx | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 1,149 |
```xml
import { G2Spec } from '../../../src';
import { seriesTooltipSteps } from './utils';
const RegionMap = new Map([
['Alaska', 'Pacific'],
['Alabama', 'East South Central'],
['Arkansas', 'West South Central'],
['Arizona', 'Mountain'],
['California', 'Pacific'],
['Colorado', 'Mountain'],
['Connecticut', 'New England'],
['District of Columbia', 'South Atlantic'],
['Delaware', 'South Atlantic'],
['Florida', 'South Atlantic'],
['Georgia', 'South Atlantic'],
['Hawaii', 'Pacific'],
['Iowa', 'West North Central'],
['Idaho', 'Mountain'],
['Illinois', 'East North Central'],
['Indiana', 'East North Central'],
['Kansas', 'West North Central'],
['Kentucky', 'East South Central'],
['Louisiana', 'West South Central'],
['Massachusetts', 'New England'],
['Maryland', 'South Atlantic'],
['Maine', 'New England'],
['Michigan', 'East North Central'],
['Minnesota', 'West North Central'],
['Missouri', 'West North Central'],
['Mississippi', 'East South Central'],
['Montana', 'Mountain'],
['North Carolina', 'South Atlantic'],
['North Dakota', 'West North Central'],
['Nebraska', 'West North Central'],
['New Hampshire', 'New England'],
['New Jersey', 'Middle Atlantic'],
['New Mexico', 'Mountain'],
['Nevada', 'Mountain'],
['New York', 'Middle Atlantic'],
['Ohio', 'East North Central'],
['Oklahoma', 'West South Central'],
['Oregon', 'Pacific'],
['Pennsylvania', 'Middle Atlantic'],
['Rhode Island', 'New England'],
['South Carolina', 'South Atlantic'],
['South Dakota', 'West North Central'],
['Tennessee', 'East South Central'],
['Texas', 'West South Central'],
['Utah', 'Mountain'],
['Virginia', 'South Atlantic'],
['Vermont', 'New England'],
['Washington', 'Pacific'],
['Wisconsin', 'East North Central'],
['West Virginia', 'South Atlantic'],
['Wyoming', 'Mountain'],
]);
export function populationByStateAreaNormalizeStacked(): G2Spec {
return {
width: 1200,
height: 800,
type: 'view',
data: {
type: 'fetch',
value: 'data/population-by-state.csv',
transform: [
{
type: 'fold',
fields: [
'Massachusetts',
'Connecticut',
'Maine',
'Rhode Island',
'New Hampshire',
'Vermont',
'New York',
'Pennsylvania',
'New Jersey',
'North Carolina',
'Virginia',
'Georgia',
'Florida',
'Maryland',
'South Carolina',
'West Virginia',
'District of Columbia',
'Delaware',
'Tennessee',
'Kentucky',
'Alabama',
'Mississippi',
'Texas',
'Louisiana',
'Oklahoma',
'Arkansas',
'Illinois',
'Ohio',
'Michigan',
'Indiana',
'Wisconsin',
'Missouri',
'Minnesota',
'Iowa',
'Kansas',
'Nebraska',
'South Dakota',
'North Dakota',
'Colorado',
'Arizona',
'Utah',
'New Mexico',
'Montana',
'Idaho',
'Nevada',
'Wyoming',
'California',
'Washington',
'Oregon',
'Hawaii',
'Alaska',
],
key: 'state',
value: 'population',
},
{
type: 'map',
callback: (d) => ({ ...d, region: RegionMap.get(d.state) }),
},
],
},
interaction: {
tooltip: { filter: (d) => parseInt(d.value as string) > 0 },
},
children: [
{
type: 'area',
transform: [{ type: 'stackY' }, { type: 'normalizeY' }],
encode: {
x: 'date',
y: 'population',
color: 'region',
series: 'state',
},
labels: [
{
text: 'state',
position: 'area',
selector: 'first',
transform: [{ type: 'overlapHide' }],
fontSize: 10,
},
],
tooltip: {
title: (d) => new Date(d.date).toUTCString(),
items: [{ channel: 'y0', valueFormatter: '.2%' }],
},
},
{
type: 'line',
transform: [{ type: 'stackY' }, { type: 'normalizeY' }],
encode: {
x: 'date',
y: 'population',
series: 'state',
},
style: {
stroke: '#000',
lineWidth: 0.5,
fillOpacity: 0.8,
},
tooltip: false,
},
],
};
}
populationByStateAreaNormalizeStacked.steps = seriesTooltipSteps([100, 300]);
``` | /content/code_sandbox/__tests__/plots/tooltip/population-by-state-area-normalize-stacked.ts | xml | 2016-05-26T09:21:04 | 2024-08-15T16:11:17 | G2 | antvis/G2 | 12,060 | 1,136 |
```xml
// Type definitions for ag-grid v6.2.1
// Project: path_to_url
// Definitions by: Niall Crosby <path_to_url
// Definitions: path_to_url
import { IRenderedHeaderElement } from "./iRenderedHeaderElement";
export declare class HeaderRenderer {
private gridOptionsWrapper;
private columnController;
private gridPanel;
private context;
private eventService;
private pinnedLeftContainer;
private pinnedRightContainer;
private centerContainer;
private childContainers;
private eHeaderViewport;
private eRoot;
private eHeaderOverlay;
private init();
forEachHeaderElement(callback: (renderedHeaderElement: IRenderedHeaderElement) => void): void;
private destroy();
private onGridColumnsChanged();
refreshHeader(): void;
private setHeight();
setPinnedColContainerWidth(): void;
}
``` | /content/code_sandbox/services/dashboard/assets-dev/js/vendor/ag-grid/dist/lib/headerRendering/headerRenderer.d.ts | xml | 2016-06-21T19:39:58 | 2024-08-12T19:23:26 | mylg | mehrdadrad/mylg | 2,691 | 187 |
```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
const decoder = new TextDecoder('utf-8');
/** @ignore */
export const decodeUtf8 = (buffer?: BufferSource) => decoder.decode(buffer);
const encoder = new TextEncoder();
/** @ignore */
export const encodeUtf8 = (value?: string) => encoder.encode(value);
``` | /content/code_sandbox/js/src/util/utf8.ts | xml | 2016-02-17T08:00:23 | 2024-08-16T19:00:48 | arrow | apache/arrow | 14,094 | 136 |
```xml
import { SessionContext } from '@jupyterlab/apputils';
import {
Context,
DocumentRegistry,
TextModelFactory
} from '@jupyterlab/docregistry';
import { RenderMimeRegistry } from '@jupyterlab/rendermime';
import { Contents, Drive, ServiceManager } from '@jupyterlab/services';
import {
acceptDialog,
dismissDialog,
signalToPromise,
waitForDialog
} from '@jupyterlab/testing';
import { ServiceManagerMock } from '@jupyterlab/services/lib/testutils';
import { UUID } from '@lumino/coreutils';
import { Widget } from '@lumino/widgets';
describe('docregistry/context', () => {
let manager: ServiceManager.IManager;
const factory = new TextModelFactory();
beforeAll(() => {
manager = new ServiceManagerMock();
manager.contents.addDrive(new Drive({ name: 'TestDrive' }));
return manager.ready;
});
describe('Context', () => {
let context: Context<DocumentRegistry.IModel>;
beforeEach(() => {
context = new Context({
manager,
factory,
path: UUID.uuid4() + '.txt'
});
});
afterEach(async () => {
await context.sessionContext.shutdown();
context.dispose();
});
describe('#constructor()', () => {
it('should create a new context', () => {
context = new Context({
manager,
factory,
path: UUID.uuid4() + '.txt'
});
expect(context).toBeInstanceOf(Context);
});
it('should set the session path with local path', () => {
const localPath = `${UUID.uuid4()}.txt`;
context = new Context({
manager,
factory,
path: `TestDrive:${localPath}`
});
expect(context.sessionContext.path).toEqual(localPath);
});
});
describe('#pathChanged', () => {
it('should be emitted when the path changes', async () => {
const newPath = UUID.uuid4() + '.txt';
let called = false;
context.pathChanged.connect((sender, args) => {
expect(sender).toBe(context);
expect(args).toBe(newPath);
called = true;
});
await context.initialize(true);
await manager.contents.rename(context.path, newPath);
expect(called).toBe(true);
});
});
describe('#fileChanged', () => {
it('should be emitted when the file is saved', async () => {
const path = context.path;
let called = false;
context.fileChanged.connect((sender, args) => {
expect(sender).toBe(context);
expect(args.path).toBe(path);
called = true;
});
await context.initialize(true);
expect(called).toBe(true);
});
it('should be emitted when the file hash changes', async () => {
let called = false;
context = new Context({
manager,
factory,
// The path below is a magic string instructing the `get()`
// method of the contents manager mock to return a random hash.
path: 'random-hash.txt'
});
await context.initialize(true);
context.fileChanged.connect((_sender, _args) => {
called = true;
});
const promise = context.save();
// Expect the correct dialog
await waitForDialog();
const dialog = document.body.getElementsByClassName(
'jp-Dialog'
)[0] as HTMLElement;
expect(dialog.innerHTML).toMatch(
'has changed on disk since the last time it was opened or saved'
);
// Accept dialog (overwrite)
await acceptDialog();
await promise;
// Expect the signal to have been emitted
expect(called).toBe(true);
});
it('should be emitted when the file timestamp changes and there is no hash', async () => {
let called = false;
context = new Context({
manager,
factory,
// The path below is a magic string instructing the `get()`
// method of the contents manager mock to return a newer timestamp and no hash.
path: 'newer-timestamp-no-hash.txt'
});
await context.initialize(true);
context.fileChanged.connect((_sender, _args) => {
called = true;
});
const promise = context.save();
// Expect the correct dialog
await waitForDialog();
const dialog = document.body.getElementsByClassName(
'jp-Dialog'
)[0] as HTMLElement;
expect(dialog.innerHTML).toMatch(
'has changed on disk since the last time it was opened or saved'
);
// Accept dialog (overwrite)
await acceptDialog();
await promise;
// Expect the signal to have been emitted
expect(called).toBe(true);
});
it('should not be emitted when the file hash is not changed', async () => {
let called = false;
context = new Context({
manager,
factory,
// The path below is a magic string instructing the `save()`
// method of the contents manager mock to not update time nor hash.
path: 'frozen-time-and-hash.txt'
});
await context.initialize(true);
context.fileChanged.connect(() => {
called = true;
});
await context.save();
expect(called).toBe(false);
});
it('should not contain the file content attribute', async () => {
let called = false;
context.fileChanged.connect((sender, args) => {
// @ts-expect-error content is omitted
expect(args['content']).toBeUndefined();
called = true;
});
await context.initialize(true);
expect(called).toBe(true);
});
});
describe('#saving', () => {
it("should emit 'starting' when the file starts saving", async () => {
let called = false;
let checked = false;
context.saveState.connect((sender, args) => {
if (!called) {
// eslint-disable-next-line jest/no-conditional-expect
expect(sender).toBe(context);
// eslint-disable-next-line jest/no-conditional-expect
expect(args).toBe('started');
checked = true;
}
called = true;
});
await context.initialize(true);
expect(called).toBe(true);
expect(checked).toBe(true);
});
it("should emit 'completed' when the file ends saving", async () => {
let called = 0;
let checked = false;
context.saveState.connect((sender, args) => {
if (called > 0) {
// eslint-disable-next-line jest/no-conditional-expect
expect(sender).toBe(context);
// eslint-disable-next-line jest/no-conditional-expect
expect(args).toBe('completed');
checked = true;
}
called += 1;
});
await context.initialize(true);
expect(called).toBe(2);
expect(checked).toBe(true);
});
it("should emit 'failed' when the save operation fails out", async () => {
context = new Context({
manager,
factory,
path: 'readonly.txt'
});
let called = 0;
let checked;
context.saveState.connect((sender, args) => {
if (called > 0) {
// eslint-disable-next-line jest/no-conditional-expect
expect(sender).toBe(context);
checked = args;
}
called += 1;
});
await expect(context.initialize(true)).rejects.toThrow(
/Invalid response: 403/
);
expect(called).toBe(2);
expect(checked).toBe('failed');
await acceptDialog();
});
});
describe('#isReady', () => {
it('should indicate whether the context is ready', async () => {
expect(context.isReady).toBe(false);
const func = async () => {
await context.ready;
expect(context.isReady).toBe(true);
};
const promise = func();
await context.initialize(true);
await promise;
});
});
describe('#ready()', () => {
it('should resolve when the file is saved for the first time', async () => {
await context.initialize(true);
await expect(context.ready).resolves.not.toThrow();
});
it('should resolve when the file is reverted for the first time', async () => {
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'foo'
});
await context.initialize(false);
await expect(context.ready).resolves.not.toThrow();
});
});
describe('#disposed', () => {
it('should be emitted when the context is disposed', () => {
let called = false;
context.disposed.connect((sender, args) => {
expect(sender).toBe(context);
expect(args).toBeUndefined();
called = true;
});
context.dispose();
expect(called).toBe(true);
});
});
describe('#model', () => {
it('should be the model associated with the document', () => {
expect(context.model.toString()).toBe('');
});
});
describe('#sessionContext', () => {
it('should be a ISessionContext object', () => {
expect(context.sessionContext).toBeInstanceOf(SessionContext);
});
});
describe('#path', () => {
it('should be the current path for the context', () => {
expect(typeof context.path).toBe('string');
});
});
describe('#lastModifiedCheckMargin', () => {
it('should be 500ms by default', () => {
expect(context.lastModifiedCheckMargin).toBe(500);
});
it('should be set-able', () => {
context.lastModifiedCheckMargin = 600;
expect(context.lastModifiedCheckMargin).toBe(600);
});
});
describe('#contentsModel', () => {
it('should be `null` before population', () => {
expect(context.contentsModel).toBeNull();
});
it('should be set after population', async () => {
const { path } = context;
void context.initialize(true);
await context.ready;
expect(context.contentsModel!.path).toBe(path);
// @ts-expect-error content is omitted
expect(context.contentsModel!['content']).toBeUndefined();
});
});
describe('#factoryName', () => {
it('should be the name of the factory used by the context', () => {
expect(context.factoryName).toBe(factory.name);
});
});
describe('#isDisposed', () => {
it('should test whether the context is disposed', () => {
expect(context.isDisposed).toBe(false);
context.dispose();
expect(context.isDisposed).toBe(true);
});
});
describe('#dispose()', () => {
it('should dispose of the resources used by the context', () => {
context.dispose();
expect(context.isDisposed).toBe(true);
context.dispose();
expect(context.isDisposed).toBe(true);
});
});
describe('#rename()', () => {
it('should change the name of the file to the new name', async () => {
await context.initialize(true);
context.model.fromString('foo');
const newName = UUID.uuid4() + '.txt';
await context.rename(newName);
await context.save();
const opts: Contents.IFetchOptions = {
format: factory.fileFormat,
type: factory.contentType,
content: true
};
const model = await manager.contents.get(newName, opts);
expect(model.content).toBe('foo');
});
});
describe('#save()', () => {
it('should save the contents of the file to disk', async () => {
await context.initialize(true);
context.model.fromString('foo');
await context.save();
const opts: Contents.IFetchOptions = {
format: factory.fileFormat,
type: factory.contentType,
content: true
};
const model = await manager.contents.get(context.path, opts);
expect(model.content).toBe('foo');
});
it('should should preserve LF line endings upon save', async () => {
await context.initialize(true);
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'foo\nbar'
});
await context.revert();
await context.save();
const opts: Contents.IFetchOptions = {
format: factory.fileFormat,
type: factory.contentType,
content: true
};
const model = await manager.contents.get(context.path, opts);
expect(model.content).toBe('foo\nbar');
});
it('should should preserve CR line endings upon save', async () => {
await context.initialize(true);
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'foo\rbar'
});
await context.revert();
await context.save();
const opts: Contents.IFetchOptions = {
format: factory.fileFormat,
type: factory.contentType,
content: true
};
const model = await manager.contents.get(context.path, opts);
expect(model.content).toBe('foo\rbar');
});
it('should should preserve CRLF line endings upon save', async () => {
await context.initialize(true);
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'foo\r\nbar'
});
await context.revert();
await context.save();
const opts: Contents.IFetchOptions = {
format: factory.fileFormat,
type: factory.contentType,
content: true
};
const model = await manager.contents.get(context.path, opts);
expect(model.content).toBe('foo\r\nbar');
});
});
describe('#saveAs()', () => {
it('should save the document to a different path chosen by the user', async () => {
const initialize = context.initialize(true);
const newPath = UUID.uuid4() + '.txt';
const func = async () => {
await initialize;
await waitForDialog();
const dialog = document.body.getElementsByClassName('jp-Dialog')[0];
const input = dialog.getElementsByTagName('input')[0];
input.value = newPath;
await acceptDialog();
};
const promise = func();
await initialize;
const changed = signalToPromise(manager.contents.fileChanged);
const oldPath = context.path;
await context.saveAs();
await promise;
// We no longer rename the current document
//expect(context.path).toBe(newPath);
// Make sure the signal emitted has a different path
const res = await changed;
expect(res[1].type).toBe('save');
expect(res[1].newValue?.path).toEqual(newPath);
expect(res[1].newValue?.path !== oldPath).toBe(true);
// Make sure the both files are there now.
const model = await manager.contents.get('', { content: true });
expect(model.content.find((x: any) => x.name === oldPath)).toBeTruthy();
expect(model.content.find((x: any) => x.name === newPath)).toBeTruthy();
// Make sure both files are equal
const model1 = await manager.contents.get(oldPath, { content: true });
const model2 = await manager.contents.get(newPath, { content: true });
expect(model1.content).toEqual(model2.content);
});
it('should bring up a conflict dialog', async () => {
const newPath = UUID.uuid4() + '.txt';
const func = async () => {
await waitForDialog();
const dialog = document.body.getElementsByClassName('jp-Dialog')[0];
const input = dialog.getElementsByTagName('input')[0];
input.value = newPath;
await acceptDialog(); // Accept rename dialog
await acceptDialog(); // Accept conflict dialog
};
await manager.contents.save(newPath, {
type: factory.contentType,
format: factory.fileFormat,
content: 'foo'
});
await context.initialize(true);
const promise = func();
const oldPath = context.path;
await context.saveAs();
await promise;
// We no longer rename the current document
//expect(context.path).toBe(newPath);
// Make sure the both files are there now.
const model = await manager.contents.get('', { content: true });
expect(model.content.find((x: any) => x.name === oldPath)).toBeTruthy();
expect(model.content.find((x: any) => x.name === newPath)).toBeTruthy();
// Make sure both files are equal
const model1 = await manager.contents.get(oldPath, { content: true });
const model2 = await manager.contents.get(newPath, { content: true });
expect(model1.content).toEqual(model2.content);
});
it('should keep the file if overwrite is aborted', async () => {
const oldPath = context.path;
const newPath = UUID.uuid4() + '.txt';
const func = async () => {
await waitForDialog();
const dialog = document.body.getElementsByClassName('jp-Dialog')[0];
const input = dialog.getElementsByTagName('input')[0];
input.value = newPath;
await acceptDialog(); // Accept rename dialog
await dismissDialog(); // Reject conflict dialog
};
await manager.contents.save(newPath, {
type: factory.contentType,
format: factory.fileFormat,
content: 'foo'
});
await context.initialize(true);
const promise = func();
await context.saveAs();
await promise;
expect(context.path).toBe(oldPath);
});
it('should just save if the file name does not change', async () => {
const changed = signalToPromise(manager.contents.fileChanged);
const path = context.path;
await context.initialize(true);
const promise = context.saveAs();
await acceptDialog();
await promise;
expect(context.path).toBe(path);
const res = await changed;
expect(res[1].newValue?.path).toEqual(path);
});
it('should no trigger save signal if the user cancel the dialog', async () => {
let saveEmitted = false;
await context.initialize(true);
manager.contents.fileChanged.connect((sender, args) => {
if (args.type === 'save') {
saveEmitted = true;
}
});
const promise = context.saveAs();
await dismissDialog();
await promise;
expect(saveEmitted).toEqual(false);
});
});
describe('#revert()', () => {
it('should revert the contents of the file to the disk', async () => {
await context.initialize(true);
context.model.fromString('foo');
await context.save();
context.model.fromString('bar');
await context.revert();
expect(context.model.toString()).toBe('foo');
});
it('should normalize CRLF line endings to LF', async () => {
await context.initialize(true);
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'foo\r\nbar'
});
await context.revert();
expect(context.model.toString()).toBe('foo\nbar');
});
});
describe('#createCheckpoint()', () => {
it('should create a checkpoint for the file', async () => {
await context.initialize(true);
const model = await context.createCheckpoint();
expect(model.id).toBeTruthy();
expect(model.last_modified).toBeTruthy();
});
});
describe('#deleteCheckpoint()', () => {
it('should delete the given checkpoint', async () => {
await context.initialize(true);
const model = await context.createCheckpoint();
await context.deleteCheckpoint(model.id);
const models = await context.listCheckpoints();
expect(models.length).toBe(0);
});
});
describe('#restoreCheckpoint()', () => {
it('should restore the value to the last checkpoint value', async () => {
context.model.fromString('bar');
await context.initialize(true);
const model = await context.createCheckpoint();
context.model.fromString('foo');
const id = model.id;
await context.save();
await context.restoreCheckpoint(id);
await context.revert();
expect(context.model.toString()).toBe('bar');
});
});
describe('#listCheckpoints()', () => {
it('should list the checkpoints for the file', async () => {
await context.initialize(true);
const model = await context.createCheckpoint();
const id = model.id;
const models = await context.listCheckpoints();
let found = false;
for (const model of models) {
if (model.id === id) {
found = true;
}
}
expect(found).toBe(true);
});
});
describe('#urlResolver', () => {
it('should be a url resolver', () => {
expect(context.urlResolver).toBeInstanceOf(
RenderMimeRegistry.UrlResolver
);
});
});
describe('#addSibling()', () => {
it('should add a sibling widget', () => {
let called = false;
const opener = (widget: Widget) => {
called = true;
};
context = new Context({
manager,
factory,
path: UUID.uuid4() + '.txt',
opener
});
context.addSibling(new Widget());
expect(called).toBe(true);
});
});
});
});
``` | /content/code_sandbox/packages/docregistry/test/context.spec.ts | xml | 2016-06-03T20:09:17 | 2024-08-16T19:12:44 | jupyterlab | jupyterlab/jupyterlab | 14,019 | 4,498 |
```xml
<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.zheng</groupId>
<artifactId>zheng-pay</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>zheng-pay</name>
<url>path_to_url
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
<modules>
<module>zheng-pay-common</module>
<module>zheng-pay-dao</module>
<module>zheng-pay-rpc-api</module>
<module>zheng-pay-rpc-service</module>
<module>zheng-pay-sdk</module>
<module>zheng-pay-web</module>
<module>zheng-pay-admin</module>
</modules>
</project>
``` | /content/code_sandbox/zheng-pay/pom.xml | xml | 2016-10-04T10:07:06 | 2024-08-16T07:00:44 | zheng | shuzheng/zheng | 16,660 | 273 |
```xml
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
import type { ViewProps } from './utils';
import type { UnsafeMixed } from './codegenUtils';
import { NumberProp } from '../lib/extract/types';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
pointerEvents?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
payload?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: UnsafeMixed<NumberProp>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: UnsafeMixed<ReadonlyArray<NumberProp> | NumberProp>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
filter?: string;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps {
d?: string;
}
export default codegenNativeComponent<NativeProps>('RNSVGPath');
``` | /content/code_sandbox/src/fabric/PathNativeComponent.ts | xml | 2016-01-17T14:29:21 | 2024-08-16T13:35:44 | react-native-svg | software-mansion/react-native-svg | 7,397 | 403 |
```xml
export * from './ListedClientInterface'
export * from './ListedService'
``` | /content/code_sandbox/packages/snjs/lib/Services/Listed/index.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 18 |
```xml
import type { ChangeEvent } from 'react';
import { useEffect } from 'react';
import { c } from 'ttag';
import type { WasmFiatCurrencySymbol } from '@proton/andromeda';
import { CircleLoader } from '@proton/atoms/CircleLoader';
import type { ModalOwnProps } from '@proton/components/components';
import {
Collapsible,
CollapsibleContent,
CollapsibleHeader,
CollapsibleHeaderIconButton,
DropdownSizeUnit,
Icon,
ModalTwoFooter,
PasswordInputTwo,
TextAreaTwo,
useModalStateWithData,
} from '@proton/components/components';
import { useWalletSettings } from '@proton/wallet';
import { Button, CoreButton, CoreButtonLike, Input, Modal } from '../../atoms';
import { CurrencySelect } from '../../atoms/CurrencySelect';
import { useWalletCreation } from '../../hooks/useWalletCreation';
import type { SubTheme } from '../../utils';
import { getTermAndConditionsSentence } from '../../utils/legal';
import type { WalletInformationalModalOwnProps } from '../WalletInformationalModal';
import { WalletInformationalModal } from '../WalletInformationalModal';
interface Props extends ModalOwnProps {
theme?: SubTheme;
walletName?: string;
currency?: WasmFiatCurrencySymbol;
isFirstCreation?: boolean;
onFinish: () => void;
}
export const WalletImportModal = ({
theme,
walletName: inputWalletName,
currency: inputCurrency,
isFirstCreation,
onFinish,
...modalProps
}: Props) => {
const [modal, setModal] = useModalStateWithData<WalletInformationalModalOwnProps>();
const [walletSettings] = useWalletSettings();
const {
walletName,
handleWalletNameChange,
selectedCurrency,
setSelectedCurrency,
passphrase,
handlePassphraseChange,
currencies,
loadingCurrencies,
mnemonic,
mnemonicError,
handleMnemonicChange,
loadingWalletSubmit,
onWalletSubmit,
} = useWalletCreation({
onSetupFinish: () => {
modalProps.onClose?.();
onFinish();
},
});
useEffect(() => {
if (inputCurrency) {
setSelectedCurrency(inputCurrency);
}
}, [setSelectedCurrency, inputCurrency]);
useEffect(() => {
if (inputWalletName) {
handleWalletNameChange(inputWalletName);
}
}, [inputWalletName, handleWalletNameChange]);
return (
<>
<Modal title={c('Wallet setup').t`Import wallet`} className={theme} {...modalProps}>
<div className="flex flex-column mt-6 gap-1">
{!isFirstCreation && (
<div>
<Input
prefix={
<div
className="rounded-full flex p-3"
style={{ background: 'var(--interaction-norm-minor-2)' }}
>
<Icon name="wallet" style={{ color: 'var(--interaction-norm-major-1)' }}></Icon>
</div>
}
label={c('Wallet setup').t`Name`}
id="wallet-name-input"
placeholder={c('Wallet setup').t`Give a name to this wallet`}
value={walletName}
disabled={loadingWalletSubmit}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
handleWalletNameChange(event.target.value);
}}
/>
</div>
)}
<div>
<CurrencySelect
disabled={loadingCurrencies || loadingWalletSubmit}
label={c('Wallet preferences').t`Default currency`}
placeholder={c('Wallet preferences').t`Select your currency`}
value={selectedCurrency}
onSelect={(value) => {
setSelectedCurrency(value.Symbol);
}}
options={currencies ?? []}
size={{
width: DropdownSizeUnit.Anchor,
maxWidth: DropdownSizeUnit.Viewport,
}}
/>
</div>
<Input
as={TextAreaTwo}
rows={3}
label={c('Wallet setup').t`Seed phrase (12-24 words)`}
value={mnemonic}
onValue={(v: string) => handleMnemonicChange(v)}
className="bg-weak"
error={mnemonicError}
/>
<CoreButtonLike
className="mr-auto"
shape="underline"
color="norm"
onClick={() => {
setModal({ kind: 'wallet-seedphrase-introduction' });
}}
>{c('Wallet setup').t`What's a wallet seed phrase?`}</CoreButtonLike>
</div>
<Collapsible>
<CollapsibleHeader
className="color-hint my-3"
suffix={
<CollapsibleHeaderIconButton>
<Icon name="chevron-down" />
</CollapsibleHeaderIconButton>
}
>{c('Wallet setup').t`My wallet had a passphrase`}</CollapsibleHeader>
<CollapsibleContent>
<Input
autoFocus
id="passphrase"
as={PasswordInputTwo}
value={passphrase}
disabled={loadingWalletSubmit}
onValue={handlePassphraseChange}
label={c('Wallet setup').t`Passphrase`}
placeholder={c('Placeholder').t`Enter a passphrase or leave empty`}
/>
<CoreButton
className="my-3"
shape="underline"
color="norm"
onClick={() => {
setModal({ kind: 'wallet-passphrase-introduction' });
}}
>{c('Wallet setup').t`What's a wallet passphrase?`}</CoreButton>
</CollapsibleContent>
</Collapsible>
<ModalTwoFooter className="prompt-footer">
<div className="w-full flex flex-row gap-2">
<Button
fullWidth
className="block mt-2"
size="large"
shape="solid"
color="norm"
disabled={loadingWalletSubmit}
onClick={() => {
void onWalletSubmit({ isFirstCreation, isImported: true });
}}
>
{c('Wallet setup').t`Import`}
{loadingWalletSubmit && <CircleLoader className="ml-2" />}
</Button>
</div>
{walletSettings?.AcceptTermsAndConditions ? undefined : (
<p className="color-weak text-break text-center text-sm">{getTermAndConditionsSentence()}</p>
)}
</ModalTwoFooter>
</Modal>
{modal.data && <WalletInformationalModal kind={modal.data.kind} {...modal} />}
</>
);
};
``` | /content/code_sandbox/applications/wallet/src/app/components/WalletImportModal/index.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 1,385 |
```xml
export * from "./Contract";
export * from "./EventEmitterModule";
``` | /content/code_sandbox/src/main/Core/EventEmitter/index.ts | xml | 2016-10-11T04:59:52 | 2024-08-16T11:53:31 | ueli | oliverschwendener/ueli | 3,543 | 15 |
```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.itmuch.cloud</groupId>
<artifactId>microservice-provider-user-sleuth-zipkin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- spring boot -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.7.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
</dependencies>
<!-- spring cloud -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- spring-bootmaven -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
``` | /content/code_sandbox/2018-Finchley/microservice-provider-user-sleuth-zipkin/pom.xml | xml | 2016-08-26T09:35:58 | 2024-08-12T06:14:53 | spring-cloud-study | eacdy/spring-cloud-study | 1,042 | 621 |
```xml
/**
* @license
*/
import {FunctionComponent} from 'preact';
import {renderCategoryScore} from '../../../report/renderer/api';
import {useExternalRenderer} from '../util';
export const CategoryScore: FunctionComponent<{
category: LH.ReportResult.Category,
href: string,
gatherMode: LH.Result.GatherMode,
}> = ({category, href, gatherMode}) => {
const ref = useExternalRenderer<HTMLDivElement>(() => {
return renderCategoryScore(category, {
gatherMode,
omitLabel: true,
onPageAnchorRendered: link => link.href = href,
});
}, [category, href]);
return (
<div ref={ref} data-testid="CategoryScore"/>
);
};
``` | /content/code_sandbox/flow-report/src/wrappers/category-score.tsx | xml | 2016-03-08T01:03:11 | 2024-08-16T10:56:56 | lighthouse | GoogleChrome/lighthouse | 28,125 | 153 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const CaretSolidRightIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M640 0l1024 1024L640 2048V0z" />
</svg>
),
displayName: 'CaretSolidRightIcon',
});
export default CaretSolidRightIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/CaretSolidRightIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 120 |
```xml
<vector xmlns:android="path_to_url" android:height="34.0dp" android:tint="?attr/colorControlNormal" android:viewportHeight="16" android:viewportWidth="16" android:width="34.0dp">
<path android:fillColor="@android:color/white" android:pathData="M 9.5,1.0 C 9.4862,1.002 9.4725,1.005 9.459,1.008 C 9.4212,1.011 9.3838,1.0181 9.3477,1.0295 C 9.3256,1.0365 9.3041,1.045 9.2832,1.0549 C 9.2406,1.0753 9.2012,1.1016 9.166,1.133 C 9.159,1.137 9.1529,1.142 9.1465,1.1467 L 3.1465,7.1467 L 2.1465,8.1467 C 2.0527,8.2405 2.0,8.3676 2.0,8.5002 L 2.0,10.5002 C 2.0,10.7763 2.2239,11.0002 2.5,11.0002 L 2.6914,11.0002 L 2.0528,12.2776 C 2.0181,12.3468 2.0002,12.4229 2.0,12.5002 L 2.0,14.5002 C 2.0,14.7764 2.2239,15.0002 2.5,15.0002 C 2.7762,15.0002 3.0,14.7764 3.0,14.5002 L 3.0,12.6174 L 3.8086,11.0 L 6.1914,11.0 L 7.0,12.6172 L 7.0,14.5 C 7.0,14.7761 7.2239,15.0 7.5,15.0 C 7.7761,15.0 8.0,14.7761 8.0,14.5 L 8.0,12.5 C 7.9999,12.4227 7.9818,12.3465 7.9473,12.2773 L 7.3086,11.0 L 7.5,11.0 C 7.7761,11.0 8.0,10.7761 8.0,10.5 L 8.0,8.5 C 8.0,8.3674 7.9473,8.2402 7.8535,8.1465 L 7.1074,7.4004 L 9.4062,2.8027 L 11.0254,7.6582 C 11.0304,7.6695 11.0367,7.6806 11.043,7.6914 C 11.0551,7.7214 11.0702,7.7502 11.0879,7.7773 C 11.0979,7.7915 11.108,7.8052 11.1191,7.8183 C 11.1397,7.8426 11.1626,7.8648 11.1875,7.8847 C 11.1994,7.895 11.2118,7.9048 11.2246,7.914 C 11.2547,7.9337 11.2867,7.95 11.3203,7.9628 C 11.3337,7.9688 11.3474,7.9738 11.3613,7.9784 C 11.4063,7.992 11.453,7.9993 11.5,7.9999 C 11.501,7.9999 11.503,7.9999 11.504,7.9999 C 11.706,8.0019 11.8855,8.1216 11.9629,8.3085 C 12.0408,8.4967 11.9975,8.7094 11.8536,8.8534 C 11.7096,8.9974 11.4968,9.0407 11.3086,8.9628 C 11.1204,8.885 11.0,8.7037 11.0,8.5 C 11.0,8.2239 10.7761,8.0 10.5,8.0 C 10.2239,8.0 10.0,8.2239 10.0,8.5 C 10.0,9.1053 10.3666,9.6551 10.9258,9.8867 C 11.485,10.1183 12.1326,9.9885 12.5605,9.5606 C 12.9885,9.1326 13.1183,8.485 12.8867,7.9258 C 12.7046,7.486 12.3249,7.1657 11.8769,7.0488 L 9.9746,1.3418 C 9.9716,1.3368 9.9696,1.3328 9.9666,1.3281 C 9.9523,1.2866 9.9326,1.2472 9.908,1.2109 C 9.907,1.2099 9.905,1.2079 9.904,1.2069 C 9.8887,1.1854 9.8717,1.1652 9.8532,1.1464 C 9.8462,1.1414 9.839,1.1374 9.8317,1.1327 C 9.7993,1.1034 9.7632,1.0784 9.7243,1.0585 C 9.7104,1.0495 9.696,1.0422 9.6813,1.0351 C 9.6344,1.0167 9.585,1.0055 9.5348,1.0019 C 9.5288,1.0025 9.5231,1.0029 9.5172,1.0039 C 9.5112,1.0029 9.5055,1.0009 9.4996,0.9999 L 9.5,1.0 M 7.6758,4.0312 L 6.1914,7.0 L 4.707,7.0 L 7.6758,4.0312"/>
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/ic_preset_roentgen_crane_portal.xml | xml | 2016-07-02T10:44:04 | 2024-08-16T18:55:54 | StreetComplete | streetcomplete/StreetComplete | 3,781 | 1,622 |
```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 hypotf = require( './index' );
// TESTS //
// The function returns a number...
{
hypotf( 8, 2 ); // $ExpectType number
}
// The compiler throws an error if the function is provided values other than two numbers...
{
hypotf( true, 3 ); // $ExpectError
hypotf( false, 2 ); // $ExpectError
hypotf( '5', 1 ); // $ExpectError
hypotf( [], 1 ); // $ExpectError
hypotf( {}, 2 ); // $ExpectError
hypotf( ( x: number ): number => x, 2 ); // $ExpectError
hypotf( 9, true ); // $ExpectError
hypotf( 9, false ); // $ExpectError
hypotf( 5, '5' ); // $ExpectError
hypotf( 8, [] ); // $ExpectError
hypotf( 9, {} ); // $ExpectError
hypotf( 8, ( x: number ): number => x ); // $ExpectError
hypotf( [], true ); // $ExpectError
hypotf( {}, false ); // $ExpectError
hypotf( false, '5' ); // $ExpectError
hypotf( {}, [] ); // $ExpectError
hypotf( '5', ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the function is provided insufficient arguments...
{
hypotf(); // $ExpectError
hypotf( 3 ); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/math/base/special/hypotf/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 421 |
```xml
// See LICENSE.txt for license information.
import React from 'react';
import CustomStatusEmoji from '@components/custom_status/custom_status_emoji';
import type {EmojiCommonStyle} from '@typings/components/emoji';
import type {StyleProp} from 'react-native';
type Props = {
customStatus?: UserCustomStatus;
customStatusExpired: boolean;
isCustomStatusEnabled: boolean;
style: StyleProp<EmojiCommonStyle>;
}
const CustomStatus = ({customStatus, customStatusExpired, isCustomStatusEnabled, style}: Props) => {
const showCustomStatusEmoji = Boolean(isCustomStatusEnabled && customStatus?.emoji && !customStatusExpired);
if (!showCustomStatusEmoji) {
return null;
}
return (
<CustomStatusEmoji
customStatus={customStatus!}
style={style}
/>
);
};
export default CustomStatus;
``` | /content/code_sandbox/app/components/channel_item/custom_status/custom_status.tsx | xml | 2016-10-07T16:52:32 | 2024-08-16T12:08:38 | mattermost-mobile | mattermost/mattermost-mobile | 2,155 | 185 |
```xml
import React from 'react';
import { createBEM } from '@zarm-design/bem';
import { Minus as MinusIcon, Plus as PlusIcon } from '@zarm-design/icons';
import type { BaseStepperProps } from './interface';
import Button from '../button';
import { ConfigContext } from '../config-provider';
import CustomInput from '../custom-input';
import type { CustomInputProps } from '../custom-input';
import Input from '../input';
import type { InputProps } from '../input';
import type { HTMLProps } from '../utils/utilityTypes';
export interface StepperCssVars {
'--height'?: React.CSSProperties['height'];
'--input-width'?: React.CSSProperties['width'];
'--input-background'?: React.CSSProperties['background'];
'--input-border-width'?: React.CSSProperties['borderWidth'];
'--input-border-color'?: React.CSSProperties['borderColor'];
'--input-border-radius'?: React.CSSProperties['borderRadius'],
'--input-text-color'?: React.CSSProperties['color'],
'--input-font-size'?: React.CSSProperties['fontSize'];
'--input-disabled-text-color'?: React.CSSProperties['color'];
'--input-disabled-opacity'?: React.CSSProperties['opacity'];
'--input-margin'?: React.CSSProperties['margin'];
'--input-padding'?: React.CSSProperties['padding'];
'--icon-font-size'?: React.CSSProperties['fontSize'];
}
const compareValue = (value, max, min) => {
if (typeof max === 'number') {
value = value > max ? max : value;
}
if (typeof min === 'number') {
value = value < min ? min : value;
}
return value;
};
const getPrecision = (value) => {
const valueStr = value?.toString();
if (valueStr && valueStr.indexOf('e-') >= 0) {
return parseInt(valueStr.slice(valueStr.indexOf('-e')), 10);
}
let precision = 0;
if (valueStr && valueStr.indexOf('.') >= 0) {
precision = valueStr.length - valueStr.indexOf('.') - 1;
}
return precision;
};
const getMaxPrecision = (currentValue, step) => {
const stepPrecision = getPrecision(step);
const currentValuePrecision = getPrecision(currentValue);
return Math.max(currentValuePrecision, stepPrecision);
};
const getPrecisionFactor = (currentValue, step) => {
const precision = getMaxPrecision(currentValue, step);
return 10 ** precision;
};
const formatValue = (currentValue, step) => {
const precision = getMaxPrecision(currentValue, step);
// 1.00jstoFixed(2)
if (precision > 0) {
return Number(currentValue).toFixed(precision);
}
return Number(Number(currentValue).toFixed(precision));
};
const getValue = (props: StepperProps, defaultValue: number) => {
const { value, max, min, step } = props;
let tempValue = props.defaultValue === undefined ? defaultValue : props.defaultValue;
tempValue = value === undefined ? tempValue : value;
return formatValue(compareValue(tempValue, max, min), step);
};
export type StepperProps = BaseStepperProps & HTMLProps<StepperCssVars>;
const Stepper = React.forwardRef<unknown, StepperProps>((props, ref) => {
const {
className,
style,
shape,
disabled,
size,
type,
disableInput,
step,
max,
min,
value,
defaultValue,
onChange,
onInputChange,
} = props;
const stepperRef = (ref as any) || React.createRef<HTMLSpanElement>();
const [currentValue, setCurrentValue] = React.useState(
getValue({ value, defaultValue, min, max }, 0),
);
const [lastValue, setLastValue] = React.useState(
getValue({ value, defaultValue, min, max, step }, 0),
);
const { prefixCls } = React.useContext(ConfigContext);
const bem = createBEM('stepper', { prefixCls });
const onInputChangeCallback = (newValue: string | number) => {
setCurrentValue(newValue);
onInputChange?.(newValue);
};
const onInputBlur = (newValue: number | string) => {
let newCurrentValue = newValue;
if (Number.isNaN(Number(newValue))) {
newCurrentValue = lastValue;
}
newCurrentValue = formatValue(compareValue(newCurrentValue, max, min), step);
setCurrentValue(newCurrentValue);
setLastValue(newCurrentValue);
onChange?.(newCurrentValue);
};
const isSubDisabled = () => {
if (min === null) {
return false;
}
return currentValue <= min! || disabled;
};
const isPlusDisabled = () => {
if (max === null) {
return false;
}
return currentValue >= max! || disabled;
};
const onSubClick = () => {
if (isSubDisabled()) {
return;
}
const precisionFactor = getPrecisionFactor(currentValue, step);
const precision = getMaxPrecision(currentValue, step);
const newValue =
(precisionFactor * Number(currentValue) - precisionFactor * step!) / precisionFactor;
onInputBlur(newValue.toFixed(precision));
};
const onPlusClick = () => {
if (isPlusDisabled()) {
return;
}
const precisionFactor = getPrecisionFactor(currentValue, step);
const precision = getMaxPrecision(currentValue, step);
const newValue =
(precisionFactor * Number(currentValue) + precisionFactor * step!) / precisionFactor;
onInputBlur(newValue.toFixed(precision));
};
React.useEffect(() => {
const newValue = getValue({ value, defaultValue, min, max, step }, 0);
setCurrentValue(newValue);
setLastValue(newValue);
}, [value, defaultValue, min, max, step]);
const cls = bem([
{
[`${shape}`]: !!shape,
[`${size}`]: !!size,
disabled,
},
className,
]);
const inputCls = bem('input', [
{
disabled: disableInput,
},
]);
const buttonSize = size === 'lg' ? 'sm' : 'xs';
const inputProps = {
className: inputCls,
type,
value: currentValue,
disabled: disabled || disableInput,
clearable: false,
onChange: () => !disabled && onInputChangeCallback(currentValue),
onBlur: () => !disabled && onInputBlur(currentValue),
};
return (
<span ref={stepperRef} className={cls} style={style}>
<Button
className={bem('sub')}
size={buttonSize}
disabled={isSubDisabled()}
shape={shape}
onClick={onSubClick}
>
<MinusIcon />
</Button>
{['price'].indexOf(type!) > -1 ? (
<CustomInput
{...(inputProps as CustomInputProps)}
onChange={(v) => !disabled && onInputChangeCallback(v!)}
/>
) : (
<Input
{...(inputProps as InputProps)}
onChange={(e) => !disabled && onInputChangeCallback(e.target.value)}
/>
)}
<Button
className={bem('plus')}
size={buttonSize}
disabled={isPlusDisabled()}
shape={shape}
onClick={onPlusClick}
>
<PlusIcon />
</Button>
</span>
);
});
Stepper.displayName = 'Stepper';
Stepper.defaultProps = {
shape: 'radius',
disabled: false,
step: 1,
type: 'number',
disableInput: false,
};
export default Stepper;
``` | /content/code_sandbox/packages/zarm/src/stepper/Stepper.tsx | xml | 2016-07-13T11:45:37 | 2024-08-12T19:23:48 | zarm | ZhongAnTech/zarm | 1,707 | 1,649 |
```xml
<Documentation>
<Docs DocId="T:UIKit.UIScrollView">
<summary>A <see cref="T:UIKit.UIView" /> that can scroll, pan, and page its children.</summary>
<remarks>
<para>
The <see cref="T:UIKit.UIScrollView" /> class is a container that provides scrolling, zooming, and panning functionality of its content
view. Because the <see cref="T:UIKit.UIScrollView" /> class provides out-of-the-box functionality for scrolling and paging, it is generally used as the basis for <see cref="T:UIKit.UIView" />s whose content is larger than the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIView.Frame" />. The need for and range of scrolling is specified by the application developer setting the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" /> to a <see cref="T:System.Drawing.SizeF" />
greater than the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIView.Frame" />.
</para>
<para>
The most common ways to use the <see cref="T:UIKit.UIScrollView" /> are to either:
</para>
<list type="bullet">
<item>
<term>
Add a single large subview, generally with a <see cref="P:UIKit.UIView.Frame" /> whose <see cref="P:System.Drawing.RectangleF.Location" />
is [0,0] and whose <see cref="T:System.Drawing.SizeF" /> is the same as the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" />; or
</term>
</item>
<item>
<term>
Arrange multiple subviews within the <see cref="T:UIKit.UIScrollView" />'s
<see cref="P:UIKit.UIScrollView.ContentSize" /> and use the <see cref="T:UIKit.UIScrollView" /> to scroll between them or, by
setting <see cref="P:UIKit.UIScrollView.PagingEnabled" /> to <see langword="true" />, to page between them. This is often done in
conjunction with a <see cref="T:UIKit.UIPageControl" />; or
</term>
</item>
<item>
<term>
Subclass <see cref="T:UIKit.UIScrollView" /> and extend it's functionality. In fact, the <see cref="T:UIKit.UIScrollView" /> is
the base class of such commonly-used classes as <see cref="T:UIKit.UITextField" /> and <see cref="T:UIKit.UITableView" />.
</term>
</item>
</list>
<format type="text/html">
<h2>Using A Single Large Subview</h2>
</format>
<para>
The following image, drawn from the "Scroll View" demo in the "iOS Standard Controls" sample, illustrates the simplest use-case: a single large subview (in this case, a <see cref="T:UIKit.UIImageView" />) whose image size
matches the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" />. The <see cref="P:UIKit.UIScrollView.ContentOffset" /> of the <see cref="T:UIKit.UIScrollView" /> corresponds to the image pixel showing
at the origin of the <see cref="T:UIKit.UIImageView" /> (e.g., <see cref="T:System.Drawing.PointF" /> [215, 145]). The <see cref="P:UIKit.UIScrollView.ContentSize" /> of the <see cref="T:UIKit.UIScrollView" /> defines the scroll limits. When the <see cref="P:UIKit.UIScrollView.ContentSize" /> is larger than the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIView.Frame" />, one gets scrolling behavior. If <see cref="P:UIKit.UIScrollView.ContentSize" /> is not set or is
set to too small a <see cref="T:System.Drawing.RectangleF" />, one doesn't (however, <see cref="P:UIKit.UIScrollView.AlwaysBounceVertical" /> and <see cref="P:UIKit.UIScrollView.AlwaysBounceHorizontal" /> can be used to allow dragging even in this situation.)
</para>
<para>
<img href="~/UIKit/_images/UIKit.UIScrollView.Slide2.png" alt="Diagram of content size in a scroll view" />
</para>
<para>
As the following code shows, it's straightforward to create and use a <see cref="T:UIKit.UIScrollView" /> in this manner. The
<c>imageView</c> is initialized from a file. The <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" /> is set to the size of the image (which happens to be 512 x 512 pixels and thus large enough
to require scrolling unless zoomed out) and the <c>imageView</c> is added as a subview.
</para>
<para>
The delegate for the <see cref="P:UIKit.UIScrollView.ViewForZoomingInScrollView" /> property allows the <see cref="T:UIKit.UIScrollView" /> to automatically handle pinch-to-zoom gestures:
</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// create our scroll view
scrollView = new UIScrollView (
new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height - this.NavigationController.NavigationBar.Frame.Height));
this.View.AddSubview (scrollView);
// create our image view
imageView = new UIImageView (UIImage.FromFile ("Images/Icons/512_icon.png"));
scrollView.ContentSize = imageView.Image.Size;
scrollView.MaximumZoomScale = 3f;
scrollView.MinimumZoomScale = .1f;
scrollView.AddSubview (imageView);
scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };
]]></code>
</example>
<para>
The <see cref="T:UIKit.UIScrollView" /> tracks the location of the application-user's fingers and updates the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" /> and
<see cref="P:UIKit.UIScrollView.ZoomScale" /> as they drag, swipe, and make pinch-to-zoom gestures. The <see cref="T:UIKit.UIScrollView" /> draws the
briefly-visible scroll-location indicators, shows the content clipped from its subviews, and animates the scrolling, panning, and zooming
transitions. As the gesture or animation proceeds, the <see cref="T:UIKit.UIScrollView" /> adjusts the <see cref="P:UIKit.UIScrollView.ContentOffset" /> and <see cref="P:UIKit.UIScrollView.ZoomScale" /> appropriately and repeatedly
fires the <see cref="E:UIKit.UIScrollView.Scrolled" /> event.
</para>
<format type="text/html">
<h2>Panning and Paging</h2>
</format>
<para>
The next image, from the "Page Control" demo in the iOS Standard Controls sample, illustrates multiple subviews aligned within the
boundaries of the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" />. The illustration shows
the application in the middle of a swiping animation; portions of both the white and gray subviews are visible.
</para>
<para>
<img href="~/UIKit/_images/UIKit.UIScrollView.Slide1.png" alt="Sequence diagram of user actions and UIScrollView events" />
</para>
<para>
If <see cref="P:UIKit.UIScrollView.PagingEnabled" /> is set to <see langword="true" /> or if the gesture attempts to scroll to an area
outside the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" />, at the end of the gesture the
selected subview will "bounce" into alignment with the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIView.Frame" />.
</para>
<para>
It is up to the application developer to synchronize with the <see cref="T:UIKit.UIPageControl" /> if one is used. A common way to do this
is to handle the <see cref="T:UIKit.UIScrollView" />'s <see cref="E:UIKit.UIScrollView.Scrolled" /> event and change
the model value that is observed by the <see cref="T:UIKit.UIPageControl" /> (or one can imperatively set the <see cref="T:UIKit.UIPageControl" />'s <see cref="P:UIKit.UIPageControl.CurrentPage" />).
</para>
<para>
In the paging demo, the <see cref="P:UIKit.UIView.Frame" />s of the individual subviews and the <see cref="P:UIKit.UIScrollView.ContentSize" /> of the <see cref="T:UIKit.UIScrollView" /> are calculated, aligned, and set using the
following code, taken from the "iOS Standard Controls" sample:
</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// instantiate and add the controllers to our list
controllers.Add (new Controller_1 ());
controllers.Add (new Controller_2 ());
controllers.Add (new Controller_3 ());
for (int i = 0; i < controllers.Count; i++)
{
// set their location and size, each one is moved to the
// right by the width of the previous
RectangleF viewFrame = new RectangleF (
scrlMain.Frame.Width * i,
scrlMain.Frame.Y,
scrlMain.Frame.Width,
scrlMain.Frame.Height);
controllers[i].View.Frame = viewFrame;
// add the view to the scrollview
scrlMain.AddSubview (controllers[i].View);
}
// set our scroll view content size (width = number of pages * scroll view width)
scrlMain.ContentSize = new SizeF (
scrlMain.Frame.Width * controllers.Count, scrlMain.Frame.Height);
]]></code>
</example>
<format type="text/html">
<h2>Tap-To-Zoom</h2>
</format>
<para>
The "tap-to-zoom" gesture consists of the application user double-tapping the scrolling area. To enable this, the developer needs to create a
<see cref="T:UIKit.UITapGestureRecognizer" />, configure it for two taps, give it a unique <see cref="T:ObjCRuntime.Selector" />, and add it to the <see cref="T:UIKit.UIScrollView" />.
Then, the developer has to implement a method with an <see cref="T:Foundation.ExportAttribute" /> configured to the <c>Selector</c> identifier.
</para>
<para>
The following code from the "Implement Tap-To-Zoom Recipe" shows the essential steps:
</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
UITapGestureRecognizer doubletap = new UITapGestureRecognizer();
doubletap.NumberOfTapsRequired = 2; // double tap
doubletap.AddTarget (this, new MonoTouch.ObjCRuntime.Selector("DoubleTapSelector"));
scrollView.AddGestureRecognizer(doubletap); // detect when the scrollView is double-tapped
//...etc...
[MonoTouch.Foundation.Export("DoubleTapSelector")]
public void OnDoubleTap (UIGestureRecognizer sender) {
if (scrollView.ZoomScale >= 1)
scrollView.SetZoomScale(0.25f, true);
else
scrollView.SetZoomScale(2f, true);
}
]]></code>
</example>
<format type="text/html">
<h2>Touch Delays Associated with UIScrollView</h2>
</format>
<para>
Because scrolling and zooming gestures can begin anywhere on the screen, the <see cref="T:UIKit.UIScrollView" /> intercepts touch events
and waits briefly to see if the application user is making a scrolling or zooming gesture. This introduces a small delay but the default behavior
can be customized by overriding the <see cref="T:UIKit.UIScrollView" />'s <see cref="M:UIKit.UIScrollView.TouchesShouldBegin(Foundation.NSSet,UIKit.UIEvent,UIKit.UIView)" />
and <see cref="M:UIKit.UIScrollView.TouchesShouldCancelInContentView(UIKit.UIView)" /> methods.
</para>
<format type="text/html">
<h2>Subview Frames</h2>
</format>
<para>
Although generally the <see cref="P:UIKit.UIView.Frame" />s of the content <see cref="T:UIKit.UIView" />s are aligned with the
extent of the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ContentSize" /> and each other, this is not
a requirement. Setting the <see cref="P:UIKit.UIView.Frame" /> so that it extends beyond the boundaries of the <see cref="P:UIKit.UIScrollView.ContentSize" /> may make drawing geometry easier or more consistent. If, by misaligning subviews, one displays
an area within the <see cref="P:UIKit.UIScrollView.ContentSize" /> of the <see cref="T:UIKit.UIScrollView" /> that does not
contain a <see cref="T:UIKit.UIView" />, gestures for scrolling and zooming occurring in the blank area will not work: the application
must have an underlying <see cref="T:UIKit.UIView" /> to get the expected behavior.
</para>
<para>
Some domains, such as maps and gameboards, may seem to suggest a design in which a <see cref="T:UIKit.UIScrollView" /> has a large number
of tiled subviews. However, all subviews -- whether visible or not -- are rendered and this can be resource- and processor-intensive. In such
cases, it is the application developer's responsibility to add or remove subviews appropriately.
</para>
<format type="text/html">
<h2>Event Sequence</h2>
</format>
<para>
The following illustration shows the user actions and resulting <see cref="T:UIKit.UIScrollView" /> event sequence associated with a dragging or swiping gesture:
</para>
<list type="bullet">
<item>
<term>The user touches the screen;</term>
</item>
<item>
<term>The user begins dragging;</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.DraggingStarted" /> event is raised;</term>
</item>
<item>
<term>As long as the user continues dragging...</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.Scrolled" /> event is raised repeatedly;</term>
</item>
<item>
<term>The user raises their finger...</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.WillEndDragging" /> event is raised;</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.DraggingEnded" /> event is raised;</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.DecelerationStarted" /> event is raised;</term>
</item>
<item>
<term>As long as the scrolling animation continues...</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.Scrolled" /> event is raised repeatedly;</term>
</item>
<item>
<term>The <format type="text/html"><a href="path_to_url" title="E:UIKit.UIScroll.DevelerationEnded">E:UIKit.UIScroll.DevelerationEnded</a></format> event is raised.</term>
</item>
</list>
<para>
<img href="~/UIKit/_images/UIKit.UIScrollView.DragEventSequence.png" alt="Diagram of events relating to dragging in a UIScrollView" />
</para>
<para>
The following illustration shows the user actions and resulting <see cref="T:UIKit.UIScrollView" /> event sequence associated with a pinch-to-zoom gesture:</para>
<list type="bullet">
<item>
<term>The user touches the screen with two fingers;</term>
</item>
<item>
<term>The user begins the pinch-to-zoom gesture;</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.ZoomingStarted" /> event is raised;</term>
</item>
<item>
<term>As long as the user continues pinching...</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.Scrolled" /> event is raised repeatedly because the zooming is effecting the origin of the displayed content;</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.DidZoom" /> event is raised repeatedly;</term>
</item>
<item>
<term>The user raises their fingers...</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.ZoomingEnded" /> event is raised;</term>
</item>
<item>
<term>The <see cref="E:UIKit.UIScrollView.Scrolled" /> event is raised as the content view bounces into alignment;</term>
</item>
</list>
<para>
<img href="~/UIKit/_images/UIKit.UIScrollView.ZoomEventSequence.png" alt="Sequence of events related to zooming" />
</para>
<format type="text/html">
<h2>State Preservation and Restoration</h2>
</format>
<para>
In iOS 6 or later, if the <see cref="P:UIKit.UIView.RestorationIdentifier" /> property is set, on restoration the <see cref="T:UIKit.UIScrollView" />'s <see cref="P:UIKit.UIScrollView.ZoomScale" />, <see cref="P:UIKit.UIScrollView.ContentOffset" />, and <see cref="P:UIKit.UIScrollView.ContentInset" /> properties will be restored.
</para>
<format type="text/html">
<h2>Event-handling</h2>
</format>
<para>
The Xamarin API supports two styles of event notification: the
Objective-C style that uses a delegate class or the C# style using event notifications.
</para>
<para>
The C# style allows the user to add or remove event handlers at runtime by assigning to the events of properties of this class. Event handlers
can be anyone of a method, an anonymous methods or a lambda expression. Using the C# style events or properties will override any manual settings
to the Objective-C Delegate or <see cref="P:UIKit.UIScrollView.WeakDelegate" /> settings.
</para>
<para>
The Objective-C style requires the user to create a new class derived from <see cref="T:UIKit.UIScrollViewDelegate" /> class and assign it
to
the <see cref="P:UIKit.UIScrollView.Delegate" /> property. Alternatively, for
low-level control, by creating a class derived from
<see cref="T:Foundation.NSObject" /> which has every entry point properly decorated with an [Export] attribute (see <see cref="T:Foundation.ExportAttribute" />). The instance of this object
can then be assigned to the <see cref="P:UIKit.UIScrollView.WeakDelegate" /> property.
</para>
</remarks>
<related type="recipe" href="path_to_url">Implement Tap-to-Zoom Recipe</related>
<related type="recipe" href="path_to_url">Create a Horizontal Scrolling Button List</related>
<related type="externalDocumentation" href="path_to_url">Apple documentation for <c>UIScrollView</c></related>
</Docs>
</Documentation>
``` | /content/code_sandbox/docs/api/UIKit/UIScrollView.xml | xml | 2016-04-20T18:24:26 | 2024-08-16T13:29:19 | xamarin-macios | xamarin/xamarin-macios | 2,436 | 4,520 |
```xml
import * as React from "react";
import styles from "./ReactAccordion.module.scss";
import { IReactAccordionProps } from "./IReactAccordionProps";
import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle";
import "./reactAccordion.css";
import {
Accordion,
AccordionItem,
AccordionItemHeading,
AccordionItemButton,
AccordionItemPanel,
} from "react-accessible-accordion";
import { getSP } from "../../../utils/pnpjs-config";
import { SPFI } from "@pnp/sp";
export interface IReactAccordionState {
items: Array<string>;
choices: Array<string>;
allowMultipleExpanded: boolean;
allowZeroExpanded: boolean;
}
export default class ReactAccordion extends React.Component<
IReactAccordionProps,
IReactAccordionState
> {
private _sp: SPFI;
constructor(props: IReactAccordionProps) {
super(props);
this.state = {
items: new Array<string>(),
choices: new Array<string>(),
allowMultipleExpanded: this.props.allowMultipleExpanded,
allowZeroExpanded: this.props.allowZeroExpanded,
};
this._sp = getSP();
this.getListItems();
}
private getListItems(): void {
if (
typeof this.props.listId !== "undefined" &&
this.props.listId.length > 0 &&
typeof this.props.columnTitle !== "undefined" &&
this.props.columnTitle.length > 0 &&
typeof this.props.selectedChoice !== "undefined" &&
this.props.selectedChoice.length > 0
) {
let orderByQuery = '';
if (this.props.accordianSortColumn) {
orderByQuery = `<OrderBy>
<FieldRef Name='${this.props.accordianSortColumn}' ${this.props.isSortDescending ? 'Ascending="False"' : ''} />
</OrderBy>`;
}
const query = `<View>
<Query>
<Where>
<Eq>
<FieldRef Name='${this.props.columnTitle}'/>
<Value Type='Text'>${this.props.selectedChoice}</Value>
</Eq>
</Where>
${orderByQuery}
</Query>
</View>`;
const theAccordianList = this._sp.web.lists.getById(this.props.listId);
theAccordianList
.getItemsByCAMLQuery({
ViewXml: query,
}) //.select("Title", "Answer", "Category")
.then((results: Array<string>) => {
this.setState({
items: results,
});
})
.catch((error) => {
console.log("Failed to get list items!");
console.log(error);
});
}
}
public componentDidUpdate(prevProps: IReactAccordionProps): void {
if (prevProps.listId !== this.props.listId) {
this.getListItems();
}
if (
prevProps.allowMultipleExpanded !== this.props.allowMultipleExpanded ||
prevProps.allowZeroExpanded !== this.props.allowZeroExpanded
) {
this.setState({
allowMultipleExpanded: this.props.allowMultipleExpanded,
allowZeroExpanded: this.props.allowZeroExpanded,
});
}
}
public render(): React.ReactElement<IReactAccordionProps> {
const listSelected: boolean =
typeof this.props.listId !== "undefined" && this.props.listId.length > 0;
const { allowMultipleExpanded, allowZeroExpanded } = this.state;
return (
<div className={styles.reactAccordion}>
{!listSelected && (
<Placeholder
iconName="MusicInCollectionFill"
iconText="Configure your web part"
description="Select a list with a Title field and Content field to have its items rendered in a collapsible accordion format"
buttonLabel="Choose a List"
onConfigure={this.props.onConfigure}
/>
)}
{listSelected && (
<div>
<WebPartTitle
displayMode={this.props.displayMode}
title={this.props.selectedChoice}
updateProperty={this.props.updateProperty}
/>
<Accordion
allowZeroExpanded={allowZeroExpanded}
allowMultipleExpanded={allowMultipleExpanded}
>
{this.state.items.map((item: string) => {
return (
<AccordionItem key={item}>
<AccordionItemHeading>
<AccordionItemButton
title={item[this.props.accordianTitleColumn]}
>
{item[this.props.accordianTitleColumn]}
</AccordionItemButton>
</AccordionItemHeading>
<AccordionItemPanel>
<p
dangerouslySetInnerHTML={{
__html: item[this.props.accordianContentColumn],
}}
/>
</AccordionItemPanel>
</AccordionItem>
);
})}
</Accordion>
</div>
)}
</div>
);
}
}
``` | /content/code_sandbox/samples/react-accordion-dynamic-section/src/webparts/reactAccordion/components/ReactAccordion.tsx | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 1,029 |
```xml
import * as React from 'react';
import { IDocPageProps } from '@fluentui/react/lib/common/DocPage.types';
import { MultiStackedBarChartBasicExample } from './MultiStackedBarChart.Example';
import { MultiStackedBarChartWithPlaceholderExample } from './MultiStackedBarChartWithPlaceHolder.Example';
import { MultiStackedBarChartVariantExample } from './MultiStackedBarChart.Variant.Example';
const MultiStackedBarChartBasicExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChart.Example.tsx') as string;
const MultiStackedBarChartWithPlaceholderExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChartWithPlaceHolder.Example.tsx') as string;
const MultiStackedBarChartVariantExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChart.Variant.Example.tsx') as string;
export const MultiStackedBarChartPageProps: IDocPageProps = {
title: 'MultiStackedBarChart',
componentName: 'MultiStackedBarChart',
componentUrl:
'path_to_url
examples: [
{
title: 'MultiStackedBarChart N/M',
code: MultiStackedBarChartBasicExampleCode,
view: <MultiStackedBarChartBasicExample />,
},
{
title: 'MultiStackedBarChart absolute scale',
code: MultiStackedBarChartVariantExampleCode,
view: <MultiStackedBarChartVariantExample />,
},
{
title: 'MultiStackedBarChart with placeholder',
code: MultiStackedBarChartWithPlaceholderExampleCode,
view: <MultiStackedBarChartWithPlaceholderExample />,
},
],
overview: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react-charting/MultiStackedBarChart/docs/MultiStackedBarChartOverview.md'),
bestPractices: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react-charting/MultiStackedBarChart/docs/MultiStackedBarChartBestPractices.md'),
dos: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react-charting/MultiStackedBarChart/docs/MultiStackedBarChartDos.md'),
donts: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react-charting/MultiStackedBarChart/docs/MultiStackedBarChartDonts.md'),
isHeaderVisible: true,
isFeedbackVisible: true,
};
``` | /content/code_sandbox/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChart.doc.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 610 |
```xml
import path from 'path'
import { preparePackage } from '@pnpm/prepare-package'
import { tempDir } from '@pnpm/prepare'
import { createTestIpcServer } from '@pnpm/test-ipc-server'
import { fixtures } from '@pnpm/test-fixtures'
const f = fixtures(__dirname)
test('prepare package runs the prepublish script', async () => {
const tmp = tempDir()
await using server = await createTestIpcServer(path.join(tmp, 'test.sock'))
f.copy('has-prepublish-script', tmp)
await preparePackage({ rawConfig: {} }, tmp, '')
expect(server.getLines()).toStrictEqual([
'prepublish',
])
})
test('prepare package does not run the prepublish script if the main file is present', async () => {
const tmp = tempDir()
await using server = await createTestIpcServer(path.join(tmp, 'test.sock'))
f.copy('has-prepublish-script-and-main-file', tmp)
await preparePackage({ rawConfig: {} }, tmp, '')
expect(server.getLines()).toStrictEqual([
'prepublish',
])
})
test('prepare package runs the prepublish script in the sub folder if pkgDir is present', async () => {
const tmp = tempDir()
await using server = await createTestIpcServer(path.join(tmp, 'test.sock'))
f.copy('has-prepublish-script-in-workspace', tmp)
await preparePackage({ rawConfig: {} }, tmp, 'packages/foo')
expect(server.getLines()).toStrictEqual([
'prepublish',
])
})
``` | /content/code_sandbox/exec/prepare-package/test/index.ts | xml | 2016-01-28T07:40:43 | 2024-08-16T12:38:47 | pnpm | pnpm/pnpm | 28,869 | 337 |
```xml
<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.zheng</groupId>
<artifactId>zheng-oss</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>zheng-oss</name>
<url>path_to_url
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
<modules>
<module>zheng-oss-sdk</module>
<module>zheng-oss-web</module>
<module>zheng-oss-admin</module>
</modules>
</project>
``` | /content/code_sandbox/zheng-oss/pom.xml | xml | 2016-10-04T10:07:06 | 2024-08-16T07:00:44 | zheng | shuzheng/zheng | 16,660 | 229 |
```xml
import { CheckCircle2 } from "lucide-react"
import { Button } from "./button"
const SuccessPost = ({ text }: { text?: string }) => {
return (
<>
<div className="backdrop-blur-sm z-10 flex flex-col items-center justify-center absolute w-full h-full">
<CheckCircle2 color="green" size={50} className="mb-5" />
<h3 className="text-md font-semibold text-[#444]">
{(text && text) || "Success !"}
</h3>
</div>
</>
)
}
export default SuccessPost
``` | /content/code_sandbox/exm-web/components/ui/successPost.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 133 |
```xml
/*your_sha256_hash-----------------------------
*your_sha256_hash----------------------------*/
import { assert } from 'chai';
import * as TypeMoq from 'typemoq';
import { IServerInfo, MetadataType, ObjectMetadata } from 'vscode-mssql';
import ConnectionManager from '../../src/controllers/connectionManager';
import SqlToolsServiceClient from '../../src/languageservice/serviceclient';
import { IScriptingObject, IScriptingResult, ScriptingRequest, ScriptOperation } from '../../src/models/contracts/scripting/scriptingRequest';
import { TreeNodeInfo } from '../../src/objectExplorer/treeNodeInfo';
import { ScriptingService } from '../../src/scripting/scriptingService';
import { TestExtensionContext } from './stubs';
suite('Scripting Service Tests', () => {
let scriptingService: ScriptingService;
let connectionManager: TypeMoq.IMock<ConnectionManager>;
let client: TypeMoq.IMock<SqlToolsServiceClient>;
setup(() => {
connectionManager = TypeMoq.Mock.ofType(ConnectionManager, TypeMoq.MockBehavior.Loose, TestExtensionContext.object);
connectionManager.setup(c => c.client).returns(() => client.object);
client = TypeMoq.Mock.ofType(SqlToolsServiceClient, TypeMoq.MockBehavior.Loose);
const mockScriptResult: IScriptingResult = {
operationId: undefined,
script: 'test_script'
};
client.setup(c => c.sendRequest(ScriptingRequest.type, TypeMoq.It.isAny())).returns(() => Promise.resolve(mockScriptResult));
connectionManager.object.client = client.object;
connectionManager.setup(c => c.getServerInfo(TypeMoq.It.isAny())).returns(() => {
const serverInfo: IServerInfo = {
engineEditionId: 2,
serverMajorVersion: 1,
isCloud: true,
serverMinorVersion: 0,
serverReleaseVersion: 0,
serverVersion: '',
serverLevel: '',
serverEdition: '',
azureVersion: 0,
osVersion: ''
};
return serverInfo;
});
});
test('Test Get Object From Node function', () => {
const testNodeMetadata: ObjectMetadata = {
metadataType: MetadataType.Table,
metadataTypeName: 'Table',
urn: undefined,
schema: 'dbo',
name: 'test_table'
};
const testNode = new TreeNodeInfo('test_table (System Versioned)', undefined, undefined,
undefined, undefined, 'Table', undefined, undefined, undefined, testNodeMetadata);
scriptingService = new ScriptingService(connectionManager.object);
const expectedScriptingObject: IScriptingObject = {
type: testNodeMetadata.metadataTypeName,
schema: testNodeMetadata.schema,
name: testNodeMetadata.name
};
const scriptingObject = scriptingService.getObjectFromNode(testNode);
assert.equal(scriptingObject.name, expectedScriptingObject.name);
assert.equal(scriptingObject.schema, expectedScriptingObject.schema);
assert.equal(scriptingObject.type, expectedScriptingObject.type);
});
test('Test Create Scripting Params', () => {
const testNodeMetadata: ObjectMetadata = {
metadataType: MetadataType.Table,
metadataTypeName: 'Table',
urn: undefined,
schema: 'dbo',
name: 'test_table'
};
const testNode = new TreeNodeInfo('test_table (System Versioned)', undefined, undefined,
undefined, undefined, 'Table', undefined, undefined, undefined, testNodeMetadata);
scriptingService = new ScriptingService(connectionManager.object);
let scriptingParams = scriptingService.createScriptingParams(testNode, 'test_uri', ScriptOperation.Select);
const scriptingObject = scriptingService.getObjectFromNode(testNode);
assert.notEqual(scriptingParams, undefined);
assert.equal(scriptingParams.scriptDestination, 'ToEditor');
assert.equal(scriptingParams.scriptingObjects[0].name, scriptingObject.name);
assert.equal(scriptingParams.scriptingObjects[0].schema, scriptingObject.schema);
assert.equal(scriptingParams.scriptingObjects[0].type, scriptingObject.type);
assert.equal(scriptingParams.operation, ScriptOperation.Select);
});
test('Test Script Select function', async () => {
const testNodeMetadata: ObjectMetadata = {
metadataType: MetadataType.Table,
metadataTypeName: 'Table',
urn: undefined,
schema: 'dbo',
name: 'test_table'
};
const testNode = new TreeNodeInfo('test_table (System Versioned)', undefined, undefined,
undefined, undefined, 'Table', undefined, undefined, undefined, testNodeMetadata);
scriptingService = new ScriptingService(connectionManager.object);
const script = await scriptingService.script(testNode, 'test_uri', ScriptOperation.Select);
assert.notEqual(script, undefined);
});
test('Test Script Create function', async () => {
const testNodeMetadata: ObjectMetadata = {
metadataType: MetadataType.Table,
metadataTypeName: 'Table',
urn: undefined,
schema: 'dbo',
name: 'test_table'
};
const testNode = new TreeNodeInfo('test_table (System Versioned)', undefined, undefined,
undefined, undefined, 'Table', undefined, undefined, undefined, testNodeMetadata);
scriptingService = new ScriptingService(connectionManager.object);
const script = await scriptingService.script(testNode, 'test_uri', ScriptOperation.Create);
assert.notEqual(script, undefined);
});
test('Test Script Execute function', async () => {
const testNodeMetadata: ObjectMetadata = {
metadataType: MetadataType.SProc,
metadataTypeName: 'StoredProcedure',
urn: undefined,
schema: 'dbo',
name: 'test_proc'
};
const testNode = new TreeNodeInfo('test_table (System Versioned)', undefined, undefined,
undefined, undefined, 'Table', undefined, undefined, undefined, testNodeMetadata);
scriptingService = new ScriptingService(connectionManager.object);
const script = await scriptingService.script(testNode, 'test_uri', ScriptOperation.Execute);
assert.notEqual(script, undefined);
});
test('Test Script Drop function', async () => {
const testNodeMetadata: ObjectMetadata = {
metadataType: MetadataType.Table,
metadataTypeName: 'Table',
urn: undefined,
schema: 'dbo',
name: 'test_table'
};
const testNode = new TreeNodeInfo('test_table (System Versioned)', undefined, undefined,
undefined, undefined, 'Table', undefined, undefined, undefined, testNodeMetadata);
scriptingService = new ScriptingService(connectionManager.object);
const script = await scriptingService.script(testNode, 'test_uri', ScriptOperation.Delete);
assert.notEqual(script, undefined);
});
test('Test Script Alter function', async () => {
const testNodeMetadata: ObjectMetadata = {
metadataType: MetadataType.SProc,
metadataTypeName: 'StoredProcedure',
urn: undefined,
schema: 'dbo',
name: 'test_sproc'
};
const testNode = new TreeNodeInfo('test_table (System Versioned)', undefined, undefined,
undefined, undefined, 'StoredProcedure', undefined, undefined, undefined, testNodeMetadata);
scriptingService = new ScriptingService(connectionManager.object);
const script = await scriptingService.script(testNode, 'test_uri', ScriptOperation.Alter);
assert.notEqual(script, undefined);
});
});
``` | /content/code_sandbox/test/unit/scriptingService.test.ts | xml | 2016-06-26T04:38:04 | 2024-08-16T20:04:12 | vscode-mssql | microsoft/vscode-mssql | 1,523 | 1,607 |
```xml
import Workos from '@workos-inc/node';
import * as jwt from 'jsonwebtoken';
import { getEnv, saveValidatedToken } from './data/utils';
import { debugBase, debugError } from './debuggers';
import { generateModels } from './connectionResolver';
import { authCookieOptions, getSubdomain } from '@erxes/api-utils/src/core';
import { USER_ROLES } from '@erxes/api-utils/src/constants';
import { getOrganizationDetail } from '@erxes/api-utils/src/saas/saas';
import redis from '@erxes/api-utils/src/redis';
const setCookie = async (res, user, subdomain: string, token: string) => {
await saveValidatedToken(token, user);
const models = await generateModels(subdomain);
const organization = await getOrganizationDetail({ subdomain, models });
const cookieOptions: any = authCookieOptions();
if (organization.domain && organization.dnsStatus === 'active') {
cookieOptions.secure = true;
cookieOptions.sameSite = 'none';
}
res.cookie('auth-token', token, cookieOptions);
};
export const handleMagiclink = async (req: any, res) => {
const { error, error_description, state } = req.query;
// already signed in
if (req.user) {
return res.redirect('/');
}
const hasError = error && !(error === 'undefined' || error === 'null');
const hasErrorDescription =
error_description &&
!(error_description === 'undefined' || error_description === 'null');
if (hasError || hasErrorDescription) {
return res.redirect('/sign-in-with-email');
}
try {
// this was set in loginWithMagicLink mutation
const subdomain = (await redis.get('subdomain')) || '';
await redis.set('subdomain', '');
const models = await generateModels(subdomain);
const { user }: any = jwt.verify(state, models.Users.getSecret());
await setCookie(res, user, subdomain, state.toString());
return res.redirect(`path_to_url{subdomain}.app.erxes.io`);
} catch (e) {
debugBase(e.message);
return res.end(e.message);
}
};
export const handleCoreLogin = async (req: any, res) => {
const { token } = req.query;
const subdomain = getSubdomain(req);
// already signed in
if (req.user) {
return res.redirect('/');
}
if (!token) {
return res.redirect('/');
}
const models = await generateModels(subdomain);
try {
const { user }: any = jwt.verify(token, models.Users.getSecret());
const systemUser = await models.Users.findOne({
email: user.email,
isActive: true,
isOwner: true,
});
if (systemUser) {
const [createToken] = await models.Users.createTokens(
systemUser,
models.Users.getSecret(),
);
await setCookie(res, systemUser, subdomain, createToken.toString());
}
return res.redirect(`path_to_url{subdomain}.app.erxes.io`);
} catch (e) {
debugBase(e.message);
return res.redirect(`path_to_url{subdomain}.app.erxes.io`);
}
};
export const ssocallback = async (req: any, res) => {
const { code = '', subdomain = '' } = req.query;
const workosClient = new Workos(getEnv({ name: 'WORKOS_API_KEY' }));
try {
const sub = subdomain || (await getSubdomain(req));
const models = await generateModels(sub);
const FRONT_DOMAIN = getEnv({ name: 'DOMAIN', subdomain });
const { profile } = await workosClient.sso.getProfileAndToken({
code: code.toString(),
clientID: getEnv({ name: 'WORKOS_PROJECT_ID' }),
});
if (!profile) {
throw new Error('Google profile not found');
}
const { email = '' } = profile;
const user = await models.Users.findOne({
email,
isActive: true,
role: { $ne: USER_ROLES.SYSTEM },
});
if (!user) {
return res.redirect(FRONT_DOMAIN);
}
const [token] = await models.Users.createTokens(
user,
models.Users.getSecret(),
);
await setCookie(res, user, subdomain, token.toString());
return res.redirect(FRONT_DOMAIN);
} catch (e) {
debugError(`Error occurred when logging in via google: "${e.message}"`);
throw new Error(e);
}
};
``` | /content/code_sandbox/packages/core/src/saas.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 988 |
```xml
import { styles as codeFrame } from '../components/CodeFrame/styles'
import { styles as dialog } from '../components/Dialog'
import { styles as leftRightDialogHeader } from '../components/LeftRightDialogHeader/styles'
import { styles as overlay } from '../components/Overlay/styles'
import { styles as terminal } from '../components/Terminal/styles'
import { styles as toast } from '../components/Toast'
import { styles as versionStaleness } from '../components/VersionStalenessInfo'
import { styles as buildErrorStyles } from '../container/BuildError'
import { styles as containerErrorStyles } from '../container/Errors'
import { styles as containerRuntimeErrorStyles } from '../container/RuntimeError'
import { noop as css } from '../helpers/noop-template'
export function ComponentStyles() {
return (
<style>
{css`
${overlay}
${toast}
${dialog}
${leftRightDialogHeader}
${codeFrame}
${terminal}
${buildErrorStyles}
${containerErrorStyles}
${containerRuntimeErrorStyles}
${versionStaleness}
`}
</style>
)
}
``` | /content/code_sandbox/packages/next/src/client/components/react-dev-overlay/internal/styles/ComponentStyles.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 242 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".ui.activity.LottieAnimationViewActivity"
tools:showIn="@layout/activity_lottie_animation_view">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:lottie_autoPlay="true"
app:lottie_fileName="PinJump.json"
app:lottie_loop="true"
/>
<LinearLayout
android:layout_below="@id/animation_view"
android:layout_width="match_parent"
android:orientation="horizontal"
android:padding="16dp"
android:layout_height="wrap_content">
<Button
android:text="restart"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_margin="10dp"
android:id="@+id/start"
android:layout_height="wrap_content"/>
<Button
android:text="success"
android:layout_width="0dp"
android:id="@+id/success"
android:layout_weight="1"
android:layout_margin="10dp"
android:layout_height="wrap_content"/>
<Button
android:text="error"
android:layout_width="0dp"
android:id="@+id/error"
android:layout_weight="1"
android:layout_margin="10dp"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
``` | /content/code_sandbox/app/src/main/res/layout/content_lottie_animation_view.xml | xml | 2016-08-08T08:52:10 | 2024-08-12T19:24:13 | AndroidAnimationExercise | REBOOTERS/AndroidAnimationExercise | 1,868 | 398 |
```xml
import { ResObject } from '../interfaces/res_object';
import { Environment } from '../models/environment';
import { ConnectionManager } from './connection_manager';
import { Message } from '../utils/message';
import { StringUtil } from '../utils/string_util';
import { DtoEnvironment } from '../common/interfaces/dto_environment';
import { VariableService } from './variable_service';
import { Project } from '../models/project';
import { noEnvironment } from '../common/enum/stress_type';
export class EnvironmentService {
static fromDto(dtoEnv: DtoEnvironment): Environment {
const env = new Environment();
env.name = dtoEnv.name;
env.id = dtoEnv.id || StringUtil.generateUID();
env.variables = dtoEnv.variables.map(v => VariableService.fromDto(v));
env.project = new Project();
env.project.id = dtoEnv.project.id;
return env;
}
static async save(env: Environment) {
const connection = await ConnectionManager.getInstance();
await connection.getRepository(Environment).save(env);
}
static formatVariables(env: Environment): { [key: string]: string } {
let variables: { [key: string]: string } = {};
env.variables.forEach(o => {
if (o.isActive) {
variables[o.key] = o.value;
}
});
return variables;
}
static async get(id: string, needVars: boolean = false): Promise<Environment> {
const connection = await ConnectionManager.getInstance();
let rep = await connection.getRepository(Environment).createQueryBuilder('env');
if (needVars) {
rep = rep.leftJoinAndSelect('env.variables', 'variable');
}
return await rep.where('env.id=:id', { 'id': id }).getOne();
}
static async create(dtoEnv: DtoEnvironment): Promise<ResObject> {
const env = EnvironmentService.fromDto(dtoEnv);
EnvironmentService.adjustVariables(env);
await EnvironmentService.save(env);
return { success: true, message: Message.get('envCreateSuccess') };
}
private static adjustVariables(env: Environment) {
env.variables.forEach((variable, index) => {
variable.id = variable.id || StringUtil.generateUID();
variable.sort = index;
});
}
static async getEnvironments(ids: string[], needVariables: boolean = true, needProject: boolean = true): Promise<Environment[]> {
if (!ids || ids.length === 0) {
return [];
}
const connection = await ConnectionManager.getInstance();
let rep = connection.getRepository(Environment).createQueryBuilder('environment');
if (needVariables) {
rep = rep.leftJoinAndSelect('environment.variables', 'variable');
}
if (needProject) {
rep = rep.leftJoinAndSelect('environment.project', 'project');
}
return await rep.where('1=1')
.andWhereInIds(ids.map(id => ({ id })))
.getMany();
}
static async update(dtoEnv: DtoEnvironment): Promise<ResObject> {
const connection = await ConnectionManager.getInstance();
const env = await EnvironmentService.get(dtoEnv.id, true);
const newEnv = EnvironmentService.fromDto(dtoEnv);
EnvironmentService.adjustVariables(newEnv);
await connection.transaction(async manager => {
if (env && env.variables && env.variables.length > 0) {
await manager.remove(env.variables);
}
await manager.save(newEnv);
});
return { success: true, message: Message.get('envUpdateSuccess') };
}
static async delete(id: string): Promise<ResObject> {
const connection = await ConnectionManager.getInstance();
const env = await EnvironmentService.get(id, true);
if (env) {
await connection.transaction(async manager => {
await manager.remove(env.variables);
await manager.remove(env);
});
}
return { success: true, message: Message.get('envDeleteSuccess') };
}
static async getVariables(envId: string): Promise<_.Dictionary<string>> {
const envVariables = {};
if (envId && envId !== noEnvironment) {
const env = await EnvironmentService.get(envId, true);
if (env) {
env.variables.forEach(v => {
if (v.isActive) {
envVariables[v.key] = v.value;
}
});
}
}
return envVariables;
}
}
``` | /content/code_sandbox/api/src/services/environment_service.ts | xml | 2016-09-26T02:47:43 | 2024-07-24T09:32:20 | Hitchhiker | brookshi/Hitchhiker | 2,193 | 914 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="sp2-vV-rZV">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Clock-->
<scene sceneID="t1m-6j-OQq">
<objects>
<viewController id="CT4-vj-wFA" customClass="ClockViewController" customModule="HGCircularSlider_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="yFY-UW-SEd"/>
<viewControllerLayoutGuide type="bottom" id="lUY-qL-6BD"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="4jd-aQ-SwJ">
<rect key="frame" x="0.0" y="0.0" width="375" height="618"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="dyk-gn-E0m">
<rect key="frame" x="26" y="76" width="323" height="57"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="116" placeholderIntrinsicHeight="57" axis="vertical" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="DG9-tl-Yx0" userLabel="BedTime Stack View">
<rect key="frame" x="0.0" y="0.0" width="154" height="57"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="YwR-eO-oZe">
<rect key="frame" x="28.5" y="0.0" width="97" height="24"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="17" placeholderIntrinsicHeight="24" image="ic_bedtime" translatesAutoresizingMaskIntoConstraints="NO" id="KC4-Yz-4tg">
<rect key="frame" x="0.0" y="0.0" width="17" height="24"/>
<color key="tintColor" red="1" green="0.65098039220000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="75" placeholderIntrinsicHeight="24" text="Bedtime" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JV5-mg-K6N">
<rect key="frame" x="22" y="0.0" width="75" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="1" green="0.65098039215686276" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="108" placeholderIntrinsicHeight="33" text="12:00 AM" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ode-Tz-DNv">
<rect key="frame" x="23" y="24" width="108" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="25"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="116" placeholderIntrinsicHeight="57" axis="vertical" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="pua-bm-FEt" userLabel="Wake Stack View">
<rect key="frame" x="169" y="0.0" width="154" height="57"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="GT6-Lu-cLO">
<rect key="frame" x="28.5" y="0.0" width="97" height="24"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="17" placeholderIntrinsicHeight="24" image="ic_wake" translatesAutoresizingMaskIntoConstraints="NO" id="yHs-NA-gtj">
<rect key="frame" x="0.0" y="0.0" width="17" height="24"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="75" placeholderIntrinsicHeight="24" text="Wake" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0hP-PD-D5h">
<rect key="frame" x="22" y="0.0" width="75" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="0.99215686270000003" green="0.75294117650000003" blue="0.035294117649999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="115" placeholderIntrinsicHeight="33" text="12:00 PM" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lh9-bX-Mdn">
<rect key="frame" x="19.5" y="24" width="115" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="27"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B7k-gj-MGd" customClass="RangeCircularSlider" customModule="HGCircularSlider">
<rect key="frame" x="27.5" y="149" width="320" height="320"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Hours" translatesAutoresizingMaskIntoConstraints="NO" id="MZM-ia-laW">
<rect key="frame" x="65" y="65" width="190" height="190"/>
<constraints>
<constraint firstAttribute="width" secondItem="MZM-ia-laW" secondAttribute="height" multiplier="1:1" id="Sa8-Wq-bG0"/>
<constraint firstAttribute="width" constant="190" id="oYT-wT-0kd"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="MZM-ia-laW" firstAttribute="centerY" secondItem="B7k-gj-MGd" secondAttribute="centerY" id="8Kc-iN-j4o"/>
<constraint firstAttribute="width" secondItem="B7k-gj-MGd" secondAttribute="height" id="Q58-Rs-yGZ"/>
<constraint firstAttribute="width" constant="320" id="b7b-at-v9d"/>
<constraint firstItem="MZM-ia-laW" firstAttribute="centerX" secondItem="B7k-gj-MGd" secondAttribute="centerX" id="xLC-da-bQb"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
<real key="value" value="40"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackFillColor">
<color key="value" red="0.99215686270000003" green="0.75294117650000003" blue="0.035294117649999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskFillColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackColor">
<color key="value" red="1" green="1" blue="1" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="backtrackLineWidth">
<real key="value" value="40"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="numberOfRounds">
<integer key="value" value="2"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="updateTexts:" destination="CT4-vj-wFA" eventType="valueChanged" id="O1n-wh-9uS"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0:41" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2Yn-91-Eq6">
<rect key="frame" x="146.5" y="281.5" width="82" height="55"/>
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="40"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="B7k-gj-MGd" firstAttribute="centerX" secondItem="4jd-aQ-SwJ" secondAttribute="centerX" id="A2F-1K-8e3"/>
<constraint firstItem="dyk-gn-E0m" firstAttribute="leading" secondItem="4jd-aQ-SwJ" secondAttribute="leadingMargin" constant="10" id="Dl0-lI-EH6"/>
<constraint firstAttribute="trailingMargin" secondItem="dyk-gn-E0m" secondAttribute="trailing" constant="10" id="N5U-c7-Tfy"/>
<constraint firstItem="2Yn-91-Eq6" firstAttribute="centerY" secondItem="B7k-gj-MGd" secondAttribute="centerY" id="OM2-lB-fj3"/>
<constraint firstItem="2Yn-91-Eq6" firstAttribute="centerX" secondItem="B7k-gj-MGd" secondAttribute="centerX" id="VWY-Ky-HzA"/>
<constraint firstItem="B7k-gj-MGd" firstAttribute="centerY" secondItem="4jd-aQ-SwJ" secondAttribute="centerY" id="YFL-7T-X0H"/>
<constraint firstItem="B7k-gj-MGd" firstAttribute="top" secondItem="dyk-gn-E0m" secondAttribute="bottom" constant="16" id="wTi-nq-Asd"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<tabBarItem key="tabBarItem" title="Clock" image="second" id="ift-R0-ETx"/>
<navigationItem key="navigationItem" id="GQt-LM-Ytd"/>
<connections>
<outlet property="bedtimeLabel" destination="Ode-Tz-DNv" id="a1P-nt-aaZ"/>
<outlet property="durationLabel" destination="2Yn-91-Eq6" id="3lh-r2-GXs"/>
<outlet property="rangeCircularSlider" destination="B7k-gj-MGd" id="T78-sm-rbg"/>
<outlet property="wakeLabel" destination="lh9-bX-Mdn" id="AfO-9T-Vva"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="IfT-Jw-FAY" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1254.5" y="2467.5"/>
</scene>
<!--Tab Bar Controller-->
<scene sceneID="M9S-pb-Waq">
<objects>
<tabBarController id="sp2-vV-rZV" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" id="b7Z-PI-gCQ">
<rect key="frame" x="0.0" y="0.0" width="320" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" red="0.89411764709999997" green="0.93333333330000001" blue="0.38823529410000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="barTintColor" red="0.17254901960784313" green="0.15686274509803921" blue="0.16862745098039217" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</tabBar>
<connections>
<segue destination="CT4-vj-wFA" kind="relationship" relationship="viewControllers" id="pZZ-eo-szV"/>
<segue destination="tLb-gm-5PK" kind="relationship" relationship="viewControllers" id="hBp-Fm-sNJ"/>
<segue destination="Npo-RV-git" kind="relationship" relationship="viewControllers" id="DMS-53-eB9"/>
<segue destination="fOf-1m-bg4" kind="relationship" relationship="viewControllers" id="5Ik-om-DOr"/>
<segue destination="814-W4-dSU" kind="relationship" relationship="viewControllers" id="xpY-bZ-bvy"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="gDj-DB-klF" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-327" y="1633"/>
</scene>
<!--Player-->
<scene sceneID="90r-0D-nKE">
<objects>
<viewController id="tLb-gm-5PK" customClass="PlayerViewController" customModule="HGCircularSlider_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="EH6-Ys-cpR"/>
<viewControllerLayoutGuide type="bottom" id="qfh-d6-sk8"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="neD-ad-Dbx">
<rect key="frame" x="0.0" y="0.0" width="375" height="618"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="c7m-F5-dgq">
<rect key="frame" x="40" y="109" width="295" height="400"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="x2l-Xh-2MZ" customClass="CircularSlider" customModule="HGCircularSlider">
<rect key="frame" x="0.0" y="0.0" width="295" height="295"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="x2l-Xh-2MZ" secondAttribute="height" priority="999" id="5ZH-Qv-URo"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackFillColor">
<color key="value" red="0.14901960780000001" green="0.83921568629999999" blue="0.99215686270000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskFillColor">
<color key="value" red="0.14901960780000001" green="0.83921568629999999" blue="0.99215686270000003" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackColor">
<color key="value" red="1" green="1" blue="1" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="thumbRadius">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeHighlightedColor">
<color key="value" red="0.80000000000000004" green="0.5725490196078431" blue="0.88235294117647056" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeColor">
<color key="value" red="0.14901960780000001" green="0.83921568629999999" blue="0.99215686270000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="updateTexts:" destination="CT4-vj-wFA" eventType="valueChanged" id="Kvp-kt-LSC"/>
</connections>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="ynQ-4R-F24">
<rect key="frame" x="0.0" y="315" width="295" height="37"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="17" text="StrangeZero" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cRt-q4-UdR">
<rect key="frame" x="0.0" y="0.0" width="295" height="17"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="14"/>
<color key="textColor" red="1" green="1" blue="1" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="20" text="Burnin Star" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uAk-aN-SL3">
<rect key="frame" x="0.0" y="17" width="295" height="20"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="9nw-2D-CbD">
<rect key="frame" x="0.0" y="372" width="295" height="29"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="Tdt-J7-hiZ"/>
</constraints>
<segments>
<segment title="Play"/>
<segment title="Pause"/>
</segments>
<connections>
<action selector="togglePlayer:" destination="tLb-gm-5PK" eventType="valueChanged" id="K6V-AR-PWu"/>
</connections>
</segmentedControl>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="167" placeholderIntrinsicHeight="48" text="0:00" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V2j-gL-XgV">
<rect key="frame" x="104" y="232.5" width="167" height="48"/>
<fontDescription key="fontDescription" type="system" weight="ultraLight" pointSize="40"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.49803921569999998" green="0.10980392160000001" blue="0.65098039220000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" red="0.14901960780000001" green="0.83921568629999999" blue="0.99215686270000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="V2j-gL-XgV" firstAttribute="centerY" secondItem="x2l-Xh-2MZ" secondAttribute="centerY" id="3Cf-SB-Xap"/>
<constraint firstItem="V2j-gL-XgV" firstAttribute="centerX" secondItem="x2l-Xh-2MZ" secondAttribute="centerX" id="KeP-bj-vvP"/>
<constraint firstItem="c7m-F5-dgq" firstAttribute="leading" secondItem="neD-ad-Dbx" secondAttribute="leadingMargin" constant="24" id="THE-G8-kPA"/>
<constraint firstAttribute="trailingMargin" secondItem="c7m-F5-dgq" secondAttribute="trailing" constant="24" id="YJD-9n-lKm"/>
<constraint firstItem="c7m-F5-dgq" firstAttribute="centerY" secondItem="neD-ad-Dbx" secondAttribute="centerY" id="og5-LJ-ZPv"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<tabBarItem key="tabBarItem" title="Player" image="first" id="VaG-Vm-OZC"/>
<navigationItem key="navigationItem" id="INE-nv-dyL"/>
<connections>
<outlet property="circularSlider" destination="x2l-Xh-2MZ" id="nOH-vj-id4"/>
<outlet property="playerSegmentedControl" destination="9nw-2D-CbD" id="KSc-fu-gyx"/>
<outlet property="timerLabel" destination="V2j-gL-XgV" id="19I-fw-Isw"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="LfZ-7G-N6b" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-794" y="2468"/>
</scene>
<!--Example-->
<scene sceneID="stQ-nu-pyE">
<objects>
<viewController id="Npo-RV-git" customClass="OtherExampleViewController" customModule="HGCircularSlider_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="kg8-3T-le0"/>
<viewControllerLayoutGuide type="bottom" id="I5G-Jl-WfO"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kxo-la-Q5X">
<rect key="frame" x="0.0" y="0.0" width="375" height="618"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P7G-Iv-4Jm" customClass="MidPointCircularSlider" customModule="HGCircularSlider">
<rect key="frame" x="73.5" y="195" width="228" height="228"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="228" id="Kx9-Mg-DfE"/>
<constraint firstAttribute="width" secondItem="P7G-Iv-4Jm" secondAttribute="height" id="aGA-yL-Kg8"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
<real key="value" value="15"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackFillColor">
<color key="value" red="0.92156862745098034" green="0.18431372549019609" blue="0.38039215686274508" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackColor">
<color key="value" red="0.35686274509803922" green="0.70196078431372544" blue="0.92549019607843142" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="distance">
<real key="value" value="0.14999999999999999"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="midThumbStrokeHighlightedColor">
<color key="value" red="0.92156862750000001" green="0.1843137255" blue="0.3803921569" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="midThumbStrokeColor">
<color key="value" red="0.35686274509999999" green="0.70196078429999997" blue="0.92549019610000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="thumbRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskFillColor">
<color key="value" red="0.35686274509999999" green="0.70196078429999997" blue="0.92549019610000005" alpha="0.13957435344827587" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="updateTexts:" destination="CT4-vj-wFA" eventType="valueChanged" id="PPZ-hO-mha"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="April" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cfm-Db-wi2">
<rect key="frame" x="112.5" y="234" width="150" height="150"/>
<constraints>
<constraint firstAttribute="width" constant="150" id="LDb-AT-qTm"/>
<constraint firstAttribute="width" secondItem="Cfm-Db-wi2" secondAttribute="height" id="sh3-2g-Wm9"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="75"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderUIColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" red="0.38039215686274508" green="0.33725490196078434" blue="0.43529411764705883" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Cfm-Db-wi2" firstAttribute="centerY" secondItem="kxo-la-Q5X" secondAttribute="centerY" id="PTz-yo-VP9"/>
<constraint firstItem="Cfm-Db-wi2" firstAttribute="centerX" secondItem="kxo-la-Q5X" secondAttribute="centerX" id="QSS-kS-W8Q"/>
<constraint firstItem="P7G-Iv-4Jm" firstAttribute="centerY" secondItem="kxo-la-Q5X" secondAttribute="centerY" id="cE7-ML-C09"/>
<constraint firstItem="P7G-Iv-4Jm" firstAttribute="centerX" secondItem="kxo-la-Q5X" secondAttribute="centerX" id="dct-rR-CWI"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<tabBarItem key="tabBarItem" title="Example" image="second" id="etG-Rt-332"/>
<connections>
<outlet property="circularSlider" destination="P7G-Iv-4Jm" id="tNc-8z-Gh2"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="11N-ZE-qqz" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-326" y="2468"/>
</scene>
<!--OClock-->
<scene sceneID="qvZ-oN-u0x">
<objects>
<viewController id="fOf-1m-bg4" customClass="OClockViewController" customModule="HGCircularSlider_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="1an-df-x8V"/>
<viewControllerLayoutGuide type="bottom" id="zbM-Dt-5AV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="fAM-4k-cvc">
<rect key="frame" x="0.0" y="0.0" width="375" height="618"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="WRY-kB-aj8">
<rect key="frame" x="127.5" y="20" width="120" height="138.5"/>
<subviews>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="19A-pG-3td">
<rect key="frame" x="0.0" y="55.5" width="120" height="29"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="3jN-4n-QeQ"/>
</constraints>
<segments>
<segment title="AM"/>
<segment title="PM"/>
</segments>
<color key="tintColor" red="0.99215686270000003" green="0.75294117650000003" blue="0.035294117649999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="switchBetweenAMAndPM:" destination="fOf-1m-bg4" eventType="valueChanged" id="Ztd-XM-Khe"/>
</connections>
</segmentedControl>
</subviews>
</stackView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="time_indicators" translatesAutoresizingMaskIntoConstraints="NO" id="iV1-rk-1SV">
<rect key="frame" x="37" y="158.5" width="301" height="301"/>
<constraints>
<constraint firstAttribute="width" secondItem="iV1-rk-1SV" secondAttribute="height" id="L3y-vK-lUp"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="Hes-2U-VeA">
<rect key="frame" x="127.5" y="229.5" width="120" height="159"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="92" placeholderIntrinsicHeight="53" text="AM" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jhh-41-cud">
<rect key="frame" x="0.0" y="0.0" width="120" height="53"/>
<fontDescription key="fontDescription" type="system" weight="ultraLight" pointSize="16"/>
<color key="textColor" red="0.87450980392156863" green="0.80000000000000004" blue="0.22352941176470587" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="43q-ax-2ig">
<rect key="frame" x="0.0" y="53" width="120" height="53"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="54" placeholderIntrinsicHeight="53" text="06" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hbF-TF-3lB">
<rect key="frame" x="0.0" y="0.0" width="54" height="53"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="44"/>
<color key="textColor" red="0.87450980392156863" green="0.80000000000000004" blue="0.22352941176470587" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="12" placeholderIntrinsicHeight="53" text=":" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vth-jB-JLd">
<rect key="frame" x="54" y="0.0" width="12" height="53"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="44"/>
<color key="textColor" red="0.87450980389999999" green="0.80000000000000004" blue="0.22352941179999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="54" placeholderIntrinsicHeight="53" text="35" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="t63-gB-ld3">
<rect key="frame" x="66" y="0.0" width="54" height="53"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="44"/>
<color key="textColor" red="0.87450980389999999" green="0.80000000000000004" blue="0.22352941179999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="92" placeholderIntrinsicHeight="53" text="MONDAY" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F6O-w8-ufI">
<rect key="frame" x="0.0" y="106" width="120" height="53"/>
<fontDescription key="fontDescription" type="system" weight="ultraLight" pointSize="16"/>
<color key="textColor" red="0.87450980392156863" green="0.80000000000000004" blue="0.22352941176470587" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kWD-6U-Cha" customClass="CircularSlider" customModule="HGCircularSlider">
<rect key="frame" x="57" y="178.5" width="261" height="261"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="diskFillColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackFillColor">
<color key="value" red="0.87450980389999999" green="0.80000000000000004" blue="0.22352941179999999" alpha="0.79496228449999995" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackColor">
<color key="value" red="1" green="1" blue="1" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="thumbRadius">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbTintColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeHighlightedColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XLN-xb-Www" customClass="CircularSlider" customModule="HGCircularSlider">
<rect key="frame" x="82" y="203.5" width="211" height="211"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="diskFillColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskColor">
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackFillColor">
<color key="value" red="0.87450980392156863" green="0.80000000000000004" blue="0.22352941176470587" alpha="0.79496228448275863" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackColor">
<color key="value" red="1" green="1" blue="1" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
<real key="value" value="4"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="thumbRadius">
<real key="value" value="4"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbTintColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeHighlightedColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="mzf-rC-Kpg">
<rect key="frame" x="121.5" y="459.5" width="132" height="158.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="i8l-FT-Qb1">
<rect key="frame" x="0.0" y="59.5" width="132" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="132" placeholderIntrinsicHeight="20" text="PARIS, FRANCE" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DSP-Eq-0z0">
<rect key="frame" x="0.0" y="0.0" width="132" height="20"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.99215686270000003" green="0.75294117650000003" blue="0.035294117649999998" alpha="0.61616379310344827" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="132" placeholderIntrinsicHeight="20" text="November 9, 2016" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="f3J-m0-6t0">
<rect key="frame" x="0.0" y="20" width="132" height="20"/>
<fontDescription key="fontDescription" type="system" weight="ultraLight" pointSize="16"/>
<color key="textColor" red="0.99215686270000003" green="0.75294117650000003" blue="0.035294117649999998" alpha="0.61616379310344827" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="0.12549019607843137" green="0.14509803921568626" blue="0.21568627450980393" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="kWD-6U-Cha" firstAttribute="top" secondItem="iV1-rk-1SV" secondAttribute="top" constant="20" id="0n6-Li-FgA"/>
<constraint firstItem="iV1-rk-1SV" firstAttribute="top" secondItem="WRY-kB-aj8" secondAttribute="bottom" id="3ax-Zd-hhc"/>
<constraint firstItem="zbM-Dt-5AV" firstAttribute="top" secondItem="mzf-rC-Kpg" secondAttribute="bottom" id="5XY-P4-hTG"/>
<constraint firstItem="mzf-rC-Kpg" firstAttribute="top" secondItem="iV1-rk-1SV" secondAttribute="bottom" id="5Za-Ci-xLj"/>
<constraint firstItem="XLN-xb-Www" firstAttribute="top" secondItem="iV1-rk-1SV" secondAttribute="top" constant="45" id="9T6-yX-BQQ"/>
<constraint firstItem="kWD-6U-Cha" firstAttribute="leading" secondItem="iV1-rk-1SV" secondAttribute="leading" constant="20" id="BYE-sV-fA8"/>
<constraint firstItem="kWD-6U-Cha" firstAttribute="bottom" secondItem="iV1-rk-1SV" secondAttribute="bottom" constant="-20" id="G0o-91-fzn"/>
<constraint firstItem="WRY-kB-aj8" firstAttribute="top" secondItem="1an-df-x8V" secondAttribute="bottom" id="TiW-Jt-Dk1"/>
<constraint firstItem="iV1-rk-1SV" firstAttribute="centerX" secondItem="fAM-4k-cvc" secondAttribute="centerX" id="UnE-yE-bn8"/>
<constraint firstItem="Hes-2U-VeA" firstAttribute="centerX" secondItem="fAM-4k-cvc" secondAttribute="centerX" id="Zd8-yK-3zg"/>
<constraint firstItem="XLN-xb-Www" firstAttribute="leading" secondItem="iV1-rk-1SV" secondAttribute="leading" constant="45" id="bVW-XM-lsI"/>
<constraint firstItem="kWD-6U-Cha" firstAttribute="trailing" secondItem="iV1-rk-1SV" secondAttribute="trailing" constant="-20" id="eLq-m4-kd9"/>
<constraint firstItem="mzf-rC-Kpg" firstAttribute="centerX" secondItem="fAM-4k-cvc" secondAttribute="centerX" id="gsB-O8-g3b"/>
<constraint firstItem="XLN-xb-Www" firstAttribute="trailing" secondItem="iV1-rk-1SV" secondAttribute="trailing" constant="-45" id="lK9-dG-HiI"/>
<constraint firstItem="XLN-xb-Www" firstAttribute="bottom" secondItem="iV1-rk-1SV" secondAttribute="bottom" constant="-45" id="rFq-4G-Ttz"/>
<constraint firstItem="WRY-kB-aj8" firstAttribute="centerX" secondItem="fAM-4k-cvc" secondAttribute="centerX" id="rt8-Ai-DO3"/>
<constraint firstItem="Hes-2U-VeA" firstAttribute="centerY" secondItem="fAM-4k-cvc" secondAttribute="centerY" id="soc-Wl-11O"/>
<constraint firstItem="iV1-rk-1SV" firstAttribute="centerY" secondItem="fAM-4k-cvc" secondAttribute="centerY" id="t8i-wJ-Rln"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<tabBarItem key="tabBarItem" title="OClock" image="first" id="Li3-0d-UGZ"/>
<connections>
<outlet property="AMPMLabel" destination="Jhh-41-cud" id="6pi-FG-7E6"/>
<outlet property="hoursCircularSlider" destination="XLN-xb-Www" id="K4y-TO-Kd2"/>
<outlet property="hoursLabel" destination="hbF-TF-3lB" id="4iV-bM-ONC"/>
<outlet property="minutesCircularSlider" destination="kWD-6U-Cha" id="XwY-y5-04n"/>
<outlet property="minutesLabel" destination="t63-gB-ld3" id="cfn-X4-Tf4"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4jZ-R1-SB1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="148" y="2468"/>
</scene>
<!--Circular-->
<scene sceneID="EVO-nS-JTv">
<objects>
<viewController id="814-W4-dSU" customClass="CircularSliderViewController" customModule="HGCircularSlider_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="hfr-Sy-sxA"/>
<viewControllerLayoutGuide type="bottom" id="Rnp-Hd-bq6"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="KW8-2q-ueG">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0zL-f3-x42" customClass="CircularSlider" customModule="HGCircularSlider">
<rect key="frame" x="46" y="152" width="283" height="283"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rounds" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eTZ-Q0-WV1">
<rect key="frame" x="111" y="131.5" width="62" height="20.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" red="0.1843137255" green="0.21960784310000001" blue="0.53725490200000003" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="eTZ-Q0-WV1" firstAttribute="centerX" secondItem="0zL-f3-x42" secondAttribute="centerX" id="3kp-PR-wHt"/>
<constraint firstAttribute="width" secondItem="0zL-f3-x42" secondAttribute="height" id="HkE-2f-Rux"/>
<constraint firstItem="eTZ-Q0-WV1" firstAttribute="centerY" secondItem="0zL-f3-x42" secondAttribute="centerY" id="MHd-ka-yGm"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="minimumValue">
<real key="value" value="0.0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
<real key="value" value="30"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="numberOfRounds">
<integer key="value" value="3"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackFillColor">
<color key="value" red="0.1843137255" green="0.21960784310000001" blue="0.53725490200000003" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="backtrackLineWidth">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
<real key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbTintColor">
<color key="value" red="0.1843137255" green="0.21960784310000001" blue="0.53725490200000003" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeHighlightedColor">
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endThumbStrokeColor">
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="trackColor">
<color key="value" red="0.67450980392156867" green="0.18823529411764706" blue="0.39215686274509803" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskFillColor">
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="diskColor">
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="KXq-jq-I0O">
<rect key="frame" x="46" y="465" width="283" height="72"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Gjj-Jf-WgG">
<rect key="frame" x="0.0" y="0.0" width="283" height="24"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Max:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eBm-NY-JEJ">
<rect key="frame" x="0.0" y="0.0" width="141.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.96862745100000003" green="0.20000000000000001" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Max:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="w0T-zs-UVB">
<rect key="frame" x="141.5" y="0.0" width="141.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.96862745100000003" green="0.20000000000000001" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="pb0-fu-6bN">
<rect key="frame" x="0.0" y="24" width="283" height="24"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Min:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="czd-zb-da5">
<rect key="frame" x="0.0" y="0.0" width="141.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.96862745100000003" green="0.20000000000000001" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Max:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yAC-yJ-TQy">
<rect key="frame" x="141.5" y="0.0" width="141.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.96862745100000003" green="0.20000000000000001" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="EWO-WK-y5L">
<rect key="frame" x="0.0" y="48" width="283" height="24"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Current:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mgG-23-eqg">
<rect key="frame" x="0.0" y="0.0" width="141.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.96862745100000003" green="0.20000000000000001" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Max:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSQ-ek-rPk">
<rect key="frame" x="141.5" y="0.0" width="141.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.96862745100000003" green="0.20000000000000001" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="pb0-fu-6bN" firstAttribute="width" secondItem="KXq-jq-I0O" secondAttribute="width" id="5nP-oz-5CM"/>
<constraint firstItem="EWO-WK-y5L" firstAttribute="width" secondItem="KXq-jq-I0O" secondAttribute="width" id="Oas-IE-BF6"/>
<constraint firstItem="Gjj-Jf-WgG" firstAttribute="width" secondItem="KXq-jq-I0O" secondAttribute="width" id="fjw-BV-kb9"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" red="0.047058823529411764" green="0.062745098039215685" blue="0.15294117647058825" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="KXq-jq-I0O" firstAttribute="top" secondItem="0zL-f3-x42" secondAttribute="bottom" constant="30" id="8wl-ME-jX4"/>
<constraint firstItem="0zL-f3-x42" firstAttribute="centerY" secondItem="KW8-2q-ueG" secondAttribute="centerY" constant="-40" id="Gbk-P7-1Fg"/>
<constraint firstItem="0zL-f3-x42" firstAttribute="leading" secondItem="KW8-2q-ueG" secondAttribute="leadingMargin" constant="30" id="Hzp-R2-8yv"/>
<constraint firstItem="KXq-jq-I0O" firstAttribute="leading" secondItem="KW8-2q-ueG" secondAttribute="leadingMargin" constant="30" id="pva-PJ-3WQ"/>
<constraint firstAttribute="trailingMargin" secondItem="KXq-jq-I0O" secondAttribute="trailing" constant="30" id="tAt-Zk-a5O"/>
<constraint firstAttribute="trailingMargin" secondItem="0zL-f3-x42" secondAttribute="trailing" constant="30" id="u6c-7J-sLh"/>
</constraints>
</view>
<tabBarItem key="tabBarItem" title="Circular" image="second" id="Dl9-Du-JZD"/>
<connections>
<outlet property="circularSlider" destination="0zL-f3-x42" id="aXt-kT-xjs"/>
<outlet property="currentValueLabel" destination="wSQ-ek-rPk" id="QxR-IO-sEq"/>
<outlet property="maxValueLabel" destination="w0T-zs-UVB" id="PYO-EN-sup"/>
<outlet property="minValueLabel" destination="yAC-yJ-TQy" id="L0J-SX-Hur"/>
<outlet property="roundsLabel" destination="eTZ-Q0-WV1" id="j6R-d5-rq2"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ijD-qf-fmt" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="643" y="2468"/>
</scene>
</scenes>
<resources>
<image name="Hours" width="219" height="219"/>
<image name="first" width="30" height="30"/>
<image name="ic_bedtime" width="17" height="19"/>
<image name="ic_wake" width="13" height="16"/>
<image name="second" width="30" height="30"/>
<image name="time_indicators" width="301" height="300"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
</simulatedMetricsContainer>
</document>
``` | /content/code_sandbox/Example/HGCircularSlider/Base.lproj/Main.storyboard | xml | 2016-11-07T23:58:30 | 2024-08-15T02:14:29 | HGCircularSlider | HamzaGhazouani/HGCircularSlider | 2,567 | 16,883 |
```xml
import { ParamListBase, StackNavigationState } from '@react-navigation/native';
import {
createNativeStackNavigator,
NativeStackNavigationEventMap,
NativeStackNavigationOptions,
} from '@react-navigation/native-stack';
import { withLayoutContext } from './withLayoutContext';
const NativeStackNavigator = createNativeStackNavigator().Navigator;
export const Stack = withLayoutContext<
NativeStackNavigationOptions,
typeof NativeStackNavigator,
StackNavigationState<ParamListBase>,
NativeStackNavigationEventMap
>(NativeStackNavigator);
export default Stack;
``` | /content/code_sandbox/packages/expo-router/src/layouts/Stack.tsx | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 110 |
```xml
import { CoreBuilder } from 'storybook/internal/cli';
import { baseGenerator } from '../baseGenerator';
import type { Generator } from '../types';
const generator: Generator = async (packageManager, npmOptions, options) => {
await baseGenerator(packageManager, npmOptions, options, 'react', {
extraAddons: [`@storybook/addon-onboarding`],
webpackCompiler: ({ builder }) => (builder === CoreBuilder.Webpack5 ? 'swc' : undefined),
});
};
export default generator;
``` | /content/code_sandbox/code/lib/create-storybook/src/generators/WEBPACK_REACT/index.ts | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 109 |
```xml
export const objectMap = <Obj extends { [key: string]: any }, R extends any>(
obj: Obj,
map: (key: keyof Obj, value: Obj[keyof Obj]) => R
) => {
return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, map(key, value)])) as {
[K in keyof Obj]: R;
};
};
export const entriesMap =
<K extends string, T extends any>(entries: [K, T][]) =>
<R extends any>(map: (value: T) => R): [K, R][] =>
entries.map(([key, value]) => [key, map(value)]);
``` | /content/code_sandbox/packages/pass/utils/object/map.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 148 |
```xml
export * from './IPollService';
export * from './IVoteOption';
export * from './IVoteResult';
export * from './PollService';
export * from './MockPollService';
export * from './IVoteOptionItem';
``` | /content/code_sandbox/samples/react-multipage/src/webparts/poll/services/index.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 49 |
```xml
<forms:FormsApplicationPage x:Class="SkiaSharpSample.Platform.MainWindow"
xmlns="path_to_url"
xmlns:x="path_to_url"
xmlns:d="path_to_url"
xmlns:mc="path_to_url"
xmlns:forms="clr-namespace:Xamarin.Forms.Platform.WPF;assembly=Xamarin.Forms.Platform.WPF"
xmlns:local="clr-namespace:SkiaSharpSample.Platform"
mc:Ignorable="d"
Title="SkiaSharpSample.Platform" Height="600" Width="800" Icon="icon.ico">
<Grid>
</Grid>
</forms:FormsApplicationPage>
``` | /content/code_sandbox/samples/Gallery/Xamarin.Forms/WPF/MainWindow.xaml | xml | 2016-02-22T17:54:43 | 2024-08-16T17:53:42 | SkiaSharp | mono/SkiaSharp | 4,347 | 135 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#0f88eb</color>
<color name="colorPrimaryDark">#0d79d1</color>
<color name="colorAccent">#FF4081</color>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/colors.xml | xml | 2016-08-08T14:34:56 | 2024-08-16T01:17:59 | ViewPagerLayoutManager | leochuan/ViewPagerLayoutManager | 1,749 | 67 |
```xml
import React, {FunctionComponent, ReactNode} from 'react'
interface Props {
children: ReactNode
}
const OverlayBody: FunctionComponent<Props> = ({children}) => (
<div className="overlay--body">{children}</div>
)
export default OverlayBody
``` | /content/code_sandbox/ui/src/reusable_ui/components/overlays/OverlayBody.tsx | xml | 2016-08-24T23:28:56 | 2024-08-13T19:50:03 | chronograf | influxdata/chronograf | 1,494 | 58 |
```xml
import * as React from 'react';
import { useCallback } from 'react';
import { classNamesFunction } from '../../Utilities';
import { Link } from '../../Link';
import { GroupSpacer } from './GroupSpacer';
import type { IGroupShowAllProps, IGroupShowAllStyleProps, IGroupShowAllStyles } from './GroupShowAll.types';
const getClassNames = classNamesFunction<IGroupShowAllStyleProps, IGroupShowAllStyles>();
export const GroupShowAllBase: React.FunctionComponent<IGroupShowAllProps> = props => {
const { group, groupLevel, showAllLinkText = 'Show All', styles, theme, onToggleSummarize } = props;
const classNames = getClassNames(styles, { theme: theme! });
const memoizedOnClick = useCallback(
(ev: React.MouseEvent<HTMLElement>) => {
onToggleSummarize!(group!);
ev.stopPropagation();
ev.preventDefault();
},
[onToggleSummarize, group],
);
if (group) {
return (
<div className={classNames.root}>
<GroupSpacer count={groupLevel!} />
<Link onClick={memoizedOnClick}>{showAllLinkText}</Link>
</div>
);
}
return null;
};
``` | /content/code_sandbox/packages/react/src/components/GroupedList/GroupShowAll.base.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 266 |
```xml
import styles from "./index.css";
import { setInnerHTML } from "../utils";
import { RQDraggableWidget } from "../abstract-classes/draggable-widget";
import RQLogo from "../../../resources/icons/rqLogo-blue.svg";
import RQLogoSmall from "../../../resources/icons/rqLogo-white.svg";
import MinimizeIcon from "../../../resources/icons/minimze.svg";
import InfoIcon from "../../../resources/icons/info.svg";
import VisibilityIcon from "../../../resources/icons/visibility.svg";
import CloseIcon from "../../../resources/icons/close.svg";
const DEFAULT_POSITION = { right: 16, top: 16 };
export abstract class RQTestRuleWidget extends RQDraggableWidget {
constructor() {
super(DEFAULT_POSITION);
this.shadowRoot = this.attachShadow({ mode: "closed" });
setInnerHTML(this.shadowRoot, this._getDefaultMarkup());
}
connectedCallback() {
this.setAttribute("draggable", "true");
super.connectedCallback();
this.addListeners();
}
addListeners() {
this.shadowRoot.getElementById("minimize-button").addEventListener("click", (event) => {
event.stopPropagation();
this.toggleMinimize(true);
});
this.shadowRoot.getElementById("test-rule-minimized-btn").addEventListener("click", (event) => {
event.stopPropagation();
this.toggleMinimize(false);
});
}
getContainer() {
return this.shadowRoot.getElementById("container");
}
show(position = DEFAULT_POSITION) {
this.moveToPostion(position);
this.setAttribute("draggable", "true");
const container = this.getContainer();
container.classList.remove("hidden");
container.classList.add("visible");
}
hide() {
this.getContainer().classList.add("hidden");
this.getContainer().classList.remove("visible");
}
toggleMinimize(minimize: boolean) {
const container = this.shadowRoot.getElementById("container");
const minimizedDetails = this.shadowRoot.getElementById("minimized-details");
if (minimize) {
container.classList.add("minimized");
minimizedDetails.classList.add("visible");
} else {
container.classList.remove("minimized");
minimizedDetails.classList.remove("visible");
// if expanded widget width is going out of screen, then set its horizontal position to default
const boundingRect = this.getBoundingClientRect();
if (boundingRect.right > window.innerWidth) {
this.moveToPostion({ right: DEFAULT_POSITION.right, top: boundingRect.top });
}
}
}
_getDefaultMarkup() {
return `
<style>${styles}</style>
<div id="container">
<div id="minimized-details">
<div id="minimized-logo">${RQLogoSmall}</div>
<button id="test-rule-minimized-btn"></button>
</div>
<div id="heading-container">
<div id="logo-container">
<span id="heading-logo">${RQLogo}</span>
<span id="logo-text">requestly</span>
</div>
<div id="actions-container">
<button id="settings-button" class="hidden" data-tooltip="Hide widget in app settings">${VisibilityIcon}</button>
<button id="minimize-button">${MinimizeIcon}</buttton>
<button id="close-button" class="hidden">${CloseIcon}</buttton>
</div>
</div>
<div id="test-rule-container"></div>
<div id="info-container" class="hidden">
<div id="info-icon" class="secondary-text">${InfoIcon}</div>
<div id="info-text" class="secondary-text"></div>
</div>
</div>
`;
}
}
``` | /content/code_sandbox/browser-extension/common/src/custom-elements/test-rule-widget/index.ts | xml | 2016-12-01T04:36:06 | 2024-08-16T19:12:19 | requestly | requestly/requestly | 2,121 | 767 |
```xml
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { DonutChartComponent } from './donut-chart.component';
describe('DonutChartComponent', () => {
let component: DonutChartComponent;
let fixture: ComponentFixture<DonutChartComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
schemas: [NO_ERRORS_SCHEMA],
declarations: [DonutChartComponent],
}).compileComponents();
fixture = TestBed.createComponent(DonutChartComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
``` | /content/code_sandbox/src/portal/src/app/base/left-side-nav/job-service-dashboard/worker-card/donut-chart/donut-chart.component.spec.ts | xml | 2016-01-28T21:10:28 | 2024-08-16T15:28:34 | harbor | goharbor/harbor | 23,335 | 141 |
```xml
<vector android:height="24dp" android:viewportHeight="20"
android:viewportWidth="20" android:width="24dp" xmlns:android="path_to_url">
<path android:fillColor="@color/gray65" android:pathData="M16,3.5A1.5,1.5 0,0 1,17.5 5V15A1.5,1.5 0,0 1,16 16.5H4A1.5,1.5 0,0 1,2.5 15V5A1.5,1.5 0,0 1,4 3.5H16M16,2H4A3,3 0,0 0,1 5V15a3,3 0,0 0,3 3H16a3,3 0,0 0,3 -3V5a3,3 0,0 0,-3 -3ZM10.011,15l0.523,-2.46H8.4L7.873,15H6.381l0.524,-2.46H4.829V11.089H7.207l0.464,-2.178H5.594V7.46h2.38L8.5,5H9.99L9.466,7.46H11.6L12.127,5h1.492L13.1,7.46h2.076V8.911H12.793l-0.464,2.178h2.077V12.54h-2.38L11.5,15ZM11.3,8.911H9.163L8.7,11.089h2.138Z"/>
</vector>
``` | /content/code_sandbox/src/main/res/drawable/ic_emoji_symbol_light_20.xml | xml | 2016-07-03T07:32:36 | 2024-08-16T16:51:15 | deltachat-android | deltachat/deltachat-android | 1,082 | 397 |
```xml
import { AccountsMagicLink, RequestMagicLinkEmailErrors } from '@accounts/magic-link';
import { AccountsServer, AccountsJsError } from '@accounts/server';
import { type MutationResolvers } from '../models';
export const Mutation: MutationResolvers = {
requestMagicLinkEmail: async (_, { email }, ctx) => {
const { injector } = ctx;
const accountsServer = injector.get(AccountsServer);
const accountsMagicLink = injector.get(AccountsMagicLink);
try {
await accountsMagicLink.requestMagicLinkEmail(email);
} catch (error) {
// If ambiguousErrorMessages is true,
// to prevent user enumeration we fail silently in case there is no user attached to this email
if (
accountsServer.options.ambiguousErrorMessages &&
error instanceof AccountsJsError &&
error.code === RequestMagicLinkEmailErrors.UserNotFound
) {
return null;
}
throw error;
}
return null;
},
};
``` | /content/code_sandbox/modules/module-magic-link/src/resolvers/mutation.ts | xml | 2016-10-07T01:43:23 | 2024-07-14T11:57:08 | accounts | accounts-js/accounts | 1,492 | 204 |
```xml
import { ApolloLink, Observable, gql } from "../../../core/index.js";
import type { TypedDocumentNode } from "../../../core/index.js";
import type { MockedResponse } from "../../core/index.js";
export interface SimpleCaseData {
greeting: string;
}
export function setupSimpleCase() {
const query: TypedDocumentNode<SimpleCaseData, Record<string, never>> = gql`
query GreetingQuery {
greeting
}
`;
const mocks: MockedResponse<SimpleCaseData>[] = [
{
request: { query },
result: { data: { greeting: "Hello" } },
delay: 10,
},
];
return { query, mocks };
}
export interface VariablesCaseData {
character: {
__typename: "Character";
id: string;
name: string;
};
}
export interface VariablesCaseVariables {
id: string;
}
export function setupVariablesCase() {
const query: TypedDocumentNode<VariablesCaseData, VariablesCaseVariables> =
gql`
query CharacterQuery($id: ID!) {
character(id: $id) {
id
name
}
}
`;
const CHARACTERS = ["Spider-Man", "Black Widow", "Iron Man", "Hulk"];
const mocks: MockedResponse<VariablesCaseData>[] = [...CHARACTERS].map(
(name, index) => ({
request: { query, variables: { id: String(index + 1) } },
result: {
data: {
character: { __typename: "Character", id: String(index + 1), name },
},
},
delay: 20,
})
);
return { mocks, query };
}
interface Letter {
letter: string;
position: number;
}
export interface PaginatedCaseData {
letters: Letter[];
}
export interface PaginatedCaseVariables {
limit?: number;
offset?: number;
}
export function setupPaginatedCase() {
const query: TypedDocumentNode<PaginatedCaseData, PaginatedCaseVariables> =
gql`
query LettersQuery($limit: Int, $offset: Int) {
letters(limit: $limit, offset: $offset) {
letter
position
}
}
`;
const data = "ABCDEFGHIJKLMNOPQRSTUV".split("").map((letter, index) => ({
__typename: "Letter",
letter,
position: index + 1,
}));
const link = new ApolloLink((operation) => {
const { offset = 0, limit = 2 } = operation.variables;
const letters = data.slice(offset, offset + limit);
return new Observable((observer) => {
setTimeout(() => {
observer.next({ data: { letters } });
observer.complete();
}, 10);
});
});
return { query, link, data };
}
``` | /content/code_sandbox/src/testing/internal/scenarios/index.ts | xml | 2016-02-26T20:25:00 | 2024-08-16T10:56:57 | apollo-client | apollographql/apollo-client | 19,304 | 609 |
```xml
import { IContext } from '../../../connectionResolver';
import { ITimeframe } from '../../../models/definitions/timeframes';
import {
moduleCheckPermission,
moduleRequireLogin
} from '@erxes/api-utils/src/permissions';
interface IEditArgs extends ITimeframe {
_id?: string;
}
const timeframeMutations = {
timeframesEdit: async (
_root: any,
{ docs }: { docs: any[] },
{ models }: IContext
) => {
return await models.Timeframes.timeframesEdit(docs);
}
};
moduleRequireLogin(timeframeMutations);
moduleCheckPermission(timeframeMutations, 'manageSalesPlans');
export default timeframeMutations;
``` | /content/code_sandbox/packages/plugin-salesplans-api/src/graphql/resolvers/mutations/timeframes.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 145 |
```xml
///
///
///
/// path_to_url
///
/// Unless required by applicable law or agreed to in writing, software
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
///
import { EntityId } from './entity-id';
import { EntityType } from '@shared/models/entity-type.models';
export class AssetProfileId implements EntityId {
entityType = EntityType.ASSET_PROFILE;
id: string;
constructor(id: string) {
this.id = id;
}
}
``` | /content/code_sandbox/ui-ngx/src/app/shared/models/id/asset-profile-id.ts | xml | 2016-12-01T09:33:30 | 2024-08-16T19:58:25 | thingsboard | thingsboard/thingsboard | 16,820 | 101 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Fortran (Fixed Format)" version="6" kateversion="5.0" section="Sources" extensions="*.f;*.F;*.for;*.FOR;*.fpp;*.FPP;" mimetype="text/x-fortran-src" casesensitive="0" author="Franchin Matteo (fnch@libero.it)" license="MIT" priority="9">
<!-- by Franchin Matteo, fnch@libero.it -->
<!-- NOTE: Keep in sync with the "Fortran (Free Format)" highlighter! (fortran-free.xml) -->
<highlighting>
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * L I S T S * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<list name="keywords">
<item>allocate</item>
<item>break</item>
<item>call</item>
<item>common</item>
<item>continue</item>
<item>cycle</item>
<item>deallocate</item>
<item>forall</item>
<item>where</item>
<item>elsewhere</item>
<item>equivalence</item>
<item>exit</item>
<item>external</item>
<item>for</item>
<item>go</item>
<item>goto</item>
<item>if</item>
<item>implicit</item>
<item>include</item>
<item>interface</item>
<item>intrinsic</item>
<item>namelist</item>
<item>none</item>
<item>nullify</item>
<item>operator</item>
<item>assignment</item>
<item>pause</item>
<item>procedure</item>
<item>pure</item>
<item>elemental</item>
<item>record</item>
<item>recursive</item>
<item>result</item>
<item>return</item>
<item>stop</item>
<item>to</item>
<item>use</item>
<item>only</item>
<item>entry</item>
<item>while</item>
<!-- Others keywords:
case, default, select, selectcase,
contains, do, elseif, else, then -->
</list>
<list name="io_functions">
<item>access</item>
<item>backspace</item>
<item>close</item>
<item>inquire</item>
<item>open</item>
<item>print</item>
<item>read</item>
<item>rewind</item>
<item>write</item>
<item>format</item>
</list>
<!-- Keywords inside read(...), write(...), backspace(...),
rewind(...), endfile(...), close(...) -->
<list name="io_keywords">
<item>unit</item>
<item>end</item>
<item>err</item>
<item>fmt</item>
<item>iostat</item>
<item>status</item>
<item>advance</item>
<item>size</item>
<item>eor</item>
</list>
<!-- Keywords inside open(...) -->
<list name="open_keywords">
<item>unit</item>
<item>iostat</item>
<item>err</item>
<item>file</item>
<item>status</item>
<item>access</item>
<item>form</item>
<item>recl</item>
<item>blank</item>
<item>position</item>
<item>action</item>
<item>delim</item>
<item>pad</item>
</list>
<!-- Keywords inside inquire(...) -->
<list name="inquire_keywords">
<item>unit</item>
<item>iostat</item>
<item>err</item>
<item>file</item>
<item>exist</item>
<item>opened</item>
<item>number</item>
<item>named</item>
<item>name</item>
<item>access</item>
<item>sequential</item>
<item>direct</item>
<item>form</item>
<item>formatted</item>
<item>unformatted</item>
<item>recl</item>
<item>nextrec</item>
<item>blank</item>
<item>position</item>
<item>action</item>
<item>read</item>
<item>write</item>
<item>readwrite</item>
<item>delim</item>
<item>pad</item>
</list>
<list name="types">
<item>parameter</item>
<item>save</item>
<item>pointer</item>
<item>public</item>
<item>private</item>
<item>target</item>
<item>allocatable</item>
<item>optional</item>
<item>sequence</item>
<!-- Others types: double, precision -->
</list>
<!-- There are 4 types of intrinsic procedures in Fortran 90:
1) Elemental procedures (elemental_procs);
2) Inquiry functions (inquiry_fn);
3) Transformational functions (transform_fn);
4) Non elemental subroutines (non_elem_subr);
Often mathematical functions have one generic form and many specific names!
If you use the generic form, the compiler will select the right function
to use depending on the type of the arguments.
But you can use also the specific names!
-->
<!-- E L E M E N T A L P R O C E D U R E S -->
<list name="elemental_procs">
<!-- Elemental functions that may convert -->
<item>abs</item> <!-- Generic form: abs -->
<item>cabs</item> <!-- Specific names for abs -->
<item>dabs</item>
<item>iabs</item>
<item>aimag</item>
<item>aint</item> <!-- Generic form: aint -->
<item>dint</item> <!-- Specific name for aint -->
<item>anint</item> <!-- Generic form: anint -->
<item>dnint</item> <!-- Specific name for anint -->
<item>ceiling</item>
<item>cmplx</item>
<item>dcmplx</item> <!-- (non standard) -->
<item>dimag</item> <!-- (non standard) -->
<item>floor</item>
<item>nint</item> <!-- Generic form: nint -->
<item>idnint</item><!-- Specific name for nint -->
<item>int</item> <!-- Generic form: int -->
<item>idint</item> <!-- Specific names for int -->
<item>ifix</item>
<item>real</item> <!-- Generic form: real -->
<item>float</item> <!-- Specific names for real -->
<item>sngl</item>
<item>dble</item>
<item>dreal</item> <!-- (non standard) -->
<item>aprime</item> <!-- 5 functions from fortran.xml -->
<item>dconjg</item> <!-- I don't know if they really belong to -->
<item>dfloat</item> <!-- the fortran 90/95 standard! -->
<item>ddmim</item>
<item>rand</item>
<!-- Elemental functions that do not convert -->
<item>modulo</item>
<item>conjg</item>
<item>dprod</item> <!-- dprod(x, y) is the specific name for x*y -->
<item>dim</item> <!-- Generic form: dim -->
<item>ddim</item> <!-- Specific names for dim -->
<item>idim</item>
<item>max</item> <!-- Generic form: max -->
<item>amax0</item> <!-- Specific names for max -->
<item>amax1</item>
<item>max0</item>
<item>max1</item>
<item>dmax1</item>
<item>min</item> <!-- Generic form: min -->
<item>amin0</item> <!-- Specific names for min -->
<item>amin1</item>
<item>min0</item>
<item>min1</item>
<item>dmin1</item>
<item>mod</item> <!-- Generic form: mod -->
<item>amod</item> <!-- Specific names for mod -->
<item>dmod</item>
<item>sign</item> <!-- Generic form: sign -->
<item>dsign</item> <!-- Specific names for sign -->
<item>isign</item>
<!-- Elemental mathematical functions -->
<item>acos</item> <!-- Generic form: acos -->
<item>dacos</item> <!-- Specific names for acos -->
<item>asin</item> <!-- Generic form: asin -->
<item>dasin</item> <!-- Specific names for asin -->
<item>atan</item> <!-- Generic form: atan -->
<item>datan</item> <!-- Specific names for atan -->
<item>atan2</item> <!-- Generic form: atan2 -->
<item>datan2</item> <!-- Specific names for atan2 -->
<item>cos</item> <!-- Generic form: cos -->
<item>ccos</item> <!-- Specific names for cos -->
<item>dcos</item>
<item>cosh</item> <!-- Generic form: cosh -->
<item>dcosh</item> <!-- Specific names for cosh -->
<item>exp</item> <!-- Generic form: exp -->
<item>cexp</item> <!-- Specific names for exp -->
<item>dexp</item>
<item>log</item> <!-- Generic form: log -->
<item>alog</item> <!-- Specific names for log -->
<item>dlog</item>
<item>clog</item>
<item>log10</item> <!-- Generic form: log10 -->
<item>alog10</item> <!-- Specific names for log10 -->
<item>dlog10</item>
<item>sin</item> <!-- Generic form: sin -->
<item>csin</item> <!-- Specific names for sin -->
<item>dsin</item>
<item>sinh</item> <!-- Generic form: sinh -->
<item>dsinh</item> <!-- Specific name for sinh -->
<item>sqrt</item> <!-- Generic form: sqrt -->
<item>csqrt</item> <!-- Specific names for sqrt -->
<item>dsqrt</item>
<item>tan</item> <!-- Generic form: tan -->
<item>dtan</item> <!-- Generic form: dtan -->
<item>tanh</item> <!-- Generic form: tanh -->
<item>dtanh</item> <!-- Specific names for tanh -->
<!-- Elemental character and logical functions -->
<!-- Character-integer conversions -->
<item>achar</item>
<item>char</item>
<item>iachar</item>
<item>ichar</item>
<!-- Lexical comparison functions -->
<item>lge</item>
<item>lgt</item>
<item>lle</item>
<item>llt</item>
<!-- String-handling elemental functions -->
<item>adjustl</item>
<item>adjustr</item>
<item>index</item>
<item>len_trim</item>
<item>scan</item>
<item>verify</item>
<!-- Logical conversion -->
<item>logical</item>
<!-- Elemental functions to manipulate reals -->
<item>exponent</item>
<item>fraction</item>
<item>nearest</item>
<item>rrspacing</item>
<item>scale</item>
<item>set_exponent</item>
<item>spacing</item>
<!-- Bit manipulation elemental functions -->
<item>btest</item>
<item>iand</item>
<item>ibclr</item>
<item>ibits</item>
<item>ibset</item>
<item>ieor</item>
<item>ior</item>
<item>ishft</item>
<item>ishftc</item>
<item>not</item>
<!-- Bit manipulation elemental subroutine -->
<item>mvbits</item>
<!-- Merge elemental function -->
<item>merge</item>
</list>
<!-- I N Q U I R Y F U N C T I O N S -->
<list name="inquiry_fn">
<!-- Inquiry functions for any type -->
<item>associated</item>
<item>present</item>
<item>kind</item>
<!-- String-handling inquiry function -->
<item>len</item>
<!-- Numeric inquiry functions -->
<item>digits</item>
<item>epsilon</item>
<item>huge</item>
<item>maxexponent</item>
<item>minexponent</item>
<item>precision</item>
<item>radix</item>
<item>range</item>
<item>tiny</item>
<!-- Bit inquiry function -->
<item>bit_size</item>
<!-- Array inquiry functions -->
<item>allocated</item>
<item>lbound</item>
<item>ubound</item>
<item>shape</item>
<item>size</item>
</list>
<!-- T R A N S F O R M A T I O N A L F U N C T I O N S -->
<list name="transform_fn">
<!-- String-handling transformational functions -->
<item>repeat</item>
<item>trim</item>
<!-- Transformational functions for kind values -->
<item>selected_int_kind</item>
<item>selected_real_kind</item>
<!-- Transfer function -->
<item>transfer</item>
<!-- Vector and matrix multiplication functions -->
<item>dot_product</item>
<item>matmul</item>
<!-- Transformational functions that reduce arrays -->
<item>all</item>
<item>any</item>
<item>count</item>
<item>maxval</item>
<item>minval</item>
<item>product</item>
<item>sum</item>
<!-- Packing and unpacking arrays -->
<item>pack</item>
<item>unpack</item>
<!-- Transformational function for reshaping an array -->
<item>reshape</item>
<!-- Transformational function for replication -->
<item>spread</item>
<!-- Array shifting functions -->
<item>cshift</item>
<item>eoshift</item>
<!-- Matrix transpose -->
<item>transpose</item>
<!-- Transformational functions for geometric location -->
<item>maxloc</item>
<item>minloc</item>
</list>
<!-- N O N E L E M E N T A L S U B R O U T I N E S -->
<list name="non_elem_subr">
<!-- Real time clock -->
<item>date_and_time</item>
<item>system_clock</item>
<!-- Random numbers -->
<item>random_number</item>
<item>random_seed</item>
</list>
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * C O N T E X T S * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="default" >
<IncludeRules context="find_preprocessor" />
<IncludeRules context="find_comments" />
<IncludeRules context="find_strings" />
<IncludeRules context="find_decls" />
<IncludeRules context="find_intrinsics" />
<IncludeRules context="find_io_stmnts" />
<IncludeRules context="find_op_and_log" />
<IncludeRules context="find_numbers" />
<IncludeRules context="find_continue" />
<IncludeRules context="find_symbols" />
<IncludeRules context="find_begin_stmnts" />
<IncludeRules context="find_end_stmnts" />
<IncludeRules context="find_mid_stmnts" />
</context>
<!--************************END OF THE MAIN CONTEXT*************************-->
<!-- IMPORTANT: If you modify something, do it also in "fortran-free.xml"! -->
<!-- This context highlights preprocessor lines -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_preprocessor">
<DetectChar attribute="Preprocessor" context="preprocessor" char="#" column="0"/>
<StringDetect attribute="Preprocessor" context="preprocessor" String="cDEC$" column="0"/>
<StringDetect attribute="Preprocessor" context="preprocessor" String="CDEC$" column="0"/>
</context>
<context attribute="Preprocessor" lineEndContext="#pop" name="preprocessor" />
<!-- This context highlights operators and the logical values .true. .false. -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_op_and_log">
<StringDetect attribute="Logical" context="#stay" String=".true." insensitive="true"/>
<StringDetect attribute="Logical" context="#stay" String=".false." insensitive="true"/>
<RegExpr attribute="Operator" context="#stay" String="\.[A-Za-z]+\."/>
<Detect2Chars attribute="Operator" context="#stay" char="=" char1="="/>
<Detect2Chars attribute="Operator" context="#stay" char="/" char1="="/>
<Detect2Chars attribute="Operator" context="#stay" char="<" char1="="/>
<Detect2Chars attribute="Operator" context="#stay" char=">" char1="="/>
<AnyChar attribute="Operator" context="#stay" String="<>"/>
</context>
<!-- This context highlights comments -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_comments">
<AnyChar attribute="Comment" context="comment" String="cC*" column="0"/>
<DetectChar attribute="Comment" context="comment" char="!"/>
<RegExpr attribute="Comment" context="comment" String="." column="72" />
</context>
<context attribute="Comment" lineEndContext="#pop" name="comment">
<IncludeRules context="##Alerts"/>
<IncludeRules context="##Modelines"/>
</context>
<!-- This context highlights symbols -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_symbols">
<Detect2Chars attribute="Keyword" context="#stay" char="*" char1="*"/>
<Detect2Chars attribute="Keyword" context="#stay" char="(" char1="/"/>
<Detect2Chars attribute="Keyword" context="#stay" char="/" char1=")"/>
<AnyChar attribute="Keyword" context="#stay" String="&+-*/=?[]^{|}~"/>
<AnyChar attribute="Symbol" context="#stay" String="(),"/>
</context>
<!-- This context highlights the continuation character -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_continue">
<RegExpr attribute="Continuation character" context="#stay" String="^ [^0-9\s]"/>
</context>
<!-- This context highlights items inside the parentesis of a function -->
<context attribute="Normal Text" lineEndContext="#stay" name="inside_func_paren">
<DetectChar attribute="Normal Text" context="inside_func_paren" char="("/>
<DetectChar attribute="Normal Text" context="#pop" char=")"/>
<IncludeRules context="find_strings" />
<IncludeRules context="find_intrinsics" />
<IncludeRules context="find_numbers" />
</context>
<!-- The following two contexts match input/output statements -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_io_stmnts">
<RegExpr attribute="IO Function" context="find_io_paren" String="\b(read|write|backspace|rewind|end\s*file|close|open|inquire)\s*[(]" insensitive="true"/>
<RegExpr attribute="IO Function" context="format_stmnt" String="\bformat\s*[(]" insensitive="true"/>
<RegExpr attribute="IO Function" context="#stay" String="\bend\s*file\b" insensitive="true"/>
<keyword attribute="IO Function" context="#stay" String="io_functions"/>
</context>
<!-- This context matches parenthesis for the read, write, ... statements -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_io_paren">
<DetectChar attribute="IO Function" context="#stay" char="*"/>
<DetectChar attribute="Normal Text" context="inside_func_paren" char="("/>
<DetectChar attribute="IO Function" context="#pop" char=")"/>
<keyword attribute="IO Function" context="#stay" String="io_keywords"/>
<keyword attribute="IO Function" context="#stay" String="inquire_keywords"/>
<keyword attribute="IO Function" context="#stay" String="open_keywords"/>
<IncludeRules context="find_strings" />
<IncludeRules context="find_intrinsics" />
<IncludeRules context="find_numbers" />
<IncludeRules context="find_symbols" />
</context>
<!-- This context highlights the text inside the parenthesis of fortran statement -->
<context attribute="Normal Text" lineEndContext="#stay" name="format_stmnt">
<DetectChar attribute="IO Function" context="format_stmnt" char="("/>
<DetectChar attribute="IO Function" context="#pop" char=")"/>
<RegExpr attribute="IO Function" context="#stay" String="[0-9]*/" insensitive="true"/>
<DetectChar attribute="IO Function" context="#stay" char=":"/>
<IncludeRules context="find_strings" />
<IncludeRules context="find_symbols" />
</context>
<!-- The following context matches the begin of program units -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_begin_stmnts">
<RegExpr attribute="Keyword" context="#stay" String="\bmodule\s+procedure\b" insensitive="true"/>
<RegExpr attribute="Keyword" context="#stay" String="\b(subroutine|function|block\s*data|program|module)\b" insensitive="true" beginRegion="Routine"/>
<RegExpr attribute="Keyword" context="#stay" String="\b(then|do|select\s+case)\b" insensitive="true" beginRegion="Block"/>
</context>
<!-- The following context matches the end of program units -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_end_stmnts">
<RegExpr attribute="Keyword" context="#stay" String="\bend\s*(subroutine|function|block\s*data|program|module)\b" insensitive="true" endRegion="Routine"/>
<RegExpr attribute="Keyword" context="#stay" String="\bend\s*(do|if)\b" insensitive="true" endRegion="Block"/>
<RegExpr attribute="Keyword" context="#stay" String="\bend\s*(select|where|forall|interface)\b" insensitive="true"/>
<RegExpr attribute="Keyword" context="#stay" String="\belse\s*if\b" insensitive="true" endRegion="Block"/>
<WordDetect attribute="Keyword" context="#stay" String="end" insensitive="true" endRegion="Routine"/>
</context>
<!-- The following context matches the mid of program units -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_mid_stmnts">
<WordDetect attribute="Keyword" context="#stay" String="else" insensitive="true" endRegion="Block" beginRegion="Block"/>
<RegExpr attribute="Keyword" context="#stay" String="\bcase(\s+default)?\b" insensitive="true" endRegion="Block" beginRegion="Block"/>
<WordDetect attribute="Keyword" context="#stay" String="contains" insensitive="true" endRegion="Routine" beginRegion="Routine"/>
</context>
<!-- The following two contexts match declarations -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_decls">
<RegExpr attribute="Data Type" context="#stay" String="\b(integer|real|complex)[\*]\d{1,2}" insensitive="true"/>
<RegExpr attribute="Data Type" context="#stay" String="\bend\s*type\b" insensitive="true"/>
<keyword attribute="Data Type" context="#stay" String="types"/>
<WordDetect attribute="Data Type" context="#stay" String="data" firstNonSpace="true" insensitive="true"/>
<!--<RegExpr attribute="Data Type" context="find_paren" String="real\s*[(]" firstNonSpace="true" insensitive="true"/>
<RegExpr attribute="Data Type" context="#stay" String="real(?![\w\*])" firstNonSpace="true" insensitive="true"/>-->
<RegExpr attribute="Data Type" context="#stay" String="\bcharacter[*][0-9]+\b" insensitive="true"/>
<RegExpr attribute="Data Type" context="find_paren" String="\b(type|integer|real|complex|character|logical|intent|dimension)\s*[(]" insensitive="true"/>
<RegExpr attribute="Data Type" context="#stay" String="\b(type|integer|real|complex|character|logical|double\s*precision|intent|dimension)\b" insensitive="true"/>
<Detect2Chars attribute="Data Type" context="#stay" char=":" char1=":"/>
</context>
<!-- This context matches parenthesis in data type declarations, such as in 'real(...)'-->
<context attribute="Data Type" lineEndContext="#pop" name="find_paren">
<DetectChar attribute="Data Type" context="find_paren" char="("/>
<DetectChar attribute="Data Type" context="#pop" char=")"/>
</context>
<!-- The following context matches intrinsic procedures -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_intrinsics">
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<!-- INTRINSIC PROCEDURES -->
<keyword attribute="Elemental Procedure" context="#stay" String="elemental_procs"/>
<keyword attribute="Inquiry Function" context="#stay" String="inquiry_fn"/>
<keyword attribute="Transformational Function" context="#stay" String="transform_fn"/>
<keyword attribute="Non elemental subroutine" context="#stay" String="non_elem_subr"/>
</context>
<!-- The following context matches integer and real numbers -->
<context attribute="Normal Text" lineEndContext="#stay" name="find_numbers">
<!-- Floating-point numbers with optional kind -->
<RegExpr attribute="Float" context="#stay" String="[0-9]*\.[0-9]+([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?" insensitive="true"/>
<RegExpr attribute="Float" context="#stay" String="\b[0-9]+\.[0-9]*([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?(?![a-z])" insensitive="true"/>
<RegExpr attribute="Float" context="#stay" String="\b[0-9]+[de][+-]?[0-9]+([_]([0-9]+|[a-z][\w_]*))?" insensitive="true"/>
<!-- Integers with optional kind specifier -->
<RegExpr attribute="Decimal" context="#stay" String="\b[0-9]+([_]([0-9]+|[a-zA-Z][\w_]*))?"/>
<!-- Integers in binary, octal and hexadecimal notations -->
<RegExpr attribute="Decimal" context="#stay" String="\b[bozx](['][0-9a-f]+[']|["][0-9a-f]+["])" insensitive="true"/>
</context>
<!-- The following four contexts implement the complex string multi-line declarations -->
<!-- Matches STRINGS (there are 2 types of strings: '...' and "...") -->
<context attribute="String" lineEndContext="#stay" name="find_strings">
<DetectChar attribute="String" context="string_1" char="'"/>
<DetectChar attribute="String" context="string_2" char="""/>
</context>
<context attribute="String" lineEndContext="#stay" name="string_1" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="String" context="#pop" String="[^']*'"/>
<RegExpr attribute="Keyword" context="end_of_string" String="&\s*$"/>
<RegExpr attribute="String" context="end_of_string" String=".*(?=&\s*$)"/>
</context>
<context attribute="String" lineEndContext="#stay" name="string_2" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="String" context="#pop" String="[^"]*""/>
<RegExpr attribute="Keyword" context="end_of_string" String="&\s*$"/>
<RegExpr attribute="String" context="end_of_string" String=".*(?=&\s*$)"/>
</context>
<context attribute="String" lineEndContext="#stay" name="end_of_string" fallthrough="true" fallthroughContext="#pop#pop">
<DetectSpaces />
<RegExpr attribute="Keyword" context="#stay" String="&\s*$"/>
<DetectChar attribute="Keyword" context="#pop" char="&" firstNonSpace="true"/>
<AnyChar attribute="Comment" context="comment" String="cC*" column="0"/>
<DetectChar attribute="Comment" context="comment" char="!" firstNonSpace="true"/>
</context>
</contexts>
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * S T Y L E I T E M D E F I N I T I O N S * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<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="Float" defStyleNum="dsFloat"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Symbol" defStyleNum="dsNormal"/>
<itemData name="Preprocessor" defStyleNum="dsOthers"/>
<itemData name="Operator" defStyleNum="dsOperator" bold="1" italic="0"/>
<itemData name="Logical" defStyleNum="dsConstant" bold="1" italic="0"/>
<itemData name="IO Function" defStyleNum="dsFunction" bold="0" italic="0"/>
<itemData name="Elemental Procedure" defStyleNum="dsBuiltIn" bold="1" italic="0"/>
<itemData name="Continuation character" defStyleNum="dsBuiltIn" bold="1" italic="0"/>
<itemData name="Inquiry Function" defStyleNum="dsFunction" bold="1" italic="1"/>
<itemData name="Transformational Function" defStyleNum="dsFunction" bold="1" italic="0"/>
<itemData name="Non elemental subroutine" defStyleNum="dsFunction" bold="1" italic="0"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="c"/>
</comments>
<keywords casesensitive="0"/>
</general>
</language>
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->
``` | /content/code_sandbox/src/data/extra/syntax-highlighting/syntax/fortran-fixed.xml | xml | 2016-10-05T07:24:54 | 2024-08-16T05:03:40 | vnote | vnotex/vnote | 11,687 | 7,408 |
```xml
import { NumberArray, NumberProp } from '../../lib/extract/types';
import { warnUnimplementedFilter } from '../../lib/util';
import FilterPrimitive from './FilterPrimitive';
type FunctionChannel = 'R' | 'G' | 'B' | 'A' | 'UNKNOWN';
type FunctionType = 'identity' | 'table' | 'discrete' | 'linear' | 'gamma';
export type FeComponentTransferFunctionProps = {
type: FunctionType;
tableValues?: NumberArray;
slope?: NumberProp;
intercept?: NumberProp;
amplitude?: NumberProp;
exponent?: NumberProp;
offset?: NumberProp;
};
export default class FeComponentTransferFunction extends FilterPrimitive<FeComponentTransferFunctionProps> {
channel: FunctionChannel = 'UNKNOWN';
static defaultProps: React.ComponentProps<
typeof FeComponentTransferFunction
> = {
type: 'identity',
tableValues: [],
slope: 1,
intercept: 0,
amplitude: 1,
exponent: 1,
offset: 0,
};
render() {
warnUnimplementedFilter();
return null;
}
}
export type FeFuncRProps = FeComponentTransferFunctionProps;
export class FeFuncR extends FeComponentTransferFunction {
static displayName = 'FeFuncR';
channel: FunctionChannel = 'R';
}
export type FeFuncGProps = FeComponentTransferFunctionProps;
export class FeFuncG extends FeComponentTransferFunction {
static displayName = 'FeFuncG';
channel: FunctionChannel = 'G';
}
export type FeFuncBProps = FeComponentTransferFunctionProps;
export class FeFuncB extends FeComponentTransferFunction {
static displayName = 'FeFuncB';
channel: FunctionChannel = 'B';
}
export type FeFuncAProps = FeComponentTransferFunctionProps;
export class FeFuncA extends FeComponentTransferFunction {
static displayName = 'FeFuncA';
channel: FunctionChannel = 'A';
}
``` | /content/code_sandbox/src/elements/filters/FeComponentTransferFunction.tsx | xml | 2016-01-17T14:29:21 | 2024-08-16T13:35:44 | react-native-svg | software-mansion/react-native-svg | 7,397 | 414 |
```xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Correct call cancellation on wrong SDP offer PR #3137 -->
<scenario name="UAC sending INVITE with unsupported media in SDP offer">
<send retrans="500">
<![CDATA[
INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
To: [service] <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, BYE, PRACK, UPDATE, REFER, MESSAGE
Supported: 100rel, precondition
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=video 11128 RTP/AVP 34 103 104
a=rtpmap:34 H263/90000
a=rtpmap:103 H263-1998/90000
a=rtpmap:104 H264/90000
a=sendrecv
]]>
</send>
<recv response="100" optional="true">
</recv>
<recv response="183" optional="true">
</recv>
<recv response="488" rtd="true" crlf="true">
</recv>
<send>
<![CDATA[
ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
To: [service] <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
``` | /content/code_sandbox/tests/pjsua/scripts-sipp/uac-183-wrong-media.xml | xml | 2016-01-24T05:00:33 | 2024-08-16T03:31:21 | pjproject | pjsip/pjproject | 1,960 | 830 |
```xml
import type { FC, ReactNode } from 'react';
import noop from '@proton/utils/noop';
import type { CreateNotificationOptions, NotificationsContextValue } from './index';
import { NotificationsContext } from './index';
interface NotificationsHijackProps {
onCreate: ((options: CreateNotificationOptions) => void) | undefined;
children?: ReactNode;
}
const NotificationsHijack: FC<NotificationsHijackProps> = ({ children, onCreate }) => {
if (!onCreate) {
return <>{children}</>;
}
const hijackedCreateNotification = (options: CreateNotificationOptions) => {
onCreate(options);
/* createNotification has to return a number */
return 42;
};
const context: NotificationsContextValue = {
createNotification: hijackedCreateNotification,
removeNotification: noop,
hideNotification: noop,
removeDuplicate: noop,
clearNotifications: noop,
setOffset: noop,
};
return <NotificationsContext.Provider value={context}>{children}</NotificationsContext.Provider>;
};
export default NotificationsHijack;
``` | /content/code_sandbox/packages/components/containers/notifications/NotificationsHijack.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 226 |
```xml
/*your_sha256_hash-----------------------------
*your_sha256_hash----------------------------*/
declare module 'vscode' {
// path_to_url
//
// This API is still proposed but we don't intent on promoting it to stable due to problems
// around performance. See #145234 for a more likely API to get stabilized.
export interface TerminalDataWriteEvent {
/**
* The {@link Terminal} for which the data was written.
*/
readonly terminal: Terminal;
/**
* The data being written.
*/
readonly data: string;
}
namespace window {
/**
* An event which fires when the terminal's child pseudo-device is written to (the shell).
* In other words, this provides access to the raw data stream from the process running
* within the terminal, including VT sequences.
*/
export const onDidWriteTerminalData: Event<TerminalDataWriteEvent>;
}
}
``` | /content/code_sandbox/typings/vscode-proposed/vscode.proposed.terminalDataWriteEvent.d.ts | xml | 2016-01-19T10:50:01 | 2024-08-12T21:05:24 | pythonVSCode | DonJayamanne/pythonVSCode | 2,078 | 197 |
```xml
// a slider that shows the history of the diagram layout optimization, requesting shapes from the worker and rendering them on demand
import { penroseBlue } from "@penrose/components";
import { isPenroseError, runtimeError } from "@penrose/core";
import { useState } from "react";
import { useRecoilState, useRecoilValue } from "recoil";
import { showOptimizerError } from "../optimizer/common";
import { diagramState, diagramWorkerState, optimizer } from "../state/atoms.js";
import SegmentedSlider from "./SegmentedSlider.js";
export const LayoutTimelineSlider: React.FC<{}> = (props) => {
const [diagram, setDiagram] = useRecoilState(diagramState);
const { optimizing } = useRecoilValue(diagramWorkerState);
const [waiting, setWaiting] = useState(false);
const onChange = (i: number) => {
// request shapes from worker
async function requestShapes() {
if (diagram.diagramId === null || diagram.historyLoc === null) return;
setWaiting(true);
const historyLoc = {
sequenceId: diagram.historyLoc.sequenceId,
frame: i,
};
const state = await optimizer.computeLayout(
diagram.diagramId,
historyLoc,
);
if (state.isErr()) {
setWaiting(false);
setDiagram((diagram) => ({
...diagram,
error: isPenroseError(state.error)
? state.error
: runtimeError(showOptimizerError(state.error)),
}));
} else {
setWaiting(false);
setDiagram((diagram) => ({
...diagram,
state: state.value,
}));
}
setDiagram((diagram) => ({
...diagram,
historyLoc,
}));
}
if (!waiting) {
// may not be able to request shapes if recompiled, resampled, etc between
// call and receive
requestShapes().catch(() => {
setWaiting(false);
});
}
};
const layoutStats = diagram.historyLoc
? diagram.historyInfo?.get(diagram.historyLoc.sequenceId)?.layoutStats ?? []
: [];
return (
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
}}
>
<SegmentedSlider
disabled={optimizing}
segments={layoutStats.map((stat, i) => ({
label: stat.name,
frames: stat.frames,
cumulativeFrames: stat.cumulativeFrames,
color: penroseBlue.primary,
}))}
onChange={onChange}
></SegmentedSlider>
</div>
);
};
``` | /content/code_sandbox/packages/editor/src/components/LayoutTimelineSlider.tsx | xml | 2016-09-22T04:47:19 | 2024-08-16T13:00:54 | penrose | penrose/penrose | 6,760 | 569 |
```xml
<shape xmlns:android="path_to_url"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#4CAF50"
android:endColor="#2E7D32"
android:startColor="#81C784"
android:type="linear"/>
</shape>
``` | /content/code_sandbox/app/src/main/res/drawable/side_nav_bar.xml | xml | 2016-05-23T14:19:17 | 2024-08-02T07:38:08 | ColorfulNews | kaku2015/ColorfulNews | 1,312 | 67 |
```xml
import { FieldNode, GraphQLFieldConfig, GraphQLSchema } from 'graphql';
import { DelegationContext, SubschemaConfig, Transform } from '@graphql-tools/delegate';
import { ExecutionRequest, MapperKind, mapSchema } from '@graphql-tools/utils';
import TransformObjectFields from './TransformObjectFields.js';
type RenamerFunction = (typeName: string, fieldName: string, argName: string) => string;
interface RenameObjectFieldArgumentsTransformationContext extends Record<string, any> {}
export default class RenameObjectFieldArguments<TContext = Record<string, any>>
implements Transform<RenameObjectFieldArgumentsTransformationContext, TContext>
{
private readonly renamer: RenamerFunction;
private readonly transformer: TransformObjectFields<TContext>;
private reverseMap: Record<string, Record<string, Record<string, string>>>;
constructor(renamer: RenamerFunction) {
this.renamer = renamer;
this.transformer = new TransformObjectFields(
(typeName, fieldName, fieldConfig) => {
const argsConfig = Object.fromEntries(
Object.entries(fieldConfig.args || []).map(([argName, conf]) => {
const newName = renamer(typeName, fieldName, argName);
if (newName !== undefined && newName !== argName) {
if (newName != null) {
return [newName, conf];
}
}
return [argName, conf];
}),
);
return [fieldName, { ...fieldConfig, args: argsConfig }];
},
(typeName: string, fieldName: string, inputFieldNode: FieldNode) => {
if (!(typeName in this.reverseMap)) {
return inputFieldNode;
}
if (!(fieldName in this.reverseMap[typeName])) {
return inputFieldNode;
}
const fieldNameMap = this.reverseMap[typeName][fieldName];
return {
...inputFieldNode,
arguments: (inputFieldNode.arguments || []).map(argNode => {
return argNode.name.value in fieldNameMap
? {
...argNode,
name: {
...argNode.name,
value: fieldNameMap[argNode.name.value],
},
}
: argNode;
}),
};
},
);
this.reverseMap = Object.create(null);
}
public transformSchema(
originalWrappingSchema: GraphQLSchema,
subschemaConfig: SubschemaConfig<any, any, any, TContext>,
): GraphQLSchema {
mapSchema(originalWrappingSchema, {
[MapperKind.OBJECT_FIELD]: (
fieldConfig: GraphQLFieldConfig<any, any>,
fieldName: string,
typeName,
): undefined => {
Object.entries(fieldConfig.args || {}).forEach(([argName]) => {
const newName = this.renamer(typeName, fieldName, argName);
if (newName !== undefined && newName !== fieldName) {
if (this.reverseMap[typeName] == null) {
this.reverseMap[typeName] = Object.create(null);
}
if (this.reverseMap[typeName][fieldName] == null) {
this.reverseMap[typeName][fieldName] = Object.create(null);
}
this.reverseMap[typeName][fieldName][newName] = argName;
}
});
return undefined;
},
[MapperKind.ROOT_OBJECT]() {
return undefined;
},
});
return this.transformer.transformSchema(originalWrappingSchema, subschemaConfig);
}
public transformRequest(
originalRequest: ExecutionRequest,
delegationContext: DelegationContext<TContext>,
transformationContext: RenameObjectFieldArgumentsTransformationContext,
): ExecutionRequest {
return this.transformer.transformRequest(
originalRequest,
delegationContext,
transformationContext,
);
}
}
``` | /content/code_sandbox/packages/wrap/src/transforms/RenameObjectFieldArguments.ts | xml | 2016-03-22T00:14:38 | 2024-08-16T02:02:06 | graphql-tools | ardatan/graphql-tools | 5,331 | 777 |
```xml
import * as React from 'react';
import {
FolderRegular,
EditRegular,
OpenRegular,
DocumentRegular,
PeopleRegular,
DocumentPdfRegular,
VideoRegular,
} from '@fluentui/react-icons';
import {
PresenceBadgeStatus,
Avatar,
TableBody,
TableCell,
TableRow,
Table,
TableHeader,
TableHeaderCell,
TableSelectionCell,
TableCellLayout,
useTableFeatures,
TableColumnDefinition,
useTableSelection,
createTableColumn,
} from '@fluentui/react-components';
type FileCell = {
label: string;
icon: JSX.Element;
};
type LastUpdatedCell = {
label: string;
timestamp: number;
};
type LastUpdateCell = {
label: string;
icon: JSX.Element;
};
type AuthorCell = {
label: string;
status: PresenceBadgeStatus;
};
type Item = {
file: FileCell;
author: AuthorCell;
lastUpdated: LastUpdatedCell;
lastUpdate: LastUpdateCell;
};
const items: Item[] = [
{
file: { label: 'Meeting notes', icon: <DocumentRegular /> },
author: { label: 'Max Mustermann', status: 'available' },
lastUpdated: { label: '7h ago', timestamp: 3 },
lastUpdate: {
label: 'You edited this',
icon: <EditRegular />,
},
},
{
file: { label: 'Thursday presentation', icon: <FolderRegular /> },
author: { label: 'Erika Mustermann', status: 'busy' },
lastUpdated: { label: 'Yesterday at 1:45 PM', timestamp: 2 },
lastUpdate: {
label: 'You recently opened this',
icon: <OpenRegular />,
},
},
{
file: { label: 'Training recording', icon: <VideoRegular /> },
author: { label: 'John Doe', status: 'away' },
lastUpdated: { label: 'Yesterday at 1:45 PM', timestamp: 2 },
lastUpdate: {
label: 'You recently opened this',
icon: <OpenRegular />,
},
},
{
file: { label: 'Purchase order', icon: <DocumentPdfRegular /> },
author: { label: 'Jane Doe', status: 'offline' },
lastUpdated: { label: 'Tue at 9:30 AM', timestamp: 1 },
lastUpdate: {
label: 'You shared this in a Teams chat',
icon: <PeopleRegular />,
},
},
];
const columns: TableColumnDefinition<Item>[] = [
createTableColumn<Item>({
columnId: 'file',
}),
createTableColumn<Item>({
columnId: 'author',
}),
createTableColumn<Item>({
columnId: 'lastUpdated',
}),
createTableColumn<Item>({
columnId: 'lastUpdate',
}),
];
export const SubtleSelection = () => {
const {
getRows,
selection: { allRowsSelected, someRowsSelected, toggleAllRows, toggleRow, isRowSelected },
} = useTableFeatures(
{
columns,
items,
},
[
useTableSelection({
selectionMode: 'multiselect',
defaultSelectedItems: new Set([0, 1]),
}),
],
);
const rows = getRows(row => {
const selected = isRowSelected(row.rowId);
return {
...row,
onClick: (e: React.MouseEvent) => toggleRow(e, row.rowId),
onKeyDown: (e: React.KeyboardEvent) => {
if (e.key === ' ') {
e.preventDefault();
toggleRow(e, row.rowId);
}
},
selected,
appearance: selected ? ('brand' as const) : ('none' as const),
};
});
const toggleAllKeydown = React.useCallback(
(e: React.KeyboardEvent<HTMLDivElement>) => {
if (e.key === ' ') {
toggleAllRows(e);
e.preventDefault();
}
},
[toggleAllRows],
);
return (
<Table aria-label="Table with subtle selection" style={{ minWidth: '550px' }}>
<TableHeader>
<TableRow>
<TableSelectionCell
checked={allRowsSelected ? true : someRowsSelected ? 'mixed' : false}
onClick={toggleAllRows}
onKeyDown={toggleAllKeydown}
checkboxIndicator={{ 'aria-label': 'Select all rows ' }}
/>
<TableHeaderCell>File</TableHeaderCell>
<TableHeaderCell>Author</TableHeaderCell>
<TableHeaderCell>Last updated</TableHeaderCell>
<TableHeaderCell>Last update</TableHeaderCell>
</TableRow>
</TableHeader>
<TableBody>
{rows.map(({ item, selected, onClick, onKeyDown, appearance }) => (
<TableRow
key={item.file.label}
onClick={onClick}
onKeyDown={onKeyDown}
aria-selected={selected}
appearance={appearance}
>
<TableSelectionCell subtle checked={selected} checkboxIndicator={{ 'aria-label': 'Select row' }} />
<TableCell>
<TableCellLayout media={item.file.icon}>{item.file.label}</TableCellLayout>
</TableCell>
<TableCell>
<TableCellLayout
media={
<Avatar
aria-label={item.author.label}
name={item.author.label}
badge={{ status: item.author.status }}
/>
}
>
{item.author.label}
</TableCellLayout>
</TableCell>
<TableCell>{item.lastUpdated.label}</TableCell>
<TableCell>
<TableCellLayout media={item.lastUpdate.icon}>{item.lastUpdate.label}</TableCellLayout>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
);
};
SubtleSelection.parameters = {
docs: {
description: {
story: [
'By setting the `subtle` prop on the `TableSelectionCell` component, the selection indicator will only',
'appear when:',
'- the `TableRow` component is hovered.',
'- The current focused element is within the `TableRow`',
'- The `TableSelectionCell` is checked',
].join('\n'),
},
},
};
``` | /content/code_sandbox/packages/react-components/react-table/stories/src/Table/SubtleSelection.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 1,339 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
</PropertyGroup>
</Project>
``` | /content/code_sandbox/GameMaths/GameMaths.csproj | xml | 2016-03-25T11:39:45 | 2024-08-16T04:33:58 | GameServer | LeagueSandbox/GameServer | 1,045 | 46 |
```xml
import { type FC, memo } from 'react';
import { Link } from 'react-router-dom';
import { ButtonLike, type ButtonLikeProps } from '@proton/atoms/Button';
import { ItemTag } from '@proton/pass/components/Item/List/ItemTag';
import type { ItemRevision } from '@proton/pass/types';
import clsx from '@proton/utils/clsx';
import './PinnedItem.scss';
export const PINNED_ITEM_MAX_WIDTH_PX = 150;
type Props = ButtonLikeProps<any> & {
item: ItemRevision;
active?: boolean;
className?: string;
};
const PinnedItemRaw: FC<Props> = ({ item, active = false, className, ...rest }) => (
<ButtonLike
as={Link}
to="#"
className={clsx('pass-pinned-list--item shrink-0 button-xs', className, active && 'is-active')}
color="weak"
shape="ghost"
size="small"
{...rest}
>
<ItemTag {...item} />
</ButtonLike>
);
export const PinnedItem = memo(PinnedItemRaw);
``` | /content/code_sandbox/packages/pass/components/Item/Pinned/PinnedItem.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 242 |
```xml
import * as assert from "assert"
import { unescape } from "lodash"
import { StackElement } from "vscode-textmate"
import * as markdown from "./../../browser/src/Editor/NeovimEditor/markdown"
describe("Markdown Conversion Functions", () => {
it("Scopes to string fn should correctly convert scopes to classnames", () => {
const className = markdown.scopesToString(["token.scope.extension"])
assert.ok(className === "token-scope")
})
it("Scopes to string fn should correctly convert single words to a className", () => {
const className = markdown.scopesToString(["source"])
assert.ok(className === "source")
})
it("Scopes to string Should return null if passed an falsy", () => {
const nullArg = markdown.scopesToString(null)
assert.ok(!nullArg)
})
it("Escape RegExp function should add an escape character to all banned chars", () => {
const stringForRegex = "*apple^"
const escaped = markdown.escapeRegExp(stringForRegex)
// prettier-ignore
assert.ok(escaped === "\\*apple\\^")
})
it("Escape RegExp function should NOT add an escape character to the | or - characters", () => {
// NOTE token names include either so if they are escaped the token matching will fail
const stringForRegex = "apple-tree|pineapple"
const notEscaped = markdown.escapeRegExp(stringForRegex)
assert.ok(notEscaped === "apple-tree|pineapple")
})
it("Create container function should wrap given text in a paragraph tag", () => {
const wrapped = markdown.createContainer("p", "this is a paragraph")
assert.ok(wrapped === `<p class="marked-paragraph">this is a paragraph</p>`)
})
it("Create container function should wrap given text in a pre element with a code block", () => {
const wrapped = markdown.createContainer("pre", "this is code")
assert.ok(wrapped === `<pre class="marked-pre">this is code</pre>`)
})
it("Should match tokens correctly and wrap a token in a span with the correct class", () => {
const test = "eight"
const token = [
{
line: test,
ruleStack: {} as StackElement,
tokens: [
{
scopes: ["test.scope.tsx"],
range: { start: { character: 0, line: 0 }, end: { character: 5, line: 0 } },
},
],
},
]
const tag = markdown.renderWithClasses({ tokens: token, text: test, container: "p" })
assert.ok(
tag.replace("\n", "") ===
`<p class="marked-paragraph"><span class="marked test-scope">eight</span></p>`,
)
})
it("Should match several tokens correctly and wrap a token in a span with the correct class", () => {
const tokens = [
{
line: "React HTMLElement",
ruleStack: {} as StackElement,
tokens: [
{
scopes: ["react.js.tsx"],
range: { start: { character: 0, line: 0 }, end: { character: 5, line: 0 } },
},
{
scopes: ["stack.element.tsx"],
range: {
start: { character: 6, line: 0 },
end: { character: 17, line: 0 },
},
},
],
},
]
const tag = markdown.renderWithClasses({
tokens,
text: "React HTMLElement",
container: "code",
})
// Note Code block provides its own code tag so this should return just spans
const expected = `<span class="marked react-js">React</span> <span class="marked stack-element">HTMLElement</span>`
.replace("\n", "")
.trim()
assert.ok(tag.replace("\n", "").trim() === expected)
})
it("should render safe jsx untouched ", () => {
const md = `### A title
<AReactComponent />`
const result = markdown.convertMarkdown({ markdown: md, tokens: null })
assert.ok(unescape(result).includes(`<AReactComponent />`))
})
it("should render safe html untouched ", () => {
const md = `### Another Title
<div></div>`
const result = markdown.convertMarkdown({ markdown: md, tokens: null })
assert.ok(unescape(result).includes(`<div></div>`))
})
})
``` | /content/code_sandbox/browser/test/MarkdownTests.ts | xml | 2016-11-16T14:42:55 | 2024-08-14T11:48:05 | oni | onivim/oni | 11,355 | 978 |
```xml
import Head from 'next/head'
import React, { useEffect } from 'react'
import { useRouter } from 'next/router'
import { Card, Image, Layout } from 'antd'
import { useCurrentUserQuery } from '../../components/Me/meHooks'
import getPageTitle from '../../lib/getPageTitle'
import BuiltWithCodeGenie from '../BuiltWithCodeGenie'
export default function UnauthenticatedPage({
children,
pageTitle,
includeLayout = true,
includeLogoContentWrapper = true,
}) {
const router = useRouter()
const currentUserQuery = useCurrentUserQuery({ redirectOnNotAuth: false })
useEffect(() => {
if (currentUserQuery.data) {
const searchParams = new URLSearchParams(window.location.search)
const redirect = searchParams.get('redirect') || '/todo-lists'
router.replace(redirect)
}
}, [currentUserQuery.data])
if (currentUserQuery.isInitialLoading || currentUserQuery.data) return null
return (
<>
<Head>
<title>{getPageTitle({ pageTitle })}</title>
</Head>
{includeLayout ? <Layout>
<Layout.Content>
<div style={{flexDirection: 'column'}}>
<Card className='layout-container'>
{includeLogoContentWrapper ? (
<div>
<div style={{textAlign: 'center', padding: '1rem'}}>
<Image
className='logo'
src='/logo.png'
alt='Logo'
preview={false}
style={{maxHeight: '100px', maxWidth: '100%'}}
/>
</div>
{children}
</div>
) : children}
</Card>
<BuiltWithCodeGenie />
</div>
</Layout.Content>
</Layout> : children}
<style jsx global>
{`
body {
margin: 0;
}
.layout-container {
width: 360px;
}
.ant-layout .ant-layout-content {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
overflow: auto;
}
.ant-card .ant-card-body {
padding-top: 0;
}
`}
</style>
</>
)
}
``` | /content/code_sandbox/examples/lambda-function-url/packages/ui/components/layouts/UnauthenticatedPage.tsx | xml | 2016-09-13T23:29:07 | 2024-08-15T09:52:47 | serverless-express | CodeGenieApp/serverless-express | 5,117 | 474 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="intelligent"
android:id="@+id/cb_authflood_intelligent"
android:checked="false" />
<Button
android:id="@+id/button_start_authflood"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Start" />
</LinearLayout>
``` | /content/code_sandbox/app/app/src/main/res/layout/authflood_dialog.xml | xml | 2016-10-27T09:31:28 | 2024-08-16T19:00:35 | nexmon | seemoo-lab/nexmon | 2,381 | 144 |
```xml
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
ContentChildren,
EventEmitter,
HostBinding,
Input,
Output,
QueryList,
Type,
ViewChild,
ViewChildren,
ViewContainerRef
} from "@angular/core";
import { UntypedFormGroup, ReactiveFormsModule } from "@angular/forms";
import {
DYNAMIC_FORM_CONTROL_INPUT_TYPE_NUMBER,
DYNAMIC_FORM_CONTROL_TYPE_ARRAY,
DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX,
DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX_GROUP,
DYNAMIC_FORM_CONTROL_TYPE_COLORPICKER,
DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER,
DYNAMIC_FORM_CONTROL_TYPE_EDITOR,
DYNAMIC_FORM_CONTROL_TYPE_GROUP,
DYNAMIC_FORM_CONTROL_TYPE_INPUT,
DYNAMIC_FORM_CONTROL_TYPE_RADIO_GROUP,
DYNAMIC_FORM_CONTROL_TYPE_RATING,
DYNAMIC_FORM_CONTROL_TYPE_SELECT,
DYNAMIC_FORM_CONTROL_TYPE_SLIDER,
DYNAMIC_FORM_CONTROL_TYPE_SWITCH,
DYNAMIC_FORM_CONTROL_TYPE_TEXTAREA,
DYNAMIC_FORM_CONTROL_TYPE_TIMEPICKER,
DynamicFormArrayComponent,
DynamicFormArrayGroupModel,
DynamicFormArrayModel,
DynamicFormComponentService,
DynamicFormControl,
DynamicFormControlContainerComponent,
DynamicFormControlCustomEvent,
DynamicFormControlEvent,
DynamicFormControlLayout,
DynamicFormControlModel,
DynamicFormGroupComponent,
DynamicFormGroupModel,
DynamicFormLayout,
DynamicFormLayoutService,
DynamicFormRelationService,
DynamicFormValidationService,
DynamicInputModel,
DynamicSelectModel,
DynamicTemplateDirective
} from "@ng-dynamic-forms/core";
import { DynamicPrimeNGCheckboxComponent } from "./checkbox/dynamic-primeng-checkbox.component";
import { DynamicPrimeNGColorPickerComponent } from "./colorpicker/dynamic-primeng-colorpicker.component";
import { DynamicPrimeNGCalendarComponent } from "./calendar/dynamic-primeng-calendar.component";
import { DynamicPrimeNGEditorComponent } from "./editor/dynamic-primeng-editor.component";
import { DynamicPrimeNGSpinnerComponent } from "./spinner/dynamic-primeng-spinner.component";
import { DynamicPrimeNGInputMaskComponent } from "./input-mask/dynamic-primeng-input-mask.component";
import { DynamicPrimeNGAutoCompleteComponent } from "./autocomplete/dynamic-primeng-autocomplete.component";
import { DynamicPrimeNGChipsComponent } from "./chips/dynamic-primeng-chips.component";
import { DynamicPrimeNGInputComponent } from "./input/dynamic-primeng-input.component";
import { DynamicPrimeNGRadioGroupComponent } from "./radio-group/dynamic-primeng-radio-group.component";
import { DynamicPrimeNGRatingComponent } from "./rating/dynamic-primeng-rating.component";
import { DynamicPrimeNGMultiSelectComponent } from "./multiselect/dynamic-primeng-multiselect.component";
import { DynamicPrimeNGDropdownComponent } from "./dropdown/dynamic-primeng-dropdown.component";
import { DynamicPrimeNGSliderComponent } from "./slider/dynamic-primeng-slider.component";
import { DynamicPrimeNGInputSwitchComponent } from "./input-switch/dynamic-primeng-input-switch.component";
import { DynamicPrimeNGTextAreaComponent } from "./textarea/dynamic-primeng-textarea.component";
import { NgClass, NgFor, NgTemplateOutlet, NgIf } from "@angular/common";
@Component({
selector: "dynamic-primeng-form-control",
templateUrl: "./dynamic-primeng-form-control-container.component.html",
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [ReactiveFormsModule, NgClass, NgIf, NgTemplateOutlet, NgFor]
})
export class DynamicPrimeNGFormControlContainerComponent extends DynamicFormControlContainerComponent {
@ContentChildren(DynamicTemplateDirective) contentTemplateList!: QueryList<DynamicTemplateDirective>;
@HostBinding("class") klass?: string;
@Input() context: DynamicFormArrayGroupModel | null = null;
@Input() group!: UntypedFormGroup;
@Input() hostClass!: string[];
// tslint:disable-next-line:no-input-rename
@Input("templates") inputTemplateList?: QueryList<DynamicTemplateDirective>;
@Input() layout?: DynamicFormLayout;
@Input() model!: DynamicFormControlModel;
@Output() blur: EventEmitter<DynamicFormControlEvent> = new EventEmitter<DynamicFormControlEvent>();
@Output() change: EventEmitter<DynamicFormControlEvent> = new EventEmitter<DynamicFormControlEvent>();
@Output() focus: EventEmitter<DynamicFormControlEvent> = new EventEmitter<DynamicFormControlEvent>();
// tslint:disable-next-line:no-output-rename
@Output("pEvent") customEvent: EventEmitter<DynamicFormControlEvent> = new EventEmitter<DynamicFormControlEvent>();
@ViewChild("componentViewContainer", {read: ViewContainerRef, static: true}) componentViewContainerRef!: ViewContainerRef;
constructor(protected changeDetectorRef: ChangeDetectorRef,
protected componentFactoryResolver: ComponentFactoryResolver,
protected layoutService: DynamicFormLayoutService,
protected validationService: DynamicFormValidationService,
protected componentService: DynamicFormComponentService,
protected relationService: DynamicFormRelationService) {
super(changeDetectorRef, componentFactoryResolver, layoutService, validationService, componentService, relationService);
}
get componentType(): Type<DynamicFormControl> | null {
return this.componentService.getCustomComponentType(this.model) ?? primeNGUIFormControlMapFn(this.model);
}
}
export function primeNGUIFormControlMapFn(model: DynamicFormControlModel): Type<DynamicFormControl> | null {
switch (model.type) {
case DYNAMIC_FORM_CONTROL_TYPE_ARRAY:
return DynamicPrimeNGFormArrayComponent;
case DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX:
return DynamicPrimeNGCheckboxComponent;
case DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX_GROUP:
return DynamicPrimeNGFormGroupComponent;
case DYNAMIC_FORM_CONTROL_TYPE_COLORPICKER:
return DynamicPrimeNGColorPickerComponent;
case DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER:
return DynamicPrimeNGCalendarComponent;
case DYNAMIC_FORM_CONTROL_TYPE_EDITOR:
return DynamicPrimeNGEditorComponent;
case DYNAMIC_FORM_CONTROL_TYPE_GROUP:
return DynamicPrimeNGFormGroupComponent;
case DYNAMIC_FORM_CONTROL_TYPE_INPUT:
const inputModel = model as DynamicInputModel;
if (inputModel.inputType === DYNAMIC_FORM_CONTROL_INPUT_TYPE_NUMBER) {
return DynamicPrimeNGSpinnerComponent;
} else if (inputModel.mask) {
return DynamicPrimeNGInputMaskComponent;
} else if (Array.isArray(inputModel.list)) {
return DynamicPrimeNGAutoCompleteComponent;
} else if (inputModel.multiple) {
return DynamicPrimeNGChipsComponent;
} else {
return DynamicPrimeNGInputComponent;
}
case DYNAMIC_FORM_CONTROL_TYPE_RADIO_GROUP:
return DynamicPrimeNGRadioGroupComponent;
case DYNAMIC_FORM_CONTROL_TYPE_RATING:
return DynamicPrimeNGRatingComponent;
case DYNAMIC_FORM_CONTROL_TYPE_SELECT:
const selectModel = model as DynamicSelectModel<string>;
return selectModel.multiple ? DynamicPrimeNGMultiSelectComponent : DynamicPrimeNGDropdownComponent;
case DYNAMIC_FORM_CONTROL_TYPE_SLIDER:
return DynamicPrimeNGSliderComponent;
case DYNAMIC_FORM_CONTROL_TYPE_SWITCH:
return DynamicPrimeNGInputSwitchComponent;
case DYNAMIC_FORM_CONTROL_TYPE_TEXTAREA:
return DynamicPrimeNGTextAreaComponent;
case DYNAMIC_FORM_CONTROL_TYPE_TIMEPICKER:
return DynamicPrimeNGCalendarComponent;
default:
return null;
}
}
@Component({
selector: "dynamic-primeng-form-array",
templateUrl: "./dynamic-primeng-form-array.component.html",
standalone: true,
imports: [ReactiveFormsModule, NgClass, NgFor, NgTemplateOutlet, DynamicPrimeNGFormControlContainerComponent]
})
export class DynamicPrimeNGFormArrayComponent extends DynamicFormArrayComponent {
@Input() formLayout?: DynamicFormLayout;
@Input() group!: UntypedFormGroup;
@Input() layout?: DynamicFormControlLayout;
@Input() model!: DynamicFormArrayModel;
@Input() templates?: QueryList<DynamicTemplateDirective>;
@Output() blur: EventEmitter<any> = new EventEmitter();
@Output() change: EventEmitter<any> = new EventEmitter();
@Output() customEvent: EventEmitter<DynamicFormControlCustomEvent> = new EventEmitter();
@Output() focus: EventEmitter<any> = new EventEmitter();
@ViewChildren(DynamicPrimeNGFormControlContainerComponent) components!: QueryList<DynamicPrimeNGFormControlContainerComponent>;
constructor(protected layoutService: DynamicFormLayoutService, protected validationService: DynamicFormValidationService) {
super(layoutService, validationService);
}
}
@Component({
selector: "dynamic-primeng-form-group",
templateUrl: "./dynamic-primeng-form-group.component.html",
standalone: true,
imports: [ReactiveFormsModule, NgClass, NgFor, DynamicPrimeNGFormControlContainerComponent]
})
export class DynamicPrimeNGFormGroupComponent extends DynamicFormGroupComponent {
@Input() formLayout?: DynamicFormLayout;
@Input() group!: UntypedFormGroup;
@Input() layout?: DynamicFormControlLayout;
@Input() model!: DynamicFormGroupModel;
@Input() templates?: QueryList<DynamicTemplateDirective> | DynamicTemplateDirective[];
@Output() blur: EventEmitter<any> = new EventEmitter();
@Output() change: EventEmitter<any> = new EventEmitter();
@Output() customEvent: EventEmitter<DynamicFormControlCustomEvent> = new EventEmitter();
@Output() focus: EventEmitter<any> = new EventEmitter();
@ViewChildren(DynamicPrimeNGFormControlContainerComponent) components!: QueryList<DynamicPrimeNGFormControlContainerComponent>;
constructor(protected layoutService: DynamicFormLayoutService, protected validationService: DynamicFormValidationService) {
super(layoutService, validationService);
}
}
``` | /content/code_sandbox/projects/ng-dynamic-forms/ui-primeng/src/lib/dynamic-primeng-form-control-container.component.ts | xml | 2016-06-01T20:26:33 | 2024-08-05T16:40:39 | ng-dynamic-forms | udos86/ng-dynamic-forms | 1,315 | 2,040 |
```xml
import { removeBin, removeBinsOfDependency } from './removeBins'
export {
removeBin,
removeBinsOfDependency,
}
``` | /content/code_sandbox/pkg-manager/remove-bins/src/index.ts | xml | 2016-01-28T07:40:43 | 2024-08-16T12:38:47 | pnpm | pnpm/pnpm | 28,869 | 29 |
```xml
import { type FC, useEffect, useState } from 'react';
import { useLocation, useParams } from 'react-router';
import { c } from 'ttag';
import warningIcon from '@proton/pass/assets/secure-link/secure-link-warning.svg';
import { ItemContentView } from '@proton/pass/components/Item/Containers/ItemContentView';
import { DateBadge } from '@proton/pass/components/Layout/Badge/DateBadge';
import { useRequest } from '@proton/pass/hooks/useActionRequest';
import { intoSecureLinkItemRevision } from '@proton/pass/lib/secure-links/secure-links.utils';
import { secureLinkOpen } from '@proton/pass/store/actions';
import { secureLinkOpenRequest } from '@proton/pass/store/actions/requests';
import type { Maybe, MaybeNull, SecureLinkItem } from '@proton/pass/types';
import { PASS_APP_NAME } from '@proton/shared/lib/constants';
type SecureLinkParams = { token: string };
const SecureLinkView: FC = () => {
const { hash } = useLocation();
const { token } = useParams<SecureLinkParams>();
const [response, setResponse] = useState<Maybe<SecureLinkItem>>();
const [error, setError] = useState<MaybeNull<string>>(null);
const { dispatch, loading } = useRequest(secureLinkOpen, {
initialRequestId: secureLinkOpenRequest(token),
onFailure: ({ data }) => setError(data.error),
onStart: () => setError(null),
onSuccess: ({ data }) => setResponse(data),
});
useEffect(() => dispatch({ token, linkKey: hash.replaceAll('#', '') }), []);
return (
<>
{response && (
<>
<h3 className="text-bold mb-4 xs:px-8 sm:px-16 sm:mx-4 md:mx-10">
{c('Action').t`Someone shared an item with you on ${PASS_APP_NAME}.`}
</h3>
{response.expirationDate && <DateBadge expirationTime={response?.expirationDate} />}
{response.item && (
<ItemContentView revision={intoSecureLinkItemRevision(response)} secureLinkItem />
)}
</>
)}
{loading && (
<div className="flex flex-column gap-2">
<div className="pass-skeleton pass-skeleton--box" style={{ '--skeleton-height': '3.5rem' }} />
<div className="pass-skeleton pass-skeleton--box" style={{ '--skeleton-height': '3rem' }} />
<div className="pass-skeleton pass-skeleton--box" style={{ '--skeleton-height': '30rem' }} />
</div>
)}
{error && (
<div className="flex flex-column items-center">
<img src={warningIcon} alt="" />
<h4 className="text-bold mb-3">{error}</h4>
<div>{c('Error').t`Try reaching out to the link owner.`}</div>
</div>
)}
</>
);
};
export default SecureLinkView;
``` | /content/code_sandbox/packages/pass/components/SecureLink/SecureLinkView.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 647 |
```xml
import { SystemInfoService } from '../../../../shared/services';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ConfirmationDialogComponent } from '../../../../shared/components/confirmation-dialog';
import { ProjectPolicyConfigComponent } from './project-policy-config.component';
import { ProjectService } from '../../../../shared/services';
import { SystemCVEAllowlist, SystemInfo } from '../../../../shared/services';
import { Project } from './project';
import { UserPermissionService } from '../../../../shared/services';
import { of } from 'rxjs';
import { SharedTestingModule } from '../../../../shared/shared.module';
import { ErrorHandler } from '../../../../shared/units/error-handler';
import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
import { Component, ViewChild } from '@angular/core';
const mockSystemInfo: SystemInfo[] = [
{
with_trivy: true,
with_admiral: false,
admiral_endpoint: 'NA',
auth_mode: 'db_auth',
registry_url: '10.112.122.56',
project_creation_restriction: 'everyone',
self_registration: true,
has_ca_root: false,
harbor_version: 'v1.1.1-rc1-160-g565110d',
},
{
with_trivy: false,
with_admiral: false,
admiral_endpoint: 'NA',
auth_mode: 'db_auth',
registry_url: '10.112.122.56',
project_creation_restriction: 'everyone',
self_registration: true,
has_ca_root: false,
harbor_version: 'v1.1.1-rc1-160-g565110d',
},
];
const mockProjectPolicies: Project[] | any[] = [
{
project_id: 1,
owner_id: 1,
name: 'library',
creation_time: '2017-11-03T02:37:24Z',
update_time: '2017-11-03T02:37:24Z',
deleted: 0,
owner_name: '',
togglable: false,
current_user_role_id: 0,
repo_count: 0,
metadata: {
public: 'true',
},
},
{
project_id: 2,
owner_id: 1,
name: 'test',
creation_time: '2017-11-03T02:37:24Z',
update_time: '2017-11-03T02:37:24Z',
deleted: 0,
owner_name: '',
togglable: false,
current_user_role_id: 0,
repo_count: 0,
metadata: {
auto_scan: 'true',
auto_sbom_generation: 'true',
enable_content_trust: 'true',
prevent_vul: 'true',
public: 'true',
severity: 'low',
},
},
];
const mockSystemAllowlist: SystemCVEAllowlist = {
expires_at: 1561996800,
id: 1,
items: [],
project_id: 0,
};
const projectService = {
getProject() {
return of(mockProjectPolicies[1]);
},
};
const systemInfoService = {
getSystemInfo() {
return of(mockSystemInfo[0]);
},
getSystemAllowlist() {
return of(mockSystemAllowlist);
},
};
const userPermissionService = {
getPermission() {
return of(true);
},
};
describe('ProjectPolicyConfigComponent', () => {
let fixture: ComponentFixture<TestHostComponent>,
component: TestHostComponent;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SharedTestingModule],
declarations: [
TestHostComponent,
ProjectPolicyConfigComponent,
ConfirmationDialogComponent,
],
providers: [
{ provide: ErrorHandler, useClass: MessageHandlerService },
{ provide: ProjectService, useValue: projectService },
{ provide: SystemInfoService, useValue: systemInfoService },
{
provide: UserPermissionService,
useValue: userPermissionService,
},
],
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(TestHostComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should get systemInfo', async () => {
fixture.detectChanges();
await fixture.whenStable();
expect(component.projectPolicyConfigComponent.systemInfo).toBeTruthy();
});
it('should get projectPolicy', () => {
expect(
component.projectPolicyConfigComponent.projectPolicy
).toBeTruthy();
expect(
component.projectPolicyConfigComponent.projectPolicy.ScanImgOnPush
).toBeTruthy();
expect(
component.projectPolicyConfigComponent.projectPolicy
.GenerateSbomOnPush
).toBeTruthy();
});
it('should get hasChangeConfigRole', () => {
expect(
component.projectPolicyConfigComponent.hasChangeConfigRole
).toBeTruthy();
});
});
// mock a TestHostComponent for ProjectPolicyConfigComponent
@Component({
template: ` <hbr-project-policy-config
[projectName]="'testing'"
[projectId]="1">
</hbr-project-policy-config>`,
})
class TestHostComponent {
@ViewChild(ProjectPolicyConfigComponent)
projectPolicyConfigComponent: ProjectPolicyConfigComponent;
}
``` | /content/code_sandbox/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts | xml | 2016-01-28T21:10:28 | 2024-08-16T15:28:34 | harbor | goharbor/harbor | 23,335 | 1,136 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="path_to_url"
package="com.github.mobile">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.GitHub"
android:name="AnalyticsApplication">
<activity
android:name=".ui.user.HomeActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.default_searchable"
android:value="com.github.mobile.ui.search.SearchActivity" />
</activity>
<activity
android:name=".ui.gist.CreateGistActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity
android:name=".ui.issue.IssueBrowseActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.repo.issues.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.app.default_searchable"
android:value="com.github.mobile.ui.issue.IssueSearchActivity" />
</activity>
<activity
android:name=".ui.issue.EditIssuesFilterActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.repo.issues.filter.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.issue.IssueDashboardActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.repo.issues.dashboard.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.issue.EditIssueActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.repo.issues.edit.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.search.SearchActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/search_title"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable_repos_users" />
</activity>
<activity
android:name=".ui.gist.GistsActivity"
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name=".ui.issue.FiltersViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.repo.issues.filters.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.gist.GistsViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.gists.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.gist.GistFilesViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.gist.files.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.issue.CreateCommentActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.issue.comment.create.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.gist.CreateCommentActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.gist.comment.create.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.commit.CreateCommentActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.commit.comment.create.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.repo.RepositoryViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.repo.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.app.default_searchable"
android:value="com.github.mobile.ui.issue.IssueSearchActivity" />
</activity>
<activity
android:name=".ui.repo.RepositoryContributorsActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.repo.contributors.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.user.UserViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.user.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.team.TeamViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.team.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.issue.IssuesViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.issues.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service
android:name=".accounts.AccountAuthenticatorService"
android:exported="false"
android:process=":auth">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
<activity
android:name=".accounts.LoginActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/Theme.GitHub.Login"
android:excludeFromRecents="true">
<!--
No intent-filter here! This activity is only ever launched by
someone who explicitly knows the class name
-->
</activity>
<activity
android:name=".accounts.TwoFactorAuthActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/Theme.GitHub.Login"
android:excludeFromRecents="true">
<!--
No intent-filter here! This activity is only ever launched by
someone who explicitly knows the class name
-->
</activity>
<activity
android:name=".ui.user.UriLauncherActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:host="github.com"
android:scheme="http" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:host="github.com"
android:scheme="https" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:host="gist.github.com"
android:scheme="http" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:host="gist.github.com"
android:scheme="https" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.issue.IssueSearchActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/search_title"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable_issues" />
</activity>
<activity
android:name=".ui.commit.CommitCompareViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/commit_compare_title">
<intent-filter>
<action android:name="com.github.client.mobile.commits.compare.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.commit.CommitViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.commits.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.commit.CommitFileViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.commit.file.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.ref.BranchFileViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.github.client.mobile.branch.file.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service
android:name=".sync.SyncAdapterService"
android:exported="false"
android:process=":repos">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/sync_adapter" />
</service>
<provider
android:name=".sync.ContentProviderAdapter"
android:authorities="com.github.client.sync"
android:exported="false"
android:label="GitHub"
android:syncable="true" />
<provider
android:name=".ui.search.RepositorySearchSuggestionsProvider"
android:authorities="com.github.client.search.suggest.recent.repos"
android:exported="false" />
<provider
android:name=".ui.issue.IssueSearchSuggestionsProvider"
android:authorities="com.github.client.search.suggest.recent.issues"
android:exported="false" />
</application>
</manifest>
``` | /content/code_sandbox/app/src/main/AndroidManifest.xml | xml | 2016-04-09T16:05:02 | 2024-08-08T06:37:18 | trugithub | kba7/trugithub | 2,055 | 2,872 |
```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="@stdlib/types"/>
import * as random from '@stdlib/types/random';
import { TypedIterator } from '@stdlib/types/iter';
/**
* Interface defining function options.
*/
interface Options {
/**
* 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.
*/
iter?: number;
}
/**
* Interface for iterators of pseudorandom numbers drawn from a Frchet distribution.
*/
interface Iterator<T> extends TypedIterator<T> {
/**
* 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;
}
/**
* Returns an iterator for generating pseudorandom numbers drawn from a Frchet distribution.
*
* @param alpha - shape parameter
* @param s - rate parameter
* @param options - function options
* @throws `alpha` must be a positive number
* @throws `s` must be a positive number
* @throws must provide valid options
* @throws must provide a valid state
* @returns iterator
*
* @example
* var iter = iterator( 2.0, 5.0 );
*
* var r = iter.next().value;
* // returns <number>
*
* r = iter.next().value;
* // returns <number>
*
* r = iter.next().value;
* // returns <number>
*
* // ...
*/
declare function iterator( alpha: number, s: number, options?: Options ): Iterator<number>;
// EXPORTS //
export = iterator;
``` | /content/code_sandbox/lib/node_modules/@stdlib/random/iter/frechet/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 558 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.