text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```xml
import * as React from 'react';
import {
MergeStylesShadowRootContext,
MergeStylesShadowRootContextValue,
} from '../contexts/MergeStylesShadowRootContext';
export type HasMergeStylesShadowRootContextHook = () => boolean;
export type MergeStylesShadowRootContetHook = () => MergeStylesShadowRootContextValue | undefined;
/**
* Test if a context is available.
* @returns true if there is a context.
*/
export const useHasMergeStylesShadowRootContext: HasMergeStylesShadowRootContextHook = () => {
return !!useMergeStylesShadowRootContext();
};
/**
* Get a reference to the shadow root context.
* @returns The context for the shadow root.
*/
export const useMergeStylesShadowRootContext: MergeStylesShadowRootContetHook = () => {
return React.useContext(MergeStylesShadowRootContext);
};
``` | /content/code_sandbox/packages/utilities/src/shadowDom/hooks/useMergeStylesShadowRoot.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 179 |
```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>BuildMachineOSBuild</key>
<string>13C64</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>AsusNBFnKeys</string>
<key>CFBundleIdentifier</key>
<string>org.emlydinesh.driver.AsusNBFnKeys</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AsusNBFnKeys</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.2</string>
<key>DTCompiler</key>
<string></string>
<key>DTPlatformBuild</key>
<string>4H1503</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>11E52</string>
<key>DTSDKName</key>
<string>macosx10.7</string>
<key>DTXcode</key>
<string>0463</string>
<key>DTXcodeBuild</key>
<string>4H1503</string>
<key>IOKitPersonalities</key>
<dict>
<key>AsusNBFnKeys</key>
<dict>
<key>CFBundleIdentifier</key>
<string>org.emlydinesh.driver.AsusNBFnKeys</string>
<key>Debug</key>
<false/>
<key>IOClass</key>
<string>AsusNBFnKeys</string>
<key>IONameMatch</key>
<array>
<string>PNP0c14</string>
<string>PNP0C14</string>
<string>ASU010</string>
<string>ASU0100</string>
<string>ASU0010</string>
<string>ATK0100</string>
</array>
<key>IOProbeScore</key>
<integer>30</integer>
<key>IOProviderClass</key>
<string>IOACPIPlatformDevice</string>
<key>Preferences</key>
<dict>
<key>ALSEnabledAtBoot</key>
<false/>
<key>DimBacklightOnAC/DC</key>
<true/>
<key>DisplayUsesNvidiaGPU</key>
<false/>
<key>F3KeyFunction</key>
<integer>0</integer>
<key>F4KeyFunction</key>
<integer>0</integer>
<key>HasKeyboardBacklight</key>
<true/>
<key>HasMediaFnKeys</key>
<false/>
<key>HasSensorALS</key>
<false/>
<key>IdleKBacklightAutoOff</key>
<false/>
<key>IdleKBacklightAutoOffTimeout</key>
<integer>10000</integer>
<key>KBackLightlvlAtBoot</key>
<integer>3</integer>
<key>KeyboardHas16BLightLvls</key>
<false/>
<key>MediaKeysDoFastRewind</key>
<false/>
<key>SoftDisplayBacklightOff</key>
<true/>
</dict>
</dict>
<key>FnKeysHIKeyboard</key>
<dict>
<key>CFBundleIdentifier</key>
<string>org.emlydinesh.driver.AsusNBFnKeys</string>
<key>IOClass</key>
<string>FnKeysHIKeyboard</string>
<key>IONameMatch</key>
<string>FnKeysHIKeyboardDevice</string>
<key>IOProviderClass</key>
<string>FnKeysHIKeyboardDevice</string>
</dict>
</dict>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.iokit.IOACPIFamily</key>
<string>1.0.0d1</string>
<key>com.apple.iokit.IOHIDSystem</key>
<string>1.6.5</string>
<key>com.apple.kpi.bsd</key>
<string>10.0.0</string>
<key>com.apple.kpi.iokit</key>
<string>9.6.0</string>
<key>com.apple.kpi.libkern</key>
<string>9.6.0</string>
<key>com.apple.kpi.unsupported</key>
<string>9.6.0</string>
</dict>
</dict>
</plist>
``` | /content/code_sandbox/Clover-Configs/Asus/FXPRO 6300 (GL552VW)/CLOVER/kexts/10.12/AsusNBFnKeys.kext/Contents/Info.plist | xml | 2016-11-05T04:22:54 | 2024-08-12T19:25:53 | Hackintosh-Installer-University | huangyz0918/Hackintosh-Installer-University | 3,937 | 1,224 |
```xml
import { requireNativeModule } from 'expo-modules-core';
export default requireNativeModule('ExpoLightSensor');
``` | /content/code_sandbox/packages/expo-sensors/src/ExpoLightSensor.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 24 |
```xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="HintText" parent="TextAppearance.Design.Hint">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/colorPrimary</item>
</style>
<style name="CounterText" parent="TextAppearance.Design.Counter">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/my_pink</item>
</style>
<style name="CounterOverFlow" parent="TextAppearance.Design.Counter.Overflow">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/my_orange</item>
</style>
<style name="ErrorText" parent="TextAppearance.Design.Error">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/my_black</item>
</style>
</resources>
``` | /content/code_sandbox/Android/FeaturesOfTextInputLayout/app/src/main/res/values/styles.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 285 |
```xml
export default () => 'Hello from b'
``` | /content/code_sandbox/test/integration/typescript-paths/lib/b/api.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 10 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--
~ All Rights Reserved.
-->
<resources>
<attr name="darkTheme" format="reference" />
<attr name="colorPrimaryDarkWithoutSystemWindowScrim" format="color" />
<attr name="colorPrimaryLight" format="color" />
<attr name="textColorPrimaryDark" format="color" />
<attr name="iconButtonTint" format="color" />
<declare-styleable name="CardIconButton">
<attr name="android:src" />
<attr name="android:text" />
</declare-styleable>
<declare-styleable name="ContentStateLayout">
<attr name="animationEnabled" format="boolean" />
<attr name="loadingView" format="reference" />
<attr name="contentView" format="reference" />
<attr name="emptyView" format="reference" />
<attr name="errorView" format="reference" />
</declare-styleable>
<declare-styleable name="FriendlySwipeRefreshLayout">
<attr name="progressOffset" format="dimension" />
<attr name="progressDistanceOffset" format="dimension" />
</declare-styleable>
<declare-styleable name="ImageLayout">
<attr name="fillOrientation" format="enum">
<enum name="horizontal" value="0" />
<enum name="vertical" value="1" />
</attr>
</declare-styleable>
<declare-styleable name="InsetBackgroundFrameLayout">
<attr name="insetBackground" format="color" />
</declare-styleable>
<declare-styleable name="RatioHeightRecyclerView">
<attr name="ratio" format="string" />
</declare-styleable>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/attrs.xml | xml | 2016-02-01T13:44:19 | 2024-08-15T05:23:34 | Douya | zhanghai/Douya | 4,549 | 384 |
```xml
<manifest package="github.nisrulz.example.awesomelib" />
``` | /content/code_sandbox/CompileOnly/awesomelib/src/main/AndroidManifest.xml | xml | 2016-02-25T11:06:48 | 2024-08-07T21:41:59 | android-examples | nisrulz/android-examples | 1,747 | 18 |
```xml
import Ajv, { JSONSchemaType } from 'ajv';
/**
* Type representing base dev launcher configuration.
*/
export type PluginConfigType = PluginConfigOptionsByPlatform & PluginConfigOptions;
/**
* Type representing available configuration for each platform.
*/
export type PluginConfigOptionsByPlatform = {
/**
* Type representing available configuration for Android dev launcher.
* @platform android
*/
android?: PluginConfigOptions;
/**
* Type representing available configuration for iOS dev launcher.
* @platform ios
*/
ios?: PluginConfigOptions;
};
/**
* Type representing available configuration for dev launcher.
*/
export type PluginConfigOptions = {
/**
* Determines whether to launch the most recently opened project or navigate to the launcher screen.
*
* - `'most-recent'` - Attempt to launch directly into a previously opened project and if unable to connect,
* fall back to the launcher screen.
*
* - `'launcher'` - Opens the launcher screen.
*
* @default 'most-recent'
*/
launchMode?: 'most-recent' | 'launcher';
/**
* @deprecated use the `launchMode` property instead
*/
launchModeExperimental?: 'most-recent' | 'launcher';
};
const schema: JSONSchemaType<PluginConfigType> = {
type: 'object',
properties: {
launchMode: {
type: 'string',
enum: ['most-recent', 'launcher'],
nullable: true,
},
launchModeExperimental: {
type: 'string',
enum: ['most-recent', 'launcher'],
nullable: true,
},
android: {
type: 'object',
properties: {
launchMode: {
type: 'string',
enum: ['most-recent', 'launcher'],
nullable: true,
},
launchModeExperimental: {
type: 'string',
enum: ['most-recent', 'launcher'],
nullable: true,
},
},
nullable: true,
},
ios: {
type: 'object',
properties: {
launchMode: {
type: 'string',
enum: ['most-recent', 'launcher'],
nullable: true,
},
launchModeExperimental: {
type: 'string',
enum: ['most-recent', 'launcher'],
nullable: true,
},
},
nullable: true,
},
},
};
/**
* @ignore
*/
export function validateConfig<T>(config: T): PluginConfigType {
const validate = new Ajv({ allowUnionTypes: true }).compile(schema);
if (!validate(config)) {
throw new Error('Invalid expo-dev-launcher config: ' + JSON.stringify(validate.errors));
}
if (
config.launchModeExperimental ||
config.ios?.launchModeExperimental ||
config.android?.launchModeExperimental
) {
warnOnce(
'The `launchModeExperimental` property of expo-dev-launcher config plugin is deprecated and will be removed in a future SDK release. Use `launchMode` instead.'
);
}
return config;
}
const warnMap: Record<string, boolean> = {};
function warnOnce(message: string) {
if (!warnMap[message]) {
warnMap[message] = true;
console.warn(message);
}
}
``` | /content/code_sandbox/packages/expo-dev-launcher/plugin/src/pluginConfig.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 701 |
```xml
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { DockerConfig } from '../types';
import { buildDockerProxyUrl } from '../../proxy/queries/buildDockerProxyUrl';
export async function deleteConfig(
environmentId: EnvironmentId,
id: DockerConfig['Id']
) {
try {
await axios.delete(buildDockerProxyUrl(environmentId, 'configs', id));
} catch (e) {
throw parseAxiosError(e, 'Unable to delete config');
}
}
``` | /content/code_sandbox/app/react/docker/configs/queries/useDeleteConfigMutation.ts | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 127 |
```xml
// See LICENSE.txt for license information.
import React, {useCallback} from 'react';
import {useIntl} from 'react-intl';
import OptionItem from '@components/option_item';
import Screens from '@constants/screens';
import {showModal} from '@screens/navigation';
import {preventDoubleTap} from '@utils/tap';
const Settings = () => {
const intl = useIntl();
const openSettings = useCallback(preventDoubleTap(() => {
showModal(
Screens.SETTINGS,
intl.formatMessage({id: 'mobile.screen.settings', defaultMessage: 'Settings'}),
);
}), []);
return (
<OptionItem
action={openSettings}
icon='settings-outline'
label={intl.formatMessage({id: 'account.settings', defaultMessage: 'Settings'})}
testID='account.settings.option'
type='default'
/>
);
};
export default Settings;
``` | /content/code_sandbox/app/screens/home/account/components/options/settings/index.tsx | xml | 2016-10-07T16:52:32 | 2024-08-16T12:08:38 | mattermost-mobile | mattermost/mattermost-mobile | 2,155 | 187 |
```xml
import { QueryResponse } from "@erxes/ui/src/types";
export interface IGolomtBankConfigsItem {
_id: string;
name: string;
organizationName: string;
clientId: string;
ivKey: string;
sessionKey: string;
configPassword: string;
registerId: string;
accountId: string;
golomtCode: string;
}
export type ConfigsListQueryResponse = {
golomtBankConfigsList: {
list: IGolomtBankConfigsItem[];
totalCount: number;
};
loading: boolean;
refetch: () => void;
} & QueryResponse;
``` | /content/code_sandbox/packages/plugin-golomtbank-ui/src/types/IConfigs.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 138 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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="org.zakariya.stickyheadersapp.ui.DemoActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
style="@style/ToolBarWithNavigationBack" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<ProgressBar
android:id="@+id/progress"
android:visibility="gone"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
``` | /content/code_sandbox/app/src/main/res/layout/activity_demo.xml | xml | 2016-04-16T22:20:07 | 2024-07-18T10:04:59 | StickyHeaders | ShamylZakariya/StickyHeaders | 1,404 | 445 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Blink</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionFileProviderDocumentGroup</key>
<string>group.$(GROUP_ID)</string>
<key>NSExtensionFileProviderSupportsEnumeration</key>
<true/>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.fileprovider-nonui</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).FileProviderExtension</string>
</dict>
</dict>
</plist>
``` | /content/code_sandbox/BlinkFileProvider/Info.plist | xml | 2016-03-29T10:43:10 | 2024-08-16T04:03:19 | blink | blinksh/blink | 6,114 | 355 |
```xml
import useWebChatUIContext from './useWebChatUIContext';
export default function useDispatchTranscriptFocusByActivityKey(): (activityKey: string | undefined) => void {
return useWebChatUIContext().dispatchTranscriptFocusByActivityKey;
}
``` | /content/code_sandbox/packages/component/src/hooks/internal/useDispatchTranscriptFocusByActivityKey.ts | xml | 2016-07-07T23:16:57 | 2024-08-16T00:12:37 | BotFramework-WebChat | microsoft/BotFramework-WebChat | 1,567 | 54 |
```xml
// this enum create by path_to_url
export enum ThemeOptionsEnum {
Basic = 1,
Lepton = 2,
LeptonXLite = 3,
LeptonX = 4,
}
``` | /content/code_sandbox/npm/ng-packs/packages/generators/src/generators/change-theme/theme-options.enum.ts | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 47 |
```xml
import React, { ComponentType } from "react"
import {
Pressable,
PressableProps,
PressableStateCallbackType,
StyleProp,
TextStyle,
ViewStyle,
} from "react-native"
import { colors, spacing, typography } from "app/theme"
import { Text, TextProps } from "./Text"
type Presets = keyof typeof $viewPresets
export interface ButtonAccessoryProps {
style: StyleProp<any>
pressableState: PressableStateCallbackType
disabled?: boolean
}
export interface ButtonProps extends PressableProps {
/**
* Text which is looked up via i18n.
*/
tx?: TextProps["tx"]
/**
* The text to display if not using `tx` or nested components.
*/
text?: TextProps["text"]
/**
* Optional options to pass to i18n. Useful for interpolation
* as well as explicitly setting locale or translation fallbacks.
*/
txOptions?: TextProps["txOptions"]
/**
* An optional style override useful for padding & margin.
*/
style?: StyleProp<ViewStyle>
/**
* An optional style override for the "pressed" state.
*/
pressedStyle?: StyleProp<ViewStyle>
/**
* An optional style override for the button text.
*/
textStyle?: StyleProp<TextStyle>
/**
* An optional style override for the button text when in the "pressed" state.
*/
pressedTextStyle?: StyleProp<TextStyle>
/**
* An optional style override for the button text when in the "disabled" state.
*/
disabledTextStyle?: StyleProp<TextStyle>
/**
* One of the different types of button presets.
*/
preset?: Presets
/**
* An optional component to render on the right side of the text.
* Example: `RightAccessory={(props) => <View {...props} />}`
*/
RightAccessory?: ComponentType<ButtonAccessoryProps>
/**
* An optional component to render on the left side of the text.
* Example: `LeftAccessory={(props) => <View {...props} />}`
*/
LeftAccessory?: ComponentType<ButtonAccessoryProps>
/**
* Children components.
*/
children?: React.ReactNode
/**
* disabled prop, accessed directly for declarative styling reasons.
* path_to_url#disabled
*/
disabled?: boolean
/**
* An optional style override for the disabled state
*/
disabledStyle?: StyleProp<ViewStyle>
}
/**
* A component that allows users to take actions and make choices.
* Wraps the Text component with a Pressable component.
*
* - [Documentation and Examples](path_to_url
*/
export function Button(props: ButtonProps) {
const {
tx,
text,
txOptions,
style: $viewStyleOverride,
pressedStyle: $pressedViewStyleOverride,
textStyle: $textStyleOverride,
pressedTextStyle: $pressedTextStyleOverride,
disabledTextStyle: $disabledTextStyleOverride,
children,
RightAccessory,
LeftAccessory,
disabled,
disabledStyle: $disabledViewStyleOverride,
...rest
} = props
const preset: Presets = props.preset ?? "default"
function $viewStyle({ pressed }: PressableStateCallbackType) {
return [
$viewPresets[preset],
$viewStyleOverride,
!!pressed && [$pressedViewPresets[preset], $pressedViewStyleOverride],
!!disabled && $disabledViewStyleOverride,
]
}
function $textStyle({ pressed }: PressableStateCallbackType) {
return [
$textPresets[preset],
$textStyleOverride,
!!pressed && [$pressedTextPresets[preset], $pressedTextStyleOverride],
!!disabled && $disabledTextStyleOverride,
]
}
return (
<Pressable
style={$viewStyle}
accessibilityRole="button"
accessibilityState={{ disabled: !!disabled }}
{...rest}
disabled={disabled}
>
{(state) => (
<>
{!!LeftAccessory && (
<LeftAccessory style={$leftAccessoryStyle} pressableState={state} disabled={disabled} />
)}
<Text tx={tx} text={text} txOptions={txOptions} style={$textStyle(state)}>
{children}
</Text>
{!!RightAccessory && (
<RightAccessory
style={$rightAccessoryStyle}
pressableState={state}
disabled={disabled}
/>
)}
</>
)}
</Pressable>
)
}
const $baseViewStyle: ViewStyle = {
minHeight: 56,
borderRadius: 4,
justifyContent: "center",
alignItems: "center",
flexDirection: "row",
paddingVertical: spacing.sm,
paddingHorizontal: spacing.sm,
overflow: "hidden",
}
const $baseTextStyle: TextStyle = {
fontSize: 16,
lineHeight: 20,
fontFamily: typography.primary.medium,
textAlign: "center",
flexShrink: 1,
flexGrow: 0,
zIndex: 2,
}
const $rightAccessoryStyle: ViewStyle = { marginStart: spacing.xs, zIndex: 1 }
const $leftAccessoryStyle: ViewStyle = { marginEnd: spacing.xs, zIndex: 1 }
const $viewPresets = {
default: [
$baseViewStyle,
{
borderWidth: 1,
borderColor: colors.palette.neutral400,
backgroundColor: colors.palette.neutral100,
},
] as StyleProp<ViewStyle>,
filled: [$baseViewStyle, { backgroundColor: colors.palette.neutral300 }] as StyleProp<ViewStyle>,
reversed: [
$baseViewStyle,
{ backgroundColor: colors.palette.neutral800 },
] as StyleProp<ViewStyle>,
}
const $textPresets: Record<Presets, StyleProp<TextStyle>> = {
default: $baseTextStyle,
filled: $baseTextStyle,
reversed: [$baseTextStyle, { color: colors.palette.neutral100 }],
}
const $pressedViewPresets: Record<Presets, StyleProp<ViewStyle>> = {
default: { backgroundColor: colors.palette.neutral200 },
filled: { backgroundColor: colors.palette.neutral400 },
reversed: { backgroundColor: colors.palette.neutral700 },
}
const $pressedTextPresets: Record<Presets, StyleProp<TextStyle>> = {
default: { opacity: 0.9 },
filled: { opacity: 0.9 },
reversed: { opacity: 0.9 },
}
``` | /content/code_sandbox/apps/example-app/app/components/Button.tsx | xml | 2016-04-15T21:58:32 | 2024-08-16T11:39:46 | reactotron | infinitered/reactotron | 14,757 | 1,390 |
```xml
export class ShareCalendarSignatureVerificationError extends Error {
senderEmail: string;
errors?: Error[];
constructor(senderEmail: string, errors?: Error[]) {
super('Authenticity of calendar invite could not be verified');
this.senderEmail = senderEmail;
this.errors = errors;
Object.setPrototypeOf(this, ShareCalendarSignatureVerificationError.prototype);
}
}
``` | /content/code_sandbox/packages/shared/lib/calendar/sharing/shareProton/ShareCalendarSignatureVerificationError.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 77 |
```xml
import chroma, { type Color, valid } from 'chroma-js';
import { type INode } from 'svgson';
import { getStyle, traverse } from '../cloning';
import {
closerMaterialColorTo,
getMaterialColorByKey,
} from './materialPalette';
/** Get all the colors used in the SVG node as a `Set` list. **/
export const getColorList = (node: INode) => {
const colors = new Set<string>();
traverse(node, (node) => {
// check colors in style attribute
const style = getStyle(node);
if (style) {
if (style.fill && isValidColor(style.fill)) {
colors.add(style.fill);
}
if (style.stroke && isValidColor(style.stroke)) {
colors.add(style.stroke);
}
}
// check colors in svg attributes
if (node.attributes) {
if (node.attributes.fill && isValidColor(node.attributes.fill)) {
colors.add(node.attributes.fill);
}
if (node.attributes.stroke && isValidColor(node.attributes.stroke)) {
colors.add(node.attributes.stroke);
}
if (
node.attributes['stop-color'] &&
isValidColor(node.attributes['stop-color'])
) {
colors.add(node.attributes['stop-color']);
}
}
});
return colors;
};
/** given a set of colors, orders them from dark to light. **/
export const orderDarkToLight = (colors: Set<string>) => {
const colorArray = Array.from(colors);
return colorArray.sort((a, b) => {
// sort by lightness
const lA = chroma(a).get('hsl.l');
const lB = chroma(b).get('hsl.l');
if (lA < lB) {
return -1;
} else if (lA > lB) {
return 1;
} else {
return 0;
}
});
};
/** Lightens a color by a given percentage. **/
const lighten = (color: Color, hslPercent: number) =>
color.set('hsl.l', color.get('hsl.l') + hslPercent);
/** checks if a string is a valid color. **/
export const isValidColor = (color: string | undefined): boolean => {
if (color === undefined) {
return false;
}
return valid(color);
};
/**
* Creates a map of color replacements based on the base color and
* the list of colors.
*
* Orders the list of colors from dark to light and replaces the darkest
* color with the base color. Then uses the hue of the base color and
* the material palette to find the most appropriate color for the rest
* in the list.
*/
export const replacementMap = (baseColor: string, colors: Set<string>) => {
if (!isValidColor(baseColor)) {
// try to get it from the material palette by key
const matCol = getMaterialColorByKey(baseColor);
if (matCol === undefined) {
throw new Error(`Invalid color: ${baseColor}`);
}
baseColor = matCol;
}
const orderedColors = orderDarkToLight(colors);
const baseColorChroma = chroma(baseColor);
const baseHue = baseColorChroma.get('hsl.h');
const replacement = new Map<string, string>();
replacement.set(orderedColors[0], baseColor);
// keep track of the latest color to determine if the next color
// should be lightened or not.
let latestColor = baseColorChroma;
for (let i = 1; i < orderedColors.length; i++) {
const color = chroma(orderedColors[i]);
let newColor = color.set('hsl.h', baseHue);
// the idea is to keep the paths with the same relative darkness
// as the original icon, but with different hues. So if the
// new color results in a darker color (as we are looping from
// dark to light), we set the lightness to the latest color and
// then lighten it a bit so that it's brighter than the latest one.
if (newColor.luminance() < latestColor.luminance()) {
newColor = newColor.set('hsl.l', latestColor.get('hsl.l'));
newColor = lighten(newColor, 0.1);
}
const matCol = closerMaterialColorTo(newColor.hex());
latestColor = chroma(matCol);
replacement.set(orderedColors[i], matCol);
}
return replacement;
};
``` | /content/code_sandbox/src/core/generator/clones/utils/color/colors.ts | xml | 2016-09-09T20:41:42 | 2024-08-16T07:38:46 | vscode-material-icon-theme | material-extensions/vscode-material-icon-theme | 2,007 | 973 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {action, makeObservable} from 'mobx';
class NetworkReconnectionHandler {
boundCallback?: Function;
constructor() {
makeObservable(this, {reset: action.bound});
}
handleReconnection = () => {
this.boundCallback?.();
};
retryOnConnectionLost(callback: (...params: any[]) => any) {
this.boundCallback = callback;
return (...params: any[]) => {
window.removeEventListener('online', this.handleReconnection);
window.addEventListener('online', this.handleReconnection);
this.boundCallback = callback.bind(this, ...params);
return callback(...params);
};
}
reset() {
window.removeEventListener('online', this.handleReconnection);
}
}
export {NetworkReconnectionHandler};
``` | /content/code_sandbox/operate/client/src/modules/stores/networkReconnectionHandler.ts | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 189 |
```xml
import { renderHook } from '@testing-library/react-hooks';
import * as React from 'react';
import { useAccordionItem_unstable } from './useAccordionItem';
import { useAccordionItemContextValues_unstable } from './useAccordionItemContextValues';
describe('useAccordionContextValues_unstable', () => {
it('should return a value for "accordion"', () => {
const { result } = renderHook(() => {
const state = useAccordionItem_unstable({ value: 'foo' }, React.createRef());
return useAccordionItemContextValues_unstable(state);
});
expect(result.current.accordionItem).toBeDefined();
expect(result.current.accordionItem.disabled).toBe(false);
expect(result.current.accordionItem.open).toBe(false);
expect(result.current.accordionItem.value).toBe('foo');
});
});
``` | /content/code_sandbox/packages/react-components/react-accordion/library/src/components/AccordionItem/useAccordionItemContextValues.test.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 173 |
```xml
import { DocumentRegistry } from '@jupyterlab/docregistry';
import { IDisposable } from '@lumino/disposable';
import { Signal } from '@lumino/signaling';
/**
* A class that manages the auto saving of a document.
*
* #### Notes
* Implements path_to_url
*/
export class SaveHandler implements IDisposable {
/**
* Construct a new save handler.
*/
constructor(options: SaveHandler.IOptions) {
this._context = options.context;
this._isConnectedCallback = options.isConnectedCallback || (() => true);
const interval = options.saveInterval || 120;
this._minInterval = interval * 1000;
this._interval = this._minInterval;
// Restart the timer when the contents model is updated.
this._context.fileChanged.connect(this._setTimer, this);
this._context.disposed.connect(this.dispose, this);
}
/**
* The save interval used by the timer (in seconds).
*/
get saveInterval(): number {
return this._interval / 1000;
}
set saveInterval(value: number) {
this._minInterval = this._interval = value * 1000;
if (this._isActive) {
this._setTimer();
}
}
/**
* Get whether the handler is active.
*/
get isActive(): boolean {
return this._isActive;
}
/**
* Get whether the save handler is disposed.
*/
get isDisposed(): boolean {
return this._isDisposed;
}
/**
* Dispose of the resources used by the save handler.
*/
dispose(): void {
if (this.isDisposed) {
return;
}
this._isDisposed = true;
clearTimeout(this._autosaveTimer);
Signal.clearData(this);
}
/**
* Start the autosaver.
*/
start(): void {
this._isActive = true;
this._setTimer();
}
/**
* Stop the autosaver.
*/
stop(): void {
this._isActive = false;
clearTimeout(this._autosaveTimer);
}
/**
* Set the timer.
*/
private _setTimer(): void {
clearTimeout(this._autosaveTimer);
if (!this._isActive) {
return;
}
this._autosaveTimer = window.setTimeout(() => {
if (this._isConnectedCallback()) {
this._save();
}
}, this._interval);
}
/**
* Handle an autosave timeout.
*/
private _save(): void {
const context = this._context;
// Trigger the next update.
this._setTimer();
if (!context) {
return;
}
// Bail if the model is not dirty or the file is not writable, or the dialog
// is already showing.
const writable = context.contentsModel && context.contentsModel.writable;
if (!writable || !context.model.dirty || this._inDialog) {
return;
}
const start = new Date().getTime();
context
.save()
.then(() => {
if (this.isDisposed) {
return;
}
const duration = new Date().getTime() - start;
// New save interval: higher of 10x save duration or min interval.
this._interval = Math.max(
this._multiplier * duration,
this._minInterval
);
// Restart the update to pick up the new interval.
this._setTimer();
})
.catch(err => {
// If the user canceled the save, do nothing.
const { name } = err;
if (name === 'ModalCancelError' || name === 'ModalDuplicateError') {
return;
}
// Otherwise, log the error.
console.error('Error in Auto-Save', err.message);
});
}
private _autosaveTimer = -1;
private _minInterval = -1;
private _interval = -1;
private _context: DocumentRegistry.Context;
private _isConnectedCallback: () => boolean;
private _isActive = false;
private _inDialog = false;
private _isDisposed = false;
private _multiplier = 10;
}
/**
* A namespace for `SaveHandler` statics.
*/
export namespace SaveHandler {
/**
* The options used to create a save handler.
*/
export interface IOptions {
/**
* The context associated with the file.
*/
context: DocumentRegistry.Context;
/**
* Autosaving should be paused while this callback function returns `false`.
* By default, it always returns `true`.
*/
isConnectedCallback?: () => boolean;
/**
* The minimum save interval in seconds (default is two minutes).
*/
saveInterval?: number;
}
}
``` | /content/code_sandbox/packages/docmanager/src/savehandler.ts | xml | 2016-06-03T20:09:17 | 2024-08-16T19:12:44 | jupyterlab | jupyterlab/jupyterlab | 14,019 | 1,021 |
```xml
import {TransactionalInterceptor} from "./TransactionalInterceptor.js";
import {anyFunction, anything, deepEqual, instance, mock, objectContaining, reset, verify, when} from "ts-mockito";
import {InjectorService, InterceptorContext} from "@tsed/di";
import {Logger} from "@tsed/logger";
import {EntityManager, IsolationLevel, MikroORM, OptimisticLockError} from "@mikro-orm/core";
import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js";
import {RetryStrategy} from "../interfaces/RetryStrategy.js";
import {MikroOrmContext} from "../services/MikroOrmContext.js";
// AHDOC: path_to_url
// TODO: avoid using ts-mockito
const resolvableInstance = <T extends object>(m: T): T =>
new Proxy<T>(instance(m), {
get(target, prop, receiver) {
if (["Symbol(Symbol.toPrimitive)", "then", "catch"].includes(prop.toString())) {
return undefined;
}
return Reflect.get(target, prop, receiver);
}
});
describe("TransactionalInterceptor", () => {
const mockedInjectorService = mock<InjectorService>();
const mockedMikroOrmRegistry = mock<MikroOrmRegistry>();
const mockedMikroOrm = mock<MikroORM>();
const mockedEntityManager = mock<EntityManager>();
const mockedLogger = mock<Logger>();
const mockedRetryStrategy = mock<RetryStrategy>();
const mockedMikroOrmContext = mock<MikroOrmContext>();
const next = jest.fn();
let entityManger!: EntityManager;
let mikroOrm!: MikroORM;
let transactionalInterceptor!: TransactionalInterceptor;
afterEach(() => {
next.mockReset();
reset<InjectorService | MikroOrmRegistry | MikroORM | EntityManager | Logger | RetryStrategy | MikroOrmContext>(
mockedInjectorService,
mockedMikroOrmRegistry,
mockedMikroOrm,
mockedEntityManager,
mockedLogger,
mockedMikroOrmContext,
mockedRetryStrategy
);
});
beforeEach(() => {
entityManger = resolvableInstance(mockedEntityManager);
mikroOrm = resolvableInstance(mockedMikroOrm);
when(mockedMikroOrm.em).thenReturn(entityManger);
transactionalInterceptor = new TransactionalInterceptor(
instance(mockedInjectorService),
instance(mockedMikroOrmRegistry),
instance(mockedMikroOrmContext),
instance(mockedLogger)
);
});
describe("intercept", () => {
it("should run within a existing context", async () => {
// arrange
const context = {} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
// act
await transactionalInterceptor.intercept(context, next);
// assert
verify(mockedEntityManager.transactional(anyFunction(), objectContaining({}))).once();
});
it("should set an isolation level", async () => {
// arrange
const context = {options: {isolationLevel: IsolationLevel.SERIALIZABLE}} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
// act
await transactionalInterceptor.intercept(context, next);
// assert
verify(mockedEntityManager.transactional(anyFunction(), objectContaining({isolationLevel: IsolationLevel.SERIALIZABLE}))).once();
});
it("should run within a new context", async () => {
// arrange
const context = {} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedMikroOrmContext.has(anything())).thenReturn(false);
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
when(mockedMikroOrmContext.run(anything(), anything())).thenCall((_: EntityManager[], func: (...args: unknown[]) => unknown) =>
func()
);
// act
await transactionalInterceptor.intercept(context, next);
// assert
verify(mockedMikroOrmContext.run(deepEqual([entityManger]), anyFunction())).twice();
verify(mockedEntityManager.transactional(anyFunction(), objectContaining({}))).once();
});
it("should perform a task within a transaction", async () => {
// arrange
const context = {} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
when(mockedEntityManager.transactional(anything(), anything())).thenCall((func: (...args: unknown[]) => unknown) => func());
// act
await transactionalInterceptor.intercept(context, next);
// assert
expect(next).toHaveBeenCalled();
});
it("should emit events in the right order", async () => {
// arrange
const context = {} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
when(mockedEntityManager.transactional(anything(), anything())).thenCall((func: (...args: unknown[]) => unknown) => func());
when(mockedMikroOrmContext.run(anything(), anything())).thenCall((_: EntityManager[], func: (...args: unknown[]) => unknown) =>
func()
);
// act
await transactionalInterceptor.intercept(context, next);
// assert
verify(mockedInjectorService.alterAsync("$beforeTransactionCommit", entityManger)).calledBefore(
mockedInjectorService.alterAsync("$afterTransactionCommit", entityManger)
);
});
it("should disable an explicit transaction", async () => {
// arrange
const context = {options: {disabled: true}} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
// act
await transactionalInterceptor.intercept(context, next);
// assert
expect(next).toHaveBeenCalled();
verify(mockedEntityManager.transactional(anything(), anything())).never();
});
it("should throw an error if context is lost", async () => {
// arrange
const context = {} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedEntityManager.transactional(anything(), anything())).thenCall((func: (...args: unknown[]) => unknown) => func());
// act
const result = transactionalInterceptor.intercept(context, next);
// assert
await expect(result).rejects.toThrow("No such context");
});
it("should throw an error if no such context", async () => {
// arrange
const context = {} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn();
// act
const result = transactionalInterceptor.intercept(context, next);
// assert
await expect(result).rejects.toThrow("No such context");
});
it("should throw an optimistic lock exception immediately if no retry strategy", async () => {
// arrange
const context = {} as InterceptorContext;
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedEntityManager.transactional(anything(), anything())).thenReject(OptimisticLockError.lockFailed("Lock"));
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
// act
const result = transactionalInterceptor.intercept(context, next);
// assert
await expect(result).rejects.toThrowError("Lock");
verify(mockedEntityManager.transactional(anyFunction(), objectContaining({}))).times(1);
});
it("should apply a retry mechanism if retry is enabled", async () => {
// arrange
transactionalInterceptor = new TransactionalInterceptor(
instance(mockedInjectorService),
instance(mockedMikroOrmRegistry),
instance(mockedMikroOrmContext),
instance(mockedLogger),
instance(mockedRetryStrategy)
);
const context = {options: {retry: true}} as InterceptorContext;
when(mockedMikroOrmContext.has(anything())).thenReturn(true);
when(mockedRetryStrategy.acquire(anything())).thenResolve();
when(mockedMikroOrmRegistry.get(anything())).thenReturn(mikroOrm);
when(mockedEntityManager.transactional(anything(), anything())).thenReject(OptimisticLockError.lockFailed("Lock"));
when(mockedMikroOrmContext.get(anything())).thenReturn(entityManger);
// act
await transactionalInterceptor.intercept(context, next);
// assert
verify(mockedRetryStrategy.acquire(anything())).once();
});
it("should log a warning if the retry is enabled, while a retry strategy is not resolved", async () => {
// arrange
const context = {options: {retry: true}} as InterceptorContext;
when(mockedMikroOrmRegistry.get(anything())).thenReturn(instance(mockedMikroOrm));
// act
await transactionalInterceptor.intercept(context, next);
// assert
verify(mockedLogger.warn(`To retry a transaction you have to implement a "${RetryStrategy.description}" interface`)).once();
});
});
});
``` | /content/code_sandbox/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 2,174 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LocalAndRemoteDifferentWidget</class>
<widget class="QWidget" name="LocalAndRemoteDifferentWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>345</width>
<height>172</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>7</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item alignment="Qt::AlignTop">
<widget class="QLabel" name="selectLabel">
<property name="font">
<font>
<family>Lato 13</family>
<pointsize>-1</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">#selectLabel
{
font-family: Lato Bold;
font-size: 13px;
line-height: 16px;
color: #333333;
}</string>
</property>
<property name="text">
<string>Please select which version you want to keep</string>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QWidget" name="chooseContainer" native="true">
<layout class="QVBoxLayout" name="chooseLayout">
<property name="spacing">
<number>12</number>
</property>
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item>
<widget class="CloudStalledIssueChooseWidget" name="chooseRemoteCopy" native="true"/>
</item>
<item>
<widget class="LocalStalledIssueChooseWidget" name="chooseLocalCopy" native="true"/>
</item>
<item>
<widget class="GenericChooseWidget" name="keepLastModifiedOption" native="true"/>
</item>
<item>
<widget class="GenericChooseWidget" name="keepBothOption" native="true"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>CloudStalledIssueChooseWidget</class>
<extends>QWidget</extends>
<header>stalled_issues_cases/LocalAndRemoteChooseWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>LocalStalledIssueChooseWidget</class>
<extends>QWidget</extends>
<header>stalled_issues_cases/LocalAndRemoteChooseWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GenericChooseWidget</class>
<extends>QWidget</extends>
<header>StalledIssueChooseWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
``` | /content/code_sandbox/src/MEGASync/stalled_issues/gui/stalled_issues_cases/linux/LocalAndRemoteDifferentWidget.ui | xml | 2016-02-10T18:28:05 | 2024-08-16T19:36:44 | MEGAsync | meganz/MEGAsync | 1,593 | 981 |
```xml
import { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';
import {
CodeMirrorEditor,
EditorExtensionRegistry
} from '@jupyterlab/codemirror';
import { YFile } from '@jupyter/ydoc';
import { Message, MessageLoop } from '@lumino/messaging';
import { Widget } from '@lumino/widgets';
import { simulate } from 'simulate-event';
class LogEditor extends CodeMirrorEditor {
methods: string[] = [];
events: string[] = [];
handleEvent(event: Event): void {
super.handleEvent(event);
this.events.push(event.type);
}
}
class LogWidget extends CodeEditorWrapper {
methods: string[] = [];
protected onActivateRequest(msg: Message): void {
super.onActivateRequest(msg);
this.methods.push('onActivateRequest');
}
protected onAfterAttach(msg: Message): void {
super.onAfterAttach(msg);
this.methods.push('onAfterAttach');
}
protected onBeforeDetach(msg: Message): void {
super.onBeforeDetach(msg);
this.methods.push('onBeforeDetach');
}
protected onAfterShow(msg: Message): void {
super.onAfterShow(msg);
this.methods.push('onAfterShow');
}
protected onResize(msg: Widget.ResizeMessage): void {
super.onResize(msg);
this.methods.push('onResize');
}
}
describe('CodeEditorWrapper', () => {
let widget: LogWidget;
const extensionsRegistry = (() => {
const registry = new EditorExtensionRegistry();
EditorExtensionRegistry.getDefaultExtensions()
.filter(ext => ['lineNumbers'].includes(ext.name))
.forEach(ext => {
registry.addExtension(ext);
});
return registry;
})();
const editorFactory = (options: CodeEditor.IOptions) => {
options.uuid = 'foo';
return new LogEditor({ ...options, extensionsRegistry });
};
beforeEach(() => {
const model = new CodeEditor.Model({ sharedModel: new YFile() });
widget = new LogWidget({
factory: editorFactory,
model
});
});
afterEach(() => {
widget.dispose();
});
describe('#constructor()', () => {
it('should be a CodeEditorWrapper', () => {
expect(widget).toBeInstanceOf(CodeEditorWrapper);
});
it('should add a focus listener', () => {
widget.node.tabIndex = -1;
simulate(widget.node, 'focus');
const editor = widget.editor as LogEditor;
expect(editor.events).toEqual(expect.arrayContaining(['focus']));
});
});
describe('#editor', () => {
it('should be a a code editor', () => {
expect(widget.editor.getOption('lineNumbers')).toBe(true);
});
});
describe('#dispose()', () => {
it('should dispose of the resources used by the widget', () => {
expect(widget.isDisposed).toBe(false);
widget.dispose();
expect(widget.isDisposed).toBe(true);
widget.dispose();
expect(widget.isDisposed).toBe(true);
});
it('should remove the focus listener', () => {
const editor = widget.editor as LogEditor;
expect(editor.isDisposed).toBe(false);
widget.dispose();
expect(editor.isDisposed).toBe(true);
widget.node.tabIndex = -1;
simulate(widget.node, 'focus');
expect(editor.events).toEqual(expect.not.arrayContaining(['focus']));
});
});
describe('#handleEvent()', () => {
describe('focus', () => {
it('should be a no-op if the editor was not resized', () => {
Widget.attach(widget, document.body);
const editor = widget.editor as LogEditor;
editor.methods = [];
simulate(editor.editor.contentDOM, 'focus');
expect(editor.methods).toEqual([]);
});
});
});
describe('#onActivateRequest()', () => {
it('should focus the editor', () => {
Widget.attach(widget, document.body);
MessageLoop.sendMessage(widget, Widget.Msg.ActivateRequest);
expect(widget.methods).toEqual(
expect.arrayContaining(['onActivateRequest'])
);
expect(widget.editor.hasFocus()).toBe(true);
});
});
});
``` | /content/code_sandbox/packages/codemirror/test/widget.spec.ts | xml | 2016-06-03T20:09:17 | 2024-08-16T19:12:44 | jupyterlab | jupyterlab/jupyterlab | 14,019 | 875 |
```xml
// Pre-run
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import * as chaiFs from 'chai-fs';
import * as fs from 'fs';
import * as path from 'path';
// Actual Test Imports
import downloadChromeExtension from '../src/downloadChromeExtension';
import { REACT_DEVELOPER_TOOLS } from '../src/';
chai.use(chaiAsPromised);
chai.use(chaiFs);
chai.should();
describe('Extension Downloader', () => {
describe('when given a valid extension ID', () => {
it('should return a valid path', (done) => {
downloadChromeExtension(REACT_DEVELOPER_TOOLS.id)
.then((dir) => {
dir.should.be.a.directory();
done();
})
.catch((err) => done(err));
});
it('should download a valid extension', (done) => {
downloadChromeExtension(REACT_DEVELOPER_TOOLS.id)
.then((dir) => {
dir.should.be.a.directory();
path.resolve(dir, 'manifest.json').should.be.a.file();
done();
})
.catch((err) => done(err));
});
describe('with the force parameter', () => {
it('should always re-download the extension', (done) => {
downloadChromeExtension(REACT_DEVELOPER_TOOLS.id)
.then((dir) => {
dir.should.be.a.directory();
fs.writeFileSync(path.resolve(dir, 'old_ext.file'), '__TEST__');
path.resolve(dir, 'manifest.json').should.be.a.file();
path.resolve(dir, 'old_ext.file').should.be.a.file();
downloadChromeExtension(REACT_DEVELOPER_TOOLS.id, true)
.then((newDir) => {
newDir.should.be.equal(dir);
newDir.should.be.a.directory();
path.resolve(newDir, 'manifest.json').should.be.a.file();
fs.existsSync(path.resolve(newDir, 'old_ext.file')).should.be.equal(false);
done();
})
.catch((err) => done(err));
})
.catch((err) => done(err));
});
});
});
describe('when given an invalid extension ID', () => {
it('should reject the promise', () =>
downloadChromeExtension('YOLO SWAGGINGS').should.be.rejected);
});
});
``` | /content/code_sandbox/test/download_spec.ts | xml | 2016-06-08T11:08:33 | 2024-08-12T19:09:52 | electron-devtools-installer | MarshallOfSound/electron-devtools-installer | 1,106 | 503 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="path_to_url"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:pivotX="12"
android:pivotY="4"
android:scaleX="1.15"
android:scaleY="1.15">
<group
android:pivotX="12"
android:pivotY="12"
android:scaleX="-1">
<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="M12,5V1L7,6l5,5V7c3.31,0 6,2.69 6,6s-2.69,6 -6,6 -6,-2.69 -6,-6H4c0,4.42 3.58,8 8,8s8,-3.58 8,-8 -3.58,-8 -8,-8z" />
</group>
<group
android:pivotX="12"
android:pivotY="8"
android:scaleX="0.9"
android:scaleY="0.9">
<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="m 10.030088,16.051511 0.770367,-0.06521 q 0.08559,0.562491 0.395373,0.847811 0.313853,0.281245 0.754062,0.281245 0.529882,0 0.896723,-0.399449 0.366841,-0.39945 0.366841,-1.059764 0,-0.627706 -0.354612,-0.990471 -0.350538,-0.362765 -0.92118,-0.362765 -0.354613,0 -0.639933,0.163041 -0.285322,0.158964 -0.448362,0.415752 l -0.688846,-0.08967 0.578794,-3.069238 h 2.971413 v 0.701074 H 11.32626 l -0.322005,1.60595 q 0.538034,-0.374993 1.129056,-0.374993 0.782594,0 1.320628,0.54211 0.538034,0.542109 0.538034,1.393996 0,0.811127 -0.472817,1.402149 -0.574718,0.72553 -1.569266,0.72553 -0.815202,0 -1.332856,-0.456514 -0.513578,-0.456516 -0.586946,-1.210578 z" />
</group>
</group>
</vector>
``` | /content/code_sandbox/packages/expo-video/android/src/main/res/drawable/seek_forwards_5s.xml | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 675 |
```xml
/*
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
// TypeScript Version: 4.1
/// <reference types="@stdlib/types"/>
import { ArrayLike } from '@stdlib/types/array';
/**
* Interface describing loop interchange data.
*/
interface LoopOrderObject {
/**
* Dimensions sorted in loop order.
*/
sh: Array<number>;
/**
* Input array strides sorted in loop order.
*/
sx: Array<number>;
/**
* Output array strides sorted in loop order.
*/
sy: Array<number>;
/**
* Dimension indices sorted in loop order.
*/
idx: Array<number>;
}
/**
* Reorders ndarray dimensions and associated strides for loop interchange.
*
* ## Notes
*
* - The returned object has the following properties:
*
* - **sh**: dimensions sorted in loop order.
* - **sx**: input ndarray strides sorted in loop order.
* - **sy**: output ndarray strides sorted in loop order.
* - **idx**: dimension indices sorted in loop order.
*
* - When iterating over the elements of a multi-dimensional array, accessing elements which are closer in memory can improve performance. To this end, loop interchange is a technique used in loop nest optimization to improve locality of reference and take advantage of CPU cache.
*
* The purpose of this function is to order ndarray dimensions according to the magnitude of **input array** strides. By using the ordered dimensions and associated strides, one can construct nested loops (one for each dimension) such that the innermost loop iterates over the dimension in which array elements are closest in memory and the outermost loop iterates over the dimension in which array elements are farthest apart in memory. As a consequence, element iteration is optimized to minimize cache misses and ensure locality of reference.
*
* - Cache performance may be degraded if the layout order (i.e., row-major or column-major) differs for the input and output ndarrays. This function is intended to optimize cache performance for the input ndarray. If the output ndarray has a different layout order (e.g., if the input ndarray is row-major and the output ndarray is column-major), cache misses are likely for the output ndarray. In general, to ensure best performance, input and output ndarrays should have the same layout order.
*
* - The function assumes that the input and output ndarrays have the same shape. Hence, loop interchange order should only be determined **after** broadcasting.
*
* @param sh - array dimensions
* @param sx - input array stride lengths
* @param sy - output array stride lengths
* @returns loop interchange data
*
* @example
* var sh = [ 2, 3, 4 ];
*
* var sx = [ 12, 4, 1 ]; // row-major
* var sy = [ 1, -2, 6 ]; // column-major
*
* var o = unaryLoopOrder( sh, sx, sy );
* // returns {...}
*
* var ssh = o.sh;
* // returns [ 4, 3, 2 ]
*
* var ssx = o.sx;
* // returns [ 1, 4, 12 ]
*
* var ssy = o.sy;
* // returns [ 6, -2, 1 ]
*
* var idx = o.idx;
* // returns [ 2, 1, 0 ]
*/
declare function unaryLoopOrder( shape: ArrayLike<number>, stridesX: ArrayLike<number>, stridesY: ArrayLike<number> ): LoopOrderObject;
// EXPORTS //
export = unaryLoopOrder;
``` | /content/code_sandbox/lib/node_modules/@stdlib/ndarray/base/unary-loop-interchange-order/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 786 |
```xml
<page id="footer">
<section layout="row" source="popularSearches"/>
<section id="extraFooter" layout="row" source="topArticles"/>
</page>
``` | /content/code_sandbox/config-model/src/test/java/com/yahoo/vespa/model/container/search/test/pages/footer.xml | xml | 2016-06-03T20:54:20 | 2024-08-16T15:32:01 | vespa | vespa-engine/vespa | 5,524 | 40 |
```xml
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { getClientVPNInfo } from '@proton/shared/lib/api/vpn';
import type { Currency } from '@proton/shared/lib/interfaces';
import useApi from './useApi';
import useCache from './useCache';
export interface VPNUserInfo {
VPN: {
ExpirationTime: number;
Name: string;
Password: string;
GroupID: string;
Status: number;
PlanName: string | null;
PlanTitle: string | null;
MaxTier: number | null;
MaxConnect: number;
Groups: string[];
NeedConnectionAllocation: boolean;
};
Warnings: any[];
Services: number;
Subscribed: number;
Delinquent: number;
HasPaymentMethod: number;
Credit: number;
Currency: Currency;
}
const useUserVPN = () => {
const api = useApi();
const mountedRef = useRef(true);
const cache = useCache();
const [state, setState] = useState<{
error?: Error;
result?: VPNUserInfo;
loading: boolean;
}>(() => ({ result: cache.get('vpn')?.result, loading: false }));
const fetch = useCallback(async (maxAge = 0) => {
try {
const cachedValue = cache.get('vpn');
const time = new Date().getTime();
if (cachedValue?.time + maxAge >= time) {
setState({ result: cachedValue?.result, loading: false });
return;
}
if (cachedValue?.promise) {
const result = await cachedValue?.promise;
setState({ result, loading: false });
return;
}
const promise = api(getClientVPNInfo()) as Promise<VPNUserInfo>;
cache.set('vpn', { promise });
const result = await promise;
cache.set('vpn', {
result,
time,
});
if (mountedRef.current) {
setState({ result, loading: false });
}
} catch (e) {
cache.delete('vpn');
if (mountedRef.current) {
setState({ error: e as Error, loading: false });
}
}
}, []);
useEffect(() => {
fetch(30_000);
return () => {
mountedRef.current = false;
};
}, []);
return useMemo(
() => ({
...state,
fetch,
}),
[state]
);
};
export default useUserVPN;
``` | /content/code_sandbox/packages/components/hooks/useUserVPN.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 529 |
```xml
import { Component, OnInit, Input, ViewEncapsulation } from '@angular/core';
import { Router, NavigationExtras } from '@angular/router';
@Component({
selector: 'app-main-header',
templateUrl: './main-header.component.html',
styleUrls: ['./main-header.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class MainHeaderComponent implements OnInit {
@Input() totalChartsNumber: number
// Store the router
constructor(private router: Router) { }
ngOnInit() { }
searchCharts(input: HTMLInputElement): void {
// Empty query
if(input.value === ''){
this.router.navigate(['/charts']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: { 'q': input.value }
};
this.router.navigate(['/charts'], navigationExtras);
}
}
}
``` | /content/code_sandbox/frontend/src/app/main-header/main-header.component.ts | xml | 2016-08-24T19:35:09 | 2024-07-01T06:23:47 | monocular | helm/monocular | 1,423 | 174 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
<!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- Generate ready to run images during publishing to improve cold start time. -->
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
<ItemGroup>
<Compile Include="Function.fs" />
</ItemGroup>
<ItemGroup>
<Content Include="aws-lambda-tools-defaults.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.2.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.1" />
</ItemGroup>
<ItemGroup>
<Content Include="aws-lambda-tools-defaults.json" />
<None Include="Dockerfile" />
<None Include="Readme.md" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | xml | 2016-11-11T20:43:34 | 2024-08-15T16:57:53 | aws-lambda-dotnet | aws/aws-lambda-dotnet | 1,558 | 274 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Yams.xcscheme</key>
<dict></dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict></dict>
</dict>
</plist>
``` | /content/code_sandbox/Yams.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist | xml | 2016-11-19T21:55:12 | 2024-08-16T17:40:50 | Yams | jpsim/Yams | 1,090 | 87 |
```xml
// Will include more rules in the future
import { hasPDFSupport } from './browser';
import { isAudio, isPDF, isSupportedImage, isSupportedText, isVideo, isWordDocument } from './mimetype';
// The reason to limit preview is because the file needs to be loaded
// in memory. At this moment we don't even have any progress bar so
// it is better to have reasonable lower limit.
// It could be dropped once we support video streaming or dynamic
// text loading and other tricks to avoid the need to load it all.
export const MAX_PREVIEW_FILE_SIZE = 1024 * 1024 * 100;
// Adding a lot of text to DOM crashes or slows down the browser.
// Even just 2 MB is enough to hang the browser for a short amount of time.
// Someday we'll do text windowing, but for now this will do.
export const MAX_PREVIEW_TEXT_SIZE = 1024 * 1024 * 2;
export const isPreviewTooLarge = (mimeType?: string, fileSize?: number) => {
if (!mimeType || !fileSize) {
return false;
}
const maxSize = isSupportedText(mimeType) ? MAX_PREVIEW_TEXT_SIZE : MAX_PREVIEW_FILE_SIZE;
return fileSize >= maxSize;
};
export const isPreviewAvailable = (mimeType: string, fileSize?: number) => {
return (
(!fileSize || !isPreviewTooLarge(mimeType, fileSize)) &&
(isSupportedImage(mimeType) ||
isVideo(mimeType) ||
isAudio(mimeType) ||
isSupportedText(mimeType) ||
(hasPDFSupport() && isPDF(mimeType)) ||
isWordDocument(mimeType))
);
};
``` | /content/code_sandbox/packages/shared/lib/helpers/preview.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 360 |
```xml
import {Property, ReadOnly, Required} from "@tsed/schema";
import {Currency, getFormioSchema, Hidden, TableView, Textarea} from "../src/index.js";
describe("Nested form integration", () => {
it("should generate form and nested form", async () => {
class Price {
@Currency()
amount: number;
}
class Product {
@Hidden()
id: string;
@Textarea()
description: string;
@Property()
price: Price;
}
const form = await getFormioSchema(Product);
expect(form).toEqual({
machineName: "product",
name: "product",
title: "Product",
type: "form",
display: "form",
submissionAccess: [],
access: [],
tags: [],
components: [
{
key: "id",
label: "Id",
input: true,
type: "textfield",
hidden: true,
disabled: false,
validate: {
required: false
}
},
{
key: "description",
label: "Description",
input: true,
type: "textarea",
autoExpand: false,
disabled: false,
validate: {
required: false
}
},
{
key: "price",
disabled: false,
tableView: false,
type: "form",
display: "form",
input: true,
components: [
{
key: "panel",
label: "Price",
disabled: false,
collapsible: false,
input: false,
tableView: false,
components: [
{
key: "amount",
label: "Amount",
currency: "USD",
inputFormat: "plain",
mask: false,
spellcheck: true,
delimiter: true,
type: "number",
disabled: false,
input: true,
requireDecimal: false,
validate: {
required: false
}
}
]
}
],
validate: {
required: false
}
}
]
});
});
it("should generate form and nested form with some extra decorators", async () => {
class Price {
@Currency()
amount: number;
}
class Product {
@Textarea()
description: string;
@Required()
@TableView(true)
@ReadOnly()
price: Price;
}
const form = await getFormioSchema(Product);
expect(form).toEqual({
access: [],
components: [
{
autoExpand: false,
disabled: false,
input: true,
key: "description",
label: "Description",
type: "textarea",
validate: {
required: false
}
},
{
key: "price",
label: "Price",
validate: {
required: true
}
}
],
display: "form",
machineName: "product",
name: "product",
submissionAccess: [],
tags: [],
title: "Product",
type: "form"
});
});
});
``` | /content/code_sandbox/packages/third-parties/schema-formio/test/nested-form.integration.spec.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 665 |
```xml
import { ICAL_ATTENDEE_RSVP } from '@proton/shared/lib/calendar/constants';
import { extractEmailAddress } from '@proton/shared/lib/calendar/vcalConverter';
import { getAttendeePartstat, getAttendeeRole } from '@proton/shared/lib/calendar/vcalHelper';
import type { AttendeeModel } from '@proton/shared/lib/interfaces/calendar';
import type { VcalAttendeeProperty } from '@proton/shared/lib/interfaces/calendar/VcalModel';
export const propertiesToAttendeeModel = (attendee?: VcalAttendeeProperty[]): AttendeeModel[] => {
if (!attendee) {
return [];
}
return attendee.map((attendee) => {
const email = extractEmailAddress(attendee);
if (email === undefined) {
throw new Error('Malformed attendee');
}
const result: AttendeeModel = {
email,
rsvp: ICAL_ATTENDEE_RSVP.TRUE,
cn: attendee.parameters?.cn || email,
partstat: getAttendeePartstat(attendee),
role: getAttendeeRole(attendee),
token: attendee?.parameters?.['x-pm-token'],
};
return result;
});
};
``` | /content/code_sandbox/applications/calendar/src/app/components/eventModal/eventForm/propertiesToAttendeeModel.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 255 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="path_to_url">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F3A48900-ADED-7C44-A952-32824CCFFD54}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace></RootNamespace>
<AssemblyName>Assembly-CSharp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseDirectory>Assets</BaseDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_OBSOLETE_API_UPDATING;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Temp\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>C:/Program Files/Unity 5.0.0b12/Editor/Data/Managed/UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>C:/Program Files/Unity 5.0.0b12/Editor/Data/Managed/UnityEditor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Client.cs" />
<Compile Include="Assets\MyData.cs" />
<Compile Include="Assets\MyExporter.cs" />
<Reference Include="UnityEngine.UI">
<HintPath>C:/Program Files/Unity 5.0.0b12/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
``` | /content/code_sandbox/SomeTest/ScriptableDemo/Assembly-CSharp.csproj | xml | 2016-04-25T14:37:08 | 2024-08-16T09:19:37 | Unity3DTraining | XINCGer/Unity3DTraining | 7,368 | 944 |
```xml
/*
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
import snansumkbn2 = require( './index' );
// TESTS //
// The function returns a number...
{
const x = new Float32Array( 10 );
snansumkbn2( x.length, x, 1 ); // $ExpectType number
}
// The compiler throws an error if the function is provided a first argument which is not a number...
{
const x = new Float32Array( 10 );
snansumkbn2( '10', x, 1 ); // $ExpectError
snansumkbn2( true, x, 1 ); // $ExpectError
snansumkbn2( false, x, 1 ); // $ExpectError
snansumkbn2( null, x, 1 ); // $ExpectError
snansumkbn2( undefined, x, 1 ); // $ExpectError
snansumkbn2( [], x, 1 ); // $ExpectError
snansumkbn2( {}, x, 1 ); // $ExpectError
snansumkbn2( ( x: number ): number => x, x, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a second argument which is not a Float32Array...
{
const x = new Float32Array( 10 );
snansumkbn2( x.length, 10, 1 ); // $ExpectError
snansumkbn2( x.length, '10', 1 ); // $ExpectError
snansumkbn2( x.length, true, 1 ); // $ExpectError
snansumkbn2( x.length, false, 1 ); // $ExpectError
snansumkbn2( x.length, null, 1 ); // $ExpectError
snansumkbn2( x.length, undefined, 1 ); // $ExpectError
snansumkbn2( x.length, [], 1 ); // $ExpectError
snansumkbn2( x.length, {}, 1 ); // $ExpectError
snansumkbn2( x.length, ( x: number ): number => x, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a third argument which is not a number...
{
const x = new Float32Array( 10 );
snansumkbn2( x.length, x, '10' ); // $ExpectError
snansumkbn2( x.length, x, true ); // $ExpectError
snansumkbn2( x.length, x, false ); // $ExpectError
snansumkbn2( x.length, x, null ); // $ExpectError
snansumkbn2( x.length, x, undefined ); // $ExpectError
snansumkbn2( x.length, x, [] ); // $ExpectError
snansumkbn2( x.length, x, {} ); // $ExpectError
snansumkbn2( x.length, x, ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the function is provided an unsupported number of arguments...
{
const x = new Float32Array( 10 );
snansumkbn2(); // $ExpectError
snansumkbn2( x.length ); // $ExpectError
snansumkbn2( x.length, x ); // $ExpectError
snansumkbn2( x.length, x, 1, 10 ); // $ExpectError
}
// Attached to main export is an `ndarray` method which returns a number...
{
const x = new Float32Array( 10 );
snansumkbn2.ndarray( x.length, x, 1, 0 ); // $ExpectType number
}
// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
{
const x = new Float32Array( 10 );
snansumkbn2.ndarray( '10', x, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( true, x, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( false, x, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( null, x, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( undefined, x, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( [], x, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( {}, x, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Float32Array...
{
const x = new Float32Array( 10 );
snansumkbn2.ndarray( x.length, 10, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, '10', 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, true, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, false, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, null, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, undefined, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, [], 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, {}, 1, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number...
{
const x = new Float32Array( 10 );
snansumkbn2.ndarray( x.length, x, '10', 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, true, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, false, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, null, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, undefined, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, [], 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, {}, 0 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError
}
// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
{
const x = new Float32Array( 10 );
snansumkbn2.ndarray( x.length, x, 1, '10' ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, true ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, false ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, null ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, undefined ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, [] ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, {} ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
{
const x = new Float32Array( 10 );
snansumkbn2.ndarray(); // $ExpectError
snansumkbn2.ndarray( x.length ); // $ExpectError
snansumkbn2.ndarray( x.length, x ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1 ); // $ExpectError
snansumkbn2.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/blas/ext/base/snansumkbn2/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 1,943 |
```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 { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { defaultHttpOptionsFromConfig, RequestConfig } from '@core/http/http-utils';
import { Observable } from 'rxjs';
import { QueueInfo, QueueStatisticsInfo, ServiceType } from '@shared/models/queue.models';
import { PageLink } from '@shared/models/page/page-link';
import { PageData } from '@shared/models/page/page-data';
import { map } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class QueueService {
constructor(
private http: HttpClient
) { }
public getQueueById(queueId: string, config?: RequestConfig): Observable<QueueInfo> {
return this.http.get<QueueInfo>(`/api/queues/${queueId}`, defaultHttpOptionsFromConfig(config));
}
public getQueueByName(queueName: string, config?: RequestConfig): Observable<QueueInfo> {
return this.http.get<QueueInfo>(`/api/queues/name/${queueName}`, defaultHttpOptionsFromConfig(config));
}
public getTenantQueuesByServiceType(pageLink: PageLink,
serviceType: ServiceType,
config?: RequestConfig): Observable<PageData<QueueInfo>> {
return this.http.get<PageData<QueueInfo>>(`/api/queues${pageLink.toQuery()}&serviceType=${serviceType}`,
defaultHttpOptionsFromConfig(config));
}
public saveQueue(queue: QueueInfo, serviceType: ServiceType, config?: RequestConfig): Observable<QueueInfo> {
return this.http.post<QueueInfo>(`/api/queues?serviceType=${serviceType}`, queue, defaultHttpOptionsFromConfig(config));
}
public deleteQueue(queueId: string) {
return this.http.delete(`/api/queues/${queueId}`);
}
private parseQueueStatName = (queueStat: QueueStatisticsInfo) => Object.defineProperty(queueStat, 'name', {
get() { return `${this.queueName} (${this.serviceId})`; }
});
public getQueueStatistics(pageLink: PageLink, config?: RequestConfig): Observable<PageData<QueueStatisticsInfo>> {
return this.http.get<PageData<QueueStatisticsInfo>>(`/api/queueStats${pageLink.toQuery()}`,
defaultHttpOptionsFromConfig(config)).pipe(
map(queueData => {
queueData.data.map(queueStat => this.parseQueueStatName(queueStat));
return queueData;
})
);
}
public getQueueStatisticsById(queueStatId: string, config?: RequestConfig): Observable<QueueStatisticsInfo> {
return this.http.get<QueueStatisticsInfo>(`/api/queueStats/${queueStatId}`, defaultHttpOptionsFromConfig(config)).pipe(
map(queueStat => this.parseQueueStatName(queueStat)));
}
public getQueueStatisticsByIds(queueStatIds: Array<string>, config?: RequestConfig): Observable<Array<QueueStatisticsInfo>> {
return this.http.get<Array<QueueStatisticsInfo>>(`/api/queueStats?QueueStatsIds=${queueStatIds.join(',')}`,
defaultHttpOptionsFromConfig(config)).pipe(
map(queueStats => queueStats.map(queueStat => this.parseQueueStatName(queueStat))
)
);
}
}
``` | /content/code_sandbox/ui-ngx/src/app/core/http/queue.service.ts | xml | 2016-12-01T09:33:30 | 2024-08-16T19:58:25 | thingsboard | thingsboard/thingsboard | 16,820 | 723 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "path_to_url">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: path_to_url -->
<!-- code: path_to_url -->
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#272822</string>
<key>caret</key>
<string>#F8F8F0</string>
<key>foreground</key>
<string>#F8F8F2</string>
<key>invisibles</key>
<string>#3B3A32</string>
<key>lineHighlight</key>
<string>#3E3D32</string>
<key>selection</key>
<string>#49483E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comment</string>
<key>scope</key>
<string>comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#75715E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String</string>
<key>scope</key>
<string>string</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#E6DB74</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Number</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#AE81FF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Built-in constant</string>
<key>scope</key>
<string>constant.language</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#AE81FF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>User-defined constant</string>
<key>scope</key>
<string>constant.character, constant.other</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#AE81FF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variable</string>
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keyword</string>
<key>scope</key>
<string>keyword</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#F92672</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>storage</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#F92672</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage type</string>
<key>scope</key>
<string>storage.type</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#66D9EF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Class name</string>
<key>scope</key>
<string>entity.name.class</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>underline</string>
<key>foreground</key>
<string>#A6E22E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inherited class</string>
<key>scope</key>
<string>entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic underline</string>
<key>foreground</key>
<string>#A6E22E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Function name</string>
<key>scope</key>
<string>entity.name.function</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#A6E22E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Function argument</string>
<key>scope</key>
<string>variable.parameter</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#FD971F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tag name</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#F92672</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tag attribute</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#A6E22E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library function</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#66D9EF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library constant</string>
<key>scope</key>
<string>support.constant</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#66D9EF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library class/type</string>
<key>scope</key>
<string>support.type, support.class</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#66D9EF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library variable</string>
<key>scope</key>
<string>support.other.variable</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid</string>
<key>scope</key>
<string>invalid</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#F92672</string>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#F8F8F0</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid deprecated</string>
<key>scope</key>
<string>invalid.deprecated</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#AE81FF</string>
<key>foreground</key>
<string>#F8F8F0</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>semanticClass</key>
<string>theme.dark.monokai</string>
</dict>
</plist>
``` | /content/code_sandbox/sublime/themes/monokai.tmTheme | xml | 2016-12-06T02:57:25 | 2024-08-16T19:49:35 | zola | getzola/zola | 13,258 | 2,380 |
```xml
import logging from 'log4js';
import sinon from 'sinon';
import { logger } from './producers.js';
let log: sinon.SinonStubbedInstance<logging.Logger>;
beforeEach(() => {
log = logger();
sinon.stub(logging, 'getLogger').returns(log);
});
export function currentLogMock(): any {
return log;
}
``` | /content/code_sandbox/packages/core/test/helpers/log-mock.ts | xml | 2016-02-12T13:14:28 | 2024-08-15T18:38:25 | stryker-js | stryker-mutator/stryker-js | 2,561 | 75 |
```xml
import { RouterFactory, useNavigationBuilder } from '@react-navigation/native';
import * as React from 'react';
type NavigatorTypes = ReturnType<typeof useNavigationBuilder>;
export declare const NavigatorContext: React.Context<{
contextKey: string;
state: NavigatorTypes['state'];
navigation: NavigatorTypes['navigation'];
descriptors: NavigatorTypes['descriptors'];
router: RouterFactory<any, any, any>;
} | null>;
export type NavigatorProps = {
initialRouteName?: Parameters<typeof useNavigationBuilder>[1]['initialRouteName'];
screenOptions?: Parameters<typeof useNavigationBuilder>[1]['screenOptions'];
children?: Parameters<typeof useNavigationBuilder>[1]['children'];
router?: Parameters<typeof useNavigationBuilder>[0];
};
/** An unstyled custom navigator. Good for basic web layouts */
export declare function Navigator({ initialRouteName, screenOptions, children, router }: NavigatorProps): React.JSX.Element | null;
export declare namespace Navigator {
var Slot: typeof import("./Navigator").Slot;
var useContext: typeof useNavigatorContext;
var Screen: typeof import("./Screen").Screen;
}
export declare function useNavigatorContext(): {
contextKey: string;
state: Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>;
navigation: {
dispatch(action: Readonly<{
type: string;
payload?: object | undefined;
source?: string | undefined;
target?: string | undefined;
}> | ((state: Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>) => Readonly<{
type: string;
payload?: object | undefined;
source?: string | undefined;
target?: string | undefined;
}>)): void;
navigate<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName] | [screen: RouteName, params: object | undefined] : never): void;
navigate<RouteName_1 extends string>(options: RouteName_1 extends unknown ? {
key: string;
params?: object | undefined;
merge?: boolean | undefined;
} | {
name: RouteName_1;
key?: string | undefined;
params: object | undefined;
merge?: boolean | undefined;
} : never): void;
reset(state: Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}> | import("@react-navigation/native").PartialState<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>>): void;
goBack(): void;
isFocused(): boolean;
canGoBack(): boolean;
getId(): string | undefined;
getParent<T = import("@react-navigation/native").NavigationHelpers<import("@react-navigation/native").ParamListBase, {}> | undefined>(id?: string | undefined): T;
getState(): Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>;
} & import("@react-navigation/native").PrivateValueStore<[import("@react-navigation/native").ParamListBase, unknown, unknown]> & import("@react-navigation/native").EventEmitter<Record<string, any>> & {
setParams<RouteName_2 extends string>(params: Partial<object | undefined>): void;
} & Record<string, () => void>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<{}, Omit<{
dispatch(action: Readonly<{
type: string;
payload?: object | undefined;
source?: string | undefined;
target?: string | undefined;
}> | ((state: Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>) => Readonly<{
type: string;
payload?: object | undefined;
source?: string | undefined;
target?: string | undefined;
}>)): void;
navigate<RouteName_3 extends string>(...args: RouteName_3 extends unknown ? [screen: RouteName_3] | [screen: RouteName_3, params: object | undefined] : never): void;
navigate<RouteName_1_1 extends string>(options: RouteName_1_1 extends unknown ? {
key: string;
params?: object | undefined;
merge?: boolean | undefined;
} | {
name: RouteName_1_1;
key?: string | undefined;
params: object | undefined;
merge?: boolean | undefined;
} : never): void;
reset(state: Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}> | import("@react-navigation/native").PartialState<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>>): void;
goBack(): void;
isFocused(): boolean;
canGoBack(): boolean;
getId(): string | undefined;
getParent<T_1 = import("@react-navigation/native").NavigationHelpers<import("@react-navigation/native").ParamListBase, {}> | undefined>(id?: string | undefined): T_1;
getState(): Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>;
} & import("@react-navigation/native").PrivateValueStore<[import("@react-navigation/native").ParamListBase, unknown, unknown]>, "getParent"> & {
getParent<T_1 = import("@react-navigation/native").NavigationProp<import("@react-navigation/native").ParamListBase, string, undefined, Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>, {}, {}> | undefined>(id?: string | undefined): T_1;
setParams(params: Partial<object | undefined>): void;
setOptions(options: Partial<{}>): void;
} & import("@react-navigation/native").EventConsumer<Record<string, any> & import("@react-navigation/native").EventMapCore<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[] | undefined;
routes: (Readonly<{
key: string;
name: string;
path?: string | undefined;
}> & Readonly<{
params?: Readonly<object | undefined>;
}> & {
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
})[];
type: string;
stale: false;
}>>> & import("@react-navigation/native").PrivateValueStore<[import("@react-navigation/native").ParamListBase, string, Record<string, any>]> & Record<string, () => void>, import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>>>;
router: RouterFactory<any, any, any>;
};
export declare function useSlot(): JSX.Element | null;
/** Renders the currently selected content. */
export declare function Slot(props: Omit<NavigatorProps, 'children'>): React.JSX.Element;
export declare function QualifiedSlot(): JSX.Element | null;
export declare function DefaultNavigator(): React.JSX.Element;
export {};
//# sourceMappingURL=Navigator.d.ts.map
``` | /content/code_sandbox/packages/expo-router/build/views/Navigator.d.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 2,338 |
```xml
<Documentation>
<Docs DocId="T:CoreImage.CIAffineTransform">
<summary>Performs an affine transform on an image.</summary>
<remarks>
<para>The following example shows this filter in use</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Create a CIImage from a File
CIImage flower = CIImage.FromCGImage (UIImage.FromFile ("flower.png").CGImage);
// Create an AffineTransform to Skew the Image
var transform = new CGAffineTransform (1F, .5F, .5F, 1F, 0F, 0F);
var affineTransform = new CIAffineTransform ()
{
Image = flower,
Transform = transform
};
// Get the Transformed Image
var output affineTransform.OutputImage;
// To render the results, we need to create a context, and then
// use one of the context rendering APIs, in this case, we render the
// result into a CoreGraphics image, which is merely a useful representation
//
var context = CIContext.FromOptions (null);
var cgimage = context.CreateCGImage (output, output.Extent);
// The above cgimage can be added to a screen view, for example, this
// would add it to a UIImageView on the screen:
myImageView.Image = UIImage.FromImage (cgimage);
]]></code>
</example>
<para>
With the following source:
</para>
<para>
<img href="~/CoreImage/_images/flower.png" alt="Photograph of a sunflower." />
</para>
<para>
Produces the following output:
</para>
<para>
<img href="~/CoreImage/_images/AffineTransform.png" alt="Result of applying the filter." />
</para>
<para>
"Flower" 2012 Milica Sekulic, used under a Creative Commons Attribution-ShareAlike license: path_to_url
</para>
</remarks>
</Docs>
</Documentation>
``` | /content/code_sandbox/docs/api/CoreImage/CIAffineTransform.xml | xml | 2016-04-20T18:24:26 | 2024-08-16T13:29:19 | xamarin-macios | xamarin/xamarin-macios | 2,436 | 441 |
```xml
import { Injectable } from '@angular/core';
import { plainToClass, classToPlain } from 'class-transformer';
import { HttpClient } from '@angular/common/http';
import { Workflow } from '../models/playbook/workflow';
import { Playbook } from '../models/playbook/playbook';
import { AppApi } from '../models/api/appApi';
import { Global } from '../models/global';
import { Variable } from '../models/variable';
import { User } from '../models/user';
import { Role } from '../models/role';
import { WorkflowStatus } from '../models/execution/workflowStatus';
import { GlobalsService } from '../globals/globals.service';
import { ExecutionService } from '../execution/execution.service';
import { SettingsService } from '../settings/settings.service';
import { UtilitiesService } from '../utilities.service';
import { UUID } from 'angular2-uuid';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import { Subscriber } from 'rxjs';
import { ActionType } from '../models/api/actionApi';
@Injectable({
providedIn: 'root'
})
export class PlaybookService {
workflowsChange: Observable<any>;
observer: Subscriber<any>;
tempStoredWorkflow: Workflow;
constructor(private http: HttpClient, private utils: UtilitiesService, private executionService: ExecutionService,
private globalsService: GlobalsService, private settingsService: SettingsService) {
this.workflowsChange = new Observable((observer) => {
this.observer = observer;
this.getWorkflows().then(workflows => this.observer.next(workflows));
})
}
emitChange(data: any) {
if (this.observer) this.getWorkflows().then(workflows => this.observer.next(workflows));
return data;
}
/**
* Returns all playbooks and their child workflows in minimal form (id, name).
*/
getPlaybooks(): Promise<Playbook[]> {
return this.http.get('api/playbooks')
.toPromise()
.then((data) => plainToClass(Playbook, data))
.catch(this.utils.handleResponseError);
}
/**
* Saves a new playbook.
* @param playbook New playbook to be saved
*/
newPlaybook(playbook: Playbook): Promise<Playbook> {
return this.http.post('api/playbooks', classToPlain(playbook))
.toPromise()
.then((data) => plainToClass(Playbook, data))
.catch(this.utils.handleResponseError);
}
/**
* Renames an existing playbook.
* @param playbookId Current playbook ID to change
* @param newName New name for the updated playbook
*/
renamePlaybook(playbookId: string, newName: string): Promise<Playbook> {
return this.http.patch('api/playbooks', { id: playbookId, name: newName })
.toPromise()
.then((data: object) => plainToClass(Playbook, data))
.catch(this.utils.handleResponseError);
}
/**
* Duplicates and saves an existing playbook, it's workflows, actions, branches, etc. under a new name.
* @param playbookId ID of the playbook to duplicate
* @param newName Name of the new copy to be saved
*/
duplicatePlaybook(playbookId: string, newName: string): Promise<Playbook> {
return this.http.post(`api/playbooks?source=${playbookId}`, { name: newName })
.toPromise()
.then((data) => plainToClass(Playbook, data))
.catch(this.utils.handleResponseError);
}
/**
* Deletes a playbook by name.
* @param playbookIdToDelete ID of playbook to be deleted.
*/
deletePlaybook(playbookIdToDelete: string): Promise<void> {
return this.http.delete(`api/playbooks/${playbookIdToDelete}`)
.toPromise()
.catch(this.utils.handleResponseError);
}
/**
* Exports a playbook as an Observable (component handles the actual 'save').
* @param playbookId: ID of playbook to export
*/
exportPlaybook(playbookId: string): Observable<Blob> {
return this.http.get(`api/playbooks/${playbookId}?mode=export`, { responseType: 'blob' })
.catch(this.utils.handleResponseError);
}
/**
* Exports a playbook as an Observable (component handles the actual 'save').
* @param workflowId: ID of playbook to export
*/
exportWorkflow(workflowId: string): Promise<Blob> {
return this.http.get(`api/workflows/${workflowId}?mode=export`, { responseType: 'blob' })
.toPromise()
.catch(this.utils.handleResponseError);
}
/**
* Imports a playbook from a supplied file.
* @param fileToImport File to be imported
*/
async importWorkflow(fileToImport: File): Promise<Workflow> {
const body: FormData = new FormData();
body.append('file', fileToImport, fileToImport.name);
return this.http.post('api/workflows/upload', body)
.toPromise()
.then((data) => this.emitChange(data))
.then((data) => plainToClass(Workflow, data))
.catch(this.utils.handleResponseError);
}
async nextWorkflowName(name: string) : Promise<string> {
const workflows = await this.getWorkflows();
const count = workflows.filter(w => w.name.match(new RegExp(`^${ name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') }( \(\d+\))?$`))).length;
return (count > 0) ? `${ name } (${ count })`: name;
}
/**
* Returns all playbooks and their child workflows in minimal form (id, name).
*/
getWorkflows(): Promise<Workflow[]> {
return this.http.get('api/workflows/')
.toPromise()
.then((data) => plainToClass(Workflow, data))
.catch(this.utils.handleResponseError);
}
/**
* Duplicates a workflow under a given playbook, it's actions, branches, etc. under a new name.
* @param sourceWorkflowId Current workflow ID to be duplicated
* @param destinationPlaybookId ID of playbook the workflow will be duplicated to
* @param newName Name for the new copy to be saved
*/
duplicateWorkflow(
sourceWorkflowId: string, newName: string,
): Promise<Workflow> {
return this.http.post(`api/workflows/copy?source=${sourceWorkflowId}`,
{ name: newName })
.toPromise()
.then((data) => this.emitChange(data))
.then((data) => plainToClass(Workflow, data))
.catch(this.utils.handleResponseError);
}
/**
* Deletes a given workflow under a given playbook.
* @param workflowIdToDelete ID of the workflow to be deleted
*/
deleteWorkflow(workflowIdToDelete: string): Promise<void> {
return this.http.delete(`api/workflows/${workflowIdToDelete}`)
.toPromise()
.then((data) => this.emitChange(data))
.catch(this.utils.handleResponseError);
}
/**
* Creates a new workflow under a given playbook.
* @param playbookId ID of the playbook the new workflow should be added under
* @param workflow Workflow to be saved
*/
newWorkflow(workflow: Workflow): Promise<Workflow> {
workflow.id = UUID.UUID();
return this.http.post('api/workflows/', classToPlain(workflow))
.toPromise()
.then((data) => this.emitChange(data))
.then((data) => plainToClass(Workflow, data))
.catch(this.utils.handleResponseError);
}
/**
* Saves the data of a given workflow specified under a given playbook.
* @param workflow Data to be saved under the workflow (actions, etc.)
*/
saveWorkflow(workflow: Workflow): Promise<Workflow> {
return this.http.put(`api/workflows/${workflow.id}`, classToPlain(workflow))
.toPromise()
.then((data) => this.emitChange(data))
.then((data) => plainToClass(Workflow, data))
.catch(this.utils.handleResponseError);
}
/**
* Loads the data of a given workflow under a given playbook.
* @param workflowId ID of the workflow to load
*/
loadWorkflow(workflowId: string): Promise<Workflow> {
return this.http.get(`api/workflows/${workflowId}`)
.toPromise()
.then((data) => plainToClass(Workflow, data))
.catch(this.utils.handleResponseError);
}
/**
* Notifies the server to execute a given workflow.
* Note that execution results are not returned here, but on a separate stream-actions EventSource.
* @param workflowId ID of the workflow to execute
*/
addWorkflowToQueue(workflowId: string, executionId: string = null): Promise<WorkflowStatus> {
return this.executionService.addWorkflowToQueue(workflowId, executionId);
}
/**
* For a given executing workflow, asyncronously perform some action to change its status.
* Only returns success
* @param executionId Execution ID to act upon
* @param action Action to take (e.g. abort, resume, pause)
*/
performWorkflowTrigger(executionId: string, trigger: string, data = {}): Promise<void> {
return this.http.patch(`api/workflowqueue/${ executionId }`, { status: 'trigger', trigger_id: trigger, trigger_data: data})
.toPromise()
.then(() => null)
.catch(this.utils.handleResponseError);
}
/**
* Returns an array of all globals within the DB.
*/
getGlobals(): Promise<Variable[]> {
return this.globalsService.getAllGlobals();
}
/**
* Gets all app apis from the server.
*/
getApis(): Promise<AppApi[]> {
return this.http.get('api/apps/apis/')
.toPromise()
// .then((data: any[]) => {
// return [{
// id_: '30f06bd4-3703-f8a9-47e0-8853ea916913',
// name: 'Builtin',
// description: 'Walkoff built-in functions',
// app_version: '1.0.1',
// walkoff_version: '1.0.0',
// contact_info: {email: "walkoff@nsa.gov", name: "Walkoff Team", url: "path_to_url"},
// license_info: {name: "Creative Commons", url: "path_to_url"},
// external_docs: {},
// actions: [
// {
// id_: '7a1c6838-1b14-4ddc-7d84-935fcbc260ca',
// name: 'Condition',
// node_type: ActionType.CONDITION,
// },
// {
// id_: '21f7c721-448f-da7b-fea9-9b781824e7d3',
// name: 'Trigger',
// node_type: ActionType.TRIGGER,
// },
// {
// id_: '40a9e8ee-9a4f-ffb7-0a01-0cd25a6bd3a2',
// name: 'Transform',
// node_type: ActionType.TRANSFORM,
// }
// ]
// }].concat(data);
// })
.then((data: any[]) => plainToClass(AppApi, data))
.then((appApis: AppApi[]) => {
appApis.forEach(app => app.action_apis.map(action => {
action.app_name = app.name;
action.app_version = app.app_version;
return action;
}))
return appApis;
})
.catch(this.utils.handleResponseError);
}
/**
* Returns an array of all users within the DB.
*/
getUsers(): Promise<User[]> {
return this.settingsService.getAllUsers();
}
/**
* Returns an array of all roles within the application.
*/
getRoles(): Promise<Role[]> {
return this.settingsService.getRoles();
}
get workflowToCreate(): Workflow {
const w = this.tempStoredWorkflow;
//this.tempStoredWorkflow = null;
return w;
}
set workflowToCreate(workflow: Workflow) {
this.tempStoredWorkflow = workflow;
}
}
``` | /content/code_sandbox/api/client/src/app/playbook/playbook.service.ts | xml | 2016-06-08T16:34:46 | 2024-08-16T18:12:30 | WALKOFF | nsacyber/WALKOFF | 1,198 | 2,755 |
```xml
<ResourceDictionary xmlns="path_to_url"
xmlns:x="path_to_url"
xmlns:iconPacks="clr-namespace:MahApps.Metro.IconPacks"
xmlns:converter="clr-namespace:MahApps.Metro.IconPacks.Converter;assembly=MahApps.Metro.IconPacks.Core">
<ControlTemplate x:Key="MahApps.Templates.PackIconGameIcons" TargetType="{x:Type iconPacks:PackIconGameIcons}">
<Grid>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Grid x:Name="PART_InnerGrid"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RenderTransformOrigin="0.5 0.5"
Margin="{TemplateBinding BorderThickness}">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="FlipTransform"
ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleXValueConverter}}"
ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Flip, Mode=OneWay, Converter={converter:FlipToScaleYValueConverter}}" />
<RotateTransform x:Name="RotationTransform"
Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle, Mode=OneWay}" />
<RotateTransform x:Name="SpinTransform" />
</TransformGroup>
</Grid.RenderTransform>
<Viewbox Margin="{TemplateBinding Padding}">
<Path Fill="{TemplateBinding Foreground}"
Stretch="Uniform"
Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
SnapsToDevicePixels="False"
UseLayoutRounding="False" />
</Viewbox>
</Grid>
</Grid>
</ControlTemplate>
<Style x:Key="MahApps.Styles.PackIconGameIcons" TargetType="{x:Type iconPacks:PackIconGameIcons}">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Padding" Value="0" />
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="False" />
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Template" Value="{StaticResource MahApps.Templates.PackIconGameIcons}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
</Style>
</ResourceDictionary>
``` | /content/code_sandbox/src/MahApps.Metro.IconPacks.GameIcons/Themes/WPF/PackIconGameIcons.xaml | xml | 2016-07-17T00:10:12 | 2024-08-16T16:16:36 | MahApps.Metro.IconPacks | MahApps/MahApps.Metro.IconPacks | 1,748 | 639 |
```xml
import {GraphicalMeasure} from "./GraphicalMeasure";
import {StaffLine} from "./StaffLine";
import {MusicSystem} from "./MusicSystem";
import {SystemLinePosition} from "./SystemLinePosition";
import {SystemLinesEnum} from "./SystemLinesEnum";
import {BoundingBox} from "./BoundingBox";
import {GraphicalObject} from "./GraphicalObject";
import {EngravingRules} from "./EngravingRules";
export class SystemLine extends GraphicalObject {
constructor(lineType: SystemLinesEnum, linePosition: SystemLinePosition, musicSystem: MusicSystem,
topMeasure: GraphicalMeasure, bottomMeasure: GraphicalMeasure = undefined) {
super();
this.lineType = lineType;
this.linePosition = linePosition;
this.parentMusicSystem = musicSystem;
this.topMeasure = topMeasure;
this.bottomMeasure = bottomMeasure;
this.parentTopStaffLine = topMeasure?.ParentStaffLine;
this.boundingBox = new BoundingBox(this, musicSystem.PositionAndShape);
}
public lineType: SystemLinesEnum;
public linePosition: SystemLinePosition;
public parentMusicSystem: MusicSystem;
public parentTopStaffLine: StaffLine;
public topMeasure: GraphicalMeasure;
public bottomMeasure: GraphicalMeasure;
/**
* Return the width of the SystemLinesContainer for the given SystemLineType.
* @param rules
* @param systemLineType
* @returns {number}
*/
public static getObjectWidthForLineType(rules: EngravingRules, systemLineType: SystemLinesEnum): number {
switch (systemLineType) {
case SystemLinesEnum.SingleThin:
return rules.SystemThinLineWidth;
case SystemLinesEnum.DoubleThin:
return rules.SystemThinLineWidth * 2 + rules.DistanceBetweenVerticalSystemLines;
case SystemLinesEnum.ThinBold:
return rules.SystemThinLineWidth + rules.SystemBoldLineWidth + rules.DistanceBetweenVerticalSystemLines;
case SystemLinesEnum.BoldThinDots:
return rules.SystemThinLineWidth + rules.SystemBoldLineWidth + rules.DistanceBetweenVerticalSystemLines + rules.SystemDotWidth +
rules.DistanceBetweenDotAndLine;
case SystemLinesEnum.DotsThinBold:
return rules.SystemThinLineWidth + rules.SystemBoldLineWidth + rules.DistanceBetweenVerticalSystemLines + rules.SystemDotWidth +
rules.DistanceBetweenDotAndLine;
case SystemLinesEnum.DotsBoldBoldDots:
return 2 * rules.SystemBoldLineWidth + 2 * rules.SystemDotWidth + 2 * rules.DistanceBetweenDotAndLine +
rules.DistanceBetweenVerticalSystemLines;
default:
return 0;
}
}
}
``` | /content/code_sandbox/src/MusicalScore/Graphical/SystemLine.ts | xml | 2016-02-08T15:47:01 | 2024-08-16T17:49:53 | opensheetmusicdisplay | opensheetmusicdisplay/opensheetmusicdisplay | 1,416 | 559 |
```xml
/*your_sha256_hash-----------------------------
*your_sha256_hash----------------------------*/
import { testTokenization } from '../test/testRunner';
testTokenization('sql', [
// Comments
[
{
line: '-- a comment',
tokens: [{ startIndex: 0, type: 'comment.sql' }]
}
],
[
{
line: '---sticky -- comment',
tokens: [{ startIndex: 0, type: 'comment.sql' }]
}
],
[
{
line: '-almost a comment',
tokens: [
{ startIndex: 0, type: 'operator.sql' },
{ startIndex: 1, type: 'identifier.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.sql' },
{ startIndex: 9, type: 'white.sql' },
{ startIndex: 10, type: 'identifier.sql' }
]
}
],
[
{
line: '/* a full line comment */',
tokens: [
{ startIndex: 0, type: 'comment.quote.sql' },
{ startIndex: 2, type: 'comment.sql' },
{ startIndex: 23, type: 'comment.quote.sql' }
]
}
],
[
{
line: '/* /// *** /// */',
tokens: [
{ startIndex: 0, type: 'comment.quote.sql' },
{ startIndex: 2, type: 'comment.sql' },
{ startIndex: 15, type: 'comment.quote.sql' }
]
}
],
[
{
line: 'declare @x int = /* a simple comment */ 1;',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.sql' },
{ startIndex: 10, type: 'white.sql' },
{ startIndex: 11, type: 'keyword.sql' },
{ startIndex: 14, type: 'white.sql' },
{ startIndex: 15, type: 'operator.sql' },
{ startIndex: 16, type: 'white.sql' },
{ startIndex: 17, type: 'comment.quote.sql' },
{ startIndex: 19, type: 'comment.sql' },
{ startIndex: 37, type: 'comment.quote.sql' },
{ startIndex: 39, type: 'white.sql' },
{ startIndex: 40, type: 'number.sql' },
{ startIndex: 41, type: 'delimiter.sql' }
]
}
],
// Not supporting nested comments, as nested comments seem to not be standard?
// i.e. path_to_url
[
{
line: '@x=/* a /* nested comment 1*/;',
tokens: [
{ startIndex: 0, type: 'identifier.sql' },
{ startIndex: 2, type: 'operator.sql' },
{ startIndex: 3, type: 'comment.quote.sql' },
{ startIndex: 5, type: 'comment.sql' },
{ startIndex: 28, type: 'comment.quote.sql' },
{ startIndex: 30, type: 'delimiter.sql' }
]
}
],
[
{
line: '@x=/* another comment */ 1*/;',
tokens: [
{ startIndex: 0, type: 'identifier.sql' },
{ startIndex: 2, type: 'operator.sql' },
{ startIndex: 3, type: 'comment.quote.sql' },
{ startIndex: 5, type: 'comment.sql' },
{ startIndex: 22, type: 'comment.quote.sql' },
{ startIndex: 24, type: 'white.sql' },
{ startIndex: 25, type: 'number.sql' },
{ startIndex: 26, type: 'operator.sql' },
{ startIndex: 28, type: 'delimiter.sql' }
]
}
],
[
{
line: '@x=/*/;',
tokens: [
{ startIndex: 0, type: 'identifier.sql' },
{ startIndex: 2, type: 'operator.sql' },
{ startIndex: 3, type: 'comment.quote.sql' },
{ startIndex: 5, type: 'comment.sql' }
]
}
],
// Numbers
[
{
line: '123',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '-123',
tokens: [
{ startIndex: 0, type: 'operator.sql' },
{ startIndex: 1, type: 'number.sql' }
]
}
],
[
{
line: '0xaBc123',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '0XaBc123',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '0x',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '0x0',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '0xAB_CD',
tokens: [
{ startIndex: 0, type: 'number.sql' },
{ startIndex: 4, type: 'identifier.sql' }
]
}
],
[
{
line: '$',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$-123',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$-+-123',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$123.5678',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$0.99',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$.99',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$99.',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$0.',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '$.0',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '.',
tokens: [{ startIndex: 0, type: 'delimiter.sql' }]
}
],
[
{
line: '123',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '123.5678',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '0.99',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '.99',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '99.',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '0.',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '.0',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '1E-2',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '1E+2',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '1E2',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '0.1E2',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '1.E2',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
[
{
line: '.1E2',
tokens: [{ startIndex: 0, type: 'number.sql' }]
}
],
// Identifiers
[
{
line: '_abc$01',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: '#abc$01',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: '##abc$01',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: '@abc$01',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: '@@abc$01',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: '$abc',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: '$action',
tokens: [{ startIndex: 0, type: 'predefined.sql' }]
}
],
[
{
line: '$nonexistent',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: '@@DBTS',
tokens: [{ startIndex: 0, type: 'predefined.sql' }]
}
],
[
{
line: '@@nonexistent',
tokens: [{ startIndex: 0, type: 'identifier.sql' }]
}
],
[
{
line: 'declare [abc 321];',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.quote.sql' },
{ startIndex: 9, type: 'identifier.sql' },
{ startIndex: 16, type: 'identifier.quote.sql' },
{ startIndex: 17, type: 'delimiter.sql' }
]
}
],
[
{
line: '[abc[[ 321 ]] xyz]',
tokens: [
{ startIndex: 0, type: 'identifier.quote.sql' },
{ startIndex: 1, type: 'identifier.sql' },
{ startIndex: 17, type: 'identifier.quote.sql' }
]
}
],
[
{
line: '[abc',
tokens: [
{ startIndex: 0, type: 'identifier.quote.sql' },
{ startIndex: 1, type: 'identifier.sql' }
]
}
],
[
{
line: 'declare "abc 321";',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.quote.sql' },
{ startIndex: 9, type: 'identifier.sql' },
{ startIndex: 16, type: 'identifier.quote.sql' },
{ startIndex: 17, type: 'delimiter.sql' }
]
}
],
[
{
line: '"abc"" 321 "" xyz"',
tokens: [
{ startIndex: 0, type: 'identifier.quote.sql' },
{ startIndex: 1, type: 'identifier.sql' },
{ startIndex: 17, type: 'identifier.quote.sql' }
]
}
],
[
{
line: '"abc',
tokens: [
{ startIndex: 0, type: 'identifier.quote.sql' },
{ startIndex: 1, type: 'identifier.sql' }
]
}
],
[
{
line: 'int',
tokens: [{ startIndex: 0, type: 'keyword.sql' }]
}
],
[
{
line: '[int]',
tokens: [
{ startIndex: 0, type: 'identifier.quote.sql' },
{ startIndex: 1, type: 'identifier.sql' },
{ startIndex: 4, type: 'identifier.quote.sql' }
]
}
],
// Strings
[
{
line: "declare @x='a string';",
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.sql' },
{ startIndex: 10, type: 'operator.sql' },
{ startIndex: 11, type: 'string.sql' },
{ startIndex: 21, type: 'delimiter.sql' }
]
}
],
[
{
line: "'a '' string with quotes'",
tokens: [{ startIndex: 0, type: 'string.sql' }]
}
],
[
{
line: "'a \" string with quotes'",
tokens: [{ startIndex: 0, type: 'string.sql' }]
}
],
[
{
line: "'a -- string with comment'",
tokens: [{ startIndex: 0, type: 'string.sql' }]
}
],
[
{
line: "N'a unicode string'",
tokens: [{ startIndex: 0, type: 'string.sql' }]
}
],
[
{
line: "'a endless string",
tokens: [{ startIndex: 0, type: 'string.sql' }]
}
],
// Operators
[
{
line: 'SET @x=@x+1',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 3, type: 'white.sql' },
{ startIndex: 4, type: 'identifier.sql' },
{ startIndex: 6, type: 'operator.sql' },
{ startIndex: 7, type: 'identifier.sql' },
{ startIndex: 9, type: 'operator.sql' },
{ startIndex: 10, type: 'number.sql' }
]
}
],
[
{
line: '@x^=@x',
tokens: [
{ startIndex: 0, type: 'identifier.sql' },
{ startIndex: 2, type: 'operator.sql' },
{ startIndex: 4, type: 'identifier.sql' }
]
}
],
[
{
line: 'WHERE x IS NOT NULL',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 5, type: 'white.sql' },
{ startIndex: 6, type: 'identifier.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'operator.sql' },
{ startIndex: 10, type: 'white.sql' },
{ startIndex: 11, type: 'operator.sql' },
{ startIndex: 14, type: 'white.sql' },
{ startIndex: 15, type: 'operator.sql' }
]
}
],
[
{
line: 'SELECT * FROM dbo.MyTable WHERE MyColumn IN (1,2)',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 6, type: 'white.sql' },
{ startIndex: 7, type: 'operator.sql' },
{ startIndex: 8, type: 'white.sql' },
{ startIndex: 9, type: 'keyword.sql' },
{ startIndex: 13, type: 'white.sql' },
{ startIndex: 14, type: 'identifier.sql' },
{ startIndex: 17, type: 'delimiter.sql' },
{ startIndex: 18, type: 'identifier.sql' },
{ startIndex: 25, type: 'white.sql' },
{ startIndex: 26, type: 'keyword.sql' },
{ startIndex: 31, type: 'white.sql' },
{ startIndex: 32, type: 'identifier.sql' },
{ startIndex: 40, type: 'white.sql' },
{ startIndex: 41, type: 'operator.sql' },
{ startIndex: 43, type: 'white.sql' },
{ startIndex: 44, type: 'delimiter.parenthesis.sql' },
{ startIndex: 45, type: 'number.sql' },
{ startIndex: 46, type: 'delimiter.sql' },
{ startIndex: 47, type: 'number.sql' },
{ startIndex: 48, type: 'delimiter.parenthesis.sql' }
]
}
],
// Scopes
[
{
line: 'WHILE() BEGIN END',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 5, type: 'delimiter.parenthesis.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'keyword.block.sql' },
{ startIndex: 13, type: 'white.sql' },
{ startIndex: 14, type: 'keyword.block.sql' }
]
}
],
[
{
line: 'BEGIN TRAN BEGIN TRY SELECT $ COMMIT END TRY BEGIN CATCH ROLLBACK END CATCH',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 10, type: 'white.sql' },
{ startIndex: 11, type: 'keyword.try.sql' },
{ startIndex: 20, type: 'white.sql' },
{ startIndex: 21, type: 'keyword.sql' },
{ startIndex: 27, type: 'white.sql' },
{ startIndex: 28, type: 'number.sql' },
{ startIndex: 29, type: 'white.sql' },
{ startIndex: 30, type: 'keyword.sql' },
{ startIndex: 36, type: 'white.sql' },
{ startIndex: 37, type: 'keyword.try.sql' },
{ startIndex: 44, type: 'white.sql' },
{ startIndex: 45, type: 'keyword.catch.sql' },
{ startIndex: 56, type: 'white.sql' },
{ startIndex: 57, type: 'keyword.sql' },
{ startIndex: 65, type: 'white.sql' },
{ startIndex: 66, type: 'keyword.catch.sql' }
]
}
],
[
{
line: 'SELECT CASE $ WHEN 3 THEN 4 ELSE 5 END',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 6, type: 'white.sql' },
{ startIndex: 7, type: 'keyword.block.sql' },
{ startIndex: 11, type: 'white.sql' },
{ startIndex: 12, type: 'number.sql' },
{ startIndex: 13, type: 'white.sql' },
{ startIndex: 14, type: 'keyword.choice.sql' },
{ startIndex: 18, type: 'white.sql' },
{ startIndex: 19, type: 'number.sql' },
{ startIndex: 20, type: 'white.sql' },
{ startIndex: 21, type: 'keyword.choice.sql' },
{ startIndex: 25, type: 'white.sql' },
{ startIndex: 26, type: 'number.sql' },
{ startIndex: 27, type: 'white.sql' },
{ startIndex: 28, type: 'keyword.sql' },
{ startIndex: 32, type: 'white.sql' },
{ startIndex: 33, type: 'number.sql' },
{ startIndex: 34, type: 'white.sql' },
{ startIndex: 35, type: 'keyword.block.sql' }
]
}
]
]);
``` | /content/code_sandbox/src/basic-languages/sql/sql.test.ts | xml | 2016-06-07T16:56:31 | 2024-08-16T17:17:05 | monaco-editor | microsoft/monaco-editor | 39,508 | 4,862 |
```xml
import classNames from 'classnames';
import * as React from 'react';
import './styles.scss';
interface RadioOption {
value: string;
name: string;
}
interface PublicProps {
className?: string;
name: string;
options: RadioOption[];
onChange: (value: string) => void;
value: string;
}
export const RadioGroup = ({ className, name, onChange, options, value }: PublicProps) => (
<div className={classNames('radio-group', className)}>
{options.map((option) => (
<div className="radio-group__option" key={option.name}>
<input
className="radio-group__input"
type="radio"
id={`${name}-${option.value}`}
name={name}
onChange={(e) => onChange(option.value as string)}
value={option.value as string}
checked={value === option.value}
></input>
<label className="radio-group__toggle" htmlFor={`${name}-${option.value}`}></label>
<label className="radio-group__label" htmlFor={`${name}-${option.value}`}>
{option.name}
</label>
</div>
))}
</div>
);
``` | /content/code_sandbox/src/components/radio-group/component.tsx | xml | 2016-01-03T05:38:10 | 2024-08-13T16:08:09 | toolkit-for-ynab | toolkit-for-ynab/toolkit-for-ynab | 1,418 | 248 |
```xml
import {BaseContext} from "@tsed/di";
import {BadRequest} from "@tsed/exceptions";
import {Catch} from "../decorators/catch.js";
import {ErrorFilter} from "./ErrorFilter.js";
@Catch("MongooseError", "MongoError")
export class MongooseErrorFilter extends ErrorFilter {
catch(error: Error, ctx: BaseContext) {
return super.catch(new BadRequest(error.message, error), ctx);
}
}
``` | /content/code_sandbox/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 94 |
```xml
import { Component, ViewChild, ElementRef, AfterViewInit } from '@angular/core';
import { DefaultEditor } from 'ng2-smart-table';
@Component({
template: `
Name: <input [ngClass]="inputClass"
#name
class="form-control short-input"
[name]="cell.getId()"
[disabled]="!cell.isEditable()"
[placeholder]="cell.getTitle()"
(click)="onClick.emit($event)"
(keyup)="updateValue()"
(keydown.enter)="onEdited.emit($event)"
(keydown.esc)="onStopEditing.emit()"><br>
Url: <input [ngClass]="inputClass"
#url
class="form-control short-input"
[name]="cell.getId()"
[disabled]="!cell.isEditable()"
[placeholder]="cell.getTitle()"
(click)="onClick.emit($event)"
(keyup)="updateValue()"
(keydown.enter)="onEdited.emit($event)"
(keydown.esc)="onStopEditing.emit()">
<div [hidden]="true" [innerHTML]="cell.getValue()" #htmlValue></div>
`,
})
export class CustomEditorComponent extends DefaultEditor implements AfterViewInit {
@ViewChild('name') name: ElementRef;
@ViewChild('url') url: ElementRef;
@ViewChild('htmlValue') htmlValue: ElementRef;
constructor() {
super();
}
ngAfterViewInit() {
if (this.cell.newValue !== '') {
this.name.nativeElement.value = this.getUrlName();
this.url.nativeElement.value = this.getUrlHref();
}
}
updateValue() {
const href = this.url.nativeElement.value;
const name = this.name.nativeElement.value;
this.cell.newValue = `<a href='${href}'>${name}</a>`;
}
getUrlName(): string {
return this.htmlValue.nativeElement.innerText;
}
getUrlHref(): string {
return this.htmlValue.nativeElement.querySelector('a').getAttribute('href');
}
}
``` | /content/code_sandbox/projects/demo/src/app/pages/examples/custom-edit-view/custom-editor.component.ts | xml | 2016-08-10T10:25:51 | 2024-08-05T21:57:53 | ng2-smart-table | akveo/ng2-smart-table | 1,631 | 407 |
```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>Disabled</key>
<true/>
<key>Label</key>
<string>org.macports.ppp.l2tp</string>
<key>KeepAlive</key>
<true/>
<key>ProcessType</key>
<string>Interactive</string>
<key>Program</key>
<string>/usr/sbin/vpnd</string>
<key>ProgramArguments</key>
<array>
<string>vpnd</string>
<string>-x</string>
<string>-i</string>
<string>org.macports.ppp.l2tp</string>
</array>
<key>PreventsSleep</key>
<true/>
<key>EnableTransactions</key>
<false/>
<key>EnablePressuredExit</key>
<false/>
</dict>
</plist>
``` | /content/code_sandbox/net/macos-vpn-server/files/org.macports.ppp.l2tp.plist | xml | 2016-10-09T00:31:44 | 2024-08-16T18:11:47 | macports-ports | macports/macports-ports | 1,499 | 235 |
```xml
import { FastifyError } from '@fastify/error'
import { FastifyInstance } from './instance'
import { FastifyReply } from './reply'
import { FastifyRequest } from './request'
import { RouteGenericInterface } from './route'
import { FastifySchema } from './schema'
import { FastifyTypeProvider, FastifyTypeProviderDefault } from './type-provider'
import { ContextConfigDefault, RawReplyDefaultExpression, RawRequestDefaultExpression, RawServerBase, RawServerDefault } from './utils'
import pino from 'pino'
/**
* Standard Fastify logging function
*/
export type FastifyLogFn = pino.LogFn
export type LogLevel = pino.LevelWithSilent
export type Bindings = pino.Bindings
export type ChildLoggerOptions = pino.ChildLoggerOptions
export interface FastifyBaseLogger extends pino.BaseLogger {
child(bindings: Bindings, options?: ChildLoggerOptions): FastifyBaseLogger
}
// TODO delete FastifyBaseLogger in the next major release. It seems that it is enough to have only FastifyBaseLogger.
/**
* @deprecated Use FastifyBaseLogger instead
*/
export type FastifyLoggerInstance = FastifyBaseLogger
export interface FastifyLoggerStreamDestination {
write(msg: string): void;
}
export type PinoLoggerOptions = pino.LoggerOptions
// TODO: once node 18 is EOL, this type can be replaced with plain FastifyReply.
/**
* Specialized reply type used for the `res` log serializer, since only `statusCode` is passed in certain cases.
*/
export type ResSerializerReply<
RawServer extends RawServerBase,
RawReply extends FastifyReply<RouteGenericInterface, RawServer>
> = Partial<RawReply> & Pick<RawReply, 'statusCode'>
/**
* Fastify Custom Logger options.
*/
export interface FastifyLoggerOptions<
RawServer extends RawServerBase = RawServerDefault,
RawRequest extends FastifyRequest<RouteGenericInterface, RawServer, RawRequestDefaultExpression<RawServer>, FastifySchema, FastifyTypeProvider> = FastifyRequest<RouteGenericInterface, RawServer, RawRequestDefaultExpression<RawServer>, FastifySchema, FastifyTypeProviderDefault>,
RawReply extends FastifyReply<RouteGenericInterface, RawServer, RawRequestDefaultExpression<RawServer>, RawReplyDefaultExpression<RawServer>, ContextConfigDefault, FastifySchema, FastifyTypeProvider> = FastifyReply<RouteGenericInterface, RawServer, RawRequestDefaultExpression<RawServer>, RawReplyDefaultExpression<RawServer>, ContextConfigDefault, FastifySchema, FastifyTypeProviderDefault>
> {
serializers?: {
req?: (req: RawRequest) => {
method?: string;
url?: string;
version?: string;
host?: string;
remoteAddress?: string;
remotePort?: number;
[key: string]: unknown;
};
err?: (err: FastifyError) => {
type: string;
message: string;
stack: string;
[key: string]: unknown;
};
res?: (res: ResSerializerReply<RawServer, RawReply>) => {
statusCode?: string | number;
[key: string]: unknown;
};
};
level?: string;
file?: string;
genReqId?: (req: RawRequest) => string;
stream?: FastifyLoggerStreamDestination;
}
export interface FastifyChildLoggerFactory<
RawServer extends RawServerBase = RawServerDefault,
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
Logger extends FastifyBaseLogger = FastifyBaseLogger,
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault
> {
/**
* @param logger The parent logger
* @param bindings The bindings object that will be passed to the child logger
* @param childLoggerOpts The logger options that will be passed to the child logger
* @param rawReq The raw request
* @this The fastify instance
* @returns The child logger instance
*/
(
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
logger: Logger,
bindings: Bindings,
childLoggerOpts: ChildLoggerOptions,
rawReq: RawRequest
): Logger
}
``` | /content/code_sandbox/types/logger.d.ts | xml | 2016-09-28T19:10:14 | 2024-08-16T19:06:24 | fastify | fastify/fastify | 31,648 | 939 |
```xml
import { Container } from '../../container';
import { executeGitCommand } from '../actions';
import type { GitReference, GitTagReference } from '../models/reference';
import type { Repository } from '../models/repository';
export function create(repo?: string | Repository, ref?: GitReference, name?: string) {
return executeGitCommand({
command: 'tag',
state: {
subcommand: 'create',
repo: repo,
reference: ref,
name: name,
},
});
}
export function remove(repo?: string | Repository, refs?: GitTagReference | GitTagReference[]) {
return executeGitCommand({
command: 'tag',
state: {
subcommand: 'delete',
repo: repo,
references: refs,
},
});
}
export async function reveal(
tag: GitTagReference,
options?: {
select?: boolean;
focus?: boolean;
expand?: boolean | number;
},
) {
const view = Container.instance.tagsView;
const node = view.canReveal
? await view.revealTag(tag, options)
: await Container.instance.repositoriesView.revealTag(tag, options);
if (node == null) {
void view.show({ preserveFocus: !options?.focus });
}
return node;
}
``` | /content/code_sandbox/src/git/actions/tag.ts | xml | 2016-08-08T14:50:30 | 2024-08-15T21:25:09 | vscode-gitlens | gitkraken/vscode-gitlens | 8,889 | 274 |
```xml
export * from './numFormatChecker';
``` | /content/code_sandbox/webapp/client/src/shared/utils/typeChecker/index.ts | xml | 2016-10-19T01:07:26 | 2024-08-14T03:53:55 | modeldb | VertaAI/modeldb | 1,689 | 9 |
```xml
set PROD; # products
set STAGE; # stages
param rate {PROD,STAGE} > 0; # tons per hour in each stage
param avail_mean {STAGE} > 0;
param avail_variance {s in STAGE} > 0, < avail_mean[s] / 2;
param avail {s in STAGE} =
max(Normal(avail_mean[s], avail_variance[s]), 0);
# hours available/week in each stage
param profit {PROD}; # profit per ton
param commit {PROD} >= 0; # lower limit on tons sold in week
param market {PROD} >= 0; # upper limit on tons sold in week
var Make {p in PROD} >= commit[p], <= market[p]; # tons produced
maximize Total_Profit: sum {p in PROD} profit[p] * Make[p];
# Objective: total profits from all products
subject to Time {s in STAGE}:
sum {p in PROD} (1/rate[p,s]) * Make[p] <= avail[s];
# In each stage: total of hours used by all
# products may not exceed hours available
``` | /content/code_sandbox/examples/pyomo/amplbook2/steel4r.mod | xml | 2016-05-27T19:33:45 | 2024-08-16T08:09:25 | pyomo | Pyomo/pyomo | 1,945 | 263 |
```xml
import type { API_ComposedRef } from '@storybook/core/types';
import { logger } from '@storybook/core/client-logger';
import { getSourceType } from '../modules/refs';
import type { API } from '../root';
interface Meta {
ref?: API_ComposedRef;
source?: string;
sourceType?: 'local' | 'external';
sourceLocation?: string;
refId?: string;
v?: number;
type: string;
}
export const getEventMetadata = (context: Meta, fullAPI: API) => {
const { source, refId, type } = context;
const [sourceType, sourceLocation] = getSourceType(source!, refId);
let ref: API_ComposedRef | undefined;
if (refId || sourceType === 'external') {
ref =
refId && fullAPI.getRefs()[refId]
? fullAPI.getRefs()[refId]
: fullAPI.findRef(sourceLocation!);
}
const meta = {
source,
sourceType,
sourceLocation,
refId,
ref,
type,
};
switch (true) {
case typeof refId === 'string':
case sourceType === 'local':
case sourceType === 'external': {
return meta;
}
// if we couldn't find the source, something risky happened, we ignore the input, and log a warning
default: {
logger.warn(`Received a ${type} frame that was not configured as a ref`);
return null;
}
}
};
``` | /content/code_sandbox/code/core/src/manager-api/lib/events.ts | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 327 |
```xml
import { JSONSchema } from '../../types';
import { stripReadOnlyProperties, stripWriteOnlyProperties } from '../filterRequiredProperties';
import { assertSome } from '@stoplight/prism-core/src/__tests__/utils';
describe('filterRequiredProperties', () => {
it('strips writeOnly properties', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
name: { type: 'string' },
description: { type: 'string', writeOnly: true },
title: { type: 'string', readOnly: true },
},
required: ['name', 'description', 'title'],
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.required).toEqual(['name', 'title']);
expect(schema.properties).toEqual({
name: expect.any(Object),
title: expect.any(Object),
});
});
});
it('strips readOnly properties on non-array object', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
name: { type: 'string' },
description: { type: 'string', writeOnly: true },
title: { type: 'string', readOnly: true },
},
required: ['name', 'description', 'title'],
};
assertSome(stripReadOnlyProperties(schema), schema => {
expect(schema.required).toEqual(['name', 'description']);
expect(schema.properties).toEqual({
name: expect.any(Object),
description: expect.any(Object),
});
});
});
it('strips readOnly properties from objects in single schema array', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArray: {
type: 'array',
items: {
type: 'object',
required: ['id', 'name'],
properties: {
id: {
readOnly: true,
type: 'string'
},
name: {
type: 'string'
}
}
}
},
title: { type: 'string', readOnly: true },
address: { type: 'integer' },
},
required: ['title', 'address'],
};
assertSome(stripReadOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr_items = (schema.properties.objectsArray as JSONSchema).items as JSONSchema;
expect(arr_items).not.toBeNull();
expect(arr_items).not.toBeUndefined();
if (arr_items) {
expect(arr_items.required).toEqual(['name']);
expect(arr_items.properties).toEqual({
name: expect.any(Object),
});
expect(schema.required).toEqual(['address']);
expect(schema.properties).toEqual({
address: expect.any(Object),
objectsArray: expect.any(Object),
});
}
}
});
});
it('strips writeOnly properties from objects in single schema array', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArray: {
type: 'array',
items: {
type: 'object',
required: ['id', 'name'],
properties: {
id: {
writeOnly: true,
type: 'string'
},
name: {
type: 'string'
}
}
}
},
title: { type: 'string', writeOnly: true },
address: { type: 'integer' },
},
required: ['title', 'address'],
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr_items = (schema.properties.objectsArray as JSONSchema).items as JSONSchema;
expect(arr_items).not.toBeNull();
expect(arr_items).not.toBeUndefined();
if (arr_items) {
expect(arr_items.required).toEqual(['name']);
expect(arr_items.properties).toEqual({
name: expect.any(Object),
});
expect(schema.required).toEqual(['address']);
expect(schema.properties).toEqual({
address: expect.any(Object),
objectsArray: expect.any(Object),
});
}
}
});
});
it('strips readOnly properties from objects in tuple-typed array and unspecified additionalItems', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArrayAdditionalItemsUnspecified: {
type: 'array',
items: [
{
type: 'object',
required: ['id', 'name'],
properties: {
id: { readOnly: true, type: 'string' },
name: { type: 'string' }
}
},
{
type: 'object',
required: ['address', 'title'],
properties: {
address: { readOnly: true, type: 'string' },
title: { type: 'string' }
}
}
]
},
}
};
assertSome(stripReadOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr_items = (schema.properties.objectsArrayAdditionalItemsUnspecified as JSONSchema).items;
expect(arr_items).not.toBeNull();
expect(arr_items).not.toBeUndefined();
if (arr_items) {
expect(arr_items[0].required).toEqual(['name']);
expect(arr_items[0].properties).toEqual({
name: expect.any(Object),
});
expect(arr_items[1].required).toEqual(['title']);
expect(arr_items[1].properties).toEqual({
title: expect.any(Object),
});
}
}
});
});
it('strips writeOnly properties from objects in tuple-typed array and unspecified additionalItems', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArrayAdditionalItemsUnspecified: {
type: 'array',
items: [
{
type: 'object',
required: ['id', 'name'],
properties: {
id: { writeOnly: true, type: 'string' },
name: { type: 'string' }
}
},
{
type: 'object',
required: ['address', 'title'],
properties: {
address: { writeOnly: true, type: 'string' },
title: { type: 'string' }
}
}
]
},
}
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr_items = (schema.properties.objectsArrayAdditionalItemsUnspecified as JSONSchema).items;
expect(arr_items).not.toBeNull();
expect(arr_items).not.toBeUndefined();
if (arr_items) {
expect(arr_items[0].required).toEqual(['name']);
expect(arr_items[0].properties).toEqual({
name: expect.any(Object),
});
expect(arr_items[1].required).toEqual(['title']);
expect(arr_items[1].properties).toEqual({
title: expect.any(Object),
});
}
}
});
});
it('strips readOnly properties from objects in tuple-typed array with additionalItems', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArrayWithAdditionalItems: {
type: 'array',
items: [
{
type: 'object',
required: ['id', 'name'],
properties: {
id: { readOnly: true, type: 'string' },
name: { type: 'string' }
}
},
{
type: 'object',
required: ['address', 'title'],
properties: {
address: { readOnly: true, type: 'string' },
title: { type: 'string' }
}
}
],
additionalItems: {
type: 'object',
properties: {
status: { readOnly: true, type: 'string' },
ticket: { type: 'string' }
},
required: ['status', 'ticket']
}
}
}
};
assertSome(stripReadOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr = schema.properties.objectsArrayWithAdditionalItems as JSONSchema;
expect(arr.items).not.toBeNull();
expect(arr.items).not.toBeUndefined();
const arr_items = arr.items as JSONSchema;
expect(arr_items[0].required).toEqual(['name']);
expect(arr_items[0].properties).toEqual({
name: expect.any(Object)
});
expect(arr_items[1].required).toEqual(['title']);
expect(arr_items[1].properties).toEqual({
title: expect.any(Object)
});
expect(arr.additionalItems).not.toBeNull();
const additional_items = arr.additionalItems as JSONSchema
expect(additional_items.properties).toEqual({
ticket: expect.any(Object)
});
expect(additional_items.required).toEqual(['ticket']);
}
});
});
it('strips writeOnly properties from objects in tuple-typed array with additionalItems', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArrayWithAdditionalItems: {
type: 'array',
items: [
{
type: 'object',
required: ['id', 'name'],
properties: {
id: { writeOnly: true, type: 'string' },
name: { type: 'string' }
}
},
{
type: 'object',
required: ['address', 'title'],
properties: {
address: { writeOnly: true, type: 'string' },
title: { type: 'string' }
}
}
],
additionalItems: {
type: 'object',
properties: {
status: { writeOnly: true, type: 'string' },
ticket: { type: 'string' }
},
required: ['status', 'ticket']
}
}
}
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr = schema.properties.objectsArrayWithAdditionalItems as JSONSchema;
expect(arr.items).not.toBeNull();
expect(arr.items).not.toBeUndefined();
const arr_items = arr.items as JSONSchema;
expect(arr_items[0].required).toEqual(['name']);
expect(arr_items[0].properties).toEqual({
name: expect.any(Object)
});
expect(arr_items[1].required).toEqual(['title']);
expect(arr_items[1].properties).toEqual({
title: expect.any(Object)
});
expect(arr.additionalItems).not.toBeNull();
const additional_items = arr.additionalItems as JSONSchema
expect(additional_items.properties).toEqual({
ticket: expect.any(Object)
});
expect(additional_items.required).toEqual(['ticket']);
}
});
});
it('strips readOnly properties from objects in tuple-typed array no additionalItems', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArrayNoAdditionalItems: {
type: 'array',
items: [
{
type: 'object',
required: ['id', 'name'],
properties: {
id: { readOnly: true, type: 'string' },
name: { type: 'string' }
}
},
{
type: 'object',
required: ['address', 'title'],
properties: {
address: { readOnly: true, type: 'string' },
title: { type: 'string' }
}
}
],
additionalItems: false
},
}
};
assertSome(stripReadOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr = schema.properties.objectsArrayNoAdditionalItems as JSONSchema;
expect(arr.items).not.toBeNull();
expect(arr.items).not.toBeUndefined();
const arr_items = arr.items as JSONSchema;
expect(arr_items[0].required).toEqual(['name']);
expect(arr_items[0].properties).toEqual({
name: expect.any(Object)
});
expect(arr_items[1].required).toEqual(['title']);
expect(arr_items[1].properties).toEqual({
title: expect.any(Object)
});
expect(arr.additionalItems).toEqual(false);
}
});
});
it('strips writeOnly properties from objects in tuple-typed array no additionalItems', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
objectsArrayNoAdditionalItems: {
type: 'array',
items: [
{
type: 'object',
required: ['id', 'name'],
properties: {
id: { writeOnly: true, type: 'string' },
name: { type: 'string' } }
},
{
type: 'object',
required: ['address', 'title'],
properties: {
address: { writeOnly: true, type: 'string' },
title: { type: 'string' } }
}
],
additionalItems: false
},
}
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.properties).not.toBeNull()
if (schema.properties) {
const arr = schema.properties.objectsArrayNoAdditionalItems as JSONSchema;
expect(arr.items).not.toBeNull();
expect(arr.items).not.toBeUndefined();
const arr_items = arr.items as JSONSchema;
expect(arr_items[0].required).toEqual(['name']);
expect(arr_items[0].properties).toEqual({
name: expect.any(Object)
});
expect(arr_items[1].required).toEqual(['title']);
expect(arr_items[1].properties).toEqual({
title: expect.any(Object)
});
expect(arr.additionalItems).toEqual(false);
}
});
});
it('strips nested writeOnly properties', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
name: { type: 'string' },
title: { type: 'string', readOnly: true },
author: {
type: 'object',
properties: {
userId: { type: 'string' },
username: { type: 'string', writeOnly: true },
},
required: ['userId', 'username'],
},
},
required: ['name', 'title', 'author'],
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.required).toEqual(['name', 'title', 'author']);
expect(schema.properties).toEqual({
name: expect.any(Object),
title: expect.any(Object),
author: expect.objectContaining({
properties: {
userId: {
type: 'string',
},
},
required: ['userId'],
}),
});
});
});
it('strips writeOnly properties and leaves boolean properties', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
name: true,
description: { type: 'string', writeOnly: true },
title: { type: 'string', readOnly: true },
},
required: ['name', 'description', 'title'],
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.required).toEqual(['name', 'title']);
expect(schema.properties).toEqual({
name: true,
title: { type: 'string', readOnly: true },
});
});
});
it('removes required properties that have been filtered', () => {
const schema: JSONSchema = {
type: 'object',
properties: {
title: { type: 'string' },
description: { type: 'string', writeOnly: true },
priority: { type: 'number', default: 0 },
},
required: ['title', 'description'],
};
assertSome(stripWriteOnlyProperties(schema), schema => {
expect(schema.required).toEqual(['title']);
expect(schema.properties).toEqual({
title: { type: 'string' },
priority: { type: 'number', default: 0 },
});
});
});
});
``` | /content/code_sandbox/packages/http/src/utils/__tests__/filterRequiredProperties.test.ts | xml | 2016-03-18T03:52:09 | 2024-08-16T09:16:35 | prism | stoplightio/prism | 4,175 | 3,555 |
```xml
import {PlatformTest} from "@tsed/common";
import {PlatformKoaRequest} from "./PlatformKoaRequest.js";
function createRequest() {
const req = PlatformTest.createRequest();
const koaRequest = {
protocol: "http",
req,
get ctx() {
return koaCtx;
}
};
const koaCtx: any = {
request: koaRequest,
cookie: {
test: "test"
},
cookies: {
test: "test"
},
session: {
test: "test"
}
};
const ctx = PlatformTest.createRequestContext({
event: {
request: koaRequest,
koaContext: koaCtx
},
RequestKlass: PlatformKoaRequest
});
return {req, request: ctx.request, koaCtx, koaRequest};
}
describe("PlatformKoaRequest", () => {
beforeEach(() => PlatformTest.create());
afterEach(() => PlatformTest.reset());
it("should create a PlatformRequest instance", () => {
const {koaRequest, request} = createRequest();
expect(request.raw).toEqual(koaRequest);
});
describe("secure", () => {
it("should get cookies from cookie", () => {
const {koaCtx, request} = createRequest();
koaCtx.request.secure = true;
expect(request.secure).toEqual(true);
});
});
describe("protocol()", () => {
it("should return the protocol request state (http)", () => {
const {koaCtx, request} = createRequest();
koaCtx.request.req.protocol = "http";
expect(request.protocol).toEqual("http");
});
it("should return the protocol request state (https)", () => {
const {koaCtx, request} = createRequest();
koaCtx.request.protocol = "https";
expect(request.protocol).toEqual("https");
});
});
describe("host()", () => {
it("should return the host", () => {
const {koaCtx, request} = createRequest();
koaCtx.request.host = "host";
expect(request.host).toEqual("host");
});
});
describe("cookies", () => {
it("should get cookies from cookies", () => {
const {koaCtx, request} = createRequest();
koaCtx.cookie = null;
expect(request.cookies).toEqual({test: "test"});
});
it("should get cookies from cookie", () => {
const {request} = createRequest();
expect(request.cookies).toEqual({test: "test"});
});
});
describe("session", () => {
it("should get session", () => {
const {request} = createRequest();
expect(request.session).toEqual({test: "test"});
});
});
describe("getReq()", () => {
it("should return nodejs request", () => {
const {req, request} = createRequest();
expect(request.getReq()).toEqual(req);
});
});
});
``` | /content/code_sandbox/packages/platform/platform-koa/src/services/PlatformKoaRequest.spec.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 648 |
```xml
import { DecryptedItemInterface, TrustedContactInterface } from '@standardnotes/models'
import { AbstractService } from '../Service/AbstractService'
import { SharedVaultInviteServerHash, SharedVaultUserServerHash } from '@standardnotes/responses'
import { ItemSignatureValidationResult } from './UseCase/Types/ItemSignatureValidationResult'
import { Result } from '@standardnotes/domain-core'
export enum ContactServiceEvent {}
export interface ContactServiceInterface extends AbstractService<ContactServiceEvent> {
isCollaborationEnabled(): boolean
enableCollaboration(): Promise<void>
getCollaborationID(): string
getCollaborationIDFromInvite(invite: SharedVaultInviteServerHash): string
addTrustedContactFromCollaborationID(
collaborationID: string,
name?: string,
): Promise<TrustedContactInterface | undefined>
getCollaborationIDForTrustedContact(contact: TrustedContactInterface): string
createOrEditTrustedContact(params: {
contactUuid: string
name?: string
publicKey: string
signingPublicKey: string
}): Promise<TrustedContactInterface | undefined>
editTrustedContactFromCollaborationID(
contact: TrustedContactInterface,
params: { name: string; collaborationID: string },
): Promise<TrustedContactInterface>
deleteContact(contact: TrustedContactInterface): Promise<Result<void>>
getAllContacts(): TrustedContactInterface[]
getSelfContact(): TrustedContactInterface | undefined
findContact(userUuid: string): TrustedContactInterface | undefined
findContactForServerUser(user: SharedVaultUserServerHash): TrustedContactInterface | undefined
findContactForInvite(invite: SharedVaultInviteServerHash): TrustedContactInterface | undefined
findSenderContactForInvite(invite: SharedVaultInviteServerHash): TrustedContactInterface | undefined
getItemSignatureStatus(item: DecryptedItemInterface): ItemSignatureValidationResult
}
``` | /content/code_sandbox/packages/services/src/Domain/Contacts/ContactServiceInterface.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 404 |
```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>UIAppFonts</key>
<array>
<string>FontAwesome.ttf</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>TextInputEffects</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
``` | /content/code_sandbox/Example/ios/TextInputEffects/Info.plist | xml | 2016-06-01T12:22:28 | 2024-07-31T08:30:47 | react-native-textinput-effects | halilb/react-native-textinput-effects | 2,978 | 525 |
```xml
import * as React from 'react';
import cx from 'classnames';
import { createSvgIcon } from '../utils/createSvgIcon';
import { iconClassNames } from '../utils/iconClassNames';
export const ThumbtackSlashIcon = createSvgIcon({
svg: ({ classes }) => (
<svg
style={{ overflow: 'visible' }}
role="presentation"
focusable="false"
viewBox="2 2 16 16"
className={classes.svg}
>
<g className={cx(iconClassNames.outline, classes.outlinePart)}>
<path d="M3.58 8.718L6.903 7.61 2.146 2.854a.5.5 0 11.708-.708L8.746 8.04l3.218 3.218 5.89 5.89a.5.5 0 01-.708.707l-4.754-4.755-1.108 3.323a.5.5 0 01-.828.195l-3.182-3.182-3.567 3.567L3.705 17h-.703v-.703L3 16.295l3.567-3.567-3.182-3.182a.5.5 0 01.196-.828zm8.021 3.59L7.694 8.401l-3.03 1.01 5.927 5.927 1.01-3.03zM12.697 10.538l-.026.012.755.755 4.195-1.907a1.5 1.5 0 00.44-2.426l-5.03-5.03a1.5 1.5 0 00-2.426.44L8.7 6.577l.755.755.012-.027 2.05-4.51a.5.5 0 01.808-.146l5.03 5.03a.5.5 0 01-.146.809l-4.511 2.05z" />
</g>
<g className={cx(iconClassNames.filled, classes.filledPart)}>
<path d="M3.58 8.718L6.904 7.61 2.146 2.854a.5.5 0 11.708-.708l15 15a.5.5 0 01-.708.708l-4.754-4.755-1.108 3.323a.5.5 0 01-.828.195l-3.182-3.182-3.567 3.567L3.705 17h-.703v-.703L3 16.295l3.567-3.567-3.182-3.182a.5.5 0 01.196-.828zM17.621 9.398l-4.195 1.907-4.727-4.728 1.906-4.195a1.5 1.5 0 012.426-.44l5.03 5.03a1.5 1.5 0 01-.44 2.426z" />
</g>
</svg>
),
displayName: 'ThumbtackSlashIcon',
});
``` | /content/code_sandbox/packages/fluentui/react-icons-northstar/src/components/ThumbtackSlashIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 749 |
```xml
import {
GraphQLField,
GraphQLInterfaceType,
GraphQLNamedType,
GraphQLObjectType,
GraphQLSchema,
isInterfaceType,
isObjectType,
isUnionType,
} from 'graphql/type';
export function typeObjToId(type: GraphQLNamedType) {
return typeNameToId(type.name);
}
export function typeNameToId(name: string) {
return `TYPE::${name}`;
}
export function extractTypeName(typeID: string) {
const [, type] = typeID.split('::');
return type;
}
export function mapFields<R>(
type: GraphQLNamedType,
fn: (id: string, field: GraphQLField<any, any>) => R | null,
): Array<R> {
const array = [];
if (isInterfaceType(type) || isObjectType(type)) {
for (const field of Object.values(type.getFields())) {
const id = `FIELD::${type.name}::${field.name}`;
const result = fn(id, field);
if (result != null) {
array.push(result);
}
}
}
return array;
}
export function mapPossibleTypes<R>(
type: GraphQLNamedType,
fn: (id: string, type: GraphQLObjectType) => R | null,
): Array<R> {
const array = [];
if (isUnionType(type)) {
for (const possibleType of type.getTypes()) {
const id = `POSSIBLE_TYPE::${type.name}::${possibleType.name}`;
const result = fn(id, possibleType);
if (result != null) {
array.push(result);
}
}
}
return array;
}
export function mapDerivedTypes<R>(
schema: GraphQLSchema,
type: GraphQLNamedType,
fn: (id: string, type: GraphQLObjectType | GraphQLInterfaceType) => R | null,
): Array<R> {
const array = [];
if (isInterfaceType(type)) {
const { interfaces, objects } = schema.getImplementations(type);
for (const derivedType of [...interfaces, ...objects]) {
const id = `DERIVED_TYPE::${type.name}::${derivedType.name}`;
const result = fn(id, derivedType);
if (result != null) {
array.push(result);
}
}
}
return array;
}
export function mapInterfaces<R>(
type: GraphQLNamedType,
fn: (id: string, type: GraphQLInterfaceType) => R | null,
): Array<R> {
const array = [];
if (isInterfaceType(type) || isObjectType(type)) {
for (const baseType of type.getInterfaces()) {
const id = `INTERFACE::${type.name}::${baseType.name}`;
const result = fn(id, baseType);
if (result != null) {
array.push(result);
}
}
}
return array;
}
``` | /content/code_sandbox/src/introspection/utils.ts | xml | 2016-11-29T14:26:53 | 2024-08-15T11:05:30 | graphql-voyager | graphql-kit/graphql-voyager | 7,720 | 611 |
```xml
import React from "react";
import { Route, Routes } from "react-router-dom";
import asyncComponent from "@erxes/ui/src/components/AsyncComponent";
const Plans = asyncComponent(
() => import(/* webpackChunkName: "Settings List - Pricing" */ "./page/Plans")
);
const PlanCreate = asyncComponent(
() =>
import(
/* webpackChunkName: "Settings List - Pricing - Create Discount" */ "./page/PlanCreate"
)
);
const PlanEdit = asyncComponent(
() =>
import(
/* webpackChunkName: "Settings List - Pricing - Edit Discount" */ "./page/PlanEdit"
)
);
const routes = () => {
return (
<Routes>
<Route path="/pricing/plans" key="/pricing/plans" element={<Plans />} />
<Route
path="/pricing/plans/create"
key="/pricing/plans/create"
element={<PlanCreate />}
/>
<Route
path="/pricing/plans/edit/:id"
key="/pricing/plans/edit/"
element={<PlanEdit />}
/>
</Routes>
);
};
export default routes;
``` | /content/code_sandbox/packages/plugin-pricing-ui/src/routes.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 239 |
```xml
import { uint8, int16, uint16, int32, uint32, float32, float64 } from "./Int32.js";
import { int64, uint64 } from "./BigInt.js";
import { char } from "./Char.js";
const littleEndian = true;
export function isLittleEndian() {
return littleEndian;
}
export function getBytesBoolean(value: boolean) {
const bytes = new Uint8Array(1);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setUint8(0, value ? 1 : 0);
return bytes;
}
export function getBytesChar(value: char) {
const bytes = new Uint8Array(2);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setUint16(0, value.charCodeAt(0), littleEndian);
return bytes;
}
export function getBytesInt16(value: int16) {
const bytes = new Uint8Array(2);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setInt16(0, value, littleEndian);
return bytes;
}
export function getBytesInt32(value: int32) {
const bytes = new Uint8Array(4);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setInt32(0, value, littleEndian);
return bytes;
}
export function getBytesInt64(value: int64) {
const bytes = new Uint8Array(8);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setBigInt64(0, value, littleEndian);
return bytes;
}
export function getBytesUInt16(value: uint16) {
const bytes = new Uint8Array(2);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setUint16(0, value, littleEndian);
return bytes;
}
export function getBytesUInt32(value: uint32) {
const bytes = new Uint8Array(4);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setUint32(0, value, littleEndian);
return bytes;
}
export function getBytesUInt64(value: uint64) {
const bytes = new Uint8Array(8);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setBigUint64(0, value, littleEndian);
return bytes;
}
export function getBytesSingle(value: float32) {
const bytes = new Uint8Array(4);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setFloat32(0, value, littleEndian);
return bytes;
}
export function getBytesDouble(value: float64) {
const bytes = new Uint8Array(8);
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
view.setFloat64(0, value, littleEndian);
return bytes;
}
export function int64BitsToDouble(value: int64): float64 {
const buffer = new ArrayBuffer(8);
const view = new DataView(buffer);
view.setBigInt64(0, value, littleEndian);
return view.getFloat64(0, littleEndian);
}
export function doubleToInt64Bits(value: float64): int64 {
const buffer = new ArrayBuffer(8);
const view = new DataView(buffer);
view.setFloat64(0, value, littleEndian);
return view.getBigInt64(0, littleEndian);
}
export function toBoolean(bytes: ArrayLike<uint8>, offset: int32): boolean {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getUint8(offset) === 1 ? true : false;
}
export function toChar(bytes: ArrayLike<uint8>, offset: int32): char {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
const code = view.getUint16(offset, littleEndian);
return String.fromCharCode(code);
}
export function toInt16(bytes: ArrayLike<uint8>, offset: int32): int16 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getInt16(offset, littleEndian);
}
export function toInt32(bytes: ArrayLike<uint8>, offset: int32): int32 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getInt32(offset, littleEndian);
}
export function toInt64(bytes: ArrayLike<uint8>, offset: int32): int64 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getBigInt64(offset, littleEndian);
}
export function toUInt16(bytes: ArrayLike<uint8>, offset: int32): uint16 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getUint16(offset, littleEndian);
}
export function toUInt32(bytes: ArrayLike<uint8>, offset: int32): uint32 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getUint32(offset, littleEndian);
}
export function toUInt64(bytes: ArrayLike<uint8>, offset: int32): uint64 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getBigUint64(offset, littleEndian);
}
export function toSingle(bytes: ArrayLike<uint8>, offset: int32): float32 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getFloat32(offset, littleEndian);
}
export function toDouble(bytes: ArrayLike<uint8>, offset: int32): float64 {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
return view.getFloat64(offset, littleEndian);
}
export function toString(bytes: ArrayLike<uint8>, offset?: int32, count?: int32): string {
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
let buffer = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
if (offset != null && count != null) {
buffer = buffer.subarray(offset, offset + count);
} else if (offset != null) {
buffer = buffer.subarray(offset);
}
return Array.from(buffer).map((b) => ("0" + b.toString(16)).slice(-2)).join("-");
}
``` | /content/code_sandbox/src/fable-library-ts/BitConverter.ts | xml | 2016-01-11T10:10:13 | 2024-08-15T11:42:55 | Fable | fable-compiler/Fable | 2,874 | 1,568 |
```xml
import type { ColorValue } from 'react-native';
import { processColor } from 'react-native';
import { convertPercentageColor } from '../utils/convertPercentageColor';
const urlIdPattern = /^url\(#(.+)\)$/;
const currentColorBrush = { type: 2 };
const contextFillBrush = { type: 3 };
const contextStrokeBrush = { type: 4 };
export default function extractBrush(color?: ColorValue) {
if (!color || color === 'none') {
return null;
}
if (color === 'currentColor') {
return currentColorBrush;
}
if (color === 'context-fill') {
return contextFillBrush;
}
if (color === 'context-stroke') {
return contextStrokeBrush;
}
const brush = typeof color === 'string' && color.match(urlIdPattern);
if (brush) {
return { type: 1, brushRef: brush[1] };
}
// Convert percentage RGB/RGBA color to standard RGB/RGBA color
const colorToProcess = convertPercentageColor(color);
const processedColor = processColor(colorToProcess);
if (typeof processedColor === 'number') {
return { type: 0, payload: processedColor };
}
if (typeof processedColor === 'object' && processedColor !== null) {
// if we got an object, it should be `PlatformColor` or `DynamicColorIOS`,
// so we pass it as an object with `0` value as first item, which is interpreted
// on the native side as color to be managed by `RCTConvert`.
return { type: 0, payload: processedColor };
}
console.warn(`"${String(color)}" is not a valid color or brush`);
return null;
}
``` | /content/code_sandbox/src/lib/extract/extractBrush.ts | xml | 2016-01-17T14:29:21 | 2024-08-16T13:35:44 | react-native-svg | software-mansion/react-native-svg | 7,397 | 379 |
```xml
import * as React from 'react';
import { Route } from 'react-router-dom';
import { config } from './config';
export function Router(routes) {
return props => {
return (
<div className="router">
{routes.map(config => (
<Route {...config} />
))}
</div>
);
};
}
export async function createServerRoutes() {
const routes = [];
for (const route of config.routes) {
const response = await route.render();
const DefaultComponent = response.default;
const newConfig = { ...route, component: DefaultComponent };
delete newConfig.render;
routes.push(newConfig);
}
return routes;
}
export function createBrowserRoutes() {
const routes = [];
for (const route of config.routes) {
const newConfig = {
...route,
render: () => {
const Component = LazyLoad(route.render);
return <Component />;
},
};
routes.push(newConfig);
}
return routes;
}
export function LazyLoad(lazyFunction) {
return class extends React.Component<any, any> {
constructor(props) {
super(props);
this.state = {
component: null,
};
lazyFunction().then(_module => {
this.setState({ Component: _module.default });
});
}
render() {
const Component = this.state.Component;
if (!Component) {
return <div>Loading...</div>;
}
return <Component></Component>;
}
};
}
``` | /content/code_sandbox/playground/universal/src/app/Router.tsx | xml | 2016-10-28T10:37:16 | 2024-07-27T15:17:43 | fuse-box | fuse-box/fuse-box | 4,003 | 318 |
```xml
<project xmlns="path_to_url" xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<modelVersion>4.0.0</modelVersion>
<groupId>com.emc.testapp</groupId>
<artifactId>testapp</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>testapp</name>
<url>path_to_url
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.emc.testapp.App</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
``` | /content/code_sandbox/test/test_apps/test_java_app/pom.xml | xml | 2016-04-06T18:46:17 | 2024-08-11T17:18:28 | unik | solo-io/unik | 2,702 | 421 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Nextcloud - Android Client
~
-->
<FrameLayout xmlns:android="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.nextcloud.client.etm.pages.EtmBackgroundJobsFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/etm_background_jobs_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
``` | /content/code_sandbox/app/src/main/res/layout/fragment_etm_background_jobs.xml | xml | 2016-06-06T21:23:36 | 2024-08-16T18:22:36 | android | nextcloud/android | 4,122 | 127 |
```xml
export * from "./org/apache/beam/model/fn_execution/v1/beam_provision_api.grpc-client"
``` | /content/code_sandbox/sdks/typescript/src/apache_beam/proto/beam_provision_api.grpc-client.ts | xml | 2016-02-02T08:00:06 | 2024-08-16T18:58:11 | beam | apache/beam | 7,730 | 23 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="OJK-Gk-BJB">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Item List View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="ItemListViewController" id="BYZ-38-t0r" customClass="ItemListViewController" customModule="ToDo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="nT8-gc-fK3">
<rect key="frame" x="0.0" y="32" width="375" height="667"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ItemCell" rowHeight="105" id="P2v-tl-L99" customClass="ItemCell" customModule="ToDo" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="105"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="P2v-tl-L99" id="RQI-Du-qTp">
<rect key="frame" x="0.0" y="0.0" width="375" height="104.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="title" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Uy3-es-Go9">
<rect key="frame" x="20" y="41" width="100" height="22.5"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="SmD-5y-yrD"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="location" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="UZU-vQ-rZl">
<rect key="frame" x="140" y="42" width="120" height="20.5"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="zBe-jN-Dwg"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="time" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="agQ-za-woE">
<rect key="frame" x="280" y="42" width="75" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="agQ-za-woE" firstAttribute="leading" secondItem="UZU-vQ-rZl" secondAttribute="trailing" constant="20" id="6PY-Xb-kiR"/>
<constraint firstItem="UZU-vQ-rZl" firstAttribute="leading" secondItem="Uy3-es-Go9" secondAttribute="trailing" constant="20" id="7w4-YH-o8I"/>
<constraint firstItem="Uy3-es-Go9" firstAttribute="leading" secondItem="RQI-Du-qTp" secondAttribute="leading" constant="20" id="C2C-xH-dIl"/>
<constraint firstItem="Uy3-es-Go9" firstAttribute="top" secondItem="RQI-Du-qTp" secondAttribute="topMargin" constant="30" id="Fvt-DN-ACN"/>
<constraint firstAttribute="trailing" secondItem="agQ-za-woE" secondAttribute="trailing" constant="20" id="dSY-dR-krj"/>
<constraint firstItem="agQ-za-woE" firstAttribute="firstBaseline" secondItem="UZU-vQ-rZl" secondAttribute="firstBaseline" id="f48-SP-1go"/>
<constraint firstItem="Uy3-es-Go9" firstAttribute="centerY" secondItem="UZU-vQ-rZl" secondAttribute="centerY" id="ksc-ja-1DT"/>
<constraint firstItem="agQ-za-woE" firstAttribute="baseline" secondItem="UZU-vQ-rZl" secondAttribute="baseline" id="pmE-Ta-qAD"/>
<constraint firstItem="agQ-za-woE" firstAttribute="centerY" secondItem="RQI-Du-qTp" secondAttribute="centerY" id="vXf-K3-CbO"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="dateLabel" destination="agQ-za-woE" id="hdc-JG-VkW"/>
<outlet property="locationLabel" destination="UZU-vQ-rZl" id="aaS-vE-fOO"/>
<outlet property="titleLabel" destination="Uy3-es-Go9" id="gel-NF-Zcr"/>
</connections>
</tableViewCell>
</prototypes>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="nT8-gc-fK3" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="Fcr-DQ-sXt"/>
<constraint firstItem="nT8-gc-fK3" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="MEJ-xV-oYn"/>
<constraint firstItem="nT8-gc-fK3" firstAttribute="height" secondItem="8bC-Xf-vdC" secondAttribute="height" id="puX-bM-PXY"/>
<constraint firstItem="nT8-gc-fK3" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="szK-4u-ufe"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="DIU-I2-y4I">
<barButtonItem key="rightBarButtonItem" systemItem="add" id="Ise-V2-Qeu">
<connections>
<action selector="addItem:" destination="BYZ-38-t0r" id="JDf-s5-g8e"/>
</connections>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="dataProvider" destination="afS-4e-u3U" id="2Bh-Lu-zcp"/>
<outlet property="tableView" destination="nT8-gc-fK3" id="0jf-Ux-IBg"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
<customObject id="afS-4e-u3U" customClass="ItemListDataProvider" customModule="ToDo" customModuleProvider="target"/>
</objects>
<point key="canvasLocation" x="1076" y="89.505247376311857"/>
</scene>
<!--Detail View Controller-->
<scene sceneID="ETd-Pb-2lj">
<objects>
<viewController storyboardIdentifier="DetailViewController" id="XYF-d8-SwS" customClass="DetailViewController" customModule="ToDo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Q5I-mr-mL3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3RE-Gv-XJM">
<rect key="frame" x="0.0" y="80" width="375" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="AUC-fr-OpL">
<rect key="frame" x="0.0" y="401" width="375" height="266"/>
</mapView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Location" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uzi-Ng-ZJ2">
<rect key="frame" x="120" y="330" width="135" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="uzi-Ng-ZJ2" firstAttribute="leading" secondItem="lrE-JD-e9Q" secondAttribute="leading" constant="120" id="0R2-u5-0Bg"/>
<constraint firstItem="3RE-Gv-XJM" firstAttribute="top" secondItem="lrE-JD-e9Q" secondAttribute="top" constant="60" id="7md-tD-gJT"/>
<constraint firstItem="3RE-Gv-XJM" firstAttribute="width" secondItem="Q5I-mr-mL3" secondAttribute="width" id="9yu-NO-K5c"/>
<constraint firstItem="AUC-fr-OpL" firstAttribute="width" secondItem="Q5I-mr-mL3" secondAttribute="width" id="NUA-fL-rvh"/>
<constraint firstItem="AUC-fr-OpL" firstAttribute="top" secondItem="lrE-JD-e9Q" secondAttribute="top" constant="381" id="Plx-MU-XAl"/>
<constraint firstItem="AUC-fr-OpL" firstAttribute="centerX" secondItem="lrE-JD-e9Q" secondAttribute="centerX" id="SyA-iS-INp"/>
<constraint firstItem="3RE-Gv-XJM" firstAttribute="centerX" secondItem="lrE-JD-e9Q" secondAttribute="centerX" id="rzb-d1-AVx"/>
<constraint firstItem="AUC-fr-OpL" firstAttribute="top" secondItem="uzi-Ng-ZJ2" secondAttribute="bottom" constant="50" id="s6n-qu-y21"/>
<constraint firstItem="uzi-Ng-ZJ2" firstAttribute="centerX" secondItem="lrE-JD-e9Q" secondAttribute="centerX" id="v5o-La-Myl"/>
<constraint firstItem="lrE-JD-e9Q" firstAttribute="bottom" secondItem="AUC-fr-OpL" secondAttribute="bottom" id="vuT-WN-JWI"/>
</constraints>
<viewLayoutGuide key="safeArea" id="lrE-JD-e9Q"/>
</view>
<connections>
<outlet property="locationLabel" destination="uzi-Ng-ZJ2" id="Ciy-qC-TUW"/>
<outlet property="mapView" destination="AUC-fr-OpL" id="cJS-17-s0a"/>
<outlet property="titleLabel" destination="3RE-Gv-XJM" id="bBb-tz-lR7"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="z4S-n8-uqc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1936.8" y="89.505247376311857"/>
</scene>
<!--Input View Controller-->
<scene sceneID="PBB-Oo-hp4">
<objects>
<viewController storyboardIdentifier="InputViewController" id="eGX-7D-b9e" customClass="InputViewController" customModule="ToDo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Suv-Mj-oko">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Title" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="pPs-Xb-gU2">
<rect key="frame" x="87.5" y="83" width="200" height="30"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="200" id="AFE-6I-Sx5"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Address" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="zvI-Ma-flx">
<rect key="frame" x="87.5" y="143" width="200" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" textContentType="location"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Description" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ys6-4s-57S">
<rect key="frame" x="87.5" y="203" width="200" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="date" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="yKY-pG-guB">
<rect key="frame" x="0.0" y="309" width="375" height="216"/>
<date key="date" timeIntervalSinceReferenceDate="578698890.84597301">
<!--2019-05-04 21:41:30 +0000-->
</date>
</datePicker>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uqI-mp-F7I">
<rect key="frame" x="169.5" y="283" width="36" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mkD-nw-tyr">
<rect key="frame" x="87.5" y="555" width="48" height="30"/>
<state key="normal" title="Cancel">
<color key="titleColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="cancel" destination="eGX-7D-b9e" eventType="touchUpInside" id="9Be-3U-PYo"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sre-Dx-RsO">
<rect key="frame" x="253.5" y="555" width="34" height="30"/>
<state key="normal" title="Save"/>
<connections>
<action selector="save" destination="eGX-7D-b9e" eventType="touchUpInside" id="bTz-Sd-BWE"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="ys6-4s-57S" firstAttribute="top" secondItem="zvI-Ma-flx" secondAttribute="bottom" constant="30" id="2hW-bW-XyN"/>
<constraint firstItem="zvI-Ma-flx" firstAttribute="width" secondItem="pPs-Xb-gU2" secondAttribute="width" id="32B-dT-ApZ"/>
<constraint firstItem="pPs-Xb-gU2" firstAttribute="centerX" secondItem="Suv-Mj-oko" secondAttribute="centerX" id="3zW-iB-PrA"/>
<constraint firstItem="yKY-pG-guB" firstAttribute="centerX" secondItem="zee-rq-b05" secondAttribute="centerX" id="7D7-fJ-JjY"/>
<constraint firstItem="zvI-Ma-flx" firstAttribute="centerX" secondItem="zee-rq-b05" secondAttribute="centerX" id="7PM-X2-ywv"/>
<constraint firstItem="yKY-pG-guB" firstAttribute="width" secondItem="Suv-Mj-oko" secondAttribute="width" id="A6V-am-0nS"/>
<constraint firstItem="mkD-nw-tyr" firstAttribute="leading" secondItem="ys6-4s-57S" secondAttribute="leading" id="Fsq-5b-zbO"/>
<constraint firstItem="ys6-4s-57S" firstAttribute="centerX" secondItem="zee-rq-b05" secondAttribute="centerX" id="G6g-oe-gJT"/>
<constraint firstItem="mkD-nw-tyr" firstAttribute="top" secondItem="yKY-pG-guB" secondAttribute="bottom" constant="30" id="GYm-yR-wL5"/>
<constraint firstItem="zvI-Ma-flx" firstAttribute="top" secondItem="pPs-Xb-gU2" secondAttribute="bottom" constant="30" id="LHg-nB-K7f"/>
<constraint firstItem="uqI-mp-F7I" firstAttribute="top" secondItem="ys6-4s-57S" secondAttribute="bottom" constant="50" id="OoT-6f-1oD"/>
<constraint firstItem="ys6-4s-57S" firstAttribute="width" secondItem="pPs-Xb-gU2" secondAttribute="width" id="e5e-PJ-b1p"/>
<constraint firstItem="mkD-nw-tyr" firstAttribute="baseline" secondItem="sre-Dx-RsO" secondAttribute="baseline" id="fOw-IV-bMV"/>
<constraint firstItem="uqI-mp-F7I" firstAttribute="centerX" secondItem="zee-rq-b05" secondAttribute="centerX" id="gGV-zj-FuW"/>
<constraint firstItem="yKY-pG-guB" firstAttribute="top" secondItem="uqI-mp-F7I" secondAttribute="bottom" constant="5" id="gPf-sH-IyV"/>
<constraint firstItem="sre-Dx-RsO" firstAttribute="trailing" secondItem="ys6-4s-57S" secondAttribute="trailing" id="nFO-Cw-GbP"/>
<constraint firstItem="uqI-mp-F7I" firstAttribute="centerY" secondItem="zee-rq-b05" secondAttribute="centerY" constant="-50" id="uni-vt-Zbw"/>
</constraints>
<viewLayoutGuide key="safeArea" id="zee-rq-b05"/>
</view>
<connections>
<outlet property="cancelButton" destination="mkD-nw-tyr" id="zQd-dj-uYS"/>
<outlet property="datePicker" destination="yKY-pG-guB" id="c20-S8-UWv"/>
<outlet property="descriptionTextField" destination="ys6-4s-57S" id="4s2-96-hzW"/>
<outlet property="locationTextField" destination="zvI-Ma-flx" id="2H4-zs-kdM"/>
<outlet property="saveButton" destination="sre-Dx-RsO" id="ZBY-rd-aj9"/>
<outlet property="titleTextField" destination="pPs-Xb-gU2" id="W35-1F-zDw"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kXv-iH-7wX" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1937" y="-582"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="hJA-tl-byd">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="OJK-Gk-BJB" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="1OD-A6-Tb4">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="Tqe-li-FsR"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cqc-ee-G23" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="136.80000000000001" y="89.505247376311857"/>
</scene>
</scenes>
</document>
``` | /content/code_sandbox/Project 04 - TodoTDD/ToDo/Storyboards/Base.lproj/Main.storyboard | xml | 2016-02-14T20:14:21 | 2024-08-15T20:49:08 | Swift-30-Projects | soapyigu/Swift-30-Projects | 8,036 | 5,945 |
```xml
import { Executor, ExecutorOptions } from "../Executor"
import { FakeCI } from "../../ci_source/providers/Fake"
import { FakePlatform } from "../../platforms/FakePlatform"
import {
emptyResults,
failsResults,
inlineFailResults,
inlineMessageResults,
inlineMultipleWarnResults,
inlineMultipleWarnResults2,
inlineWarnResults,
warnResults,
} from "./fixtures/ExampleDangerResults"
import inlineRunner from "../runners/inline"
import { jsonDSLGenerator } from "../dslGenerator"
import { jsonToDSL } from "../jsonToDSL"
import { DangerDSLType } from "../../dsl/DangerDSL"
import { singleViolationSingleFileResults } from "../../dsl/_tests/fixtures/ExampleDangerResults"
import { inlineTemplate } from "../templates/githubIssueTemplate"
import { DangerResults, inlineResultsIntoResults, resultsIntoInlineResults } from "../../dsl/DangerResults"
const defaultConfig: ExecutorOptions = {
stdoutOnly: false,
verbose: false,
jsonOnly: false,
dangerID: "123",
passURLForDSL: false,
failOnErrors: false,
noPublishCheck: false,
ignoreOutOfDiffComments: false,
}
class FakeProcces {
constructor(public exitCode: number = 0) {}
}
const fakeCI = new FakeCI({})
const defaultDsl = (platform: any): Promise<DangerDSLType> => {
return jsonDSLGenerator(platform, fakeCI, {} as any).then((jsonDSL) => {
jsonDSL.github = {
pr: {
number: 1,
base: { sha: "321", repo: { full_name: "321" } },
head: { sha: "123", repo: { full_name: "123" } },
},
} as any
return jsonToDSL(jsonDSL, fakeCI)
})
}
const mockPayloadForResults = (results: DangerResults): any => {
return resultsIntoInlineResults(results).map((inlineResult) => {
const comment = inlineTemplate(
defaultConfig.dangerID,
inlineResultsIntoResults(inlineResult),
inlineResult.file,
inlineResult.line
)
return { id: 1234, body: comment, ownedByDanger: true }
})
}
describe("setup", () => {
it("gets diff / pr info in setup", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
platform.getPlatformGitRepresentation = jest.fn()
platform.getPlatformReviewDSLRepresentation = jest.fn()
await exec.dslForDanger()
expect(platform.getPlatformGitRepresentation).toBeCalled()
expect(platform.getPlatformReviewDSLRepresentation).toBeCalled()
})
it("gets diff / pr info / utils in setup", async () => {
const exec = new Executor(new FakeCI({}), new FakePlatform(), inlineRunner, defaultConfig, new FakeProcces())
const dsl = await exec.dslForDanger()
expect(dsl.git).toBeTruthy()
expect(dsl.github).toBeTruthy()
expect(dsl.utils).toBeTruthy()
})
it("Creates a DangerResults for a raising dangerfile", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
// This is a real error occurring when Danger modifies the Dangerfile
// as it is given a path of ""
const error = {
name: "Error",
message: "ENOENT: no such file or directory",
}
const results = await exec.runDanger("", { danger: dsl } as any)
expect(results.fails.length).toBeGreaterThan(0)
const markdown = results.markdowns[0].message
expect(markdown).toMatch(error.name)
expect(markdown).toMatch(error.message)
})
it("Deletes a post when there are no messages", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.deleteMainComment = jest.fn()
await exec.handleResults(emptyResults, dsl.git)
expect(platform.deleteMainComment).toBeCalled()
})
it("Configure to Skip a post deletion when there are no messages", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
let parameters: { skip: boolean; times: number }[] = [
{ skip: true, times: 0 },
{ skip: false, times: 1 },
]
for (let el of parameters) {
if (el.skip) {
process.env.DANGER_SKIP_WHEN_EMPTY = "true"
} else {
process.env.DANGER_SKIP_WHEN_EMPTY = "false"
}
const dsl = await defaultDsl(platform)
platform.deleteMainComment = jest.fn()
await exec.handleResults(emptyResults, dsl.git)
expect(process.env.DANGER_SKIP_WHEN_EMPTY).toBeDefined()
expect(platform.deleteMainComment).toBeCalledTimes(el.times)
}
})
it("Deletes a post when 'removePreviousComments' option has been specified", async () => {
const platform = new FakePlatform()
const exec = new Executor(
new FakeCI({}),
platform,
inlineRunner,
{ ...defaultConfig, removePreviousComments: true },
new FakeProcces()
)
const dsl = await defaultDsl(platform)
platform.deleteMainComment = jest.fn()
await exec.handleResults(warnResults, dsl.git)
expect(platform.deleteMainComment).toBeCalled()
})
it("Fails if the failOnErrors option is true and there are fails on the build", async () => {
const platform = new FakePlatform()
const strictConfig: ExecutorOptions = {
stdoutOnly: false,
verbose: false,
jsonOnly: false,
dangerID: "123",
passURLForDSL: false,
failOnErrors: true,
ignoreOutOfDiffComments: false,
}
const exec = new Executor(new FakeCI({}), platform, inlineRunner, strictConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.deleteMainComment = jest.fn()
await exec.handleResults(failsResults, dsl.git)
expect(exec.process.exitCode).toEqual(1)
})
it("Doesn't fail if the failOnErrors option is false and there are fails on the build", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.deleteMainComment = jest.fn()
await exec.handleResults(failsResults, dsl.git)
expect(exec.process.exitCode).toEqual(0)
})
it("Updates or Creates comments for warnings", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(warnResults, dsl.git)
expect(platform.updateOrCreateComment).toBeCalled()
})
it("Creates comments (rather than update or create) for warnings when newComment option is passed", async () => {
const platform = new FakePlatform()
const exec = new Executor(
new FakeCI({}),
platform,
inlineRunner,
{ ...defaultConfig, newComment: true },
new FakeProcces()
)
const dsl = await defaultDsl(platform)
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(warnResults, dsl.git)
expect(platform.createComment).toBeCalled()
expect(platform.updateOrCreateComment).not.toBeCalled()
})
it("Updates or Creates comments for warnings, without GitDSL", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(warnResults)
expect(platform.updateOrCreateComment).toBeCalled()
})
it("Creates comments (rather than update or create) for warnings, without GitDSL, when newComment option is passed", async () => {
const platform = new FakePlatform()
const exec = new Executor(
new FakeCI({}),
platform,
inlineRunner,
{ ...defaultConfig, newComment: true },
new FakeProcces()
)
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(warnResults)
expect(platform.createComment).toBeCalled()
expect(platform.updateOrCreateComment).not.toBeCalled()
})
it("Sends inline comments and returns regular results for failures", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createInlineComment = jest.fn().mockReturnValue(new Promise<any>((_, reject) => reject()))
let results = await exec.sendInlineComments(singleViolationSingleFileResults, dsl.git, [])
expect(results).toEqual(singleViolationSingleFileResults)
})
it("Creates an inline comment for warning", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createInlineComment = jest.fn()
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(inlineWarnResults, dsl.git)
expect(platform.createInlineComment).toBeCalled()
})
it("Creates multiple inline comments as a review", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createInlineReview = jest.fn()
platform.createInlineComment = jest.fn()
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(inlineMultipleWarnResults, dsl.git)
expect(platform.createInlineReview).toBeCalled()
expect(platform.createInlineComment).not.toBeCalled()
expect(platform.updateOrCreateComment).not.toBeCalled()
})
it("Creates multiple inline comments if review fails", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createInlineReview = jest.fn().mockImplementation(() => {
throw new Error("Should not be called")
})
platform.createInlineComment = jest.fn()
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(inlineMultipleWarnResults, dsl.git)
expect(platform.createInlineReview).toBeCalled()
expect(platform.createInlineComment).not.toBeCalled()
expect(platform.updateOrCreateComment).toBeCalled()
})
it("Invalid inline comment is ignored if ignoreOutOfDiffComments is true", async () => {
const platform = new FakePlatform()
const config = Object.assign({}, defaultConfig, { ignoreOutOfDiffComments: true })
const exec = new Executor(new FakeCI({}), platform, inlineRunner, config, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createInlineComment = jest.fn().mockReturnValue(new Promise<any>((_, reject) => reject()))
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
await exec.handleResults(inlineWarnResults, dsl.git)
expect(platform.createComment).not.toBeCalled()
expect(platform.updateOrCreateComment).not.toBeCalled()
})
it("Updates an inline comment as the new one was different than the old", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
const previousResults = inlineWarnResults
const newResults = inlineFailResults
const inlineResults = resultsIntoInlineResults(previousResults)[0]
const comment = inlineTemplate(defaultConfig.dangerID, previousResults, inlineResults.file, inlineResults.line)
const previousComments = [{ id: 1234, body: comment, ownedByDanger: true }]
platform.getInlineComments = jest.fn().mockReturnValue(new Promise((r) => r(previousComments)))
platform.updateInlineComment = jest.fn()
platform.createInlineComment = jest.fn()
await exec.handleResults(newResults, dsl.git)
expect(platform.updateInlineComment).toBeCalled()
expect(platform.createInlineComment).not.toBeCalled()
})
it("Updates multiple inline comments", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
const previousResults = inlineMultipleWarnResults
const newResults = inlineMultipleWarnResults2
const previousComments = mockPayloadForResults(previousResults)
platform.getInlineComments = jest.fn().mockReturnValue(new Promise((r) => r(previousComments)))
platform.updateInlineComment = jest.fn()
platform.createInlineComment = jest.fn()
platform.deleteInlineComment = jest.fn()
await exec.handleResults(newResults, dsl.git)
expect(platform.updateInlineComment).toHaveBeenCalledTimes(3)
expect(platform.createInlineComment).not.toBeCalled()
expect(platform.deleteInlineComment).not.toBeCalled()
})
it("Doesn't update/create an inline comment as the old was the same as the new", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
const previousResults = inlineWarnResults
const newResults = previousResults
const inlineResults = resultsIntoInlineResults(previousResults)[0]
const comment = inlineTemplate(defaultConfig.dangerID, previousResults, inlineResults.file, inlineResults.line)
const previousComments = [{ id: 1234, body: comment, ownedByDanger: true }]
platform.getInlineComments = jest.fn().mockReturnValue(new Promise((r) => r(previousComments)))
platform.updateInlineComment = jest.fn()
platform.createInlineComment = jest.fn()
await exec.handleResults(newResults, dsl.git)
expect(platform.updateInlineComment).not.toBeCalled()
expect(platform.createInlineComment).not.toBeCalled()
})
it("Creates new inline comment as none of the old ones was for this file/line", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
const previousResults = inlineWarnResults
const newResults = inlineMessageResults
const inlineResults = resultsIntoInlineResults(previousResults)[0]
const comment = inlineTemplate(defaultConfig.dangerID, previousResults, inlineResults.file, inlineResults.line)
const previousComments = [{ id: 1234, body: comment, ownedByDanger: true }]
platform.getInlineComments = jest.fn().mockReturnValue(new Promise((r) => r(previousComments)))
platform.updateInlineComment = jest.fn()
platform.createInlineComment = jest.fn()
await exec.handleResults(newResults, dsl.git)
expect(platform.updateInlineComment).not.toBeCalled()
expect(platform.createInlineComment).toBeCalled()
})
it("Deletes all old inline comments because new results are all clear", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
const previousResults = {
fails: [],
warnings: [
{ message: "1", file: "1.swift", line: 1 },
{ message: "2", file: "2.swift", line: 2 },
],
messages: [],
markdowns: [],
}
const previousComments = mockPayloadForResults(previousResults)
const newResults = emptyResults
platform.getInlineComments = jest.fn().mockReturnValue(new Promise((r) => r(previousComments)))
platform.updateInlineComment = jest.fn()
platform.createInlineComment = jest.fn()
platform.deleteInlineComment = jest.fn()
await exec.handleResults(newResults, dsl.git)
expect(platform.updateInlineComment).not.toBeCalled()
expect(platform.createInlineComment).not.toBeCalled()
expect(platform.deleteInlineComment).toHaveBeenCalledTimes(2)
})
it("Deletes all old inline comments when 'removePreviousComments' option has been specified", async () => {
const platform = new FakePlatform()
const exec = new Executor(
new FakeCI({}),
platform,
inlineRunner,
{ ...defaultConfig, removePreviousComments: true },
new FakeProcces()
)
const dsl = await defaultDsl(platform)
const previousComments = mockPayloadForResults(inlineMultipleWarnResults)
platform.getInlineComments = jest.fn().mockResolvedValueOnce(previousComments).mockResolvedValueOnce([])
platform.updateInlineComment = jest.fn()
platform.createInlineComment = jest.fn()
platform.deleteInlineComment = jest.fn()
await exec.handleResults(warnResults, dsl.git)
expect(platform.deleteInlineComment).toHaveBeenCalledTimes(3)
})
it("Deletes old inline comment when not applicable in new results", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
const previousResults = {
fails: [],
warnings: [
{ message: "1", file: "1.swift", line: 1 },
{ message: "2", file: "2.swift", line: 2 },
],
messages: [],
markdowns: [],
}
const newResults = {
fails: [],
warnings: [
{ message: "1", file: "1.swift", line: 2 },
{ message: "2", file: "2.swift", line: 3 },
],
messages: [],
markdowns: [],
}
const previousComments = mockPayloadForResults(previousResults)
platform.getInlineComments = jest.fn().mockReturnValue(new Promise((r) => r(previousComments)))
platform.updateInlineComment = jest.fn()
platform.createInlineComment = jest.fn()
platform.deleteInlineComment = jest.fn()
await exec.handleResults(newResults, dsl.git)
expect(platform.updateInlineComment).not.toBeCalled()
expect(platform.createInlineComment).toHaveBeenCalledTimes(2)
expect(platform.deleteInlineComment).toHaveBeenCalledTimes(2)
})
it("Updates the status with success for a passed empty results", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
platform.updateStatus = jest.fn()
await exec.handleResults(emptyResults, dsl.git)
expect(platform.updateStatus).toBeCalledWith(true, expect.any(String), undefined, defaultConfig.dangerID)
})
it("Updates the status with success for a passed results", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
platform.updateStatus = jest.fn()
await exec.handleResults(warnResults, dsl.git)
expect(platform.updateStatus).toBeCalledWith(
true,
"Found some issues. Don't worry, everything is fixable.",
undefined,
defaultConfig.dangerID
)
})
it("Updates the status with success for failing results", async () => {
const platform = new FakePlatform()
const exec = new Executor(new FakeCI({}), platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
platform.updateStatus = jest.fn()
await exec.handleResults(failsResults, dsl.git)
expect(platform.updateStatus).toBeCalledWith(
false,
"Found some issues. Don't worry, everything is fixable.",
undefined,
defaultConfig.dangerID
)
})
it("Passes the URL from a platform to the updateStatus", async () => {
const platform = new FakePlatform()
const ci: any = new FakeCI({})
ci.ciRunURL = "path_to_url"
const exec = new Executor(ci, platform, inlineRunner, defaultConfig, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
platform.updateStatus = jest.fn()
await exec.handleResults(failsResults, dsl.git)
expect(platform.updateStatus).toBeCalledWith(expect.anything(), expect.anything(), ci.ciRunURL, expect.anything())
})
it("Doesn't update status when check publishing feature is disabled", async () => {
const platform = new FakePlatform()
const ci: any = new FakeCI({})
ci.ciRunURL = "path_to_url"
const config = {
...defaultConfig,
noPublishCheck: true,
}
const exec = new Executor(ci, platform, inlineRunner, config, new FakeProcces())
const dsl = await defaultDsl(platform)
platform.createComment = jest.fn()
platform.updateOrCreateComment = jest.fn()
platform.updateStatus = jest.fn()
await exec.handleResults(failsResults, dsl.git)
expect(platform.updateStatus).not.toBeCalled()
})
})
``` | /content/code_sandbox/source/runner/_tests/_executor.test.ts | xml | 2016-08-20T12:57:06 | 2024-08-13T14:00:02 | danger-js | danger/danger-js | 5,229 | 4,892 |
```xml
'use client'
import React, { useState } from 'react'
import Link from 'next/link'
import Head from 'next/head'
import { Breadcrumb, Button } from 'antd'
import { HomeOutlined, AppstoreOutlined } from '@ant-design/icons'
import TodoListsTable from '@/components/TodoList/TodoListsTable'
import TodoListUpsertModal from '@/components/TodoList/TodoListUpsertModal'
import getPageTitle from '@/ui/lib/getPageTitle'
import AuthenticatedPage from '@/ui/components/layouts/AuthenticatedPage'
export default function TodoListsMasterPage() {
const [isUpsertModalVisible, setIsUpsertModalVisible] = useState(false)
function showUpsertModal() {
setIsUpsertModalVisible(true)
}
return (
<AuthenticatedPage>
<Head>
<title>{getPageTitle({ pageTitle: 'Todo lists' })}</title>
</Head>
<Breadcrumb items={[
{
title: <Link href='/' passHref><HomeOutlined /></Link>,
},
{
title: <>
<AppstoreOutlined />
<span>Todo lists</span>
</>,
},
]} />
<div className='toolbar'>
<Button type='primary' onClick={showUpsertModal}>
Create Todo list
</Button>
</div>
<TodoListUpsertModal
isOpen={isUpsertModalVisible}
setIsOpen={setIsUpsertModalVisible}
/>
<TodoListsTable />
<style jsx>
{`
.toolbar {
margin-bottom: 1rem;
}
`}
</style>
</AuthenticatedPage>
)
}
``` | /content/code_sandbox/examples/lambda-function-url/packages/ui/pages/todo-lists/index.tsx | xml | 2016-09-13T23:29:07 | 2024-08-15T09:52:47 | serverless-express | CodeGenieApp/serverless-express | 5,117 | 352 |
```xml
import { apiClient, codec, cryptography, Schema, Transaction } from 'lisk-sdk';
import { keys } from '../default/dev-validators.json';
type ModulesMetadata = [
{
stores: { key: string; data: Schema }[];
events: { name: string; data: Schema }[];
name: string;
commands: { name: string; params: Schema }[];
},
];
(async () => {
const { address } = cryptography;
const nodeAlias = 'one';
const tokenID = Buffer.from('0400000000000000', 'hex');
const mainchainID = Buffer.from('04000000', 'hex');
const recipientLSKAddress = 'lskzjzeam6szx4a65sxgavr98m9h4kctcx85nvy7h';
const recipientAddress = address.getAddressFromLisk32Address(recipientLSKAddress);
const sidechainClient = await apiClient.createIPCClient(`~/.lisk/pos-sidechain-example-one`);
const mainchainNodeInfo = await sidechainClient.invoke('system_getNodeInfo');
const { modules: modulesMetadata } = await sidechainClient.invoke<{
modules: ModulesMetadata;
}>('system_getMetadata');
const tokenMetadata = modulesMetadata.find(m => m.name === 'token');
const ccTransferCMDSchema = tokenMetadata?.commands.filter(
cmd => cmd.name == 'transferCrossChain',
)[0].params as Schema;
const params = {
tokenID,
amount: BigInt('990000000'),
receivingChainID: mainchainID,
recipientAddress,
data: 'cc transfer testing',
messageFee: BigInt('10000000'),
messageFeeTokenID: tokenID,
};
const relayerkeyInfo = keys[48];
const { nonce } = await sidechainClient.invoke<{ nonce: string }>('auth_getAuthAccount', {
address: address.getLisk32AddressFromPublicKey(Buffer.from(relayerkeyInfo.publicKey, 'hex')),
});
const tx = new Transaction({
module: 'token',
command: 'transferCrossChain',
fee: BigInt(200000000),
params: codec.encode(ccTransferCMDSchema, params),
nonce: BigInt(nonce),
senderPublicKey: Buffer.from(relayerkeyInfo.publicKey, 'hex'),
signatures: [],
});
tx.sign(
Buffer.from(mainchainNodeInfo.chainID as string, 'hex'),
Buffer.from(relayerkeyInfo.privateKey, 'hex'),
);
const result = await sidechainClient.invoke<{
transactionId: string;
}>('txpool_postTransaction', {
transaction: tx.getBytes().toString('hex'),
});
console.log(
`Sent cross chain transfer transaction (amount: ${params.amount.toString()}, recipient: ${recipientLSKAddress}) from sidechain (sidechainID: ${
params.receivingChainID
}) node ${nodeAlias} to mainchain. Result from transaction pool is: `,
result,
);
process.exit(0);
})();
``` | /content/code_sandbox/examples/interop/pos-sidechain-example-one/config/scripts/transfer_lsk_mainchain.ts | xml | 2016-02-01T21:45:35 | 2024-08-15T19:16:48 | lisk-sdk | LiskArchive/lisk-sdk | 2,721 | 644 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const WebTemplateIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M768 896h1280v1152H768V896zm1152 1024v-640H896v640h1024zm0-768v-128H896v128h1024zM128 0v128H0V0h128zm0 256v128H0V256h128zm0 256v128H0V512h128zm0 256v128H0V768h128zm0 256v128H0v-128h128zm0 256v128H0v-128h128zm0 256v128H0v-128h128zM0 1792h128v128H0v-128zm128 256v-128h128v128H128zM384 0v128H256V0h128zm0 2048v-128h128v128H384zM512 128V0h128v128H512zM896 0v128H768V0h128zm256 0v128h-128V0h128zm256 0v128h-128V0h128zm128 256h-128V128h128v128zm0 128v128h-128V384h128zm-128 384V640h128v128h-128z" />
</svg>
),
displayName: 'WebTemplateIcon',
});
export default WebTemplateIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/WebTemplateIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 371 |
```xml
import { Entity } from "../../../../src/decorator/entity/Entity"
import { PrimaryGeneratedColumn } from "../../../../src/decorator/columns/PrimaryGeneratedColumn"
import { Column } from "../../../../src/decorator/columns/Column"
@Entity()
export class Post {
@PrimaryGeneratedColumn()
id: number
@Column()
title: string
@Column()
text: string
}
``` | /content/code_sandbox/test/github-issues/211/entity/Post.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 85 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A5047E3D-8ACD-1684-7A27-320ADAEA8EB0}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cast_net</RootNamespace>
<IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
<PropertyGroup Label="Configuration">
<CharacterSet>Unicode</CharacterSet>
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Label="Locals">
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props"/>
<ImportGroup Label="ExtensionSettings"/>
<ImportGroup Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
</ImportGroup>
<PropertyGroup Label="UserMacros"/>
<PropertyGroup>
<EmbedManifest>false</EmbedManifest>
<ExecutablePath>$(ExecutablePath);$(MSBuildProjectDirectory)\.\bin\;$(MSBuildProjectDirectory)\.\bin\</ExecutablePath>
<OutDir>..\..\out\$(Configuration)\</OutDir>
<IntDir>$(OutDir)obj\$(ProjectName)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<TargetName>$(ProjectName)</TargetName>
<TargetPath>$(OutDir)lib\$(ProjectName)$(TargetExt)</TargetPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/MP /we4389 /bigobj /Zc:sizedDealloc- %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<BufferSecurityCheck>true</BufferSecurityCheck>
<CompileAsWinRT>false</CompileAsWinRT>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4091;4127;4351;4355;4503;4589;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4995;4996;4456;4457;4458;4459;4702;4267;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
</ClCompile>
<Lib>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
<OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<Link>
<AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;advapi32.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/maxilksize:0x7ff00000 /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<FixedBaseAddress>false</FixedBaseAddress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MapFileName>$(OutDir)$(TargetName).map</MapFileName>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Midl>
<AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DllDataFileName>%(Filename).dlldata.c</DllDataFileName>
<GenerateStublessProxies>true</GenerateStublessProxies>
<HeaderFileName>%(Filename).h</HeaderFileName>
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
<OutputDirectory>$(IntDir)</OutputDirectory>
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
</Midl>
<ResourceCompile>
<AdditionalIncludeDirectories>../..;$(OutDir)gen;$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/MP /we4389 /bigobj /Zc:sizedDealloc- %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<BufferSecurityCheck>true</BufferSecurityCheck>
<CompileAsWinRT>false</CompileAsWinRT>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4091;4127;4351;4355;4503;4589;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4995;4996;4456;4457;4458;4459;4702;4267;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
</ClCompile>
<Lib>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
<OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
<Link>
<AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;advapi32.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/maxilksize:0x7ff00000 /dynamicbase /ignore:4199 /ignore:4221 /nxcompat %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<FixedBaseAddress>false</FixedBaseAddress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<IgnoreSpecificDefaultLibraries>olepro32.lib</IgnoreSpecificDefaultLibraries>
<MapFileName>$(OutDir)$(TargetName).map</MapFileName>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<Midl>
<AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DllDataFileName>%(Filename).dlldata.c</DllDataFileName>
<GenerateStublessProxies>true</GenerateStublessProxies>
<HeaderFileName>%(Filename).h</HeaderFileName>
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
<OutputDirectory>$(IntDir)</OutputDirectory>
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
</Midl>
<ResourceCompile>
<AdditionalIncludeDirectories>../..;$(OutDir)gen;$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/MP /we4389 /bigobj /Zc:sizedDealloc- /d2Zi+ /Zc:inline /Oy- /Gw %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>true</BufferSecurityCheck>
<CompileAsWinRT>false</CompileAsWinRT>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4091;4127;4351;4355;4503;4589;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4995;4996;4456;4457;4458;4459;4702;4267;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<MinimalRebuild>false</MinimalRebuild>
<OmitFramePointers>false</OmitFramePointers>
<Optimization>MaxSpeed</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
</ClCompile>
<Lib>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
<OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<Link>
<AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;advapi32.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/maxilksize:0x7ff00000 /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<FixedBaseAddress>false</FixedBaseAddress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MapFileName>$(OutDir)$(TargetName).map</MapFileName>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<OptimizeReferences>true</OptimizeReferences>
<Profile>true</Profile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Midl>
<AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DllDataFileName>%(Filename).dlldata.c</DllDataFileName>
<GenerateStublessProxies>true</GenerateStublessProxies>
<HeaderFileName>%(Filename).h</HeaderFileName>
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
<OutputDirectory>$(IntDir)</OutputDirectory>
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
</Midl>
<ResourceCompile>
<AdditionalIncludeDirectories>../..;$(OutDir)gen;$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/MP /we4389 /bigobj /Zc:sizedDealloc- /d2Zi+ /Zc:inline /Oy- /Gw %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>true</BufferSecurityCheck>
<CompileAsWinRT>false</CompileAsWinRT>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4091;4127;4351;4355;4503;4589;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4995;4996;4456;4457;4458;4459;4702;4267;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<MinimalRebuild>false</MinimalRebuild>
<OmitFramePointers>false</OmitFramePointers>
<Optimization>MaxSpeed</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
</ClCompile>
<Lib>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
<OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
<Link>
<AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;advapi32.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/maxilksize:0x7ff00000 /dynamicbase /ignore:4199 /ignore:4221 /nxcompat %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<FixedBaseAddress>false</FixedBaseAddress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<IgnoreSpecificDefaultLibraries>olepro32.lib</IgnoreSpecificDefaultLibraries>
<MapFileName>$(OutDir)$(TargetName).map</MapFileName>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<OptimizeReferences>true</OptimizeReferences>
<Profile>true</Profile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<Midl>
<AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DllDataFileName>%(Filename).dlldata.c</DllDataFileName>
<GenerateStublessProxies>true</GenerateStublessProxies>
<HeaderFileName>%(Filename).h</HeaderFileName>
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
<OutputDirectory>$(IntDir)</OutputDirectory>
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
</Midl>
<ResourceCompile>
<AdditionalIncludeDirectories>../..;$(OutDir)gen;$(OutDir)gen;..\..\third_party\wtl\include;..\..;$(OutDir)gen\protoc_out;..\..;..\..\third_party\protobuf\vsprojects;..\..\third_party\protobuf\src;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;CLD_VERSION=2;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;DISABLE_NACL;CHROMIUM_BUILD;CR_CLANG_REVISION=247874-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;USE_PROPRIETARY_CODECS;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;FIELDTRIAL_TESTING_ENABLED;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PDF=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;PROTOBUF_USE_DLLS;GOOGLE_PROTOBUF_NO_RTTI;GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="cast.gyp"/>
</ItemGroup>
<ItemGroup>
<ClInclude Include="net\cast_transport_config.h"/>
<ClInclude Include="net\cast_transport_defines.h"/>
<ClInclude Include="net\cast_transport_sender.h"/>
<ClInclude Include="net\cast_transport_sender_impl.h"/>
<ClInclude Include="net\pacing\paced_sender.h"/>
<ClInclude Include="net\rtcp\rtcp.h"/>
<ClInclude Include="net\rtcp\rtcp_builder.h"/>
<ClInclude Include="net\rtcp\rtcp_defines.h"/>
<ClInclude Include="net\rtcp\rtcp_utility.h"/>
<ClInclude Include="net\rtp\packet_storage.h"/>
<ClInclude Include="net\rtp\rtp_defines.h"/>
<ClInclude Include="net\rtp\rtp_packetizer.h"/>
<ClInclude Include="net\rtp\rtp_parser.h"/>
<ClInclude Include="net\rtp\rtp_sender.h"/>
<ClInclude Include="net\udp_transport.h"/>
</ItemGroup>
<ItemGroup>
<ClCompile Include="net\cast_transport_config.cc"/>
<ClCompile Include="net\cast_transport_sender_impl.cc"/>
<ClCompile Include="net\pacing\paced_sender.cc"/>
<ClCompile Include="net\rtcp\receiver_rtcp_event_subscriber.cc"/>
<ClCompile Include="net\rtcp\rtcp.cc"/>
<ClCompile Include="net\rtcp\rtcp_builder.cc"/>
<ClCompile Include="net\rtcp\rtcp_defines.cc"/>
<ClCompile Include="net\rtcp\rtcp_utility.cc"/>
<ClCompile Include="net\rtp\packet_storage.cc"/>
<ClCompile Include="net\rtp\rtp_defines.cc"/>
<ClCompile Include="net\rtp\rtp_packetizer.cc"/>
<ClCompile Include="net\rtp\rtp_parser.cc"/>
<ClCompile Include="net\rtp\rtp_sender.cc"/>
<ClCompile Include="net\udp_transport.cc"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets"/>
<ImportGroup Label="ExtensionTargets"/>
<Target Name="Build">
<Exec Command="call ninja.exe -C $(OutDir) $(ProjectName)"/>
</Target>
<Target Name="Clean">
<Exec Command="call ninja.exe -C $(OutDir) -tclean $(ProjectName)"/>
</Target>
<Target Name="ClCompile">
<Exec Command="call P:\dev\depot_tools\python276_bin\python.exe $(OutDir)gyp-win-tool cl-compile $(ProjectDir) $(SelectedFiles)"/>
</Target>
</Project>
``` | /content/code_sandbox/orig_chrome/media/cast/cast_net.vcxproj | xml | 2016-09-27T03:41:10 | 2024-08-16T10:42:57 | miniblink49 | weolar/miniblink49 | 7,069 | 10,670 |
```xml
export interface MediaRepositoryCommentResponse {
comment: MediaRepositoryCommentResponseComment;
status: string;
}
export interface MediaRepositoryCommentResponseComment {
content_type: string;
user: MediaRepositoryCommentResponseUser;
pk: string;
text: string;
type: number;
created_at: number;
created_at_utc: number;
media_id: string;
status: string;
share_enabled: boolean;
}
export interface MediaRepositoryCommentResponseUser {
pk: number;
username: string;
full_name: string;
is_private: boolean;
profile_pic_url: string;
profile_pic_id: string;
is_verified: boolean;
has_anonymous_profile_picture: boolean;
reel_auto_archive: string;
allowed_commenter_type: string;
}
``` | /content/code_sandbox/src/responses/media.repository.comment.response.ts | xml | 2016-06-09T12:14:48 | 2024-08-16T10:07:22 | instagram-private-api | dilame/instagram-private-api | 5,877 | 167 |
```xml
import { ClientMessageWithEvents } from '../Generated'
import type { EventTypeEnum } from '../Event/EventTypeEnum'
import type { ClientEventVersion } from '../Version'
import { CreateEvent } from './CreateEvent'
export function CreateClientEventMessage(dto: {
type: EventTypeEnum
content: Uint8Array
authorAddress: string
timestamp: number
version: ClientEventVersion
}): ClientMessageWithEvents {
const event = CreateEvent(dto)
const message = new ClientMessageWithEvents({
events: [event],
})
return message
}
``` | /content/code_sandbox/packages/docs-proto/lib/Factory/CreateClientEventMessage.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 123 |
```xml
export const MeshoptDecoder: {
supported: boolean;
ready: Promise<void>;
decodeVertexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, filter?: string) => void;
decodeIndexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;
decodeIndexSequence: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;
decodeGltfBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, mode: string, filter?: string) => void;
useWorkers: (count: number) => void;
decodeGltfBufferAsync: (count: number, size: number, source: Uint8Array, mode: string, filter?: string) => Promise<Uint8Array>;
};
``` | /content/code_sandbox/js/meshopt_decoder.module.d.ts | xml | 2016-09-09T05:24:56 | 2024-08-16T16:04:23 | meshoptimizer | zeux/meshoptimizer | 5,424 | 198 |
```xml
import { CipherType } from "@bitwarden/common/vault/enums";
import { CardView } from "@bitwarden/common/vault/models/view/card.view";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { BaseImporter } from "../src/importers/base-importer";
class FakeBaseImporter extends BaseImporter {
initLoginCipher(): CipherView {
return super.initLoginCipher();
}
setCardExpiration(cipher: CipherView, expiration: string): boolean {
return super.setCardExpiration(cipher, expiration);
}
parseXml(data: string): Document {
return super.parseXml(data);
}
}
describe("BaseImporter class", () => {
const importer = new FakeBaseImporter();
let cipher: CipherView;
describe("setCardExpiration method", () => {
beforeEach(() => {
cipher = importer.initLoginCipher();
cipher.card = new CardView();
cipher.type = CipherType.Card;
});
it.each([
["01/2025", "1", "2025"],
["5/21", "5", "2021"],
["10/2100", "10", "2100"],
])(
"sets ciper card expYear & expMonth and returns true",
(expiration, expectedMonth, expectedYear) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(cipher.card.expMonth).toBe(expectedMonth);
expect(cipher.card.expYear).toBe(expectedYear);
expect(result).toBe(true);
},
);
it.each([
["01/2032", "1"],
["09/2032", "9"],
["10/2032", "10"],
])("removes leading zero from month", (expiration, expectedMonth) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(cipher.card.expMonth).toBe(expectedMonth);
expect(cipher.card.expYear).toBe("2032");
expect(result).toBe(true);
});
it.each([
["12/00", "2000"],
["12/99", "2099"],
["12/32", "2032"],
["12/2042", "2042"],
])("prefixes '20' to year if only two digits long", (expiration, expectedYear) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(cipher.card.expYear).toHaveLength(4);
expect(cipher.card.expYear).toBe(expectedYear);
expect(result).toBe(true);
});
it.each([["01 / 2025"], ["01 / 2025"], [" 01/2025 "], [" 01/2025 "]])(
"removes any whitespace in expiration string",
(expiration) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(cipher.card.expMonth).toBe("1");
expect(cipher.card.expYear).toBe("2025");
expect(result).toBe(true);
},
);
it.each([[""], [" "], [null]])(
"returns false if expiration is null or empty ",
(expiration) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(result).toBe(false);
},
);
it.each([["0123"], ["01/03/23"]])(
"returns false if invalid card expiration string",
(expiration) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(result).toBe(false);
},
);
it.each([["5/"], ["03/231"], ["12/1"], ["2/20221"]])(
"returns false if year is not 2 or 4 digits long",
(expiration) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(result).toBe(false);
},
);
it.each([["/2023"], ["003/2023"], ["111/32"]])(
"returns false if month is not 1 or 2 digits long",
(expiration) => {
const result = importer.setCardExpiration(cipher, expiration);
expect(result).toBe(false);
},
);
it("parse XML should reject xml with external entities", async () => {
const xml = `<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE replace [
<!ELEMENT replace ANY>
<!ENTITY xxe "External entity">
]>
<passwordsafe delimiter=";">
<entry><title>PoC XXE</title><username>&xxe;</username></entry>
</passwordsafe>`;
const result = importer.parseXml(xml);
expect(result).toBe(null);
});
});
});
``` | /content/code_sandbox/libs/importer/spec/base-importer.spec.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 1,017 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="path_to_url">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:id="@+id/text"/>
</merge>
``` | /content/code_sandbox/app/src/main/res/layout/view_label.xml | xml | 2016-04-22T16:59:44 | 2024-08-15T20:25:34 | OpenMemories-Tweak | ma1co/OpenMemories-Tweak | 1,151 | 65 |
```xml
import * as React from "react";
import { IAlert } from "../redux/view";
import Alert from "./Alert";
export interface IAlertListProps extends React.Props<AlertList> {
alerts: IAlert[];
}
export class AlertList extends React.Component<IAlertListProps> {
public static defaultProps: Partial<IAlertListProps> = {
alerts: [],
};
public render() {
return <div>{this.props.alerts.map(alert => <Alert {...alert} />)}</div>;
}
}
export default AlertList;
``` | /content/code_sandbox/src/components/AlertList.tsx | xml | 2016-01-21T17:02:22 | 2024-08-12T19:21:02 | datacamp-light | datacamp/datacamp-light | 1,304 | 113 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="path_to_url">
<UsingTask TaskName="SetVsSDKEnvironmentVariables" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<ProjectDirectory Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
System.Environment.SetEnvironmentVariable("VsSDKToolsPath", System.IO.Path.GetFullPath(ProjectDirectory + @"\..\tools\VSSDK\bin"),EnvironmentVariableTarget.Process);
System.Environment.SetEnvironmentVariable("VsSDKSchemaDir", System.IO.Path.GetFullPath(ProjectDirectory + @"\..\tools\VSSDK\schemas"),EnvironmentVariableTarget.Process);
</Code>
</Task>
</UsingTask>
<Target Name="SetVsSDKEnvironmentVariables" BeforeTargets="GeneratePkgDef;VSCTCompile;VSIXNameProjectOutputGroup">
<SetVsSDKEnvironmentVariables ProjectDirectory="$(MSBuildThisFileDirectory)" />
</Target>
</Project>
``` | /content/code_sandbox/packages/Microsoft.VSSDK.BuildTools.15.5.100/build/Microsoft.VSSDK.BuildTools.targets | xml | 2016-04-24T09:50:47 | 2024-08-16T11:45:14 | ILRuntime | Ourpalm/ILRuntime | 2,976 | 228 |
```xml
import type { SBType } from '@storybook/core/types';
import { UnknownArgTypesError } from '@storybook/core/preview-errors';
import { parseLiteral } from '../utils';
import type { TSSigType, TSType } from './types';
const convertSig = (type: TSSigType) => {
switch (type.type) {
case 'function':
return { name: 'function' };
case 'object':
const values: any = {};
type.signature.properties.forEach((prop) => {
values[prop.key] = convert(prop.value);
});
return {
name: 'object',
value: values,
};
default:
throw new UnknownArgTypesError({ type, language: 'Typescript' });
}
};
export const convert = (type: TSType): SBType | void => {
const { name, raw } = type;
const base: any = {};
if (typeof raw !== 'undefined') {
base.raw = raw;
}
switch (type.name) {
case 'string':
case 'number':
case 'symbol':
case 'boolean': {
return { ...base, name };
}
case 'Array': {
return { ...base, name: 'array', value: type.elements.map(convert) };
}
case 'signature':
return { ...base, ...convertSig(type) };
case 'union':
let result;
if (type.elements?.every((element) => element.name === 'literal')) {
result = {
...base,
name: 'enum',
// @ts-expect-error fix types
value: type.elements?.map((v) => parseLiteral(v.value)),
};
} else {
result = { ...base, name, value: type.elements?.map(convert) };
}
return result;
case 'intersection':
return { ...base, name, value: type.elements?.map(convert) };
default:
return { ...base, name: 'other', value: name };
}
};
``` | /content/code_sandbox/code/core/src/docs-tools/argTypes/convert/typescript/convert.ts | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 435 |
```xml
import * as child_process from "child_process";
import * as stream from "stream";
import { DaemonCapabilities } from "./capabilities/flutter";
import { LogCategory, LogSeverity } from "./enums";
import { Event } from "./events";
import * as f from "./flutter/daemon_interfaces";
import { UnknownResponse } from "./services/interfaces";
import { WorkspaceContext } from "./workspace";
export interface SdkSearchResults {
// The fully resolved path to the SDK.
sdkPath?: string;
// The original path (before following symlinks) that led us to [sdkPath].
originalPath?: string;
candidatePaths: string[];
sdkInitScript: string | undefined;
}
export interface SdkSearchResult {
// The fully resolved path to the SDK.
sdkPath: string;
// The original path (before following symlinks) that led us to [sdkPath].
originalPath: string;
}
export interface Sdks {
readonly dart?: string;
readonly dartVersion?: string;
readonly flutter?: string;
readonly flutterVersion?: string;
readonly dartSdkIsFromFlutter: boolean;
readonly isPreReleaseSdk: boolean;
}
export interface DartSdks extends Sdks {
readonly dart: string;
}
export interface FlutterSdks extends Sdks {
readonly flutter: string;
}
export interface DartWorkspaceContext extends WorkspaceContext {
readonly sdks: DartSdks;
}
// TODO(dantup): Move capabilities onto here?
export interface FlutterWorkspaceContext extends WorkspaceContext {
readonly sdks: FlutterSdks;
}
export interface WritableWorkspaceConfig {
// All fields here should handle undefined, and the default (undefined) state
// should be what is expected from a standard workspace without any additional
// config.
startDevToolsServerEagerly?: boolean;
startDevToolsFromDaemon?: boolean;
disableAnalytics?: boolean;
disableAutomaticPackageGet?: boolean;
/// Whether to disable DTD for this workspace.
disableDartToolingDaemon?: boolean;
disableSdkUpdateChecks?: boolean;
disableStartupPrompts?: boolean;
flutterDaemonScript?: CustomScript;
flutterDevToolsScript?: CustomScript;
flutterDoctorScript?: CustomScript;
flutterRunScript?: CustomScript;
flutterSdkHome?: string;
flutterTestScript?: CustomScript;
flutterToolsScript?: CustomScript;
flutterVersion?: string;
useLegacyProtocol?: boolean;
forceFlutterWorkspace?: boolean;
forceFlutterDebug?: boolean;
skipFlutterInitialization?: boolean;
omitTargetFlag?: boolean;
defaultDartSdk?: string;
restartMacDaemonMessage?: string;
localDeviceCommandAdviceMessage?: string;
localMacWarningMessage?: string;
/// Whether or not we can use pkg:test for running tests. This means the tool supports
/// arguments like "--plain-name", "--name".
///
/// true: definitely does support it (Bazel)
/// false: definitely does not support it (Dart SDK)
/// undefined: only if there's a pubspec
supportsPackageTest?: boolean;
/// Similar to [supportsPackageTest], but whether we can successfully run
/// commands like "dart run test:test --version".
supportsDartRunTest?: boolean;
}
export type WorkspaceConfig = Readonly<WritableWorkspaceConfig>;
export interface CustomScript {
script: string | undefined;
replacesArgs: number | undefined;
}
export interface DartProjectTemplate {
readonly name: string;
readonly label: string;
readonly description: string;
readonly categories: string[];
readonly entrypoint: string;
}
export interface FlutterProjectTemplate {
readonly id: string;
readonly empty?: boolean;
}
export interface FlutterCreateTriggerData {
readonly sample?: string;
readonly template?: string;
readonly empty?: boolean;
}
export interface Logger {
info(message: string, category?: LogCategory): void;
warn(message: any, category?: LogCategory): void;
error(error: any, category?: LogCategory): void;
}
export interface LogMessage {
readonly message: string;
readonly severity: LogSeverity;
readonly category: LogCategory;
toLine(maxLength: number): string;
}
export interface IAmDisposable {
dispose(): void | Promise<void>;
}
export interface CancellationToken {
isCancellationRequested: boolean;
onCancellationRequested: Event<any>;
}
export interface IFlutterDaemon extends IAmDisposable {
daemonStarted: Promise<void>;
capabilities: DaemonCapabilities;
enablePlatformGlobally(platformType: string): Promise<void>;
checkIfPlatformGloballyDisabled(platformType: string): Promise<boolean>;
deviceEnable(): Thenable<UnknownResponse>;
getEmulators(): Thenable<f.FlutterEmulator[]>;
launchEmulator(emulatorId: string, coldBoot: boolean): Thenable<void>;
createEmulator(name?: string): Thenable<{ success: boolean, emulatorName: string, error: string }>;
getSupportedPlatforms(projectRoot: string): Thenable<f.SupportedPlatformsResponse>;
serveDevTools(): Thenable<f.ServeDevToolsResponse>;
shutdown(): Thenable<void>
registerForDaemonConnected(subscriber: (notification: f.DaemonConnected) => void): IAmDisposable;
registerForDeviceAdded(subscriber: (notification: f.Device) => void): IAmDisposable;
registerForDeviceRemoved(subscriber: (notification: f.Device) => void): IAmDisposable;
registerForDaemonLogMessage(subscriber: (notification: f.DaemonLogMessage) => void): IAmDisposable;
registerForDaemonLog(subscriber: (notification: f.DaemonLog) => void): IAmDisposable;
registerForDaemonShowMessage(subscriber: (notification: f.ShowMessage) => void): IAmDisposable;
}
export type Emulator = (f.FlutterEmulator & { type: "emulator" }) | CustomEmulator;
export interface CustomEmulator {
id: string;
type: "custom-emulator";
category: "custom" | f.Category;
platformType?: undefined | f.PlatformType;
name: string;
executable: string;
args?: string[];
env?: { [key: string]: string };
}
export interface EmulatorCreator {
id?: undefined;
type: "emulator-creator";
platformType: "android";
}
export interface PlatformEnabler {
id?: undefined;
type: "platform-enabler";
platformType: f.PlatformType;
}
export interface FlutterCreateCommandArgs {
projectPath?: string;
projectName?: string;
triggerData?: FlutterCreateTriggerData;
platform?: string;
}
export interface CustomEmulatorDefinition {
id: string;
name: string;
executable: string;
args?: string[];
}
export interface Location {
startLine: number;
startColumn: number;
length: number;
}
export interface FlutterRawSurveyData {
uniqueId: string;
title: string;
url: string;
startDate: string;
endDate: string;
}
export interface FlutterSurveyData {
uniqueId: string;
title: string;
url: string;
startDate: number;
endDate: number;
}
export type SpawnedProcess = child_process.ChildProcess & {
stdin: stream.Writable,
stdout: stream.Readable,
stderr: stream.Readable,
};
export interface OpenedFileInformation {
readonly contents: string;
readonly selectionOffset: number;
readonly selectionLength: number;
}
export interface DevToolsPage {
id: string;
commandSuffix: string;
routeId?: (flutterVersion: string | undefined) => string;
title: string;
requiresFlutter?: boolean;
requiredDartSdkVersion?: string;
// Page can be opened without a VM Service.
isStaticTool?: boolean;
}
export interface WidgetErrorInspectData {
errorDescription: string;
devToolsUrl: string;
inspectorReference: string;
}
export interface Range {
start: Position;
end: Position;
}
export interface Position {
// Zero-based line number.
line: number;
// Zero-based line number.
character: number;
}
export interface Analytics {
logFlutterSurveyShown(): void;
logFlutterSurveyClicked(): void;
logFlutterSurveyDismissed(): void;
}
export interface MyCancellationToken {
isCancellationRequested: boolean;
}
export interface CustomDevToolsConfig {
args?: string[];
path?: string;
env?: { [key: string]: string };
}
export interface ExtensionConfig {
get experimentalTestRunnerInSdk(): boolean;
}
``` | /content/code_sandbox/src/shared/interfaces.ts | xml | 2016-07-30T13:49:11 | 2024-08-10T16:23:15 | Dart-Code | Dart-Code/Dart-Code | 1,472 | 1,761 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="path_to_url">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform>AnyCPU</Platform>
<ProjectGuid>{11848039-1F13-4047-9539-8F9F45930788}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SelfHost</RootNamespace>
<AssemblyName>signalrclient-testhost</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNet.SignalR.Core">
<HintPath>..\..\packages\Microsoft.AspNet.SignalR.Core.2.2.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin">
<HintPath>..\..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Diagnostics">
<HintPath>..\..\packages\Microsoft.Owin.Diagnostics.3.0.1\lib\net45\Microsoft.Owin.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener">
<HintPath>..\..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Hosting">
<HintPath>..\..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security">
<HintPath>..\..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Connections\HubConnection.cs" />
<Compile Include="Connections\RawConnection.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see path_to_url The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
``` | /content/code_sandbox/clients/cpp/test/signalrclient-testhost/signalrclient-testhost.csproj | xml | 2016-10-17T16:39:15 | 2024-08-15T16:33:14 | SignalR | aspnet/SignalR | 2,383 | 1,384 |
```xml
import { NativeModule } from './web/CoreModule';
export function createWebModule<ModuleType = any>(moduleImplementation: ModuleType): ModuleType {
const module = new NativeModule();
return Object.assign(module, moduleImplementation);
}
``` | /content/code_sandbox/packages/expo-modules-core/src/createWebModule.web.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 50 |
```xml
import Link from '@docusaurus/Link';
import Translate, { translate } from '@docusaurus/Translate';
import useBaseUrl from '@docusaurus/useBaseUrl';
import cx from 'classnames';
import React from 'react';
import Command from './Command';
import styles from './Header.module.scss';
import Logo from './Logo';
const Header = (): React.ReactElement => {
return (
<div className={styles.header}>
<div className={styles['header--wrap']}>
<Logo />
<div className={styles['header--mt-2']}>
<h1 className={styles['header--title']}>Verdaccio</h1>
<p className={styles['header--subtitle']}>
<Translate>A lightweight Node.js private proxy registry</Translate>
</p>
<iframe
src={
'path_to_url
}
frameBorder="0"
scrolling="0"
width="160px"
height="30px"
style={{ marginTop: '8px' }}
/>
<div className={styles['header--links']}>
<a href="/Talks" className="link-secondary">
WATCH
</a>
<Link to={useBaseUrl('/docs/what-is-verdaccio')} className="link-primary">
<Translate>GET STARTED</Translate>
</Link>
<a
href="path_to_url"
className={cx('link-secondary', 'specialButton')}
>
<Translate>DONATE</Translate>
</a>
</div>
</div>
<div className={styles['header--m-2']}>
<Command
command="npm install --global verdaccio"
alt={translate({ message: 'NPM command to install Verdaccio' })}
/>
</div>
</div>
</div>
);
};
export default Header;
``` | /content/code_sandbox/website/src/components/Header.tsx | xml | 2016-04-15T16:21:12 | 2024-08-16T09:38:01 | verdaccio | verdaccio/verdaccio | 16,189 | 400 |
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"path_to_url" >
<!--
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
path_to_url
Unless required by applicable law or agreed to in writing,
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
specific language governing permissions and limitations
-->
<mapper namespace="org.apache.guacamole.auth.jdbc.connection.ConnectionRecordMapper" >
<!-- Result mapper for system permissions -->
<resultMap id="ConnectionRecordResultMap" type="org.apache.guacamole.auth.jdbc.connection.ConnectionRecordModel">
<id column="history_id" property="recordID" jdbcType="INTEGER"/>
<result column="connection_id" property="connectionIdentifier" jdbcType="INTEGER"/>
<result column="connection_name" property="connectionName" jdbcType="VARCHAR"/>
<result column="remote_host" property="remoteHost" jdbcType="VARCHAR"/>
<result column="sharing_profile_id" property="sharingProfileIdentifier" jdbcType="INTEGER"/>
<result column="sharing_profile_name" property="sharingProfileName" jdbcType="VARCHAR"/>
<result column="user_id" property="userID" jdbcType="INTEGER"/>
<result column="username" property="username" jdbcType="VARCHAR"/>
<result column="start_date" property="startDate" jdbcType="TIMESTAMP"/>
<result column="end_date" property="endDate" jdbcType="TIMESTAMP"/>
</resultMap>
<!-- Insert the given connection record -->
<insert id="insert" useGeneratedKeys="true" keyProperty="record.recordID"
parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionRecordModel">
INSERT INTO guacamole_connection_history (
connection_id,
connection_name,
remote_host,
sharing_profile_id,
sharing_profile_name,
user_id,
username,
start_date,
end_date
)
VALUES (
#{record.connectionIdentifier,jdbcType=INTEGER}::integer,
#{record.connectionName,jdbcType=VARCHAR},
#{record.remoteHost,jdbcType=VARCHAR},
#{record.sharingProfileIdentifier,jdbcType=INTEGER}::integer,
#{record.sharingProfileName,jdbcType=VARCHAR},
(SELECT user_id FROM guacamole_user
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
WHERE
guacamole_entity.name = #{record.username,jdbcType=VARCHAR}
AND guacamole_entity.type = 'USER'::guacamole_entity_type),
#{record.username,jdbcType=VARCHAR},
#{record.startDate,jdbcType=TIMESTAMP},
#{record.endDate,jdbcType=TIMESTAMP}
)
</insert>
<!-- Update the given connection record, assigning an end date -->
<update id="updateEndDate" parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionRecordModel">
UPDATE guacamole_connection_history
SET end_date = #{record.endDate,jdbcType=TIMESTAMP}
WHERE history_id = #{record.recordID,jdbcType=INTEGER}::integer
</update>
<!-- Search for specific connection records -->
<select id="search" resultMap="ConnectionRecordResultMap">
SELECT
guacamole_connection_history.history_id,
guacamole_connection_history.connection_id,
guacamole_connection_history.connection_name,
guacamole_connection_history.remote_host,
guacamole_connection_history.sharing_profile_id,
guacamole_connection_history.sharing_profile_name,
guacamole_connection_history.user_id,
guacamole_connection_history.username,
guacamole_connection_history.start_date,
guacamole_connection_history.end_date
FROM guacamole_connection_history
<!-- Search terms -->
<where>
<if test="recordIdentifier != null">
guacamole_connection_history.history_id = #{recordIdentifier,jdbcType=INTEGER}::integer
</if>
<if test="identifier != null">
AND guacamole_connection_history.connection_id = #{identifier,jdbcType=INTEGER}::integer
</if>
<foreach collection="terms" item="term" open=" AND " separator=" AND ">
(
guacamole_connection_history.user_id IN (
SELECT user_id
FROM guacamole_user
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
)
OR guacamole_connection_history.connection_id IN (
SELECT connection_id
FROM guacamole_connection
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
)
<if test="term.startDate != null and term.endDate != null">
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
</if>
)
</foreach>
</where>
<!-- Bind sort property enum values for sake of readability -->
<bind name="START_DATE" value="@org.apache.guacamole.net.auth.ActivityRecordSet$SortableProperty@START_DATE"/>
<!-- Sort predicates -->
<foreach collection="sortPredicates" item="sortPredicate"
open="ORDER BY " separator=", ">
<choose>
<when test="sortPredicate.property == START_DATE">guacamole_connection_history.start_date</when>
<otherwise>1</otherwise>
</choose>
<if test="sortPredicate.descending">DESC</if>
</foreach>
LIMIT #{limit,jdbcType=INTEGER}
</select>
<!-- Search for specific connection records -->
<select id="searchReadable" resultMap="ConnectionRecordResultMap">
SELECT
guacamole_connection_history.history_id,
guacamole_connection_history.connection_id,
guacamole_connection_history.connection_name,
guacamole_connection_history.remote_host,
guacamole_connection_history.sharing_profile_id,
guacamole_connection_history.sharing_profile_name,
guacamole_connection_history.user_id,
guacamole_connection_history.username,
guacamole_connection_history.start_date,
guacamole_connection_history.end_date
FROM guacamole_connection_history
LEFT JOIN guacamole_connection ON guacamole_connection_history.connection_id = guacamole_connection.connection_id
LEFT JOIN guacamole_user ON guacamole_connection_history.user_id = guacamole_user.user_id
<!-- Search terms -->
<where>
<if test="recordIdentifier != null">
guacamole_connection_history.history_id = #{recordIdentifier,jdbcType=INTEGER}::integer
</if>
<!-- Restrict to readable connections -->
AND guacamole_connection_history.connection_id IN (
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
<property name="groups" value="effectiveGroups"/>
</include>
)
<!-- Restrict to readable users -->
AND guacamole_connection_history.user_id IN (
<include refid="org.apache.guacamole.auth.jdbc.user.UserMapper.getReadableIDs">
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
<property name="groups" value="effectiveGroups"/>
</include>
)
<if test="identifier != null">
AND guacamole_connection_history.connection_id = #{identifier,jdbcType=INTEGER}::integer
</if>
<foreach collection="terms" item="term" open=" AND " separator=" AND ">
(
guacamole_connection_history.user_id IN (
SELECT user_id
FROM guacamole_user
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
WHERE
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
AND guacamole_entity.type = 'USER'::guacamole_entity_type
)
OR guacamole_connection_history.connection_id IN (
SELECT connection_id
FROM guacamole_connection
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
)
<if test="term.startDate != null and term.endDate != null">
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
</if>
)
</foreach>
</where>
<!-- Bind sort property enum values for sake of readability -->
<bind name="START_DATE" value="@org.apache.guacamole.net.auth.ActivityRecordSet$SortableProperty@START_DATE"/>
<!-- Sort predicates -->
<foreach collection="sortPredicates" item="sortPredicate"
open="ORDER BY " separator=", ">
<choose>
<when test="sortPredicate.property == START_DATE">guacamole_connection_history.start_date</when>
<otherwise>1</otherwise>
</choose>
<if test="sortPredicate.descending">DESC</if>
</foreach>
LIMIT #{limit,jdbcType=INTEGER}
</select>
</mapper>
``` | /content/code_sandbox/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/apache/guacamole/auth/jdbc/connection/ConnectionRecordMapper.xml | xml | 2016-03-22T07:00:06 | 2024-08-16T13:03:48 | guacamole-client | apache/guacamole-client | 1,369 | 1,999 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--
~ All Rights Reserved.
-->
<vector
xmlns:android="path_to_url"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M6.99,11L3,15l3.99,4v-3H14v-2H6.99v-3zM21,9l-3.99,-4v3H10v2h7.01v3L21,9z" />
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/mutual_icon_white_24dp.xml | xml | 2016-02-01T13:44:19 | 2024-08-15T05:23:34 | Douya | zhanghai/Douya | 4,549 | 149 |
```xml
import { useState, useEffect } from 'react';
import '@/styles/globals.css';
import '@/styles/globals.less';
import type { AppProps } from 'next/app';
import { CustomProvider } from 'rsuite';
const useTeme = () => {
const [theme, setTheme] = useState<'light' | 'dark'>('light');
useEffect(() => {
const media = matchMedia('(prefers-color-scheme: dark)');
setTheme(media.matches ? 'dark' : 'light');
}, []);
return { theme };
};
export default function App({ Component, pageProps }: AppProps) {
const { theme } = useTeme();
return (
<CustomProvider theme={theme}>
<Component {...pageProps} />
</CustomProvider>
);
}
``` | /content/code_sandbox/examples/with-nextjs-pages-and-less/src/pages/_app.tsx | xml | 2016-06-06T02:27:46 | 2024-08-16T16:41:54 | rsuite | rsuite/rsuite | 8,263 | 167 |
```xml
import { ICreatedBy, IUser } from './IListCollection';
export interface IGenericCreateItem {
createdBy: ICreatedBy;
createDateTime: Date;
eTag: string;
id: string;
lastModifiedBy: IUser;
lastModifiedDateTime: Date;
listItemId: number;
webUrl: string;
}
``` | /content/code_sandbox/samples/angular-msgraph/src/webparts/msGraph/models/IGenericCreateItem.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 71 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.