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 /** * InfluxDuration represents components of InfluxDB duration. * See path_to_url#durations */ export type InfluxDuration = [ w: number, d: number, h: number, m: number, s: number, ms: number, us: number, ns: number ] const durationPartIndex: Record<string, number> = { w: 0, d: 1, h: 2, m: 3, s: 4, ms: 5, u: 6, s: 6, ns: 7, } /** * ParseDuration parses string into a InfluxDuration, unknown duration parts are simply ignored. * @param duration duration literal per path_to_url#durations * @returns InfluxDuration */ export function parseDuration(duration: string): InfluxDuration { const retVal = new Array<number>(8).fill(0) as InfluxDuration const regExp = /([0-9]+)([^0-9]+)/g let matched: string[] while ((matched = regExp.exec(duration)) !== null) { const index = durationPartIndex[matched[2]] if (index === undefined) { // ignore unknown part continue } retVal[index] = parseInt(matched[1], 10) } return retVal } /** * CompareDurations implements sort comparator for InfluxDuration instances. */ export function compareDurations(a: InfluxDuration, b: InfluxDuration): number { let i = 0 for (; i < 8; i++) { if (a[i] !== b[i]) { return a[i] - b[i] } } return 0 } ```
/content/code_sandbox/ui/src/utils/influxDuration.ts
xml
2016-08-24T23:28:56
2024-08-13T19:50:03
chronograf
influxdata/chronograf
1,494
384
```xml <vector android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp" xmlns:android="path_to_url"> <path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/> </vector> ```
/content/code_sandbox/Android/AndroidRecyclerViewSwipeToDelete/app/src/main/res/drawable/ic_delete.xml
xml
2016-05-02T05:43:21
2024-08-16T06:51:39
journaldev
WebJournal/journaldev
1,314
145
```xml "use client" import { useState, useEffect, useRef } from "react" import { ContentHeader } from "@/components/custom/content-header" import { PiLinkSimple } from "react-icons/pi" import { Bookmark, GraduationCap, Check } from "lucide-react" interface LinkProps { title: string url: string } const links = [ { title: "JavaScript", url: "path_to_url" }, { title: "TypeScript", url: "path_to_url" }, { title: "React", url: "path_to_url" } ] const LinkItem: React.FC<LinkProps> = ({ title, url }) => ( <div className="mb-1 flex flex-row items-center justify-between rounded-xl bg-[#121212] px-2 py-4 hover:cursor-pointer"> <div className="flex items-center space-x-4"> <p>{title}</p> <span className="text-md flex flex-row items-center space-x-1 font-medium tracking-wide text-white/20 hover:opacity-50"> <PiLinkSimple size={20} className="text-white/20" /> <a href={url} target="_blank" rel="noopener noreferrer"> {new URL(url).hostname} </a> </span> </div> </div> ) interface ButtonProps { children: React.ReactNode onClick: () => void className?: string color?: string icon?: React.ReactNode fullWidth?: boolean } const Button: React.FC<ButtonProps> = ({ children, onClick, className = "", color = "", icon, fullWidth = false }) => { return ( <button className={`flex items-center justify-start rounded px-3 py-1 text-sm font-medium ${ fullWidth ? "w-full" : "" } ${className} ${color}`} onClick={onClick} > {icon && <span className="mr-2 flex items-center">{icon}</span>} <span>{children}</span> </button> ) } export default function GlobalTopic({ topic }: { topic: string }) { const [showOptions, setShowOptions] = useState(false) const [selectedOption, setSelectedOption] = useState<string | null>(null) const [activeTab, setActiveTab] = useState("Guide") const decodedTopic = decodeURIComponent(topic) const learningStatusRef = useRef<HTMLDivElement>(null) useEffect(() => { function handleClickOutside(event: MouseEvent) { if (learningStatusRef.current && !learningStatusRef.current.contains(event.target as Node)) { setShowOptions(false) } } document.addEventListener("mousedown", handleClickOutside) return () => { document.removeEventListener("mousedown", handleClickOutside) } }, []) const learningOptions = [ { text: "To Learn", icon: <Bookmark size={18} /> }, { text: "Learning", icon: <GraduationCap size={18} /> }, { text: "Learned", icon: <Check size={18} /> } ] const learningStatusColor = (option: string) => { switch (option) { case "To Learn": return "text-white/70" case "Learning": return "text-[#D29752]" case "Learned": return "text-[#708F51]" default: return "text-white/70" } } const selectedStatus = (option: string) => { setSelectedOption(option) setShowOptions(false) } return ( <div className="flex h-full flex-auto flex-col overflow-hidden"> <ContentHeader> <div className="flex w-full items-center justify-between"> <h1 className="text-2xl font-bold">{decodedTopic}</h1> <div className="flex items-center space-x-4"> <div className="flex rounded-lg bg-neutral-800 bg-opacity-60"> <button onClick={() => setActiveTab("Guide")} className={`px-4 py-2 text-[16px] font-semibold transition-colors ${ activeTab === "Guide" ? "rounded-lg bg-neutral-800 shadow-inner shadow-neutral-700/70" : "text-white/70" }`} > Guide </button> <button onClick={() => setActiveTab("All links")} className={`px-4 py-2 text-[16px] font-semibold transition-colors ${ activeTab === "All links" ? "rounded-lg bg-neutral-800 shadow-inner shadow-neutral-700/70" : "text-white/70" }`} > All links </button> </div> </div> </div> <div className="relative"> <Button onClick={() => setShowOptions(!showOptions)} className="w-[150px] whitespace-nowrap rounded-[7px] bg-neutral-800 px-4 py-2 text-[17px] font-semibold shadow-inner shadow-neutral-700/50 transition-colors hover:bg-neutral-700" color={learningStatusColor(selectedOption || "")} icon={selectedOption && learningOptions.find(opt => opt.text === selectedOption)?.icon} > {selectedOption || "Add to my profile"} </Button> {showOptions && ( <div ref={learningStatusRef} className="absolute left-1/2 mt-1 w-40 -translate-x-1/2 rounded-lg bg-neutral-800 shadow-lg" > {learningOptions.map(option => ( <Button key={option.text} onClick={() => selectedStatus(option.text)} className="space-x-1 px-2 py-2 text-left text-[14px] font-semibold hover:bg-neutral-700" color={learningStatusColor(option.text)} icon={option.icon} fullWidth > {option.text} </Button> ))} </div> )} </div> </ContentHeader> <div className="px-5 py-3"> <h2 className="mb-3 text-white/60">Intro</h2> {links.map((link, index) => ( <LinkItem key={index} title={link.title} url={link.url} /> ))} </div> <div className="px-5 py-3"> <h2 className="mb-3 text-opacity-60">Other</h2> {links.map((link, index) => ( <LinkItem key={index} title={link.title} url={link.url} /> ))} </div> <div className="flex-1 overflow-auto p-4"></div> </div> ) } ```
/content/code_sandbox/web/components/routes/globalTopic/globalTopic.tsx
xml
2016-08-08T16:09:17
2024-08-16T16:23:04
learn-anything.xyz
learn-anything/learn-anything.xyz
15,943
1,471
```xml import { Component } from '@angular/core'; import { Code } from '@domain/code'; @Component({ selector: 'import-doc', template: ` <app-code [code]="code" [hideToggleCode]="true"></app-code> ` }) export class ImportDoc { code: Code = { typescript: `import { ButtonModule } from 'primeng/button';` }; } ```
/content/code_sandbox/src/app/showcase/doc/button/importdoc.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
83
```xml import React from 'react' import { mdiLanguageHtml5, mdiLanguageMarkdownOutline, mdiGoogle, } from '@mdi/js' import styled from '../../../../design/lib/styled' import Icon from '../../../../design/components/atoms/Icon' import { overflowEllipsis } from '../../../../design/lib/styled/styleFunctions' interface ImportModalSelectSourceProps { pickSource: (val: string) => void } const ImportFlowSource = ({ pickSource }: ImportModalSelectSourceProps) => ( <Container> <div className='import__flow__row'> <SourceButton label={'Markdown or text'} logo={<Icon path={mdiLanguageMarkdownOutline} size={26} />} onClick={() => pickSource('md')} /> <SourceButton label={'Html'} logo={<Icon path={mdiLanguageHtml5} size={26} />} onClick={() => pickSource('html')} /> <SourceButton label={'Evernote'} logo={<img src='/app/static/logos/evernote.svg' />} onClick={() => pickSource('evernote')} externalLink='path_to_url /> </div> <div className='import__flow__row'> <SourceButton label={'Confluence'} logo={<img src='/app/static/logos/confluence.svg' />} onClick={() => pickSource('confluence')} externalLink='path_to_url /> <SourceButton label={'Notion'} logo={<img src='/app/static/logos/notion.svg' />} onClick={() => pickSource('notion')} externalLink='path_to_url /> <SourceButton label={'Google Docs'} logo={<Icon path={mdiGoogle} size={26} />} onClick={() => pickSource('gdocs')} externalLink='path_to_url /> </div> <div className='import__flow__row'> <SourceButton label={'Quip'} logo={<img src='/app/static/logos/quip.svg' />} onClick={() => pickSource('quip')} externalLink='path_to_url /> <SourceButton label={'Dropbox'} logo={<img src='/app/static/logos/dropboxpaper.svg' />} onClick={() => pickSource('dropbox')} externalLink='path_to_url /> </div> </Container> ) const SourceButton = ({ label, logo, externalLink, onClick, }: { label: string onClick: () => void logo: React.ReactNode externalLink?: string }) => ( <div className='import__source'> <button className='import__source__button' onClick={onClick}> <div className='import__source__icon'>{logo}</div> <span className='import__source__label'>{label}</span> </button> {externalLink && ( <a rel='noopener noreferrer' target='_blank' className='import__source__link' href={externalLink} > ? </a> )} </div> ) const Container = styled.div` .import__flow__row { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; } .import__source__button { background: none; display: inline-flex; flex: 1 1 auto; color: inherit; align-items: center; text-align: left; &:hover { color: ${({ theme }) => theme.colors.text.subtle}; } } .import__flow__row + .import__flow__row { margin-top: ${({ theme }) => theme.sizes.spaces.df}px; } .import__source { display: flex; width: 33%; flex: 1 1 auto; max-width: 32%; align-items: center; border: 1px solid ${({ theme }) => theme.colors.border.main}; border-radius: ${({ theme }) => theme.borders.radius}px; padding: ${({ theme }) => theme.sizes.spaces.xsm}px ${({ theme }) => theme.sizes.spaces.xsm}px; } .import__source__label { flex: 1 1 auto; ${overflowEllipsis} } .import__source + .import__source { margin-left: ${({ theme }) => theme.sizes.spaces.df}px; } .import__source__icon { flex: 0 0 auto; margin-right: ${({ theme }) => theme.sizes.spaces.sm}px; img, svg { width: 26; height: 26px; } } .import__source__link { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; text-align: center; text-decoration: none; cursor: pointer; background: ${({ theme }) => theme.colors.variants.secondary.base}; color: ${({ theme }) => theme.colors.variants.secondary.text}; line-height: 20px; &:hover { filter: brightness(1.3); } } ` export default ImportFlowSource ```
/content/code_sandbox/src/cloud/components/ImportFlow/molecules/ImportFlowSources.tsx
xml
2016-11-19T14:30:34
2024-08-16T03:13:45
BoostNote-App
BoostIO/BoostNote-App
3,745
1,131
```xml /* * * See the LICENSE file at the top-level directory of this distribution * for licensing information. * * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation, * no part of this software, including this file, may be copied, modified, * propagated, or distributed except according to the terms contained in the * LICENSE file. * * Removal or modification of this copyright notice is prohibited. */ import { LENGTH_CHAIN_ID, LENGTH_COLLECTION_ID, LENGTH_NFT_ID, MAX_LENGTH_MODULE_NAME, MIN_LENGTH_MODULE_NAME, MAX_LENGTH_DATA, } from './constants'; export const transferParamsSchema = { $id: '/lisk/nftTransferParams', type: 'object', required: ['nftID', 'recipientAddress', 'data'], properties: { nftID: { dataType: 'bytes', minLength: LENGTH_NFT_ID, maxLength: LENGTH_NFT_ID, fieldNumber: 1, }, recipientAddress: { dataType: 'bytes', format: 'lisk32', fieldNumber: 2, }, data: { dataType: 'string', minLength: 0, maxLength: MAX_LENGTH_DATA, fieldNumber: 3, }, }, }; export const crossChainNFTTransferMessageParamsSchema = { $id: '/lisk/crossChainNFTTransferMessageParamsSchmema', type: 'object', required: ['nftID', 'senderAddress', 'recipientAddress', 'attributesArray', 'data'], properties: { nftID: { dataType: 'bytes', minLength: LENGTH_NFT_ID, maxLength: LENGTH_NFT_ID, fieldNumber: 1, }, senderAddress: { dataType: 'bytes', format: 'lisk32', fieldNumber: 2, }, recipientAddress: { dataType: 'bytes', format: 'lisk32', fieldNumber: 3, }, attributesArray: { type: 'array', fieldNumber: 4, items: { type: 'object', required: ['module', 'attributes'], properties: { module: { dataType: 'string', minLength: MIN_LENGTH_MODULE_NAME, maxLength: MAX_LENGTH_MODULE_NAME, pattern: '^[a-zA-Z0-9]*$', fieldNumber: 1, }, attributes: { dataType: 'bytes', fieldNumber: 2, }, }, }, }, data: { dataType: 'string', maxLength: MAX_LENGTH_DATA, fieldNumber: 5, }, }, }; export interface CCTransferMessageParams { nftID: Buffer; attributesArray: { module: string; attributes: Buffer }[]; senderAddress: Buffer; recipientAddress: Buffer; data: string; } export const crossChainTransferParamsSchema = { $id: '/lisk/crossChainNFTTransferParamsSchema', type: 'object', required: [ 'nftID', 'receivingChainID', 'recipientAddress', 'data', 'messageFee', 'includeAttributes', ], properties: { nftID: { dataType: 'bytes', minLength: LENGTH_NFT_ID, maxLength: LENGTH_NFT_ID, fieldNumber: 1, }, receivingChainID: { dataType: 'bytes', minLength: LENGTH_CHAIN_ID, maxLength: LENGTH_CHAIN_ID, fieldNumber: 2, }, recipientAddress: { dataType: 'bytes', format: 'lisk32', fieldNumber: 3, }, data: { dataType: 'string', minLength: 0, maxLength: MAX_LENGTH_DATA, fieldNumber: 4, }, messageFee: { dataType: 'uint64', fieldNumber: 5, }, includeAttributes: { dataType: 'boolean', fieldNumber: 6, }, }, }; export const getNFTsRequestSchema = { $id: '/nft/endpoint/getNFTsRequest', type: 'object', properties: { address: { type: 'string', format: 'lisk32', }, }, required: ['address'], }; export const getNFTsResponseSchema = { $id: '/nft/endpoint/getNFTsResponse', type: 'object', properties: { nfts: { type: 'array', items: { type: 'object', properties: { id: { type: 'string', format: 'hex', }, attributesArray: { type: 'array', items: { type: 'object', properties: { module: { type: 'string', }, attributes: { type: 'string', format: 'hex', }, }, }, }, lockingModule: { type: 'string', }, }, }, }, }, }; export const hasNFTRequestSchema = { $id: '/nft/endpoint/hasNFTRequest', type: 'object', properties: { address: { type: 'string', format: 'lisk32', }, id: { type: 'string', format: 'hex', minLength: LENGTH_NFT_ID * 2, maxLength: LENGTH_NFT_ID * 2, }, }, required: ['address', 'id'], }; export const hasNFTResponseSchema = { $id: '/nft/endpoint/hasNFTResponse', type: 'object', properties: { hasNFT: { type: 'boolean', }, }, }; export const getNFTRequestSchema = { $id: '/nft/endpoint/getNFTRequest', type: 'object', properties: { id: { type: 'string', format: 'hex', minLength: LENGTH_NFT_ID * 2, maxLength: LENGTH_NFT_ID * 2, }, }, required: ['id'], }; export const getNFTResponseSchema = { $id: '/nft/endpoint/getNFTResponse', type: 'object', properties: { owner: { type: 'string', format: 'hex', }, attributesArray: { type: 'array', items: { type: 'object', properties: { module: { type: 'string', }, attributes: { type: 'string', format: 'hex', }, }, }, }, lockingModule: { type: 'string', }, }, }; export const getSupportedCollectionIDsResponseSchema = { $id: '/nft/endpoint/getSupportedCollectionIDsRespone', type: 'object', properties: { supportedCollectionIDs: { type: 'array', items: { type: 'string', format: 'hex', }, }, }, }; export const isCollectionIDSupportedRequestSchema = { $id: '/nft/endpoint/isCollectionIDSupportedRequest', type: 'object', properties: { chainID: { type: 'string', format: 'hex', minLength: LENGTH_CHAIN_ID * 2, maxLength: LENGTH_CHAIN_ID * 2, }, collectionID: { type: 'string', format: 'hex', minLength: LENGTH_COLLECTION_ID * 2, maxLength: LENGTH_COLLECTION_ID * 2, }, }, required: ['chainID', 'collectionID'], }; export const isCollectionIDSupportedResponseSchema = { $id: '/nft/endpoint/isCollectionIDSupportedResponse', type: 'object', properties: { isCollectionIDSupported: { type: 'boolean', }, }, }; export const getEscrowedNFTIDsRequestSchema = { $id: '/nft/endpoint/getEscrowedNFTIDsRequest', type: 'object', properties: { chainID: { type: 'string', format: 'hex', minLength: LENGTH_CHAIN_ID * 2, maxLength: LENGTH_CHAIN_ID * 2, }, }, required: ['chainID'], }; export const getEscrowedNFTIDsResponseSchema = { $id: '/nft/endpoint/getEscrowedNFTIDsResponse', type: 'object', properties: { escrowedNFTIDs: { type: 'array', items: { type: 'string', format: 'hex', }, }, }, }; export const isNFTSupportedRequestSchema = { $id: '/nft/endpoint/isNFTSupportedRequest', type: 'object', properties: { nftID: { type: 'string', format: 'hex', minLength: LENGTH_NFT_ID * 2, maxLength: LENGTH_NFT_ID * 2, }, }, required: ['nftID'], }; export const isNFTSupportedResponseSchema = { $id: '/nft/endpoint/isNFTSupportedResponse', type: 'object', properties: { isNFTSupported: { type: 'boolean', }, }, }; export const genesisNFTStoreSchema = { $id: '/nft/module/genesis', type: 'object', required: ['nftSubstore', 'supportedNFTsSubstore'], properties: { nftSubstore: { type: 'array', fieldNumber: 1, items: { type: 'object', required: ['nftID', 'owner', 'attributesArray'], properties: { nftID: { dataType: 'bytes', minLength: LENGTH_NFT_ID, maxLength: LENGTH_NFT_ID, fieldNumber: 1, }, owner: { dataType: 'bytes', fieldNumber: 2, }, attributesArray: { type: 'array', fieldNumber: 3, items: { type: 'object', required: ['module', 'attributes'], properties: { module: { dataType: 'string', minLength: MIN_LENGTH_MODULE_NAME, maxLength: MAX_LENGTH_MODULE_NAME, pattern: '^[a-zA-Z0-9]*$', fieldNumber: 1, }, attributes: { dataType: 'bytes', fieldNumber: 2, }, }, }, }, }, }, }, supportedNFTsSubstore: { type: 'array', fieldNumber: 2, items: { type: 'object', required: ['chainID', 'supportedCollectionIDArray'], properties: { chainID: { dataType: 'bytes', fieldNumber: 1, }, supportedCollectionIDArray: { type: 'array', fieldNumber: 2, items: { type: 'object', required: ['collectionID'], properties: { collectionID: { dataType: 'bytes', minLength: LENGTH_COLLECTION_ID, maxLength: LENGTH_COLLECTION_ID, fieldNumber: 1, }, }, }, }, }, }, }, }, }; ```
/content/code_sandbox/framework/src/modules/nft/schemas.ts
xml
2016-02-01T21:45:35
2024-08-15T19:16:48
lisk-sdk
LiskArchive/lisk-sdk
2,721
2,522
```xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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"> <View android:id="@+id/controller_bg" android:layout_width="0dp" android:layout_height="@dimen/audio_player_main_controller_height" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> <androidx.media3.ui.DefaultTimeBar android:id="@id/exo_progress" style="@style/Widget.Mega.TimeBar" android:layout_width="0dp" android:layout_height="20dp" android:layout_marginStart="16dp" android:layout_marginEnd="16dp" android:layout_marginBottom="20dp" app:layout_constraintBottom_toTopOf="@id/track_name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> <TextView android:id="@id/exo_position" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="24dp" android:textAppearance="@style/TextAppearance.Mega.Caption.Variant3" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/exo_progress" tools:text="00:30" /> <TextView android:id="@id/exo_duration" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="24dp" android:textAppearance="@style/TextAppearance.Mega.Caption.Variant3" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/exo_progress" tools:text="04:30" /> <TextView android:id="@+id/track_name" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginHorizontal="20dp" android:layout_marginBottom="@dimen/audio_player_track_name_margin_bottom_small" android:ellipsize="marquee" android:gravity="center" android:singleLine="true" android:textAppearance="@style/TextAppearance.Mega.Subtitle1.Medium.Variant6" app:layout_constraintBottom_toTopOf="@id/artist_name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" tools:text="Cashew Rhythm" /> <TextView android:id="@+id/artist_name" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginHorizontal="54dp" android:layout_marginBottom="10dp" android:ellipsize="marquee" android:gravity="center" android:singleLine="true" android:textAppearance="@style/TextAppearance.Mega.Subtitle2.Normal.Variant" app:layout_constraintBottom_toTopOf="@id/exo_play_pause" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" tools:text="Two Fingers" /> <androidx.constraintlayout.widget.Guideline android:id="@+id/control_button_center" android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintGuide_end="92dp" /> <ImageButton android:id="@+id/exo_rew" style="@style/AudioPlayerButton" android:layout_marginStart="10dp" android:src="@drawable/media_player_15_minus" app:layout_constraintBottom_toBottomOf="@id/control_button_center" app:layout_constraintEnd_toStartOf="@id/exo_prev" app:layout_constraintHorizontal_chainStyle="spread_inside" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/control_button_center" /> <ImageButton android:id="@id/exo_prev" style="@style/AudioPlayerButton" android:src="@drawable/media_player_prev" app:layout_constraintBottom_toBottomOf="@id/control_button_center" app:layout_constraintEnd_toStartOf="@id/play_pause_placeholder" app:layout_constraintHorizontal_chainStyle="spread_inside" app:layout_constraintStart_toEndOf="@id/exo_rew" app:layout_constraintTop_toTopOf="@id/control_button_center" /> <View android:id="@+id/play_pause_placeholder" android:layout_width="64dp" android:layout_height="64dp" app:layout_constraintBottom_toBottomOf="@id/control_button_center" app:layout_constraintEnd_toStartOf="@id/exo_next" app:layout_constraintHorizontal_chainStyle="spread_inside" app:layout_constraintStart_toEndOf="@id/exo_prev" app:layout_constraintTop_toTopOf="@id/control_button_center" /> <ImageButton android:id="@id/exo_play_pause" style="@style/ExoStyledControls.Button.Center.PlayPause" android:layout_width="64dp" android:layout_height="64dp" android:background="@null" app:layout_constraintStart_toStartOf="@id/play_pause_placeholder" app:layout_constraintTop_toTopOf="@id/play_pause_placeholder" /> <ImageButton android:id="@id/exo_next" style="@style/AudioPlayerButton" android:src="@drawable/media_player_next" app:layout_constraintBottom_toBottomOf="@id/control_button_center" app:layout_constraintEnd_toStartOf="@id/exo_ffwd" app:layout_constraintHorizontal_chainStyle="spread_inside" app:layout_constraintStart_toEndOf="@id/play_pause_placeholder" app:layout_constraintTop_toTopOf="@id/control_button_center" /> <ImageButton android:id="@+id/exo_ffwd" style="@style/AudioPlayerButton" android:layout_marginEnd="10dp" android:src="@drawable/media_player_15_plus" app:layout_constraintBottom_toBottomOf="@id/control_button_center" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_chainStyle="spread_inside" app:layout_constraintStart_toEndOf="@id/exo_next" app:layout_constraintTop_toTopOf="@id/control_button_center" /> <ImageButton android:id="@id/exo_shuffle" style="@style/AudioPlayerButton" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/exo_prev" app:layout_constraintStart_toStartOf="@id/exo_prev" tools:src="@drawable/exo_styled_controls_shuffle_on" /> <ImageButton android:id="@id/exo_repeat_toggle" style="@style/AudioPlayerButton" android:src="@drawable/exo_styled_controls_repeat_all" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> <ImageButton android:id="@+id/playlist" style="@style/AudioPlayerButton" android:enabled="false" android:src="@drawable/ic_player_queue" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/exo_next" app:layout_constraintStart_toStartOf="@id/exo_next" app:tint="@color/dark_grey_white"/> </androidx.constraintlayout.widget.ConstraintLayout> ```
/content/code_sandbox/app/src/main/res/layout/audio_player_control.xml
xml
2016-05-04T11:46:20
2024-08-15T16:29:10
android
meganz/android
1,537
1,699
```xml <epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> <command> <renew> <domain:renew xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> <domain:name>example.tld</domain:name> <domain:curExpDate>2000-04-03</domain:curExpDate> <domain:period unit="m">5</domain:period> </domain:renew> </renew> <clTRID>ABC-12345</clTRID> </command> </epp> ```
/content/code_sandbox/core/src/test/resources/google/registry/flows/domain/domain_renew_months.xml
xml
2016-02-29T20:16:48
2024-08-15T19:49:29
nomulus
google/nomulus
1,685
140
```xml <?xml version="1.0"?> <?define VerMajor = "22" ?> <?define VerMinor = "01" ?> <?define VerBuild = "00" ?> <?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?> <?define MmHex = "$(var.VerMajor)$(var.VerMinor)" ?> <?define MmmmVer = "$(var.MmVer).$(var.VerBuild).0" ?> <?define UpgradeMinVer = "4.38" ?> <?define ProductName = "7-Zip" ?> <?ifndef MyCPU?> <?define MyCPU = "Intel" ?> <?endif?> <?if $(var.MyCPU) = "x64" ?> <?define CpuId = "2" ?> <?define PFilesFolder = "ProgramFiles64Folder" ?> <?define Platforms = "x64" ?> <?define CpuPostfix = " (x64 edition)" ?> <?define Is64 = "yes" ?> <?define NumBits = "64" ?> <?elseif $(var.MyCPU) = "ia64" ?> <?define CpuId = "3" ?> <?define PFilesFolder = "ProgramFiles64Folder" ?> <?define Platforms = "Intel64" ?> <?define CpuPostfix = " (ia64 edition)" ?> <?define Is64 = "yes" ?> <?define NumBits = "64" ?> <?else ?> <?define CpuId = "1" ?> <?define PFilesFolder = "ProgramFilesFolder" ?> <?define Platforms = "Intel" ?> <?define CpuPostfix = "" ?> <?define Is64 = "no" ?> <?define NumBits = "32" ?> <?endif ?> <?define ShellExtId = "{23170F69-40C1-278A-1000-000100020000}" ?> <?define BaseId = "23170F69-40C1-270$(var.CpuId)" ?> <?define BaseIdVer = "$(var.BaseId)-$(var.MmHex)-$(var.VerBuild)00" ?> <?define ProductId = "$(var.BaseIdVer)01000000" ?> <?define PackageId = "$(var.BaseIdVer)02000000" ?> <?define CompId = "$(var.BaseIdVer)030000" ?> <?define UpgradeCode = "$(var.BaseId)-0000-000004000000" ?> <?define CompFm = "$(var.CompId)01" ?> <?define CompShellExt = "$(var.CompId)02" ?> <?define CompCmdLine = "$(var.CompId)03" ?> <?define CompCmdLineA = "$(var.CompId)04" ?> <?define CompGui = "$(var.CompId)05" ?> <?define CompGuiSfx = "$(var.CompId)06" ?> <?define CompConSfx = "$(var.CompId)07" ?> <?define CompHelp = "$(var.CompId)08" ?> <?define CompDocs = "$(var.CompId)09" ?> <?define CompFormats = "$(var.CompId)10" ?> <?define CompCodecs = "$(var.CompId)11" ?> <?define CompLang = "$(var.CompId)12" ?> <?define CompShellExt2 = "$(var.CompId)13" ?> <?define CompInstallRegCU = "$(var.CompId)80" ?> <?define CompInstallRegLM = "$(var.CompId)81" ?> <?define CompInstallRegWild = "$(var.CompId)82" ?> <?define CompInstallRegDirectory = "$(var.CompId)83" ?> <?define CompInstallRegDirDD = "$(var.CompId)84" ?> <?define CompInstallRegDriveDD = "$(var.CompId)85" ?> <?define CompInstallRegApproved = "$(var.CompId)86" ?> <?define CompInstallRegAppPath = "$(var.CompId)87" ?> <?define CompInstallRegFolder = "$(var.CompId)88" ?> <?define Manufacturer = "Igor Pavlov" ?> <?define HomePage = "path_to_url" ?> <?define AboutURL = "$(var.HomePage)" ?> <?define UpdatesURL = "$(var.HomePage)download.html" ?> <?define SupportURL = "$(var.HomePage)support.html" ?> <Wix xmlns="path_to_url"> <Product Id="$(var.ProductId)" UpgradeCode="$(var.UpgradeCode)" Name="$(var.ProductName) $(var.MmVer)$(var.CpuPostfix)" Language="1033" Version="$(var.MmmmVer)" Manufacturer="$(var.Manufacturer)"> <Package Id="$(var.PackageId)" Description="$(var.ProductName)$(var.CpuPostfix) Package" Comments="$(var.ProductName)$(var.CpuPostfix) Package" Manufacturer="$(var.Manufacturer)" InstallerVersion="200" Compressed="yes" Platforms="$(var.Platforms)" /> <!-- Major upgrade --> <Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion Minimum="$(var.UpgradeMinVer)" IncludeMinimum="yes" Maximum="$(var.MmmmVer)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" /> </Upgrade> <Media Id="1" Cabinet="product.cab" EmbedCab="yes" CompressionLevel="high" /> <Property Id="MSIRMSHUTDOWN" Value="2"/> <Property Id="INSTALLDIR"> <RegistrySearch Id="My7zipPathLM" Type="raw" Root="HKLM" Key="Software\7-Zip" Name="Path" /> <RegistrySearch Id="My7zipPathLM2" Type="raw" Root="HKLM" Key="Software\7-Zip" Name="Path$(var.NumBits)" /> <RegistrySearch Id="My7zipPath" Type="raw" Root="HKCU" Key="Software\7-Zip" Name="Path" /> <RegistrySearch Id="My7zipPath2" Type="raw" Root="HKCU" Key="Software\7-Zip" Name="Path$(var.NumBits)" /> </Property> <Property Id="ALLUSERS">2</Property> <Property Id="ARPURLINFOABOUT" Value="$(var.AboutURL)" /> <Property Id="ARPHELPLINK" Value="$(var.SupportURL)" /> <Property Id="ARPURLUPDATEINFO" Value="$(var.UpdatesURL)" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="$(var.PFilesFolder)" Name="Files"> <Directory Id="INSTALLDIR" Name="7-Zip"> <Component Id="InstallRegCU" Guid="$(var.CompInstallRegCU)" DiskId="1" Win64="$(var.Is64)"> <Registry Id="MyInstallRegCU" Root="HKCU" Key="Software\7-Zip" Name="Path" Action="write" Type="string" Value="[INSTALLDIR]" /> <Registry Id="MyInstallRegCU2" Root="HKCU" Key="Software\7-Zip" Name="Path$(var.NumBits)" Action="write" Type="string" Value="[INSTALLDIR]" /> </Component> <Component Id="InstallRegLM" Guid="$(var.CompInstallRegLM)" DiskId="1" Win64="$(var.Is64)"> <Condition>Privileged</Condition> <Registry Id="MyInstallRegLM" Root="HKLM" Key="Software\7-Zip" Name="Path" Action="write" Type="string" Value="[INSTALLDIR]" /> <Registry Id="MyInstallRegLM2" Root="HKLM" Key="Software\7-Zip" Name="Path$(var.NumBits)" Action="write" Type="string" Value="[INSTALLDIR]" /> </Component> <Component Id="InstallRegWild" Guid="$(var.CompInstallRegWild)" DiskId="1" Win64="$(var.Is64)"> <Registry Id="MyInstallRegWild" Action="write" Type="string" Root="HKCR" Key="*\shellex\ContextMenuHandlers\7-Zip" Value="$(var.ShellExtId)" /> </Component> <Component Id="InstallRegDirectory" Guid="$(var.CompInstallRegDirectory)" DiskId="1" Win64="$(var.Is64)"> <Registry Id="MyInstallRegDirectory" Action="write" Type="string" Root="HKCR" Key="Directory\shellex\ContextMenuHandlers\7-Zip" Value="$(var.ShellExtId)" /> </Component> <Component Id="InstallRegFolder" Guid="$(var.CompInstallRegFolder)" DiskId="1" Win64="$(var.Is64)"> <Registry Id="MyInstallRegFolder" Action="write" Type="string" Root="HKCR" Key="Folder\shellex\ContextMenuHandlers\7-Zip" Value="$(var.ShellExtId)" /> </Component> <Component Id="InstallRegDirDD" Guid="$(var.CompInstallRegDirDD)" DiskId="1" Win64="$(var.Is64)"> <Registry Id="MyInstallRegDirDD" Action="write" Type="string" Root="HKCR" Key="Directory\shellex\DragDropHandlers\7-Zip" Value="$(var.ShellExtId)" /> </Component> <Component Id="InstallRegDriveDD" Guid="$(var.CompInstallRegDriveDD)" DiskId="1" Win64="$(var.Is64)"> <Registry Id="MyInstallRegDriveDD" Action="write" Type="string" Root="HKCR" Key="Drive\shellex\DragDropHandlers\7-Zip" Value="$(var.ShellExtId)" /> </Component> <Component Id="InstallRegApproved" Guid="$(var.CompInstallRegApproved)" DiskId="1" Win64="$(var.Is64)"> <Condition>Privileged</Condition> <Registry Id="MyInstallRegApproved" Action="write" Type="string" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Name="$(var.ShellExtId)" Value="7-Zip Shell Extension" /> </Component> <Component Id="InstallRegAppPath" Guid="$(var.CompInstallRegAppPath)" DiskId="1" Win64="$(var.Is64)"> <Condition>Privileged</Condition> <Registry Id="MyInstallRegAppPath" Action="write" Type="string" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe" Value="[INSTALLDIR]7zFM.exe" /> <Registry Id="MyInstallRegAppPath2" Action="write" Type="string" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe" Name="Path" Value="[INSTALLDIR]" /> </Component> <Component Id="Fm" Guid="$(var.CompFm)" DiskId="1" Win64="$(var.Is64)"> <File Id="_7zFM.exe" Name="7zFM.exe"> <Shortcut Id="startmenuFmShortcut" Directory="PMenu" Name="7zipFM" LongName="7-Zip ZS File Manager" /> </File> </Component> <?if $(var.MyCPU) = "x64" ?> <Component Id="ShellExt32" Guid="$(var.CompShellExt2)" DiskId="1" Win64="no"> <File Id="_7zip32.dll" Name="7-zip32.dll" /> <Registry Id="shellReg0_32" Action="write" Type="string" Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32" Value="[INSTALLDIR]7-zip32.dll" /> <Registry Id="shellReg1_32" Action="write" Type="string" Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32" Name="ThreadingModel" Value="Apartment" /> </Component> <?endif ?> <Component Id="ShellExt" Guid="$(var.CompShellExt)" DiskId="1" Win64="$(var.Is64)"> <File Id="_7zip.dll" Name="7-zip.dll" /> <Registry Id="shellReg0" Action="write" Type="string" Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32" Value="[INSTALLDIR]7-zip.dll" /> <Registry Id="shellReg1" Action="write" Type="string" Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32" Name="ThreadingModel" Value="Apartment" /> </Component> <Component Id="Gui" Guid="$(var.CompGui)" DiskId="1" Win64="$(var.Is64)"> <File Id="_7zG.exe" Name="7zG.exe" /> </Component> <Component Id="Formats" Guid="$(var.CompFormats)" DiskId="1" Win64="$(var.Is64)"> <File Id="_7z.dll" Name="7z.dll" /> </Component> <Component Id="CmdLine" Guid="$(var.CompCmdLine)" DiskId="1" Win64="$(var.Is64)"> <File Id="_7z.exe" Name="7z.exe" /> </Component> <Component Id="GuiSfx" Guid="$(var.CompGuiSfx)" DiskId="1" Win64="$(var.Is64)"> <File Id="_7z.sfx" Name="7z.sfx" /> </Component> <Component Id="ConSfx" Guid="$(var.CompConSfx)" DiskId="1" Win64="$(var.Is64)"> <File Id="_7zCon.sfx" Name="7zCon.sfx" /> </Component> <Component Id="Docs" Guid="$(var.CompDocs)" DiskId="1" Win64="$(var.Is64)"> <File Id="descript.ion" Name="descript.ion" /> <File Id="History.txt" Name="History.txt" /> <File Id="readme.txt" Name="readme.txt" /> </Component> <Component Id="Help" Guid="$(var.CompHelp)"> <File Id="_7zip.chm" Name="7-zip.chm" DiskId="1" > <Shortcut Id="startmenuHelpShortcut" Directory="PMenu" Name="7zipHelp" LongName="7-Zip Help" /> </File> </Component> <Directory Id="MyLang" Name="Lang"> <Component Id="Lang" Guid="$(var.CompLang)" DiskId="1" Win64="$(var.Is64)"> <File Id="en.ttt" Name="en.ttt" /> <File Id="af.txt" Name="af.txt" /> <File Id="an.txt" Name="an.txt" /> <File Id="ar.txt" Name="ar.txt" /> <File Id="ast.txt" Name="ast.txt" /> <File Id="az.txt" Name="az.txt" /> <File Id="ba.txt" Name="ba.txt" /> <File Id="be.txt" Name="be.txt" /> <File Id="bg.txt" Name="bg.txt" /> <File Id="bn.txt" Name="bn.txt" /> <File Id="br.txt" Name="br.txt" /> <File Id="ca.txt" Name="ca.txt" /> <File Id="co.txt" Name="co.txt" /> <File Id="cs.txt" Name="cs.txt" /> <File Id="cy.txt" Name="cy.txt" /> <File Id="da.txt" Name="da.txt" /> <File Id="de.txt" Name="de.txt" /> <File Id="el.txt" Name="el.txt" /> <File Id="eo.txt" Name="eo.txt" /> <File Id="es.txt" Name="es.txt" /> <File Id="et.txt" Name="et.txt" /> <File Id="eu.txt" Name="eu.txt" /> <File Id="ext.txt" Name="ext.txt" /> <File Id="fa.txt" Name="fa.txt" /> <File Id="fi.txt" Name="fi.txt" /> <File Id="fr.txt" Name="fr.txt" /> <File Id="fur.txt" Name="fur.txt" /> <File Id="fy.txt" Name="fy.txt" /> <File Id="ga.txt" Name="ga.txt" /> <File Id="gl.txt" Name="gl.txt" /> <File Id="gu.txt" Name="gu.txt" /> <File Id="he.txt" Name="he.txt" /> <File Id="hi.txt" Name="hi.txt" /> <File Id="hr.txt" Name="hr.txt" /> <File Id="hu.txt" Name="hu.txt" /> <File Id="hy.txt" Name="hy.txt" /> <File Id="id.txt" Name="id.txt" /> <File Id="io.txt" Name="io.txt" /> <File Id="is.txt" Name="is.txt" /> <File Id="it.txt" Name="it.txt" /> <File Id="ja.txt" Name="ja.txt" /> <File Id="ka.txt" Name="ka.txt" /> <File Id="kaa.txt" Name="kaa.txt" /> <File Id="kab.txt" Name="kab.txt" /> <File Id="kk.txt" Name="kk.txt" /> <File Id="ko.txt" Name="ko.txt" /> <File Id="ku.txt" Name="ku.txt" /> <File Id="ku_ckb.txt" Name="ku-ckb.txt" /> <File Id="ky.txt" Name="ky.txt" /> <File Id="lij.txt" Name="lij.txt" /> <File Id="lt.txt" Name="lt.txt" /> <File Id="lv.txt" Name="lv.txt" /> <File Id="mk.txt" Name="mk.txt" /> <File Id="mn.txt" Name="mn.txt" /> <File Id="mng.txt" Name="mng.txt" /> <File Id="mng2.txt" Name="mng2.txt" /> <File Id="mr.txt" Name="mr.txt" /> <File Id="ms.txt" Name="ms.txt" /> <File Id="ne.txt" Name="ne.txt" /> <File Id="nl.txt" Name="nl.txt" /> <File Id="nb.txt" Name="nb.txt" /> <File Id="nn.txt" Name="nn.txt" /> <File Id="pa_in.txt" Name="pa-in.txt" /> <File Id="pl.txt" Name="pl.txt" /> <File Id="ps.txt" Name="ps.txt" /> <File Id="pt.txt" Name="pt.txt" /> <File Id="pt_br.txt" Name="pt-br.txt" /> <File Id="ro.txt" Name="ro.txt" /> <File Id="ru.txt" Name="ru.txt" /> <File Id="sa.txt" Name="sa.txt" /> <File Id="si.txt" Name="si.txt" /> <File Id="sk.txt" Name="sk.txt" /> <File Id="sl.txt" Name="sl.txt" /> <File Id="sq.txt" Name="sq.txt" /> <File Id="sr_spl.txt" Name="sr-spl.txt" /> <File Id="sr_spc.txt" Name="sr-spc.txt" /> <File Id="sv.txt" Name="sv.txt" /> <File Id="sw.txt" Name="sw.txt" /> <File Id="ta.txt" Name="ta.txt" /> <File Id="tg.txt" Name="tg.txt" /> <File Id="th.txt" Name="th.txt" /> <File Id="tk.txt" Name="tk.txt" /> <File Id="tr.txt" Name="tr.txt" /> <File Id="tt.txt" Name="tt.txt" /> <File Id="ug.txt" Name="ug.txt" /> <File Id="uk.txt" Name="uk.txt" /> <File Id="uz.txt" Name="uz.txt" /> <File Id="uz_cyrl.txt" Name="uz-cyrl.txt" /> <File Id="va.txt" Name="va.txt" /> <File Id="vi.txt" Name="vi.txt" /> <File Id="yo.txt" Name="yo.txt" /> <File Id="zh_cn.txt" Name="zh-cn.txt" /> <File Id="zh_tw.txt" Name="zh-tw.txt" /> </Component> </Directory> </Directory> </Directory> <Directory Id="ProgramMenuFolder" Name="PMenu" LongName="Programs"> <Directory Id="PMenu" Name="7zip" LongName="7-Zip" /> </Directory> </Directory> <Feature Id="Complete" Title="7-Zip" Description="The complete package." Display="expand" Level="1" ConfigurableDirectory="INSTALLDIR" Absent="disallow" AllowAdvertise="no" > <Feature Id="Program" Title="Program files" Description="Program files." Level="1" Absent="disallow" AllowAdvertise="no"> <ComponentRef Id="Fm" /> <ComponentRef Id="ShellExt" /> <?if $(var.MyCPU) = "x64" ?> <ComponentRef Id="ShellExt32" /> <?endif ?> <ComponentRef Id="CmdLine" /> <ComponentRef Id="Gui" /> <ComponentRef Id="GuiSfx" /> <ComponentRef Id="ConSfx" /> <ComponentRef Id="Formats" /> <ComponentRef Id="Docs" /> <ComponentRef Id="Help" /> <ComponentRef Id="InstallRegCU" /> <ComponentRef Id="InstallRegLM" /> <ComponentRef Id="InstallRegWild" /> <ComponentRef Id="InstallRegDirectory" /> <ComponentRef Id="InstallRegDirDD" /> <ComponentRef Id="InstallRegDriveDD" /> <ComponentRef Id="InstallRegApproved" /> <ComponentRef Id="InstallRegAppPath" /> <ComponentRef Id="InstallRegFolder" /> </Feature> <Feature Id="LanguageFiles" Title="Localization files" Description="Localization files for 71 languages." Level="1" AllowAdvertise="no"> <ComponentRef Id="Lang" /> </Feature> </Feature> <UIRef Id="WixUI" /> <!-- Install Sequences --> <InstallExecuteSequence> <RemoveExistingProducts After="InstallValidate" /> </InstallExecuteSequence> </Product> </Wix> ```
/content/code_sandbox/DOC/7zip.wxs
xml
2016-06-25T19:19:58
2024-08-16T10:47:27
7-Zip-zstd
mcmilk/7-Zip-zstd
4,978
5,003
```xml export * from './RatingItemContext'; ```
/content/code_sandbox/packages/react-components/react-rating/library/src/contexts/index.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
9
```xml <?xml version="1.0" encoding="UTF-8"?> <testsuites> <testsuite name="tensorflow/python/kernel_tests/zero_division_test" tests="1" failures="0" errors="0"> <testcase name="tensorflow/python/kernel_tests/zero_division_test" status="run"></testcase> </testsuite> </testsuites> ```
/content/code_sandbox/testlogs/python27/2016_07_17/tensorflow/python/kernel_tests/zero_division_test/test.xml
xml
2016-03-12T06:26:47
2024-08-12T19:21:52
tensorflow-on-raspberry-pi
samjabrahams/tensorflow-on-raspberry-pi
2,242
81
```xml <resources> <string name="lib_name">blelib</string> <string name="ota_error">%1$s</string> <string name="update_retry"></string> <string name="update_cancel"></string> <string name="updating">,</string> </resources> ```
/content/code_sandbox/core/src/main/res/values/strings.xml
xml
2016-11-29T06:15:08
2024-08-16T11:21:28
Android-BLE
aicareles/Android-BLE
2,623
63
```xml <response status="success"> <result> <flags>flags: A:active, ?:loose, C:connect, H:host, S:static, ~:internal, R:rip, O:ospf, B:bgp, Oi:ospf intra-area, Oo:ospf inter-area, O1:ospf ext-type-1, O2:ospf ext-type-2, E:ecmp, M:multicast</flags> <entry> <virtual-router>default</virtual-router> <destination>0.0.0.0/0</destination> <nexthop>1.1.1.1</nexthop> <metric>10</metric> <flags>A S </flags> <age></age> <interface>ethernet1/1</interface> <route-table>unicast</route-table> </entry> </result> </response> ```
/content/code_sandbox/Packs/PAN-OS/Integrations/Panorama/test_data/show_routing_route.xml
xml
2016-06-06T12:17:02
2024-08-16T11:52:59
content
demisto/content
1,108
206
```xml import * as compose from 'lodash.flowright'; import { ToCheckCategoriesMutationResponse, ToSyncCategoriesMutationResponse, } from '../types'; import Alert from '@erxes/ui/src/utils/Alert'; import { Bulk } from '@erxes/ui/src/components'; import InventoryCategory from '../components/inventoryCategory/InventoryCategory'; import React from 'react'; import { gql } from '@apollo/client'; import { graphql } from '@apollo/client/react/hoc'; import { mutations } from '../graphql'; import { withProps } from '@erxes/ui/src/utils/core'; type Props = { queryParams: any; }; type FinalProps = {} & Props & ToCheckCategoriesMutationResponse & ToSyncCategoriesMutationResponse; type State = { items: any; loading: boolean; }; class InventoryCategoryContainer extends React.Component<FinalProps, State> { constructor(props) { super(props); this.state = { items: {}, loading: false, }; } render() { const { items, loading } = this.state; const setSyncStatus = (data: any, action: string) => { const createData = data[action].items.map((d) => ({ ...d, syncStatus: false, })); data[action].items = createData; return data; }; const setSyncStatusTrue = (data: any, categories: any, action: string) => { data[action].items = data[action].items.map((i) => { if (categories.find((c) => c.code === i.code)) { const temp = i; temp.syncStatus = true; return temp; } return i; }); }; const toSyncCategories = (action: string, categories: any[]) => { this.setState({ loading: true }); this.props .toSyncCategories({ variables: { action, categories, }, }) .then(() => { this.setState({ loading: false }); Alert.success('Success. Please check again.'); }) .finally(() => { const data = this.state.items; setSyncStatusTrue(data, categories, action.toLowerCase()); this.setState({ items: data }); }) .catch((e) => { Alert.error(e.message); this.setState({ loading: false }); }); }; const toCheckCategories = () => { this.setState({ loading: true }); this.props .toCheckCategories({ variables: {} }) .then((response) => { const data = response.data.toCheckCategories; setSyncStatus(data, 'create'); setSyncStatus(data, 'update'); setSyncStatus(data, 'delete'); this.setState({ items: response.data.toCheckCategories }); this.setState({ loading: false }); }) .catch((e) => { Alert.error(e.message); this.setState({ loading: false }); }); }; const updatedProps = { ...this.props, loading, toCheckCategories, toSyncCategories, items, }; const content = (props) => ( <InventoryCategory {...props} {...updatedProps} /> ); return <Bulk content={content} />; } } export default withProps<Props>( compose( graphql<Props, ToCheckCategoriesMutationResponse, {}>( gql(mutations.toCheckCategories), { name: 'toCheckCategories', }, ), graphql<Props, ToSyncCategoriesMutationResponse, {}>( gql(mutations.toSyncCategories), { name: 'toSyncCategories', }, ), )(InventoryCategoryContainer), ); ```
/content/code_sandbox/packages/plugin-syncerkhet-ui/src/containers/InventoryCategory.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
770
```xml import React from 'react'; import { storiesOf } from '@storybook/react-native'; import { withKnobs } from '@storybook/addon-knobs'; import Wrapper from './../../Wrapper'; import { Example as Basic } from './basic'; import { Example as HiddenFromAndToBreakpoints } from './hiddenFromAndToBreakpoints'; import { Example as HiddenOnColorModes } from './hiddenOnColorModes'; import { Example as HiddenOnlyOnBreakPoints } from './hiddenOnlyOnBreakPoints'; import { Example as HiddenOnPlatforms } from './hiddenOnPlatforms'; storiesOf('Hidden', module) .addDecorator(withKnobs) .addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>) .add('Basic', () => <Basic />) .add('HiddenOnColorModes', () => <HiddenOnColorModes />) .add('HiddenFromAndToBreakpoints', () => <HiddenFromAndToBreakpoints />) .add('HiddenOnlyOnBreakPoints', () => <HiddenOnlyOnBreakPoints />) .add('HiddenOnPlatforms', () => <HiddenOnPlatforms />); ```
/content/code_sandbox/example/storybook/stories/components/primitives/Hidden/index.tsx
xml
2016-04-15T11:37:23
2024-08-14T16:16:44
NativeBase
GeekyAnts/NativeBase
20,132
234
```xml import { ABIFunc } from './abiFunc'; import { IERC20 } from './erc20'; type uint256 = any; export interface IGolemMigration extends IERC20 { migrate: ABIFunc<{ _value: uint256 }>; } ```
/content/code_sandbox/src/types/golemV2Migration.ts
xml
2016-12-04T01:35:27
2024-08-14T21:41:58
MyCrypto
MyCryptoHQ/MyCrypto
1,347
54
```xml /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import { assert } from "chai"; import { mount, type ReactWrapper } from "enzyme"; import * as React from "react"; import { spy } from "sinon"; import { ResizeSensor, type ResizeSensorProps } from "../../src/components/resize-sensor/resizeSensor"; describe("<ResizeSensor>", () => { // this scope variable is assigned in mountResizeSensor() and used in resize() let wrapper: ReactWrapper<ResizeTesterProps, any> | undefined; const testsContainerElement = document.createElement("div"); document.documentElement.appendChild(testsContainerElement); afterEach(() => { // clean up wrapper after each test, if it was used wrapper?.unmount(); wrapper?.detach(); }); after(() => testsContainerElement.remove()); it("onResize is called when size changes", async () => { const onResize = spy(); mountResizeSensor({ onResize }); await resize({ width: 200 }); await resize({ height: 100 }); await resize({ width: 55 }); assert.equal(onResize.callCount, 3); assertResizeArgs(onResize, ["200x0", "200x100", "55x100"]); }); it("onResize is NOT called redundantly when size is unchanged", async () => { const onResize = spy(); mountResizeSensor({ onResize }); await resize({ width: 200 }); await resize({ width: 200 }); // this one should be ignored assert.equal(onResize.callCount, 1); assertResizeArgs(onResize, ["200x0"]); }); it("onResize is called when element changes", async () => { const onResize = spy(); mountResizeSensor({ onResize }); await resize({ width: 200, id: 1 }); await resize({ width: 200, id: 2 }); // not ignored bc element recreated await resize({ width: 55, id: 3 }); assertResizeArgs(onResize, ["200x0", "200x0", "55x0"]); }); it("onResize can be changed", async () => { const onResize1 = spy(); mountResizeSensor({ onResize: onResize1 }); await resize({ width: 200, id: 1 }); const onResize2 = spy(); wrapper!.setProps({ onResize: onResize2 }); await resize({ height: 100, id: 2 }); await resize({ width: 55, id: 3 }); assert.equal(onResize1.callCount, 1, "first callback should have been called exactly once"); assert.equal(onResize2.callCount, 2, "second callback should have been called exactly twice"); }); it("still works when user sets their own targetRef", async () => { const onResize = spy(); const targetRef = React.createRef<HTMLElement>(); const RESIZE_WIDTH = 200; mountResizeSensor({ onResize, targetRef }); await resize({ width: RESIZE_WIDTH }); assert.equal(onResize.callCount, 1, "onResize should be called"); assertResizeArgs(onResize, [`${RESIZE_WIDTH}x0`]); assert.isNotNull(targetRef.current, "user-provided targetRef should be set"); assert.strictEqual(targetRef.current?.clientWidth, RESIZE_WIDTH, "user-provided targetRef.current.clientWidth"); }); function mountResizeSensor(props: Omit<ResizeSensorProps, "children">) { return (wrapper = mount<ResizeTesterProps>( <ResizeTester id={0} {...props} />, // must be in the DOM for measurement { attachTo: testsContainerElement }, )); } function resize(size: SizeProps) { wrapper!.setProps(size); wrapper!.update(); return new Promise(resolve => setTimeout(resolve, 30)); } function assertResizeArgs(onResize: sinon.SinonSpy, sizes: string[]) { assert.sameMembers( onResize.args .map(args => (args[0] as ResizeObserverEntry[])[0].contentRect) .map(r => `${r.width}x${r.height}`), sizes, ); } }); interface SizeProps { /** Used as React `key`, so changing it will force a new element to be created. */ id?: number; width?: number; height?: number; } type ResizeTesterProps = Omit<ResizeSensorProps, "children"> & SizeProps; const ResizeTester: React.FC<ResizeTesterProps> = ({ id, width, height, ...sensorProps }) => ( <ResizeSensor {...sensorProps}> <div key={id} style={{ width, height }} ref={sensorProps.targetRef as React.RefObject<HTMLDivElement>} /> </ResizeSensor> ); ```
/content/code_sandbox/packages/core/test/resize-sensor/resizeSensorTests.tsx
xml
2016-10-25T21:17:50
2024-08-16T15:14:48
blueprint
palantir/blueprint
20,593
1,063
```xml export const types = ` extend type User @key(fields: "_id") { _id: String! @external } type Notification { _id: String! notifType: String title: String link: String content: String action: String createdUser: User receiver: String date: Date isRead: Boolean } type NotificationConfiguration { _id: String! user: String notifType: String isAllowed: Boolean } `; const params = ` limit: Int, page: Int, perPage: Int, requireRead: Boolean, notifType: String contentTypes: [String] title: String startDate: String endDate: String `; export const queries = ` notifications(${params}): [Notification] notificationCounts(requireRead: Boolean, notifType: String, contentTypes: [String]): Int notificationsModules : [JSON] notificationsGetConfigurations : [NotificationConfiguration] `; export const mutations = ` notificationsSaveConfig (notifType: String!, isAllowed: Boolean): NotificationConfiguration notificationsMarkAsRead (_ids: [String], contentTypeId: String) : JSON notificationsShow : String `; ```
/content/code_sandbox/packages/plugin-notifications-api/src/graphql/notificationTypeDefs.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
281
```xml <!-- ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <dataset> <metadata> <column name="udt_catalog"/> <column name="udt_schema"/> <column name="udt_name"/> <column name="table_catalog"/> <column name="table_schema"/> <column name="table_name"/> <column name="column_name"/> </metadata> </dataset> ```
/content/code_sandbox/test/e2e/sql/src/test/resources/cases/dql/dataset/empty_storage_units/opengauss/select_opengauss_information_schema_column_udt_usage.xml
xml
2016-01-18T12:49:26
2024-08-16T15:48:11
shardingsphere
apache/shardingsphere
19,707
145
```xml <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="BottomNavigationView"> <!-- If text will be enabled for the tabs, defaulted to true --> <attr name="bnv_with_text" format="boolean" /> <!-- If there will be a shadow on the view, default is true --> <attr name="bnv_shadow" format="boolean" /> <!-- If the view should be set up for a tablet, default is false --> <attr name="bnv_tablet" format="boolean" /> <!-- Disable or enable the background color, default is true --> <attr name="bnv_colored_background" format="boolean" /> <!-- If a supplied ViewPager will have a slide animation, default is true --> <attr name="bnv_viewpager_slide" format="boolean" /> <!-- Text size for the active tab, default size is 14sp --> <attr name="bnv_active_text_size" format="dimension" /> <!-- Text size for an inactive tab, default size is 12sp --> <attr name="bnv_inactive_text_size" format="dimension" /> <!-- The color of an activated tab. Will only be considered if bnv_colored_background is false, no default is set --> <attr name="bnv_active_color" format="color" /> </declare-styleable> </resources> ```
/content/code_sandbox/BottomNavigationViewLibrary/src/main/res/values/attrs.xml
xml
2016-03-19T12:23:24
2024-08-05T09:51:53
LuseenBottomNavigation
armcha/LuseenBottomNavigation
1,015
296
```xml export default interface Constructor { name: string; new (...params: any[]): any; } ```
/content/code_sandbox/e2e/test/cucumber-ts/src/class-constructor.ts
xml
2016-02-12T13:14:28
2024-08-15T18:38:25
stryker-js
stryker-mutator/stryker-js
2,561
21
```xml /* * one or more contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright ownership. */ import {render, screen} from 'modules/testing-library'; import {DEFAULT_MOCK_CLIENT_CONFIG} from 'modules/mocks/window'; import {nodeMockServer} from 'modules/mockServer/nodeMockServer'; import {http, HttpResponse} from 'msw'; import {Header} from '..'; import {getWrapper} from './mocks'; import * as userMocks from 'modules/mock-schema/mocks/current-user'; describe('license note', () => { afterEach(() => { window.clientConfig = DEFAULT_MOCK_CLIENT_CONFIG; }); beforeEach(() => { nodeMockServer.use( http.get( '/v1/internal/users/current', () => { return HttpResponse.json(userMocks.currentUser); }, { once: true, }, ), ); }); it('should show and hide license information', async () => { const {user} = render(<Header />, { wrapper: getWrapper(), }); expect(await screen.findByText('Demo User')).toBeInTheDocument(); expect( screen.getByRole('button', { expanded: false, }), ).toBeInTheDocument(); await user.click( ); expect( screen.getByRole('button', { expanded: true, }), ).toBeInTheDocument(); expect( screen.getByText( ), ).toBeInTheDocument(); }); it('should show license note in CCSM free/trial environment', async () => { window.clientConfig = { isEnterprise: false, organizationId: null, }; render(<Header />, { wrapper: getWrapper(), }); expect( ).toBeInTheDocument(); }); it('should not show license note in SaaS environment', async () => { window.clientConfig = { isEnterprise: false, organizationId: '000000000-0000-0000-0000-000000000000', }; render(<Header />, { wrapper: getWrapper(), }); expect(await screen.findByText('Demo User')).toBeInTheDocument(); expect( ).not.toBeInTheDocument(); }); it('should not show license note in CCSM enterprise environment', async () => { window.clientConfig = { isEnterprise: true, organizationId: null, }; render(<Header />, { wrapper: getWrapper(), }); expect(await screen.findByText('Demo User')).toBeInTheDocument(); expect( ).not.toBeInTheDocument(); }); }); ```
/content/code_sandbox/tasklist/client/src/Layout/Header/tests/licenseNotice.test.tsx
xml
2016-03-20T03:38:04
2024-08-16T19:59:58
camunda
camunda/camunda
3,172
532
```xml import { __ } from '../../utils'; import { NotFoundWrapper } from '../styles'; import Button from '@erxes/ui/src/components/Button'; import Icon from '@erxes/ui/src/components/Icon'; import React from 'react'; function NotFound() { return ( <NotFoundWrapper> <div className="auth-content"> <div className="container"> <div className="col-md-7"> <div className="auth-description not-found"> <img src="/images/not-found.png" alt="erxes" /> <h1>{__('Page not found')}</h1> <p> {__('Sorry but the page you are looking for cannot be found')} </p> <Button href="/welcome"> <Icon icon="arrow-left" /> {__('Back to home')} </Button> </div> </div> </div> </div> </NotFoundWrapper> ); } export default NotFound; ```
/content/code_sandbox/packages/erxes-ui/src/layout/components/NotFound.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
200
```xml /// <reference types="vitest" /> import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; // path_to_url export default defineConfig({ plugins: [react()], server: { host: true, }, base: './', test: { globals: true, environment: 'jsdom' } }); ```
/content/code_sandbox/packages/create-react-admin/templates/ra-data-fakerest/vite.config.ts
xml
2016-07-13T07:58:54
2024-08-16T18:32:27
react-admin
marmelab/react-admin
24,624
81
```xml import type { AssetPathResolver } from "@Core/AssetPathResolver"; import type { Extension } from "@Core/Extension"; import type { SettingsManager } from "@Core/SettingsManager"; import type { Translator } from "@Core/Translator"; import { SearchResultItemActionUtility, type SearchResultItem } from "@common/Core"; import { getExtensionSettingKey } from "@common/Core/Extension"; import type { Image } from "@common/Core/Image"; import type { Net } from "electron"; import type { ApiResponse, PostBody } from "./Api"; import type { InvocationArgument } from "./InvocationArgument"; import type { Settings } from "./Settings"; export class DeeplTranslatorExtension implements Extension { public readonly id = "DeeplTranslator"; public readonly name = "DeepL Translator"; public readonly nameTranslation = { key: "extensionName", namespace: "extension[DeeplTranslator]", }; public readonly author = { name: "Oliver Schwendener", githubUserName: "oliverschwendener", }; private readonly defaultSettings: Settings = { apiKey: "", defaultSourceLanguage: "Auto", defaultTargetLanguage: "EN-US", }; public constructor( private readonly net: Net, private readonly assetPathResolver: AssetPathResolver, private readonly settingsManager: SettingsManager, private readonly translator: Translator, ) {} public async getSearchResultItems(): Promise<SearchResultItem[]> { const { t } = this.translator.createT(this.getI18nResources()); return [ { id: "DeeplTranslator:invoke", description: t("searchResultItemDescription"), name: t("searchResultItemName"), image: this.getImage(), defaultAction: SearchResultItemActionUtility.createInvokeExtensionAction({ extensionId: this.id, description: t("searchResultItemActionDescription"), fluentIcon: "OpenRegular", }), }, ]; } public async invoke(argument: InvocationArgument): Promise<string[]> { const apiResponse = await this.getApiResponse(this.getPostBody(argument)); return apiResponse.translations.map((t) => t.text); } public isSupported(): boolean { return true; } public getSettingDefaultValue<T>(key: string): T { return this.defaultSettings[key] as T; } public getImage(): Image { return { url: `file://${this.getDeeplAssetFilePath()}`, }; } public getSettingKeysTriggeringRescan() { return ["general.language"]; } public getI18nResources() { return { "en-US": { extensionName: "DeepL Translator", openAccount: "Open DeepL Account", searchResultItemDescription: "Translate with DeepL", searchResultItemName: "DeepL Translator", searchResultItemActionDescription: "Open DeepL Translator", }, "de-CH": { extensionName: "DeepL bersetzer", openAccount: "DeepL Account ffnen", searchResultItemDescription: "Mit DeepL bersetzen", searchResultItemName: "DeepL bersetzer", searchResultItemActionDescription: "DeepL bersetzer ffnen", }, }; } private getDeeplAssetFilePath() { return this.assetPathResolver.getExtensionAssetPath(this.id, "deepl-logo.svg"); } private getPostBody({ searchTerm, sourceLanguage, targetLanguage }: InvocationArgument): PostBody { const postBody: PostBody = { text: [searchTerm], target_lang: targetLanguage, }; if (sourceLanguage !== "Auto") { postBody.source_lang = sourceLanguage; } return postBody; } private async getApiResponse(postBody: PostBody): Promise<ApiResponse> { const response = await this.net.fetch("path_to_url", { method: "POST", headers: { Authorization: `DeepL-Auth-Key ${this.getApiKey()}`, "Content-Type": "application/json", }, body: JSON.stringify(postBody), }); if (!response.ok) { throw new Error(`DeepL API error: ${response.statusText}`); } return (await response.json()) as ApiResponse; } private getApiKey(): string { const apiKey = this.settingsManager.getValue<string | undefined>( getExtensionSettingKey(this.id, "apiKey"), undefined, true, ); if (!apiKey) { throw new Error("Missing DeepL API key"); } return apiKey; } } ```
/content/code_sandbox/src/main/Extensions/DeeplTranslator/DeeplTranslatorExtension.ts
xml
2016-10-11T04:59:52
2024-08-16T11:53:31
ueli
oliverschwendener/ueli
3,543
976
```xml <?xml version="1.0" encoding="utf-8"?> <!-- ~ ~ ~ path_to_url ~ ~ Unless required by applicable law or agreed to in writing, software ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <resources> <string name="cat_music_player_album_cover_content_description" description="Content description of album cover [CHAR_LIMIT=NONE]">Album cover</string> <string name="cat_music_player_progress_indicator_content_description" description="Content description of the progress indicator [CHAR_LIMIT=NONE]">Music progress indicator</string> <string name="cat_music_player_pause_button_content_description" description="Content description of the pause button [CHAR_LIMIT=NONE]">Pause button</string> <string name="cat_music_player_play_button_content_description" description="Content description of the play button [CHAR_LIMIT=NONE]">Play button</string> <string name="cat_music_player_rewind_button_content_description" description="Content description of the rewind button [CHAR_LIMIT=NONE]">Rewind button</string> <string name="cat_music_player_fast_forward_button_content_description" description="Content description of the fast forward button [CHAR_LIMIT=NONE]">Fast forward button</string> <string name="cat_music_player_volume_down_button_content_description" description="Content description of the volume down button [CHAR_LIMIT=NONE]">Volume down button</string> <string name="cat_music_player_volume_slider_content_description" description="Content description of the volume slider [CHAR_LIMIT=NONE]">Volume slider</string> <string name="cat_music_player_volume_up_button_content_description" description="Content description of the volume up button [CHAR_LIMIT=NONE]">Volume up button</string> <string name="cat_music_player_album_menu_favorite_title" description="Content description of the favorite button [CHAR_LIMIT=NONE]">Favorite</string> <string name="cat_music_player_album_menu_share_title" description="Content description of the share button [CHAR_LIMIT=NONE]">Share</string> <string name="cat_music_player_lib_menu_sort_title" description="Name of the sort list button [CHAR_LIMIT=NONE]">Sort</string> <string name="cat_music_player_lib_menu_list_type_title" description="Name of the list type toggle button [CHAR_LIMIT=NONE]">Toggle list type</string> <string name="cat_music_player_album_duration" description="Duration of the album [CHAR_LIMIT=NONE]">52 mins</string> </resources> ```
/content/code_sandbox/catalog/java/io/material/catalog/musicplayer/res/values/strings.xml
xml
2016-12-05T16:11:29
2024-08-16T17:51:42
material-components-android
material-components/material-components-android
16,176
539
```xml import { assert } from 'chai'; import { IdentifierNamesGenerator } from '../../../../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator'; import { StringArrayEncoding } from '../../../../../src/enums/node-transformers/string-array-transformers/StringArrayEncoding'; import { StringArrayIndexesType } from '../../../../../src/enums/node-transformers/string-array-transformers/StringArrayIndexesType'; import { StringArrayWrappersType } from '../../../../../src/enums/node-transformers/string-array-transformers/StringArrayWrappersType'; import { NO_ADDITIONAL_NODES_PRESET } from '../../../../../src/options/presets/NoCustomNodes'; import { readFileAsString } from '../../../../helpers/readFileAsString'; import { checkCodeEvaluation } from '../../../../helpers/checkCodeEvaluation'; import { getRegExpMatch } from '../../../../helpers/getRegExpMatch'; import { JavaScriptObfuscator } from '../../../../../src/JavaScriptObfuscatorFacade'; describe('StringArrayScopeCallsWrapperTransformer', function () { this.timeout(120000); describe('Variant #1: base', () => { describe('Variant #1: root scope', () => { describe('Variant #1: option value is lower then count `literal` nodes in the scope', () => { const stringArrayCallRegExp: RegExp = new RegExp( '(?<!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + '(const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};(function .*)?){2}' + '(?!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + 'const foo *= *_0x([a-f0-9]){4,6}\\(0x0\\);.*' + 'const bar *= *_0x([a-f0-9]){4,6}\\(0x1\\);.*' + 'const baz *= *_0x([a-f0-9]){4,6}\\(0x2\\);' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 2 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #2: option value is bigger then count `literal` nodes in the scope', () => { const stringArrayCallRegExp: RegExp = new RegExp( '(?<!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + '(const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};(function .*)?){3}' + '(?!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + 'const foo *= *_0x([a-f0-9]){4,6}\\(0x0\\);.*' + 'const bar *= *_0x([a-f0-9]){4,6}\\(0x1\\);.*' + 'const baz *= *_0x([a-f0-9]){4,6}\\(0x2\\);' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 5 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #3: correct wrappers order', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'const f *= *b;.*' + 'const g *= *b;.*' + 'const foo *= *[f|g]\\(0x0\\);.*' + 'const bar *= *[f|g]\\(0x1\\);.*' + 'const baz *= *[f|g]\\(0x2\\);' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 2 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #4: `identifiersPrefix` option is set', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'const foo_d *= *foo_b;.*' + 'const foo_e *= *foo_b;.*' + 'const foo *= *foo_[d|e]\\(0x0\\);.*' + 'const bar *= *foo_[d|e]\\(0x1\\);.*' + 'const baz *= *foo_[d|e]\\(0x2\\);' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, identifiersPrefix: 'foo_', stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 2 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); }); describe('Variant #2: function scope', () => { describe('Variant #1: option value is lower then count `literal` nodes in the scope', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'function test *\\( *\\) *{' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x3\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x4\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x5\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 2 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #2: option value is bigger then count `literal` nodes in the scope', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'function test *\\(\\) *{' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x3\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x4\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x5\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 5 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #3: correct wrappers order', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'function test *\\( *\\) *{' + 'const h *= *b;' + 'const i *= *b;' + 'const c *= *[h|i]\\(0x3\\);' + 'const d *= *[h|i]\\(0x4\\);' + 'const e *= *[h|i]\\(0x5\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 2 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #4: correct wrapper for the function default parameter', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'const e *= *b;.*' + 'const foo *= *e\\(0x0\\);.*' + 'function test *\\(c *= *e\\(0x1\\)\\) *{' + 'const f *= *b;' + 'const d *= *f\\(0x2\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrapper-for-the-function-default-parameter.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 1 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #5: `identifiersPrefix` option is set', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'function test *\\( *\\) *{' + 'const f *= *foo_b;' + 'const g *= *foo_b;' + 'const a *= *[f|g]\\(0x3\\);' + 'const b *= *[f|g]\\(0x4\\);' + 'const c *= *[f|g]\\(0x5\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, identifiersPrefix: 'foo_', stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 2 } ).getObfuscatedCode(); }); it('should add scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); }); describe('Variant #3: prohibited scopes', () => { describe('Variant #1: if statement scope', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'var c *= *b;.*' + 'if *\\(!!\\[]\\) *{' + 'var foo *= *c\\(0x0\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/prohibited-scope-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 1 } ).getObfuscatedCode(); }); it('should not add scope calls wrappers to a prohibited scope', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #2: arrow function scope without statements', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'var c *= *b;.*' + '\\[]\\[c\\(0x0\\)]\\(\\(\\) *=> *c\\(0x1\\)\\);' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/prohibited-scope-2.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 1 } ).getObfuscatedCode(); }); it('should not add scope calls wrappers to a prohibited scope', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); }); describe('Variant #4: prevailing kind of variables', () => { const stringArrayCallRegExp: RegExp = new RegExp( '(?<!var _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + '(var _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};(function .*)?){2}' + '(?!var _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + 'var foo *= *_0x([a-f0-9]){4,6}\\(0x0\\);.*' + 'var bar *= *_0x([a-f0-9]){4,6}\\(0x1\\);.*' + 'var baz *= *_0x([a-f0-9]){4,6}\\(0x2\\);' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-var.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 2 } ).getObfuscatedCode(); }); it('should add scope calls wrappers with a correct variables kind', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); describe('Variant #5: correct evaluation of the scope calls wrappers', () => { const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let evaluationResult: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-eval.js'); const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersCount: 5 } ).getObfuscatedCode(); evaluationResult = eval(obfuscatedCode); }); it('should correctly evaluate scope calls wrappers', () => { assert.equal(evaluationResult, expectedEvaluationResult); }); }); describe('Variant #6: `stringArrayWrappersChainedCalls` option is enabled', () => { describe('Variant #1: correct chained calls', () => { describe('Variant #1: `Mangled` identifier names generator', () => { const stringArrayCallRegExp: RegExp = new RegExp( 'const q *= *b;.*' + 'const foo *= *q\\(0x0\\);.*' + 'function test\\(c, *d\\) *{' + 'const r *= *q;' + 'const e *= *r\\(0x1\\);' + 'const f *= *r\\(0x2\\);' + 'function g\\(h, *i\\) *{' + 'const s *= *r;' + 'const j *= *s\\(0x3\\);' + 'const k *= *s\\(0x4\\);' + 'function l\\(m, *n *\\) *{' + 'const t *= *s;' + 'const o *= *t\\(0x3\\);' + 'const p *= *t\\(0x4\\);' + 'return o *\\+ *p;' + '}' + 'return j *\\+ *k;' + '}' + 'return e *\\+ *f *\\+ *g\\(\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 1 } ).getObfuscatedCode(); }); it('should add correct scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallRegExp); }); }); }); describe('Variant #2: correct evaluation of the string array wrappers chained calls', () => { describe('Variant #1: base', () => { describe('Variant #1: `Hexadecimal` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-1.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Rc4 ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5 } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); describe('Variant #2: `Mangled` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-1.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Rc4 ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5 } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); }); describe('Variant #2: advanced', () => { describe('Variant #1: `Hexadecimal` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-2.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Rc4 ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5 } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); describe('Variant #2: `Mangled` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-2.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Rc4 ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5 } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); }); }); }); describe('Variant #7: `stringArrayWrappersType` option has `Function` value', () => { const evaluationSamplesCount: number = 500; const hexadecimalIndexMatch: string = '0x[a-z0-9]{1,3}'; describe('Variant #1: base', () => { describe('Variant #1: `hexadecimal-number` indexes type', () => { const getStringArrayCallsWrapperMatch = (stringArrayCallsWrapperName: string) => `function *${stringArrayCallsWrapperName} *\\(c, *d\\) *{` + `return b\\([cd] *-(?: -)?${hexadecimalIndexMatch}, *[cd]\\);` + '}'; const stringArrayScopeCallsWrapperRegExp1: RegExp = new RegExp( getStringArrayCallsWrapperMatch('f') ); const stringArrayScopeCallsWrapperRegExp2: RegExp = new RegExp( 'function test *\\( *\\) *{.*' + `${getStringArrayCallsWrapperMatch('g')}.*?` + '}' ); const stringArrayCallsWrapperCallsRegExp: RegExp = new RegExp( `const foo *= *f\\(-? *${hexadecimalIndexMatch}\\, *-? *${hexadecimalIndexMatch}\\);.*` + `const bar *= *f\\(-? *${hexadecimalIndexMatch}\\, *-? *${hexadecimalIndexMatch}\\);.*` + `const baz *= *f\\(-? *${hexadecimalIndexMatch}\\, *-? *${hexadecimalIndexMatch}\\);.*` + 'function test *\\( *\\) *{.*' + `const c *= *g\\(-? *${hexadecimalIndexMatch}\\, *-? *${hexadecimalIndexMatch}\\);.*` + `const d *= *g\\(-? *${hexadecimalIndexMatch}\\, *-? *${hexadecimalIndexMatch}\\);.*` + `const e *= *g\\(-? *${hexadecimalIndexMatch}\\, *-? *${hexadecimalIndexMatch}\\);.*` + '}' ); let obfuscatedCode: string; let areSuccessEvaluations: boolean; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); const getObfuscatedCode: () => string = () => JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayIndexesType: [ StringArrayIndexesType.HexadecimalNumber ], stringArrayThreshold: 1, stringArrayWrappersChainedCalls: false, stringArrayWrappersCount: 1, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); obfuscatedCode = getObfuscatedCode(); areSuccessEvaluations = checkCodeEvaluation( getObfuscatedCode, evaluationSamplesCount ).areSuccessEvaluations; }); it('Match #1: should add correct scope calls wrapper 1', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp1); }); it('Match #2: should add correct scope calls wrapper 2', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp2); }); it('Match #3: should add correct scope calls wrappers calls', () => { assert.match(obfuscatedCode, stringArrayCallsWrapperCallsRegExp); }); it('should evaluate code without errors', () => { assert.isTrue(areSuccessEvaluations); }); }); describe('Variant #2: `hexadecimal-numeric-string` indexes type', () => { const getStringArrayCallsWrapperMatch = (stringArrayCallsWrapperName: string) => `function *${stringArrayCallsWrapperName} *\\(c, *d\\) *{` + `return b\\([cd] *-(?: -)?'${hexadecimalIndexMatch}', *[cd]\\);` + '}'; const stringArrayScopeCallsWrapperRegExp1: RegExp = new RegExp( getStringArrayCallsWrapperMatch('f') ); const stringArrayScopeCallsWrapperRegExp2: RegExp = new RegExp( 'function test *\\( *\\) *{.*' + `${getStringArrayCallsWrapperMatch('g')}.*?` + '}' ); const stringArrayCallsWrapperCallRegExp: RegExp = new RegExp( `const foo *= *f\\(-? *'${hexadecimalIndexMatch}', *-? *'${hexadecimalIndexMatch}'\\);.*` + `const bar *= *f\\(-? *'${hexadecimalIndexMatch}', *-? *'${hexadecimalIndexMatch}'\\);.*` + `const baz *= *f\\(-? *'${hexadecimalIndexMatch}', *-? *'${hexadecimalIndexMatch}'\\);.*` + 'function test *\\( *\\) *{.*' + `const c *= *g\\(-? *'${hexadecimalIndexMatch}', *-? *'${hexadecimalIndexMatch}'\\);.*` + `const d *= *g\\(-? *'${hexadecimalIndexMatch}', *-? *'${hexadecimalIndexMatch}'\\);.*` + `const e *= *g\\(-? *'${hexadecimalIndexMatch}', *-? *'${hexadecimalIndexMatch}'\\);.*` + '}' ); let obfuscatedCode: string; let areSuccessEvaluations: boolean; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); const getObfuscatedCode = () => JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayIndexesType: [ StringArrayIndexesType.HexadecimalNumericString ], stringArrayThreshold: 1, stringArrayWrappersChainedCalls: false, stringArrayWrappersCount: 1, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); obfuscatedCode = getObfuscatedCode(); areSuccessEvaluations = checkCodeEvaluation( getObfuscatedCode, evaluationSamplesCount ).areSuccessEvaluations; }); it('Match #1: should add correct scope calls wrapper 1', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp1); }); it('Match #2: should add correct scope calls wrapper 2', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp2); }); it('Match #3: should add correct scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallsWrapperCallRegExp); }); it('should evaluate code without errors', () => { assert.isTrue(areSuccessEvaluations); }); }); }); describe('Variant #2: correct chained calls', () => { const stringArrayScopeCallsWrapperRegExp1: RegExp = new RegExp( 'function *f *\\(c, *d\\) *{' + `return b\\([cd] *-(?: -)?${hexadecimalIndexMatch}, *[cd]\\);` + '}.*' ); const stringArrayScopeCallsWrapperRegExp2: RegExp = new RegExp( 'function test *\\( *\\) *{.*' + 'function *g *\\(c, *d\\) *{' + `return f\\(` + // order of arguments depends on the parent wrapper parameters order `[cd](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cd](?: *-(?: -)?${hexadecimalIndexMatch})?` + `\\);` + '}.*' + '}' ); const stringArrayCallsWrapperCallRegExp: RegExp = new RegExp( `const foo *= *f\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + `const bar *= *f\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + `const baz *= *f\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + 'function test *\\( *\\) *{.*' + `const c *= *g\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + `const d *= *g\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + `const e *= *g\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + '}' ); let obfuscatedCode: string; let areSuccessEvaluations: boolean; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); const getObfuscatedCode = () => JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 1, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); obfuscatedCode = getObfuscatedCode(); areSuccessEvaluations = checkCodeEvaluation( getObfuscatedCode, evaluationSamplesCount ).areSuccessEvaluations; }); it('Match #1: should add correct scope calls wrapper 1', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp1); }); it('Match #2: should add correct scope calls wrapper 2', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp2); }); it('Match #3: should add correct scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallsWrapperCallRegExp); }); it('should evaluate code without errors', () => { assert.isTrue(areSuccessEvaluations); }); }); describe('Variant #3: no wrappers on a root scope', () => { const stringArrayScopeCallsWrapperRegExp: RegExp = new RegExp( 'function test *\\( *\\) *{.*' + 'function *f*\\(c, *d\\) *{' + `return b\\([cd] *-(?: -)?${hexadecimalIndexMatch}, *[cd]\\);` + '}.*' + '}' ); const stringArrayCallsWrapperCallRegExp: RegExp = new RegExp( '(?<!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + 'function test *\\( *\\) *{.*' + `const c *= *f\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + `const d *= *f\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + `const e *= *f\\(-? *${hexadecimalIndexMatch}, *-? *${hexadecimalIndexMatch}\\);.*` + '}' ); let obfuscatedCode: string; let areSuccessEvaluations: boolean; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const-no-root-wrappers.js'); const getObfuscatedCode = () => JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 1, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); obfuscatedCode = getObfuscatedCode(); areSuccessEvaluations = checkCodeEvaluation( getObfuscatedCode, evaluationSamplesCount ).areSuccessEvaluations; }); it('Match #1: should add correct scope calls wrapper', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp); }); it('Match #2: should add correct scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallsWrapperCallRegExp); }); it('should evaluate code without errors', () => { assert.isTrue(areSuccessEvaluations); }); }); describe('Variant #4: correct evaluation of the string array wrappers chained calls', () => { describe('Variant #1: base', () => { describe('Variant #1: `Hexadecimal` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-1.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); describe('Variant #2: `Mangled` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-1.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); }); describe('Variant #2: advanced', () => { describe('Variant #1: `Hexadecimal` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-2.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Rc4 ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); describe('Variant #2: `Mangled` identifier names generator', () => { const samplesCount: number = 50; const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let isEvaluationSuccessful: boolean = true; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/chained-calls-2.js'); for (let i = 0; i < samplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Rc4 ], stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); const evaluationResult: string = eval(obfuscatedCode); if (evaluationResult !== expectedEvaluationResult) { isEvaluationSuccessful = false; break; } } }); it('should correctly evaluate string array wrappers chained calls', () => { assert.equal(isEvaluationSuccessful, true); }); }); }); }); describe('Variant #5: variable amount of the arguments', () => { describe('Variant #1: base', () => { const stringArrayWrapperArgumentsRegExpString: string = Array(5) .fill(`-? *${hexadecimalIndexMatch}`) .join(', *'); const stringArrayScopeCallsWrapperRegExp1: RegExp = new RegExp( 'function *f *\\(c, *d, *e, *h, *i\\) *{' + `return b\\([cdehi] *-(?: -)?${hexadecimalIndexMatch}, *[cdehi]\\);` + '}.*' ); const stringArrayScopeCallsWrapperRegExp2: RegExp = new RegExp( 'function test *\\( *\\) *{.*' + 'function *g *\\(c, *d, *e, *h, *i\\) *{' + `return f\\(` + // order of arguments depends on the parent wrapper parameters order `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?` + `\\);` + '}.*' + '}' ); const stringArrayCallsWrapperCallRegExp: RegExp = new RegExp( `const foo *= *f\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const bar *= *f\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const baz *= *f\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + 'function test *\\( *\\) *{.*' + `const c *= *g\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const d *= *g\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const e *= *g\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + '}' ); let obfuscatedCode: string; let areSuccessEvaluations: boolean; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); const getObfuscatedCode = () => JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 1, stringArrayWrappersParametersMaxCount: 5, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); obfuscatedCode = getObfuscatedCode(); areSuccessEvaluations = checkCodeEvaluation( getObfuscatedCode, evaluationSamplesCount ).areSuccessEvaluations; }); it('Match #1: should add correct scope calls wrapper 1', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp1); }); it('Match #2: should add correct scope calls wrapper 2', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp2); }); it('Match #3: should add correct scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallsWrapperCallRegExp); }); it('should evaluate code without errors', () => { assert.isTrue(areSuccessEvaluations); }); }); describe('Variant #2: `stringArrayEncoding` option is `rc4`', () => { const stringArrayWrapperArgumentsRegExpString: string = Array(5) .fill(`(?:-? *${hexadecimalIndexMatch}|(?:'.{4}'))`) .join(', *'); const stringArrayScopeCallsWrapperRegExp1: RegExp = new RegExp( 'function *f *\\(c, *d, *e, *h, *i\\) *{' + `return b\\([cdehi] *-(?: -)?${hexadecimalIndexMatch}, *[cdehi]\\);` + '}.*' ); const stringArrayScopeCallsWrapperRegExp2: RegExp = new RegExp( 'function test *\\( *\\) *{.*' + 'function *g *\\(c, *d, *e, *h, *i\\) *{' + `return f\\(` + // order of arguments depends on the parent wrapper parameters order `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?, *` + `[cdehi](?: *-(?: -)?${hexadecimalIndexMatch})?` + `\\);` + '}.*' + '}' ); const stringArrayCallsWrapperCallRegExp: RegExp = new RegExp( `const foo *= *f\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const bar *= *f\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const baz *= *f\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + 'function test *\\( *\\) *{.*' + `const c *= *g\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const d *= *g\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + `const e *= *g\\(${stringArrayWrapperArgumentsRegExpString}\\);.*` + '}' ); let obfuscatedCode: string; let areSuccessEvaluations: boolean; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); const getObfuscatedCode = () => JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayEncoding: [ StringArrayEncoding.Rc4 ], stringArrayThreshold: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 1, stringArrayWrappersParametersMaxCount: 5, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); obfuscatedCode = getObfuscatedCode(); areSuccessEvaluations = checkCodeEvaluation( getObfuscatedCode, evaluationSamplesCount ).areSuccessEvaluations; }); it('Match #1: should add correct scope calls wrapper 1', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp1); }); it('Match #2: should add correct scope calls wrapper 2', () => { assert.match(obfuscatedCode, stringArrayScopeCallsWrapperRegExp2); }); it('Match #3: should add correct scope calls wrappers', () => { assert.match(obfuscatedCode, stringArrayCallsWrapperCallRegExp); }); it('should evaluate code without errors', () => { assert.isTrue(areSuccessEvaluations); }); }); }); describe('Variant #6: different indexes for calls wrappers', () => { const getStringArrayScopeCallsWrapperMatch = (stringArrayScopeCallsWrapperName: string) => `function *${stringArrayScopeCallsWrapperName} *\\(e, *f\\) *{` + `return b\\([ef] *-(?: -)?(${hexadecimalIndexMatch}), *[ef]\\);` + '}.*'; const stringArrayScopeCallsWrapperIndexRegExp1: RegExp = new RegExp( getStringArrayScopeCallsWrapperMatch('c') ); const stringArrayScopeCallsWrapperIndexRegExp2: RegExp = new RegExp( getStringArrayScopeCallsWrapperMatch('d') ); const differentIndexesMatchesSamplesCount: number = 20; let differentIndexesMatchesCount: number = 0; let differentIndexesMatchesDelta: number = 3; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/function-calls-wrappers-different-indexes.js'); for (let i = 0; i < differentIndexesMatchesSamplesCount; i++) { const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, stringArray: true, stringArrayThreshold: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 2, stringArrayWrappersParametersMaxCount: 2, stringArrayWrappersType: StringArrayWrappersType.Function } ).getObfuscatedCode(); const indexMatch1 = getRegExpMatch(obfuscatedCode, stringArrayScopeCallsWrapperIndexRegExp1); const indexMatch2 = getRegExpMatch(obfuscatedCode, stringArrayScopeCallsWrapperIndexRegExp2); if (indexMatch1 !== indexMatch2) { differentIndexesMatchesCount++; } } }); it('Should generate a different indexes for different string array scope calls wrappers', () => { assert.closeTo( differentIndexesMatchesCount, differentIndexesMatchesSamplesCount, differentIndexesMatchesDelta ); }); }); }); }); describe('Variant #2: none and base64 encoding', () => { describe('Variant #1: root scope', () => { describe('Variant #1: `1` scope calls wrapper for each encoding type', () => { const stringArrayWrappersRegExp: RegExp = new RegExp( '(?<!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + // second one may be added or not depends on: // if all literal values encoded with a single encoding or not '(const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};(function .*)?){1,2}' + '(?!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + 'const foo *= *_0x([a-f0-9]){4,6}\\(0x0\\);.*' + 'const bar *= *_0x([a-f0-9]){4,6}\\(0x1\\);.*' + 'const baz *= *_0x([a-f0-9]){4,6}\\(0x2\\);.*' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Base64 ], stringArrayWrappersCount: 1, stringArrayThreshold: 1 } ).getObfuscatedCode(); }); it('should add scope calls wrappers for both `none` and `base64` string array wrappers', () => { assert.match(obfuscatedCode, stringArrayWrappersRegExp); }); }); describe('Variant #2: `2` scope calls wrappers for each encoding type', () => { const stringArrayWrappersRegExp: RegExp = new RegExp( '(?<!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + // third one may be added or not depends on: // if all literal values encoded with a single encoding or not '(const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};(function .*)?){2,3}' + '(?!const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};.*)' + 'const foo *= *_0x([a-f0-9]){4,6}\\(0x0\\);.*' + 'const bar *= *_0x([a-f0-9]){4,6}\\(0x1\\);.*' + 'const baz *= *_0x([a-f0-9]){4,6}\\(0x2\\);' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Base64 ], stringArrayWrappersCount: 2, stringArrayThreshold: 1 } ).getObfuscatedCode(); }); it('should add scope calls wrappers for both `none` and `base64` string array wrappers', () => { assert.match(obfuscatedCode, stringArrayWrappersRegExp); }); }); }); describe('Variant #2: function scope', () => { describe('Variant #1: `1` scope calls wrapper for each encoding type', () => { const stringArrayWrappersRegExp: RegExp = new RegExp( 'function test *\\( *\\) *{' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + // this one may be added or not depends on: // if all literal values encoded with a single encoding or not '(?:const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};)?' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x3\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x4\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x5\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Base64 ], stringArrayWrappersCount: 1, stringArrayThreshold: 1 } ).getObfuscatedCode(); }); it('should add scope calls wrappers for both `none` and `base64` string array wrappers', () => { assert.match(obfuscatedCode, stringArrayWrappersRegExp); }); }); describe('Variant #2: `2` scope calls wrappers for each encoding type', () => { const stringArrayWrappersRegExp: RegExp = new RegExp( 'function test *\\( *\\) *{' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};' + // this one may be added or not depends on: // if all literal values encoded with a single encoding or not '(?:const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4};)?' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x3\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x4\\);' + 'const _0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6}\\(0x5\\);' + '}' ); let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-const.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Base64 ], stringArrayWrappersCount: 2, stringArrayThreshold: 1 } ).getObfuscatedCode(); }); it('should add scope calls wrappers for both `none` and `base64` string array wrappers', () => { assert.match(obfuscatedCode, stringArrayWrappersRegExp); }); }); }); }); describe('Variant #3: none and rc4 encoding', () => { describe('Variant #1: correct evaluation of the scope calls wrappers', () => { const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let evaluationResult: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-eval.js'); const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.None, StringArrayEncoding.Rc4 ], stringArrayWrappersCount: 5 } ).getObfuscatedCode(); evaluationResult = eval(obfuscatedCode); }); it('should correctly evaluate scope calls wrappers', () => { assert.equal(evaluationResult, expectedEvaluationResult); }); }); }); describe('Variant #4: base64 and rc4 encoding', () => { describe('Variant #1: correct evaluation of the scope calls wrappers', () => { const expectedEvaluationResult: string = 'aaabbbcccdddeee'; let evaluationResult: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/wrappers-count-eval.js'); const obfuscatedCode: string = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, stringArrayEncoding: [ StringArrayEncoding.Base64, StringArrayEncoding.Rc4 ], stringArrayWrappersCount: 5 } ).getObfuscatedCode(); evaluationResult = eval(obfuscatedCode); }); it('should correctly evaluate scope calls wrappers', () => { assert.equal(evaluationResult, expectedEvaluationResult); }); }); }); }); ```
/content/code_sandbox/test/functional-tests/node-transformers/string-array-transformers/string-array-scope-calls-wrapper-transformer/StringArrayScopeCallsWrapperTransformer.spec.ts
xml
2016-05-09T08:16:53
2024-08-16T19:43:07
javascript-obfuscator
javascript-obfuscator/javascript-obfuscator
13,358
13,903
```xml import React, { useCallback } from 'react' import querystring from 'querystring' import { SerializedTeam } from '../../interfaces/db/team' import { useRouter } from '../../lib/router' import CloudLink from './CloudLink' export type TeamLinkIntent = | 'index' | 'archived' | 'invites' | 'uploads' | 'blocks' | 'blocks/new' | 'timeline' | 'delete' | 'shared' | 'requests/deny' | 'dashboard' | 'workflows' | 'automations' export interface TeamIdProps { id: string domain?: string } interface TeamLinkProps { team: TeamIdProps intent?: TeamLinkIntent className?: string children?: React.ReactNode query?: any beforeNavigate?: () => void tabIndex?: number onFocus?: () => void id?: string } const TeamLink = ({ intent = 'index', team, className, children, query, beforeNavigate, onFocus, id, tabIndex = 0, }: TeamLinkProps) => { return ( <CloudLink href={getTeamLinkHref(team, intent, query)} className={className} beforeNavigate={beforeNavigate} onFocus={onFocus} tabIndex={tabIndex} id={id} > {children} </CloudLink> ) } export default TeamLink export function getTeamLinkHref( team: TeamIdProps, intent: TeamLinkIntent, query?: any ) { const basePathname = `/${team.domain != null ? team.domain : team.id}` const queryPathName = query != null ? `?${querystring.stringify(query)}` : '' if (intent === 'index') { return `${basePathname}${queryPathName}` } return `${basePathname}/${intent}${queryPathName}` } export function useNavigateToTeam() { const { push } = useRouter() return useCallback( (team: SerializedTeam, intent: TeamLinkIntent, query?: any) => { const href = getTeamLinkHref(team, intent, query) push(href) }, [push] ) } ```
/content/code_sandbox/src/cloud/components/Link/TeamLink.tsx
xml
2016-11-19T14:30:34
2024-08-16T03:13:45
BoostNote-App
BoostIO/BoostNote-App
3,745
485
```xml import { G2Spec } from '../../../src'; import { LEGEND_ITEMS_CLASS_NAME } from '../../../src/interaction/legendFilter'; import { step } from './utils'; export function mockPieLegendFilter(): G2Spec { return { type: 'facetRect', data: { type: 'inline', value: [ { D2022010400161505000009920363_sum: 22828922, dd2baf8827554249bd380cd0371f85b4: '2024-07-02', '8abf74ed1ebe45408af4676486cb8fb6': 4549244.58, }, { D2022010400161505000009920363_sum: 24710705.71, dd2baf8827554249bd380cd0371f85b4: '2024-07-01', '8abf74ed1ebe45408af4676486cb8fb6': 5174241.6, }, { D2022010400161505000009920363_sum: 27181856.29, dd2baf8827554249bd380cd0371f85b4: '2024-06-30', '8abf74ed1ebe45408af4676486cb8fb6': 5564121.4, }, { D2022010400161505000009920363_sum: 25462071.48, dd2baf8827554249bd380cd0371f85b4: '2024-06-29', '8abf74ed1ebe45408af4676486cb8fb6': 5509570.71, }, { D2022010400161505000009920363_sum: 27109916.98, dd2baf8827554249bd380cd0371f85b4: '2024-06-28', '8abf74ed1ebe45408af4676486cb8fb6': 6320245.72, }, { D2022010400161505000009920363_sum: 27554918.99, dd2baf8827554249bd380cd0371f85b4: '2024-06-27', '8abf74ed1ebe45408af4676486cb8fb6': 6582401.59, }, { D2022010400161505000009920363_sum: 28621357.6, dd2baf8827554249bd380cd0371f85b4: '2024-06-26', '8abf74ed1ebe45408af4676486cb8fb6': 6744951.36, }, ], transform: [ { type: 'rename', D2022010400161505000009920363_sum: '', '8abf74ed1ebe45408af4676486cb8fb6': '', }, { type: 'fold', fields: ['', ''], key: 'folded_key', value: 'folded_value', }, ], }, encode: { x: 'folded_key', }, axis: { x: { title: false, }, }, children: [ { type: 'view', coordinate: { type: 'theta' }, frame: false, children: [ { type: 'interval', encode: { color: 'dd2baf8827554249bd380cd0371f85b4', y: 'folded_value', }, transform: [{ type: 'stackY' }], scale: { y: { facet: false } }, animate: false, }, ], }, ], }; } mockPieLegendFilter.steps = ({ canvas }) => { const { document } = canvas; const elements = document.getElementsByClassName(LEGEND_ITEMS_CLASS_NAME); const [e0] = elements; return [step(e0, 'click')]; }; ```
/content/code_sandbox/__tests__/plots/interaction/mock-pie-legend-filter.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
908
```xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <groupId>com.neo</groupId> <artifactId>spring-boot-thymeleaf-layout</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>spring-boot-thymeleaf-layout</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.0.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>nz.net.ultraq.thymeleaf</groupId> <artifactId>thymeleaf-layout-dialect</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build> </project> ```
/content/code_sandbox/2.x/spring-boot-thymeleaf/spring-boot-thymeleaf-layout/pom.xml
xml
2016-11-05T05:32:33
2024-08-16T13:11:30
spring-boot-examples
ityouknow/spring-boot-examples
30,137
549
```xml /* eslint-env jest */ import { sandbox } from 'development-sandbox' import { FileRef, nextTestSetup } from 'e2e-utils' import { outdent } from 'outdent' import path from 'path' describe('Error overlay for hydration errors', () => { const { next } = nextTestSetup({ files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), skipStart: true, }) it('should show correct hydration error when client and server render different text', async () => { const { cleanup, session, browser } = await sandbox( next, new Map([ [ 'index.js', outdent` const isClient = typeof window !== 'undefined' export default function Mismatch() { return ( <div className="parent"> <main className="child">{isClient ? "client" : "server"}</main> </div> ); } `, ], ]) ) await session.assertHasRedbox() expect(await session.getRedboxDescription()).toMatchInlineSnapshot(` "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used See more info here: path_to_url" `) expect(await session.getRedboxDescriptionWarning()).toMatchInlineSnapshot(` "- A server/client branch \`if (typeof window !== 'undefined')\`. - Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called. - Date formatting in a user's locale which doesn't match the server. - External changing data without sending a snapshot of it along with the HTML. - Invalid HTML tag nesting. It can also happen if the client has a browser extension installed which messes with the HTML before React loaded." `) await session.patch( 'index.js', outdent` export default function Mismatch() { return ( <div className="parent"> <main className="child">Value</main> </div> ); } ` ) await session.assertNoRedbox() expect(await browser.elementByCss('.child').text()).toBe('Value') await cleanup() }) }) ```
/content/code_sandbox/test/development/acceptance/hydration-error.test.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
491
```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 /** * Computes the cosecant of a degree. * * @param x - input value (in degrees) * @returns cosecant * * @example * var v = cscd( 30 ); * // returns ~2.0 * * @example * var v = cscd( 45 ); * // returns ~1.41 * * @example * var v = cscd( 60 ); * // returns ~1.15 * * @example * var v = cscd( 90 ); * // returns 1.0 * * @example * var v = cscd( 0 ); * // returns Infinity * * @example * var v = cscd( NaN ); * // returns NaN */ declare function cscd( x: number ): number; // EXPORTS // export = cscd; ```
/content/code_sandbox/lib/node_modules/@stdlib/math/base/special/cscd/docs/types/index.d.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
247
```xml export * from "./Contract"; export * from "./ExtensionRegistryModule"; ```
/content/code_sandbox/src/main/Core/ExtensionRegistry/index.ts
xml
2016-10-11T04:59:52
2024-08-16T11:53:31
ueli
oliverschwendener/ueli
3,543
15
```xml import * as React from 'react'; import { createSvgIcon } from '@fluentui/react-icons-mdl2'; const FabricOpenFolderHorizontalIcon = createSvgIcon({ svg: ({ classes }) => ( <svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg}> <path d="M2005 896q0 32-15 60l-340 639q-17 32-47 50t-67 19H128q-26 0-49-10t-41-27-28-41-10-50V256q0-27 10-50t27-40 41-28 50-10h608q37 0 69 13t58 36 49 51 39 59q13 23 25 41t28 30 35 19 49 7h576q27 0 50 10t40 27 28 41 10 50v256h28q14 0 29-1 42 0 77 10t61 53q18 30 18 66zM128 256v1073l245-490q17-33 47-52t68-19h1176V512h-576q-62 0-104-19t-73-47-51-62-39-61-38-48-47-19H128zm1408 1280l341-640H488l-320 640h1368z" /> </svg> ), displayName: 'FabricOpenFolderHorizontalIcon', }); export default FabricOpenFolderHorizontalIcon; ```
/content/code_sandbox/packages/react-icons-mdl2-branded/src/components/FabricOpenFolderHorizontalIcon.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
361
```xml <android.support.design.widget.CoordinatorLayout xmlns:android="path_to_url" xmlns:app="path_to_url" xmlns:tools="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context=".MainActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.AppBarLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <com.github.jdsjlzx.recyclerview.LuRecyclerView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:descendantFocusability="blocksDescendants" /> </LinearLayout> </android.support.design.widget.CoordinatorLayout> ```
/content/code_sandbox/app/src/main/res/layout/activity_multi_click_loading.xml
xml
2016-05-19T10:12:08
2024-08-02T07:42:36
LRecyclerView
jdsjlzx/LRecyclerView
2,470
306
```xml /************************************************************* * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ /** * @fileoverview Implements the CommonMunderover wrapper mixin for the MmlMunderover object * and the special cases CommonMunder and CommonMsup * * @author dpvc@mathjax.org (Davide Cervone) */ import {AnyWrapper, Constructor} from '../Wrapper.js'; import {CommonScriptbase, ScriptbaseConstructor} from './scriptbase.js'; import {MmlMunderover, MmlMunder, MmlMover} from '../../../core/MmlTree/MmlNodes/munderover.js'; import {BBox} from '../../../util/BBox.js'; /*****************************************************************/ /** * The CommonMunder interface * * @template W The child-node Wrapper class */ export interface CommonMunder<W extends AnyWrapper> extends CommonScriptbase<W> { } /** * Shorthand for the CommonMunder constructor * * @template W The child-node Wrapper class */ export type MunderConstructor<W extends AnyWrapper> = Constructor<CommonMunder<W>>; /*****************************************************************/ /** * The CommonMunder wrapper mixin for the MmlMunder object * * @template W The child-node Wrapper class * @template T The Wrapper class constructor type */ export function CommonMunderMixin< W extends AnyWrapper, T extends ScriptbaseConstructor<W> >(Base: T): MunderConstructor<W> & T { return class extends Base { /** * @override */ public get scriptChild() { return this.childNodes[(this.node as MmlMunder).under]; } /** * @override * @constructor */ constructor(...args: any[]) { super(...args); this.stretchChildren(); } /** * @override */ public computeBBox(bbox: BBox, recompute: boolean = false) { if (this.hasMovableLimits()) { super.computeBBox(bbox, recompute); return; } bbox.empty(); const basebox = this.baseChild.getOuterBBox(); const underbox = this.scriptChild.getOuterBBox(); const v = this.getUnderKV(basebox, underbox)[1]; const delta = (this.isLineBelow ? 0 : this.getDelta(true)); const [bw, uw] = this.getDeltaW([basebox, underbox], [0, -delta]); bbox.combine(basebox, bw, 0); bbox.combine(underbox, uw, v); bbox.d += this.font.params.big_op_spacing5; bbox.clean(); this.setChildPWidths(recompute); } }; } /*****************************************************************/ /** * The CommonMover interface * * @template W The child-node Wrapper class */ export interface CommonMover<W extends AnyWrapper> extends CommonScriptbase<W> { } /** * Shorthand for the CommonMover constructor * * @template W The child-node Wrapper class */ export type MoverConstructor<W extends AnyWrapper> = Constructor<CommonMover<W>>; /*****************************************************************/ /** * The CommonMover wrapper mixin for the MmlMover object * * @template W The child-node Wrapper class * @template T The Wrapper class constructor type */ export function CommonMoverMixin< W extends AnyWrapper, T extends ScriptbaseConstructor<W> >(Base: T): MoverConstructor<W> & T { return class extends Base { /** * @override */ public get scriptChild() { return this.childNodes[(this.node as MmlMover).over]; } /** * @override * @constructor */ constructor(...args: any[]) { super(...args); this.stretchChildren(); } /** * @override */ public computeBBox(bbox: BBox) { if (this.hasMovableLimits()) { super.computeBBox(bbox); return; } bbox.empty(); const basebox = this.baseChild.getOuterBBox(); const overbox = this.scriptChild.getOuterBBox(); if (this.node.attributes.get('accent')) { basebox.h = Math.max(basebox.h, this.font.params.x_height * basebox.scale); } const u = this.getOverKU(basebox, overbox)[1]; const delta = (this.isLineAbove ? 0 : this.getDelta()); const [bw, ow] = this.getDeltaW([basebox, overbox], [0, delta]); bbox.combine(basebox, bw, 0); bbox.combine(overbox, ow, u); bbox.h += this.font.params.big_op_spacing5; bbox.clean(); } }; } /*****************************************************************/ /** * The CommonMunderover interface * * @template W The child-node Wrapper class */ export interface CommonMunderover<W extends AnyWrapper> extends CommonScriptbase<W> { /* * The wrapped under node */ readonly underChild: W; /* * The wrapped overder node */ readonly overChild: W; } /** * Shorthand for the CommonMunderover constructor * * @template W The child-node Wrapper class */ export type MunderoverConstructor<W extends AnyWrapper> = Constructor<CommonMunderover<W>>; /*****************************************************************/ /* * The CommonMunderover wrapper for the MmlMunderover object * * @template W The child-node Wrapper class * @template T The Wrapper class constructor type */ export function CommonMunderoverMixin< W extends AnyWrapper, T extends ScriptbaseConstructor<W> >(Base: T): MunderoverConstructor<W> & T { return class extends Base { /* * @return {W} The wrapped under node */ public get underChild() { return this.childNodes[(this.node as MmlMunderover).under]; } /* * @return {W} The wrapped overder node */ public get overChild() { return this.childNodes[(this.node as MmlMunderover).over]; } /* * Needed for movablelimits * * @override */ public get subChild() { return this.underChild; } /* * Needed for movablelimits * * @override */ public get supChild() { return this.overChild; } /** * @override * @constructor */ constructor(...args: any[]) { super(...args); this.stretchChildren(); } /** * @override */ public computeBBox(bbox: BBox) { if (this.hasMovableLimits()) { super.computeBBox(bbox); return; } bbox.empty(); const overbox = this.overChild.getOuterBBox(); const basebox = this.baseChild.getOuterBBox(); const underbox = this.underChild.getOuterBBox(); if (this.node.attributes.get('accent')) { basebox.h = Math.max(basebox.h, this.font.params.x_height * basebox.scale); } const u = this.getOverKU(basebox, overbox)[1]; const v = this.getUnderKV(basebox, underbox)[1]; const delta = this.getDelta(); const [bw, uw, ow] = this.getDeltaW([basebox, underbox, overbox], [0, this.isLineBelow ? 0 : -delta, this.isLineAbove ? 0 : delta]); bbox.combine(basebox, bw, 0); bbox.combine(overbox, ow, u); bbox.combine(underbox, uw, v); const z = this.font.params.big_op_spacing5; bbox.h += z; bbox.d += z; bbox.clean(); } }; } ```
/content/code_sandbox/ts/output/common/Wrappers/munderover.ts
xml
2016-02-23T09:52:03
2024-08-16T04:46:50
MathJax-src
mathjax/MathJax-src
2,017
1,716
```xml import { Move } from 'lucide-react'; import { EnvironmentId } from '@/react/portainer/environments/types'; import { Icon } from '@@/Icon'; import { TextTip } from '@@/Tip/TextTip'; import { Tooltip } from '@@/Tip/Tooltip'; import { Application } from '../../types'; import { useApplicationHorizontalPodAutoscaler } from '../../application.queries'; type Props = { environmentId: EnvironmentId; namespace: string; appName: string; app?: Application; }; export function ApplicationAutoScalingTable({ environmentId, namespace, appName, app, }: Props) { const { data: appAutoScalar } = useApplicationHorizontalPodAutoscaler( environmentId, namespace, appName, app ); return ( <> <div className="text-muted mb-4 flex items-center"> <Icon icon={Move} className="!mr-2" /> Auto-scaling </div> {!appAutoScalar && ( <TextTip color="blue"> This application does not have an autoscaling policy defined. </TextTip> )} {appAutoScalar && ( <div className="mt-4 w-3/5"> <table className="table"> <tbody> <tr className="text-muted"> <td className="w-1/3">Minimum instances</td> <td className="w-1/3">Maximum instances</td> <td className="w-1/3"> <div className="flex min-w-max items-center gap-1"> Target CPU usage <Tooltip message="The autoscaler will ensure enough instances are running to maintain an average CPU usage across all instances." /> </div> </td> </tr> <tr> <td data-cy="k8sAppDetail-minReplicas"> {appAutoScalar.spec?.minReplicas} </td> <td data-cy="k8sAppDetail-maxReplicas"> {appAutoScalar.spec?.maxReplicas} </td> <td data-cy="k8sAppDetail-targetCPU"> {appAutoScalar.spec?.targetCPUUtilizationPercentage}% </td> </tr> </tbody> </table> </div> )} </> ); } ```
/content/code_sandbox/app/react/kubernetes/applications/DetailsView/ApplicationDetailsWidget/ApplicationAutoScalingTable.tsx
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
509
```xml // Set theme on page load // This is done outside the Angular app to avoid a flash of unthemed content before it loads const setTheme = () => { const getLegacyTheme = (): string | null => { // MANUAL-STATE-ACCESS: Calling global to get setting before migration // has had a chance to run, can be remove in the future. // Tracking Issue: path_to_url const globalState = window.localStorage.getItem("global"); const parsedGlobalState = JSON.parse(globalState) as { theme?: string } | null; return parsedGlobalState ? parsedGlobalState.theme : null; }; const defaultTheme = "light"; const htmlEl = document.documentElement; let theme = defaultTheme; // First try the new state providers location, then the legacy location const themeFromState = window.localStorage.getItem("global_theming_selection") ?? getLegacyTheme(); if (themeFromState) { if (themeFromState.indexOf("system") > -1) { theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } else if (themeFromState.indexOf("dark") > -1) { theme = "dark"; } } if (!htmlEl.classList.contains("theme_" + theme)) { // The defaultTheme is also set in the html itself to make sure that some theming is always applied htmlEl.classList.remove("theme_" + defaultTheme); htmlEl.classList.add("theme_" + theme); } }; setTheme(); ```
/content/code_sandbox/apps/web/src/theme.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
334
```xml <?xml version="1.0" encoding="UTF-8"?> <definitions id="definitions" xmlns="path_to_url" xmlns:activiti="path_to_url" targetNamespace="Examples"> <process id="compensateProcess"> <startEvent id="start" /> <sequenceFlow sourceRef="start" targetRef="scope" /> <subProcess id="scope"> <multiInstanceLoopCharacteristics isSequential="true"> <loopCardinality>5</loopCardinality> </multiInstanceLoopCharacteristics> <startEvent id="startInScope" /> <sequenceFlow sourceRef="startInScope" targetRef="bookHotel" /> <serviceTask id="bookHotel" activiti:expression="${true}"> </serviceTask> <boundaryEvent id="compensateBookHotelEvt" name="Boundary event" attachedToRef="bookHotel"> <compensateEventDefinition /> </boundaryEvent> <serviceTask id="undoBookHotel" isForCompensation="true" activiti:class="org.activiti.engine.test.bpmn.event.compensate.helper.UndoService"> <extensionElements> <activiti:field name="counterName" stringValue="undoBookHotel" /> </extensionElements> </serviceTask> <sequenceFlow sourceRef="bookHotel" targetRef="endInScope" /> <endEvent id="endInScope" /> <association associationDirection="One" sourceRef="compensateBookHotelEvt" targetRef="undoBookHotel" /> </subProcess> <sequenceFlow sourceRef="scope" targetRef="throwCompensate" /> <intermediateThrowEvent id="throwCompensate"> <compensateEventDefinition activityRef="scope" /> </intermediateThrowEvent> <sequenceFlow sourceRef="throwCompensate" targetRef="beforeEnd" /> <sequenceFlow sourceRef="beforeEnd" targetRef="end" /> <receiveTask id="beforeEnd" /> <endEvent id="end" /> </process> </definitions> ```
/content/code_sandbox/modules/flowable5-test/src/test/resources/org/activiti/engine/test/bpmn/event/compensate/CompensateEventTest.testCompensateMiSubprocess.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
498
```xml import { createSelector } from '@reduxjs/toolkit'; import { LockMode } from '@proton/pass/lib/auth/lock/types'; import { EXCLUDED_SETTINGS_KEYS } from '@proton/pass/store/reducers/settings'; import type { State } from '@proton/pass/store/types'; import type { Maybe } from '@proton/pass/types'; import type { DomainCriterias } from '@proton/pass/types/worker/settings'; import { pipe } from '@proton/pass/utils/fp/pipe'; import { omit } from '@proton/shared/lib/helpers/object'; import { selectState } from './utils'; export const selectProxiedSettings = createSelector(selectState, ({ settings }: State) => omit(settings, EXCLUDED_SETTINGS_KEYS) ); export const selectCanLoadDomainImages = ({ settings }: State) => settings.loadDomainImages; export const selectLockTTL = ({ settings }: State): Maybe<number> => settings.lockTTL; export const selectDisallowedDomains = ({ settings }: State): DomainCriterias => settings.disallowedDomains; export const selectLocale = ({ settings }: State) => settings.locale; export const selectPasswordOptions = (state: State) => state.settings.passwordOptions; export const selectAutosuggestCopyToClipboard = ({ settings }: State) => settings.autosuggest.passwordCopy; export const selectCreatedItemsCount = ({ settings }: State) => settings.createdItemsCount; export const selectOfflineEnabled = ({ settings }: State) => settings.offlineEnabled ?? false; export const selectExtraPasswordEnabled = ({ settings }: State) => settings.extraPassword ?? false; export const selectBetaEnabled = ({ settings }: State) => settings.beta ?? false; export const selectLockMode = ({ settings }: State) => settings.lockMode ?? LockMode.NONE; export const selectLockEnabled = pipe(selectLockMode, (mode) => mode !== LockMode.NONE); ```
/content/code_sandbox/packages/pass/store/selectors/settings.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
383
```xml import { Element } from "xml-js"; import { createTextElementContents, patchSpaceAttribute } from "./util"; import { IRenderedParagraphNode } from "./run-renderer"; const ReplaceMode = { START: 0, MIDDLE: 1, END: 2, } as const; export const replaceTokenInParagraphElement = ({ paragraphElement, renderedParagraph, originalText, replacementText, }: { readonly paragraphElement: Element; readonly renderedParagraph: IRenderedParagraphNode; readonly originalText: string; readonly replacementText: string; }): Element => { const startIndex = renderedParagraph.text.indexOf(originalText); const endIndex = startIndex + originalText.length - 1; let replaceMode: (typeof ReplaceMode)[keyof typeof ReplaceMode] = ReplaceMode.START; for (const run of renderedParagraph.runs) { for (const { text, index, start, end } of run.parts) { switch (replaceMode) { case ReplaceMode.START: if (startIndex >= start) { const offsetStartIndex = startIndex - start; const offsetEndIndex = Math.min(endIndex, end) - start; const partToReplace = run.text.substring(offsetStartIndex, offsetEndIndex + 1); // We use a token to split the text if the replacement is within the same run // If not, we just add text to the middle of the run later if (partToReplace === "") { continue; } const firstPart = text.replace(partToReplace, replacementText); patchTextElement(paragraphElement.elements![run.index].elements![index], firstPart); replaceMode = ReplaceMode.MIDDLE; continue; /* c8 ignore next 2 */ } break; case ReplaceMode.MIDDLE: if (endIndex <= end) { const lastPart = text.substring(endIndex - start + 1); patchTextElement(paragraphElement.elements![run.index].elements![index], lastPart); const currentElement = paragraphElement.elements![run.index].elements![index]; // We need to add xml:space="preserve" to the last element to preserve the whitespace // Otherwise, the text will be merged with the next element // eslint-disable-next-line functional/immutable-data paragraphElement.elements![run.index].elements![index] = patchSpaceAttribute(currentElement); replaceMode = ReplaceMode.END; } else { patchTextElement(paragraphElement.elements![run.index].elements![index], ""); } break; /* c8 ignore next */ default: } } } return paragraphElement; }; const patchTextElement = (element: Element, text: string): Element => { // eslint-disable-next-line functional/immutable-data element.elements = createTextElementContents(text); return element; }; ```
/content/code_sandbox/src/patcher/paragraph-token-replacer.ts
xml
2016-03-26T23:43:56
2024-08-16T13:02:47
docx
dolanmiu/docx
4,139
611
```xml <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>SamplesCount</class> <widget class="QWidget" name="SamplesCount"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>400</width> <height>300</height> </rect> </property> <property name="windowTitle"> <string>Form</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QLabel" name="label"> <property name="text"> <string>Count the number of data points in the given time interval:</string> </property> <property name="wordWrap"> <bool>true</bool> </property> </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <widget class="QLabel" name="label_2"> <property name="text"> <string>Milliseconds:</string> </property> </widget> </item> <item> <widget class="QSpinBox" name="spinBoxMilliseconds"> <property name="minimumSize"> <size> <width>100</width> <height>0</height> </size> </property> <property name="minimum"> <number>1</number> </property> <property name="maximum"> <number>999999</number> </property> <property name="value"> <number>1000</number> </property> </widget> </item> <item> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </item> </layout> </widget> <resources/> <connections/> </ui> ```
/content/code_sandbox/plotjuggler_app/transforms/samples_count.ui
xml
2016-03-01T21:05:42
2024-08-16T08:37:27
PlotJuggler
facontidavide/PlotJuggler
4,294
569
```xml import React, {useContext} from 'react'; import ls from './Wizard.less'; import CadError from '../../../../utils/errors'; import {FormEditContext, FormParamsContext, FormPathContext, FormStateContext} from './form/Form'; import {GenericWizard} from "ui/components/GenericWizard"; import {useStream} from "ui/effects"; import {ReactApplicationContext} from "cad/dom/ReactApplicationContext"; import {resolveAppearance} from "cad/craft/operationHelper"; import ImgIcon from "ui/components/ImgIcon"; interface WizardProps { noFocus: boolean; left?: number; onCancel(): void; onOK(): void; } export default function Wizard(props: WizardProps) { const ctx = useContext(ReactApplicationContext); const state = useStream(ctx => ctx.wizardService.state$); const workingRequest = useStream(ctx => ctx.wizardService.workingRequest$); const formEdit = { onChange: (fullPath, value) => ctx.wizardService.updateParam(fullPath, value), setActive: (fullPathFlatten, isActive) => ctx.wizardService.updateState(state => { state.activeParam = isActive ? fullPathFlatten : null; }) }; if (!workingRequest) { return; } const operation = ctx.operationService.get(workingRequest.type); if (!operation) { return; } const error = state.error; const focusFirstInput = el => { if (props.noFocus) { return; } let toFocus = el.querySelector('input, select'); if (!toFocus) { toFocus = el; } toFocus.focus(); }; const cancel = () => { props.onCancel(); }; const onOK = () => { props.onOK(); }; const {left} = props; const appearance = resolveAppearance(operation, workingRequest.params); const title = appearance.label.toUpperCase(); const icon = <ImgIcon url={appearance.icon32} size={16}/>; const Form = operation.form; return <GenericWizard left={left} title={title} icon={icon} onClose={cancel} setFocus={focusFirstInput} className='Wizard' data-operation-id={operation.id} documentationLink={operation.documentationLink} onCancel={cancel} onOK={onOK} infoText={<> {error && <ErrorPrinter error={error}/>} <PipelineError /> </>} > <FormParamsContext.Provider value={workingRequest.params}> <FormPathContext.Provider value={[]}> <FormStateContext.Provider value={state}> <FormEditContext.Provider value={formEdit}> <Form/> </FormEditContext.Provider> </FormStateContext.Provider> </FormPathContext.Provider> </FormParamsContext.Provider> </GenericWizard>; } function PipelineError() { const pipelineFailure = useStream(ctx => ctx.craftService.pipelineFailure$); if (!pipelineFailure) { return null; } return <ErrorPrinter error={pipelineFailure}/> } function ErrorPrinter({error}) { return <div className={ls.errorMessage}> {CadError.ALGORITHM_ERROR_KINDS.includes(error.kind) && <span> performing operation with current parameters leads to an invalid object (self-intersecting / zero-thickness / complete degeneration or unsupported cases) </span>} {error.code && <div className={ls.errorCode}>{error.code}</div>} {error.userMessage && <div className={ls.userErrorMessage}>{error.userMessage}</div>} {!error.userMessage && <div>internal error processing operation, check the log</div>} </div> } ```
/content/code_sandbox/web/app/cad/craft/wizard/components/Wizard.tsx
xml
2016-08-26T21:55:19
2024-08-15T01:02:53
jsketcher
xibyte/jsketcher
1,461
788
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <VCProjectVersion>16.0</VCProjectVersion> <Keyword>Win32Proj</Keyword> <ProjectGuid>{79fe382a-c29c-4c32-a028-b8d1abdf51b0}</ProjectGuid> <RootNamespace>SampleClient</RootNamespace> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> <PreferredToolArchitecture>x64</PreferredToolArchitecture> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v143</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <PreferredToolArchitecture>x64</PreferredToolArchitecture> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v143</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> <PreferredToolArchitecture>x64</PreferredToolArchitecture> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v143</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>MultiByte</CharacterSet> <PreferredToolArchitecture>x64</PreferredToolArchitecture> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="Shared"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\vcpkg.props" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\vcpkg.props" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\vcpkg.props" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\vcpkg.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <IntDir>..\..\build\obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir> <OutDir>..\..\build\$(Configuration)\</OutDir> <TargetName>$(ProjectName)-x86</TargetName> <LinkIncremental>true</LinkIncremental> <EnableClangTidyCodeAnalysis>false</EnableClangTidyCodeAnalysis> <ClangTidyChecks>--checks=clang-analyzer-*,google-*</ClangTidyChecks> <RunCodeAnalysis>false</RunCodeAnalysis> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <IntDir>..\..\build\obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir> <OutDir>..\..\build\$(Configuration)\</OutDir> <TargetName>$(ProjectName)-x86</TargetName> <LinkIncremental>false</LinkIncremental> <EnableClangTidyCodeAnalysis>false</EnableClangTidyCodeAnalysis> <ClangTidyChecks>--checks=clang-analyzer-*,google-*</ClangTidyChecks> <RunCodeAnalysis>false</RunCodeAnalysis> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <IntDir>..\..\build\obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir> <OutDir>..\..\build\$(Configuration)\</OutDir> <LinkIncremental>true</LinkIncremental> <EnableClangTidyCodeAnalysis>false</EnableClangTidyCodeAnalysis> <ClangTidyChecks>--checks=clang-analyzer-*,google-*</ClangTidyChecks> <RunCodeAnalysis>false</RunCodeAnalysis> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <IntDir>..\..\build\obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir> <OutDir>..\..\build\$(Configuration)\</OutDir> <LinkIncremental>false</LinkIncremental> <EnableClangTidyCodeAnalysis>false</EnableClangTidyCodeAnalysis> <ClangTidyChecks>--checks=clang-analyzer-*,google-*</ClangTidyChecks> <RunCodeAnalysis>false</RunCodeAnalysis> </PropertyGroup> <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> </PropertyGroup> <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> </PropertyGroup> <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> </PropertyGroup> <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <DebugInformationFormat>EditAndContinue</DebugInformationFormat> <LanguageStandard>stdcpplatest</LanguageStandard> <AdditionalIncludeDirectories>..\PresentMonAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>..\..\build\$(Configuration)</AdditionalLibraryDirectories> <AdditionalDependencies>PresentMonAPI.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <LanguageStandard>stdcpplatest</LanguageStandard> <AdditionalIncludeDirectories>..\PresentMonAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>..\..\build\$(Configuration)</AdditionalLibraryDirectories> <AdditionalDependencies>PresentMonAPI.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <DebugInformationFormat>EditAndContinue</DebugInformationFormat> <LanguageStandard>stdcpplatest</LanguageStandard> <AdditionalIncludeDirectories>..\PresentMonAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <ExceptionHandling>Async</ExceptionHandling> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>..\..\build\$(Configuration)</AdditionalLibraryDirectories> <AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <LanguageStandard>stdcpplatest</LanguageStandard> <AdditionalIncludeDirectories>..\PresentMonAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>NDEBUG;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>Async</ExceptionHandling> </ClCompile> <Link> <SubSystem>Console</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>..\..\build\$(Configuration)</AdditionalLibraryDirectories> <AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="Console.cpp" /> <ClCompile Include="DiagnosticDemo.cpp" /> <ClCompile Include="LogSetup.cpp" /> <ClCompile Include="LogDemo.cpp" /> <ClCompile Include="SampleClient.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="CheckMetricSample.h" /> <ClInclude Include="CliOptions.h" /> <ClInclude Include="Console.h" /> <ClInclude Include="DiagnosticDemo.h" /> <ClInclude Include="DynamicQuerySample.h" /> <ClInclude Include="FrameQuerySample.h" /> <ClInclude Include="IntrospectionSample.h" /> <ClInclude Include="LogSetup.h" /> <ClInclude Include="LogDemo.h" /> <ClInclude Include="MetricListSample.h" /> <ClInclude Include="Utils.h" /> <ClInclude Include="Verbose.h" /> <ClInclude Include="WrapperStaticQuery.h" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\CommonUtilities\CommonUtilities.vcxproj"> <Project>{08a704d8-ca1c-45e9-8ede-542a1a43b53e}</Project> </ProjectReference> <ProjectReference Include="..\PresentMonAPI2\PresentMonAPI2.vcxproj"> <Project>{5ddba061-53a0-4835-8aaf-943f403f924f}</Project> </ProjectReference> <ProjectReference Include="..\PresentMonAPIWrapper\PresentMonAPIWrapper.vcxproj"> <Project>{cee032ed-b0d3-47f8-bdae-d46757b0061b}</Project> </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project> ```
/content/code_sandbox/IntelPresentMon/SampleClient/SampleClient.vcxproj
xml
2016-03-09T18:44:16
2024-08-15T19:51:10
PresentMon
GameTechDev/PresentMon
1,580
3,008
```xml import * as ts from 'typescript'; import { findNodes } from './angular/ast-utils'; export function findEnvironmentExpression(source: ts.SourceFile) { const expressions = findNodes(source, ts.isObjectLiteralExpression); return expressions.find(expr => expr.getText().includes('production')); } export function getAssignedPropertyFromObjectliteral( expression: ts.ObjectLiteralExpression, variableSelector: string[], ) { const expressions = findNodes(expression, isBooleanStringOrNumberLiteral); const literal = expressions.find(node => Boolean( variableSelector.reduceRight( (acc: ts.PropertyAssignment, key) => acc?.name?.getText() === key ? acc.parent.parent : undefined, node.parent, ), ), ); return literal ? literal.getText() : undefined; } export function isBooleanStringOrNumberLiteral( node: ts.Node, ): node is ts.StringLiteral | ts.NumericLiteral | ts.BooleanLiteral { return ( ts.isStringLiteral(node) || ts.isNumericLiteral(node) || node.kind === ts.SyntaxKind.TrueKeyword || node.kind === ts.SyntaxKind.FalseKeyword ); } ```
/content/code_sandbox/npm/ng-packs/packages/schematics/src/utils/ast.ts
xml
2016-12-03T22:56:24
2024-08-16T16:24:05
abp
abpframework/abp
12,657
239
```xml <?xml version="1.0" encoding="UTF-8" ?> <class name="VoxelStreamRegionFiles" inherits="VoxelStream" xmlns:xsi="path_to_url" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> Loads and saves blocks to region files indexed by world position, under a directory. </brief_description> <description> Loads and saves blocks to the filesystem, in multiple region files indexed by world position, under a directory. Regions pack many blocks together, so it reduces file switching and improves performance. Inspired by [url=path_to_url of Andromeda[/url] and Minecraft. Region files are not thread-safe. Because of this, internal mutexing may often constrain the use by one thread only. </description> <tutorials> </tutorials> <methods> <method name="convert_files"> <return type="void" /> <param index="0" name="new_settings" type="Dictionary" /> <description> </description> </method> <method name="get_region_size" qualifiers="const"> <return type="Vector3" /> <description> </description> </method> </methods> <members> <member name="block_size_po2" type="int" setter="set_block_size_po2" getter="get_block_size_po2" default="4"> </member> <member name="directory" type="String" setter="set_directory" getter="get_directory" default="&quot;&quot;"> Directory under which the data is saved. </member> <member name="lod_count" type="int" setter="set_lod_count" getter="get_lod_count" default="1"> </member> <member name="region_size_po2" type="int" setter="set_region_size_po2" getter="get_region_size_po2" default="4"> </member> <member name="sector_size" type="int" setter="set_sector_size" getter="get_sector_size" default="512"> </member> </members> </class> ```
/content/code_sandbox/doc/classes/VoxelStreamRegionFiles.xml
xml
2016-05-01T21:44:28
2024-08-16T18:52:42
godot_voxel
Zylann/godot_voxel
2,550
479
```xml /** * Created by AAravindan on 5/5/16. */ import { Indicator, IndicatorInput } from '../indicator/indicator'; export declare class RSIInput extends IndicatorInput { period: number; values: number[]; } export declare class RSI extends Indicator { generator: IterableIterator<number | undefined>; constructor(input: RSIInput); static calculate: typeof rsi; nextValue(price: number): number | undefined; } export declare function rsi(input: RSIInput): number[]; ```
/content/code_sandbox/declarations/oscillators/RSI.d.ts
xml
2016-05-02T19:16:32
2024-08-15T14:25:09
technicalindicators
anandanand84/technicalindicators
2,137
111
```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 Slice = require( '@stdlib/slice/ctor' ); import normalizeSlice = require( './index' ); // TESTS // // The function returns a Slice object or an error object... { normalizeSlice( new Slice( 0, 10, 2 ), 10, false ); // $ExpectType SliceResult normalizeSlice( new Slice( null, null, -2 ), 10, false ); // $ExpectType SliceResult normalizeSlice( new Slice( 0, 10, 2 ), 10, true ); // $ExpectType SliceResult normalizeSlice( new Slice( null, null, -2 ), 10, true ); // $ExpectType SliceResult } // The compiler throws an error if the function is provided a first argument which is not a slice object... { normalizeSlice( '1', 10, false ); // $ExpectError normalizeSlice( 1, 10, false ); // $ExpectError normalizeSlice( true, 10, false ); // $ExpectError normalizeSlice( false, 10, false ); // $ExpectError normalizeSlice( null, 10, false ); // $ExpectError normalizeSlice( undefined, 10, false ); // $ExpectError normalizeSlice( [], 10, false ); // $ExpectError normalizeSlice( {}, 10, false ); // $ExpectError normalizeSlice( ( x: number ): number => x, 10, false ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a number... { normalizeSlice( new Slice( 0, 10, 2 ), '1', false ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), true, false ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), false, false ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), null, false ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), undefined, false ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), [], false ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), {}, false ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), ( x: number ): number => x, false ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a boolean... { normalizeSlice( new Slice( 0, 10, 2 ), 10, '1' ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10, 1 ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10, null ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10, undefined ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10, [] ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10, {} ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { normalizeSlice(); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ) ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10 ); // $ExpectError normalizeSlice( new Slice( 0, 10, 2 ), 10, false, {} ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/slice/base/normalize-slice/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
917
```xml import App from '../src/App'; import { expectType } from 'tsd'; import { CodedError } from '../src/errors'; import { IncomingMessage, ServerResponse } from 'http'; import { BufferedIncomingMessage } from '../src/receivers/BufferedIncomingMessage'; const app = new App({ token: 'TOKEN', signingSecret: 'Signing Secret' }); // path_to_url // CodedError should have original and so on app.error(async (error) => { expectType<CodedError>(error); expectType<Error | undefined>(error.original); if (error.original != undefined) { expectType<Error>(error.original); console.log(error.original.message); } expectType<Error[] | undefined>(error.originals); if (error.originals != undefined) { expectType<Error[]>(error.originals); console.log(error.originals); } expectType<string | undefined>(error.missingProperty); if (error.missingProperty != undefined) { expectType<string>(error.missingProperty); console.log(error.missingProperty); } expectType<IncomingMessage | BufferedIncomingMessage | undefined>(error.req); if (error.req != undefined) { expectType<IncomingMessage | BufferedIncomingMessage>(error.req); console.log(error.req); } expectType<ServerResponse | undefined>(error.res); if (error.res != undefined) { expectType<ServerResponse>(error.res); console.log(error.res); } }); ```
/content/code_sandbox/types-tests/error.test-d.ts
xml
2016-07-19T02:46:33
2024-08-16T12:34:33
bolt-js
slackapi/bolt-js
2,729
321
```xml const CATALOG_PROTOCOL = 'catalog:' /** * Parse a package.json dependency specifier using the catalog: protocol. * Returns null if the given specifier does not start with 'catalog:'. */ export function parseCatalogProtocol (pref: string): string | 'default' | null { if (!pref.startsWith(CATALOG_PROTOCOL)) { return null } const catalogNameRaw = pref.slice(CATALOG_PROTOCOL.length).trim() // Allow a specifier of 'catalog:' to be a short-hand for 'catalog:default'. const catalogNameNormalized = catalogNameRaw === '' ? 'default' : catalogNameRaw return catalogNameNormalized } ```
/content/code_sandbox/catalogs/protocol-parser/src/parseCatalogProtocol.ts
xml
2016-01-28T07:40:43
2024-08-16T12:38:47
pnpm
pnpm/pnpm
28,869
136
```xml import { useMemo } from 'react'; import getRTLList from '../localization/getRTLList'; import useDirFromProps from './internal/useDirFromProps'; import useLanguage from './useLanguage'; function determineDirection(dir, language) { if (dir !== 'auto') { return dir; } else if (getRTLList().includes(language)) { return 'rtl'; } return 'ltr'; } export default function useDirection(): ['auto' | 'ltr' | 'rtl'] { const [dir] = useDirFromProps(); const [language] = useLanguage(); const determinedDirection = useMemo(() => determineDirection(dir, language), [dir, language]); return [determinedDirection]; } ```
/content/code_sandbox/packages/api/src/hooks/useDirection.ts
xml
2016-07-07T23:16:57
2024-08-16T00:12:37
BotFramework-WebChat
microsoft/BotFramework-WebChat
1,567
154
```xml /* eslint-env jest */ import { findPageFile, createValidFileMatcher, } from 'next/dist/server/lib/find-page-file' import { normalizePagePath } from 'next/dist/shared/lib/page-path/normalize-page-path' import { join } from 'path' const resolveDataDir = join(__dirname, 'isolated', '_resolvedata') const dirWithPages = join(resolveDataDir, 'readdir', 'pages') describe('findPageFile', () => { it('should work', async () => { const pagePath = normalizePagePath('/nav/about') const result = await findPageFile( dirWithPages, pagePath, ['jsx', 'js'], false ) expect(result).toMatch(/^[\\/]nav[\\/]about\.js/) }) it('should work with nested index.js', async () => { const pagePath = normalizePagePath('/nested') const result = await findPageFile( dirWithPages, pagePath, ['jsx', 'js'], false ) expect(result).toMatch(/^[\\/]nested[\\/]index\.js/) }) it('should prefer prefered.js before preferred/index.js', async () => { const pagePath = normalizePagePath('/prefered') const result = await findPageFile( dirWithPages, pagePath, ['jsx', 'js'], false ) expect(result).toMatch(/^[\\/]prefered\.js/) }) }) describe('createPageFileMatcher', () => { describe('isAppRouterPage', () => { const pageExtensions = ['tsx', 'ts', 'jsx', 'js'] const fileMatcher = createValidFileMatcher(pageExtensions, '') it('should determine either server or client component page file as leaf node page', () => { expect(fileMatcher.isAppRouterPage('page.js')).toBe(true) expect(fileMatcher.isAppRouterPage('./page.js')).toBe(true) expect(fileMatcher.isAppRouterPage('./page.jsx')).toBe(true) expect(fileMatcher.isAppRouterPage('/page.ts')).toBe(true) expect(fileMatcher.isAppRouterPage('/path/page.tsx')).toBe(true) expect(fileMatcher.isAppRouterPage('\\path\\page.tsx')).toBe(true) expect(fileMatcher.isAppRouterPage('.\\page.jsx')).toBe(true) expect(fileMatcher.isAppRouterPage('\\page.js')).toBe(true) }) it('should determine other files under layout routes as non leaf node', () => { expect(fileMatcher.isAppRouterPage('./not-a-page.js')).toBe(false) expect(fileMatcher.isAppRouterPage('not-a-page.js')).toBe(false) expect(fileMatcher.isAppRouterPage('./page.component.jsx')).toBe(false) expect(fileMatcher.isAppRouterPage('layout.js')).toBe(false) expect(fileMatcher.isAppRouterPage('page')).toBe(false) }) }) describe('isMetadataRouteFile', () => { it('should determine top level metadata routes', () => { const pageExtensions = ['tsx', 'ts', 'jsx', 'js'] const fileMatcher = createValidFileMatcher(pageExtensions, 'app') expect(fileMatcher.isMetadataFile('app/route.js')).toBe(false) expect(fileMatcher.isMetadataFile('app/page.js')).toBe(false) expect(fileMatcher.isMetadataFile('pages/index.js')).toBe(false) expect(fileMatcher.isMetadataFile('app/robots.txt')).toBe(true) expect(fileMatcher.isMetadataFile('app/path/robots.txt')).toBe(false) expect(fileMatcher.isMetadataFile('app/sitemap.xml')).toBe(true) expect(fileMatcher.isMetadataFile('app/path/sitemap.xml')).toBe(true) }) }) }) ```
/content/code_sandbox/test/unit/find-page-file.test.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
794
```xml <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.flowable</groupId> <artifactId>archetypes</artifactId> <version>7.1.0-SNAPSHOT</version> </parent> <artifactId>flowable-archetype-unittest</artifactId> <description>Creates a new Flowable unit test.</description> <packaging>jar</packaging> </project> ```
/content/code_sandbox/tooling/archetypes/flowable-archetype-unittest/pom.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
132
```xml <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="pl"> <context> <name>AboutDialog</name> <message> <location filename="../ui/about_dialog.ui" line="14"/> <source>About</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.ui" line="60"/> <source>General</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.ui" line="90"/> <source>Service Information</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.ui" line="105"/> <source>Donate!</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.ui" line="129"/> <source>Close</source> <translation type="unfinished"></translation> </message> </context> <context> <name>DownloadDialog</name> <message> <location filename="../ui/download_dialog.ui" line="14"/> <source>Downloading</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/download_dialog.ui" line="26"/> <source>Downloading update in progress...</source> <translation type="unfinished"></translation> </message> </context> <context> <name>SessionType</name> <message> <location filename="../ui/session_type.cc" line="31"/> <source>Desktop Manage</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/session_type.cc" line="34"/> <source>Desktop View</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/session_type.cc" line="37"/> <source>File Transfer</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/session_type.cc" line="40"/> <source>System Information</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/session_type.cc" line="43"/> <source>Text Chat</source> <translation type="unfinished"></translation> </message> </context> <context> <name>StatusDialog</name> <message> <location filename="../ui/status_dialog.ui" line="14"/> <source>Connection Status</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TextChatIncomingMessage</name> <message> <location filename="../ui/text_chat_incoming_message.ui" line="197"/> <source>Time</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TextChatOutgoingMessage</name> <message> <location filename="../ui/text_chat_outgoing_message.ui" line="48"/> <source>Time</source> <translation type="unfinished"></translation> </message> </context> <context> <name>TextChatWidget</name> <message> <location filename="../ui/text_chat_widget.ui" line="20"/> <source>Aspia Chat</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.ui" line="179"/> <source>Send message</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.ui" line="225"/> <source>Tools</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.ui" line="248"/> <source></source> <translation type="unfinished"></translation> </message> </context> <context> <name>UpdateDialog</name> <message> <location filename="../ui/update_dialog.ui" line="14"/> <source>Update</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.ui" line="44"/> <source>Checking for updates</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.ui" line="59"/> <source>Current version:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.ui" line="66"/> <source>Available version:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.ui" line="75"/> <source>URL:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.ui" line="136"/> <source>Update description:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.ui" line="181"/> <source>Update now!</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.ui" line="188"/> <source>Close</source> <translation type="unfinished"></translation> </message> </context> <context> <name>common::AboutDialog</name> <message> <location filename="../ui/about_dialog.cc" line="121"/> <source>Version: %1 (%2)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="125"/> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="126"/> <source>You can get a copy of license here:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="131"/> <source>You can also get a translation of GNU GPL license here:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="135"/> <source>Links:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="136"/> <source>Home page:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="137"/> <source>GitHub page:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="140"/> <source>Developers:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="142"/> <source>Translators:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="144"/> <source>Third-party components:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="165"/> <source>Path: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="166"/> <source>Compilation date: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="167"/> <source>Compilation time: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="170"/> <source>Git branch: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="171"/> <source>Git commit: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="182"/> <source>Display &apos;%1&apos;</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="183"/> <source>Pixel ratio: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="184"/> <source>Logical DPI: %1x%2</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="187"/> <source>Physical DPI: %1x%2</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="192"/> <source>Size: %1x%2</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="195"/> <source>Available size: %1x%2</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="199"/> <source>Virtual size: %1x%2</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="202"/> <source>Depth: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="203"/> <source>Refresh rate: %1</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="208"/> <source>%1 version: %2</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="267"/> <source>Save to file...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="275"/> <source>Save File</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="277"/> <source>TXT files (*.txt)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="292"/> <source>Warning</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/about_dialog.cc" line="293"/> <source>Could not open file for writing.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>common::DownloadDialog</name> <message> <location filename="../ui/download_dialog.cc" line="42"/> <source>Cancel</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/download_dialog.cc" line="65"/> <source>Warning</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/download_dialog.cc" line="66"/> <source>An error occurred while downloading the update: %1</source> <translation type="unfinished"></translation> </message> </context> <context> <name>common::StatusDialog</name> <message> <location filename="../ui/status_dialog.cc" line="40"/> <source>Close</source> <translation type="unfinished"></translation> </message> </context> <context> <name>common::TextChatWidget</name> <message> <location filename="../ui/text_chat_widget.cc" line="71"/> <source>Save chat...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="72"/> <source>Clear chat</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="128"/> <source>%1 is typing...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="132"/> <source>User %1 has joined the chat (%2)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="136"/> <source>User %1 has left the chat (%2)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="140"/> <source>User %1 is logged in (%2)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="144"/> <source>User %1 is not logged in (%2)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="249"/> <location filename="../ui/text_chat_widget.cc" line="315"/> <source>Warning</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> <location filename="../ui/text_chat_widget.cc" line="250"/> <source>The message is too long. The maximum message length is %n characters.</source> <translation type="unfinished"> <numerusform></numerusform> <numerusform></numerusform> <numerusform></numerusform> </translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="298"/> <source>Save File</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="300"/> <source>TXT files (*.txt)</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/text_chat_widget.cc" line="316"/> <source>Could not open file for writing.</source> <translation type="unfinished"></translation> </message> </context> <context> <name>common::UpdateDialog</name> <message> <location filename="../ui/update_dialog.cc" line="59"/> <source>Receiving information...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="111"/> <source>Cancel checking for updates. Please wait.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="126"/> <source>Unknown</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="127"/> <source>Error retrieving update information.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="139"/> <location filename="../ui/update_dialog.cc" line="162"/> <source>No updates available.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="180"/> <source>An update will be downloaded. After the download is complete, the application will automatically close.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="182"/> <source>All connected sessions will be terminated. You cannot establish a connection until the update is complete.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="184"/> <source>All unsaved data will be lost.</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="185"/> <source>Continue?</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="188"/> <source>Confirmation</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="193"/> <source>Yes</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="194"/> <source>No</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="205"/> <source>Warning</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/update_dialog.cc" line="206"/> <source>An error occurred while installing the update: %1</source> <translation type="unfinished"></translation> </message> </context> </TS> ```
/content/code_sandbox/source/common/translations/aspia_common_pl.ts
xml
2016-10-26T16:17:31
2024-08-16T13:37:42
aspia
dchapyshev/aspia
1,579
3,932
```xml <clickhouse> <keeper_server> <use_cluster>false</use_cluster> <tcp_port>9181</tcp_port> <server_id>7</server_id> <log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path> <snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path> <coordination_settings> <operation_timeout_ms>5000</operation_timeout_ms> <session_timeout_ms>10000</session_timeout_ms> <snapshot_distance>75</snapshot_distance> <raft_logs_level>trace</raft_logs_level> <max_requests_batch_size>200</max_requests_batch_size> </coordination_settings> <raft_configuration> <server> <id>1</id> <hostname>node1</hostname> <port>9234</port> </server> <server> <id>2</id> <hostname>node2</hostname> <port>9234</port> </server> <server> <id>6</id> <hostname>node6</hostname> <port>9234</port> </server> <server> <id>7</id> <hostname>node7</hostname> <port>9234</port> </server> <server> <id>8</id> <hostname>node8</hostname> <port>9234</port> </server> </raft_configuration> </keeper_server> </clickhouse> ```
/content/code_sandbox/tests/integration/test_keeper_force_recovery/configs/enable_keeper7.xml
xml
2016-06-02T08:28:18
2024-08-16T18:39:33
ClickHouse
ClickHouse/ClickHouse
36,234
345
```xml export * from './fields'; export * from './invite'; export * from './item'; export * from './vault'; ```
/content/code_sandbox/packages/pass/types/forms/index.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
25
```xml import React from 'react'; import DefaultPage from '@/components/Page'; import { Table, SelectPicker, CheckPicker, Loader } from 'rsuite'; import { faker } from '@faker-js/faker/locale/en'; import { importFakerString, mockUsers, mockUsersString, sandboxFakerVersion } from '@/utils/mock'; const mockfile = { name: 'mock.js', content: [importFakerString, mockUsersString].join('\n') }; const sandboxDependencies = { ...sandboxFakerVersion }; export default function Page() { return ( <DefaultPage dependencies={{ faker, mockUsers, SelectPicker, CheckPicker, Table, Loader }} sandboxDependencies={sandboxDependencies} sandboxFiles={[mockfile]} /> ); } ```
/content/code_sandbox/docs/pages/guide/optimizing-performance/index.tsx
xml
2016-06-06T02:27:46
2024-08-16T16:41:54
rsuite
rsuite/rsuite
8,263
171
```xml /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at path_to_url */ import { DOWN_ARROW, END, ENTER, HOME, LEFT_ARROW, PAGE_DOWN, PAGE_UP, RIGHT_ARROW, UP_ARROW, SPACE, ESCAPE, hasModifierKey, } from '@angular/cdk/keycodes'; import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Inject, Input, Optional, Output, ViewEncapsulation, ViewChild, OnDestroy, SimpleChanges, OnChanges, } from '@angular/core'; import {DateAdapter, MAT_DATE_FORMATS, MatDateFormats} from '@angular/material/core'; import {Directionality} from '@angular/cdk/bidi'; import { MatCalendarBody, MatCalendarCell, MatCalendarUserEvent, MatCalendarCellClassFunction, } from './calendar-body'; import {createMissingDateImplError} from './datepicker-errors'; import {Subscription} from 'rxjs'; import {startWith} from 'rxjs/operators'; import {DateRange} from './date-selection-model'; import { MatDateRangeSelectionStrategy, MAT_DATE_RANGE_SELECTION_STRATEGY, } from './date-range-selection-strategy'; const DAYS_PER_WEEK = 7; let uniqueIdCounter = 0; /** * An internal component used to display a single month in the datepicker. * @docs-private */ @Component({ selector: 'mat-month-view', templateUrl: 'month-view.html', exportAs: 'matMonthView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatCalendarBody], }) export class MatMonthView<D> implements AfterContentInit, OnChanges, OnDestroy { private _rerenderSubscription = Subscription.EMPTY; /** Flag used to filter out space/enter keyup events that originated outside of the view. */ private _selectionKeyPressed: boolean; /** * The date to display in this month view (everything other than the month and year is ignored). */ @Input() get activeDate(): D { return this._activeDate; } set activeDate(value: D) { const oldActiveDate = this._activeDate; const validDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value)) || this._dateAdapter.today(); this._activeDate = this._dateAdapter.clampDate(validDate, this.minDate, this.maxDate); if (!this._hasSameMonthAndYear(oldActiveDate, this._activeDate)) { this._init(); } } private _activeDate: D; /** The currently selected date. */ @Input() get selected(): DateRange<D> | D | null { return this._selected; } set selected(value: DateRange<D> | D | null) { if (value instanceof DateRange) { this._selected = value; } else { this._selected = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value)); } this._setRanges(this._selected); } private _selected: DateRange<D> | D | null; /** The minimum selectable date. */ @Input() get minDate(): D | null { return this._minDate; } set minDate(value: D | null) { this._minDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value)); } private _minDate: D | null; /** The maximum selectable date. */ @Input() get maxDate(): D | null { return this._maxDate; } set maxDate(value: D | null) { this._maxDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value)); } private _maxDate: D | null; /** Function used to filter which dates are selectable. */ @Input() dateFilter: (date: D) => boolean; /** Function that can be used to add custom CSS classes to dates. */ @Input() dateClass: MatCalendarCellClassFunction<D>; /** Start of the comparison range. */ @Input() comparisonStart: D | null; /** End of the comparison range. */ @Input() comparisonEnd: D | null; /** ARIA Accessible name of the `<input matStartDate/>` */ @Input() startDateAccessibleName: string | null; /** ARIA Accessible name of the `<input matEndDate/>` */ @Input() endDateAccessibleName: string | null; /** Origin of active drag, or null when dragging is not active. */ @Input() activeDrag: MatCalendarUserEvent<D> | null = null; /** Emits when a new date is selected. */ @Output() readonly selectedChange: EventEmitter<D | null> = new EventEmitter<D | null>(); /** Emits when any date is selected. */ @Output() readonly _userSelection: EventEmitter<MatCalendarUserEvent<D | null>> = new EventEmitter<MatCalendarUserEvent<D | null>>(); /** Emits when the user initiates a date range drag via mouse or touch. */ @Output() readonly dragStarted = new EventEmitter<MatCalendarUserEvent<D>>(); /** * Emits when the user completes or cancels a date range drag. * Emits null when the drag was canceled or the newly selected date range if completed. */ @Output() readonly dragEnded = new EventEmitter<MatCalendarUserEvent<DateRange<D> | null>>(); /** Emits when any date is activated. */ @Output() readonly activeDateChange: EventEmitter<D> = new EventEmitter<D>(); /** The body of calendar table */ @ViewChild(MatCalendarBody) _matCalendarBody: MatCalendarBody; /** The label for this month (e.g. "January 2017"). */ _monthLabel: string; /** Grid of calendar cells representing the dates of the month. */ _weeks: MatCalendarCell[][]; /** The number of blank cells in the first row before the 1st of the month. */ _firstWeekOffset: number; /** Start value of the currently-shown date range. */ _rangeStart: number | null; /** End value of the currently-shown date range. */ _rangeEnd: number | null; /** Start value of the currently-shown comparison date range. */ _comparisonRangeStart: number | null; /** End value of the currently-shown comparison date range. */ _comparisonRangeEnd: number | null; /** Start of the preview range. */ _previewStart: number | null; /** End of the preview range. */ _previewEnd: number | null; /** Whether the user is currently selecting a range of dates. */ _isRange: boolean; /** The date of the month that today falls on. Null if today is in another month. */ _todayDate: number | null; /** The names of the weekdays. */ _weekdays: {long: string; narrow: string; id: number}[]; constructor( readonly _changeDetectorRef: ChangeDetectorRef, @Optional() @Inject(MAT_DATE_FORMATS) private _dateFormats: MatDateFormats, @Optional() public _dateAdapter: DateAdapter<D>, @Optional() private _dir?: Directionality, @Inject(MAT_DATE_RANGE_SELECTION_STRATEGY) @Optional() private _rangeStrategy?: MatDateRangeSelectionStrategy<D>, ) { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!this._dateAdapter) { throw createMissingDateImplError('DateAdapter'); } if (!this._dateFormats) { throw createMissingDateImplError('MAT_DATE_FORMATS'); } } this._activeDate = this._dateAdapter.today(); } ngAfterContentInit() { this._rerenderSubscription = this._dateAdapter.localeChanges .pipe(startWith(null)) .subscribe(() => this._init()); } ngOnChanges(changes: SimpleChanges) { const comparisonChange = changes['comparisonStart'] || changes['comparisonEnd']; if (comparisonChange && !comparisonChange.firstChange) { this._setRanges(this.selected); } if (changes['activeDrag'] && !this.activeDrag) { this._clearPreview(); } } ngOnDestroy() { this._rerenderSubscription.unsubscribe(); } /** Handles when a new date is selected. */ _dateSelected(event: MatCalendarUserEvent<number>) { const date = event.value; const selectedDate = this._getDateFromDayOfMonth(date); let rangeStartDate: number | null; let rangeEndDate: number | null; if (this._selected instanceof DateRange) { rangeStartDate = this._getDateInCurrentMonth(this._selected.start); rangeEndDate = this._getDateInCurrentMonth(this._selected.end); } else { rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected); } if (rangeStartDate !== date || rangeEndDate !== date) { this.selectedChange.emit(selectedDate); } this._userSelection.emit({value: selectedDate, event: event.event}); this._clearPreview(); this._changeDetectorRef.markForCheck(); } /** * Takes the index of a calendar body cell wrapped in an event as argument. For the date that * corresponds to the given cell, set `activeDate` to that date and fire `activeDateChange` with * that date. * * This function is used to match each component's model of the active date with the calendar * body cell that was focused. It updates its value of `activeDate` synchronously and updates the * parent's value asynchronously via the `activeDateChange` event. The child component receives an * updated value asynchronously via the `activeCell` Input. */ _updateActiveDate(event: MatCalendarUserEvent<number>) { const month = event.value; const oldActiveDate = this._activeDate; this.activeDate = this._getDateFromDayOfMonth(month); if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) { this.activeDateChange.emit(this._activeDate); } } /** Handles keydown events on the calendar body when calendar is in month view. */ _handleCalendarBodyKeydown(event: KeyboardEvent): void { // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent // disabled ones from being selected. This may not be ideal, we should look into whether // navigation should skip over disabled dates, and if so, how to implement that efficiently. const oldActiveDate = this._activeDate; const isRtl = this._isRtl(); switch (event.keyCode) { case LEFT_ARROW: this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? 1 : -1); break; case RIGHT_ARROW: this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? -1 : 1); break; case UP_ARROW: this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, -7); break; case DOWN_ARROW: this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 7); break; case HOME: this.activeDate = this._dateAdapter.addCalendarDays( this._activeDate, 1 - this._dateAdapter.getDate(this._activeDate), ); break; case END: this.activeDate = this._dateAdapter.addCalendarDays( this._activeDate, this._dateAdapter.getNumDaysInMonth(this._activeDate) - this._dateAdapter.getDate(this._activeDate), ); break; case PAGE_UP: this.activeDate = event.altKey ? this._dateAdapter.addCalendarYears(this._activeDate, -1) : this._dateAdapter.addCalendarMonths(this._activeDate, -1); break; case PAGE_DOWN: this.activeDate = event.altKey ? this._dateAdapter.addCalendarYears(this._activeDate, 1) : this._dateAdapter.addCalendarMonths(this._activeDate, 1); break; case ENTER: case SPACE: this._selectionKeyPressed = true; if (this._canSelect(this._activeDate)) { // Prevent unexpected default actions such as form submission. // Note that we only prevent the default action here while the selection happens in // `keyup` below. We can't do the selection here, because it can cause the calendar to // reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup` // because it's too late (see #23305). event.preventDefault(); } return; case ESCAPE: // Abort the current range selection if the user presses escape mid-selection. if (this._previewEnd != null && !hasModifierKey(event)) { this._clearPreview(); // If a drag is in progress, cancel the drag without changing the // current selection. if (this.activeDrag) { this.dragEnded.emit({value: null, event}); } else { this.selectedChange.emit(null); this._userSelection.emit({value: null, event}); } event.preventDefault(); event.stopPropagation(); // Prevents the overlay from closing. } return; default: // Don't prevent default or focus active cell on keys that we don't explicitly handle. return; } if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) { this.activeDateChange.emit(this.activeDate); this._focusActiveCellAfterViewChecked(); } // Prevent unexpected default actions such as form submission. event.preventDefault(); } /** Handles keyup events on the calendar body when calendar is in month view. */ _handleCalendarBodyKeyup(event: KeyboardEvent): void { if (event.keyCode === SPACE || event.keyCode === ENTER) { if (this._selectionKeyPressed && this._canSelect(this._activeDate)) { this._dateSelected({value: this._dateAdapter.getDate(this._activeDate), event}); } this._selectionKeyPressed = false; } } /** Initializes this month view. */ _init() { this._setRanges(this.selected); this._todayDate = this._getCellCompareValue(this._dateAdapter.today()); this._monthLabel = this._dateFormats.display.monthLabel ? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel) : this._dateAdapter .getMonthNames('short') [this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase(); let firstOfMonth = this._dateAdapter.createDate( this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1, ); this._firstWeekOffset = (DAYS_PER_WEEK + this._dateAdapter.getDayOfWeek(firstOfMonth) - this._dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK; this._initWeekdays(); this._createWeekCells(); this._changeDetectorRef.markForCheck(); } /** Focuses the active cell after the microtask queue is empty. */ _focusActiveCell(movePreview?: boolean) { this._matCalendarBody._focusActiveCell(movePreview); } /** Focuses the active cell after change detection has run and the microtask queue is empty. */ _focusActiveCellAfterViewChecked() { this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked(); } /** Called when the user has activated a new cell and the preview needs to be updated. */ _previewChanged({event, value: cell}: MatCalendarUserEvent<MatCalendarCell<D> | null>) { if (this._rangeStrategy) { // We can assume that this will be a range, because preview // events aren't fired for single date selections. const value = cell ? cell.rawValue! : null; const previewRange = this._rangeStrategy.createPreview( value, this.selected as DateRange<D>, event, ); this._previewStart = this._getCellCompareValue(previewRange.start); this._previewEnd = this._getCellCompareValue(previewRange.end); if (this.activeDrag && value) { const dragRange = this._rangeStrategy.createDrag?.( this.activeDrag.value, this.selected as DateRange<D>, value, event, ); if (dragRange) { this._previewStart = this._getCellCompareValue(dragRange.start); this._previewEnd = this._getCellCompareValue(dragRange.end); } } // Note that here we need to use `detectChanges`, rather than `markForCheck`, because // the way `_focusActiveCell` is set up at the moment makes it fire at the wrong time // when navigating one month back using the keyboard which will cause this handler // to throw a "changed after checked" error when updating the preview state. this._changeDetectorRef.detectChanges(); } } /** * Called when the user has ended a drag. If the drag/drop was successful, * computes and emits the new range selection. */ protected _dragEnded(event: MatCalendarUserEvent<D | null>) { if (!this.activeDrag) return; if (event.value) { // Propagate drag effect const dragDropResult = this._rangeStrategy?.createDrag?.( this.activeDrag.value, this.selected as DateRange<D>, event.value, event.event, ); this.dragEnded.emit({value: dragDropResult ?? null, event: event.event}); } else { this.dragEnded.emit({value: null, event: event.event}); } } /** * Takes a day of the month and returns a new date in the same month and year as the currently * active date. The returned date will have the same day of the month as the argument date. */ private _getDateFromDayOfMonth(dayOfMonth: number): D { return this._dateAdapter.createDate( this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), dayOfMonth, ); } /** Initializes the weekdays. */ private _initWeekdays() { const firstDayOfWeek = this._dateAdapter.getFirstDayOfWeek(); const narrowWeekdays = this._dateAdapter.getDayOfWeekNames('narrow'); const longWeekdays = this._dateAdapter.getDayOfWeekNames('long'); // Rotate the labels for days of the week based on the configured first day of the week. let weekdays = longWeekdays.map((long, i) => { return {long, narrow: narrowWeekdays[i], id: uniqueIdCounter++}; }); this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek)); } /** Creates MatCalendarCells for the dates in this month. */ private _createWeekCells() { const daysInMonth = this._dateAdapter.getNumDaysInMonth(this.activeDate); const dateNames = this._dateAdapter.getDateNames(); this._weeks = [[]]; for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) { if (cell == DAYS_PER_WEEK) { this._weeks.push([]); cell = 0; } const date = this._dateAdapter.createDate( this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), i + 1, ); const enabled = this._shouldEnableDate(date); const ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.dateA11yLabel); const cellClasses = this.dateClass ? this.dateClass(date, 'month') : undefined; this._weeks[this._weeks.length - 1].push( new MatCalendarCell<D>( i + 1, dateNames[i], ariaLabel, enabled, cellClasses, this._getCellCompareValue(date)!, date, ), ); } } /** Date filter for the month */ private _shouldEnableDate(date: D): boolean { return ( !!date && (!this.minDate || this._dateAdapter.compareDate(date, this.minDate) >= 0) && (!this.maxDate || this._dateAdapter.compareDate(date, this.maxDate) <= 0) && (!this.dateFilter || this.dateFilter(date)) ); } /** * Gets the date in this month that the given Date falls on. * Returns null if the given Date is in another month. */ private _getDateInCurrentMonth(date: D | null): number | null { return date && this._hasSameMonthAndYear(date, this.activeDate) ? this._dateAdapter.getDate(date) : null; } /** Checks whether the 2 dates are non-null and fall within the same month of the same year. */ private _hasSameMonthAndYear(d1: D | null, d2: D | null): boolean { return !!( d1 && d2 && this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) && this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2) ); } /** Gets the value that will be used to one cell to another. */ private _getCellCompareValue(date: D | null): number | null { if (date) { // We use the time since the Unix epoch to compare dates in this view, rather than the // cell values, because we need to support ranges that span across multiple months/years. const year = this._dateAdapter.getYear(date); const month = this._dateAdapter.getMonth(date); const day = this._dateAdapter.getDate(date); return new Date(year, month, day).getTime(); } return null; } /** Determines whether the user has the RTL layout direction. */ private _isRtl() { return this._dir && this._dir.value === 'rtl'; } /** Sets the current range based on a model value. */ private _setRanges(selectedValue: DateRange<D> | D | null) { if (selectedValue instanceof DateRange) { this._rangeStart = this._getCellCompareValue(selectedValue.start); this._rangeEnd = this._getCellCompareValue(selectedValue.end); this._isRange = true; } else { this._rangeStart = this._rangeEnd = this._getCellCompareValue(selectedValue); this._isRange = false; } this._comparisonRangeStart = this._getCellCompareValue(this.comparisonStart); this._comparisonRangeEnd = this._getCellCompareValue(this.comparisonEnd); } /** Gets whether a date can be selected in the month view. */ private _canSelect(date: D) { return !this.dateFilter || this.dateFilter(date); } /** Clears out preview state. */ private _clearPreview() { this._previewStart = this._previewEnd = null; } } ```
/content/code_sandbox/src/material/datepicker/month-view.ts
xml
2016-01-04T18:50:02
2024-08-16T11:21:13
components
angular/components
24,263
5,075
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="debug|x64"> <Configuration>debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="checked|x64"> <Configuration>checked</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="profile|x64"> <Configuration>profile</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="release|x64"> <Configuration>release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{653CC2CD-99F5-48D8-0E9C-46FA10B26447}</ProjectGuid> <RootNamespace>PhysXCommon</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='checked|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='profile|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/PhysXCommon/debug\</IntDir> <TargetExt>.dll</TargetExt> <TargetName>PhysX3CommonDEBUG_x64</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /d2Zi+</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>./../../../../Externals/nvToolsExt/1/include;./../../Common/include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../../../PxShared/src/pvd/include;./../../../Include/common;./../../../Include;./../../Common/src;./../../Common/src/windows;./../../PhysXProfile/include;./../../PhysXProfile/src;./../../PhysXGpu/include;./../../../Include/geometry;./../../GeomUtils/headers;./../../GeomUtils/src;./../../GeomUtils/src/contact;./../../GeomUtils/src/common;./../../GeomUtils/src/convex;./../../GeomUtils/src/distance;./../../GeomUtils/src/sweep;./../../GeomUtils/src/gjk;./../../GeomUtils/src/intersection;./../../GeomUtils/src/mesh;./../../GeomUtils/src/hf;./../../GeomUtils/src/pcm;./../../GeomUtils/src/ccd;./../../../Include/GeomUtils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PX_FOUNDATION_DLL=1;PX_PHYSX_COMMON_EXPORTS;_DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;PX_PHYSX_DLL_NAME_POSTFIX=DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/MAP /MACHINE:x64 /DEBUG /DELAYLOAD:PxFoundationDEBUG_x64.dll</AdditionalOptions> <AdditionalDependencies>./../../../../Externals/nvToolsExt/1/lib/x64/nvToolsExt64_1.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)PhysX3CommonDEBUG_x64.dll</OutputFile> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>./../../../Lib/vc14win64/$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/PhysXCommon/checked\</IntDir> <TargetExt>.dll</TargetExt> <TargetName>PhysX3CommonCHECKED_x64</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../../Externals/nvToolsExt/1/include;./../../Common/include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../../../PxShared/src/pvd/include;./../../../Include/common;./../../../Include;./../../Common/src;./../../Common/src/windows;./../../PhysXProfile/include;./../../PhysXProfile/src;./../../PhysXGpu/include;./../../../Include/geometry;./../../GeomUtils/headers;./../../GeomUtils/src;./../../GeomUtils/src/contact;./../../GeomUtils/src/common;./../../GeomUtils/src/convex;./../../GeomUtils/src/distance;./../../GeomUtils/src/sweep;./../../GeomUtils/src/gjk;./../../GeomUtils/src/intersection;./../../GeomUtils/src/mesh;./../../GeomUtils/src/hf;./../../GeomUtils/src/pcm;./../../GeomUtils/src/ccd;./../../../Include/GeomUtils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PX_FOUNDATION_DLL=1;PX_PHYSX_COMMON_EXPORTS;NDEBUG;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;PX_PHYSX_DLL_NAME_POSTFIX=CHECKED;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/MAP /MACHINE:x64 /DELAYLOAD:PxFoundationCHECKED_x64.dll</AdditionalOptions> <AdditionalDependencies>./../../../../Externals/nvToolsExt/1/lib/x64/nvToolsExt64_1.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)PhysX3CommonCHECKED_x64.dll</OutputFile> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>./../../../Lib/vc14win64/$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/PhysXCommon/profile\</IntDir> <TargetExt>.dll</TargetExt> <TargetName>PhysX3CommonPROFILE_x64</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../../Externals/nvToolsExt/1/include;./../../Common/include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../../../PxShared/src/pvd/include;./../../../Include/common;./../../../Include;./../../Common/src;./../../Common/src/windows;./../../PhysXProfile/include;./../../PhysXProfile/src;./../../PhysXGpu/include;./../../../Include/geometry;./../../GeomUtils/headers;./../../GeomUtils/src;./../../GeomUtils/src/contact;./../../GeomUtils/src/common;./../../GeomUtils/src/convex;./../../GeomUtils/src/distance;./../../GeomUtils/src/sweep;./../../GeomUtils/src/gjk;./../../GeomUtils/src/intersection;./../../GeomUtils/src/mesh;./../../GeomUtils/src/hf;./../../GeomUtils/src/pcm;./../../GeomUtils/src/ccd;./../../../Include/GeomUtils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PX_FOUNDATION_DLL=1;PX_PHYSX_COMMON_EXPORTS;NDEBUG;PX_PROFILE=1;PX_NVTX=1;PX_SUPPORT_PVD=1;PX_PHYSX_DLL_NAME_POSTFIX=PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/MAP /MACHINE:x64 /INCREMENTAL:NO /DEBUG /DELAYLOAD:PxFoundationPROFILE_x64.dll</AdditionalOptions> <AdditionalDependencies>./../../../../Externals/nvToolsExt/1/lib/x64/nvToolsExt64_1.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)PhysX3CommonPROFILE_x64.dll</OutputFile> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>./../../../Lib/vc14win64/$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> </ItemDefinitionGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> <OutDir>./../../../bin/vc14win64\</OutDir> <IntDir>./x64/PhysXCommon/release\</IntDir> <TargetExt>.dll</TargetExt> <TargetName>PhysX3Common_x64</TargetName> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> <SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> <ClCompile> <TreatWarningAsError>true</TreatWarningAsError> <StringPooling>true</StringPooling> <RuntimeTypeInfo>false</RuntimeTypeInfo> <BufferSecurityCheck>false</BufferSecurityCheck> <FloatingPointModel>Fast</FloatingPointModel> <AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /d2Zi+</AdditionalOptions> <Optimization>Full</Optimization> <AdditionalIncludeDirectories>./../../../../Externals/nvToolsExt/1/include;./../../Common/include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../../../PxShared/src/pvd/include;./../../../Include/common;./../../../Include;./../../Common/src;./../../Common/src/windows;./../../PhysXProfile/include;./../../PhysXProfile/src;./../../PhysXGpu/include;./../../../Include/geometry;./../../GeomUtils/headers;./../../GeomUtils/src;./../../GeomUtils/src/contact;./../../GeomUtils/src/common;./../../GeomUtils/src/convex;./../../GeomUtils/src/distance;./../../GeomUtils/src/sweep;./../../GeomUtils/src/gjk;./../../GeomUtils/src/intersection;./../../GeomUtils/src/mesh;./../../GeomUtils/src/hf;./../../GeomUtils/src/pcm;./../../GeomUtils/src/ccd;./../../../Include/GeomUtils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PX_FOUNDATION_DLL=1;PX_PHYSX_COMMON_EXPORTS;NDEBUG;PX_SUPPORT_PVD=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling>false</ExceptionHandling> <WarningLevel>Level4</WarningLevel> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeaderFile></PrecompiledHeaderFile> <ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <AdditionalOptions>/MAP /MACHINE:x64 /INCREMENTAL:NO /DELAYLOAD:PxFoundation_x64.dll</AdditionalOptions> <AdditionalDependencies>./../../../../Externals/nvToolsExt/1/lib/x64/nvToolsExt64_1.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)PhysX3Common_x64.dll</OutputFile> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile> <SubSystem>Console</SubSystem> <ImportLibrary>./../../../Lib/vc14win64/$(TargetName).lib</ImportLibrary> <GenerateDebugInformation>true</GenerateDebugInformation> <TargetMachine>MachineX64</TargetMachine> </Link> <ResourceCompile> </ResourceCompile> <ProjectReference> </ProjectReference> </ItemDefinitionGroup> <ItemGroup> <ResourceCompile Include="..\resource_x64\PhysX3Common.rc"> </ResourceCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\Include\common\PxBase.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxCollection.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxCoreUtilityTypes.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxMetaData.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxMetaDataFlags.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxPhysicsInsertionCallback.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxPhysXCommonConfig.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxRenderBuffer.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxSerialFramework.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxSerializer.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxStringTable.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxTolerancesScale.h"> </ClInclude> <ClInclude Include="..\..\..\Include\common\PxTypeInfo.h"> </ClInclude> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\Include\geometry\PxBoxGeometry.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxCapsuleGeometry.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxConvexMesh.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxConvexMeshGeometry.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxGeometry.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxGeometryHelpers.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxGeometryQuery.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxHeightField.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxHeightFieldDesc.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxHeightFieldFlag.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxHeightFieldGeometry.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxHeightFieldSample.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxMeshQuery.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxMeshScale.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxPlaneGeometry.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxSimpleTriangleMesh.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxSphereGeometry.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxTriangle.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxTriangleMesh.h"> </ClInclude> <ClInclude Include="..\..\..\Include\geometry\PxTriangleMeshGeometry.h"> </ClInclude> </ItemGroup> <ItemGroup> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\Common\src\windows\CmWindowsDelayLoadHook.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\windows\CmWindowsModuleUpdateLoader.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\Common\src\CmBoxPruning.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\CmCollection.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\CmMathUtils.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\CmPtrTable.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\CmRadixSort.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\CmRadixSortBuffered.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\CmRenderOutput.cpp"> </ClCompile> <ClCompile Include="..\..\Common\src\CmVisualization.cpp"> </ClCompile> <ClInclude Include="..\..\Common\src\CmBitMap.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmBoxPruning.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmCollection.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmConeLimitHelper.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmFlushPool.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmIDPool.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmIO.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmMatrix34.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmPhysXCommon.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmPool.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmPreallocatingPool.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmPriorityQueue.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmPtrTable.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmQueue.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmRadixSort.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmRadixSortBuffered.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmRefCountable.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmRenderBuffer.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmRenderOutput.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmScaling.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmSpatialVector.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmTask.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmTaskPool.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmTmpMem.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmTransformUtils.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmUtils.h"> </ClInclude> <ClInclude Include="..\..\Common\src\CmVisualization.h"> </ClInclude> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\Common\include\windows\CmWindowsLoadLibrary.h"> </ClInclude> <ClInclude Include="..\..\Common\include\windows\CmWindowsModuleUpdateLoader.h"> </ClInclude> </ItemGroup> <ItemGroup> </ItemGroup> <ItemGroup> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\headers\GuAxes.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuDistanceSegmentBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuDistanceSegmentSegment.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuIntersectionBoxBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuIntersectionTriangleBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuRaycastTests.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuSegment.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\headers\GuSIMDHelpers.h"> </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\..\..\Include\GeomUtils"> </None> </ItemGroup> <ItemGroup> </ItemGroup> <ItemGroup> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\contact\GuContactMethodImpl.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\contact\GuContactPolygonPolygon.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\contact\GuFeatureCode.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\contact\GuLegacyTraceLineCallback.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactBoxBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactCapsuleBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactCapsuleCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactCapsuleConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactCapsuleMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactConvexConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactConvexMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactPlaneBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactPlaneCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactPlaneConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactPolygonPolygon.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactSphereBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactSphereCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactSphereMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactSpherePlane.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuContactSphereSphere.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuFeatureCode.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuLegacyContactBoxHeightField.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuLegacyContactCapsuleHeightField.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuLegacyContactConvexHeightField.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\contact\GuLegacyContactSphereHeightField.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\common\GuBarycentricCoordinates.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\common\GuBoxConversion.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\common\GuEdgeCache.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\common\GuEdgeListData.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\common\GuSeparatingAxes.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\common\GuBarycentricCoordinates.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\common\GuSeparatingAxes.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\convex\GuBigConvexData.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuBigConvexData2.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuConvexEdgeFlags.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuConvexHelper.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuConvexMesh.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuConvexMeshData.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuConvexSupportTable.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuConvexUtilsInternal.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuCubeIndex.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuHillClimbing.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\convex\GuShapeConvex.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\convex\GuBigConvexData.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\convex\GuConvexHelper.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\convex\GuConvexMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\convex\GuConvexSupportTable.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\convex\GuConvexUtilsInternal.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\convex\GuHillClimbing.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\convex\GuShapeConvex.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\distance\GuDistancePointBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\distance\GuDistancePointSegment.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\distance\GuDistancePointTriangle.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\distance\GuDistancePointTriangleSIMD.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\distance\GuDistanceSegmentSegmentSIMD.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\distance\GuDistanceSegmentTriangle.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\distance\GuDistanceSegmentTriangleSIMD.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\distance\GuDistancePointBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\distance\GuDistancePointTriangle.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\distance\GuDistanceSegmentBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\distance\GuDistanceSegmentSegment.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\distance\GuDistanceSegmentTriangle.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepBoxBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepBoxSphere.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepBoxTriangle_FeatureBased.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepBoxTriangle_SAT.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepCapsuleBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepCapsuleCapsule.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepCapsuleTriangle.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepSphereCapsule.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepSphereSphere.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepSphereTriangle.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\sweep\GuSweepTriangleUtils.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepBoxBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepBoxSphere.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepBoxTriangle_FeatureBased.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepBoxTriangle_SAT.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepCapsuleBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepCapsuleCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepCapsuleTriangle.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepSphereCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepSphereSphere.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepSphereTriangle.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\sweep\GuSweepTriangleUtils.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\gjk\GuEPA.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuEPAFacet.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuGJK.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuGJKPenetration.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuGJKRaycast.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuGJKSimplex.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuGJKTest.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuGJKType.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuGJKUtil.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecCapsule.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecConvex.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecConvexHull.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecConvexHullNoScale.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecPlane.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecShrunkBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecShrunkConvexHull.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecShrunkConvexHullNoScale.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecSphere.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\gjk\GuVecTriangle.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\gjk\GuEPA.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\gjk\GuGJKSimplex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\gjk\GuGJKTest.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionCapsuleTriangle.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionEdgeEdge.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionRay.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionRayBox.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionRayBoxSIMD.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionRayCapsule.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionRayPlane.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionRaySphere.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionRayTriangle.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\intersection\GuIntersectionSphereBox.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionBoxBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionCapsuleTriangle.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionEdgeEdge.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionRayBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionRayCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionRaySphere.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionSphereBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\intersection\GuIntersectionTriangleBox.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV32.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV32Build.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4Build.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4Settings.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_AABBAABBSweepTest.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_BoxBoxOverlapTest.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_BoxOverlap_Internal.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_BoxSweep_Internal.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_BoxSweep_Params.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_CapsuleSweep_Internal.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_Common.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_Internal.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_ProcessStreamNoOrder_OBBOBB.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_ProcessStreamNoOrder_SegmentAABB.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_ProcessStreamNoOrder_SegmentAABB_Inflated.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_ProcessStreamNoOrder_SphereAABB.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_ProcessStreamOrdered_OBBOBB.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_ProcessStreamOrdered_SegmentAABB.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_ProcessStreamOrdered_SegmentAABB_Inflated.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_Slabs.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_Slabs_KajiyaNoOrder.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_Slabs_KajiyaOrdered.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_Slabs_SwizzledNoOrder.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBV4_Slabs_SwizzledOrdered.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuBVConstants.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuMeshData.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuMidphaseInterface.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuRTree.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuSweepConvexTri.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuSweepMesh.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuTriangle32.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuTriangleCache.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuTriangleMesh.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuTriangleMeshBV4.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuTriangleMeshRTree.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\mesh\GuTriangleVertexPointers.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV32.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV32Build.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4Build.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_AABBSweep.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_BoxOverlap.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_CapsuleSweep.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_CapsuleSweepAA.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_OBBSweep.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_Raycast.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_SphereOverlap.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuBV4_SphereSweep.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuMeshQuery.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuMidphaseBV4.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuMidphaseRTree.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuOverlapTestsMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuRTree.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuRTreeQueries.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuSweepsMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuTriangleMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuTriangleMeshBV4.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\mesh\GuTriangleMeshRTree.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\hf\GuEntityReport.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\hf\GuHeightField.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\hf\GuHeightFieldData.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\hf\GuHeightFieldUtil.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\hf\GuHeightField.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\hf\GuHeightFieldUtil.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\hf\GuOverlapTestsHF.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\hf\GuSweepsHF.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\pcm\GuPCMContactConvexCommon.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\pcm\GuPCMContactGen.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\pcm\GuPCMContactGenUtil.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\pcm\GuPCMContactMeshCallback.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\pcm\GuPCMShapeConvex.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\pcm\GuPCMTriangleContactGen.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\pcm\GuPersistentContactManifold.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactBoxBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactBoxConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactCapsuleBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactCapsuleCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactCapsuleConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactCapsuleHeightField.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactCapsuleMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactConvexCommon.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactConvexConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactConvexHeightField.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactConvexMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactGenBoxConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactGenSphereCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactPlaneBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactPlaneCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactPlaneConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactSphereBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactSphereCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactSphereConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactSphereHeightField.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactSphereMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactSpherePlane.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMContactSphereSphere.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMShapeConvex.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPCMTriangleContactGen.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\pcm\GuPersistentContactManifold.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\ccd\GuCCDSweepConvexMesh.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\ccd\GuCCDSweepConvexMesh.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\ccd\GuCCDSweepPrimitives.cpp"> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\GeomUtils\src\GuBounds.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuCapsule.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuCenterExtents.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuGeometryUnion.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuInternal.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuMeshFactory.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuMTD.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuOverlapTests.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuSerialize.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuSphere.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuSweepMTD.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuSweepSharedTests.h"> </ClInclude> <ClInclude Include="..\..\GeomUtils\src\GuSweepTests.h"> </ClInclude> <ClCompile Include="..\..\GeomUtils\src\GuBounds.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuBox.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuCapsule.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuCCTSweepTests.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuGeometryQuery.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuGeometryUnion.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuInternal.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuMeshFactory.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuMetaData.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuMTD.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuOverlapTests.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuRaycastTests.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuSerialize.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuSweepMTD.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuSweepSharedTests.cpp"> </ClCompile> <ClCompile Include="..\..\GeomUtils\src\GuSweepTests.cpp"> </ClCompile> </ItemGroup> <ItemGroup> </ItemGroup> <ItemGroup> <ProjectReference Include="./../../../../PxShared/src/compiler/vc14win64/PxFoundation.vcxproj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"></ImportGroup> </Project> ```
/content/code_sandbox/PhysX_3.4/Source/compiler/vc14win64/PhysXCommon.vcxproj
xml
2016-10-12T16:34:31
2024-08-16T09:40:38
PhysX-3.4
NVIDIAGameWorks/PhysX-3.4
2,343
14,290
```xml import type { Placement as FloatingUiPlacement } from '@floating-ui/dom'; export type ArrowOffset = 0 | string; export type PopperPlacement = FloatingUiPlacement; export type PopperPosition = { top: number; left: number }; export type PopperArrow = { '--arrow-offset': ArrowOffset }; ```
/content/code_sandbox/packages/components/components/popper/interface.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
65
```xml import { WorkItem, WorkItemService } from "../WorkItemService"; export class MockWorkItemService extends WorkItemService { id = 0; nextId() { this.id += 1; return String(this.id); } items: Record<string, WorkItem> = {}; override archiveItem: (itemId: string) => Promise<unknown> = jest .fn() .mockResolvedValue({}); override mailItem: (email: string) => Promise<Response> = jest .fn() .mockResolvedValue({}); override create: (item: Omit<WorkItem, "id">) => Promise<WorkItem> = jest.fn( (item: Omit<WorkItem, "id">) => { let workItem: WorkItem = { ...item, id: this.nextId(), }; this.items[workItem.id] = workItem; return Promise.resolve(workItem); } ); override list: ( params?: Partial<Record<keyof WorkItem, string>> ) => Promise<WorkItem[]> = jest.fn( (params?: Partial<Record<keyof WorkItem, string>>) => Promise.resolve([...Object.values(this.items)]) ); override retrieve: ( id: string, params?: Partial<Record<keyof WorkItem, string>> ) => Promise<WorkItem> = jest.fn( (id: string, params?: Partial<Record<keyof WorkItem, string>>) => Promise.resolve(this.items[id]) ); override update: (id: string, body: Partial<WorkItem>) => Promise<WorkItem> = jest.fn((id: string, body: Partial<WorkItem>) => { this.items[id] = body as WorkItem; return Promise.resolve(this.items[id]); }); override delete: (id: string) => Promise<void> = jest.fn((id: string) => { delete this.items[id]; return Promise.resolve(); }); } ```
/content/code_sandbox/resources/clients/react/elwing/src/plugins/item-tracker/work-item/testing/MockWorkItemService.ts
xml
2016-08-18T19:06:57
2024-08-16T18:59:44
aws-doc-sdk-examples
awsdocs/aws-doc-sdk-examples
9,298
430
```xml import styled from '../../../../../design/lib/styled' export const StyledGithubEmbed = styled.span` padding: 10px; display: inline-flex; background-color: white; & > svg { margin-right: 5px; } ` export const SpanBlock = styled.span` display: block; ` export const Title = styled.a` text-decoration: none; font-size: 24; ` export const InfoBlock = styled.span` display: block; color: black; font-size: 14px; opacity: 0.7; ` export const Label = styled.span` display: inline-block; padding: 0 7px; margin: 2px 2px 2px 0; margin-left: 10px; border-radius: 2em; font-size: 12px; font-weight: 500; line-height: 18px; text-decoration: none; ` ```
/content/code_sandbox/src/cloud/components/MarkdownView/Shortcode/github/styles.ts
xml
2016-11-19T14:30:34
2024-08-16T03:13:45
BoostNote-App
BoostIO/BoostNote-App
3,745
207
```xml <?xml version="1.0" encoding="utf-8"?> path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <selector xmlns:android="path_to_url"> <!-- Functional keys. --> <item android:state_single="true" android:state_pressed="true" android:drawable="@drawable/btn_keyboard_key_dark_pressed" /> <item android:state_single="true" android:drawable="@drawable/btn_keyboard_key_dark_normal" /> <!-- Toggle keys. Use checkable/checked state. --> <!-- The lock icon is a copy of the 'on' icon, hue shifted by -75 using Gimp's Colors/Hue&Saturation --> <item android:state_checkable="true" android:state_checked="true" android:state_pressed="true" android:drawable="@drawable/btn_keyboard_key_dark_pressed_on" /> <item android:state_checkable="true" android:state_pressed="true" android:drawable="@drawable/btn_keyboard_key_dark_pressed_off" /> <item android:state_checkable="true" android:state_checked="true" android:state_active="true" android:drawable="@drawable/btn_keyboard_key_dark_normal_lock" /> <item android:state_checkable="true" android:state_checked="true" android:drawable="@drawable/btn_keyboard_key_dark_normal_on" /> <item android:state_checkable="true" android:drawable="@drawable/btn_keyboard_key_dark_normal_off" /> <!-- Normal keys --> <item android:state_pressed="true" android:drawable="@drawable/btn_keyboard_key_light_pressed" /> <item android:drawable="@drawable/btn_keyboard_key_light_normal" /> </selector> ```
/content/code_sandbox/app/src/main/res/drawable/btn_keyboard_key_gingerbread.xml
xml
2016-01-22T21:40:54
2024-08-16T11:54:30
hackerskeyboard
klausw/hackerskeyboard
1,807
385
```xml let constants = { ENTER_BUTTON_NUM: 13, TAB_BUTTON_NUM: 9, LEFT_BUTTON_NUM: 37, UP_BUTTON_NUM: 38, RIGHT_BUTTON_NUM: 39, DOWN_BUTTON_NUM: 40, Y_BUTTON_NUM: 89, N_BUTTON_NUM: 78, COMMA_BUTTON_NUM: 188, DATE_FORMAT: "dddd, MMMM Do YYYY, h:mm:ss a", IGNORE_ERRORS_TOKEN_STR: "1", DISASSEMBLY_FOR_MISSING_FILE_STR: "2", CREATE_VAR_STR: "3", INLINE_DISASSEMBLY_STR: "4", console_entry_type: { SENT_COMMAND: "SENT_COMMAND", STD_ERR: "STD_ERR", STD_OUT: "STD_OUT", GDBGUI_OUTPUT: "GDBGUI_OUTPUT", GDBGUI_OUTPUT_RAW: "GDBGUI_OUTPUT_RAW", AUTOCOMPLETE_OPTION: "AUTOCOMPLETE_OPTION" }, source_code_selection_states: { USER_SELECTION: "USER_SELECTION", PAUSED_FRAME: "PAUSED_FRAME" }, source_code_states: { ASSM_AND_SOURCE_CACHED: "ASSM_AND_SOURCE_CACHED", SOURCE_CACHED: "SOURCE_CACHED", FETCHING_SOURCE: "FETCHING_SOURCE", ASSM_CACHED: "ASSM_CACHED", FETCHING_ASSM: "FETCHING_ASSM", ASSM_UNAVAILABLE: "ASSM_UNAVAILABLE", FILE_MISSING: "FILE_MISSING", NONE_AVAILABLE: "NONE_AVAILABLE" }, inferior_states: { unknown: "unknown", running: "running", paused: "paused", exited: "exited" }, tree_component_id: "tree", default_max_lines_of_code_to_fetch: 500, keys_to_not_log_changes_in_console: ["gdb_mi_output"], xtermColors: { reset: "\x1B[0m", red: "\x1B[31m", grey: "\x1b[1;30m", green: "\x1B[0;32m", lgreen: "\x1B[1;32m", blue: "\x1B[0;34m", lblue: "\x1B[1;34m", yellow: "\x1B[0;33m" } }; const colorTypeMap = {}; // @ts-expect-error ts-migrate(7053) FIXME: No index signature with a parameter of type 'strin... Remove this comment to see the full error message colorTypeMap[constants.console_entry_type.STD_OUT] = constants.xtermColors["reset"]; // @ts-expect-error ts-migrate(7053) FIXME: No index signature with a parameter of type 'strin... Remove this comment to see the full error message colorTypeMap[constants.console_entry_type.STD_ERR] = constants.xtermColors["red"]; // @ts-expect-error ts-migrate(7053) FIXME: No index signature with a parameter of type 'strin... Remove this comment to see the full error message colorTypeMap[constants.console_entry_type.SENT_COMMAND] = constants.xtermColors["lblue"]; // @ts-expect-error ts-migrate(7053) FIXME: No index signature with a parameter of type 'strin... Remove this comment to see the full error message colorTypeMap[constants.console_entry_type.GDBGUI_OUTPUT] = constants.xtermColors["yellow"]; // @ts-expect-error ts-migrate(7053) FIXME: No index signature with a parameter of type 'strin... Remove this comment to see the full error message colorTypeMap[constants.console_entry_type.GDBGUI_OUTPUT_RAW] = constants.xtermColors["green"]; // @ts-expect-error ts-migrate(7053) FIXME: Property 'colorTypeMap' does not exist on type '{ ... Remove this comment to see the full error message constants["colorTypeMap"] = colorTypeMap; // @ts-expect-error ts-migrate(2551) FIXME: Property 'IGNORE_ERRORS_TOKEN_INT' does not exist ... Remove this comment to see the full error message constants["IGNORE_ERRORS_TOKEN_INT"] = parseInt(constants.IGNORE_ERRORS_TOKEN_STR); // @ts-expect-error ts-migrate(2551) FIXME: Property 'DISASSEMBLY_FOR_MISSING_FILE_INT' does n... Remove this comment to see the full error message constants["DISASSEMBLY_FOR_MISSING_FILE_INT"] = parseInt( constants.DISASSEMBLY_FOR_MISSING_FILE_STR ); // @ts-expect-error ts-migrate(2551) FIXME: Property 'CREATE_VAR_INT' does not exist on type '... Remove this comment to see the full error message constants["CREATE_VAR_INT"] = parseInt(constants.CREATE_VAR_STR); // @ts-expect-error ts-migrate(2551) FIXME: Property 'INLINE_DISASSEMBLY_INT' does not exist o... Remove this comment to see the full error message constants["INLINE_DISASSEMBLY_INT"] = parseInt(constants.INLINE_DISASSEMBLY_STR); export default Object.freeze(constants); ```
/content/code_sandbox/gdbgui/src/js/constants.ts
xml
2016-10-27T03:19:25
2024-08-16T06:39:35
gdbgui
cs01/gdbgui
9,816
1,087
```xml export * from './json' export * from './jsonable-value' export * from './logger' ```
/content/code_sandbox/src/utils/index.ts
xml
2016-08-30T13:47:17
2024-08-16T15:05:40
ts-jest
kulshekhar/ts-jest
6,902
21
```xml import { ClientComp } from './client-component' export default function Home() { return ( <> <ClientComp /> </> ) } ```
/content/code_sandbox/examples/react/next-server-actions/src/app/page.tsx
xml
2016-11-29T04:53:07
2024-08-16T16:25:02
form
TanStack/form
3,566
32
```xml export type { Request, Geo } from './headers'; export { geolocation, ipAddress } from './headers'; export { getEnv } from './get-env'; export { waitUntil } from './wait-until'; ```
/content/code_sandbox/packages/functions/src/index.ts
xml
2016-09-09T01:12:08
2024-08-16T17:39:45
vercel
vercel/vercel
12,545
44
```xml import { ScrollManagerService } from './scroll-manager.service'; import { ScrollSectionDirective } from './scroll-section.directive'; describe('ScrollSectionDirective', () => { it('should create an instance', () => { const directive = new ScrollSectionDirective( { nativeElement: <HTMLDivElement>document.createElement('div') }, new ScrollManagerService() ); expect(directive).toBeTruthy(); }); }); ```
/content/code_sandbox/src/portal/src/app/shared/directives/scroll/scroll-section.directive.spec.ts
xml
2016-01-28T21:10:28
2024-08-16T15:28:34
harbor
goharbor/harbor
23,335
88
```xml // Libraries import _ from 'lodash' // Utils import {getDeep} from 'src/utils/wrappers' // Constants import {DYNAMIC_SOURCE, DYNAMIC_SOURCE_INFO} from 'src/dashboards/constants' // Types import {CellQuery, Cell, Source, Template} from 'src/types' import { CellInfo, SourceInfo, SourcesCells, SourceMappings, ImportedSources, } from 'src/types/dashboards' const REGEX_SOURCE_ID = /sources\/(\d+)/g export const createSourceMappings = ( source, cells, importedSources, variables: Template[] = [] ): {sourcesCells: SourcesCells; sourceMappings: SourceMappings} => { let sourcesCells: SourcesCells = {} const sourceMappings: SourceMappings = {} const sourceInfo: SourceInfo = getSourceInfo(source) const cellsWithNoSource: CellInfo[] = [] sourcesCells = _.reduce( cells, (acc, c) => { const cellInfo: CellInfo = {id: c.i, name: c.name} const query = getDeep<CellQuery>(c, 'queries.0', null) if (_.isEmpty(query)) { return acc } const sourceLink = getDeep<string>(query, 'source', '') if (!sourceLink) { cellsWithNoSource.push(cellInfo) return acc } let importedSourceID = _.findKey( importedSources, is => is.link === sourceLink ) if (!importedSourceID) { const sourceLinkSID = getSourceIDFromLink(sourceLink) if (!sourceLinkSID) { return acc } importedSourceID = sourceLinkSID } if (acc[importedSourceID]) { acc[importedSourceID].push(cellInfo) } else { acc[importedSourceID] = [cellInfo] } sourceMappings[importedSourceID] = sourceInfo return acc }, sourcesCells ) // add sources also for variables variables.forEach(v => { if (v.sourceID && !sourceMappings[v.sourceID]) { sourceMappings[v.sourceID] = sourceInfo sourcesCells[v.sourceID] = [] } }) if (cellsWithNoSource.length) { sourcesCells[DYNAMIC_SOURCE] = cellsWithNoSource sourceMappings[DYNAMIC_SOURCE] = DYNAMIC_SOURCE_INFO } return {sourcesCells, sourceMappings} } export const mapCells = ( cells: Cell[], sourceMappings: SourceMappings, importedSources: ImportedSources ): Cell[] => { const mappedCells = cells.map(c => { const query = getDeep<CellQuery>(c, 'queries.0', null) if (_.isEmpty(query)) { return c } const sourceLink = getDeep<string>(query, 'source', '') if (!sourceLink) { return mapQueriesInCell(sourceMappings, c, DYNAMIC_SOURCE) } let importedSourceID = _.findKey( importedSources, is => is.link === sourceLink ) if (!importedSourceID) { const sourceLinkSID = getSourceIDFromLink(sourceLink) if (!sourceLinkSID) { return c } importedSourceID = sourceLinkSID } if (importedSourceID) { return mapQueriesInCell(sourceMappings, c, importedSourceID) } return c }) return mappedCells } export const mapQueriesInCell = ( sourceMappings: SourceMappings, cell: Cell, sourceID: string ): Cell => { const mappedSourceLink = sourceMappings[sourceID].link let queries = getDeep<CellQuery[]>(cell, 'queries', []) if (queries.length) { queries = queries.map(q => { return {...q, source: mappedSourceLink} }) } return {...cell, queries} } export const getSourceInfo = (source: Source): SourceInfo => { return { name: source.name, id: source.id, link: source.links.self, } } export const getSourceIDFromLink = (sourceLink: string): string => { // first capture group const matcher = new RegExp(REGEX_SOURCE_ID) const sourceLinkSID = matcher.exec(sourceLink)[1] return sourceLinkSID } ```
/content/code_sandbox/ui/src/dashboards/utils/importDashboardMappings.ts
xml
2016-08-24T23:28:56
2024-08-13T19:50:03
chronograf
influxdata/chronograf
1,494
947
```xml <vector android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="path_to_url"> <path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/> </vector> ```
/content/code_sandbox/imitate/src/main/res/drawable/ic_baseline_close_24.xml
xml
2016-08-08T08:52:10
2024-08-12T19:24:13
AndroidAnimationExercise
REBOOTERS/AndroidAnimationExercise
1,868
141
```xml export { getDefaultConfig, ConfigBuilder } from '@verdaccio/config'; export { constants } from '@verdaccio/core'; export { Registry } from 'verdaccio'; export { initialSetup, getConfigPath, Setup } from './registry'; export { addNpmPrefix, addYarnClassicPrefix, addRegistry, prepareYarnModernProject, prepareGenericEmptyProject, nJSONParse, } from './utils'; export { exec, ExecOutput } from './process'; export { callRegistry } from './web'; export * as npmUtils from './npm-utils'; export * as pnpmUtils from './npm-utils'; export * as yarnModernUtils from './yarn-modern-utils'; ```
/content/code_sandbox/e2e/cli/cli-commons/src/index.ts
xml
2016-04-15T16:21:12
2024-08-16T09:38:01
verdaccio
verdaccio/verdaccio
16,189
151
```xml import Alert from "../../utils/Alert"; import { AuthBox } from "../styles"; import Button from "../../common/Button"; import FormControl from "../../common/form/Control"; import FormGroup from "../../common/form/Group"; import { IOwner } from "../types"; import Icon from "../../common/Icon"; import { PasswordWithEye } from "../../layout/styles"; import React from "react"; import { __ } from "../../../utils"; import { useState } from "react"; type Props = { createOwner: (arg: IOwner) => void; }; export const OwnerDescription = () => { return ( <> <h1>{__("Welcome to erxes")}</h1> <h2>{__("erxes is the partner your website needs for success")}</h2> <p> {__( "You will configure several settings on this page. You will be able to change these settings in the erxes settings tab. You will be creating the top level administrator account profile. Please complete all the data in Initial Configuration Steps." )} </p> </> ); }; const OwnerSetup = (props: Props) => { const { createOwner } = props; const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [firstName, setFirstName] = useState(""); const [purpose, setPurpose] = useState("manage a personal project"); const [lastName, setLastName] = useState(""); const [subscribeEmail, setSubscribeEmail] = useState(false); const [showPassword, setShowPassword] = useState(false); const handleSubmit = (e) => { e.preventDefault(); if (!firstName) { return Alert.error( "We would love your real first name, but you are free to choose any name you want to be called." ); } if (!email) { return Alert.error( "Your best email address is required. You will want to receive these notifications." ); } if (!password) { return Alert.error("Your password is required."); } createOwner({ email, password, firstName, lastName, purpose, subscribeEmail, }); }; const handleFirstName = (e) => { e.preventDefault(); setFirstName(e.target.value); }; const handleLastName = (e) => { e.preventDefault(); setLastName(e.target.value); }; const handlePurpose = (e) => { e.preventDefault(); setPurpose(e.target.value); }; const handleEmail = (e) => { e.preventDefault(); setEmail(e.target.value); }; const handlePassword = (e) => { e.preventDefault(); setPassword(e.target.value); }; const toggleSubscribeEmail = (e) => { setSubscribeEmail(e.target.checked); }; const toggleShowPassword = () => { setShowPassword(!showPassword); }; return ( <AuthBox> <h2>{__("Initial Configuration Steps")}</h2> <p> {__("Please fill out the following form to complete your installation")} . </p> <form onSubmit={handleSubmit}> <FormGroup> <FormControl placeholder="First name" type="text" name="firstName" onChange={handleFirstName} /> </FormGroup> <FormGroup> <FormControl placeholder="Last name" type="text" name="lastName" onChange={handleLastName} /> </FormGroup> <br /> <p> {__( "Please input the best email address to use as your login and to receive emails from your installation such as notifications, alerts and other messages" )} . </p> <FormGroup> <FormControl placeholder="Email" type="text" name="email" onChange={handleEmail} /> </FormGroup> <FormGroup> <PasswordWithEye> <FormControl placeholder="Password" type={showPassword ? "text" : "password"} name="password" onChange={handlePassword} /> <Icon onClick={toggleShowPassword} size={16} icon={showPassword ? "eye-slash" : "eye"} /> </PasswordWithEye> </FormGroup> <FormGroup> <p>{__("I am planning to use erxes to")}</p> <FormControl componentClass="select" value={purpose} options={[ { value: "manage a personal project", label: "Manage a personal project", }, { value: "manage an internal company use case", label: "Manage an internal company use case", }, { value: "attract new businesses", label: "Attract new businesses", }, ]} onChange={handlePurpose} /> </FormGroup> <br /> <p> {__( "You must check below to receive information about upgrades and upgrading instructions, new tutorials, occasional requests for feedback and the monthly newsletter" )} . </p> <FormGroup> <FormControl className="toggle-message" componentClass="checkbox" checked={subscribeEmail} onChange={toggleSubscribeEmail} > {__("Yes, I want in. I know I can unsubscribe easily at any time")}. </FormControl> </FormGroup> <Button btnStyle="success" type="submit" block={true} disabled={!subscribeEmail} > Save and continue to login </Button> </form> </AuthBox> ); }; export default OwnerSetup; ```
/content/code_sandbox/exm/modules/auth/components/OwnerSetup.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
1,195
```xml <manifest package="com.xw.repo.bubbleseekbar"> <application/> </manifest> ```
/content/code_sandbox/bubbleseekbar/src/main/AndroidManifest.xml
xml
2016-11-03T14:31:05
2024-08-15T06:21:54
BubbleSeekBar
woxingxiao/BubbleSeekBar
3,356
21
```xml import { ChangeDetectionStrategy, Component } from '@angular/core'; import { TreeNode } from 'primeng/api'; import { Code } from '@domain/code'; import { NodeService } from '@service/nodeservice'; interface Column { field: string; header: string; } @Component({ selector: 'resize-fit-doc', template: ` <app-docsectiontext> <p>Columns can be resized with drag and drop when <i>resizableColumns</i> is enabled. Default resize mode is <i>fit</i> that does not change the overall table width.</p> </app-docsectiontext> <div class="card"> <p-deferred-demo (load)="loadDemoData()"> <p-treeTable [value]="files" [columns]="cols" [resizableColumns]="true" [tableStyle]="{ 'min-width': '50rem' }"> <ng-template pTemplate="header" let-columns> <tr> <th *ngFor="let col of columns" ttResizableColumn> {{ col.header }} </th> </tr> </ng-template> <ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns"> <tr [ttRow]="rowNode"> <td *ngFor="let col of columns; let i = index"> <p-treeTableToggler [rowNode]="rowNode" *ngIf="i === 0" /> {{ rowData[col.field] }} </td> </tr> </ng-template> </p-treeTable> </p-deferred-demo> </div> <app-code [code]="code" selector="tree-table-resize-fit-demo"></app-code> `, changeDetection: ChangeDetectionStrategy.OnPush }) export class ResizeFitDoc { files!: TreeNode[]; cols!: Column[]; constructor(private nodeService: NodeService) {} loadDemoData() { this.nodeService.getFilesystem().then((files) => (this.files = files)); this.cols = [ { field: 'name', header: 'Name' }, { field: 'size', header: 'Size' }, { field: 'type', header: 'Type' } ]; } code: Code = { basic: `<p-treeTable [value]="files" [columns]="cols" [resizableColumns]="true" [tableStyle]="{'min-width': '50rem'}"> <ng-template pTemplate="header" let-columns> <tr> <th *ngFor="let col of columns" ttResizableColumn> {{ col.header }} </th> </tr> </ng-template> <ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns"> <tr [ttRow]="rowNode"> <td *ngFor="let col of columns; let i = index"> <p-treeTableToggler [rowNode]="rowNode" *ngIf="i === 0" /> {{ rowData[col.field] }} </td> </tr> </ng-template> </p-treeTable>`, html: `<div class="card"> <p-treeTable [value]="files" [columns]="cols" [resizableColumns]="true" [tableStyle]="{'min-width': '50rem'}"> <ng-template pTemplate="header" let-columns> <tr> <th *ngFor="let col of columns" ttResizableColumn> {{ col.header }} </th> </tr> </ng-template> <ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns"> <tr [ttRow]="rowNode"> <td *ngFor="let col of columns; let i = index"> <p-treeTableToggler [rowNode]="rowNode" *ngIf="i === 0" /> {{ rowData[col.field] }} </td> </tr> </ng-template> </p-treeTable> </div>`, typescript: `import { Component, OnInit } from '@angular/core'; import { TreeNode } from 'primeng/api'; import { NodeService } from '@service/nodeservice'; import { TreeTableModule } from 'primeng/treetable'; import { CommonModule } from '@angular/common'; interface Column { field: string; header: string; } @Component({ selector: 'tree-table-resize-fit-demo', templateUrl: './tree-table-resize-fit-demo.html', standalone: true, imports: [TreeTableModule, CommonModule], providers: [NodeService] }) export class TreeTableResizeFitDemo implements OnInit { files!: TreeNode[]; cols!: Column[]; constructor(private nodeService: NodeService) {} ngOnInit() { this.nodeService.getFilesystem().then((files) => (this.files = files)); this.cols = [ { field: 'name', header: 'Name' }, { field: 'size', header: 'Size' }, { field: 'type', header: 'Type' } ]; } }`, service: ['NodeService'] }; } ```
/content/code_sandbox/src/app/showcase/doc/treetable/columnresizefitdoc.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
1,128
```xml import type { PrerenderAsyncStorage } from './prerender-async-storage.external' import { createAsyncLocalStorage } from '../../client/components/async-local-storage' export const prerenderAsyncStorage: PrerenderAsyncStorage = createAsyncLocalStorage() ```
/content/code_sandbox/packages/next/src/server/app-render/prerender-async-storage-instance.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
53
```xml import * as React from 'react'; import { makeStyles, Persona } from '@fluentui/react-components'; const useStyles = makeStyles({ root: { display: 'grid', gridTemplateColumns: 'repeat(2, max-content)', columnGap: '10px', rowGap: '10px', }, }); export const PresenceSize = () => { const styles = useStyles(); return ( <div className={styles.root}> <Persona size="extra-small" presenceOnly presence={{ status: 'available' }} name="Kevin Sturgis" secondaryText="Available" /> <Persona size="small" presenceOnly presence={{ status: 'available' }} name="Kevin Sturgis" secondaryText="Available" /> <Persona size="medium" presenceOnly presence={{ status: 'available' }} name="Kevin Sturgis" secondaryText="Available" /> <Persona size="large" presenceOnly presence={{ status: 'available' }} name="Kevin Sturgis" secondaryText="Available" /> <Persona size="extra-large" presenceOnly presence={{ status: 'available' }} name="Kevin Sturgis" secondaryText="Available" /> <Persona size="huge" presenceOnly presence={{ status: 'available' }} name="Kevin Sturgis" secondaryText="Available" /> </div> ); }; PresenceSize.parameters = { docs: { description: { story: `A Persona supports different sizes, medium being the default.`, }, }, }; ```
/content/code_sandbox/packages/react-components/react-persona/stories/src/Persona/PersonaPresenceSize.stories.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
365
```xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="vertical_stepper_form_background_color_disabled_elements">#c8c8c8</color> <color name="vertical_stepper_form_background_color_circle">#1976d2</color> <color name="vertical_stepper_form_background_color_next_button">#1976d2</color> <color name="vertical_stepper_form_background_color_next_button_pressed">#004ba0</color> <color name="vertical_stepper_form_background_color_cancel_button">#9b9b9b</color> <color name="vertical_stepper_form_background_color_cancel_button_pressed">#878787</color> <color name="vertical_stepper_form_background_color_bottom_navigation">#f0f0f0</color> <color name="vertical_stepper_form_text_color_circle">#ffffff</color> <color name="vertical_stepper_form_text_color_title">#212121</color> <color name="vertical_stepper_form_text_color_subtitle">#9b9b9b</color> <color name="vertical_stepper_form_text_color_next_button">#ffffff</color> <color name="vertical_stepper_form_text_color_next_button_pressed">#ffffff</color> <color name="vertical_stepper_form_text_color_cancel_button">#ffffff</color> <color name="vertical_stepper_form_text_color_cancel_button_pressed">#ffffff</color> <color name="vertical_stepper_form_text_color_error_message">#af1212</color> </resources> ```
/content/code_sandbox/vertical-stepper-form/src/main/res/values/colors.xml
xml
2016-06-13T19:59:59
2024-08-07T21:44:04
VerticalStepperForm
ernestoyaquello/VerticalStepperForm
1,052
323
```xml import { useEffect, useState } from 'react'; import { format, isValid } from 'date-fns'; import { c } from 'ttag'; import { ContactKeyWarningIcon, Loader, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow, } from '@proton/components'; import { useLoading } from '@proton/hooks'; import { dateLocale } from '@proton/shared/lib/i18n'; import type { ContactWithBePinnedPublicKey } from '@proton/shared/lib/interfaces/contacts'; import { getFormattedAlgorithmName } from '@proton/shared/lib/keys'; interface Props { contact: ContactWithBePinnedPublicKey; } const SimplePublicKeyTable = ({ contact }: Props) => { const [expirationDate, setExpirationDate] = useState<Date | typeof Infinity | null>(); const [loading, withLoading] = useLoading(); const publicKey = contact.bePinnedPublicKey; const fingerprint = publicKey.getFingerprint(); const creationDate = new Date(publicKey.getCreationTime()); const algorithmType = getFormattedAlgorithmName(publicKey.getAlgorithmInfo()); useEffect(() => { const getExpirationTime = async () => { const time = await publicKey.getExpirationTime(); setExpirationDate(time); }; void withLoading(getExpirationTime()); }, []); const fingerprintCell = ( <div key={fingerprint} title={fingerprint} className="flex flex-nowrap"> <ContactKeyWarningIcon className="mr-2 shrink-0" publicKey={publicKey} emailAddress={contact.emailAddress} isInternal={contact.isInternal} /> <span className="flex-1 text-ellipsis">{fingerprint}</span> </div> ); const creationCell = isValid(creationDate) ? format(creationDate, 'PP', { locale: dateLocale }) : '-'; const expirationCell = loading ? ( <Loader className="icon-size-4.5 m-auto flex" /> ) : isValid(expirationDate) ? ( format(expirationDate as Date, 'PP', { locale: dateLocale }) ) : ( '-' ); return ( <Table responsive="cards"> <TableHeader> <TableHeaderCell>{c('Table header').t`Fingerprint`}</TableHeaderCell> <TableHeaderCell className="w-1/5">{c('Table header').t`Created`}</TableHeaderCell> <TableHeaderCell className="w-1/6">{c('Table header').t`Expires`}</TableHeaderCell> <TableHeaderCell className="w-1/6">{c('Table header').t`Type`}</TableHeaderCell> </TableHeader> <TableBody> <TableRow key={fingerprint}> <TableCell label={c('Table header').t`Fingerprint`}>{fingerprintCell}</TableCell> <TableCell label={c('Table header').t`Created`}>{creationCell}</TableCell> <TableCell label={c('Table header').t`Expires`}>{expirationCell}</TableCell> <TableCell label={c('Table header').t`Type`}>{algorithmType}</TableCell> </TableRow> </TableBody> </Table> ); }; export default SimplePublicKeyTable; ```
/content/code_sandbox/applications/mail/src/app/components/message/modals/SimplePublicKeyTable.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
697
```xml <x:Null xmlns:x="path_to_url" /> ```
/content/code_sandbox/src/Test/System.Xaml.TestCases/XmlFiles/NullExtension.xml
xml
2016-08-25T20:07:20
2024-08-13T22:23:35
CoreWF
UiPath/CoreWF
1,126
12
```xml import { Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn, } from "../../../../src" import { AnimalEntity } from "./Animal" import { Content } from "./Content" @Entity({ name: "person" }) export class PersonEntity { @PrimaryGeneratedColumn() id!: number @OneToMany(() => AnimalEntity, ({ person }) => person, { cascade: true, eager: true, }) pets!: AnimalEntity[] @OneToOne(() => Content, { cascade: true, eager: true, nullable: true, }) @JoinColumn() content?: Content } ```
/content/code_sandbox/test/github-issues/7558/entity/Person.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
139
```xml import dedent from 'dedent-js'; import { FormatFn } from '../../src/sqlFormatter.js'; export default function supportsLinesBetweenQueries(format: FormatFn) { it('defaults to single empty line between queries', () => { const result = format('SELECT * FROM foo; SELECT * FROM bar;'); expect(result).toBe(dedent` SELECT * FROM foo; SELECT * FROM bar; `); }); it('supports more empty lines between queries', () => { const result = format('SELECT * FROM foo; SELECT * FROM bar;', { linesBetweenQueries: 2 }); expect(result).toBe(dedent` SELECT * FROM foo; SELECT * FROM bar; `); }); it('supports no empty lines between queries', () => { const result = format('SELECT * FROM foo; SELECT * FROM bar;', { linesBetweenQueries: 0 }); expect(result).toBe(dedent` SELECT * FROM foo; SELECT * FROM bar; `); }); } ```
/content/code_sandbox/test/options/linesBetweenQueries.ts
xml
2016-09-12T13:09:04
2024-08-16T10:30:12
sql-formatter
sql-formatter-org/sql-formatter
2,272
248
```xml import { assertObjectType, GraphQLObjectType, isObjectType, } from "grafast/graphql"; import * as core from "./core.js"; test( "view with fake unique constraints and primary key", core.test( __filename, ["smart_comment_relations"], {}, (pgClient) => pgClient.query( ` comment on view smart_comment_relations.houses is E'@name houses @primaryKey street_id,property_id @unique street_name,property_id @unique street_id,property_name_or_number @unique street_name,building_name';`, ), (schema) => { const Query = schema.getType("Query"); if (!isObjectType(Query)) { throw new Error("Expected Query to be an object type"); } const queryFields = Query.getFields(); expect(queryFields.houseByStreetIdAndPropertyId).toBeTruthy(); expect(queryFields.houseByStreetNameAndPropertyId).toBeTruthy(); expect(queryFields.houseByStreetIdAndPropertyNameOrNumber).toBeTruthy(); expect(queryFields.houseByStreetNameAndBuildingName).toBeTruthy(); expect(queryFields.nonsense).toBeFalsy(); }, ), ); ```
/content/code_sandbox/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.test.ts
xml
2016-04-14T21:29:19
2024-08-16T17:12:51
crystal
graphile/crystal
12,539
243
```xml <?xml version="1.0" encoding="utf-8"?> <!--EXPORTED BY TOOL, DON'T MODIFY IT!--> <!--Source File: node_test\predicate_sequence_ut_3.xml--> <behavior name="node_test/predicate_sequence_ut_3" agenttype="AgentNodeTest" version="5"> <node class="Sequence" id="0"> <custom> <node class="DecoratorNot" id="1"> <property DecorateWhenChildEnds="false" /> <node class="Sequence" id="3"> <node class="Condition" id="6"> <property Operator="Equal" /> <property Opl="int Self.AgentNodeTest::testVar_1" /> <property Opr="const int -1" /> </node> <node class="Condition" id="7"> <property Operator="Equal" /> <property Opl="int Self.AgentNodeTest::testVar_0" /> <property Opr="const int -1" /> </node> </node> </node> </custom> <node class="Action" id="5"> <property Method="Self.AgentNodeTest::setTestVar_0(0)" /> <property ResultOption="BT_SUCCESS" /> </node> <node class="Action" id="4"> <property Method="Self.AgentNodeTest::setTestVar_1(0)" /> <property ResultOption="BT_SUCCESS" /> </node> <node class="Action" id="2"> <property Method="Self.AgentNodeTest::setTestVar_2(0)" /> <property ResultOption="BT_SUCCESS" /> </node> </node> </behavior> ```
/content/code_sandbox/integration/unity/Assets/Resources/behaviac/exported/node_test/predicate_sequence_ut_3.xml
xml
2016-11-21T05:08:08
2024-08-16T07:18:30
behaviac
Tencent/behaviac
2,831
371
```xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="path_to_url" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/colorPrimaryDark" android:elevation="6dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/white" android:gravity="left|center" android:layout_gravity="center" android:textSize="18sp" android:text="@string/home"/> </android.support.v7.widget.Toolbar> ```
/content/code_sandbox/app/src/main/res/layout/toolbar_home.xml
xml
2016-08-18T16:21:50
2024-07-28T12:22:42
PlaceHolderView
janishar/PlaceHolderView
2,109
142
```xml /** @jsx jsx */ import { jsx } from 'slate-hyperscript' export const input = ( <editor> <element> on <anchor />e </element> <element> t<focus /> wo </element> </editor> ) export const output = { children: [ { children: [ { text: 'one', }, ], }, { children: [ { text: 'two', }, ], }, ], selection: { anchor: { path: [0, 0], offset: 2, }, focus: { path: [1, 0], offset: 1, }, }, } ```
/content/code_sandbox/packages/slate-hyperscript/test/fixtures/cursor-across-elements-middle.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
166
```xml import queryString from 'query-string'; import Settings from './containers/Settings'; import React from 'react'; import { Route, Routes } from 'react-router-dom'; import { useLocation } from 'react-router-dom'; import asyncComponent from '@erxes/ui/src/components/AsyncComponent'; const GeneralSettings = asyncComponent(() => import(/* webpackChunkName: "KnowledgeBase" */ './components/GeneralSettings') ); const StageSettings = asyncComponent(() => import(/* webpackChunkName: "KnowledgeBase" */ './components/StageSettings') ); const ReturnStageSettings = asyncComponent(() => import( /* webpackChunkName: "KnowledgeBase" */ './components/ReturnStageSettings' ) ); const PutResponses = asyncComponent(() => import(/* webpackChunkName: "KnowledgeBase" */ './containers/PutResponses') ); const PutResponsesByDate = asyncComponent(() => import( /* webpackChunkName: "KnowledgeBase" */ './containers/PutResponsesByDate' ) ); const PutResponsesDuplicated = asyncComponent(() => import( /* webpackChunkName: "PutResponsesDuplicated" */ './containers/PutResponsesDuplicated' ) ); const GeneralSetting = () => { return <Settings component={GeneralSettings} configCode="EBARIMT" />; }; const StageSetting = () => { return <Settings component={StageSettings} configCode="stageInEbarimt" />; }; const ReturnStageSetting = () => { return ( <Settings component={ReturnStageSettings} configCode="returnStageInEbarimt" /> ); }; const PutResponsesComponent = () => { const location = useLocation(); return ( <PutResponses queryParams={queryString.parse(location.search)} /> ); }; const PutResponsesByDateComponent = () => { const location = useLocation(); return ( <PutResponsesByDate queryParams={queryString.parse(location.search)} /> ); }; const PutResponsesDuplicatedComponent = () => { const location = useLocation(); return ( <PutResponsesDuplicated queryParams={queryString.parse(location.search)} /> ); }; const routes = () => { return ( <Routes> <Route path="/erxes-plugin-ebarimt/settings/general" element={<GeneralSetting/>} /> <Route path="/erxes-plugin-ebarimt/settings/stage" element={<StageSetting/>} /> <Route path="/erxes-plugin-ebarimt/settings/return-stage" element={<ReturnStageSetting/>} /> <Route path="/put-responses" element={<PutResponsesComponent/>} /> <Route path="/put-responses-by-date" element={<PutResponsesByDateComponent/>} /> <Route path="/put-responses-duplicated" element={<PutResponsesDuplicatedComponent/>} /> </Routes> ); // response: returnResponse }; export default routes; ```
/content/code_sandbox/packages/plugin-ebarimt-ui/src/routes.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
637
```xml <vector android:alpha="0.5" android:height="24dp" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp" xmlns:android="path_to_url"> <path android:fillColor="#FF000000" android:pathData="M640,480v-80h80v80h-80ZM640,560h-80v-80h80v80ZM640,640v-80h80v80h-80ZM447,320l-80,-80L160,240v480h400v-80h80v80h160v-400L640,320v80h-80v-80L447,320ZM160,800q-33,0 -56.5,-23.5T80,720v-480q0,-33 23.5,-56.5T160,160h240l80,80h320q33,0 56.5,23.5T880,320v400q0,33 -23.5,56.5T800,800L160,800ZM160,720v-480,480Z"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_folder_zip.xml
xml
2016-08-15T19:10:31
2024-08-16T19:34:19
Aegis
beemdevelopment/Aegis
8,651
256
```xml <!-- contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <parent> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-all</artifactId> <version>4.8.0</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> <artifactId>rocketmq-remoting</artifactId> <name>rocketmq-remoting ${project.version}</name> <dependencies> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>rocketmq-logging</artifactId> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>1.1.33.Fork26</version> </dependency> </dependencies> </project> ```
/content/code_sandbox/remoting/pom.xml
xml
2016-06-15T08:56:27
2024-07-22T17:20:00
RocketMQC
ProgrammerAnthony/RocketMQC
1,072
334
```xml // *** WARNING: this file was generated by test. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** * Returns the absolute value of a given float. * Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. */ export function absReducedOutput(args: AbsReducedOutputArgs, opts?: pulumi.InvokeOptions): Promise<number> { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeSingle("std:index:AbsReducedOutput", { "a": args.a, "b": args.b, }, opts); } export interface AbsReducedOutputArgs { a: number; b?: number; } /** * Returns the absolute value of a given float. * Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. */ export function absReducedOutputOutput(args: AbsReducedOutputOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<number> { return pulumi.output(args).apply((a: any) => absReducedOutput(a, opts)) } export interface AbsReducedOutputOutputArgs { a: pulumi.Input<number>; b?: pulumi.Input<number>; } ```
/content/code_sandbox/tests/testdata/codegen/simplified-invokes/nodejs/absReducedOutput.ts
xml
2016-10-31T21:02:47
2024-08-16T19:47:04
pulumi
pulumi/pulumi
20,743
314
```xml <pkgref spec="1.12" uuid="<%= SecureRandom.uuid.upcase %>"> <config> <identifier><%= @osx_pkg_id %></identifier> <version><%= @package_json['version'] %></version> <description></description> <post-install type="none"/> <requireAuthorization/> <installFrom relative="true" mod="true">../out/dist-osx/usr/local/</installFrom> <installTo mod="true" relocatable="true">/usr/local</installTo> <flags> <followSymbolicLinks/> </flags> <packageStore type="internal"></packageStore> <mod>installTo.isRelativeType</mod> <mod>installTo</mod> <mod>locationType</mod> <mod>relocatable</mod> <mod>installFrom.path</mod> <mod>installTo.isAbsoluteType</mod> <mod>identifier</mod> <mod>parent</mod> <mod>installTo.path</mod> <mod>installFrom.isRelativeType</mod> </config> </pkgref> ```
/content/code_sandbox/current/tools/osx-pkg.pmdoc/01local.xml
xml
2016-10-10T12:09:49
2024-08-11T15:13:17
node-packer
pmq20/node-packer
3,069
250
```xml import { CdsFile as File } from '@cds/core/file'; import '@cds/core/file/register'; import { createComponent } from '@lit-labs/react'; import * as React from 'react'; import { logReactVersion } from '../utils/index.js'; export const CdsFile = createComponent(React, 'cds-file', File, {}, 'CdsFile'); logReactVersion(React); ```
/content/code_sandbox/packages/react/src/file/index.tsx
xml
2016-09-29T17:24:17
2024-08-11T17:06:15
clarity
vmware-archive/clarity
6,431
86
```xml import { Entity } from "../../../../../../src/decorator/entity/Entity" import { PrimaryGeneratedColumn } from "../../../../../../src/decorator/columns/PrimaryGeneratedColumn" import { Column } from "../../../../../../src/decorator/columns/Column" import { ManyToMany } from "../../../../../../src/decorator/relations/ManyToMany" import { JoinTable } from "../../../../../../src/decorator/relations/JoinTable" import { ManyToOne } from "../../../../../../src/decorator/relations/ManyToOne" import { OneToOne } from "../../../../../../src/decorator/relations/OneToOne" import { JoinColumn } from "../../../../../../src/decorator/relations/JoinColumn" import { Category } from "./Category" @Entity("s_post", { orderBy: { title: "ASC", id: "DESC", }, }) export class Post { @PrimaryGeneratedColumn() id: number @Column() title: string @Column() text: string @ManyToMany((type) => Category) @JoinTable() categories: Promise<Category[]> @ManyToMany((type) => Category, (category) => category.twoSidePosts) @JoinTable() twoSideCategories: Promise<Category[]> @Column() viewCount: number = 0 @ManyToOne((type) => Category) category: Promise<Category> @OneToOne((type) => Category, (category) => category.onePost) @JoinColumn() oneCategory: Promise<Category> @ManyToOne((type) => Category, (category) => category.twoSidePosts2) twoSideCategory: Promise<Category> // ManyToMany with named properties @ManyToMany((type) => Category, (category) => category.postsNamedTable) @JoinTable() categoriesNamedTable: Promise<Category[]> // ManyToOne with named properties @ManyToOne((type) => Category, (category) => category.onePostsNamedTable) @JoinColumn() categoryNamedTable: Promise<Category> // OneToOne with named properties @OneToOne((type) => Category, (category) => category.onePostNamedTable) @JoinColumn() oneCategoryNamedTable: Promise<Category> } ```
/content/code_sandbox/test/functional/relations/lazy-relations/named-tables/entity/Post.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
467
```xml import * as Areas from './areas'; export { Areas }; ```
/content/code_sandbox/npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/index.ts
xml
2016-12-03T22:56:24
2024-08-16T16:24:05
abp
abpframework/abp
12,657
13
```xml import styled from '@emotion/styled'; import BugReportIcon from '@mui/icons-material/BugReport'; import DownloadIcon from '@mui/icons-material/CloudDownload'; import HomeIcon from '@mui/icons-material/Home'; import RawOnIcon from '@mui/icons-material/RawOn'; import CircularProgress from '@mui/material/CircularProgress'; import FabMUI from '@mui/material/Fab'; import Tooltip from '@mui/material/Tooltip'; import React, { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; import { Theme } from '../../Theme'; import { Dispatch, RootState } from '../../store/store'; import LinkExternal from '../LinkExternal'; export const Fab = styled(FabMUI)<{ theme?: Theme }>(({ theme }) => ({ backgroundColor: theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue, '&:hover': { color: theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue, }, color: theme?.palette.white, })); type ActionType = 'VISIT_HOMEPAGE' | 'OPEN_AN_ISSUE' | 'DOWNLOAD_TARBALL' | 'RAW_DATA'; export interface ActionBarActionProps { type: ActionType; link?: string; action?: () => void; } /* eslint-disable react/jsx-no-bind */ const ActionBarAction: React.FC<ActionBarActionProps> = ({ type, link, action }) => { const { t } = useTranslation(); const dispatch = useDispatch<Dispatch>(); const isLoading = useSelector((state: RootState) => state?.loading?.models.download); const handleDownload = useCallback(async () => { dispatch.download.getTarball({ link }); }, [dispatch, link]); switch (type) { case 'VISIT_HOMEPAGE': return ( <Tooltip title={t('action-bar-action.visit-home-page') as string}> <LinkExternal to={link} variant="button"> <Fab size="small"> <HomeIcon /> </Fab> </LinkExternal> </Tooltip> ); case 'OPEN_AN_ISSUE': return ( <Tooltip title={t('action-bar-action.open-an-issue') as string}> <LinkExternal to={link} variant="button"> <Fab size="small"> <BugReportIcon /> </Fab> </LinkExternal> </Tooltip> ); case 'DOWNLOAD_TARBALL': return ( <Tooltip title={t('action-bar-action.download-tarball') as string}> {isLoading ? ( <CircularProgress sx={{ marginX: 0 }}> <Fab data-testid="download-tarball-btn" onClick={handleDownload} size="small"> <DownloadIcon /> </Fab> </CircularProgress> ) : ( <Fab data-testid="download-tarball-btn" onClick={handleDownload} size="small"> <DownloadIcon /> </Fab> )} </Tooltip> ); case 'RAW_DATA': return ( <Tooltip title={t('action-bar-action.raw') as string}> <Fab data-testid="raw-btn" onClick={action} size="small"> <RawOnIcon /> </Fab> </Tooltip> ); } }; export default ActionBarAction; ```
/content/code_sandbox/packages/ui-components/src/components/ActionBar/ActionBarAction.tsx
xml
2016-04-15T16:21:12
2024-08-16T09:38:01
verdaccio
verdaccio/verdaccio
16,189
711
```xml import { CommandLinker } from '@jupyterlab/apputils'; import { CommandRegistry } from '@lumino/commands'; import { h, VirtualDOM, VirtualNode } from '@lumino/virtualdom'; import { simulate } from 'simulate-event'; describe('@jupyterlab/apputils', () => { describe('CommandLinker', () => { describe('#constructor()', () => { it('should create a command linker', () => { const linker = new CommandLinker({ commands: new CommandRegistry() }); expect(linker).toBeInstanceOf(CommandLinker); linker.dispose(); }); }); describe('#isDisposed', () => { it('should test whether a command linker has been disposed', () => { const linker = new CommandLinker({ commands: new CommandRegistry() }); expect(linker.isDisposed).toBe(false); linker.dispose(); expect(linker.isDisposed).toBe(true); }); }); describe('#connectNode()', () => { it('should connect a node to a command', () => { let called = false; const command = 'commandlinker:connect-node'; const commands = new CommandRegistry(); const linker = new CommandLinker({ commands }); const node = document.createElement('div'); const disposable = commands.addCommand(command, { execute: () => { called = true; } }); document.body.appendChild(node); linker.connectNode(node, command, undefined); expect(called).toBe(false); simulate(node, 'click'); expect(called).toBe(true); document.body.removeChild(node); linker.dispose(); disposable.dispose(); }); }); describe('#disconnectNode()', () => { it('should disconnect a node from a command', () => { let called = false; const command = 'commandlinker:disconnect-node'; const commands = new CommandRegistry(); const linker = new CommandLinker({ commands }); const node = document.createElement('div'); const disposable = commands.addCommand(command, { execute: () => { called = true; } }); document.body.appendChild(node); linker.connectNode(node, command, undefined); // Make sure connection is working. expect(called).toBe(false); simulate(node, 'click'); expect(called).toBe(true); // Reset flag. called = false; // Make sure disconnection is working. linker.disconnectNode(node); expect(called).toBe(false); simulate(node, 'click'); expect(called).toBe(false); document.body.removeChild(node); linker.dispose(); disposable.dispose(); }); }); describe('#dispose()', () => { it('should dispose the resources held by the linker', () => { const linker = new CommandLinker({ commands: new CommandRegistry() }); expect(linker.isDisposed).toBe(false); linker.dispose(); expect(linker.isDisposed).toBe(true); }); }); describe('#populateVNodeDataset()', () => { it('should connect a node to a command', () => { let called = false; const command = 'commandlinker:connect-node'; const commands = new CommandRegistry(); const linker = new CommandLinker({ commands }); let node: HTMLElement; let vnode: VirtualNode; const disposable = commands.addCommand(command, { execute: () => { called = true; } }); vnode = h.div({ dataset: linker.populateVNodeDataset(command, undefined) }); node = VirtualDOM.realize(vnode); document.body.appendChild(node); expect(called).toBe(false); simulate(node, 'click'); expect(called).toBe(true); document.body.removeChild(node); linker.dispose(); disposable.dispose(); }); }); }); }); ```
/content/code_sandbox/packages/apputils/test/commandlinker.spec.ts
xml
2016-06-03T20:09:17
2024-08-16T19:12:44
jupyterlab
jupyterlab/jupyterlab
14,019
807
```xml import * as React from 'react'; import { FolderRegular, EditRegular, OpenRegular, DocumentRegular, PeopleRegular, DocumentPdfRegular, VideoRegular, } from '@fluentui/react-icons'; import { PresenceBadgeStatus, Avatar, Checkbox, DataGridBody, DataGridRow, DataGrid, DataGridHeader, DataGridHeaderCell, DataGridCell, TableCellLayout, TableColumnDefinition, TableRowData, createTableColumn, TableRowId, DataGridProps, } from '@fluentui/react-components'; type FileCell = { label: string; icon: JSX.Element; }; type LastUpdatedCell = { label: string; timestamp: number; }; type LastUpdateCell = { label: string; icon: JSX.Element; }; type AuthorCell = { label: string; status: PresenceBadgeStatus; }; type Item = { file: FileCell; author: AuthorCell; lastUpdated: LastUpdatedCell; lastUpdate: LastUpdateCell; }; const items: Item[] = [ { file: { label: 'Meeting notes', icon: <DocumentRegular /> }, author: { label: 'Max Mustermann', status: 'available' }, lastUpdated: { label: '7h ago', timestamp: 1 }, lastUpdate: { label: 'You edited this', icon: <EditRegular />, }, }, { file: { label: 'Thursday presentation', icon: <FolderRegular /> }, author: { label: 'Erika Mustermann', status: 'busy' }, lastUpdated: { label: 'Yesterday at 1:45 PM', timestamp: 2 }, lastUpdate: { label: 'You recently opened this', icon: <OpenRegular />, }, }, { file: { label: 'Training recording', icon: <VideoRegular /> }, author: { label: 'John Doe', status: 'away' }, lastUpdated: { label: 'Yesterday at 1:45 PM', timestamp: 2 }, lastUpdate: { label: 'You recently opened this', icon: <OpenRegular />, }, }, { file: { label: 'Purchase order', icon: <DocumentPdfRegular /> }, author: { label: 'Jane Doe', status: 'offline' }, lastUpdated: { label: 'Tue at 9:30 AM', timestamp: 3 }, lastUpdate: { label: 'You shared this in a Teams chat', icon: <PeopleRegular />, }, }, ]; const columns: TableColumnDefinition<Item>[] = [ createTableColumn<Item>({ columnId: 'file', compare: (a, b) => { return a.file.label.localeCompare(b.file.label); }, renderHeaderCell: () => { return 'File'; }, renderCell: item => { return <TableCellLayout media={item.file.icon}>{item.file.label}</TableCellLayout>; }, }), createTableColumn<Item>({ columnId: 'author', compare: (a, b) => { return a.author.label.localeCompare(b.author.label); }, renderHeaderCell: () => { return 'Author'; }, renderCell: item => { return ( <TableCellLayout media={ <Avatar aria-label={item.author.label} name={item.author.label} badge={{ status: item.author.status }} /> } > {item.author.label} </TableCellLayout> ); }, }), createTableColumn<Item>({ columnId: 'lastUpdated', compare: (a, b) => { return a.lastUpdated.timestamp - b.lastUpdated.timestamp; }, renderHeaderCell: () => { return 'Last updated'; }, renderCell: item => { return item.lastUpdated.label; }, }), createTableColumn<Item>({ columnId: 'lastUpdate', compare: (a, b) => { return a.lastUpdate.label.localeCompare(b.lastUpdate.label); }, renderHeaderCell: () => { return 'Last update'; }, renderCell: item => { return <TableCellLayout media={item.lastUpdate.icon}>{item.lastUpdate.label}</TableCellLayout>; }, }), ]; export const CustomRowId = () => { const [selectedRows, setSelectedRows] = React.useState(new Set<TableRowId>(['Thursday presentation'])); const onSelectionChange: DataGridProps['onSelectionChange'] = (e, data) => { setSelectedRows(data.selectedItems); }; return ( <> <ul> {items.map(item => ( <li key={item.file.label}> <Checkbox label={item.file.label} checked={selectedRows.has(item.file.label)} /> </li> ))} </ul> <DataGrid items={items} columns={columns} selectionMode="multiselect" selectedItems={selectedRows} onSelectionChange={onSelectionChange} getRowId={item => item.file.label} style={{ minWidth: '550px' }} > <DataGridHeader> <DataGridRow selectionCell={{ checkboxIndicator: { 'aria-label': 'Select all rows' } }}> {({ renderHeaderCell }: TableColumnDefinition<Item>) => ( <DataGridHeaderCell>{renderHeaderCell()}</DataGridHeaderCell> )} </DataGridRow> </DataGridHeader> <DataGridBody> {({ item, rowId }: TableRowData<Item>) => ( <DataGridRow key={rowId} selectionCell={{ checkboxIndicator: { 'aria-label': 'Select row' } }}> {({ renderCell }: TableColumnDefinition<Item>) => <DataGridCell>{renderCell(item)}</DataGridCell>} </DataGridRow> )} </DataGridBody> </DataGrid> </> ); }; CustomRowId.parameters = { docs: { description: { story: [ 'By default row Ids are the index of the item in the collection. In order to use a row Id based on the data', 'use the `getRowId` prop.', ].join('\n'), }, }, }; ```
/content/code_sandbox/packages/react-components/react-table/stories/src/DataGrid/CustomRowId.stories.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
1,339
```xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="path_to_url" xmlns:app="path_to_url"> <item android:id="@+id/action_search" android:icon="@drawable/ic_search" android:title="@string/search" app:showAsAction="always" /> <item android:id="@+id/action_delete_playlist" android:icon="@drawable/ic_delete" android:title="@string/menu_delete_playlist" app:showAsAction="ifRoom" /> <item android:id="@+id/action_rename_playlist" android:icon="@drawable/ic_mode_edit" android:title="@string/menu_rename" app:showAsAction="ifRoom" /> <item android:id="@+id/action_batch" android:title="@string/title_batch_operate" app:showAsAction="never" /> <item android:id="@+id/action_order" android:title="@string/title_order" app:showAsAction="never"> <menu> <item android:id="@+id/action_order_title" android:title="@string/title_order_title" app:showAsAction="never" /> <item android:id="@+id/action_order_artist" android:title="@string/title_order_artist" app:showAsAction="never" /> <item android:id="@+id/action_order_album" android:title="@string/title_order_album" app:showAsAction="never" /> </menu> </item> </menu> ```
/content/code_sandbox/app/src/main/res/menu/menu_playlist_detail.xml
xml
2016-04-09T15:47:45
2024-08-14T04:30:04
MusicLake
caiyonglong/MusicLake
2,654
336
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "path_to_url" [ <!ENTITY legal SYSTEM "legal.xml"> ]> <!--<?yelp:chunk-depth 4?> --> <!-- (Do not remove this comment block.) Version: 3.0 Last modified: Sep 8, 2010 Maintainers: Michael Vogt <mvo@ubuntu.com> Translators: (translators put your name and email here) --> <!-- =============Document Header ============================= --> <book id="index" lang=""> <!-- ============= Document Body ============================= --> <!-- ============= Introduction ============================== --> <bookinfo> <!-- please do not change the id; for translations, change lang to --> <!-- appropriate code --> <title>Ubuntu </title> <!-- translators: uncomment this: <copyright> <year>2000</year> <holder>ME-THE-TRANSLATOR (Latin translation)</holder> </copyright> --> <!-- An address can be added to the publisher information. If a role is not specified, the publisher/author is the same for all versions of the document. --> <!-- This file contains link to license for the documentation (GNU FDL), and other legal stuff such as "NO WARRANTY" statement. Please do not change any of this. --> <publisher> <publishername>Ubuntu Documentation Project</publishername> </publisher> &legal; <authorgroup> <author> <firstname>Michael</firstname> <surname>Vogt</surname> <email>mvo@ubuntu.com</email> </author> <author> <firstname>Matthew</firstname> <firstname>Paul</firstname> <surname>Thomas</surname> <email>mpt@ubuntu.com</email> </author> <author> <firstname>Andrew</firstname> <surname>Higginson</surname> <email>rugby471@gmail.com</email> </author> </authorgroup> <abstract> <para> Ubuntu </para> </abstract> </bookinfo> <chapter id="introduction"> <title> Ubuntu </title> <para> Ubuntu </para> <para> </para> <para> </para> </chapter> <chapter id="installing"> <title></title> <para> Ubuntu ( Ubuntu ) </para> <orderedlist> <listitem> <para> <guilabel></guilabel> ( &#8220;&#8221;) </para> </listitem> <listitem> <para> <guilabel></guilabel> </para> </listitem> <listitem> <para> <guilabel></guilabel> Ubuntu </para> </listitem> </orderedlist> <para> </para> <para> </para> <itemizedlist> <listitem><para><xref linkend="launching" endterm="launching-title"/></para></listitem> <listitem><para><xref linkend="missing" endterm="missing-title"/></para></listitem> </itemizedlist> </chapter> <chapter id="launching"> <title id="launching-title" ></title> <para> For most programs, once they are installed, you can launch them from the <guimenu>Applications</guimenu> menu. (Utilities for changing settings may appear inside <menuchoice><guimenu>System</guimenu> <guisubmenu>Preferences</guisubmenu></menuchoice> or <menuchoice><guimenu>System</guimenu> <guisubmenu>Administration</guisubmenu></menuchoice> instead). </para> <para> To find out where to launch a new program, navigate to the screen for that program in Ubuntu Software Center, if it is not still being displayed. The menu location should be displayed on that screen, below the colored bar. </para> <para> If you are using Ubuntu Netbook Edition, an application appears in the appropriate category on the home screen. </para> <para> Ubuntu </para> </chapter> <chapter id="removing"> <title id="removing-title"></title> <para> ( Ubuntu ) </para> <orderedlist> <listitem> <para> <guilabel></guilabel> </para> </listitem> <listitem> <para> <guilabel></guilabel> Ubuntu </para> </listitem> </orderedlist> <para> </para> <itemizedlist> <listitem><para><xref linkend="metapackages" endterm="metapackages-title"/></para></listitem> </itemizedlist> </chapter> <chapter id="metapackages"> <title id="metapackages-title" ></title> <para> Sometimes if you try to remove one item, Ubuntu Software Center will warn you that other items will be removed too. There are two main reasons this happens. </para> <itemizedlist> <listitem> <para> If you remove an application, any add-ons or plugins for that application usually will be removed too. </para> </listitem> <listitem> <para> Ubuntu </para> </listitem> </itemizedlist> <para> <guilabel></guilabel> Ubuntu <menuchoice><guimenu></guimenu> <guisubmenu></guisubmenu></menuchoice> <guilabel></guilabel> Ubuntu <menuchoice><guimenu></guimenu> <guisubmenu></guisubmenu></menuchoice> </para> <itemizedlist> <listitem> <para><ulink url="ghelp:user-guide?menu-editor" ></ulink></para> </listitem> </itemizedlist> </chapter> <chapter id="canonical-maintained"> <title>Canonical </title> <para> Some of the software available for Ubuntu is maintained by Canonical. Canonical engineers ensure that security fixes and other critical updates are provided for these programs. </para> <para> Ubuntu </para> </chapter> <chapter id="canonical-partners"> <title>Canonical </title> <para> <guilabel>Canonical </guilabel> Canonical Canonical Ubuntu </para> <para> Ubuntu </para> </chapter> <chapter id="commercial"> <title id="commercial-title"></title> <para> Ubuntu </para> <para> <guilabel></guilabel><guilabel></guilabel> </para> <para> Ubuntu SSO Launchpad Ubuntu </para> </chapter> <chapter id="commercial-reinstalling"> <title id="commercial-reinstalling-title"> What if I paid for software and then lost it? </title> <para> If you accidentally removed software that you purchased, and you want it back, choose <menuchoice><guimenu>File</guimenu> <guimenuitem>Reinstall Previous Purchases</guimenuitem></menuchoice>. </para> <para> Once you sign in to the account that you used to buy the software, Ubuntu Software Center will display your purchases for reinstalling. </para> <para> This works even if you have reinstalled Ubuntu on the computer. </para> </chapter> <chapter id="missing"> <title id="missing-title" >Ubuntu </title> <para> <menuchoice><guimenu></guimenu> <guimenuitem></guimenuitem></menuchoice> </para> <para> Ubuntu Ubuntu </para> <para> ubuntu Ubuntu </para> </chapter> <chapter id="bugs"> <title id="bugs-title" ></title> <para> Ubuntu </para> <para> Ubuntu <guimenu></guimenu> <guimenuitem></guimenuitem> </para> <para> Otherwise, look through Ubuntu Software Center for another program to do what you want. </para> <itemizedlist> <listitem><para><xref linkend="removing" endterm="removing-title"/></para></listitem> </itemizedlist> </chapter> </book> ```
/content/code_sandbox/help/zh_CN/software-center.xml
xml
2016-08-08T17:54:58
2024-08-06T13:58:47
x-mario-center
fossasia/x-mario-center
1,487
2,004
```xml import {CachedFunction} from 'webext-storage-cache'; import React from 'dom-chef'; import {$, expectElement} from 'select-dom'; import PlayIcon from 'octicons-plain-react/Play'; import {parseCron} from '@cheap-glitch/mi-cron'; import * as pageDetect from 'github-url-detection'; import features from '../feature-manager.js'; import api from '../github-helpers/api.js'; import {cacheByRepo} from '../github-helpers/index.js'; import observe from '../helpers/selector-observer.js'; import GetWorkflows from './github-actions-indicators.gql'; type Workflow = { name: string; isEnabled: boolean; }; type WorkflowDetails = { schedule?: string; manuallyDispatchable: boolean; }; function addTooltip(element: HTMLElement, tooltip: string): void { const existingTooltip = element.getAttribute('aria-label'); if (existingTooltip) { element.setAttribute('aria-label', existingTooltip + '.\n' + tooltip); } else { element.classList.add('tooltipped', 'tooltipped-s'); element.setAttribute('aria-label', tooltip); } } // There is no way to get a workflow list in the v4 API #6543 async function getWorkflows(): Promise<Workflow[]> { const response = await api.v3('actions/workflows'); const workflows = response.workflows as any[]; // The response is not reliable: Some workflow's path is '' and deleted workflow's state is 'active' return workflows .map<Workflow>(workflow => ({ name: workflow.path.split('/').pop()!, isEnabled: workflow.state === 'active', })); } async function getFilesInWorkflowPath(): Promise<Record<string, string>> { const {repository: {workflowFiles}} = await api.v4(GetWorkflows); const workflows: any[] = workflowFiles?.entries ?? []; const result: Record<string, string> = {}; for (const workflow of workflows) { result[workflow.name] = workflow.object.text; } return result; } const workflowDetails = new CachedFunction('workflows-details', { async updater(): Promise<Record<string, Workflow & WorkflowDetails>> { const [workflows, workflowFiles] = await Promise.all([getWorkflows(), getFilesInWorkflowPath()]); const details: Record<string, Workflow & WorkflowDetails> = {}; for (const workflow of workflows) { const workflowYaml = workflowFiles[workflow.name]; if (workflowYaml === undefined) { // Cannot find workflow yaml; workflow removed. continue; } // Single-line regex, allows comments around const cron = /^(?: {4}|\t\t)-\s*cron[:\s'"]+([^'"\n]+)/m.exec(workflowYaml); details[workflow.name] = { ...workflow, schedule: cron?.[1], manuallyDispatchable: workflowYaml.includes('workflow_dispatch:'), }; } return details; }, maxAge: {days: 1}, staleWhileRevalidate: {days: 10}, cacheKey: cacheByRepo, }); async function addIndicators(workflowListItem: HTMLAnchorElement): Promise<void> { // Called in `init`, memoized const workflows = await workflowDetails.get(); const workflowName = workflowListItem.href.split('/').pop()!; const workflow = workflows[workflowName]; if (!workflow) { return; } const svgTrailer = $('.ActionListItem-visual--trailing', workflowListItem) ?? <div className="ActionListItem-visual--trailing"/>; if (!svgTrailer.isConnected) { workflowListItem.append(svgTrailer); } svgTrailer.classList.add('m-auto', 'd-flex', 'gap-2'); if (workflow.manuallyDispatchable) { svgTrailer.append(<PlayIcon className="m-auto"/>); addTooltip(workflowListItem, 'This workflow can be triggered manually'); } if (!workflow.schedule) { return; } const nextTime = parseCron.nextDate(workflow.schedule); if (!nextTime) { return; } const relativeTime = <relative-time datetime={String(nextTime)}/>; expectElement('.ActionListItem-label', workflowListItem).append( <em> ({relativeTime}) </em>, ); setTimeout(() => { // The content of `relative-time` might is not immediately available addTooltip(workflowListItem, `Next run: ${relativeTime.shadowRoot!.textContent}`); }, 500); } async function init(signal: AbortSignal): Promise<false | void> { observe('a.ActionListContent', addIndicators, {signal}); } void features.add(import.meta.url, { asLongAs: [ pageDetect.isRepositoryActions, async () => Boolean(await workflowDetails.get()), ], init, }); /* ## Test URLs Manual + scheduled: path_to_url Manual + disabled + pinned: path_to_url */ ```
/content/code_sandbox/source/features/github-actions-indicators.tsx
xml
2016-02-15T16:45:02
2024-08-16T18:39:26
refined-github
refined-github/refined-github
24,013
1,061
```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 { Iterator } from '@stdlib/types/iter'; /** * Returns an iterator which iteratively computes a moving arithmetic mean. * * ## Notes * * - The `W` parameter defines the number of iterated values over which to compute the moving mean. * - As `W` values are needed to fill the window buffer, the first `W-1` returned values are calculated from smaller sample sizes. Until the window is full, each returned value is calculated from all previously iterated values. * - If an environment supports `Symbol.iterator`, the returned iterator is iterable. * * @param iterator - input iterator * @param W - window size * @throws second argument must be a positive integer * @returns iterator * * @example * var runif = require( '@stdlib/random/iter/uniform' ); * * var rand = runif( -10.0, 10.0, { * 'iter': 100 * }); * * var it = itermmean( rand, 3 ); * * var v = it.next().value; * // returns <number> * * v = it.next().value; * // returns <number> * * v = it.next().value; * // returns <number> * * // ... */ declare function itermmean( iterator: Iterator, W: number ): Iterator; // EXPORTS // export = itermmean; ```
/content/code_sandbox/lib/node_modules/@stdlib/stats/iter/mmean/docs/types/index.d.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
362