text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```xml
import { After, Before } from 'cucumber';
import sinon from 'sinon';
import { environment } from '../source/main/environment';
global.environment = environment;
// Add context object to share data between steps
Before(function () {
this.context = {};
});
After(() => {
sinon.restore();
});
``` | /content/code_sandbox/tests/setup-common.ts | xml | 2016-10-05T13:48:54 | 2024-08-13T22:03:19 | daedalus | input-output-hk/daedalus | 1,230 | 63 |
```xml
<resources>
<string name="app_name">ViewPager</string>
</resources>
``` | /content/code_sandbox/ViewPager/app/src/main/res/values/strings.xml | xml | 2016-02-25T11:06:48 | 2024-08-07T21:41:59 | android-examples | nisrulz/android-examples | 1,747 | 19 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../Resources.resx">
<body>
<trans-unit id="BreakingChangesFoundRegenerateSuppressionFileCommandHelp">
<source>API breaking changes found. If those are intentional, the APICompat suppression file can be updated by rebuilding with '/p:ApiCompatGenerateSuppressionFile=true'</source>
<target state="translated"> API /p:ApiCompatGenerateSuppressionFile=true APICompat </target>
<note />
</trans-unit>
<trans-unit id=your_sha256_hash>
<source>Unnecessary suppressions found. The APICompat suppression file can be updated by rebuilding with '/p:ApiCompatGenerateSuppressionFile=true'</source>
<target state="translated">/p:ApiCompatGenerateSuppressionFile=true APICompat </target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.Task/xlf/Resources.zh-Hans.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 287 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>Author</key>
<string>usr-sse2</string>
<key>CodecID</key>
<integer>20590</integer>
<key>CodecName</key>
<string>CX20590</string>
<key>Files</key>
<dict>
<key>Layouts</key>
<array>
<dict>
<key>Comment</key>
<string>Mirone Laptop Patch</string>
<key>Id</key>
<integer>3</integer>
<key>Path</key>
<string>layout3.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Lenovo Yoga 13 by usr-sse2</string>
<key>Id</key>
<integer>12</integer>
<key>Path</key>
<string>layout12.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Lenovo T420 with dock by tluck (Additional ports for use with a Docking Station)</string>
<key>Id</key>
<integer>13</integer>
<key>Path</key>
<string>layout13.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Lenovo T420 by tluck (Standard Laptop)</string>
<key>Id</key>
<integer>14</integer>
<key>Path</key>
<string>layout14.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Dell Vostro 3x60 by vusun123</string>
<key>Id</key>
<integer>28</integer>
<key>Path</key>
<string>layout28.xml.zlib</string>
</dict>
</array>
<key>Platforms</key>
<array>
<dict>
<key>Comment</key>
<string>Mirone Laptop Patch</string>
<key>Id</key>
<integer>3</integer>
<key>Path</key>
<string>PlatformsM.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Lenovo Yoga 13 by usr-sse2</string>
<key>Id</key>
<integer>12</integer>
<key>Path</key>
<string>Platforms12.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Lenovo T420 with dock by tluck (Additional ports for use with a Docking Station)</string>
<key>Id</key>
<integer>13</integer>
<key>Path</key>
<string>Platforms13.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Lenovo T420 by tluck (Standard Laptop)</string>
<key>Id</key>
<integer>14</integer>
<key>Path</key>
<string>Platforms14.xml.zlib</string>
</dict>
<dict>
<key>Comment</key>
<string>Custom for Dell Vostro 3x60 by vusun123</string>
<key>Id</key>
<integer>28</integer>
<key>Path</key>
<string>Platforms28.xml.zlib</string>
</dict>
</array>
</dict>
<key>Patches</key>
<array>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>xgYASIu/aAE=</data>
<key>MinKernel</key>
<integer>18</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>xgYBSIu/aAE=</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>QcYGAEmLvCQ=</data>
<key>MaxKernel</key>
<integer>13</integer>
<key>MinKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>QcYGAUmLvCQ=</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>QcYGAEiLu2g=</data>
<key>MinKernel</key>
<integer>14</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>QcYGAUiLu2g=</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>QcaGQwEAAAA=</data>
<key>MinKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>QcaGQwEAAAE=</data>
</dict>
<dict>
<key>Count</key>
<integer>2</integer>
<key>Find</key>
<data>gxnUEQ==</data>
<key>MinKernel</key>
<integer>15</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>AAAAAA==</data>
</dict>
<dict>
<key>Count</key>
<integer>2</integer>
<key>Find</key>
<data>hBnUEQ==</data>
<key>MinKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>blDxFA==</data>
</dict>
<dict>
<key>Count</key>
<integer>2</integer>
<key>Find</key>
<data>ixnUEQ==</data>
<key>MinKernel</key>
<integer>16</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>blDxFA==</data>
</dict>
<dict>
<key>Count</key>
<integer>2</integer>
<key>Find</key>
<data>ihnUEQ==</data>
<key>MinKernel</key>
<integer>16</integer>
<key>Name</key>
<string>AppleHDA</string>
<key>Replace</key>
<data>AAAAAA==</data>
</dict>
<dict>
<key>Count</key>
<integer>1</integer>
<key>Find</key>
<data>a3Bzaes=</data>
<key>MinKernel</key>
<string>14</string>
<key>Name</key>
<string>AppleHDA</string>
<key>Provider</key>
<string>Wern Apfel</string>
<key>Replace</key>
<data>Y2ltaes=</data>
</dict>
</array>
<key>Revisions</key>
<array>
<integer>1048576</integer>
<integer>1048578</integer>
<integer>1048579</integer>
</array>
<key>Vendor</key>
<string>Conexant</string>
</dict>
</plist>
``` | /content/code_sandbox/Resources/CX20590/Info.plist | xml | 2016-03-07T20:45:58 | 2024-08-14T08:57:03 | AppleALC | acidanthera/AppleALC | 3,420 | 2,042 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../CommonLocalizableStrings.resx">
<body>
<trans-unit id="ArchArgumentName">
<source>ARCH</source>
<target state="translated">ARCH</target>
<note />
</trans-unit>
<trans-unit id="ArchitectureOptionDescription">
<source>The target architecture.</source>
<target state="translated">Die Zielarchitektur.</target>
<note />
</trans-unit>
<trans-unit id="ArtifactsPathArgumentName">
<source>ARTIFACTS_DIR</source>
<target state="translated">ARTIFACTS_DIR</target>
<note />
</trans-unit>
<trans-unit id="ArtifactsPathOptionDescription">
<source>The artifacts path. All output from the project, including build, publish, and pack output, will go in subfolders under the specified path.</source>
<target state="translated">Der Artefaktpfad. Die gesamte Ausgabe des Projekts, einschlielich Build-, Verffentlichungs- und Paketausgabe, wird in Unterordnern unter dem angegebenen Pfad angezeigt.</target>
<note />
</trans-unit>
<trans-unit id="CannotResolveRuntimeIdentifier">
<source>Resolving the current runtime identifier failed.</source>
<target state="translated">Fehler beim Auflsen des aktuellen Runtimebezeichners.</target>
<note />
</trans-unit>
<trans-unit id="CannotSpecifyBothRuntimeAndArchOptions">
<source>Specifying both the `-r|--runtime` and `-a|--arch` options is not supported.</source>
<target state="translated">Das gleichzeitige Angeben der Optionen -r|--runtime und -a|--arch wird nicht untersttzt.</target>
<note />
</trans-unit>
<trans-unit id="CannotSpecifyBothRuntimeAndOsOptions">
<source>Specifying both the `-r|--runtime` and `-os` options is not supported.</source>
<target state="translated">Das gleichzeitige Angeben der Optionen -r|--runtime und -os wird nicht untersttzt.</target>
<note />
</trans-unit>
<trans-unit id="CommandInteractiveOptionDescription">
<source>Allows the command to stop and wait for user input or action (for example to complete authentication).</source>
<target state="translated">Hiermit wird zugelassen, dass der Befehl anhlt und auf eine Benutzereingabe oder Aktion wartet (beispielsweise auf den Abschluss der Authentifizierung).</target>
<note />
</trans-unit>
<trans-unit id="CommandPrereleaseOptionDescription">
<source>Allows prerelease packages to be installed.</source>
<target state="translated">Ermglicht die Installation von Paketen mit Vorabversionen.</target>
<note />
</trans-unit>
<trans-unit id="CorruptSolutionProjectFolderStructure">
<source>The solution file '{0}' is missing EndProject tags or has invalid child-parent project folder mappings around project GUID: '{1}'. Manually repair the solution or try to open and save it in Visual Studio."</source>
<target state="translated">In der Projektmappendatei {0} fehlen EndProject-Tags, oder es sind ungltige Zuordnungen des untergeordneten bergeordneten Projektordners um die Projekt-GUID vorhanden: {1}. Reparieren Sie die Projektmappe manuell, oder versuchen Sie, sie zu ffnen und in Visual Studio zu speichern.</target>
<note />
</trans-unit>
<trans-unit id="CouldNotFindAnyProjectInDirectory">
<source>Could not find any project in `{0}`.</source>
<target state="translated">In "{0}" wurde kein Projekt gefunden.</target>
<note />
</trans-unit>
<trans-unit id="DidYouMean">
<source>Did you mean the following command?</source>
<target state="translated">Meinten Sie den folgenden Befehl?</target>
<note />
</trans-unit>
<trans-unit id="DisableBuildServersOptionDescription">
<source>Force the command to ignore any persistent build servers.</source>
<target state="translated">Erzwingen Sie, dass der Befehl alle persistenten Buildserver ignoriert.</target>
<note />
</trans-unit>
<trans-unit id="EnvironmentPathOSXBashManualInstructions">
<source>Tools directory '{0}' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:
cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:{0}"
EOF
You can add it to the current session by running the following command:
export PATH="$PATH:{0}"
</source>
<target state="translated">Das Toolverzeichnis "{0}" befindet sich derzeit nicht in der PATH-Umgebungsvariablen.
Wenn Sie Bash verwenden, knnen Sie es Ihrem Profil durch Ausfhren des folgenden Befehls hinzufgen:
cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:{0}"
EOF
Sie knnen es der aktuellen Sitzung hinzufgen, indem Sie den folgenden Befehl ausfhren:
export PATH="$PATH:{0}"
</target>
<note />
</trans-unit>
<trans-unit id="EnvironmentPathOSXZshManualInstructions">
<source>Tools directory '{0}' is not currently on the PATH environment variable.
If you are using zsh, you can add it to your profile by running the following command:
cat << \EOF >> ~/.zprofile
# Add .NET Core SDK tools
export PATH="$PATH:{0}"
EOF
And run `zsh -l` to make it available for current session.
You can only add it to the current session by running the following command:
export PATH="$PATH:{0}"
</source>
<target state="translated">Das Toolverzeichnis "{0}" ist aktuell nicht in der PATH-Umgebungsvariable enthalten.
Wenn Sie zsh verwenden, knnen Sie es Ihrem Profil hinzufgen, indem Sie folgenden Befehl ausfhren:
cat << \EOF >> ~/.zprofile
# Add .NET Core SDK tools
export PATH="$PATH:{0}"
EOF
Fhren Sie anschlieend "zsh -l" aus, um das Tool fr die aktuelle Sitzung verfgbar zu machen.
Um es nur der aktuellen Sitzung hinzuzufgen, fhren Sie den folgenden Befehl aus:
export PATH="$PATH:{0}"
</target>
<note />
</trans-unit>
<trans-unit id="FrameworkDependentOptionDescription">
<source>Publish your application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run your application.</source>
<target state="translated">Verffentlichen Sie Ihre Anwendung als eine von einem Framework abhngige Anwendung. Eine kompatible .NET-Runtime muss auf dem Zielcomputer installiert sein, um Ihre Anwendung ausfhren zu knnen.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildAdditionalOptionTitle">
<source>.NET Cli Options:</source>
<target state="translated">.NET-Cli-Optionen:</target>
<note />
</trans-unit>
<trans-unit id="MoreThanOneProjectInDirectory">
<source>Found more than one project in `{0}`. Specify which one to use.</source>
<target state="translated">In "{0}" wurden mehrere Projekte gefunden. Geben Sie an, welches davon verwendet werden soll.</target>
<note />
</trans-unit>
<trans-unit id="OSArgumentName">
<source>OS</source>
<target state="translated">Betriebssystem</target>
<note />
</trans-unit>
<trans-unit id="OperatingSystemOptionDescription">
<source>The target operating system.</source>
<target state="translated">Das Zielbetriebssystem.</target>
<note />
</trans-unit>
<trans-unit id="ProjectAlreadyHasAreference">
<source>Project already has a reference to `{0}`.</source>
<target state="translated">Fr das Projekt ist bereits ein Verweis auf "{0}" vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="ProjectReferenceCouldNotBeFound">
<source>Project reference `{0}` could not be found.</source>
<target state="translated">Der Projektverweis "{0}" wurde nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="ProjectReferenceRemoved">
<source>Project reference `{0}` removed.</source>
<target state="translated">Der Projektverweis "{0}" wurde entfernt.</target>
<note />
</trans-unit>
<trans-unit id="Project">
<source>Project</source>
<target state="translated">Projekt</target>
<note />
</trans-unit>
<trans-unit id="ProjectFile">
<source>Project file</source>
<target state="translated">Projektdatei</target>
<note />
</trans-unit>
<trans-unit id="Reference">
<source>Reference</source>
<target state="translated">Verweis</target>
<note />
</trans-unit>
<trans-unit id="ProjectReference">
<source>Project reference</source>
<target state="translated">Projektverweis</target>
<note />
</trans-unit>
<trans-unit id="PackageReference">
<source>Package reference</source>
<target state="translated">Paketverweis</target>
<note />
</trans-unit>
<trans-unit id="P2P">
<source>Project to Project</source>
<target state="translated">Projekt zu Projekt</target>
<note />
</trans-unit>
<trans-unit id="P2PReference">
<source>Project to Project reference</source>
<target state="translated">Projekt-zu-Projekt-Verweis</target>
<note />
</trans-unit>
<trans-unit id="Package">
<source>Package</source>
<target state="translated">Paket</target>
<note />
</trans-unit>
<trans-unit id="ResponseFileNotFound">
<source>Response file '{0}' does not exist.</source>
<target state="translated">Die Antwortdatei {0} ist nicht vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="SelfContainAndNoSelfContainedConflict">
<source>The '--self-contained' and '--no-self-contained' options cannot be used together.</source>
<target state="translated">Die Optionen --self-contained und --no-self-contained knnen nicht gemeinsam verwendet werden.</target>
<note>{Locked="--self-contained"}{Locked="--no-self-contained"}</note>
</trans-unit>
<trans-unit id="SelfContainedOptionDescription">
<source>Publish the .NET runtime with your application so the runtime doesn't need to be installed on the target machine.
The default is 'false.' However, when targeting .NET 7 or lower, the default is 'true' if a runtime identifier is specified.</source>
<target state="translated">Hiermit wird die .NET-Runtime mit Ihrer Anwendung verffentlicht, sodass die Runtime nicht auf dem Zielcomputer installiert werden muss.
Der Standardwert lautet FALSE. Wenn sie jedoch auf .NET 7 oder niedriger abzielen, lautet der Standardwert TRUE, wenn ein Laufzeitbezeichner angegeben wird.</target>
<note />
</trans-unit>
<trans-unit id="Solution">
<source>Solution</source>
<target state="translated">Projektmappe</target>
<note />
</trans-unit>
<trans-unit id="SolutionArgumentMisplaced">
<source>Solution argument '{0}' is misplaced.</source>
<target state="translated">Das Projektmappenargument "{0}" wurde falsch eingefgt.</target>
<note />
</trans-unit>
<trans-unit id="SolutionFile">
<source>Solution file</source>
<target state="translated">Projektmappendatei</target>
<note />
</trans-unit>
<trans-unit id="Executable">
<source>Executable</source>
<target state="translated">Ausfhrbare Datei</target>
<note />
</trans-unit>
<trans-unit id="Library">
<source>Library</source>
<target state="translated">Bibliothek</target>
<note />
</trans-unit>
<trans-unit id="Program">
<source>Program</source>
<target state="translated">Programm</target>
<note />
</trans-unit>
<trans-unit id="Application">
<source>Application</source>
<target state="translated">Anwendung</target>
<note />
</trans-unit>
<trans-unit id="ReferenceAddedToTheProject">
<source>Reference `{0}` added to the project.</source>
<target state="translated">Der Verweis "{0}" wurde dem Projekt hinzugefgt.</target>
<note />
</trans-unit>
<trans-unit id="Add">
<source>Add</source>
<target state="translated">Hinzufgen</target>
<note />
</trans-unit>
<trans-unit id="Remove">
<source>Remove</source>
<target state="translated">Entfernen</target>
<note />
</trans-unit>
<trans-unit id="Delete">
<source>Delete</source>
<target state="translated">lschen</target>
<note />
</trans-unit>
<trans-unit id="SolutionFolderAlreadyContainsProject">
<source>Solution {0} already contains project {1} in solution folder {2}.</source>
<target state="translated">Die Projektmappe "{0}" enthlt bereits das Projekt "{1}" im Projektmappenordner "{2}".</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsNotFound">
<source>Tool settings file does not exist for the tool {0}.</source>
<target state="translated">Die Tooleinstellungsdatei ist fr das Tool {0} nicht vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="Update">
<source>Update</source>
<target state="translated">Aktualisieren</target>
<note />
</trans-unit>
<trans-unit id="New">
<source>New</source>
<target state="translated">Neu</target>
<note />
</trans-unit>
<trans-unit id="List">
<source>List</source>
<target state="translated">Liste</target>
<note />
</trans-unit>
<trans-unit id="Load">
<source>Load</source>
<target state="translated">Laden</target>
<note />
</trans-unit>
<trans-unit id="Save">
<source>Save</source>
<target state="translated">Speichern</target>
<note />
</trans-unit>
<trans-unit id="Find">
<source>Find</source>
<target state="translated">Suchen</target>
<note />
</trans-unit>
<trans-unit id="Error">
<source>Error</source>
<target state="translated">Fehler</target>
<note />
</trans-unit>
<trans-unit id="Warning">
<source>Warning</source>
<target state="translated">Warnung</target>
<note />
</trans-unit>
<trans-unit id="File">
<source>File</source>
<target state="translated">Datei</target>
<note />
</trans-unit>
<trans-unit id="Directory">
<source>Directory</source>
<target state="translated">Verzeichnis</target>
<note />
</trans-unit>
<trans-unit id="Type">
<source>Type</source>
<target state="translated">Typ</target>
<note />
</trans-unit>
<trans-unit id="Value">
<source>Value</source>
<target state="translated">Wert</target>
<note />
</trans-unit>
<trans-unit id="Group">
<source>Group</source>
<target state="translated">Gruppe</target>
<note />
</trans-unit>
<trans-unit id="XAddedToY">
<source>{0} added to {1}.</source>
<target state="translated">"{0}" wurde "{1}" hinzugefgt.</target>
<note />
</trans-unit>
<trans-unit id="XRemovedFromY">
<source>{0} removed from {1}.</source>
<target state="translated">"{0}" wurde aus "{1}" entfernt.</target>
<note />
</trans-unit>
<trans-unit id="XDeletedFromY">
<source>{0} deleted from {1}.</source>
<target state="translated">"{0}" wurde aus "{1}" gelscht.</target>
<note />
</trans-unit>
<trans-unit id="XSuccessfullyUpdated">
<source>{0} successfully updated.</source>
<target state="translated">"{0}" wurde erfolgreich aktualisiert.</target>
<note />
</trans-unit>
<trans-unit id="XIsInvalid">
<source>{0} is invalid.</source>
<target state="translated">"{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="XYFoundButInvalid">
<source>{0} `{1}` found but is invalid.</source>
<target state="translated">{0} "{1}" wurde gefunden, ist aber ungltig.</target>
<note />
</trans-unit>
<trans-unit id="XFoundButInvalid">
<source>`{0}` found but is invalid.</source>
<target state="translated">"{0}" wurde gefunden, ist aber ungltig.</target>
<note />
</trans-unit>
<trans-unit id="OperationInvalid">
<source>Operation is invalid.</source>
<target state="translated">Der Vorgang ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="OperationXInvalid">
<source>Operation {0} is invalid.</source>
<target state="translated">Der Vorgang "{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="XNotFound">
<source>{0} not found.</source>
<target state="translated">"{0}" wurde nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="XOrYNotFound">
<source>{0} or {1} not found.</source>
<target state="translated">"{0}" oder "{1}" wurde nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="XOrYNotFoundInZ">
<source>{0} or {1} not found in `{2}`.</source>
<target state="translated">"{0}" oder "{1}" wurde in "{2}" nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="FileNotFound">
<source>File `{0}` not found.</source>
<target state="translated">Die Datei "{0}" wurde nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="XDoesNotExist">
<source>{0} does not exist.</source>
<target state="translated">"{0}" ist nicht vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="XYDoesNotExist">
<source>{0} `{1}` does not exist.</source>
<target state="translated">{0} "{1}" ist nicht vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="MoreThanOneXFound">
<source>More than one {0} found.</source>
<target state="translated">Es wurden mehrere Elemente "{0}" gefunden.</target>
<note />
</trans-unit>
<trans-unit id="XAlreadyContainsY">
<source>{0} already contains {1}.</source>
<target state="translated">"{1}" ist bereits in "{0}" enthalten.</target>
<note />
</trans-unit>
<trans-unit id="XAlreadyContainsYZ">
<source>{0} already contains {1} `{2}`.</source>
<target state="translated">{1} "{2}" ist bereits in "{0}" enthalten.</target>
<note />
</trans-unit>
<trans-unit id="XAlreadyHasY">
<source>{0} already has {1}.</source>
<target state="translated">"{0}" verfgt bereits ber "{1}".</target>
<note />
</trans-unit>
<trans-unit id="XAlreadyHasYZ">
<source>{0} already has {1} `{2}`.</source>
<target state="translated">"{0}" verfgt bereits ber {1} "{2}".</target>
<note />
</trans-unit>
<trans-unit id="XWasNotExpected">
<source>{0} was not expected.</source>
<target state="translated">"{0}" wurde nicht erwartet.</target>
<note />
</trans-unit>
<trans-unit id="XNotProvided">
<source>{0} not provided.</source>
<target state="translated">"{0}" wurde nicht angegeben.</target>
<note />
</trans-unit>
<trans-unit id="SpecifyAtLeastOne">
<source>Specify at least one {0}.</source>
<target state="translated">Geben Sie mindestens ein Element "{0}" an.</target>
<note />
</trans-unit>
<trans-unit id="CouldNotConnectWithTheServer">
<source>Could not connect with the server.</source>
<target state="translated">Mit dem Server konnte keine Verbindung hergestellt werden.</target>
<note />
</trans-unit>
<trans-unit id="RequiredArgumentIsInvalid">
<source>Required argument {0} is invalid.</source>
<target state="translated">Das erforderliche Argument "{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="OptionIsInvalid">
<source>Option {0} is invalid.</source>
<target state="translated">Die Option "{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="ArgumentIsInvalid">
<source>Argument {0} is invalid.</source>
<target state="translated">Das Argument "{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="RequiredArgumentNotPassed">
<source>Required argument {0} was not provided.</source>
<target state="translated">Das erforderliche Argument "{0}" wurde nicht angegeben.</target>
<note />
</trans-unit>
<trans-unit id="CouldNotFindProjectOrDirectory">
<source>Could not find project or directory `{0}`.</source>
<target state="translated">Das Projekt oder Verzeichnis "{0}" wurde nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="FoundInvalidProject">
<source>Found a project `{0}` but it is invalid.</source>
<target state="translated">Ein Projekt "{0}" wurde gefunden, ist aber ungltig.</target>
<note />
</trans-unit>
<trans-unit id="InvalidProject">
<source>Invalid project `{0}`.</source>
<target state="translated">Ungltiges Projekt "{0}".</target>
<note />
</trans-unit>
<trans-unit id="CouldNotFindSolutionIn">
<source>Specified solution file {0} does not exist, or there is no solution file in the directory.</source>
<target state="translated">Die angegebene Projektmappendatei "{0}" ist nicht vorhanden, oder das Verzeichnis enthlt keine Projektmappendatei.</target>
<note />
</trans-unit>
<trans-unit id="CouldNotFindSolutionOrDirectory">
<source>Could not find solution or directory `{0}`.</source>
<target state="translated">Die Projektmappe oder das Verzeichnis "{0}" wurde nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="SolutionDoesNotExist">
<source>Specified solution file {0} does not exist, or there is no solution file in the directory.</source>
<target state="translated">Die angegebene Projektmappendatei "{0}" ist nicht vorhanden, oder das Verzeichnis enthlt keine Projektmappendatei.</target>
<note />
</trans-unit>
<trans-unit id="ReferenceIsInvalid">
<source>Reference `{0}` is invalid.</source>
<target state="translated">Der Verweis "{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="SpecifyAtLeastOneReferenceToAdd">
<source>You must specify at least one reference to add.</source>
<target state="translated">Geben Sie mindestens einen hinzuzufgenden Verweis an.</target>
<note />
</trans-unit>
<trans-unit id="PackageReferenceDoesNotExist">
<source>Package reference `{0}` does not exist.</source>
<target state="translated">Der Paketverweis "{0}" ist nicht vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="PackageReferenceIsInvalid">
<source>Package reference `{0}` is invalid.</source>
<target state="translated">Der Paketverweis "{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="SpecifyAtLeastOnePackageReferenceToAdd">
<source>You must specify at least one package to add.</source>
<target state="translated">Geben Sie mindestens ein hinzuzufgendes Paket an.</target>
<note />
</trans-unit>
<trans-unit id="PackageReferenceAddedToTheProject">
<source>Package reference `{0}` added to the project.</source>
<target state="translated">Der Paketverweis "{0}" wurde dem Projekt hinzugefgt.</target>
<note />
</trans-unit>
<trans-unit id="ProjectAlreadyHasAPackageReference">
<source>Project {0} already has a reference `{1}`.</source>
<target state="translated">Fr das Projekt "{0}" ist bereits ein Verweis "{1}" vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="PleaseSpecifyVersion">
<source>Specify a version of the package.</source>
<target state="translated">Geben Sie eine Paketversion an.</target>
<note />
</trans-unit>
<trans-unit id="ProjectDoesNotExist">
<source>Project `{0}` does not exist.</source>
<target state="translated">Das Projekt "{0}" ist nicht vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="ProjectIsInvalid">
<source>Project `{0}` is invalid.</source>
<target state="translated">Das Projekt "{0}" ist ungltig.</target>
<note />
</trans-unit>
<trans-unit id="SpecifyAtLeastOneProjectToAdd">
<source>You must specify at least one project to add.</source>
<target state="translated">Geben Sie mindestens ein hinzuzufgendes Projekt an.</target>
<note />
</trans-unit>
<trans-unit id="ProjectAddedToTheSolution">
<source>Project `{0}` added to the solution.</source>
<target state="translated">Das Projekt "{0}" wurde der Projektmappe hinzugefgt.</target>
<note />
</trans-unit>
<trans-unit id="ReferenceNotFoundInTheProject">
<source>Specified reference {0} does not exist in project {1}.</source>
<target state="translated">Der angegebene Verweis "{0}" ist im Projekt "{1}" nicht vorhanden.</target>
<note />
</trans-unit>
<trans-unit id="ReferenceRemoved">
<source>Reference `{0}` deleted from the project.</source>
<target state="translated">Der Verweis "{0}" wurde aus dem Projekt gelscht.</target>
<note />
</trans-unit>
<trans-unit id="SpecifyAtLeastOneReferenceToRemove">
<source>You must specify at least one reference to remove.</source>
<target state="translated">Geben Sie mindestens einen zu lschenden Verweis an.</target>
<note />
</trans-unit>
<trans-unit id="ReferenceDeleted">
<source>Reference `{0}` deleted.</source>
<target state="translated">Der Verweis "{0}" wurde gelscht.</target>
<note />
</trans-unit>
<trans-unit id="PackageReferenceNotFoundInTheProject">
<source>Package reference `{0}` could not be found in the project.</source>
<target state="translated">Der Paketverweis "{0}" wurde im Projekt nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="PackageReferenceRemoved">
<source>Reference `{0}` deleted from the project.</source>
<target state="translated">Der Verweis "{0}" wurde aus dem Projekt gelscht.</target>
<note />
</trans-unit>
<trans-unit id="SpecifyAtLeastOnePackageReferenceToRemove">
<source>You must specify at least one package reference to remove.</source>
<target state="translated">Geben Sie mindestens einen zu lschenden Paketverweis an.</target>
<note />
</trans-unit>
<trans-unit id="PackageReferenceDeleted">
<source>Package reference `{0}` deleted.</source>
<target state="translated">Der Paketverweis "{0}" wurde gelscht.</target>
<note />
</trans-unit>
<trans-unit id="ProjectNotFoundInTheSolution">
<source>Project `{0}` could not be found in the solution.</source>
<target state="translated">Das Projekt "{0}" wurde in der Projektmappe nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="ProjectRemoved">
<source>Project `{0}` removed from solution.</source>
<target state="translated">Das Projekt "{0}" wurde aus der Projektmappe entfernt.</target>
<note />
</trans-unit>
<trans-unit id="SpecifyAtLeastOneProjectToRemove">
<source>You must specify at least one project to remove.</source>
<target state="translated">Geben Sie mindestens ein zu entfernendes Projekt an.</target>
<note />
</trans-unit>
<trans-unit id="ProjectDeleted">
<source>Project `{0}` deleted from solution.</source>
<target state="translated">Das Projekt "{0}" wurde aus der Projektmappe gelscht.</target>
<note />
</trans-unit>
<trans-unit id="NoReferencesFound">
<source>There are no {0} references in project {1}.</source>
<target state="translated">Im Projekt "{1}" liegen keine {0}-Verweise vor.</target>
<note />
</trans-unit>
<trans-unit id="NoProjectsFound">
<source>No projects found in the solution.</source>
<target state="translated">In der Projektmappe wurden keine Projekte gefunden.</target>
<note />
</trans-unit>
<trans-unit id="PleaseSpecifyNewVersion">
<source>Specify new version of the package.</source>
<target state="translated">Geben Sie die neue Version des Pakets an.</target>
<note />
</trans-unit>
<trans-unit id="PleaseSpecifyWhichPackageToUpdate">
<source>Specify which package to update.</source>
<target state="translated">Geben Sie das zu aktualisierende Paket an.</target>
<note />
</trans-unit>
<trans-unit id="NothingToUpdate">
<source>Nothing to update.</source>
<target state="translated">Keine Aktualisierung verfgbar.</target>
<note />
</trans-unit>
<trans-unit id="EverythingUpToDate">
<source>Everything is already up-to-date.</source>
<target state="translated">Alle Elemente sind bereits auf dem neuesten Stand.</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionUpdatedTo">
<source>Version of package `{0}` updated to `{1}`.</source>
<target state="translated">Die Version des Pakets "{0}" wurde auf "{1}" aktualisiert.</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionUpdated">
<source>Version of package `{0}` updated.</source>
<target state="translated">Die Version des Pakets "{0}" wurde aktualisiert.</target>
<note />
</trans-unit>
<trans-unit id="CouldNotUpdateTheVersion">
<source>Could not update the version of the package `{0}`.</source>
<target state="translated">Die Version des Pakets "{0}" konnte nicht aktualisiert werden.</target>
<note />
</trans-unit>
<trans-unit id="TemplateCreatedSuccessfully">
<source>The template {0} created successfully. run "dotnet restore" to get started!</source>
<target state="translated">Die Vorlage "{0}" wurde erfolgreich erstellt. Fhren Sie "dotnet restore" aus, um zu beginnen.</target>
<note />
</trans-unit>
<trans-unit id="TemplateInstalledSuccesfully">
<source>The template {0} installed successfully. You can use "dotnet new {0}" to get started with the new template.</source>
<target state="translated">Die Vorlage "{0}" wurde erfolgreich installiert. Verwenden Sie "dotnet new {0}", um die neue Vorlage zu verwenden.</target>
<note />
</trans-unit>
<trans-unit id="TemplateCreateError">
<source>Template {0} could not be created. Error returned was: {1}.</source>
<target state="translated">Die Vorlage "{0}" konnte nicht erstellt werden. Zurckgegebener Fehler: {1}.</target>
<note />
</trans-unit>
<trans-unit id="TemplateInstallError">
<source>Template {0} could not be installed. Error returned was: {1}.</source>
<target state="translated">Die Vorlage "{0}" konnte nicht installiert werden. Zurckgegebener Fehler: {1}.</target>
<note />
</trans-unit>
<trans-unit id="SpecifiedNameExists">
<source>Specified name {0} already exists. Specify a different name.</source>
<target state="translated">Der angegebene Name "{0}" ist bereits vorhanden. Geben Sie einen anderen Namen an.</target>
<note />
</trans-unit>
<trans-unit id="SpecifiedAliasExists">
<source>Specified alias {0} already exists. Specify a different alias.</source>
<target state="translated">Der angegebene Alias "{0}" ist bereits vorhanden. Geben Sie einen anderen Alias an.</target>
<note />
</trans-unit>
<trans-unit id="MandatoryParameterMissing">
<source>Mandatory parameter {0} missing for template {1}. </source>
<target state="translated">Der obligatorische Parameter "{0}" ist fr die Vorlage "{1}" nicht vorhanden. </target>
<note />
</trans-unit>
<trans-unit id="ProjectReferenceOneOrMore">
<source>Project reference(s)</source>
<target state="translated">Projektverweis(e)</target>
<note />
</trans-unit>
<trans-unit id="RequiredCommandNotPassed">
<source>Required command was not provided.</source>
<target state="translated">Der erforderliche Befehl wurde nicht bereitgestellt.</target>
<note />
</trans-unit>
<trans-unit id="MoreThanOneSolutionInDirectory">
<source>Found more than one solution file in {0}. Specify which one to use.</source>
<target state="translated">In "{0}" wurden mehrere Projektmappendateien gefunden. Geben Sie an, welche davon verwendet werden soll.</target>
<note />
</trans-unit>
<trans-unit id="SolutionAlreadyContainsProject">
<source>Solution {0} already contains project {1}.</source>
<target state="translated">Die Projektmappe "{0}" enthlt das Projekt "{1}" bereits.</target>
<note />
</trans-unit>
<trans-unit id="ArgumentsProjectOrSolutionDescription">
<source>The project or solution to operation on. If a file is not specified, the current directory is searched.</source>
<target state="translated">Projekt oder Projektmappe, woran der Vorgang ausgefhrt werden soll. Wenn keine Datei angegeben wird, wird das aktuelle Verzeichnis durchsucht.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK</source>
<target state="translated">FRAMEWORK</target>
<note />
</trans-unit>
<trans-unit id="ProjectNotCompatibleWithFrameworks">
<source>Project `{0}` cannot be added due to incompatible targeted frameworks between the two projects. Review the project you are trying to add and verify that is compatible with the following targets:</source>
<target state="translated">Das Projekt "{0}" kann nicht hinzugefgt werden, weil die Zielframeworks der beiden Projekte nicht kompatibel sind. berprfen Sie das Projekt, das Sie hinzuzufgen mchten, und stellen Sie sicher, dass es mit folgenden Zielen kompatibel ist:</target>
<note />
</trans-unit>
<trans-unit id="ProjectDoesNotTargetFramework">
<source>Project `{0}` does not target framework `{1}`.</source>
<target state="translated">"{1}" ist kein Zielframework von Projekt "{0}" .</target>
<note />
</trans-unit>
<trans-unit id="ProjectCouldNotBeEvaluated">
<source>Project `{0}` could not be evaluated. Evaluation failed with following error:
{1}.</source>
<target state="translated">Das Projekt "{0}" konnte nicht ausgewertet werden. Fehler bei der Auswertung:
{1}.</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedProjectType">
<source>Project '{0}' has an unknown project type and cannot be added to the solution file. Contact your SDK provider for support.</source>
<target state="translated">Das Projekt "{0}" weist einen unbekannten Projekttyp auf und kann der Projektmappendatei nicht hinzugefgt werden. Wenden Sie sich an Ihren SDK-Anbieter, um Untersttzung zu erhalten.</target>
<note />
</trans-unit>
<trans-unit id="InvalidSolutionFormatString">
<source>Invalid solution `{0}`. {1}.</source>
<target state="translated">Ungltige Projektmappe "{0}". {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidProjectWithExceptionMessage">
<source>Invalid project `{0}`. {1}.</source>
<target state="translated">Ungltiges Projekt "{0}". {1}.</target>
<note />
</trans-unit>
<trans-unit id="VerbosityOptionDescription">
<source>Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].</source>
<target state="translated">Hiermit wird der Ausfhrlichkeitsgrad von MSBuild festgelegt. Zulssige Werte sind "q[uiet]", "m[inimal]", "n[ormal]", "d[etailed]" und "diag[nostic]".</target>
<note />
</trans-unit>
<trans-unit id="CmdVersionSuffixDescription">
<source>Set the value of the $(VersionSuffix) property to use when building the project.</source>
<target state="translated">Hiermit wird der Wert der $(VersionSuffix)-Eigenschaft festgelegt, die beim Erstellen des Projekts verwendet werden soll.</target>
<note />
</trans-unit>
<trans-unit id="ShowHelpDescription">
<source>Show command line help.</source>
<target state="translated">Hiermit wird die Hilfe zur Befehlszeile angezeigt.</target>
<note />
</trans-unit>
<trans-unit id="NoRestoreDescription">
<source>Do not restore the project before building.</source>
<target state="translated">Hiermit wird das Projekt nicht vor der Erstellung wiederhergestellt.</target>
<note />
</trans-unit>
<trans-unit id="ProjectRemovedFromTheSolution">
<source>Project `{0}` removed from the solution.</source>
<target state="translated">Das Projekt "{0}" wurde aus der Projektmappe entfernt.</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsInvalidXml">
<source>Invalid XML: {0}</source>
<target state="translated">Ungltiges XML: {0}</target>
<note />
</trans-unit>
<trans-unit id="EnvironmentPathLinuxNeedLogout">
<source>Since you just installed the .NET SDK, you will need to logout or restart your session before running the tool you installed.</source>
<target state="translated">Da Sie gerade das .NET SDK installiert haben, mssen Sie sich abmelden oder Ihre Sitzung neu starten, bevor Sie das installierte Tool ausfhren.</target>
<note />
</trans-unit>
<trans-unit id="EnvironmentPathOSXNeedReopen">
<source>Since you just installed the .NET SDK, you will need to reopen terminal before running the tool you installed.</source>
<target state="translated">Da Sie gerade das .NET SDK installiert haben, mssen Sie das Terminal neu ffnen, bevor Sie das installierte Tool ausfhren.</target>
<note />
</trans-unit>
<trans-unit id="EnvironmentPathWindowsNeedReopen">
<source>Since you just installed the .NET SDK, you will need to reopen the Command Prompt window before running the tool you installed.</source>
<target state="translated">Da Sie gerade das .NET SDK installiert haben, mssen Sie das Eingabeaufforderungsfenster neu ffnen, bevor Sie das installierte Tool ausfhren.</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsMissingCommandName">
<source>Tool defines a command with a missing name setting.</source>
<target state="translated">Das Tool definiert einen Befehl mit fehlender Namenseinstellung.</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsMissingEntryPoint">
<source>Command '{0}' is missing an entry point setting.</source>
<target state="translated">Dem Befehl "{0}" fehlt eine Einstiegspunkteinstellung.</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsInvalidCommandName">
<source>Command '{0}' contains one or more of the following invalid characters: {1}.</source>
<target state="translated">Der Befehl "{0}" enthlt mindestens eines der folgenden ungltigen Zeichen: {1}.</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsMoreThanOneCommand">
<source>More than one command is defined for the tool.</source>
<target state="translated">Fr das Tool wurden mehrere Befehle definiert.</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsUnsupportedRunner">
<source>Command '{0}' uses unsupported runner '{1}'."</source>
<target state="translated">Der Befehl "{0}" verwendet die nicht untersttzte Ausfhrung "{1}".</target>
<note />
</trans-unit>
<trans-unit id="ToolPackageConflictPackageId">
<source>Tool '{0}' (version '{1}') is already installed.</source>
<target state="translated">Das Tool "{0}" (Version "{1}") ist bereits installiert.</target>
<note />
</trans-unit>
<trans-unit id="ShellShimConflict">
<source>Command '{0}' conflicts with an existing command from another tool.</source>
<target state="translated">Der Befehl "{0}" steht in Konflikt zu einem vorhandenen Befehl aus einem anderen Tool.</target>
<note />
</trans-unit>
<trans-unit id="CannotCreateShimForEmptyExecutablePath">
<source>Cannot create shell shim for an empty executable path.</source>
<target state="translated">Fr einen leeren Pfad einer ausfhrbaren Datei kann kein Shell-Shim erstellt werden.</target>
<note />
</trans-unit>
<trans-unit id="CannotCreateShimForEmptyCommand">
<source>Cannot create shell shim for an empty command.</source>
<target state="translated">Fr einen leeren Befehl kann kein Shell-Shim erstellt werden.</target>
<note />
</trans-unit>
<trans-unit id="FailedToRetrieveToolConfiguration">
<source>Failed to retrieve tool configuration: {0}</source>
<target state="translated">Fehler beim Abrufen der Toolkonfiguration: {0}</target>
<note />
</trans-unit>
<trans-unit id="EnvironmentPathLinuxManualInstructions">
<source>Tools directory '{0}' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:
cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:{0}"
EOF
You can add it to the current session by running the following command:
export PATH="$PATH:{0}"
</source>
<target state="translated">Das Toolverzeichnis "{0}" befindet sich derzeit nicht in der PATH-Umgebungsvariablen.
Wenn Sie Bash verwenden, knnen Sie es Ihrem Profil durch Ausfhren des folgenden Befehls hinzufgen:
cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:{0}"
EOF
Sie knnen es der aktuellen Sitzung hinzufgen, indem Sie den folgenden Befehl ausfhren:
export PATH="$PATH:{0}"
</target>
<note />
</trans-unit>
<trans-unit id="EnvironmentPathWindowsManualInstructions">
<source>Tools directory '{0}' is not currently on the PATH environment variable.
You can add the directory to the PATH by running the following command:
setx PATH "%PATH%;{0}"
</source>
<target state="translated">Das Toolverzeichnis "{0}" ist aktuell nicht in der PATH-Umgebungsvariable angegeben.
Um das Verzeichnis zu PATH hinzuzufgen, knnen Sie den folgenden Befehl ausfhren:
setx PATH "%PATH%;{0}"
</target>
<note />
</trans-unit>
<trans-unit id="FailedToCreateShellShim">
<source>Failed to create tool shim for command '{0}': {1}</source>
<target state="translated">Fehler beim Erstellen des Tool-Shims fr den Befehl "{0}": {1}</target>
<note />
</trans-unit>
<trans-unit id="FailedToRemoveShellShim">
<source>Failed to remove tool shim for command '{0}': {1}</source>
<target state="translated">Fehler beim Entfernen des Tool-Shims fr den Befehl "{0}": {1}</target>
<note />
</trans-unit>
<trans-unit id="FailedSettingShimPermissions">
<source>Failed to set user executable permissions for shell shim: {0}</source>
<target state="translated">Fehler beim Festlegen der Benutzerberechtigungen der ausfhrbaren Datei fr den Shell-Shim: {0}</target>
<note />
</trans-unit>
<trans-unit id="FailedToInstallToolPackage">
<source>Failed to install tool package '{0}': {1}</source>
<target state="translated">Fehler beim Installieren des Toolpakets "{0}": {1}</target>
<note />
</trans-unit>
<trans-unit id="FailedToUninstallToolPackage">
<source>Failed to uninstall tool package '{0}': {1}</source>
<target state="translated">Fehler beim Deinstallieren des Toolpakets "{0}": {1}</target>
<note />
</trans-unit>
<trans-unit id="ColumnMaxWidthMustBeGreaterThanZero">
<source>Column maximum width must be greater than zero.</source>
<target state="translated">Die maximale Spaltenbreite muss grer als 0 sein.</target>
<note />
</trans-unit>
<trans-unit id="MissingToolEntryPointFile">
<source>Entry point file '{0}' for command '{1}' was not found in the package.</source>
<target state="translated">Die Einstiegspunktdatei "{0}" fr den Befehl "{1}" wurde nicht im Paket gefunden.</target>
<note />
</trans-unit>
<trans-unit id="MissingToolSettingsFile">
<source>Settings file 'DotnetToolSettings.xml' was not found in the package.</source>
<target state="translated">Die Einstellungsdatei "DotnetToolSettings.xml" wurde nicht im Paket gefunden.</target>
<note />
</trans-unit>
<trans-unit id="FailedToFindStagedToolPackage">
<source>Failed to find staged tool package '{0}'.</source>
<target state="translated">Das gestagete Toolpaket "{0}" wurde nicht gefunden.</target>
<note />
</trans-unit>
<trans-unit id="ToolSettingsInvalidLeadingDotCommandName">
<source>The command name '{0}' cannot begin with a leading dot (.).</source>
<target state="translated">Der Befehlsname "{0}" kann nicht mit einem vorangestellten Punkt (.) beginnen.</target>
<note />
</trans-unit>
<trans-unit id="FormatVersionIsHigher">
<source>Format version is higher than supported. This tool may not be supported in this SDK version. Update your SDK.</source>
<target state="translated">Die Formatversion ist hher als untersttzt. Dieses Tool wird in dieser SDK-Version mglicherweise nicht untersttzt. Aktualisieren Sie Ihr SDK.</target>
<note />
</trans-unit>
<trans-unit id="FormatVersionIsMalformed">
<source>Format version is malformed. This tool may not be supported in this SDK version. Contact the author of the tool.</source>
<target state="translated">Die Formatversion ist fehlerhaft. Dieses Tool wird in dieser SDK-Version mglicherweise nicht untersttzt. Wenden Sie sich an den Autor des Tools.</target>
<note />
</trans-unit>
<trans-unit id="FormatVersionIsMissing">
<source>Format version is missing. This tool may not be supported in this SDK version. Contact the author of the tool.</source>
<target state="translated">Die Formatversion fehlt. Dieses Tool wird in dieser SDK-Version mglicherweise nicht untersttzt. Wenden Sie sich an den Autor des Tools.</target>
<note />
</trans-unit>
<trans-unit id="FailedToSetToolsPathEnvironmentVariable">
<source>Failed to add '{0}' to the PATH environment variable. Add this directory to your PATH to use tools installed with 'dotnet tool install'.</source>
<target state="translated">Fehler beim Hinzufgen von "{0}" zur PATH-Umgebungsvariable. Fgen Sie dieses Verzeichnis Ihrem PATH hinzu, um mit "dotnet tool install" installierte Tools zu verwenden.</target>
<note />
</trans-unit>
<trans-unit id="MoreThanOnePackagedShimAvailable">
<source>More than one packaged shim is available: {0}.</source>
<target state="translated">Mehr als ein paketierter Shim verfgbar: {0}.</target>
<note />
</trans-unit>
<trans-unit id="FailedToReadNuGetLockFile">
<source>Failed to read NuGet LockFile for tool package '{0}': {1}</source>
<target state="translated">Fehler beim Lesen von NuGet-LockFile fr Toolpaket "{0}": {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectArgumentName">
<source>PROJECT</source>
<target state="translated">PROJECT</target>
<note />
</trans-unit>
<trans-unit id="ProjectArgumentDescription">
<source>The project file to operate on. If a file is not specified, the command will search the current directory for one.</source>
<target state="translated">Die zu verwendende Projektdatei. Wenn keine Datei angegeben ist, sucht der Befehl im aktuellen Verzeichnis nach einer Datei.</target>
<note />
</trans-unit>
<trans-unit id="LevelArgumentName">
<source>LEVEL</source>
<target state="translated">LEVEL</target>
<note />
</trans-unit>
<trans-unit id="FrameworkArgumentName">
<source>FRAMEWORK</source>
<target state="translated">FRAMEWORK</target>
<note />
</trans-unit>
<trans-unit id="RuntimeIdentifierArgumentName">
<source>RUNTIME_IDENTIFIER</source>
<target state="translated">RUNTIME_IDENTIFIER</target>
<note />
</trans-unit>
<trans-unit id="ConfigurationArgumentName">
<source>CONFIGURATION</source>
<target state="translated">CONFIGURATION</target>
<note />
</trans-unit>
<trans-unit id="VersionSuffixArgumentName">
<source>VERSION_SUFFIX</source>
<target state="translated">VERSION_SUFFIX</target>
<note />
</trans-unit>
<trans-unit id="SolutionOrProjectArgumentDescription">
<source>The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.</source>
<target state="translated">Das Projekt oder die Projektmappendatei, die verwendet werden soll. Wenn keine Datei angegeben ist, durchsucht der Befehl das aktuelle Verzeichnis nach einer Datei.</target>
<note />
</trans-unit>
<trans-unit id="SolutionOrProjectArgumentName">
<source>PROJECT | SOLUTION</source>
<target state="translated">PROJECT | SOLUTION</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/xlf/CommonLocalizableStrings.de.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 12,569 |
```xml
import { A11yModule } from "@angular/cdk/a11y";
import { DragDropModule } from "@angular/cdk/drag-drop";
import { OverlayModule } from "@angular/cdk/overlay";
import { ScrollingModule } from "@angular/cdk/scrolling";
import { DatePipe } from "@angular/common";
import { NgModule } from "@angular/core";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { AvatarComponent } from "../components/avatar.component";
import { ServicesModule } from "../services/services.module";
@NgModule({
imports: [
A11yModule,
BrowserAnimationsModule,
BrowserModule,
DragDropModule,
FormsModule,
JslibModule,
OverlayModule,
ReactiveFormsModule,
ScrollingModule,
ServicesModule,
],
declarations: [AvatarComponent],
exports: [
A11yModule,
BrowserAnimationsModule,
BrowserModule,
DatePipe,
DragDropModule,
FormsModule,
JslibModule,
OverlayModule,
ReactiveFormsModule,
ScrollingModule,
ServicesModule,
AvatarComponent,
],
providers: [DatePipe],
})
export class SharedModule {}
``` | /content/code_sandbox/apps/desktop/src/app/shared/shared.module.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 272 |
```xml
#import "CRNodeHierarchy.h"
#import "CRContext.h"
#import "CRMacros.h"
#include "CRNodeBuilder.h"
@implementation CRNodeHierarchy {
__weak CRContext *_context;
__weak UIView *_containerView;
CGSize _size;
CRNodeLayoutOptions _options;
CROpaqueNodeBuilder * (^_buildNodeHierarchy)(CRContext *);
}
- (instancetype)initWithContext:(CRContext *)context
nodeHierarchyBuilder:(CROpaqueNodeBuilder * (^)(CRContext *))buildNodeHierarchy {
if (self = [super init]) {
_context = context;
_buildNodeHierarchy = buildNodeHierarchy;
}
return self;
}
#pragma mark Render
- (void)buildHierarchyInView:(UIView *)view
constrainedToSize:(CGSize)size
withOptions:(CRNodeLayoutOptions)options {
CR_ASSERT_ON_MAIN_THREAD();
_containerView = view;
_size = size;
_options = options;
_root = [_buildNodeHierarchy(_context) build];
[_root registerNodeHierarchyInContext:_context];
[_root setNodeHierarchy:self];
[_root reconcileInView:view constrainedToSize:size withOptions:options];
}
- (void)reconcileInView:(nullable UIView *)view
constrainedToSize:(CGSize)size
withOptions:(CRNodeLayoutOptions)options {
CR_ASSERT_ON_MAIN_THREAD();
_containerView = view;
_size = size;
_options = options;
[_root reconcileInView:view constrainedToSize:size withOptions:options];
}
- (void)layoutConstrainedToSize:(CGSize)size withOptions:(CRNodeLayoutOptions)options {
_size = size;
_options = options;
CR_ASSERT_ON_MAIN_THREAD();
[_root layoutConstrainedToSize:size withOptions:options];
}
- (void)setNeedsReconcile {
CR_ASSERT_ON_MAIN_THREAD();
[self buildHierarchyInView:_containerView constrainedToSize:_size withOptions:_options];
}
- (void)setNeedsLayout {
CR_ASSERT_ON_MAIN_THREAD();
[self layoutConstrainedToSize:_size withOptions:_options];
}
@end
``` | /content/code_sandbox/Sources/CoreRender/CRNodeHierarchy.mm | xml | 2016-04-13T08:39:19 | 2024-08-05T04:12:30 | Render | alexdrone/Render | 2,157 | 450 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--
~ All Rights Reserved.
-->
<resources>
<string name="app_name">MaterialRatingBar Sample</string>
<string name="normal_layout">Normal Layout</string>
<string name="wide_layout">Wide Layout</string>
<string name="decimal_step_size">Decimal Step Size</string>
<string name="framework_implementation">Framework Implementation</string>
<string name="library_implementation">Library Implementation</string>
<string name="library_implementation_tinted">Library Implementation (Tinted)</string>
<string name="action_about">About</string>
<string name="about_title">About</string>
<string name="about_name">MaterialRatingBar</string>
<string name="about_version_format">Version %1$s</string>
<string name="about_credit">Zhang Hai 2016</string>
<string name="about_github"><a href="path_to_url">View on GitHub</a></string>
</resources>
``` | /content/code_sandbox/sample/src/main/res/values/strings.xml | xml | 2016-10-22T01:32:12 | 2024-08-14T01:26:08 | MaterialRatingBar | zhanghai/MaterialRatingBar | 1,960 | 231 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="path_to_url"
android:orientation="horizontal"
>
<TextView
android:id="@+id/weekdaysLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout="@+id/hoursLabel"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/hoursLabel"
app:layout_constraintHorizontal_weight="2"
android:gravity="end"
tools:text="Mon - Tue"
style="@style/TimesField"/>
<TextView
android:id="@+id/hoursLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/weekdaysLabel"
app:layout_constraintEnd_toStartOf="@id/deleteButton"
app:layout_constraintHorizontal_weight="3"
tools:text="18:00 - 22:00+"
style="@style/TimesField"/>
<ImageView
android:id="@+id/deleteButton"
style="@style/TimesField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_delete_24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/hoursLabel"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
``` | /content/code_sandbox/app/src/main/res/layout/quest_times_weekday_row.xml | xml | 2016-07-02T10:44:04 | 2024-08-16T18:55:54 | StreetComplete | streetcomplete/StreetComplete | 3,781 | 401 |
```xml
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
@customElement('gk-blame-svg')
export class BlameSvg extends LitElement {
static override styles = css`
:host {
position: relative;
--gl-svg-indicator-color: var(
--vscode-activityBarBadge-background,
dodgerblue
); //color-mix(in srgb, var(--vscode-activityBarBadge-background) 90%, white);
--gl-svg-indicator-size: 2.5;
--gl-svg-indicator-pulse-size: 12; // calc(var(--gl-svg-indicator-size, 3) * 4);
}
:host svg:last-child {
display: block;
max-width: 69.2rem;
width: calc(100% - 2rem);
height: auto;
margin: 0 1rem;
border: 0.1rem solid var(--vscode-editorWidget-border);
}
* {
user-select: none;
}
.codicon {
font-family: codicon;
cursor: default;
user-select: none;
}
.glicon {
font-family: glicons;
cursor: default;
user-select: none;
}
.line text {
font-family: var(--vscode-editor-font-family);
font-size: var(--vscode-editor-font-size);
font-weight: var(--vscode-editor-font-weight);
}
.cursor {
fill: var(--vscode-editorCursor-foreground);
}
.splitter {
stroke: var(--vscode-editorGroup-border);
}
.punctuation {
fill: var(--vscode-editor-foreground);
}
.function-declaration {
fill: var(--vscode-symbolIcon-functionForeground);
}
.function-name {
fill: var(--vscode-symbolIcon-colorForeground);
}
.function-argument {
fill: var(--vscode-symbolIcon-variableForeground);
}
.function-argument-type {
fill: var(--vscode-symbolIcon-typeParameterForeground);
}
.function-return {
fill: var(--vscode-debugTokenExpression-name);
}
.line-current {
fill: var(--vscode-editor-lineHighlightBackground);
stroke: var(--vscode-editor-lineHighlightBorder);
stroke-width: 0.1rem;
fill-opacity: 0.8;
}
.line-number {
fill: var(--vscode-editorLineNumber-foreground);
}
.line-number-active {
fill: var(--vscode-editorLineNumber-activeForeground);
}
.blame {
fill: var(--vscode-gitlens-trailingLineForegroundColor);
cursor: pointer;
}
.codelens text {
font-family: var(--vscode-font-family);
font-size: var(--vscode-font-size);
font-weight: var(--vscode-font-weight);
fill: var(--vscode-editorCodeLens-foreground);
}
.codelens text tspan {
font-size: 0.8em;
}
.hover {
opacity: 0;
visibility: hidden;
position: absolute;
bottom: 30px;
right: -30px;
animation-duration: 0.25s;
animation-timing-function: ease-in-out;
animation-fill-mode: both;
}
.hover rect {
fill: var(--vscode-editorHoverWidget-background);
stroke: var(--vscode-editorHoverWidget-border);
stroke-width: 1;
}
.hover line {
stroke: var(--vscode-editorHoverWidget-border);
stroke-width: 1;
}
.hover text {
font-family: var(--vscode-font-family);
font-weight: var(--vscode-font-weight);
font-size: 1.1rem;
fill: var(--vscode-editorHoverWidget-foreground);
}
.hover__diff tspan {
font-family: var(--vscode-editor-font-family);
font-weight: var(--vscode-editor-font-weight);
font-size: var(--vscode-editor-font-size);
}
.hover__diff-removed {
fill: var(--vscode-gitDecoration-deletedResourceForeground);
}
.hover__diff-added {
fill: var(--vscode-gitDecoration-addedResourceForeground);
}
.hover__author {
font-weight: 700;
}
.hover__date {
font-style: italic;
}
.hover__link {
fill: #3794ff !important;
}
@keyframes fadeInHover {
0% {
opacity: 0;
visibility: visible;
}
100% {
opacity: 1;
visibility: visible;
}
}
@keyframes fadeOutHover {
0% {
opacity: 1;
visibility: visible;
}
100% {
opacity: 0;
visibility: hidden;
}
}
:host([hovering]) {
z-index: 1000;
}
:host([hovered][hovering]) .hover {
animation-name: fadeInHover;
}
:host([hovered]:not([hovering])) .hover {
animation-name: fadeOutHover;
}
.blame,
.codelens {
transition: opacity 150ms ease-in-out;
}
:host(:not([inline])) .blame,
:host(:not([codelens])) .codelens {
cursor: default;
opacity: 0;
}
circle.indicator {
fill: var(--gl-svg-indicator-color);
stroke: var(--gl-svg-indicator-color);
stroke-width: 1;
r: var(--gl-svg-indicator-size);
pointer-events: none;
}
circle.indicator--pulse {
animation: 1.05s ease 0s infinite normal none running pulse;
}
@keyframes pulse {
0% {
stroke-width: 1;
opacity: 1;
}
100% {
stroke-width: var(--gl-svg-indicator-pulse-size, 12);
opacity: 0;
}
}
`;
@property({ type: Boolean, reflect: true })
inline?: boolean;
@property({ type: Boolean, reflect: true })
codelens?: boolean;
@property({ type: Boolean, reflect: true })
hovered?: boolean;
@property({ type: Boolean, reflect: true })
hovering?: boolean;
protected onMouseOver() {
this.hovered = true;
this.hovering = this.inline;
}
protected onMouseOut() {
this.hovered = true;
this.hovering = false;
}
override render() {
return html`
<!-- Don't reformat or let prettier reformat the SVG otherwise whitespace will get added incorrect and screw up the positioning -->
<!-- prettier-ignore -->
<svg class="hover" width="600" height="177" viewBox="30 0 80 177" fill="none" xmlns="path_to_url">
<rect width="370" height="177" rx="3"></rect>
<text x="9" y="41" text-anchor="start"><tspan class="codicon" font-size="32"></tspan></text>
<text>
<tspan class="hover__author hover__link" x="52" y="30">You</tspan><tspan>, 6 years ago via PR </tspan><tspan class="hover__author hover__link">#1</tspan><tspan class="hover__date" dx="12">(November 12th, 2016 3:41pm)</tspan><tspan x="52" y="55">Supercharge Git</tspan>
</text>
<line x1="0" y1="70" x2="371" y2="70" />
<text y="89">
<tspan x="9" dy="1.5" class="codicon hover__link"></tspan><tspan dx="2" dy="-1.5" class="hover__link">29ad3a0</tspan><tspan dx="9" opacity="0.6">|</tspan><tspan dx="9" dy="1.5" class="codicon hover__link"></tspan><tspan dx="9" dy="-1.5" opacity="0.6">|</tspan><tspan dx="9" dy="1.5" class="codicon hover__link"></tspan><tspan dx="9" dy="-1.5" opacity="0.6">|</tspan><tspan dx="9" dy="1.5" class="codicon hover__link"></tspan><tspan dx="9" dy="-1.5" opacity="0.6">|</tspan><tspan dx="9" dy="1.5" class="codicon hover__link"></tspan>
</text>
<line x1="0" y1="99" x2="371" y2="99" />
<text class="hover__diff">
<tspan class="hover__diff-removed" x="9" y="119">- return git;</tspan>
<tspan class="hover__diff-added" x="9" y="136">+ return supercharged(git);</tspan>
</text>
<line x1="0" y1="147" x2="371" y2="147" />
<text y="166">
<tspan x="9">Changes</tspan><tspan dx="12" dy="1.5" class="codicon hover__link"></tspan><tspan dx="2" dy="-1.5" class="hover__link">3ac1d3f</tspan><tspan dx="9" dy="1.5" class="codicon"></tspan><tspan dx="6" class="codicon hover__link"></tspan><tspan dx="2" dy="-1.5" class="hover__link">29ad3a0</tspan><tspan dx="9" opacity="0.6">|</tspan><tspan dx="9" dy="1.5" class="codicon hover__link"></tspan>
</text>
</svg>
<!-- Don't reformat or let prettier reformat the SVG otherwise whitespace will get added incorrect and screw up the positioning -->
<!-- prettier-ignore -->
<svg width="600" height="45" viewBox="0 0 600 43" fill="none" xmlns="path_to_url">
<g class="codelens">
<text y="18"><tspan x="38">Eric Amodio, 3 minutes ago | 1 author (Eric Amodio)</tspan></text>
</g>
<g class="line">
<text y="34"><tspan x="7" class="line-number">13</tspan><tspan x="38" class="function-return">return</tspan><tspan dx="6" class="function-name">supercharged</tspan><tspan class="punctuation">(</tspan><tspan class="function-argument">git</tspan><tspan class="punctuation">)</tspan><tspan class="punctuation">;</tspan><tspan class="cursor">|</tspan><tspan dx="24" class="blame" @mouseover=${this
.onMouseOver} @mouseout=${this.onMouseOut}>You, 6 years ago via PR #1 Supercharge Git</tspan></text>
<circle class="indicator indicator--pulse" cx="260" cy="20" />
<circle class="indicator" cx="260" cy="20" />
</g>
<!-- <g class="line">
<text y="34"><tspan x="7" class="line-number">12</tspan><tspan x="38" class="function-declaration">function</tspan><tspan dx="6" class="function-name">gitlens</tspan><tspan class="punctuation">(</tspan><tspan class="function-argument">git</tspan><tspan class="punctuation">:</tspan><tspan dx="6" class="function-argument-type">object</tspan><tspan class="punctuation">)</tspan><tspan dx="6" class="punctuation">{</tspan><tspan class="cursor">|</tspan><tspan dx="24" class="blame" data-feature-blame="on">You, 6 years ago via PR #1 Supercharge Git</tspan></text>
</g> -->
</svg>
`;
}
}
``` | /content/code_sandbox/src/webviews/apps/welcome/components/svg-blame.ts | xml | 2016-08-08T14:50:30 | 2024-08-15T21:25:09 | vscode-gitlens | gitkraken/vscode-gitlens | 8,889 | 2,942 |
```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
/**
* Tests if a finite double-precision floating-point number is an integer.
*
* ## Notes
*
* - The function assumes a finite number. If provided positive or negative infinity, the function will return `true`, when, in fact, the result is undefined.
*
* @param x - value to test
* @returns boolean indicating whether the value is an integer
*
* @example
* var bool = isInteger( 1.0 );
* // returns true
*
* @example
* var bool = isInteger( 3.14 );
* // returns false
*/
declare function isInteger( x: number ): boolean;
// EXPORTS //
export = isInteger;
``` | /content/code_sandbox/lib/node_modules/@stdlib/math/base/assert/is-integer/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 202 |
```xml
<resources>
<string name="about_contact_us"></string>
<string name="about_instagram">Instagram</string>
<string name="about_facebook">Facebook</string>
<string name="about_play_store">Play Store</string>
<string name="about_youtube">Youtube</string>
<string name="about_twitter">Twitter</string>
<string name="about_github">GitHub</string>
<string name="about_website"></string>
</resources>
``` | /content/code_sandbox/library/src/main/res/values-ja/strings.xml | xml | 2016-04-20T23:26:30 | 2024-08-16T16:27:00 | android-about-page | medyo/android-about-page | 2,040 | 105 |
```xml
export type ColorMode = 'light' | 'dark' | null | undefined;
export interface StorageManager {
get(init?: ColorMode): Promise<ColorMode | undefined>;
set(value: ColorMode): void;
}
export interface ColorModeOptions {
initialColorMode?: ColorMode;
useSystemColorMode?: boolean;
accessibleColors?: boolean;
}
export type IColorModeProviderProps = {
children?: React.ReactNode;
options: ColorModeOptions;
colorModeManager?: StorageManager;
};
export interface IColorModeContextProps {
colorMode: ColorMode;
toggleColorMode: () => void;
setColorMode: (value: any) => void;
accessibleColors: boolean;
setAccessibleColors: (value: boolean) => void;
}
``` | /content/code_sandbox/src/core/color-mode/types.ts | xml | 2016-04-15T11:37:23 | 2024-08-14T16:16:44 | NativeBase | GeekyAnts/NativeBase | 20,132 | 162 |
```xml
import React from 'react'
import styled from 'styled-components'
import { settingsMapper } from '../../../lib/settings'
const TooltipWrapper = styled.div`
display: grid;
background: #333;
padding: 10px;
border-radius: 4px;
grid-template-columns: 40px 1fr;
grid-column-gap: 12px;
`
const TooltipKey = styled.span`
font-weight: 600;
`
const CustomTooltip = day => {
return (
<TooltipWrapper style={{ color: day.color }}>
<TooltipKey>day</TooltipKey>
<span>{day.day}</span>
<TooltipKey>value</TooltipKey>
<span>{day.value}</span>
<TooltipKey>x</TooltipKey>
<span>{day.x}</span>
<TooltipKey>y</TooltipKey>
<span>{day.y}</span>
<TooltipKey>size</TooltipKey>
<span>{day.size}</span>
</TooltipWrapper>
)
}
export default settingsMapper(
{
tooltip: (value, values) => {
if (!values['custom tooltip example']) return undefined
return CustomTooltip
},
},
{
exclude: ['custom tooltip example'],
}
)
``` | /content/code_sandbox/website/src/data/components/calendar/mapper.tsx | xml | 2016-04-16T03:27:56 | 2024-08-16T03:38:37 | nivo | plouc/nivo | 13,010 | 267 |
```xml
import { isFunction } from '../../src/helper/is-function';
describe('is-function', () => {
it('isFunction', () => {
expect(isFunction(1)).toBe(false);
expect(isFunction('')).toBe(false);
expect(isFunction(true)).toBe(false);
expect(isFunction(() => {})).toBe(true);
});
});
``` | /content/code_sandbox/__tests__/helper/is-fucntion-spec.ts | xml | 2016-06-03T06:08:21 | 2024-08-15T16:38:40 | echarts-for-react | hustcc/echarts-for-react | 4,472 | 71 |
```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="name" />
<column name="type" />
<column name="host" />
<column name="port" />
<column name="db" />
<column name="connection_timeout_milliseconds" />
<column name="idle_timeout_milliseconds" />
<column name="max_lifetime_milliseconds" />
<column name="max_pool_size" />
<column name="min_pool_size" />
<column name="read_only" />
<column name="other_attributes" />
</metadata>
<row values="encrypt_write_ds_0| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_0| 30000| 60000| 1800000| 20| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_1| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_1| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_2| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_2| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_3| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_3| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_4| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_4| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_5| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_5| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_6| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_6| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_7| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_7| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_8| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_8| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_write_ds_9| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_9| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_0| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_0| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_1| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_1| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_2| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_2| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_3| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_3| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_4| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_4| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_5| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_5| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_6| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_6| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_7| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_7| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_8| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_8| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
<row values="encrypt_read_ds_9| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_9| 30000| 60000| 1800000| 2| 2| false| {"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false,"autoCommit":true,"isolateInternalQueries":false,"queryProperties":{"characterEncoding":"utf-8","useSSL":"false"}}" />
</dataset>
``` | /content/code_sandbox/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_storage_units.xml | xml | 2016-01-18T12:49:26 | 2024-08-16T15:48:11 | shardingsphere | apache/shardingsphere | 19,707 | 4,717 |
```xml
import React, { useState } from "react";
import { isRule } from "features/rules/utils";
import { RuleTableRecord } from "../../types";
import { Link } from "react-router-dom";
import { Button, Progress, Tooltip } from "antd";
import { RiInformationLine } from "@react-icons/all-files/ri/RiInformationLine";
import { RuleSelectionListDrawer } from "../../../RuleSelectionListDrawer/RuleSelectionListDrawer";
import PATHS from "config/constants/sub/paths";
import { RecordStatus } from "features/rules/types/rules";
import { useTheme } from "styled-components";
import { SOURCE } from "modules/analytics/events/common/constants";
import { trackNewRuleButtonClicked } from "modules/analytics/events/common/rules";
import { useDispatch } from "react-redux";
import { actions } from "store";
import { trackSampleRuleEditorViewed } from "features/rules/analytics";
const RuleNameColumn: React.FC<{
record: RuleTableRecord;
}> = ({ record }) => {
const dispatch = useDispatch();
const theme = useTheme();
const [isRulesListDrawerOpen, setIsRulesListDrawerOpen] = useState(false);
const onRulesListDrawerClose = () => {
setIsRulesListDrawerOpen(false);
};
if (isRule(record)) {
return (
<div className="rule-name-container">
<Link
className="rule-name"
state={{ source: "my_rules" }}
to={`${PATHS.RULE_EDITOR.EDIT_RULE.ABSOLUTE}/${record.id}`}
onClick={() => {
if (record.isSample) {
trackSampleRuleEditorViewed(record.name);
}
//@ts-ignore
dispatch(actions.updateSecondarySidebarCollapse(false));
}}
>
{record.name}
</Link>
{record?.description ? (
<Tooltip title={record?.description} placement="right" showArrow={false}>
<span className="rule-description-icon">
<RiInformationLine />
</span>
</Tooltip>
) : null}
</div>
);
} else {
const group = record;
const totalRules = group.children?.length ?? 0;
const activeRulesCount = (group.children || []).reduce((count, rule) => {
return count + (rule.status === RecordStatus.ACTIVE ? 1 : 0);
}, 0);
return (
<div className="group-name-container" key={record.id}>
<div className="group-name">{group.name}</div>
{totalRules > 0 ? (
<Tooltip
placement="top"
title={
<>
<div>Active rules: {activeRulesCount}</div>
<div>Total rules: {totalRules}</div>
</>
}
>
<div className="group-rules-count-details">
<Progress
strokeWidth={16}
strokeColor={theme?.colors?.success}
showInfo={false}
type="circle"
percent={(activeRulesCount / totalRules) * 100}
size="small"
/>
{activeRulesCount} / {totalRules}
</div>
</Tooltip>
) : null}
<RuleSelectionListDrawer
groupId={group.id}
open={isRulesListDrawerOpen}
onClose={onRulesListDrawerClose}
source={SOURCE.RULE_GROUP}
>
<Button
className="add-rule-btn"
onClick={(e) => {
e.stopPropagation();
setIsRulesListDrawerOpen(true);
trackNewRuleButtonClicked(SOURCE.RULE_GROUP);
}}
>
<span>+</span> <span>Add rule</span>
</Button>
</RuleSelectionListDrawer>
</div>
);
}
};
export default RuleNameColumn;
``` | /content/code_sandbox/app/src/features/rules/screens/rulesList/components/RulesList/components/RulesTable/components/RulesColumn/RulesColumn.tsx | xml | 2016-12-01T04:36:06 | 2024-08-16T19:12:19 | requestly | requestly/requestly | 2,121 | 797 |
```xml
import {SpanFirstQuery} from './span_first.query';
describe('SpanFirst query format', () => {
// Set initial things
// set expected query format
var query: SpanFirstQuery;
var expectedFormat = {
'span_first': {
'match': {
'span_term': {
'gender': {
'value': 'female'
}
}
},
'end': '3'
}
};
// instantiate query component and set the input fields
beforeEach(function() {
query = new SpanFirstQuery();
query.queryName = 'span_first';
query.fieldName = 'gender';
query.inputs = {
input: {
value: 'female'
},
end: {
value: '3'
}
};
});
function isValidJson(str: string) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
// Test to check if queryformat is valid json
it('is valid json', () => {
var format = query.setFormat();
var validJson = isValidJson(JSON.stringify(format));
expect(validJson).toEqual(true);
});
// Test to check if result of setformat is equal to expected query format.
it('Is setformat matches with expected query format', () => {
var format = query.setFormat();
expect(format).toEqual(expectedFormat);
});
})
declare var $;
describe("xhr test (SpanFirst)", function () {
var returnedJSON: any = {};
var status = 0;
beforeEach(function (done) {
var query = new SpanFirstQuery();
query.queryName = 'span_first';
query.fieldName = 'gender';
query.inputs = {
input: {
value: 'female'
},
end: {
value: '3'
}
};
var config = {
url: 'path_to_url
appname: 'mirage_test',
username: 'wvCmyBy3D',
password: '7a7078e0-0204-4ccf-9715-c720f24754f2'
};
var url = 'path_to_url
var query_data = query.setFormat();
var request_data = {
"query": {
"bool": {
"must": [query_data]
}
}
};
$.ajax({
type: 'POST',
beforeSend: function(request) {
request.setRequestHeader("Authorization", "Basic " + btoa(config.username + ':' + config.password));
},
url: url,
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(request_data),
xhrFields: {
withCredentials: true
},
success: function(res) {
returnedJSON = res;
status = 200;
done();
},
error: function(xhr) {
returnedJSON = xhr;
status = xhr.status;
done();
}
});
});
it("Should have returned JSON and Should have atleast 1 record", function () {
expect(returnedJSON).not.toEqual({});
expect(returnedJSON).not.toBeUndefined();
expect(status).toEqual(200);
expect(returnedJSON.hits.hits.length).toBeGreaterThan(0);
});
});
``` | /content/code_sandbox/app/queryBlocks/singlequery/queries/span_first.query.spec.ts | xml | 2016-02-25T06:15:36 | 2024-08-02T10:28:20 | mirage | appbaseio/mirage | 2,213 | 713 |
```xml
import {Inject} from "../decorators/inject.js";
import {Injectable} from "../decorators/injectable.js";
import {Scope} from "../decorators/scope.js";
import {Service} from "../decorators/service.js";
import {Container} from "../domain/Container.js";
import {LocalsContainer} from "../domain/LocalsContainer.js";
import {ProviderScope} from "../domain/ProviderScope.js";
import {OnDestroy} from "../interfaces/OnDestroy.js";
import {GlobalProviders} from "../registries/GlobalProviders.js";
import {InjectorService} from "../services/InjectorService.js";
describe("DI", () => {
describe("create new injector", () => {
@Service()
@Scope(ProviderScope.INSTANCE)
class ServiceInstance {
constructor() {}
}
@Service()
class ServiceSingleton {
constructor() {}
}
@Service()
@Scope(ProviderScope.REQUEST)
class ServiceRequest implements OnDestroy {
constructor(
public serviceSingleton: ServiceSingleton,
public serviceInstance: ServiceInstance
) {}
$onDestroy(): Promise<any> | void {
return undefined;
}
}
afterAll(() => {
GlobalProviders.delete(ServiceSingleton);
GlobalProviders.delete(ServiceRequest);
GlobalProviders.delete(ServiceInstance);
});
it("should load all providers with the SINGLETON scope only", async () => {
// GIVEN
const injector = new InjectorService();
const providers = new Container();
providers.add(ServiceInstance);
providers.add(ServiceSingleton);
providers.add(ServiceRequest);
// WHEN
await injector.load(providers);
// THEN
expect(injector.get(ServiceSingleton)).toEqual(injector.invoke(ServiceSingleton));
expect(injector.get(ServiceRequest)).toBeUndefined();
expect(injector.get(ServiceInstance)).toBeUndefined();
expect(injector.invoke(ServiceRequest) === injector.invoke(ServiceRequest)).toEqual(false);
expect(injector.invoke(ServiceInstance) === injector.invoke(ServiceInstance)).toEqual(false);
const locals = new LocalsContainer();
expect(injector.invoke(ServiceRequest, locals)).toEqual(injector.invoke(ServiceRequest, locals));
expect(injector.invoke(ServiceInstance, locals) === injector.invoke(ServiceInstance, locals)).toEqual(false);
});
});
describe("it should invoke service with abstract class", () => {
abstract class BaseService {}
@Injectable()
class NestedService extends BaseService {}
class BaseMyService {
@Inject(NestedService)
nested: BaseService;
}
@Injectable()
class MyService extends BaseMyService {}
afterAll(() => {
GlobalProviders.delete(MyService);
GlobalProviders.delete(NestedService);
});
it("should inject the expected class", async () => {
const injector = new InjectorService();
const providers = new Container();
providers.add(MyService);
providers.add(NestedService);
await injector.load(providers);
expect(injector.get<MyService>(MyService)!.nested).toBeInstanceOf(NestedService);
});
});
describe("it should invoke service with a symbol", () => {
interface BaseService {}
const BaseService: unique symbol = Symbol("BaseService");
@Injectable({provide: BaseService})
class NestedService implements BaseService {}
@Injectable()
class MyService {
@Inject(BaseService)
nested: BaseService;
}
afterAll(() => {
GlobalProviders.delete(MyService);
GlobalProviders.delete(NestedService);
});
it("should inject the expected class", async () => {
const injector = new InjectorService();
const providers = new Container();
providers.add(MyService);
providers.add(NestedService);
await injector.load(providers);
expect(injector.get<MyService>(MyService)!.nested).toBeInstanceOf(NestedService);
});
});
describe("invoke class with a provider", () => {
it("should invoke class with a another useClass", async () => {
@Injectable()
class MyClass {}
class FakeMyClass {}
const injector = new InjectorService();
injector.addProvider(MyClass, {
useClass: FakeMyClass
});
const instance = injector.invoke(MyClass);
expect(instance).toBeInstanceOf(FakeMyClass);
expect(injector.get(MyClass)).toBeInstanceOf(FakeMyClass);
await injector.load();
expect(injector.get(MyClass)).toBeInstanceOf(FakeMyClass);
});
});
});
``` | /content/code_sandbox/packages/di/src/common/integration/di.spec.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 927 |
```xml
import type { ViewportLayout } from './types/extra-types'
import type { Icons } from './types/metadata-types'
export const ViewportMetaKeys: { [k in keyof ViewportLayout]: string } = {
width: 'width',
height: 'height',
initialScale: 'initial-scale',
minimumScale: 'minimum-scale',
maximumScale: 'maximum-scale',
viewportFit: 'viewport-fit',
userScalable: 'user-scalable',
interactiveWidget: 'interactive-widget',
} as const
export const IconKeys: (keyof Icons)[] = ['icon', 'shortcut', 'apple', 'other']
``` | /content/code_sandbox/packages/next/src/lib/metadata/constants.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 137 |
```xml
<clickhouse>
<remote_servers>
<insert_distributed_async_send_cluster_two_replicas>
<shard>
<internal_replication>false</internal_replication>
<replica>
<host>n1</host>
<port>9000</port>
</replica>
<replica>
<host>n2</host>
<port>9000</port>
</replica>
</shard>
</insert_distributed_async_send_cluster_two_replicas>
<insert_distributed_async_send_cluster_two_shards>
<shard>
<replica>
<host>n1</host>
<port>9000</port>
</replica>
</shard>
<shard>
<replica>
<host>n2</host>
<port>9000</port>
</replica>
</shard>
</insert_distributed_async_send_cluster_two_shards>
</remote_servers>
</clickhouse>
``` | /content/code_sandbox/tests/integration/test_insert_distributed_async_send/configs/remote_servers.xml | xml | 2016-06-02T08:28:18 | 2024-08-16T18:39:33 | ClickHouse | ClickHouse/ClickHouse | 36,234 | 216 |
```xml
export const input = {
title: 'AdditionalProperties',
type: 'object',
properties: {
foo: {
type: 'string',
},
},
additionalProperties: {
type: 'number',
},
}
``` | /content/code_sandbox/test/e2e/additionalProperties.1.ts | xml | 2016-03-22T03:56:58 | 2024-08-12T18:37:05 | json-schema-to-typescript | bcherny/json-schema-to-typescript | 2,877 | 51 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<data>
<messages>
<ccp_dialog_title translation=" " />
<ccp_dialog_search_hint_message translation="..." />
<ccp_dialog_no_result_ack_message translation=" " />
</messages>
<countries>
<country
name=""
english_name="Andorra"
name_code="ad"
phone_code="376" />
<country
name=" ()"
english_name="United Arab Emirates (UAE)"
name_code="ae"
phone_code="971" />
<country
name=""
english_name="Afghanistan"
name_code="af"
phone_code="93" />
<country
name=" "
english_name="Antigua and Barbuda"
name_code="ag"
phone_code="1" />
<country
name=""
english_name="Anguilla"
name_code="ai"
phone_code="1" />
<country
name=""
english_name="Albania"
name_code="al"
phone_code="355" />
<country
name=""
english_name="Armenia"
name_code="am"
phone_code="374" />
<country
name=""
english_name="Angola"
name_code="ao"
phone_code="244" />
<country
name=""
english_name="Antarctica"
name_code="aq"
phone_code="672" />
<country
name=""
english_name="Argentina"
name_code="ar"
phone_code="54" />
<country
name=" "
english_name="American Samoa"
name_code="as"
phone_code="1" />
<country
name=""
english_name="Austria"
name_code="at"
phone_code="43" />
<country
name=""
english_name="Australia"
name_code="au"
phone_code="61" />
<country
name=""
english_name="Aruba"
name_code="aw"
phone_code="297" />
<country
name=" "
english_name="land Islands"
name_code="ax"
phone_code="358" />
<country
name=""
english_name="Azerbaijan"
name_code="az"
phone_code="994" />
<country
name=" "
english_name="Bosnia And Herzegovina"
name_code="ba"
phone_code="387" />
<country
name=""
english_name="Barbados"
name_code="bb"
phone_code="1"/>
<country
name=""
english_name="Bangladesh"
name_code="bd"
phone_code="880" />
<country
name=""
english_name="Belgium"
name_code="be"
phone_code="32" />
<country
name=" "
english_name="Burkina Faso"
name_code="bf"
phone_code="226" />
<country
name=""
english_name="Bulgaria"
name_code="bg"
phone_code="359" />
<country
name=""
english_name="Bahrain"
name_code="bh"
phone_code="973" />
<country
name=""
english_name="Burundi"
name_code="bi"
phone_code="257" />
<country
name=""
english_name="Benin"
name_code="bj"
phone_code="229" />
<country
name=" "
english_name="Saint Barthlemy"
name_code="bl"
phone_code="590" />
<country
name=""
english_name="Bermuda"
name_code="bm"
phone_code="1"/>
<country
name=" "
english_name="Brunei Darussalam"
name_code="bn"
phone_code="673" />
<country
name=""
english_name="Bolivia, Plurinational State Of"
name_code="bo"
phone_code="591" />
<country
name=""
english_name="Brazil"
name_code="br"
phone_code="55" />
<country
name=""
english_name="Bahamas"
name_code="bs"
phone_code="1" />
<country
name=""
english_name="Bhutan"
name_code="bt"
phone_code="975" />
<country
name=""
english_name="Botswana"
name_code="bw"
phone_code="267" />
<country
name=""
english_name="Belarus"
name_code="by"
phone_code="375" />
<country
name=""
english_name="Belize"
name_code="bz"
phone_code="501" />
<country
name=""
english_name="Canada"
name_code="ca"
phone_code="1" />
<country
name=" ()"
english_name="Cocos (keeling) Islands"
name_code="cc"
phone_code="61" />
<country
name=" "
english_name="Congo, The Democratic Republic Of The"
name_code="cd"
phone_code="243" />
<country
name=" "
english_name="Central African Republic"
name_code="cf"
phone_code="236" />
<country
name=""
english_name="Congo"
name_code="cg"
phone_code="242" />
<country
name=""
english_name="Switzerland"
name_code="ch"
phone_code="41" />
<country
name=" "
english_name="Cte D'ivoire"
name_code="ci"
phone_code="225" />
<country
name=" "
english_name="Cook Islands"
name_code="ck"
phone_code="682" />
<country
name=""
english_name="Chile"
name_code="cl"
phone_code="56" />
<country
name=""
english_name="Cameroon"
name_code="cm"
phone_code="237" />
<country
name=""
english_name="China"
name_code="cn"
phone_code="86" />
<country
name=""
english_name="Colombia"
name_code="co"
phone_code="57" />
<country
name=" "
english_name="Costa Rica"
name_code="cr"
phone_code="506" />
<country
name=""
english_name="Cuba"
name_code="cu"
phone_code="53" />
<country
name=" "
english_name="Cape Verde"
name_code="cv"
phone_code="238" />
<country
name=""
english_name="Curaao"
name_code="cw"
phone_code="599" />
<country
name=" "
english_name="Christmas Island"
name_code="cx"
phone_code="61" />
<country
name=""
english_name="Cyprus"
name_code="cy"
phone_code="357" />
<country
name=" "
english_name="Czech Republic"
name_code="cz"
phone_code="420" />
<country
name=""
english_name="Germany"
name_code="de"
phone_code="49" />
<country
name=""
english_name="Djibouti"
name_code="dj"
phone_code="253" />
<country
name=""
english_name="Denmark"
name_code="dk"
phone_code="45" />
<country
name=""
english_name="Dominica"
name_code="dm"
phone_code="1" />
<country
name=" "
english_name="Dominican Republic"
name_code="do"
phone_code="1" />
<country
name=""
english_name="Algeria"
name_code="dz"
phone_code="213" />
<country
name=""
english_name="Ecuador"
name_code="ec"
phone_code="593" />
<country
name=""
english_name="Estonia"
name_code="ee"
phone_code="372" />
<country
name=""
english_name="Egypt"
name_code="eg"
phone_code="20" />
<country
name=""
english_name="Eritrea"
name_code="er"
phone_code="291" />
<country
name=""
english_name="Spain"
name_code="es"
phone_code="34" />
<country
name=""
english_name="Ethiopia"
name_code="et"
phone_code="251" />
<country
name=""
english_name="Finland"
name_code="fi"
phone_code="358" />
<country
name=" "
english_name="Fiji"
name_code="fj"
phone_code="679" />
<country
name=" ()"
english_name="Falkland Islands (malvinas)"
name_code="fk"
phone_code="500" />
<country
name=" "
english_name="Micronesia, Federated States Of"
name_code="fm"
phone_code="691" />
<country
name=" "
english_name="Faroe Islands"
name_code="fo"
phone_code="298" />
<country
name=""
english_name="France"
name_code="fr"
phone_code="33" />
<country
name=""
english_name="Gabon"
name_code="ga"
phone_code="241" />
<country
name=" "
english_name="United Kingdom"
name_code="gb"
phone_code="44" />
<country
name=""
english_name="Grenada"
name_code="gd"
phone_code="1" />
<country
name=""
english_name="Georgia"
name_code="ge"
phone_code="995" />
<country
name=" "
english_name="French Guyana"
name_code="gf"
phone_code="594" />
<country
name=""
english_name="Guernsey"
name_code="gg"
phone_code="44" />
<country
name=""
english_name="Ghana"
name_code="gh"
phone_code="233" />
<country
name=""
english_name="Gibraltar"
name_code="gi"
phone_code="350" />
<country
name=""
english_name="Greenland"
name_code="gl"
phone_code="299" />
<country
name=""
english_name="Gambia"
name_code="gm"
phone_code="220" />
<country
name=""
english_name="Guinea"
name_code="gn"
phone_code="224" />
<country
name=""
english_name="Guadeloupe"
name_code="gp"
phone_code="590" />
<country
name=" "
english_name="Equatorial Guinea"
name_code="gq"
phone_code="240" />
<country
name=""
english_name="Greece"
name_code="gr"
phone_code="30" />
<country
name=""
english_name="Guatemala"
name_code="gt"
phone_code="502" />
<country
name=""
english_name="Guam"
name_code="gu"
phone_code="1" />
<country
name="-"
english_name="Guinea-bissau"
name_code="gw"
phone_code="245" />
<country
name=""
english_name="Guyana"
name_code="gy"
phone_code="592" />
<country
name=" "
english_name="Hong Kong"
name_code="hk"
phone_code="852" />
<country
name=""
english_name="Honduras"
name_code="hn"
phone_code="504" />
<country
name=""
english_name="Croatia"
name_code="hr"
phone_code="385" />
<country
name=""
english_name="Haiti"
name_code="ht"
phone_code="509" />
<country
name=""
english_name="Hungary"
name_code="hu"
phone_code="36" />
<country
name=""
english_name="Indonesia"
name_code="id"
phone_code="62" />
<country
name=""
english_name="Ireland"
name_code="ie"
phone_code="353" />
<country
name=""
english_name="Israel"
name_code="il"
phone_code="972" />
<country
name=" "
english_name="Isle Of Man"
name_code="im"
phone_code="44" />
<country
name=""
english_name="Iceland"
name_code="is"
phone_code="354" />
<country
name=""
english_name="India"
name_code="in"
phone_code="91" />
<country
name="B "
english_name="British Indian Ocean Territory"
name_code="io"
phone_code="246" />
<country
name=""
english_name="Iraq"
name_code="iq"
phone_code="964" />
<country
name=" "
english_name="Iran, Islamic Republic Of"
name_code="ir"
phone_code="98" />
<country
name=""
english_name="Italy"
name_code="it"
phone_code="39" />
<country
name=""
english_name="Jersey"
name_code="je"
phone_code="44" />
<country
name=""
english_name="Jamaica"
name_code="jm"
phone_code="1" />
<country
name=""
english_name="Jordan"
name_code="jo"
phone_code="962" />
<country
name=""
english_name="Japan"
name_code="jp"
phone_code="81" />
<country
name=""
english_name="Kenya"
name_code="ke"
phone_code="254" />
<country
name=""
english_name="Kyrgyzstan"
name_code="kg"
phone_code="996" />
<country
name=""
english_name="Cambodia"
name_code="kh"
phone_code="855" />
<country
name=""
english_name="Kiribati"
name_code="ki"
phone_code="686" />
<country
name=""
english_name="Comoros"
name_code="km"
phone_code="269" />
<country
name=" "
english_name="Saint Kitts and Nevis"
name_code="kn"
phone_code="1" />
<country
name=" "
english_name="North Korea"
name_code="kp"
phone_code="850" />
<country
name=" "
english_name="South Korea"
name_code="kr"
phone_code="82" />
<country
name=""
english_name="Kuwait"
name_code="kw"
phone_code="965" />
<country
name=" "
english_name="Cayman Islands"
name_code="ky"
phone_code="1" />
<country
name=""
english_name="Kazakhstan"
name_code="kz"
phone_code="7" />
<country
name=" "
english_name="Lao People's Democratic Republic"
name_code="la"
phone_code="856" />
<country
name=""
english_name="Lebanon"
name_code="lb"
phone_code="961" />
<country
name=" "
english_name="Saint Lucia"
name_code="lc"
phone_code="1" />
<country
name=""
english_name="Liechtenstein"
name_code="li"
phone_code="423" />
<country
name=" "
english_name="Sri Lanka"
name_code="lk"
phone_code="94" />
<country
name=""
english_name="Liberia"
name_code="lr"
phone_code="231" />
<country
name=""
english_name="Lesotho"
name_code="ls"
phone_code="266" />
<country
name=""
english_name="Lithuania"
name_code="lt"
phone_code="370" />
<country
name=""
english_name="Luxembourg"
name_code="lu"
phone_code="352" />
<country
name=""
english_name="Latvia"
name_code="lv"
phone_code="371" />
<country
name=""
english_name="Libya"
name_code="ly"
phone_code="218" />
<country
name=""
english_name="Morocco"
name_code="ma"
phone_code="212" />
<country
name=""
english_name="Monaco"
name_code="mc"
phone_code="377" />
<country
name=" "
english_name="Moldova, Republic Of"
name_code="md"
phone_code="373" />
<country
name=""
english_name="Montenegro"
name_code="me"
phone_code="382" />
<country
name=" "
english_name="Saint Martin"
name_code="mf"
phone_code="590" />
<country
name=""
english_name="Madagascar"
name_code="mg"
phone_code="261" />
<country
name=" "
english_name="Marshall Islands"
name_code="mh"
phone_code="692" />
<country
name=" "
english_name="Macedonia (FYROM)"
name_code="mk"
phone_code="389" />
<country
name=""
english_name="Mali"
name_code="ml"
phone_code="223" />
<country
name=""
english_name="Myanmar"
name_code="mm"
phone_code="95" />
<country
name=""
english_name="Mongolia"
name_code="mn"
phone_code="976" />
<country
name=""
english_name="Macau"
name_code="mo"
phone_code="853" />
<country
name=" "
english_name="Northern Mariana Islands"
name_code="mp"
phone_code="1" />
<country
name=""
english_name="Martinique"
name_code="mq"
phone_code="596" />
<country
name=""
english_name="Mauritania"
name_code="mr"
phone_code="222" />
<country
name=""
english_name="Montserrat"
name_code="ms"
phone_code="1" />
<country
name=""
english_name="Malta"
name_code="mt"
phone_code="356" />
<country
name=""
english_name="Mauritius"
name_code="mu"
phone_code="230" />
<country
name=""
english_name="Maldives"
name_code="mv"
phone_code="960" />
<country
name=""
english_name="Malawi"
name_code="mw"
phone_code="265" />
<country
name=""
english_name="Mexico"
name_code="mx"
phone_code="52" />
<country
name=""
english_name="Malaysia"
name_code="my"
phone_code="60" />
<country
name=""
english_name="Mozambique"
name_code="mz"
phone_code="258" />
<country
name=""
english_name="Namibia"
name_code="na"
phone_code="264" />
<country
name=" "
english_name="New Caledonia"
name_code="nc"
phone_code="687" />
<country
name=""
english_name="Niger"
name_code="ne"
phone_code="227" />
<country
name=" "
english_name="Norfolk Islands"
name_code="nf"
phone_code="672" />
<country
name=""
english_name="Nigeria"
name_code="ng"
phone_code="234" />
<country
name=""
english_name="Nicaragua"
name_code="ni"
phone_code="505" />
<country
name=""
english_name="Netherlands"
name_code="nl"
phone_code="31" />
<country
name=""
english_name="Norway"
name_code="no"
phone_code="47" />
<country
name=""
english_name="Nepal"
name_code="np"
phone_code="977" />
<country
name=""
english_name="Nauru"
name_code="nr"
phone_code="674" />
<country
name=""
english_name="Niue"
name_code="nu"
phone_code="683" />
<country
name=" "
english_name="New Zealand"
name_code="nz"
phone_code="64" />
<country
name=""
english_name="Oman"
name_code="om"
phone_code="968" />
<country
name=""
english_name="Panama"
name_code="pa"
phone_code="507" />
<country
name=""
english_name="Peru"
name_code="pe"
phone_code="51" />
<country
name=" "
english_name="French Polynesia"
name_code="pf"
phone_code="689" />
<country
name=" "
english_name="Papua New Guinea"
name_code="pg"
phone_code="675" />
<country
name=""
english_name="Philippines"
name_code="ph"
phone_code="63" />
<country
name=""
english_name="Pakistan"
name_code="pk"
phone_code="92" />
<country
name=""
english_name="Poland"
name_code="pl"
phone_code="48" />
<country
name=" "
english_name="Saint Pierre And Miquelon"
name_code="pm"
phone_code="508" />
<country
name=" "
english_name="Pitcairn Islands"
name_code="pn"
phone_code="870" />
<country
name=" "
english_name="Puerto Rico"
name_code="pr"
phone_code="1" />
<country
name=""
english_name="Palestine"
name_code="ps"
phone_code="970" />
<country
name=""
english_name="Portugal"
name_code="pt"
phone_code="351" />
<country
name=""
english_name="Palau"
name_code="pw"
phone_code="680" />
<country
name=""
english_name="Paraguay"
name_code="py"
phone_code="595" />
<country
name=""
english_name="Qatar"
name_code="qa"
phone_code="974" />
<country
name=""
english_name="Runion"
name_code="re"
phone_code="262" />
<country
name=""
english_name="Romania"
name_code="ro"
phone_code="40" />
<country
name=""
english_name="Serbia"
name_code="rs"
phone_code="381" />
<country
name=" "
english_name="Russian Federation"
name_code="ru"
phone_code="7" />
<country
name=""
english_name="Rwanda"
name_code="rw"
phone_code="250" />
<country
name=" "
english_name="Saudi Arabia"
name_code="sa"
phone_code="966" />
<country
name=" "
english_name="Solomon Islands"
name_code="sb"
phone_code="677" />
<country
name=""
english_name="Seychelles"
name_code="sc"
phone_code="248" />
<country
name=""
english_name="Sudan"
name_code="sd"
phone_code="249" />
<country
name=""
english_name="Sweden"
name_code="se"
phone_code="46" />
<country
name=""
english_name="Singapore"
name_code="sg"
phone_code="65" />
<country
name=" "
english_name="Saint Helena, Ascension And Tristan Da Cunha"
name_code="sh"
phone_code="290" />
<country
name=""
english_name="Slovenia"
name_code="si"
phone_code="386" />
<country
name=""
english_name="Slovakia"
name_code="sk"
phone_code="421" />
<country
name=" "
english_name="Sierra Leone"
name_code="sl"
phone_code="232" />
<country
name=" "
english_name="San Marino"
name_code="sm"
phone_code="378" />
<country
name=""
english_name="Senegal"
name_code="sn"
phone_code="221" />
<country
name=""
english_name="Somalia"
name_code="so"
phone_code="252" />
<country
name=""
english_name="Suriname"
name_code="sr"
phone_code="597" />
<country
name=" "
english_name="South Sudan"
name_code="ss"
phone_code="211" />
<country
name=" "
english_name="Sao Tome And Principe"
name_code="st"
phone_code="239" />
<country
name=" "
english_name="El Salvador"
name_code="sv"
phone_code="503" />
<country
name=" "
english_name="Sint Maarten"
name_code="sx"
phone_code="1" />
<country
name=" "
english_name="Syrian Arab Republic"
name_code="sy"
phone_code="963" />
<country
name=""
english_name="Swaziland"
name_code="sz"
phone_code="268" />
<country
name=" "
english_name="Turks and Caicos Islands"
name_code="tc"
phone_code="1" />
<country
name=""
english_name="Chad"
name_code="td"
phone_code="235" />
<country
name=""
english_name="Togo"
name_code="tg"
phone_code="228" />
<country
name=""
english_name="Thailand"
name_code="th"
phone_code="66" />
<country
name=""
english_name="Tajikistan"
name_code="tj"
phone_code="992" />
<country
name=""
english_name="Tokelau"
name_code="tk"
phone_code="690" />
<country
name=" "
english_name="Timor-leste"
name_code="tl"
phone_code="670" />
<country
name=""
english_name="Turkmenistan"
name_code="tm"
phone_code="993" />
<country
name=""
english_name="Tunisia"
name_code="tn"
phone_code="216" />
<country
name=""
english_name="Tonga"
name_code="to"
phone_code="676" />
<country
name=""
english_name="Turkey"
name_code="tr"
phone_code="90" />
<country
name=" "
english_name="Trinidad & Tobago"
name_code="tt"
phone_code="1" />
<country
name=""
english_name="Tuvalu"
name_code="tv"
phone_code="688" />
<country
name=""
english_name="Taiwan"
name_code="tw"
phone_code="886" />
<country
name=" "
english_name="Tanzania, United Republic Of"
name_code="tz"
phone_code="255" />
<country
name=""
english_name="Ukraine"
name_code="ua"
phone_code="380" />
<country
name=""
english_name="Uganda"
name_code="ug"
phone_code="256" />
<country
name=" ()"
english_name="United States (USA)"
name_code="us"
phone_code="1" />
<country
name=""
english_name="Uruguay"
name_code="uy"
phone_code="598" />
<country
name=""
english_name="Uzbekistan"
name_code="uz"
phone_code="998" />
<country
name=" ( ) "
english_name="Holy See (vatican City State)"
name_code="va"
phone_code="379" />
<country
name=" "
english_name="Saint Vincent & The Grenadines"
name_code="vc"
phone_code="1" />
<country
name=" "
english_name="Venezuela, Bolivarian Republic Of"
name_code="ve"
phone_code="58" />
<country
name=" "
english_name="British Virgin Islands"
name_code="vg"
phone_code="1" />
<country
name=" "
english_name="US Virgin Islands"
name_code="vi"
phone_code="1" />
<country
name=""
english_name="Vietnam"
name_code="vn"
phone_code="84" />
<country
name=""
english_name="Vanuatu"
name_code="vu"
phone_code="678" />
<country
name=" "
english_name="Wallis And Futuna"
name_code="wf"
phone_code="681" />
<country
name=""
english_name="Samoa"
name_code="ws"
phone_code="685" />
<country
name=""
english_name="Kosovo"
name_code="xk"
phone_code="383" />
<country
name=""
english_name="Yemen"
name_code="ye"
phone_code="967" />
<country
name=""
english_name="Mayotte"
name_code="yt"
phone_code="262" />
<country
name=" "
english_name="South Africa"
name_code="za"
phone_code="27" />
<country
name=""
english_name="Zambia"
name_code="zm"
phone_code="260" />
<country
name=""
english_name="Zimbabwe"
name_code="zw"
phone_code="263" />
</countries>
</data>
``` | /content/code_sandbox/ccp/src/main/res/raw/ccp_greek.xml | xml | 2016-01-20T10:28:34 | 2024-08-13T16:24:01 | CountryCodePickerProject | hbb20/CountryCodePickerProject | 1,506 | 6,937 |
```xml
import { Component, OnInit, ViewChild } from '@angular/core';
import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
import { MatSidenav } from '@angular/material/sidenav';
import { filter } from 'rxjs/operators';
import { UntilDestroy, untilDestroyed } from '@shared';
@UntilDestroy()
@Component({
selector: 'app-shell',
templateUrl: './shell.component.html',
styleUrls: ['./shell.component.scss']
})
export class ShellComponent implements OnInit {
@ViewChild('sidenav', { static: false }) sidenav!: MatSidenav;
constructor(private breakpoint: BreakpointObserver) { }
ngOnInit() {
// Automatically close side menu on screens > small breakpoint
this.breakpoint
.observe([Breakpoints.Small, Breakpoints.XSmall])
.pipe(
filter(({ matches }) => !matches),
untilDestroyed(this)
)
.subscribe(() => this.sidenav.close());
}
}
``` | /content/code_sandbox/generators/app/templates/src/app/shell/__material-simple.shell.component.ts | xml | 2016-04-27T19:11:10 | 2024-08-15T11:32:04 | generator-ngx-rocket | ngx-rocket/generator-ngx-rocket | 1,525 | 198 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"path_to_url">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.datasource">java:comp/env/jdbc/MyLocalDB</property>
<property name="hibernate.current_session_context_class">thread</property>
<!-- Mapping with model class containing annotations -->
<mapping class="com.journaldev.servlet.hibernate.model.Employee"/>
</session-factory>
</hibernate-configuration>
``` | /content/code_sandbox/Hibernate/HibernateDataSource/src/main/resources/hibernate.cfg.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 179 |
```xml
import { IRenderListDataAsStreamResult as IRenderListDataAsStreamResult_PNP } from "@pnp/sp/lists/types";
import { IListItemResult } from "./IListItemResult";
export interface IRenderListDataAsStreamResult<T extends IListItemResult> extends IRenderListDataAsStreamResult_PNP {
readonly NextHref: string;
readonly PrevHref: string;
readonly Row: T[];
}
``` | /content/code_sandbox/samples/react-rhythm-of-business-calendar/src/common/sharepoint/query_/IRenderListDataAsStreamResult.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 84 |
```xml
export const DEFAULT_ENCODING = 'utf8';
``` | /content/code_sandbox/src/client/common/process/constants.ts | xml | 2016-01-19T10:50:01 | 2024-08-12T21:05:24 | pythonVSCode | DonJayamanne/pythonVSCode | 2,078 | 11 |
```xml
import { Android, ExpoConfig, IOS } from '@expo/config-types';
import { getRuntimeVersionForSDKVersion } from '@expo/sdk-runtime-versions';
import fs from 'fs';
import { boolish } from 'getenv';
import path from 'path';
import resolveFrom from 'resolve-from';
import semver from 'semver';
import { AndroidConfig, IOSConfig } from '..';
export type ExpoConfigUpdates = Pick<
ExpoConfig,
'sdkVersion' | 'owner' | 'runtimeVersion' | 'updates' | 'slug'
>;
export const FINGERPRINT_RUNTIME_VERSION_SENTINEL = 'file:fingerprint';
export function getExpoUpdatesPackageVersion(projectRoot: string): string | null {
const expoUpdatesPackageJsonPath = resolveFrom.silent(projectRoot, 'expo-updates/package.json');
if (!expoUpdatesPackageJsonPath || !fs.existsSync(expoUpdatesPackageJsonPath)) {
return null;
}
const packageJson = JSON.parse(fs.readFileSync(expoUpdatesPackageJsonPath, 'utf8'));
return packageJson.version;
}
export function getUpdateUrl(config: Pick<ExpoConfigUpdates, 'updates'>): string | null {
return config.updates?.url ?? null;
}
export function getAppVersion(config: Pick<ExpoConfig, 'version'>): string {
return config.version ?? '1.0.0';
}
export function getNativeVersion(
config: Pick<ExpoConfig, 'version'> & {
android?: Pick<Android, 'versionCode'>;
ios?: Pick<IOS, 'buildNumber'>;
},
platform: 'android' | 'ios'
): string {
const version = IOSConfig.Version.getVersion(config);
switch (platform) {
case 'ios': {
const buildNumber = IOSConfig.Version.getBuildNumber(config);
return `${version}(${buildNumber})`;
}
case 'android': {
const versionCode = AndroidConfig.Version.getVersionCode(config);
return `${version}(${versionCode})`;
}
default: {
throw new Error(
`"${platform}" is not a supported platform. Choose either "ios" or "android".`
);
}
}
}
export async function getRuntimeVersionNullableAsync(
...[projectRoot, config, platform]: Parameters<typeof getRuntimeVersionAsync>
): Promise<string | null> {
try {
return await getRuntimeVersionAsync(projectRoot, config, platform);
} catch (e) {
if (boolish('EXPO_DEBUG', false)) {
console.log(e);
}
return null;
}
}
export async function getRuntimeVersionAsync(
projectRoot: string,
config: Pick<ExpoConfig, 'version' | 'runtimeVersion' | 'sdkVersion'> & {
android?: Pick<Android, 'versionCode' | 'runtimeVersion'>;
ios?: Pick<IOS, 'buildNumber' | 'runtimeVersion'>;
},
platform: 'android' | 'ios'
): Promise<string | null> {
const runtimeVersion = config[platform]?.runtimeVersion ?? config.runtimeVersion;
if (!runtimeVersion) {
return null;
}
if (typeof runtimeVersion === 'string') {
if (runtimeVersion === FINGERPRINT_RUNTIME_VERSION_SENTINEL) {
throw new Error(
`${FINGERPRINT_RUNTIME_VERSION_SENTINEL} is a reserved value for runtime version. To use a fingerprint runtime version, use the "fingerprint" runtime version policy.`
);
}
return runtimeVersion;
} else if (!runtimeVersion.policy) {
throw new Error(
`"${runtimeVersion}" is not a valid runtime version. Only a string or a runtime version policy is supported.`
);
} else if (runtimeVersion.policy === 'fingerprint') {
return FINGERPRINT_RUNTIME_VERSION_SENTINEL;
} else {
return await resolveRuntimeVersionPolicyAsync(runtimeVersion.policy, config, platform);
}
}
export async function resolveRuntimeVersionPolicyAsync(
policy: 'appVersion' | 'nativeVersion' | 'sdkVersion',
config: Pick<ExpoConfig, 'version' | 'sdkVersion'> & {
android?: Pick<Android, 'versionCode'>;
ios?: Pick<IOS, 'buildNumber'>;
},
platform: 'android' | 'ios'
): Promise<string> {
if (policy === 'appVersion') {
return getAppVersion(config);
} else if (policy === 'nativeVersion') {
return getNativeVersion(config, platform);
} else if (policy === 'sdkVersion') {
if (!config.sdkVersion) {
throw new Error("An SDK version must be defined when using the 'sdkVersion' runtime policy.");
}
return getRuntimeVersionForSDKVersion(config.sdkVersion);
} else {
// fingerprint is resolvable only at build time (not in config plugin).
throw new Error(`"${policy}" is not a valid runtime version policy type.`);
}
}
export function getSDKVersion(config: Pick<ExpoConfigUpdates, 'sdkVersion'>): string | null {
return typeof config.sdkVersion === 'string' ? config.sdkVersion : null;
}
export function getUpdatesEnabled(config: Pick<ExpoConfigUpdates, 'updates'>): boolean {
// allow override of enabled property
if (config.updates?.enabled !== undefined) {
return config.updates.enabled;
}
return getUpdateUrl(config) !== null;
}
export function getUpdatesTimeout(config: Pick<ExpoConfigUpdates, 'updates'>): number {
return config.updates?.fallbackToCacheTimeout ?? 0;
}
export function getUpdatesCheckOnLaunch(
config: Pick<ExpoConfigUpdates, 'updates'>,
expoUpdatesPackageVersion?: string | null
): 'NEVER' | 'ERROR_RECOVERY_ONLY' | 'ALWAYS' | 'WIFI_ONLY' {
if (config.updates?.checkAutomatically === 'ON_ERROR_RECOVERY') {
// native 'ERROR_RECOVERY_ONLY' option was only introduced in 0.11.x
if (expoUpdatesPackageVersion && semver.gte(expoUpdatesPackageVersion, '0.11.0')) {
return 'ERROR_RECOVERY_ONLY';
}
return 'NEVER';
} else if (config.updates?.checkAutomatically === 'ON_LOAD') {
return 'ALWAYS';
} else if (config.updates?.checkAutomatically === 'WIFI_ONLY') {
return 'WIFI_ONLY';
} else if (config.updates?.checkAutomatically === 'NEVER') {
return 'NEVER';
}
return 'ALWAYS';
}
export function getUpdatesCodeSigningCertificate(
projectRoot: string,
config: Pick<ExpoConfigUpdates, 'updates'>
): string | undefined {
const codeSigningCertificatePath = config.updates?.codeSigningCertificate;
if (!codeSigningCertificatePath) {
return undefined;
}
const finalPath = path.join(projectRoot, codeSigningCertificatePath);
if (!fs.existsSync(finalPath)) {
throw new Error(`File not found at \`updates.codeSigningCertificate\` path: ${finalPath}`);
}
return fs.readFileSync(finalPath, 'utf8');
}
export function getUpdatesCodeSigningMetadata(
config: Pick<ExpoConfigUpdates, 'updates'>
): NonNullable<ExpoConfigUpdates['updates']>['codeSigningMetadata'] {
return config.updates?.codeSigningMetadata;
}
export function getUpdatesCodeSigningMetadataStringified(
config: Pick<ExpoConfigUpdates, 'updates'>
): string | undefined {
const metadata = getUpdatesCodeSigningMetadata(config);
if (!metadata) {
return undefined;
}
return JSON.stringify(metadata);
}
export function getUpdatesRequestHeaders(
config: Pick<ExpoConfigUpdates, 'updates'>
): NonNullable<ExpoConfigUpdates['updates']>['requestHeaders'] {
return config.updates?.requestHeaders;
}
export function getUpdatesRequestHeadersStringified(
config: Pick<ExpoConfigUpdates, 'updates'>
): string | undefined {
const metadata = getUpdatesRequestHeaders(config);
if (!metadata) {
return undefined;
}
return JSON.stringify(metadata);
}
``` | /content/code_sandbox/packages/@expo/config-plugins/src/utils/Updates.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 1,738 |
```xml
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
import { IPropertyPaneConfiguration, PropertyPaneTextField, PropertyPaneToggle } from '@microsoft/sp-property-pane';
import TeamsTracker from './components/TeamsTracker';
import { graph } from '@pnp/graph';
// tidy up props and property pane
export interface ITeamsTrackerWebPartProps {
title: string;
description: string;
showChannels: boolean;
}
export default class TeamsTrackerWebPart extends BaseClientSideWebPart<ITeamsTrackerWebPartProps> {
public onInit(): Promise<void> {
return super.onInit().then(() => {
graph.setup({ spfxContext: this.context });
});
}
public render(): void {
ReactDom.render(React.createElement(TeamsTracker, this.properties), this.domElement);
}
protected onDispose(): void {
ReactDom.unmountComponentAtNode(this.domElement);
}
protected get dataVersion(): Version {
return Version.parse('1.0');
}
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return {
pages: [
{
header: {
description: "Properties"
},
groups: [
{
groupName: "General",
groupFields: [
PropertyPaneTextField('title', { label: "Web part title" }),
PropertyPaneTextField('description', { label: "Description Text" }),
PropertyPaneToggle('showChannels', { label: "Show channels" })
]
}
]
}
]
};
}
}
``` | /content/code_sandbox/samples/react-functional-component-with-data-fetch/src/webparts/teamsTracker/TeamsTrackerWebPart.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 360 |
```xml
import type { Plugin } from '@ice/app/types';
interface PluginOptions {
type: 'child' | 'framework';
library?: string;
}
const PLUGIN_NAME = '@ice/plugin-icestark';
const plugin: Plugin<PluginOptions> = ({ type, library }) => ({
name: PLUGIN_NAME,
setup: ({ onGetConfig, context, generator, modifyUserConfig }) => {
onGetConfig((config) => {
config.configureWebpack ??= [];
config.configureWebpack.push((webpackConfig) => {
if (type === 'child') {
const { pkg } = context;
webpackConfig.output.library = library || pkg.name as string || 'microApp';
webpackConfig.output.libraryTarget = 'umd';
}
return webpackConfig;
});
return config;
});
if (type === 'child') {
// Modify basename when render as a child app.
generator.modifyRenderData((data) => {
return {
...data,
basename: `(typeof window !== 'undefined' && window.ICESTARK?.basename || ${data.basename})`,
};
});
generator.addEntryCode(() => {
return `let root;
if (!window.ICESTARK?.root && !window.__POWERED_BY_QIANKUN__) {
root = render();
}
// For qiankun lifecycle validation.
export async function bootstrap(props) {
await app?.icestark?.bootstrap?.(props);
}
export async function mount(props) {
await app?.icestark?.mount?.(props);
// Avoid remount when app mount in other micro app framework.
if (!root) {
// When app mount in qiankun, do not use props passed by.
// Props of container if conflict with render node in ice, it may cause node overwritten.
let runtimeOptions = props;
if (props.singleSpa) {
const iceContainer = props.container?.querySelector('#ice-container');
if (iceContainer) {
runtimeOptions = {...props, container: iceContainer };
} else {
const ele = document.createElement('div');
ele.id = 'ice-container';
props.container.appendChild(ele);
runtimeOptions = {...props, container: ele };
}
}
root = render({ runtimeOptions });
}
await root;
}
export async function unmount(props) {
root?.then((res) => res.unmount());
await app?.icestark?.unmount?.(props);
// Reset root to null when app unmount.
root = null;
}`;
});
} else {
// Plugin icestark do not support ssr yet.
modifyUserConfig('ssr', false);
modifyUserConfig('ssg', false);
}
},
runtime: `${PLUGIN_NAME}/esm/runtime/${type === 'framework' ? 'framework' : 'child'}`,
});
export default plugin;
``` | /content/code_sandbox/packages/plugin-icestark/src/index.ts | xml | 2016-11-03T06:59:15 | 2024-08-16T10:11:29 | ice | alibaba/ice | 17,815 | 610 |
```xml
import * as React from 'react';
import { StoryWright, Steps } from 'storywright';
import { Meta } from '@storybook/react';
import { Datepicker, inputClassName } from '@fluentui/react-northstar';
import { datepickerCalendarCellSelector } from './utils';
import { getThemeStoryVariant } from '../utilities';
import DatepickerExampleClearable from '../../examples/components/Datepicker/Slots/DatepickerExampleClearable.shorthand';
export default {
component: Datepicker,
title: 'Datepicker',
decorators: [
story => (
<StoryWright
steps={new Steps()
.click(`.${inputClassName}`)
.click(datepickerCalendarCellSelector(16))
.snapshot('Shows selected date in input with clear possibility.')
.click(`.${inputClassName}__icon`)
.snapshot('Shows cleared input.')
.click(`.${inputClassName}`)
.snapshot('Shows cleared calendar.')
.end()}
>
{story()}
</StoryWright>
),
],
} as Meta<typeof Datepicker>;
const DatepickerExampleClearableTeams = getThemeStoryVariant(DatepickerExampleClearable, 'teamsV2');
const DatepickerExampleClearableTeamsDark = getThemeStoryVariant(DatepickerExampleClearable, 'teamsDarkV2');
const DatepickerExampleClearableTeamsHighContrast = getThemeStoryVariant(
DatepickerExampleClearable,
'teamsHighContrast',
);
export {
DatepickerExampleClearable,
DatepickerExampleClearableTeams,
DatepickerExampleClearableTeamsDark,
DatepickerExampleClearableTeamsHighContrast,
};
``` | /content/code_sandbox/packages/fluentui/docs/src/vr-tests/Datepicker/DatepickerExampleClearable.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 343 |
```xml
import {
BoxContent,
BoxHeader,
BoxedStep,
Boxes,
Card,
Header,
Left,
LinkedButton,
Setup,
SetupContent,
VideoFrame,
VideoLink,
} from "../styles";
import { COMMUNITY, DOCS, SETUP, STEPS, VIDEO } from "../constants";
import React, { useState } from "react";
import Button from "@erxes/ui/src/components/Button";
import { DescImg } from "@erxes/ui/src/components/HeaderDescription";
import Dropdown from "@erxes/ui/src/components/Dropdown";
import { IUser } from "@erxes/ui/src/auth/types";
import Icon from "@erxes/ui/src/components/Icon";
import ProgressBar from "@erxes/ui/src/components/ProgressBar";
import { WidgetBackgrounds } from "@erxes/ui-settings/src/styles";
import Wrapper from "modules/layout/components/Wrapper";
import _ from "lodash";
import { __ } from "modules/common/utils";
import { useNavigate } from "react-router-dom";
type Props = {
currentUser: IUser;
branchesLength: number;
departmentLength: number;
};
function Welcome({ currentUser, branchesLength, departmentLength }: Props) {
const navigate = useNavigate();
const { onboardingHistory } = currentUser;
const completedSteps = onboardingHistory && onboardingHistory.completedSteps;
const [collapsed, setCollapsed] = useState([] as string[]);
const handleClick = (id: string) => {
if (collapsed.includes(id)) {
const index = collapsed.indexOf(id);
setCollapsed(collapsed.splice(index, 1));
} else {
setCollapsed(collapsed.splice(1, 0, id));
}
};
let active = 0;
if (completedSteps && completedSteps.includes("generalSettingsCreate")) {
active = active + 1;
}
if (completedSteps && completedSteps.includes("brandCreate")) {
active = active + 1;
}
if (completedSteps && completedSteps.includes("userGroupCreate")) {
active = active + 1;
}
if (completedSteps && completedSteps.includes("userCreate")) {
active = active + 1;
}
if (branchesLength > 0 || departmentLength > 0) {
active = active + 1;
}
const renderUserName = () => {
if (!currentUser) {
return null;
}
if (currentUser.details) {
return currentUser.details.fullName;
}
if (currentUser.username) {
return `@${currentUser.username}`;
}
return null;
};
const renderHeader = () => {
return (
<Header>
<h1>
{__("Welcome!")} {renderUserName()}
<span role="img" aria-label="Wave">
</span>
</h1>
<div>
{__(
"Enjoy a single yet complete experience operating system (XOS) to build your own experience."
)}
<br />
{__(
"All-in-one cost-effective platform for customer service, marketing, sales, and employees. "
)}
</div>
</Header>
);
};
const renderBoxHeader = (
title: string,
handleOpen: () => void,
image?: string,
isOpen?: boolean
) => {
const percentage = Math.floor((active / 5) * 100);
const icon = isOpen ? "angle-down" : "angle-right";
return (
<BoxHeader
onClick={() => handleOpen()}
$isOpen={isOpen}
$isSetup={title === "Getting Started"}
>
<Left>
{image && <DescImg src={image} />}
<div>
<h4>{title}</h4>
</div>
</Left>
{title === "Getting Started" && (
<ProgressBar
percentage={percentage}
color={percentage === 100 ? "#3CCC38" : "#673FBD"}
type="circle"
height="70px"
/>
)}
{title !== "Getting Started" && (
<Icon icon={icon} size={25} color="#673FBD" />
)}
</BoxHeader>
);
};
const renderDocContent = (
title: string,
description: string,
url: string,
icon: string
) => {
return (
<LinkedButton href={url} target="_blank">
<Icon icon={icon} size={20} color="#888888" />
<div>
<h3>{title}</h3>
<span>{description}</span>
</div>
</LinkedButton>
);
};
const renderDocumentation = () => {
return (
<WidgetBackgrounds>
<Boxes>
{DOCS.slice(0, 2).map((item) =>
renderDocContent(item.title, item.desc, item.url, item.icon)
)}
</Boxes>
<Boxes>
{DOCS.slice(2, 4).map((item) =>
renderDocContent(item.title, item.desc, item.url, item.icon)
)}
</Boxes>
</WidgetBackgrounds>
);
};
const renderSetup = () => {
return SETUP.map((item) => {
const { url, title, icon, btnText, action } = item;
const [isOpen, setIsOpen] = useState(false);
const isComplete =
url === "/settings/structure"
? branchesLength > 0 || departmentLength > 0
: completedSteps?.includes(action);
const handleOpen = () => {
setIsOpen(!isOpen);
};
const dropdownIcon = isComplete
? "check"
: isOpen
? "uparrow"
: "downarrow-2";
return (
<Setup key={title}>
<LinkedButton onClick={() => handleOpen()}>
<Icon
icon={icon}
size={20}
color={isComplete ? "#3CCC38" : "#888888"}
/>
<div>
<h3>{title}</h3>
</div>
<Button
icon={dropdownIcon}
btnStyle={isComplete ? "success" : "link"}
size="small"
/>
</LinkedButton>
{isOpen && (
<SetupContent>
<div dangerouslySetInnerHTML={{ __html: item.content }} />
<Button onClick={() => navigate(url)}>{btnText}</Button>
</SetupContent>
)}
</Setup>
);
});
};
const renderVideo = (
title: string,
description: string,
icon: string,
url: string
) => {
return (
<Dropdown
toggleComponent={
<LinkedButton>
<Icon icon={icon} size={20} color="#888888" />
<div>
<h3>{title}</h3>
<span>{description}</span>
</div>
<VideoLink onClick={() => handleClick(title)}>
{__("Watch video")}
<Icon icon="play-1" size={15} color="#fff" />
</VideoLink>
</LinkedButton>
}
>
<VideoFrame>
<iframe
width="100%"
height="478"
src={url}
title="YouTube video player"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
/>
</VideoFrame>
</Dropdown>
);
};
const renderGuide = () => {
return (
<WidgetBackgrounds>
{VIDEO.map((item) => {
return renderVideo(item.title, item.desc, item.icon, item.url);
})}
</WidgetBackgrounds>
);
};
const renderCommunity = () => {
return (
<WidgetBackgrounds>
<h5>
Join our community to engage in discussions with team members,
contributors, and developers across various channels.
</h5>
<br />
{COMMUNITY.map((com, index) => (
<Button
key={index}
href={com.link}
btnStyle="simple"
icon={com.icon}
img={com.image}
iconColor="black"
target="_blank"
>
{com.name}
</Button>
))}
</WidgetBackgrounds>
);
};
const content = (
<>
{renderHeader()}
{STEPS.map((group, index) => {
const [isOpen, setIsOpen] = useState(
window.location.hash.includes(group.key) ? true : false
);
const handleOpen = () => {
if (group.key !== "setup") {
setIsOpen(!isOpen);
}
};
return (
<BoxedStep key={index}>
{renderBoxHeader(group.title, handleOpen, group.image, isOpen)}
{isOpen && (
<BoxContent>
{group.key === "documentation" && renderDocumentation()}
{group.key === "usingGuide" && renderGuide()}
{group.key === "community" && renderCommunity()}
</BoxContent>
)}
{group.key === "setup" && renderSetup()}
</BoxedStep>
);
})}
<React.Fragment>
<Card>
<div>
<h4>{__("Onboarding optimized for you")}</h4>
<p>{__("Contact us to start the onboarding process")}</p>
<br />
<Button
size="large"
btnStyle="white"
href={"path_to_url"}
target="_blank"
>
{__("Request")}
</Button>
</div>
</Card>
</React.Fragment>
</>
);
return (
<Wrapper
content={content}
transparent={true}
center={true}
initialOverflow={true}
/>
);
}
export default Welcome;
``` | /content/code_sandbox/packages/core-ui/src/modules/welcome/components/WelcomeOs.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 2,109 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="path_to_url"
xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="${jdbc.driver:org.h2.Driver}" />
<property name="url" value="${jdbc.url:jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000}" />
<property name="username" value="${jdbc.username:sa}" />
<property name="password" value="${jdbc.password:}" />
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="nextProcessEvaluator"
class="org.activiti.spring.test.expression.callactivity.NextProcessExecutionEvaluator"/>
<bean id="bean2" class="org.activiti.spring.test.servicetask.SentenceGenerator"/>
<bean id="processEngineConfiguration" class="org.flowable.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="databaseSchemaUpdate" value="true"/>
<property name="flowable5CompatibilityEnabled" value="true" />
<property name="flowable5CompatibilityHandlerFactory" ref="flowable5CompabilityFactory" />
<property name="asyncExecutorActivate" value="false"/>
</bean>
<bean id="processEngine" class="org.flowable.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration"/>
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/>
<bean id="flowable5CompabilityFactory" class="org.activiti.compatibility.spring.SpringFlowable5CompatibilityHandlerFactory" />
</beans>
``` | /content/code_sandbox/modules/flowable5-spring-test/src/test/resources/org/activiti/spring/test/expression/callactivity/testCallActivityByExpression-context.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 533 |
```xml
import { RepositoryStateCache } from '../../src/lib/stores/repository-state-cache'
import { Repository } from '../../src/models/repository'
import { PullRequest } from '../../src/models/pull-request'
import { GitHubRepository } from '../../src/models/github-repository'
import {
WorkingDirectoryStatus,
WorkingDirectoryFileChange,
AppFileStatusKind,
} from '../../src/models/status'
import { DiffSelection, DiffSelectionType } from '../../src/models/diff'
import { HistoryTabMode, IDisplayHistory } from '../../src/lib/app-state'
import { gitHubRepoFixture } from '../helpers/github-repo-builder'
import { StatsDatabase, StatsStore } from '../../src/lib/stats'
import { UiActivityMonitor } from '../../src/ui/lib/ui-activity-monitor'
import { fakePost } from '../fake-stats-post'
function createSamplePullRequest(gitHubRepository: GitHubRepository) {
return new PullRequest(
new Date(),
'something',
1,
{
ref: 'refs/heads/master',
sha: 'deadbeef',
gitHubRepository,
},
{
ref: 'refs/heads/my-cool-feature',
sha: 'deadbeef',
gitHubRepository,
},
'shiftkey',
false,
'something body'
)
}
describe('RepositoryStateCache', () => {
let repository: Repository
let statsStore: StatsStore
beforeEach(() => {
repository = new Repository('/something/path', 1, null, false)
statsStore = new StatsStore(
new StatsDatabase('test-StatsDatabase'),
new UiActivityMonitor(),
fakePost
)
})
it('can update branches state for a repository', () => {
const gitHubRepository = gitHubRepoFixture({
name: 'desktop',
owner: 'desktop',
})
const firstPullRequest = createSamplePullRequest(gitHubRepository)
const cache = new RepositoryStateCache(statsStore)
cache.updateBranchesState(repository, () => {
return {
openPullRequests: [firstPullRequest],
isLoadingPullRequests: true,
}
})
const { branchesState } = cache.get(repository)
expect(branchesState.isLoadingPullRequests).toBe(true)
expect(branchesState.openPullRequests).toHaveLength(1)
})
it('can update changes state for a repository', () => {
const files = [
new WorkingDirectoryFileChange(
'README.md',
{ kind: AppFileStatusKind.New },
DiffSelection.fromInitialSelection(DiffSelectionType.All)
),
]
const summary = 'Hello world!'
const cache = new RepositoryStateCache(statsStore)
cache.updateChangesState(repository, () => {
return {
workingDirectory: WorkingDirectoryStatus.fromFiles(files),
commitMessage: {
summary,
description: null,
},
showCoAuthoredBy: true,
}
})
const { changesState } = cache.get(repository)
expect(changesState.workingDirectory.includeAll).toBe(true)
expect(changesState.workingDirectory.files).toHaveLength(1)
expect(changesState.showCoAuthoredBy).toBe(true)
expect(changesState.commitMessage!.summary).toBe(summary)
})
it('can update compare state for a repository', () => {
const filterText = 'my-cool-branch'
const cache = new RepositoryStateCache(statsStore)
cache.updateCompareState(repository, () => {
const newState: IDisplayHistory = {
kind: HistoryTabMode.History,
}
return {
formState: newState,
filterText,
commitSHAs: ['deadbeef'],
}
})
const { compareState } = cache.get(repository)
expect(compareState.formState.kind).toBe(HistoryTabMode.History)
expect(compareState.filterText).toBe(filterText)
expect(compareState.commitSHAs).toHaveLength(1)
})
})
``` | /content/code_sandbox/app/test/unit/repository-state-cache-test.ts | xml | 2016-05-11T15:59:00 | 2024-08-16T17:00:41 | desktop | desktop/desktop | 19,544 | 825 |
```xml
import { EncString } from "../../../../platform/models/domain/enc-string";
import { SendType } from "../../enums/send-type";
import { SendTextApi } from "../../models/api/send-text.api";
import { SendTextData } from "../../models/data/send-text.data";
import { SendData } from "../../models/data/send.data";
import { Send } from "../../models/domain/send";
import { SendView } from "../../models/view/send.view";
export function testSendViewData(id: string, name: string) {
const data = new SendView({} as any);
data.id = id;
data.name = name;
data.disabled = false;
data.accessCount = 2;
data.accessId = "1";
data.revisionDate = null;
data.expirationDate = null;
data.deletionDate = null;
data.notes = "Notes!!";
data.key = null;
return data;
}
export function createSendData(value: Partial<SendData> = {}) {
const defaultSendData: Partial<SendData> = {
id: "1",
name: "Test Send",
accessId: "123",
type: SendType.Text,
notes: "notes!",
file: null,
text: new SendTextData(new SendTextApi({ Text: "send text" })),
key: "key",
maxAccessCount: 12,
accessCount: 2,
revisionDate: "2024-09-04",
expirationDate: "2024-09-04",
deletionDate: "2024-09-04",
password: "password",
disabled: false,
hideEmail: false,
};
const testSend: any = {};
for (const prop in defaultSendData) {
testSend[prop] = value[prop as keyof SendData] ?? defaultSendData[prop as keyof SendData];
}
return testSend;
}
export function testSendData(id: string, name: string) {
const data = new SendData({} as any);
data.id = id;
data.name = name;
data.disabled = false;
data.accessCount = 2;
data.accessId = "1";
data.revisionDate = null;
data.expirationDate = null;
data.deletionDate = null;
data.notes = "Notes!!";
data.key = null;
return data;
}
export function testSend(id: string, name: string) {
const data = new Send({} as any);
data.id = id;
data.name = new EncString(name);
data.disabled = false;
data.accessCount = 2;
data.accessId = "1";
data.revisionDate = null;
data.expirationDate = null;
data.deletionDate = null;
data.notes = new EncString("Notes!!");
data.key = null;
return data;
}
``` | /content/code_sandbox/libs/common/src/tools/send/services/test-data/send-tests.data.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 612 |
```xml
import { expect, galata, test } from '@jupyterlab/galata';
import * as path from 'path';
import {
dragCellTo,
notebookViewportRatio,
positionCellPartiallyBelowViewport
} from './utils';
const fileName = 'scroll.ipynb';
const longOutputsNb = 'long_outputs.ipynb';
test.use({
mockSettings: {
...galata.DEFAULT_SETTINGS,
'@jupyterlab/notebook-extension:tracker': {
...galata.DEFAULT_SETTINGS['@jupyterlab/notebook-extension:tracker'],
windowingMode: 'none'
}
}
});
test.describe('Notebook scroll on navigation (no windowing)', () => {
test.beforeEach(async ({ page, tmpPath }) => {
await page.contents.uploadFile(
path.resolve(__dirname, `./notebooks/${fileName}`),
`${tmpPath}/${fileName}`
);
await page.notebook.openByPath(`${tmpPath}/${fileName}`);
await page.notebook.activate(fileName);
});
test.afterEach(async ({ page, tmpPath }) => {
await page.contents.deleteDirectory(tmpPath);
});
const cellLinks = {
'penultimate cell using heading, legacy format': 18,
'penultimate cell using heading, explicit fragment': 18,
'last cell using heading, legacy format': 19,
'last cell using heading, explicit fragment': 19,
'last cell using cell identifier': 19
};
for (const [link, cellIdx] of Object.entries(cellLinks)) {
test(`Scroll to ${link}`, async ({ page }) => {
const firstCellLocator = page.locator(
'.jp-Cell[data-windowed-list-index="0"]'
);
const lastCellLocator = page.locator(
`.jp-Cell[data-windowed-list-index="${cellIdx}"]`
);
await firstCellLocator.scrollIntoViewIfNeeded();
await page.click(`a:has-text("${link}")`);
await expect(firstCellLocator).not.toBeInViewport();
await expect(lastCellLocator).toBeInViewport();
});
}
});
test.describe('Notebook scroll on dragging cells (no windowing)', () => {
test.beforeEach(async ({ page, tmpPath }) => {
await page.contents.uploadFile(
path.resolve(__dirname, `./notebooks/${fileName}`),
`${tmpPath}/${fileName}`
);
await page.notebook.openByPath(`${tmpPath}/${fileName}`);
await page.notebook.activate(fileName);
});
const NOTEBOOK_SCROLLER = '.jp-WindowedPanel-outer';
const NOTEBOOK_CONTENT = '.jp-WindowedPanel-inner';
const EDGE_MARGIN = 10;
test.afterEach(async ({ page, tmpPath }) => {
await page.contents.deleteDirectory(tmpPath);
});
test('Scroll down on dragging cell to the bottom edge', async ({ page }) => {
const firstCellLocator = page.locator(
'.jp-Cell[data-windowed-list-index="0"]'
);
const lastCellLocator = page.locator(
'.jp-Cell[data-windowed-list-index="19"]'
);
const scroller = page.locator(NOTEBOOK_SCROLLER);
await firstCellLocator.scrollIntoViewIfNeeded();
const scrollerBBox = await scroller.boundingBox();
const notebookContentHeight = (
await page.locator(NOTEBOOK_CONTENT).boundingBox()
).height;
// Ensure the notebook is scrolled correctly and last cell is not visible
const before = await scroller.evaluate(node => node.scrollTop);
expect(before).toBe(0);
await expect(lastCellLocator).not.toBeInViewport();
// Emulate drag and drop
await dragCellTo(page, {
cell: firstCellLocator,
x: scrollerBBox.x + 0.5 * scrollerBBox.width,
y: scrollerBBox.y + scrollerBBox.height - EDGE_MARGIN,
stopCondition: async () => {
const scrollTop = await scroller.evaluate(node => node.scrollTop);
return scrollTop >= notebookContentHeight - 100;
}
});
// The notebook should have scrolled down and the last cell should be visible
const after = await scroller.evaluate(node => node.scrollTop);
expect(after).toBeGreaterThan(before);
await expect(lastCellLocator).toBeInViewport();
});
test('Scroll up on dragging cell to the top edge', async ({ page }) => {
const firstCellLocator = page.locator(
'.jp-Cell[data-windowed-list-index="0"]'
);
const lastCellLocator = page.locator(
'.jp-Cell[data-windowed-list-index="19"]'
);
const scroller = page.locator(NOTEBOOK_SCROLLER);
const scrollerBBox = await scroller.boundingBox();
const notebookContentHeight = (
await page.locator(NOTEBOOK_CONTENT).boundingBox()
).height;
// Scroll notebook to the bottom, leaving top 200px visible
await page.mouse.move(
scrollerBBox.x + 0.5 * scrollerBBox.width,
scrollerBBox.y + 0.5 * scrollerBBox.height
);
await page.mouse.wheel(0, notebookContentHeight - 200);
await lastCellLocator.scrollIntoViewIfNeeded();
// Ensure the notebook is scrolled correctly and first cell is not visible
const before = await scroller.evaluate(node => node.scrollTop);
expect(before).toBeGreaterThan(notebookContentHeight * 0.75);
await expect(firstCellLocator).not.toBeInViewport();
// Emulate drag and drop
await dragCellTo(page, {
cell: lastCellLocator,
x: scrollerBBox.x + 0.5 * scrollerBBox.width,
y: scrollerBBox.y + EDGE_MARGIN,
stopCondition: async () => {
const scrollTop = await scroller.evaluate(node => node.scrollTop);
return scrollTop <= 50;
}
});
// The notebook should have scrolled up and the first cell should be visible
const after = await scroller.evaluate(node => node.scrollTop);
expect(after).toBeLessThan(before);
await expect(firstCellLocator).toBeInViewport();
});
});
test.describe('Notebook scroll on execution (no windowing)', () => {
test.beforeEach(async ({ page, tmpPath }) => {
await page.contents.uploadFile(
path.resolve(__dirname, `./notebooks/${longOutputsNb}`),
`${tmpPath}/${longOutputsNb}`
);
await page.notebook.openByPath(`${tmpPath}/${longOutputsNb}`);
await page.notebook.activate(longOutputsNb);
});
test.afterEach(async ({ page, tmpPath }) => {
await page.contents.deleteDirectory(tmpPath);
});
test('should scroll when advancing if top is only marginally visible', async ({
page
}) => {
const notebook = await page.notebook.getNotebookInPanelLocator();
const thirdCell = await page.notebook.getCellLocator(2);
await positionCellPartiallyBelowViewport(page, notebook!, thirdCell!, 0.01);
// Select second cell
await page.notebook.selectCells(1);
// The third cell should be positioned at the bottom, revealing between 0 to 2% of its content.
await expect(thirdCell!).toBeInViewport({ ratio: 0.0 });
await expect(thirdCell!).not.toBeInViewport({ ratio: 0.02 });
// Only a small fraction of notebook viewport should be taken up by that cell
expect(await notebookViewportRatio(notebook!, thirdCell!)).toBeLessThan(
0.1
);
// Run second cell
await page.notebook.runCell(1);
// After running the second cell, the third cell should be revealed, in at least 10%
await expect(thirdCell!).toBeInViewport({ ratio: 0.1 });
// The third cell should now occupy about half of the notebook viewport
expect(await notebookViewportRatio(notebook!, thirdCell!)).toBeGreaterThan(
0.4
);
});
test('should not scroll when advancing if top is non-marginally visible', async ({
page
}) => {
const notebook = await page.notebook.getNotebookInPanelLocator();
const thirdCell = await page.notebook.getCellLocator(2);
await positionCellPartiallyBelowViewport(page, notebook!, thirdCell!, 0.15);
// Select second cell
await page.notebook.selectCells(1);
// The third cell should be positioned at the bottom, revealing between 10 to 20% of its content.
await expect(thirdCell!).toBeInViewport({ ratio: 0.1 });
await expect(thirdCell!).not.toBeInViewport({ ratio: 0.2 });
// This cell should initially take up between 30% and 50% of the notebook viewport
let spaceTaken = await notebookViewportRatio(notebook!, thirdCell!);
expect(spaceTaken).toBeGreaterThan(0.3);
expect(spaceTaken).toBeLessThan(0.5);
// Run second cell
await page.notebook.runCell(1);
// After running the second cell, the third cell should not be scrolled
await expect(thirdCell!).not.toBeInViewport({ ratio: 0.2 });
// The cell should still take up between 30% and 50% of the notebook viewport
spaceTaken = await notebookViewportRatio(notebook!, thirdCell!);
expect(spaceTaken).toBeGreaterThan(0.3);
expect(spaceTaken).toBeLessThan(0.5);
});
test('should not scroll when running in-place', async ({ page }) => {
const notebook = await page.notebook.getNotebookInPanelLocator();
const thirdCell = await page.notebook.getCellLocator(2);
await positionCellPartiallyBelowViewport(page, notebook!, thirdCell!, 0.15);
// Select third cell
await page.notebook.enterCellEditingMode(2);
// The third cell should be positioned at the bottom, revealing between 10 to 20% of its content.
await expect(thirdCell!).toBeInViewport({ ratio: 0.1 });
await expect(thirdCell!).not.toBeInViewport({ ratio: 0.2 });
// Run third cell in-place
await page.notebook.runCell(2, true);
// After running the third cell it should not be scrolled
await expect(thirdCell!).not.toBeInViewport({ ratio: 0.2 });
// The galata implementation of `page.notebook.runCell(2, true);`
// first switches to command mode before cell execution,
// so we want to also check if this works from edit mode too.
await page.keyboard.press('Control+Enter');
// After running the third cell it should not be scrolled
await expect(thirdCell!).not.toBeInViewport({ ratio: 0.2 });
});
});
test.describe('Notebook scroll over long outputs (no windowing)', () => {
const outputAndHeading = 'long_output_and_headings.ipynb';
test.beforeEach(async ({ page, tmpPath }) => {
await page.contents.uploadFile(
path.resolve(__dirname, `./notebooks/${outputAndHeading}`),
`${tmpPath}/${outputAndHeading}`
);
await page.notebook.openByPath(`${tmpPath}/${outputAndHeading}`);
await page.notebook.activate(outputAndHeading);
});
test.afterEach(async ({ page, tmpPath }) => {
await page.contents.deleteDirectory(tmpPath);
});
test('should scroll smoothly without snapping to headings', async ({
page
}) => {
const renderedMarkdownLocator = page.locator(
'.jp-Cell .jp-RenderedMarkdown:has-text("Before")'
);
// Wait until Markdown cells are rendered
await renderedMarkdownLocator.waitFor({ timeout: 100 });
// Un-render the "before" markdown cell
await renderedMarkdownLocator.dblclick();
// Make the first cell active
await page.notebook.selectCells(0);
// Check that that the markdown cell is un-rendered
await renderedMarkdownLocator.waitFor({ state: 'hidden', timeout: 100 });
// Scroll to the last cell
const lastCell = await page.notebook.getCellLocator(10);
await lastCell!.scrollIntoViewIfNeeded();
// Get the outer window
const outer = page.locator('.jp-WindowedPanel-outer');
let previousOffset = await outer.evaluate(node => node.scrollTop);
expect(previousOffset).toBeGreaterThan(1000);
// Scroll piece by piece checking that there is no jump
while (previousOffset > 75) {
await page.mouse.wheel(0, -100);
// Explicit wait because mouse wheel does not wait for scrolling.
await page.waitForTimeout(150);
const offset = await outer.evaluate(node => node.scrollTop);
const diff = previousOffset - offset;
// The scroll should be by about 100px, but because wheel event
// does not wait we allow for some wiggle room (+/-25px).
expect(diff).toBeLessThanOrEqual(125);
expect(diff).toBeGreaterThan(75);
previousOffset = offset;
}
});
});
``` | /content/code_sandbox/galata/test/jupyterlab/notebook-scroll-no-windowing.test.ts | xml | 2016-06-03T20:09:17 | 2024-08-16T19:12:44 | jupyterlab | jupyterlab/jupyterlab | 14,019 | 2,834 |
```xml
import { Editor, EditorInterface } from '../interfaces/editor'
export const start: EditorInterface['start'] = (editor, at) => {
return Editor.point(editor, at, { edge: 'start' })
}
``` | /content/code_sandbox/packages/slate/src/editor/start.ts | xml | 2016-06-18T01:52:42 | 2024-08-16T18:43:42 | slate | ianstormtaylor/slate | 29,492 | 46 |
```xml
<test>
<settings>
<allow_experimental_object_type>1</allow_experimental_object_type>
</settings>
<!-- Looks like the only way to use json in test's queries is to put them to substitution.
Otherwise jsons are interpreted as substitutions themselves -->
<substitutions>
<substitution>
<name>json1</name>
<values>
<value>'{"k1":1, "k2": "some"}'</value>
</values>
</substitution>
<substitution>
<name>json2</name>
<values>
<value>'{"col' || toString(number % 100) || '":' || toString(number) || '}'</value>
</values>
</substitution>
<substitution>
<name>json3</name>
<values>
<value>'{"k1":[{"k2":"aaa","k3":[{"k4":"bbb"},{"k4":"ccc"}]},{"k2":"ddd","k3":[{"k4":"eee"},{"k4":"fff"}]}]}'</value>
</values>
</substitution>
</substitutions>
<create_query>CREATE TABLE t_json_1(data Object('json')) ENGINE = MergeTree ORDER BY tuple()</create_query>
<create_query>CREATE TABLE t_json_2(data Object('json')) ENGINE = MergeTree ORDER BY tuple()</create_query>
<create_query>CREATE TABLE t_json_3(data Object('json')) ENGINE = MergeTree ORDER BY tuple()</create_query>
<query>INSERT INTO t_json_1 SELECT materialize({json1}) FROM numbers(200000)</query>
<query>INSERT INTO t_json_2 SELECT {json2} FROM numbers(100000)</query>
<query>INSERT INTO t_json_3 SELECT materialize({json3}) FROM numbers_mt(100000)</query>
<drop_query>DROP TABLE IF EXISTS t_json_1</drop_query>
<drop_query>DROP TABLE IF EXISTS t_json_2</drop_query>
<drop_query>DROP TABLE IF EXISTS t_json_3</drop_query>
</test>
``` | /content/code_sandbox/tests/performance/json_type.xml | xml | 2016-06-02T08:28:18 | 2024-08-16T18:39:33 | ClickHouse | ClickHouse/ClickHouse | 36,234 | 459 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props"/>
<PropertyGroup>
<IsPackable>false</IsPackable>
<LangVersion>Latest</LangVersion>
<OutputType>exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Include="appsettings.json"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.0"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0"/>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.0"/>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\App.Metrics.Extensions.Configuration\App.Metrics.Extensions.Configuration.csproj"/>
<ProjectReference Include="..\..\src\App.Metrics.Extensions.DependencyInjection\App.Metrics.Extensions.DependencyInjection.csproj"/>
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
</Project>
``` | /content/code_sandbox/src/Extensions/sandbox/MetricsMicrosoftExtensionsSandbox/MetricsMicrosoftExtensionsSandbox.csproj | xml | 2016-11-20T04:39:02 | 2024-08-14T12:43:59 | AppMetrics | AppMetrics/AppMetrics | 2,215 | 304 |
```xml
<vector xmlns:android="path_to_url"
xmlns:aapt="path_to_url"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M11,6H37C38.657,6 40,7.343 40,9V39C40,40.657 38.657,42 37,42H11C9.343,42 8,40.657 8,39V9C8,7.343 9.343,6 11,6ZM16.195,29.639L29.378,16.455L31.107,18.172L17.917,31.361C17.861,31.417 17.799,31.466 17.732,31.507L14.276,33.624C14.052,33.761 13.795,33.504 13.932,33.28L16.049,29.824C16.09,29.757 16.139,29.694 16.195,29.639ZM33.417,15.861L31.74,17.539L30.017,15.816L31.694,14.139C32.17,13.664 32.941,13.664 33.417,14.139C33.892,14.615 33.892,15.386 33.417,15.861ZM13.5,35C13.224,35 13,35.224 13,35.5C13,35.776 13.224,36 13.5,36H38.5C38.776,36 39,35.776 39,35.5C39,35.224 38.776,35 38.5,35H13.5Z"
android:fillType="evenOdd">
<aapt:attr name="android:fillColor">
<gradient
android:startX="24"
android:startY="6"
android:endX="24"
android:endY="42"
android:type="linear">
<item android:offset="0" android:color="#FFFDC121"/>
<item android:offset="1" android:color="#FFF7A308"/>
</gradient>
</aapt:attr>
</path>
</vector>
``` | /content/code_sandbox/icon-pack/src/main/res/drawable/ic_pages_medium_solid.xml | xml | 2016-05-04T11:46:20 | 2024-08-15T16:29:10 | android | meganz/android | 1,537 | 539 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
path_to_url
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-->
<resources xmlns:android="path_to_url"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="bsp_done_label" msgid="7007948707597430919">"Valmis"</string>
<string name="bsp_hour_picker_description" msgid="7586639618712934060">"Ringikujuline tunniliugur"</string>
<string name="bsp_minute_picker_description" msgid="6024811202872705251">"Ringikujuline minutiliugur"</string>
<string name="bsp_select_hours" msgid="7651068754188418859">"Tundide valimine"</string>
<string name="bsp_select_minutes" msgid="8327182090226828481">"Minutite valimine"</string>
<string name="bsp_day_picker_description" msgid="3968620852217927702">"Pevad kuu ruudustikus"</string>
<string name="bsp_year_picker_description" msgid="6963340404644587098">"Aastate loend"</string>
<string name="bsp_select_day" msgid="3973338219107019769">"Valige kuu ja pev"</string>
<string name="bsp_select_year" msgid="2603330600102539372">"Valige aasta"</string>
<string name="bsp_item_is_selected" msgid="2674929164900463786">"<xliff:g id="ITEM">%1$s</xliff:g> on valitud"</string>
<string name="bsp_deleted_key" msgid="6908431551612331381">"<xliff:g id="KEY">%1$s</xliff:g> on kustutatud"</string>
</resources>
``` | /content/code_sandbox/bottomsheetpickers/src/main/res/values-et-rEE/strings.xml | xml | 2016-10-06T01:20:05 | 2024-08-05T10:12:07 | BottomSheetPickers | philliphsu/BottomSheetPickers | 1,101 | 441 |
```xml
import { IPropertyPaneCustomFieldProps } from "@microsoft/sp-property-pane";
import { IPropertyPaneAsyncDropdownProps } from './IPropertyPaneAsyncDropdownProps';
export interface IPropertyPaneAsyncDropdownInternalProps extends IPropertyPaneAsyncDropdownProps, IPropertyPaneCustomFieldProps { }
``` | /content/code_sandbox/samples/react-list-form/src/controls/PropertyPaneAsyncDropdown/IPropertyPaneAsyncDropdownInternalProps.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 62 |
```xml
<shapes name="mxgraph.electrical.abstract">
<shape aspect="variable" h="90" name="Amplifier" strokewidth="inherit" w="100">
<connections>
<constraint name="in" perimeter="0" x="0" y="0.5"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<path>
<move x="5" y="0"/>
<line x="95" y="45"/>
<line x="5" y="90"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="45"/>
<line x="5" y="45"/>
<move x="95" y="45"/>
<line x="100" y="45"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="Controlled Amplifier" strokewidth="inherit" w="100">
<connections>
<constraint name="control" perimeter="0" x="0.6" y="0.95"/>
<constraint name="in" perimeter="0" x="0" y="0.5"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<path>
<move x="5" y="0"/>
<line x="95" y="45"/>
<line x="5" y="90"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="45"/>
<line x="5" y="45"/>
<move x="95" y="45"/>
<line x="100" y="45"/>
<move x="60" y="85"/>
<line x="60" y="68"/>
</path>
<stroke/>
<path>
<move x="57" y="68"/>
<line x="60" y="63"/>
<line x="63" y="68"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="46" name="DAC" strokewidth="inherit" w="70">
<connections>
<constraint name="in" perimeter="0" x="0" y="0.5"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<path>
<move x="0" y="0"/>
<line x="45" y="0"/>
<line x="70" y="23"/>
<line x="45" y="46"/>
<line x="0" y="46"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="50" name="Delta" strokewidth="inherit" w="50">
<connections>
<constraint name="N" perimeter="0" x="0.5" y="0"/>
<constraint name="S" perimeter="0" x="0.5" y="1"/>
<constraint name="W" perimeter="0" x="0" y="0.5"/>
<constraint name="E" perimeter="0" x="1" y="0.5"/>
<constraint name="NW" perimeter="0" x="0.145" y="0.145"/>
<constraint name="SW" perimeter="0" x="0.145" y="0.855"/>
<constraint name="NE" perimeter="0" x="0.855" y="0.145"/>
<constraint name="SE" perimeter="0" x="0.855" y="0.855"/>
</connections>
<background>
<ellipse h="50" w="50" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="15" y="35"/>
<line x="25" y="15"/>
<line x="35" y="35"/>
<close/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="Demux" strokewidth="inherit" w="60">
<connections>
<constraint name="in" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.333"/>
<constraint name="out2" perimeter="0" x="1" y="0.445"/>
<constraint name="out3" perimeter="0" x="1" y="0.555"/>
<constraint name="out4" perimeter="0" x="1" y="0.667"/>
<constraint name="control1" perimeter="0" x="0.415" y="1"/>
<constraint name="control2" perimeter="0" x="0.585" y="1"/>
</connections>
<background>
<path>
<move x="10" y="0"/>
<line x="50" y="20"/>
<line x="50" y="70"/>
<line x="10" y="90"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="25" y="82.5"/>
<line x="25" y="90"/>
<move x="50" y="50"/>
<line x="60" y="50"/>
<move x="50" y="60"/>
<line x="60" y="60"/>
<move x="0" y="45"/>
<line x="10" y="45"/>
<move x="50" y="40"/>
<line x="60" y="40"/>
<move x="50" y="30"/>
<line x="60" y="30"/>
<move x="35" y="77.5"/>
<line x="35" y="90"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="46" name="Filter" strokewidth="inherit" w="52">
<connections>
<constraint name="in2" perimeter="0" x="0.5" y="0"/>
<constraint name="out2" perimeter="0" x="0.5" y="1"/>
<constraint name="in1" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<rect h="46" w="52" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="6" y="23"/>
<arc large-arc-flag="0" rx="15" ry="15" sweep-flag="1" x="26" x-axis-rotation="0" y="23"/>
<arc large-arc-flag="0" rx="15" ry="15" sweep-flag="0" x="46" x-axis-rotation="0" y="23"/>
<move x="6" y="13"/>
<arc large-arc-flag="0" rx="15" ry="15" sweep-flag="1" x="26" x-axis-rotation="0" y="13"/>
<arc large-arc-flag="0" rx="15" ry="15" sweep-flag="0" x="46" x-axis-rotation="0" y="13"/>
<move x="6" y="33"/>
<arc large-arc-flag="0" rx="15" ry="15" sweep-flag="1" x="26" x-axis-rotation="0" y="33"/>
<arc large-arc-flag="0" rx="15" ry="15" sweep-flag="0" x="46" x-axis-rotation="0" y="33"/>
<move x="22" y="35"/>
<line x="28" y="29"/>
<move x="22" y="15"/>
<line x="28" y="9"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="50" name="Function" strokewidth="inherit" w="50">
<connections>
<constraint name="in2" perimeter="0" x="0.5" y="0"/>
<constraint name="out2" perimeter="0" x="0.5" y="1"/>
<constraint name="in1" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<ellipse h="50" w="50" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="50" name="Integrator" strokewidth="inherit" w="50">
<connections>
<constraint name="in2" perimeter="0" x="0.5" y="0"/>
<constraint name="out2" perimeter="0" x="0.5" y="1"/>
<constraint name="in1" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<ellipse h="50" w="50" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="20" y="35"/>
<arc large-arc-flag="0" rx="2.5" ry="2.5" sweep-flag="0" x="25" x-axis-rotation="0" y="35"/>
<line x="25" y="15"/>
<arc large-arc-flag="0" rx="2.5" ry="2.5" sweep-flag="1" x="30" x-axis-rotation="0" y="15"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="50" name="Multiplier" strokewidth="inherit" w="50">
<connections>
<constraint name="in2" perimeter="0" x="0.5" y="0"/>
<constraint name="out2" perimeter="0" x="0.5" y="1"/>
<constraint name="in1" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<ellipse h="50" w="50" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="7.2" y="7.2"/>
<line x="42.8" y="42.8"/>
<move x="42.8" y="7.2"/>
<line x="7.2" y="42.8"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="Mux-Demux" strokewidth="inherit" w="60">
<connections>
<constraint name="in1" perimeter="0" x="0" y="0.055"/>
<constraint name="in2" perimeter="0" x="0" y="0.165"/>
<constraint name="in3" perimeter="0" x="0" y="0.275"/>
<constraint name="in4" perimeter="0" x="0" y="0.39"/>
<constraint name="in5" perimeter="0" x="0" y="0.5"/>
<constraint name="in6" perimeter="0" x="0" y="0.61"/>
<constraint name="in7" perimeter="0" x="0" y="0.72"/>
<constraint name="in8" perimeter="0" x="0" y="0.835"/>
<constraint name="in9" perimeter="0" x="0" y="0.945"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
<constraint name="control" perimeter="0" x="0.5" y="1"/>
</connections>
<background>
<path>
<move x="10" y="0"/>
<line x="50" y="20"/>
<line x="50" y="70"/>
<line x="10" y="90"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="30" y="80"/>
<line x="30" y="90"/>
<move x="50" y="45"/>
<line x="60" y="45"/>
<move x="0" y="85"/>
<line x="10" y="85"/>
<move x="0" y="75"/>
<line x="10" y="75"/>
<move x="0" y="65"/>
<line x="10" y="65"/>
<move x="0" y="55"/>
<line x="10" y="55"/>
<move x="0" y="45"/>
<line x="10" y="45"/>
<move x="0" y="35"/>
<line x="10" y="35"/>
<move x="0" y="25"/>
<line x="10" y="25"/>
<move x="0" y="15"/>
<line x="10" y="15"/>
<move x="0" y="5"/>
<line x="10" y="5"/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="Mux" strokewidth="inherit" w="60">
<connections>
<constraint name="in1" perimeter="0" x="0" y="0.055"/>
<constraint name="in2" perimeter="0" x="0" y="0.165"/>
<constraint name="in3" perimeter="0" x="0" y="0.275"/>
<constraint name="in4" perimeter="0" x="0" y="0.39"/>
<constraint name="in5" perimeter="0" x="0" y="0.5"/>
<constraint name="in6" perimeter="0" x="0" y="0.61"/>
<constraint name="in7" perimeter="0" x="0" y="0.72"/>
<constraint name="in8" perimeter="0" x="0" y="0.835"/>
<constraint name="in9" perimeter="0" x="0" y="0.945"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
<constraint name="control1" perimeter="0" x="0.415" y="1"/>
<constraint name="control2" perimeter="0" x="0.585" y="1"/>
</connections>
<background>
<path>
<move x="10" y="0"/>
<line x="50" y="20"/>
<line x="50" y="70"/>
<line x="10" y="90"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="25" y="82.5"/>
<line x="25" y="90"/>
<move x="50" y="45"/>
<line x="60" y="45"/>
<move x="0" y="85"/>
<line x="10" y="85"/>
<move x="0" y="75"/>
<line x="10" y="75"/>
<move x="0" y="65"/>
<line x="10" y="65"/>
<move x="0" y="55"/>
<line x="10" y="55"/>
<move x="0" y="45"/>
<line x="10" y="45"/>
<move x="0" y="35"/>
<line x="10" y="35"/>
<move x="0" y="25"/>
<line x="10" y="25"/>
<move x="0" y="15"/>
<line x="10" y="15"/>
<move x="0" y="5"/>
<line x="10" y="5"/>
<move x="35" y="77.5"/>
<line x="35" y="90"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="Operational Amp 1" strokewidth="inherit" w="98">
<connections>
<constraint name="in-" perimeter="0" x="0" y="0.165"/>
<constraint name="in+" perimeter="0" x="0" y="0.835"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
<constraint name="control1" perimeter="0" x="0.612" y="0.11"/>
<constraint name="control2" perimeter="0" x="0.612" y="0.89"/>
</connections>
<background>
<path>
<move x="5" y="0"/>
<line x="98" y="45"/>
<line x="5" y="90"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="15"/>
<line x="5" y="15"/>
<move x="0" y="75"/>
<line x="5" y="75"/>
<move x="60" y="10"/>
<line x="60" y="26.5"/>
<move x="60" y="63.5"/>
<line x="60" y="80"/>
<move x="8" y="15"/>
<line x="14" y="15"/>
<move x="8" y="75"/>
<line x="14" y="75"/>
<move x="11" y="72"/>
<line x="11" y="78"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="Operational Amp 2" strokewidth="inherit" w="98">
<connections>
<constraint name="in-" perimeter="0" x="0" y="0.165"/>
<constraint name="in+" perimeter="0" x="0" y="0.835"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
<constraint name="control1" perimeter="0" x="0.408" y="0.05"/>
<constraint name="control2" perimeter="0" x="0.408" y="0.95"/>
<constraint name="out+" perimeter="0" x="0.815" y="0.292"/>
<constraint name="out-" perimeter="0" x="0.815" y="0.708"/>
</connections>
<background>
<path>
<move x="5" y="0"/>
<line x="98" y="45"/>
<line x="5" y="90"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="15"/>
<line x="5" y="15"/>
<move x="0" y="75"/>
<line x="5" y="75"/>
<move x="80" y="26.5"/>
<line x="60" y="26.5"/>
<move x="60" y="63.5"/>
<line x="80" y="63.5"/>
<move x="8" y="15"/>
<line x="14" y="15"/>
<move x="8" y="75"/>
<line x="14" y="75"/>
<move x="11" y="72"/>
<line x="11" y="78"/>
<move x="40" y="5"/>
<line x="40" y="17"/>
<move x="40" y="73"/>
<line x="40" y="85"/>
<move x="45" y="28"/>
<line x="51" y="28"/>
<move x="48" y="25"/>
<line x="48" y="31"/>
<move x="45" y="62"/>
<line x="51" y="62"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="OTA 1" strokewidth="inherit" w="100">
<connections>
<constraint name="in-" perimeter="0" x="0" y="0.165"/>
<constraint name="in+" perimeter="0" x="0" y="0.835"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
<constraint name="control1" perimeter="0" x="0.4" y="0.05"/>
<constraint name="control2" perimeter="0" x="0.4" y="0.95"/>
</connections>
<background>
<path>
<move x="5" y="90"/>
<line x="5" y="0"/>
<line x="68" y="30.5"/>
<line x="68" y="59.5"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="15"/>
<line x="5" y="15"/>
<move x="68" y="45"/>
<line x="100" y="45"/>
<move x="8" y="15"/>
<line x="14" y="15"/>
<move x="8" y="75"/>
<line x="14" y="75"/>
<move x="11" y="72"/>
<line x="11" y="78"/>
<move x="0" y="75"/>
<line x="5" y="75"/>
<move x="40" y="73"/>
<line x="40" y="85"/>
<move x="40" y="5"/>
<line x="40" y="17"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="OTA 2" strokewidth="inherit" w="100">
<connections>
<constraint name="in-" perimeter="0" x="0" y="0.165"/>
<constraint name="in+" perimeter="0" x="0" y="0.835"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
<constraint name="control1" perimeter="0" x="0.4" y="0.05"/>
<constraint name="control2" perimeter="0" x="0.4" y="0.95"/>
<constraint name="out+" perimeter="0" x="0.8" y="0.292"/>
<constraint name="out-" perimeter="0" x="0.8" y="0.708"/>
</connections>
<background>
<path>
<move x="5" y="90"/>
<line x="5" y="0"/>
<line x="68" y="30.5"/>
<line x="68" y="59.5"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="15"/>
<line x="5" y="15"/>
<move x="68" y="45"/>
<line x="100" y="45"/>
<move x="8" y="15"/>
<line x="14" y="15"/>
<move x="8" y="75"/>
<line x="14" y="75"/>
<move x="11" y="72"/>
<line x="11" y="78"/>
<move x="0" y="75"/>
<line x="5" y="75"/>
<move x="45" y="62"/>
<line x="51" y="62"/>
<move x="45" y="28"/>
<line x="51" y="28"/>
<move x="48" y="25"/>
<line x="48" y="31"/>
<move x="60" y="63.5"/>
<line x="80" y="63.5"/>
<move x="80" y="26.5"/>
<line x="60" y="26.5"/>
<move x="40" y="73"/>
<line x="40" y="85"/>
<move x="40" y="5"/>
<line x="40" y="17"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="90" name="OTA 3" strokewidth="inherit" w="100">
<connections>
<constraint name="in" perimeter="0" x="0" y="0.5"/>
<constraint name="out" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<path>
<move x="5" y="90"/>
<line x="5" y="0"/>
<line x="68" y="30.5"/>
<line x="68" y="59.5"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="45"/>
<line x="5" y="45"/>
<move x="68" y="45"/>
<line x="100" y="45"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="46" name="Quantizer" strokewidth="inherit" w="52">
<connections>
<constraint name="in2" perimeter="0" x="0.5" y="0"/>
<constraint name="out2" perimeter="0" x="0.5" y="1"/>
<constraint name="in1" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<rect h="46" w="52" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="21" y="33"/>
<line x="26" y="33"/>
<line x="26" y="13"/>
<line x="31" y="13"/>
<move x="21" y="23"/>
<line x="31" y="23"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="50" name="Sum" strokewidth="inherit" w="50">
<connections>
<constraint name="in2" perimeter="0" x="0.5" y="0"/>
<constraint name="out2" perimeter="0" x="0.5" y="1"/>
<constraint name="in1" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<ellipse h="50" w="50" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="32" y="35"/>
<line x="18" y="35"/>
<line x="28" y="25"/>
<line x="18" y="15"/>
<line x="32" y="15"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="50" name="Summation Point" strokewidth="inherit" w="50">
<connections>
<constraint name="in2" perimeter="0" x="0.5" y="0"/>
<constraint name="out2" perimeter="0" x="0.5" y="1"/>
<constraint name="in1" perimeter="0" x="0" y="0.5"/>
<constraint name="out1" perimeter="0" x="1" y="0.5"/>
</connections>
<background>
<ellipse h="50" w="50" x="0" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="25" y="10"/>
<line x="25" y="40"/>
<move x="10" y="25"/>
<line x="40" y="25"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="94.25" name="Thermistor With Independent Integral Heater" strokewidth="inherit" w="100">
<connections>
<constraint name="in" perimeter="0" x="0" y="0.48"/>
<constraint name="out" perimeter="0" x="1" y="0.48"/>
<constraint name="v-" perimeter="0" x="0.435" y="1"/>
<constraint name="v+" perimeter="0" x="0.625" y="1"/>
</connections>
<background>
<ellipse h="80" w="80" x="10" y="5"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="45"/>
<line x="18" y="45"/>
<line x="22" y="35"/>
<line x="30" y="55"/>
<line x="38" y="35"/>
<line x="46" y="55"/>
<line x="54" y="35"/>
<line x="62" y="55"/>
<line x="70" y="35"/>
<line x="78" y="55"/>
<line x="82" y="45"/>
<line x="100" y="45"/>
<move x="0" y="85"/>
<line x="15" y="85"/>
<line x="23.5" y="75"/>
<move x="43.5" y="93.5"/>
<line x="44" y="84.75"/>
<line x="53.75" y="73"/>
<line x="62.5" y="82.75"/>
<line x="62.75" y="94.25"/>
<move x="87" y="0"/>
<line x="75.3" y="14"/>
</path>
<stroke/>
</foreground>
</shape>
<shape aspect="variable" h="58" name="Voltage Regulator" strokewidth="inherit" w="70">
<connections>
<constraint name="control" perimeter="0" x="0.5" y="1"/>
<constraint name="in" perimeter="0" x="0" y="0.395"/>
<constraint name="out" perimeter="0" x="1" y="0.395"/>
</connections>
<background>
<rect h="46" w="52" x="9" y="0"/>
</background>
<foreground>
<fillstroke/>
<path>
<move x="0" y="23"/>
<line x="9" y="23"/>
<move x="35" y="58"/>
<line x="35" y="46"/>
<move x="61" y="23"/>
<line x="70" y="23"/>
</path>
<stroke/>
</foreground>
</shape>
</shapes>
``` | /content/code_sandbox/src/main/webapp/stencils/electrical/abstract.xml | xml | 2016-09-06T12:59:15 | 2024-08-16T13:28:41 | drawio | jgraph/drawio | 40,265 | 7,974 |
```xml
import * as React from 'react';
import ComponentExample from '../../../../components/ComponentDoc/ComponentExample';
import NonPublicSection from '../../../../components/ComponentDoc/NonPublicSection';
const Rtl = () => (
<NonPublicSection title="Rtl">
<ComponentExample examplePath="components/Menu/Rtl/MenuExample.rtl" />
</NonPublicSection>
);
export default Rtl;
``` | /content/code_sandbox/packages/fluentui/docs/src/examples/components/Menu/Rtl/index.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 85 |
```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 table-name="t_broadcast_table_for_ddl" data-nodes="db_${0..9}.t_broadcast_table_for_ddl">
<column name="id" type="integer" />
</metadata>
</dataset>
``` | /content/code_sandbox/test/e2e/sql/src/test/resources/cases/ddl/dataset/db/alter_broadcast_drop.xml | xml | 2016-01-18T12:49:26 | 2024-08-16T15:48:11 | shardingsphere | apache/shardingsphere | 19,707 | 124 |
```xml
import type ts from 'typescript';
import { RuntimeLibrary } from '../dependencyService';
type NodeChanges<T extends ts.Node> = { [K in keyof T]?: T[K] | ts.Node | ts.NodeArray<ts.Node> };
/**
* Walk all descendant expressions included root node naively. Not comprehensive walker.
* Traversal type is post-order (LRN).
* If some expression node is returned in predicate function, the node will be replaced.
*/
export function walkExpression(
tsModule: RuntimeLibrary['typescript'],
root: ts.Expression,
predicate: (node: ts.Expression, additionalScope: ts.Identifier[]) => ts.Expression | void
): ts.Expression {
function visit(node: ts.Expression, scope: ts.Identifier[]): ts.Expression {
return predicate(node, scope) || node;
}
function update<T extends ts.Node>(changes: NodeChanges<T>, original: T, updated: T): T {
const changedKeys = Object.keys(changes) as Array<keyof T>;
const isUpdated = changedKeys.reduce((acc, key) => {
return acc || changes[key] !== original[key];
}, false);
return isUpdated ? tsModule.setTextRange(updated, original) : original;
}
function loop(node: ts.Expression, scope: ts.Identifier[]): ts.Expression {
if (tsModule.isPropertyAccessChain(node)) {
const expression = loop(node.expression, scope);
return visit(
update({ expression }, node, tsModule.createPropertyAccessChain(expression, node.questionDotToken, node.name)),
scope
);
}
if (tsModule.isPropertyAccessExpression(node)) {
const expression = loop(node.expression, scope);
return visit(update({ expression }, node, tsModule.createPropertyAccess(expression, node.name)), scope);
}
if (tsModule.isElementAccessExpression(node)) {
const expression = loop(node.expression, scope);
const argumentExpression = loop(node.argumentExpression, scope);
return visit(
update({ expression, argumentExpression }, node, tsModule.createElementAccess(expression, argumentExpression)),
scope
);
}
if (tsModule.isPrefixUnaryExpression(node)) {
const operand = loop(node.operand, scope);
return visit(update({ operand }, node, tsModule.createPrefix(node.operator, operand)), scope);
}
if (tsModule.isPostfixUnaryExpression(node)) {
const operand = loop(node.operand, scope);
return visit(update({ operand }, node, tsModule.createPostfix(operand, node.operator)), scope);
}
// Manually check `kind` for typeof expression
// since ts.isTypeOfExpression is not working.
if (node.kind === tsModule.SyntaxKind.TypeOfExpression) {
const n = node as ts.TypeOfExpression;
const expression = loop(n.expression, scope);
return visit(update({ expression }, n, tsModule.createTypeOf(expression)), scope);
}
if (tsModule.isDeleteExpression(node)) {
const expression = loop(node.expression, scope);
return visit(update({ expression }, node, tsModule.createDelete(expression)), scope);
}
if (tsModule.isVoidExpression(node)) {
const expression = loop(node.expression, scope);
return visit(update({ expression }, node, tsModule.createVoid(expression)), scope);
}
if (tsModule.isBinaryExpression(node)) {
const left = loop(node.left, scope);
const right = loop(node.right, scope);
return visit(update({ left, right }, node, tsModule.createBinary(left, node.operatorToken, right)), scope);
}
if (tsModule.isConditionalExpression(node)) {
const condition = loop(node.condition, scope);
const whenTrue = loop(node.whenTrue, scope);
const whenFalse = loop(node.whenFalse, scope);
return visit(
update({ condition, whenTrue, whenFalse }, node, tsModule.createConditional(condition, whenTrue, whenFalse)),
scope
);
}
if (tsModule.isCallExpression(node)) {
const expression = loop(node.expression, scope);
const args = mapNodeArray(tsModule, node.arguments, arg => loop(arg, scope));
return visit(
update({ expression, arguments: args }, node, tsModule.createCall(expression, node.typeArguments, args)),
scope
);
}
if (tsModule.isParenthesizedExpression(node)) {
const expression = loop(node.expression, scope);
return visit(update({ expression }, node, tsModule.createParen(expression)), scope);
}
if (tsModule.isObjectLiteralExpression(node)) {
const properties = mapNodeArray(tsModule, node.properties, p => {
return walkObjectLiteralElementLike(p, scope);
});
return visit(update({ properties }, node, tsModule.createObjectLiteral(properties)), scope);
}
if (tsModule.isArrayLiteralExpression(node)) {
const elements = mapNodeArray(tsModule, node.elements, el => loop(el, scope));
return visit(update({ elements }, node, tsModule.createArrayLiteral(elements)), scope);
}
if (tsModule.isSpreadElement(node)) {
const expression = loop(node.expression, scope);
return visit(update({ expression }, node, tsModule.createSpread(expression)), scope);
}
if (tsModule.isArrowFunction(node)) {
const fnScope = scope.concat(flatMap(node.parameters, value => collectScope(tsModule, value)));
let body: ts.ConciseBody;
if (tsModule.isBlock(node.body)) {
const statements = mapNodeArray(tsModule, node.body.statements, st => {
if (tsModule.isExpressionStatement(st)) {
const expression = loop(st.expression, fnScope);
return update({ expression }, st, tsModule.createExpressionStatement(expression));
} else {
return st;
}
});
body = update({ statements }, node.body, tsModule.createBlock(statements));
} else {
body = loop(node.body, fnScope);
}
return visit(
update(
{ body },
node,
tsModule.createArrowFunction(
node.modifiers,
node.typeParameters,
node.parameters,
node.type,
node.equalsGreaterThanToken,
body
)
),
scope
);
}
if (tsModule.isTemplateExpression(node)) {
const templateSpans = mapNodeArray(tsModule, node.templateSpans, span => {
const expression = loop(span.expression, scope);
return update({ expression }, span, tsModule.createTemplateSpan(expression, span.literal));
});
return visit(update({ templateSpans }, node, tsModule.createTemplateExpression(node.head, templateSpans)), scope);
}
if (tsModule.isNewExpression(node)) {
const expression = loop(node.expression, scope);
const args = node.arguments && mapNodeArray(tsModule, node.arguments, arg => loop(arg, scope));
return update(
{
expression,
arguments: args
},
node,
tsModule.createNew(expression, node.typeArguments, args)
);
}
return visit(node, scope);
}
function walkObjectLiteralElementLike(
node: ts.ObjectLiteralElementLike,
scope: ts.Identifier[]
): ts.ObjectLiteralElementLike {
if (tsModule.isPropertyAssignment(node)) {
let name: ts.PropertyName;
if (tsModule.isComputedPropertyName(node.name)) {
const expression = loop(node.name.expression, scope);
name = update({ expression }, node.name, tsModule.createComputedPropertyName(expression));
} else {
name = node.name;
}
const initializer = loop(node.initializer, scope);
return update({ name, initializer }, node, tsModule.createPropertyAssignment(name, initializer));
}
if (tsModule.isSpreadAssignment(node)) {
const expression = loop(node.expression, scope);
return update({ expression }, node, tsModule.createSpreadAssignment(expression));
}
return node;
}
return loop(root, []);
}
/**
* Collect newly added variable names from function parameters.
* e.g.
* If the function parameters look like following:
* (foo, { bar, baz: qux }) => { ... }
* The output should be:
* ['foo', 'bar', 'qux']
*/
function collectScope(
tsModule: RuntimeLibrary['typescript'],
param: ts.ParameterDeclaration | ts.BindingElement
): ts.Identifier[] {
const binding = param.name;
if (tsModule.isIdentifier(binding)) {
return [binding];
} else if (tsModule.isObjectBindingPattern(binding)) {
return flatMap(binding.elements, value => collectScope(tsModule, value));
} else if (tsModule.isArrayBindingPattern(binding)) {
const filtered = binding.elements.filter(tsModule.isBindingElement);
return flatMap(filtered, value => collectScope(tsModule, value));
} else {
return [];
}
}
/**
* Map node array to the same item type. If all item references are not changed, it returns the input list.
*/
function mapNodeArray<T extends ts.Node>(
tsModule: RuntimeLibrary['typescript'],
list: ts.NodeArray<T>,
fn: (value: T) => T
): ts.NodeArray<T> {
const mapped = list.map(fn);
const isUpdated = mapped.some((v, i) => {
const old = list[i];
return v !== old;
});
return isUpdated ? tsModule.createNodeArray(mapped) : list;
}
function flatMap<T extends ts.Node, R>(list: ReadonlyArray<T>, fn: (value: T) => R[]): R[] {
return list.reduce<R[]>((acc, item) => {
return acc.concat(fn(item));
}, []);
}
``` | /content/code_sandbox/server/src/services/typescriptService/walkExpression.ts | xml | 2016-10-29T23:20:43 | 2024-08-16T03:59:58 | vetur | vuejs/vetur | 5,739 | 2,036 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<!-- Publishing configuration -->
<PublishReadyToRun>true</PublishReadyToRun>
<SelfContained>false</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../LibExecution/LibExecution.fsproj" />
<ProjectReference Include="../LibCloud/LibCloud.fsproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="CronChecker.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
``` | /content/code_sandbox/backend/src/CronChecker/CronChecker.fsproj | xml | 2016-12-04T23:15:08 | 2024-08-16T03:57:32 | dark | darklang/dark | 1,652 | 219 |
```xml
import { Entity } from "../../../../../../src/decorator/entity/Entity"
import { PrimaryColumn } from "../../../../../../src/decorator/columns/PrimaryColumn"
import { Column } from "../../../../../../src/decorator/columns/Column"
import { Post } from "./Post"
import { ManyToMany } from "../../../../../../src/decorator/relations/ManyToMany"
import { Tag } from "./Tag"
import { Unique } from "../../../../../../src"
@Entity()
@Unique(["code", "version", "description"])
export class Category {
@PrimaryColumn(String, {
length: 31,
})
name: string
@PrimaryColumn(String, {
length: 31,
})
type: string
@Column()
code: number
@Column()
version: number
@Column({ nullable: true })
description: string
@ManyToMany((type) => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Post, (post) => post.categoriesWithOptions)
postsWithOptions: Post[]
@ManyToMany((type) => Post, (post) => post.categoriesWithNonPKColumns)
postsWithNonPKColumns: Post[]
@ManyToMany((type) => Tag, (tag) => tag.categories)
tags: Tag[]
@ManyToMany((type) => Tag, (tag) => tag.categoriesWithOptions)
tagsWithOptions: Tag[]
@ManyToMany((type) => Tag, (tag) => tag.categoriesWithNonPKColumns)
tagsWithNonPKColumns: Tag[]
}
``` | /content/code_sandbox/test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-many/entity/Category.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 339 |
```xml
<ListReceiptFiltersResponse xmlns="path_to_url"> <ListReceiptFiltersResult>
<Filters>
<member>
<Name>cpp_func_test</Name>
<IpFilter>
<Cidr>10.0.0.1/24</Cidr>
<Policy>Allow</Policy>
</IpFilter>
</member>
</Filters>
</ListReceiptFiltersResult>
<ResponseMetadata>
<RequestId>74a55731-25fa-4d57-9e93-b679e419ddae</RequestId>
</ResponseMetadata>
</ListReceiptFiltersResponse>
``` | /content/code_sandbox/cpp/example_code/ses/tests/mock_input/ListReceiptFilters.xml | xml | 2016-08-18T19:06:57 | 2024-08-16T18:59:44 | aws-doc-sdk-examples | awsdocs/aws-doc-sdk-examples | 9,298 | 134 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="path_to_url"
xmlns:tools="path_to_url"
xmlns:app="path_to_url"
android:id="@+id/activity_recycle_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.hitomi.fungamerefreshdemo.RecycleViewActivity">
<com.hitomi.refresh.view.FunGameRefreshView
android:id="@+id/refresh_fun_game"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:game_type="hit_block">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.hitomi.refresh.view.FunGameRefreshView>
</RelativeLayout>
``` | /content/code_sandbox/fungamerefreshdemo/src/main/res/layout/activity_recycle_view.xml | xml | 2016-03-01T07:28:09 | 2024-08-16T02:11:49 | FunGameRefresh | Hitomis/FunGameRefresh | 1,326 | 195 |
```xml
import fs from 'fs';
import net from 'net';
import os from 'os';
import path from 'path';
import type { Browser as PlaywrightBrowser, BrowserType } from 'playwright';
import { loadFirefoxAddon } from './load-firefox-addon';
import { PlaywrightBrowser as PlaywrightBrowserWithPersistentContext } from './playwright-browser';
import { PlaywrightController } from './playwright-controller';
import type { BrowserController } from '../abstract-classes/browser-controller';
import { BrowserPlugin } from '../abstract-classes/browser-plugin';
import { anonymizeProxySugar } from '../anonymize-proxy';
import { createProxyServerForContainers } from '../container-proxy-server';
import type { LaunchContext } from '../launch-context';
import { log } from '../logger';
import { getLocalProxyAddress } from '../proxy-server';
import type { SafeParameters } from '../utils';
const getFreePort = async () => {
return new Promise<number>((resolve, reject) => {
const server = net
.createServer()
.once('error', reject)
.listen(() => {
resolve((server.address() as net.AddressInfo).port);
server.close();
});
});
};
// __dirname = browser-pool/dist/playwright
// taacPath = browser-pool/dist/tab-as-a-container
const taacPath = path.join(__dirname, '..', 'tab-as-a-container');
export class PlaywrightPlugin extends BrowserPlugin<
BrowserType,
SafeParameters<BrowserType['launch']>[0],
PlaywrightBrowser
> {
private _browserVersion?: string;
_containerProxyServer?: Awaited<ReturnType<typeof createProxyServerForContainers>>;
protected async _launch(launchContext: LaunchContext<BrowserType>): Promise<PlaywrightBrowser> {
const { launchOptions, useIncognitoPages, proxyUrl } = launchContext;
let { userDataDir } = launchContext;
let browser: PlaywrightBrowser;
// Required for the `proxy` context option to work.
launchOptions!.proxy = {
server: await getLocalProxyAddress(),
...launchOptions!.proxy,
};
// WebKit does not support --no-sandbox
if (this.library.name() === 'webkit') {
launchOptions!.args = launchOptions!.args?.filter((arg) => arg !== '--no-sandbox');
}
const [anonymizedProxyUrl, close] = await anonymizeProxySugar(proxyUrl);
if (anonymizedProxyUrl) {
launchOptions!.proxy = {
server: anonymizedProxyUrl,
bypass: launchOptions!.proxy.bypass,
};
}
try {
if (useIncognitoPages) {
browser = await this.library.launch(launchOptions).catch((error) => {
return this._throwOnFailedLaunch(launchContext, error);
});
if (anonymizedProxyUrl) {
browser.on('disconnected', async () => {
await close();
});
}
} else {
const experimentalContainers = launchContext.experimentalContainers && this.library.name() !== 'webkit';
let firefoxPort: number | undefined;
if (experimentalContainers) {
launchOptions!.args = [...(launchOptions!.args ?? [])];
// Use native headless mode so we can load an extension
if (launchOptions!.headless && this.library.name() === 'chromium') {
launchOptions!.args.push('--headless=chrome');
}
if (this.library.name() === 'chromium') {
launchOptions!.args.push(
`--disable-extensions-except=${taacPath}`,
`--load-extension=${taacPath}`,
);
} else if (this.library.name() === 'firefox') {
firefoxPort = await getFreePort();
launchOptions!.args.push(`--start-debugger-server=${firefoxPort}`);
const prefs = {
'devtools.debugger.remote-enabled': true,
'devtools.debugger.prompt-connection': false,
};
const prefsRaw = Object.entries(prefs)
.map(([name, value]) => `user_pref(${JSON.stringify(name)}, ${JSON.stringify(value)});`)
.join('\n');
if (userDataDir === '') {
userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'apify-playwright-firefox-taac-'));
}
fs.writeFileSync(path.join(userDataDir, 'user.js'), prefsRaw);
}
}
const browserContext = await this.library
.launchPersistentContext(userDataDir, launchOptions)
.catch((error) => {
return this._throwOnFailedLaunch(launchContext, error);
});
browserContext.once('close', () => {
if (userDataDir.includes('apify-playwright-firefox-taac-')) {
fs.rmSync(userDataDir, {
recursive: true,
force: true,
});
}
});
if (experimentalContainers) {
if (this.library.name() === 'firefox') {
const loaded = await loadFirefoxAddon(firefoxPort!, '127.0.0.1', taacPath);
if (!loaded) {
await browserContext.close();
throw new Error('Failed to load Firefox experimental containers addon');
}
}
// Wait for the extension to load.
const checker = await browserContext.newPage();
await checker.goto('data:text/plain,tabid');
await checker.waitForNavigation();
await checker.close();
this._containerProxyServer = await createProxyServerForContainers();
const page = await browserContext.newPage();
await page.goto(`data:text/plain,proxy#{"port":${this._containerProxyServer.port}}`);
await page.waitForNavigation();
await page.close();
browserContext.on('close', async () => {
await this._containerProxyServer!.close(true);
});
}
if (anonymizedProxyUrl) {
browserContext.on('close', async () => {
await close();
});
}
if (!this._browserVersion) {
// Launches unused browser just to get the browser version.
const inactiveBrowser = await this.library.launch(launchOptions);
this._browserVersion = inactiveBrowser.version();
inactiveBrowser.close().catch((error) => {
log.exception(error, 'Failed to close browser.');
});
}
browser = new PlaywrightBrowserWithPersistentContext({ browserContext, version: this._browserVersion });
}
} catch (error) {
await close();
throw error;
}
return browser;
}
private _throwOnFailedLaunch(launchContext: LaunchContext<BrowserType>, cause: unknown): never {
this._throwAugmentedLaunchError(
cause,
launchContext.launchOptions?.executablePath,
'`apify/actor-node-playwright-*` (with a correct browser name)',
'Try installing the required dependencies by running `npx playwright install --with-deps` (path_to_url
);
}
protected _createController(): BrowserController<
BrowserType,
SafeParameters<BrowserType['launch']>[0],
PlaywrightBrowser
> {
return new PlaywrightController(this);
}
protected async _addProxyToLaunchOptions(launchContext: LaunchContext<BrowserType>): Promise<void> {
launchContext.launchOptions ??= {};
const { launchOptions, proxyUrl } = launchContext;
if (proxyUrl) {
const url = new URL(proxyUrl);
launchOptions.proxy = {
server: url.origin,
username: decodeURIComponent(url.username),
password: decodeURIComponent(url.password),
};
}
}
protected _isChromiumBasedBrowser(): boolean {
const name = this.library.name();
return name === 'chromium';
}
}
``` | /content/code_sandbox/packages/browser-pool/src/playwright/playwright-plugin.ts | xml | 2016-08-26T18:35:03 | 2024-08-16T16:40:08 | crawlee | apify/crawlee | 14,153 | 1,637 |
```xml
/* eslint-env jest */
import JsonFile from '@expo/json-file';
import execa from 'execa';
import klawSync from 'klaw-sync';
import path from 'path';
import * as fs from 'fs';
import { sync as globSync } from 'glob';
import { runExportSideEffects } from './export-side-effects';
import { bin, getRouterE2ERoot } from '../utils';
runExportSideEffects();
describe('exports for hermes with no bytecode', () => {
const projectRoot = getRouterE2ERoot();
const outputName = 'dist-no-bytecode';
const outputDir = path.join(projectRoot, outputName);
beforeAll(
async () => {
await execa(
'node',
[bin, 'export', '-p', 'ios', '--output-dir', outputName, '--no-bytecode'],
{
cwd: projectRoot,
env: {
NODE_ENV: 'production',
EXPO_USE_STATIC: 'static',
E2E_ROUTER_JS_ENGINE: 'hermes',
E2E_ROUTER_SRC: 'url-polyfill',
E2E_ROUTER_ASYNC: 'development',
EXPO_USE_FAST_RESOLVER: 'true',
},
}
);
},
// Could take 45s depending on how fast the bundler resolves
560 * 1000
);
it('has expected files', async () => {
// List output files with sizes for snapshotting.
// This is to make sure that any changes to the output are intentional.
// Posix path formatting is used to make paths the same across OSes.
const files = klawSync(outputDir)
.map((entry) => {
if (entry.path.includes('node_modules') || !entry.stats.isFile()) {
return null;
}
return path.posix.relative(outputDir, entry.path);
})
.filter(Boolean);
const metadata = await JsonFile.readAsync(path.resolve(outputDir, 'metadata.json'));
expect(metadata).toEqual({
bundler: 'metro',
fileMetadata: {
ios: {
assets: expect.anything(),
bundle: expect.stringMatching(/_expo\/static\/js\/ios\/index-.*\.js/),
},
},
version: 0,
});
// The wrapper should not be included as a route.
expect(files).not.toContain('+html.html');
expect(files).not.toContain('index.html');
const iosBundle = files.find((v) => v?.startsWith('_expo/static/js/ios/'));
expect(iosBundle).toBeDefined();
// Check if the bundle is minified
const bundlePath = globSync('**/*.js', {
cwd: path.join(outputDir, '_expo'),
absolute: true,
})[0];
const bundle = await fs.promises.readFile(bundlePath, 'utf8');
// Minified mark
expect(bundle).toMatch('__d((function(g,r,');
});
});
describe('exports for hermes with no bytecode and no minification', () => {
const projectRoot = getRouterE2ERoot();
const outputName = 'dist-no-bytecode-no-minify';
const outputDir = path.join(projectRoot, outputName);
beforeAll(
async () => {
await execa(
'node',
[bin, 'export', '-p', 'ios', '--output-dir', outputName, '--no-bytecode', '--no-minify'],
{
cwd: projectRoot,
env: {
NODE_ENV: 'production',
EXPO_USE_STATIC: 'static',
E2E_ROUTER_JS_ENGINE: 'hermes',
E2E_ROUTER_SRC: 'url-polyfill',
E2E_ROUTER_ASYNC: 'development',
EXPO_USE_FAST_RESOLVER: 'true',
},
}
);
},
// Could take 45s depending on how fast the bundler resolves
560 * 1000
);
it('has expected files', async () => {
// List output files with sizes for snapshotting.
// This is to make sure that any changes to the output are intentional.
// Posix path formatting is used to make paths the same across OSes.
const files = klawSync(outputDir)
.map((entry) => {
if (entry.path.includes('node_modules') || !entry.stats.isFile()) {
return null;
}
return path.posix.relative(outputDir, entry.path);
})
.filter(Boolean);
const metadata = await JsonFile.readAsync(path.resolve(outputDir, 'metadata.json'));
expect(metadata).toEqual({
bundler: 'metro',
fileMetadata: {
ios: {
assets: expect.anything(),
bundle: expect.stringMatching(/_expo\/static\/js\/ios\/index-.*\.js/),
},
},
version: 0,
});
// The wrapper should not be included as a route.
expect(files).not.toContain('+html.html');
expect(files).not.toContain('index.html');
const iosBundle = files.find((v) => v?.startsWith('_expo/static/js/ios/'));
expect(iosBundle).toBeDefined();
// Check if the bundle is minified
const bundlePath = globSync('**/*.js', {
cwd: path.join(outputDir, '_expo'),
absolute: true,
})[0];
const bundle = await fs.promises.readFile(bundlePath, 'utf8');
// Unminified mark
expect(bundle).toMatch('__d(function (global,');
});
});
``` | /content/code_sandbox/packages/@expo/cli/e2e/__tests__/export/no-bytecode.test.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 1,197 |
```xml
import { Fork, Omit } from "../types";
import { ASTNode } from "./types";
import { NodePath } from "./node-path";
export interface PathVisitor {
_reusableContextStack: any;
_methodNameTable: any;
_shouldVisitComments: any;
Context: any;
_visiting: any;
_changeReported: any;
_abortRequested: boolean;
visit(...args: any[]): any;
reset(...args: any[]): any;
visitWithoutReset(path: any): any;
AbortRequest: any;
abort(): void;
visitor: any;
acquireContext(path: any): any;
releaseContext(context: any): void;
reportChanged(): void;
wasChangeReported(): any;
}
export interface PathVisitorStatics {
fromMethodsObject(methods?: any): Visitor;
visit<M = {}>(node: ASTNode, methods?: import("../gen/visitor").Visitor<M>): any;
}
export interface PathVisitorConstructor extends PathVisitorStatics {
new (): PathVisitor;
}
export interface Visitor extends PathVisitor {
}
export interface VisitorConstructor extends PathVisitorStatics {
new (): Visitor;
}
export interface VisitorMethods {
[visitorMethod: string]: (path: NodePath) => any;
}
export interface SharedContextMethods {
currentPath: any;
needToCallTraverse: boolean;
Context: any;
visitor: any;
reset(path: any, ...args: any[]): any;
invokeVisitorMethod(methodName: string): any;
traverse(path: any, newVisitor?: VisitorMethods): any;
visit(path: any, newVisitor?: VisitorMethods): any;
reportChanged(): void;
abort(): void;
}
export interface Context extends Omit<PathVisitor, "visit" | "reset">, SharedContextMethods {
}
export default function pathVisitorPlugin(fork: Fork): PathVisitorConstructor;
``` | /content/code_sandbox/node_modules/degenerator/node_modules/ast-types/lib/path-visitor.d.ts | xml | 2016-03-11T09:28:00 | 2024-08-16T17:55:54 | antSword | AntSwordProject/antSword | 3,579 | 400 |
```xml
declare interface IBirthdaysWebPartStrings {
BottomEditLabel: string;
PropertyPaneDescription: string;
DescriptionFieldLabel: string;
ErrorMessageText: string;
GridHeightPropertyLabel: string;
GroupGridProperties: string;
MessageColorPropertyLabel: string;
ModalCancelButtonLabel: string;
ModalHeaderLabel: string;
upComingBirthdays: string;
todayBirthdays: string;
noBirthdays: string;
NoUpcomingBirthdayMessageLabel: string;
PageSizePropertyLabel: string;
PlaceHolderButtonLabel: string;
PlaceHolderDescription: string;
PlaceHolderIconText: string;
PreviewLabel: string;
SelectImagePropertyLabel: string;
SendLabel: string;
ShowNextPageToolTipLabel: string;
TodayBackgroundPropertyImageLabel: string;
TodayBirthdayMessagePropertyLabel: string;
UpComingBirthdayBackGroundImagePropertyLabel: string;
UpComingBirthdaysMessageLabel: string;
UpComingDaysPropertyLabel: string;
showingNumberUserMessage: string;
}
declare module 'BirthdaysWebPartStrings' {
const strings: IBirthdaysWebPartStrings;
export = strings;
}
``` | /content/code_sandbox/samples/react-modern-birthdays/src/webparts/birthdays/loc/mystrings.d.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 236 |
```xml
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as renderer from 'react-test-renderer';
import { ReactWrapper } from 'enzyme';
import { safeMount } from '@fluentui/test-utilities';
import { EventGroup, KeyCodes, resetIds } from '../../Utilities';
import { SelectionMode, Selection, SelectionZone } from '../../Selection';
import { getTheme } from '../../Styling';
import { DetailsHeader } from './DetailsHeader';
import { DetailsList } from './DetailsList';
import { DetailsListBase } from './DetailsList.base';
import { CheckboxVisibility, DetailsListLayoutMode } from './DetailsList.types';
import { DetailsRow } from './DetailsRow';
import { DetailsRowCheck } from './DetailsRowCheck';
import type { IDragDropEvents } from '../../DragDrop';
import type { IGroup } from '../../GroupedList';
import type { IRenderFunction } from '../../Utilities';
import type { IDetailsColumnProps } from './DetailsColumn';
import type { IDetailsHeaderProps } from './DetailsHeader';
import type { IColumn, IDetailsGroupDividerProps, IDetailsList } from './DetailsList.types';
import type { IDetailsRowProps } from './DetailsRow';
// Populate mock data for testing
function mockData(count: number, isColumn: boolean = false, customDivider: boolean = false): any {
const data = [];
let _data = {};
for (let i = 0; i < count; i++) {
_data = {
key: i,
name: 'Item ' + i,
value: i,
};
if (isColumn) {
_data = {
..._data,
key: `column_key_${i}`,
ariaLabel: `column_${i}`,
onRenderDivider: customDivider ? customColumnDivider : columnDividerWrapper,
};
}
data.push(_data);
}
return data;
}
// Wrapper function which calls the defaultRenderer with the corresponding params
function columnDividerWrapper(
iDetailsColumnProps: IDetailsColumnProps,
defaultRenderer: (props?: IDetailsColumnProps) => JSX.Element | null,
): any {
return defaultRenderer(iDetailsColumnProps);
}
// Using a bar sign as a custom divider along with the default divider
function customColumnDivider(
iDetailsColumnProps: IDetailsColumnProps,
defaultRenderer: (props?: IDetailsColumnProps) => JSX.Element | null,
): any {
return (
<React.Fragment key={`divider_${iDetailsColumnProps.columnIndex}`}>
<span>|</span>
{defaultRenderer(iDetailsColumnProps)}
</React.Fragment>
);
}
describe('DetailsList', () => {
let spy: jest.SpyInstance;
beforeEach(() => {
/* eslint-disable-next-line @typescript-eslint/no-empty-function */
spy = jest.spyOn(window, 'scrollTo').mockImplementation(() => {});
resetIds();
});
afterAll(() => {
spy.mockRestore();
});
afterEach(() => {
if ((setTimeout as unknown as jest.Mock).mock) {
jest.runOnlyPendingTimers();
jest.useRealTimers();
}
});
it('renders List correctly', () => {
const component = renderer.create(
<DetailsList
items={mockData(5)}
onRenderRow={() => null}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders List correctly with onRenderDivider props', () => {
const component = renderer.create(
<DetailsList
items={mockData(5)}
columns={mockData(5, true)}
onRenderRow={() => null}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders List with custom icon as column divider', () => {
const component = renderer.create(
<DetailsList
items={mockData(5)}
columns={mockData(5, true, true)}
onRenderRow={() => null}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders List in fixed constrained layout correctly', () => {
const component = renderer.create(
<DetailsList
items={mockData(5)}
onRenderRow={() => null}
layoutMode={DetailsListLayoutMode.fixedColumns}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders a single proportional column with correct width', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
safeMount(
<DetailsList
className="list"
items={[{ key: 'item1' }, { key: 'item2' }, { key: 'item3' }]}
columns={[
{ fieldName: 'a', key: 'col1', minWidth: 101, name: 'column 1' },
{ fieldName: 'b', key: 'col2', minWidth: 102, name: 'column 2', flexGrow: 1 },
{ fieldName: 'c', key: 'col3', minWidth: 103, name: 'column 3' },
]}
componentRef={ref => (component = ref)}
layoutMode={DetailsListLayoutMode.fixedColumns}
flexMargin={-640}
skipViewportMeasures={false}
onShouldVirtualize={() => false}
/>,
() => {
expect(component).toBeTruthy();
component!.focusIndex(2);
setTimeout(() => {
const elements = (document.activeElement as HTMLElement).querySelectorAll('div[role=columnheader]');
elements.forEach((element: Element, index: number) => {
if (index === 0) {
return;
}
const style = element.getAttribute('style')!;
expect(style).toBeDefined();
const width = style.match(/(?<=width: )\d+/g)!;
expect(width).toBeDefined();
expect(width[0]).toBeDefined();
if (index === 1) {
expect(width[0]).toBe('121');
} else if (index === 2) {
expect(width[0]).toBe('348');
} else if (index === 3) {
expect(width[0]).toBe('123');
} else {
fail('Unexpected index.');
}
});
}, 0);
jest.runOnlyPendingTimers();
},
);
});
it('renders proportional columns with proper width ratios', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
safeMount(
<DetailsList
className="list"
items={[{ key: 'item1' }, { key: 'item2' }, { key: 'item3' }]}
columns={[
{ fieldName: 'a', key: 'col1', minWidth: 100, name: 'column 1', flexGrow: 0.8 },
{ fieldName: 'b', key: 'col2', minWidth: 100, name: 'column 2', flexGrow: 0.5 },
]}
componentRef={ref => (component = ref)}
layoutMode={DetailsListLayoutMode.fixedColumns}
flexMargin={-640}
skipViewportMeasures={false}
onShouldVirtualize={() => false}
/>,
() => {
expect(component).toBeTruthy();
component!.focusIndex(2);
setTimeout(() => {
const elements = (document.activeElement as HTMLElement).querySelectorAll('div[role=columnheader]');
elements.forEach((element: Element, index: number) => {
if (index === 0) {
return;
}
const style = element.getAttribute('style')!;
expect(style).toBeDefined();
const width = style.match(/(?<=width: )\d+/g)!;
expect(width).toBeDefined();
expect(width[0]).toBeDefined();
if (index === 1) {
expect(width[0]).toBe('336');
} else if (index === 2) {
expect(width[0]).toBe('255');
} else {
fail('Unexpected index.');
}
});
}, 0);
jest.runOnlyPendingTimers();
},
);
});
it('renders proportional columns with proper width ratios when delayFirstMeasure', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
safeMount(
<DetailsList
className="list"
items={[{ key: 'item1' }, { key: 'item2' }, { key: 'item3' }]}
columns={[
{ fieldName: 'a', key: 'col1', minWidth: 100, name: 'column 1', flexGrow: 0.8 },
{ fieldName: 'b', key: 'col2', minWidth: 100, name: 'column 2', flexGrow: 0.5 },
]}
componentRef={ref => (component = ref)}
layoutMode={DetailsListLayoutMode.fixedColumns}
flexMargin={-640}
skipViewportMeasures={false}
onShouldVirtualize={() => false}
delayFirstMeasure
/>,
() => {
expect(component).toBeTruthy();
component!.focusIndex(2);
setTimeout(() => {
const elements = (document.activeElement as HTMLElement).querySelectorAll('div[role=columnheader]');
elements.forEach((element: Element, index: number) => {
if (index === 0) {
return;
}
const style = element.getAttribute('style')!;
expect(style).toBeDefined();
const width = style.match(/(?<=width: )\d+/g)!;
expect(width).toBeDefined();
expect(width[0]).toBeDefined();
if (index === 1) {
expect(width[0]).toBe('336');
} else if (index === 2) {
expect(width[0]).toBe('255');
} else {
fail('Unexpected index.');
}
});
}, 0);
jest.runOnlyPendingTimers();
},
);
});
it('renders List in compact mode correctly', () => {
const component = renderer.create(
<DetailsList
items={mockData(5)}
onRenderRow={() => null}
compact={true}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders List with hidden checkboxes correctly', () => {
const component = renderer.create(
<DetailsList
items={mockData(5)}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
groups={[
{
key: 'group0',
name: 'Group 0',
startIndex: 0,
count: 2,
},
{
key: 'group1',
name: 'Group 1',
startIndex: 2,
count: 3,
},
]}
checkboxVisibility={CheckboxVisibility.hidden}
/>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('focuses row by index', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
safeMount(
<DetailsList
items={mockData(5)}
componentRef={ref => (component = ref)}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
() => {
expect(component).toBeTruthy();
component!.focusIndex(2);
jest.runAllTimers();
expect(
(document.activeElement as HTMLElement).querySelector('[data-automationid=DetailsRowCell]')!.textContent,
).toEqual('2');
expect((document.activeElement as HTMLElement).className.split(' ')).toContain('ms-DetailsRow');
},
true /* attach */,
);
});
it('focuses row by arrow key', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
const onSelectionChanged = jest.fn();
const selection = new Selection({
onSelectionChanged,
});
safeMount(
<DetailsList
componentRef={ref => (component = ref)}
items={mockData(5)}
selection={selection}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
wrapper => {
expect(component).toBeTruthy();
component!.focusIndex(0);
jest.runAllTimers();
onSelectionChanged.mockClear();
wrapper.find('.ms-DetailsList-headerWrapper').simulate('keyDown', { which: KeyCodes.down });
expect(onSelectionChanged).toHaveBeenCalledTimes(1);
},
);
});
it('does not focus by arrow key when isSelectedOnFocus is `false`', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
const onSelectionChanged = jest.fn();
const selection = new Selection({
onSelectionChanged,
});
safeMount(
<DetailsList
componentRef={ref => (component = ref)}
items={mockData(5)}
selection={selection}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
isSelectedOnFocus={false}
/>,
wrapper => {
expect(component).toBeTruthy();
component!.focusIndex(0);
jest.runAllTimers();
onSelectionChanged.mockClear();
wrapper.find('.ms-DetailsList-headerWrapper').simulate('keyDown', { which: KeyCodes.down });
expect(onSelectionChanged).toHaveBeenCalledTimes(0);
},
);
});
it('clears selection when escape key is pressed and isSelectedOnFocus is `true`', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
const onSelectionChanged = jest.fn();
const selection = new Selection({
onSelectionChanged,
});
safeMount(
<DetailsList
componentRef={ref => (component = ref)}
items={mockData(5)}
selection={selection}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
wrapper => {
expect(component).toBeTruthy();
selection.setAllSelected(true);
jest.runAllTimers();
onSelectionChanged.mockClear();
wrapper.find('.ms-SelectionZone').simulate('keyDown', { which: KeyCodes.escape });
expect(onSelectionChanged).toHaveBeenCalledTimes(1);
expect(selection.getSelectedCount()).toEqual(0);
},
);
});
it('does not clear selection when escape key is pressed and isSelectedOnFocus is `false`', () => {
jest.useFakeTimers();
let component: IDetailsList | null;
const onSelectionChanged = jest.fn();
const selection = new Selection({
onSelectionChanged,
});
safeMount(
<DetailsList
componentRef={ref => (component = ref)}
items={mockData(5)}
selection={selection}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
isSelectedOnFocus={false}
/>,
wrapper => {
expect(component).toBeTruthy();
selection.setAllSelected(true);
jest.runAllTimers();
onSelectionChanged.mockClear();
wrapper.find('.ms-SelectionZone').simulate('keyDown', { which: KeyCodes.escape });
expect(onSelectionChanged).toHaveBeenCalledTimes(0);
expect(selection.getSelectedCount()).toEqual(5);
},
);
});
it('invokes optional onRenderMissingItem prop once per missing item rendered', () => {
const onRenderMissingItem = jest.fn();
const items = [...mockData(5), null, null];
safeMount(
<DetailsList items={items} skipViewportMeasures={true} onRenderMissingItem={onRenderMissingItem} />,
() => {
expect(onRenderMissingItem).toHaveBeenCalledTimes(2);
},
);
});
it('does not invoke optional onRenderMissingItem prop if no missing items are rendered', () => {
const onRenderMissingItem = jest.fn();
const items = mockData(5);
safeMount(
<DetailsList items={items} skipViewportMeasures={true} onRenderMissingItem={onRenderMissingItem} />,
() => {
expect(onRenderMissingItem).toHaveBeenCalledTimes(0);
},
);
});
it('executes onItemInvoked when double click is pressed', () => {
const items = mockData(5);
const onItemInvoked = jest.fn();
safeMount(
<DetailsList items={items} skipViewportMeasures={true} onItemInvoked={onItemInvoked} />,
(wrapper: ReactWrapper) => {
wrapper.find('.ms-DetailsRow').first().simulate('dblclick');
expect(onItemInvoked).toHaveBeenCalledTimes(1);
},
);
});
it('executes onItemInvoked when enter is pressed', () => {
const items = mockData(5);
const onItemInvoked = jest.fn();
safeMount(
<DetailsList items={items} skipViewportMeasures={true} onItemInvoked={onItemInvoked} />,
(wrapper: ReactWrapper) => {
wrapper.find('.ms-DetailsRow').first().simulate('keydown', { which: KeyCodes.enter });
expect(onItemInvoked).toHaveBeenCalledTimes(1);
},
);
});
it('respects changed dragDropEvents prop on re-renders.', () => {
const _dragDropEvents: IDragDropEvents = {
canDrag: jest.fn().mockReturnValue(true),
canDrop: jest.fn().mockReturnValue(true),
onDragEnd: jest.fn(),
onDragEnter: jest.fn(),
onDragLeave: jest.fn(),
onDragStart: jest.fn(),
onDrop: jest.fn(),
};
const _dragDropEvents2: IDragDropEvents = {
canDrag: jest.fn().mockReturnValue(true),
canDrop: jest.fn().mockReturnValue(true),
onDragEnd: jest.fn(),
onDragEnter: jest.fn(),
onDragLeave: jest.fn(),
onDragStart: jest.fn(),
onDrop: jest.fn(),
};
const _RaiseEvent = (target: any, _eventName: string, _clientX: number) => {
EventGroup.raise(
target,
_eventName,
{
clientX: _clientX,
button: 0,
} as DragEvent,
true,
);
};
const container = document.createElement('div');
const items = mockData(5);
const columns = mockData(5, true);
ReactDOM.render(
<DetailsListBase columns={columns} skipViewportMeasures={true} items={items} dragDropEvents={_dragDropEvents} />,
container,
);
let detailsRowSource = container.querySelector('div[aria-rowindex="2"][role="row"]') as HTMLDivElement;
_RaiseEvent(detailsRowSource, 'mousedown', 270);
_RaiseEvent(detailsRowSource, 'dragstart', 270);
// original eventhandler should be fired
expect(_dragDropEvents.onDragStart).toHaveBeenCalledTimes(1);
expect(_dragDropEvents2.onDragStart).toHaveBeenCalledTimes(0);
ReactDOM.render(
<DetailsListBase columns={columns} skipViewportMeasures={true} items={items} dragDropEvents={_dragDropEvents} />,
container,
);
detailsRowSource = container.querySelector('div[aria-rowindex="2"][role="row"]') as HTMLDivElement;
_RaiseEvent(detailsRowSource, 'mousedown', 270);
_RaiseEvent(detailsRowSource, 'dragstart', 270);
expect(_dragDropEvents.onDragStart).toHaveBeenCalledTimes(2);
expect(_dragDropEvents2.onDragStart).toHaveBeenCalledTimes(0);
ReactDOM.render(
<DetailsListBase columns={columns} skipViewportMeasures={true} items={items} dragDropEvents={_dragDropEvents2} />,
container,
);
detailsRowSource = container.querySelector('div[aria-rowindex="2"][role="row"]') as HTMLDivElement;
_RaiseEvent(detailsRowSource, 'mousedown', 270);
_RaiseEvent(detailsRowSource, 'dragstart', 270);
expect(_dragDropEvents.onDragStart).toHaveBeenCalledTimes(2);
expect(_dragDropEvents2.onDragStart).toHaveBeenCalledTimes(1);
});
it('focuses into row element', () => {
jest.useFakeTimers();
const onRenderColumn = (item: any, index: number, column: IColumn) => {
let value = item && column && column.fieldName ? item[column.fieldName] : '';
if (value === null || value === undefined) {
value = '';
}
return (
<div className={'test-column'} data-is-focusable={true}>
{value}
</div>
);
};
const getCellValueKey = (item: any, index: number, column: IColumn) => {
const valueKey = item && column && column.fieldName ? item[column.fieldName] : column.key + index;
return valueKey;
};
let component: IDetailsList | null;
safeMount(
<DetailsList
items={mockData(5)}
componentRef={ref => (component = ref)}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
onRenderItemColumn={onRenderColumn}
getCellValueKey={getCellValueKey}
/>,
() => {
expect(component).toBeTruthy();
component!.focusIndex(3);
jest.runOnlyPendingTimers();
expect(
(document.activeElement as HTMLElement).querySelector('[data-automationid=DetailsRowCell]')!.textContent,
).toEqual('3');
expect((document.activeElement as HTMLElement).className.split(' ')).toContain('ms-DetailsRow');
// Set element visibility manually as a test workaround
component!.focusIndex(4);
jest.runOnlyPendingTimers();
((document.activeElement as HTMLElement).children[1] as any).isVisible = true;
((document.activeElement as HTMLElement).children[1].children[0] as any).isVisible = true;
((document.activeElement as HTMLElement).children[1].children[0].children[0] as any).isVisible = true;
component!.focusIndex(4, true);
jest.runOnlyPendingTimers();
expect((document.activeElement as HTMLElement).textContent).toEqual('4');
expect((document.activeElement as HTMLElement).className.split(' ')).toContain('test-column');
},
true /* attach */,
);
});
it('reset focusedItemIndex when setKey updates', () => {
jest.useFakeTimers();
let component: DetailsListBase | null;
safeMount(
<DetailsList
items={mockData(5)}
setKey={'key1'}
initialFocusedIndex={0}
componentRef={value => (component = value as any)}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
/>,
(wrapper: ReactWrapper) => {
expect(component).toBeTruthy();
component!.focusIndex(3);
jest.runAllTimers();
expect(component!.state.focusedItemIndex).toEqual(3);
// update props to new setKey
const newProps = { items: mockData(7), setKey: 'set2', initialFocusedIndex: 0 };
wrapper.setProps(newProps);
wrapper.update();
// verify that focusedItemIndex is reset to 0 and 0th row is focused
jest.runAllTimers();
expect(component!.state.focusedItemIndex).toEqual(0);
expect(
(document.activeElement as HTMLElement).querySelector('[data-automationid=DetailsRowCell]')!.textContent,
).toEqual('0');
expect((document.activeElement as HTMLElement).className.split(' ')).toContain('ms-DetailsRow');
},
true /* attach */,
);
});
it('invokes optional onColumnResize callback per IColumn if defined when columns are adjusted', () => {
jest.useFakeTimers();
const columns: IColumn[] = mockData(2, true);
columns[0].onColumnResize = jest.fn();
columns[1].onColumnResize = jest.fn();
safeMount(<DetailsList items={mockData(2)} columns={columns} onShouldVirtualize={() => false} />, () => {
jest.runOnlyPendingTimers();
expect(columns[0].onColumnResize).toHaveBeenCalledTimes(1);
expect(columns[1].onColumnResize).toHaveBeenCalledTimes(1);
});
});
it('invokes optional onRenderDetailsHeader prop to customize DetailsHeader rendering when provided', () => {
const onRenderDetailsHeaderMock = jest.fn();
safeMount(
<DetailsList
items={mockData(2)}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
onRenderDetailsHeader={onRenderDetailsHeaderMock}
/>,
() => {
expect(onRenderDetailsHeaderMock).toHaveBeenCalledTimes(1);
},
);
});
it('calculates DetailsHeader and DetailsFooter in rowcount', () => {
const onRenderDetailsHeaderMock = jest.fn();
const onRenderDetailsFooterMock = jest.fn();
const component = renderer.create(
<DetailsList
items={mockData(5)}
onRenderDetailsHeader={onRenderDetailsHeaderMock}
onRenderDetailsFooter={onRenderDetailsFooterMock}
/>,
);
const grid = component.root.findByProps({ role: 'grid' });
expect(grid.props[`aria-rowcount`]).toEqual(7);
});
it('invokes onRenderColumnHeaderTooltip to customize DetailsColumn tooltip rendering when provided', () => {
const NUM_COLUMNS = 2;
const onRenderColumnHeaderTooltipMock = jest.fn();
const onRenderDetailsHeader = (
props: IDetailsHeaderProps,
defaultRenderer?: IRenderFunction<IDetailsHeaderProps>,
) => {
return <DetailsHeader {...props} onRenderColumnHeaderTooltip={onRenderColumnHeaderTooltipMock} />;
};
safeMount(
<DetailsList
items={mockData(NUM_COLUMNS)}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
onRenderDetailsHeader={onRenderDetailsHeader}
/>,
() => {
expect(onRenderColumnHeaderTooltipMock).toHaveBeenCalledTimes(4);
},
);
});
it('invokes optional onRenderCheckbox callback to customize checkbox rendering when provided', () => {
const onRenderCheckboxMock = jest.fn();
const selection = new Selection();
const theme = getTheme();
safeMount(
<DetailsList
items={mockData(2)}
skipViewportMeasures={true}
onShouldVirtualize={() => false}
onRenderCheckbox={onRenderCheckboxMock}
checkboxVisibility={CheckboxVisibility.always}
selectionMode={SelectionMode.multiple}
selection={selection}
/>,
() => {
expect(onRenderCheckboxMock).toHaveBeenCalledTimes(3);
expect(onRenderCheckboxMock.mock.calls[2][0]).toEqual({ checked: false, theme });
selection.setAllSelected(true);
expect(onRenderCheckboxMock).toHaveBeenCalledTimes(6);
expect(onRenderCheckboxMock.mock.calls[5][0]).toEqual({ checked: true, theme });
},
);
});
it('initializes the selection mode object with the selectionMode prop', () => {
safeMount(
<DetailsList items={mockData(5)} columns={mockData(5, true)} selectionMode={SelectionMode.none} />,
(wrapper: ReactWrapper) => {
const selectionZone = wrapper.find(SelectionZone);
expect(selectionZone.props().selection.mode).toEqual(SelectionMode.none);
},
);
});
it('handles updates to items and groups', () => {
const tableOneItems = [
{ f1: 'A1', f2: 'B1', f3: 'C1' },
{ f1: 'A2', f2: 'B2', f3: 'C2' },
{ f1: 'A3', f2: 'B3', f3: 'C3' },
{ f1: 'A4', f2: 'B4', f3: 'C4' },
];
const tableTwoItems = [
{ f1: 'D1', f2: 'E1', f3: 'F1' },
{ f1: 'D2', f2: 'E2', f3: 'F2' },
{ f1: 'D3', f2: 'E3', f3: 'F3' },
{ f1: 'D4', f2: 'E4', f3: 'F4' },
];
const groupOneGroups: IGroup[] = [
{ key: 'one-1', name: 'one 1', count: 1, startIndex: 0 },
{ key: 'one-2', name: 'one 2', count: 1, startIndex: 1 },
{ key: 'one-3', name: 'one 3', count: 1, startIndex: 2 },
{ key: 'one-4', name: 'one 4', count: 1, startIndex: 3 },
];
const groupTwoGroups: IGroup[] = [
{ key: 'two-1', name: 'two 1', count: 2, startIndex: 0 },
{ key: 'two-2', name: 'two 2', count: 2, startIndex: 2 },
];
const onRenderDetailsHeader: IRenderFunction<IDetailsHeaderProps> = (headerProps: IDetailsHeaderProps) => {
return (
<div>
{headerProps.columns.map((column: IColumn) => {
return <div key={column.key}>{column.name}</div>;
})}
</div>
);
};
const onRenderRow = (rowProps: IDetailsRowProps) => {
return (
<div>
{rowProps.columns.map((column: IColumn) => {
return <div key={column.key}>{rowProps.item[column.key]}</div>;
})}
</div>
);
};
const onRenderGroupHeader: IRenderFunction<IDetailsGroupDividerProps> = (
groupDividerProps: IDetailsGroupDividerProps,
) => {
return <div>{groupDividerProps.group?.name}</div>;
};
const component = renderer.create(
<DetailsList
onRenderDetailsHeader={onRenderDetailsHeader}
onRenderRow={onRenderRow}
groupProps={{ onRenderHeader: onRenderGroupHeader }}
items={tableOneItems}
groups={groupOneGroups}
layoutMode={DetailsListLayoutMode.fixedColumns}
skipViewportMeasures={true}
/>,
);
expect(component.toJSON()).toMatchSnapshot();
// New items, same groups
component.update(
<DetailsList
onRenderDetailsHeader={onRenderDetailsHeader}
onRenderRow={onRenderRow}
groupProps={{ onRenderHeader: onRenderGroupHeader }}
items={tableTwoItems}
groups={groupOneGroups}
layoutMode={DetailsListLayoutMode.fixedColumns}
skipViewportMeasures={true}
/>,
);
expect(component.toJSON()).toMatchSnapshot();
// Same items, new groups
component.update(
<DetailsList
onRenderDetailsHeader={onRenderDetailsHeader}
onRenderRow={onRenderRow}
groupProps={{ onRenderHeader: onRenderGroupHeader }}
items={tableTwoItems}
groups={groupTwoGroups}
layoutMode={DetailsListLayoutMode.fixedColumns}
skipViewportMeasures={true}
/>,
);
expect(component.toJSON()).toMatchSnapshot();
// New items, same groups
component.update(
<DetailsList
onRenderDetailsHeader={onRenderDetailsHeader}
onRenderRow={onRenderRow}
groupProps={{ onRenderHeader: onRenderGroupHeader }}
items={tableOneItems}
groups={groupTwoGroups}
layoutMode={DetailsListLayoutMode.fixedColumns}
skipViewportMeasures={true}
/>,
);
expect(component.toJSON()).toMatchSnapshot();
});
it('handles paged updates to items within groups', () => {
const roundOneItems = [{ f1: 'A1', f2: 'B1', f3: 'C1' }, undefined, { f1: 'A3', f2: 'B3', f3: 'C3' }, undefined];
const roundTwoItems = [
{ f1: 'A1', f2: 'B1', f3: 'C1' },
{ f1: 'A2', f2: 'B2', f3: 'C2' },
{ f1: 'A3', f2: 'B3', f3: 'C3' },
{ f1: 'A4', f2: 'B4', f3: 'C4' },
];
const groups: IGroup[] = [
{ key: 'two-1', name: 'two 1', count: 2, startIndex: 0 },
{ key: 'two-2', name: 'two 2', count: 2, startIndex: 2 },
];
const onRenderDetailsHeader: IRenderFunction<IDetailsHeaderProps> = (headerProps: IDetailsHeaderProps) => {
return (
<div>
{headerProps.columns.map((column: IColumn) => {
return <div key={column.key}>{column.name}</div>;
})}
</div>
);
};
const onRenderRow = (rowProps: IDetailsRowProps) => {
return (
<div>
{rowProps.columns.map((column: IColumn) => {
return <div key={column.key}>{rowProps.item[column.key]}</div>;
})}
</div>
);
};
const onRenderMissingItem = () => {
return <div>Placeholder</div>;
};
const onRenderGroupHeader: IRenderFunction<IDetailsGroupDividerProps> = (
groupDividerProps: IDetailsGroupDividerProps,
) => {
return <div>{groupDividerProps.group?.name}</div>;
};
const component = renderer.create(
<DetailsList
onRenderDetailsHeader={onRenderDetailsHeader}
onRenderRow={onRenderRow}
onRenderMissingItem={onRenderMissingItem}
groupProps={{ onRenderHeader: onRenderGroupHeader }}
items={roundOneItems}
groups={groups}
layoutMode={DetailsListLayoutMode.fixedColumns}
skipViewportMeasures={true}
/>,
);
expect(component.toJSON()).toMatchSnapshot();
// New items, same groups
component.update(
<DetailsList
onRenderDetailsHeader={onRenderDetailsHeader}
onRenderRow={onRenderRow}
onRenderMissingItem={onRenderMissingItem}
groupProps={{ onRenderHeader: onRenderGroupHeader }}
items={roundTwoItems}
groups={groups}
layoutMode={DetailsListLayoutMode.fixedColumns}
skipViewportMeasures={true}
/>,
);
expect(component.toJSON()).toMatchSnapshot();
});
it('returns an element with the correct text based on the second id passed in aria-labelledby', () => {
const container = document.createElement('div');
const columns = [
{
key: 'column1',
name: 'Name',
fieldName: 'name',
minWidth: 100,
maxWidth: 200,
isResizable: true,
isRowHeader: true,
},
{ key: 'column2', name: 'Value', fieldName: 'value', minWidth: 100, maxWidth: 200, isResizable: true },
];
const items = mockData(1);
ReactDOM.render(
<DetailsListBase
items={mockData(1)}
columns={columns}
ariaLabelForSelectionColumn="Toggle selection"
ariaLabelForSelectAllCheckbox="Toggle selection for all items"
checkButtonAriaLabel="select row"
/>,
container,
);
const checkbox = container.querySelector('div[role="checkbox"][aria-label="select row"]') as HTMLElement;
const rowHeaderId = checkbox?.getAttribute('aria-labelledby')?.split(' ')[1];
expect(container.querySelector(`#${rowHeaderId}`)!.textContent).toEqual(items[0].name);
});
it('has an aria-labelledby checkboxId that matches the id of the checkbox', () => {
const component = renderer.create(
<DetailsList
items={mockData(5)}
columns={mockData(5, true)}
ariaLabelForSelectionColumn="Toggle selection"
ariaLabelForSelectAllCheckbox="Toggle selection for all items"
checkButtonAriaLabel="select row"
/>,
);
const detailsRowSource = component.root.findAllByType(DetailsRow)[0];
const detailsRowCheckSource = detailsRowSource.findByType(DetailsRowCheck).props;
const checkboxId = detailsRowCheckSource.id;
expect(checkboxId).toEqual(detailsRowCheckSource[`aria-labelledby`].split(' ')[0]);
});
it('names group header checkboxes based on checkButtonGroupAriaLabel', () => {
const container = document.createElement('div');
ReactDOM.render(
<DetailsList
items={mockData(5)}
groups={[
{
key: 'group0',
name: 'Group 0',
startIndex: 0,
count: 2,
},
{
key: 'group1',
name: 'Group 1',
startIndex: 2,
count: 3,
},
]}
checkButtonGroupAriaLabel="select section"
/>,
container,
);
const checkbox = container.querySelector('[role="checkbox"][aria-label="select section"]') as HTMLElement;
expect(checkbox).not.toBeNull();
const groupNameId = checkbox.getAttribute('aria-labelledby')?.split(' ')[1];
expect(container.querySelector(`#${groupNameId} span`)!.textContent).toEqual('Group 0');
});
it('makes the first row tabbable if isHeaderVisible is false', () => {
const component = renderer.create(
<DetailsList items={mockData(5)} columns={mockData(5, true)} isHeaderVisible={false} />,
);
const firstRow = component.root.findAllByType(DetailsRow)[0];
expect(firstRow.props.focusZoneProps?.tabIndex).toEqual(0);
});
});
``` | /content/code_sandbox/packages/react/src/components/DetailsList/DetailsList.test.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 8,311 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../Strings.resx">
<body>
<trans-unit id="AmazonRegistryFailed">
<source>CONTAINER1002: Request to Amazon Elastic Container Registry failed prematurely. This is often caused when the target repository does not exist in the registry.</source>
<target state="translated">CONTAINER1002: Amazon Elastic Container Registry . .</target>
<note>{StrBegin="CONTAINER1002: "}</note>
</trans-unit>
<trans-unit id="AmbiguousTags">
<source>CONTAINER2008: Both {0} and {1} were provided, but only one or the other is allowed.</source>
<target state="translated">CONTAINER2008: {0} {1}() .</target>
<note>{StrBegin="CONTAINER2008: "}</note>
</trans-unit>
<trans-unit id="AppCommandArgsSetNoAppCommand">
<source>CONTAINER2025: ContainerAppCommandArgs are provided without specifying a ContainerAppCommand.</source>
<target state="translated">CONTAINER2025: ContainerAppCommandArgs ContainerAppCommand .</target>
<note>{StrBegin="CONTAINER2025: "}</note>
</trans-unit>
<trans-unit id="AppCommandSetNotUsed">
<source>CONTAINER2026: ContainerAppCommand and ContainerAppCommandArgs must be empty when ContainerAppCommandInstruction is '{0}'.</source>
<target state="translated">CONTAINER2026: ContainerAppCommandInstruction '{0}' ContainerAppCommand ContainerAppCommandArgs .</target>
<note>{StrBegin="CONTAINER2026: "}</note>
</trans-unit>
<trans-unit id="ArchiveRegistry_PushInfo">
<source>local archive at '{0}'</source>
<target state="translated">'{0}' </target>
<note>{0} is the path to the file written</note>
</trans-unit>
<trans-unit id="BaseEntrypointOverwritten">
<source>CONTAINER2022: The base image has an entrypoint that will be overwritten to start the application. Set ContainerAppCommandInstruction to 'Entrypoint' if this is desired. To preserve the base image entrypoint, set ContainerAppCommandInstruction to 'DefaultArgs'.</source>
<target state="translated">CONTAINER2022: . ContainerAppCommandInstruction 'Entrypoint' . ContainerAppCommandInstruction 'DefaultArgs' .</target>
<note>{StrBegin="CONTAINER2022: "}</note>
</trans-unit>
<trans-unit id="BaseImageNameParsingFailed">
<source>CONTAINER2009: Could not parse {0}: {1}</source>
<target state="translated">CONTAINER2009: {0}() : {1}</target>
<note>{StrBegin="CONTAINER2009: "}</note>
</trans-unit>
<trans-unit id="BaseImageNameRegistryFallback">
<source>CONTAINER2020: {0} does not specify a registry and will be pulled from Docker Hub. Please prefix the name with the image registry, for example: '{1}/<image>'.</source>
<target state="translated">CONTAINER2020: {0}() Docker Hub . (: '{1}/<image>').</target>
<note>{StrBegin="CONTAINER2020: "}</note>
</trans-unit>
<trans-unit id="BaseImageNameWithSpaces">
<source>CONTAINER2013: {0} had spaces in it, replacing with dashes.</source>
<target state="translated">CONTAINER2013: {0} .</target>
<note>{StrBegin="CONTAINER2013: "}</note>
</trans-unit>
<trans-unit id="BaseImageNotFound">
<source>CONTAINER1011: Couldn't find matching base image for {0} that matches RuntimeIdentifier {1}.</source>
<target state="translated">CONTAINER1011: RuntimeIdentifier {1}() {0} .</target>
<note>{StrBegin="CONTAINER1011: "}</note>
</trans-unit>
<trans-unit id="BlobUploadFailed">
<source>CONTAINER1001: Failed to upload blob using {0}; received status code '{1}'.</source>
<target state="translated">CONTAINER1001: {0}() Blob . '{1}' .</target>
<note>{StrBegin="CONTAINER1001: "}</note>
</trans-unit>
<trans-unit id="ContainerBuilder_ImageUploadedToLocalDaemon">
<source>Pushed image '{0}' to {1}.</source>
<target state="translated">'{0}' {1} .</target>
<note />
</trans-unit>
<trans-unit id="ContainerBuilder_ImageUploadedToRegistry">
<source>Pushed image '{0}' to registry '{1}'.</source>
<target state="translated">'{0}' '{1}' .</target>
<note />
</trans-unit>
<trans-unit id="ContainerBuilder_StartBuildingImage">
<source>Building image '{0}' with tags '{1}' on top of base image '{2}'.</source>
<target state="translated"> '{2}' '{1}' '{0}' .</target>
<note />
</trans-unit>
<trans-unit id="CouldntDeserializeJsonToken">
<source>CONTAINER1007: Could not deserialize token from JSON.</source>
<target state="translated">CONTAINER1007: JSON .</target>
<note>{StrBegin="CONTAINER1007: "}</note>
</trans-unit>
<trans-unit id="CouldntRecognizeRegistry">
<source>CONTAINER2012: Could not recognize registry '{0}'.</source>
<target state="translated">CONTAINER2012: '{0}'() .</target>
<note>{StrBegin="CONTAINER2012: "}</note>
</trans-unit>
<trans-unit id="DockerCli_PushInfo">
<source>local registry via '{0}'</source>
<target state="translated">'{0}'() </target>
<note>{0} is the command used</note>
</trans-unit>
<trans-unit id="DockerInfoFailed">
<source>CONTAINER3002: Failed to get docker info({0})\n{1}\n{2}</source>
<target state="translated">CONTAINER3002: ({0}) .\n{1}\n{2}</target>
<note>{StrBegin="CONTAINER3002: "}</note>
</trans-unit>
<trans-unit id="DockerInfoFailed_Ex">
<source>CONTAINER3002: Failed to get docker info: {0}</source>
<target state="translated">CONTAINER3002: : {0}</target>
<note>{StrBegin="CONTAINER3002: "}</note>
</trans-unit>
<trans-unit id="ContainerRuntimeProcessCreationFailed">
<source>CONTAINER3001: Failed creating {0} process.</source>
<target state="translated">CONTAINER3001: {0} .</target>
<note>CONTAINER3001: {0} is the name of the command we failed to run, usually 'docker' or 'podman'.</note>
</trans-unit>
<trans-unit id="EmptyOrWhitespacePropertyIgnored">
<source>CONTAINER4006: Property '{0}' is empty or contains whitespace and will be ignored.</source>
<target state="translated">CONTAINER4006: '{0}'() .</target>
<note>{StrBegin="CONTAINER4006: "}</note>
</trans-unit>
<trans-unit id="EmptyValuesIgnored">
<source>CONTAINER4004: Items '{0}' contain empty item(s) which will be ignored.</source>
<target state="translated">CONTAINER4004: '{0}' .</target>
<note>{StrBegin="CONTAINER4004: "}</note>
</trans-unit>
<trans-unit id="EntrypointAndAppCommandArgsSetNoAppCommandInstruction">
<source>CONTAINER2023: A ContainerEntrypoint and ContainerAppCommandArgs are provided. ContainerAppInstruction must be set to configure how the application is started. Valid instructions are {0}.</source>
<target state="translated">CONTAINER2023: ContainerEntrypoint ContainerAppCommandArgs . ContainerAppInstruction . {0}.</target>
<note>{StrBegin="CONTAINER2023: "}</note>
</trans-unit>
<trans-unit id="EntrypointSetNoAppCommandInstruction">
<source>CONTAINER2027: A ContainerEntrypoint is provided. ContainerAppInstruction must be set to configure how the application is started. Valid instructions are {0}.</source>
<target state="translated">CONTAINER2027: ContainerEntrypoint . ContainerAppInstruction . {0}.</target>
<note>{StrBegin="CONTAINER2027: "}</note>
</trans-unit>
<trans-unit id="EntrypointArgsSetNoEntrypoint">
<source>CONTAINER2024: ContainerEntrypointArgs are provided without specifying a ContainerEntrypoint.</source>
<target state="translated">CONTAINER2024: ContainerEntrypointArgs ContainerEntrypoint .</target>
<note>{StrBegin="CONTAINER2024: "}</note>
</trans-unit>
<trans-unit id="EntrypointArgsSetPreferAppCommandArgs">
<source>CONTAINER2029: ContainerEntrypointArgsSet are provided. Change to use ContainerAppCommandArgs for arguments that must always be set, or ContainerDefaultArgs for arguments that can be overridden when the container is created.</source>
<target state="translated">CONTAINER2029: ContainerEntrypointArgsSet . ContainerAppCommandArgs ContainerDefaultArgs .</target>
<note>{StrBegin="CONTAINER2029: "}</note>
</trans-unit>
<trans-unit id="EntrypointConflictAppCommand">
<source>CONTAINER2028: ContainerEntrypoint can not be combined with ContainerAppCommandInstruction '{0}'.</source>
<target state="translated">CONTAINER2028: ContainerEntrypoint '{0}' ContainerAppCommandInstruction .</target>
<note>{StrBegin="CONTAINER2028: "}</note>
</trans-unit>
<trans-unit id="FailedRetrievingCredentials">
<source>CONTAINER1008: Failed retrieving credentials for "{0}": {1}</source>
<target state="translated">CONTAINER1008: "{0}" : {1}</target>
<note>{StrBegin="CONTAINER1008: "}</note>
</trans-unit>
<trans-unit id="GenerateDigestLabelWithoutGenerateLabels">
<source>CONTAINER2030: GenerateLabels was disabled but GenerateDigestLabel was enabled - no digest label will be created.</source>
<target state="translated">CONTAINER2030: GenerateLabels GenerateDigestLabel . .</target>
<note>{StrBegin="CONTAINER2030: "}</note>
</trans-unit>
<trans-unit id="HostObjectNotDetected">
<source>No host object detected.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="ImageLoadFailed">
<source>CONTAINER1009: Failed to load image from local registry. stdout: {0}</source>
<target state="translated">CONTAINER1009: . stdout: {0}</target>
<note>{StrBegin="CONTAINER1009: "}</note>
</trans-unit>
<trans-unit id="ImagePullNotSupported">
<source>CONTAINER1010: Pulling images from local registry is not supported.</source>
<target state="translated">CONTAINER1010: .</target>
<note>{StrBegin="CONTAINER1010: "}</note>
</trans-unit>
<trans-unit id="InvalidEnvVar">
<source>CONTAINER2015: {0}: '{1}' was not a valid Environment Variable. Ignoring.</source>
<target state="translated">CONTAINER2015: {0}: '{1}'() . .</target>
<note>{StrBegin="CONTAINER2015: "}</note>
</trans-unit>
<trans-unit id="InvalidImageName_EntireNameIsInvalidCharacters">
<source>CONTAINER2005: The inferred image name '{0}' contains entirely invalid characters. The valid characters for an image name arealphanumeric characters, -, /, or _, and the image name must start with an alphanumeric character.</source>
<target state="translated">CONTAINER2005: '{0}' . , -, / _ .</target>
<note>{StrBegin="CONTAINER2005: "}</note>
</trans-unit>
<trans-unit id="InvalidImageName_NonAlphanumericStartCharacter">
<source>CONTAINER2005: The first character of the image name '{0}' must be a lowercase letter or a digit and all characters in the name must be an alphanumeric character, -, /, or _.</source>
<target state="translated">CONTAINER2005: '{0}' , -, / _ .</target>
<note>{StrBegin="CONTAINER2005: "}</note>
</trans-unit>
<trans-unit id="InvalidPort_Number">
<source>CONTAINER2017: A ContainerPort item was provided with an invalid port number '{0}'. ContainerPort items must have an Include value that is an integer, and a Type value that is either 'tcp' or 'udp'.</source>
<target state="translated">CONTAINER2017: ContainerPort '{0}'() . ContainerPort Include 'tcp' 'udp' Type .</target>
<note>{StrBegin="CONTAINER2017: "}</note>
</trans-unit>
<trans-unit id="InvalidPort_NumberAndType">
<source>CONTAINER2017: A ContainerPort item was provided with an invalid port number '{0}' and an invalid port type '{1}'. ContainerPort items must have an Include value that is an integer, and a Type value that is either 'tcp' or 'udp'.</source>
<target state="translated">CONTAINER2017: '{0}' '{1}'() ContainerPort . ContainerPort Include 'tcp' 'udp' Type .</target>
<note>{StrBegin="CONTAINER2017: "}</note>
</trans-unit>
<trans-unit id="InvalidPort_Type">
<source>CONTAINER2017: A ContainerPort item was provided with an invalid port type '{0}'. ContainerPort items must have an Include value that is an integer, and a Type value that is either 'tcp' or 'udp'.</source>
<target state="translated">CONTAINER2017: '{0}'() ContainerPort . ContainerPort Include 'tcp' 'udp' Type .</target>
<note>{StrBegin="CONTAINER2017: "}</note>
</trans-unit>
<trans-unit id="InvalidSdkPrereleaseVersion">
<source>CONTAINER2018: Invalid SDK prerelease version '{0}' - only 'rc' and 'preview' are supported.</source>
<target state="translated">CONTAINER2018: SDK '{0}' - 'rc' 'preview' .</target>
<note>{StrBegin="CONTAINER2018: "}</note>
</trans-unit>
<trans-unit id="InvalidSdkVersion">
<source>CONTAINER2019: Invalid SDK semantic version '{0}'.</source>
<target state="translated">CONTAINER2019: SDK '{0}'.</target>
<note>{StrBegin="CONTAINER2019: "}</note>
</trans-unit>
<trans-unit id="InvalidTag">
<source>CONTAINER2007: Invalid {0} provided: {1}. Image tags must be alphanumeric, underscore, hyphen, or period.</source>
<target state="translated">CONTAINER2007: {0}() : {1}. , , .</target>
<note>{StrBegin="CONTAINER2007: "}</note>
</trans-unit>
<trans-unit id="InvalidTags">
<source>CONTAINER2010: Invalid {0} provided: {1}. {0} must be a semicolon-delimited list of valid image tags. Image tags must be alphanumeric, underscore, hyphen, or period.</source>
<target state="translated">CONTAINER2010: {0}() : {1}. {0}() . , , .</target>
<note>{StrBegin="CONTAINER2010: "}</note>
</trans-unit>
<trans-unit id="InvalidTokenResponse">
<source>CONTAINER1003: Token response had neither token nor access_token.</source>
<target state="translated">CONTAINER1003: access_token .</target>
<note>{StrBegin="CONTAINER1003: "}</note>
</trans-unit>
<trans-unit id="ItemsWithoutMetadata">
<source>CONTAINER4005: Item '{0}' contains items without metadata 'Value', and they will be ignored.</source>
<target state="translated">CONTAINER4005: '{0}' '' .</target>
<note>{StrBegin="CONTAINER4005: "}</note>
</trans-unit>
<trans-unit id="LocalRegistryNotAvailable">
<source>CONTAINER1012: The local registry is not available, but pushing to a local registry was requested.</source>
<target state="translated">CONTAINER1012: .</target>
<note>{StrBegin="CONTAINER1012: "}</note>
</trans-unit>
<trans-unit id="LocalDocker_FailedToGetConfig">
<source>Error while reading daemon config: {0}</source>
<target state="translated"> . {0}</target>
<note>{0} is the exception message that ends with period</note>
</trans-unit>
<trans-unit id="LocalDocker_LocalDaemonErrors">
<source>The daemon server reported errors: {0}</source>
<target state="translated"> . {0}</target>
<note>{0} are the list of messages, each message starts with new line</note>
</trans-unit>
<trans-unit id="MissingLinkToRegistry">
<source>CONTAINER2004: Unable to download layer with descriptor '{0}' from registry '{1}' because it does not exist.</source>
<target state="translated">CONTAINER2004: '{1}' '{0}' .</target>
<note>{StrBegin="CONTAINER2004: "}</note>
</trans-unit>
<trans-unit id="MissingPortNumber">
<source>CONTAINER2016: ContainerPort item '{0}' does not specify the port number. Please ensure the item's Include is a port number, for example '<ContainerPort Include="80" />'</source>
<target state="translated">CONTAINER2016: ContainerPort '{0}'() . (: '<ContainerPort Include="80" />').</target>
<note>{StrBegin="CONTAINER2016: "}</note>
</trans-unit>
<trans-unit id="NoRequestUriSpecified">
<source>CONTAINER1004: No RequestUri specified.</source>
<target state="translated">CONTAINER1004: RequestUri .</target>
<note>{StrBegin="CONTAINER1004: "}</note>
</trans-unit>
<trans-unit id="NormalizedContainerName">
<source>'{0}' was not a valid container image name, it was normalized to '{1}'</source>
<target state="translated">'{0}'() . '{1}'() .</target>
<note />
</trans-unit>
<trans-unit id="PublishDirectoryDoesntExist">
<source>CONTAINER2011: {0} '{1}' does not exist</source>
<target state="translated">CONTAINER2011: {0} '{1}'() .</target>
<note>{StrBegin="CONTAINER2011: "}</note>
</trans-unit>
<trans-unit id="RegistryOperationFailed">
<source>CONTAINER1017: Unable to communicate with the registry '{0}'.</source>
<target state="translated">CONTAINER1017: '{0}' .</target>
<note>{StrBegin="CONTAINER1017:" }</note>
</trans-unit>
<trans-unit id="RegistryOutputPushFailed">
<source>CONTAINER1013: Failed to push to the output registry: {0}</source>
<target state="translated">CONTAINER1013: : {0}</target>
<note>{StrBegin="CONTAINER1013: "}</note>
</trans-unit>
<trans-unit id="RegistryPullFailed">
<source>CONTAINER1014: Manifest pull failed.</source>
<target state="translated">CONTAINER1014: .</target>
<note>{StrBegin="CONTAINER1014: "}</note>
</trans-unit>
<trans-unit id="RegistryPushFailed">
<source>CONTAINER1005: Registry push failed; received status code '{0}'.</source>
<target state="translated">CONTAINER1005: . '{0}'() .</target>
<note>{StrBegin="CONTAINER1005: "}</note>
</trans-unit>
<trans-unit id="Registry_ConfigUploadStarted">
<source>Uploading config to registry at blob '{0}',</source>
<target state="translated">Blob '{0}' .</target>
<note />
</trans-unit>
<trans-unit id="Registry_ConfigUploaded">
<source>Uploaded config to registry.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="Registry_LayerExists">
<source>Layer '{0}' already exists.</source>
<target state="translated">'{0}' .</target>
<note />
</trans-unit>
<trans-unit id="Registry_LayerUploadStarted">
<source>Uploading layer '{0}' to '{1}'.</source>
<target state="translated">'{1}' '{0}' .</target>
<note>{0} is the layer digest, {1} is the registry name</note>
</trans-unit>
<trans-unit id="Registry_LayerUploaded">
<source>Finished uploading layer '{0}' to '{1}'.</source>
<target state="translated">'{1}' '{0}' .</target>
<note>{0} is the layer digest, {1} is the registry name</note>
</trans-unit>
<trans-unit id="Registry_ManifestUploadStarted">
<source>Uploading manifest to registry '{0}' as blob '{1}'.</source>
<target state="translated">'{0}' '{1}' Blob .</target>
<note>{0} is the registry name</note>
</trans-unit>
<trans-unit id="Registry_ManifestUploaded">
<source>Uploaded manifest to '{0}'.</source>
<target state="translated">'{0}' .</target>
<note>{0} is the registry name</note>
</trans-unit>
<trans-unit id="Registry_TagUploadStarted">
<source>Uploading tag '{0}' to '{1}'.</source>
<target state="translated">'{1}' '{0}' .</target>
<note>{1} is the registry name</note>
</trans-unit>
<trans-unit id="Registry_TagUploaded">
<source>Uploaded tag '{0}' to '{1}'.</source>
<target state="translated">'{1}' '{0}' .</target>
<note>{1} is the registry name</note>
</trans-unit>
<trans-unit id="RepositoryNotFound">
<source>CONTAINER1015: Unable to access the repository '{0}' at tag '{1}' in the registry '{2}'. Please confirm that this name and tag are present in the registry.</source>
<target state="translated">CONTAINER1015: '{2}' '{1}' '{0}' . .</target>
<note>{StrBegin="CONTAINER1015: "}</note>
</trans-unit>
<trans-unit id="RequiredItemsContainsEmptyItems">
<source>CONTAINER4003: Required '{0}' items contain empty items.</source>
<target state="translated">CONTAINER4003: '{0}' .</target>
<note>{StrBegin="CONTAINER4003: "}</note>
</trans-unit>
<trans-unit id="RequiredItemsNotSet">
<source>CONTAINER4002: Required '{0}' items were not set.</source>
<target state="translated">CONTAINER4002: '{0}' .</target>
<note>{StrBegin="CONTAINER4002: "}</note>
</trans-unit>
<trans-unit id="RequiredPropertyNotSetOrEmpty">
<source>CONTAINER4001: Required property '{0}' was not set or empty.</source>
<target state="translated">CONTAINER4001: '{0}'() .</target>
<note>{StrBegin="CONTAINER4001: "}</note>
</trans-unit>
<trans-unit id="TooManyRetries">
<source>CONTAINER1006: Too many retries, stopping.</source>
<target state="translated">CONTAINER1006: .</target>
<note>{StrBegin="CONTAINER1006: "}</note>
</trans-unit>
<trans-unit id="UnableToAccessRepository">
<source>CONTAINER1016: Unable to access the repository '{0}' in the registry '{1}'. Please confirm your credentials are correct and that you have access to this repository and registry.</source>
<target state="translated">CONTAINER1016: '{1}' '{0}' . .</target>
<note>{StrBegin="CONTAINER1016:" }</note>
</trans-unit>
<trans-unit id="UnknownAppCommandInstruction">
<source>CONTAINER2021: Unknown AppCommandInstruction '{0}'. Valid instructions are {1}.</source>
<target state="translated">CONTAINER2021: AppCommandInstruction '{0}'. {1}.</target>
<note>{StrBegin="CONTAINER2021: "}</note>
</trans-unit>
<trans-unit id="UnknownLocalRegistryType">
<source>CONTAINER2002: Unknown local registry type '{0}'. Valid local container registry types are {1}.</source>
<target state="translated">CONTAINER2002: '{0}'. {1}.</target>
<note>{StrBegin="CONTAINER2002: "}</note>
</trans-unit>
<trans-unit id="UnknownMediaType">
<source>CONTAINER2003: The manifest for {0}:{1} from registry {2} was an unknown type: {3}. Please raise an issue at path_to_url with this message.</source>
<target state="translated">CONTAINER2003: {2} {0}:{1} : {3}. path_to_url .</target>
<note>{StrBegin="CONTAINER2003: "}</note>
</trans-unit>
<trans-unit id="UnrecognizedMediaType">
<source>CONTAINER2001: Unrecognized mediaType '{0}'.</source>
<target state="translated">CONTAINER2001: '{0}'() .</target>
<note>{StrBegin="CONTAINER2001: "}</note>
</trans-unit>
<trans-unit id="_Test">
<source>CONTAINER0000: Value for unit test {0}</source>
<target state="translated">CONTAINER0000: {0}</target>
<note>Used only for unit tests</note>
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Containers/Microsoft.NET.Build.Containers/Resources/xlf/Strings.ko.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 6,364 |
```xml
import RedditContent from './RedditContent';
import RedditUser from './RedditUser';
import * as Snoowrap from '../snoowrap';
export interface BanStatus {
endDate?: string | null;
reason: string;
isBanned: boolean;
isPermanent: boolean;
}
export interface RecentPost {
date: string;
permalink: string;
title: string;
}
export interface RecentConvo {
date: string;
permalink: string;
id: string;
subject: string;
}
export interface RecentComment {
date: string;
permalink: string;
title: string;
comment: string;
}
/**
* A class representing an author from a modmail conversation
* <style> #ModmailConversationAuthor {display: none} </style>
* @example
*
* // Get a Modmail Conversation author with a given ID
* r.getNewModmailConversation('75hxt').getParticipant()
* @extends RedditContent
*/
export default class ModmailConversationAuthor extends RedditContent<ModmailConversationAuthor> {
name!: string;
isMod?: boolean;
isAdmin?: boolean;
isOp?: boolean;
isParticipant?: boolean;
isHidden?: boolean;
isDeleted?: boolean;
// these fields only show up sometimes
banStatus?: BanStatus;
isSuspended?: boolean;
isShadowBanned?: boolean;
recentPosts?: { [id: string]: RecentPost };
recentConvos?: { [id: string]: RecentConvo };
recentComments?: { [id: string]: RecentComment };
constructor (options: any, r: Snoowrap, hasFetched: boolean) {
super(options, r, hasFetched);
options.recentComments = Object.keys(options.recentComments).map(commentId => this._r._newObject('Comment', {
name: commentId,
...options.recentComments[commentId]
}));
options.recentPosts = Object.keys(options.recentPosts).map(postId => this._r._newObject('Submission', {
name: postId,
...options.recentPosts[postId]
}));
}
/**
* @summary Gets information on a Reddit user for the given modmail.
* @returns {RedditUser} An unfetched RedditUser object for the requested user
* @example
*
* r.getNewModmailConversation('efy3lax').getParticipant().getUser()
* // => RedditUser { name: 'not_an_aardvark' }
* r.getNewModmailConversation('efy3lax').getParticipant().getUser().link_karma.then(console.log)
* // => 6
*/
getUser (): Promise<RedditUser> {
return this._r.getUser(this.name);
}
};
``` | /content/code_sandbox/src/objects/ModmailConversationAuthor.ts | xml | 2016-01-18T06:13:04 | 2024-08-09T14:11:47 | snoowrap | not-an-aardvark/snoowrap | 1,011 | 593 |
```xml
import { timeout, sleep } from '../../src/lib/promise'
jest.useFakeTimers()
describe('timeout', () => {
it('falls back to the fallback value if promise takes too long', async () => {
const promise = timeout(
sleep(1000).then(() => 'foo'),
500,
'bar'
)
jest.advanceTimersByTime(500)
expect(await promise).toBe('bar')
})
it('returns the promise result if it finishes in time', async () => {
const promise = timeout(Promise.resolve('foo'), 500, 'bar')
jest.advanceTimersByTime(500)
expect(await promise).toBe('foo')
})
})
``` | /content/code_sandbox/app/test/unit/promise-test.ts | xml | 2016-05-11T15:59:00 | 2024-08-16T17:00:41 | desktop | desktop/desktop | 19,544 | 151 |
```xml
import {
formatExpirationDateMMYY,
formatExpirationDateMMYYYY,
formatExpirationDateYYYYMM,
} from '@proton/pass/lib/validation/credit-card';
describe('expiration date', () => {
describe('formatExpirationDateMMYY', () => {
test('should parse and validate MMYY format', () => {
expect(formatExpirationDateMMYY('012026')).toEqual('0126');
expect(formatExpirationDateMMYY('0126')).toEqual('0126');
expect(formatExpirationDateMMYY('122000')).toEqual('1200');
expect(formatExpirationDateMMYY('1200')).toEqual('1200');
});
test('should parse and validate MMYY with separators', () => {
expect(formatExpirationDateMMYY('12.34')).toEqual('1234');
expect(formatExpirationDateMMYY('12/34')).toEqual('1234');
expect(formatExpirationDateMMYY('12-34')).toEqual('1234');
expect(formatExpirationDateMMYY('12 34')).toEqual('1234');
expect(formatExpirationDateMMYY('12,34')).toEqual('1234');
});
test('should parse and validate MMYYYY with separators', () => {
expect(formatExpirationDateMMYY('12.2034')).toEqual('1234');
expect(formatExpirationDateMMYY('12/2034')).toEqual('1234');
expect(formatExpirationDateMMYY('12-2034')).toEqual('1234');
expect(formatExpirationDateMMYY('12 2034')).toEqual('1234');
expect(formatExpirationDateMMYY('12,2034')).toEqual('1234');
expect(formatExpirationDateMMYY('12,,2034')).toEqual('1234');
});
test('should parse and validate YYYY-MM', () => {
expect(formatExpirationDateMMYY('2034-12')).toEqual('1234');
});
test('should return empty string if could not validate date parts', () => {
expect(formatExpirationDateMMYY('1')).toEqual('');
expect(formatExpirationDateMMYY('12')).toEqual('');
expect(formatExpirationDateMMYY('123')).toEqual('');
expect(formatExpirationDateMMYY('12345')).toEqual('');
expect(formatExpirationDateMMYY('1234567')).toEqual('');
expect(formatExpirationDateMMYY('ab26')).toEqual('');
expect(formatExpirationDateMMYY('notnumber')).toEqual('');
expect(formatExpirationDateMMYY('12-034')).toEqual('');
});
});
describe('formatExpirationDateMMYYYY', () => {
test('should parse and validate MMYY format', () => {
expect(formatExpirationDateMMYYYY('012026')).toEqual('012026');
expect(formatExpirationDateMMYYYY('0126')).toEqual('012026');
expect(formatExpirationDateMMYYYY('122000')).toEqual('122000');
expect(formatExpirationDateMMYYYY('1200')).toEqual('122000');
});
test('should parse and validate MMYY with separators', () => {
expect(formatExpirationDateMMYYYY('12.34')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12/34')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12-34')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12 34')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12,34')).toEqual('122034');
});
test('should parse and validate MMYYYY with separators', () => {
expect(formatExpirationDateMMYYYY('12.2034')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12/2034')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12-2034')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12 2034')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12,2034')).toEqual('122034');
expect(formatExpirationDateMMYYYY('12,,2034')).toEqual('122034');
});
test('should parse and validate YYYY-MM', () => {
expect(formatExpirationDateMMYYYY('2034-12')).toEqual('122034');
});
test('should return empty string if could not validate date parts', () => {
expect(formatExpirationDateMMYYYY('1')).toEqual('');
expect(formatExpirationDateMMYYYY('12')).toEqual('');
expect(formatExpirationDateMMYYYY('123')).toEqual('');
expect(formatExpirationDateMMYYYY('12345')).toEqual('');
expect(formatExpirationDateMMYYYY('1234567')).toEqual('');
expect(formatExpirationDateMMYYYY('ab26')).toEqual('');
expect(formatExpirationDateMMYYYY('notnumber')).toEqual('');
expect(formatExpirationDateMMYYYY('12-034')).toEqual('');
});
});
describe('formatExpirationDateYYYYMM', () => {
test('should parse and validate MMYY format', () => {
expect(formatExpirationDateYYYYMM('012026')).toEqual('2026-01');
expect(formatExpirationDateYYYYMM('0126')).toEqual('2026-01');
expect(formatExpirationDateYYYYMM('122000')).toEqual('2000-12');
expect(formatExpirationDateYYYYMM('1200')).toEqual('2000-12');
});
test('should parse and validate MMYY with separators', () => {
expect(formatExpirationDateYYYYMM('12.34')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12/34')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12-34')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12 34')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12,34')).toEqual('2034-12');
});
test('should parse and validate MMYYYY with separators', () => {
expect(formatExpirationDateYYYYMM('12.2034')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12/2034')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12-2034')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12 2034')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12,2034')).toEqual('2034-12');
expect(formatExpirationDateYYYYMM('12,,2034')).toEqual('2034-12');
});
test('should parse and validate YYYY-MM', () => {
expect(formatExpirationDateYYYYMM('2034-12')).toEqual('2034-12');
});
test('should return empty string if could not validate date parts', () => {
expect(formatExpirationDateYYYYMM('1')).toEqual('');
expect(formatExpirationDateYYYYMM('12')).toEqual('');
expect(formatExpirationDateYYYYMM('123')).toEqual('');
expect(formatExpirationDateYYYYMM('12345')).toEqual('');
expect(formatExpirationDateYYYYMM('1234567')).toEqual('');
expect(formatExpirationDateYYYYMM('ab26')).toEqual('');
expect(formatExpirationDateYYYYMM('notnumber')).toEqual('');
expect(formatExpirationDateYYYYMM('12-034')).toEqual('');
});
});
});
``` | /content/code_sandbox/packages/pass/lib/validation/credit-card.spec.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 1,505 |
```xml
import Tags from '@erxes/ui/src/components/Tags';
export default Tags;
``` | /content/code_sandbox/packages/core-ui/src/modules/common/components/Tags.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 17 |
```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 { Component, Inject, OnInit, SkipSelf } from '@angular/core';
import { ErrorStateMatcher } from '@angular/material/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, FormGroupDirective, NgForm, Validators } from '@angular/forms';
import { DeviceService } from '@core/http/device.service';
import { EdgeService } from '@core/http/edge.service';
import { EntityType } from '@shared/models/entity-type.models';
import { forkJoin, Observable } from 'rxjs';
import { AssetService } from '@core/http/asset.service';
import { EntityViewService } from '@core/http/entity-view.service';
import { DashboardService } from '@core/http/dashboard.service';
import { DialogComponent } from '@shared/components/dialog.component';
import { Router } from '@angular/router';
import { RuleChainService } from '@core/http/rule-chain.service';
import { RuleChainType } from '@shared/models/rule-chain.models';
export interface AddEntitiesToEdgeDialogData {
edgeId: string;
entityType: EntityType;
}
@Component({
selector: 'tb-add-entities-to-edge-dialog',
templateUrl: './add-entities-to-edge-dialog.component.html',
providers: [{provide: ErrorStateMatcher, useExisting: AddEntitiesToEdgeDialogComponent}],
styleUrls: []
})
export class AddEntitiesToEdgeDialogComponent extends
DialogComponent<AddEntitiesToEdgeDialogComponent, boolean> implements OnInit, ErrorStateMatcher {
addEntitiesToEdgeFormGroup: UntypedFormGroup;
submitted = false;
entityType: EntityType;
subType: string;
assignToEdgeTitle: string;
assignToEdgeText: string;
constructor(protected store: Store<AppState>,
protected router: Router,
@Inject(MAT_DIALOG_DATA) public data: AddEntitiesToEdgeDialogData,
private deviceService: DeviceService,
private edgeService: EdgeService,
private assetService: AssetService,
private entityViewService: EntityViewService,
private dashboardService: DashboardService,
private ruleChainService: RuleChainService,
@SkipSelf() private errorStateMatcher: ErrorStateMatcher,
public dialogRef: MatDialogRef<AddEntitiesToEdgeDialogComponent, boolean>,
public fb: UntypedFormBuilder) {
super(store, router, dialogRef);
this.entityType = this.data.entityType;
}
ngOnInit(): void {
this.addEntitiesToEdgeFormGroup = this.fb.group({
entityIds: [null, [Validators.required]]
});
this.subType = '';
switch (this.entityType) {
case EntityType.DEVICE:
this.assignToEdgeTitle = 'device.assign-device-to-edge-title';
this.assignToEdgeText = 'device.assign-device-to-edge-text';
break;
case EntityType.RULE_CHAIN:
this.assignToEdgeTitle = 'rulechain.assign-rulechain-to-edge-title';
this.assignToEdgeText = 'rulechain.assign-rulechain-to-edge-text';
this.subType = RuleChainType.EDGE;
break;
case EntityType.ASSET:
this.assignToEdgeTitle = 'asset.assign-asset-to-edge-title';
this.assignToEdgeText = 'asset.assign-asset-to-edge-text';
break;
case EntityType.ENTITY_VIEW:
this.assignToEdgeTitle = 'entity-view.assign-entity-view-to-edge-title';
this.assignToEdgeText = 'entity-view.assign-entity-view-to-edge-text';
break;
case EntityType.DASHBOARD:
this.assignToEdgeTitle = 'dashboard.assign-dashboard-to-edge-title';
this.assignToEdgeText = 'dashboard.assign-dashboard-to-edge-text';
break;
}
}
isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {
const originalErrorState = this.errorStateMatcher.isErrorState(control, form);
const customErrorState = !!(control && control.invalid && this.submitted);
return originalErrorState || customErrorState;
}
cancel(): void {
this.dialogRef.close(false);
}
assign(): void {
this.submitted = true;
const entityIds: Array<string> = this.addEntitiesToEdgeFormGroup.get('entityIds').value;
const tasks: Observable<any>[] = [];
entityIds.forEach(
(entityId) => {
tasks.push(this.getAssignToEdgeTask(this.data.edgeId, entityId, this.entityType));
}
);
forkJoin(tasks).subscribe(
() => {
this.dialogRef.close(true);
}
);
}
private getAssignToEdgeTask(edgeId: string, entityId: string, entityType: EntityType): Observable<any> {
switch (entityType) {
case EntityType.DEVICE:
return this.deviceService.assignDeviceToEdge(edgeId, entityId);
case EntityType.ASSET:
return this.assetService.assignAssetToEdge(edgeId, entityId);
case EntityType.ENTITY_VIEW:
return this.entityViewService.assignEntityViewToEdge(edgeId, entityId);
case EntityType.DASHBOARD:
return this.dashboardService.assignDashboardToEdge(edgeId, entityId);
case EntityType.RULE_CHAIN:
return this.ruleChainService.assignRuleChainToEdge(edgeId, entityId);
}
}
}
``` | /content/code_sandbox/ui-ngx/src/app/modules/home/dialogs/add-entities-to-edge-dialog.component.ts | xml | 2016-12-01T09:33:30 | 2024-08-16T19:58:25 | thingsboard | thingsboard/thingsboard | 16,820 | 1,156 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net35;net45;netstandard1.3;netstandard2.0</TargetFrameworks>
<Authors>Harry McIntyre</Authors>
<Title>OneOf - Easy Discriminated Unions for c#</Title>
<Company>Harry McIntyre</Company>
<PackageVersion>1.0.0</PackageVersion>
<Product>Harry McIntyre</Product>
<Description>F# style discriminated unions for C#, using a custom type OneOf<T0, ... Tn> which holds a single value and has a .Match(...) method on it for exhaustive matching. Simple but powerful.</Description>
<PackageProjectUrl>path_to_url
<PackageTags>discriminated unions, return type, match switch</PackageTags>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>OneOf</PackageId>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/OneOf/OneOf.csproj | xml | 2016-01-12T22:31:19 | 2024-08-15T23:49:59 | OneOf | mcintyre321/OneOf | 3,372 | 307 |
```xml
import { MaputnikDriver } from "./maputnik-driver";
describe("accessibility", () => {
let { beforeAndAfter, get, when, then } = new MaputnikDriver();
beforeAndAfter();
describe("skip links", () => {
beforeEach(() => {
when.setStyle("layer");
});
it("skip link to layer list", () => {
const selector = "root:skip:layer-list";
then(get.elementByTestId(selector)).shouldExist();
when.tab();
then(get.elementByTestId(selector)).shouldBeFocused();
when.click(selector);
then(get.skipTargetLayerList()).shouldBeFocused();
});
// This fails for some reason only in Chrome, but passes in firefox. Adding a skip here to allow merge and later on we'll decide if we want to fix this or not.
it.skip("skip link to layer editor", () => {
const selector = "root:skip:layer-editor";
then(get.elementByTestId(selector)).shouldExist();
when.tab().tab();
then(get.elementByTestId(selector)).shouldBeFocused();
when.click(selector);
then(get.skipTargetLayerEditor()).shouldBeFocused();
});
it("skip link to map view", () => {
const selector = "root:skip:map-view";
then(get.elementByTestId(selector)).shouldExist();
when.tab().tab().tab();
then(get.elementByTestId(selector)).shouldBeFocused();
when.click(selector);
then(get.canvas()).shouldBeFocused();
});
});
});
``` | /content/code_sandbox/cypress/e2e/accessibility.cy.ts | xml | 2016-09-08T17:52:22 | 2024-08-16T12:54:23 | maputnik | maplibre/maputnik | 2,046 | 319 |
```xml
/*
* Wire
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program. If not, see path_to_url
*
*/
import React, {useEffect, useState} from 'react';
import * as Icon from 'Components/Icon';
import {MediaDeviceType} from 'src/script/media/MediaDeviceType';
import {useKoSubscribableChildren} from 'Util/ComponentUtil';
import {t} from 'Util/LocalizerUtil';
import {getLogger} from 'Util/Logger';
import {DeviceSelect} from './DeviceSelect';
import {InputLevel} from './InputLevel';
import {Config} from '../../../../../Config';
import {MediaDevicesHandler} from '../../../../../media/MediaDevicesHandler';
import {MediaStreamHandler} from '../../../../../media/MediaStreamHandler';
import {MediaType} from '../../../../../media/MediaType';
import {PreferencesSection} from '../components/PreferencesSection';
const logger = getLogger('MicrophonePreferences');
interface MicrophonePreferencesProps {
devicesHandler: MediaDevicesHandler;
refreshStream: () => Promise<MediaStream>;
streamHandler: MediaStreamHandler;
}
const MicrophonePreferences: React.FC<MicrophonePreferencesProps> = ({
devicesHandler,
streamHandler,
refreshStream,
}) => {
const [isRequesting, setIsRequesting] = useState(false);
const [stream, setStream] = useState<MediaStream>();
const {[MediaDeviceType.AUDIO_INPUT]: availableDevices} = useKoSubscribableChildren(
devicesHandler?.availableDevices,
[MediaDeviceType.AUDIO_INPUT],
);
const {[MediaDeviceType.AUDIO_INPUT]: currentDeviceId} = useKoSubscribableChildren(devicesHandler?.currentDeviceId, [
MediaDeviceType.AUDIO_INPUT,
]);
const {URL: urls} = Config.getConfig();
const requestStream = async () => {
setIsRequesting(true);
try {
setStream(await refreshStream());
} catch (error) {
logger.warn(`Requesting MediaStream for type "${MediaType.AUDIO}" failed: ${error.message}`, error);
setStream(null);
} finally {
setIsRequesting(false);
}
};
useEffect(() => {
requestStream();
}, [currentDeviceId]);
useEffect(
() => () => {
if (stream) {
streamHandler.releaseTracksFromStream(stream);
}
},
[stream],
);
return (
<PreferencesSection title={t('preferencesAVMicrophone')}>
{!stream && !isRequesting && (
<div className="preferences-av-detail">
<a rel="nofollow noopener noreferrer" target="_blank" href={urls.SUPPORT.DEVICE_ACCESS_DENIED}>
{t('preferencesAVPermissionDetail')}
</a>
</div>
)}
<DeviceSelect
uieName="enter-microphone"
devices={availableDevices as MediaDeviceInfo[]}
value={currentDeviceId}
defaultDeviceName={t('preferencesAVMicrophone')}
icon={Icon.MicOnIcon}
isRequesting={isRequesting}
onChange={deviceId => devicesHandler.currentDeviceId[MediaDeviceType.AUDIO_INPUT](deviceId)}
title={t('preferencesAVMicrophone')}
/>
{isRequesting ? (
<div className="preferences-av-spinner">
<div className="icon-spinner spin accent-text"></div>
</div>
) : (
<InputLevel className="preferences-av-meter accent-text" disabled={!stream} mediaStream={stream} />
)}
</PreferencesSection>
);
};
export {MicrophonePreferences};
``` | /content/code_sandbox/src/script/page/MainContent/panels/preferences/avPreferences/MicrophonePreferences.tsx | xml | 2016-07-21T15:34:05 | 2024-08-16T11:40:13 | wire-webapp | wireapp/wire-webapp | 1,125 | 814 |
```xml
import * as sortBy from "lodash/sortBy"
import * as Oni from "oni-api"
import {
compareItemsByScoreOni,
getHighlightsFromResult,
scoreItemOni,
} from "./../../Search/Scorer/OniQuickOpenScorer"
import { ScorerCache } from "./../../Search/Scorer/QuickOpenScorer"
import * as utils from "./Utils"
import { IMenuOptionWithHighlights } from "./../Menu"
export function filter(
options: Oni.Menu.MenuOption[],
searchString: string,
): IMenuOptionWithHighlights[] {
if (!searchString) {
const opt = options.map(o => {
return {
...o,
detailHighlights: [],
labelHighlights: [],
}
})
return sortBy(opt, o => (o.pinned ? 0 : 1))
}
const isCaseSensitive = utils.shouldBeCaseSensitive(searchString)
if (!isCaseSensitive) {
searchString = searchString.toLowerCase()
}
const listOfSearchTerms = searchString.split(" ").filter(x => x)
// Since the VSCode scorer doesn't deal so well with the spaces,
// instead rebuild the term in reverse order.
// ie `index browser editor` becomes `browsereditorindex`
// This allows the scoring and highlighting to work better.
const vsCodeSearchString =
listOfSearchTerms.length > 1
? listOfSearchTerms.slice(1).join("") + listOfSearchTerms[0]
: listOfSearchTerms[0]
// Adds a cache for the scores. This is needed to stop the final score
// compare from repeating all the scoring logic again.
// Currently, this only persists for the current search, which will speed
// up that search only.
// TODO: Is it worth instead persisting this cache?
// Plus side is repeated searches are fast.
// Down side is there will be a lot of rubbish being stored too.
const cache: ScorerCache = {}
const filteredOptions = processSearchTerm(vsCodeSearchString, options, cache)
const ret = filteredOptions.filter(fo => {
if (fo.score === 0) {
return false
} else {
return true
}
})
return ret.sort((e1, e2) => compareItemsByScoreOni(e1, e2, vsCodeSearchString, true, cache))
}
export function processSearchTerm(
searchString: string,
options: Oni.Menu.MenuOption[],
cache: ScorerCache,
): Oni.Menu.IMenuOptionWithHighlights[] {
const result: Oni.Menu.IMenuOptionWithHighlights[] = options.map(f => {
const itemScore = scoreItemOni(f, searchString, true, cache)
const detailHighlights = getHighlightsFromResult(itemScore.descriptionMatch)
const labelHighlights = getHighlightsFromResult(itemScore.labelMatch)
return {
...f,
detailHighlights,
labelHighlights,
score: f.pinned ? Number.MAX_SAFE_INTEGER : itemScore.score,
}
})
return result
}
``` | /content/code_sandbox/browser/src/Services/Menu/Filter/VSCodeFilter.ts | xml | 2016-11-16T14:42:55 | 2024-08-14T11:48:05 | oni | onivim/oni | 11,355 | 652 |
```xml
import { HttpServiceInterface } from '../../Http/HttpServiceInterface'
import {
ListAuthenticatorsRequestParams,
GenerateAuthenticatorAuthenticationOptionsRequestParams,
DeleteAuthenticatorRequestParams,
VerifyAuthenticatorRegistrationResponseRequestParams,
} from '../../Request'
import { HttpResponse } from '@standardnotes/responses'
import {
ListAuthenticatorsResponseBody,
DeleteAuthenticatorResponseBody,
GenerateAuthenticatorRegistrationOptionsResponseBody,
VerifyAuthenticatorRegistrationResponseBody,
GenerateAuthenticatorAuthenticationOptionsResponseBody,
} from '../../Response'
import { AuthenticatorServerInterface } from './AuthenticatorServerInterface'
import { Paths } from './Paths'
export class AuthenticatorServer implements AuthenticatorServerInterface {
constructor(private httpService: HttpServiceInterface) {}
async list(params: ListAuthenticatorsRequestParams): Promise<HttpResponse<ListAuthenticatorsResponseBody>> {
return this.httpService.get(Paths.v1.listAuthenticators, params)
}
async delete(params: DeleteAuthenticatorRequestParams): Promise<HttpResponse<DeleteAuthenticatorResponseBody>> {
return this.httpService.delete(Paths.v1.deleteAuthenticator(params.authenticatorId), params)
}
async generateRegistrationOptions(): Promise<HttpResponse<GenerateAuthenticatorRegistrationOptionsResponseBody>> {
return this.httpService.get(Paths.v1.generateRegistrationOptions)
}
async verifyRegistrationResponse(
params: VerifyAuthenticatorRegistrationResponseRequestParams,
): Promise<HttpResponse<VerifyAuthenticatorRegistrationResponseBody>> {
return this.httpService.post(Paths.v1.verifyRegistrationResponse, params)
}
async generateAuthenticationOptions(
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
): Promise<HttpResponse<GenerateAuthenticatorAuthenticationOptionsResponseBody>> {
return this.httpService.post(Paths.v1.generateAuthenticationOptions, params)
}
}
``` | /content/code_sandbox/packages/api/src/Domain/Server/Authenticator/AuthenticatorServer.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 369 |
```xml
// See LICENSE.txt for license information.
import {useManagedConfig} from '@mattermost/react-native-emm';
import PasteInput, {type PasteInputRef} from '@mattermost/react-native-paste-input';
import React, {forwardRef, useCallback, useImperativeHandle, useMemo, useRef} from 'react';
import {useIntl} from 'react-intl';
import {type NativeSyntheticEvent, type TextInputSelectionChangeEventData, View} from 'react-native';
import {useTheme} from '@context/theme';
import {emptyFunction} from '@utils/general';
import {changeOpacity, getKeyboardAppearanceFromTheme, makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
const getStyleSheet = makeStyleSheetFromTheme((theme) => ({
input: {
color: theme.centerChannelColor,
padding: 15,
textAlignVertical: 'top',
...typography('Body', 200),
},
inputContainer: {
backgroundColor: theme.centerChannelBg,
marginTop: 2,
},
}));
export type EditPostInputRef = {
focus: () => void;
}
type PostInputProps = {
inputHeight: number;
message: string;
hasError: boolean;
onTextSelectionChange: (curPos: number) => void;
onChangeText: (text: string) => void;
}
const EditPostInput = forwardRef<EditPostInputRef, PostInputProps>(({
inputHeight,
message,
onChangeText,
onTextSelectionChange,
hasError,
}: PostInputProps, ref) => {
const intl = useIntl();
const theme = useTheme();
const styles = getStyleSheet(theme);
const managedConfig = useManagedConfig<ManagedConfig>();
const disableCopyAndPaste = managedConfig.copyAndPasteProtection === 'true';
const inputRef = useRef<PasteInputRef>();
const inputStyle = useMemo(() => {
return [styles.input, {height: inputHeight}];
}, [inputHeight, styles]);
const onSelectionChange = useCallback((event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {
const curPos = event.nativeEvent.selection.end;
onTextSelectionChange(curPos);
}, [onTextSelectionChange]);
const containerStyle = useMemo(() => [
styles.inputContainer,
hasError && {marginTop: 0},
{height: inputHeight},
], [styles, inputHeight]);
useImperativeHandle(ref, () => ({
focus: () => inputRef.current?.focus(),
}), [inputRef.current]);
return (
<View style={containerStyle}>
<PasteInput
allowFontScaling={true}
disableCopyPaste={disableCopyAndPaste}
disableFullscreenUI={true}
keyboardAppearance={getKeyboardAppearanceFromTheme(theme)}
multiline={true}
onChangeText={onChangeText}
onPaste={emptyFunction}
onSelectionChange={onSelectionChange}
placeholder={intl.formatMessage({id: 'edit_post.editPost', defaultMessage: 'Edit the post...'})}
placeholderTextColor={changeOpacity(theme.centerChannelColor, 0.5)}
ref={inputRef}
smartPunctuation='disable'
submitBehavior='newline'
style={inputStyle}
testID='edit_post.message.input'
underlineColorAndroid='transparent'
value={message}
/>
</View>
);
});
EditPostInput.displayName = 'EditPostInput';
export default EditPostInput;
``` | /content/code_sandbox/app/screens/edit_post/edit_post_input/index.tsx | xml | 2016-10-07T16:52:32 | 2024-08-16T12:08:38 | mattermost-mobile | mattermost/mattermost-mobile | 2,155 | 734 |
```xml
export * from './permission-management';
``` | /content/code_sandbox/npm/ng-packs/packages/permission-management/src/lib/models/index.ts | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 8 |
```xml
export class ValidationError extends Error {
constructor(message: string) {
super(message);
this.name = 'ValidationError';
this.message = message;
}
}
``` | /content/code_sandbox/packages/expo-image/src/utils/blurhash/error.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 34 |
```xml
//
//
// Microsoft Bot Framework: path_to_url
//
// Bot Framework Emulator Github:
// path_to_url
//
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import { loadSettings } from './loadSettings';
const mockSettings = {
framework: {
ngrokPath: '',
bypassNgrokLocalhost: true,
stateSizeLimit: 64,
use10Tokens: false,
useCodeValidation: false,
localhost: 'localhost',
locale: '',
},
bots: [
{
botId: '1f5aeed9-a6d7-4757-b8c2-408c18c3e40c',
botUrl: 'path_to_url
msaAppId: '',
msaPassword: '',
locale: '',
},
],
windowState: {
zoomLevel: 0,
width: 1400,
height: 920,
left: 324,
top: 116,
theme: 'Light',
availableThemes: [
{
name: 'Dark',
href: './themes/dark.css',
},
{
name: 'High-contrast',
href: './themes/high-contrast.css',
},
{
name: 'Light',
href: './themes/light.css',
},
],
displayId: 2779098405,
},
users: {},
azure: {},
};
const mockLoadedSettings = {
framework: mockSettings.framework,
users: {},
};
const mockIsFile = jest.fn();
jest.mock('fs-extra', () => ({
statSync: () => ({ isFile: () => mockIsFile() }),
readFileSync: () => JSON.stringify(mockLoadedSettings),
writeFileSync: () => true,
}));
jest.mock('./ensureStoragePath', () => ({
ensureStoragePath: () => 'filePath/',
}));
describe('the loadSettings utility', () => {
it('should return the loaded settings with the user property removed', () => {
mockIsFile.mockReturnValueOnce(true);
const settings = loadSettings('appData/server.json', {});
expect(settings).toEqual({
...mockLoadedSettings,
users: undefined,
});
});
it('should return the default settings when the requested settings file does not exist', () => {
mockIsFile.mockReturnValueOnce(false);
const settings = loadSettings('appData/server.json', mockSettings);
expect(settings).toEqual(mockSettings);
});
it('should return the default settings when there is an error trying to load the settings', () => {
mockIsFile.mockImplementationOnce(() => {
throw new Error('Invalid file path.');
});
const settings = loadSettings('appData/server.json', mockSettings);
expect(settings).toEqual(mockSettings);
});
});
``` | /content/code_sandbox/packages/app/main/src/utils/loadSettings.spec.ts | xml | 2016-11-11T23:15:09 | 2024-08-16T12:45:29 | BotFramework-Emulator | microsoft/BotFramework-Emulator | 1,803 | 807 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#ff9800</color>
<color name="colorPrimaryDark">#f57c00</color>
<color name="colorAccent">#0091ea</color>
<color name="googleBlue">#4285f4</color>
<color name="googleRed">#ea4335</color>
<color name="googleYellow">#fbbc05</color>
<color name="googleGreen">#34a853</color>
<color name="black_overlay">#66000000</color>
<color name="colorDivider">#1E000000</color>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/colors.xml | xml | 2016-05-21T08:47:10 | 2024-08-14T04:13:43 | JAViewer | SplashCodes/JAViewer | 4,597 | 151 |
```xml
export {
default,
default as CommunityGuidelinesContainer,
} from "./CommunityGuidelinesContainer";
``` | /content/code_sandbox/client/src/core/client/stream/tabs/Comments/Stream/CommunityGuidelines/index.ts | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 22 |
```xml
import uniq from "lodash/uniq";
import { Op, QueryTypes } from "sequelize";
import Logger from "@server/logging/Logger";
import { Document, Attachment } from "@server/models";
import { DocumentHelper } from "@server/models/helpers/DocumentHelper";
import { ProsemirrorHelper } from "@server/models/helpers/ProsemirrorHelper";
import DeleteAttachmentTask from "@server/queues/tasks/DeleteAttachmentTask";
import { sequelize } from "@server/storage/database";
export default async function documentPermanentDeleter(documents: Document[]) {
const activeDocument = documents.find((doc) => !doc.deletedAt);
if (activeDocument) {
throw new Error(
`Cannot permanently delete ${activeDocument.id} document. Please delete it and try again.`
);
}
const query = `
SELECT COUNT(id)
FROM documents
WHERE "searchVector" @@ to_tsquery('english', :query) AND
"teamId" = :teamId AND
"id" != :documentId
`;
for (const document of documents) {
// Find any attachments that are referenced in the text content
const attachmentIdsInText = ProsemirrorHelper.parseAttachmentIds(
DocumentHelper.toProsemirror(document)
);
// Find any attachments that were originally uploaded to this document
const attachmentIdsForDocument = (
await Attachment.findAll({
attributes: ["id"],
where: {
teamId: document.teamId,
documentId: document.id,
},
})
).map((attachment) => attachment.id);
const attachmentIds = uniq([
...attachmentIdsInText,
...attachmentIdsForDocument,
]);
await Promise.all(
attachmentIds.map(async (attachmentId) => {
// Check if the attachment is referenced in any other documents this
// is needed as it's easy to copy and paste content between documents.
// An uploaded attachment may end up referenced in multiple documents.
const [{ count }] = await sequelize.query<{ count: string }>(query, {
type: QueryTypes.SELECT,
replacements: {
documentId: document.id,
teamId: document.teamId,
query: attachmentId,
},
});
// If the attachment is not referenced in any other documents then
// delete it from the database and the storage provider.
if (parseInt(count) === 0) {
Logger.info(
"commands",
`Attachment ${attachmentId} scheduled for deletion`
);
await DeleteAttachmentTask.schedule({
attachmentId,
teamId: document.teamId,
});
}
})
);
}
const documentIds = documents.map((document) => document.id);
await Document.update(
{
parentDocumentId: null,
},
{
where: {
parentDocumentId: {
[Op.in]: documentIds,
},
},
paranoid: false,
}
);
return Document.scope("withDrafts").destroy({
where: {
id: documents.map((document) => document.id),
},
force: true,
});
}
``` | /content/code_sandbox/server/commands/documentPermanentDeleter.ts | xml | 2016-05-22T21:31:47 | 2024-08-16T19:57:22 | outline | outline/outline | 26,751 | 655 |
```xml
import * as routerUtils from "../utils/router";
import { CloseModal } from "../styles/main";
import Icon from "./Icon";
import { Modal } from "react-bootstrap";
import RTG from "react-transition-group";
import React from "react";
import { __ } from "../../utils";
type Props = {
title: string;
trigger?: React.ReactNode;
autoOpenKey?: string;
content: ({ closeModal }: { closeModal: () => void }) => React.ReactNode;
size?: "sm" | "lg" | "xl";
ignoreTrans?: boolean;
dialogClassName?: string;
backDrop?: "static" | boolean;
enforceFocus?: boolean;
hideHeader?: boolean;
isOpen?: boolean;
history?: any;
paddingContent?: "less-padding";
centered?: boolean;
style?: any;
onExit?: () => void;
isAnimate?: boolean;
};
type State = {
isOpen?: boolean;
autoOpenKey?: string;
};
class ModalTrigger extends React.Component<Props, State> {
static getDerivedStateFromProps(props, state) {
if (props.autoOpenKey !== state.autoOpenKey) {
if (
routerUtils.checkHashKeyInURL(
props.history ? props.history : {},
props.autoOpenKey
)
) {
return {
isOpen: true,
autoOpenKey: props.autoOpenKey,
};
}
}
return null;
}
constructor(props) {
super(props);
this.state = {
isOpen: props.isOpen || false,
autoOpenKey: "",
};
}
openModal = () => {
this.setState({ isOpen: true });
};
closeModal = () => {
this.setState({ isOpen: false });
};
renderHeader = () => {
if (this.props.hideHeader) {
return (
<CloseModal onClick={this.closeModal}>
<Icon icon="times" />
</CloseModal>
);
}
const { title, ignoreTrans, paddingContent } = this.props;
return (
<Modal.Header closeButton={true} className={paddingContent}>
<Modal.Title>{ignoreTrans ? title : __(title)}</Modal.Title>
</Modal.Header>
);
};
render() {
const {
trigger,
size,
dialogClassName,
content,
backDrop,
enforceFocus,
onExit,
paddingContent,
centered,
style,
isAnimate = false,
} = this.props;
const { isOpen } = this.state;
// add onclick event to the trigger component
const triggerComponent = trigger
? React.cloneElement(trigger as React.ReactElement<any>, {
onClick: this.openModal,
})
: null;
return (
<>
{triggerComponent}
<Modal
dialogClassName={dialogClassName}
size={size}
show={isOpen}
onHide={this.closeModal}
backdrop={backDrop}
enforceFocus={enforceFocus}
onExit={onExit}
animation={isAnimate}
centered={centered}
style={style}
>
{this.renderHeader()}
<Modal.Body className={paddingContent}>
<RTG.Transition in={isOpen} timeout={300} unmountOnExit={true}>
{content({ closeModal: this.closeModal })}
</RTG.Transition>
</Modal.Body>
</Modal>
</>
);
}
}
export default ModalTrigger;
``` | /content/code_sandbox/exm/modules/common/ModalTrigger.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 729 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="sk" datatype="plaintext" original="email.en.xlf">
<body>
<trans-unit id="d0XfN_m" resname="button_copy_url_to_browser">
<source>button_copy_url_to_browser</source>
<target>Pokia tlaidlo nefunguje, prosm skoprujte & vlote nslodovn web adresu do Vho prehliadaa: %url%</target>
</trans-unit>
<trans-unit id="8jDJmrK" resname="automated_email_dont_answer">
<source>automated_email_dont_answer</source>
<target>Toto je automaticky generovan email. Prosm neodpovedajte na neho, adresa nebude pretan.</target>
</trans-unit>
<trans-unit id="pjr3FDv" resname="registration.subject">
<source>registration.subject</source>
<target>Aktivujte Vae konto</target>
</trans-unit>
<trans-unit id="QtcznHC" resname="registration.title">
<source>registration.title</source>
<target>Vitajte %username%</target>
</trans-unit>
<trans-unit id="YMLel3P" resname="registration.button">
<source>registration.button</source>
<target>Aktivujte V prstup</target>
</trans-unit>
<trans-unit id="IkjnHoP" resname="registration.intro">
<source>registration.intro</source>
<target>Prihlsili ste sa do Kimai sledovanie asu s emailom %email%. Teraz si muste V et aktivova v priebeh niekokch hodn predtm ne vypr platnos linku.</target>
</trans-unit>
<trans-unit id="1ZLD_Y0" resname="reset.subject">
<source>reset.subject</source>
<target>Resetujte si heslo</target>
</trans-unit>
<trans-unit id="G2mhn_2" resname="reset.title" xml:space="preserve">
<source>Forgot your password?</source>
<target state="needs-translation">To sa me sta</target>
</trans-unit>
<trans-unit id="qbt.84Y" resname="reset.button">
<source>reset.button</source>
<target>Resetova heslo</target>
</trans-unit>
<trans-unit id="rhkMAep" resname="reset.intro" xml:space="preserve">
<source>Don't worry, Kimai will help you create a new one!</source>
<target state="needs-translation">zabudli ste Vae heslo? Bez obv: Kimai Vm pome vytvori nov:</target>
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/translations/email.sk.xlf | xml | 2016-10-20T17:06:34 | 2024-08-16T18:27:30 | kimai | kimai/kimai | 3,084 | 684 |
```xml
<!-- LibreSprite -->
<gui>
<window id="options" text="Preferences">
<vbox>
<hbox expansive="true">
<view maxsize="true">
<listbox id="section_listbox">
<listitem text="General" value="section_general" />
<listitem text="Editor" value="section_editor" />
<listitem text="Timeline" value="section_timeline" />
<listitem text="Cursors" value="section_cursors" />
<listitem text="Grid && Background" value="section_grid" />
<listitem text="Undo" value="section_undo" />
<listitem text="Theme" value="section_theme" />
<listitem text="Experimental" value="section_experimental" />
</listbox>
</view>
<panel id="panel" expansive="true">
<vbox id="section_general">
<separator text="General" horizontal="true" />
<hbox>
<grid columns="2">
<label text="Screen Scaling:" />
<combobox id="screen_scale">
<listitem text="100%" value="1" />
<listitem text="200%" value="2" />
<listitem text="300%" value="3" />
<listitem text="400%" value="4" />
</combobox>
<label text="UI Elements Scaling:" />
<combobox id="ui_scale">
<listitem text="100%" value="1" />
<listitem text="200%" value="2" />
<listitem text="300%" value="3" />
<listitem text="400%" value="4" />
</combobox>
</grid>
</hbox>
<check text="GPU acceleration" id="gpu_acceleration" tooltip="Check this option to enable hardware acceleration" />
<check text="Expand menu bar items on mouseover" id="expand_menubar_on_mouseover" tooltip="Check this option to get this old menus behavior." />
<hbox>
<check text="Automatically save recovery data every" id="enable_data_recovery" tooltip="With this option you can recover your documents if the program finalizes unexpectedly." />
<combobox id="data_recovery_period">
<listitem text="2 Minutes" value="2" />
<listitem text="5 Minutes" value="5" />
<listitem text="10 Minutes" value="10" />
<listitem text="15 Minutes" value="15" />
<listitem text="30 Minutes" value="30" />
</combobox>
</hbox>
<check text="Show full file name path" id="show_full_path" tooltip="Uncheck this option if you would prefer to hide full path on UI (e.g. useful for live streaming)" />
<separator horizontal="true" />
<link id="locate_file" text="Locate Configuration File" />
<link id="locate_crash_folder" text="Locate Crash Folder" />
</vbox>
<!-- Editor -->
<vbox id="section_editor">
<separator text="Editor" horizontal="true" />
<check text="Zoom with scroll wheel" id="wheel_zoom" />
<check text="Zoom sliding two fingers up or down" id="slide_zoom" />
<check text="Zoom from center with scroll wheel" id="zoom_from_center_with_wheel" />
<check text="Zoom from center with keys" id="zoom_from_center_with_keys" />
<check text="Show scroll-bars in sprite editor" id="show_scrollbars" tooltip="Show scroll-bars in all sprite editors." />
<hbox>
<label text="Right-click:" />
<combobox id="right_click_behavior" expansive="true" />
</hbox>
<separator text="Selection" horizontal="true" />
<check text="Adjust opaque/transparent mode automatically" id="auto_opaque" tooltip="Depending on the layer (background/transparent), the pasted selection will be adjusted automatically (opaque/transparent)" />
<check text="Keep selection after "Edit > Clear" command" id="keep_selection_after_clear" tooltip="Check this if you want to keep the selection after deleting it." />
</vbox>
<!-- Timeline -->
<vbox id="section_timeline">
<separator text="Timeline" horizontal="true" />
<check text="Show timeline automatically" id="autotimeline" tooltip="Show the timeline automatically when a new frame or layer is added." />
<check text="Rewind on Stop" id="rewind_on_stop" tooltip="The 'Stop' button should rewind the animation where it was started." />
</vbox>
<!-- Cursors -->
<vbox id="section_cursors">
<separator text="Cursor" horizontal="true" />
<check id="native_cursor" text="Use native mouse cursor" />
<separator text="Painting Cursors" horizontal="true" />
<label text="Precise Cursor Color:" />
<hbox>
<combobox group="1" id="cursor_color_type">
<listitem text="Negative Black and White" value="0" />
<listitem text="Specific Color" value="1" />
</combobox>
<box id="cursor_color_placeholder" /><!-- custom widget -->
</hbox>
<label text="Brush Preview:" />
<combobox id="brush_preview">
<listitem text="None" value="0" />
<listitem text="Brush Edges" value="1" />
<listitem text="Full Real-time Brush Preview" value="2" />
</combobox>
</vbox>
<!-- Grid & background -->
<vbox id="section_grid">
<combobox id="grid_scope" />
<separator text="Grid" horizontal="true" />
<grid columns="3">
<label text="Grid Color:" />
<box id="grid_color_placeholder" /><!-- custom widget -->
<hbox />
<label text="Grid Opacity:" />
<slider grid_hspan="1" id="grid_opacity" min="1" max="255" width="128" />
<check id="grid_auto_opacity" text="Auto" />
<label text="Pixel Grid Color:" />
<box id="pixel_grid_color_placeholder" /><!-- custom widget -->
<hbox />
<label text="Pixel Grid Opacity:" />
<slider id="pixel_grid_opacity" min="1" max="255" width="128" />
<check id="pixel_grid_auto_opacity" text="Auto" />
</grid>
<separator text="Checked Background" horizontal="true" />
<hbox>
<label text="Size:" />
<combobox id="checked_bg_size" expansive="true" />
</hbox>
<check text="Apply Zoom" id="checked_bg_zoom" />
<hbox>
<label text="Colors:" />
<box horizontal="true" id="checked_bg_color1_box" />
<box horizontal="true" id="checked_bg_color2_box" />
</hbox>
<hbox>
<hbox expansive="true" />
<button id="reset" text="Reset" width="60" />
</hbox>
</vbox>
<!-- Undo -->
<vbox id="section_undo">
<separator text="Undo" horizontal="true" />
<hbox>
<label text="Undo Limit:" />
<entry id="undo_size_limit" maxsize="4" tooltip="Limit of memory to be used for undo information per sprite. Specified in megabytes." />
<label text="MB" />
</hbox>
<vbox>
<check id="undo_goto_modified" text="Go to modified frame/layer" tooltip="When it's enabled each time you undo/redo the current frame & layer will be modified to focus the undid/redid change." />
<check id="undo_allow_nonlinear_history" text="Allow non-linear history" />
</vbox>
</vbox>
<!-- Theme -->
<vbox id="section_theme">
<separator text="Available Themes" horizontal="true" />
<view expansive="true" maxsize="true">
<listbox id="theme_list" />
</view>
<hbox>
<button id="select_theme" text="&Select" width="60" />
<boxfiller />
<button id="open_theme_folder" text="Open &Folder" width="100" />
</hbox>
</vbox>
<!-- Experimental -->
<vbox id="section_experimental">
<separator text="User Interface" horizontal="true" />
<check id="native_file_dialog" text="Use native file dialog" />
<check id="flash_layer" text="Flash layer when it is selected" />
</vbox>
</panel>
</hbox>
<separator horizontal="true" />
<hbox>
<boxfiller />
<hbox homogeneous="true">
<button text="&OK" closewindow="true" id="button_ok" magnet="true" width="60" />
<button text="&Apply" id="button_apply" />
<button text="&Cancel" closewindow="true" />
</hbox>
</hbox>
</vbox>
</window>
</gui>
``` | /content/code_sandbox/data/widgets/options.xml | xml | 2016-08-31T17:26:42 | 2024-08-16T11:45:24 | LibreSprite | LibreSprite/LibreSprite | 4,717 | 2,106 |
```xml
import clsx from 'clsx';
import { useEffect, useId, useState } from 'react';
import { Select } from '~/ui';
export type Month = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
export type MonthYear = Readonly<{
month: Month;
year: number;
}>;
export type MonthYearOptional = Readonly<{
month: Month | null;
year: number | null;
}>;
type Props = Readonly<{
className?: string;
errorMessage?: string;
monthLabel?: string;
monthRequired?: boolean;
onChange: (value: MonthYearOptional) => void;
value: MonthYearOptional;
yearLabel?: string;
yearRequired?: boolean;
}>;
const MONTH_OPTIONS = [
{
label: 'January',
value: 1,
},
{
label: 'February',
value: 2,
},
{
label: 'March',
value: 3,
},
{
label: 'April',
value: 4,
},
{
label: 'May',
value: 5,
},
{
label: 'June',
value: 6,
},
{
label: 'July',
value: 7,
},
{
label: 'August',
value: 8,
},
{
label: 'September',
value: 9,
},
{
label: 'October',
value: 10,
},
{
label: 'November',
value: 11,
},
{
label: 'December',
value: 12,
},
];
const NUM_YEARS = 5;
const YEAR_OPTIONS = Array.from({ length: NUM_YEARS }, (_, i) => {
const year = new Date().getFullYear() - NUM_YEARS + i + 1;
return {
label: String(year),
value: year,
};
});
export default function MonthYearPicker({
className,
errorMessage,
monthLabel = 'Month',
value,
onChange,
yearLabel = 'Year',
monthRequired = false,
yearRequired = false,
}: Props) {
const hasError = errorMessage != null;
const errorId = useId();
const [monthCounter, setMonthCounter] = useState<number>(0);
const [yearCounter, setYearCounter] = useState<number>(0);
useEffect(() => {
if (value.month == null) {
setMonthCounter((val) => val + 1);
}
if (value.year == null) {
setYearCounter((val) => val + 1);
}
}, [value.month, value.year]);
return (
<div aria-describedby={hasError ? errorId : undefined}>
<div className={clsx('flex items-end', className)}>
<div className="grow">
<Select
key={`month:${monthCounter}`}
display="block"
label={monthLabel}
options={MONTH_OPTIONS}
placeholder="Select month"
required={monthRequired}
value={value.month}
onChange={(newMonth) =>
onChange({ month: Number(newMonth) as Month, year: value.year })
}
/>
</div>
<div className="grow">
<Select
key={`year:${yearCounter}`}
display="block"
label={yearLabel}
options={YEAR_OPTIONS}
placeholder="Select year"
required={yearRequired}
value={value.year}
onChange={(newYear) =>
onChange({ month: value.month, year: Number(newYear) })
}
/>
</div>
</div>
{errorMessage && (
<p className="text-danger-600 mt-2 text-sm" id={errorId}>
{errorMessage}
</p>
)}
</div>
);
}
``` | /content/code_sandbox/apps/portal/src/components/shared/MonthYearPicker.tsx | xml | 2016-07-05T05:00:48 | 2024-08-16T19:01:19 | tech-interview-handbook | yangshun/tech-interview-handbook | 115,302 | 844 |
```xml
import * as React from 'react';
import { makeStyles, SwatchPicker, ImageSwatch } from '@fluentui/react-components';
import type { SwatchPickerOnSelectEventHandler } from '@fluentui/react-components';
const useStyles = makeStyles({
example: {
width: '100%',
height: '466px',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
margin: '20px 0',
},
swatch: {
width: '100px',
height: '100px',
'@media (max-width: 768px)': {
width: '50px',
height: '50px',
},
},
});
const DEFAULT_IMAGE = 'path_to_url
const images = [
{
swatchSrc: 'path_to_url
value: '0',
label: 'sea',
fullImageSrc: 'path_to_url
},
{
swatchSrc: 'path_to_url
value: '1',
label: 'bridge',
fullImageSrc: 'path_to_url
},
{
swatchSrc: 'path_to_url
value: '2',
label: 'park',
fullImageSrc: 'path_to_url
},
];
export const SwatchPickerImage = () => {
const [selectedValue, setSelectedValue] = React.useState('1');
const [selectedImage, setSelectedImage] = React.useState(DEFAULT_IMAGE);
const handleSelect: SwatchPickerOnSelectEventHandler = (_, data) => {
setSelectedValue(data.selectedValue);
const image = images.find(img => img.value === data.selectedValue) || images[0];
setSelectedImage(image.fullImageSrc);
};
const styles = useStyles();
return (
<>
<SwatchPicker
aria-label="SwatchPicker with images"
selectedValue={selectedValue}
onSelectionChange={handleSelect}
>
{images.map(image => (
<ImageSwatch
className={styles.swatch}
key={image.value}
src={image.swatchSrc}
value={image.value}
aria-label={image.label}
/>
))}
</SwatchPicker>
<div
className={styles.example}
style={{
backgroundImage: `url(${selectedImage})`,
}}
/>
</>
);
};
SwatchPickerImage.parameters = {
docs: {
description: {
story: 'A swatch can be represented as an image.',
},
},
};
``` | /content/code_sandbox/packages/react-components/react-swatch-picker/stories/src/SwatchPicker/SwatchPickerImage.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 528 |
```xml
import { RecurrentConnection } from './layer/recurrent-connection';
import {
IRecurrentInput,
RecurrentInput,
RecurrentZeros,
ILayer,
ILayerSettings,
} from './layer';
import {
Activation,
EntryPoint,
EntryPointType,
Filter,
Internal,
InternalModel,
Model,
Modifier,
Operator,
Target,
} from './layer/types';
import { flattenLayers } from './utilities/flatten-layers';
import {
FeedForward,
IFeedForwardOptions,
IFeedForwardTrainingOptions,
ITrainingStatus,
} from './feed-forward';
import { release, clone } from './utilities/kernel';
import { KernelOutput, Texture, TextureArrayOutput } from 'gpu.js';
import { OperatorType } from './layer/operator';
import { ModifierType } from './layer/modifier';
import { FilterType } from './layer/filter';
import { ActivationType } from './layer/activation';
import { TargetType } from './layer/target';
export interface IRecurrentTrainingOptions
extends IFeedForwardTrainingOptions {}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
export interface IRecurrentOptions extends IFeedForwardOptions {
hiddenLayers: Array<
(
inputLayer: ILayer,
recurrentInput: IRecurrentInput,
index: number
) => ILayer
>;
}
export interface IRecurrentPreppedTrainingData<T> {
status: ITrainingStatus;
preparedData: T[][];
endTime: number;
}
export class Recurrent<
T extends TextureArrayOutput = TextureArrayOutput
> extends FeedForward {
trainOpts: IRecurrentTrainingOptions = {};
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
options: IRecurrentOptions;
_outputConnection: RecurrentConnection | null = null;
_layerSets: ILayer[][] = [];
_hiddenLayerOutputIndices: number[] = [];
_model: ILayer[] | null = null;
// TODO: use generics in extend
constructor(
options: Partial<IRecurrentOptions & IRecurrentTrainingOptions> = {}
) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
super(options);
}
_connectLayers(): {
inputLayer: ILayer;
hiddenLayers: ILayer[];
outputLayer: ILayer;
} {
if (!this.options.inputLayer) {
throw new Error('inputLayer not found');
}
if (!this.options.outputLayer) {
throw new Error('outputLayer not found');
}
const inputLayer = this.options.inputLayer();
const hiddenLayers = this._connectHiddenLayers(inputLayer);
const outputLayer = this.options.outputLayer(
hiddenLayers[hiddenLayers.length - 1],
-1
);
return {
inputLayer,
hiddenLayers,
outputLayer,
};
}
_connectLayersDeep(): ILayer[] {
const layers: ILayer[] = [];
const previousLayers = this._layerSets[this._layerSets.length - 1];
let usedHiddenLayerOutputIndex = 0;
function findInputLayer(inputLayer: ILayer) {
const index = previousLayers.indexOf(inputLayer);
if (index < 0) throw new Error('unable to find layer');
return layers[index];
}
function layerSettings(layer: ILayer): ILayerSettings {
return {
...layer.settings,
weights: null,
deltas: null,
praxis: null,
};
}
for (let i = 0; i < previousLayers.length; i++) {
const previousLayer = previousLayers[i];
let layer: ILayer;
if (previousLayer instanceof Activation) {
layer = new (previousLayer.constructor as ActivationType)(
findInputLayer(previousLayer.inputLayer),
layerSettings(previousLayer)
);
} else if (previousLayer instanceof EntryPoint) {
layer = new (previousLayer.constructor as EntryPointType)(
layerSettings(previousLayer)
);
} else if (previousLayer instanceof Filter) {
layer = new (previousLayer.constructor as FilterType)(
layerSettings(previousLayer.inputLayer),
findInputLayer(previousLayer.inputLayer)
);
} else if (previousLayer instanceof Internal) {
const previousHiddenLayerOutput =
previousLayers[
this._hiddenLayerOutputIndices[usedHiddenLayerOutputIndex++]
];
if (previousLayer instanceof RecurrentConnection) {
throw new Error('unfinished');
} else if (previousLayer instanceof RecurrentInput) {
layer = new RecurrentInput(previousHiddenLayerOutput);
} else if (previousLayer instanceof RecurrentZeros) {
layer = new RecurrentInput(previousHiddenLayerOutput);
} else {
throw new Error(
`hidden layer ${previousLayer.constructor.name} extends unknown hidden layer`
);
}
} else if (
previousLayer instanceof InternalModel ||
previousLayer instanceof Model
) {
layer = previousLayer;
} else if (previousLayer instanceof Modifier) {
layer = new (previousLayer.constructor as ModifierType)(
findInputLayer(previousLayer.inputLayer),
layerSettings(previousLayer.inputLayer)
);
} else if (previousLayer instanceof Operator) {
layer = new (previousLayer.constructor as OperatorType)(
findInputLayer(previousLayer.inputLayer1),
findInputLayer(previousLayer.inputLayer2),
layerSettings(previousLayer)
);
} else if (previousLayer instanceof Target) {
layer = new (previousLayer.constructor as TargetType)(
layerSettings(previousLayer),
findInputLayer(previousLayer.inputLayer)
);
} else {
throw new Error(
`hidden layer ${previousLayer.constructor.name} extends unknown hidden layer`
);
}
layers.push(layer);
}
return layers;
}
_connectHiddenLayers(previousLayer: ILayer): ILayer[] {
const hiddenLayers = [];
if (!this.options.hiddenLayers) throw new Error('hiddenLayers not defined');
for (let i = 0; i < this.options.hiddenLayers.length; i++) {
const recurrentInput = new RecurrentZeros();
const hiddenLayer = this.options.hiddenLayers[i](
previousLayer,
recurrentInput,
i
);
previousLayer = hiddenLayer;
hiddenLayers.push(hiddenLayer);
}
return hiddenLayers;
}
initialize(): void {
this._outputConnection = new RecurrentConnection();
let layerSet: ILayer[];
if (this.options.layers) {
layerSet = this._connectOptionsLayers();
} else {
const { inputLayer, hiddenLayers, outputLayer } = this._connectLayers();
layerSet = flattenLayers([inputLayer, ...hiddenLayers, outputLayer]);
this._hiddenLayerOutputIndices = hiddenLayers.map((l) =>
layerSet.indexOf(l)
);
this._inputLayer = inputLayer;
this._hiddenLayers = hiddenLayers;
this._outputLayer = outputLayer;
}
this.layers = layerSet;
this._layerSets = [layerSet];
this._model = layerSet.filter(
(l) => l instanceof Model || l instanceof InternalModel
);
this.initializeLayers(layerSet);
}
initializeDeep(): void {
const layers = this._connectLayersDeep();
for (let i = 0; i < layers.length; i++) {
const layer = layers[i];
layer.setupKernels(true);
layer.reuseKernels(this._layerSets[0][i]);
}
this._layerSets.push(layers);
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
run(inputs: T[]): T[] {
while (this._layerSets.length <= inputs.length) {
this.initializeDeep();
}
const result = this.runInputs(inputs);
if (result instanceof Texture) {
return result.toArray() as T[];
}
return result as T[];
}
runInput(input: KernelOutput): KernelOutput {
throw new Error('use .runInputs()');
}
runInputs(inputs: T[]): KernelOutput {
while (this._layerSets.length < inputs.length) {
this.initializeDeep();
}
const max = inputs.length - 1; // last output will be compared with last index
for (let x = 0; x <= max; x++) {
const layerSet = this._layerSets[x];
layerSet[0].predict(inputs[x]);
for (let i = 1; i < layerSet.length; i++) {
layerSet[i].predict();
}
}
const lastLayerUsed = this._layerSets[max];
const result = lastLayerUsed[lastLayerUsed.length - 1].weights;
this.end();
return result as KernelOutput;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
train(
data: T[][],
options: Partial<IRecurrentTrainingOptions> = {}
): ITrainingStatus {
const { preparedData, status, endTime } = this._prepTraining(data, options);
let continueTicking = true;
const calculateError = (): number =>
this._calculateTrainingError(preparedData);
const trainPatters = (): void => this._trainPatterns(preparedData);
while (continueTicking) {
continueTicking = this._trainingTick(
status,
endTime,
calculateError,
trainPatters
);
}
return status;
}
end(): void {
const x = this._layerSets.length - 1;
const lastLayerSet = this._layerSets[x];
lastLayerSet[0].predict([new Float32Array([0])]);
for (let i = 1; i < lastLayerSet.length; i++) {
lastLayerSet[i].predict();
}
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
transferData(formattedData: T[][]): T[][] {
return formattedData;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
_prepTraining(
data: T[][],
options: Partial<IRecurrentTrainingOptions>
): IRecurrentPreppedTrainingData<T> {
this._updateTrainingOptions(options);
const endTime = this.trainOpts.timeout
? Date.now() + this.trainOpts.timeout
: 0;
const status = {
error: 1,
iterations: 0,
};
this.verifyIsInitialized();
return {
preparedData: this.transferData(data),
status,
endTime,
};
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
_calculateTrainingError(data: T[][]): number {
if (!this.meanSquaredError) {
throw new Error('this.meanSquaredError not setup');
}
let sum: KernelOutput = new Float32Array(1);
for (let i = 0; i < data.length; ++i) {
const prevSum = sum;
const error = this._trainPattern(data[i], true) as KernelOutput;
sum = this.meanSquaredError.add(sum, error);
release(error);
release(prevSum);
}
const result = this.meanSquaredError.divide(data.length, sum);
release(sum);
if (result instanceof Texture) {
const resultArray = result.toArray() as number[];
return resultArray[0];
}
return (result as number[])[0];
}
// TODO: more types
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
formatData(data: Float32Array): Float32Array {
return data;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
_calculateDeltas(target: T[]): void {
const lastLayerSet = this._layerSets[this._layerSets.length - 1];
// Iterate from the second to last layer backwards, propagating 0's
for (let i = lastLayerSet.length - 2; i >= 0; i--) {
lastLayerSet[i].compare();
}
for (let x = target.length - 2; x >= 0; x--) {
const layerSet = this._layerSets[x];
layerSet[layerSet.length - 1].compare(target[x + 1]);
for (let i = layerSet.length - 2; i >= 0; i--) {
layerSet[i].compare();
}
}
}
adjustWeights(): void {
const _model = this._model as ILayer[];
for (let i = 0; i < _model.length; i++) {
_model[i].learn(this.options.learningRate ?? 0);
}
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
_trainPatterns(data: T[][]): void {
for (let i = 0; i < data.length; ++i) {
this._trainPattern(data[i], false);
}
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
_trainPattern(inputs: T[], logErrorRate: boolean): KernelOutput | null {
// forward propagate
this.runInputs(inputs);
// back propagate
this._calculateDeltas(inputs);
this.adjustWeights();
if (logErrorRate) {
if (!this.meanSquaredError) {
throw new Error('this.meanSquaredError not setup');
}
let error: KernelOutput = new Float32Array(1);
for (let i = 0, max = inputs.length - 2; i <= max; i++) {
const layerSet = this._layerSets[i];
const lastLayer = layerSet[layerSet.length - 1];
const prevError: KernelOutput = error;
error = this.meanSquaredError.addAbsolute(
prevError,
lastLayer.errors as KernelOutput
);
release(prevError);
}
return clone(this.meanSquaredError.divide(inputs.length, error));
}
return null;
}
}
``` | /content/code_sandbox/src/recurrent.ts | xml | 2016-02-13T18:09:44 | 2024-08-15T20:41:49 | brain.js | BrainJS/brain.js | 14,300 | 3,077 |
```xml
/**
* Events allow for applications to use the observer pattern, which
* allows subscribing and publishing events, outside the normal
* execution paths.
*
* @_section api/utils/events:Events [about-events]
*/
import { defineProperties } from "./properties.js";
/**
* A callback function called when a an event is triggered.
*/
export type Listener = (...args: Array<any>) => void;
/**
* An **EventEmitterable** behaves similar to an EventEmitter
* except provides async access to its methods.
*
* An EventEmitter implements the observer pattern.
*/
export interface EventEmitterable<T> {
/**
* Registers a %%listener%% that is called whenever the
* %%event%% occurs until unregistered.
*/
on(event: T, listener: Listener): Promise<this>;
/**
* Registers a %%listener%% that is called the next time
* %%event%% occurs.
*/
once(event: T, listener: Listener): Promise<this>;
/**
* Triggers each listener for %%event%% with the %%args%%.
*/
emit(event: T, ...args: Array<any>): Promise<boolean>;
/**
* Resolves to the number of listeners for %%event%%.
*/
listenerCount(event?: T): Promise<number>;
/**
* Resolves to the listeners for %%event%%.
*/
listeners(event?: T): Promise<Array<Listener>>;
/**
* Unregister the %%listener%% for %%event%%. If %%listener%%
* is unspecified, all listeners are unregistered.
*/
off(event: T, listener?: Listener): Promise<this>;
/**
* Unregister all listeners for %%event%%.
*/
removeAllListeners(event?: T): Promise<this>;
/**
* Alias for [[on]].
*/
addListener(event: T, listener: Listener): Promise<this>;
/**
* Alias for [[off]].
*/
removeListener(event: T, listener: Listener): Promise<this>;
}
/**
* When an [[EventEmitterable]] triggers a [[Listener]], the
* callback always ahas one additional argument passed, which is
* an **EventPayload**.
*/
export class EventPayload<T> {
/**
* The event filter.
*/
readonly filter!: T;
/**
* The **EventEmitterable**.
*/
readonly emitter!: EventEmitterable<T>;
readonly #listener: null | Listener;
/**
* Create a new **EventPayload** for %%emitter%% with
* the %%listener%% and for %%filter%%.
*/
constructor(emitter: EventEmitterable<T>, listener: null | Listener, filter: T) {
this.#listener = listener;
defineProperties<EventPayload<any>>(this, { emitter, filter });
}
/**
* Unregister the triggered listener for future events.
*/
async removeListener(): Promise<void> {
if (this.#listener == null) { return; }
await this.emitter.off(this.filter, this.#listener);
}
}
``` | /content/code_sandbox/src.ts/utils/events.ts | xml | 2016-07-16T04:35:37 | 2024-08-16T13:37:46 | ethers.js | ethers-io/ethers.js | 7,843 | 660 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#42873c</color>
<color name="colorPrimaryDark">#1c4811</color>
<color name="colorAccent">#FF4081</color>
</resources>
``` | /content/code_sandbox/CustomBroadcastPermissions/app/src/app3/res/values/colors.xml | xml | 2016-02-25T11:06:48 | 2024-08-07T21:41:59 | android-examples | nisrulz/android-examples | 1,747 | 65 |
```xml
import React, { FunctionComponent } from "react";
const AppWindowDisableIcon: FunctionComponent = () => {
// path_to_url
return (
<svg viewBox="-0.25 -0.25 24.5 24.5" xmlns="path_to_url">
<path
d="M21.76,8.253v-6a1.5,1.5,0,0,0-1.5-1.5h-18a1.5,1.5,0,0,0-1.5,1.5v16.5a1.5,1.5,0,0,0,1.5,1.5h6"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M0.76 5.253L21.76 5.253"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M11.258 17.253 A6.000 6.000 0 1 0 23.258 17.253 A6.000 6.000 0 1 0 11.258 17.253 Z"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M13.016 21.495L21.5 13.011"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
></path>
</svg>
);
};
export default AppWindowDisableIcon;
``` | /content/code_sandbox/client/src/core/client/ui/components/icons/AppWindowDisableIcon.tsx | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 381 |
```xml
export async function getSchemaAsync(sdkVersion: string): Promise<any> {
const result = await fetch(
new URL(
`/--/api/v2/project/configuration/schema/${sdkVersion}`,
getExpoHostApiBaseUrl()
).toString()
);
const resultJson: any = await result.json();
return resultJson.data?.schema;
}
function getExpoHostApiBaseUrl(): string {
if (process.env.EXPO_STAGING) {
return `path_to_url`;
} else {
return `path_to_url`;
}
}
``` | /content/code_sandbox/packages/expo-doctor/src/api/getSchemaAsync.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 118 |
```xml
import { DOCUMENT } from "@angular/common";
import { Inject, Injectable } from "@angular/core";
import { firstValueFrom } from "rxjs";
import { AbstractThemingService } from "@bitwarden/angular/platform/services/theming/theming.service.abstraction";
import { WINDOW } from "@bitwarden/angular/services/injection-tokens";
import { EventUploadService as EventUploadServiceAbstraction } from "@bitwarden/common/abstractions/event/event-upload.service";
import { NotificationsService as NotificationsServiceAbstraction } from "@bitwarden/common/abstractions/notifications.service";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { TwoFactorService as TwoFactorServiceAbstraction } from "@bitwarden/common/auth/abstractions/two-factor.service";
import { CryptoService as CryptoServiceAbstraction } from "@bitwarden/common/platform/abstractions/crypto.service";
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
import { I18nService as I18nServiceAbstraction } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { StateService as StateServiceAbstraction } from "@bitwarden/common/platform/abstractions/state.service";
import { ContainerService } from "@bitwarden/common/platform/services/container.service";
import { UserAutoUnlockKeyService } from "@bitwarden/common/platform/services/user-auto-unlock-key.service";
import { SyncService as SyncServiceAbstraction } from "@bitwarden/common/platform/sync";
import { EventUploadService } from "@bitwarden/common/services/event/event-upload.service";
import { VaultTimeoutService } from "@bitwarden/common/services/vault-timeout/vault-timeout.service";
import { UserId } from "@bitwarden/common/types/guid";
import { I18nRendererService } from "../../platform/services/i18n.renderer.service";
import { NativeMessagingService } from "../../services/native-messaging.service";
@Injectable()
export class InitService {
constructor(
@Inject(WINDOW) private win: Window,
private syncService: SyncServiceAbstraction,
private vaultTimeoutService: VaultTimeoutService,
private i18nService: I18nServiceAbstraction,
private eventUploadService: EventUploadServiceAbstraction,
private twoFactorService: TwoFactorServiceAbstraction,
private notificationsService: NotificationsServiceAbstraction,
private platformUtilsService: PlatformUtilsServiceAbstraction,
private stateService: StateServiceAbstraction,
private cryptoService: CryptoServiceAbstraction,
private nativeMessagingService: NativeMessagingService,
private themingService: AbstractThemingService,
private encryptService: EncryptService,
private userAutoUnlockKeyService: UserAutoUnlockKeyService,
private accountService: AccountService,
@Inject(DOCUMENT) private document: Document,
) {}
init() {
return async () => {
this.nativeMessagingService.init();
await this.stateService.init({ runMigrations: false }); // Desktop will run them in main process
const accounts = await firstValueFrom(this.accountService.accounts$);
const setUserKeyInMemoryPromises = [];
for (const userId of Object.keys(accounts) as UserId[]) {
// For each acct, we must await the process of setting the user key in memory
// if the auto user key is set to avoid race conditions of any code trying to access
// the user key from mem.
setUserKeyInMemoryPromises.push(
this.userAutoUnlockKeyService.setUserKeyInMemoryIfAutoUserKeySet(userId),
);
}
await Promise.all(setUserKeyInMemoryPromises);
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.syncService.fullSync(true);
await this.vaultTimeoutService.init(true);
await (this.i18nService as I18nRendererService).init();
(this.eventUploadService as EventUploadService).init(true);
this.twoFactorService.init();
setTimeout(() => this.notificationsService.init(), 3000);
const htmlEl = this.win.document.documentElement;
htmlEl.classList.add("os_" + this.platformUtilsService.getDeviceString());
this.themingService.applyThemeChangesTo(this.document);
const containerService = new ContainerService(this.cryptoService, this.encryptService);
containerService.attachToGlobal(this.win);
};
}
}
``` | /content/code_sandbox/apps/desktop/src/app/services/init.service.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 963 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="transition_movie_img">transition_movie_img</string>
<string name="transition_news_img">transition_news_img</string>
<string name="transition_book_img">transition_book_img</string>
<string name="transition_publish_bt">transition_publish_bt</string>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/transition.xml | xml | 2016-11-20T11:59:25 | 2024-08-14T13:24:02 | CloudReader | youlookwhat/CloudReader | 4,933 | 81 |
```xml
<resources>
<string name="app_name">AndroidRxBinding</string>
</resources>
``` | /content/code_sandbox/Android/AndroidRxBinding/app/src/main/res/values/strings.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 22 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../LocalizableStrings.resx">
<body>
<trans-unit id="AppFullName">
<source>.NET SDK Command</source>
<target state="translated">Polecenie zestawu .NET SDK</target>
<note />
</trans-unit>
<trans-unit id="AppDescription">
<source>Manage .NET SDK installation.</source>
<target state="translated">Zarzdzaj instalacj zestawu .NET SDK.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/commands/dotnet-sdk/xlf/LocalizableStrings.pl.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 225 |
```xml
<manifest package="net.androidwing.hotxposed" />
``` | /content/code_sandbox/hotxposed/src/main/AndroidManifest.xml | xml | 2016-01-14T11:22:46 | 2024-08-07T01:51:39 | Unblock163MusicClient-Xposed | bin456789/Unblock163MusicClient-Xposed | 2,584 | 13 |
```xml
import { ContentType } from '@standardnotes/domain-core'
import { SNNote, SNTag, ItemCounts } from '@standardnotes/models'
export class StaticItemCounter {
countNotesAndTags(items: Array<SNNote | SNTag>): ItemCounts {
const counts: ItemCounts = {
notes: 0,
archived: 0,
deleted: 0,
tags: 0,
}
for (const item of items) {
if (item.trashed) {
counts.deleted++
continue
}
if (item.archived) {
counts.archived++
continue
}
if (item.content_type === ContentType.TYPES.Note && !item.conflictOf) {
counts.notes++
continue
}
if (item.content_type === ContentType.TYPES.Tag) {
counts.tags++
continue
}
}
return counts
}
}
``` | /content/code_sandbox/packages/services/src/Domain/Item/StaticItemCounter.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 190 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="path_to_url"
android:duration="300">
<alpha
android:fromAlpha="1"
android:toAlpha="0" />
</set>
``` | /content/code_sandbox/app/src/main/res/anim/fragment_main_exit.xml | xml | 2016-02-21T04:39:19 | 2024-08-16T13:35:51 | GeometricWeather | WangDaYeeeeee/GeometricWeather | 2,420 | 56 |
```xml
import { CommonModule } from '@angular/common';
import { booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, EventEmitter, forwardRef, Input, NgModule, numberAttribute, OnInit, Output, QueryList, signal, TemplateRef, ViewEncapsulation } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { PrimeNGConfig, PrimeTemplate, SharedModule } from 'primeng/api';
import { BanIcon } from 'primeng/icons/ban';
import { StarIcon } from 'primeng/icons/star';
import { StarFillIcon } from 'primeng/icons/starfill';
import { Nullable } from 'primeng/ts-helpers';
import { RatingRateEvent } from './rating.interface';
import { DomHandler } from 'primeng/dom';
import { UniqueComponentId } from 'primeng/utils';
import { AutoFocusModule } from 'primeng/autofocus';
export const RATING_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => Rating),
multi: true
};
/**
* Rating is an extension to standard radio button element with theming.
* @group Components
*/
@Component({
selector: 'p-rating',
template: `
<div class="p-rating" [ngClass]="{ 'p-readonly': readonly, 'p-disabled': disabled }" [attr.data-pc-name]="'rating'" [attr.data-pc-section]="'root'">
<ng-container *ngIf="!isCustomIcon; else customTemplate">
<div *ngIf="cancel" [attr.data-pc-section]="'cancelItem'" (click)="onOptionClick($event, 0)" [ngClass]="{ 'p-focus': focusedOptionIndex() === 0 && isFocusVisibleItem }" class="p-rating-item p-rating-cancel-item">
<span class="p-hidden-accessible" [attr.data-p-hidden-accessible]="true">
<input
type="radio"
value="0"
[name]="name"
[checked]="value === 0"
[disabled]="disabled"
[readonly]="readonly"
[attr.aria-label]="cancelAriaLabel()"
(focus)="onInputFocus($event, 0)"
(blur)="onInputBlur($event)"
(change)="onChange($event, 0)"
pAutoFocus
[autofocus]="autofocus"
/>
</span>
<span *ngIf="iconCancelClass" class="p-rating-icon p-rating-cancel" [ngClass]="iconCancelClass" [ngStyle]="iconCancelStyle"></span>
<BanIcon *ngIf="!iconCancelClass" [styleClass]="'p-rating-icon p-rating-cancel'" [ngStyle]="iconCancelStyle" [attr.data-pc-section]="'cancelIcon'" />
</div>
<ng-template ngFor [ngForOf]="starsArray" let-star let-i="index">
<div class="p-rating-item" [ngClass]="{ 'p-rating-item-active': star + 1 <= value, 'p-focus': star + 1 === focusedOptionIndex() && isFocusVisibleItem }" (click)="onOptionClick($event, star + 1)">
<span class="p-hidden-accessible" [attr.data-p-hidden-accessible]="true">
<input
type="radio"
value="0"
[name]="name"
[checked]="value === 0"
[disabled]="disabled"
[readonly]="readonly"
[attr.aria-label]="starAriaLabel(star + 1)"
(focus)="onInputFocus($event, star + 1)"
(blur)="onInputBlur($event)"
(change)="onChange($event, star + 1)"
pAutoFocus
[autofocus]="autofocus"
/>
</span>
<ng-container *ngIf="!value || i >= value">
<span class="p-rating-icon" *ngIf="iconOffClass" [ngStyle]="iconOffStyle" [ngClass]="iconOffClass" [attr.data-pc-section]="'offIcon'"></span>
<StarIcon *ngIf="!iconOffClass" [ngStyle]="iconOffStyle" [styleClass]="'p-rating-icon'" [attr.data-pc-section]="'offIcon'" />
</ng-container>
<ng-container *ngIf="value && i < value">
<span class="p-rating-icon p-rating-icon-active" *ngIf="iconOnClass" [ngStyle]="iconOnStyle" [ngClass]="iconOnClass" [attr.data-pc-section]="'onIcon'"></span>
<StarFillIcon *ngIf="!iconOnClass" [ngStyle]="iconOnStyle" [styleClass]="'p-rating-icon p-rating-icon-active'" [attr.data-pc-section]="'onIcon'" />
</ng-container>
</div>
</ng-template>
</ng-container>
<ng-template #customTemplate>
<span *ngIf="cancel" (click)="onOptionClick($event, 0)" class="p-rating-icon p-rating-cancel" [ngStyle]="iconCancelStyle" [attr.data-pc-section]="'cancelIcon'">
<ng-container *ngTemplateOutlet="cancelIconTemplate"></ng-container>
</span>
<span *ngFor="let star of starsArray; let i = index" class="p-rating-icon" (click)="onOptionClick($event, star + 1)" [attr.data-pc-section]="'onIcon'">
<ng-container *ngTemplateOutlet="getIconTemplate(i)"></ng-container>
</span>
</ng-template>
</div>
`,
providers: [RATING_VALUE_ACCESSOR],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
styleUrls: ['./rating.css'],
host: {
class: 'p-element'
}
})
export class Rating implements OnInit, ControlValueAccessor {
/**
* When present, it specifies that the element should be disabled.
* @group Props
*/
@Input({ transform: booleanAttribute }) disabled: boolean | undefined;
/**
* When present, changing the value is not possible.
* @group Props
*/
@Input({ transform: booleanAttribute }) readonly: boolean | undefined;
/**
* Number of stars.
* @group Props
*/
@Input({ transform: numberAttribute }) stars: number = 5;
/**
* When specified a cancel icon is displayed to allow removing the value.
* @group Props
*/
@Input({ transform: booleanAttribute }) cancel: boolean = true;
/**
* Style class of the on icon.
* @group Props
*/
@Input() iconOnClass: string | undefined;
/**
* Inline style of the on icon.
* @group Props
*/
@Input() iconOnStyle: { [klass: string]: any } | null | undefined;
/**
* Style class of the off icon.
* @group Props
*/
@Input() iconOffClass: string | undefined;
/**
* Inline style of the off icon.
* @group Props
*/
@Input() iconOffStyle: { [klass: string]: any } | null | undefined;
/**
* Style class of the cancel icon.
* @group Props
*/
@Input() iconCancelClass: string | undefined;
/**
* Inline style of the cancel icon.
* @group Props
*/
@Input() iconCancelStyle: { [klass: string]: any } | null | undefined;
/**
* When present, it specifies that the component should automatically get focus on load.
* @group Props
*/
@Input({ transform: booleanAttribute }) autofocus: boolean | undefined;
/**
* Emitted on value change.
* @param {RatingRateEvent} value - Custom rate event.
* @group Emits
*/
@Output() onRate: EventEmitter<RatingRateEvent> = new EventEmitter<RatingRateEvent>();
/**
* Emitted when the rating is cancelled.
* @param {Event} value - Browser event.
* @group Emits
*/
@Output() onCancel: EventEmitter<Event> = new EventEmitter<Event>();
/**
* Emitted when the rating receives focus.
* @param {Event} value - Browser event.
* @group Emits
*/
@Output() onFocus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
/**
* Emitted when the rating loses focus.
* @param {Event} value - Browser event.
* @group Emits
*/
@Output() onBlur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
@ContentChildren(PrimeTemplate) templates!: QueryList<PrimeTemplate>;
onIconTemplate: Nullable<TemplateRef<any>>;
offIconTemplate: Nullable<TemplateRef<any>>;
cancelIconTemplate: Nullable<TemplateRef<any>>;
value: Nullable<number>;
onModelChange: Function = () => {};
onModelTouched: Function = () => {};
public starsArray: Nullable<number[]>;
isFocusVisibleItem: boolean = true;
focusedOptionIndex = signal<number>(-1);
name: string | undefined;
constructor(private cd: ChangeDetectorRef, private config: PrimeNGConfig) {}
ngOnInit() {
this.name = this.name || UniqueComponentId();
this.starsArray = [];
for (let i = 0; i < this.stars; i++) {
this.starsArray[i] = i;
}
}
ngAfterContentInit() {
this.templates.forEach((item) => {
switch (item.getType()) {
case 'onicon':
this.onIconTemplate = item.template;
break;
case 'officon':
this.offIconTemplate = item.template;
break;
case 'cancelicon':
this.cancelIconTemplate = item.template;
break;
}
});
}
onOptionClick(event, value) {
if (!this.readonly && !this.disabled) {
this.onOptionSelect(event, value);
this.isFocusVisibleItem = false;
const firstFocusableEl = DomHandler.getFirstFocusableElement(event.currentTarget, '');
firstFocusableEl && DomHandler.focus(firstFocusableEl);
}
}
onOptionSelect(event, value) {
this.focusedOptionIndex.set(value);
this.updateModel(event, value || null);
}
onChange(event, value) {
this.onOptionSelect(event, value);
this.isFocusVisibleItem = true;
}
onInputBlur(event) {
this.focusedOptionIndex.set(-1);
this.onBlur.emit(event);
}
onInputFocus(event, value) {
this.focusedOptionIndex.set(value);
this.onFocus.emit(event);
}
updateModel(event, value) {
this.value = value;
this.onModelChange(this.value);
this.onModelTouched();
if (!value) {
this.onCancel.emit();
} else {
this.onRate.emit({
originalEvent: event,
value
});
}
}
cancelAriaLabel() {
return this.config.translation.clear;
}
starAriaLabel(value) {
return value === 1 ? this.config.translation.aria.star : this.config.translation.aria.stars.replace(/{star}/g, value);
}
getIconTemplate(i: number): Nullable<TemplateRef<any>> {
return !this.value || i >= this.value ? this.offIconTemplate : this.onIconTemplate;
}
writeValue(value: any): void {
this.value = value;
this.cd.detectChanges();
}
registerOnChange(fn: Function): void {
this.onModelChange = fn;
}
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}
setDisabledState(val: boolean): void {
this.disabled = val;
this.cd.markForCheck();
}
get isCustomIcon(): boolean {
return this.templates && this.templates.length > 0;
}
}
@NgModule({
imports: [CommonModule, AutoFocusModule, StarFillIcon, StarIcon, BanIcon],
exports: [Rating, SharedModule],
declarations: [Rating]
})
export class RatingModule {}
``` | /content/code_sandbox/src/app/components/rating/rating.ts | xml | 2016-01-16T09:23:28 | 2024-08-16T19:58:20 | primeng | primefaces/primeng | 9,969 | 2,663 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="path_to_url" xmlns:xsi="path_to_url"
xmlns:context="path_to_url"
xmlns:nettyrpc="path_to_url" xmlns:tx="path_to_url"
xsi:schemaLocation="path_to_url path_to_url
path_to_url path_to_url
path_to_url path_to_url path_to_url path_to_url">
<context:property-placeholder location="classpath:rpc-server.properties"/>
<bean id="beanFactory" class="com.newlandframework.rpc.spring.BeanFactoryUtils"/>
<nettyrpc:service id="demoAddService" interfaceName="com.newlandframework.rpc.services.AddCalculate"
ref="calcAddService"></nettyrpc:service>
<nettyrpc:service id="demoMultiService" interfaceName="com.newlandframework.rpc.services.MultiCalculate"
ref="calcMultiService"></nettyrpc:service>
<nettyrpc:service id="demoPersonManage" interfaceName="com.newlandframework.rpc.services.PersonManage"
ref="personManageService"></nettyrpc:service>
<nettyrpc:service id="demoPersonManageJdbc" interfaceName="com.newlandframework.rpc.services.JdbcPersonManage"
ref="personManageServiceJdbc"></nettyrpc:service>
<nettyrpc:service id="demoCostTime" interfaceName="com.newlandframework.rpc.services.CostTimeCalculate"
ref="costTimeCalculateService"></nettyrpc:service>
<nettyrpc:service id="demoCache" interfaceName="com.newlandframework.rpc.services.Cache"
ref="cacheService" filter="simpleFilter"></nettyrpc:service>
<nettyrpc:service id="demoStore" interfaceName="com.newlandframework.rpc.services.Store"
ref="storeService" filter="simpleFilter"></nettyrpc:service>
<nettyrpc:registry id="rpcRegistry" ipAddr="${rpc.server.addr}" echoApiPort="${rpc.server.echo.api.port}"
protocol="PROTOSTUFFSERIALIZE"></nettyrpc:registry>
<bean id="calcAddService" class="com.newlandframework.rpc.services.impl.AddCalculateImpl"></bean>
<bean id="calcMultiService" class="com.newlandframework.rpc.services.impl.MultiCalculateImpl"></bean>
<bean id="personManageService" class="com.newlandframework.rpc.services.impl.PersonManageImpl"></bean>
<bean id="personManageServiceJdbc" class="com.newlandframework.rpc.services.impl.JdbcPersonManageImpl">
<property name="dataSource" ref="dataSource"></property>
</bean>
<bean id="costTimeCalculateService" class="com.newlandframework.rpc.services.impl.CostTimeCalculateImpl"></bean>
<bean id="cacheService" class="com.newlandframework.rpc.services.impl.CacheImpl"></bean>
<bean id="storeService" class="com.newlandframework.rpc.services.impl.StoreImpl"></bean>
<bean id="simpleFilter" class="com.newlandframework.rpc.filter.support.SimpleFilter"></bean>
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@10.1.0.211:1521:kf"/>
<property name="username" value="ccs_nd"/>
<property name="password" value="ccs_nd"/>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg name="dataSource" ref="dataSource"/>
</bean>
<bean id="sqlTxManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<tx:annotation-driven transaction-manager="sqlTxManager"/>
</beans>
``` | /content/code_sandbox/src/test/resources/rpc-invoke-config-jdbc-server.xml | xml | 2016-07-28T14:56:15 | 2024-08-03T22:52:46 | NettyRPC | tang-jie/NettyRPC | 1,271 | 849 |
```xml
import { useCallback, useEffect, useState } from 'react';
import useLoading from '@proton/hooks/useLoading';
import { sendErrorReport } from '../../utils/errorHandling';
import type { DecryptedLink, DecryptedLinkWithShareInfo } from '../_links';
import { useAbortSignal } from '../_views/utils';
import { useDirectSharingInfo } from './useDirectSharingInfo';
interface Props {
shareId: string;
sharedByMeListing?: boolean;
links: DecryptedLink[];
driveSharingFF?: boolean; // TODO: This is used to disable it under FF, remove this props when FF is removed
areLinksLoading: boolean;
}
/**
* useLoadLinksShareInfo allow to enriched standard Decrypted links with sharing info like sharedOn, sharedBy and permissions
*
**/
export const useLoadLinksShareInfo = ({
shareId,
links,
areLinksLoading,
sharedByMeListing = false,
driveSharingFF = true,
}: Props) => {
// If it's not new direct sharing, we shouldn't load share info, loading should be set to 'false' by default.
const [isLoading, withLoading] = useLoading(driveSharingFF);
const abortSignal = useAbortSignal([shareId, withLoading]);
const [linksWithShareInfo, setLinksWithShareInfo] = useState<Map<string, DecryptedLinkWithShareInfo>>(new Map());
const { getDirectSharingInfo } = useDirectSharingInfo({ sharedByMeListing });
const loadLinksShareInfo = useCallback(
async (signal: AbortSignal) => {
const newState = new Map();
for (const link of links) {
if (linksWithShareInfo.has(link.linkId)) {
newState.set(link.linkId, linksWithShareInfo.get(link.linkId));
} else {
const linkShareId = link.sharingDetails?.shareId;
const directSharingInfo = linkShareId ? await getDirectSharingInfo(signal, linkShareId) : {};
newState.set(link.linkId, {
...link,
...directSharingInfo,
});
}
}
setLinksWithShareInfo(newState);
},
[links] //TODO: No all deps params as too much work needed in getDirectSharingInfo and all useShare functions
);
useEffect(() => {
// Not nice: we block loading extra info until all the basic stuff is loaded first to avoid performance issues.
// We must redo it a lot, probably with refactor or if users will have too many shared items quickly.
// The view should show cached items in meantime.
if (!driveSharingFF || areLinksLoading) {
return;
}
void withLoading(loadLinksShareInfo(abortSignal).catch(sendErrorReport));
}, [loadLinksShareInfo, areLinksLoading]);
return {
isLoading,
linksWithShareInfo: [...linksWithShareInfo.values()],
};
};
``` | /content/code_sandbox/packages/drive-store/store/_shares/useLoadLinksShareInfo.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 614 |
```xml
import fs from 'fs';
import type * as Har from 'har-format';
import React, { Fragment, useCallback, useEffect, useState } from 'react';
import { Button, Tab, TabList, TabPanel, Tabs, Toolbar } from 'react-aria-components';
import { useRouteLoaderData } from 'react-router-dom';
import { useFetcher } from 'react-router-dom';
import { useInterval } from 'react-use';
import { getMockServiceURL, getPreviewModeName, PREVIEW_MODE_FRIENDLY, PREVIEW_MODES, type PreviewMode } from '../../../common/constants';
import { exportHarCurrentRequest } from '../../../common/har';
import type { ResponseTimelineEntry } from '../../../main/network/libcurl-promise';
import * as models from '../../../models';
import type { MockRoute } from '../../../models/mock-route';
import type { MockServer } from '../../../models/mock-server';
import type { Response } from '../../../models/response';
import { cancelRequestById } from '../../../network/cancellation';
import { insomniaFetch } from '../../../ui/insomniaFetch';
import { jsonPrettify } from '../../../utils/prettify/json';
import { useExecutionState } from '../../hooks/use-execution-state';
import type { MockRouteLoaderData } from '../../routes/mock-route';
import { useRootLoaderData } from '../../routes/root';
import { Dropdown, DropdownItem, DropdownSection, ItemContent } from '../base/dropdown';
import { CodeEditor } from '../codemirror/code-editor';
import { Pane, PaneHeader } from '../panes/pane';
import { PlaceholderResponsePane } from '../panes/placeholder-response-pane';
import { ResponseTimer } from '../response-timer';
import { SizeTag } from '../tags/size-tag';
import { StatusTag } from '../tags/status-tag';
import { TimeTag } from '../tags/time-tag';
import { getTimeFromNow } from '../time-from-now';
import { ResponseHeadersViewer } from '../viewers/response-headers-viewer';
import { ResponseTimelineViewer } from '../viewers/response-timeline-viewer';
import { ResponseViewer } from '../viewers/response-viewer';
interface MockbinLogOutput {
log: {
version: string;
creator: {
name: string;
version: string;
};
entries: [
{
startedDateTime: string;
clientIPAddress: string;
request: Har.Request;
}
];
};
}
export const MockResponsePane = () => {
const { mockServer, mockRoute, activeResponse } = useRouteLoaderData(':mockRouteId') as MockRouteLoaderData;
const { settings } = useRootLoaderData();
const [timeline, setTimeline] = useState<ResponseTimelineEntry[]>([]);
const [previewMode, setPreviewMode] = useState<PreviewMode>(PREVIEW_MODE_FRIENDLY);
const requestFetcher = useFetcher({ key: 'mock-request-fetcher' });
const { steps } = useExecutionState({ requestId: activeResponse?.parentId });
useEffect(() => {
const fn = async () => {
if (activeResponse) {
const timeline = await models.response.getTimeline(activeResponse, true);
setTimeline(timeline);
}
};
fn();
}, [activeResponse]);
if (requestFetcher.state !== 'idle') {
return (
<PlaceholderResponsePane>
{<ResponseTimer
handleCancel={() => activeResponse && cancelRequestById(activeResponse.parentId)}
activeRequestId={mockRoute._id}
steps={steps}
/>}
</PlaceholderResponsePane>
);
}
return (
<Pane type="response">
{!activeResponse ? null : (
<PaneHeader className="row-spaced">
<div aria-atomic="true" aria-live="polite" className="no-wrap scrollable scrollable--no-bars pad-left">
<StatusTag statusCode={activeResponse.statusCode} statusMessage={activeResponse.statusMessage} />
<TimeTag milliseconds={activeResponse.elapsedTime} steps={[]} />
<SizeTag bytesRead={activeResponse.bytesRead} bytesContent={activeResponse.bytesContent} />
</div>
</PaneHeader>
)}
<Tabs aria-label='Mock response' className="flex-1 w-full h-full flex flex-col">
<TabList className='w-full flex-shrink-0 overflow-x-auto border-solid scro border-b border-b-[--hl-md] bg-[--color-bg] flex items-center h-[--line-height-sm]' aria-label='Request pane tabs'>
<Tab
className='flex-shrink-0 h-full flex items-center justify-between cursor-pointer gap-2 outline-none select-none px-3 py-1 text-[--hl] aria-selected:text-[--color-font] hover:bg-[--hl-sm] hover:text-[--color-font] aria-selected:bg-[--hl-xs] aria-selected:focus:bg-[--hl-sm] aria-selected:hover:bg-[--hl-sm] focus:bg-[--hl-sm] transition-colors duration-300'
id='preview'
>
Preview
</Tab>
<Tab
className='flex-shrink-0 h-full flex items-center justify-between cursor-pointer gap-2 outline-none select-none px-3 py-1 text-[--hl] aria-selected:text-[--color-font] hover:bg-[--hl-sm] hover:text-[--color-font] aria-selected:bg-[--hl-xs] aria-selected:focus:bg-[--hl-sm] aria-selected:hover:bg-[--hl-sm] focus:bg-[--hl-sm] transition-colors duration-300'
id='headers'
>
Headers
</Tab>
<Tab
className='flex-shrink-0 h-full flex items-center justify-between cursor-pointer gap-2 outline-none select-none px-3 py-1 text-[--hl] aria-selected:text-[--color-font] hover:bg-[--hl-sm] hover:text-[--color-font] aria-selected:bg-[--hl-xs] aria-selected:focus:bg-[--hl-sm] aria-selected:hover:bg-[--hl-sm] focus:bg-[--hl-sm] transition-colors duration-300'
id='timeline'
>
Console
</Tab>
<Tab
className='flex-shrink-0 h-full flex items-center justify-between cursor-pointer gap-2 outline-none select-none px-3 py-1 text-[--hl] aria-selected:text-[--color-font] hover:bg-[--hl-sm] hover:text-[--color-font] aria-selected:bg-[--hl-xs] aria-selected:focus:bg-[--hl-sm] aria-selected:hover:bg-[--hl-sm] focus:bg-[--hl-sm] transition-colors duration-300'
id='history'
>
History
</Tab>
</TabList>
<TabPanel className='w-full flex-1 flex flex-col overflow-y-auto' id='preview'>
<Toolbar className="w-full flex-shrink-0 h-[--line-height-sm] border-b border-solid border-[--hl-md] flex items-center px-2">
{activeResponse ?
<PreviewModeDropdown
activeResponse={activeResponse}
previewMode={previewMode}
setPreviewMode={setPreviewMode}
/> : null}
</Toolbar>
{activeResponse && <ResponseViewer
key={activeResponse._id}
bytes={Math.max(activeResponse.bytesContent, activeResponse.bytesRead)}
contentType={activeResponse.contentType || ''}
disableHtmlPreviewJs={settings.disableHtmlPreviewJs}
disablePreviewLinks={settings.disableResponsePreviewLinks}
download={() => { }}
editorFontSize={settings.editorFontSize}
error={activeResponse.error}
filter={''}
filterHistory={[]}
getBody={() => models.response.getBodyBuffer(activeResponse)}
previewMode={previewMode}
responseId={activeResponse._id}
updateFilter={activeResponse.error ? undefined : () => { }}
url={activeResponse.url}
/>}
</TabPanel>
<TabPanel className='w-full flex-1 flex flex-col overflow-y-auto' id='headers'>
<ResponseHeadersViewer headers={activeResponse?.headers || []} />
</TabPanel>
<TabPanel className='w-full flex-1 flex flex-col overflow-y-auto' id='timeline'>
<ResponseTimelineViewer
key={activeResponse?._id}
timeline={timeline}
pinToBottom={true}
/>
</TabPanel>
<TabPanel className='w-full flex-1 flex flex-col overflow-y-auto' id='history'>
<HistoryViewWrapperComponentFactory mockServer={mockServer} mockRoute={mockRoute} />
</TabPanel>
</Tabs>
</Pane>
);
};
const HistoryViewWrapperComponentFactory = ({ mockServer, mockRoute }: { mockServer: MockServer; mockRoute: MockRoute }) => {
const [logs, setLogs] = useState<MockbinLogOutput | null>(null);
const [logEntryId, setLogEntryId] = useState<number | null>(null);
const { userSession } = useRootLoaderData();
const fetchLogs = useCallback(async () => {
const compoundId = mockRoute.parentId + mockRoute.name;
const mockbinUrl = mockServer.useInsomniaCloud ? getMockServiceURL() : mockServer.url;
try {
const res = await insomniaFetch<MockbinLogOutput>({
origin: mockbinUrl,
path: `/bin/log/${compoundId}`,
method: 'GET',
sessionId: userSession.id,
});
if (res?.log) {
setLogs(res);
return;
}
console.log('[mock] Error: fetching logs from remote', { mockbinUrl, res });
} catch (e) {
// network erros will be managed by the upsert trigger, so we can ignore them here
console.log({ mockbinUrl, e });
}
}, [mockRoute.name, mockRoute.parentId, mockServer.url, mockServer.useInsomniaCloud, userSession.id]);
// refetches logs whenever the path changes, or a response is recieved, or tenseconds elapses or history tab is click
// chatgpt: answer my called
useInterval(() => {
fetchLogs();
}, 10000);
useEffect(() => {
fetchLogs();
}, [fetchLogs]);
return (
<div className="h-full w-full grid grid-rows-[repeat(auto-fit,minmax(0,1fr))]">
<div className="w-full flex-1 overflow-hidden box-border overflow-y-scroll">
<div className="grid grid-cols-[repeat(5,auto)] divide-solid divide-y divide-[--hl-sm]">
<div className="uppercase p-2 bg-[--hl-sm] text-left text-xs font-semibold focus:outline-none">Method</div>
<div className="uppercase p-2 bg-[--hl-sm] text-left text-xs font-semibold focus:outline-none">Size</div>
<div className="uppercase p-2 bg-[--hl-sm] text-left text-xs font-semibold focus:outline-none">Date</div>
<div className="uppercase p-2 bg-[--hl-sm] text-left text-xs font-semibold focus:outline-none">IP</div>
<div className="uppercase p-2 bg-[--hl-sm] text-left text-xs font-semibold focus:outline-none">Path</div>
{logs?.log.entries?.map((row, index) => (
<Fragment key={row.startedDateTime}>
<div onClick={() => setLogEntryId(index)} className={`${index % 2 === 0 ? '' : 'bg-[--hl-xs]'} cursor-pointer whitespace-nowrap text-sm truncate font-medium group-last-of-type:border-none focus:outline-none`}>
<div className='p-2'>{row.request.method}</div>
</div>
<div onClick={() => setLogEntryId(index)} className={`${index % 2 === 0 ? '' : 'bg-[--hl-xs]'} cursor-pointer whitespace-nowrap text-sm truncate font-medium group-last-of-type:border-none focus:outline-none`}>
<div className='p-2'>{row.request.bodySize + row.request.headersSize}</div></div>
<div onClick={() => setLogEntryId(index)} className={`${index % 2 === 0 ? '' : 'bg-[--hl-xs]'} cursor-pointer whitespace-nowrap text-sm truncate font-medium group-last-of-type:border-none focus:outline-none`}>
<div className='p-2 truncate'>{getTimeFromNow(row.startedDateTime, false)}</div>
</div>
<div onClick={() => setLogEntryId(index)} className={`${index % 2 === 0 ? '' : 'bg-[--hl-xs]'} cursor-pointer whitespace-nowrap text-sm truncate font-medium group-last-of-type:border-none focus:outline-none`}>
<div className='p-2 truncate'>{row.clientIPAddress}</div>
</div>
<div onClick={() => setLogEntryId(index)} className={`${index % 2 === 0 ? '' : 'bg-[--hl-xs]'} cursor-pointer whitespace-nowrap truncate text-sm font-medium group-last-of-type:border-none focus:outline-none`}>
<div className='p-2 truncate'>{row.request.url}</div>
</div>
</Fragment>
)).reverse()}
</div>
</div>
{logEntryId !== null && logs?.log.entries?.[logEntryId] && (
<div className='flex-1 h-full border-solid border border-[--hl-md]'>
<CodeEditor
id="log-body-preview"
key={logEntryId + logs?.log.entries?.[logEntryId].startedDateTime}
hideLineNumbers
mode={'text/json'}
defaultValue={JSON.stringify(logs?.log.entries?.[logEntryId], null, '\t')}
readOnly
/>
</div>
)}
</div>
);
};
const PreviewModeDropdown = ({ activeResponse, previewMode, setPreviewMode }: { activeResponse: Response; previewMode: PreviewMode; setPreviewMode: (mode: PreviewMode) => void }) => {
return (
<Dropdown
aria-label='Preview Mode Dropdown'
triggerButton={
<Button className="text-[--hl]">
{getPreviewModeName(previewMode)}
<i className="fa fa-caret-down space-left" />
</Button>
}
>
<DropdownSection
aria-label='Preview Mode Section'
title="Preview Mode"
>
{PREVIEW_MODES.map(mode =>
<DropdownItem
key={mode}
aria-label={getPreviewModeName(mode, true)}
>
<ItemContent
icon={previewMode === mode ? 'check' : 'empty'}
label={getPreviewModeName(mode, true)}
onClick={() => setPreviewMode(mode)}
/>
</DropdownItem>
)}
</DropdownSection>
<DropdownSection
aria-label='Action Section'
title="Action"
>
<DropdownItem aria-label='Copy raw response'>
<ItemContent
icon="copy"
label="Copy raw response"
onClick={async () => {
const bodyBuffer = await models.response.getBodyBuffer(activeResponse);
bodyBuffer && window.clipboard.writeText(bodyBuffer.toString('utf8'));
}}
/>
</DropdownItem>
<DropdownItem aria-label='Export raw response'>
<ItemContent
icon="save"
label="Export raw response"
onClick={async () => {
const bodyBuffer = await models.response.getBodyBuffer(activeResponse);
const { canceled, filePath } = await window.dialog.showSaveDialog({
title: 'Save Full Response',
buttonLabel: 'Save',
defaultPath: `response-${Date.now()}.txt`,
});
if (canceled || !filePath || !bodyBuffer) {
return;
}
fs.promises.writeFile(filePath, bodyBuffer.toString('utf8'));
}}
/>
</DropdownItem>
<DropdownItem aria-label='Export prettified response'>
{activeResponse.contentType.includes('json') &&
<ItemContent
icon="save"
label="Export prettified response"
onClick={async () => {
const bodyBuffer = await models.response.getBodyBuffer(activeResponse);
const { canceled, filePath } = await window.dialog.showSaveDialog({
title: 'Save Full Response',
buttonLabel: 'Save',
defaultPath: `response-${Date.now()}.txt`,
});
if (canceled || !filePath || !bodyBuffer) {
return;
}
fs.promises.writeFile(filePath, jsonPrettify(bodyBuffer.toString('utf8')));
}}
/>
}
</DropdownItem>
<DropdownItem aria-label='Export HTTP debug'>
<ItemContent
icon="bug"
label="Export HTTP debug"
onClick={async () => {
const { canceled, filePath } = await window.dialog.showSaveDialog({
title: 'Save Full Response',
buttonLabel: 'Save',
defaultPath: `response-${Date.now()}.txt`,
});
if (canceled || !filePath) {
return;
}
const timeline = models.response.getTimeline(activeResponse);
const headers = timeline
.filter(v => v.name === 'HeaderIn')
.map(v => v.value)
.join('');
fs.promises.writeFile(filePath, headers);
}}
/>
</DropdownItem>
<DropdownItem aria-label='Export as HAR'>
<ItemContent
icon="save"
label="Export as HAR"
onClick={async () => {
const activeRequest = await models.request.getById(activeResponse.parentId);
const { canceled, filePath } = await window.dialog.showSaveDialog({
title: 'Save Full Response',
buttonLabel: 'Save',
defaultPath: `response-${Date.now()}.txt`,
});
if (canceled || !filePath || !activeRequest) {
return;
}
const data = await exportHarCurrentRequest(activeRequest, activeResponse);
const har = JSON.stringify(data, null, '\t');
fs.promises.writeFile(filePath, har);
}}
/>
</DropdownItem>
</DropdownSection>
</Dropdown>
);
};
``` | /content/code_sandbox/packages/insomnia/src/ui/components/mocks/mock-response-pane.tsx | xml | 2016-04-23T03:54:26 | 2024-08-16T16:50:44 | insomnia | Kong/insomnia | 34,054 | 3,844 |
```xml
export * from 'storybook/internal/node-logger';
export type * from 'storybook/internal/node-logger';
``` | /content/code_sandbox/code/deprecated/node-logger/shim.d.ts | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 22 |
```xml
import { merge } from "lodash";
import { CLIENT_ID_HEADER } from "coral-common/common/lib/constants";
import { Overwrite } from "coral-framework/types";
import { AccessTokenProvider } from "./auth";
import { assertOnline, extractTraceableError } from "./network";
const buildOptions = (inputOptions: RequestInit = {}) => {
const defaultOptions: RequestInit = {
method: "GET",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
credentials: "same-origin",
};
const options = merge({}, defaultOptions, inputOptions);
if (options.method!.toLowerCase() !== "get") {
options.body = JSON.stringify(options.body);
}
return options;
};
// TODO (bc): Wrap response errors into error objects once server errors have been defined
const handleResp = async (res: Response) => {
if (res.status === 404) {
const response = await res.text();
throw new Error(response);
}
const type = res.headers.get("content-type");
if (!res.ok) {
if (type && type.includes("application/json")) {
const response = await res.json();
throw extractTraceableError(response.error as Error);
} else {
const response = await res.text();
throw new Error(response);
}
}
if (res.status === 204) {
return res.text();
}
if (type && type.includes("application/octet-stream")) {
return res.arrayBuffer();
}
return res.json();
};
type PartialRequestInit = Overwrite<Partial<RequestInit>, { body?: any }> & {
token?: string;
};
export class RestClient {
private readonly uri: string;
private readonly clientID?: string;
private readonly accessTokenProvider?: AccessTokenProvider;
constructor(
uri: string,
clientID?: string,
accessTokenProvider?: AccessTokenProvider
) {
this.uri = uri;
this.clientID = clientID;
this.accessTokenProvider = accessTokenProvider;
}
public async fetch<T = {}>(
path: string,
options: PartialRequestInit
): Promise<T> {
let opts = options;
const token =
options.token || (this.accessTokenProvider && this.accessTokenProvider());
if (token) {
opts = merge({}, options, {
headers: {
Authorization: `Bearer ${token}`,
},
});
}
if (this.clientID) {
opts = merge({}, opts, {
headers: {
[CLIENT_ID_HEADER]: this.clientID,
},
});
}
try {
const response = await fetch(`${this.uri}${path}`, buildOptions(opts));
return handleResp(response);
} catch (error) {
assertOnline(error as Error);
throw error;
}
}
}
``` | /content/code_sandbox/client/src/core/client/framework/lib/rest.ts | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 598 |
```xml
import { SyncServiceInterface } from '../../Sync/SyncServiceInterface'
import { UuidGenerator } from '@standardnotes/utils'
import {
KeySystemRootKeyParamsInterface,
KeySystemPasswordType,
VaultListingContentSpecialized,
VaultListingInterface,
KeySystemRootKeyStorageMode,
FillItemContentSpecialized,
KeySystemRootKeyInterface,
EmojiString,
IconType,
} from '@standardnotes/models'
import { MutatorClientInterface } from '../../Mutator/MutatorClientInterface'
import { ContentType } from '@standardnotes/domain-core'
import { EncryptionProviderInterface } from '../../Encryption/EncryptionProviderInterface'
import { KeySystemKeyManagerInterface } from '../../KeySystem/KeySystemKeyManagerInterface'
export class CreateVault {
constructor(
private mutator: MutatorClientInterface,
private encryption: EncryptionProviderInterface,
private keys: KeySystemKeyManagerInterface,
private sync: SyncServiceInterface,
) {}
async execute(dto: {
vaultName: string
vaultDescription?: string
vaultIcon: IconType | EmojiString
userInputtedPassword: string | undefined
storagePreference: KeySystemRootKeyStorageMode
}): Promise<VaultListingInterface> {
const keySystemIdentifier = UuidGenerator.GenerateUuid()
const rootKey = await this.createKeySystemRootKey({
keySystemIdentifier,
vaultName: dto.vaultName,
vaultDescription: dto.vaultDescription,
userInputtedPassword: dto.userInputtedPassword,
storagePreference: dto.storagePreference,
})
await this.createKeySystemItemsKey(keySystemIdentifier, rootKey.token)
const vaultListing = await this.createVaultListing({
keySystemIdentifier,
vaultName: dto.vaultName,
vaultDescription: dto.vaultDescription,
vaultIcon: dto.vaultIcon,
passwordType: dto.userInputtedPassword ? KeySystemPasswordType.UserInputted : KeySystemPasswordType.Randomized,
rootKeyParams: rootKey.keyParams,
storage: dto.storagePreference,
})
await this.sync.sync()
return vaultListing
}
private async createVaultListing(dto: {
keySystemIdentifier: string
vaultName: string
vaultDescription?: string
vaultIcon: IconType | EmojiString
passwordType: KeySystemPasswordType
rootKeyParams: KeySystemRootKeyParamsInterface
storage: KeySystemRootKeyStorageMode
}): Promise<VaultListingInterface> {
const content: VaultListingContentSpecialized = {
systemIdentifier: dto.keySystemIdentifier,
rootKeyParams: dto.rootKeyParams,
keyStorageMode: dto.storage,
name: dto.vaultName,
description: dto.vaultDescription,
iconString: dto.vaultIcon,
}
return this.mutator.createItem(ContentType.TYPES.VaultListing, FillItemContentSpecialized(content), true)
}
private async createKeySystemItemsKey(keySystemIdentifier: string, rootKeyToken: string): Promise<void> {
const keySystemItemsKey = this.encryption.createKeySystemItemsKey(
UuidGenerator.GenerateUuid(),
keySystemIdentifier,
undefined,
rootKeyToken,
)
await this.mutator.insertItem(keySystemItemsKey)
}
private async createKeySystemRootKey(dto: {
keySystemIdentifier: string
vaultName: string
vaultDescription?: string
userInputtedPassword: string | undefined
storagePreference: KeySystemRootKeyStorageMode
}): Promise<KeySystemRootKeyInterface> {
let newRootKey: KeySystemRootKeyInterface | undefined
if (dto.userInputtedPassword) {
newRootKey = this.encryption.createUserInputtedKeySystemRootKey({
systemIdentifier: dto.keySystemIdentifier,
userInputtedPassword: dto.userInputtedPassword,
})
} else {
newRootKey = this.encryption.createRandomizedKeySystemRootKey({
systemIdentifier: dto.keySystemIdentifier,
})
}
if (dto.storagePreference === KeySystemRootKeyStorageMode.Synced) {
await this.mutator.insertItem(newRootKey, true)
} else {
this.keys.cacheKey(newRootKey, dto.storagePreference)
}
return newRootKey
}
}
``` | /content/code_sandbox/packages/services/src/Domain/Vault/UseCase/CreateVault.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 900 |
```xml
<fxlayout>
<page name="Bloom Iwa">
<control>gamma</control>
<control>gammaAdjust</control>
<control>auto_gain</control>
<control>gain_adjust</control>
<control>gain</control>
<control decimals="0">decay</control>
<control>size</control>
<control>alpha_mode</control>
<visibleToggle>
<controller>auto_gain</controller>
<on>gain_adjust</on>
<off>gain</off>
</visibleToggle>
</page>
</fxlayout>
``` | /content/code_sandbox/stuff/profiles/layouts/fxs/STD_iwa_BloomFx.xml | xml | 2016-03-18T17:55:48 | 2024-08-15T18:11:38 | opentoonz | opentoonz/opentoonz | 4,445 | 144 |
```xml
import type { MouseEventHandler } from 'react';
import { useCallback, useState } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import classNames from 'classnames';
import { useHistory } from 'react-router';
import type Immutable from 'immutable';
import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react';
import AttachmentList from 'mastodon/components/attachment_list';
import { Icon } from 'mastodon/components/icon';
import { VisibilityIcon } from 'mastodon/components/visibility_icon';
import PrivacyDropdown from 'mastodon/features/compose/components/privacy_dropdown';
import type { Account } from 'mastodon/models/account';
import type { Status, StatusVisibility } from 'mastodon/models/status';
import { useAppSelector } from 'mastodon/store';
import { Avatar } from '../../../components/avatar';
import { Button } from '../../../components/button';
import { DisplayName } from '../../../components/display_name';
import { RelativeTimestamp } from '../../../components/relative_timestamp';
import StatusContent from '../../../components/status_content';
const messages = defineMessages({
cancel_reblog: {
id: 'status.cancel_reblog_private',
defaultMessage: 'Unboost',
},
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
});
export const BoostModal: React.FC<{
status: Status;
onClose: () => void;
onReblog: (status: Status, privacy: StatusVisibility) => void;
}> = ({ status, onReblog, onClose }) => {
const intl = useIntl();
const history = useHistory();
const default_privacy = useAppSelector(
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
(state) => state.compose.get('default_privacy') as StatusVisibility,
);
const account = status.get('account') as Account;
const statusVisibility = status.get('visibility') as StatusVisibility;
const [privacy, setPrivacy] = useState<StatusVisibility>(
statusVisibility === 'private' ? 'private' : default_privacy,
);
const onPrivacyChange = useCallback((value: StatusVisibility) => {
setPrivacy(value);
}, []);
const handleReblog = useCallback(() => {
onReblog(status, privacy);
onClose();
}, [onClose, onReblog, status, privacy]);
const handleAccountClick = useCallback<MouseEventHandler>(
(e) => {
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault();
onClose();
history.push(`/@${account.acct}`);
}
},
[history, onClose, account],
);
const buttonText = status.get('reblogged')
? messages.cancel_reblog
: messages.reblog;
const findContainer = useCallback(
() => document.getElementsByClassName('modal-root__container')[0],
[],
);
return (
<div className='modal-root__modal boost-modal'>
<div className='boost-modal__container'>
<div
className={classNames(
'status',
`status-${statusVisibility}`,
'light',
)}
>
<div className='status__info'>
<a
href={`/@${account.acct}/${status.get('id') as string}`}
className='status__relative-time'
target='_blank'
rel='noopener noreferrer'
>
<span className='status__visibility-icon'>
<VisibilityIcon visibility={statusVisibility} />
</span>
<RelativeTimestamp
timestamp={status.get('created_at') as string}
/>
</a>
<a
onClick={handleAccountClick}
href={`/@${account.acct}`}
className='status__display-name'
>
<div className='status__avatar'>
<Avatar account={account} size={48} />
</div>
<DisplayName account={account} />
</a>
</div>
{/* @ts-expect-error Expected until StatusContent is typed */}
<StatusContent status={status} />
{(status.get('media_attachments') as Immutable.List<unknown>).size >
0 && (
<AttachmentList compact media={status.get('media_attachments')} />
)}
</div>
</div>
<div className='boost-modal__action-bar'>
<div>
<FormattedMessage
id='boost_modal.combo'
defaultMessage='You can press {combo} to skip this next time'
values={{
combo: (
<span>
Shift + <Icon id='retweet' icon={RepeatIcon} />
</span>
),
}}
/>
</div>
{statusVisibility !== 'private' && !status.get('reblogged') && (
<PrivacyDropdown
noDirect
value={privacy}
container={findContainer}
onChange={onPrivacyChange}
/>
)}
<Button
text={intl.formatMessage(buttonText)}
onClick={handleReblog}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
/>
</div>
</div>
);
};
``` | /content/code_sandbox/app/javascript/mastodon/features/ui/components/boost_modal.tsx | xml | 2016-02-22T15:01:25 | 2024-08-16T19:27:35 | mastodon | mastodon/mastodon | 46,560 | 1,090 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<org.horaapps.leafpic.views.SquareRelativeLayout
xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:id="@+id/media_card_layout"
android:layout_width="wrap_content"
android:foreground="@drawable/ripple"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/photo_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/photo_path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:paddingStart="2dp"
android:textColor="@color/md_dark_primary_text"
android:background="@color/md_black_1000_transparent"
android:paddingEnd="2dp"
android:elevation="10dp"
android:textSize="@dimen/medium_small_text"
android:maxLines="1"
android:layout_alignParentBottom="true"
tools:targetApi="lollipop" />
<org.horaapps.liz.ui.ThemedIcon
android:id="@+id/gif_icon"
android:layout_width="@dimen/icon_sub_width_height"
android:layout_height="@dimen/icon_sub_width_height"
android:layout_marginBottom="2dp"
android:layout_marginStart="4dp"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:visibility="gone"
android:elevation="@dimen/icon_elevation"
app:iiv_color="@color/md_white_1000"
app:iiv_icon="gmd-gif"
tools:targetApi="lollipop" />
<org.horaapps.liz.ui.ThemedIcon
android:id="@+id/icon"
android:layout_width="26dp"
android:layout_height="26dp"
android:elevation="@dimen/icon_elevation"
android:visibility="gone"
android:layout_centerInParent="true"
app:iiv_color="@color/md_white_1000"
app:iiv_icon="gmd-play-circle-filled"
tools:targetApi="lollipop" />
</org.horaapps.leafpic.views.SquareRelativeLayout>
``` | /content/code_sandbox/app/src/main/res/layout/card_photo.xml | xml | 2016-01-07T17:24:12 | 2024-08-16T06:55:33 | LeafPic | UnevenSoftware/LeafPic | 3,258 | 516 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.