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"?>
<!--
~
~
~ 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.
-->
<com.google.android.material.textview.MaterialTextView
xmlns:android="path_to_url"
xmlns:app="path_to_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TestStyleWithLineHeight"
app:lineHeight="@dimen/material_text_view_test_line_height_override" />
``` | /content/code_sandbox/lib/javatests/com/google/android/material/textview/res/layout/text_view_with_line_height_from_layout.xml | xml | 2016-12-05T16:11:29 | 2024-08-16T17:51:42 | material-components-android | material-components/material-components-android | 16,176 | 139 |
```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>
<style name="AppTheme" parent="Theme.AppCompat">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
``` | /content/code_sandbox/sample/src/main/res/values/styles.xml | xml | 2016-11-01T22:04:45 | 2024-08-13T12:07:08 | TextLayoutBuilder | facebook/TextLayoutBuilder | 1,475 | 132 |
```xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="ALinLiveAnchorView">
<rect key="frame" x="0.0" y="0.0" width="600" height="120"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kua-Xv-IkK">
<rect key="frame" x="240" y="25" width="350" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="La1-41-7mT"/>
</constraints>
</scrollView>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ktr-H4-FKR">
<rect key="frame" x="10" y="90" width="220" height="30"/>
<color key="backgroundColor" white="0.0" alpha="0.20212765956950357" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="220" id="1hF-3P-zGa"/>
<constraint firstAttribute="height" constant="30" id="jHn-Wk-Izp"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
<inset key="titleEdgeInsets" minX="2" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title=":1993045 124593" image="cat_food_18x12"/>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kmu-u3-TES" userLabel="">
<rect key="frame" x="10" y="20" width="220" height="60"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="placeholder_head" translatesAutoresizingMaskIntoConstraints="NO" id="j27-Nh-eX3">
<rect key="frame" x="10" y="5" width="50" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="ShT-8w-MkS"/>
<constraint firstAttribute="width" constant="50" id="lnc-n9-8wf"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PQ0-UC-qjh">
<rect key="frame" x="70" y="5" width="80" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="10442" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fqd-gA-iZo">
<rect key="frame" x="70" y="38" width="56" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Spk-ic-osl">
<rect key="frame" x="160" y="10" width="50" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="ecw-qR-vc8"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<state key="normal" title="">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="selected" title=""/>
<connections>
<action selector="Device:" destination="iN0-l3-epB" eventType="touchUpInside" id="2hW-Oe-Akk"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.19722406914893617" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Spk-ic-osl" firstAttribute="centerY" secondItem="j27-Nh-eX3" secondAttribute="centerY" id="4Yv-4e-pfB"/>
<constraint firstAttribute="height" constant="60" id="59O-KU-4Yb"/>
<constraint firstItem="fqd-gA-iZo" firstAttribute="bottom" secondItem="j27-Nh-eX3" secondAttribute="bottom" id="85r-Gv-c23"/>
<constraint firstAttribute="trailing" secondItem="Spk-ic-osl" secondAttribute="trailing" constant="10" id="Bme-hb-rgC"/>
<constraint firstAttribute="width" constant="220" id="Eu6-Oz-Sxp"/>
<constraint firstItem="PQ0-UC-qjh" firstAttribute="leading" secondItem="j27-Nh-eX3" secondAttribute="trailing" constant="10" id="Iew-Dw-QF7"/>
<constraint firstItem="PQ0-UC-qjh" firstAttribute="top" secondItem="j27-Nh-eX3" secondAttribute="top" id="JbE-kx-Y7f"/>
<constraint firstAttribute="trailing" secondItem="Spk-ic-osl" secondAttribute="trailing" constant="10" id="OWh-IH-e5U"/>
<constraint firstItem="Spk-ic-osl" firstAttribute="height" secondItem="j27-Nh-eX3" secondAttribute="height" constant="-10" id="V6O-ig-r1M"/>
<constraint firstItem="j27-Nh-eX3" firstAttribute="leading" secondItem="kmu-u3-TES" secondAttribute="leading" constant="10" id="gKs-9m-PdZ"/>
<constraint firstItem="j27-Nh-eX3" firstAttribute="top" secondItem="kmu-u3-TES" secondAttribute="top" constant="5" id="lDc-oD-J5d"/>
<constraint firstItem="fqd-gA-iZo" firstAttribute="leading" secondItem="PQ0-UC-qjh" secondAttribute="leading" id="sw0-50-1IE"/>
<constraint firstItem="Spk-ic-osl" firstAttribute="leading" secondItem="PQ0-UC-qjh" secondAttribute="trailing" constant="10" id="teX-nC-Rq3"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="Bme-hb-rgC"/>
</mask>
</variation>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ktr-H4-FKR" firstAttribute="top" secondItem="kmu-u3-TES" secondAttribute="bottom" constant="10" id="B4e-XC-Bg5"/>
<constraint firstAttribute="trailing" secondItem="Kua-Xv-IkK" secondAttribute="trailing" constant="10" id="GcH-pU-OaI"/>
<constraint firstItem="kmu-u3-TES" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="20" id="SMx-I1-J4R"/>
<constraint firstItem="ktr-H4-FKR" firstAttribute="leading" secondItem="kmu-u3-TES" secondAttribute="leading" id="dU6-vI-TEB"/>
<constraint firstItem="kmu-u3-TES" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="evW-ly-5h7"/>
<constraint firstItem="Kua-Xv-IkK" firstAttribute="leading" secondItem="kmu-u3-TES" secondAttribute="trailing" constant="10" id="f6l-rj-hZa"/>
<constraint firstItem="Kua-Xv-IkK" firstAttribute="centerY" secondItem="kmu-u3-TES" secondAttribute="centerY" id="yWu-5e-cGF"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="anchorView" destination="kmu-u3-TES" id="DjV-3m-LGz"/>
<outlet property="careBtn" destination="Spk-ic-osl" id="w6x-pB-gnw"/>
<outlet property="giftView" destination="ktr-H4-FKR" id="HqV-e8-adc"/>
<outlet property="headImageView" destination="j27-Nh-eX3" id="I6T-wt-xow"/>
<outlet property="nameLabel" destination="PQ0-UC-qjh" id="gUT-EA-v3D"/>
<outlet property="peopleLabel" destination="fqd-gA-iZo" id="Mi2-FO-BuG"/>
<outlet property="peoplesScrollView" destination="Kua-Xv-IkK" id="EYs-L0-t7U"/>
</connections>
<point key="canvasLocation" x="593" y="214"/>
</view>
</objects>
<resources>
<image name="cat_food_18x12" width="18" height="12"/>
<image name="placeholder_head" width="100" height="100"/>
</resources>
</document>
``` | /content/code_sandbox/MiaowShow/MiaowShow/Classes/Home/Live/View/ALinLiveAnchorView.xib | xml | 2016-07-05T03:56:08 | 2024-08-12T03:58:23 | MiaowShow | SunLiner/MiaowShow | 2,771 | 2,659 |
```xml
/**
* Removes the notification channel group and all notification channels that belong to it.
* @param groupId The channel group identifier.
* @return A Promise which resolves once the channel group is removed (or if there was no channel group for given identifier).
* @platform android
* @header channels
*/
export default function deleteNotificationChannelGroupAsync(groupId: string): Promise<void>;
//# sourceMappingURL=deleteNotificationChannelGroupAsync.d.ts.map
``` | /content/code_sandbox/packages/expo-notifications/build/deleteNotificationChannelGroupAsync.d.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 88 |
```xml
import { useState } from 'react';
import { c } from 'ttag';
import { InlineLinkButton } from '@proton/atoms/InlineLinkButton';
import truncate from '@proton/utils/truncate';
interface Props {
children: string;
maxChars: number;
}
const TruncatedText = ({ children, maxChars }: Props) => {
const [isShowingMore, setIsShowingMore] = useState(false);
return (
<>
{isShowingMore ? children : truncate(children, maxChars)}{' '}
{children.length > maxChars && (
<InlineLinkButton
color="norm"
onClick={() => setIsShowingMore((prevState) => !prevState)}
className="align-baseline"
>
{isShowingMore ? c('Action').t`Show less` : c('Action').t`Show more`}
</InlineLinkButton>
)}
</>
);
};
export default TruncatedText;
``` | /content/code_sandbox/packages/components/components/truncatedText/TruncatedText.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 198 |
```xml
import {
BaseThemeBasicModule,
BASIC_THEME_NAV_ITEM_PROVIDERS,
BASIC_THEME_STYLES_PROVIDERS,
ValidationErrorComponent,
} from '@abp/ng.theme.basic';
import { ModuleWithProviders, NgModule } from '@angular/core';
import {
VALIDATION_ERROR_TEMPLATE,
VALIDATION_INVALID_CLASSES,
VALIDATION_TARGET_SELECTOR,
} from '@ngx-validate/core';
@NgModule({
exports: [BaseThemeBasicModule],
imports: [BaseThemeBasicModule],
})
export class ThemeBasicTestingModule {
static withConfig(): ModuleWithProviders<ThemeBasicTestingModule> {
return {
ngModule: ThemeBasicTestingModule,
providers: [
BASIC_THEME_NAV_ITEM_PROVIDERS,
BASIC_THEME_STYLES_PROVIDERS,
{
provide: VALIDATION_ERROR_TEMPLATE,
useValue: ValidationErrorComponent,
},
{
provide: VALIDATION_TARGET_SELECTOR,
useValue: '.form-group',
},
{
provide: VALIDATION_INVALID_CLASSES,
useValue: 'is-invalid',
},
],
};
}
}
``` | /content/code_sandbox/npm/ng-packs/packages/theme-basic/testing/src/lib/theme-basic-testing.module.ts | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 216 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</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|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</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>{3b1131b5-ead9-4f69-be70-4b97a89fd675}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>InterfacesTest</ProjectName>
<RootNamespace>InterfacesTest</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>8.1</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<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|ARM'">
<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)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Header2.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Class1.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Class1.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/docs/cppcx/codesnippet/CPP/interfacestest/interfacestest.vcxproj | xml | 2016-11-14T19:38:32 | 2024-08-16T09:06:37 | cpp-docs | MicrosoftDocs/cpp-docs | 1,425 | 2,891 |
```xml
import { concat } from '../src/concat';
describe(concat.name, () => {
it('should concat a and b', () => {
expect(concat('foo', 'bar')).toBe('foobar');
})
});
``` | /content/code_sandbox/e2e/test/jasmine-ts-node/spec/concat.spec.ts | xml | 2016-02-12T13:14:28 | 2024-08-15T18:38:25 | stryker-js | stryker-mutator/stryker-js | 2,561 | 46 |
```xml
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget parent="main_window" name="Main Window">
<Tab containers="1" tab_name="Lateral Plan Conformance">
<Container>
<DockSplitter count="4" sizes="0.25;0.25;0.25;0.25" orientation="-">
<DockArea name="desired vs actual lateral acceleration (closer means better conformance to plan)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="3.586831" right="269.643117" left="0.000140" bottom="-2.354077"/>
<limitY/>
<curve color="#1f77b4" name="/controlsState/lateralControlState/torqueState/actualLateralAccel"/>
<curve color="#d62728" name="/controlsState/lateralControlState/torqueState/desiredLateralAccel"/>
</plot>
</DockArea>
<DockArea name="desired vs actual lateral acceleration, road-roll factored out (closer means better conformance to plan)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="3.445087" right="269.643117" left="0.000140" bottom="-2.654874"/>
<limitY/>
<curve color="#1ac938" name="Actual lateral accel (roll compensated)"/>
<curve color="#ff7f0e" name="Desired lateral accel (roll compensated)"/>
</plot>
</DockArea>
<DockArea name="controller feed-forward vs actuator output (closer means controller prediction is more accurate)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="1.082031" right="269.643117" left="0.000140" bottom="-1.050781"/>
<limitY/>
<curve color="#9467bd" name="/carOutput/actuatorsOutput/steer">
<transform alias="/carOutput/actuatorsOutput/steer[Scale/Offset]" name="Scale/Offset">
<options value_scale="-1" time_offset="0" value_offset="0"/>
</transform>
</curve>
<curve color="#1f77b4" name="/controlsState/lateralControlState/torqueState/f"/>
<curve color="#ff000f" name="/carState/steeringPressed"/>
</plot>
</DockArea>
<DockArea name="vehicle speed">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="101.506277" right="269.643117" left="0.000140" bottom="-2.475763"/>
<limitY/>
<curve color="#d62728" name="carState.vEgo mph"/>
<curve color="#1ac938" name="carState.vEgo kmh"/>
<curve color="#ff7f0e" name="/carState/vEgo"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab containers="1" tab_name="Actuator Performance">
<Container>
<DockSplitter count="3" sizes="0.33361;0.33278;0.33361" orientation="-">
<DockArea name="offline-calculated vs online-learned lateral accel scaling factor, accel obtained from 100% actuator output">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="4.186453" right="269.490213" left="0.000000" bottom="3.175940"/>
<limitY/>
<curve color="#1f77b4" name="/liveTorqueParameters/latAccelFactorFiltered"/>
<curve color="#d62728" name="/liveTorqueParameters/latAccelFactorRaw"/>
<curve color="#1c9222" name="/carParams/lateralTuning/torque/latAccelFactor"/>
</plot>
</DockArea>
<DockArea name="learned lateral accel offset, vehicle-specific compensation to obtain true zero lateral accel">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="0.003035" right="269.490213" left="0.000000" bottom="-0.124417"/>
<limitY/>
<curve color="#1ac938" name="/liveTorqueParameters/latAccelOffsetFiltered"/>
<curve color="#ff7f0e" name="/liveTorqueParameters/latAccelOffsetRaw"/>
</plot>
</DockArea>
<DockArea name="offline-calculated vs online-learned EPS friction factor, necessary to start moving the steering wheel">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="0.121143" right="269.490213" left="0.000000" bottom="-0.002955"/>
<limitY/>
<curve color="#f14cc1" name="/liveTorqueParameters/frictionCoefficientFiltered"/>
<curve color="#9467bd" name="/liveTorqueParameters/frictionCoefficientRaw"/>
<curve color="#1c9222" name="/carParams/lateralTuning/torque/friction"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab containers="1" tab_name="Vehicle Dynamics">
<Container>
<DockSplitter count="3" sizes="0.33361;0.33278;0.33361" orientation="-">
<DockArea name="configured-initial vs online-learned steerRatio, set configured value to match learned">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="12.903705" right="269.638801" left="0.000000" bottom="12.748092"/>
<limitY/>
<curve color="#1f77b4" name="/carParams/steerRatio"/>
<curve color="#1ac938" name="/liveParameters/steerRatio"/>
</plot>
</DockArea>
<DockArea name="configured-initial vs online-learned tireStiffnessRatio, set configured value to match learned">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="1.000520" right="269.638801" left="0.000000" bottom="0.999718"/>
<limitY/>
<curve color="#d62728" name="/carParams/tireStiffnessFactor"/>
<curve color="#ff7f0e" name="/liveParameters/stiffnessFactor"/>
</plot>
</DockArea>
<DockArea name="live steering angle offsets for straight-ahead driving, large values here may indicate alignment problems">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="-0.332067" right="269.638801" left="0.000000" bottom="-3.149970"/>
<limitY/>
<curve color="#f14cc1" name="/liveParameters/angleOffsetAverageDeg"/>
<curve color="#9467bd" name="/liveParameters/angleOffsetDeg"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab containers="1" tab_name="Controller PIF Terms">
<Container>
<DockSplitter count="3" sizes="0.33361;0.33278;0.33361" orientation="-">
<DockArea name="controller feed-forward vs actuator output (closer means controller prediction is more accurate)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="1.082031" right="269.643117" left="0.000140" bottom="-1.050781"/>
<limitY/>
<curve color="#9467bd" name="/carOutput/actuatorsOutput/steer">
<transform alias="/carOutput/actuatorsOutput/steer[Scale/Offset]" name="Scale/Offset">
<options value_scale="-1.0" time_offset="0" value_offset="0"/>
</transform>
</curve>
<curve color="#1f77b4" name="/controlsState/lateralControlState/torqueState/f"/>
<curve color="#ff000f" name="/carState/steeringPressed"/>
</plot>
</DockArea>
<DockArea name="proportional, integral, and feed-forward terms (actuator output = sum of PIF terms)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="1.572946" right="269.643117" left="0.000140" bottom="-3.822608"/>
<limitY/>
<curve color="#0ab027" name="/controlsState/lateralControlState/torqueState/f"/>
<curve color="#d62728" name="/controlsState/lateralControlState/torqueState/p"/>
<curve color="#ffaf00" name="/controlsState/lateralControlState/torqueState/i"/>
<curve color="#756a6a" name="Zero"/>
</plot>
</DockArea>
<DockArea name="road roll angle, from openpilot localizer">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="0.059127" right="269.643117" left="0.000140" bottom="-0.031841"/>
<limitY/>
<curve color="#f14cc1" name="/liveParameters/roll"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab containers="1" tab_name="Actuator Delay Estimation">
<Container>
<DockSplitter count="4" sizes="0.25;0.25;0.25;0.25" orientation="-">
<DockArea name="desired vs actual lateral acceleration (baseline)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="3.586831" right="269.943117" left="0.134774" bottom="-2.354077"/>
<limitY/>
<curve color="#d62728" name="/controlsState/lateralControlState/torqueState/desiredLateralAccel"/>
<curve color="#1f77b4" name="/controlsState/lateralControlState/torqueState/actualLateralAccel"/>
</plot>
</DockArea>
<DockArea name="desired vs actual lateral acceleration (desired shifted by +0.1s)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="3.586831" right="269.943117" left="0.134774" bottom="-2.354077"/>
<limitY/>
<curve color="#1ac938" name="/controlsState/lateralControlState/torqueState/desiredLateralAccel">
<transform alias="/controlsState/lateralControlState/torqueState/desiredLateralAccel[Scale/Offset]" name="Scale/Offset">
<options value_scale="1.0" time_offset="0.1" value_offset="0"/>
</transform>
</curve>
<curve color="#ff7f0e" name="/controlsState/lateralControlState/torqueState/actualLateralAccel"/>
</plot>
</DockArea>
<DockArea name="desired vs actual lateral acceleration (desired shifted by +0.2s)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="3.586831" right="269.943117" left="0.134774" bottom="-2.354077"/>
<limitY/>
<curve color="#1ac938" name="/controlsState/lateralControlState/torqueState/desiredLateralAccel">
<transform alias="/controlsState/lateralControlState/torqueState/desiredLateralAccel[Scale/Offset]" name="Scale/Offset">
<options value_scale="1.0" time_offset="0.2" value_offset="0"/>
</transform>
</curve>
<curve color="#ff7f0e" name="/controlsState/lateralControlState/torqueState/actualLateralAccel"/>
</plot>
</DockArea>
<DockArea name="desired vs actual lateral acceleration (desired shifted by +0.3s)">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range top="3.586831" right="269.943117" left="0.134774" bottom="-2.354077"/>
<limitY/>
<curve color="#1ac938" name="/controlsState/lateralControlState/torqueState/desiredLateralAccel">
<transform alias="/controlsState/lateralControlState/torqueState/desiredLateralAccel[Scale/Offset]" name="Scale/Offset">
<options value_scale="1.0" time_offset="0.3" value_offset="0"/>
</transform>
</curve>
<curve color="#ff7f0e" name="/controlsState/lateralControlState/torqueState/actualLateralAccel"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<customMathEquations>
<snippet name="Zero">
<global></global>
<function>return (0)</function>
<linked_source>/carState/canValid</linked_source>
</snippet>
<snippet name="Actual lateral accel (roll compensated)">
<global></global>
<function>return (value * v1 ^ 2) - (v2 * 9.81)</function>
<linked_source>/controlsState/curvature</linked_source>
<additional_sources>
<v1>/carState/vEgo</v1>
<v2>/liveParameters/roll</v2>
</additional_sources>
</snippet>
<snippet name="Desired lateral accel (roll compensated)">
<global></global>
<function>return (value * v1 ^ 2) - (v2 * 9.81)</function>
<linked_source>/controlsState/desiredCurvature</linked_source>
<additional_sources>
<v1>/carState/vEgo</v1>
<v2>/liveParameters/roll</v2>
</additional_sources>
</snippet>
<snippet name="carState.vEgo mph">
<global></global>
<function>return value * 2.23694</function>
<linked_source>/carState/vEgo</linked_source>
</snippet>
<snippet name="carState.vEgo kmh">
<global></global>
<function>return value * 3.6</function>
<linked_source>/carState/vEgo</linked_source>
</snippet>
</customMathEquations>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>
``` | /content/code_sandbox/tools/plotjuggler/layouts/torque-controller.xml | xml | 2016-11-24T01:33:30 | 2024-08-16T19:18:04 | openpilot | commaai/openpilot | 49,010 | 3,543 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<countries>
<country id="4" alpha2="af" alpha3="afg" name="Afganistan"/>
<country id="248" alpha2="ax" alpha3="ala" name="Alandy"/>
<country id="8" alpha2="al" alpha3="alb" name="Albnsko"/>
<country id="12" alpha2="dz" alpha3="dza" name="Alrsko"/>
<country id="16" alpha2="as" alpha3="asm" name="Americk Samoa"/>
<country id="850" alpha2="vi" alpha3="vir" name="Americk Panensk ostrovy"/>
<country id="20" alpha2="ad" alpha3="and" name="Andorra"/>
<country id="24" alpha2="ao" alpha3="ago" name="Angola"/>
<country id="660" alpha2="ai" alpha3="aia" name="Anguilla"/>
<country id="10" alpha2="aq" alpha3="ata" name="Antarktda"/>
<country id="28" alpha2="ag" alpha3="atg" name="Antigua a Barbuda"/>
<country id="32" alpha2="ar" alpha3="arg" name="Argentna"/>
<country id="51" alpha2="am" alpha3="arm" name="Armnsko"/>
<country id="533" alpha2="aw" alpha3="abw" name="Aruba"/>
<country id="36" alpha2="au" alpha3="aus" name="Austrlia"/>
<country id="31" alpha2="az" alpha3="aze" name="Azerbajdan"/>
<country id="44" alpha2="bs" alpha3="bhs" name="Bahamy"/>
<country id="48" alpha2="bh" alpha3="bhr" name="Bahrajn"/>
<country id="50" alpha2="bd" alpha3="bgd" name="Banglad"/>
<country id="52" alpha2="bb" alpha3="brb" name="Barbados"/>
<country id="56" alpha2="be" alpha3="bel" name="Belgicko"/>
<country id="84" alpha2="bz" alpha3="blz" name="Belize"/>
<country id="204" alpha2="bj" alpha3="ben" name="Benin"/>
<country id="60" alpha2="bm" alpha3="bmu" name="Bermudy"/>
<country id="64" alpha2="bt" alpha3="btn" name="Bhutn"/>
<country id="112" alpha2="by" alpha3="blr" name="Bielorusko"/>
<country id="68" alpha2="bo" alpha3="bol" name="Bolvia"/>
<country id="535" alpha2="bq" alpha3="bes" name="Bonaire, Svt Eustach a Saba"/>
<country id="70" alpha2="ba" alpha3="bih" name="Bosna a Hercegovina"/>
<country id="72" alpha2="bw" alpha3="bwa" name="Botswana"/>
<country id="74" alpha2="bv" alpha3="bvt" name="Bouvetov ostrov"/>
<country id="76" alpha2="br" alpha3="bra" name="Brazlia"/>
<country id="86" alpha2="io" alpha3="iot" name="Britsk indickoocenske zemie"/>
<country id="92" alpha2="vg" alpha3="vgb" name="Britsk Panensk ostrovy"/>
<country id="96" alpha2="bn" alpha3="brn" name="Brunej"/>
<country id="100" alpha2="bg" alpha3="bgr" name="Bulharsko"/>
<country id="854" alpha2="bf" alpha3="bfa" name="Burkina"/>
<country id="108" alpha2="bi" alpha3="bdi" name="Burundi"/>
<country id="184" alpha2="ck" alpha3="cok" name="Cookove ostrovy"/>
<country id="531" alpha2="cw" alpha3="cuw" name="Curaao"/>
<country id="196" alpha2="cy" alpha3="cyp" name="Cyprus"/>
<country id="148" alpha2="td" alpha3="tcd" name="ad"/>
<country id="203" alpha2="cz" alpha3="cze" name="esko"/>
<country id="499" alpha2="me" alpha3="mne" name="ierna Hora"/>
<country id="152" alpha2="cl" alpha3="chl" name="ile"/>
<country id="156" alpha2="cn" alpha3="chn" name="na"/>
<country id="208" alpha2="dk" alpha3="dnk" name="Dnsko"/>
<country id="212" alpha2="dm" alpha3="dma" name="Dominika"/>
<country id="214" alpha2="do" alpha3="dom" name="Dominiknska republika"/>
<country id="262" alpha2="dj" alpha3="dji" name="Dibutsko"/>
<country id="818" alpha2="eg" alpha3="egy" name="Egypt"/>
<country id="218" alpha2="ec" alpha3="ecu" name="Ekvdor"/>
<country id="232" alpha2="er" alpha3="eri" name="Eritrea"/>
<country id="233" alpha2="ee" alpha3="est" name="Estnsko"/>
<country id="231" alpha2="et" alpha3="eth" name="Etipia"/>
<country id="234" alpha2="fo" alpha3="fro" name="Faersk ostrovy"/>
<country id="238" alpha2="fk" alpha3="flk" name="Falklandy"/>
<country id="242" alpha2="fj" alpha3="fji" name="Fidi"/>
<country id="608" alpha2="ph" alpha3="phl" name="Filipny"/>
<country id="246" alpha2="fi" alpha3="fin" name="Fnsko"/>
<country id="250" alpha2="fr" alpha3="fra" name="Franczsko"/>
<country id="254" alpha2="gf" alpha3="guf" name="Franczska Guyana"/>
<country id="258" alpha2="pf" alpha3="pyf" name="Franczska Polynzia"/>
<country id="260" alpha2="tf" alpha3="atf" name="Franczske jun zemia"/>
<country id="266" alpha2="ga" alpha3="gab" name="Gabon"/>
<country id="270" alpha2="gm" alpha3="gmb" name="Gambia"/>
<country id="288" alpha2="gh" alpha3="gha" name="Ghana"/>
<country id="292" alpha2="gi" alpha3="gib" name="Gibraltr"/>
<country id="300" alpha2="gr" alpha3="grc" name="Grcko"/>
<country id="308" alpha2="gd" alpha3="grd" name="Grenada"/>
<country id="304" alpha2="gl" alpha3="grl" name="Grnsko"/>
<country id="268" alpha2="ge" alpha3="geo" name="Gruznsko"/>
<country id="312" alpha2="gp" alpha3="glp" name="Guadeloupe"/>
<country id="316" alpha2="gu" alpha3="gum" name="Guam"/>
<country id="320" alpha2="gt" alpha3="gtm" name="Guatemala"/>
<country id="831" alpha2="gg" alpha3="ggy" name="Guernsey"/>
<country id="324" alpha2="gn" alpha3="gin" name="Guinea"/>
<country id="624" alpha2="gw" alpha3="gnb" name="Guinea-Bissau"/>
<country id="328" alpha2="gy" alpha3="guy" name="Guyana"/>
<country id="332" alpha2="ht" alpha3="hti" name="Haiti"/>
<country id="334" alpha2="hm" alpha3="hmd" name="Heardov ostrov"/>
<country id="528" alpha2="nl" alpha3="nld" name="Holandsko"/>
<country id="340" alpha2="hn" alpha3="hnd" name="Honduras"/>
<country id="344" alpha2="hk" alpha3="hkg" name="Hongkong"/>
<country id="191" alpha2="hr" alpha3="hrv" name="Chorvtsko"/>
<country id="356" alpha2="in" alpha3="ind" name="India"/>
<country id="360" alpha2="id" alpha3="idn" name="Indonzia"/>
<country id="364" alpha2="ir" alpha3="irn" name="Irn"/>
<country id="368" alpha2="iq" alpha3="irq" name="Irak"/>
<country id="372" alpha2="ie" alpha3="irl" name="rsko"/>
<country id="352" alpha2="is" alpha3="isl" name="Island"/>
<country id="376" alpha2="il" alpha3="isr" name="Izrael"/>
<country id="388" alpha2="jm" alpha3="jam" name="Jamajka"/>
<country id="392" alpha2="jp" alpha3="jpn" name="Japonsko"/>
<country id="887" alpha2="ye" alpha3="yem" name="Jemen"/>
<country id="832" alpha2="je" alpha3="jey" name="Jersey"/>
<country id="400" alpha2="jo" alpha3="jor" name="Jordnsko"/>
<country id="710" alpha2="za" alpha3="zaf" name="Jun Afrika"/>
<country id="239" alpha2="gs" alpha3="sgs" name="Jun Georgia a Jun Sandwichove ostrovy"/>
<country id="728" alpha2="ss" alpha3="ssd" name="Jun Sudn"/>
<country id="136" alpha2="ky" alpha3="cym" name="Kajmanie ostrovy"/>
<country id="116" alpha2="kh" alpha3="khm" name="Kamboda"/>
<country id="120" alpha2="cm" alpha3="cmr" name="Kamerun"/>
<country id="124" alpha2="ca" alpha3="can" name="Kanada"/>
<country id="132" alpha2="cv" alpha3="cpv" name="Kapverdy"/>
<country id="634" alpha2="qa" alpha3="qat" name="Katar"/>
<country id="398" alpha2="kz" alpha3="kaz" name="Kazachstan"/>
<country id="404" alpha2="ke" alpha3="ken" name="Kea"/>
<country id="417" alpha2="kg" alpha3="kgz" name="Kirgizsko"/>
<country id="296" alpha2="ki" alpha3="kir" name="Kiribati"/>
<country id="166" alpha2="cc" alpha3="cck" name="Kokosov ostrovy"/>
<country id="170" alpha2="co" alpha3="col" name="Kolumbia"/>
<country id="174" alpha2="km" alpha3="com" name="Komory"/>
<country id="178" alpha2="cg" alpha3="cog" name="Kongo"/>
<country id="180" alpha2="cd" alpha3="cod" name="Konsk demokratick republika"/>
<country id="408" alpha2="kp" alpha3="prk" name="Krejsk udovodemokratick republika"/>
<country id="410" alpha2="kr" alpha3="kor" name="Krejsk republika"/>
<country id="188" alpha2="cr" alpha3="cri" name="Kostarika"/>
<country id="192" alpha2="cu" alpha3="cub" name="Kuba"/>
<country id="414" alpha2="kw" alpha3="kwt" name="Kuvajt"/>
<country id="418" alpha2="la" alpha3="lao" name="Laos"/>
<country id="426" alpha2="ls" alpha3="lso" name="Lesotho"/>
<country id="422" alpha2="lb" alpha3="lbn" name="Libanon"/>
<country id="430" alpha2="lr" alpha3="lbr" name="Libria"/>
<country id="434" alpha2="ly" alpha3="lby" name="Lbya"/>
<country id="438" alpha2="li" alpha3="lie" name="Lichtentajnsko"/>
<country id="440" alpha2="lt" alpha3="ltu" name="Litva"/>
<country id="428" alpha2="lv" alpha3="lva" name="Lotysko"/>
<country id="442" alpha2="lu" alpha3="lux" name="Luxembursko"/>
<country id="446" alpha2="mo" alpha3="mac" name="Macao"/>
<country id="807" alpha2="mk" alpha3="mkd" name="Severn Macednsko"/>
<country id="450" alpha2="mg" alpha3="mdg" name="Madagaskar"/>
<country id="348" alpha2="hu" alpha3="hun" name="Maarsko"/>
<country id="458" alpha2="my" alpha3="mys" name="Malajzia"/>
<country id="454" alpha2="mw" alpha3="mwi" name="Malawi"/>
<country id="462" alpha2="mv" alpha3="mdv" name="Maldivy"/>
<country id="466" alpha2="ml" alpha3="mli" name="Mali"/>
<country id="470" alpha2="mt" alpha3="mlt" name="Malta"/>
<country id="504" alpha2="ma" alpha3="mar" name="Maroko"/>
<country id="584" alpha2="mh" alpha3="mhl" name="Marshallove ostrovy"/>
<country id="474" alpha2="mq" alpha3="mtq" name="Martinik"/>
<country id="480" alpha2="mu" alpha3="mus" name="Maurcius"/>
<country id="478" alpha2="mr" alpha3="mrt" name="Mauritnia"/>
<country id="175" alpha2="yt" alpha3="myt" name="Mayotte"/>
<country id="581" alpha2="um" alpha3="umi" name="Menie odahl ostrovy USA"/>
<country id="484" alpha2="mx" alpha3="mex" name="Mexiko"/>
<country id="583" alpha2="fm" alpha3="fsm" name="Mikronzia"/>
<country id="104" alpha2="mm" alpha3="mmr" name="Mjanmarsko"/>
<country id="498" alpha2="md" alpha3="mda" name="Moldavsko"/>
<country id="492" alpha2="mc" alpha3="mco" name="Monako"/>
<country id="496" alpha2="mn" alpha3="mng" name="Mongolsko"/>
<country id="500" alpha2="ms" alpha3="msr" name="Montserrat"/>
<country id="508" alpha2="mz" alpha3="moz" name="Mozambik"/>
<country id="516" alpha2="na" alpha3="nam" name="Nambia"/>
<country id="520" alpha2="nr" alpha3="nru" name="Nauru"/>
<country id="276" alpha2="de" alpha3="deu" name="Nemecko"/>
<country id="524" alpha2="np" alpha3="npl" name="Nepl"/>
<country id="562" alpha2="ne" alpha3="ner" name="Niger"/>
<country id="566" alpha2="ng" alpha3="nga" name="Nigria"/>
<country id="558" alpha2="ni" alpha3="nic" name="Nikaragua"/>
<country id="570" alpha2="nu" alpha3="niu" name="Niue"/>
<country id="574" alpha2="nf" alpha3="nfk" name="Norfolk"/>
<country id="578" alpha2="no" alpha3="nor" name="Nrsko"/>
<country id="540" alpha2="nc" alpha3="ncl" name="Nov Kalednia"/>
<country id="554" alpha2="nz" alpha3="nzl" name="Nov Zland"/>
<country id="512" alpha2="om" alpha3="omn" name="Omn"/>
<country id="833" alpha2="im" alpha3="imn" name="Ostrov Man"/>
<country id="586" alpha2="pk" alpha3="pak" name="Pakistan"/>
<country id="585" alpha2="pw" alpha3="plw" name="Palau"/>
<country id="275" alpha2="ps" alpha3="pse" name="Palestna"/>
<country id="591" alpha2="pa" alpha3="pan" name="Panama"/>
<country id="598" alpha2="pg" alpha3="png" name="Papua-Nov Guinea"/>
<country id="600" alpha2="py" alpha3="pry" name="Paraguaj"/>
<country id="604" alpha2="pe" alpha3="per" name="Peru"/>
<country id="612" alpha2="pn" alpha3="pcn" name="Pitcairnove ostrovy"/>
<country id="384" alpha2="ci" alpha3="civ" name="Pobreie Slonoviny"/>
<country id="616" alpha2="pl" alpha3="pol" name="Posko"/>
<country id="630" alpha2="pr" alpha3="pri" name="Portoriko"/>
<country id="620" alpha2="pt" alpha3="prt" name="Portugalsko"/>
<country id="40" alpha2="at" alpha3="aut" name="Raksko"/>
<country id="638" alpha2="re" alpha3="reu" name="Runion"/>
<country id="226" alpha2="gq" alpha3="gnq" name="Rovnkov Guinea"/>
<country id="642" alpha2="ro" alpha3="rou" name="Rumunsko"/>
<country id="643" alpha2="ru" alpha3="rus" name="Rusko"/>
<country id="646" alpha2="rw" alpha3="rwa" name="Rwanda"/>
<country id="663" alpha2="mf" alpha3="maf" name="Saint-Martin"/>
<country id="666" alpha2="pm" alpha3="spm" name="Saint Pierre a Miquelon"/>
<country id="222" alpha2="sv" alpha3="slv" name="Salvdor"/>
<country id="882" alpha2="ws" alpha3="wsm" name="Samoa"/>
<country id="674" alpha2="sm" alpha3="smr" name="San Marno"/>
<country id="682" alpha2="sa" alpha3="sau" name="Saudsk Arbia"/>
<country id="686" alpha2="sn" alpha3="sen" name="Senegal"/>
<country id="580" alpha2="mp" alpha3="mnp" name="Severn Mariny"/>
<country id="690" alpha2="sc" alpha3="syc" name="Seychely"/>
<country id="694" alpha2="sl" alpha3="sle" name="Sierra Leone"/>
<country id="702" alpha2="sg" alpha3="sgp" name="Singapur"/>
<country id="534" alpha2="sx" alpha3="sxm" name="Sint Maarten"/>
<country id="703" alpha2="sk" alpha3="svk" name="Slovensko"/>
<country id="705" alpha2="si" alpha3="svn" name="Slovinsko"/>
<country id="706" alpha2="so" alpha3="som" name="Somlsko"/>
<country id="784" alpha2="ae" alpha3="are" name="Spojen arabsk emirty"/>
<country id="826" alpha2="gb" alpha3="gbr" name="Spojen krovstvo"/>
<country id="840" alpha2="us" alpha3="usa" name="Spojen tty"/>
<country id="688" alpha2="rs" alpha3="srb" name="Srbsko"/>
<country id="144" alpha2="lk" alpha3="lka" name="Sr Lanka"/>
<country id="140" alpha2="cf" alpha3="caf" name="Stredoafrick republika"/>
<country id="729" alpha2="sd" alpha3="sdn" name="Sudn"/>
<country id="740" alpha2="sr" alpha3="sur" name="Surinam"/>
<country id="654" alpha2="sh" alpha3="shn" name="Svt Helena"/>
<country id="662" alpha2="lc" alpha3="lca" name="Svt Lucia"/>
<country id="652" alpha2="bl" alpha3="blm" name="Svt Bartolomej"/>
<country id="659" alpha2="kn" alpha3="kna" name="Svt Kritof a Nevis"/>
<country id="678" alpha2="st" alpha3="stp" name="Svt Tom a Princov ostrov"/>
<country id="670" alpha2="vc" alpha3="vct" name="Svt Vincent a Grenadny"/>
<country id="748" alpha2="sz" alpha3="swz" name="Svazijsko"/>
<country id="760" alpha2="sy" alpha3="syr" name="Sria"/>
<country id="90" alpha2="sb" alpha3="slb" name="alamnove ostrovy"/>
<country id="724" alpha2="es" alpha3="esp" name="panielsko"/>
<country id="744" alpha2="sj" alpha3="sjm" name="picbergy a Jan Mayen"/>
<country id="756" alpha2="ch" alpha3="che" name="vajiarsko"/>
<country id="752" alpha2="se" alpha3="swe" name="vdsko"/>
<country id="762" alpha2="tj" alpha3="tjk" name="Tadikistan"/>
<country id="158" alpha2="tw" alpha3="twn" name="Taiwan"/>
<country id="380" alpha2="it" alpha3="ita" name="Taliansko"/>
<country id="834" alpha2="tz" alpha3="tza" name="Tanznia"/>
<country id="764" alpha2="th" alpha3="tha" name="Thajsko"/>
<country id="768" alpha2="tg" alpha3="tgo" name="Togo"/>
<country id="772" alpha2="tk" alpha3="tkl" name="Tokelau"/>
<country id="776" alpha2="to" alpha3="ton" name="Tonga"/>
<country id="780" alpha2="tt" alpha3="tto" name="Trinidad a Tobago"/>
<country id="788" alpha2="tn" alpha3="tun" name="Tunisko"/>
<country id="792" alpha2="tr" alpha3="tur" name="Turecko"/>
<country id="795" alpha2="tm" alpha3="tkm" name="Turkmnsko"/>
<country id="796" alpha2="tc" alpha3="tca" name="Turks a Caicos"/>
<country id="798" alpha2="tv" alpha3="tuv" name="Tuvalu"/>
<country id="800" alpha2="ug" alpha3="uga" name="Uganda"/>
<country id="804" alpha2="ua" alpha3="ukr" name="Ukrajina"/>
<country id="858" alpha2="uy" alpha3="ury" name="Uruguaj"/>
<country id="860" alpha2="uz" alpha3="uzb" name="Uzbekistan"/>
<country id="548" alpha2="vu" alpha3="vut" name="Vanuatu"/>
<country id="336" alpha2="va" alpha3="vat" name="Vatikn"/>
<country id="862" alpha2="ve" alpha3="ven" name="Venezuela"/>
<country id="162" alpha2="cx" alpha3="cxr" name="Vianon ostrov"/>
<country id="704" alpha2="vn" alpha3="vnm" name="Vietnam"/>
<country id="626" alpha2="tl" alpha3="tls" name="Vchodn Timor"/>
<country id="876" alpha2="wf" alpha3="wlf" name="Wallis a Futuna"/>
<country id="894" alpha2="zm" alpha3="zmb" name="Zambia"/>
<country id="732" alpha2="eh" alpha3="esh" name="Zpadn Sahara"/>
<country id="716" alpha2="zw" alpha3="zwe" name="Zimbabwe"/>
</countries>
``` | /content/code_sandbox/data/countries/sk/world.xml | xml | 2016-01-27T21:41:04 | 2024-08-16T10:07:17 | world_countries | stefangabos/world_countries | 1,364 | 6,035 |
```xml
<deployment version="1.0" athenz-domain="foo" athenz-service="bar">
<test />
<staging />
<prod>
<region active="true">us-west-1</region>
</prod>
</deployment>
``` | /content/code_sandbox/application/src/test/app-packages/athenz-in-deployment-xml/deployment.xml | xml | 2016-06-03T20:54:20 | 2024-08-16T15:32:01 | vespa | vespa-engine/vespa | 5,524 | 57 |
```xml
<UserControl
x:Class="Certify.UI.Controls.ProgressMonitor"
xmlns="path_to_url"
xmlns:x="path_to_url"
xmlns:certifyui="clr-namespace:Certify.UI"
xmlns:d="path_to_url"
xmlns:fa="path_to_url"
xmlns:local="clr-namespace:Certify.UI.Controls"
xmlns:mc="path_to_url"
xmlns:res="clr-namespace:Certify.Locales;assembly=Certify.Locales"
xmlns:utils="clr-namespace:Certify.UI.Utils"
HorizontalAlignment="Stretch"
d:DataContext="{d:DesignInstance Type=certifyui:AppViewModelDesign,
IsDesignTimeCreatable=True}"
d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<DockPanel Width="Auto" HorizontalAlignment="Stretch">
<DockPanel.Resources>
<utils:OptionalBooleanToVisibilityConverter
x:Key="InverseBooleanToVisibilityConverter"
False="Visible"
True="Collapsed" />
<utils:OptionalBooleanToVisibilityConverter
x:Key="BooleanToVisibilityConverter"
False="Hidden"
True="Visible" />
<utils:InverseBooleanConverter x:Key="InvBoolConverter" />
<utils:StateToColorConverter x:Key="StateToColorConverter" />
</DockPanel.Resources>
<Label
Margin="25,20,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Content="{x:Static res:SR.ProgressMonitor_NoProgress}"
DockPanel.Dock="Top"
Visibility="{Binding HasRequestsInProgress, Converter={StaticResource InverseBooleanToVisibilityConverter}}" />
<ListView
Margin="0,0,0,0"
HorizontalContentAlignment="Stretch"
BorderBrush="{DynamicResource IdealForegroundDisabledBrush}"
ItemsSource="{Binding ProgressResults}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode="Single">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Background" Value="{DynamicResource MahApps.Brushes.Control.Background}" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel
Width="Auto"
Margin="0,8,0,0"
HorizontalAlignment="Stretch"
MouseUp="ManagedCertificate_ViewLog"
Orientation="Vertical">
<DockPanel
HorizontalAlignment="Stretch"
DockPanel.Dock="Top"
LastChildFill="False">
<TextBlock
Margin="0,0,8,0"
DockPanel.Dock="Left"
FontWeight="Bold"
Foreground="{Binding CurrentState, Converter={StaticResource StateToColorConverter}}"
Text="{Binding ManagedCertificate.Name}" />
</DockPanel>
<DockPanel
Margin="0,4,0,0"
HorizontalAlignment="Stretch"
DockPanel.Dock="Top">
<TextBlock
Margin="8,0,8,0"
FontWeight="DemiBold"
Foreground="{Binding CurrentState, Converter={StaticResource StateToColorConverter}}"
Text="{Binding CurrentState}" />
<ProgressBar
Width="Auto"
MinWidth="100"
MaxWidth="300"
IsIndeterminate="True"
Visibility="{Binding IsRunning, Converter={StaticResource BooleanToVisibilityConverter}}" />
</DockPanel>
<StackPanel>
<StackPanel.Style>
<Style>
<Setter Property="StackPanel.Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding CurrentState}" Value="Paused">
<Setter Property="StackPanel.Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<TextBox
Background="Transparent"
BorderThickness="0"
FontWeight="SemiBold"
IsReadOnly="True"
IsTabStop="False"
Text="{Binding ManagedCertificate.FailureMessage, Mode=OneWay}"
TextWrapping="WrapWithOverflow" />
</StackPanel>
<TextBlock
Margin="8,8,8,8"
HorizontalAlignment="Stretch"
DockPanel.Dock="Top"
FontSize="10"
Foreground="{DynamicResource MahApps.Brushes.SystemControlForegroundChromeGray}"
Text="{Binding Message}"
TextWrapping="WrapWithOverflow" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DockPanel>
</UserControl>
``` | /content/code_sandbox/src/Certify.UI.Shared/Controls/ProgressMonitor.xaml | xml | 2016-03-27T07:05:15 | 2024-08-15T05:08:45 | certify | webprofusion/certify | 1,471 | 980 |
```xml
<?xml version="1.0"?>
<project xmlns="path_to_url"
xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url
path_to_url">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yahoo.vespa</groupId>
<artifactId>parent</artifactId>
<version>8-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>vespa-3party-jars</artifactId>
<version>8-SNAPSHOT</version>
<packaging>pom</packaging>
<description>
List 3rd party Java libraries that should be installed to lib/jars.
These libraries are not embedded in fat jars produced by bundle-plugin's 'assemble-fat-jar' goal.
</description>
<dependencies>
<dependency>
<groupId>com.yahoo.vespa</groupId>
<artifactId>vespa-3party-bundles</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.yahoo.vespa</groupId>
<artifactId>container-apache-http-client-bundle</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Explicit for IntelliJ to detect correct language level from parent -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
<configuration>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<excludeTransitive>false</excludeTransitive>
<excludeGroupIds>com.yahoo.vespa</excludeGroupIds>
</configuration>
</plugin>
</plugins>
</build>
</project>
``` | /content/code_sandbox/vespa-3party-jars/pom.xml | xml | 2016-06-03T20:54:20 | 2024-08-16T15:32:01 | vespa | vespa-engine/vespa | 5,524 | 610 |
```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
/**
* Beta prime distribution.
*/
declare class BetaPrime {
/**
* Beta prime distribution constructor.
*
* @param alpha - first shape parameter (default: 1.0)
* @param beta - second shape parameter (default: 1.0)
* @throws `alpha` must be a positive number
* @throws `beta` must be a positive number
* @returns distribution instance
*
* @example
* var betaprime = new BetaPrime( 1.0, 1.0 );
*
* var y = betaprime.cdf( 0.8 );
* // returns ~0.444
*
* var v = betaprime.mode;
* // returns 0.0
*/
constructor( alpha: number, beta: number );
/**
* Beta prime distribution constructor.
*
* @returns distribution instance
*
* @example
* var betaprime = new BetaPrime();
*
* var y = betaprime.cdf( 0.8 );
* // returns ~0.444
*
* var v = betaprime.mode;
* // returns 0.0
*/
constructor();
/**
* First shape parameter. If set, the value must be greater than `0`.
*/
alpha: number;
/**
* Second shape parameter. If set, the value must be greater than `0`.
*/
beta: number;
/**
* Read-only property which returns the excess kurtosis.
*/
readonly kurtosis: number;
/**
* Read-only property which returns the expected value.
*/
readonly mean: number;
/**
* Read-only property which returns the mode.
*/
readonly mode: number;
/**
* Read-only property which returns the skewness.
*/
readonly skewness: number;
/**
* Read-only property which returns the standard deviation.
*/
readonly stdev: number;
/**
* Read-only property which returns the variance.
*/
readonly variance: number;
/**
* Evaluates the cumulative distribution function (CDF).
*
* @param x - input value
* @returns evaluated CDF
*/
cdf( x: number ): number;
/**
* Evaluates the natural logarithm of the cumulative distribution function (CDF).
*
* @param x - input value
* @returns evaluated logCDF
*/
logcdf( x: number ): number;
/**
* Evaluates the natural logarithm of the probability density function (PDF).
*
* @param x - input value
* @returns evaluated logPDF
*/
logpdf( x: number ): number;
/**
* Evaluates the probability density function (PDF).
*
* @param x - input value
* @returns evaluated PDF
*/
pdf( x: number ): number;
/**
* Evaluates the quantile function at probability `p`.
*
* @param p - input probability
* @returns evaluated quantile function
*/
quantile( p: number ): number;
}
// EXPORTS //
export = BetaPrime;
``` | /content/code_sandbox/lib/node_modules/@stdlib/stats/base/dists/betaprime/ctor/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 746 |
```xml
abstract class AbstractFoo {
abstract method1(/* comment */ arg: string);
abstract method2(
/* comment */
arg: string
);
abstract method3(
// comment
arg: string
);
}
``` | /content/code_sandbox/tests/format/typescript/comments/abstract_methods.ts | xml | 2016-11-29T17:13:37 | 2024-08-16T17:29:57 | prettier | prettier/prettier | 48,913 | 50 |
```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.
-->
<LinearLayout xmlns:android="path_to_url"
xmlns:app="path_to_url"
android:id="@+id/cat_bottom_navs_animated_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/bottom_nav_animated_menu" />
</LinearLayout>
``` | /content/code_sandbox/catalog/java/io/material/catalog/bottomnav/res/layout/cat_bottom_navs_animated.xml | xml | 2016-12-05T16:11:29 | 2024-08-16T17:51:42 | material-components-android | material-components/material-components-android | 16,176 | 177 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: node_test\action_noop_ut_0.xml-->
<behavior name="node_test/action_noop_ut_0" agenttype="AgentNodeTest" version="5">
<node class="Sequence" id="0">
<node class="Noop" id="2" />
<node class="Noop" id="1" />
<node class="Assignment" id="4">
<property CastRight="false" />
<property Opl="int Self.AgentNodeTest::testVar_0" />
<property Opr="const int 2" />
</node>
<node class="Noop" id="3" />
</node>
</behavior>
``` | /content/code_sandbox/integration/unity/Assets/Resources/behaviac/exported/node_test/action_noop_ut_0.xml | xml | 2016-11-21T05:08:08 | 2024-08-16T07:18:30 | behaviac | Tencent/behaviac | 2,831 | 176 |
```xml
import { merge } from 'lodash';
import path from 'path';
import * as fs from 'fs-extra';
import type { WriteStream } from 'fs';
import * as cardanoLauncher from 'cardano-launcher';
import type { Launcher } from 'cardano-launcher';
import type { NodeConfig } from '../config';
import { environment } from '../environment';
import {
FALLBACK_TOKEN_METADATA_SERVER_URL,
MOCK_TOKEN_METADATA_SERVER_URL,
MOCK_TOKEN_METADATA_SERVER_PORT,
} from '../config';
import {
MAINNET,
STAGING,
TESTNET,
SELFNODE,
} from '../../common/types/environment.types';
import { CardanoNodeImplementationOptions } from '../../common/types/cardano-node.types';
import { createSelfnodeConfig } from './utils';
import { logger } from '../utils/logging';
import type { CardanoNodeImplementations } from '../../common/types/cardano-node.types';
export type WalletOptions = {
nodeImplementation: CardanoNodeImplementations;
nodeConfig: NodeConfig;
cluster: string;
stateDir: string;
tlsPath: string;
configPath: string;
syncTolerance: string;
nodeLogFile: WriteStream;
walletLogFile: WriteStream;
cliBin: string;
isStaging: boolean;
metadataUrl?: string;
rtsFlags: Array<string>;
};
export async function CardanoWalletLauncher(
walletOptions: WalletOptions
// @ts-ignore ts-migrate(1064) FIXME: The return type of an async function or method mus... Remove this comment to see the full error message
): Launcher {
const {
nodeImplementation,
nodeConfig,
// For cardano-node / byron only!
cluster,
stateDir,
tlsPath,
configPath,
syncTolerance,
nodeLogFile,
walletLogFile,
cliBin,
isStaging,
metadataUrl,
rtsFlags,
} = walletOptions;
// TODO: Update launcher config to pass number
const syncToleranceSeconds = parseInt(syncTolerance.replace('s', ''), 10);
// Shared launcher config (node implementations agnostic)
const launcherConfig = {
networkName: cluster,
stateDir,
nodeConfig: {
kind: nodeImplementation,
configurationDir: '',
network: {
configFile: configPath,
},
},
syncToleranceSeconds,
childProcessLogWriteStreams: {
node: nodeLogFile,
wallet: walletLogFile,
},
installSignalHandlers: false,
};
// TLS configuration used only for cardano-node
const tlsConfiguration = {
caCert: path.join(tlsPath, 'server/ca.crt'),
svCert: path.join(tlsPath, 'server/server.crt'),
svKey: path.join(tlsPath, 'server/server.key'),
};
let tokenMetadataServer;
// This switch statement handles any node specific
// configuration, prior to spawning the child process
logger.info('Node implementation', {
nodeImplementation,
});
switch (nodeImplementation) {
case CardanoNodeImplementationOptions.CARDANO:
if (cluster === SELFNODE) {
const { configFile, genesisFile } = nodeConfig.network;
const {
configPath: selfnodeConfigPath,
genesisPath: selfnodeGenesisPath,
genesisHash: selfnodeGenesisHash,
} = await createSelfnodeConfig(
configFile,
genesisFile,
stateDir,
cliBin
);
nodeConfig.network.configFile = selfnodeConfigPath;
nodeConfig.network.genesisFile = selfnodeGenesisPath;
nodeConfig.network.genesisHash = selfnodeGenesisHash;
merge(launcherConfig, {
apiPort: 8088,
});
}
if (cluster === MAINNET) {
launcherConfig.networkName = MAINNET;
// @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
logger.info('Launching Wallet with --mainnet flag');
} else if (isStaging) {
launcherConfig.networkName = STAGING;
// @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
logger.info('Launching Wallet with --staging flag');
} else {
// All clusters not flagged as staging except for Mainnet are treated as "Testnets"
launcherConfig.networkName = TESTNET;
// @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
logger.info('Launching Wallet with --testnet flag');
}
if (MOCK_TOKEN_METADATA_SERVER_PORT) {
tokenMetadataServer = `${MOCK_TOKEN_METADATA_SERVER_URL}:${MOCK_TOKEN_METADATA_SERVER_PORT}`;
} else if (metadataUrl) {
tokenMetadataServer = metadataUrl;
} else {
tokenMetadataServer = FALLBACK_TOKEN_METADATA_SERVER_URL;
}
logger.info('Launching Wallet with --token-metadata-server flag', {
tokenMetadataServer,
});
// RTS flags:
// 1) "-H4G -M6553M -c70" 16.0% peak RSS reduction and a sub-percentile CPU regression
// 2) "-H4G -M6553M" 18.5% peak RSS reduction and a second-best CPU regression
if (!!rtsFlags && rtsFlags?.length > 0) {
nodeConfig.rtsOpts = rtsFlags;
logger.info('Launching Cardano Node with RTS flags', {
rtsFlags,
});
} else {
// @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
logger.info('Launching Cardano Node without RTS flags');
}
merge(launcherConfig, {
nodeConfig,
tlsConfiguration,
tokenMetadataServer,
});
break;
default:
break;
}
logger.info('Setting up CardanoLauncher now...', {
walletOptions,
launcherConfig,
});
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '{ networkName: string; stateDir:... Remove this comment to see the full error message
return new cardanoLauncher.Launcher(launcherConfig, logger);
}
``` | /content/code_sandbox/source/main/cardano/CardanoWalletLauncher.ts | xml | 2016-10-05T13:48:54 | 2024-08-13T22:03:19 | daedalus | input-output-hk/daedalus | 1,230 | 1,328 |
```xml
import React, {useRef, useState} from 'react';
import {Button, Image, View} from 'react-native';
import {Circle, Svg} from 'react-native-svg';
export default () => {
const ref = useRef<Svg>(null);
const [s, setS] = useState('');
return (
<View style={{flex: 1, paddingTop: 100}}>
<Button
onPress={() => {
ref.current?.toDataURL(source => {
setS(source);
console.log(source);
});
}}
title="log data url"
/>
<Image
width={400}
height={300}
source={{uri: `data:image/png;base64,${s}`}}
/>
<Svg width={400} height={300} ref={ref}>
<Circle cx={200} cy={150} r={100} fill="red" />
</Svg>
</View>
);
};
``` | /content/code_sandbox/apps/test-examples/src/Test1986.tsx | xml | 2016-01-17T14:29:21 | 2024-08-16T13:35:44 | react-native-svg | software-mansion/react-native-svg | 7,397 | 202 |
```xml
<vector xmlns:android="path_to_url" android:height="34.0dp" android:tint="?attr/colorControlNormal" android:viewportHeight="15" android:viewportWidth="15" android:width="34.0dp">
<path android:fillColor="@android:color/white" android:pathData="M9.38 1.96C9.38 2.76 8.68 3.42 7.81 3.42C6.95 3.42 6.25 2.76 6.25 1.96C6.25 1.15 6.95 0.5 7.81 0.5C8.68 0.5 9.38 1.15 9.38 1.96zM6.25 4L6.88 4L7.19 4L12.5 7.79L12.5 8.67L11.88 8.67L8.75 6.41L8.75 8.67L10 11L11.25 13.92L10.63 14.5L10 14.5L8.75 11.58L6.25 8.08L6.25 5.37L4.69 6.63L3.44 8.67L2.5 8.67L2.5 8.08L3.44 6.33L6.25 4zM6.78 10.07L5.33 14.5L4.69 14.5L4.06 13.92L5.82 8.99z"/>
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/ic_preset_temaki_pedestrian.xml | xml | 2016-07-02T10:44:04 | 2024-08-16T18:55:54 | StreetComplete | streetcomplete/StreetComplete | 3,781 | 372 |
```xml
import { Hero, Monster, Treasure } from "./fixtures/fixture-models"
import { expect, test } from "bun:test"
const mst = require("../../dist/mobx-state-tree.umd")
const { unprotect } = mst
const SAMPLE_HERO = {
id: 1,
name: "jimmy",
level: 1,
role: "cleric",
description: "hi"
}
test("Hero computed fields", () => {
const hero = Hero.create(SAMPLE_HERO)
expect(hero.descriptionLength).toBe(2)
})
test("Tresure", () => {
const treasure = Treasure.create({ gold: 1, trapped: true })
expect(treasure.trapped).toBe(true)
expect(treasure.gold).toBe(1)
})
test("Monster computed fields", () => {
const monster = Monster.create({
id: "foo",
level: 1,
maxHp: 3,
hp: 1,
warning: "boo!",
createdAt: new Date(),
treasures: [
{ gold: 2, trapped: true },
{ gold: 3, trapped: true }
],
eatenHeroes: [SAMPLE_HERO],
hasFangs: true,
hasClaws: true,
hasWings: true,
hasGrowl: true,
freestyle: null
})
expect(monster.isAlive).toBe(true)
expect(monster.isFlashingRed).toBe(true)
unprotect(monster)
expect(monster.weight).toBe(2)
monster.level = 0
monster.hasFangs = false
monster.hasWings = false
monster.eatenHeroes = null
expect(monster.weight).toBe(1)
monster.hp = 0
expect(monster.isFlashingRed).toBe(false)
expect(monster.isAlive).toBe(false)
})
``` | /content/code_sandbox/__tests__/perf/fixture-models.skip.ts | xml | 2016-09-04T18:28:25 | 2024-08-16T08:48:55 | mobx-state-tree | mobxjs/mobx-state-tree | 6,917 | 407 |
```xml
import * as React from 'react';
import { classNamesFunction } from '../../Utilities';
import { TeachingBubbleContent } from './TeachingBubbleContent';
import { Callout } from '../../Callout';
import { DirectionalHint } from '../../common/DirectionalHint';
import { useMergedRefs } from '@fluentui/react-hooks';
import type {
ITeachingBubble,
ITeachingBubbleProps,
ITeachingBubbleStyleProps,
ITeachingBubbleStyles,
ITeachingBubbleSubComponentStyles,
} from './TeachingBubble.types';
import type { ICalloutProps } from '../../Callout';
const COMPONENT_NAME = 'TeachingBubble';
const defaultCalloutProps: ICalloutProps = {
beakWidth: 16,
gapSpace: 0,
setInitialFocus: true,
doNotLayer: false,
directionalHint: DirectionalHint.rightCenter,
};
const getClassNames = classNamesFunction<ITeachingBubbleStyleProps, ITeachingBubbleStyles>();
const useComponentRef = (
componentRef: React.Ref<ITeachingBubble> | undefined,
rootElementRef: React.RefObject<HTMLDivElement>,
) => {
React.useImperativeHandle(
componentRef,
() => ({
focus: () => rootElementRef.current?.focus(),
}),
[rootElementRef],
);
};
export const TeachingBubbleBase: React.FunctionComponent<ITeachingBubbleProps> = React.forwardRef<
HTMLDivElement,
ITeachingBubbleProps
>((props, forwardedRef) => {
const rootElementRef = React.useRef<HTMLDivElement>(null);
const mergedRootRef = useMergedRefs(rootElementRef, forwardedRef);
const {
calloutProps: setCalloutProps,
// eslint-disable-next-line deprecation/deprecation
targetElement,
onDismiss,
// eslint-disable-next-line deprecation/deprecation
hasCloseButton = props.hasCloseIcon,
isWide,
styles,
theme,
target,
} = props;
const calloutProps: ICalloutProps & Required<Pick<ICalloutProps, 'theme'>> = React.useMemo(
() => ({ ...defaultCalloutProps, ...setCalloutProps, theme: theme! }),
[setCalloutProps, theme],
);
const stylesProps: ITeachingBubbleStyleProps = {
theme: theme!,
isWide,
calloutProps,
hasCloseButton,
};
const classNames = getClassNames(styles, stylesProps);
const calloutStyles = classNames.subComponentStyles
? (classNames.subComponentStyles as ITeachingBubbleSubComponentStyles).callout
: undefined;
useComponentRef(props.componentRef, rootElementRef);
return (
<Callout
target={target || targetElement}
onDismiss={onDismiss}
{...calloutProps}
className={classNames.root}
styles={calloutStyles}
hideOverflow
>
<div ref={mergedRootRef}>
<TeachingBubbleContent {...props} />
</div>
</Callout>
);
});
TeachingBubbleBase.displayName = COMPONENT_NAME;
``` | /content/code_sandbox/packages/react/src/components/TeachingBubble/TeachingBubble.base.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 668 |
```xml
import type { IDBPDatabase } from 'idb';
import { deleteDB, openDB } from 'idb';
import noop from '@proton/utils/noop';
import { INDEXEDDB_VERSION, STORING_OUTCOME } from '../constants';
import { ciphertextSize, esSentryReport, isTimepointSmaller, removeESFlags } from '../esHelpers';
import type { AesGcmCiphertext, EncryptedItemWithInfo, EncryptedMetadataItem, EncryptedSearchDB } from '../models';
import { updateSize } from './configObjectStore';
import { getOldestID, getOldestInfo } from './metadata';
/**
* Format the name of the ES database for the given user ID
*/
const getDBName = (userID: string) => `ES:${userID}:DB`;
/**
* Delete the given user's IDB
*/
export const deleteESDB = async (userID: string) => deleteDB(getDBName(userID)).catch(noop);
/**
* Open an existing IDB for the given user. If the DB hadn't already existed,
* undefined is returned instead. WARNING: this function will delete an old
* version of IDB if it exists
*/
export const openESDB = async (userID: string) => {
let esDB: IDBPDatabase<EncryptedSearchDB> | undefined;
try {
let dbExisted = true;
esDB = await openDB<EncryptedSearchDB>(getDBName(userID), INDEXEDDB_VERSION, {
upgrade() {
dbExisted = false;
},
});
if (!dbExisted) {
throw new Error('Attempting to opening a non-existent DB');
}
} catch (error: any) {
esDB?.close();
// Flags are removed from local storage in case this code
// is called due to an update from an outdated version of IDB
removeESFlags(userID);
await deleteESDB(userID);
return;
}
return esDB;
};
/**
* Check whether the current version of IDB exists. WARNING: this function
* will delete an old version of IDB if it exists
*/
export const checkVersionedESDB = async (userID: string) => {
const esDB = await openESDB(userID);
const check = !!esDB;
esDB?.close();
return check;
};
/**
* Create an up-to-date IDB for the given user
*/
export const createESDB = async (userID: string) => {
// Remove the database first, in case there is an old stale version that
// might arise when removing it and creating a new one immediately after
await deleteESDB(userID);
return openDB<EncryptedSearchDB>(getDBName(userID), INDEXEDDB_VERSION, {
upgrade: (esDB) => {
// The object store containing the content of items, indexed by their ID.
// Out-of-line keys are used
esDB.createObjectStore('content');
// The object store containing all metadata of items, indexed by their ID
// In-line keys are used, defined by the ID property. A temporal index
// is created as well
const metadataOS = esDB.createObjectStore('metadata');
metadataOS.createIndex('temporal', 'timepoint', { unique: true, multiEntry: false });
// The config object store contains ES-wide values (e.g. the encrypted index key),
// configuration (e.g. whether ES is enabled) and information (e.g. an estimate
// of the size)
esDB.createObjectStore('config');
// The events object store contains the last event ID according to which the index has
// been updated for every component of the product
esDB.createObjectStore('events');
// The indexingProgress object store contains metadata information on indexing. It always
// will contain a 'metadata' row, for items metadata to either search those exclusively or
// to enable ES for free users, as well as a row for content in case a product decides to
// have any
esDB.createObjectStore('indexingProgress');
},
});
};
/**
* Delete the oldest item from ESDB, both from the metadata table and the content table
*/
const deleteOldestItem = async (ID: string, esDB: IDBPDatabase<EncryptedSearchDB>) => {
let removeSize = 0;
await Promise.all([
esDB.get('metadata', ID).then((item) => {
removeSize += ciphertextSize(item?.aesGcmCiphertext);
return esDB.delete('metadata', ID);
}),
esDB.get('content', ID).then((aesGcmCiphertext) => {
removeSize += ciphertextSize(aesGcmCiphertext);
return esDB.delete('content', ID);
}),
]);
return updateSize(esDB, -removeSize);
};
/**
* Return whether an item fetched from either the metadata table or the content table is of type AesGcmCiphertext
*/
const discriminateItem = (item: EncryptedMetadataItem | AesGcmCiphertext): item is AesGcmCiphertext =>
Object.hasOwn(item, 'iv');
/**
* Compute the size of an item from either the metadata or content table
*/
const getItemSize = async (ID: string, storeName: 'metadata' | 'content', esDB: IDBPDatabase<EncryptedSearchDB>) => {
const item = await esDB.get(storeName, ID);
if (!item) {
return 0;
}
if (discriminateItem(item)) {
return ciphertextSize(item);
}
return ciphertextSize(item.aesGcmCiphertext);
};
/**
* Write to the ES IDB and manage the case of running out of disk space.
* If we do run out of space we must remove the oldest item to make space
*/
export const safelyWriteToIDBConditionally = async (
value: EncryptedItemWithInfo,
storeName: 'metadata' | 'content',
esDB: IDBPDatabase<EncryptedSearchDB>,
inputStoringOutcome?: STORING_OUTCOME
): Promise<STORING_OUTCOME> => {
const valueToStore: EncryptedMetadataItem | AesGcmCiphertext =
storeName === 'metadata'
? { aesGcmCiphertext: value.aesGcmCiphertext, timepoint: value.timepoint }
: value.aesGcmCiphertext;
try {
await esDB.put(storeName, valueToStore, value.ID);
// We always update the size if we are storing to the content table.
// If we are storing to the metadata table, we do so only if the item
// was flagged to update the size
if (storeName === 'content' || !value.keepSize) {
const oldSize = await getItemSize(value.ID, storeName, esDB);
await updateSize(esDB, ciphertextSize(value.aesGcmCiphertext) - oldSize);
}
return inputStoringOutcome ?? STORING_OUTCOME.SUCCESS;
} catch (error: any) {
if (error.name === 'QuotaExceededError') {
// We check wheter the present item is newer than the oldest one,
// in which case we remove the latter to make space for the former
const oldestItemInfo = await getOldestInfo(esDB);
if (!oldestItemInfo) {
// If there is no such oldest item, it means IDB is empty,
// which is a rather peculiar state to throw a quota error
esSentryReport('safelyWriteToIDBConditionally: quota reached with empty IDB', { error });
return STORING_OUTCOME.FAILURE;
}
if (isTimepointSmaller(value.timepoint, oldestItemInfo.timepoint)) {
return STORING_OUTCOME.QUOTA;
}
await deleteOldestItem(oldestItemInfo.ID, esDB);
return safelyWriteToIDBConditionally(value, storeName, esDB, STORING_OUTCOME.QUOTA);
} else {
// Any other error should be interpreted as a failure
esSentryReport('safelyWriteToIDBConditionally: put failed', { error });
return STORING_OUTCOME.FAILURE;
}
}
};
/**
* Write to the ES IDB and always remove the oldest item to make space for this write
* in case we run out of it
*/
export const safelyWriteToIDBAbsolutely = async (
value: any,
key: string,
storeName: 'config' | 'events' | 'indexingProgress',
esDB: IDBPDatabase<EncryptedSearchDB>
): Promise<void> => {
try {
await esDB.put(storeName, value, key);
} catch (error: any) {
if (error.name === 'QuotaExceededError') {
// Since the data we're trying to store to IDB has absolute
// precedence over content, we simply remove the oldest item
// and retry
const oldestItemID = await getOldestID(esDB);
if (!oldestItemID) {
// If there is no such oldest item, it means IDB is empty,
// which is a rather peculiar state to throw a quota error
esSentryReport('safelyWriteToIDBAbsolutely: quota reached with empty IDB', { error });
throw error;
}
await deleteOldestItem(oldestItemID, esDB);
return safelyWriteToIDBAbsolutely(value, key, storeName, esDB);
} else {
// Any other error should be interpreted as a failure
esSentryReport('safelyWriteToIDBAbsolutely: put failed', { error });
throw error;
}
}
};
``` | /content/code_sandbox/packages/encrypted-search/lib/esIDB/indexedDB.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 2,105 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
xmlns="path_to_url"
xmlns:activiti="path_to_url"
xmlns:xsd="path_to_url"
typeLanguage="path_to_url"
expressionLanguage="path_to_url"
targetNamespace="org.activiti.engine.test.bpmn.servicetask"
xmlns:tns="org.activiti.engine.test.bpmn.servicetask"
xmlns:counter="path_to_url">
<!--
XML Schema is used as type language for the model whereas
XPath serves as language for Expressions.
-->
<import importType="path_to_url"
location="path_to_url"
namespace="path_to_url" />
<process id="webServiceInvocationWithDataFlowUEL">
<!--
The Data Inputs and Outputs of a Process have to be explicitly
declared with their type to be valid BPMN 2.0
-->
<ioSpecification>
<dataInput id="dataInputOfProcess" itemSubjectRef="tns:prettyPrintCountRequestItem" />
<dataOutput id="dataOutputOfProcess" itemSubjectRef="xsd:string" />
<inputSet>
<dataInputRefs>dataInputOfProcess</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>dataOutputOfProcess</dataOutputRefs>
</outputSet>
</ioSpecification>
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="webService" />
<serviceTask id="webService"
name="Web service invocation"
implementation="##WebService"
operationRef="tns:prettyPrintCountOperation">
<!-- The BPMN 2.0 Meta Model requires an Input/Output Specification -->
<ioSpecification>
<dataInput itemSubjectRef="tns:prettyPrintCountRequestItem" id="dataInputOfServiceTask" />
<dataOutput itemSubjectRef="tns:prettyPrintCountResponseItem" id="dataOutputOfServiceTask" />
<inputSet>
<dataInputRefs>dataInputOfServiceTask</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>dataOutputOfServiceTask</dataOutputRefs>
</outputSet>
</ioSpecification>
<!--
getDataObject, getDataInput, and getDataOutput are custom
XPath functions defined in the BPMN specification
-->
<dataInputAssociation>
<sourceRef>dataInputOfProcess</sourceRef>
<targetRef>dataInputOfServiceTask</targetRef>
<assignment>
<from>bpmn:getDataObject("dataInputOfProcess")/prefix</from>
<to>bpmn:getDataInput("dataInputOfServiceTask")/counter:prefix</to>
</assignment>
<assignment>
<from>bpmn:getDataObject("dataInputOfProcess")/suffix</from>
<to>bpmn:getDataInput("dataInputOfServiceTask")/counter:suffix</to>
</assignment>
</dataInputAssociation>
<dataOutputAssociation>
<targetRef>dataOutputOfProcess</targetRef>
<transformation>bpmn:getDataOutput("dataOutputOfServiceTask")/counter:prettyPrint</transformation>
</dataOutputAssociation>
</serviceTask>
<sequenceFlow id="flow2" sourceRef="webService" targetRef="waitState" />
<receiveTask id="waitState" />
<sequenceFlow id="flow3" sourceRef="waitState" targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
<!-- Interface: implementationRef = QName of WSDL Port Type -->
<interface name="Counter Interface" implementationRef="counter:Counter">
<!-- Operation: implementationRef = QName of WSDL Operation -->
<operation id="prettyPrintCountOperation" name="prettyPrintCount Operation" implementationRef="counter:prettyPrintCount">
<inMessageRef>tns:prettyPrintCountRequestMessage</inMessageRef>
<outMessageRef>tns:prettyPrintCountResponseMessage</outMessageRef>
</operation>
</interface>
<message id="prettyPrintCountRequestMessage" itemRef="tns:prettyPrintCountRequestItem" />
<message id="prettyPrintCountResponseMessage" itemRef="tns:prettyPrintCountResponseItem" />
<itemDefinition id="prettyPrintCountRequestItem" structureRef="counter:prettyPrintCount" /><!-- QName of input element -->
<itemDefinition id="prettyPrintCountResponseItem" structureRef="counter:prettyPrintCountResponse" /><!-- QName of output element -->
</definitions>
``` | /content/code_sandbox/modules/flowable5-cxf-test/src/test/resources/org/activiti/engine/test/bpmn/servicetask/WebServiceTaskTest.testWebServiceInvocationWithDataFlowXPath.bpmn20.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 1,060 |
```xml
import path from 'path';
import { createHash } from 'crypto';
import fse from 'fs-extra';
import { esbuild } from '@ice/bundles';
import type { Plugin, BuildOptions } from 'esbuild';
import { resolve as resolveExports, legacy as resolveLegacy } from 'resolve.exports';
import moduleLexer from '@ice/bundles/compiled/es-module-lexer/index.js';
import type { Config } from '@ice/shared-config/types';
import type { TaskConfig } from 'build-scripts';
import flattenId from '../utils/flattenId.js';
import formatPath from '../utils/formatPath.js';
import { BUILDIN_CJS_DEPS, BUILDIN_ESM_DEPS } from '../constant.js';
import type { DepScanData } from '../esbuild/scan.js';
import externalPlugin from '../esbuild/external.js';
import emptyCSSPlugin from '../esbuild/emptyCSS.js';
import cssModulesPlugin from '../esbuild/cssModules.js';
import { createLogger } from '../utils/logger.js';
import getCSSModuleIdent from '../utils/getCSSModuleIdent.js';
const logger = createLogger('pre-bundle-deps');
interface DepInfo {
file: string;
src: string;
}
export interface PreBundleDepsMetaData {
hash: string;
deps: Record<string, DepInfo>;
}
interface PreBundleDepsResult {
metadata?: PreBundleDepsMetaData;
}
interface PreBundleDepsOptions {
rootDir: string;
cacheDir: string;
taskConfig: Config;
alias: Record<string, string>;
ignores?: string[];
plugins?: Plugin[];
define?: esbuild.BuildOptions['define'];
external?: esbuild.BuildOptions['external'];
speedup?: boolean;
}
/**
* Only when the server bundle format type is esm,
* we will pre bundle dependencies which maybe have import css file directly.
*
* CSS files can not be resolve in ESM(server render will run in ESM), so we will external item.
*/
export default async function preBundleDeps(
depsInfo: Record<string, DepScanData>,
options: PreBundleDepsOptions,
): Promise<PreBundleDepsResult> {
const { cacheDir, taskConfig, plugins = [], alias, ignores, define, external = [], rootDir, speedup } = options;
const metadata = createDepsMetadata(depsInfo, taskConfig);
if (!Object.keys(depsInfo)) {
return {
metadata,
};
}
const depsCacheDir = getDepsCacheDir(cacheDir);
const metadataJSONPath = getDepsMetaDataJSONPath(cacheDir);
if (fse.pathExistsSync(metadataJSONPath)) {
const prevMetadata = await fse.readJSON(metadataJSONPath) as PreBundleDepsMetaData;
if (metadata.hash === prevMetadata.hash) {
// don't need to pre bundle the deps again if the deps info is not updated
return {
metadata: prevMetadata,
};
}
}
await fse.emptyDir(depsCacheDir);
const flatIdDeps: Record<string, string> = {};
await moduleLexer.init;
for (const depId in depsInfo) {
const packageEntry = resolvePackageESEntry(depId, depsInfo[depId].pkgPath, alias);
const flatId = flattenId(depId);
flatIdDeps[flatId] = packageEntry;
const file = path.join(depsCacheDir, `${flatId}.mjs`);
// add meta info to metadata.deps
metadata.deps[depId] = {
file,
src: flatIdDeps[flatId],
};
}
try {
await bundleDeps({
rootDir,
entryPoints: flatIdDeps,
outdir: depsCacheDir,
plugins,
ignores,
alias,
external,
define,
taskConfig,
speedup,
});
await fse.writeJSON(metadataJSONPath, metadata, { spaces: 2 });
return {
metadata,
};
} catch (error) {
logger.briefError('Failed to bundle dependencies.', flatIdDeps);
logger.debug(error);
return {};
}
}
export async function bundleDeps(options:
{
rootDir: string;
entryPoints: BuildOptions['entryPoints'];
outdir: BuildOptions['outdir'];
alias: BuildOptions['alias'];
ignores: string[];
plugins: Plugin[];
external: string[];
define: BuildOptions['define'];
taskConfig: Config;
speedup?: boolean;
}) {
const { entryPoints, outdir, alias, ignores, plugins, external, define, speedup, rootDir, taskConfig } = options;
return await esbuild.build({
absWorkingDir: process.cwd(),
entryPoints,
bundle: true,
logLevel: 'error',
outdir,
format: 'esm',
platform: 'node',
loader: { '.js': 'jsx' },
ignoreAnnotations: true,
alias,
define,
metafile: true,
outExtension: {
'.js': '.mjs',
},
banner: {
js: "import { createRequire } from 'module';const require = createRequire(import.meta.url);",
},
plugins: [
emptyCSSPlugin(),
externalPlugin({ ignores, format: 'esm', externalDependencies: false }),
cssModulesPlugin({
extract: false,
generateLocalIdentName: function (name: string, fileName: string) {
return getCSSModuleIdent({
rootDir,
// Prebundle only works in development mode.
mode: 'development',
fileName,
localName: name,
rule: speedup ? 'native' : 'loader',
localIdentName: taskConfig.cssModules?.localIdentName,
});
},
}),
...plugins,
],
external: [...BUILDIN_CJS_DEPS, ...BUILDIN_ESM_DEPS, ...external],
});
}
export function resolvePackageESEntry(depId: string, pkgPath: string, alias: TaskConfig<Config>['config']['alias']) {
const pkgJSON = fse.readJSONSync(pkgPath);
const pkgDir = path.dirname(pkgPath);
const aliasKey = Object.keys(alias).find(key => depId === key || depId.startsWith(`${depId}/`));
// alias: { rax: 'rax-compat' }
// rax -> .
// rax/element -> ./element
const entry = aliasKey ? depId.replace(new RegExp(`^${aliasKey}`), '.') : depId;
// resolve "exports.import" field or "module" field
const resolvedEntryPoint = (resolveExports(pkgJSON, entry) || resolveLegacy(pkgJSON) || 'index.js') as string;
const entryPointPath = path.join(pkgDir, resolvedEntryPoint);
return entryPointPath;
}
function createDepsMetadata(depsInfo: Record<string, DepScanData>, taskConfig: Config): PreBundleDepsMetaData {
const hash = getDepHash(depsInfo, taskConfig);
return {
hash,
deps: {},
};
}
function getDepHash(depsInfo: Record<string, DepScanData>, taskConfig: Config) {
let content = JSON.stringify(depsInfo) + JSON.stringify(taskConfig);
return getHash(content);
}
function getHash(text: Buffer | string): string {
return createHash('sha1').update(text).digest('hex').substring(0, 8);
}
export function getDepsCacheDir(cacheDir: string) {
return formatPath(path.resolve(cacheDir, 'deps'));
}
export function getDepsMetaDataJSONPath(cacheDir: string) {
return formatPath(path.resolve(getDepsCacheDir(cacheDir), '_metadata.json'));
}
``` | /content/code_sandbox/packages/ice/src/service/preBundleDeps.ts | xml | 2016-11-03T06:59:15 | 2024-08-16T10:11:29 | ice | alibaba/ice | 17,815 | 1,659 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="path_to_url"
xmlns:x="path_to_url"
x:Class="Xamarin.Forms.Xaml.UnitTests.I8"
l0="0"
l1="2147483647"
l2="4294967295"
l3="9223372036854775807"
l4="-2147483647"
l5="-4294967295"
l6="-9223372036854775807"
l7="256"
l8="-256"
l9="127"
ul0="0"
ul1="2147483647"
ul2="4294967295"
ul3="9223372036854775807"
ul4="18446744073709551615"
ul5="256">
</ContentPage>
``` | /content/code_sandbox/Xamarin.Forms.Xaml.UnitTests/I8.xaml | xml | 2016-03-18T15:52:03 | 2024-08-16T16:25:43 | Xamarin.Forms | xamarin/Xamarin.Forms | 5,637 | 198 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="path_to_url"
xmlns:app="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--DragLayoutViewlayout_gravity-->
<com.stone.transition.DragLayout
android:id="@+id/drag_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bototmExtraIndicatorHeight="@dimen/card_extra_height"
app:bottomDragVisibleHeight="@dimen/card_bottom_info_height">
<!--1. view-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="320dp"
android:layout_gravity="center_vertical"
android:alpha="0"
android:background="@drawable/white_back">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/card_bottom_info_height"
android:layout_gravity="bottom"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/address4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:ellipsize="end"
android:maxLines="1"
android:paddingRight="10dp"
android:text="La Crescenta-Montrose, CA91020 Glende And Way"
android:textColor="#333"
android:textSize="15sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/address5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="NO. 7911847"
android:textColor="#333"
android:textSize="15sp" />
<RatingBar
android:id="@+id/rating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:rating="4.5" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="10dp"
android:background="#f0f0f0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/head1"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/head1" />
<ImageView
android:id="@+id/head2"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="-10dp"
android:src="@drawable/head2" />
<ImageView
android:id="@+id/head3"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="-10dp"
android:src="@drawable/head3" />
<ImageView
android:id="@+id/head4"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="-10dp"
android:src="@drawable/head4" />
<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_weight="1" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/three_dot" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<!--2. View-->
<com.stone.transition.AspectRatioCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/card_extra_height"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
app:cardCornerRadius="5dp"
app:cardElevation="6dp"
app:cardMaxElevation="6dp">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:padding="5dp">
<TextView
android:id="@+id/address1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="NORTH LAT"
android:textColor="#12edf0"
android:textSize="15sp" />
<ImageView
android:id="@+id/address2"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="@drawable/gps" />
<TextView
android:id="@+id/address3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="EAST LNG 17"
android:textColor="#12edf0"
android:textSize="13sp" />
</RelativeLayout>
</com.stone.transition.AspectRatioCardView>
</com.stone.transition.DragLayout>
</FrameLayout>
``` | /content/code_sandbox/android-page-transition/app/src/main/res/layout/fragment_common.xml | xml | 2016-09-19T05:38:45 | 2024-08-05T10:12:07 | ViewpagerTransition | xmuSistone/ViewpagerTransition | 3,038 | 1,343 |
```xml
'use client'
import { nanoid } from 'nanoid'
export default function Page({ searchParams }) {
return (
<>
<h1>Parameter: {searchParams.search}</h1>
<p id="nanoid">{nanoid()}</p>
</>
)
}
``` | /content/code_sandbox/test/e2e/app-dir/searchparams-static-bailout/app/client-component-page/page.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 61 |
```xml
import React from 'react';
type IconProps = React.SVGProps<SVGSVGElement>;
export declare const IcBrandFirefox: (props: IconProps) => React.JSX.Element;
export {};
``` | /content/code_sandbox/packages/icons/lib/icBrandFirefox.d.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 43 |
```xml
import { Suspense, ReactNode } from 'react';
import { CssBaseline, Container } from '@mui/material';
import { Error, Loading, CheckForApplicationUpdate } from 'react-admin';
import { ErrorBoundary } from 'react-error-boundary';
import Header from './Header';
const Layout = ({ children }: { children: ReactNode }) => (
<>
<CssBaseline />
<Header />
<Container sx={{ maxWidth: { xl: 1280 } }}>
<main id="main-content">
<ErrorBoundary FallbackComponent={Error}>
<Suspense fallback={<Loading />}>{children}</Suspense>
</ErrorBoundary>
</main>
</Container>
<CheckForApplicationUpdate interval={30 * 1000} />
</>
);
export default Layout;
``` | /content/code_sandbox/examples/crm/src/layout/Layout.tsx | xml | 2016-07-13T07:58:54 | 2024-08-16T18:32:27 | react-admin | marmelab/react-admin | 24,624 | 166 |
```xml
/* eslint-env jest */
import JsonFile from '@expo/json-file';
import execa from 'execa';
import klawSync from 'klaw-sync';
import path from 'path';
import { runExportSideEffects } from './export-side-effects';
import { bin, getRouterE2ERoot } from '../utils';
runExportSideEffects();
describe('exports with url-polyfill', () => {
const projectRoot = getRouterE2ERoot();
const outputName = 'dist-url-polyfill';
const outputDir = path.join(projectRoot, outputName);
beforeAll(
async () => {
await execa('node', [bin, 'export', '-p', 'ios', '--output-dir', outputName], {
cwd: projectRoot,
env: {
NODE_ENV: 'production',
EXPO_USE_STATIC: 'static',
E2E_ROUTER_SRC: 'url-polyfill',
E2E_ROUTER_ASYNC: 'development',
EXPO_USE_FAST_RESOLVER: 'true',
},
});
},
// Could take 45s depending on how fast the bundler resolves
560 * 1000
);
it('has expected files', async () => {
// List output files with sizes for snapshotting.
// This is to make sure that any changes to the output are intentional.
// Posix path formatting is used to make paths the same across OSes.
const files = klawSync(outputDir)
.map((entry) => {
if (entry.path.includes('node_modules') || !entry.stats.isFile()) {
return null;
}
return path.posix.relative(outputDir, entry.path);
})
.filter(Boolean);
const metadata = await JsonFile.readAsync(path.resolve(outputDir, 'metadata.json'));
expect(metadata).toEqual({
bundler: 'metro',
fileMetadata: {
ios: {
assets: expect.anything(),
bundle: expect.stringMatching(/_expo\/static\/js\/ios\/index-.*\.js/),
},
},
version: 0,
});
// The wrapper should not be included as a route.
expect(files).not.toContain('+html.html');
expect(files).not.toContain('index.html');
const iosBundle = files.find((v) => v?.startsWith('_expo/static/js/ios/'));
expect(iosBundle).toBeDefined();
});
});
``` | /content/code_sandbox/packages/@expo/cli/e2e/__tests__/export/url-polyfill.test.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 516 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/resourceplugin">
<file>test1.txt</file>
</gresource>
</gresources>
``` | /content/code_sandbox/utilities/glib/gio/tests/test4.gresource.xml | xml | 2016-10-27T09:31:28 | 2024-08-16T19:00:35 | nexmon | seemoo-lab/nexmon | 2,381 | 46 |
```xml
import type { PropsWithChildren } from 'react';
import ReactMarkdown from 'react-markdown';
import { APISectionPlatformTags } from '~/components/plugins/api/APISectionPlatformTags';
import { mdComponents } from '~/components/plugins/api/APISectionUtils';
import { Cell, HeaderCell, Row, Table, TableHead } from '~/ui/components/Table';
import { StatusTag } from '~/ui/components/Tag';
import { P, CODE, H3 } from '~/ui/components/Text';
type Props = PropsWithChildren<{
properties: PluginProperty[];
}>;
export const ConfigPluginProperties = ({ children, properties }: Props) => (
<>
<H3>Configurable properties</H3>
{!!children && <P>{children}</P>}
<Table>
<TableHead>
<Row>
<HeaderCell>Name</HeaderCell>
<HeaderCell>Default</HeaderCell>
<HeaderCell>Description</HeaderCell>
</Row>
</TableHead>
<tbody>
{properties.map(property => (
<Row key={property.name}>
<Cell fitContent>
<CODE>{property.name}</CODE>
</Cell>
<Cell>{!property.default ? '-' : <CODE>{property.default}</CODE>}</Cell>
<Cell>
{property.experimental && <StatusTag status="experimental" className="mb-2" />}
{!!property.platform && (
<APISectionPlatformTags
platforms={[
{ content: [{ kind: 'text', text: property.platform }], tag: 'platform' },
]}
prefix="Only for:"
/>
)}
<ReactMarkdown components={mdComponents}>{property.description}</ReactMarkdown>
</Cell>
</Row>
))}
</tbody>
</Table>
</>
);
export type PluginProperty = {
name: string;
description: string;
default?: string;
platform?: 'android' | 'ios' | 'web';
experimental?: boolean;
};
``` | /content/code_sandbox/docs/ui/components/ConfigSection/ConfigPluginProperties.tsx | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 413 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="path_to_url"
android:id="@+id/activity_new_photo_edit_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF000000" />
``` | /content/code_sandbox/app/src/main/res/layout/activity_new_video_edit.xml | xml | 2016-02-16T21:17:13 | 2024-08-16T15:29:22 | Simple-Gallery | SimpleMobileTools/Simple-Gallery | 3,580 | 65 |
```xml
import path from 'path';
import fs from 'fs-extra';
import resolvePkg from 'resolve-pkg';
import * as git from './git.js';
export async function installModules(cwd: string) {
const manifestPath = path.join(cwd, 'package.json');
const targetModulesPath = path.join(cwd, 'node_modules');
if (await fs.pathExists(manifestPath)) {
const {dependencies = {}, devDependencies = {}} = await fs.readJson(
manifestPath
);
const deps = Object.keys({...dependencies, ...devDependencies});
await Promise.all(
deps.map(async (dependency: any) => {
const sourcePath = resolvePkg(dependency);
if (!sourcePath) {
throw new Error(`Could not resolve dependency ${dependency}`);
}
const sourceModulesPath = findParentPath(sourcePath, 'node_modules');
if (!sourceModulesPath) {
throw new Error(`Could not determine node_modules for ${sourcePath}`);
}
const relativePath = path.relative(sourceModulesPath, sourcePath);
const targetPath = path.join(targetModulesPath, relativePath);
await fs.mkdirp(path.join(targetPath, '..'));
await fs.symlink(sourcePath, targetPath);
})
);
}
}
export async function bootstrap(fixture: string, directory?: string) {
const cwd = await git.bootstrap(fixture, directory);
await installModules(cwd);
return cwd;
}
function findParentPath(
parentPath: string,
dirname: string
): string | undefined {
const rawFragments = parentPath.split(path.sep);
const {matched, fragments} = rawFragments.reduceRight(
({fragments, matched}, item) => {
if (item === dirname && !matched) {
return {fragments, matched: true};
}
if (!matched && fragments.length > 0) {
fragments.pop();
}
return {fragments, matched};
},
{fragments: rawFragments, matched: false}
);
return matched ? fragments.join(path.sep) : undefined;
}
``` | /content/code_sandbox/@packages/test/src/npm.ts | xml | 2016-02-12T08:37:56 | 2024-08-16T13:28:33 | commitlint | conventional-changelog/commitlint | 16,499 | 444 |
```xml
<annotation>
<folder>toy_images</folder>
<filename>toy97.jpg</filename>
<path>/home/animesh/Documents/grocery_detection/toy_exptt/toy_images/toy97.jpg</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>500</width>
<height>300</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>toy</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>147</xmin>
<ymin>21</ymin>
<xmax>295</xmax>
<ymax>197</ymax>
</bndbox>
</object>
</annotation>
``` | /content/code_sandbox/Custom_Mask_RCNN/annotations/xmls/toy97.xml | xml | 2016-08-17T18:29:12 | 2024-08-12T19:24:24 | Deep-Learning | priya-dwivedi/Deep-Learning | 3,346 | 210 |
```xml
import mimemessage from '@protontech/mimemessage';
import type { WorkerDecryptionResult } from '@proton/crypto';
import { arrayToBinaryString } from '@proton/crypto/lib/utils';
import { MIME_TYPES } from '@proton/shared/lib/constants';
import type { Api } from '@proton/shared/lib/interfaces';
import { ATTACHMENT_DISPOSITION } from '@proton/shared/lib/mail/constants';
import { getAttachments, isPlainText as testIsPlainText } from '@proton/shared/lib/mail/messages';
import type {
MessageEmbeddedImage,
MessageImages,
MessageKeys,
MessageState,
} from '../../store/messages/messagesTypes';
import type { Download } from '../attachment/attachmentDownloader';
import { formatDownload } from '../attachment/attachmentDownloader';
import { getPlainText } from '../message/messageContent';
import { readContentIDandLocation } from '../message/messageEmbeddeds';
import { prepareExport } from '../message/messageExport';
// Reference: Angular/src/app/composer/services/mimeMessageBuilder.js
/**
* Remove '; name=' and '; filename=' values
*/
const extractContentValue = (value = '') => {
const semicolonIndex = value.indexOf(';');
if (semicolonIndex === -1) {
return value;
}
return value.substring(0, semicolonIndex);
};
const getAttachmentsByType = (attachments: Download[], messageImages: MessageImages | undefined, inline: boolean) =>
attachments.filter((attachmentData) => {
const { cid, cloc } = readContentIDandLocation(attachmentData.attachment);
const image = messageImages?.images.find(
(image) => (image as MessageEmbeddedImage).cid === cid || (image as MessageEmbeddedImage).cloc === cloc
);
return !!image === inline;
});
const getEnbeddedAttachments = (attachments: Download[], messageImages: MessageImages | undefined) =>
getAttachmentsByType(attachments, messageImages, true);
const getNormalAttachments = (attachments: Download[], messageImages: MessageImages | undefined) =>
getAttachmentsByType(attachments, messageImages, false);
const buildAttachments = (attachments: Download[]) =>
attachments.map(({ attachment, data }) => {
const attachmentName = JSON.stringify(attachment.Name);
const headers = attachment.Headers || {};
const contentTypeValue =
extractContentValue(headers['content-type']) || attachment.MIMEType || 'application/octet-stream';
const contentDispositionValue =
extractContentValue(headers['content-disposition']) || ATTACHMENT_DISPOSITION.ATTACHMENT;
const entity = mimemessage.factory({
contentType: `${contentTypeValue}; filename=${attachmentName}; name=${attachmentName}`,
contentTransferEncoding: 'base64',
body: arrayToBinaryString(data),
});
entity.header(
'content-disposition',
`${contentDispositionValue}; filename=${attachmentName}; name=${attachmentName}`
);
if (headers['content-id']) {
entity.header('content-id', headers['content-id']);
}
return entity;
});
const buildEmbeddedHtml = (
html: string | undefined,
attachments: Download[],
messageImages: MessageImages | undefined
) => {
const htmlEntity = mimemessage.factory({
contentType: 'text/html;charset=utf-8',
contentTransferEncoding: 'base64',
body: html,
});
// Attachments
const inlineAttachments = getEnbeddedAttachments(attachments, messageImages);
const attachmentEntities = buildAttachments(inlineAttachments);
// add the attachments
const relatedBody = [htmlEntity].concat(attachmentEntities);
return mimemessage.factory({
contentType: 'multipart/related',
body: relatedBody,
});
};
/**
* Quoted printable for compatibility with old clients
* Mimemessagefactory doesn't handle the empty string well.
*/
const buildPlaintextEntity = (plaintext?: string) =>
mimemessage.factory({
body: plaintext,
contentTransferEncoding: 'quoted-printable',
});
/**
* Build the multipart/alternate MIME entity containing both the HTML and plain text entities.
*/
const buildAlternateEntity = (
plaintext: string | undefined,
html: string | undefined,
attachments: Download[],
messageImages: MessageImages | undefined
) =>
mimemessage.factory({
contentType: 'multipart/alternative',
body: [buildPlaintextEntity(plaintext), buildEmbeddedHtml(html, attachments, messageImages)],
});
/**
* Builds a mime body given the plaintext, html source and a list of attachments to fetch embedded images from
*/
const buildBodyEntity = (
plaintext: string | undefined,
html: string | undefined,
attachments: Download[],
messageImages: MessageImages | undefined
) => {
if (html !== undefined && plaintext !== undefined) {
return buildAlternateEntity(plaintext, html, attachments, messageImages);
}
return html !== undefined ? buildEmbeddedHtml(html, attachments, messageImages) : buildPlaintextEntity(plaintext);
};
/**
* Builds a multipart message from the given plaintext, html bodies and attachments.
* The html body is not necessary to create a valid mime body
*/
const build = (
plaintext: string | undefined,
html: string | undefined,
attachments: Download[],
messageImages: MessageImages | undefined
): string => {
const bodyEntity = buildBodyEntity(plaintext, html, attachments, messageImages);
const normalAttachments = getNormalAttachments(attachments, messageImages);
const attachmentEntities = buildAttachments(normalAttachments);
const body = [bodyEntity].concat(attachmentEntities);
const msgentity = mimemessage.factory({
contentType: 'multipart/mixed',
body,
});
// this trailing line space is important: if it's not there Outlook adds it and breaks pgp/mime signatures.
return `${msgentity.toString()}\r\n`;
};
const fetchMimeDependencies = async (
message: MessageState,
messageKeys: MessageKeys,
getAttachment: (ID: string) => WorkerDecryptionResult<Uint8Array> | undefined,
onUpdateAttachment: (ID: string, attachment: WorkerDecryptionResult<Uint8Array>) => void,
api: Api
): Promise<Download[]> => {
return Promise.all(
getAttachments(message.data).map(async (attachment) =>
formatDownload(
attachment,
message.verification,
messageKeys,
onUpdateAttachment,
api,
getAttachment,
message.data?.Flags
)
)
);
};
export const constructMime = async (
message: MessageState,
messageKeys: MessageKeys,
getAttachment: (ID: string) => WorkerDecryptionResult<Uint8Array> | undefined,
onUpdateAttachment: (ID: string, attachment: WorkerDecryptionResult<Uint8Array>) => void,
api: Api,
downconvert = true
) => {
const plaintext = getPlainText(message, downconvert);
const html = message.data?.MIMEType !== MIME_TYPES.PLAINTEXT ? prepareExport(message) : undefined;
const attachments = await fetchMimeDependencies(message, messageKeys, getAttachment, onUpdateAttachment, api);
return build(plaintext, html, attachments, message.messageImages);
};
export const constructMimeFromSource = async (
message: MessageState,
messageKeys: MessageKeys,
getAttachment: (ID: string) => WorkerDecryptionResult<Uint8Array> | undefined,
onUpdateAttachment: (ID: string, attachment: WorkerDecryptionResult<Uint8Array>) => void,
api: Api
) => {
const isDecryptionError = !!message.errors?.decryption?.length;
let plaintext: string | undefined;
let html: string | undefined;
if (isDecryptionError) {
plaintext = message.data?.Body;
} else {
const isPlainText = testIsPlainText(message.data);
plaintext = isPlainText ? message.decryption?.decryptedBody : undefined;
html = isPlainText ? undefined : message.decryption?.decryptedBody;
}
const attachments = await fetchMimeDependencies(message, messageKeys, getAttachment, onUpdateAttachment, api);
return build(plaintext, html, attachments, message.messageImages);
};
``` | /content/code_sandbox/applications/mail/src/app/helpers/send/sendMimeBuilder.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 1,729 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="path_to_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp"
android:background="@android:color/white"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp">
<ImageView
android:id="@+id/img_avatar"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginLeft="12dp"
android:layout_alignParentRight="true"
android:src="@drawable/ic_avatar"
android:tint="@color/bg_btn"/>
<TextView
android:id="@+id/tv_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:layout_toLeftOf="@id/img_avatar"
android:background="@drawable/bg_chat_right"
android:layout_marginLeft="50dp"
android:layout_alignBottom="@id/img_avatar"/>
</RelativeLayout>
``` | /content/code_sandbox/demo/src/main/res/layout/item_wechat_msg.xml | xml | 2016-02-23T08:54:55 | 2024-08-15T05:22:10 | Fragmentation | YoKeyword/Fragmentation | 9,719 | 255 |
```xml
const checklistsChanged = `
subscription salesChecklistsChanged($contentType: String!, $contentTypeId: String!) {
salesChecklistsChanged(contentType: $contentType, contentTypeId: $contentTypeId) {
_id
}
}
`;
const checklistDetailChanged = `
subscription salesChecklistDetailChanged($_id: String!) {
salesChecklistDetailChanged(_id: $_id) {
_id
}
}
`;
export default {
checklistsChanged,
checklistDetailChanged
};
``` | /content/code_sandbox/packages/ui-sales/src/checklists/graphql/subscriptions.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 108 |
```xml
import {expect, test} from '@playwright/test';
import {click} from './utils/click';
['table', 'td', 'th'].forEach((node) => {
test(`correctly positioned on bottom for ${node}`, async ({page}) => {
await page.goto('path_to_url
await click(page, `[data-testid="reference-${node}"]`);
expect(await page.locator('.container').screenshot()).toMatchSnapshot(
`${node}.png`,
);
await click(page, `[data-testid="inside-true"]`);
expect(await page.locator('.container').screenshot()).toMatchSnapshot(
`${node}-inside.png`,
);
});
});
``` | /content/code_sandbox/packages/dom/test/functional/table.test.ts | xml | 2016-03-29T17:00:47 | 2024-08-16T16:29:40 | floating-ui | floating-ui/floating-ui | 29,450 | 142 |
```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
/**
* Interface describing `dmskabs`.
*/
interface Routine {
/**
* Computes the absolute value for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`.
*
* @param N - number of indexed elements
* @param x - input array
* @param strideX - `x` stride length
* @param mask - mask array
* @param strideMask - `mask` stride length
* @param y - destination array
* @param strideY - `y` stride length
* @returns `y`
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Uint8Array = require( '@stdlib/array/uint8' );
*
* var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] );
* var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] );
* var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
*
* dmskabs( x.length, x, 1, m, 1, y, 1 );
* // y => <Float64Array>[ 2.0, 1.0, 0.0, 5.0, 0.0 ]
*/
( N: number, x: Float64Array, strideX: number, mask: Uint8Array, strideMask: number, y: Float64Array, strideY: number ): Float64Array;
/**
* Computes the absolute value for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics.
*
* @param N - number of indexed elements
* @param x - input array
* @param strideX - `x` stride length
* @param offsetX - starting index for `x`
* @param mask - mask array
* @param strideMask - `mask` stride length
* @param offsetMask - starting index for `mask`
* @param y - destination array
* @param strideY - `y` stride length
* @param offsetY - starting index for `y`
* @returns `y`
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Uint8Array = require( '@stdlib/array/uint8' );
*
* var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] );
* var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] );
* var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
*
* dmskabs.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 );
* // y => <Float64Array>[ 2.0, 1.0, 0.0, 5.0, 0.0 ]
*/
ndarray( N: number, x: Float64Array, strideX: number, offsetX: number, mask: Uint8Array, strideMask: number, offsetMask: number, y: Float64Array, strideY: number, offsetY: number ): Float64Array;
}
/**
* Computes the absolute value for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`.
*
* @param N - number of indexed elements
* @param x - input array
* @param strideX - `x` stride length
* @param mask - mask array
* @param strideMask - `mask` stride length
* @param y - destination array
* @param strideY - `y` stride length
* @returns `y`
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Uint8Array = require( '@stdlib/array/uint8' );
*
* var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] );
* var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] );
* var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
*
* dmskabs( x.length, x, 1, m, 1, y, 1 );
* // y => <Float64Array>[ 2.0, 1.0, 0.0, 5.0, 0.0 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Uint8Array = require( '@stdlib/array/uint8' );
*
* var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] );
* var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] );
* var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
*
* dmskabs.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 );
* // y => <Float64Array>[ 2.0, 1.0, 0.0, 5.0, 0.0 ]
*/
declare var dmskabs: Routine;
// EXPORTS //
export = dmskabs;
``` | /content/code_sandbox/lib/node_modules/@stdlib/math/strided/special/dmskabs/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 1,461 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="path_to_url">
<title type="text">dive into mark</title>
<subtitle type="html">A <em>lot</em> of effort went into making this effortless</subtitle>
<updated>2005-07-31T12:29:29Z</updated>
<id>tag:example.org,2003:3</id>
<link rel="alternate" type="text/html" hreflang="en" href="path_to_url" title="Human-readable information about the link" length="1234" />
<link rel="self" type="application/atom+xml" hreflang="pt" href="path_to_url" title="Information about the link is Human-readable" length="5678" />
<logo>path_to_url
<generator uri="path_to_url" version="1.0">Example Toolkit</generator>
<category term="music" />
<category term="video" />
<author>
<name>Pilgrim Mark</name>
<uri>path_to_url
<email>1234@example.com</email>
</author>
<author>
<name>Mark the Pilgrim</name>
<uri>path_to_url
<email>5678@example.com</email>
</author>
<contributor>
<name>Jane Doe</name>
<uri>path_to_url
<email>9101@example.com</email>
</contributor>
<contributor>
<name>John Doe</name>
<uri>path_to_url
<email>2345@example.com</email>
</contributor>
<entry>
<title>Atom draft-07 snapshot</title>
<summary type="text">An overview of Atom 1.0</summary>
<link rel="alternate" hreflang="en" type="text/html" href="path_to_url" title="Human-readable information about the link" length="1234" />
<link rel="enclosure" type="audio/mpeg" hreflang="pt" length="1337" title="Information about the link is Human-readable" href="path_to_url" />
<id>tag:example.org,2003:3.2397</id>
<updated>2005-07-31T12:29:29Z</updated>
<published>2003-12-13T08:29:29-04:00</published>
<category term="music" />
<category term="video" />
<author>
<name>Mark Pilgrim</name>
<uri>path_to_url
<email>f8dy@example.com</email>
</author>
<contributor>
<name>Sam Ruby</name>
<uri>path_to_url
<email>2345@example.com</email>
</contributor>
<contributor>
<name>Joe Gregorio</name>
<uri>path_to_url
<email>2345@example.com</email>
</contributor>
<content src="path_to_url" type="xhtml" xml:lang="en" xml:base="path_to_url"><div xmlns="path_to_url"><p><i>[Update: The Atom draft is finished.]</i></p></div></content>
</entry>
<entry>
<summary type="xhtml">
<div xmlns="path_to_url">
<p>
<strong>Some markings</strong>
<a href="path_to_url">Example</a>
</p>
<div class="blockquote">
<p>On a quote...</p>
</div>
</div>
</summary>
</entry>
</feed>
``` | /content/code_sandbox/Tests/xml/Atom.xml | xml | 2016-07-16T20:30:52 | 2024-08-11T11:30:01 | FeedKit | nmdias/FeedKit | 1,176 | 845 |
```xml
import { Localized } from "@fluent/react/compat";
import cn from "classnames";
import React, { FunctionComponent } from "react";
import { GQLSTORY_MODE } from "coral-framework/schema";
import { CommentContainer_comment as CommentData } from "coral-stream/__generated__/CommentContainer_comment.graphql";
import CLASSES from "coral-stream/classes";
import HTMLContent from "coral-stream/common/HTMLContent";
import Timestamp from "coral-stream/common/Timestamp";
import InReplyTo from "coral-stream/tabs/Comments/Comment/InReplyTo";
import { Hidden, HorizontalGutter, RelativeTime } from "coral-ui/components/v2";
import { StarRating } from "coral-ui/components/v3";
import styles from "./HistoryComment.css";
export interface HistoryCommentProps {
id: string;
body: string | null;
createdAt: string;
rating: number | null;
parent: CommentData["parent"];
story: {
metadata: {
title: string | null;
} | null;
settings: {
mode: string;
};
};
media: React.ReactNode;
footer: React.ReactNode;
}
const HistoryComment: FunctionComponent<HistoryCommentProps> = (props) => {
const storyTitle = props.story.metadata ? props.story.metadata.title : "N/A";
return (
<HorizontalGutter
className={cn(styles.root, CLASSES.myComment.$root)}
data-testid={`historyComment-${props.id}`}
container="article"
aria-labelledby={`historyComment-${props.id}-label`}
>
<div data-testid={`profile-historyComment-${props.id}-onStory`}>
<Localized
id="profile-historyComment-commentLabel"
elems={{ RelativeTime: <RelativeTime date={props.createdAt} /> }}
vars={{ storyTitle: storyTitle ?? "" }}
>
<Hidden id={`historyComment-${props.id}-label`}>
Comment <RelativeTime date={props.createdAt} /> on {storyTitle}
</Hidden>
</Localized>
<Localized id="profile-historyComment-comment-on">
<span className={cn(CLASSES.myComment.commentOn, styles.commentOn)}>
Comment on:
</span>
</Localized>
<div className={cn(styles.storyTitle, CLASSES.myComment.story)}>
{storyTitle}
</div>
</div>
<div>
<Timestamp className={CLASSES.myComment.timestamp}>
{props.createdAt}
</Timestamp>
{props.parent?.author?.username && (
<div className={styles.subBar}>
<InReplyTo parent={props.parent} enableJumpToParent={false} />
</div>
)}
<HorizontalGutter>
{props.story.settings.mode === GQLSTORY_MODE.RATINGS_AND_REVIEWS &&
props.rating && <StarRating rating={props.rating} />}
<div className={styles.content}>
{props.body && (
<HTMLContent className={CLASSES.myComment.content}>
{props.body}
</HTMLContent>
)}
</div>
{props.media}
</HorizontalGutter>
</div>
{props.footer}
</HorizontalGutter>
);
};
export default HistoryComment;
``` | /content/code_sandbox/client/src/core/client/stream/tabs/Profile/MyComments/HistoryComment.tsx | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 683 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>Author</key>
<string>Vandroiy</string>
<key>CodecID</key>
<integer>8200</integer>
<key>CodecName</key>
<string>CX8200</string>
<key>Files</key>
<dict>
<key>Layouts</key>
<array>
<dict>
<key>Comment</key>
<string>Mirone Laptop Patch</string>
<key>Id</key>
<integer>3</integer>
<key>Path</key>
<string>layout3.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>MacPeet - Conexant CX8200 for HP ZbooK 15UG4</string>
<key>Id</key>
<integer>15</integer>
<key>Path</key>
<string>layout15.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Andres ZeroCross for HP Spectre 13-V130NG</string>
<key>Id</key>
<integer>21</integer>
<key>Path</key>
<string>layout21.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>frankiezdh - Conexant CX8200 for HP Probook 440 G5</string>
<key>Id</key>
<integer>23</integer>
<key>Path</key>
<string>layout23.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Conexant CX8200 for LG Gram Z990/Z90N</string>
<key>Id</key>
<integer>80</integer>
<key>Path</key>
<string>layout80.xml.zlib</string>
</dict>
</array>
<key>Platforms</key>
<array>
<dict>
<key>Comment</key>
<string>Mirone Laptop Patch</string>
<key>Id</key>
<integer>3</integer>
<key>Path</key>
<string>PlatformsM.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>MacPeet - Conexant CX8200 for HP ZbooK 15UG4</string>
<key>Id</key>
<integer>15</integer>
<key>Path</key>
<string>Platforms15.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Andres ZeroCross for HP Spectre 13-V130NG</string>
<key>Id</key>
<integer>21</integer>
<key>Path</key>
<string>Platforms21.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>frankiezdh - Conexant CX8200 for HP Probook 440 G5</string>
<key>Id</key>
<integer>23</integer>
<key>Path</key>
<string>Platforms23.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Conexant CX8200 for LG Gram Z990/Z90N</string>
<key>Id</key>
<integer>80</integer>
<key>Path</key>
<string>Platforms80.xml.zlib</string>
</dict>
</array>
</dict>
<key>Patches</key>
<array>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>xgYASIu/aAE=</data>
<key>MinKernel</key>
<integer>18</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>xgYBSIu/aAE=</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>QcYGAEmLvCQ=</data>
<key>MaxKernel</key>
<integer>13</integer>
<key>MinKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>QcYGAUmLvCQ=</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>QcYGAEiLu2g=</data>
<key>MinKernel</key>
<integer>14</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>QcYGAUiLu2g=</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>QcaGQwEAAAA=</data>
<key>MinKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>QcaGQwEAAAE=</data>
</dict>
<dict>
<key>Count</key>
<integer>2</integer>
<key>Find</key>
<data>ixnUEQ==</data>
<key>MinKernel</key>
<integer>16</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>CCDxFA==</data>
</dict>
<dict>
<key>Count</key>
<integer>2</integer>
<key>Find</key>
<data>ihnUEQ==</data>
<key>MinKernel</key>
<integer>16</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>AAAAAA==</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>a3Bzaes=</data>
<key>MinKernel</key>
<integer>14</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Provider</key>
<string>Wern Apfel</string>
<key>Replace</key>
<data>Y2ltaes=</data>
</dict>
</array>
<key>Vendor</key>
<string>Conexant</string>
</dict>
</plist>
``` | /content/code_sandbox/Resources/CX8200/Info.plist | xml | 2016-03-07T20:45:58 | 2024-08-14T08:57:03 | AppleALC | acidanthera/AppleALC | 3,420 | 1,795 |
```xml
import * as React from 'react';
import { Field, Textarea } from '@fluentui/react-components';
export const Disabled = () => (
<Field label="Disabled Textarea">
<Textarea disabled />
</Field>
);
``` | /content/code_sandbox/packages/react-components/react-textarea/stories/src/Textarea/TextareaDisabled.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 50 |
```xml
// TypeScript Version: 3.0
// changed from: path_to_url
/* eslint-disable */
import * as React from 'react';
export type IntrinsicElementsKeys = keyof JSX.IntrinsicElements;
// Any prop that has a default prop becomes optional, but its type is unchanged
// Undeclared default props are augmented into the resulting allowable attributes
// If declared props have indexed properties, ignore default props entirely as keyof gets widened
// Wrap in an outer-level conditional type to allow distribution over props that are unions
type Defaultize<P, D> = P extends any
? string extends keyof P
? P
: Pick<P, Exclude<keyof P, keyof D>> &
Partial<Pick<P, Extract<keyof P, keyof D>>> &
Partial<Pick<D, Exclude<keyof D, keyof P>>>
: never;
type ReactDefaultizedProps<C, P> = C extends { defaultProps: infer D }
? Defaultize<P, D>
: P;
type MakeAttrsOptional<
C extends string | React.ComponentType<any>,
O extends object,
A extends keyof any
> = Omit<
ReactDefaultizedProps<
C,
React.ComponentPropsWithRef<
C extends IntrinsicElementsKeys | React.ComponentType<any> ? C : never
>
> &
O,
A
> &
Partial<
Pick<
React.ComponentPropsWithRef<
C extends IntrinsicElementsKeys | React.ComponentType<any> ? C : never
> &
O,
A
>
>;
export type StyledComponentProps<
// The Component from whose props are derived
C extends keyof string | React.ComponentType<any>,
// The other props added by the template
O extends object,
// The props that are made optional by .attrs
A extends keyof any
> =
// Distribute O if O is a union type
O extends object
? MakeAttrsOptional<C, O, A> & WithChildrenIfReactComponentClass<C>
: never;
// Because of React typing quirks, when getting props from a React.ComponentClass,
// we need to manually add a `children` field.
// See path_to_url
// and path_to_url
type WithChildrenIfReactComponentClass<
C extends keyof string | React.ComponentType<any>
> = C extends React.ComponentClass<any>
? { children?: React.ReactNode | undefined }
: {};
type StyledComponentPropsWithAs<
C extends keyof string | React.ComponentType<any>,
O extends object,
A extends keyof any
> = StyledComponentProps<C, O, A> & { as?: C | undefined };
// abuse Pick to strip the call signature from ForwardRefExoticComponent
type ForwardRefExoticBase<P> = Pick<
React.ForwardRefExoticComponent<P>,
keyof React.ForwardRefExoticComponent<any>
>;
export interface StyledComponent<
C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,
O extends object = {},
A extends keyof any = never
> extends ForwardRefExoticBase<StyledComponentProps<C, O, A>> {
// add our own fake call signature to implement the polymorphic 'as' prop
(props: StyledComponentProps<C, O, A> & { as?: never }): React.ReactElement<
StyledComponentProps<C, O, A>
>;
<AsC extends string | React.ComponentType<any> = C>(
props: StyledComponentPropsWithAs<AsC, O, A>,
): React.ReactElement<StyledComponentPropsWithAs<AsC, O, A>>;
withComponent<WithC extends string | React.ComponentType<any>>(
component: WithC,
): StyledComponent<WithC, O>;
}
export type StyledComponentPropsWithRef<
C extends string | React.ComponentType<any>
> = React.ComponentPropsWithRef<C>;
type Attrs<P, A extends Partial<P>> = ((props: P) => A) | A;
export interface StyledFunction<
C extends string | React.ComponentType<any>,
O extends object = {},
A extends keyof any = never
> {
(...rest: any[]): StyledComponent<C, O, A>;
// tslint:disable-next-line:no-unnecessary-generics
<U extends object>(...rest: any[]): StyledComponent<C, O & U, A>;
attrs<
U extends object,
NewA extends Partial<StyledComponentPropsWithRef<C> & U> & {
[others: string]: any;
} = Partial<StyledComponentPropsWithRef<C> & U>
>(
provideProps: Attrs<
ReactDefaultizedProps<C, React.ComponentPropsWithRef<C>> & U,
NewA
>,
): StyledFunction<C, O & NewA, A | keyof NewA>;
}
export type StyledTags = {
readonly [TTag in IntrinsicElementsKeys]: StyledFunction<TTag>;
};
export interface StyledOptions {
allowAs?: boolean | undefined;
}
export type mapper<TInner, TOuter> = (input: TInner) => TOuter;
export interface CreateStyled extends StyledTags {
<C extends IntrinsicElementsKeys | React.ComponentType<any>>(
component: C,
options?: StyledOptions,
): StyledFunction<C>;
<
C extends IntrinsicElementsKeys | React.ComponentType<any>,
OtherProps extends object
>(
component: C,
options?: StyledOptions | undefined,
): StyledFunction<C, OtherProps>;
}
declare const styled: CreateStyled;
export function css(template: TemplateStringsArray, ...args: any[]): string;
export function stylesheet(
template: TemplateStringsArray,
...args: any[]
): Record<string, string>;
export default styled;
``` | /content/code_sandbox/src/runtime/react.d.ts | xml | 2016-10-18T15:09:36 | 2024-08-13T04:00:36 | astroturf | astroturfcss/astroturf | 2,274 | 1,226 |
```xml
import * as fs from 'fs-extra';
import * as iconv from 'iconv-lite';
import * as path from 'path';
import { CookieJar, Store } from 'tough-cookie';
import * as url from 'url';
import { Uri, window } from 'vscode';
import { RequestHeaders, ResponseHeaders } from '../models/base';
import { IRestClientSettings, SystemSettings } from '../models/configurationSettings';
import { HttpRequest } from '../models/httpRequest';
import { HttpResponse } from '../models/httpResponse';
import { awsCognito } from './auth/awsCognito';
import { awsSignature } from './auth/awsSignature';
import { digest } from './auth/digest';
import { MimeUtility } from './mimeUtility';
import { getHeader, removeHeader } from './misc';
import { convertBufferToStream, convertStreamToBuffer } from './streamUtility';
import { UserDataManager } from './userDataManager';
import { getCurrentHttpFileName, getWorkspaceRootPath } from './workspaceUtility';
import { CancelableRequest, Headers, Method, OptionsOfBufferResponseBody, Response } from 'got';
import got = require('got');
const encodeUrl = require('encodeurl');
const CookieFileStore = require('tough-cookie-file-store').FileCookieStore;
type Certificate = {
cert?: Buffer;
key?: Buffer;
pfx?: Buffer;
passphrase?: string;
};
export class HttpClient {
private cookieStore: Store;
public constructor() {
const cookieFilePath = UserDataManager.cookieFilePath;
this.cookieStore = new CookieFileStore(cookieFilePath) as Store;
}
public async send(httpRequest: HttpRequest, settings?: IRestClientSettings): Promise<HttpResponse> {
settings = settings || SystemSettings.Instance;
const options = await this.prepareOptions(httpRequest, settings);
let bodySize = 0;
let headersSize = 0;
const requestUrl = encodeUrl(httpRequest.url);
const request: CancelableRequest<Response<Buffer>> = got.default(requestUrl, options);
httpRequest.setUnderlyingRequest(request);
(request as any).on('response', res => {
if (res.rawHeaders) {
headersSize += res.rawHeaders.map(h => h.length).reduce((a, b) => a + b, 0);
headersSize += (res.rawHeaders.length) / 2;
}
res.on('data', chunk => {
bodySize += chunk.length;
});
});
const response = await request;
const contentType = response.headers['content-type'];
let encoding: string | undefined;
if (contentType) {
encoding = MimeUtility.parse(contentType).charset;
}
if (!encoding) {
encoding = "utf8";
}
const bodyBuffer = response.body;
let bodyString = iconv.encodingExists(encoding) ? iconv.decode(bodyBuffer, encoding) : bodyBuffer.toString();
if (settings.decodeEscapedUnicodeCharacters) {
bodyString = this.decodeEscapedUnicodeCharacters(bodyString);
}
// adjust response header case, due to the response headers in nodejs http module is in lowercase
const responseHeaders: ResponseHeaders = HttpClient.normalizeHeaderNames(response.headers, response.rawHeaders);
const requestBody = options.body;
return new HttpResponse(
response.statusCode,
response.statusMessage!,
response.httpVersion,
responseHeaders,
bodyString,
bodySize,
headersSize,
bodyBuffer,
response.timings.phases,
new HttpRequest(
options.method!,
requestUrl,
HttpClient.normalizeHeaderNames(
(response as any).request.options.headers as RequestHeaders,
Object.keys(httpRequest.headers)),
Buffer.isBuffer(requestBody) ? convertBufferToStream(requestBody) : requestBody,
httpRequest.rawBody,
httpRequest.name
));
}
public async clearCookies() {
await fs.remove(UserDataManager.cookieFilePath);
this.cookieStore = new CookieFileStore(UserDataManager.cookieFilePath) as Store;
}
private async prepareOptions(httpRequest: HttpRequest, settings: IRestClientSettings): Promise<OptionsOfBufferResponseBody> {
const originalRequestBody = httpRequest.body;
let requestBody: string | Buffer | undefined;
if (originalRequestBody) {
if (typeof originalRequestBody !== 'string') {
requestBody = await convertStreamToBuffer(originalRequestBody);
} else {
requestBody = originalRequestBody;
}
}
// Fix #682 Do not touch original headers in httpRequest, which may be used for retry later
// Simply do a shadow copy here
const clonedHeaders = Object.assign({}, httpRequest.headers);
const options: OptionsOfBufferResponseBody = {
headers: clonedHeaders as any as Headers,
method: httpRequest.method as any as Method,
body: requestBody,
responseType: 'buffer',
decompress: true,
followRedirect: settings.followRedirect,
throwHttpErrors: false,
retry: 0,
hooks: {
afterResponse: [],
beforeRequest: [],
},
https: {
rejectUnauthorized: false
}
};
if (settings.timeoutInMilliseconds > 0) {
options.timeout = settings.timeoutInMilliseconds;
}
if (settings.rememberCookiesForSubsequentRequests) {
options.cookieJar = new CookieJar(this.cookieStore);
}
// TODO: refactor auth
const authorization = getHeader(options.headers!, 'Authorization') as string | undefined;
if (authorization) {
const [scheme, user, ...args] = authorization.split(/\s+/);
const normalizedScheme = scheme.toLowerCase();
if (args.length > 0) {
const pass = args.join(' ');
if (normalizedScheme === 'basic') {
removeHeader(options.headers!, 'Authorization');
options.username = user;
options.password = pass;
} else if (normalizedScheme === 'digest') {
removeHeader(options.headers!, 'Authorization');
options.hooks!.afterResponse!.push(digest(user, pass));
} else if (normalizedScheme === 'aws') {
removeHeader(options.headers!, 'Authorization');
options.hooks!.beforeRequest!.push(awsSignature(authorization));
} else if (normalizedScheme === 'cognito') {
removeHeader(options.headers!, 'Authorization');
options.hooks!.beforeRequest!.push(await awsCognito(authorization));
}
} else if (normalizedScheme === 'basic' && user.includes(':')) {
removeHeader(options.headers!, 'Authorization');
const [username, password] = user.split(':');
options.username = username;
options.password = password;
}
}
// set certificate
const certificate = this.getRequestCertificate(httpRequest.url, settings);
Object.assign(options, certificate);
// set proxy
if (settings.proxy && !HttpClient.ignoreProxy(httpRequest.url, settings.excludeHostsForProxy)) {
const proxyEndpoint = url.parse(settings.proxy);
if (/^https?:$/.test(proxyEndpoint.protocol || '')) {
const proxyOptions = {
host: proxyEndpoint.hostname,
port: Number(proxyEndpoint.port),
rejectUnauthorized: settings.proxyStrictSSL
};
const ctor = (httpRequest.url.startsWith('http:')
? await import('http-proxy-agent')
: await import('https-proxy-agent')).default;
options.agent = new ctor(proxyOptions);
}
}
return options;
}
private decodeEscapedUnicodeCharacters(body: string): string {
return body.replace(/\\u([0-9a-fA-F]{4})/gi, (_, g) => {
const char = String.fromCharCode(parseInt(g, 16));
return char === '"' ? '\\"' : char;
});
}
private getRequestCertificate(requestUrl: string, settings: IRestClientSettings): Certificate | null {
const host = url.parse(requestUrl).host;
if (!host || !(host in settings.hostCertificates)) {
return null;
}
const { cert: certPath, key: keyPath, pfx: pfxPath, passphrase } = settings.hostCertificates[host];
const cert = this.resolveCertificate(certPath);
const key = this.resolveCertificate(keyPath);
const pfx = this.resolveCertificate(pfxPath);
return { cert, key, pfx, passphrase };
}
private static ignoreProxy(requestUrl: string, excludeHostsForProxy: string[]): Boolean {
if (!excludeHostsForProxy || excludeHostsForProxy.length === 0) {
return false;
}
const resolvedUrl = url.parse(requestUrl);
const hostName = resolvedUrl.hostname?.toLowerCase();
const port = resolvedUrl.port;
const excludeHostsProxyList = Array.from(new Set(excludeHostsForProxy.map(eh => eh.toLowerCase())));
for (const eh of excludeHostsProxyList) {
const urlParts = eh.split(":");
if (!port) {
// if no port specified in request url, host name must exactly match
if (urlParts.length === 1 && urlParts[0] === hostName) {
return true;
}
} else {
// if port specified, match host without port or hostname:port exactly match
const [ph, pp] = urlParts;
if (ph === hostName && (!pp || pp === port)) {
return true;
}
}
}
return false;
}
private resolveCertificate(absoluteOrRelativePath: string | undefined): Buffer | undefined {
if (absoluteOrRelativePath === undefined) {
return undefined;
}
if (path.isAbsolute(absoluteOrRelativePath)) {
if (!fs.existsSync(absoluteOrRelativePath)) {
window.showWarningMessage(`Certificate path ${absoluteOrRelativePath} doesn't exist, please make sure it exists.`);
return undefined;
} else {
return fs.readFileSync(absoluteOrRelativePath);
}
}
// the path should be relative path
const rootPath = getWorkspaceRootPath();
let absolutePath = '';
if (rootPath) {
absolutePath = path.join(Uri.parse(rootPath).fsPath, absoluteOrRelativePath);
if (fs.existsSync(absolutePath)) {
return fs.readFileSync(absolutePath);
} else {
window.showWarningMessage(`Certificate path ${absoluteOrRelativePath} doesn't exist, please make sure it exists.`);
return undefined;
}
}
const currentFilePath = getCurrentHttpFileName();
if (!currentFilePath) {
return undefined;
}
absolutePath = path.join(path.dirname(currentFilePath), absoluteOrRelativePath);
if (fs.existsSync(absolutePath)) {
return fs.readFileSync(absolutePath);
} else {
window.showWarningMessage(`Certificate path ${absoluteOrRelativePath} doesn't exist, please make sure it exists.`);
return undefined;
}
}
private static normalizeHeaderNames<T extends RequestHeaders | ResponseHeaders>(headers: T, rawHeaders: string[]): T {
const headersDic: { [key: string]: string } = rawHeaders.reduce(
(prev, cur) => {
if (!(cur.toLowerCase() in prev)) {
prev[cur.toLowerCase()] = cur;
}
return prev;
}, {});
const adjustedResponseHeaders = {} as RequestHeaders | ResponseHeaders;
for (const header in headers) {
const adjustedHeaderName = headersDic[header] || header;
adjustedResponseHeaders[adjustedHeaderName] = headers[header];
}
return adjustedResponseHeaders as T;
}
}
``` | /content/code_sandbox/src/utils/httpClient.ts | xml | 2016-03-30T08:12:52 | 2024-08-16T05:00:34 | vscode-restclient | Huachao/vscode-restclient | 5,163 | 2,406 |
```xml
import { assert } from 'chai';
import { JavaScriptObfuscator } from '../../../../src/JavaScriptObfuscatorFacade';
import { NO_ADDITIONAL_NODES_PRESET } from '../../../../src/options/presets/NoCustomNodes';
import { SourceMapSourcesMode } from '../../../../src/enums/source-map/SourceMapSourcesMode';
describe('`inputFileName` validation', () => {
describe('IsInputFileName', () => {
describe('Variant #1: positive validation', () => {
describe('Variant #1: empty string when `sourceMapSourcesMode: \'sources-content\'', () => {
let testFunc: () => string;
beforeEach(() => {
testFunc = () => JavaScriptObfuscator.obfuscate(
'',
{
...NO_ADDITIONAL_NODES_PRESET,
inputFileName: '',
sourceMapSourcesMode: SourceMapSourcesMode.SourcesContent
}
).getObfuscatedCode();
});
it('should pass validation', () => {
assert.doesNotThrow(testFunc);
});
});
describe('Variant #2: string with input file name when `sourceMapSourcesMode: \'sources\'', () => {
let testFunc: () => string;
beforeEach(() => {
testFunc = () => JavaScriptObfuscator.obfuscate(
'',
{
...NO_ADDITIONAL_NODES_PRESET,
inputFileName: 'some-file.js',
sourceMapSourcesMode: SourceMapSourcesMode.Sources
}
).getObfuscatedCode();
});
it('should pass validation', () => {
assert.doesNotThrow(testFunc);
});
});
});
describe('Variant #2: negative validation', () => {
describe('Variant #1: empty string when `sourceMapSourcesMode: \'sources\'', () => {
const expectedError: string = 'should not be empty';
let testFunc: () => string;
beforeEach(() => {
testFunc = () => JavaScriptObfuscator.obfuscate(
'',
{
...NO_ADDITIONAL_NODES_PRESET,
inputFileName: '',
sourceMapSourcesMode: SourceMapSourcesMode.Sources
}
).getObfuscatedCode();
});
it('should not pass validation', () => {
assert.throws(testFunc, expectedError);
});
});
});
});
});
``` | /content/code_sandbox/test/functional-tests/options/input-file-name/Validation.spec.ts | xml | 2016-05-09T08:16:53 | 2024-08-16T19:43:07 | javascript-obfuscator | javascript-obfuscator/javascript-obfuscator | 13,358 | 493 |
```xml
import { IWeatherConditions } from '../../model/IWeatherConditions';
// US only for now
export interface IWeatherService {
getConditions (zip: string) : Promise<IWeatherConditions>;
}
``` | /content/code_sandbox/samples/react-teams-tab-field-visit-mashup/src/webparts/fieldVisitTab/services/WeatherService/IWeatherService.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 41 |
```xml
import { useEffect, useRef } from 'react';
import { ExtensionContext } from 'proton-pass-extension/lib/context/extension-context';
import type { MessageWithSenderFactory } from '@proton/pass/lib/extension/message';
import { sendMessage } from '@proton/pass/lib/extension/message';
import type {
AppState,
ClientEndpoint,
TabId,
WorkerMessageResponse,
WorkerMessageWithSender,
} from '@proton/pass/types';
import { AppStatus, WorkerMessageType } from '@proton/pass/types';
import { type Awaiter, awaiter } from '@proton/pass/utils/fp/promises';
import { logger } from '@proton/pass/utils/logger';
import noop from '@proton/utils/noop';
type WakeupOptions = { tabId: TabId; endpoint: ClientEndpoint; messageFactory: MessageWithSenderFactory };
type UseWorkerStateEventsOptions = WakeupOptions & { onWorkerStateChange: (state: AppState) => void };
const wakeup = (options: WakeupOptions): Promise<WorkerMessageResponse<WorkerMessageType.WORKER_WAKEUP>> =>
sendMessage.on(
options.messageFactory({
type: WorkerMessageType.WORKER_WAKEUP,
payload: { tabId: options.tabId },
}),
(response) => {
if (response.type === 'success') return response;
else {
logger.warn(`[Endpoint::${options.endpoint}] wakeup failed`, response.error);
throw new Error();
}
}
);
export const useWorkerStateEvents = ({ onWorkerStateChange, ...options }: UseWorkerStateEventsOptions) => {
const ready = useRef<Awaiter<void>>(awaiter());
useEffect(() => {
const onMessage = (message: WorkerMessageWithSender) => {
if (message.sender === 'background' && message.type === WorkerMessageType.WORKER_STATE_CHANGE) {
ready.current.then(() => onWorkerStateChange(message.payload.state)).catch(noop);
}
};
ExtensionContext.get().port.onMessage.addListener(onMessage);
wakeup(options)
.then(({ state }) => onWorkerStateChange(state))
.catch(() =>
onWorkerStateChange({
authorized: false,
booted: false,
localID: undefined,
status: AppStatus.ERROR,
UID: undefined,
})
)
.finally(ready.current.resolve);
return () => ExtensionContext.get().port.onMessage.removeListener(onMessage);
}, []);
};
``` | /content/code_sandbox/applications/pass-extension/src/lib/hooks/useWorkerStateEvents.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 507 |
```xml
import { isEmpty, pickBy } from 'lodash';
import { RequestResult } from './types';
export abstract class NuclearService {
protected _token: string;
constructor(protected baseUrl: string) {}
public set token(token: string) {
this._token = token;
}
getHeaders() {
return {
'Content-type': 'application/json'
};
}
prepareBody<TRequestBody extends object>(body: TRequestBody) {
return pickBy(body, value => !isEmpty(value));
}
async getJson<TResponseBody, TErrorBody>(
request: Promise<Response>
): Promise<RequestResult<TResponseBody, TErrorBody>> {
let result: Response;
let body;
try {
result = await request;
body = await result.json();
} catch (err) {
body = undefined;
}
if (result.ok) {
return {
body: body as TResponseBody ?? null,
status: result.status,
ok: result.ok
};
} else {
return {
body: body as TErrorBody ?? null,
status: result.status,
ok: result.ok
};
}
}
}
export const isResponseBody = <TResponseBody, TErrorBody>(
result: RequestResult<TResponseBody, TErrorBody>
): result is RequestResult<TResponseBody, never> => result.ok;
``` | /content/code_sandbox/packages/core/src/rest/Nuclear/NuclearService.ts | xml | 2016-09-22T22:58:21 | 2024-08-16T15:47:39 | nuclear | nukeop/nuclear | 11,862 | 293 |
```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
/**
* Interface describing `snanvariance`.
*/
interface Routine {
/**
* Computes the variance of a single-precision floating-point strided array ignoring `NaN` values.
*
* @param N - number of indexed elements
* @param correction - degrees of freedom adjustment
* @param x - input array
* @param stride - stride length
* @returns variance
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
*
* var v = snanvariance( x.length, 1, x, 1 );
* // returns ~4.3333
*/
( N: number, correction: number, x: Float32Array, stride: number ): number;
/**
* Computes the variance of a single-precision floating-point strided array ignoring `NaN` values and using alternative indexing semantics.
*
* @param N - number of indexed elements
* @param correction - degrees of freedom adjustment
* @param x - input array
* @param stride - stride length
* @param offset - starting index
* @returns variance
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
*
* var v = snanvariance.ndarray( x.length, 1, x, 1, 0 );
* // returns ~4.3333
*/
ndarray( N: number, correction: number, x: Float32Array, stride: number, offset: number ): number;
}
/**
* Computes the variance of a single-precision floating-point strided array ignoring `NaN` values.
*
* @param N - number of indexed elements
* @param correction - degrees of freedom adjustment
* @param x - input array
* @param stride - stride length
* @returns variance
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
*
* var v = snanvariance( x.length, 1, x, 1 );
* // returns ~4.3333
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
*
* var v = snanvariance.ndarray( x.length, 1, x, 1, 0 );
* // returns ~4.3333
*/
declare var snanvariance: Routine;
// EXPORTS //
export = snanvariance;
``` | /content/code_sandbox/lib/node_modules/@stdlib/stats/base/snanvariance/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 712 |
```xml
import { IVSCodeProperties } from './vscodeProperties';
export interface IVSCodeConfiguration {
title: string;
properties: Record<string, IVSCodeProperties>;
}
``` | /content/code_sandbox/src/models/packageManifest/vscodeConfiguration.ts | xml | 2016-05-30T23:24:37 | 2024-08-12T22:55:53 | vscode-icons | vscode-icons/vscode-icons | 4,391 | 38 |
```xml
import {
Column,
Entity,
JoinTable,
ManyToMany,
PrimaryGeneratedColumn,
} from "../../../../src"
import { Book } from "./Book"
export const BORROWED = "borrowed"
@Entity()
export class User {
@PrimaryGeneratedColumn("uuid")
id: string
@Column()
name: string
@ManyToMany((_type) => Book, {})
@JoinTable({ name: BORROWED })
public borrowed: Book[]
}
``` | /content/code_sandbox/test/github-issues/9965/entity/User.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 104 |
```xml
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import {
IPropertyPaneConfiguration,
PropertyPaneTextField
} from '@microsoft/sp-property-pane';
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
import * as strings from 'GraphAutoBatchingWebPartStrings';
import GraphAutoBatching from './components/GraphAutoBatching';
import { IGraphAutoBatchingProps } from './components/IGraphAutoBatchingProps';
import { IHttpClient } from '../../dal/http/IHttpClient';
import { SPFxHttpClient } from '../../dal/http/SPFxHttpClient';
import { BatchGraphClient } from '../../dal/http/BatchGraphClient';
export interface IGraphAutoBatchingWebPartProps {
description: string;
}
export default class GraphAutoBatchingWebPart extends BaseClientSideWebPart<IGraphAutoBatchingWebPartProps> {
protected httpClient: IHttpClient;
protected async onInit(): Promise<void> {
let client = await this.context.aadHttpClientFactory.getClient('path_to_url
this.httpClient = new BatchGraphClient(new SPFxHttpClient(client));
}
public render(): void {
const element: React.ReactElement<IGraphAutoBatchingProps> = React.createElement(
GraphAutoBatching,
{
graphClient: this.httpClient
}
);
ReactDom.render(element, this.domElement);
}
protected onDispose(): void {
ReactDom.unmountComponentAtNode(this.domElement);
}
protected get dataVersion(): Version {
return Version.parse('1.0');
}
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
PropertyPaneTextField('description', {
label: strings.DescriptionFieldLabel
})
]
}
]
}
]
};
}
}
``` | /content/code_sandbox/samples/react-graph-auto-batching/src/webparts/graphAutoBatching/GraphAutoBatchingWebPart.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 434 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bt-parent</artifactId>
<groupId>com.github.atomashpolskiy</groupId>
<version>1.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bt-cli</artifactId>
<name>Bt CLI Launcher</name>
<description>Command line BitTorrent client</description>
<properties>
<main.class>bt.cli.CliClient</main.class>
<jopts-version>5.0.2</jopts-version>
<lanterna-version>3.1.1</lanterna-version>
</properties>
<build>
<finalName>bt-launcher</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${main.class}</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-http-tracker-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-dht</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.atomashpolskiy</groupId>
<artifactId>bt-upnp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>${jopts-version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.lanterna</groupId>
<artifactId>lanterna</artifactId>
<version>${lanterna-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j-version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j-version}</version>
</dependency>
</dependencies>
</project>
``` | /content/code_sandbox/bt-cli/pom.xml | xml | 2016-05-15T19:56:23 | 2024-08-15T15:26:55 | bt | atomashpolskiy/bt | 2,400 | 1,078 |
```xml
/* eslint-disable class-methods-use-this */
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
import { TransactionCreateCommand } from 'lisk-commander';
import { Application, Types } from 'lisk-sdk';
import { getApplication } from '../../app/app';
type CreateFlags = typeof TransactionCreateCommand.flags & {
[key: string]: Record<string, unknown>;
};
export class CreateCommand extends TransactionCreateCommand {
static flags: CreateFlags = {
...TransactionCreateCommand.flags,
};
static args = [...TransactionCreateCommand.args];
public getApplication(config: Types.PartialApplicationConfig): Application {
const app = getApplication(config);
return app;
}
}
``` | /content/code_sandbox/examples/interop/pos-sidechain-example-two/src/commands/transaction/create.ts | xml | 2016-02-01T21:45:35 | 2024-08-15T19:16:48 | lisk-sdk | LiskArchive/lisk-sdk | 2,721 | 142 |
```xml
import { DecryptedPayloadInterface } from '@standardnotes/models'
import { AbstractKeySplit } from './AbstractKeySplit'
export type KeyedEncryptionSplit = AbstractKeySplit<DecryptedPayloadInterface>
``` | /content/code_sandbox/packages/encryption/src/Domain/Split/KeyedEncryptionSplit.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 42 |
```xml
//
//
// Microsoft Bot Framework: path_to_url
//
// Bot Framework Emulator Github:
// path_to_url
//
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import { existsSync, unlinkSync } from 'fs';
import { join } from 'path';
import { Application } from 'spectron';
import { appPath, chromeDriverLogPath, electronPath, closeDialogsIfShowing } from './utils';
import { init, setupMock } from './mocks/electronDialog';
describe('Exporting and importing transcripts', () => {
let app: Application;
beforeEach(async () => {
jest.setTimeout(30000);
app = new Application({
path: electronPath,
args: [appPath],
chromeDriverLogPath,
});
init(app);
await app.start();
await closeDialogsIfShowing(app);
});
afterEach(async () => {
if (app && app.isRunning()) {
await app.stop();
}
});
it('should export a transcript to disk', async () => {
// mock the electron save dialog to return the path for the transcript we want to export
const transcriptPath = join(__dirname, 'e2e-exported-transcript.transcript');
await setupMock(app, { method: 'showSaveDialog', value: transcriptPath });
// open the open bot modal
await app.client.click('button#open-bot-welcome');
// enter the bot URL into the input and click connect
await app.client.setValue('input[id*="auto-complete-textbox"]', 'path_to_url
await app.client.click('button#connect-open-bot');
// wait for Web Chat to show up
await app.client.waitForExist('div.bubble:first-of-type', 3000);
// greet the bot
await app.client.setValue('input[data-id="webchat-sendbox-input"]', 'Hello');
await app.client.click('button[title="Send"]');
// wait for the response from the bot
await app.client.pause(1000);
// respond to the bot
await app.client.setValue('input[data-id="webchat-sendbox-input"]', "I'm doing well, thanks for asking!");
await app.client.click('button[title="Send"]');
// wait for the response from the bot
await app.client.pause(1000);
// save the transcript to disk
await app.client.click('div[class*="toolbar"] > button[class*="save-icon"]');
// wait for save
await app.client.pause(500);
// verify that the transcript was saved to disk
expect(existsSync(transcriptPath)).toBe(true);
// delete the transcript
unlinkSync(transcriptPath);
});
it('should import a transcript from disk', async () => {
// mock the electron open dialog to return the path for the transcript we want to import
const testBotDir = join(__dirname, '..', '..', '..', 'tools', 'test-bot');
await setupMock(app, { method: 'showOpenDialog', value: [testBotDir] });
// open the open bot modal
await app.client.click('button#open-bot-welcome');
// enter the .bot file path into the input and click connect
const botFilePath = join(__dirname, '..', '..', '..', 'tools', 'test-bot', 'e2e-test-bot.bot');
await app.client.setValue('input[id*="auto-complete-textbox"]', botFilePath);
await app.client.click('button#connect-open-bot');
// wait for Web Chat to show up
await app.client.waitForExist('div.bubble:first-of-type', 5000);
// close the livechat tab
await app.client.click('button[class*="editor-tab-close"][title*="Close Live Chat"]');
// open the resources tab
await app.client.click('nav > button[title="Resources"]');
// expand the transcripts explorer
await app.client.click('div[class*="resources-bar"] div[aria-label="transcripts"]');
// click "Choose a different location"
await app.client.click('div[class*="resources-bar"] div[aria-label="transcripts"] ~ div[class*="body"] button');
// browse for a new transcripts directory
await app.client.click('button[data-prop="transcriptsPath"]');
// click save if it's enabled, otherwise the path was already set to the e2e test path, and we should dismiss the dialog
const disabled = await app.client.getAttribute(
'div[class*="dialog-host-content"] div[class*="footer"] > button:nth-of-type(2)',
'disabled'
);
if (disabled === 'true') {
await app.client.click('div[class*="dialog-host-content"] div[class*="footer"] > button:nth-of-type(1)');
} else {
await app.client.click('div[class*="dialog-host-content"] div[class*="footer"] > button:nth-of-type(2)');
}
// click the transcript to load it
await app.client.click('li[title*="sample-conversation.transcript"]');
// wait for Web Chat to show up
await app.client.waitForExist('div.bubble:first-of-type', 5000);
// there should be 5 chat bubbles visible
const msgBubbles = await app.client.$$('div.bubble > div > span');
expect(msgBubbles.length).toBe(5);
const msgBubble0 = await app.client.elementIdText(msgBubbles[0].ELEMENT);
expect(msgBubble0.value).toEqual('Welcome to the e2e testing bot! :)');
const msgBubble1 = await app.client.elementIdText(msgBubbles[1].ELEMENT);
expect(msgBubble1.value).toEqual('Hello');
const msgBubble2 = await app.client.elementIdText(msgBubbles[2].ELEMENT);
expect(msgBubble2.value).toEqual('Hello! :)');
const msgBubble3 = await app.client.elementIdText(msgBubbles[3].ELEMENT);
expect(msgBubble3.value).toEqual('How are you doing?');
const msgBubble4 = await app.client.elementIdText(msgBubbles[4].ELEMENT);
expect(msgBubble4.value).toEqual("I'm doing great, thanks for asking!");
});
});
``` | /content/code_sandbox/packages/app/main/e2e/exportAndImportTranscript.spec.ts | xml | 2016-11-11T23:15:09 | 2024-08-16T12:45:29 | BotFramework-Emulator | microsoft/BotFramework-Emulator | 1,803 | 1,552 |
```xml
import * as ESTree from 'estree';
import { TNumericalExpressionDataToNodeConverterLiteralNodeGetter } from '../types/node/TNumericalExpressionDataToNodeConverterLiteralNodeGetter';
import { TNumberNumericalExpressionData } from '../types/analyzers/number-numerical-expression-analyzer/TNumberNumericalExpressionData';
import { NodeFactory } from './NodeFactory';
import { NumberUtils } from '../utils/NumberUtils';
/**
* Converts NumberNumericalExpressionData to node
*/
export class NumericalExpressionDataToNodeConverter {
/**
* @param {TNumberNumericalExpressionData} numberNumericalExpressionData
* @param {TNumericalExpressionDataToNodeConverterLiteralNodeGetter} literalNodeGetter
* @returns {Expression}
*/
public static convertIntegerNumberData (
numberNumericalExpressionData: TNumberNumericalExpressionData,
literalNodeGetter: TNumericalExpressionDataToNodeConverterLiteralNodeGetter
): ESTree.Expression {
return NumericalExpressionDataToNodeConverter.convertNumericalExpressionDataToNode(
numberNumericalExpressionData,
literalNodeGetter
);
}
/**
* @param {TNumberNumericalExpressionData} integerNumberNumericalExpressionData
* @param {number} decimalPart
* @param {TNumericalExpressionDataToNodeConverterLiteralNodeGetter} literalNodeGetter
* @returns {Expression}
*/
public static convertFloatNumberData (
integerNumberNumericalExpressionData: TNumberNumericalExpressionData,
decimalPart: number,
literalNodeGetter: TNumericalExpressionDataToNodeConverterLiteralNodeGetter
): ESTree.Expression {
const integerNumberNumericalExpressionNode: ESTree.Expression = NumericalExpressionDataToNodeConverter
.convertNumericalExpressionDataToNode(
integerNumberNumericalExpressionData,
literalNodeGetter
);
return NodeFactory.binaryExpressionNode(
'+',
integerNumberNumericalExpressionNode,
NodeFactory.literalNode(decimalPart)
);
}
/**
* @param {TNumberNumericalExpressionData} numberNumericalExpressionData
* @param {TNumericalExpressionDataToNodeConverterLiteralNodeGetter} literalNodeGetter
* @param {BinaryOperator} operator
* @returns {Expression}
*/
private static convertNumericalExpressionDataToNode (
numberNumericalExpressionData: TNumberNumericalExpressionData,
literalNodeGetter: TNumericalExpressionDataToNodeConverterLiteralNodeGetter,
operator: ESTree.BinaryOperator = '+'
): ESTree.Expression {
const numberNumericalExpressionDataLength: number = numberNumericalExpressionData.length;
const leftParts: TNumberNumericalExpressionData = numberNumericalExpressionDataLength > 1
? numberNumericalExpressionData.slice(0, numberNumericalExpressionDataLength - 1)
: [numberNumericalExpressionData[0]];
const rightParts: TNumberNumericalExpressionData = numberNumericalExpressionDataLength > 1
? numberNumericalExpressionData.slice(-1)
: [];
// trailing iterations
if (rightParts.length) {
return NumericalExpressionDataToNodeConverter
.convertPartsToBinaryExpression(operator, leftParts, rightParts, literalNodeGetter);
}
const firstLeftPartOrNumber: number | number[] | null = leftParts[0] ?? null;
// last iteration when only single left part is left
return Array.isArray(firstLeftPartOrNumber)
? NumericalExpressionDataToNodeConverter.convertNumericalExpressionDataToNode(
firstLeftPartOrNumber,
literalNodeGetter,
'*'
)
: NumericalExpressionDataToNodeConverter.convertPartOrNumberToLiteralNode(
firstLeftPartOrNumber,
literalNodeGetter
);
}
/**
* @param {BinaryOperator} operator
* @param {TNumberNumericalExpressionData} leftParts
* @param {TNumberNumericalExpressionData} rightParts
* @param {TNumericalExpressionDataToNodeConverterLiteralNodeGetter} literalNodeGetter
* @returns {BinaryExpression}
*/
private static convertPartsToBinaryExpression (
operator: ESTree.BinaryOperator,
leftParts: TNumberNumericalExpressionData,
rightParts: TNumberNumericalExpressionData,
literalNodeGetter: TNumericalExpressionDataToNodeConverterLiteralNodeGetter
): ESTree.BinaryExpression {
const rightPartOrNumber: number | number[] = rightParts[0];
if (Array.isArray(rightPartOrNumber)) {
// right part is array with multiply numbers
return NodeFactory.binaryExpressionNode(
operator,
NumericalExpressionDataToNodeConverter.convertNumericalExpressionDataToNode(
leftParts,
literalNodeGetter
),
NumericalExpressionDataToNodeConverter.convertNumericalExpressionDataToNode(
rightPartOrNumber,
literalNodeGetter,
'*'
)
);
} else {
// right part is number
return NodeFactory.binaryExpressionNode(
operator,
NumericalExpressionDataToNodeConverter.convertNumericalExpressionDataToNode(
leftParts,
literalNodeGetter
),
this.convertPartOrNumberToLiteralNode(
rightPartOrNumber,
literalNodeGetter
)
);
}
}
/**
* @param {number | number[]} partOrNumber
* @param {TNumericalExpressionDataToNodeConverterLiteralNodeGetter} literalNodeGetter
* @returns {Expression}
*/
private static convertPartOrNumberToLiteralNode (
partOrNumber: number | number[],
literalNodeGetter: TNumericalExpressionDataToNodeConverterLiteralNodeGetter
): ESTree.Expression {
const number: number = Array.isArray(partOrNumber)
? partOrNumber[0]
: partOrNumber;
const isPositiveNumber: boolean = NumberUtils.isPositive(number);
const absoluteNumber: number = Math.abs(number);
return literalNodeGetter(absoluteNumber, isPositiveNumber);
}
}
``` | /content/code_sandbox/src/node/NumericalExpressionDataToNodeConverter.ts | xml | 2016-05-09T08:16:53 | 2024-08-16T19:43:07 | javascript-obfuscator | javascript-obfuscator/javascript-obfuscator | 13,358 | 1,294 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.Core</AssemblyName>
<PackageId>Volo.Abp.Core</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Collections.Immutable" />
<PackageReference Include="Microsoft.Extensions.Localization" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" />
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="System.Text.Encodings.Web" />
<PackageReference Include="System.Runtime.Loader" />
<PackageReference Include="System.Linq.Dynamic.Core" />
<PackageReference Include="System.Linq.Queryable" />
<PackageReference Include="JetBrains.Annotations" />
<PackageReference Include="Nito.AsyncEx.Context" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '2.1')) ">
<PackageReference Include="System.ComponentModel.Annotations" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '2.0')) ">
<PackageReference Include="Nullable">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
``` | /content/code_sandbox/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 535 |
```xml
export class MonitoringVersion {
version: string;
}
// MonitoringStatus contains status of CDS Component
export class MonitoringStatus {
now: string;
lines: Array<MonitoringStatusLine>;
}
// MonitoringStatusLine represents a CDS Component Status
export class MonitoringStatusLine {
status: string;
component: string;
value: string;
type: string;
service: string;
hostname: string;
session: string;
consumer: string;
}
export class MonitoringStatusLineUtil {
public static color(monitoringMetricsLine: MonitoringStatusLine): string {
switch (monitoringMetricsLine.status) {
case 'OK':
return 'green';
case 'AL':
return 'red';
case 'WARN':
return 'orange';
}
return 'blue';
}
}
export interface MonitoringMetricsLabel {
name: string;
value: string;
}
export interface MonitoringMetricsGauge {
value: number;
}
export interface MonitoringMetricsMetric {
label: MonitoringMetricsLabel[];
gauge: MonitoringMetricsGauge;
}
export interface MonitoringMetricsLine {
name: string;
help: string;
type: number;
metric: MonitoringMetricsMetric[];
}
``` | /content/code_sandbox/ui/src/app/model/monitoring.model.ts | xml | 2016-10-11T08:28:23 | 2024-08-16T01:55:31 | cds | ovh/cds | 4,535 | 254 |
```xml
<resources>
<string name="app_name">Lottie Benchmark</string>
</resources>
``` | /content/code_sandbox/app-benchmark/src/main/res/values/strings.xml | xml | 2016-10-06T22:42:42 | 2024-08-16T18:32:58 | lottie-android | airbnb/lottie-android | 34,892 | 21 |
```xml
import * as React from 'react';
import { Button, Combobox, makeStyles, Option, tokens, useId } from '@fluentui/react-components';
import type { ComboboxProps } from '@fluentui/react-components';
import { Dismiss12Regular } from '@fluentui/react-icons';
const useStyles = makeStyles({
root: {
// Stack the label above the field with a gap
display: 'grid',
gridTemplateRows: 'repeat(1fr)',
justifyItems: 'start',
gap: '2px',
maxWidth: '400px',
},
tagsList: {
listStyleType: 'none',
marginBottom: tokens.spacingVerticalXXS,
marginTop: 0,
paddingLeft: 0,
display: 'flex',
gridGap: tokens.spacingHorizontalXXS,
},
});
export const MultiselectWithTags = (props: Partial<ComboboxProps>) => {
// generate ids for handling labelling
const comboId = useId('combo-multi');
const selectedListId = `${comboId}-selection`;
// refs for managing focus when removing tags
const selectedListRef = React.useRef<HTMLUListElement>(null);
const comboboxInputRef = React.useRef<HTMLInputElement>(null);
const options = ['Cat', 'Dog', 'Ferret', 'Fish', 'Hamster', 'Snake'];
const styles = useStyles();
// Handle selectedOptions both when an option is selected or deselected in the Combobox,
// and when an option is removed by clicking on a tag
const [selectedOptions, setSelectedOptions] = React.useState<string[]>([]);
const onSelect: ComboboxProps['onOptionSelect'] = (event, data) => {
setSelectedOptions(data.selectedOptions);
};
const onTagClick = (option: string, index: number) => {
// remove selected option
setSelectedOptions(selectedOptions.filter(o => o !== option));
// focus previous or next option, defaulting to focusing back to the combo input
const indexToFocus = index === 0 ? 1 : index - 1;
const optionToFocus = selectedListRef.current?.querySelector(`#${comboId}-remove-${indexToFocus}`);
if (optionToFocus) {
(optionToFocus as HTMLButtonElement).focus();
} else {
comboboxInputRef.current?.focus();
}
};
const labelledBy = selectedOptions.length > 0 ? `${comboId} ${selectedListId}` : comboId;
return (
<div className={styles.root}>
<label id={comboId}>Best pets</label>
{selectedOptions.length ? (
<ul id={selectedListId} className={styles.tagsList} ref={selectedListRef}>
{/* The "Remove" span is used for naming the buttons without affecting the Combobox name */}
<span id={`${comboId}-remove`} hidden>
Remove
</span>
{selectedOptions.map((option, i) => (
<li key={option}>
<Button
size="small"
shape="circular"
appearance="primary"
icon={<Dismiss12Regular />}
iconPosition="after"
onClick={() => onTagClick(option, i)}
id={`${comboId}-remove-${i}`}
aria-labelledby={`${comboId}-remove ${comboId}-remove-${i}`}
>
{option}
</Button>
</li>
))}
</ul>
) : null}
<Combobox
aria-labelledby={labelledBy}
multiselect={true}
placeholder="Select one or more animals"
selectedOptions={selectedOptions}
onOptionSelect={onSelect}
ref={comboboxInputRef}
{...props}
>
{options.map(option => (
<Option key={option}>{option}</Option>
))}
</Combobox>
</div>
);
};
MultiselectWithTags.parameters = {
docs: {
description: {
story:
'Combobox can display multiselect values in custom tags. ' +
'This example uses a controlled selection so the tags can be used to remove selected options.',
},
},
};
``` | /content/code_sandbox/packages/react-components/react-combobox/stories/src/Combobox/ComboboxMultiselectWithTags.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 884 |
```xml
<resources>
<style name="AppTheme" parent="Theme.AppCompat">
<item name="android:windowBackground">@drawable/holo_background</item>
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="AppThemeReference" parent="Theme.AppCompat">
<item name="android:background">#212121</item>
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="StatisticsWhiteTheme" parent="Theme.AppCompat.Light">
<item name="android:background">@android:color/white</item>
<item name="android:textColor">@android:color/black</item>
</style>
<style name="AppThemeToolBar" parent="Theme.AppCompat.NoActionBar">
<item name="android:background">#212121</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="AppThemeToolBarLite" parent="Theme.AppCompat.NoActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="Toolbar">
<item name="android:background">?attr/colorPrimary</item>
<item name="theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
</style>
<style name="OldAppTheme" parent="android:Theme.Holo">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="OldAppThemeNoTitleBar" parent="android:Theme.Holo.NoActionBar">
</style>
<style name="PopUpKeypad" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="KeypadButton">
<item name="android:layout_margin">5dp</item>
<item name="android:background">#666666</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="CustomShowcaseTheme" parent="ShowcaseView.Light">
<item name="sv_backgroundColor">#3300A621</item>
<item name="sv_showcaseColor">#00801A</item>
<item name="sv_buttonText">Hide</item>
<item name="sv_tintButtonColor">false</item>
<item name="sv_titleTextAppearance">@style/CustomTitle</item>
</style>
<style name="CustomShowcaseTheme2" parent="ShowcaseView">
<item name="sv_backgroundColor">#f2212121</item>
<item name="sv_showcaseColor">#7a7225</item>
<item name="sv_buttonText">@string/ok</item>
<item name="sv_titleTextAppearance">@style/CustomTitle2</item>
<item name="sv_detailTextAppearance">@style/CustomText2</item>
</style>
<style name="CustomShowcaseTheme3" parent="ShowcaseView.Light">
<item name="sv_backgroundColor">#c8ed680f</item>
<item name="sv_showcaseColor">#ed680f</item>
<item name="sv_buttonText">Hide</item>
<item name="sv_tintButtonColor">false</item>
<item name="sv_titleTextAppearance">@style/CustomTitle2</item>
<item name="sv_detailTextAppearance">@style/CustomText2</item>
</style>
<style name="CustomTitle" parent="TextAppearance.ShowcaseView.Title">
<item name="android:textColor">#00801A</item>
</style>
<style name="CustomTitle2" parent="TextAppearance.ShowcaseView.Title.Light">
<item name="android:textColor">#deffffff</item>
</style>
<style name="CustomText2" parent="TextAppearance.ShowcaseView.Detail.Light">
<item name="android:textColor">#8affffff</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">#212121</item>
<!--<item name="android:color">#616161</item>-->
</style>
<style name="WhiteActionBar"
parent="@android:style/Widget.Holo.ActionBar">
<item name="android:colorForeground">@style/WhiteActionBar.Title</item>
<item name="android:background">#212121</item>
<item name="android:titleTextStyle">@style/WhiteActionBar.Title</item>
<item name="android:subtitleTextStyle">@style/WhiteActionBar.Subtitle</item>
<!--<item name="android:color">#616161</item>-->
</style>
<style name="WhiteActionBar.Title">
<item name="android:textColor">@android:color/black</item>
</style>
<style name="WhiteActionBar.Subtitle">
<item name="android:textColor">@android:color/black</item>
</style>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/styles.xml | xml | 2016-09-23T13:33:17 | 2024-08-15T09:51:19 | xDrip | NightscoutFoundation/xDrip | 1,365 | 1,243 |
```xml
/** @jsxRuntime automatic */
/** @jsxImportSource @fluentui/react-jsx-runtime */
import type { TagPickerOptionGroupState } from './TagPickerOptionGroup.types';
import { renderOptionGroup_unstable } from '@fluentui/react-combobox';
/**
* Render the final JSX of TagPickerOptionGroup
*/
export const renderTagPickerOptionGroup: (state: TagPickerOptionGroupState) => JSX.Element = renderOptionGroup_unstable;
``` | /content/code_sandbox/packages/react-components/react-tag-picker/library/src/components/TagPickerOptionGroup/renderTagPickerOptionGroup.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 96 |
```xml
import { IFilePickerTab } from "../IFilePickerTab.types";
export interface IRecentFilesTabProps extends IFilePickerTab {
//inherited
}
export interface IRecentFilesTabState {
results: IRecentFile[];
isLoading: boolean;
fileUrl?: string;
}
export interface IRecentFile {
fileUrl: string;
key: string;
name: string;
editedBy: string;
}
``` | /content/code_sandbox/samples/react-comparer/src/controls/PropertyPaneFilePicker/RecentFilesTab/RecentFilesTab.types.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 91 |
```xml
<!--
~
~
~ path_to_url
~
~ Unless required by applicable law or agreed to in writing, software
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-->
<project xmlns:xsi="path_to_url" xmlns="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.networknt</groupId>
<artifactId>light-4j</artifactId>
<version>2.1.36-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>cache-manager</artifactId>
<packaging>jar</packaging>
<description>A centralized cache manager for all in-memory caches across the entire application.</description>
<dependencies>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>service</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
``` | /content/code_sandbox/cache-manager/pom.xml | xml | 2016-09-09T22:28:14 | 2024-08-14T17:35:43 | light-4j | networknt/light-4j | 3,614 | 366 |
```xml
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { dedent } from 'ts-dedent';
import * as ButtonStories from '../examples/Button.stories';
import * as ParameterStories from '../examples/CanvasParameters.stories';
import * as SourceParameterStories from '../examples/SourceParameters.stories';
import { Canvas } from './Canvas';
import SourceStoriesMeta from './Source.stories';
const meta: Meta<typeof Canvas> = {
component: Canvas,
parameters: {
layout: 'fullscreen',
relativeCsfPaths: [
'../examples/Button.stories',
'../examples/CanvasParameters.stories',
'../examples/SourceParameters.stories',
],
snippets: {
'storybook-blocks-example-button--primary': {
code: dedent`
<Button
label="Button"
onClick={() => {}}
primary={true}
/>`,
},
},
docsStyles: true,
},
decorators: SourceStoriesMeta.decorators,
};
export default meta;
type Story = StoryObj<typeof meta>;
export const OfAttached: Story = {
args: {
of: ButtonStories.Primary,
},
};
export const OfUnattached: Story = {
args: {
of: ButtonStories.Primary,
},
parameters: { attached: false },
};
export const OfError: Story = {
args: {
of: ButtonStories.ErrorStory,
},
};
export const DefaultAttached: Story = {};
export const OfUndefined: Story = {
args: {
// @ts-expect-error this is supposed to be undefined
// eslint-disable-next-line import/namespace
of: ButtonStories.NotDefined,
},
parameters: { chromatic: { disableSnapshot: true } },
tags: ['!test'],
};
export const PropWithToolbar: Story = {
name: 'Prop withToolbar = true',
args: {
of: ButtonStories.Primary,
withToolbar: true,
},
};
export const PropAdditionalActions: Story = {
name: 'Prop additionalActions = [ ... ]',
args: {
of: ButtonStories.Primary,
additionalActions: [
{
title: 'Open in GitHub',
onClick: () => {
window.open(
'path_to_url
'_blank'
);
},
},
{
title: 'Go to documentation',
onClick: () => {
window.open(
'path_to_url#annotation',
'_blank'
);
},
},
],
},
};
export const PropSourceStateShown: Story = {
name: 'Prop sourceState = shown',
args: {
of: ButtonStories.Primary,
sourceState: 'shown',
},
};
export const PropSourceStateHidden: Story = {
name: 'Prop sourceState = hidden',
args: {
of: ButtonStories.Primary,
sourceState: 'hidden',
},
};
export const PropSourceStateNone: Story = {
name: 'Prop sourceState = none',
args: {
of: ButtonStories.Primary,
sourceState: 'none',
},
};
export const PropLayoutFullscreen: Story = {
name: 'Prop layout = fullscreen',
args: {
of: ButtonStories.Primary,
layout: 'fullscreen',
},
};
export const PropLayoutCentered: Story = {
name: 'Prop layout = centered',
args: {
of: ButtonStories.Primary,
layout: 'centered',
},
};
export const PropLayoutPadded: Story = {
name: 'Prop layout = padded',
args: {
of: ButtonStories.Primary,
layout: 'padded',
},
};
export const PropSource: Story = {
name: 'Prop source = { ... }',
args: {
of: ButtonStories.Primary,
source: {
language: 'html',
code: '<button> Button </button>', // spaces should be removed by the prettier formatter
format: 'html',
},
},
};
export const PropInlineStory: Story = {
name: 'Prop story = { ..., inline: true }',
args: {
of: ButtonStories.Primary,
story: { inline: false, height: '200px' },
},
};
export const PropAutoplayingStory: Story = {
name: 'Prop story = { ..., autoplay: true}',
args: {
of: ButtonStories.Clicking,
story: { autoplay: true },
},
};
const ClassNameStoryDescription = () => (
<p>
This story sets the <code>className</code> prop on the <code>Canvas</code> to{' '}
<code>my-custom-classname</code>, which will propagate to the preview element. To demonstrate
this, it also adds a <code>style</code> tag that sets another background color for that class:
</p>
);
export const PropClassName: Story = {
name: 'Prop className = my-custom-classname',
args: {
of: ButtonStories.Primary,
className: 'my-custom-classname',
},
render: (args) => (
<>
<ClassNameStoryDescription />
<style>
{`
.my-custom-classname {
background-color: #fd5c9355;
}
`}
</style>
<Canvas {...args} />
</>
),
};
export const ParameterWithToolbar: Story = {
name: 'parameters.docs.canvas.withToolbar = true',
args: {
of: ParameterStories.WithToolbar,
},
};
export const ParameterAdditionalActions: Story = {
name: 'parameters.docs.canvas.additionalActions = [ ... ]',
args: {
of: ParameterStories.AdditionalActions,
},
};
export const ParameterClassName: Story = {
name: 'parameters.docs.canvas.className = my-custom-classname',
args: {
of: ParameterStories.ClassName,
},
render: (args) => (
<>
<ClassNameStoryDescription />
<style>
{`
.my-custom-classname {
background-color: #fd5c9355;
}
`}
</style>
<Canvas {...args} />
</>
),
};
export const ParametersSourceStateShown: Story = {
name: 'parameters.docs.canvas.sourceState = shown',
args: {
of: ParameterStories.SourceStateShown,
},
};
export const ParametersSourceStateHidden: Story = {
name: 'parameters.docs.canvas.sourceState = hidden',
args: {
of: ParameterStories.SourceStateHidden,
},
};
export const ParametersSourceStateNone: Story = {
name: 'parameters.docs.canvas.sourceState = none',
args: {
of: ParameterStories.SourceStateNone,
},
};
export const ParameterDocsCanvasLayoutFullscreen: Story = {
name: 'parameters.docs.canvas.layout = fullscreen',
args: {
of: ParameterStories.DocsCanvasLayoutFullscreen,
},
};
export const ParameterDocsCanvasLayoutCentered: Story = {
name: 'parameters.docs.canvas.layout = centered',
args: {
of: ParameterStories.DocsCanvasLayoutCentered,
},
};
export const ParameterDocsCanvasLayoutPadded: Story = {
name: 'parameters.docs.canvas.layout = padded',
args: {
of: ParameterStories.DocsCanvasLayoutPadded,
},
};
export const ParameterLayoutFullscreen: Story = {
name: 'parameters.layout = fullscreen',
args: {
of: ParameterStories.LayoutFullscreen,
},
};
export const ParameterLayoutCentered: Story = {
name: 'parameters.layout = centered',
args: {
of: ParameterStories.LayoutCentered,
},
};
export const ParameterLayoutPadded: Story = {
name: 'parameters.layout = padded',
args: {
of: ParameterStories.LayoutPadded,
},
};
export const ParameterSource: Story = {
name: 'parameters.docs.source',
args: {
of: SourceParameterStories.CodeLanguage,
},
};
export const ParameterStory: Story = {
name: 'parameters.docs.story',
args: {
of: ParameterStories.StoryParameters,
},
};
``` | /content/code_sandbox/code/lib/blocks/src/blocks/Canvas.stories.tsx | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 1,715 |
```xml
// See LICENSE.txt for license information.
import {cleanUrlForLogging} from '@utils/url';
export default class ClientError extends Error {
url: string;
intl?: ClientErrorIntl;
server_error_id?: string;
status_code?: number;
details?: unknown;
constructor(baseUrl: string, data: ClientErrorProps) {
super(data.message + ': ' + cleanUrlForLogging(baseUrl, data.url));
this.message = data.message;
this.url = data.url;
this.intl = data.intl;
this.server_error_id = data.server_error_id;
this.status_code = data.status_code;
this.details = data.details;
// Ensure message is treated as a property of this class when object spreading. Without this,
// copying the object by using `{...error}` would not include the message.
Object.defineProperty(this, 'message', {enumerable: true});
}
}
``` | /content/code_sandbox/app/client/rest/error.ts | xml | 2016-10-07T16:52:32 | 2024-08-16T12:08:38 | mattermost-mobile | mattermost/mattermost-mobile | 2,155 | 192 |
```xml
import React from 'react';
import { Platform } from 'react-native';
import { useThemeProps } from '../../../hooks';
import Box from '../../primitives/Box';
import type { ICodeProps } from './types';
import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps';
const Code = ({ ...props }: ICodeProps, ref?: any) => {
let { ...newProps } = useThemeProps('Code', props);
//TODO: refactor for responsive prop
if (useHasResponsiveProps(props)) {
return null;
}
return (
<Box
_text={{
fontFamily: Platform.OS === 'ios' ? 'Courier' : 'monospace',
}}
{...newProps}
ref={ref}
/>
);
};
export type { ICodeProps };
export default React.memo(React.forwardRef(Code));
``` | /content/code_sandbox/src/components/composites/Code/index.tsx | xml | 2016-04-15T11:37:23 | 2024-08-14T16:16:44 | NativeBase | GeekyAnts/NativeBase | 20,132 | 182 |
```xml
<!-- Generated by bit-dual template v-8.11.0-pre-04 -->
<Project>
<PropertyGroup>
<LangVersion>12.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);CS1998;CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Net.Http" />
<Using Include="System.Resources" />
<Using Include="System.Text.Json.Serialization" />
<Using Include="System.ComponentModel.DataAnnotations" />
<Using Include="System.ComponentModel.DataAnnotations.Schema" />
<Using Include="Microsoft.Extensions.Configuration" />
<Using Include="Microsoft.Extensions.DependencyInjection" />
<Using Include="Bit.Websites.Careers.Shared.Enums" />
<Using Include="Bit.Websites.Careers.Shared.Dtos" />
<Using Include="Bit.Websites.Careers.Shared.Infra" />
<Using Include="Bit.Websites.Careers.Shared.Exceptions" />
<Using Include="Bit.Websites.Careers.Shared.Services.Contracts" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/src/Websites/Careers/src/Directory.Build.props | xml | 2016-10-19T14:23:48 | 2024-08-16T11:34:32 | bitplatform | bitfoundation/bitplatform | 1,051 | 266 |
```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 * as React from "react";
import { Button, CompoundTag, H5, Intent, Switch } from "@blueprintjs/core";
import { Example, type ExampleProps, handleBooleanChange } from "@blueprintjs/docs-theme";
import { IntentSelect } from "./common/intentSelect";
export interface CompoundTagExampleState {
active: boolean;
fill: boolean;
icon: boolean;
intent: Intent;
interactive: boolean;
large: boolean;
minimal: boolean;
removable: boolean;
rightIcon: boolean;
round: boolean;
tags: string[];
}
export class CompoundTagExample extends React.PureComponent<ExampleProps, CompoundTagExampleState> {
public state: CompoundTagExampleState = {
active: false,
fill: false,
icon: false,
intent: Intent.NONE,
interactive: false,
large: false,
minimal: false,
removable: false,
rightIcon: false,
round: false,
tags: INITIAL_TAGS,
};
private handleActiveChange = handleBooleanChange(active => this.setState({ active }));
private handleFillChange = handleBooleanChange(fill => this.setState({ fill }));
private handleIconChange = handleBooleanChange(icon => this.setState({ icon }));
private handleIntentChange = (intent: Intent) => this.setState({ intent });
private handleInteractiveChange = handleBooleanChange(interactive => this.setState({ interactive }));
private handleLargeChange = handleBooleanChange(large => this.setState({ large }));
private handleMinimalChange = handleBooleanChange(minimal => this.setState({ minimal }));
private handleRemovableChange = handleBooleanChange(removable => this.setState({ removable }));
private handleRightIconChange = handleBooleanChange(rightIcon => this.setState({ rightIcon }));
private handleRoundChange = handleBooleanChange(round => this.setState({ round }));
public render() {
const { icon, removable, rightIcon, tags, ...tagProps } = this.state;
const tagElements = tags.map(tag => {
const onRemove = () => this.setState({ tags: this.state.tags.filter(t => t !== tag) });
return (
<CompoundTag
key={tag}
leftContent="City"
onRemove={removable && onRemove}
icon={icon === true ? "globe" : undefined}
rightIcon={rightIcon === true ? "map-marker" : undefined}
{...tagProps}
>
{tag}
</CompoundTag>
);
});
return (
<Example options={this.renderOptions()} {...this.props}>
{tagElements}
</Example>
);
}
private renderOptions() {
const { active, fill, icon, intent, interactive, large, minimal, removable, rightIcon, round } = this.state;
return (
<>
<H5>Props</H5>
<Switch label="Active" checked={active} onChange={this.handleActiveChange} />
<Switch label="Fill" checked={fill} onChange={this.handleFillChange} />
<Switch label="Large" checked={large} onChange={this.handleLargeChange} />
<Switch label="Minimal" checked={minimal} onChange={this.handleMinimalChange} />
<Switch label="Interactive" checked={interactive} onChange={this.handleInteractiveChange} />
<Switch label="Removable" checked={removable} onChange={this.handleRemovableChange} />
<Switch label="Round" checked={round} onChange={this.handleRoundChange} />
<Switch label="Left icon" checked={icon} onChange={this.handleIconChange} />
<Switch label="Right icon" checked={rightIcon} onChange={this.handleRightIconChange} />
<IntentSelect intent={intent} onChange={this.handleIntentChange} />
<H5>Example</H5>
<Button icon="refresh" text="Reset tags" onClick={this.resetCompoundTags} />
</>
);
}
private resetCompoundTags = () => this.setState({ tags: INITIAL_TAGS });
}
const INITIAL_TAGS = ["London", "New York", "San Francisco", "Seattle"];
``` | /content/code_sandbox/packages/docs-app/src/examples/core-examples/compoundTagExample.tsx | xml | 2016-10-25T21:17:50 | 2024-08-16T15:14:48 | blueprint | palantir/blueprint | 20,593 | 905 |
```xml
import { DialectOptions } from '../../dialect.js';
import { expandPhrases } from '../../expandPhrases.js';
import { functions } from './sqlite.functions.js';
import { dataTypes, keywords } from './sqlite.keywords.js';
const reservedSelect = expandPhrases(['SELECT [ALL | DISTINCT]']);
const reservedClauses = expandPhrases([
// queries
'WITH [RECURSIVE]',
'FROM',
'WHERE',
'GROUP BY',
'HAVING',
'WINDOW',
'PARTITION BY',
'ORDER BY',
'LIMIT',
'OFFSET',
// Data manipulation
// - insert:
'INSERT [OR ABORT | OR FAIL | OR IGNORE | OR REPLACE | OR ROLLBACK] INTO',
'REPLACE INTO',
'VALUES',
// - update:
'SET',
]);
const standardOnelineClauses = expandPhrases(['CREATE [TEMPORARY | TEMP] TABLE [IF NOT EXISTS]']);
const tabularOnelineClauses = expandPhrases([
// - create:
'CREATE [TEMPORARY | TEMP] VIEW [IF NOT EXISTS]',
// - update:
'UPDATE [OR ABORT | OR FAIL | OR IGNORE | OR REPLACE | OR ROLLBACK]',
// - insert:
'ON CONFLICT',
// - delete:
'DELETE FROM',
// - drop table:
'DROP TABLE [IF EXISTS]',
// - alter table:
'ALTER TABLE',
'ADD [COLUMN]',
'DROP [COLUMN]',
'RENAME [COLUMN]',
'RENAME TO',
// - set schema
'SET SCHEMA',
]);
const reservedSetOperations = expandPhrases(['UNION [ALL]', 'EXCEPT', 'INTERSECT']);
// joins - path_to_url
const reservedJoins = expandPhrases([
'JOIN',
'{LEFT | RIGHT | FULL} [OUTER] JOIN',
'{INNER | CROSS} JOIN',
'NATURAL [INNER] JOIN',
'NATURAL {LEFT | RIGHT | FULL} [OUTER] JOIN',
]);
const reservedPhrases = expandPhrases([
'ON {UPDATE | DELETE} [SET NULL | SET DEFAULT]',
'{ROWS | RANGE | GROUPS} BETWEEN',
]);
export const sqlite: DialectOptions = {
name: 'sqlite',
tokenizerOptions: {
reservedSelect,
reservedClauses: [...reservedClauses, ...standardOnelineClauses, ...tabularOnelineClauses],
reservedSetOperations,
reservedJoins,
reservedPhrases,
reservedKeywords: keywords,
reservedDataTypes: dataTypes,
reservedFunctionNames: functions,
stringTypes: [
"''-qq",
{ quote: "''-raw", prefixes: ['X'], requirePrefix: true },
// Depending on context SQLite also supports double-quotes for strings,
// and single-quotes for identifiers.
],
identTypes: [`""-qq`, '``', '[]'],
// path_to_url#parameters
paramTypes: { positional: true, numbered: ['?'], named: [':', '@', '$'] },
operators: ['%', '~', '&', '|', '<<', '>>', '==', '->', '->>', '||'],
},
formatOptions: {
onelineClauses: [...standardOnelineClauses, ...tabularOnelineClauses],
tabularOnelineClauses,
},
};
``` | /content/code_sandbox/src/languages/sqlite/sqlite.formatter.ts | xml | 2016-09-12T13:09:04 | 2024-08-16T10:30:12 | sql-formatter | sql-formatter-org/sql-formatter | 2,272 | 736 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-->
<LWM2M xmlns:xsi="path_to_url"
xsi:noNamespaceSchemaLocation="path_to_url">
<Object ObjectType="MODefinition">
<Name>Water quality sensor</Name>
<Description1>The uCIFI water quality sensor measures the quality of the water in the drinkable water distribution network, in water tanks or in lakes and rivers.</Description1>
<ObjectID>3426</ObjectID>
<ObjectURN>urn:oma:lwm2m:ext:3426</ObjectURN>
<LWM2MVersion>1.0</LWM2MVersion>
<ObjectVersion>1.0</ObjectVersion>
<MultipleInstances>Multiple</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Resources>
<Item ID="1">
<Name>pH</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units></Units>
<Description>Current or last value of the pH measured by the sensor.</Description>
</Item>
<Item ID="2">
<Name>Chlorine</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>ppm</Units>
<Description>Current or last value of the chlorine measured by the sensor.</Description>
</Item>
<Item ID="3">
<Name>Redox or ORP</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>V</Units>
<Description>Current or last value of the oxidation reduction potential measured by the sensor.</Description>
</Item>
<Item ID="4">
<Name>Total dissolved gas or TDG</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>ppm</Units>
<Description>Current or last value of the dissolved gas measured by the sensor.</Description>
</Item>
<Item ID="5">
<Name>Dissolved oxygen</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>ppm</Units>
<Description>Current or last value of the dissolved oxygen measured by the sensor.</Description>
</Item>
<Item ID="6">
<Name>Turbidity</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>NTU</Units>
<Description>Current or last value of the turbidity measured by the sensor using the Nephelometric Turbidity Unit (NTU).</Description>
</Item>
<Item ID="7">
<Name>Conductivity</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>S/m</Units>
<Description>Current or last value of the conductivity measured by the sensor.</Description>
</Item>
<Item ID="8">
<Name>Conductance</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>S/m</Units>
<Description>Current or last value of the conductance measured by the sensor.</Description>
</Item>
<Item ID="9">
<Name>Total suspended solids</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>mg/l</Units>
<Description>Current or last value of the TSS measured by the sensor.</Description>
</Item>
<Item ID="10">
<Name>Total dissolved solids</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>mg/l</Units>
<Description>Current or last value of the TDS measured by the sensor.</Description>
</Item>
<Item ID="11">
<Name>Salinity</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>ppt</Units>
<Description>Current or last value of the salinity measured by the sensor.</Description>
</Item>
<Item ID="12">
<Name>NO3</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>mg/l</Units>
<Description>Current or last value of NO3 measured by the sensor.</Description>
</Item>
<Item ID="13">
<Name>NH3</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>mg/l</Units>
<Description>Current or last value of NH3 measured by the sensor.</Description>
</Item>
<Item ID="14">
<Name>NH4</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration></RangeEnumeration>
<Units>mg/l</Units>
<Description>Current or last value of NH4 measured by the sensor.</Description>
</Item>
</Resources>
<Description2></Description2>
</Object>
</LWM2M>
``` | /content/code_sandbox/application/src/main/data/lwm2m-registry/3426.xml | xml | 2016-12-01T09:33:30 | 2024-08-16T19:58:25 | thingsboard | thingsboard/thingsboard | 16,820 | 1,870 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="tools_height">30dp</dimen>
</resources>
``` | /content/code_sandbox/app/src/main/res/values-h720dp/dimension.xml | xml | 2016-05-11T20:50:11 | 2024-08-16T11:41:39 | TUI-ConsoleLauncher | fandreuz/TUI-ConsoleLauncher | 1,233 | 36 |
```xml
import { mergeClasses } from '@expo/styleguide';
import { CornerDownRightIcon } from '@expo/styleguide-icons/outline/CornerDownRightIcon';
import { APIDataType } from '~/components/plugins/api/APIDataType';
import {
AccessorDefinitionData,
MethodDefinitionData,
PropData,
} from '~/components/plugins/api/APIDataTypes';
import { APISectionDeprecationNote } from '~/components/plugins/api/APISectionDeprecationNote';
import { APISectionPlatformTags } from '~/components/plugins/api/APISectionPlatformTags';
import {
CommentTextBlock,
getMethodName,
renderParams,
resolveTypeName,
STYLES_APIBOX,
STYLES_APIBOX_NESTED,
STYLES_NOT_EXPOSED_HEADER,
getH3CodeWithBaseNestingLevel,
getTagData,
getAllTagData,
} from '~/components/plugins/api/APISectionUtils';
import { ELEMENT_SPACING } from '~/components/plugins/api/styles';
import { CALLOUT, H2, MONOSPACE } from '~/ui/components/Text';
export type APISectionMethodsProps = {
data: (MethodDefinitionData | PropData)[];
sdkVersion: string;
apiName?: string;
header?: string;
exposeInSidebar?: boolean;
};
export type RenderMethodOptions = {
apiName?: string;
sdkVersion: string;
header?: string;
exposeInSidebar?: boolean;
baseNestingLevel?: number;
};
function getMethodRootSignatures(method: MethodDefinitionData | AccessorDefinitionData | PropData) {
if ('signatures' in method) {
return method.signatures ?? [];
}
if ('getSignature' in method) {
return method.getSignature ? [method.getSignature] : [];
}
if ('type' in method) {
if (method?.type?.declaration?.signatures) {
if (method.type.declaration.name === '__type') {
return method.type.declaration.signatures.map(signature => ({
...signature,
comment: method.comment,
}));
}
return method.type.declaration.signatures ?? [];
}
}
return [];
}
export const renderMethod = (
method: MethodDefinitionData | AccessorDefinitionData | PropData,
{ apiName, exposeInSidebar = true, sdkVersion, ...options }: RenderMethodOptions
) => {
const signatures = getMethodRootSignatures(method);
const baseNestingLevel = options.baseNestingLevel ?? (exposeInSidebar ? 3 : 4);
const HeaderComponent = getH3CodeWithBaseNestingLevel(baseNestingLevel);
return signatures.map(({ name, parameters, comment, type, typeParameter }) => {
const returnComment = getTagData('returns', comment);
return (
<div
key={`method-signature-${method.name || name}-${parameters?.length || 0}`}
css={[STYLES_APIBOX, STYLES_APIBOX_NESTED]}>
<APISectionDeprecationNote comment={comment} sticky />
<APISectionPlatformTags comment={comment} />
<HeaderComponent>
<MONOSPACE
weight="medium"
css={!exposeInSidebar && STYLES_NOT_EXPOSED_HEADER}
className="wrap-anywhere">
{getMethodName(
method as MethodDefinitionData,
apiName,
name,
parameters,
typeParameter
)}
</MONOSPACE>
</HeaderComponent>
{parameters && parameters.length > 0 && (
<>
{renderParams(parameters, sdkVersion)}
<br />
</>
)}
<CommentTextBlock
comment={comment}
includePlatforms={false}
afterContent={
type && resolveTypeName(type, sdkVersion) !== 'undefined' ? (
<>
<div
className={mergeClasses(
'flex flex-row gap-2 items-start',
!returnComment && getAllTagData('example', comment) && ELEMENT_SPACING
)}>
<div className="flex flex-row gap-2 items-center">
<CornerDownRightIcon className="inline-block icon-sm text-icon-secondary" />
<CALLOUT tag="span" theme="secondary" weight="medium">
Returns:
</CALLOUT>
</div>
<CALLOUT>
<APIDataType typeDefinition={type} sdkVersion={sdkVersion} />
</CALLOUT>
</div>
{returnComment ? (
<div className="flex flex-col mt-1.5 mb-1 pl-6">
<CommentTextBlock comment={{ summary: returnComment.content }} />
</div>
) : undefined}
</>
) : undefined
}
/>
{}
</div>
);
});
};
const APISectionMethods = ({
data,
sdkVersion,
apiName,
header = 'Methods',
exposeInSidebar = true,
}: APISectionMethodsProps) =>
data?.length ? (
<>
<H2 key={`${header}-header`}>{header}</H2>
{data.map((method: MethodDefinitionData | PropData) =>
renderMethod(method, { apiName, sdkVersion, header, exposeInSidebar })
)}
</>
) : null;
export default APISectionMethods;
``` | /content/code_sandbox/docs/components/plugins/api/APISectionMethods.tsx | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 1,109 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~
~ path_to_url
~
~ Unless required by applicable law or agreed to in writing, software
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-->
<sql-parser-test-cases>
<alter-tablespace sql-case-id="alter_tablespace_rename">
<tablespace start-index="17" stop-index="19" name="ts1" />
<rename start-index="31" stop-index="33" name="ts2" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_read_only">
<tablespace start-index="17" stop-index="19" name="ts1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_read_write">
<tablespace start-index="17" stop-index="23" name="sales_1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_add_datafile">
<tablespace start-index="17" stop-index="19" name="ts1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_add_datafile_autoextend_next_maxsize_unlimited">
<tablespace start-index="17" stop-index="26" name="undotbs_01" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_add_datafile_size_autoextend_next_maxsize">
<tablespace start-index="17" stop-index="22" name="tbs_03" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_add_datafile_size_reuse">
<tablespace start-index="17" stop-index="22" name="stocks" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_add_tempfile_size_autoextend">
<tablespace start-index="17" stop-index="25" name="temp_demo" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_shrink_tempfile">
<tablespace start-index="17" stop-index="19" name="ts1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_shrink_space">
<tablespace start-index="17" stop-index="25" name="temp_demo" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_shrink_space_keep">
<tablespace start-index="17" stop-index="23" name="lmtemp1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_drop_tempfile">
<tablespace start-index="17" stop-index="19" name="ts1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_drop_datafile">
<tablespace start-index="17" stop-index="19" name="ts1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_group_newname">
<tablespace start-index="17" stop-index="23" name="lmtemp2" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_group_empty">
<tablespace start-index="17" stop-index="23" name="lmtemp3" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_begin_backup">
<tablespace start-index="17" stop-index="22" name="tbs_01" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_end_backup">
<tablespace start-index="17" stop-index="21" name="users" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_online">
<tablespace start-index="17" stop-index="22" name="tbs_02" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_offline">
<tablespace start-index="17" stop-index="21" name="tbs_4" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_offline_normal">
<tablespace start-index="17" stop-index="21" name="users" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_offline_immediate">
<tablespace start-index="17" stop-index="21" name="users" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_offline_temporary">
<tablespace start-index="17" stop-index="21" name="users" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_flashback_off">
<tablespace start-index="17" stop-index="21" name="tbs_3" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_flashback_on">
<tablespace start-index="17" stop-index="21" name="tbs_3" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_retention_guarantee">
<tablespace start-index="17" stop-index="23" name="undots1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_retention_noguarantee">
<tablespace start-index="17" stop-index="23" name="undots1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_rename_datafile">
<tablespace start-index="17" stop-index="22" name="tbs_02" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_rename_datafile_single">
<tablespace start-index="17" stop-index="21" name="users" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_rename_datafile_multiple">
<tablespace start-index="17" stop-index="21" name="users" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_autoextend_on_next_g">
<tablespace start-index="17" stop-index="22" name="bigtbs" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_add_datafile_size_m">
<tablespace start-index="17" stop-index="22" name="lmtbsb" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_nologging">
<tablespace start-index="17" stop-index="22" name="tbs_03" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_add_tempfile_size_m_reuse">
<tablespace start-index="17" stop-index="22" name="lmtemp" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_with_initial_size">
<tablespace start-index="17" stop-index="20" name="ts_1" />
</alter-tablespace>
<alter-tablespace sql-case-id="alter_tablespace_with_engine_attribute">
<tablespace start-index="17" stop-index="19" name="ts1" />
</alter-tablespace>
</sql-parser-test-cases>
``` | /content/code_sandbox/test/it/parser/src/main/resources/case/ddl/alter-tablespace.xml | xml | 2016-01-18T12:49:26 | 2024-08-16T15:48:11 | shardingsphere | apache/shardingsphere | 19,707 | 1,673 |
```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"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/head"
android:layout_width="35dp"
android:layout_height="35dp"
android:scaleType="fitXY"
android:src="@drawable/head1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:gravity="center"
android:text="Peter Allan"
android:textColor="#111"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:gravity="center"
android:text="Feb 14th"
android:textColor="#aaa"
android:textSize="12sp" />
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_marginBottom="3dp"
android:scaleType="fitXY"
android:src="@drawable/like" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:lineSpacingExtra="6dp"
android:maxLines="3"
android:text="The federal beach atc requires states that receive funding to develop a risk-baseed beach evaluation and classification plan and apply it to the big environment..."
android:textSize="13sp" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="10dp"
android:background="#cccccc" />
</LinearLayout>
``` | /content/code_sandbox/android-page-transition/app/src/main/res/layout/detail_list_item.xml | xml | 2016-09-19T05:38:45 | 2024-08-05T10:12:07 | ViewpagerTransition | xmuSistone/ViewpagerTransition | 3,038 | 496 |
```xml
import { Entity } from "../../../../../src/decorator/entity/Entity"
import { Column } from "../../../../../src/decorator/columns/Column"
import { PrimaryGeneratedColumn } from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"
import { PostDetails } from "./PostDetails"
import { OneToOne } from "../../../../../src/decorator/relations/OneToOne"
import { JoinColumn } from "../../../../../src/decorator/relations/JoinColumn"
@Entity()
export class Post {
@PrimaryGeneratedColumn()
id: number
@OneToOne((type) => PostDetails)
@JoinColumn()
details: PostDetails
@Column()
title: string
}
``` | /content/code_sandbox/test/functional/relations/relation-mapped-to-different-name-column/entity/Post.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 145 |
```xml
<vector xmlns:android="path_to_url"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M2.5,4v3h5v12h3L10.5,7h5L15.5,4h-13zM21.5,9h-9v3h3v7h3v-7h3L21.5,9z"/>
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/ic_text.xml | xml | 2016-08-13T08:08:39 | 2024-08-06T13:58:48 | open-event-organizer-android | fossasia/open-event-organizer-android | 1,783 | 129 |
```xml
const commonParams = `
$searchValue: String
$perPage: Int
$page: Int
`;
const commonParamsDef = `
searchValue: $searchValue
perPage: $perPage
page: $page
`;
const operations = `
query Operations(${commonParams}) {
operations(${commonParamsDef}) {
_id
code
order
createdAt
description
modifiedAt
name
teamMemberIds
parentId
}
}
`;
const operationsTotalCount = `
query OpeartionsTotalCount (${commonParams}) {
operationsTotalCount(${commonParamsDef})
}
`;
const operation = `
query Operation {
operation {
_id
code
createdAt
description
modifiedAt
name
}
}
`;
export default {
operation,
operations,
operationsTotalCount
};
``` | /content/code_sandbox/packages/plugin-riskassessment-ui/src/operations/graphql/queries.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 188 |
```xml
import {CollectionOf, Groups, Property} from "@tsed/schema";
export class Photo {
@Property(() => User)
owner: User;
}
export class User {
@CollectionOf(Photo)
@Groups("group.roles")
photos: Photo[];
}
``` | /content/code_sandbox/docs/docs/snippets/model/circular-references.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 56 |
```xml
import { AddGroupAction } from '../actions/groups';
import { ClearChoicesAction } from '../actions/choices';
import { Group } from '../interfaces/group';
import { State } from '../interfaces/state';
export declare const defaultState: never[];
type ActionTypes = AddGroupAction | ClearChoicesAction | Record<string, never>;
export default function groups(state?: Group[], action?: ActionTypes): State['groups'];
export {};
//# sourceMappingURL=groups.d.ts.map
``` | /content/code_sandbox/public/types/src/scripts/reducers/groups.d.ts | xml | 2016-03-15T14:02:08 | 2024-08-15T07:08:50 | Choices | Choices-js/Choices | 6,092 | 91 |
```xml
import type { ChangeEvent, FocusEvent } from 'react';
import React, { useState } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import type { ModalStateProps } from '@proton/components';
import {
InputFieldTwo,
ModalTwo,
ModalTwoContent,
ModalTwoFooter,
ModalTwoHeader,
PrimaryButton,
useFormErrors,
useModalTwoStatic,
} from '@proton/components';
import { useLoading } from '@proton/hooks';
import noop from '@proton/utils/noop';
import useActiveShare from '../../hooks/drive/useActiveShare';
import { formatLinkName, useActions, validateLinkNameField } from '../../store';
interface Props {
onClose?: () => void;
onCreateDone?: (folderId: string) => void;
folder?: { shareId: string; linkId: string };
}
const CreateFolderModal = ({ onClose, folder, onCreateDone, ...modalProps }: Props & ModalStateProps) => {
const { activeFolder } = useActiveShare();
const { createFolder } = useActions();
const [folderName, setFolderName] = useState('');
const [loading, withLoading] = useLoading();
const { validator, onFormSubmit } = useFormErrors();
const handleBlur = ({ target }: FocusEvent<HTMLInputElement>) => {
setFolderName(formatLinkName(target.value));
};
const handleChange = ({ target }: ChangeEvent<HTMLInputElement>) => {
setFolderName(target.value);
};
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (!onFormSubmit()) {
return;
}
const formattedName = formatLinkName(folderName);
setFolderName(formattedName);
const parentFolder = folder || activeFolder;
if (!parentFolder) {
return;
}
const folderId = await createFolder(
new AbortController().signal,
parentFolder.shareId,
parentFolder.linkId,
formattedName
);
onCreateDone?.(folderId);
onClose?.();
};
return (
<ModalTwo
as="form"
disableCloseOnEscape={loading}
onClose={onClose}
onSubmit={(e: React.FormEvent) => withLoading(handleSubmit(e)).catch(noop)}
size="large"
{...modalProps}
>
<ModalTwoHeader closeButtonProps={{ disabled: loading }} title={c('Title').t`Create a new folder`} />
<ModalTwoContent>
<InputFieldTwo
id="folder-name"
autoFocus
value={folderName}
label={c('Label').t`Folder name`}
placeholder={c('Placeholder').t`Enter a new folder name`}
onChange={handleChange}
onBlur={handleBlur}
error={validator([validateLinkNameField(folderName) || ''])}
data-testid="input-new-folder-name"
required
/>
</ModalTwoContent>
<ModalTwoFooter>
<Button type="button" onClick={onClose} disabled={loading}>
{c('Action').t`Cancel`}
</Button>
<PrimaryButton type="submit" loading={loading}>
{c('Action').t`Create`}
</PrimaryButton>
</ModalTwoFooter>
</ModalTwo>
);
};
export default CreateFolderModal;
export const useCreateFolderModal = () => {
return useModalTwoStatic(CreateFolderModal);
};
``` | /content/code_sandbox/applications/drive/src/app/components/modals/CreateFolderModal.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 736 |
```xml
export * from 'rxjs-compat/observable/fromIterable';
``` | /content/code_sandbox/deps/node-10.15.3/tools/node_modules/eslint/node_modules/rxjs/observable/fromIterable.d.ts | xml | 2016-09-05T10:18:44 | 2024-08-11T13:21:40 | LiquidCore | LiquidPlayer/LiquidCore | 1,010 | 13 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="mobi.acpm.inspeckage.ui.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
<!--android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_dialog_email" /-->
</android.support.design.widget.CoordinatorLayout>
``` | /content/code_sandbox/app/src/main/res/layout/app_bar_main.xml | xml | 2016-02-28T22:59:51 | 2024-08-15T00:26:58 | Inspeckage | ac-pm/Inspeckage | 2,789 | 295 |
```xml
import { getModuleBuildInfo } from '../get-module-build-info'
import { stringifyRequest } from '../../stringify-request'
import type { NextConfig } from '../../../../server/config-shared'
import type { webpack } from 'next/dist/compiled/webpack/webpack'
import { WEBPACK_RESOURCE_QUERIES } from '../../../../lib/constants'
import type { MiddlewareConfig } from '../../../analysis/get-page-static-info'
import { loadEntrypoint } from '../../../load-entrypoint'
export type EdgeAppRouteLoaderQuery = {
absolutePagePath: string
page: string
appDirLoader: string
preferredRegion: string | string[] | undefined
nextConfigOutput: NextConfig['output']
middlewareConfig: string
}
const EdgeAppRouteLoader: webpack.LoaderDefinitionFunction<EdgeAppRouteLoaderQuery> =
async function (this) {
const {
page,
absolutePagePath,
preferredRegion,
appDirLoader: appDirLoaderBase64 = '',
middlewareConfig: middlewareConfigBase64 = '',
} = this.getOptions()
const appDirLoader = Buffer.from(appDirLoaderBase64, 'base64').toString()
const middlewareConfig: MiddlewareConfig = JSON.parse(
Buffer.from(middlewareConfigBase64, 'base64').toString()
)
// Ensure we only run this loader for as a module.
if (!this._module) throw new Error('This loader is only usable as a module')
const buildInfo = getModuleBuildInfo(this._module)
buildInfo.nextEdgeSSR = {
isServerComponent: false,
page: page,
isAppDir: true,
}
buildInfo.route = {
page,
absolutePagePath,
preferredRegion,
middlewareConfig,
}
const stringifiedPagePath = stringifyRequest(this, absolutePagePath)
const modulePath = `${appDirLoader}${stringifiedPagePath.substring(
1,
stringifiedPagePath.length - 1
)}?${WEBPACK_RESOURCE_QUERIES.edgeSSREntry}`
return await loadEntrypoint('edge-app-route', {
VAR_USERLAND: modulePath,
})
}
export default EdgeAppRouteLoader
``` | /content/code_sandbox/packages/next/src/build/webpack/loaders/next-edge-app-route-loader/index.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 460 |
```xml
/**
* @jest-environment node
*/
/* eslint-disable jest/no-conditional-expect */
// @ts-nocheck
import { ipcRenderer } from 'electron';
import DatabaseService from 'main/services/database.service';
import IPCService from 'main/services/ipc.service';
import 'reflect-metadata';
import {
ConnectArguments,
ConnectRequest,
ConnectResponse,
DeleteRequest,
DeleteResponse,
InsertRequest,
InsertResponse,
ReadDataRequest,
ReadDataResponse,
ReadWidgetDataRequest,
ReadWidgetDataResponse,
TableInfoRequest,
TablesListRequest,
TablesListResponse,
UpdateRequest,
UpdateResponse,
} from '@electrocrud/shared';
import {
IPCChannelEnum,
QueryAggregateEnum,
ServerTypeEnum,
} from 'shared/enums';
import { container } from 'tsyringe';
const ipc = container.resolve(IPCService);
const database = container.resolve(DatabaseService);
beforeAll(() => ipc.listen());
afterAll(async () => {
ipc.disconnect();
await database.disconnect();
});
describe('Main IPC Service', () => {
test('connect', async () => {
const body: ConnectArguments = {
client: ServerTypeEnum.SQLITE,
connection: {
filename: 'src/__tests__/data/database.db',
},
};
const response: ConnectResponse = await ipcRenderer.invoke(
IPCChannelEnum.CONNECT,
{
channel: IPCChannelEnum.CONNECT,
body,
} as ConnectRequest
);
expect(response.channel).toEqual(IPCChannelEnum.CONNECT);
expect(response.body).toBeTruthy();
});
test('tables list', async () => {
const response: TablesListResponse = await ipcRenderer.invoke(
IPCChannelEnum.TABLES_LIST,
{
channel: IPCChannelEnum.TABLES_LIST,
} as TablesListRequest
);
expect(response.channel).toEqual(IPCChannelEnum.TABLES_LIST);
expect(response.body).toEqual([
'albums',
'sqlite_sequence',
'artists',
'customers',
'employees',
'genres',
'invoices',
'invoice_items',
'media_types',
'playlists',
'playlist_track',
'tracks',
'sqlite_stat1',
]);
});
test('table info', async () => {
const response: TablesListResponse = await ipcRenderer.invoke(
IPCChannelEnum.TABLE_INFO,
{
channel: IPCChannelEnum.TABLE_INFO,
body: 'albums',
} as TableInfoRequest
);
expect(response.channel).toEqual(IPCChannelEnum.TABLE_INFO);
expect(response.body).toEqual([
{
col_id: 0,
name: 'AlbumId',
table_name: 'albums',
type: 'INTEGER',
key: 1,
default: null,
nullable: 1,
length: 0,
extra: '',
},
{
col_id: 1,
name: 'Title',
table_name: 'albums',
type: 'NVARCHAR(160)',
key: 0,
default: null,
nullable: 1,
length: 0,
extra: '',
},
{
col_id: 2,
name: 'ArtistId',
table_name: 'albums',
type: 'INTEGER',
key: 0,
default: null,
nullable: 1,
length: 0,
extra: '',
},
]);
});
test('read data', async () => {
const response: ReadDataResponse = await ipcRenderer.invoke(
IPCChannelEnum.READ_DATA,
{
channel: IPCChannelEnum.READ_DATA,
body: {
table: 'genres',
columns: ['GenreId', 'Name'],
limit: 1,
offset: 0,
},
} as ReadDataRequest
);
expect(response.channel).toEqual(IPCChannelEnum.READ_DATA);
expect(response.body.count).toEqual(25);
expect(response.body.data).toEqual([{ GenreId: 1, Name: 'Rock' }]);
});
test.each([
{ column: '*', func: QueryAggregateEnum.COUNT, data: 25 },
{ column: 'GenreId', func: QueryAggregateEnum.COUNT_DISTINCT, data: 25 },
{ column: 'GenreId', func: QueryAggregateEnum.SUM, data: 325 },
{ column: 'GenreId', func: QueryAggregateEnum.SUM_DISTINCT, data: 325 },
{ column: 'GenreId', func: QueryAggregateEnum.MIN, data: 1 },
{ column: 'GenreId', func: QueryAggregateEnum.MAX, data: 25 },
{ column: 'GenreId', func: QueryAggregateEnum.AVG, data: 13 },
{ column: 'GenreId', func: QueryAggregateEnum.AVG_DISTINCT, data: 13 },
])(
'read data widget data, column $column, function $func',
async ({ column, func, data }) => {
const response: ReadWidgetDataResponse = await ipcRenderer.invoke(
IPCChannelEnum.READ_WIDGET_DATA,
{
channel: IPCChannelEnum.READ_WIDGET_DATA,
body: {
table: 'genres',
column,
func,
},
} as ReadWidgetDataRequest
);
expect(response.body.data).toEqual(data);
}
);
test('insert data', async () => {
await database.executeQuery('delete from albums');
const response: InsertResponse = await ipcRenderer.invoke(
IPCChannelEnum.INSERT_DATA,
{
channel: IPCChannelEnum.INSERT_DATA,
body: {
table: 'albums',
data: { AlbumId: 10, ArtistId: 10, Title: 'test 2' },
},
} as InsertRequest
);
expect(response.channel).toEqual(IPCChannelEnum.INSERT_DATA);
expect(response.body).toBeTruthy();
});
test('insert data (multiple)', async () => {
const response: InsertResponse = await ipcRenderer.invoke(
IPCChannelEnum.INSERT_DATA,
{
channel: IPCChannelEnum.INSERT_DATA,
body: {
table: 'albums',
data: [
{ AlbumId: 11, ArtistId: 11, Title: 'test 4' },
{ AlbumId: 12, ArtistId: 12, Title: 'test 5' },
],
},
} as InsertRequest
);
expect(response.channel).toEqual(IPCChannelEnum.INSERT_DATA);
expect(response.body).toBeTruthy();
});
test('update data', async () => {
const response: UpdateResponse = await ipcRenderer.invoke(
IPCChannelEnum.UPDATE_DATA,
{
channel: IPCChannelEnum.UPDATE_DATA,
body: {
table: 'albums',
update: { Title: 'test 3' },
where: [{ column: 'AlbumId', value: 10, opr: '=', or: false }],
},
} as UpdateRequest
);
expect(response.channel).toEqual(IPCChannelEnum.UPDATE_DATA);
expect(response.body).toBeTruthy();
});
test('delete data', async () => {
const response: DeleteResponse = await ipcRenderer.invoke(
IPCChannelEnum.DELETE_DATA,
{
channel: IPCChannelEnum.DELETE_DATA,
body: {
table: 'albums',
where: [{ column: 'AlbumId', value: 10, opr: '=', or: false }],
},
} as DeleteRequest
);
expect(response.channel).toEqual(IPCChannelEnum.DELETE_DATA);
expect(response.body).toBeTruthy();
});
});
``` | /content/code_sandbox/src/__tests__/main/services/ipc.service.test.ts | xml | 2016-05-14T02:18:49 | 2024-08-16T02:46:28 | ElectroCRUD | garrylachman/ElectroCRUD | 1,538 | 1,605 |
```xml
<!--
// THE CODE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-->
<ResourceDictionary xmlns="path_to_url"
xmlns:x="path_to_url"
xmlns:local="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:localprimitives="using:Microsoft.Toolkit.Uwp.UI.Controls.Primitives">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="InvalidBrush" Color="#FFFF00"/>
<SolidColorBrush x:Key="FillerGridLinesBrush" Color="Transparent"/>
<StaticResource x:Key="ScrollBarsSeparatorBackground" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderForegroundBrush" ResourceKey="SystemControlForegroundBaseMediumBrush"/>
<StaticResource x:Key="DataGridColumnHeaderBackgroundColor" ResourceKey="SystemAltHighColor"/>
<SolidColorBrush x:Key="DataGridColumnHeaderBackgroundBrush" Color="{StaticResource DataGridColumnHeaderBackgroundColor}"/>
<StaticResource x:Key="DataGridColumnHeaderHoveredBackgroundColor" ResourceKey="SystemListLowColor"/>
<StaticResource x:Key="DataGridColumnHeaderPressedBackgroundColor" ResourceKey="SystemListMediumColor"/>
<StaticResource x:Key="DataGridColumnHeaderDraggedBackgroundBrush" ResourceKey="SystemControlBackgroundChromeMediumLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderPointerOverBrush" ResourceKey="SystemControlHighlightListLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderPressedBrush" ResourceKey="SystemControlHighlightListMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderBackgroundBrush" ResourceKey="SystemControlBackgroundChromeMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderPressedBackgroundBrush" ResourceKey="SystemControlBackgroundListMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="DataGridRowHoveredBackgroundColor" ResourceKey="SystemListLowColor"/>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="InvalidBrush" Color="#FFFF00"/>
<SolidColorBrush x:Key="FillerGridLinesBrush" Color="Transparent"/>
<StaticResource x:Key="ScrollBarsSeparatorBackground" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderForegroundBrush" ResourceKey="SystemControlForegroundBaseMediumBrush"/>
<StaticResource x:Key="DataGridColumnHeaderBackgroundColor" ResourceKey="SystemAltHighColor"/>
<SolidColorBrush x:Key="DataGridColumnHeaderBackgroundBrush" Color="{StaticResource DataGridColumnHeaderBackgroundColor}"/>
<StaticResource x:Key="DataGridColumnHeaderHoveredBackgroundColor" ResourceKey="SystemListLowColor"/>
<StaticResource x:Key="DataGridColumnHeaderPressedBackgroundColor" ResourceKey="SystemListMediumColor"/>
<StaticResource x:Key="DataGridColumnHeaderDraggedBackgroundBrush" ResourceKey="SystemControlBackgroundChromeMediumLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderPointerOverBrush" ResourceKey="SystemControlHighlightListLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderPressedBrush" ResourceKey="SystemControlHighlightListMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderBackgroundBrush" ResourceKey="SystemControlBackgroundChromeMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderPressedBackgroundBrush" ResourceKey="SystemControlBackgroundListMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="DataGridRowHoveredBackgroundColor" ResourceKey="SystemListLowColor"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="InvalidBrush" Color="#C50500"/>
<SolidColorBrush x:Key="FillerGridLinesBrush" Color="Transparent"/>
<SolidColorBrush x:Key="ScrollBarsSeparatorBackground" Color="{StaticResource SystemChromeMediumColor}" Opacity="0.9"/>
<StaticResource x:Key="DataGridColumnHeaderForegroundBrush" ResourceKey="SystemControlForegroundBaseMediumBrush"/>
<StaticResource x:Key="DataGridColumnHeaderBackgroundColor" ResourceKey="SystemAltHighColor"/>
<SolidColorBrush x:Key="DataGridColumnHeaderBackgroundBrush" Color="{StaticResource DataGridColumnHeaderBackgroundColor}"/>
<StaticResource x:Key="DataGridColumnHeaderHoveredBackgroundColor" ResourceKey="SystemListLowColor"/>
<StaticResource x:Key="DataGridColumnHeaderPressedBackgroundColor" ResourceKey="SystemListMediumColor"/>
<StaticResource x:Key="DataGridColumnHeaderDraggedBackgroundBrush" ResourceKey="SystemControlBackgroundChromeMediumLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderPointerOverBrush" ResourceKey="SystemControlHighlightListLowBrush"/>
<StaticResource x:Key="DataGridColumnHeaderPressedBrush" ResourceKey="SystemControlHighlightListMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderBackgroundBrush" ResourceKey="SystemControlBackgroundChromeMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderPressedBackgroundBrush" ResourceKey="SystemControlBackgroundListMediumBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="DataGridRowHoveredBackgroundColor" ResourceKey="SystemListLowColor"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<SolidColorBrush x:Key="SystemControlGridLinesBaseMediumLowBrush" Color="{StaticResource SystemBaseMediumLowColor}" Opacity="0.4"/>
<SolidColorBrush x:Key="SystemControlRowGroupHeaderBackgroundMediumBrush" Color="{StaticResource SystemChromeMediumColor}"/>
<SolidColorBrush x:Key="DataGridCurrencyVisualPrimaryBrush" Color="Transparent"/>
<x:String x:Key="SortIconAscending"></x:String>
<x:String x:Key="SortIconDescending"></x:String>
<x:String x:Key="RowGroupHeaderIconClosed"></x:String>
<x:String x:Key="RowGroupHeaderIconOpened"></x:String>
<x:String x:Key="ScrollBarsSeparatorExpandBeginTime">00:00:00.40</x:String>
<x:String x:Key="ScrollBarsSeparatorExpandDuration">00:00:00.1</x:String>
<x:String x:Key="ScrollBarsSeparatorContractBeginTime">00:00:02.00</x:String>
<x:String x:Key="ScrollBarsSeparatorContractDelay">00:00:02</x:String>
<x:String x:Key="ScrollBarsSeparatorContractDuration">00:00:00.1</x:String>
<x:String x:Key="ScrollBarsSeparatorContractFinalKeyframe">00:00:02.1</x:String>
<x:String x:Key="ScrollBarsSeparatorNoTouchDuration">00:00:00.5</x:String>
<x:Double x:Key="ListAccentLowOpacity">0.6</x:Double>
<x:Double x:Key="ListAccentMediumOpacity">0.8</x:Double>
<StaticResource x:Key="GridLinesBrush" ResourceKey="SystemControlGridLinesBaseMediumLowBrush"/>
<StaticResource x:Key="DataGridDetailsPresenterBackgroundBrush" ResourceKey="SystemControlBackgroundChromeMediumLowBrush"/>
<StaticResource x:Key="DataGridFillerColumnGridLinesBrush" ResourceKey="FillerGridLinesBrush"/>
<StaticResource x:Key="DataGridRowSelectedBackgroundColor" ResourceKey="SystemAccentColor"/>
<StaticResource x:Key="DataGridRowSelectedBackgroundOpacity" ResourceKey="ListAccentLowOpacity"/>
<StaticResource x:Key="DataGridRowSelectedHoveredBackgroundColor" ResourceKey="SystemAccentColor"/>
<StaticResource x:Key="DataGridRowSelectedHoveredBackgroundOpacity" ResourceKey="ListAccentMediumOpacity"/>
<StaticResource x:Key="DataGridRowSelectedUnfocusedBackgroundColor" ResourceKey="SystemAccentColor"/>
<StaticResource x:Key="DataGridRowSelectedUnfocusedBackgroundOpacity" ResourceKey="ListAccentLowOpacity"/>
<StaticResource x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundColor" ResourceKey="SystemAccentColor"/>
<StaticResource x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundOpacity" ResourceKey="ListAccentMediumOpacity"/>
<StaticResource x:Key="DataGridRowHeaderForegroundBrush" ResourceKey="SystemControlForegroundBaseMediumBrush"/>
<StaticResource x:Key="DataGridRowHeaderBackgroundBrush" ResourceKey="SystemControlBackgroundAltHighBrush"/>
<StaticResource x:Key="DataGridRowGroupHeaderHoveredBackgroundBrush" ResourceKey="SystemControlBackgroundListLowBrush"/>
<StaticResource x:Key="DataGridRowInvalidBrush" ResourceKey="InvalidBrush"/>
<StaticResource x:Key="DataGridCellBackgroundBrush" ResourceKey="SystemControlTransparentBrush"/>
<StaticResource x:Key="DataGridCellFocusVisualPrimaryBrush" ResourceKey="SystemControlFocusVisualPrimaryBrush"/>
<StaticResource x:Key="DataGridCellFocusVisualSecondaryBrush" ResourceKey="SystemControlFocusVisualSecondaryBrush"/>
<StaticResource x:Key="DataGridCellInvalidBrush" ResourceKey="InvalidBrush"/>
<Style TargetType="local:DataGrid">
<Setter Property="DragIndicatorStyle">
<Setter.Value>
<Style TargetType="ContentControl">
<Setter Property="Foreground" Value="{ThemeResource DataGridColumnHeaderForegroundBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<Grid Background="{ThemeResource DataGridColumnHeaderDraggedBackgroundBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SortStates">
<VisualState x:Name="Unsorted"/>
<VisualState x:Name="SortAscending">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
</Storyboard>
</VisualState>
<VisualState x:Name="SortDescending">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
</Storyboard>
<VisualState.Setters>
<Setter Target="SortIcon.Glyph" Value="{ThemeResource SortIconDescending}"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="{TemplateBinding Padding}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition MinWidth="32" Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter Content="{TemplateBinding Content}"/>
<FontIcon x:Name="SortIcon" Grid.Column="1" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="{ThemeResource SortIconAscending}"
FontSize="12" Foreground="{ThemeResource DataGridColumnHeaderForegroundBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0"/>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="DropLocationIndicatorStyle">
<Setter.Value>
<Style TargetType="Control">
<Setter Property="Background" Value="#FF3F4346"/>
<Setter Property="Width" Value="2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Control">
<Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="HorizontalGridLinesBrush" Value="{ThemeResource GridLinesBrush}"/>
<Setter Property="UseSystemFocusVisuals" Value="False"/>
<Setter Property="IsTabStop" Value="True"/>
<Setter Property="VerticalGridLinesBrush" Value="{ThemeResource GridLinesBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:DataGrid">
<Grid x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ScrollBarsStates">
<VisualStateGroup.Transitions>
<VisualTransition From="MouseIndicator" To="NoIndicator">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorContractDelay}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>None</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorContractDelay}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>None</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
<VisualTransition From="MouseIndicatorFull" To="NoIndicator">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorContractDelay}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>None</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorContractDelay}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>None</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
<VisualTransition From="MouseIndicatorFull" To="MouseIndicator">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorContractDelay}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>MouseIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorContractDelay}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>MouseIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
<VisualTransition From="TouchIndicator" To="NoIndicator">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorNoTouchDuration}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>None</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="{ThemeResource ScrollBarsSeparatorNoTouchDuration}">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>None</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="NoIndicator"/>
<VisualState x:Name="TouchIndicator">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>TouchIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>TouchIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="MouseIndicator">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>MouseIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>MouseIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="MouseIndicatorFull">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>MouseIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="IndicatorMode">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<ScrollingIndicatorMode>MouseIndicator</ScrollingIndicatorMode>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ScrollBarsSeparatorStates">
<VisualStateGroup.Transitions>
<VisualTransition From="SeparatorExpanded" To="SeparatorCollapsed">
<Storyboard>
<DoubleAnimation Duration="{ThemeResource ScrollBarsSeparatorContractDuration}"
BeginTime="{ThemeResource ScrollBarsSeparatorContractBeginTime}"
Storyboard.TargetName="BottomRightCorner"
Storyboard.TargetProperty="Opacity"
To="0"/>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="SeparatorCollapsed"/>
<VisualState x:Name="SeparatorExpanded">
<Storyboard>
<DoubleAnimation Duration="{ThemeResource ScrollBarsSeparatorExpandDuration}"
BeginTime="{ThemeResource ScrollBarsSeparatorExpandBeginTime}"
Storyboard.TargetName="BottomRightCorner"
Storyboard.TargetProperty="Opacity"
To="1"/>
</Storyboard>
</VisualState>
<VisualState x:Name="SeparatorExpandedWithoutAnimation">
<Storyboard>
<DoubleAnimation Duration="0"
BeginTime="{ThemeResource ScrollBarsSeparatorExpandBeginTime}"
Storyboard.TargetName="BottomRightCorner"
Storyboard.TargetProperty="Opacity"
To="1"/>
</Storyboard>
</VisualState>
<VisualState x:Name="SeparatorCollapsedWithoutAnimation" >
<Storyboard>
<DoubleAnimation Duration="0"
BeginTime="{ThemeResource ScrollBarsSeparatorContractBeginTime}"
Storyboard.TargetName="BottomRightCorner"
Storyboard.TargetProperty="Opacity"
To="0"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Background="{TemplateBinding Background}">
<Grid.Resources>
<!--Start: TopLeftHeaderTemplate-->
<ControlTemplate x:Key="TopLeftHeaderTemplate" TargetType="localprimitives:DataGridColumnHeader">
<Grid x:Name="TopLeftHeaderRoot">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,1,0" BorderBrush="{ThemeResource GridLinesBrush}" Grid.RowSpan="2"/>
<Rectangle VerticalAlignment="Bottom" Width="Auto" StrokeThickness="1" Height="1" Fill="{ThemeResource GridLinesBrush}" Grid.RowSpan="2"/>
</Grid>
</ControlTemplate>
<!--End: TopLeftHeaderTemplate-->
<!--Start: TopRightHeaderTemplate-->
<ControlTemplate x:Key="TopRightHeaderTemplate" TargetType="localprimitives:DataGridColumnHeader">
<Grid x:Name="RootElement"/>
</ControlTemplate>
<!--End: TopRightHeaderTemplate-->
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<!-- For ValidationSummary addition
<RowDefinition Height="Auto"/>
-->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<localprimitives:DataGridColumnHeader x:Name="TopLeftCornerHeader" Template="{StaticResource TopLeftHeaderTemplate}"/>
<localprimitives:DataGridColumnHeadersPresenter x:Name="ColumnHeadersPresenter" Grid.Column="1" Grid.ColumnSpan="2"
AutomationProperties.AccessibilityView="Raw"/>
<!-- Use TopRightCornerHeader when ColumnHeadersPresenter's Grid.ColumnSpan is 1 and the vertical ScrollBar does not paint on top of the cells -->
<!--<localprimitives:DataGridColumnHeader x:Name="TopRightCornerHeader" Grid.Column="2" Template="{StaticResource TopRightHeaderTemplate}"/>-->
<Rectangle x:Name="ColumnHeadersAndRowsSeparator" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Width="Auto" StrokeThickness="1" Height="1" Fill="{ThemeResource GridLinesBrush}"/>
<localprimitives:DataGridRowsPresenter x:Name="RowsPresenter" Grid.ColumnSpan="3" Grid.Row="1" Grid.RowSpan="2"
AutomationProperties.AccessibilityView="Raw"/>
<Rectangle x:Name="BottomRightCorner" Fill="{ThemeResource ScrollBarsSeparatorBackground}" Opacity="0" Grid.Row="2" Grid.Column="2"/>
<!-- Use BottomLeftCorner when RowsPresenter's Grid.RowSpan is 1 and the horizontal ScrollBar does not paint on top of the cells -->
<!--<Rectangle x:Name="BottomLeftCorner" Fill="#FFE9EEF4" Grid.Row="2" Grid.ColumnSpan="2"/>-->
<ScrollBar x:Name="VerticalScrollBar" Orientation="Vertical" Visibility="Collapsed" Grid.Column="2" Grid.Row="1"/>
<Grid Grid.Column="1" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="FrozenColumnScrollBarSpacer"/>
<ScrollBar x:Name="HorizontalScrollBar" Grid.Column="1" Orientation="Horizontal" Visibility="Collapsed"/>
</Grid>
<!--<dataInput:ValidationSummary x:Name="ValidationSummary" Grid.Row="3" Grid.ColumnSpan="3" MaxHeight="90"/>-->
</Grid>
<Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" CornerRadius="2" Background="#8CFFFFFF" Opacity="0"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="local:DataGridCell">
<Setter Property="Background" Value="{ThemeResource DataGridCellBackgroundBrush}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:DataGridCell">
<Grid x:Name="CellRoot" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CurrentStates">
<VisualState x:Name="Regular"/>
<VisualState x:Name="Current">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CurrencyVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
<DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="CurrentWithFocus">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CurrencyVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
<DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="Valid"/>
<VisualState x:Name="Invalid">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="InvalidVisualElement" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="CurrencyVisual" Stroke="{ThemeResource DataGridCurrencyVisualPrimaryBrush}" StrokeThickness="1" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False" Opacity="0"/>
<Grid x:Name="FocusVisual" IsHitTestVisible="False" Opacity="0">
<Rectangle Stroke="{ThemeResource DataGridCellFocusVisualPrimaryBrush}" StrokeThickness="2" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False"/>
<Rectangle Stroke="{ThemeResource DataGridCellFocusVisualSecondaryBrush}" StrokeThickness="1" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False" Margin="2"/>
</Grid>
<ContentPresenter
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Rectangle x:Name="InvalidVisualElement" IsHitTestVisible="False" StrokeThickness="1" Stroke="{ThemeResource DataGridCellInvalidBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0"/>
<Rectangle x:Name="RightGridLine" Grid.Column="1" VerticalAlignment="Stretch" Width="1" Fill="{ThemeResource DataGridFillerColumnGridLinesBrush}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="localprimitives:DataGridColumnHeader">
<Setter Property="Foreground" Value="{ThemeResource DataGridColumnHeaderForegroundBrush}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="SeparatorBrush" Value="{ThemeResource GridLinesBrush}"/>
<Setter Property="Padding" Value="12,0,0,0"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="localprimitives:DataGridColumnHeader">
<Grid x:Name="ColumnHeaderRoot">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridColumnHeaderBackgroundColor}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridColumnHeaderHoveredBackgroundColor}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridColumnHeaderPressedBackgroundColor}"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SortStates">
<VisualState x:Name="Unsorted"/>
<VisualState x:Name="SortAscending">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
</Storyboard>
</VisualState>
<VisualState x:Name="SortDescending">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
</Storyboard>
<VisualState.Setters>
<Setter Target="SortIcon.Glyph" Value="{ThemeResource SortIconDescending}"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="BackgroundRectangle" Stretch="Fill" Fill="{ThemeResource DataGridColumnHeaderBackgroundBrush}" Grid.ColumnSpan="2"/>
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition MinWidth="32" Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<FontIcon Grid.Column="1" x:Name="SortIcon" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="{ThemeResource SortIconAscending}" FontSize="12"
Foreground="{ThemeResource DataGridColumnHeaderForegroundBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0"/>
</Grid>
<Rectangle x:Name="VerticalSeparator" Grid.Column="1" Width="1" VerticalAlignment="Stretch" Fill="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}"/>
<Grid x:Name="FocusVisual" IsHitTestVisible="False" Opacity="0">
<Rectangle x:Name="FocusVisualPrimary" Stroke="{ThemeResource DataGridCellFocusVisualPrimaryBrush}" StrokeThickness="2" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False"/>
<Rectangle x:Name="FocusVisualSecondary" Stroke="{ThemeResource DataGridCellFocusVisualSecondaryBrush}" StrokeThickness="1" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False" Margin="2"/>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="local:DataGridRow">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:DataGridRow">
<localprimitives:DataGridFrozenGrid x:Name="RowRoot">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="NormalAlternatingRow"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowHoveredBackgroundColor}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="NormalSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverUnfocusedSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredUnfocusedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredUnfocusedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="UnfocusedSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedUnfocusedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedUnfocusedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="Valid"/>
<VisualState x:Name="Invalid">
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="InvalidVisualElement" Storyboard.TargetProperty="Opacity" Duration="0" To="0.4"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="BackgroundRectangle" Grid.ColumnSpan="2" Fill="{ThemeResource SystemControlTransparentBrush}"/>
<Rectangle x:Name="InvalidVisualElement" Grid.ColumnSpan="2" Opacity="0" Fill="{ThemeResource DataGridRowInvalidBrush}"/>
<localprimitives:DataGridRowHeader x:Name="RowHeader" Grid.RowSpan="3" localprimitives:DataGridFrozenGrid.IsFrozen="True"/>
<localprimitives:DataGridCellsPresenter x:Name="CellsPresenter" Grid.Column="1"
localprimitives:DataGridFrozenGrid.IsFrozen="True" MinHeight="32"
AutomationProperties.AccessibilityView="Raw"/>
<localprimitives:DataGridDetailsPresenter x:Name="DetailsPresenter" Grid.Row="1" Grid.Column="1"
Background="{ThemeResource DataGridDetailsPresenterBackgroundBrush}"
AutomationProperties.AccessibilityView="Raw"/>
<Rectangle x:Name="BottomGridLine" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" Height="1"/>
</localprimitives:DataGridFrozenGrid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="localprimitives:DataGridRowHeader">
<Setter Property="Background" Value="{ThemeResource DataGridRowHeaderBackgroundBrush}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="SeparatorBrush" Value="{ThemeResource GridLinesBrush}"/>
<Setter Property="SeparatorVisibility" Value="Collapsed"/>
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="localprimitives:DataGridRowHeader">
<Grid x:Name="RowHeaderRoot">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="NormalCurrentRow">
<!-- For optional row currency and editing glyphs
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
<DoubleAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
</Storyboard>
-->
</VisualState>
<VisualState x:Name="NormalSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedBackgroundOpacity}"/>
<!-- For optional row currency and editing glyphs
<DoubleAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
<DoubleAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
-->
</Storyboard>
</VisualState>
<VisualState x:Name="NormalEditingRow">
<!-- For optional row currency and editing glyphs
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
<DoubleAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
</Storyboard>
-->
</VisualState>
<VisualState x:Name="NormalCurrentRowSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource SystemListLowColor}"/>
<!-- For optional row currency and editing glyphs
<DoubleAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
<DoubleAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
-->
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverCurrentRow">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource SystemListLowColor}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverUnfocusedEditingRow">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource SystemListLowColor}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverEditingRow">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource SystemListLowColor}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverUnfocusedSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredUnfocusedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredUnfocusedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverUnfocusedCurrentRowSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredUnfocusedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredUnfocusedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverCurrentRowSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredBackgroundOpacity}"/>
<!-- For optional row currency and editing glyphs
<DoubleAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
<DoubleAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
-->
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOverSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedHoveredBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="UnfocusedEditingRow">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedBackgroundColor}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="UnfocusedSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedUnfocusedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedUnfocusedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
<VisualState x:Name="UnfocusedCurrentRowSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Duration="0" To="{ThemeResource DataGridRowSelectedUnfocusedBackgroundColor}"/>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="{ThemeResource DataGridRowSelectedUnfocusedBackgroundOpacity}"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="RowValid"/>
<VisualState x:Name="RowInvalid">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" Duration="0" To="0"/>
<DoubleAnimation Storyboard.TargetName="RowInvalidVisualElement" Storyboard.TargetProperty="Opacity" Duration="0" To="0.4"/>
<!-- For optional row currency and editing glyphs
<ColorAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Duration="0" To="#FFDC000C"/>
<ColorAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0" To="#FFDC000C"/>
<ColorAnimation Storyboard.TargetName="CurrentRowGlyph" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Duration="0" To="#FFDC000C"/>
<ColorAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Duration="0" To="#FFDC000C"/>
<ColorAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0" To="#FFDC000C"/>
<ColorAnimation Storyboard.TargetName="EditingRowGlyph" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Duration="0" To="#FFDC000C"/>
-->
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="{TemplateBinding SeparatorBrush}" BorderThickness="0,0,1,0" Grid.RowSpan="3" Grid.ColumnSpan="2">
<Grid Background="{TemplateBinding Background}">
<Rectangle x:Name="RowInvalidVisualElement" Stretch="Fill" Fill="{ThemeResource DataGridRowInvalidBrush}" Opacity="0"/>
<Rectangle x:Name="BackgroundRectangle" Stretch="Fill" Fill="Transparent"/>
</Grid>
</Border>
<Rectangle x:Name="HorizontalSeparator" Grid.ColumnSpan="2" Grid.Row="2" Height="1" Margin="1,0,1,0" HorizontalAlignment="Stretch" Fill="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}"/>
<ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="1" Grid.RowSpan="2"/>
<!-- For optional row currency glyph
<Path x:Name="CurrentRowGlyph" VerticalAlignment="Center" HorizontalAlignment="Center" Width="6" Height="10" Margin="8,0,8,0" Grid.RowSpan="2" Stretch="Fill" Opacity="0" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z ">
<Path.Fill>
<LinearGradientBrush StartPoint="0,-.15" EndPoint="0,1.75">
<GradientStop Color="#FF84E3FF" Offset="0"/>
<GradientStop Color="#FF6ABFD8" Offset="0.5"/>
<GradientStop Color="#FF5297AB" Offset="1"/>
</LinearGradientBrush>
</Path.Fill>
</Path>
-->
<!-- For optional row editing glyph
<Path x:Name="EditingRowGlyph" VerticalAlignment="Center" HorizontalAlignment="Center" Width="6" Height="10" Margin="8,0,8,0" Grid.RowSpan="2" Stretch="Fill" Opacity="0" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z ">
<Path.Fill>
<LinearGradientBrush StartPoint="0,-.15" EndPoint="0,1.75">
<GradientStop Color="#FF84E3FF" Offset="0"/>
<GradientStop Color="#FF6ABFD8" Offset="0.5"/>
<GradientStop Color="#FF5297AB" Offset="1"/>
</LinearGradientBrush>
</Path.Fill>
</Path>
-->
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="local:DataGridRowGroupHeader">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Foreground" Value="{ThemeResource DataGridRowGroupHeaderForegroundBrush}"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:DataGridRowGroupHeader">
<localprimitives:DataGridFrozenGrid x:Name="RowGroupHeaderRoot" Background="{ThemeResource DataGridRowGroupHeaderBackgroundBrush}" MinHeight="{TemplateBinding MinHeight}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="RowGroupHeaderRoot.Background" Value="{ThemeResource DataGridRowGroupHeaderHoveredBackgroundBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="RowGroupHeaderRoot.Background" Value="{ThemeResource DataGridRowGroupHeaderPressedBackgroundBrush}"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CurrentStates">
<VisualState x:Name="Regular"/>
<VisualState x:Name="Current">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CurrencyVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
<DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="CurrentWithFocus">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CurrencyVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
<DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<localprimitives:DataGridFrozenGrid.Resources>
<ControlTemplate x:Key="ToggleButtonTemplate" TargetType="ToggleButton">
<Grid Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Target="Arrow.Glyph" Value="{ThemeResource RowGroupHeaderIconClosed}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="Arrow.Glyph" Value="{ThemeResource RowGroupHeaderIconClosed}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="Arrow.Glyph" Value="{ThemeResource RowGroupHeaderIconClosed}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="Arrow.Glyph" Value="{ThemeResource RowGroupHeaderIconClosed}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Checked"/>
<VisualState x:Name="CheckedPointerOver"/>
<VisualState x:Name="CheckedPressed"/>
<VisualState x:Name="CheckedDisabled"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="{ThemeResource RowGroupHeaderIconOpened}"
FontSize="12" Foreground="{ThemeResource DataGridRowGroupHeaderForegroundBrush}"
HorizontalAlignment="Right" VerticalAlignment="Center"/>
</Grid>
</ControlTemplate>
</localprimitives:DataGridFrozenGrid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle x:Name="IndentSpacer" Grid.Column="1"/>
<ToggleButton x:Name="ExpanderButton" Grid.Column="2" Height="12" Width="12" Template="{StaticResource ToggleButtonTemplate}"
IsTabStop="False" Margin="12,0,0,0" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}"/>
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center" Margin="12,0,0,0">
<TextBlock x:Name="PropertyNameElement" Margin="4,0,0,0" Visibility="{TemplateBinding PropertyNameVisibility}" Style="{ThemeResource BodyTextBlockStyle}" Foreground="{TemplateBinding Foreground}"/>
<TextBlock x:Name="PropertyValueElement" Margin="4,0,0,0" Style="{ThemeResource BodyTextBlockStyle}" Foreground="{TemplateBinding Foreground}"/>
<TextBlock x:Name="ItemCountElement" Margin="4,0,0,0" Visibility="{TemplateBinding ItemCountVisibility}" Style="{ThemeResource BodyTextBlockStyle}" Foreground="{TemplateBinding Foreground}"/>
</StackPanel>
<Rectangle x:Name="CurrencyVisual" Grid.ColumnSpan="5"
Stroke="{ThemeResource DataGridCurrencyVisualPrimaryBrush}" StrokeThickness="1" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False" Opacity="0"/>
<Grid x:Name="FocusVisual" Grid.ColumnSpan="5" IsHitTestVisible="False" Opacity="0">
<Rectangle Stroke="{ThemeResource DataGridCellFocusVisualPrimaryBrush}" StrokeThickness="2" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False"/>
<Rectangle Stroke="{ThemeResource DataGridCellFocusVisualSecondaryBrush}" StrokeThickness="1" Fill="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False" Margin="2"/>
</Grid>
<localprimitives:DataGridRowHeader x:Name="RowHeader" Grid.RowSpan="2" localprimitives:DataGridFrozenGrid.IsFrozen="True"/>
<Rectangle x:Name="BottomGridLine" Grid.ColumnSpan="5" Height="1" Grid.Row="1"/>
</localprimitives:DataGridFrozenGrid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
``` | /content/code_sandbox/Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGrid.xaml | xml | 2016-06-17T21:29:46 | 2024-08-16T09:32:00 | WindowsCommunityToolkit | CommunityToolkit/WindowsCommunityToolkit | 5,842 | 12,606 |
```xml
import { useEffect, useState } from 'react';
import { c } from 'ttag';
interface Props {
filename?: string;
contents?: Uint8Array[];
}
const PDFPreview = ({ filename = 'preview.pdf', contents }: Props) => {
const [url, setUrl] = useState<string>();
useEffect(() => {
const newUrl = URL.createObjectURL(new Blob(contents, { type: 'application/pdf' }));
setUrl(newUrl);
return () => {
if (newUrl) {
URL.revokeObjectURL(newUrl);
}
};
}, [contents]);
return (
<>
{url && (
<object
data={url}
className="w-full flex *:min-size-auto flex-auto flex-column-reverse"
type="application/pdf"
title={filename}
>
<embed src={url} className="flex" type="application/pdf" />
<p className="m-auto">{c('Info')
.t`This browser does not support previewing PDF documents. Please download the file.`}</p>
</object>
)}
</>
);
};
export default PDFPreview;
``` | /content/code_sandbox/packages/components/containers/filePreview/PDFPreview.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 243 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net47;</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>0114;0672;0108;0067;0168;0169;0219;0612;0618;1998;4014</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter">
<Version>3.16.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj" />
<ProjectReference Include="..\Xamarin.Forms.DualScreen\Xamarin.Forms.DualScreen.csproj" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/Xamarin.Forms.DualScreen.UnitTests/Xamarin.Forms.DualScreen.UnitTests.csproj | xml | 2016-03-18T15:52:03 | 2024-08-16T16:25:43 | Xamarin.Forms | xamarin/Xamarin.Forms | 5,637 | 253 |
```xml
import * as React from 'react';
import { Calendar } from '@fluentui/react-calendar-compat';
import type { CalendarDayProps } from '@fluentui/react-calendar-compat';
export const CalendarCustomDayCellRef = () => {
const [selectedDate, setSelectedDate] = React.useState<Date>();
const onSelectDate = React.useCallback((date: Date, _): void => {
setSelectedDate(date);
}, []);
const customDayCellRef: CalendarDayProps['customDayCellRef'] = React.useCallback((element, date, classNames) => {
if (element) {
element.title = 'custom title from customDayCellRef: ' + date.toString();
if (date.getDay() === 0 || date.getDay() === 6) {
// We need to split the className since we use makeStyles and griffel provides a string of space
// separated classnames
classNames.dayOutsideBounds && element.classList.add(...classNames.dayOutsideBounds.split(' '));
(element.children[0] as HTMLButtonElement).disabled = true;
}
}
}, []);
return (
<>
<div>Selected date: {selectedDate?.toDateString() || 'Not set'}</div>
<Calendar
highlightSelectedMonth
showGoToToday
calendarDayProps={{ customDayCellRef }}
onSelectDate={onSelectDate}
value={selectedDate}
/>
</>
);
};
CalendarCustomDayCellRef.parameters = {
docs: {
description: {
story: 'A Calendar Compat can be modified to allow selecting a non contiguous (7 day) week.',
},
},
};
``` | /content/code_sandbox/packages/react-components/react-calendar-compat/stories/src/Calendar/CalendarCustomDayCellRef.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 348 |
```xml
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0-preview.5.24306.11" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/projects/net9/open-api-3/open-api-3.csproj | xml | 2016-07-27T08:23:40 | 2024-08-16T19:15:21 | practical-aspnetcore | dodyg/practical-aspnetcore | 9,106 | 85 |
```xml
export const enum eAccountRouteNames {
Account = 'AbpAccount::Menu:Account',
Login = 'AbpAccount::Login',
Register = 'AbpAccount::Register',
ManageProfile = 'AbpAccount::MyAccount',
ForgotPassword = 'AbpAccount::ForgotPassword',
ResetPassword = 'AbpAccount::ResetPassword',
}
``` | /content/code_sandbox/npm/ng-packs/packages/account/config/src/enums/route-names.ts | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 78 |
```xml
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
/**
* Environment URL for production
*/
export const environment = {
production: true,
api_endpoint: 'path_to_url
};
``` | /content/code_sandbox/frontend_v2/src/environments/environment.prod.ts | xml | 2016-10-21T00:51:45 | 2024-08-16T14:41:56 | EvalAI | Cloud-CV/EvalAI | 1,736 | 102 |
```xml
import fs from 'fs';
import path from 'path';
import { series, task, copyInstructionsTask, copyInstructions, cleanTask } from '@fluentui/scripts-tasks';
import { findGitRoot, getAllPackageInfo } from '@fluentui/scripts-monorepo';
task('clean', cleanTask());
const gitRoot = findGitRoot();
const instructions = copyInstructions.copyFilesToDestinationDirectory(
['pr-deploy-site.css', 'chiclet-test.html', 'index.html'],
'dist',
);
// If you are adding a new tile into this site, please make sure it is also listed in the siteInfo of
// `pr-deploy-site.js`
//
// Dependencies are listed here and NOT in package.json because declaring in package.json would
// prevent scoped/partial builds from working. (Since the demo site has both v0 and v8 packages,
// it would cause both of those dependency trees to get built every time.)
const dependencies = [
'@fluentui/docs',
'@fluentui/perf-test-northstar',
'@fluentui/public-docsite-resources',
'@fluentui/public-docsite',
'@fluentui/react',
'@fluentui/react-charting',
'@fluentui/public-docsite-v9',
'@fluentui/react-experiments',
'@fluentui/web-components',
'@fluentui/perf-test',
'@fluentui/theming-designer',
'@fluentui/theme-designer',
'@fluentui/perf-test-react-components',
];
const allPackages = getAllPackageInfo();
const repoDeps = dependencies.map(dep => allPackages[dep]);
const deployedPackages = new Set<string>();
repoDeps.forEach(dep => {
const packageDist = path.join(gitRoot, dep.packagePath, 'dist');
if (fs.existsSync(packageDist)) {
if (dep.packageJson.name === '@fluentui/docs') {
instructions.push(...copyInstructions.copyFilesInDirectory(packageDist, path.join('dist', 'react-northstar')));
deployedPackages.add(dep.packageJson.name);
} else if (dep.packageJson.name === '@fluentui/perf-test-northstar') {
instructions.push(
...copyInstructions.copyFilesInDirectory(packageDist, path.join('dist', 'perf-test-northstar')),
);
deployedPackages.add(dep.packageJson.name);
} else {
instructions.push(
...copyInstructions.copyFilesInDirectory(packageDist, path.join('dist', path.basename(dep.packagePath))),
);
deployedPackages.add(dep.packageJson.name);
}
}
});
/**
* Sets the list of tiles to render based on which packages were actually built
*/
task('generate:js', () => {
const jsContent = fs.readFileSync(path.join(__dirname, './pr-deploy-site.js'), 'utf-8');
if (!jsContent.includes('var packages;')) {
console.error('pr-deploy-site.js must contain a line "var packages;" to replace with the actual packages');
process.exit(1);
}
fs.writeFileSync(
path.join('dist', 'pr-deploy-site.js'),
jsContent.replace('var packages;', `var packages = ${JSON.stringify([...deployedPackages])};`),
);
});
/**
* Copies all the built dist files and updates the JS to load the ones that were actually built
*/
task('generate:site', series(copyInstructionsTask({ copyInstructions: instructions }), 'generate:js'));
``` | /content/code_sandbox/apps/pr-deploy-site/just.config.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 721 |
```xml
/*
* Wire
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program. If not, see path_to_url
*
*/
import {render, waitFor} from '@testing-library/react';
import {CONVERSATION_TYPE, MLSConversation} from '@wireapp/api-client/lib/conversation';
import {CredentialType} from '@wireapp/core/lib/messagingProtocols/mls';
import {container} from 'tsyringe';
import {withTheme} from 'src/script/auth/util/test/TestUtil';
import {E2EIHandler, MLSStatuses, WireIdentity} from 'src/script/E2EIdentity';
import {User} from 'src/script/entity/User';
import {Core} from 'src/script/service/CoreSingleton';
import {UserState} from 'src/script/user/UserState';
import {generateAPIConversation} from 'test/helper/ConversationGenerator';
import {E2EICertificateDetails} from './E2EICertificateDetails';
const generateIdentity = (status: MLSStatuses, credentialType = CredentialType.X509): WireIdentity => ({
status,
x509Identity: {
certificate: 'certificate',
displayName: '',
domain: '',
handle: '',
notBefore: BigInt(0),
notAfter: BigInt(0),
serialNumber: '',
},
credentialType,
deviceId: '',
clientId: '',
thumbprint: '',
qualifiedUserId: {
domain: '',
id: '',
},
});
const core = container.resolve(Core);
describe('E2EICertificateDetails', () => {
beforeAll(async () => {
jest.spyOn(core.service?.conversation!, 'getMLSSelfConversation').mockResolvedValue(
generateAPIConversation({
id: {id: 'id', domain: 'domain'},
type: CONVERSATION_TYPE.ONE_TO_ONE,
overwites: {group_id: 'groupId'},
}) as MLSConversation,
);
const selfUser = new User('id', 'domain');
container.resolve(UserState).self(selfUser);
const handler = E2EIHandler.getInstance();
await handler.initialize({discoveryUrl: '', gracePeriodInSeconds: 100});
});
describe('idicates the state of the e2ei identity', () => {
it('is e2ei identity not downloaded', async () => {
const {getByTestId} = render(withTheme(<E2EICertificateDetails />));
const E2EIdentityStatus = getByTestId('e2ei-identity-status');
expect(E2EIdentityStatus.getAttribute('data-uie-value')).toEqual(MLSStatuses.NOT_ACTIVATED);
});
it('is e2ei identity not downloaded for basic MLS device', async () => {
const identity = generateIdentity(MLSStatuses.VALID, CredentialType.Basic);
const {getByTestId} = render(withTheme(<E2EICertificateDetails identity={identity} />));
const E2EIdentityStatus = getByTestId('e2ei-identity-status');
expect(E2EIdentityStatus.getAttribute('data-uie-value')).toEqual(MLSStatuses.NOT_ACTIVATED);
});
it('is e2ei identity expired', async () => {
const identity = generateIdentity(MLSStatuses.EXPIRED);
const {getByTestId} = render(withTheme(<E2EICertificateDetails identity={identity} />));
const E2EIdentityStatus = getByTestId('e2ei-identity-status');
expect(E2EIdentityStatus.getAttribute('data-uie-value')).toEqual(MLSStatuses.EXPIRED);
});
it('is e2ei identity revoked', async () => {
const identity = generateIdentity(MLSStatuses.REVOKED);
const {getByTestId} = render(withTheme(<E2EICertificateDetails identity={identity} />));
const E2EIdentityStatus = getByTestId('e2ei-identity-status');
expect(E2EIdentityStatus.getAttribute('data-uie-value')).toEqual(MLSStatuses.REVOKED);
});
it('is e2ei identity verified', async () => {
const identity = generateIdentity(MLSStatuses.VALID);
const {getByTestId} = render(withTheme(<E2EICertificateDetails identity={identity} />));
const E2EIdentityStatus = getByTestId('e2ei-identity-status');
expect(E2EIdentityStatus.getAttribute('data-uie-value')).toEqual(MLSStatuses.VALID);
});
});
describe('shows the update certificate button for the current device', () => {
it('for expired certificate', async () => {
const identity = generateIdentity(MLSStatuses.EXPIRED);
const {getByText} = render(withTheme(<E2EICertificateDetails identity={identity} isCurrentDevice />));
await waitFor(() => {
const E2EIdentityStatus = getByText('E2EI.updateCertificate');
expect(E2EIdentityStatus).toBeDefined();
});
});
it('for certificate that expires soon', async () => {
const identity = generateIdentity(MLSStatuses.VALID);
const instance = E2EIHandler.getInstance();
jest.spyOn(instance, 'hasGracePeriodStartedForSelfClient').mockResolvedValue(true);
const {getByText} = render(withTheme(<E2EICertificateDetails identity={identity} isCurrentDevice />));
await waitFor(() => {
const E2EIdentityStatus = getByText('E2EI.updateCertificate');
expect(E2EIdentityStatus).toBeDefined();
});
});
it('for not downloaded certificate', async () => {
const identity = generateIdentity(MLSStatuses.NOT_ACTIVATED);
const {getByText} = render(withTheme(<E2EICertificateDetails identity={identity} isCurrentDevice />));
const E2EIdentityStatus = getByText('E2EI.getCertificate');
expect(E2EIdentityStatus).toBeDefined();
});
});
});
``` | /content/code_sandbox/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.test.tsx | xml | 2016-07-21T15:34:05 | 2024-08-16T11:40:13 | wire-webapp | wireapp/wire-webapp | 1,125 | 1,300 |
```xml
export * from 'rxjs-compat/observable/dom/webSocket';
``` | /content/code_sandbox/deps/node-10.15.3/tools/node_modules/eslint/node_modules/rxjs/observable/dom/webSocket.d.ts | xml | 2016-09-05T10:18:44 | 2024-08-11T13:21:40 | LiquidCore | LiquidPlayer/LiquidCore | 1,010 | 14 |
```xml
export const iconSizes = {
small: '16px',
medium: '20px',
large: '24px',
};
``` | /content/code_sandbox/packages/react-components/react-combobox/library/src/utils/internalTokens.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 29 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.