repo_name
stringlengths
4
116
path
stringlengths
3
942
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
flowtype/flow-typed
definitions/npm/cookie_v0.3.x/flow_v0.104.x-/cookie_v0.3.x.js
711
type SerializeOptions = { domain?: string, encode?: (stringToDecode: string) => string, expires?: Date, httpOnly?: boolean, maxAge?: number, path?: string, sameSite?: boolean | 'lax' | 'strict', secure?: boolean, ... }; type ParseOptions = { // Library itself does not specify output for decode function. // Because of simplicity is output set to string which is default settings and best for working with cookies. decode?: (stringToDecode: string) => string, ... }; declare module 'cookie' { declare module.exports: { serialize(name: string, val: string, options: ?SerializeOptions): string, parse(data: string, options: ?ParseOptions): { [string]: string, ... }, ... }; };
mit
jmptrader/JRIAppTS
RIAppDemo/RIAPP.DataService/Utils/STAThreadSync/StaSynchronizationContext.cs
1996
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Security.Permissions; namespace StaThreadSyncronizer { [SecurityPermission(SecurityAction.Demand, ControlThread = true)] public class StaSynchronizationContext : SynchronizationContext, IDisposable { private BlockingQueue<SendOrPostCallbackItem> mQueue; private StaThread mStaThread; public StaSynchronizationContext() : base() { mQueue = new BlockingQueue<SendOrPostCallbackItem>(); mStaThread = new StaThread(mQueue); mStaThread.Start(); } public override void Send(SendOrPostCallback action, object state) { // to avoid deadlock! if (Thread.CurrentThread.ManagedThreadId == mStaThread.ManagedThreadId) { action(state); return; } // create an item for execution SendOrPostCallbackItem item = new SendOrPostCallbackItem(action, state, ExecutionType.Send); // queue the item mQueue.Enqueue(item); // wait for the item execution to end item.ExecutionCompleteWaitHandle.WaitOne(); // if there was an exception, throw it on the caller thread, not the // sta thread. if (item.ExecutedWithException) throw item.Exception; } public override void Post(SendOrPostCallback d, object state) { // queue the item and don't wait for its execution. This is risky because // an unhandled exception will terminate the STA thread. Use with caution. SendOrPostCallbackItem item = new SendOrPostCallbackItem(d, state, ExecutionType.Post); mQueue.Enqueue(item); } public void Dispose() { mStaThread.Stop(); } public override SynchronizationContext CreateCopy() { return this; } } }
mit
xieta/mincoin
src/qt/locale/bitcoin_sv.ts
124283
<TS language="sv" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Högerklicka för att ändra adressen eller etiketten.</translation> </message> <message> <source>Create a new address</source> <translation>Skapa ny adress</translation> </message> <message> <source>&amp;New</source> <translation>&amp;Ny</translation> </message> <message> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopiera den markerade adressen till systemets Urklipp</translation> </message> <message> <source>&amp;Copy</source> <translation>&amp;Kopiera</translation> </message> <message> <source>C&amp;lose</source> <translation>S&amp;täng</translation> </message> <message> <source>Delete the currently selected address from the list</source> <translation>Ta bort den valda adressen från listan</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Exportera informationen i den nuvarande fliken till en fil</translation> </message> <message> <source>&amp;Export</source> <translation>&amp;Exportera</translation> </message> <message> <source>&amp;Delete</source> <translation>&amp;Radera</translation> </message> <message> <source>Choose the address to send coins to</source> <translation>Välj en adress att sända betalning till</translation> </message> <message> <source>Choose the address to receive coins with</source> <translation>Välj en adress att ta emot betalning till</translation> </message> <message> <source>C&amp;hoose</source> <translation>V&amp;älj</translation> </message> <message> <source>Sending addresses</source> <translation>Avsändaradresser</translation> </message> <message> <source>Receiving addresses</source> <translation>Mottagaradresser</translation> </message> <message> <source>These are your Mincoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Detta är dina Mincoin adresser för att skicka betalningar. Kolla alltid summan och den mottagande adressen innan du skickar Mincoins.</translation> </message> <message> <source>These are your Mincoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation>Detta är dina Mincoin adresser för att ta emot betalningar. Det rekommenderas att använda en ny mottagningsadress för varje transaktion.</translation> </message> <message> <source>&amp;Copy Address</source> <translation>&amp;Kopiera adress</translation> </message> <message> <source>Copy &amp;Label</source> <translation>Kopiera &amp;etikett</translation> </message> <message> <source>&amp;Edit</source> <translation>&amp;Redigera</translation> </message> <message> <source>Export Address List</source> <translation>Exportera adresslista</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Kommaseparerad fil (*.csv)</translation> </message> <message> <source>Exporting Failed</source> <translation>Export misslyckades</translation> </message> <message> <source>There was an error trying to save the address list to %1. Please try again.</source> <translation>Det inträffade ett fel när adresslistan skulle sparas till %1. Var vänlig och försök igen.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <source>Label</source> <translation>Etikett</translation> </message> <message> <source>Address</source> <translation>Adress</translation> </message> <message> <source>(no label)</source> <translation>(Ingen etikett)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <source>Passphrase Dialog</source> <translation>Lösenordsdialog</translation> </message> <message> <source>Enter passphrase</source> <translation>Ange lösenord</translation> </message> <message> <source>New passphrase</source> <translation>Nytt lösenord</translation> </message> <message> <source>Repeat new passphrase</source> <translation>Upprepa nytt lösenord</translation> </message> <message> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Ange plånbokens nya lösenord. &lt;br/&gt; Använd ett lösenord på &lt;b&gt;tio eller fler slumpmässiga tecken,&lt;/b&gt; eller &lt;b&gt;åtta eller fler ord.&lt;/b&gt;.</translation> </message> <message> <source>Encrypt wallet</source> <translation>Kryptera plånbok</translation> </message> <message> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Denna operation behöver din plånboks lösenord för att låsa upp plånboken.</translation> </message> <message> <source>Unlock wallet</source> <translation>Lås upp plånbok</translation> </message> <message> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Denna operation behöver din plånboks lösenord för att dekryptera plånboken.</translation> </message> <message> <source>Decrypt wallet</source> <translation>Dekryptera plånbok</translation> </message> <message> <source>Change passphrase</source> <translation>Ändra lösenord</translation> </message> <message> <source>Enter the old passphrase and new passphrase to the wallet.</source> <translation>Ge det gamla lösenordet och det nya lösenordet för plånboken.</translation> </message> <message> <source>Confirm wallet encryption</source> <translation>Bekräfta kryptering av plånbok</translation> </message> <message> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR MINCOINS&lt;/b&gt;!</source> <translation>VARNING: Om du krypterar din plånbok och glömmer ditt lösenord, kommer du att &lt;b&gt;FÖRLORA ALLA DINA MINCOIN&lt;/b&gt;!</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Är du säker på att du vill kryptera din plånbok?</translation> </message> <message> <source>Wallet encrypted</source> <translation>Plånbok krypterad</translation> </message> <message> <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your mincoins from being stolen by malware infecting your computer.</source> <translation>%1 kommer nu att stänga ner för att färdigställa krypteringen. Tänk på att en krypterad plånbok inte skyddar mot stöld om din dator är infekterad med en keylogger.</translation> </message> <message> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>VIKTIGT: Alla tidigare säkerhetskopior du har gjort av plånboksfilen ska ersättas med den nya genererade, krypterade plånboksfilen. Av säkerhetsskäl kommer tidigare säkerhetskopior av den okrypterade plånboksfilen blir oanvändbara när du börjar använda en ny, krypterad plånbok.</translation> </message> <message> <source>Wallet encryption failed</source> <translation>Kryptering av plånbok misslyckades</translation> </message> <message> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Kryptering av plånbok misslyckades på grund av ett internt fel. Din plånbok blev inte krypterad.</translation> </message> <message> <source>The supplied passphrases do not match.</source> <translation>De angivna lösenorden överensstämmer inte.</translation> </message> <message> <source>Wallet unlock failed</source> <translation>Misslyckades låsa upp plånboken</translation> </message> <message> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Lösenordet för dekryptering av plånboken var felaktig.</translation> </message> <message> <source>Wallet decryption failed</source> <translation>Dekryptering av plånbok misslyckades</translation> </message> <message> <source>Wallet passphrase was successfully changed.</source> <translation>Plånbokens lösenord har ändrats.</translation> </message> <message> <source>Warning: The Caps Lock key is on!</source> <translation>Varning: Caps Lock är påslaget!</translation> </message> </context> <context> <name>BanTableModel</name> <message> <source>IP/Netmask</source> <translation>IP/nätmask</translation> </message> <message> <source>Banned Until</source> <translation>Bannad tills</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <source>Sign &amp;message...</source> <translation>Signera &amp;meddelande...</translation> </message> <message> <source>Synchronizing with network...</source> <translation>Synkroniserar med nätverk...</translation> </message> <message> <source>&amp;Overview</source> <translation>&amp;Översikt</translation> </message> <message> <source>Node</source> <translation>Nod</translation> </message> <message> <source>Show general overview of wallet</source> <translation>Visa generell översikt av plånboken</translation> </message> <message> <source>&amp;Transactions</source> <translation>&amp;Transaktioner</translation> </message> <message> <source>Browse transaction history</source> <translation>Bläddra i transaktionshistorik</translation> </message> <message> <source>E&amp;xit</source> <translation>&amp;Avsluta</translation> </message> <message> <source>Quit application</source> <translation>Avsluta programmet</translation> </message> <message> <source>&amp;About %1</source> <translation>&amp;Om %1</translation> </message> <message> <source>Show information about %1</source> <translation>Visa information om %1</translation> </message> <message> <source>About &amp;Qt</source> <translation>Om &amp;Qt</translation> </message> <message> <source>Show information about Qt</source> <translation>Visa information om Qt</translation> </message> <message> <source>&amp;Options...</source> <translation>&amp;Alternativ...</translation> </message> <message> <source>Modify configuration options for %1</source> <translation>Ändra konfigurationsalternativ för %1</translation> </message> <message> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Kryptera plånbok...</translation> </message> <message> <source>&amp;Backup Wallet...</source> <translation>&amp;Säkerhetskopiera plånbok...</translation> </message> <message> <source>&amp;Change Passphrase...</source> <translation>&amp;Byt lösenord...</translation> </message> <message> <source>&amp;Sending addresses...</source> <translation>Av&amp;sändaradresser...</translation> </message> <message> <source>&amp;Receiving addresses...</source> <translation>Mottaga&amp;radresser...</translation> </message> <message> <source>Open &amp;URI...</source> <translation>Öppna &amp;URI...</translation> </message> <message> <source>Click to disable network activity.</source> <translation>Klicka för att inaktivera nätverksaktivitet.</translation> </message> <message> <source>Network activity disabled.</source> <translation>Nätverksaktivitet inaktiverad.</translation> </message> <message> <source>Click to enable network activity again.</source> <translation>Klicka för att aktivera nätverksaktivitet igen.</translation> </message> <message> <source>Syncing Headers (%1%)...</source> <translation>Synkar huvuden (%1%)...</translation> </message> <message> <source>Reindexing blocks on disk...</source> <translation>Återindexerar block på disken...</translation> </message> <message> <source>Send coins to a Mincoin address</source> <translation>Skicka mincoins till en Mincoin-adress</translation> </message> <message> <source>Backup wallet to another location</source> <translation>Säkerhetskopiera plånboken till en annan plats</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation>Byt lösenfras för kryptering av plånbok</translation> </message> <message> <source>&amp;Debug window</source> <translation>&amp;Debug-fönster</translation> </message> <message> <source>Open debugging and diagnostic console</source> <translation>Öppna debug- och diagnostikkonsolen</translation> </message> <message> <source>&amp;Verify message...</source> <translation>&amp;Verifiera meddelande...</translation> </message> <message> <source>Mincoin</source> <translation>Mincoin</translation> </message> <message> <source>Wallet</source> <translation>Plånbok</translation> </message> <message> <source>&amp;Send</source> <translation>&amp;Skicka</translation> </message> <message> <source>&amp;Receive</source> <translation>&amp;Ta emot</translation> </message> <message> <source>&amp;Show / Hide</source> <translation>&amp;Visa / Göm</translation> </message> <message> <source>Show or hide the main Window</source> <translation>Visa eller göm huvudfönstret</translation> </message> <message> <source>Encrypt the private keys that belong to your wallet</source> <translation>Kryptera de privata nycklar som tillhör din plånbok</translation> </message> <message> <source>Sign messages with your Mincoin addresses to prove you own them</source> <translation>Signera meddelanden med din Mincoin-adress för att bevisa att du äger dem</translation> </message> <message> <source>Verify messages to ensure they were signed with specified Mincoin addresses</source> <translation>Verifiera meddelanden för att vara säker på att de var signerade med specificerade Mincoin-adresser</translation> </message> <message> <source>&amp;File</source> <translation>&amp;Arkiv</translation> </message> <message> <source>&amp;Settings</source> <translation>&amp;Inställningar</translation> </message> <message> <source>&amp;Help</source> <translation>&amp;Hjälp</translation> </message> <message> <source>Tabs toolbar</source> <translation>Verktygsfält för tabbar</translation> </message> <message> <source>Request payments (generates QR codes and mincoin: URIs)</source> <translation>Begär betalning (genererar QR-koder och mincoin-URI)</translation> </message> <message> <source>Show the list of used sending addresses and labels</source> <translation>Visa listan av använda avsändaradresser och etiketter</translation> </message> <message> <source>Show the list of used receiving addresses and labels</source> <translation>Visa listan av använda mottagningsadresser och etiketter</translation> </message> <message> <source>Open a mincoin: URI or payment request</source> <translation>Öppna en mincoin: URI eller betalningsbegäran</translation> </message> <message> <source>&amp;Command-line options</source> <translation>&amp;Kommandoradsalternativ</translation> </message> <message numerus="yes"> <source>%n active connection(s) to Mincoin network</source> <translation><numerusform>%n aktiva anslutningar till Mincoin-nätverket.</numerusform><numerusform>%n aktiva anslutningar till Mincoin-nätverket.</numerusform></translation> </message> <message> <source>Indexing blocks on disk...</source> <translation>Indexerar block på disken...</translation> </message> <message> <source>Processing blocks on disk...</source> <translation>Bearbetar block på disken...</translation> </message> <message numerus="yes"> <source>Processed %n block(s) of transaction history.</source> <translation><numerusform>Bearbetade %n block av transaktionshistoriken.</numerusform><numerusform>Bearbetade %n block av transaktionshistoriken.</numerusform></translation> </message> <message> <source>%1 behind</source> <translation>%1 efter</translation> </message> <message> <source>Last received block was generated %1 ago.</source> <translation>Senast mottagna block genererades för %1 sen.</translation> </message> <message> <source>Transactions after this will not yet be visible.</source> <translation>Transaktioner efter denna kommer inte ännu vara synliga.</translation> </message> <message> <source>Error</source> <translation>Fel</translation> </message> <message> <source>Warning</source> <translation>Varning</translation> </message> <message> <source>Information</source> <translation>Information</translation> </message> <message> <source>Up to date</source> <translation>Uppdaterad</translation> </message> <message> <source>Show the %1 help message to get a list with possible Mincoin command-line options</source> <translation>Visa %1 hjälpmeddelande för att få en lista med möjliga Mincoin kommandoradsalternativ.</translation> </message> <message> <source>%1 client</source> <translation>%1-klient</translation> </message> <message> <source>Connecting to peers...</source> <translation>Ansluter till noder...</translation> </message> <message> <source>Catching up...</source> <translation>Hämtar senaste...</translation> </message> <message> <source>Date: %1 </source> <translation>Datum: %1 </translation> </message> <message> <source>Amount: %1 </source> <translation>Belopp: %1 </translation> </message> <message> <source>Type: %1 </source> <translation>Typ: %1 </translation> </message> <message> <source>Label: %1 </source> <translation>Etikett: %1 </translation> </message> <message> <source>Address: %1 </source> <translation>Adress: %1 </translation> </message> <message> <source>Sent transaction</source> <translation>Transaktion skickad</translation> </message> <message> <source>Incoming transaction</source> <translation>Inkommande transaktion</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Denna plånbok är &lt;b&gt;krypterad&lt;/b&gt; och för närvarande &lt;b&gt;olåst&lt;/b&gt;</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Denna plånbok är &lt;b&gt;krypterad&lt;/b&gt; och för närvarande &lt;b&gt;låst&lt;/b&gt;</translation> </message> <message> <source>A fatal error occurred. Mincoin can no longer continue safely and will quit.</source> <translation>Ett kritiskt fel uppstod. Mincoin kan inte fortsätta att köra säkert och kommer att avslutas.</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <source>Coin Selection</source> <translation>Myntval</translation> </message> <message> <source>Quantity:</source> <translation>Kvantitet:</translation> </message> <message> <source>Bytes:</source> <translation>Antal byte:</translation> </message> <message> <source>Amount:</source> <translation>Belopp:</translation> </message> <message> <source>Fee:</source> <translation>Avgift:</translation> </message> <message> <source>Dust:</source> <translation>Damm:</translation> </message> <message> <source>After Fee:</source> <translation>Efter avgift:</translation> </message> <message> <source>Change:</source> <translation>Växel:</translation> </message> <message> <source>(un)select all</source> <translation>(av)markera allt</translation> </message> <message> <source>Tree mode</source> <translation>Trädvy</translation> </message> <message> <source>List mode</source> <translation>Listvy</translation> </message> <message> <source>Amount</source> <translation>Mängd</translation> </message> <message> <source>Received with label</source> <translation>Mottagen med etikett</translation> </message> <message> <source>Received with address</source> <translation>Mottagen med adress</translation> </message> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Confirmations</source> <translation>Bekräftelser</translation> </message> <message> <source>Confirmed</source> <translation>Bekräftad</translation> </message> <message> <source>Copy address</source> <translation>Kopiera adress</translation> </message> <message> <source>Copy label</source> <translation>Kopiera etikett</translation> </message> <message> <source>Copy amount</source> <translation>Kopiera belopp</translation> </message> <message> <source>Copy transaction ID</source> <translation>Kopiera transaktions-ID</translation> </message> <message> <source>yes</source> <translation>ja</translation> </message> <message> <source>no</source> <translation>nej</translation> </message> <message> <source>(no label)</source> <translation>(Ingen etikett)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <source>Edit Address</source> <translation>Redigera adress</translation> </message> <message> <source>&amp;Label</source> <translation>&amp;Etikett</translation> </message> <message> <source>The label associated with this address list entry</source> <translation>Etiketten associerad med denna adresslistas post</translation> </message> <message> <source>The address associated with this address list entry. This can only be modified for sending addresses.</source> <translation>Adressen associerad med denna adresslistas post. Detta kan bara ändras för sändningsadresser.</translation> </message> <message> <source>&amp;Address</source> <translation>&amp;Adress</translation> </message> <message> <source>Could not unlock wallet.</source> <translation>Kunde inte låsa upp plånboken.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <source>A new data directory will be created.</source> <translation>En ny datakatalog kommer att skapas.</translation> </message> <message> <source>name</source> <translation>namn</translation> </message> <message> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation>Katalogen finns redan. Lägg till %1 om du vill skapa en ny katalog här.</translation> </message> <message> <source>Path already exists, and is not a directory.</source> <translation>Sökvägen finns redan, och är inte en katalog.</translation> </message> <message> <source>Cannot create data directory here.</source> <translation>Kan inte skapa datakatalog här.</translation> </message> </context> <context> <name>HelpMessageDialog</name> <message> <source>version</source> <translation>version</translation> </message> <message> <source>(%1-bit)</source> <translation>(%1-bit)</translation> </message> <message> <source>About %1</source> <translation>Om %1</translation> </message> <message> <source>Command-line options</source> <translation>Kommandoradsalternativ</translation> </message> <message> <source>Usage:</source> <translation>Användning:</translation> </message> <message> <source>command-line options</source> <translation>kommandoradsalternativ</translation> </message> <message> <source>UI Options:</source> <translation>UI-inställningar:</translation> </message> <message> <source>Choose data directory on startup (default: %u)</source> <translation>Välj datakatalog vid uppstart (standard: %u)</translation> </message> <message> <source>Set language, for example "de_DE" (default: system locale)</source> <translation>Ange språk, till exempel "de_DE" (standard: systemspråk)</translation> </message> <message> <source>Start minimized</source> <translation>Starta minimerad</translation> </message> <message> <source>Set SSL root certificates for payment request (default: -system-)</source> <translation>Ange SSL rotcertifikat för betalningsansökan (standard: -system-)</translation> </message> <message> <source>Show splash screen on startup (default: %u)</source> <translation>Visa startbild vid uppstart (standard: %u)</translation> </message> <message> <source>Reset all settings changed in the GUI</source> <translation>Återställ alla inställningar som gjorts i GUI</translation> </message> </context> <context> <name>Intro</name> <message> <source>Welcome</source> <translation>Välkommen</translation> </message> <message> <source>Welcome to %1.</source> <translation>Välkommen till %1.</translation> </message> <message> <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source> <translation>Eftersom detta är första gången programmet startas får du välja var %1 skall lagra sitt data.</translation> </message> <message> <source>%1 will download and store a copy of the Mincoin block chain. At least %2GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> <translation>%1 kommer att ladda ner och spara en kopia av Mincoin blockkedjan. Åtminstone %2GB av data kommer att sparas i denna katalog, och den kommer att växa över tiden. Plånboken kommer också att sparas i denna katalog.</translation> </message> <message> <source>Use the default data directory</source> <translation>Använd den förvalda datakatalogen</translation> </message> <message> <source>Use a custom data directory:</source> <translation>Använd en anpassad datakatalog:</translation> </message> <message> <source>Error: Specified data directory "%1" cannot be created.</source> <translation>Fel: Den angivna datakatalogen "%1" kan inte skapas.</translation> </message> <message> <source>Error</source> <translation>Fel</translation> </message> <message numerus="yes"> <source>%n GB of free space available</source> <translation><numerusform>%n GB fritt utrymme kvar</numerusform><numerusform>%n GB fritt utrymme kvar</numerusform></translation> </message> <message numerus="yes"> <source>(of %n GB needed)</source> <translation><numerusform>(av %n GB behövs)</numerusform><numerusform>(av %n GB behövs)</numerusform></translation> </message> </context> <context> <name>ModalOverlay</name> <message> <source>Form</source> <translation>Formulär</translation> </message> <message> <source>Number of blocks left</source> <translation>Antal block kvar</translation> </message> <message> <source>Unknown...</source> <translation>Okänt...</translation> </message> <message> <source>Last block time</source> <translation>Sista blocktid</translation> </message> <message> <source>Progress</source> <translation>Förlopp</translation> </message> <message> <source>calculating...</source> <translation>beräknar...</translation> </message> <message> <source>Hide</source> <translation>Göm</translation> </message> <message> <source>Unknown. Syncing Headers (%1)...</source> <translation>Okänd. Synkar huvuden (%1)...</translation> </message> </context> <context> <name>OpenURIDialog</name> <message> <source>Open URI</source> <translation>Öppna URI</translation> </message> <message> <source>Open payment request from URI or file</source> <translation>Öppna betalningsbegäran från URI eller fil</translation> </message> <message> <source>URI:</source> <translation>URI:</translation> </message> <message> <source>Select payment request file</source> <translation>Välj betalningsbegäransfil</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <source>Options</source> <translation>Alternativ</translation> </message> <message> <source>&amp;Main</source> <translation>&amp;Allmänt</translation> </message> <message> <source>Automatically start %1 after logging in to the system.</source> <translation>Starta %1 automatiskt efter inloggningen.</translation> </message> <message> <source>&amp;Start %1 on system login</source> <translation>&amp;Starta %1 vid systemlogin</translation> </message> <message> <source>Size of &amp;database cache</source> <translation>Storleken på &amp;databascache</translation> </message> <message> <source>MB</source> <translation>MB</translation> </message> <message> <source>Number of script &amp;verification threads</source> <translation>Antalet skript&amp;verifikationstrådar</translation> </message> <message> <source>Accept connections from outside</source> <translation>Acceptera anslutningar utifrån</translation> </message> <message> <source>Allow incoming connections</source> <translation>Acceptera inkommande anslutningar</translation> </message> <message> <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> <translation>Proxyns IP-adress (t.ex. IPv4: 127.0.0.1 / IPv6: ::1)</translation> </message> <message> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source> <translation>Minimera istället för att stänga programmet när fönstret stängs. När detta alternativ är aktiverat stängs programmet endast genom att välja Stäng i menyn.</translation> </message> <message> <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source> <translation>Tredjeparts URL:er (t.ex. en blockutforskare) som finns i transaktionstabben som ett menyval i sammanhanget. %s i URL:en ersätts med tansaktionshashen. Flera URL:er är separerade med vertikala streck |.</translation> </message> <message> <source>Third party transaction URLs</source> <translation>Tredjeparts transaktions-URL:er</translation> </message> <message> <source>Active command-line options that override above options:</source> <translation>Aktiva kommandoradsalternativ som ersätter alternativen ovan:</translation> </message> <message> <source>Reset all client options to default.</source> <translation>Återställ alla klientinställningar till förvalen.</translation> </message> <message> <source>&amp;Reset Options</source> <translation>&amp;Återställ alternativ</translation> </message> <message> <source>&amp;Network</source> <translation>&amp;Nätverk</translation> </message> <message> <source>(0 = auto, &lt;0 = leave that many cores free)</source> <translation>(0 = auto, &lt;0 = lämna så många kärnor lediga)</translation> </message> <message> <source>W&amp;allet</source> <translation>&amp;Plånbok</translation> </message> <message> <source>Expert</source> <translation>Expert</translation> </message> <message> <source>Enable coin &amp;control features</source> <translation>Aktivera mynt&amp;kontrollfunktioner</translation> </message> <message> <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source> <translation>Om du avaktiverar betalning med obekräftad växel, kan inte växeln från en transaktion användas förrän den transaktionen har minst en bekräftelse.</translation> </message> <message> <source>&amp;Spend unconfirmed change</source> <translation>&amp;Spendera obekräftad växel</translation> </message> <message> <source>Automatically open the Mincoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Öppna automatiskt Mincoin-klientens port på routern. Detta fungerar endast om din router har UPnP aktiverat.</translation> </message> <message> <source>Map port using &amp;UPnP</source> <translation>Tilldela port med hjälp av &amp;UPnP</translation> </message> <message> <source>Connect to the Mincoin network through a SOCKS5 proxy.</source> <translation>Anslut till Mincoin-nätverket genom en SOCKS5-proxy.</translation> </message> <message> <source>&amp;Connect through SOCKS5 proxy (default proxy):</source> <translation>&amp;Anslut genom SOCKS5-proxy (förvald proxy):</translation> </message> <message> <source>Proxy &amp;IP:</source> <translation>Proxy-&amp;IP: </translation> </message> <message> <source>&amp;Port:</source> <translation>&amp;Port: </translation> </message> <message> <source>Port of the proxy (e.g. 9050)</source> <translation>Proxyns port (t.ex. 9050)</translation> </message> <message> <source>Used for reaching peers via:</source> <translation>Används för att nå noder via:</translation> </message> <message> <source>Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source> <translation>Visas, om den angivna standard-SOCKS5-proxyn används för att nå noder via den här nätverkstypen.</translation> </message> <message> <source>IPv4</source> <translation>IPv4</translation> </message> <message> <source>IPv6</source> <translation>IPv6</translation> </message> <message> <source>Tor</source> <translation>Tor</translation> </message> <message> <source>Connect to the Mincoin network through a separate SOCKS5 proxy for Tor hidden services.</source> <translation>Anslut till Mincoin-nätverket genom en separat SOCKS5-proxy för dolda tjänster i Tor.</translation> </message> <message> <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services:</source> <translation>Använd separat SOCKS5-proxy för att nå noder via dolda tjänster i Tor:</translation> </message> <message> <source>&amp;Window</source> <translation>&amp;Fönster</translation> </message> <message> <source>&amp;Hide the icon from the system tray.</source> <translation>&amp;Göm ikonen från systemfältet.</translation> </message> <message> <source>Hide tray icon</source> <translation>Göm systemfältsikonen</translation> </message> <message> <source>Show only a tray icon after minimizing the window.</source> <translation>Visa endast en systemfältsikon vid minimering.</translation> </message> <message> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimera till systemfältet istället för aktivitetsfältet</translation> </message> <message> <source>M&amp;inimize on close</source> <translation>M&amp;inimera vid stängning</translation> </message> <message> <source>&amp;Display</source> <translation>&amp;Visa</translation> </message> <message> <source>User Interface &amp;language:</source> <translation>Användargränssnittets &amp;språk: </translation> </message> <message> <source>The user interface language can be set here. This setting will take effect after restarting %1.</source> <translation>Användargränssnittets språk kan ställas in här. Denna inställning träder i kraft efter en omstart av %1.</translation> </message> <message> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Måttenhet att visa belopp i: </translation> </message> <message> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Välj en måttenhet att visa i gränssnittet och när du skickar mynt.</translation> </message> <message> <source>Whether to show coin control features or not.</source> <translation>Om myntkontrollfunktioner skall visas eller inte</translation> </message> <message> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <source>&amp;Cancel</source> <translation>&amp;Avbryt</translation> </message> <message> <source>default</source> <translation>standard</translation> </message> <message> <source>none</source> <translation>ingen</translation> </message> <message> <source>Confirm options reset</source> <translation>Bekräfta att alternativen ska återställs</translation> </message> <message> <source>Client restart required to activate changes.</source> <translation>Klientomstart är nödvändig för att aktivera ändringarna.</translation> </message> <message> <source>Client will be shut down. Do you want to proceed?</source> <translation>Programmet kommer att stängas. Vill du fortsätta?</translation> </message> <message> <source>This change would require a client restart.</source> <translation>Denna ändring kräver en klientomstart.</translation> </message> <message> <source>The supplied proxy address is invalid.</source> <translation>Den angivna proxy-adressen är ogiltig.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <source>Form</source> <translation>Formulär</translation> </message> <message> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Mincoin network after a connection is established, but this process has not completed yet.</source> <translation>Den visade informationen kan vara inaktuell. Plånboken synkroniseras automatiskt med Mincoin-nätverket efter att anslutningen är upprättad, men denna process har inte slutförts ännu.</translation> </message> <message> <source>Watch-only:</source> <translation>Granska-bara:</translation> </message> <message> <source>Available:</source> <translation>Tillgängligt:</translation> </message> <message> <source>Your current spendable balance</source> <translation>Ditt tillgängliga saldo</translation> </message> <message> <source>Pending:</source> <translation>Pågående:</translation> </message> <message> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation>Totalt antal transaktioner som ännu inte bekräftats, och som ännu inte räknas med i aktuellt saldo</translation> </message> <message> <source>Immature:</source> <translation>Omogen:</translation> </message> <message> <source>Mined balance that has not yet matured</source> <translation>Den genererade balansen som ännu inte har mognat</translation> </message> <message> <source>Balances</source> <translation>Balanser</translation> </message> <message> <source>Total:</source> <translation>Totalt:</translation> </message> <message> <source>Your current total balance</source> <translation>Ditt nuvarande totala saldo</translation> </message> <message> <source>Your current balance in watch-only addresses</source> <translation>Ditt nuvarande saldo i granska-bara adresser</translation> </message> <message> <source>Spendable:</source> <translation>Spenderbar:</translation> </message> <message> <source>Recent transactions</source> <translation>Nyligen genomförda transaktioner</translation> </message> <message> <source>Unconfirmed transactions to watch-only addresses</source> <translation>Okonfirmerade transaktioner till granska-bara adresser</translation> </message> <message> <source>Mined balance in watch-only addresses that has not yet matured</source> <translation>Den genererade balansen i granska-bara adresser som ännu inte har mognat</translation> </message> <message> <source>Current total balance in watch-only addresses</source> <translation>Nuvarande total balans i granska-bara adresser</translation> </message> </context> <context> <name>PaymentServer</name> <message> <source>URI handling</source> <translation>URI-hantering</translation> </message> <message> <source>Refund from %1</source> <translation>Återbetalning från %1</translation> </message> <message> <source>Bad response from server %1</source> <translation>Felaktigt svar från server %1</translation> </message> </context> <context> <name>PeerTableModel</name> <message> <source>User Agent</source> <translation>Användaragent</translation> </message> <message> <source>Node/Service</source> <translation>Nod/Tjänst</translation> </message> <message> <source>Ping</source> <translation>Ping</translation> </message> </context> <context> <name>QObject</name> <message> <source>Amount</source> <translation>Mängd</translation> </message> <message> <source>Enter a Mincoin address (e.g. %1)</source> <translation>Ange en Mincoin-adress (t.ex. %1)</translation> </message> <message> <source>%1 d</source> <translation>%1 d</translation> </message> <message> <source>%1 h</source> <translation>%1 h</translation> </message> <message> <source>%1 m</source> <translation>%1 m</translation> </message> <message> <source>%1 s</source> <translation>%1 s</translation> </message> <message> <source>None</source> <translation>Ingen</translation> </message> <message> <source>N/A</source> <translation>ej tillgänglig</translation> </message> <message> <source>%1 ms</source> <translation>%1 ms</translation> </message> <message numerus="yes"> <source>%n second(s)</source> <translation><numerusform>%n sekund</numerusform><numerusform>%n sekunder</numerusform></translation> </message> <message numerus="yes"> <source>%n minute(s)</source> <translation><numerusform>%n minut</numerusform><numerusform>%n minuter</numerusform></translation> </message> <message numerus="yes"> <source>%n hour(s)</source> <translation><numerusform>%n timme</numerusform><numerusform>%n timmar</numerusform></translation> </message> <message numerus="yes"> <source>%n day(s)</source> <translation><numerusform>%n dag</numerusform><numerusform>%n dagar</numerusform></translation> </message> <message numerus="yes"> <source>%n week(s)</source> <translation><numerusform>%n vecka</numerusform><numerusform>%n veckor</numerusform></translation> </message> <message> <source>%1 and %2</source> <translation>%1 och %2</translation> </message> <message numerus="yes"> <source>%n year(s)</source> <translation><numerusform>%n år</numerusform><numerusform>%n år</numerusform></translation> </message> </context> <context> <name>QObject::QObject</name> <message> <source>Error: %1</source> <translation>Fel: %1</translation> </message> </context> <context> <name>QRImageWidget</name> </context> <context> <name>RPCConsole</name> <message> <source>N/A</source> <translation>ej tillgänglig</translation> </message> <message> <source>Client version</source> <translation>Klient-version</translation> </message> <message> <source>&amp;Information</source> <translation>&amp;Information</translation> </message> <message> <source>Debug window</source> <translation>Debug fönster</translation> </message> <message> <source>General</source> <translation>Generell</translation> </message> <message> <source>Using BerkeleyDB version</source> <translation>Använder BerkeleyDB versionen</translation> </message> <message> <source>Datadir</source> <translation>Datakatalog</translation> </message> <message> <source>Startup time</source> <translation>Uppstartstid</translation> </message> <message> <source>Network</source> <translation>Nätverk</translation> </message> <message> <source>Name</source> <translation>Namn</translation> </message> <message> <source>Number of connections</source> <translation>Antalet anslutningar</translation> </message> <message> <source>Block chain</source> <translation>Blockkedja</translation> </message> <message> <source>Current number of blocks</source> <translation>Aktuellt antal block</translation> </message> <message> <source>Memory Pool</source> <translation>Minnespool</translation> </message> <message> <source>Current number of transactions</source> <translation>Nuvarande antal transaktioner</translation> </message> <message> <source>Memory usage</source> <translation>Minnesåtgång</translation> </message> <message> <source>Received</source> <translation>Mottagen</translation> </message> <message> <source>Sent</source> <translation>Skickad</translation> </message> <message> <source>&amp;Peers</source> <translation>&amp;Klienter</translation> </message> <message> <source>Banned peers</source> <translation>Bannade noder</translation> </message> <message> <source>Select a peer to view detailed information.</source> <translation>Välj en klient för att se detaljerad information.</translation> </message> <message> <source>Whitelisted</source> <translation>Vitlistad</translation> </message> <message> <source>Direction</source> <translation>Riktning</translation> </message> <message> <source>Version</source> <translation>Version</translation> </message> <message> <source>Starting Block</source> <translation>Startblock</translation> </message> <message> <source>Synced Headers</source> <translation>Synkade huvuden</translation> </message> <message> <source>Synced Blocks</source> <translation>Synkade block</translation> </message> <message> <source>User Agent</source> <translation>Användaragent</translation> </message> <message> <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Öppna %1 debug-loggfilen från aktuell datakatalog. Detta kan ta några sekunder för stora loggfiler.</translation> </message> <message> <source>Decrease font size</source> <translation>Minska fontstorleken</translation> </message> <message> <source>Increase font size</source> <translation>Öka fontstorleken</translation> </message> <message> <source>Services</source> <translation>Tjänster</translation> </message> <message> <source>Ban Score</source> <translation>Banpoäng</translation> </message> <message> <source>Connection Time</source> <translation>Anslutningstid</translation> </message> <message> <source>Last Send</source> <translation>Senast sänt</translation> </message> <message> <source>Last Receive</source> <translation>Senast mottagen</translation> </message> <message> <source>Ping Time</source> <translation>Pingtid</translation> </message> <message> <source>The duration of a currently outstanding ping.</source> <translation>Tidsåtgången för en nuvarande utestående ping.</translation> </message> <message> <source>Ping Wait</source> <translation>Pingväntetid</translation> </message> <message> <source>Time Offset</source> <translation>Tidsförskjutning</translation> </message> <message> <source>Last block time</source> <translation>Sista blocktid</translation> </message> <message> <source>&amp;Open</source> <translation>&amp;Öppna</translation> </message> <message> <source>&amp;Console</source> <translation>&amp;Konsol</translation> </message> <message> <source>&amp;Network Traffic</source> <translation>&amp;Nätverkstrafik</translation> </message> <message> <source>&amp;Clear</source> <translation>&amp;Rensa</translation> </message> <message> <source>Totals</source> <translation>Totalt:</translation> </message> <message> <source>In:</source> <translation>In:</translation> </message> <message> <source>Out:</source> <translation>Ut:</translation> </message> <message> <source>Debug log file</source> <translation>Debugloggfil</translation> </message> <message> <source>Clear console</source> <translation>Rensa konsollen</translation> </message> <message> <source>1 &amp;hour</source> <translation>1 &amp;timme</translation> </message> <message> <source>1 &amp;day</source> <translation>1 &amp;dag</translation> </message> <message> <source>1 &amp;week</source> <translation>1 &amp;vecka</translation> </message> <message> <source>1 &amp;year</source> <translation>1 &amp;år</translation> </message> <message> <source>Welcome to the %1 RPC console.</source> <translation>Välkommen till %1 RPC-konsolen.</translation> </message> <message> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Använd upp- och ner-pilarna för att navigera i historiken, och &lt;b&gt;Ctrl-L&lt;/b&gt; för att rensa skärmen.</translation> </message> <message> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Skriv &lt;b&gt;help&lt;/b&gt; för en översikt av alla kommandon.</translation> </message> <message> <source>%1 B</source> <translation>%1 B</translation> </message> <message> <source>%1 KB</source> <translation>%1 KB</translation> </message> <message> <source>%1 MB</source> <translation>%1 MB</translation> </message> <message> <source>%1 GB</source> <translation>%1 GB</translation> </message> <message> <source>(node id: %1)</source> <translation>(nod-id: %1)</translation> </message> <message> <source>via %1</source> <translation>via %1</translation> </message> <message> <source>never</source> <translation>aldrig</translation> </message> <message> <source>Inbound</source> <translation>Inkommande</translation> </message> <message> <source>Outbound</source> <translation>Utgående</translation> </message> <message> <source>Yes</source> <translation>Ja</translation> </message> <message> <source>No</source> <translation>Nej</translation> </message> <message> <source>Unknown</source> <translation>Okänd</translation> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <source>&amp;Amount:</source> <translation>&amp;Belopp:</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Etikett:</translation> </message> <message> <source>&amp;Message:</source> <translation>&amp;Meddelande:</translation> </message> <message> <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source> <translation>Återanvänd en av tidigare använda mottagningsadresser. Återanvändning av adresser har både säkerhets och integritetsbrister. Använd inte samma mottagningsadress om du inte gör om samma betalningsbegäran.</translation> </message> <message> <source>R&amp;euse an existing receiving address (not recommended)</source> <translation>Åt&amp;eranvänd en existerande mottagningsadress (rekommenderas inte)</translation> </message> <message> <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Mincoin network.</source> <translation>Ett frivilligt meddelande att bifoga betalningsbegäran, vilket visas när begäran öppnas. NB: Meddelandet kommer inte att sändas med betalningen över Mincoinnätverket.</translation> </message> <message> <source>An optional label to associate with the new receiving address.</source> <translation>En frivillig etikett att associera med den nya mottagningsadressen.</translation> </message> <message> <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source> <translation>Använd detta formulär för att begära betalningar. Alla fält är &lt;b&gt;frivilliga&lt;/b&gt;.</translation> </message> <message> <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation>En valfri summa att begära. Lämna denna tom eller noll för att inte begära en specifik summa.</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Rensa alla formulärfälten</translation> </message> <message> <source>Clear</source> <translation>Rensa</translation> </message> <message> <source>Requested payments history</source> <translation>Historik för begärda betalningar</translation> </message> <message> <source>&amp;Request payment</source> <translation>Begä&amp;r betalning</translation> </message> <message> <source>Show the selected request (does the same as double clicking an entry)</source> <translation>Visa valda begäranden (gör samma som att dubbelklicka på en post)</translation> </message> <message> <source>Show</source> <translation>Visa</translation> </message> <message> <source>Remove the selected entries from the list</source> <translation>Ta bort valda poster från listan</translation> </message> <message> <source>Remove</source> <translation>Ta bort</translation> </message> <message> <source>Copy URI</source> <translation>Kopiera URI</translation> </message> <message> <source>Copy label</source> <translation>Kopiera etikett</translation> </message> <message> <source>Copy message</source> <translation>Kopiera meddelande</translation> </message> <message> <source>Copy amount</source> <translation>Kopiera belopp</translation> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <source>QR Code</source> <translation>QR-kod</translation> </message> <message> <source>Copy &amp;URI</source> <translation>Kopiera &amp;URI</translation> </message> <message> <source>Copy &amp;Address</source> <translation>Kopiera &amp;Adress</translation> </message> <message> <source>&amp;Save Image...</source> <translation>&amp;Spara Bild...</translation> </message> <message> <source>Payment information</source> <translation>Betalinformaton</translation> </message> <message> <source>URI</source> <translation>URI</translation> </message> <message> <source>Address</source> <translation>Adress</translation> </message> <message> <source>Label</source> <translation>Etikett</translation> </message> <message> <source>Message</source> <translation>Meddelande</translation> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Label</source> <translation>Etikett</translation> </message> <message> <source>Message</source> <translation>Meddelande</translation> </message> <message> <source>(no label)</source> <translation>(Ingen etikett)</translation> </message> <message> <source>(no message)</source> <translation>(inget meddelande)</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation>Skicka pengar</translation> </message> <message> <source>Coin Control Features</source> <translation>Myntkontrollfunktioner</translation> </message> <message> <source>Inputs...</source> <translation>Inmatningar...</translation> </message> <message> <source>automatically selected</source> <translation>automatiskt vald</translation> </message> <message> <source>Insufficient funds!</source> <translation>Otillräckliga medel!</translation> </message> <message> <source>Quantity:</source> <translation>Kvantitet:</translation> </message> <message> <source>Bytes:</source> <translation>Antal Byte:</translation> </message> <message> <source>Amount:</source> <translation>Belopp:</translation> </message> <message> <source>Fee:</source> <translation>Avgift:</translation> </message> <message> <source>After Fee:</source> <translation>Efter avgift:</translation> </message> <message> <source>Change:</source> <translation>Växel:</translation> </message> <message> <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> <translation>Om denna är aktiverad men växeladressen är tom eller felaktig kommer växeln att sändas till en nygenererad adress.</translation> </message> <message> <source>Custom change address</source> <translation>Specialväxeladress</translation> </message> <message> <source>Transaction Fee:</source> <translation>Transaktionsavgift:</translation> </message> <message> <source>Choose...</source> <translation>Välj...</translation> </message> <message> <source>collapse fee-settings</source> <translation>Fäll ihop avgiftsinställningarna</translation> </message> <message> <source>per kilobyte</source> <translation>per kilobyte</translation> </message> <message> <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source> <translation>Om den anpassad avgiften är satt till 1000 satoshi och transaktionen bara är 250 byte, betalar "per kilobyte" bara 250 satoshi i avgift, medans "totalt minst" betalar 1000 satoshi. För transaktioner större än en kilobyte betalar både per kilobyte.</translation> </message> <message> <source>Hide</source> <translation>Göm</translation> </message> <message> <source>total at least</source> <translation>totalt minst</translation> </message> <message> <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for mincoin transactions than the network can process.</source> <translation>Att betala endast den minsta avgiften är bara bra så länge det är mindre transaktionsvolym än utrymme i blocken. Men tänk på att det kan hamna i en aldrig bekräftar transaktion när det finns mer efterfrågan på mincoin transaktioner än nätverket kan bearbeta.</translation> </message> <message> <source>(read the tooltip)</source> <translation>(läs verktygstips)</translation> </message> <message> <source>Recommended:</source> <translation>Rekommenderad:</translation> </message> <message> <source>Custom:</source> <translation>Anpassad:</translation> </message> <message> <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source> <translation>(Smartavgiften är inte initierad än. Detta tar vanligen några block...)</translation> </message> <message> <source>normal</source> <translation>normal</translation> </message> <message> <source>fast</source> <translation>snabb</translation> </message> <message> <source>Send to multiple recipients at once</source> <translation>Skicka till flera mottagare samtidigt</translation> </message> <message> <source>Add &amp;Recipient</source> <translation>Lägg till &amp;mottagare</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Rensa alla formulärfälten</translation> </message> <message> <source>Dust:</source> <translation>Damm:</translation> </message> <message> <source>Clear &amp;All</source> <translation>Rensa &amp;alla</translation> </message> <message> <source>Balance:</source> <translation>Balans:</translation> </message> <message> <source>Confirm the send action</source> <translation>Bekräfta sändordern</translation> </message> <message> <source>S&amp;end</source> <translation>&amp;Skicka</translation> </message> <message> <source>Copy amount</source> <translation>Kopiera belopp</translation> </message> <message> <source>%1 to %2</source> <translation>%1 till %2</translation> </message> <message> <source>or</source> <translation>eller</translation> </message> <message numerus="yes"> <source>%n block(s)</source> <translation><numerusform>%n block</numerusform><numerusform>%n block</numerusform></translation> </message> <message> <source>(no label)</source> <translation>(Ingen etikett)</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <source>A&amp;mount:</source> <translation>&amp;Belopp:</translation> </message> <message> <source>Pay &amp;To:</source> <translation>Betala &amp;Till:</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Etikett:</translation> </message> <message> <source>Choose previously used address</source> <translation>Välj tidigare använda adresser</translation> </message> <message> <source>This is a normal payment.</source> <translation>Detta är en normal betalning.</translation> </message> <message> <source>The Mincoin address to send the payment to</source> <translation>Mincoinadress att sända betalning till</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Klistra in adress från Urklipp</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Remove this entry</source> <translation>Radera denna post</translation> </message> <message> <source>The fee will be deducted from the amount being sent. The recipient will receive less mincoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source> <translation>Avgiften dras från beloppet som skickas. Mottagaren kommer att få mindre mincoins än du angivit i belopp-fältet. Om flera mottagare valts kommer avgiften delas jämt.</translation> </message> <message> <source>S&amp;ubtract fee from amount</source> <translation>S&amp;ubtrahera avgiften från beloppet</translation> </message> <message> <source>Message:</source> <translation>Meddelande:</translation> </message> <message> <source>This is an unauthenticated payment request.</source> <translation>Detta är en oautentiserad betalningsbegäran.</translation> </message> <message> <source>This is an authenticated payment request.</source> <translation>Detta är en autentiserad betalningsbegäran.</translation> </message> <message> <source>Enter a label for this address to add it to the list of used addresses</source> <translation>Ange en etikett för denna adress att adderas till listan över använda adresser</translation> </message> <message> <source>A message that was attached to the mincoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Mincoin network.</source> <translation>Ett meddelande som bifogades mincoin-URI, vilket lagras med transaktionen som referens. NB: Meddelandet kommer inte att sändas över Mincoinnätverket.</translation> </message> <message> <source>Pay To:</source> <translation>Betala Till:</translation> </message> <message> <source>Memo:</source> <translation>PM:</translation> </message> </context> <context> <name>SendConfirmationDialog</name> <message> <source>Yes</source> <translation>Ja</translation> </message> </context> <context> <name>ShutdownWindow</name> <message> <source>%1 is shutting down...</source> <translation>%1 stängs av...</translation> </message> <message> <source>Do not shut down the computer until this window disappears.</source> <translation>Stäng inte av datorn förrän denna ruta försvinner.</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <source>Signatures - Sign / Verify a Message</source> <translation>Signaturer - Signera / Verifiera ett Meddelande</translation> </message> <message> <source>&amp;Sign Message</source> <translation>&amp;Signera Meddelande</translation> </message> <message> <source>You can sign messages/agreements with your addresses to prove you can receive mincoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Du kan underteckna meddelanden/avtal med dina adresser för att bevisa att du kan ta emot mincoins som skickats till dem. Var försiktig så du inte undertecknar något oklart eller konstigt, eftersom phishing-angrepp kan försöka få dig att underteckna din identitet till dem. Underteckna endast väldetaljerade meddelanden som du godkänner.</translation> </message> <message> <source>The Mincoin address to sign the message with</source> <translation>Mincoinadress att signera meddelandet med</translation> </message> <message> <source>Choose previously used address</source> <translation>Välj tidigare använda adresser</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Klistra in adress från Urklipp</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Enter the message you want to sign here</source> <translation>Skriv in meddelandet du vill signera här</translation> </message> <message> <source>Signature</source> <translation>Signatur</translation> </message> <message> <source>Copy the current signature to the system clipboard</source> <translation>Kopiera signaturen till systemets Urklipp</translation> </message> <message> <source>Sign the message to prove you own this Mincoin address</source> <translation>Signera meddelandet för att bevisa att du äger denna adress</translation> </message> <message> <source>Sign &amp;Message</source> <translation>Signera &amp;Meddelande</translation> </message> <message> <source>Reset all sign message fields</source> <translation>Rensa alla fält</translation> </message> <message> <source>Clear &amp;All</source> <translation>Rensa &amp;alla</translation> </message> <message> <source>&amp;Verify Message</source> <translation>&amp;Verifiera Meddelande</translation> </message> <message> <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source> <translation>Ange mottagarens adress, meddelande (kopiera radbrytningar, mellanrum, flikar, etc. exakt) och signatur nedan för att verifiera meddelandet. Undvik att läsa in mera information i signaturen än vad som stod i själva undertecknade meddelandet, för att undvika ett man-in-the-middle-angrepp. Notera att detta endast bevisar att undertecknad tar emot med adressen, det bevisar inte vem som skickat transaktionen!</translation> </message> <message> <source>The Mincoin address the message was signed with</source> <translation>Mincoinadressen som meddelandet signerades med</translation> </message> <message> <source>Verify the message to ensure it was signed with the specified Mincoin address</source> <translation>Verifiera meddelandet för att vara säker på att den var signerad med den angivna Mincoin-adressen</translation> </message> <message> <source>Verify &amp;Message</source> <translation>Verifiera &amp;Meddelande</translation> </message> <message> <source>Reset all verify message fields</source> <translation>Rensa alla fält</translation> </message> <message> <source>Message signed.</source> <translation>Meddelande signerat.</translation> </message> <message> <source>The signature could not be decoded.</source> <translation>Signaturen kunde inte avkodas.</translation> </message> <message> <source>Message verified.</source> <translation>Meddelande verifierat.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <source>KB/s</source> <translation>KB/s</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <source>Status</source> <translation>Status</translation> </message> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Message</source> <translation>Meddelande</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <source>This pane shows a detailed description of the transaction</source> <translation>Den här panelen visar en detaljerad beskrivning av transaktionen</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Label</source> <translation>Etikett</translation> </message> <message> <source>(no label)</source> <translation>(Ingen etikett)</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>Enter address or label to search</source> <translation>Ange en adress eller etikett att söka efter</translation> </message> <message> <source>Min amount</source> <translation>Minsta belopp</translation> </message> <message> <source>Abandon transaction</source> <translation>Avbryt transaktionen</translation> </message> <message> <source>Copy address</source> <translation>Kopiera adress</translation> </message> <message> <source>Copy label</source> <translation>Kopiera etikett</translation> </message> <message> <source>Copy amount</source> <translation>Kopiera belopp</translation> </message> <message> <source>Copy transaction ID</source> <translation>Kopiera transaktions-ID</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Kommaseparerad fil (*.csv)</translation> </message> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Label</source> <translation>Etikett</translation> </message> <message> <source>Address</source> <translation>Adress</translation> </message> <message> <source>Exporting Failed</source> <translation>Export misslyckades</translation> </message> </context> <context> <name>UnitDisplayStatusBarControl</name> <message> <source>Unit to show amounts in. Click to select another unit.</source> <translation>&amp;Enhet att visa belopp i. Klicka för att välja annan enhet.</translation> </message> </context> <context> <name>WalletFrame</name> </context> <context> <name>WalletModel</name> </context> <context> <name>WalletView</name> </context> <context> <name>bitcoin-core</name> <message> <source>Options:</source> <translation>Inställningar:</translation> </message> <message> <source>Specify data directory</source> <translation>Ange katalog för data</translation> </message> <message> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Anslut till en nod för att hämta klientadresser, och koppla från</translation> </message> <message> <source>Specify your own public address</source> <translation>Ange din egen publika adress</translation> </message> <message> <source>Accept command line and JSON-RPC commands</source> <translation>Tillåt kommandon från kommandotolken och JSON-RPC-kommandon</translation> </message> <message> <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source> <translation>Om &lt;kategori&gt; inte anges eller om &lt;category&gt; = 1, visa all avlusningsinformation.</translation> </message> <message> <source>Prune configured below the minimum of %d MiB. Please use a higher number.</source> <translation>Beskärning konfigurerad under miniminivån %d MiB. Vänligen använd ett högre värde.</translation> </message> <message> <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source> <translation>Beskärning: sista plånbokssynkroniseringen ligger utanför beskuren data. Du måste använda -reindex (ladda ner hela blockkedjan igen eftersom noden beskurits)</translation> </message> <message> <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source> <translation>Omskanningar kan inte göras i beskuret läge. Du måste använda -reindex vilket kommer ladda ner hela blockkedjan igen.</translation> </message> <message> <source>Error: A fatal internal error occurred, see debug.log for details</source> <translation>Fel: Ett kritiskt internt fel uppstod, se debug.log för detaljer</translation> </message> <message> <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source> <translation>Avgift (i %s/kB) att lägga till på transaktioner du skickar (förvalt: %s)</translation> </message> <message> <source>Pruning blockstore...</source> <translation>Rensar blockstore...</translation> </message> <message> <source>Run in the background as a daemon and accept commands</source> <translation>Kör i bakgrunden som tjänst och acceptera kommandon</translation> </message> <message> <source>Unable to start HTTP server. See debug log for details.</source> <translation>Kunde inte starta HTTP-server. Se avlusningsloggen för detaljer.</translation> </message> <message> <source>Mincoin Core</source> <translation>Mincoin Core</translation> </message> <message> <source>The %s developers</source> <translation>%s-utvecklarna</translation> </message> <message> <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source> <translation>En avgiftskurs (i %s/kB) som används när det inte finns tillräcklig data för att uppskatta avgiften (förvalt: %s)</translation> </message> <message> <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source> <translation>Acceptera vidarebefodrade transaktioner från vitlistade noder även när transaktioner inte vidarebefodras (förvalt: %d)</translation> </message> <message> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Bind till given adress och lyssna alltid på den. Använd [värd]:port notation för IPv6</translation> </message> <message> <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source> <translation>Kan inte låsa data-mappen %s. %s körs förmodligen redan.</translation> </message> <message> <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source> <translation>Ta bort alla plånbokstransaktioner och återskapa bara dom som är en del av blockkedjan genom att ange -rescan vid uppstart</translation> </message> <message> <source>Error loading %s: You can't enable HD on a already existing non-HD wallet</source> <translation>Fel vid laddning av %s: Du kan inte aktivera HD på en existerande icke-HD plånbok</translation> </message> <message> <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Fel vid läsning av %s! Alla nycklar lästes korrekt, men transaktionsdatat eller adressbokens poster kanske saknas eller är felaktiga.</translation> </message> <message> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Exekvera kommando när en plånbokstransaktion ändras (%s i cmd är ersatt av TxID)</translation> </message> <message> <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source> <translation>Maximalt tillåten median-peer tidsoffset justering. Lokalt perspektiv av tiden kan bli påverkad av partners, framåt eller bakåt denna tidsrymd. (förvalt: %u sekunder)</translation> </message> <message> <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source> <translation>Maximal total avgift (i %s) att använda i en plånbokstransaktion eller råa transaktioner. Sätts denna för lågt kan stora transaktioner avbrytas (förvalt: %s)</translation> </message> <message> <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source> <translation>Vänligen kolla så att din dators datum och tid är korrekt! Om din klocka går fel kommer %s inte att fungera korrekt.</translation> </message> <message> <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source> <translation>Var snäll och bidra om du finner %s användbar. Besök %s för mer information om mjukvaran.</translation> </message> <message> <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source> <translation>Ange antalet skriptkontrolltrådar (%u till %d, 0 = auto, &lt;0 = lämna så många kärnor lediga, förval: %d)</translation> </message> <message> <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source> <translation>Blockdatabasen innehåller ett block som verkar vara från framtiden. Detta kan vara på grund av att din dators datum och tid är felaktiga. Bygg bara om blockdatabasen om du är säker på att datorns datum och tid är korrekt</translation> </message> <message> <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source> <translation>Kan inte spola tillbaka databasen till obeskärt läge. Du måste ladda ner blockkedjan igen</translation> </message> <message> <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source> <translation>Använd UPnP för att mappa den lyssnande porten (förvalt: 1 när lyssning aktiverat och utan -proxy)</translation> </message> <message> <source>You need to rebuild the database using -reindex-chainstate to change -txindex</source> <translation>Du måste återskapa databasen med -reindex-chainstate för att ändra -txindex</translation> </message> <message> <source>%s corrupt, salvage failed</source> <translation>%s är korrupt, räddning misslyckades</translation> </message> <message> <source>-maxmempool must be at least %d MB</source> <translation>-maxmempool måste vara minst %d MB</translation> </message> <message> <source>&lt;category&gt; can be:</source> <translation>&lt;category&gt; Kan vara:</translation> </message> <message> <source>Append comment to the user agent string</source> <translation>Lägg till kommentar till user-agent-strängen</translation> </message> <message> <source>Attempt to recover private keys from a corrupt wallet on startup</source> <translation>Försök att rädda privata nycklar från en korrupt plånbok vid uppstart</translation> </message> <message> <source>Block creation options:</source> <translation>Block skapande inställningar:</translation> </message> <message> <source>Cannot resolve -%s address: '%s'</source> <translation>Kan inte matcha -%s adress: '%s'</translation> </message> <message> <source>Change index out of range</source> <translation>Förändringsindexet utom räckhåll</translation> </message> <message> <source>Connection options:</source> <translation>Anslutningsalternativ:</translation> </message> <message> <source>Copyright (C) %i-%i</source> <translation>Copyright (C) %i-%i</translation> </message> <message> <source>Corrupted block database detected</source> <translation>Korrupt blockdatabas har upptäckts</translation> </message> <message> <source>Debugging/Testing options:</source> <translation>Avlusnings/Test-alternativ:</translation> </message> <message> <source>Do not load the wallet and disable wallet RPC calls</source> <translation>Ladda inte plånboken och stäng av RPC-anrop till plånboken</translation> </message> <message> <source>Do you want to rebuild the block database now?</source> <translation>Vill du bygga om blockdatabasen nu?</translation> </message> <message> <source>Enable publish hash block in &lt;address&gt;</source> <translation>Aktivera publicering av hashblock i &lt;adress&gt;</translation> </message> <message> <source>Enable publish hash transaction in &lt;address&gt;</source> <translation>Aktivera publicering av hashtransaktion i &lt;adress&gt;</translation> </message> <message> <source>Enable publish raw block in &lt;address&gt;</source> <translation>Aktivera publicering av råa block i &lt;adress&gt;</translation> </message> <message> <source>Enable publish raw transaction in &lt;address&gt;</source> <translation>Aktivera publicering av råa transaktioner i &lt;adress&gt;</translation> </message> <message> <source>Enable transaction replacement in the memory pool (default: %u)</source> <translation>Aktivera byte av transaktioner i minnespoolen (förvalt: %u)</translation> </message> <message> <source>Error initializing block database</source> <translation>Fel vid initiering av blockdatabasen</translation> </message> <message> <source>Error initializing wallet database environment %s!</source> <translation>Fel vid initiering av plånbokens databasmiljö %s!</translation> </message> <message> <source>Error loading %s</source> <translation>Fel vid inläsning av %s</translation> </message> <message> <source>Error loading %s: Wallet corrupted</source> <translation>Fel vid inläsningen av %s: Plånboken är koruppt</translation> </message> <message> <source>Error loading %s: Wallet requires newer version of %s</source> <translation>Fel vid inläsningen av %s: Plånboken kräver en senare version av %s</translation> </message> <message> <source>Error loading %s: You can't disable HD on a already existing HD wallet</source> <translation>Fel vid laddning av %s: Du kan inte avaktivera HD på en redan existerande HD plånbok</translation> </message> <message> <source>Error loading block database</source> <translation>Fel vid inläsning av blockdatabasen</translation> </message> <message> <source>Error opening block database</source> <translation>Fel vid öppning av blockdatabasen</translation> </message> <message> <source>Error: Disk space is low!</source> <translation>Fel: Hårddiskutrymme är lågt!</translation> </message> <message> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Misslyckades att lyssna på någon port. Använd -listen=0 om du vill detta.</translation> </message> <message> <source>Importing...</source> <translation>Importerar...</translation> </message> <message> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation>Felaktig eller inget genesisblock hittades. Fel datadir för nätverket?</translation> </message> <message> <source>Initialization sanity check failed. %s is shutting down.</source> <translation>Initieringschecken fallerade. %s stängs av.</translation> </message> <message> <source>Invalid -onion address: '%s'</source> <translation>Ogiltig -onion adress:'%s'</translation> </message> <message> <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source> <translation>Ogiltigt belopp för -%s=&lt;belopp&gt;:'%s'</translation> </message> <message> <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source> <translation>Ogiltigt belopp för -fallbackfee=&lt;belopp&gt;: '%s'</translation> </message> <message> <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source> <translation>Håll minnespoolen över transaktioner under &lt;n&gt; megabyte (förvalt: %u)</translation> </message> <message> <source>Loading banlist...</source> <translation>Laddar svarta listan...</translation> </message> <message> <source>Location of the auth cookie (default: data dir)</source> <translation>Plats för authcookie (förvalt: datamapp)</translation> </message> <message> <source>Not enough file descriptors available.</source> <translation>Inte tillräckligt med filbeskrivningar tillgängliga.</translation> </message> <message> <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source> <translation>Anslut enbart till noder i nätverket &lt;net&gt; (IPv4, IPv6 eller onion)</translation> </message> <message> <source>Print this help message and exit</source> <translation>Visa denna hjälptext och avsluta</translation> </message> <message> <source>Print version and exit</source> <translation>Visa version och avsluta</translation> </message> <message> <source>Prune cannot be configured with a negative value.</source> <translation>Beskärning kan inte konfigureras med ett negativt värde.</translation> </message> <message> <source>Prune mode is incompatible with -txindex.</source> <translation>Beskärningsläge är inkompatibel med -txindex.</translation> </message> <message> <source>Rebuild chain state and block index from the blk*.dat files on disk</source> <translation>Återskapa blockkedjans status och index från blk*.dat filer på disken</translation> </message> <message> <source>Rebuild chain state from the currently indexed blocks</source> <translation>Återskapa blockkedjans status från aktuella indexerade block</translation> </message> <message> <source>Rewinding blocks...</source> <translation>Spolar tillbaka blocken...</translation> </message> <message> <source>Set database cache size in megabytes (%d to %d, default: %d)</source> <translation>Sätt databasens cachestorlek i megabyte (%d till %d, förvalt: %d)</translation> </message> <message> <source>Set maximum block size in bytes (default: %d)</source> <translation>Sätt maximal blockstorlek i byte (förvalt: %d)</translation> </message> <message> <source>Specify wallet file (within data directory)</source> <translation>Ange plånboksfil (inom datakatalogen)</translation> </message> <message> <source>The source code is available from %s.</source> <translation>Källkoden är tillgänglig från %s.</translation> </message> <message> <source>Unable to bind to %s on this computer. %s is probably already running.</source> <translation>Det går inte att binda till %s på den här datorn. %s är förmodligen redan igång.</translation> </message> <message> <source>Unsupported argument -benchmark ignored, use -debug=bench.</source> <translation>Argumentet -benchmark stöds inte och ignoreras, använd -debug=bench.</translation> </message> <message> <source>Unsupported argument -debugnet ignored, use -debug=net.</source> <translation>Argumentet -debugnet stöds inte och ignoreras, använd -debug=net.</translation> </message> <message> <source>Unsupported argument -tor found, use -onion.</source> <translation>Argumentet -tor hittades men stöds inte, använd -onion.</translation> </message> <message> <source>Use UPnP to map the listening port (default: %u)</source> <translation>Använd UPnP för att mappa den lyssnande porten (förvalt: %u)</translation> </message> <message> <source>User Agent comment (%s) contains unsafe characters.</source> <translation>Kommentaren i användaragent (%s) innehåller osäkra tecken.</translation> </message> <message> <source>Verifying blocks...</source> <translation>Verifierar block...</translation> </message> <message> <source>Verifying wallet...</source> <translation>Verifierar plånboken...</translation> </message> <message> <source>Wallet %s resides outside data directory %s</source> <translation>Plånbok %s ligger utanför datakatalogen %s</translation> </message> <message> <source>Wallet debugging/testing options:</source> <translation>Plånbokens Avlusnings/Testnings optioner:</translation> </message> <message> <source>Wallet needed to be rewritten: restart %s to complete</source> <translation>Plånboken behöver sparas om: Starta om %s för att fullfölja</translation> </message> <message> <source>Wallet options:</source> <translation>Plånboksinställningar:</translation> </message> <message> <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source> <translation>Tillåt JSON-RPC-anslutningar från specifik källa. Tillåtna &lt;ip&gt; är enkel IP (t.ex 1.2.3.4), en nätverk/nätmask (t.ex. 1.2.3.4/255.255.255.0) eller ett nätverk/CIDR (t.ex. 1.2.3.4/24). Detta alternativ anges flera gånger</translation> </message> <message> <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source> <translation>Bind till given adress och vitlista klienter som ansluter till den. Använd [värd]:port notation för IPv6</translation> </message> <message> <source>Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)</source> <translation>Bind till angiven adress för att lyssna på JSON-RPC-anslutningar. Använd [värd]:port-format for IPv6. Detta alternativ kan anges flera gånger (förvalt: bind till alla gränssnitt)</translation> </message> <message> <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source> <translation>Skapa nya filer med systemets förvalda rättigheter, istället för umask 077 (bara effektivt med avaktiverad plånboks funktionalitet)</translation> </message> <message> <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source> <translation>Upptäck egna IP adresser (standard: 1 vid lyssning ingen -externalip eller -proxy)</translation> </message> <message> <source>Error: Listening for incoming connections failed (listen returned error %s)</source> <translation>Fel: Avlyssning av inkommande anslutningar misslyckades (Avlyssningen returnerade felkod %s)</translation> </message> <message> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation>Exekvera kommando när ett relevant meddelande är mottagen eller när vi ser en väldigt lång förgrening (%s i cmd är utbytt med ett meddelande)</translation> </message> <message> <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source> <translation>Avgifter (i %s/kB) mindre än detta betraktas som nollavgift för vidarebefordran, mining och transaktionsskapande (förvalt: %s)</translation> </message> <message> <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source> <translation>Om paytxfee inte är satt, inkludera tillräcklig avgift så att transaktionen börjar att konfirmeras inom n blocks (förvalt: %u)</translation> </message> <message> <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source> <translation>Otillåtet belopp för -maxtxfee=&lt;belopp&gt;: '%s' (måste åtminstånde vara minrelay avgift %s för att förhindra stoppade transkationer)</translation> </message> <message> <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source> <translation>Maximal storlek på data i databärartransaktioner som vi reläar och bryter (förvalt: %u) </translation> </message> <message> <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source> <translation>Slumpa autentiseringen för varje proxyanslutning. Detta möjliggör Tor ström-isolering (förvalt: %u)</translation> </message> <message> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source> <translation>Sätt den maximala storleken av hög-prioriterade/låg-avgifts transaktioner i byte (förvalt: %d)</translation> </message> <message> <source>The transaction amount is too small to send after the fee has been deducted</source> <translation>Transaktionen är för liten att skicka efter det att avgiften har dragits</translation> </message> <message> <source>Use hierarchical deterministic key generation (HD) after BIP32. Only has effect during wallet creation/first start</source> <translation>Använd hierarkisk deterministisk nyckel generering (HD) efter BIP32. Har bara effekt under plånbokens skapande/första användning.</translation> </message> <message> <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source> <translation>Vitlistade klienter kan inte bli DoS-bannade och deras transaktioner reläas alltid, även om dom redan är i mempoolen, användbart för t.ex en gateway </translation> </message> <message> <source>You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain</source> <translation>Du måste bygga om databasen genom att använda -reindex för att återgå till obeskärt läge. Detta kommer att ladda ner hela blockkedjan.</translation> </message> <message> <source>(default: %u)</source> <translation>(förvalt: %u)</translation> </message> <message> <source>Accept public REST requests (default: %u)</source> <translation>Acceptera publika REST förfrågningar (förvalt: %u)</translation> </message> <message> <source>Automatically create Tor hidden service (default: %d)</source> <translation>Skapa automatiskt dold tjänst i Tor (förval: %d)</translation> </message> <message> <source>Connect through SOCKS5 proxy</source> <translation>Anslut genom SOCKS5 proxy</translation> </message> <message> <source>Error reading from database, shutting down.</source> <translation>Fel vid läsning från databas, avslutar.</translation> </message> <message> <source>Imports blocks from external blk000??.dat file on startup</source> <translation>Importera block från extern blk000??.dat-fil vid uppstart</translation> </message> <message> <source>Information</source> <translation>Information</translation> </message> <message> <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source> <translation>Ogiltigt belopp för -paytxfee=&lt;belopp&gt;:'%s' (måste vara minst %s)</translation> </message> <message> <source>Invalid netmask specified in -whitelist: '%s'</source> <translation>Ogiltig nätmask angiven i -whitelist: '%s'</translation> </message> <message> <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source> <translation>Håll som mest &lt;n&gt; oanslutningsbara transaktioner i minnet (förvalt: %u)</translation> </message> <message> <source>Need to specify a port with -whitebind: '%s'</source> <translation>Port måste anges med -whitelist: '%s'</translation> </message> <message> <source>Node relay options:</source> <translation>Nodreläalternativ:</translation> </message> <message> <source>RPC server options:</source> <translation>RPC-serveralternativ:</translation> </message> <message> <source>Reducing -maxconnections from %d to %d, because of system limitations.</source> <translation>Minskar -maxconnections från %d till %d, på grund av systembegränsningar.</translation> </message> <message> <source>Rescan the block chain for missing wallet transactions on startup</source> <translation>Sök i blockkedjan efter saknade plånbokstransaktioner vid uppstart</translation> </message> <message> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Skicka trace-/debuginformation till terminalen istället för till debug.log</translation> </message> <message> <source>Send transactions as zero-fee transactions if possible (default: %u)</source> <translation>Sänd transaktioner som nollavgiftstransaktioner om möjligt (förvalt: %u)</translation> </message> <message> <source>Show all debugging options (usage: --help -help-debug)</source> <translation>Visa alla avlusningsalternativ (använd: --help -help-debug)</translation> </message> <message> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Krymp debug.log filen vid klient start (förvalt: 1 vid ingen -debug)</translation> </message> <message> <source>Signing transaction failed</source> <translation>Signering av transaktion misslyckades</translation> </message> <message> <source>The transaction amount is too small to pay the fee</source> <translation>Transaktionen är för liten för att betala avgiften</translation> </message> <message> <source>This is experimental software.</source> <translation>Detta är experimentmjukvara.</translation> </message> <message> <source>Tor control port password (default: empty)</source> <translation>Lösenord för Tor-kontrollport (förval: inget)</translation> </message> <message> <source>Tor control port to use if onion listening enabled (default: %s)</source> <translation>Tor-kontrollport att använda om onion är aktiverat (förval: %s)</translation> </message> <message> <source>Transaction amount too small</source> <translation>Transaktions belopp för liten</translation> </message> <message> <source>Transaction too large for fee policy</source> <translation>Transaktionen är för stor för avgiftspolicyn</translation> </message> <message> <source>Transaction too large</source> <translation>Transaktionen är för stor</translation> </message> <message> <source>Unable to bind to %s on this computer (bind returned error %s)</source> <translation>Det går inte att binda till %s på den här datorn (bind returnerade felmeddelande %s)</translation> </message> <message> <source>Upgrade wallet to latest format on startup</source> <translation>Uppgradera plånbok till senaste formatet vid uppstart</translation> </message> <message> <source>Username for JSON-RPC connections</source> <translation>Användarnamn för JSON-RPC-anslutningar</translation> </message> <message> <source>Warning</source> <translation>Varning</translation> </message> <message> <source>Warning: unknown new rules activated (versionbit %i)</source> <translation>Varning: okända nya regler aktiverade (versionsbit %i)</translation> </message> <message> <source>Whether to operate in a blocks only mode (default: %u)</source> <translation>Ska allt göras i endast block-läge (förval: %u)</translation> </message> <message> <source>Zapping all transactions from wallet...</source> <translation>Töm plånboken på alla transaktioner...</translation> </message> <message> <source>ZeroMQ notification options:</source> <translation>ZeroMQ-alternativ för notiser:</translation> </message> <message> <source>Password for JSON-RPC connections</source> <translation>Lösenord för JSON-RPC-anslutningar</translation> </message> <message> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Exekvera kommando när det bästa blocket ändras (%s i cmd är utbytt av blockhash)</translation> </message> <message> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Tillåt DNS-sökningar för -addnode, -seednode och -connect</translation> </message> <message> <source>Loading addresses...</source> <translation>Laddar adresser...</translation> </message> <message> <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source> <translation>(1 = spara tx metadata t.ex. kontoägare och betalningsbegäransinformation, 2 = släng tx metadata)</translation> </message> <message> <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source> <translation>-maxtxfee är väldigt högt satt! Så höga avgifter kan komma att betalas för en enstaka transaktion.</translation> </message> <message> <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source> <translation>Håll inte transaktioner i minnespoolen längre än &lt;n&gt; timmar (förvalt: %u)</translation> </message> <message> <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source> <translation>Samma antal byte per sigop i transaktioner som vi reläar och bryter (förvalt: %u)</translation> </message> <message> <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source> <translation>Avgifter (i %s/kB) mindre än detta anses vara nollavgifter vid skapande av transaktion (standard: %s)</translation> </message> <message> <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source> <translation>Hur grundlig blockverifikationen vid -checkblocks är (0-4, förvalt: %u)</translation> </message> <message> <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source> <translation>Upprätthåll ett fullständigt transaktionsindex, som används av getrawtransaction rpc-anrop (förval: %u)</translation> </message> <message> <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source> <translation>Antal sekunder att hindra klienter som missköter sig från att ansluta (förvalt: %u)</translation> </message> <message> <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source> <translation>Skriv ut avlusningsinformation (förvalt: %u, att ange &lt;category&gt; är frivilligt)</translation> </message> <message> <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source> <translation>Stöd filtrering av block och transaktioner med bloomfilter (standard: %u)</translation> </message> <message> <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source> <translation>Total längd på strängen för nätverksversion (%i) överskrider maxlängden (%i). Minska numret eller storleken på uacomments.</translation> </message> <message> <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source> <translation>Försöker hålla utgående trafik under givet mål (i MiB per 24 timmar), 0 = ingen gräns (förvalt: %d)</translation> </message> <message> <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source> <translation>Argumentet -socks hittades och stöds inte. Det är inte längre möjligt att sätta SOCKS-version längre, bara SOCKS5-proxy stöds.</translation> </message> <message> <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source> <translation>Argumentet -whitelistalwaysrelay stöds inte utan ignoreras, använd -whitelistrelay och/eller -whitelistforcerelay.</translation> </message> <message> <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source> <translation>Använd separat SOCKS5 proxy för att nå kollegor via dolda tjänster i Tor (förvalt: -%s)</translation> </message> <message> <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source> <translation>Varning: Okända blockversioner bryts! Det är möjligt att okända regler används</translation> </message> <message> <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Varning: Plånboksfilen var korrupt, datat har räddats! Den ursprungliga %s har sparas som %s i %s. Om ditt saldo eller transaktioner är felaktiga bör du återställa från en säkerhetskopia.</translation> </message> <message> <source>(default: %s)</source> <translation>(förvalt: %s)</translation> </message> <message> <source>Always query for peer addresses via DNS lookup (default: %u)</source> <translation>Sök alltid efter klientadresser med DNS sökningen (förvalt: %u)</translation> </message> <message> <source>How many blocks to check at startup (default: %u, 0 = all)</source> <translation>Hur många block att kontrollera vid uppstart (förvalt: %u, 0 = alla)</translation> </message> <message> <source>Include IP addresses in debug output (default: %u)</source> <translation>Inkludera IP-adresser i debugutskrift (förvalt: %u)</translation> </message> <message> <source>Invalid -proxy address: '%s'</source> <translation>Ogiltig -proxy adress: '%s'</translation> </message> <message> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source> <translation>Lyssna på JSON-RPC-anslutningar på &lt;port&gt; (förval: %u eller testnet: %u)</translation> </message> <message> <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source> <translation>Lyssna efter anslutningar på &lt;port&gt; (förvalt: %u eller testnet: %u)</translation> </message> <message> <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source> <translation>Ha som mest &lt;n&gt; anslutningar till andra klienter (förvalt: %u)</translation> </message> <message> <source>Make the wallet broadcast transactions</source> <translation>Gör så att plånboken sänder ut transaktionerna</translation> </message> <message> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source> <translation>Maximal mottagningsbuffert per anslutning, &lt;n&gt;*1000 byte (förvalt: %u)</translation> </message> <message> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source> <translation>Maximal sändningsbuffert per anslutning, &lt;n&gt;*1000 byte (förvalt: %u)</translation> </message> <message> <source>Prepend debug output with timestamp (default: %u)</source> <translation>Skriv ut tidsstämpel i avlusningsinformationen (förvalt: %u)</translation> </message> <message> <source>Relay and mine data carrier transactions (default: %u)</source> <translation>Reläa och bearbeta databärartransaktioner (förvalt: %u) </translation> </message> <message> <source>Relay non-P2SH multisig (default: %u)</source> <translation>Reläa icke-P2SH multisig (förvalt: %u)</translation> </message> <message> <source>Set key pool size to &lt;n&gt; (default: %u)</source> <translation>Sätt storleken på nyckelpoolen till &lt;n&gt; (förvalt: %u)</translation> </message> <message> <source>Set maximum BIP141 block weight (default: %d)</source> <translation>Sätt maximal BIP141 blockvikt (förvalt: %d)</translation> </message> <message> <source>Set the number of threads to service RPC calls (default: %d)</source> <translation>Ange antalet trådar för att hantera RPC anrop (förvalt: %d)</translation> </message> <message> <source>Specify configuration file (default: %s)</source> <translation>Ange konfigurationsfil (förvalt: %s)</translation> </message> <message> <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source> <translation>Ange timeout för uppkoppling i millisekunder (minimum:1, förvalt: %d)</translation> </message> <message> <source>Specify pid file (default: %s)</source> <translation>Ange pid-fil (förvalt: %s)</translation> </message> <message> <source>Spend unconfirmed change when sending transactions (default: %u)</source> <translation>Spendera okonfirmerad växel när transaktioner sänds (förvalt: %u)</translation> </message> <message> <source>Threshold for disconnecting misbehaving peers (default: %u)</source> <translation>Tröskelvärde för att koppla ifrån klienter som missköter sig (förvalt: %u)</translation> </message> <message> <source>Unknown network specified in -onlynet: '%s'</source> <translation>Okänt nätverk som anges i -onlynet: '%s'</translation> </message> <message> <source>Insufficient funds</source> <translation>Otillräckligt med mincoins</translation> </message> <message> <source>Loading block index...</source> <translation>Laddar blockindex...</translation> </message> <message> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Lägg till en nod att koppla upp mot och försök att hålla anslutningen öppen</translation> </message> <message> <source>Loading wallet...</source> <translation>Laddar plånbok...</translation> </message> <message> <source>Cannot downgrade wallet</source> <translation>Kan inte nedgradera plånboken</translation> </message> <message> <source>Cannot write default address</source> <translation>Kan inte skriva standardadress</translation> </message> <message> <source>Rescanning...</source> <translation>Söker igen...</translation> </message> <message> <source>Done loading</source> <translation>Klar med laddning</translation> </message> <message> <source>Error</source> <translation>Fel</translation> </message> </context> </TS>
mit
stanwmusic/bootstrap
js/src/dom/selector-engine.js
2277
/** * -------------------------------------------------------------------------- * Bootstrap (v4.3.1): dom/selector-engine.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ import { find as findFn, findOne, matches, closest } from './polyfill' import { makeArray } from '../util/index' /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ const NODE_TEXT = 3 const SelectorEngine = { matches(element, selector) { return matches.call(element, selector) }, find(selector, element = document.documentElement) { if (typeof selector !== 'string') { return null } return findFn.call(element, selector) }, findOne(selector, element = document.documentElement) { if (typeof selector !== 'string') { return null } return findOne.call(element, selector) }, children(element, selector) { if (typeof selector !== 'string') { return null } const children = makeArray(element.children) return children.filter(child => this.matches(child, selector)) }, parents(element, selector) { if (typeof selector !== 'string') { return null } const parents = [] let ancestor = element.parentNode while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { if (this.matches(ancestor, selector)) { parents.push(ancestor) } ancestor = ancestor.parentNode } return parents }, closest(element, selector) { if (typeof selector !== 'string') { return null } return closest.call(element, selector) }, prev(element, selector) { if (typeof selector !== 'string') { return null } const siblings = [] let previous = element.previousSibling while (previous && previous.nodeType === Node.ELEMENT_NODE && previous.nodeType !== NODE_TEXT) { if (this.matches(previous, selector)) { siblings.push(previous) } previous = previous.previousSibling } return siblings } } export default SelectorEngine
mit
42wim/matterircd
vendor/github.com/mattermost/mattermost-server/v5/shared/mlog/levels.go
2097
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. package mlog // Standard levels var ( LvlPanic = LogLevel{ID: 0, Name: "panic", Stacktrace: true} LvlFatal = LogLevel{ID: 1, Name: "fatal", Stacktrace: true} LvlError = LogLevel{ID: 2, Name: "error"} LvlWarn = LogLevel{ID: 3, Name: "warn"} LvlInfo = LogLevel{ID: 4, Name: "info"} LvlDebug = LogLevel{ID: 5, Name: "debug"} LvlTrace = LogLevel{ID: 6, Name: "trace"} // used by redirected standard logger LvlStdLog = LogLevel{ID: 10, Name: "stdlog"} // used only by the logger LvlLogError = LogLevel{ID: 11, Name: "logerror", Stacktrace: true} ) // Register custom (discrete) levels here. // !!!!! ID's must not exceed 32,768 !!!!!! var ( // used by the audit system LvlAuditAPI = LogLevel{ID: 100, Name: "audit-api"} LvlAuditContent = LogLevel{ID: 101, Name: "audit-content"} LvlAuditPerms = LogLevel{ID: 102, Name: "audit-permissions"} LvlAuditCLI = LogLevel{ID: 103, Name: "audit-cli"} // used by the TCP log target LvlTcpLogTarget = LogLevel{ID: 120, Name: "TcpLogTarget"} // used by Remote Cluster Service LvlRemoteClusterServiceDebug = LogLevel{ID: 130, Name: "RemoteClusterServiceDebug"} LvlRemoteClusterServiceError = LogLevel{ID: 131, Name: "RemoteClusterServiceError"} LvlRemoteClusterServiceWarn = LogLevel{ID: 132, Name: "RemoteClusterServiceWarn"} // used by Shared Channel Sync Service LvlSharedChannelServiceDebug = LogLevel{ID: 200, Name: "SharedChannelServiceDebug"} LvlSharedChannelServiceError = LogLevel{ID: 201, Name: "SharedChannelServiceError"} LvlSharedChannelServiceWarn = LogLevel{ID: 202, Name: "SharedChannelServiceWarn"} LvlSharedChannelServiceMessagesInbound = LogLevel{ID: 203, Name: "SharedChannelServiceMsgInbound"} LvlSharedChannelServiceMessagesOutbound = LogLevel{ID: 204, Name: "SharedChannelServiceMsgOutbound"} // add more here ... ) // Combinations for LogM (log multi) var ( MLvlAuditAll = []LogLevel{LvlAuditAPI, LvlAuditContent, LvlAuditPerms, LvlAuditCLI} )
mit
yogeshsaroya/new-cdnjs
ajax/libs/mathjax/1.1a/jax/output/HTML-CSS/fonts/STIX/General/Italic/GeneralPunctuation.js
129
version https://git-lfs.github.com/spec/v1 oid sha256:9e5db06495724b6fedb3e06776242c7ddb55da8532eb678a5a5b88757b8108df size 1211
mit
zhaopei0418/maintain
src/main/resources/templates/payments/list.html
23669
<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorate="layout"> <head> <title>支付单管理</title> </head> <body> <div layout:fragment="header"> <div class="title_left"> <h3>支付单查询</h3> </div> <div class="title_right"> <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search"> <form th:action="@{/payments}"> <div class="input-group"> <input type="text" class="form-control" name="searchText" placeholder="输入关键字..."> <span class="input-group-btn"> <button class="btn btn-default">搜索</button> </span> </div> </form> </div> </div> </div> <div layout:fragment="content"> <script type="text/javascript"> var ctx = [[@{/}]]; function comparisonDelivery(logisticsCode, logisticsNo, copNo, headGuid) { $.getJSON(ctx + "/deliveries/comparisonDeliveryByLogisticsNo?logisticsCode=" + logisticsCode + "&logisticsNo=" + logisticsNo + "&headGuid=" + headGuid, function(data) { $("#appStatusModal").modal("show"); $("#appStatusModal .modal-title").text("入库比对结果[" + copNo + "-" + logisticsCode + ":" + logisticsNo + "]"); var isPass = false; var dataHtml = "<table class='table table-striped jambo_table bulk_action'>"; dataHtml += "<thead><th>表头序号</th><th>企业内部编号</th><th>航班航次号</th><th>总(提)运单号</th><th>运输方式</th>"; dataHtml += "<th>运输工具</th><th>比对结果</th></thead>"; dataHtml += "<tbody>"; if (null != data) { if (0 == data.length) { $("#appStatusModal .modal-body").html("没有对应的入库明细单"); } else { for (var i = 0; i < data.length; i++) { if (0 == i) { dataHtml += "<tr style='background-color: yellow;'>"; dataHtml += "<td>" + data[i].payHeadGuid + "</td>"; dataHtml += "<td>" + copNo + "</td>"; dataHtml += "<td>" + data[i].invtVoyageNo + "</td>"; dataHtml += "<td>" + data[i].invtBillNo + "</td>"; dataHtml += "<td>" + data[i].invtTrafMode + "</td>"; dataHtml += "<td>" + data[i].invtTrafNo + "</td>"; dataHtml += "<td>清单信息</td>"; dataHtml += "</tr>"; } dataHtml += "<tr>"; dataHtml += "<td>" + data[i].deliveryHeadGuid + "</td>"; dataHtml += "<td>" + data[i].copNo + "</td>"; dataHtml += "<td>" + data[i].deliveryVoyageNo + "</td>"; dataHtml += "<td>" + data[i].deliveryBillNo + "</td>"; dataHtml += "<td>" + data[i].deliveryTrafMode + "</td>"; dataHtml += "<td>" + data[i].deliveryTrafNo + "</td>"; isPass = false; if (data[i].deliveryVoyageNo == data[i].invtVoyageNo && data[i].deliveryBillNo == data[i].invtBillNo && data[i].deliveryTrafMode == data[i].invtTrafMode && data[i].deliveryTrafNo == data[i].invtTrafNo) { isPass = true; } dataHtml += "<td>" + (isPass ? "<b style='color:#5cb85c;'><i>通过</i></b>" : "<b style='color:red;'><i>不通过</i></b>") + "</td>"; dataHtml += "</tr>"; } dataHtml += "</tbody></table>"; $("#appStatusModal .modal-body").html(dataHtml); } } }) } function getCiqStatusByCopNo(copNo, copNo, status) { $.getJSON(ctx + "/invts/getImppayHeadListByCopNo/" + copNo, function(data) { $("#appStatusModal").modal("show"); $("#appStatusModal .modal-title").text("国检状态[" + copNo + "]"); var dataHtml = "<table class='table table-striped jambo_table bulk_action'>"; dataHtml += "<thead><th>支付编号</th><th>支付企业名称</th><th>国检状态</th><th>审批意见</th>"; dataHtml += "<th>审批时间</th></thead>"; dataHtml += "<tbody>"; if (null != data) { for(var i = 0; i < data.length; i++) { if (null != data) { for (var i = 0; i < data.length; i++) { dataHtml += "<tr>"; dataHtml += "<td>" + data[i].applyCode + "</td>" dataHtml += "<td title='" + data[i].payCode +"'>" + data[i].payName + "</td>"; if (undefined != data[i].auditState && null != data[i].auditState) { dataHtml += "<td>" + status[data[i].auditState] + "[" + data[i].auditState + "]" + "</td>"; } else { dataHtml += "<td></td>"; } dataHtml += "<td>" + data[i].bwName + "</td>"; dataHtml += "<td>" + data[i].applyDate + "</td>"; dataHtml += "</tr>"; } } } } dataHtml += "</tbody>"; dataHtml += "</table>"; $("#appStatusModal .modal-body").html(dataHtml); }); } function getPubRtnListByBizGuid(copNo, bizGuid, status) { $.getJSON(ctx + "/invts/getPubRtnListByBizGuid/" + bizGuid, function(data) { $("#appStatusModal").modal("show"); $("#appStatusModal .modal-title").text("历史状态[" + copNo + "]"); var dataHtml = "<table class='table table-striped jambo_table bulk_action'>"; dataHtml += "<thead><tr><th>入库时间</th><th>报文时间</th><th>业务状态</th><th>业务信息</th></thead>"; dataHtml += "<tbody>"; if (null != data) { for (var i = 0; i < data.length; i++) { dataHtml += "<tr>"; dataHtml += "<td>" + data[i].sysDate + "</td>"; dataHtml += "<td>" + data[i].rtnTime + "</td>"; dataHtml += "<td>" + status[data[i].rtnStatus] + "[" + data[i].rtnStatus + "]</td>"; dataHtml += "<td>" + data[i].rtnInfo + "</td>"; dataHtml += "</tr>"; } } dataHtml += "</tbody>"; dataHtml += "</table>"; $("#appStatusModal .modal-body").html(dataHtml); }); } function getDistHeadByInvtNo(invtNo, status) { $.getJSON(ctx + "/invts/getDistHeadByInvtNo/" + invtNo, function(data) { $("#appStatusModal").modal("show"); $("#appStatusModal .modal-title").text("核放单信息[" + invtNo + "]"); var dataHtml = "<table class='table table-striped jambo_table bulk_action'>"; dataHtml += "<thead><tr><th>核放单号</th><th>海关编码</th><th>申报企业</th><th>核放单状态</th></thead>"; dataHtml += "<tbody>"; if (null != data) { dataHtml += "<tr>"; dataHtml += "<td>" + data.distNo + "</td>"; dataHtml += "<td>" + data.customsCode + "</td>"; dataHtml += "<td title='" + data.declCode + "'>" + data.declName + "</td>"; dataHtml += "<td>" + data.distStat + "</td>"; dataHtml += "</tr>"; } dataHtml += "</tbody>"; dataHtml += "<thead><tr><th>录入日期</th><th>申报日期</th><th>退单原因</th><th>备注</th></thead>"; dataHtml += "<tbody>"; if (null != data) { dataHtml += "<tr>"; dataHtml += "<td>" + data.inputDate + "</td>"; dataHtml += "<td>" + data.declDate + "</td>"; dataHtml += "<td>" + data.returnReason + "</td>"; dataHtml += "<td>" + data.note + "</td>"; dataHtml += "</tr>"; } dataHtml += "</tbody>"; dataHtml += "</table>"; $("#appStatusModal .modal-body").html(dataHtml); }); } </script> <div id="appStatusModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"> <span aria-hidden="true">&times;</span><span class="sr-only">Close</span> </button> <h4 class="modal-title">历史状态</h4> </div> <div class="modal-body"></div> </div> </div> </div> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="x_panel"> <div class="x_title"> <h2>搜索条件</h2> <ul class="nav navbar-right panel_toolbox"> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a> <ul class="dropdown-menu" role="menu"> <li><a href="#">Settings 1</a> </li> <li><a href="#">Settings 2</a> </li> </ul> </li> </ul> <div class="clearfix"></div> </div> <div class="x_content"> <form class="form-horizontal search-form" role="form" th:action="@{/payments}" method="GET" id="payment_form"> <input type="hidden" name="pageSize" th:value="${payHead.pageSize}" /> <input class="page-num" type="hidden" name="pageNum" th:value="${payHead.pageNum}" /> <div class="form-group"> <label class="col-sm-1 control-label">支付交易号</label> <div class="col-sm-2"> <input class="form-control" type="text" name="payTransactionId" placeholder="支付交易号" th:value="${payHead.payTransactionId}" /> </div> <label class="col-sm-1 control-label">支付企业代码</label> <div class="col-sm-2"> <input class="form-control" type="text" name="payCode" placeholder="支付企业代码" th:value="${payHead.payCode}" /> </div> <label class="col-sm-1 control-label">支付企业名称</label> <div class="col-sm-2"> <input class="form-control" type="text" name="payName" placeholder="支付企业名称" th:value="${payHead.payName}" /> </div> <label class="col-sm-1 control-label">订单号</label> <div class="col-sm-2"> <input class="form-control" type="text" name="ordNo" placeholder="订单号" th:value="${payHead.ordNo}" /> </div> </div> <div class="form-group"> <label class="col-sm-1 control-label">支付人</label> <div class="col-sm-2"> <input class="form-control" type="text" name="payerName" placeholder="支付人" th:value="${payHead.payerName}" /> </div> <label class="col-sm-1 control-label">支付人身份证号</label> <div class="col-sm-2"> <input class="form-control" type="text" name="payerIdNumber" placeholder="支付人身份证号" th:value="${payHead.payerIdNumber}" /> </div> <label class="col-sm-1 control-label">入库开始时间</label> <div class="col-sm-2"> <div class='input-group date input-date'> <input type='text' class="form-control" name="beginSysDate" th:value="${payHead.beginSysDate}" placeholder="支付开始时间" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-time"></span> </span> </div> </div> <label class="col-sm-1 control-label">入库结束时间</label> <div class="col-sm-2"> <div class='input-group date input-date'> <input type='text' class="form-control" name="endSysDate" th:value="${payHead.endSysDate}" placeholder="支付结束时间" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-time"></span> </span> </div> </div> </div> <div class="form-group"> <label class="col-sm-1 control-label">业务状态</label> <div class="col-sm-2"> <select class="form-control" name="appStatus"> <option th:each="appStat : ${appStatus}" th:value="${appStat.key}" th:text="${appStat.key} + '-' + ${appStat.value}" th:selected="${appStat.key == payHead.appStatus} ? 'selected'"></option> </select> </div> <label class="col-sm-1 control-label">申报类型</label> <div class="col-sm-2"> <select class="form-control" name="appType"> <option th:each="appStat : ${appType}" th:value="${appStat.key}" th:text="${appStat.key} + '-' + ${appStat.value}" th:selected="${appStat.key == payHead.appType} ? 'selected'"></option> </select> </div> <label class="col-sm-1 control-label">支付开始时间</label> <div class="col-sm-2"> <div class='input-group date input-date'> <input type='text' class="form-control" name="beginPayTime" th:value="${payHead.beginPayTime}" placeholder="支付开始时间" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-time"></span> </span> </div> </div> <label class="col-sm-1 control-label">支付结束时间</label> <div class="col-sm-2"> <div class='input-group date input-date'> <input type='text' class="form-control" name="endPayTime" th:value="${payHead.endPayTime}" placeholder="支付结束时间" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-time"></span> </span> </div> </div> </div> <div class="form-group"> <label class="col-sm-1 control-label">电商平台代码</label> <div class="col-sm-2"> <input class="form-control" type="text" name="ebpCode" placeholder="电商平台代码" th:value="${payHead.ebpCode}" /> </div> <label class="col-sm-1 control-label">电商平台名称</label> <div class="col-sm-2"> <input class="form-control" type="text" name="ebpName" placeholder="电商平台名称" th:value="${payHead.ebpName}" /> </div> </div> <div class="pull-right form-group no-margin-right"> <button type="button" class="btn btn-round btn-info btn-lg" onclick="formSubmit(this);">搜索</button> <button type="button" class="btn btn-round btn-warning btn-lg" onclick="resetForm('payment_form')">重置</button> </div> </form> </div> </div> </div> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="x_panel"> <div class="x_content" style="display: block; text-align: center;"> <button type="button" class="btn btn-round btn-dark" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'\')'">全部</button> <button type="button" class="btn btn-round btn-success" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'03\')'">发送电子口岸成功</button> <button type="button" class="btn btn-round btn-info" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'2\')'">电子口岸申报中</button> <button type="button" class="btn btn-round btn-success" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'3\')'">发送海关成功</button> <button type="button" class="btn btn-round btn-warning" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'100\')'">退单</button> <button type="button" class="btn btn-round btn-danger" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'4\')'">发送海关失败</button> <button type="button" class="btn btn-round btn-info" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'120\')'">海关入库</button> <button type="button" class="btn btn-round btn-danger" th:onclick="'addFormParaQuery(\'payment_form\', \'appStatus\', \'05\')'">电子口岸校验失败</button> </div> </div> </div> <div class="col-md-12 col-sm-12 col-xs-12"> <ul class="pagination pagination-lg pull-right"> <li><a>共<span th:text="${pageInfo.total}" class="red">1</span>条</a></li> <li th:class="${0 == pageInfo.pages} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${0 < pageInfo.pages} ? 'goToPageNum(\'payment_form\', 1);'">首页</a> </li> <li th:class="${pageInfo.isFirstPage} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${!pageInfo.isFirstPage} ? 'goToPageNum(\'payment_form\', ' + ${pageInfo.prePage} + ');'">上页</a> </li> <li th:each="page : ${pageList}" th:class="${page == pageInfo.pageNum} ? 'active'"> <a href="javascript:void(0)" th:text="${page}" th:onclick="'goToPageNum(\'payment_form\',' + ${page} + ');'"></a> </li> <li th:class="${pageInfo.isLastPage} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${!pageInfo.isLastPage} ? 'goToPageNum(\'payment_form\', ' + ${pageInfo.nextPage} + ');'">下页</a> </li> <li th:class="${0 == pageInfo.pages} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${0 < pageInfo.pages} ? 'goToPageNum(\'payment_form\', ' + ${pageInfo.pages} + ');'">尾页</a> </li> <li><a th:text="'第' + ${pageInfo.pageNum} + '页'">第1页</a></li> <li><a th:text="'共' + ${pageInfo.pages} + '页'">共1页</a></li> <li><input type="number" class="input-lg change-page-num" style="width:100px;" th:value="${pageInfo.pageNum}" /></li> <li><button class="btn-lg btn btn-info" type="button" th:onclick="'goToPageNum(\'payment_form\', $(\'.change-page-num\').val(), ' + ${pageInfo.pages} + ')'">跳转</button></li> <li> <select title="显示条数" class="input-lg" style="width:60px;" onchange="changePageSize('payment_form', this.value);"> <option th:each="pageSize : ${pageSizeList}" th:text="${pageSize}" th:value="${pageSize}" th:selected="${pageSize == pageInfo.pageSize} ? 'selected'"></option> </select> </li> </ul> <table class="table table-striped jambo_table bulk_action"> <thead> <tr class="headings"> <th class="column-title">序号</th> <th class="column-title">支付交易号</th> <th class="column-title">电商平台企业</th> <th class="column-title">支付企业</th> <th class="column-title">订单号</th> <th class="column-title">支付人</th> <th class="column-title">支付人身份证号</th> <th class="column-title">支付金额</th> <th class="column-title">业务状态</th> <th class="column-title">入库日期</th> <th class="column-title">支付日期</th> <th class="column-title">申报类型</th> </tr> </thead> <tbody> <tr th:if="${payHeadList.empty}"> <td colspan="30">没有数据</td> </tr> <tr th:each="payHead,stat : ${payHeadList}" th:class="${0 == stat.count % 2} ? 'odd pointer' : 'even pointer'"> <td th:text="${stat.count}"></td> <td th:text="${payHead.payTransactionId}"></td> <td th:title="${payHead.ebpCode}"> <a href="javascript:void(0)" th:text="${payHead.ebpName}" th:onclick="'addFormParaQuery(\'payment_form\', \'ebpCode\', \'' + ${payHead.ebpCode} + '\')'"></a> </td> <td th:title="${payHead.payCode}"> <a href="javascript:void(0)" th:text="${payHead.payName}" th:onclick="'addFormParaQuery(\'payment_form\', \'payCode\', \'' + ${payHead.payCode} + '\')'"></a> </td> <td th:text="${payHead.ordNo}"></td> <td th:text="${payHead.payerName}"></td> <td th:text="${payHead.payerIdNumber}"></td> <td th:text="${payHead.amountPaid}"></td> <td th:switch="${payHead.appStatus}" th:onclick="'getPubRtnListByBizGuid(\'' + ${payHead.payTransactionId} + '\',\'' + ${payHead.guid} + '\', ' + ${appStatusJson} + ')'" title="点击查看历史状态"> <span th:case="05" class="btn btn-round btn-danger btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="04" class="btn btn-round btn-danger btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="4" class="btn btn-round btn-danger btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="500" class="btn btn-round btn-warning btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="100" class="btn btn-round btn-warning btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="700" class="btn btn-round btn-warning btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="400" class="btn btn-round btn-warning btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="800" class="btn btn-success btn-round btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="899" class="btn btn-round btn-success btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="3" class="btn btn-round btn-success btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="03" class="btn btn-round btn-success btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> <span th:case="*" class="btn btn-round btn-info btn-xs" th:text="${appStatus[payHead.appStatus]}"></span> </td> <td th:text="${#calendars.format(payHead.sysDate, 'YYYY-MM-dd HH:mm:ss')}"></td> <td th:text="${#calendars.format(payHead.payTime, 'YYYY-MM-dd HH:mm:ss')}"></td> <td th:text="${appType[payHead.appType]}"></td> </tr> </tbody> <tfoot> <tr class="headings"> <th class="column-title">序号</th> <th class="column-title">支付交易号</th> <th class="column-title">电商平台企业</th> <th class="column-title">支付企业</th> <th class="column-title">订单号</th> <th class="column-title">支付人</th> <th class="column-title">支付人身份证号</th> <th class="column-title">支付金额</th> <th class="column-title">业务状态</th> <th class="column-title">入库日期</th> <th class="column-title">支付日期</th> <th class="column-title">申报类型</th> </tr> </tfoot> </table> <ul class="pagination pagination-lg pull-right"> <li><a>共<span th:text="${pageInfo.total}" class="red">1</span>条</a></li> <li th:class="${0 == pageInfo.pages} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${0 < pageInfo.pages} ? 'goToPageNum(\'payment_form\', 1);'">首页</a> </li> <li th:class="${pageInfo.isFirstPage} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${!pageInfo.isFirstPage} ? 'goToPageNum(\'payment_form\', ' + ${pageInfo.prePage} + ');'">上页</a> </li> <li th:each="page : ${pageList}" th:class="${page == pageInfo.pageNum} ? 'active'"> <a href="javascript:void(0)" th:text="${page}" th:onclick="'goToPageNum(\'payment_form\',' + ${page} + ');'"></a> </li> <li th:class="${pageInfo.isLastPage} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${!pageInfo.isLastPage} ? 'goToPageNum(\'payment_form\', ' + ${pageInfo.nextPage} + ');'">下页</a> </li> <li th:class="${0 == pageInfo.pages} ? 'disabled'"> <a href="javascript:void(0)" th:onclick="${0 < pageInfo.pages} ? 'goToPageNum(\'payment_form\', ' + ${pageInfo.pages} + ');'">尾页</a> </li> <li><a th:text="'第' + ${pageInfo.pageNum} + '页'">第1页</a></li> <li><a th:text="'共' + ${pageInfo.pages} + '页'">共1页</a></li> <li><input type="number" class="input-lg change-page-num-down" style="width:100px;" th:value="${pageInfo.pageNum}" /></li> <li><button class="btn-lg btn btn-info" type="button" th:onclick="'goToPageNum(\'payment_form\', $(\'.change-page-num-down\').val(), ' + ${pageInfo.pages} + ')'">跳转</button></li> <li> <select title="显示条数" class="input-lg" style="width:60px;" onchange="changePageSize('payment_form', this.value);"> <option th:each="pageSize : ${pageSizeList}" th:text="${pageSize}" th:value="${pageSize}" th:selected="${pageSize == pageInfo.pageSize} ? 'selected'"></option> </select> </li> </ul> </div> </div> </body> </html>
mit
3sidedcube/react-native-navigation
lib/ios/RNNLayoutInfo.h
304
#import "RNNLayoutNode.h" #import <Foundation/Foundation.h> @interface RNNLayoutInfo : NSObject - (instancetype)initWithNode:(RNNLayoutNode *)node; @property(nonatomic, strong) NSString *componentId; @property(nonatomic, strong) NSString *name; @property(nonatomic, strong) NSDictionary *props; @end
mit
ungdev/integration-UTT
app/Jobs/matchNewcomerGodfather.php
750
<?php namespace App\Jobs; use App\Classes\NewcomerMatching; use Illuminate\Bus\Queueable; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; class matchNewcomerGodfather implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; private $force = false; /** * Create a new job instance. * * @return void */ public function __construct($force = false) { $this->force = $force; } /** * Execute the job. * * @return void */ public function handle() { NewcomerMatching::matchReferrals($this->force); } }
mit
N6UDP/LightweightInfluxDb
src/LightweightInfluxDb/ISeriesPoint.cs
312
using System; using System.Collections.Generic; namespace LightweightInfluxDb { public interface ISeriesPoint { string Name { get; } Dictionary<string, string> Tags { get; } List<string> Fields { get; } List<object> Values { get; } DateTime? Timestamp { get; } } }
mit
aleju/ImageAugmenter
changelogs/master/improved/20200308_prefetching.md
1925
# Added Automatic Prefetching of Random Number Samples #634 This patch adds automatic prefetching of random samples, which performs a single large random sampling call instead of many smaller ones. This seems to improve the performance of most augmenters by 5% to 40% for longer augmentation sessions (50+ consecutive batches of 128 examples each). A few augmenters seem to have gotten slightly slower, though these might be measuring errors. The prefetching is done by adding a new parameter, `imgaug.parameters.AutoPrefetcher`, which prefetches samples from a child parameter. The change is expected to have for most augmenters a slight negative performance impact if the augmenters are used only once and not for multiple batches. For a few augmenters there might be sizeable negative peformance impact (due to prefetching falsely being performed). The negative impact can be avoided in these cases by wrapping the augmentation calls in `with imgaug.parameters.no_prefetching(): ...`. This patch also adds the property `prefetchable` to `StochasticParameter`, which defaults to `False` and determines whether the parameter's outputs may be prefetched. It further adds to `handle_continuous_param()`, `handle_discrete_param()`. `handle_categorical_string_param()`, `handle_discrete_kernel_size_param()` and `handle_probability_param()` in `imgaug.parameters` the new argument `prefetch`. If set to `True` (the default), these functions may now partially or fully wrap their results in `AutoPrefetcher`. Add functions: * `imgaug.random.RNG.create_if_not_rng_()` * `imgaug.parameters.toggle_prefetching()` * `imgaug.testutils.is_parameter_instance()` * `imgaug.testutils.remove_prefetching()` Add properties: * `imgaug.parameters.StochasticParameter.prefetchable` Add classes: * `imgaug.parameters.toggled_prefetching()` (context) * `imgaug.parameters.no_prefetching()` (context) * `imgaug.parameters.AutoPrefetcher`
mit
DURAARK/microservice-sipgenerator
bindings/rosetta/app.js
5477
var spawn = require('child_process').spawn, Promise = require('bluebird'), uuid = require('node-uuid'), path = require('path'), fs = require('fs'), mkdirp = require('mkdirp'), _ = require('underscore'), fs = require('fs'), Sftp = require('sftp-upload'); var rosettaExecutable = path.join(__dirname, '../../sip-generator-2/SIP_Generator/'); var depositExecutable = path.join(__dirname, '../../sip-generator-2/rosetta-connector/dps-sdk-deposit'); var Rosetta = module.exports = function() {}; Rosetta.prototype.deposit = function(sourceDir) { var rosetta = this; console.log('[Rosetta::deposit] configuration: ' + sourceDir); var subDir = sourceDir.replace('/', ''); console.log('[Rosetta::deposit] subdir: ' + subDir); return new Promise(function(resolve, reject) { var cwd = process.cwd(); process.chdir(depositExecutable); var executable = path.join(depositExecutable, 'deposit.jar'); var executable = spawn('java', ['-jar', executable, subDir]); executable.stdout.on('data', function(data) { console.log(data.toString()); }); executable.stderr.on('data', function(data) { console.log('[Rosetta::deposit] Error during programm execution: ' + data.toString()); reject(data.toString()); }); executable.on('close', function(code) { if (code !== 0) { console.log('[Rosetta::deposit] child process exited with code ' + code); return reject('[Rosetta::deposit] child process exited with code ' + code); } console.log('[Rosetta::deposit] Successfully deposit ' + subDir); resolve(code); }); }); }; Rosetta.prototype.upload = function(sourceDir) { return new Promise(function(resolve, reject) { var uuid = sourceDir.split('/').pop(), privateKey = null; try { // FIXXME: add possibility to upload key! privateKey = fs.readFileSync('/home/hecher/.ssh/id_rsa-larissa'); } catch (err) { return reject('Private key for Rosetta upload could not be read.'); } var options = { host: 'exchange.tib.eu', username: 'duraark', path: sourceDir, remoteDir: '/tib_extern_deposit_duraark/tmp/' + uuid, privateKey: privateKey }, sftp = new Sftp(options); try { sftp.on('error', function(err) { console.log('Error connecting to SFTP: ' + err); reject('Error connecting to SFTP: ' + err); }) .on('uploading', function(pgs) { console.log('Uploading', pgs.file); console.log(pgs.percent + '% completed'); }) .on('completed', function() { console.log('Upload Completed'); resolve(sourceDir); }) .upload(); } catch (err) { console.log('Error creating connection to SFTP: ' + err); reject('Error creating connection to SFTP: ' + err); } }); }; Rosetta.prototype.start = function(sourceDir, output) { var rosetta = this; console.log('[Rosetta::start] configuration: ' + sourceDir + " --> " + output); return new Promise(function(resolve, reject) { console.log('[Rosetta::start] creating output Dir'); mkdirp(output, function(err) { if (err) return reject(err); var cwd = process.cwd(); process.chdir(rosettaExecutable); //JAVA -jar SIP _Generator.jar D:\input D:\output /exlibris1/transfer/tib_duraark // var args = [sourceDir, output, '/exlibris1/transfer/tib_duraark'], var executable = path.join(rosettaExecutable, 'SIP_Generator.jar'), args = ['-jar', executable, sourceDir, output, '/exlibris1/transfer/tib_extern_deposit_duraark']; console.log('[Rosetta::start] about to execute: java ' + args.join(' ')); var executable = spawn('java', args); executable.stdout.on('data', function(data) { console.log(data.toString()); }); executable.stderr.on('data', function(data) { console.log('[Rosetta::start] Error during programm execution: ' + data.toString()); }); executable.on('close', function(code) { if (code !== 0) { console.log('[Rosetta::start] child process exited with code ' + code); return reject('[Rosetta::start] child process exited with code ' + code); } console.log('[Rosetta::start] child process exited with code ' + code); rosetta.upload(output).then(function(sourceDir) { var deposits = []; var entities = getDirectories(sourceDir); for (var idx = 0; idx < entities.length; idx++) { var entity = entities[idx]; // var subDir = 'session_physicalasset_fa3a93318f644fe9bc97f781cdc1d501'; // var subDir = 'fa3a93318f644fe9bc97f781cdc1d501'; var subDir = path.join(sourceDir, entity); // var subDir = entity; deposits.push(rosetta.deposit(subDir)); } Promise.all(deposits).then(function() { console.log('deposit finished for all intellectual entities'); return resolve(output); }).catch(function(err) { return reject(err); }); }).catch(function(err) { console.log('Rosetta upload error: ' + err); return reject(err); }); }); }); }); }; function getDirectories(srcpath) { return fs.readdirSync(srcpath).filter(function(file) { return fs.statSync(path.join(srcpath, file)).isDirectory(); }); }
mit
brunetto/sltools-dev
cmd/kiraWrap/kiraWrap.go
1700
package main import ( "log" "time" "github.com/spf13/cobra" "github.com/brunetto/goutils/debug" "github.com/brunetto/sltools/slt" ) var ( noGPU, tf, as, noBinaries bool icsFileName string intTime string randomNumber string ) var kiraWrapCmd = &cobra.Command{ Use: "kiraWrap", Short: "Wrapper for the kira integrator", Long: `Wrap the kira integrator providing environment monitoring. The "no-GPU" flag allow you to run the non GPU version of kira if you installed kira-no-GPU in $HOME/bin/. Run with: kiraWrap (--no-GPU)`, Run: func(cmd *cobra.Command, args []string) { if icsFileName == "" || intTime == "" { log.Fatal("Provide an ICs file and the integration time.") } slt.KiraWrap(icsFileName, intTime, randomNumber, noGPU) }, } func InitCommands() { kiraWrapCmd.PersistentFlags().BoolVarP(&noGPU, "no-GPU", "n", false, "Run without GPU support if kira-no-GPU installed in $HOME/bin/.") kiraWrapCmd.PersistentFlags().BoolVarP(&tf, "tf", "f", false, "Run TF version of kira (debug strings).") kiraWrapCmd.PersistentFlags().BoolVarP(&as, "as", "a", false, "Run Allen-Santillan version of kira (debug strings).") kiraWrapCmd.PersistentFlags().BoolVarP(&noBinaries, "no-binaries", "b", false, "Switch off binary evolution.") kiraWrapCmd.PersistentFlags().StringVarP(&icsFileName, "ics", "i", "", "ICs file to start with.") kiraWrapCmd.PersistentFlags().StringVarP(&intTime, "time", "t", "", "Number of timestep to integrate before stop the simulation.") kiraWrapCmd.PersistentFlags().StringVarP(&randomNumber, "random", "s", "", "Random number.") } func main () () { defer debug.TimeMe(time.Now()) InitCommands() kiraWrapCmd.Execute() }
mit
cs3250-team6/msubanner
src/main/java/edu/msudenver/cs3250/group6/msubanner/entities/Professor.java
698
package edu.msudenver.cs3250.group6.msubanner.entities; /** * The professor class. */ public final class Professor extends User { /** * Default constructor, creates blank professor. */ public Professor() { } /** * Constructor. * * @param firstName professors first name * @param lastName professors last name */ public Professor(final String firstName, final String lastName) { super(firstName, lastName); } @Override public boolean equals(final Object other) { return other instanceof Professor && super.equals(other); } @Override public int hashCode() { return super.hashCode(); } }
mit
GerHobbelt/gulp-jison
LICENSE.md
1098
The MIT License (MIT) Copyright (c) 2014 Matt Eckert <[email protected]> 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.
mit
CharlieGreenman/pixelatorV2_with_react
app/js/_grid.js
3948
import elem from "./_elem.js"; import clrPckr from "./_color-picker.js"; var s, x, y, z, colorNum = 0, arrMap = [], c = document.getElementById("canvasGrid"), ctx = c.getContext("2d"); var grid = { //create grid and create boxes createGridIllustrator: () => { //module for creating a grid for(var r = 0; r < elem.s.columnCount; r++) { for(var i = 0; i < elem.s.rowCount; i++) { ctx.strokeStyle = "#262626"; ctx.strokeRect(r * elem.s.pixSize, i * elem.s.pixSize, elem.s.pixSize, elem.s.pixSize); ctx.fillStyle = elem.el.backgroundHexColor.value; ctx.fillRect(r * elem.s.pixSize + 1, i * elem.s.pixSize + 1, elem.s.pixSize - 2, elem.s.pixSize - 2); } } }, //allow individual boxes to be clicked // handleClick is still in prototyping phase handleClick: (e) => { clrPckr.pickBackgroundHexColor(); e = e || window.event; var xVal = Math.floor(e.offsetX === undefined ? e.layerX : e.offsetX / elem.s.pixSize) * elem.s.pixSize; var yVal = Math.floor(e.offsetY === undefined ? e.layerY : e.offsetY / elem.s.pixSize) * elem.s.pixSize; ctx.fillStyle = elem.el.hexColor.value; //get the color for the box clicked on var imgData = ctx.getImageData(Math.floor(e.offsetX / elem.s.pixSize) * elem.s.pixSize + 1, Math.floor(e.offsetY / elem.s.pixSize) * elem.s.pixSize + 1, elem.s.pixSize - 2, elem.s.pixSize - 2); //if it is the background grey/gray remove it //currently does not work with color change if(imgData.data[0] !== parseFloat(elem.el.backgroundRed.value) && imgData.data[1] !== parseFloat(elem.el.backgroundGreen.value) && imgData.data[2] !== parseFloat(elem.el.backgroundBlue.value)){ ctx.fillStyle = `rgba(${elem.el.backgroundRed.value}, ${elem.el.backgroundGreen.value}, ${elem.el.backgroundBlue.value}, 1)`; ctx.clearRect(Math.floor(e.offsetX / elem.s.pixSize) * elem.s.pixSize + 1, Math.floor(e.offsetY / elem.s.pixSize) * elem.s.pixSize + 1, elem.s.pixSize - 2, elem.s.pixSize - 2); ctx.fillRect(Math.floor(e.offsetX / elem.s.pixSize) * elem.s.pixSize + 1, Math.floor(e.offsetY / elem.s.pixSize) * elem.s.pixSize + 1, //accomodate for 2 px border //need to put in a variable down the line elem.s.pixSize - 2, elem.s.pixSize - 2); //elem.s.storeValues.indexOf([xVal, yVal, elem.el.hexColor.value]).pop(); //this return false is causing wonky behavior, should look into it return false; } ctx.fillRect(Math.floor(e.offsetX / elem.s.pixSize) * elem.s.pixSize + 1, Math.floor(e.offsetY / elem.s.pixSize) * elem.s.pixSize + 1, //accomodate for 2 px border //need to put in a variable down the line elem.s.pixSize - 2, elem.s.pixSize - 2); }, updateGridColor: () => { for(let x = 0; x < elem.s.columnCount; x++) { for(let y = 0; y < elem.s.rowCount; y++) { ctx.strokeStyle = `${elem.el.backgroundRed.value + 44}. ${elem.el.backgroundGreen.value + 44}. ${elem.el.backgroundBlue.value + 44}`; ctx.strokeRect(x * elem.s.pixSize, y * elem.s.pixSize, elem.s.pixSize, elem.s.pixSize); ctx.fillStyle = elem.el.backgroundHexColor.value; ctx.fillRect(x * elem.s.pixSize + 1, y * elem.s.pixSize + 1, elem.s.pixSize - 2, elem.s.pixSize - 2); } } for(let x = 0; x < elem.s.storeValues.length; x++){ ctx.fillStyle = elem.s.storeValues[x][2]; ctx.fillRect(parseFloat(elem.s.storeValues[x][0]) + 1, parseFloat(elem.s.storeValues[x][1]) + 1, elem.s.pixSize - 2, elem.s.pixSize - 2); } } }; export default grid;
mit
kellyrowland/openmc
tests/test_many_scores/test_many_scores.py
212
#!/usr/bin/env python import os import sys sys.path.insert(0, os.pardir) from testing_harness import TestHarness if __name__ == '__main__': harness = TestHarness('statepoint.5.*', True) harness.main()
mit
k-sheth/hapi-getting-started
tasks/test.js
1713
'use strict'; //https://gist.github.com/yannickcr/6129327b31b27b14efc5 const instrumenter = require('isparta').Instrumenter; module.exports = function (gulp, $, {src, testSrc, requires, coverageDir, disableCoverage}) { const runTest = function runTest() { return gulp.src(testSrc, {read: false}) .pipe($.mocha({ reporter: 'spec', ui: 'bdd', harmony: true, timeout: 2000000, require: requires })); }; const handleErrEnd = function handleErrEnd(pipe, cb) { return pipe .on('error', (err) => { $.gutil.log(`[test:cov]${err}`); }) .on('end', () => { cb(); const ct = setTimeout(() => { clearTimeout(ct); process.exit();//https://github.com/sindresorhus/gulp-mocha/issues/1 }, 5 * 1000);//let other tasks complete!, hopefully that will complete in 30s }); }; const gatherCoverage = function gatherCoverage(cb) { return gulp.src(src) .pipe($.istanbul({instrumenter})) .pipe($.istanbul.hookRequire()) .once('finish', () => { handleErrEnd(runTest() .pipe($.istanbul.writeReports({ dir: coverageDir, reporters: ['lcov', 'html', 'text', 'text-summary'], reportOpts: {dir: coverageDir} })), cb); }); }; return function test(cb) { disableCoverage ? handleErrEnd(runTest(), cb) : gatherCoverage(cb); }; };
mit
chefspec/chefspec
examples/group/spec/create_spec.rb
724
require 'chefspec' describe 'group::create' do platform 'ubuntu' describe 'creates a group with the default action' do it { is_expected.to create_group('default_action') } it { is_expected.to_not create_group('not_default_action') } end describe 'creates a group with an explicit action' do it { is_expected.to create_group('explicit_action') } end describe 'creates a group with attributes' do it { is_expected.to create_group('with_attributes').with(gid: 1234) } it { is_expected.to_not create_group('with_attributes').with(gid: 5678) } end describe 'creates a group when specifying the identity attribute' do it { is_expected.to create_group('identity_attribute') } end end
mit
gvaish/objectify-appengine
javadoc/com/googlecode/objectify/cache/package-frame.html
2711
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_29) on Wed Jan 25 23:03:17 EST 2012 --> <TITLE> com.googlecode.objectify.cache (Objectify-AppEngine Javadoc) </TITLE> <META NAME="date" CONTENT="2012-01-25"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../../com/googlecode/objectify/cache/package-summary.html" target="classFrame">com.googlecode.objectify.cache</A></FONT> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Interfaces</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="CacheControl.html" title="interface in com.googlecode.objectify.cache" target="classFrame"><I>CacheControl</I></A> <BR> <A HREF="MemcacheStats.html" title="interface in com.googlecode.objectify.cache" target="classFrame"><I>MemcacheStats</I></A></FONT></TD> </TR> </TABLE> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="AsyncCacheFilter.html" title="class in com.googlecode.objectify.cache" target="classFrame">AsyncCacheFilter</A> <BR> <A HREF="CachingAsyncDatastoreService.html" title="class in com.googlecode.objectify.cache" target="classFrame">CachingAsyncDatastoreService</A> <BR> <A HREF="CachingDatastoreService.html" title="class in com.googlecode.objectify.cache" target="classFrame">CachingDatastoreService</A> <BR> <A HREF="CachingDatastoreServiceFactory.html" title="class in com.googlecode.objectify.cache" target="classFrame">CachingDatastoreServiceFactory</A> <BR> <A HREF="EntityMemcache.html" title="class in com.googlecode.objectify.cache" target="classFrame">EntityMemcache</A> <BR> <A HREF="MemcacheServiceRetryProxy.html" title="class in com.googlecode.objectify.cache" target="classFrame">MemcacheServiceRetryProxy</A> <BR> <A HREF="MergeFuture.html" title="class in com.googlecode.objectify.cache" target="classFrame">MergeFuture</A> <BR> <A HREF="Pending.html" title="class in com.googlecode.objectify.cache" target="classFrame">Pending</A> <BR> <A HREF="TriggerFuture.html" title="class in com.googlecode.objectify.cache" target="classFrame">TriggerFuture</A> <BR> <A HREF="TriggerFutureHook.html" title="class in com.googlecode.objectify.cache" target="classFrame">TriggerFutureHook</A> <BR> <A HREF="TriggerSuccessFuture.html" title="class in com.googlecode.objectify.cache" target="classFrame">TriggerSuccessFuture</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
mit
daryllabar/XrmUnitTest
DLaB.Xrm.Entities/OptionSets/QueueItem_ObjectTypeCode.cs
3210
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace DLaB.Xrm.Entities { [System.Runtime.Serialization.DataContractAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9154")] public enum QueueItem_ObjectTypeCode { [System.Runtime.Serialization.EnumMemberAttribute()] Activity = 4200, [System.Runtime.Serialization.EnumMemberAttribute()] AgreementBookingDate = 10110, [System.Runtime.Serialization.EnumMemberAttribute()] AgreementBookingSetup = 10115, [System.Runtime.Serialization.EnumMemberAttribute()] AgreementInvoiceDate = 10116, [System.Runtime.Serialization.EnumMemberAttribute()] AgreementInvoiceSetup = 10118, [System.Runtime.Serialization.EnumMemberAttribute()] Appointment = 4201, [System.Runtime.Serialization.EnumMemberAttribute()] Approval = 10034, [System.Runtime.Serialization.EnumMemberAttribute()] BookingAlert = 10009, [System.Runtime.Serialization.EnumMemberAttribute()] CampaignActivity = 4402, [System.Runtime.Serialization.EnumMemberAttribute()] CampaignResponse = 4401, [System.Runtime.Serialization.EnumMemberAttribute()] Case = 112, [System.Runtime.Serialization.EnumMemberAttribute()] Email = 4202, [System.Runtime.Serialization.EnumMemberAttribute()] Fax = 4204, [System.Runtime.Serialization.EnumMemberAttribute()] InventoryAdjustment = 10135, [System.Runtime.Serialization.EnumMemberAttribute()] InventoryTransfer = 10138, [System.Runtime.Serialization.EnumMemberAttribute()] KnowledgeArticle = 9953, [System.Runtime.Serialization.EnumMemberAttribute()] Letter = 4207, [System.Runtime.Serialization.EnumMemberAttribute()] PhoneCall = 4210, [System.Runtime.Serialization.EnumMemberAttribute()] Project = 10071, [System.Runtime.Serialization.EnumMemberAttribute()] ProjectTask = 10076, [System.Runtime.Serialization.EnumMemberAttribute()] QuickCampaign = 4406, [System.Runtime.Serialization.EnumMemberAttribute()] RecurringAppointment = 4251, [System.Runtime.Serialization.EnumMemberAttribute()] ResourceRequest = 10093, [System.Runtime.Serialization.EnumMemberAttribute()] ServiceActivity = 4214, [System.Runtime.Serialization.EnumMemberAttribute()] SocialActivity = 4216, [System.Runtime.Serialization.EnumMemberAttribute()] Task = 4212, [System.Runtime.Serialization.EnumMemberAttribute()] TimeGroup = 10029, [System.Runtime.Serialization.EnumMemberAttribute()] TimeGroupDetail = 10030, [System.Runtime.Serialization.EnumMemberAttribute()] WorkOrder = 10178, [System.Runtime.Serialization.EnumMemberAttribute()] WorkOrderIncident = 10181, [System.Runtime.Serialization.EnumMemberAttribute()] WorkOrderService = 10184, [System.Runtime.Serialization.EnumMemberAttribute()] WorkOrderServiceTask = 10185, } }
mit
bertucho/moviestalk
venv/Scripts/activate.bat
570
@echo off set VIRTUAL_ENV=c:\webs\moviestalk\venv if not defined PROMPT ( set PROMPT=$P$G ) if defined _OLD_VIRTUAL_PROMPT ( set PROMPT=%_OLD_VIRTUAL_PROMPT% ) if defined _OLD_VIRTUAL_PYTHONHOME ( set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME% ) set _OLD_VIRTUAL_PROMPT=%PROMPT% set PROMPT=(venv) %PROMPT% if defined PYTHONHOME ( set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME% set PYTHONHOME= ) if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%; goto SKIPPATH set _OLD_VIRTUAL_PATH=%PATH% :SKIPPATH set PATH=%VIRTUAL_ENV%\Scripts;%PATH% :END
mit
vimeo/bosun
cmd/scollector/collectors/network_windows.go
16465
package collectors import ( "fmt" "math" "regexp" "strings" "time" "bosun.org/_third_party/github.com/StackExchange/wmi" "bosun.org/metadata" "bosun.org/opentsdb" "bosun.org/slog" ) func init() { collectors = append(collectors, &IntervalCollector{F: c_network_windows, init: winNetworkInit}) c := &IntervalCollector{ F: c_network_team_windows, } // Make sure MSFT_NetImPlatAdapter and MSFT_NetAdapterStatisticsSettingData // are valid WMI classes when initializing c_network_team_windows c.init = func() { var dstTeamNic []MSFT_NetLbfoTeamNic var dstStats []MSFT_NetAdapterStatisticsSettingData queryTeamAdapter = wmi.CreateQuery(&dstTeamNic, "") queryTeamStats = wmi.CreateQuery(&dstStats, "") c.Enable = func() bool { errTeamNic := queryWmiNamespace(queryTeamAdapter, &dstTeamNic, namespaceStandardCimv2) errStats := queryWmiNamespace(queryTeamStats, &dstStats, namespaceStandardCimv2) return errTeamNic == nil && errStats == nil } } collectors = append(collectors, c) } var ( queryTeamStats string queryTeamAdapter string namespaceStandardCimv2 = "root\\StandardCimv2" interfaceExclusions = regexp.MustCompile("isatap|Teredo") // instanceNameToUnderscore matches '#' '/' and '\' for replacing with '_'. instanceNameToUnderscore = regexp.MustCompile("[#/\\\\]") mNicInstanceNameToInterfaceIndex = make(map[string]string) ) // winNetworkToInstanceName converts a Network Adapter Name to the InstanceName // that is used in Win32_PerfRawData_Tcpip_NetworkInterface. func winNetworkToInstanceName(Name string) string { instanceName := Name instanceName = strings.Replace(instanceName, "(", "[", -1) instanceName = strings.Replace(instanceName, ")", "]", -1) instanceName = instanceNameToUnderscore.ReplaceAllString(instanceName, "_") return instanceName } // winNetworkInit maintains a mapping of InstanceName to InterfaceIndex func winNetworkInit() { update := func() { var dstNetworkAdapter []Win32_NetworkAdapter q := wmi.CreateQuery(&dstNetworkAdapter, "WHERE PhysicalAdapter=True and MACAddress <> null") err := queryWmi(q, &dstNetworkAdapter) if err != nil { slog.Error(err) return } for _, nic := range dstNetworkAdapter { var iface = fmt.Sprint("Interface", nic.InterfaceIndex) //Get PnPName using Win32_PnPEntity class var pnpname = "" var escapeddeviceid = strings.Replace(nic.PNPDeviceID, "\\", "\\\\", -1) var filter = fmt.Sprintf("WHERE DeviceID='%s'", escapeddeviceid) var dstPnPName []Win32_PnPEntity q = wmi.CreateQuery(&dstPnPName, filter) err = queryWmi(q, &dstPnPName) if err != nil { slog.Error(err) return } for _, pnp := range dstPnPName { //Really should be a single item pnpname = pnp.Name } if pnpname == "" { slog.Errorf("%s cannot find Win32_PnPEntity %s", iface, filter) continue } //Convert to instance name (see http://goo.gl/jfq6pq ) instanceName := winNetworkToInstanceName(pnpname) mNicInstanceNameToInterfaceIndex[instanceName] = iface } } update() go func() { for range time.Tick(time.Minute * 5) { update() } }() } func c_network_windows() (opentsdb.MultiDataPoint, error) { var dstStats []Win32_PerfRawData_Tcpip_NetworkInterface var q = wmi.CreateQuery(&dstStats, "") err := queryWmi(q, &dstStats) if err != nil { return nil, err } var md opentsdb.MultiDataPoint for _, nicStats := range dstStats { if interfaceExclusions.MatchString(nicStats.Name) { continue } iface := mNicInstanceNameToInterfaceIndex[nicStats.Name] if iface == "" { continue } //This does NOT include TEAM network adapters. Those will go to os.net.bond tagsIn := opentsdb.TagSet{"iface": iface, "direction": "in"} tagsOut := opentsdb.TagSet{"iface": iface, "direction": "out"} Add(&md, "win.net.ifspeed", nicStats.CurrentBandwidth, opentsdb.TagSet{"iface": iface}, metadata.Gauge, metadata.BitsPerSecond, descWinNetCurrentBandwidth) Add(&md, "win.net.bytes", nicStats.BytesReceivedPersec, tagsIn, metadata.Counter, metadata.BytesPerSecond, descWinNetBytesReceivedPersec) Add(&md, "win.net.bytes", nicStats.BytesSentPersec, tagsOut, metadata.Counter, metadata.BytesPerSecond, descWinNetBytesSentPersec) Add(&md, "win.net.packets", nicStats.PacketsReceivedPersec, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetPacketsReceivedPersec) Add(&md, "win.net.packets", nicStats.PacketsSentPersec, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetPacketsSentPersec) Add(&md, "win.net.dropped", nicStats.PacketsOutboundDiscarded, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetPacketsOutboundDiscarded) Add(&md, "win.net.dropped", nicStats.PacketsReceivedDiscarded, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetPacketsReceivedDiscarded) Add(&md, "win.net.errs", nicStats.PacketsOutboundErrors, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetPacketsOutboundErrors) Add(&md, "win.net.errs", nicStats.PacketsReceivedErrors, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetPacketsReceivedErrors) Add(&md, osNetBytes, nicStats.BytesReceivedPersec, tagsIn, metadata.Counter, metadata.BytesPerSecond, osNetBytesDesc) Add(&md, osNetBytes, nicStats.BytesSentPersec, tagsOut, metadata.Counter, metadata.BytesPerSecond, osNetBytesDesc) Add(&md, osNetPackets, nicStats.PacketsReceivedPersec, tagsIn, metadata.Counter, metadata.PerSecond, osNetPacketsDesc) Add(&md, osNetPackets, nicStats.PacketsSentPersec, tagsOut, metadata.Counter, metadata.PerSecond, osNetPacketsDesc) Add(&md, osNetDropped, nicStats.PacketsOutboundDiscarded, tagsOut, metadata.Counter, metadata.PerSecond, osNetDroppedDesc) Add(&md, osNetDropped, nicStats.PacketsReceivedDiscarded, tagsIn, metadata.Counter, metadata.PerSecond, osNetDroppedDesc) Add(&md, osNetErrors, nicStats.PacketsOutboundErrors, tagsOut, metadata.Counter, metadata.PerSecond, osNetErrorsDesc) Add(&md, osNetErrors, nicStats.PacketsReceivedErrors, tagsIn, metadata.Counter, metadata.PerSecond, osNetErrorsDesc) } return md, nil } const ( descWinNetCurrentBandwidth = "Estimate of the interface's current bandwidth in bits per second (bps). For interfaces that do not vary in bandwidth or for those where no accurate estimation can be made, this value is the nominal bandwidth." descWinNetBytesReceivedPersec = "Bytes Received/sec is the rate at which bytes are received over each network adapter, including framing characters. Network Interface\\Bytes Received/sec is a subset of Network Interface\\Bytes Total/sec." descWinNetBytesSentPersec = "Bytes Sent/sec is the rate at which bytes are sent over each network adapter, including framing characters. Network Interface\\Bytes Sent/sec is a subset of Network Interface\\Bytes Total/sec." descWinNetPacketsReceivedPersec = "Packets Received/sec is the rate at which packets are received on the network interface." descWinNetPacketsSentPersec = "Packets Sent/sec is the rate at which packets are sent on the network interface." descWinNetPacketsOutboundDiscarded = "Packets Outbound Discarded is the number of outbound packets that were chosen to be discarded even though no errors had been detected to prevent transmission. One possible reason for discarding packets could be to free up buffer space." descWinNetPacketsReceivedDiscarded = "Packets Received Discarded is the number of inbound packets that were chosen to be discarded even though no errors had been detected to prevent their delivery to a higher-layer protocol. One possible reason for discarding packets could be to free up buffer space." descWinNetPacketsOutboundErrors = "Packets Outbound Errors is the number of outbound packets that could not be transmitted because of errors." descWinNetPacketsReceivedErrors = "Packets Received Errors is the number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol." ) type Win32_PnPEntity struct { Name string //Intel(R) Gigabit ET Quad Port Server Adapter #3 } type Win32_NetworkAdapter struct { Description string //Intel(R) Gigabit ET Quad Port Server Adapter (no index) InterfaceIndex uint32 PNPDeviceID string } type Win32_PerfRawData_Tcpip_NetworkInterface struct { CurrentBandwidth uint32 BytesReceivedPersec uint32 BytesSentPersec uint32 Name string PacketsOutboundDiscarded uint32 PacketsOutboundErrors uint32 PacketsReceivedDiscarded uint32 PacketsReceivedErrors uint32 PacketsReceivedPersec uint32 PacketsSentPersec uint32 } // c_network_team_windows will add metrics for team network adapters from // MSFT_NetAdapterStatisticsSettingData for any adapters that are in // MSFT_NetLbfoTeamNic and have a valid instanceName. func c_network_team_windows() (opentsdb.MultiDataPoint, error) { var dstTeamNic []*MSFT_NetLbfoTeamNic err := queryWmiNamespace(queryTeamAdapter, &dstTeamNic, namespaceStandardCimv2) if err != nil { return nil, err } var dstStats []MSFT_NetAdapterStatisticsSettingData err = queryWmiNamespace(queryTeamStats, &dstStats, namespaceStandardCimv2) if err != nil { return nil, err } mDescriptionToTeamNic := make(map[string]*MSFT_NetLbfoTeamNic) for _, teamNic := range dstTeamNic { mDescriptionToTeamNic[teamNic.InterfaceDescription] = teamNic } var md opentsdb.MultiDataPoint for _, nicStats := range dstStats { TeamNic := mDescriptionToTeamNic[nicStats.InterfaceDescription] if TeamNic == nil { continue } instanceName := winNetworkToInstanceName(nicStats.InterfaceDescription) iface := mNicInstanceNameToInterfaceIndex[instanceName] if iface == "" { continue } tagsIn := opentsdb.TagSet{"iface": iface, "direction": "in"} tagsOut := opentsdb.TagSet{"iface": iface, "direction": "out"} linkSpeed := math.Min(float64(TeamNic.ReceiveLinkSpeed), float64(TeamNic.Transmitlinkspeed)) Add(&md, "win.net.bond.ifspeed", linkSpeed, opentsdb.TagSet{"iface": iface}, metadata.Gauge, metadata.BitsPerSecond, descWinNetTeamlinkspeed) Add(&md, "win.net.bond.bytes", nicStats.ReceivedBytes, tagsIn, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamReceivedBytes) Add(&md, "win.net.bond.bytes", nicStats.SentBytes, tagsOut, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamSentBytes) Add(&md, "win.net.bond.bytes_unicast", nicStats.ReceivedUnicastBytes, tagsIn, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamReceivedUnicastBytes) Add(&md, "win.net.bond.bytes_unicast", nicStats.SentUnicastBytes, tagsOut, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamSentUnicastBytes) Add(&md, "win.net.bond.bytes_broadcast", nicStats.ReceivedBroadcastBytes, tagsIn, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamReceivedBroadcastBytes) Add(&md, "win.net.bond.bytes_broadcast", nicStats.SentBroadcastBytes, tagsOut, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamSentBroadcastBytes) Add(&md, "win.net.bond.bytes_multicast", nicStats.ReceivedMulticastBytes, tagsIn, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamReceivedMulticastBytes) Add(&md, "win.net.bond.bytes_multicast", nicStats.SentMulticastBytes, tagsOut, metadata.Counter, metadata.BytesPerSecond, descWinNetTeamSentMulticastBytes) Add(&md, "win.net.bond.packets_unicast", nicStats.ReceivedUnicastPackets, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetTeamReceivedUnicastPackets) Add(&md, "win.net.bond.packets_unicast", nicStats.SentUnicastPackets, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetTeamSentUnicastPackets) Add(&md, "win.net.bond.dropped", nicStats.ReceivedDiscardedPackets, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetTeamReceivedDiscardedPackets) Add(&md, "win.net.bond.dropped", nicStats.OutboundDiscardedPackets, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetTeamOutboundDiscardedPackets) Add(&md, "win.net.bond.errs", nicStats.ReceivedPacketErrors, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetTeamReceivedPacketErrors) Add(&md, "win.net.bond.errs", nicStats.OutboundPacketErrors, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetTeamOutboundPacketErrors) Add(&md, "win.net.bond.packets_multicast", nicStats.ReceivedMulticastPackets, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetTeamReceivedMulticastPackets) Add(&md, "win.net.bond.packets_multicast", nicStats.SentMulticastPackets, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetTeamSentMulticastPackets) Add(&md, "win.net.bond.packets_broadcast", nicStats.ReceivedBroadcastPackets, tagsIn, metadata.Counter, metadata.PerSecond, descWinNetTeamReceivedBroadcastPackets) Add(&md, "win.net.bond.packets_broadcast", nicStats.SentBroadcastPackets, tagsOut, metadata.Counter, metadata.PerSecond, descWinNetTeamSentBroadcastPackets) //Todo: add os.net.bond metrics once we confirm they have the same metadata } return md, nil } const ( descWinNetTeamlinkspeed = "The link speed of the adapter in bits per second." descWinNetTeamReceivedBytes = "The number of bytes of data received without errors through this interface. This value includes bytes in unicast, broadcast, and multicast packets." descWinNetTeamReceivedUnicastPackets = "The number of unicast packets received without errors through this interface." descWinNetTeamReceivedMulticastPackets = "The number of multicast packets received without errors through this interface." descWinNetTeamReceivedBroadcastPackets = "The number of broadcast packets received without errors through this interface." descWinNetTeamReceivedUnicastBytes = "The number of unicast bytes received without errors through this interface." descWinNetTeamReceivedMulticastBytes = "The number of multicast bytes received without errors through this interface." descWinNetTeamReceivedBroadcastBytes = "The number of broadcast bytes received without errors through this interface." descWinNetTeamReceivedDiscardedPackets = "The number of inbound packets which were chosen to be discarded even though no errors were detected to prevent the packets from being deliverable to a higher-layer protocol." descWinNetTeamReceivedPacketErrors = "The number of incoming packets that were discarded because of errors." descWinNetTeamSentBytes = "The number of bytes of data transmitted without errors through this interface. This value includes bytes in unicast, broadcast, and multicast packets." descWinNetTeamSentUnicastPackets = "The number of unicast packets transmitted without errors through this interface." descWinNetTeamSentMulticastPackets = "The number of multicast packets transmitted without errors through this interface." descWinNetTeamSentBroadcastPackets = "The number of broadcast packets transmitted without errors through this interface." descWinNetTeamSentUnicastBytes = "The number of unicast bytes transmitted without errors through this interface." descWinNetTeamSentMulticastBytes = "The number of multicast bytes transmitted without errors through this interface." descWinNetTeamSentBroadcastBytes = "The number of broadcast bytes transmitted without errors through this interface." descWinNetTeamOutboundDiscardedPackets = "The number of outgoing packets that were discarded even though they did not have errors." descWinNetTeamOutboundPacketErrors = "The number of outgoing packets that were discarded because of errors." ) type MSFT_NetLbfoTeamNic struct { Team string Name string ReceiveLinkSpeed uint64 Transmitlinkspeed uint64 InterfaceDescription string } type MSFT_NetAdapterStatisticsSettingData struct { InstanceID string Name string InterfaceDescription string ReceivedBytes uint64 ReceivedUnicastPackets uint64 ReceivedMulticastPackets uint64 ReceivedBroadcastPackets uint64 ReceivedUnicastBytes uint64 ReceivedMulticastBytes uint64 ReceivedBroadcastBytes uint64 ReceivedDiscardedPackets uint64 ReceivedPacketErrors uint64 SentBytes uint64 SentUnicastPackets uint64 SentMulticastPackets uint64 SentBroadcastPackets uint64 SentUnicastBytes uint64 SentMulticastBytes uint64 SentBroadcastBytes uint64 OutboundDiscardedPackets uint64 OutboundPacketErrors uint64 }
mit
biotcm/biotcm
bm/biotcm/bm_table.rb
1478
require_relative '../bm_helper' RUN_TIMES = 10 MyBenchmark.group 'Table initialization' do |b| # Current method used by Table#new b.report('String#to_table') do RUN_TIMES.times do File.open('bm/fixtures/table_1.txt').read.to_table end end b.report('Table#row:Hash') do RUN_TIMES.times do fin = File.open('bm/fixtures/table_1.txt') # Fill column names col_names = fin.gets.chomp.split("\t") tab = BioTCM::Table.new(primary_key: col_names.shift, col_keys: col_names) # Insert rows fin.each do |line| col = line.chomp.split("\t", -1) val = { col_names[0] => col[1], col_names[1] => col[2] } tab.row(col[0], val) end end end b.report('Table#row:Array') do RUN_TIMES.times do fin = File.open('bm/fixtures/table_1.txt') # Fill column names col_names = fin.gets.chomp.split("\t") tab = BioTCM::Table.new(primary_key: col_names.shift, col_keys: col_names) # Insert rows fin.each do |line| col = line.chomp.split("\t", -1) tab.row(col.shift, col) end end end end @tab1 = BioTCM::Table.load('bm/fixtures/table_1.txt') @tab2 = BioTCM::Table.load('bm/fixtures/table_2.txt') MyBenchmark.group 'Table operation' do |b| b.report('merge') do RUN_TIMES.times do @tab = @tab1.merge(@tab2) end end b.report('select') do RUN_TIMES.times do @tab.select_col(%w(Name Fullname)) end end end
mit
DMDcoin/Diamond
src/qt/walletview.h
4689
// Copyright (c) 2011-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_WALLETVIEW_H #define BITCOIN_QT_WALLETVIEW_H #include "amount.h" #include "masternodelist.h" #include <QStackedWidget> class BitcoinGUI; class ClientModel; class OverviewPage; class Coinmix; class ReceiveCoinsDialog; class SendCoinsDialog; class SendCoinsRecipient; class TransactionView; class WalletModel; class BlockExplorer; QT_BEGIN_NAMESPACE class QLabel; class QModelIndex; class QProgressDialog; QT_END_NAMESPACE /* WalletView class. This class represents the view to a single wallet. It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance. It communicates with both the client and the wallet models to give the user an up-to-date view of the current core state. */ class WalletView : public QStackedWidget { Q_OBJECT public: explicit WalletView(QWidget* parent); ~WalletView(); void setBitcoinGUI(BitcoinGUI* gui); /** Set the client model. The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic. */ void setClientModel(ClientModel* clientModel); /** Set the wallet model. The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending functionality. */ void setWalletModel(WalletModel* walletModel); bool handlePaymentRequest(const SendCoinsRecipient& recipient); void showOutOfSyncWarning(bool fShow); private: ClientModel* clientModel; WalletModel* walletModel; OverviewPage* overviewPage; //AAAA //QWidget* coinmix; //Coinmix* coinmix; QWidget* transactionsPage; ReceiveCoinsDialog* receiveCoinsPage; SendCoinsDialog* sendCoinsPage; BlockExplorer* explorerWindow; MasternodeList* masternodeListPage; TransactionView* transactionView; QProgressDialog* progressDialog; QLabel* transactionSum; public slots: /** Switch to overview (home) page */ void gotoOverviewPage(); ///AAAA /** Switch to overview (home) page */ // void gotocoinmixPage(); /** Switch to history (transactions) page */ void gotoHistoryPage(); /** Switch to masternode page */ void gotoMasternodePage(); /** Switch to explorer page */ void gotoBlockExplorerPage(); /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ void gotoSendCoinsPage(QString addr = ""); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); /** Show Sign/Verify Message dialog and switch to verify message tab */ void gotoVerifyMessageTab(QString addr = ""); /** Show MultiSend Dialog */ void gotoMultiSendDialog(); /** Show a multisig tab **/ void gotoMultisigDialog(int index); /** Show BIP 38 tool - default to Encryption tab */ void gotoBip38Tool(); /** Show incoming transaction notification for new transactions. The new items are those between start and end inclusive, under the given parent item. */ void processNewTransaction(const QModelIndex& parent, int start, int /*end*/); /** Encrypt the wallet */ void encryptWallet(bool status); /** Backup the wallet */ void backupWallet(); /** Change encrypted wallet passphrase */ void changePassphrase(); /** Ask for passphrase to unlock wallet temporarily */ void unlockWallet(); /** Lock wallet */ void lockWallet(); /** Show used sending addresses */ void usedSendingAddresses(); /** Show used receiving addresses */ void usedReceivingAddresses(); /** Re-emit encryption status signal */ void updateEncryptionStatus(); /** Show progress dialog e.g. for rescan */ void showProgress(const QString& title, int nProgress); /** Update selected DMD amount from transactionview */ void trxAmount(QString amount); signals: /** Signal that we want to show the main window */ void showNormalIfMinimized(); /** Fired when a message should be reported to the user */ void message(const QString& title, const QString& message, unsigned int style); /** Encryption status of wallet changed */ void encryptionStatusChanged(int status); /** Notify that a new transaction appeared */ void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address); }; #endif // BITCOIN_QT_WALLETVIEW_H
mit
dplarson/gitlabhq
lib/github/representation/pull_request.rb
3306
module Github module Representation class PullRequest < Representation::Issuable delegate :user, :repo, :ref, :sha, to: :source_branch, prefix: true delegate :user, :exists?, :repo, :ref, :sha, :short_sha, to: :target_branch, prefix: true def source_project project end def source_branch_name @source_branch_name ||= if cross_project? || !source_branch_exists? source_branch_name_prefixed else source_branch_ref end end def source_branch_exists? return @source_branch_exists if defined?(@source_branch_exists) @source_branch_exists = !cross_project? && source_branch.exists? end def target_project project end def target_branch_name @target_branch_name ||= target_branch_exists? ? target_branch_ref : target_branch_name_prefixed end def target_branch_exists? @target_branch_exists ||= target_branch.exists? end def state return 'merged' if raw['state'] == 'closed' && raw['merged_at'].present? return 'closed' if raw['state'] == 'closed' 'opened' end def opened? state == 'opened' end def valid? source_branch.valid? && target_branch.valid? end def restore_branches! restore_source_branch! restore_target_branch! end def remove_restored_branches! return if opened? remove_source_branch! remove_target_branch! end private def project @project ||= options.fetch(:project) end def source_branch @source_branch ||= Representation::Branch.new(raw['head'], repository: project.repository) end def source_branch_name_prefixed "gh-#{target_branch_short_sha}/#{iid}/#{source_branch_user}/#{source_branch_ref}" end def target_branch @target_branch ||= Representation::Branch.new(raw['base'], repository: project.repository) end def target_branch_name_prefixed "gl-#{target_branch_short_sha}/#{iid}/#{target_branch_user}/#{target_branch_ref}" end def cross_project? return true if source_branch_repo.nil? source_branch_repo.id != target_branch_repo.id end def restore_source_branch! return if source_branch_exists? source_branch.restore!(source_branch_name) end def restore_target_branch! return if target_branch_exists? target_branch.restore!(target_branch_name) end def remove_source_branch! # We should remove the source/target branches only if they were # restored. Otherwise, we'll remove branches like 'master' that # target_branch_exists? returns true. In other words, we need # to clean up only the restored branches that (source|target)_branch_exists? # returns false for the first time it has been called, because of # this that is important to memoize these values. source_branch.remove!(source_branch_name) unless source_branch_exists? end def remove_target_branch! target_branch.remove!(target_branch_name) unless target_branch_exists? end end end end
mit
mozu-customer-success/Mozu.Integrations.Quickbooks
src/main/java/com/mozu/qbintegration/model/qbmodel/allgen/CheckModRsType.java
5304
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.09.07 at 08:01:35 PM IST // package com.mozu.qbintegration.model.qbmodel.allgen; import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CheckModRsType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CheckModRsType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element ref="{}CheckRet" minOccurs="0"/> * &lt;element ref="{}ErrorRecovery" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="requestID" type="{}STRTYPE" /> * &lt;attribute name="statusCode" use="required" type="{}INTTYPE" /> * &lt;attribute name="statusSeverity" use="required" type="{}STRTYPE" /> * &lt;attribute name="statusMessage" type="{}STRTYPE" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CheckModRsType", propOrder = { "checkRet", "errorRecovery" }) public class CheckModRsType { @XmlElement(name = "CheckRet") protected CheckRet checkRet; @XmlElement(name = "ErrorRecovery") protected ErrorRecovery errorRecovery; @XmlAttribute(name = "requestID") protected String requestID; @XmlAttribute(name = "statusCode", required = true) protected BigInteger statusCode; @XmlAttribute(name = "statusSeverity", required = true) protected String statusSeverity; @XmlAttribute(name = "statusMessage") protected String statusMessage; /** * Gets the value of the checkRet property. * * @return * possible object is * {@link CheckRet } * */ public CheckRet getCheckRet() { return checkRet; } /** * Sets the value of the checkRet property. * * @param value * allowed object is * {@link CheckRet } * */ public void setCheckRet(CheckRet value) { this.checkRet = value; } /** * Gets the value of the errorRecovery property. * * @return * possible object is * {@link ErrorRecovery } * */ public ErrorRecovery getErrorRecovery() { return errorRecovery; } /** * Sets the value of the errorRecovery property. * * @param value * allowed object is * {@link ErrorRecovery } * */ public void setErrorRecovery(ErrorRecovery value) { this.errorRecovery = value; } /** * Gets the value of the requestID property. * * @return * possible object is * {@link String } * */ public String getRequestID() { return requestID; } /** * Sets the value of the requestID property. * * @param value * allowed object is * {@link String } * */ public void setRequestID(String value) { this.requestID = value; } /** * Gets the value of the statusCode property. * * @return * possible object is * {@link BigInteger } * */ public BigInteger getStatusCode() { return statusCode; } /** * Sets the value of the statusCode property. * * @param value * allowed object is * {@link BigInteger } * */ public void setStatusCode(BigInteger value) { this.statusCode = value; } /** * Gets the value of the statusSeverity property. * * @return * possible object is * {@link String } * */ public String getStatusSeverity() { return statusSeverity; } /** * Sets the value of the statusSeverity property. * * @param value * allowed object is * {@link String } * */ public void setStatusSeverity(String value) { this.statusSeverity = value; } /** * Gets the value of the statusMessage property. * * @return * possible object is * {@link String } * */ public String getStatusMessage() { return statusMessage; } /** * Sets the value of the statusMessage property. * * @param value * allowed object is * {@link String } * */ public void setStatusMessage(String value) { this.statusMessage = value; } }
mit
sgpm-generator/sgpm-generator
singapore-gurkha-photography-museum/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-18.html
8592
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title> Singapore Gurkhas 050116 Gcspf Gurkha Contingent Archives Cbg 18</title> <!-- URL Structures --> <link rel="canonical" href="http://sgpm-generator.github.io/singapore-gurkha-photography-museum/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-18.html"> <link rel="alternate" type="application/rss+xml" title="Singapore Gurkha Photography Museum" href="http://sgpm-generator.github.io/feed.xml"> <!-- OPENGRAPH tags for Social Media linking --> <meta content="Singapore Gurkha Photography Museum" property="og:site_name"> <meta content=" Singapore Gurkhas 050116 Gcspf Gurkha Contingent Archives Cbg 18" property="og:title"> <meta content="article" property="og:type"> <meta name="description" content=" &lt;h1&gt;&lt;/h1&gt; {"1950s"=&gt;[#&lt;Jekyll::Document _posts/2014-10-11--singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-kbg-26.md collect..." property="og:description"> <meta content="http://sgpm-generator.github.io/singapore-gurkha-photography-museum/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-18.html" property="og:url"> <meta content="2014-10-09T00:00:00+08:00" property="article:published_time"> <meta content="http://sgpm-generator.github.io/about/" property="article:author"> <meta content="" property="og:image"> <meta content="singapore-gurkha-photography-museum" property="article:section"> <meta content="1950s" property="article:tag"> <meta content="1960s" property="article:tag"> <meta content="1970s" property="article:tag"> <meta content="1980s" property="article:tag"> <meta content="1990s" property="article:tag"> <meta content="bhairahawa" property="article:tag"> <meta content="dharan" property="article:tag"> <meta content="gurkhas" property="article:tag"> <meta content="kathmandu" property="article:tag"> <meta content="nepal" property="article:tag"> <meta content="pokhara" property="article:tag"> <meta content="singapore" property="article:tag"> <meta content="singapore gurkha archive" property="article:tag"> <meta content="singapore gurkha old photographs" property="article:tag"> <meta content="singapore gurkha photography museum" property="article:tag"> <meta content="singapore gurkhas" property="article:tag"> <!-- OPENGRAPH tags end --> <!-- CSS --> <link rel="stylesheet" href="/css/bootstrap.min.css"> <link rel="stylesheet" href="/css/bootstrap-theme.min.css"> <!-- Custom CSS --> <style> @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700italic,700,400italic); .sgpm-title a { color: #030303; } .main-gallery > ul { margin-bottom:1.414em; padding-left:0; } .no-bullets { list-style:none; padding-left:0; } .no-bullets > ul { list-style:none; padding-left:0; } body {min-width:420px;} footer { margin-top:2.84em; padding-top:1.414em; border-top:0.3px solid #aaa ; } header { margin-bottom:2.84em; } main { display:block; clear:both; } </style> </head> <body class="container"> <header class="row"> <!-- masthead --> <div class="col-xs-4" style="display:table-block;"> <h1 class="sgpm-title hidden-xs hidden-sm"><strong><a class="site-title" href="/">Singapore Gurkha Photography Museum</a></strong></h1> <h2 class="sgpm-title visible-sm"><strong><a class="site-title" href="/">Singapore Gurkha Photography Museum</a></strong></h2> <h3 class="sgpm-title visible-xs"><strong><a class="site-title" href="/">Singapore Gurkha Photography Museum</a></strong></h3> <!-- searchbar--> <div class=""> <div class="input-group"> <input type="text" class="form-control" placeholder="Search for..."> <span class="input-group-btn"> <button class="btn btn-default" type="button"><span class="hidden-xs">Search</span><span class="visible-xs">Go</span></button> </span> </div> </div> <!-- searchbar end --> </div> <!-- masthead end --> <nav class="col-xs-4 col-xs-offset-2 col-sm-offset-1"> <ul class="nav col-xs-12" style="padding-top:1.41em;border-left:solid 0.3px #aaa" > <!-- navlinks --> <li class="active"> <a href="/about.html">About</a> </li> <li class="active"> <a href="/archive.html">Archive</a> </li> <li class="active"> <a href="/articles.html">Articles</a> </li> <li class="active"> <a href="/contact.html">Contact</a> </li> <!-- navlinks end--> <!-- dev links --> <li class="small">(these are links for development)</li> <li class="active"> <a href="/sgpm-list.html">Brute Force List</a> </li> <li class="active"> <a href="/basic-generator.html">Brute Generator</a> </li> <!-- dev links end--> </ul> </nav> </header> <main class="row"> <section class="col-sm-6 col-xs-12"> <a href="../img/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-CBG-18.jpg"> <img class="img-responsive" src="../img/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-CBG-18.jpg" /> </a> </section> <section class="col-sm-6 col-xs-12"> <ul style="list-style:none;margin-left:0;"> <li><h3>Photo from: ChandraBahadurGurung-SingaporeGurkhaPhotographyMuseum</h3></li> <li> </li> <a href="/tags/1950s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1950s </li></a> <a href="/tags/1960s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1960s </li></a> <a href="/tags/1970s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1970s </li></a> <a href="/tags/1980s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1980s </li></a> <a href="/tags/1990s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1990s </li></a> <a href="/tags/bhairahawa" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> bhairahawa </li></a> <a href="/tags/dharan" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> dharan </li></a> <a href="/tags/gurkhas" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> gurkhas </li></a> <a href="/tags/kathmandu" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> kathmandu </li></a> <a href="/tags/nepal" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> nepal </li></a> <a href="/tags/pokhara" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> pokhara </li></a> <a href="/tags/singapore" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore </li></a> <a href="/tags/singapore gurkha archive" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkha archive </li></a> <a href="/tags/singapore gurkha old photographs" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkha old photographs </li></a> <a href="/tags/singapore gurkha photography museum" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkha photography museum </li></a> <a href="/tags/singapore gurkhas" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkhas </li></a> </ul> </section> </main> <footer class="row"> <div class="col-sm-4"> <h5 style="margin:0;font-weight:600;">©2016 Singapore Gurkha Photography Museum</h5> </div> <div class="col-sm-4"> <ul class="no-bullets"> <!-- contact --> <li><strong>email: </strong><a href="mailto:[email protected]">[email protected]</a></li> <!-- social media --> </ul> </div> <div class="col-sm-4"> <p class="small">The Singapore Gurkha Photography Museum project is an online archive of photographs and documents contributed by former members of the Singapore Gurkhas. </p> </div> </footer> <!-- jQuery --> <script src="/js/jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="/js/bootstrap.min.js"></script> </body> </html>
mit
Lokidottir/ebnf-bff
ebnf-test/ebnf-test.hs
645
import Text.EBNF hiding (main) import Text.EBNF.Informal (syntax) import Text.EBNF.SyntaxTree import Text.EBNF.Helper import Text.EBNF.Build.Parser import Text.EBNF.Build.Parser.Except main :: IO () main = print . raiseBk raiseBk :: SyntaxTree -> SyntaxTree raiseBk = raise ((`elem` [ "definitions list", "single definition", "syntactic factor", "syntactic primary", "syntactic exception", "syntactic term", "integer" ]) . identifier)
mit
gopheracademy/gcon
assets/public/2015/talks/dmitry-vyukov/index.html
14704
<!doctype html> <html> <head> <meta charset="utf-8"> <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta content="GopherCon is organized by GopherAcademy, LLC, a community-driven group of developers focused on the education of developers and the promotion of the Go programming language." name="description"> <meta content="go, golang, gophercon, convention" name="keywords"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="gophercon.com" name="author"> <meta content="GopherCon 2015" name="copyright"> <title>Gophercon 2015</title> <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/font-awesome.min.css" rel="stylesheet"> <link href="/css/main.css" rel="stylesheet"> <link href="/css/animate.css" rel="stylesheet"> </head> <body> <header> <nav id="top-nav" class="navbar navbar-default navbar-fixed-top"> <div class="row colors"> <div class="col-md-2 animated slideInDown"></div> <div class="col-md-2 animated slideInDown"></div> <div class="col-md-2 animated slideInDown"></div> <div class="col-md-2 animated slideInDown"></div> <div class="col-md-2 animated slideInDown"></div> <div class="col-md-2 animated slideInDown"></div> </div> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"></a> </div> <div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">ABOUT <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="/location">Location</a></li> <li><a href="/about">About GopherCon</a></li> <li><a href="/code-of-conduct">Code of Conduct</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">SPONSORS <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="/sponsors">GopherCon Sponsors</a></li> <li><a href="/Gophercon2015Prospectus.pdf">Sponsorship Prospectus</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">SCHEDULE <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="/#schedule-at-a-glance">Schedule At A Glance</a></li> <li><a href="/#workshop-schedule">Workshops</a></li> <li><a href="/#keynotes">Keynotes</a></li> <li><a href="/speakers">Speakers</a></li> <li><a href="/talks">Talks</a></li> <li><a href="/schedule/7july">July 7th Workshops</a></li> <li><a href="/schedule/8july">July 8th Day 1</a></li> <li><a href="/schedule/9july">July 9th Day 2</a></li> <li><a href="/schedule/10july">July 10th Hack Day</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">EVENTS <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="http://www.meetup.com/Denver-Go-Language-User-Group/events/222335594/">Kickoff Party</a></li> <li><a href="/events/after-party">After Party</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">REGISTRATION <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="https://ti.to/gophercon/gophercon-2015">Book Tickets</a></li> <li><a href="/#hotels">Hotels</a></li> </ul> </li> <li class="dropdown"> <a href="/news">NEWS</a> </li> </ul> </div> </div> </nav> <div class="header-content"> <div class="container"> <div class="row"> <div class="col-md-8 col-md-offset-2 interior-header"> <a href="/"><img src="/images/gophercon-small.svg" alt="GopherCon 2015" title="GopherCon 2015" width="300" /></a> <h1>Gophers of the world, Unite!</h1> <p>GopherCon 2015 will be the largest gathering of Go developers ever. </p> </div> </div> </div> </div> </header> <div class="sponsor-signUp"> <div class="container"> <div class="col-md-12"> <p>Interested in sponsoring?<a href="mailto:[email protected]" class="btn btn-orange" target="_blank" class="btn btn-orange">Get In Touch</a></p> </div> </div> </div> <main class="container generic"> <section class="row"> <div class="col-md-8"> <div class="row"> <div class="col-md-3"> <img class="img-rounded avatar" src="/images/speakers/dmitry-vyukov.jpg" alt="Go Dynamic Tools" width="150" /> </div> <div class="col-md-9"> <h3>Go Dynamic Tools</h3> <small> <a href="/speakers/dmitry-vyukov">Dmitry Vyukov</a> </a></small> <p>Dynamic tools can provide significant value for small time investment. But frequently they are underappreciated by developers. In this talk I will describe three dynamic tools for Go: data race detector, fuzzing system and execution tracer. The first two tools are related to bug finding, and the tracer can give insights into performance and latency issues of Go programs. I will also share our experiences of systematically applying such tools at scale.</p> </div> </div> </div> <div class="col-md-4"> <h4>Recent News</h4> <ul class="sidebar nav nav-pills nav-stacked"> <li><a href="http://gophercon.com/schedule/10july/"><img src="/images/schedule.png" width="25"> July 10th Hack Day</a></li> <li><a href="http://gophercon.com/schedule/9july/"><img src="/images/schedule.png" width="25"> July 9th Day 2</a></li> <li><a href="http://gophercon.com/schedule/8july/"><img src="/images/schedule.png" width="25"> July 8th Day 1</a></li> <li><a href="http://gophercon.com/schedule/7july/"><img src="/images/schedule.png" width="25"> July 7th Workshops</a></li> <li><a href="http://gophercon.com/sponsor/bronze/blitline/"><img src="/images/sponsor.png" width="25"> Blitline</a></li> </ul> </div> </section> </main> <main> <section class="home-sponsors content"> <div class="container"> <div class="col-md-10 col-md-offset-1 text-center"> <h1>Thanks to Our Sponsors</h1> <p class="subheader">Without their support this would not be possible</p> <div class="col-md-12 diamond"> <a href="http://gophercon.com/sponsor/diamond/google/"><img src="/images/temp-logos/google.png"></img></a> <a href="http://gophercon.com/sponsor/diamond/twitch/"><img src="/images/temp-logos/twitch.png"></img></a> <div class="clearfix"></div> </div> <br /><br /> <div class="col-md-12 platinum"> <a href="http://gophercon.com/sponsor/platinum/cisco/"><img src="/images/temp-logos/cisco.png"></img></a> <a href="http://gophercon.com/sponsor/platinum/mesosphere/"><img src="/images/temp-logos/mesosphere.png"></img></a> <div class="clearfix"></div> </div> <br /><br /> <div class="col-md-12 gold"> <a href="http://gophercon.com/sponsor/gold/clusterhq/"><img src="/images/temp-logos/clusterhq.png"></img></a> <a href="http://gophercon.com/sponsor/gold/couchbase/"><img src="/images/temp-logos/couchbase.png"></img></a> <a href="http://gophercon.com/sponsor/gold/docker/"><img src="/images/temp-logos/docker.png"></img></a> <a href="http://gophercon.com/sponsor/gold/pivotal/"><img src="/images/temp-logos/pivotal.png"></img></a> <a href="http://gophercon.com/sponsor/gold/segment/"><img src="/images/temp-logos/segment.png"></img></a> <a href="http://gophercon.com/sponsor/gold/thumbtack/"><img src="/images/temp-logos/thumbtack.png"></img></a> <a href="http://gophercon.com/sponsor/gold/verizon/"><img src="/images/temp-logos/verizon.png"></img></a> <a href="http://gophercon.com/sponsor/gold/xor/"><img src="/images/temp-logos/xor.png"></img></a> <a href="http://gophercon.com/sponsor/gold/yext/"><img src="/images/temp-logos/yext.png"></img></a> <a href="http://gophercon.com/sponsor/gold/canonical/"><img src="/images/temp-logos/ubuntu.png"></img></a> <a href="http://gophercon.com/sponsor/gold/timehop/"><img src="/images/temp-logos/timehop.png"></img></a> <a href="http://gophercon.com/sponsor/gold/nodeprime/"><img src="/images/temp-logos/nodeprime.png"></img></a> <a href="http://gophercon.com/sponsor/gold/bugsnag/"><img src="/images/temp-logos/bugsnag.png"></img></a> <a href="http://gophercon.com/sponsor/gold/datadog/"><img src="/images/temp-logos/datadog.png"></img></a> <a href="http://gophercon.com/sponsor/gold/influxdb/"><img src="/images/temp-logos/influxdb.png"></img></a> <a href="http://gophercon.com/sponsor/gold/coreos/"><img src="/images/temp-logos/coreos.png"></img></a> <a href="http://gophercon.com/sponsor/gold/apcera/"><img src="/images/temp-logos/apcera.png"></img></a> <a href="http://gophercon.com/sponsor/gold/sentry/"><img src="/images/temp-logos/sentry.png"></img></a> <div class="clearfix"></div> </div> <br /><br /> <div class="col-md-12 silver"> <a href="http://gophercon.com/sponsor/silver/qwinixtech/"><img src="/images/temp-logos/qwinixtech.png"></img></a> <a href="http://gophercon.com/sponsor/silver/contextio/"><img src="/images/temp-logos/contextio-logo.png"></img></a> <a href="http://gophercon.com/sponsor/silver/mongodb/"><img src="/images/temp-logos/mongodb.png"></img></a> <a href="http://gophercon.com/sponsor/silver/rackspace/"><img src="/images/temp-logos/rackspace.png"></img></a> <a href="http://gophercon.com/sponsor/silver/ironio/"><img src="/images/temp-logos/ironio.png"></img></a> <a href="http://gophercon.com/sponsor/silver/shopkeep/"><img src="/images/temp-logos/shopkeep.png"></img></a> <div class="clearfix"></div> </div> <div class="col-md-12 bronze"> <a href="http://gophercon.com/sponsor/bronze/raintank/"><img src="/images/temp-logos/raintank.png"></img></a> <a href="http://gophercon.com/sponsor/bronze/kismatic/"><img src="/images/temp-logos/kismatic.gif"></img></a> <a href="http://gophercon.com/sponsor/bronze/clypd/"><img src="/images/temp-logos/clypd.png"></img></a> <a href="http://gophercon.com/sponsor/bronze/heroku/"><img src="/images/temp-logos/heroku.png"></img></a> <a href="http://gophercon.com/sponsor/bronze/crowdstrike/"><img src="/images/temp-logos/crowdstrike.png"></img></a> <a href="http://gophercon.com/sponsor/bronze/metacaststv/"><img src="/images/temp-logos/metacasts.png"></img></a> <a href="http://gophercon.com/sponsor/bronze/blitline/"><img src="/images/temp-logos/blitline.png"></img></a> <a href="http://gophercon.com/sponsor/bronze/ardan/"><img src="/images/temp-logos/ardan.png"></img></a> <div class="clearfix"></div> </div> <div class="col-md-12 bronze"> <a href="http://gophercon.com/sponsor/additional/changelog/"><img src="/images/temp-logos/changelog.svg"></img></a> <a href="http://gophercon.com/sponsor/additional/oreilly/"><img src="/images/temp-logos/ORM_logo_box1_hex.jpg"></img></a> <div class="clearfix"></div> </div> </div> </div> </section> </main> <footer> <div class="container"> <div class="row"> <div class="col-md-2 col-md-offset-1 text-center"> <img src="/images/cowboy-color.png" width="170" /> </div> <div class="col-md-7 col-md-offset-1"> <p><b>GopherCon</b> is organized by GopherAcademy, LLC, a community-driven group of developers focused on the education of developers and the promotion of the Go programming language.</p> <p class="copyright">© 2015 GopherAcademy, LLC</p> <p class="copyright-character">The Gopher character is based on the Go mascot designed by <a href="http://reneefrench.blogspot.com/" target="blank">Renée French</a> and copyrighted under the <a href="http://creativecommons.org/licenses/by/3.0/us/" target="blank">Creative Commons Attribution 3.0 license.</a> </p> <p>Powered by <a href="http://gohugo.io">Hugo</a>.</p> </div> </div> </div> </footer> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="/bootstrap/js/bootstrap.min.js"></script> <script src="/js/main.js"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-40886074-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
mit
hpi-swt2/workshop-portal
spec/features/event_spec.rb
16955
require 'rails_helper' describe 'Event', type: :feature do describe 'index page' do it "should link to the show page when an event's read more button is clicked" do event = FactoryGirl.create :event visit events_path click_link event.name expect(page).to have_current_path(event_path(event)) end it 'should have a link to an event archive' do visit events_path expect(page).to have_link(href: events_archive_path) end it 'should not list past events' do current_event = FactoryGirl.create :event past_event = FactoryGirl.create :event, :in_the_past visit events_path expect(page).to have_text(current_event.name) expect(page).to_not have_text(past_event.name) end it 'should mark an event as draft by showing a label' do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) FactoryGirl.create :event, published: false visit events_path expect(page).to have_css('.label', text: I18n.t('activerecord.attributes.event.draft')) end it 'should mark an event as hidden by showing a label' do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) FactoryGirl.create :event, hidden: true visit events_path expect(page).to have_css('.label', text: I18n.t('activerecord.attributes.event.hidden')) end it 'should not show drafts to pupils or coaches' do %i[coach pupil].each do |role| login_as(FactoryGirl.create(:user, role: role), :scope => :user) FactoryGirl.create :event, published: false visit events_path expect(page).to_not have_css('.label', text: I18n.t('activerecord.attributes.event.draft')) end end it 'should not show hidden events to pupils or coaches' do %i[coach pupil].each do |role| login_as(FactoryGirl.create(:user, role: role), :scope => :user) FactoryGirl.create :event, hidden: true, name: 'Verstecktes Event' visit events_path expect(page).to_not have_text('Verstecktes Event') end end it 'should display the duration of the event' do FactoryGirl.create :event, :over_six_days visit events_path expect(page).to have_text(I18n.t('events.notices.time_span_consecutive', count: 6)) end it 'should display the duration of a sigle day event' do FactoryGirl.create :event, :single_day visit events_path expect(page).to have_text(I18n.t('events.notices.time_span_consecutive', count: 1)) end it 'should display note of non consecutive date ranges' do FactoryGirl.create :event, :with_multiple_date_ranges visit events_path expect(page).to have_text(I18n.t('events.notices.time_span_non_consecutive', count: 16)) end it "should display note of today's deadline" do FactoryGirl.create :event, :is_only_today visit events_path expect(page).to have_text(I18n.t('events.notices.deadline_approaching', count: 0)) end it 'should display the days left to apply' do FactoryGirl.create :event visit events_path expect(page).to have_text(I18n.t('events.notices.deadline_approaching', count: 1)) end it "should not display the days left to apply if it's more than 7" do FactoryGirl.create :event, :application_deadline_in_10_days visit events_path expect(page).to_not have_text(I18n.t('events.notices.deadline_approaching', count: 10)) end it 'should strip markdown from the description' do FactoryGirl.create :event, description: "# Headline Test\nParagraph with a [link](http://portal.edu)." visit events_path expect(page).to_not have_css('h1', text: 'Headline Test') expect(page).to_not have_text('Headline Test') expect(page).to have_text('Paragraph with a link.') end it "should truncate the description text if it's long" do FactoryGirl.create :event, description: ('a' * Event::TRUNCATE_DESCRIPTION_TEXT_LENGTH) + 'blah' visit events_path expect(page).to_not have_text('blah') end end describe 'archive page' do it 'should list past events' do current_event = FactoryGirl.create :event past_event = FactoryGirl.create :event, :in_the_past visit events_archive_path expect(page).to have_text(past_event.name) expect(page).to_not have_text(current_event.name) end end describe 'create page' do before :each do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) visit new_event_path fill_in 'event_name', :with => 'Testevent Name' fill_in 'event_description', :with => 'Loooooong description, which is really helpful' end I18n.t('events.type').each do |type| it 'should allow picking the #{type[1]} type' do fill_in 'Maximale Teilnehmerzahl', :with => 25 choose(type[1]) click_button I18n.t 'events.form.draft.publish' expect(page).to have_text(type[1]) end end it 'should not allow an end date before a start date' do visit new_event_path fill_in "event[date_ranges_attributes][][start_date]", with: Date.current fill_in "event[date_ranges_attributes][][end_date]", with: Date.current.prev_day(2) click_button I18n.t 'events.form.draft.publish' expect(page).to have_text('End-Datum kann nicht vor Start-Datum liegen') end it 'should allow entering multiple time spans', js: true do first_from = Date.tomorrow.next_day(1) first_to = Date.tomorrow.next_day(2) second_from = Date.tomorrow.next_day(6) second_to = Date.tomorrow.next_day(8) fill_in 'Maximale Teilnehmerzahl', :with => 25 fill_in "event[date_ranges_attributes][][start_date]", with: I18n.l(first_from) fill_in "event[date_ranges_attributes][][end_date]", with: I18n.l(first_to) click_link 'Zeitspanne hinzufügen' within page.find('#event-date-pickers').all('div')[1] do fill_in "event[date_ranges_attributes][][start_date]", with: I18n.l(second_from) fill_in "event[date_ranges_attributes][][end_date]", with: I18n.l(second_to) end fill_in 'event_application_deadline', :with => I18n.l(Date.tomorrow) click_button I18n.t 'events.form.draft.publish' expect(page).to have_text (DateRange.new start_date: first_from, end_date: first_to) expect(page).to have_text (DateRange.new start_date: second_from, end_date: second_to) end it 'should save application deadline' do deadline = Date.tomorrow fill_in 'event_max_participants', :with => 12 fill_in 'event_application_deadline', :with => I18n.l(deadline) fill_in "event[date_ranges_attributes][][start_date]", :with => Date.current.next_day(2) fill_in "event[date_ranges_attributes][][end_date]", :with => Date.current.next_day(3) click_button I18n.t 'events.form.draft.publish' expect(page).to have_text('Bewerbungsschluss ' + I18n.l(deadline)) end it 'should not allow an application deadline after the start of the event' do fill_in 'event_max_participants', :with => 12 fill_in 'event_application_deadline', :with => Date.tomorrow fill_in "event[date_ranges_attributes][][start_date]", :with => Date.current click_button I18n.t 'events.form.draft.publish' expect(page).to have_text('Bewerbungsschluss muss vor Beginn der Veranstaltung liegen') # TODO end it 'should not display errors on date ranges twice', js: true do fill_in 'Maximale Teilnehmerzahl', :with => 25 within page.find('#event-date-pickers').all('div')[0] do fill_in "event[date_ranges_attributes][][start_date]", with: I18n.l(Date.current.prev_day(7)) fill_in "event[date_ranges_attributes][][end_date]", with: I18n.l(Date.yesterday.prev_day(7)) end click_link 'Zeitspanne hinzufügen' within page.find('#event-date-pickers').all('div')[1] do fill_in "event[date_ranges_attributes][][start_date]", with: I18n.l(Date.current) fill_in "event[date_ranges_attributes][][end_date]", with: I18n.l(Date.yesterday) end click_button I18n.t('events.form.draft.publish') expect(page).to have_css('div.has-error') expect(page).to have_content('kann nicht vor Start-Datum liegen', count: 1) end it 'should allow to add custom fields', js: true do click_link I18n.t 'events.form.add_field' within page.find('#custom-application-fields').all('.input-group')[0] do fill_in "event[custom_application_fields][]", with: 'Lieblingsfarbe' end click_link I18n.t 'events.form.add_field' within page.find('#custom-application-fields').all('.input-group')[1] do fill_in "event[custom_application_fields][]", with: "Lieblings 'Friends' Charakter" end fill_in 'Maximale Teilnehmerzahl', :with => 25 fill_in "event[date_ranges_attributes][][start_date]", :with => I18n.l(Date.tomorrow.next_day(2)) fill_in "event[date_ranges_attributes][][end_date]", :with => I18n.l(Date.tomorrow.next_day(3)) fill_in 'event_application_deadline', :with => I18n.l(Date.tomorrow) click_button I18n.t('events.form.draft.publish') expect(page).to have_text('Lieblingsfarbe') expect(page).to have_text("Lieblings 'Friends' Charakter") end it 'should not allow adding fields after event creation' do event = FactoryGirl.create(:event) visit edit_event_path(event) expect(page).to_not have_text(I18n.t 'events.form.add_field') end end describe 'show page' do it 'should render markdown for the description' do event = FactoryGirl.create(:event, description: '# Test Headline') visit event_path(event) expect(page).to have_css('h1', text: 'Test Headline') end it 'should display a single day date range as a single date' do event = FactoryGirl.create(:event, :single_day) visit event_path(event) expect(page).to have_text(I18n.l(event.date_ranges.first.start_date)) expect(page).to_not have_text(' bis ' + I18n.l(event.date_ranges.first.end_date)) end it 'should display all date ranges' do event = FactoryGirl.create(:event, :with_two_date_ranges) visit event_path(event.id) expect(page).to have_text(event.date_ranges.first) expect(page).to have_text(event.date_ranges.second) end it 'should show that the application deadline is on midnight of the picked date' do event = FactoryGirl.create(:event) visit event_path(event.id) expect(page).to have_text(I18n.l(event.application_deadline) + ' Mitternacht') end end describe 'edit page' do it 'should not be possible to visit as pupil' do login_as(FactoryGirl.create(:user, role: :pupil), :scope => :user) event = FactoryGirl.create(:event, hidden: false) visit edit_event_path(event) expect(page).to have_text('Du bist nicht authorisiert diese Aktion auszuführen.') end it 'should not be possible to visit when logged out' do event = FactoryGirl.create(:event, hidden: false) visit edit_event_path(event) expect(page).to have_text('Du bist nicht authorisiert diese Aktion auszuführen.') end it 'should not be possible to visit as coach' do login_as(FactoryGirl.create(:user, role: :coach), :scope => :user) event = FactoryGirl.create(:event, hidden: false) visit edit_event_path(event) expect(page).to have_text('Du bist nicht authorisiert diese Aktion auszuführen.') end it 'should preselect the event kind' do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) event = FactoryGirl.create(:event, hidden: false) visit edit_event_path(event) expect(find_field(I18n.t('events.type.public'))[:checked]).to_not be_nil end it 'should display all existing date ranges' do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) event = FactoryGirl.create(:event, :with_two_date_ranges) visit edit_event_path(event.id) page.assert_selector('[name="event[date_ranges_attributes][][start_date]"]', count: 2) end it 'should save edits to the date ranges' do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) event = FactoryGirl.create(:event, :with_two_date_ranges) date_start = Date.current.next_year date_end = Date.tomorrow.next_year visit edit_event_path(event.id) within page.find('#event-date-pickers').first('div') do fill_in "event[date_ranges_attributes][][start_date]", with: date_start fill_in "event[date_ranges_attributes][][end_date]", with: date_end end click_button I18n.t('events.form.update') expect(page).to have_text (DateRange.new start_date: date_start, end_date: date_end) end it "should allow editing past events" do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) event = FactoryGirl.create(:event) visit edit_event_path(event.id) fill_in 'event_application_deadline', :with => Date.yesterday.prev_day(5) fill_in "event[date_ranges_attributes][][start_date]", with: Date.yesterday.prev_day fill_in "event[date_ranges_attributes][][end_date]", with: Date.yesterday click_button I18n.t('events.form.update') expect(page).to_not have_text(I18n.t('errors.form_invalid.one')) end end describe 'printing badges' do before :each do login_as(FactoryGirl.create(:user, role: :organizer), :scope => :user) @event = FactoryGirl.create(:event) @users = 12.times.collect do user = FactoryGirl.create(:user_with_profile) FactoryGirl.create(:application_letter, :accepted, user: user, event: @event) user end visit badges_event_path(@event) end it 'creates a pdf with the selected names' do @users.each do |u| find(:css, "#selected_ids_[value='#{u.id}']").set(true) if u.id.even? end select(I18n.t('events.badges.full_name')) click_button I18n.t('events.badges.print') strings = PDF::Inspector::Text.analyze(page.body).strings @users.each do |u| if u.id.even? expect(strings).to include(u.profile.name) else expect(strings).not_to include(u.profile.name) end end end it 'uses the correct name format' do all(:css, '#selected_ids_').each { |check| check.set(true) } select(I18n.t('events.badges.last_name')) click_button I18n.t('events.badges.print') strings = PDF::Inspector::Text.analyze(page.body).strings @users.each do |u| expect(strings).to include(u.profile.last_name) expect(strings).not_to include(u.profile.first_name) end end it "selects all participants when the 'select all' checkbox is checked", js: true do check('select-all-print') all('input[type=checkbox].selected_ids').each { |checkbox| expect(checkbox).to be_checked } uncheck('select-all-print') all('input[type=checkbox].selected_ids').each { |checkbox| expect(checkbox).not_to be_checked } end it 'creates a pdf with the correct schools' do all(:css, '#selected_ids_').each { |check| check.set(true) } check('show_organisation') click_button I18n.t('events.badges.print') strings = PDF::Inspector::Text.analyze(page.body).strings @users.each { |u| expect(strings).to include(ApplicationLetter.where(event: @event, user: u).first.organisation) } end it 'does not horribly crash and burn when colors are selected' do #testing if the actual colors are used is kinda hard all(:css, '#selected_ids_').each { |check| check.set(true) } check('show_color') click_button I18n.t('events.badges.print') end it 'does not throw an error with a logo' do attach_file(:logo_upload, './spec/testfiles/actual.jpg') all(:css, '#selected_ids_').each { |check| check.set(true) } click_button I18n.t('events.badges.print') end it 'shows an error message if logo is wrong filetype' do attach_file(:logo_upload, './spec/testfiles/fake.jpg') all(:css, '#selected_ids_').each { |check| check.set(true) } click_button I18n.t('events.badges.print') expect(page).to have_current_path(badges_event_path(@event)) expect(page).to have_text(I18n.t('events.badges.wrong_file_format')) end it 'shows an error message if no participant was selected' do all(:css, '#selected_ids_').each { |check| check.set(false) } click_button I18n.t('events.badges.print') expect(page).to have_current_path(badges_event_path(@event)) expect(page).to have_text(I18n.t('events.badges.no_users_selected')) end end end
mit
chain24/ebayprocess-lumen
vendor/dts/ebay-sdk-php/src/Trading/Types/CheckoutStatusType.php
3035
<?php /** * The contents of this file was generated using the WSDLs as provided by eBay. * * DO NOT EDIT THIS FILE! */ namespace DTS\eBaySDK\Trading\Types; /** * * @property \DTS\eBaySDK\Trading\Enums\PaymentStatusCodeType $eBayPaymentStatus * @property \DateTime $LastModifiedTime * @property \DTS\eBaySDK\Trading\Enums\BuyerPaymentMethodCodeType $PaymentMethod * @property \DTS\eBaySDK\Trading\Enums\CompleteStatusCodeType $Status * @property boolean $IntegratedMerchantCreditCardEnabled * @property \DTS\eBaySDK\Trading\Types\EBayPaymentMismatchDetailsType $eBayPaymentMismatchDetails * @property \DTS\eBaySDK\Trading\Enums\BuyerPaymentInstrumentCodeType $PaymentInstrument */ class CheckoutStatusType extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ 'eBayPaymentStatus' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'eBayPaymentStatus' ], 'LastModifiedTime' => [ 'type' => 'DateTime', 'repeatable' => false, 'attribute' => false, 'elementName' => 'LastModifiedTime' ], 'PaymentMethod' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'PaymentMethod' ], 'Status' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'Status' ], 'IntegratedMerchantCreditCardEnabled' => [ 'type' => 'boolean', 'repeatable' => false, 'attribute' => false, 'elementName' => 'IntegratedMerchantCreditCardEnabled' ], 'eBayPaymentMismatchDetails' => [ 'type' => 'DTS\eBaySDK\Trading\Types\EBayPaymentMismatchDetailsType', 'repeatable' => false, 'attribute' => false, 'elementName' => 'eBayPaymentMismatchDetails' ], 'PaymentInstrument' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'PaymentInstrument' ] ]; /** * @param array $values Optional properties and values to assign to the object. */ public function __construct(array $values = []) { list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); parent::__construct($parentValues); if (!array_key_exists(__CLASS__, self::$properties)) { self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); } if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) { self::$xmlNamespaces[__CLASS__] = 'xmlns="urn:ebay:apis:eBLBaseComponents"'; } $this->setValues(__CLASS__, $childValues); } }
mit
jiaaro/django-alert
alert/exceptions.py
180
class CouldNotSendError(Exception): pass class AlertIDAlreadyInUse(Exception): pass class AlertBackendIDAlreadyInUse(Exception): pass class InvalidApplicableUsers(Exception): pass
mit
judovana/jenkins-scm-koji-plugin
fake-koji/src/main/java/org/fakekoji/core/utils/FileFileFilter.java
1407
/* * The MIT License * * Copyright 2015 user. * * 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. */ package org.fakekoji.core.utils; import java.io.File; import java.io.FileFilter; public class FileFileFilter implements FileFilter { public FileFileFilter() { } @Override public boolean accept(File pathname) { return !pathname.isDirectory(); } }
mit
instantchow/home-assistant
homeassistant/components/media_player/universal.py
13920
""" Combination of multiple media players into one for a universal controller. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.universal/ """ import logging # pylint: disable=import-error from copy import copy from homeassistant.components.media_player import ( ATTR_APP_ID, ATTR_APP_NAME, ATTR_MEDIA_ALBUM_ARTIST, ATTR_MEDIA_ALBUM_NAME, ATTR_MEDIA_ARTIST, ATTR_MEDIA_CHANNEL, ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, ATTR_MEDIA_DURATION, ATTR_MEDIA_EPISODE, ATTR_MEDIA_PLAYLIST, ATTR_MEDIA_SEASON, ATTR_MEDIA_SEEK_POSITION, ATTR_MEDIA_SERIES_TITLE, ATTR_MEDIA_TITLE, ATTR_MEDIA_TRACK, ATTR_MEDIA_VOLUME_LEVEL, ATTR_MEDIA_VOLUME_MUTED, ATTR_SUPPORTED_MEDIA_COMMANDS, DOMAIN, SERVICE_PLAY_MEDIA, SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_STEP, MediaPlayerDevice) from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_ENTITY_PICTURE, CONF_NAME, SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PAUSE, SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_MEDIA_SEEK, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_MUTE, SERVICE_VOLUME_SET, SERVICE_VOLUME_UP, STATE_IDLE, STATE_OFF, STATE_ON) from homeassistant.helpers.event import track_state_change from homeassistant.helpers.service import call_from_config ATTR_ACTIVE_CHILD = 'active_child' CONF_ATTRS = 'attributes' CONF_CHILDREN = 'children' CONF_COMMANDS = 'commands' CONF_PLATFORM = 'platform' CONF_SERVICE = 'service' CONF_SERVICE_DATA = 'service_data' CONF_STATE = 'state' OFF_STATES = [STATE_IDLE, STATE_OFF] REQUIREMENTS = [] _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the universal media players.""" if not validate_config(config): return player = UniversalMediaPlayer(hass, config[CONF_NAME], config[CONF_CHILDREN], config[CONF_COMMANDS], config[CONF_ATTRS]) add_devices([player]) def validate_config(config): """Validate universal media player configuration.""" del config[CONF_PLATFORM] # Validate name if CONF_NAME not in config: _LOGGER.error('Universal Media Player configuration requires name') return False validate_children(config) validate_commands(config) validate_attributes(config) del_keys = [] for key in config: if key not in [CONF_NAME, CONF_CHILDREN, CONF_COMMANDS, CONF_ATTRS]: _LOGGER.warning( 'Universal Media Player (%s) unrecognized parameter %s', config[CONF_NAME], key) del_keys.append(key) for key in del_keys: del config[key] return True def validate_children(config): """Validate children.""" if CONF_CHILDREN not in config: _LOGGER.info( 'No children under Universal Media Player (%s)', config[CONF_NAME]) config[CONF_CHILDREN] = [] elif not isinstance(config[CONF_CHILDREN], list): _LOGGER.warning( 'Universal Media Player (%s) children not list in config. ' 'They will be ignored.', config[CONF_NAME]) config[CONF_CHILDREN] = [] def validate_commands(config): """Validate commands.""" if CONF_COMMANDS not in config: config[CONF_COMMANDS] = {} elif not isinstance(config[CONF_COMMANDS], dict): _LOGGER.warning( 'Universal Media Player (%s) specified commands not dict in ' 'config. They will be ignored.', config[CONF_NAME]) config[CONF_COMMANDS] = {} def validate_attributes(config): """Validate attributes.""" if CONF_ATTRS not in config: config[CONF_ATTRS] = {} elif not isinstance(config[CONF_ATTRS], dict): _LOGGER.warning( 'Universal Media Player (%s) specified attributes ' 'not dict in config. They will be ignored.', config[CONF_NAME]) config[CONF_ATTRS] = {} for key, val in config[CONF_ATTRS].items(): attr = val.split('|', 1) if len(attr) == 1: attr.append(None) config[CONF_ATTRS][key] = attr class UniversalMediaPlayer(MediaPlayerDevice): """Representation of an universal media player.""" # pylint: disable=too-many-public-methods def __init__(self, hass, name, children, commands, attributes): """Initialize the Universal media device.""" # pylint: disable=too-many-arguments self.hass = hass self._name = name self._children = children self._cmds = commands self._attrs = attributes self._child_state = None def on_dependency_update(*_): """Update ha state when dependencies update.""" self.update_ha_state(True) depend = copy(children) for entity in attributes.values(): depend.append(entity[0]) track_state_change(hass, depend, on_dependency_update) def _entity_lkp(self, entity_id, state_attr=None): """Look up an entity state.""" state_obj = self.hass.states.get(entity_id) if state_obj is None: return if state_attr: return state_obj.attributes.get(state_attr) return state_obj.state def _override_or_child_attr(self, attr_name): """Return either the override or the active child for attr_name.""" if attr_name in self._attrs: return self._entity_lkp(self._attrs[attr_name][0], self._attrs[attr_name][1]) return self._child_attr(attr_name) def _child_attr(self, attr_name): """Return the active child's attributes.""" active_child = self._child_state return active_child.attributes.get(attr_name) if active_child else None def _call_service(self, service_name, service_data=None, allow_override=False): """Call either a specified or active child's service.""" if allow_override and service_name in self._cmds: call_from_config( self.hass, self._cmds[service_name], blocking=True) return if service_data is None: service_data = {} active_child = self._child_state service_data[ATTR_ENTITY_ID] = active_child.entity_id self.hass.services.call(DOMAIN, service_name, service_data, blocking=True) @property def should_poll(self): """No polling needed.""" return False @property def master_state(self): """Return the master state for entity or None.""" if CONF_STATE in self._attrs: master_state = self._entity_lkp(self._attrs[CONF_STATE][0], self._attrs[CONF_STATE][1]) return master_state if master_state else STATE_OFF else: return None @property def name(self): """Return the name of universal player.""" return self._name @property def state(self): """Current state of media player. Off if master state is off else Status of first active child else master state or off """ master_state = self.master_state # avoid multiple lookups if master_state == STATE_OFF: return STATE_OFF active_child = self._child_state if active_child: return active_child.state return master_state if master_state else STATE_OFF @property def volume_level(self): """Volume level of entity specified in attributes or active child.""" return self._child_attr(ATTR_MEDIA_VOLUME_LEVEL) @property def is_volume_muted(self): """Boolean if volume is muted.""" return self._override_or_child_attr(ATTR_MEDIA_VOLUME_MUTED) \ in [True, STATE_ON] @property def media_content_id(self): """Content ID of current playing media.""" return self._child_attr(ATTR_MEDIA_CONTENT_ID) @property def media_content_type(self): """Content type of current playing media.""" return self._child_attr(ATTR_MEDIA_CONTENT_TYPE) @property def media_duration(self): """Duration of current playing media in seconds.""" return self._child_attr(ATTR_MEDIA_DURATION) @property def media_image_url(self): """Image url of current playing media.""" return self._child_attr(ATTR_ENTITY_PICTURE) @property def media_title(self): """Title of current playing media.""" return self._child_attr(ATTR_MEDIA_TITLE) @property def media_artist(self): """Artist of current playing media (Music track only).""" return self._child_attr(ATTR_MEDIA_ARTIST) @property def media_album_name(self): """Album name of current playing media (Music track only).""" return self._child_attr(ATTR_MEDIA_ALBUM_NAME) @property def media_album_artist(self): """Album artist of current playing media (Music track only).""" return self._child_attr(ATTR_MEDIA_ALBUM_ARTIST) @property def media_track(self): """Track number of current playing media (Music track only).""" return self._child_attr(ATTR_MEDIA_TRACK) @property def media_series_title(self): """The title of the series of current playing media (TV Show only).""" return self._child_attr(ATTR_MEDIA_SERIES_TITLE) @property def media_season(self): """Season of current playing media (TV Show only).""" return self._child_attr(ATTR_MEDIA_SEASON) @property def media_episode(self): """Episode of current playing media (TV Show only).""" return self._child_attr(ATTR_MEDIA_EPISODE) @property def media_channel(self): """Channel currently playing.""" return self._child_attr(ATTR_MEDIA_CHANNEL) @property def media_playlist(self): """Title of Playlist currently playing.""" return self._child_attr(ATTR_MEDIA_PLAYLIST) @property def app_id(self): """ID of the current running app.""" return self._child_attr(ATTR_APP_ID) @property def app_name(self): """Name of the current running app.""" return self._child_attr(ATTR_APP_NAME) @property def supported_media_commands(self): """Flag media commands that are supported.""" flags = self._child_attr(ATTR_SUPPORTED_MEDIA_COMMANDS) or 0 if SERVICE_TURN_ON in self._cmds: flags |= SUPPORT_TURN_ON if SERVICE_TURN_OFF in self._cmds: flags |= SUPPORT_TURN_OFF if any([cmd in self._cmds for cmd in [SERVICE_VOLUME_UP, SERVICE_VOLUME_DOWN]]): flags |= SUPPORT_VOLUME_STEP flags &= ~SUPPORT_VOLUME_SET if SERVICE_VOLUME_MUTE in self._cmds and \ ATTR_MEDIA_VOLUME_MUTED in self._attrs: flags |= SUPPORT_VOLUME_MUTE return flags @property def device_state_attributes(self): """Return device specific state attributes.""" active_child = self._child_state return {ATTR_ACTIVE_CHILD: active_child.entity_id} \ if active_child else {} def turn_on(self): """Turn the media player on.""" self._call_service(SERVICE_TURN_ON, allow_override=True) def turn_off(self): """Turn the media player off.""" self._call_service(SERVICE_TURN_OFF, allow_override=True) def mute_volume(self, is_volume_muted): """Mute the volume.""" data = {ATTR_MEDIA_VOLUME_MUTED: is_volume_muted} self._call_service(SERVICE_VOLUME_MUTE, data, allow_override=True) def set_volume_level(self, volume_level): """Set volume level, range 0..1.""" data = {ATTR_MEDIA_VOLUME_LEVEL: volume_level} self._call_service(SERVICE_VOLUME_SET, data) def media_play(self): """Send play commmand.""" self._call_service(SERVICE_MEDIA_PLAY) def media_pause(self): """Send pause command.""" self._call_service(SERVICE_MEDIA_PAUSE) def media_previous_track(self): """Send previous track command.""" self._call_service(SERVICE_MEDIA_PREVIOUS_TRACK) def media_next_track(self): """Send next track command.""" self._call_service(SERVICE_MEDIA_NEXT_TRACK) def media_seek(self, position): """Send seek command.""" data = {ATTR_MEDIA_SEEK_POSITION: position} self._call_service(SERVICE_MEDIA_SEEK, data) def play_media(self, media_type, media_id): """Play a piece of media.""" data = {ATTR_MEDIA_CONTENT_TYPE: media_type, ATTR_MEDIA_CONTENT_ID: media_id} self._call_service(SERVICE_PLAY_MEDIA, data) def volume_up(self): """Turn volume up for media player.""" self._call_service(SERVICE_VOLUME_UP, allow_override=True) def volume_down(self): """Turn volume down for media player.""" self._call_service(SERVICE_VOLUME_DOWN, allow_override=True) def media_play_pause(self): """Play or pause the media player.""" self._call_service(SERVICE_MEDIA_PLAY_PAUSE) def update(self): """Update state in HA.""" for child_name in self._children: child_state = self.hass.states.get(child_name) if child_state and child_state.state not in OFF_STATES: self._child_state = child_state return self._child_state = None
mit
revile/fastlane
spaceship/spec/test_flight/client_spec.rb
10676
require 'spec_helper' require_relative '../mock_servers' ## # subclass the client we want to test so we can make test-methods easier class TestFlightTestClient < Spaceship::TestFlight::Client def test_request(some_param: nil, another_param: nil) assert_required_params(__method__, binding) end def handle_response(response) super(response) end end describe Spaceship::TestFlight::Client do subject { TestFlightTestClient.new(current_team_id: 'fake-team-id') } let(:app_id) { 'some-app-id' } let(:platform) { 'ios' } context '#assert_required_params' do it 'requires named parameters to be passed' do expect do subject.test_request(some_param: 1) end.to raise_error(NameError) end end context '#handle_response' do it 'handles successful responses with json' do response = double('Response', status: 200) allow(response).to receive(:body).and_return({ 'data' => 'value' }) expect(subject.handle_response(response)).to eq('value') end it 'handles successful responses with no data' do response = double('Response', body: '', status: 201) expect(subject.handle_response(response)).to eq(nil) end it 'raises an exception on an API error' do response = double('Response', status: 400) allow(response).to receive(:body).and_return({ 'data' => nil, 'error' => 'Bad Request' }) expect do subject.handle_response(response) end.to raise_error(Spaceship::Client::UnexpectedResponse) end it 'raises an exception on a HTTP error' do response = double('Response', body: '<html>Server Error</html>', status: 400) expect do subject.handle_response(response) end.to raise_error(Spaceship::Client::UnexpectedResponse) end it 'raises an InternalServerError exception on a HTTP 500 error' do response = double('Response', body: '<html>Server Error</html>', status: 500) expect do subject.handle_response(response) end.to raise_error(Spaceship::Client::InternalServerError) end end ## # @!group Build Trains API ## context '#get_build_trains' do it 'executes the request' do MockAPI::TestFlightServer.get('/testflight/v2/providers/fake-team-id/apps/some-app-id/platforms/ios/trains') {} subject.get_build_trains(app_id: app_id, platform: platform) expect(WebMock).to have_requested(:get, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/platforms/ios/trains') end end context '#get_builds_for_train' do it 'executes the request' do MockAPI::TestFlightServer.get('/testflight/v2/providers/fake-team-id/apps/some-app-id/platforms/ios/trains/1.0/builds') {} subject.get_builds_for_train(app_id: app_id, platform: platform, train_version: '1.0') expect(WebMock).to have_requested(:get, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/platforms/ios/trains/1.0/builds') end it 'retries requests' do allow(subject).to receive(:request) { raise Faraday::ParsingError, 'Boom!' } expect(subject).to receive(:request).exactly(2).times begin subject.get_builds_for_train(app_id: app_id, platform: platform, train_version: '1.0', retry_count: 2) rescue end end end ## # @!group Builds API ## context '#get_build' do it 'executes the request' do MockAPI::TestFlightServer.get('/testflight/v2/providers/fake-team-id/apps/some-app-id/builds/1') {} subject.get_build(app_id: app_id, build_id: 1) expect(WebMock).to have_requested(:get, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/builds/1') end end context '#put_build' do let(:build) { double('Build', to_json: "") } it 'executes the request' do MockAPI::TestFlightServer.put('/testflight/v2/providers/fake-team-id/apps/some-app-id/builds/1') {} subject.put_build(app_id: app_id, build_id: 1, build: build) expect(WebMock).to have_requested(:put, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/builds/1') end end context '#expire_build' do let(:build) { double('Build', to_json: "") } it 'executes the request' do MockAPI::TestFlightServer.post('/testflight/v2/providers/fake-team-id/apps/some-app-id/builds/1/expire') {} subject.expire_build(app_id: app_id, build_id: 1, build: build) expect(WebMock).to have_requested(:post, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/builds/1/expire') end end ## # @!group Groups API ## context '#create_group_for_app' do let(:group_name) { 'some-group-name' } it 'executes the request' do MockAPI::TestFlightServer.post('/testflight/v2/providers/fake-team-id/apps/some-app-id/groups') {} subject.create_group_for_app(app_id: app_id, group_name: group_name) expect(WebMock).to have_requested(:post, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/groups') end end context '#delete_group_for_app' do it 'executes the request' do MockAPI::TestFlightServer.delete('/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id') {} subject.delete_group_for_app(app_id: app_id, group_id: 'fake-group-id') expect(WebMock).to have_requested(:delete, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id') end end context '#get_groups' do it 'executes the request' do MockAPI::TestFlightServer.get('/testflight/v2/providers/fake-team-id/apps/some-app-id/groups') {} subject.get_groups(app_id: app_id) expect(WebMock).to have_requested(:get, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/groups') end end context '#add_group_to_build' do it 'executes the request' do MockAPI::TestFlightServer.put('/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id/builds/fake-build-id') {} subject.add_group_to_build(app_id: app_id, group_id: 'fake-group-id', build_id: 'fake-build-id') expect(WebMock).to have_requested(:put, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id/builds/fake-build-id') end end ## # @!group Testers API ## context '#testers_for_app' do it 'executes the request' do MockAPI::TestFlightServer.get('/testflight/v2/providers/fake-team-id/apps/some-app-id/testers') {} subject.testers_for_app(app_id: app_id) expect(WebMock).to have_requested(:get, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/testers?limit=40&order=asc&sort=email') end end context '#search_for_tester_in_app' do it 'executes the request' do MockAPI::TestFlightServer.get('/testflight/v2/providers/fake-team-id/apps/some-app-id/testers') {} subject.search_for_tester_in_app(app_id: app_id, text: "fake+tester+text") expect(WebMock).to have_requested(:get, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/testers?order=asc&search=fake%2Btester%2Btext&sort=status') end end context '#delete_tester_from_app' do it 'executes the request' do MockAPI::TestFlightServer.delete('/testflight/v2/providers/fake-team-id/apps/some-app-id/testers/fake-tester-id') {} subject.delete_tester_from_app(app_id: app_id, tester_id: 'fake-tester-id') expect(WebMock).to have_requested(:delete, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/testers/fake-tester-id') end end context '#create_app_level_tester' do let(:tester) { double('Tester', email: '[email protected]', first_name: 'Fake', last_name: 'Name') } it 'executes the request' do MockAPI::TestFlightServer.post('/testflight/v2/providers/fake-team-id/apps/some-app-id/testers') {} subject.create_app_level_tester(app_id: app_id, first_name: tester.first_name, last_name: tester.last_name, email: tester.email) expect(WebMock).to have_requested(:post, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/testers') end end context '#post_tester_to_group' do it 'executes the request' do MockAPI::TestFlightServer.post('/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id/testers') {} tester = OpenStruct.new({ first_name: "Josh", last_name: "Taquitos", email: "[email protected]" }) subject.post_tester_to_group(app_id: app_id, email: tester.email, first_name: tester.first_name, last_name: tester.last_name, group_id: 'fake-group-id') expect(WebMock).to have_requested(:post, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id/testers'). with(body: '[{"email":"[email protected]","firstName":"Josh","lastName":"Taquitos"}]') end end context '#delete_tester_from_group' do it 'executes the request' do MockAPI::TestFlightServer.delete('/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id/testers/fake-tester-id') {} subject.delete_tester_from_group(app_id: app_id, tester_id: 'fake-tester-id', group_id: 'fake-group-id') expect(WebMock).to have_requested(:delete, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/groups/fake-group-id/testers/fake-tester-id') end end ## # @!group AppTestInfo ## context '#get_app_test_info' do it 'executes the request' do MockAPI::TestFlightServer.get('/testflight/v2/providers/fake-team-id/apps/some-app-id/testInfo') {} subject.get_app_test_info(app_id: app_id) expect(WebMock).to have_requested(:get, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/testInfo') end end context '#put_app_test_info' do let(:app_test_info) { double('AppTestInfo', to_json: '') } it 'executes the request' do MockAPI::TestFlightServer.put('/testflight/v2/providers/fake-team-id/apps/some-app-id/testInfo') {} subject.put_app_test_info(app_id: app_id, app_test_info: app_test_info) expect(WebMock).to have_requested(:put, 'https://itunesconnect.apple.com/testflight/v2/providers/fake-team-id/apps/some-app-id/testInfo') end end end
mit
chaosagent/pandacoin
src/qt/aboutdialog.cpp
1047
#include "aboutdialog.h" #include "ui_aboutdialog.h" #include "clientmodel.h" #include "clientversion.h" // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source const int ABOUTDIALOG_COPYRIGHT_YEAR = 2014; AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) { ui->setupUi(this); // Set current copyright year ui->copyrightLabel->setText(tr("Copyright") + QString(" &copy; 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin developers") + QString("<br>") + tr("Copyright") + QString(" &copy; ") + tr("2011-%1 Litecoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR) + QString("<br>") + tr("Copyright") + QString(" &copy; ") + tr("%1 The The Panda Coin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR)); } void AboutDialog::setModel(ClientModel *model) { if(model) { ui->versionLabel->setText(model->formatFullVersion()); } } AboutDialog::~AboutDialog() { delete ui; } void AboutDialog::on_buttonBox_accepted() { close(); }
mit
willsimmons/markedit
node_modules/showdown/test/karlcow/code-4-spaces-escaping.html
62
<pre><code>10 PRINT &lt; &gt; &amp; 20 GOTO 10 </code></pre>
mit
barriquello/iotstack
openwsn-fw-work/firmware/openos/openwsn/03a-IPHC/iphc.h
5314
#ifndef __IPHC_H #define __IPHC_H /** \addtogroup LoWPAN \{ \addtogroup IPHC \{ */ #include "openwsn.h" //=========================== define ========================================== #define IPHC_DEFAULT_HOP_LIMIT 65 #define IPv6HOP_HDR_LEN 3 enum IPHC_enums { IPHC_DISPATCH = 5, IPHC_TF = 3, IPHC_NH = 2, IPHC_HLIM = 0, IPHC_CID = 7, IPHC_SAC = 6, IPHC_SAM = 4, IPHC_M = 3, IPHC_DAC = 2, IPHC_DAM = 0, }; enum IPHC_DISPATCH_enums { IPHC_DISPATCH_IPHC = 3, }; enum IPHC_TF_enums { IPHC_TF_4B = 0, IPHC_TF_3B = 1, IPHC_TF_1B = 2, IPHC_TF_ELIDED = 3, }; enum IPHC_NH_enums { IPHC_NH_INLINE = 0, IPHC_NH_COMPRESSED = 1, }; enum NHC_enums { // IPv6 Extension Header Encoding starts with b1110 xxxx NHC_IPv6EXT_MASK = 0xf0, // b1111 0000 NHC_IPv6EXT_ID = 0xe0, // b1110 0000 // UDP Header Encoding starts with b1111 0xxx NHC_UDP_MASK = 0xf8, // b1111 1000 NHC_UDP_ID = 0xf0, // b1111 0000 }; enum NHC_IPv6HOP_enums { NHC_IPv6HOP_MASK = 0x0e, NHC_IPv6HOP_VAL = 0x0e, NHC_HOP_NH_MASK = 0x01, }; enum NHC_UDP_enums { NHC_UDP_C_MASK = 0x40, NHC_UDP_PORTS_MASK = 0x03, }; enum NHC_UDP_PORTS_enums { NHC_UDP_PORTS_INLINE = 0, NHC_UDP_PORTS_16S_8D = 1, NHC_UDP_PORTS_8S_8D = 2, NHC_UDP_PORTS_4S_4D = 3, }; enum IPHC_HLIM_enums { IPHC_HLIM_INLINE = 0, IPHC_HLIM_1 = 1, IPHC_HLIM_64 = 2, IPHC_HLIM_255 = 3, }; enum IPHC_CID_enums { IPHC_CID_NO = 0, IPHC_CID_YES = 1, }; enum IPHC_SAC_enums { IPHC_SAC_STATELESS = 0, IPHC_SAC_STATEFUL = 1, }; enum IPHC_SAM_enums { IPHC_SAM_128B = 0, IPHC_SAM_64B = 1, IPHC_SAM_16B = 2, IPHC_SAM_ELIDED = 3, }; enum IPHC_M_enums { IPHC_M_NO = 0, IPHC_M_YES = 1, }; enum IPHC_DAC_enums { IPHC_DAC_STATELESS = 0, IPHC_DAC_STATEFUL = 1, }; enum IPHC_DAM_enums { IPHC_DAM_128B = 0, IPHC_DAM_64B = 1, IPHC_DAM_16B = 2, IPHC_DAM_ELIDED = 3, }; //=========================== typedef ========================================= typedef struct { uint8_t traffic_class; uint32_t flow_label; bool next_header_compressed; uint8_t next_header; uint8_t hop_limit; open_addr_t src; open_addr_t dest; uint8_t header_length; ///< Counter for internal use } ipv6_header_iht; // iht for "internal header type" /** \brief IPv6 hop-by-hop option. The Hop-by-Hop Options header is used to carry optional information that must be examined by every node along a packet's delivery path. The Hop-by-Hop Options header is identified by a Next Header value of 0 in the IPv6 header. Per http://tools.ietf.org/html/rfc6282#section-4.2, the first 7 bits serve as an identifier for the IPv6 Extension Header immediately following the LOWPAN_NHC octet. The remaining bit indicates whether or not the following header utilizes LOWPAN_NHC encoding. The Length field contained in a compressed IPv6 Extension Header indicates the number of octets that pertain to the (compressed) extension header following the Length field. Note that this changes the Length field definition in [RFC2460] from indicating the header size in 8-octet units, not including the first 8 octets. Changing the Length field to be in units of octets removes wasteful internal fragmentation. */ typedef struct { uint8_t headerlen; ///< Counter for internal use bool next_header_compressed; uint8_t lowpan_nhc; uint8_t nextHeader; uint8_t HdrExtLen; } ipv6_hopbyhop_iht; /** \brief RPL Option header type. Described in http://tools.ietf.org/html/rfc6553#section-3 */ BEGIN_PACK typedef struct { uint8_t optionType; ///< RPL_HOPBYHOP_HEADER_OPTION_TYPE uint8_t optionLen; ///< 8-bit field indicating the length of the option, in octets, excluding the Option Type and Opt Data Len fields. uint8_t flags; ///< ORF00000 uint8_t rplInstanceID; ///< instanceid uint16_t senderRank; ///< RPL rank of the sender of the packet } rpl_option_ht; END_PACK //=========================== variables ======================================= //=========================== prototypes ====================================== void iphc_init(void); owerror_t iphc_sendFromForwarding( OpenQueueEntry_t* msg, ipv6_header_iht* ipv6_header, rpl_option_ht* rpl_option, uint32_t* flow_label, uint8_t fw_SendOrfw_Rcv ); owerror_t iphc_sendFromBridge(OpenQueueEntry_t *msg); void iphc_sendDone(OpenQueueEntry_t *msg, owerror_t error); void iphc_receive(OpenQueueEntry_t *msg); /** \} \} */ #endif
mit
cucumber/cucumber-expressions-ruby
spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
863
require 'yaml' require 'json' require 'cucumber/cucumber_expressions/cucumber_expression_tokenizer' require 'cucumber/cucumber_expressions/errors' module Cucumber module CucumberExpressions describe 'Cucumber expression tokenizer' do Dir['testdata/tokens/*.yaml'].each do |testcase| expectation = YAML.load_file(testcase) # encoding? it "#{testcase}" do tokenizer = CucumberExpressionTokenizer.new if expectation['exception'].nil? tokens = tokenizer.tokenize(expectation['expression']) token_hashes = tokens.map{|token| token.to_hash} expect(token_hashes).to eq(JSON.parse(expectation['expected'])) else expect { tokenizer.tokenize(expectation['expression']) }.to raise_error(expectation['exception']) end end end end end end
mit
s1rius/fresco
static-webp/src/main/jni/static-webp/webp/webp_codec.cpp
3114
/* * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <jni.h> #include <webp/demux.h> #include <webp/decode.h> #include "exceptions.h" #include "decoded_image.h" #include "streams.h" #include "webp_codec.h" namespace facebook { namespace imagepipeline { namespace webp { /** * Uses libwebp to extract xmp metadata. */ const std::vector<uint8_t> extractMetadata( JNIEnv* env, std::vector<uint8_t>& image_data) { // Create WebPDemux from provided data. // It is "index" of all chunks. It stores // list of pointers to particular chunks, but does // not copy memory from provided WebPData. WebPData webpdata = {image_data.data(), image_data.size()}; // Thsnks to using RAII we do not need to worry about // releasing WebPDemuxer structure auto demux = std::unique_ptr<WebPDemuxer, decltype(&WebPDemuxDelete)>{ WebPDemux(&webpdata), WebPDemuxDelete}; THROW_AND_RETURNVAL_IF( demux == nullptr, "Could not create WebPDemux from image. This webp might be malformed.", {}); // find xmp chunk WebPChunkIterator chunk_iterator; if (!WebPDemuxGetChunk(demux.get(), "XMP ", 1, &chunk_iterator)) { // we failed to find "XMP " chunk - don't worry, maybe it was not // there. Let the transcode proceed WebPDemuxReleaseChunkIterator(&chunk_iterator); return {}; } // we managed to find "XMP " chunk, let's return its size and pointer to it const unsigned int metadata_length = chunk_iterator.chunk.size; const uint8_t* metadata_ptr = chunk_iterator.chunk.bytes; WebPDemuxReleaseChunkIterator(&chunk_iterator); // If XMP chunk contains no data then return nullptr. if (metadata_length == 0) { return {}; } return {metadata_ptr, metadata_ptr + metadata_length}; } std::unique_ptr<DecodedImage> decodeWebpFromInputStream( JNIEnv* env, jobject is, PixelFormat pixel_format) { // get image into decoded heap auto encoded_image = readStreamFully(env, is); RETURNVAL_IF_EXCEPTION_PENDING({}); // extract metadata auto metadata = extractMetadata(env, encoded_image); RETURNVAL_IF_EXCEPTION_PENDING({}); // get pixels int image_width = 0; int image_height = 0; uint8_t* raw_pixels = nullptr; switch (pixel_format) { case PixelFormat::RGB: raw_pixels = WebPDecodeRGB( encoded_image.data(), encoded_image.size(), &image_width, &image_height); break; case PixelFormat::RGBA: raw_pixels = WebPDecodeRGBA( encoded_image.data(), encoded_image.size(), &image_width, &image_height); break; default: THROW_AND_RETURNVAL_IF(true, "unrecognized pixel format", {}); } auto pixels = pixels_t{raw_pixels, (void(*)(uint8_t*)) &free}; return std::unique_ptr<DecodedImage>{ new DecodedImage{ std::move(pixels), pixel_format, (unsigned int) image_width, (unsigned int) image_height, std::move(metadata)}}; } } } }
mit
liks79/choosealicense.com
assets/css/application.css
8612
body { background-image: url(../img/bg.jpg); color: #5c5855; font: 14px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif; } a { color: #149ad4; font-weight: bold; text-decoration: none; } a:hover { text-decoration: underline; } h1, h2, h3, h5 { color: #443a33; font-family: Chivo, "Helvetica Neue", Helvetica, Arial, serif; font-weight: 900; line-height: 1.1; } h1 { font-size: 40px; margin-bottom: 25px; } h2 { opacity: 0.8; font-size: 24px; margin-top: 24px; margin-bottom: 10px; } h3 { font-size: 15px; margin-top: 20px; margin-bottom: 10px; } h5 { font-size: 14px; margin-bottom: 15px; } p { margin-bottom: 1em; } ol, ul { padding: 0; margin: 0; list-style-type: none; } th, td { text-align: left; font-weight: normal; } strong { color: #443b34; } .container { margin: 40px auto; width: 940px; } .home { text-align: center; } .home h1 { font-size: 63px; } .home h2 { color: #149ad4; font-size: 27px; line-height: 70px; margin-bottom: 45px; vertical-align: middle; opacity: 1; } .home h2 span { color: #e9e6e2; font-size: 70px; padding: 0 5px; position: relative; top: 10px; } .triptych { width: 900px; margin: 0 auto 20px; } .triptych li { width: 280px; float: left; margin-left: 27px; } .triptych li:first-child { margin-left: 0; } .triptych li > a { text-decoration: none; } .triptych h3 { font-size: 22px; margin: 0 auto 20px auto; width: 220px; } .situations .whatever { margin-top: 16px; } .situations .copyleft { margin-top: 3px; } .situations .button { margin-top: 20px; } .triptych-sprite { background-image: url(../img/home-sprite.png); background-repeat: no-repeat; display: inline-block; } .three-arrows { background-position: 0 0; width: 72px; height: 57px; } .lightbulb { background-position: 0 -57px; width: 43px; height: 72px; } .circular { background-position: 0 -129px; width: 72px; height: 69px; } .license-family { clear: both; margin-bottom: 50px; } .license-family-heading { float: left; width: 35%; } .license-details { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; width: 55%; padding-left: 20px; } .license-variations { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; height: 31px; padding-top: 23px; margin-left: -10px; } .license-family-name { font-size: 28px; } .license-family-description { color: #5c5855; } .license-rules { border-bottom: solid 1px #d9d7d2; font-size: 13px; line-height: 1.3; margin-bottom: 12px; width: 100%; } .license-rules th, .license-rules td { width: 33%; } .license-rules th { font-size: 15px; padding: 5px 10px 5px 0; vertical-align: bottom; } .license-rules th.summary { line-height: 1.4; } .license-rules .name { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; border-right: solid 1px #d9d7d2; padding-left: 0; width: 280px; } .license-rules .name a { font-size: 28px; } .license-rules .name small a { font-size: 16px; } .license-rules td { padding: 4px 0 12px 0; vertical-align: top; } .license-rules .label { font-weight: bold; } .license-rules li { margin-right: 15px; margin-bottom: 5px; } .license-rules li:hover { color: #443a33; } .license-sprite { background-image: url(../img/license-sprite.png); background-repeat: no-repeat; display: inline-block; } .sidebar .source span { background-position: 0 0; width: 16px; height: 12px; } .license-forbidden span { background-position: -16px 0; width: 12px; height: 12px; } .license-permitted span { background-position: -28px 0; width: 12px; height: 12px; } .license-required span { background-position: -40px 0; width: 12px; height: 12px; } .license-rules-sidebar li { float: none; padding-bottom: 3px; } .license-body { font-size: 15px; float: left; width: 700px; } .license-body pre { font-family: Consolas, Monaco, Courier, monospace; font-size: 14px; background-color: #fff; background-color: rgba(255, 255, 255, 0.8); border: 1px solid #e9e6e1; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; padding: 20px; } .sidebar { float: right; width: 220px; font-size: 12px; } .sidebar a.button { margin-top: -110px; width: 100%; } .sidebar .how-to-apply { font-size: 12px; margin-top: -15px; } .sidebar .how-to-apply p { line-height: 1.5; } .sidebar .how-to-apply p:last-child { margin-bottom: 0; } .sidebar .note { font-style: italic; } .sidebar .source { margin-top: 4px; margin-bottom: 30px; } .sidebar .boilerplate { font: 0.7em "Courier new", courier; } .button { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border-color: #ceccc9 #b6b4b1 #a6a4a2 #b6b4b1; border-style: solid; border-width: 1px; color: #443b34; -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0 2px 4px, rgba(255, 255, 255, 0.8) 0 1px 0 0 inset; -moz-box-shadow: rgba(0, 0, 0, 0.1) 0 2px 4px, rgba(255, 255, 255, 0.8) 0 1px 0 0 inset; box-shadow: rgba(0, 0, 0, 0.1) 0 2px 4px, rgba(255, 255, 255, 0.8) 0 1px 0 0 inset; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e7e5e0), color-stop(100%, #d5d3cf)); background-image: -webkit-linear-gradient(#e7e5e0, #d5d3cf); background-image: -moz-linear-gradient(#e7e5e0, #d5d3cf); background-image: -o-linear-gradient(#e7e5e0, #d5d3cf); background-image: linear-gradient(#e7e5e0, #d5d3cf); display: inline-block; font-size: 12px; font-weight: normal; padding: 5px 10px; text-align: center; vertical-align: middle; } .button:hover { text-decoration: none; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e7e5e0), color-stop(100%, #d0ceca)); background-image: -webkit-linear-gradient(#e7e5e0, #d0ceca); background-image: -moz-linear-gradient(#e7e5e0, #d0ceca); background-image: -o-linear-gradient(#e7e5e0, #d0ceca); background-image: linear-gradient(#e7e5e0, #d0ceca); } .projects-with-license li { padding-bottom: 3px; } .site-footer { border-top: 1px solid #e9e6e1; margin-top: 30px; padding-top: 20px; color: #5c5855; font-size: 12px; text-align: left; line-height: 1.5; } .site-footer a { color: #443a33; font-weight: normal; } .site-footer p { float: left; margin-top: 0; } .site-footer nav { float: right; } .site-footer nav a { display: inline-block; margin-left: 20px; } .bullets { list-style-type: disc; } .bullets > li { margin-left: 2em; } .nav-pills > li { float: left; display: block; margin-right: 10px; } .nav-pills > li > a { padding: 5px 10px; border-radius: 3px; } .nav-pills > li.active > a { background-color: #149ad4; color: #f7f4ef; } .variation-tab { display: none; } .variation-tab.active { display: block; } .small { font-size: 90%; } /* Qtip styles */ .qtip-required, .qtip-permitted, .qtip-forbidden { font-size: 12px; line-height: 1.3; } .qtip-required { background-color: #d0ebf6; border-color: #149ad4; color: #0d648a; } .qtip-required .qtip-titlebar { background-color: #149ad4; color: #fff; } .qtip-permitted { background-color: #d8f4d7; border-color: #3dc637; color: #298625; } .qtip-permitted .qtip-titlebar { background-color: #3dc637; color: #fff; } .qtip-forbidden { background-color: #f4d9d8; border-color: #c6403d; color: #812a28; } .qtip-forbidden .qtip-titlebar { background-color: #c6403d; color: #fff; } /* For modern browsers */ .clearfix:before, .clearfix:after { content: ""; display: table; } .clearfix:after { clear: both; } .with-love { float: right; clear: right; } @media only screen and (-webkit-min-device-pixel-ratio: 2.0), only screen and (min--moz-device-pixel-ratio: 2.0), only screen and (-o-min-device-pixel-ratio: 200/100), only screen and (min-device-pixel-ratio: 2.0) { .three-arrows, .lightbulb, .circular { background-image: url(../img/[email protected]); -webkit-background-size: 72px 198px; -moz-background-size: 72px 198px; background-size: 72px 198px; } .license-sprite { background-image: url(../img/[email protected]); -webkit-background-size: 52px 12px; -moz-background-size: 52px 12px; background-size: 52px 12px; } }
mit
FBRTMaka/ooi-ui
ooiui/static/js/views/science/HighChartsStreamingDataView.js
23076
"use strict"; /* * ooiui/static/js/views/science/HighChartsStreamingDataView.js */ var HighchartsStreamingContainerView = Backbone.View.extend({ subviews : [], showControls: true, initialize: function(options) { if (options && 'showControls' in options){ this.showControls = options.showControls; } _.bindAll(this, "render", "add","remove"); this.render(); }, render: function() { this.$el.html("<div class='streaming-plot-container-header'><div class='streaming-plot-container-contents'></div></div>"); }, add: function(streamModel) { var self = this; if (self.subviews.length >= 5){ return false; } var refExists = false; var streamPlotAdded = false; _.each(self.subviews,function(currentView){ var currentRef = currentView.model.get('reference_designator'); var currentStream = currentView.model.get('stream_name'); if (currentRef == streamModel.get('reference_designator') && currentStream == streamModel.get('stream_name') ){ //check to see if the reference designator already exists refExists= true; } }); if (!refExists){ var subview = new HighchartsStreamingDataOptionsView({ model: streamModel, showControls: self.showControls }); subview.render(); this.subviews.push(subview); this.$el.find('.streaming-plot-container-contents').append(subview.el); streamPlotAdded = true; } return streamPlotAdded }, getSelectedStreams : function(){ var self = this; var selectedStreamModelCollection = new StreamCollection(); _.each(self.subviews,function(currentView,i){ selectedStreamModelCollection.add(currentView.model); }); return selectedStreamModelCollection; }, remove: function(streamModel) { var self = this; var streamPlotRemoved = false; _.each(self.subviews,function(currentView,i){ var currentRef = currentView.model.get('reference_designator'); var currentStream = currentView.model.get('stream_name'); if (currentRef == streamModel.get('reference_designator') && currentStream == streamModel.get('stream_name')){ //check to see if the reference designator already exists if (i > -1) { //de render and remove for the list currentView.derender(); self.subviews.splice(i, 1); streamPlotRemoved= true; } } }); return streamPlotRemoved; }, }); var HighchartsStreamingDataOptionsView = Backbone.View.extend({ showControls: true, initialize: function(options) { if (options && options.model){ this.model = options.model; } if (options && 'showControls' in options){ this.showControls = options.showControls; } _.bindAll(this,'render','onPlayClick','onRemoveClick','onPauseClick','onHideChart'); }, events:{ 'click #streamingClose': 'onRemoveClick', 'click #playStream': 'onPlayClick', 'click #pauseStream': 'onPauseClick', 'click #download-plot' : 'plotDownloads', 'click #streamingHide' : 'onHideChart' }, onHideChart:function(){ if (this.$el.find("#streamingHide").hasClass('fa-chevron-circle-down')){ this.$el.find("#streamingHide").removeClass('fa-chevron-circle-down').addClass('fa-chevron-circle-up'); }else{ this.$el.find("#streamingHide").removeClass('fa-chevron-circle-up').addClass('fa-chevron-circle-down'); } this.$el.find('#streamingDataPlot').toggle( "slow"); }, onRemoveClick:function(){ ooi.trigger('streamPlot:removeStream',this.model); }, plotDownloads: function(e) { event.preventDefault(); var self = this; self.onPauseClick(); if ( self.streamingDataView ){ var chart = self.streamingDataView.chart; var fileName = chart.title.textStr + '_' + chart.subtitle.textStr; chart.exportChart({type: 'image/png', filename: fileName}); } }, onPlayClick:function(){ var self = this; if (self.getVariableList().length>0){ this.$el.find('#playStream').prop('disabled', true); if (self.streamingDataView.isRendered){ self.streamingDataView.chart.showLoading(); self.streamingDataView.chart.isLoading=true; self.streamingDataView.updateVariable(self.getVariableList()); self.streamingDataView.resume(); }else{ self.streamingDataView.updateVariable(self.getVariableList()); self.streamingDataView.render(); } this.$el.find('#pauseStream').prop('disabled', false); this.$el.find('#paramSelection').attr('disabled',true); this.$el.find('.selectpicker').selectpicker('refresh'); } }, onPauseClick:function(){ var self = this this.$el.find('#pauseStream').prop('disabled', true); self.streamingDataView.abort(); this.$el.find('#playStream').prop('disabled', false); this.$el.find('#paramSelection').attr('disabled',false); this.$el.find('.selectpicker').selectpicker('refresh'); }, template: JST['ooiui/static/js/partials/HighChartsStreamingDataOptionsView.html'], initialRender: function() { this.$el.html('<i class="fa fa-spinner fa-spin" style="margin-top:80px;margin-left:50%;font-size:90px;"> </i>'); return this; }, getVariableList:function(){ var self = this; var selectedItem = self.$el.find("#paramSelection option:selected"); var selected = []; $(selectedItem).each(function(index){ selected.push({'variable':$(this).data('params'),'prettyname':$(this).text()}); }); return selected; }, render: function() { var self = this; this.$el.html(this.template({streamModel:self.model,showControls:self.showControls})); var param_list = [], parameterhtml = "", shape = self.model.get('variables_shape'), autoPlot = false; var paramCount = 0; parameterhtml += "<optgroup label='Derived'>" for (var i = 0; i < _.uniq(self.model.get('variables')).length; i++) { if (param_list.indexOf(self.model.get('variables')) == -1){ if (shape[i] === "function"){ var parameterId = self.model.get('parameter_id')[i]; var units = self.model.get('units')[i]; var variable = self.model.get('variables')[i]; var displayName; try{ displayName = self.model.get('parameter_display_name')[i]; } catch(err){ displayName = variable; } //for the case when we have "sal"inity in the variable nanem but we want to remove units of "1" var validUnits = false; var validUnitsClass = "class=invalidParam" if (units.toLowerCase() != "s" && units.toLowerCase() != "1" && units.toLowerCase() != "counts" && units.toLowerCase().indexOf("seconds since") == -1 && units.toLowerCase() != "bytes"){ validUnits = true } if (variable.toLowerCase().indexOf("sal") > -1){ validUnits = true; } if (validUnits){ validUnitsClass = 'class=validParam' } if (variable.indexOf("_timestamp") == -1){ if (variable.toLowerCase() != "time"){ if ( paramCount < 4 && validUnits && (variable.indexOf('oxygen') > -1 || variable.indexOf('temperature') > -1 || variable.indexOf('velocity') > -1 || variable.indexOf('conductivity') > -1 || variable.indexOf('current') > -1 || variable.indexOf('voltage') > -1 || variable.indexOf('pressure') > -1 || variable.indexOf('ang_rate') > -1 || variable.indexOf('coefficient') > -1 || variable.indexOf('chlorophyll') > -1 || variable.indexOf('par') > -1 || variable.indexOf('heat') > -1 )){ parameterhtml+= "<option "+validUnitsClass+" selected pid='"+ parameterId +"'data-params='" + variable + "' data-subtext='"+ units +"' >"+ displayName +"</option>"; paramCount++; } else { parameterhtml+= "<option "+validUnitsClass+" pid='"+ parameterId +"'data-params='" + variable + "' data-subtext='"+ units +"' >"+ displayName +"</option>"; } param_list.push(variable); } } } } } parameterhtml += "</optgroup>" //Now get non derived parameters parameterhtml += "<optgroup label='Non Derived'>" for (var i = 0; i < _.uniq(self.model.get('variables')).length; i++) { if (param_list.indexOf(self.model.get('variables')) == -1){ if (shape[i] != "function"){ var parameterId = self.model.get('parameter_id')[i]; var units = self.model.get('units')[i]; var variable = self.model.get('variables')[i]; var displayName; try{ displayName = self.model.get('parameter_display_name')[i]; } catch(err){ displayName = variable; } //for the case when we have "sal"inity in the variable nanem but we want to remove units of "1" var validUnits = false; var validUnitsClass = "class=invalidParam"; if (units.toLowerCase() != "s" && units.toLowerCase() != "1" && units.toLowerCase() != "counts" && units.toLowerCase().indexOf("seconds since") == -1 && units.toLowerCase() != "bytes"){ validUnits = true } if (variable.toLowerCase().indexOf("sal") > -1){ validUnits = true; } if (validUnits){ validUnitsClass = 'class=validParam' } if (variable.toLowerCase() != "time"){ if ( paramCount < 4 && ( parameterhtml.indexOf("<optgroup label='Derived'></optgroup>") > -1 ) && validUnits && (variable.indexOf('oxygen') > -1 || variable.indexOf('temperature') > -1 || variable.indexOf('velocity') > -1 || variable.indexOf('conductivity') > -1 || variable.indexOf('current') > -1 || variable.indexOf('voltage') > -1 || variable.indexOf('pressure') > -1 || variable.indexOf('ang_rate') > -1 || variable.indexOf('coefficient') > -1 || variable.indexOf('chlorophyll') > -1 || variable.indexOf('par') > -1) ) { parameterhtml+= "<option "+validUnitsClass+" selected pid='"+ parameterId +"'data-params='" + variable + "' data-subtext='"+ units +"' >"+ displayName +"</option>"; paramCount++; } else { parameterhtml+= "<option "+validUnitsClass+" pid='"+ parameterId +"'data-params='" + variable + "' data-subtext='"+ units +"' >"+ displayName +"</option>"; } param_list.push(variable); } } } } parameterhtml += "</optgroup>" self.$el.find('#paramSelection').html(parameterhtml) self.$el.find('#paramSelection .invalidParam').attr('disabled','disabled'); self.$el.find('#paramSelection').selectpicker('refresh'); this.streamingDataView = new HighchartsStreamingDataView({ model: self.model, el: self.$el.find('#streamingDataPlot'), variable: self.getVariableList() }); this.$el.find('#playStream').click(); setTimeout(function (){ $(document).resize() }, 100); }, derender: function() { this.streamingDataView.abort(); this.streamingDataView.remove(); this.streamingDataView.unbind(); this.streamingDataView.chart = null; this.streamingDataView.$el.remove(); this.streamingDataView = null; this.remove(); this.unbind(); if (this.model) this.model.off(); } }); var HighchartsStreamingDataView = Backbone.View.extend({ multiRequest: true, isRendered:false, initialize: function(options) { var self = this; this.title = options && options.title || "Chart"; this.title_style = options && options.title_style || { }; this.subtitle = options && options.subtitle || ""; _.bindAll(this, "onClick",'requestData','abort','updateDateTimes','getUrl','updateVariable','resume'); var dt = moment().utc(); var dt2Str = self.getEndDate(dt,0); var dt1Str = self.getStartDate(dt,300); self.variable = options.variable; self.variable_list = []; _.each(self.variable,function(data_variable,vv){ self.variable_list.push(data_variable['variable']); }); this.ds = new DataSeriesCollection([],{'stream':this.model.get('stream_name'),'ref_des':this.model.get('ref_des'), 'xparameters':['time'],'yparameters':self.variable_list, 'startdate':dt1Str,'enddate':dt2Str}); }, getStartDate:function(dt,rm_seconds){ //start date return dt.subtract(rm_seconds, 'seconds').format("YYYY-MM-DDTHH:mm:ss.000")+"Z" }, getEndDate:function(dt,rm_seconds){ //needs to be first, previous 10 seconds return dt.subtract(rm_seconds, 'seconds').format("YYYY-MM-DDTHH:mm:ss.000")+"Z" }, updateVariable:function(variable){ var self = this; self.variable = variable; self.variable_list = []; _.each(self.variable,function(data_variable,vv){ self.variable_list.push(data_variable['variable']); }); self.ds.yparameters = [self.variable_list]; self.resetAxis = true; }, updateDateTimes:function(){ var self = this; //update datetime using new moment dates var dt = moment().utc(); var dt2Str = self.getEndDate(dt,0); if (self.overrideStDate){ //override start date if data points exceed 0 var dt1Str = self.getStartDate(dt,300); this.ds.startdate = dt1Str; } this.ds.enddate = dt2Str; }, onClick: function(e, point) { //this.trigger('onClick', e, point); }, abort:function(){ //kill the request, if its availble this.multiRequest = false; try{ this.xhr.onreadystatechange = null; this.xhr.abort() }catch(e){ } }, resume:function(){ //kill the request this.multiRequest = true; this.overrideStDate = true; this.requestData(); }, getUrl:function(){ var self = this; self.updateDateTimes(); return this.ds.url(); }, requestData: function() { var self = this; self.xhr = $.ajax({ url: self.getUrl(), cache: false, error: function(XMLHttpRequest, textStatus, errorThrown) { // if (errorThrown!="abort"){ self.$el.parent().parent().parent().find('#pauseStream').click(); self.$el.find('.highcharts-container .highcharts-loading span').text('Error Loading...'); bootbox.dialog({ title: "Error Getting Data From Stream", message: "There was an error obtaining the stream data from uframe", }); } }, success: function(points) { if (self.multiRequest){ if (self.isLoading){ self.chart.hideLoading(); } var point = null; if (self.resetAxis){ for (var i = 0; i < 4; i++) { var series = self.chart.series[i]; self.chart.yAxis[i].update({ labels: {enabled: false}, title: {text: null} }); self.chart.series[i].setData([]); self.chart.series[i].hide(); self.chart.series[i].options.showInLegend = false; self.chart.series[i].legendItem = null; self.chart.legend.destroyItem(self.chart.series[i]); } } self.chart.legend.render(); _.each(self.variable,function(data_variable,vv){ var series = self.chart.series[vv]; var shift = false; var shift = self.chart.series[vv].data.length > 200; if (self.resetAxis){ //reset the axis and some of the contents series.name = data_variable['prettyname']; //self.chart.legend.allItems[vv].update({name:series.name}); series.options.showInLegend = true; self.chart.yAxis[vv].update({ labels: {enabled: true}, title: {text:points['units'][self.variable_list[vv]]} }); series.options.units = points['units'][self.variable_list[vv]]; self.chart.series[vv].show(); self.chart.redraw(); self.chart.legend.renderItem(series); self.chart.legend.render(); } //only override the data if their are points available self.overrideStDate = true; if (points['data'].length > 0){ var dx= null; self.overrideStDate = false; for (var i = 0; i < points['data'].length; i++) { var x = points['data'][i]['time']; var y = points['data'][i][self.variable_list[vv]]; x -= 2208988800; x = x*1000; dx= moment.utc(x); point = [dx._i,y] if (i < points['data'].length-1){ self.chart.series[vv].addPoint(point, false, shift); }else{ self.chart.series[vv].addPoint(point, true, shift); } } //fix start date self.ds.startdate = moment.utc(x).format("YYYY-MM-DDTHH:mm:ss.000")+"Z" } }); if (self.resetAxis){ self.chart.redraw(); self.resetAxis = false; } if (self.multiRequest){ // call it again after (X) seconds setTimeout(self.requestData, 2000); } } }, cache: false }); }, render: function() { var self = this; self.isRendered = true; self.resetAxis = true; self.isLoading = true; var formatter = d3.format(".2f"); var yAxisList = []; var seriesList = []; for (var i = 0; i < 4; i++) { var op = !((i+1) % 2); var gridWidth = 1; if (i>0){ gridWidth = 0; } yAxisList.push({ gridLineWidth:gridWidth, labels: { format: '{value:.2f}', style: { color: Highcharts.getOptions().colors[i] } }, minPadding: 0.2, maxPadding: 0.2, title: { text: null, margin: 80, style: { color: Highcharts.getOptions().colors[i] } }, opposite: op }) seriesList.push({ yAxis: i, name: "unknown", data: [] }); } self.chart = new Highcharts.Chart({ chart: { renderTo: self.el, defaultSeriesType: 'line', events: { load: self.requestData } }, credits: { enabled: false }, loading: { labelStyle: { //color: 'black' }, style: { //backgroundColor: 'lightblue', //opacity: 0.4, }, hideDuration: 500, showDuration: 1000, }, plotOptions: { line: { marker: { enabled: false, } } }, title: { text: self.model.get('display_name') }, subtitle: { text: self.model.get('stream_name') }, legend: { align: 'left' }, exporting: { //Enable exporting images enabled: true, scale: 1, enableImages: true, legend:{ enabled:true }, chartOptions: { chart: { width: 1400, height: 400, events: { load: function () { var chart = this; $.each(chart.series,function(i,series) { series.name = self.chart.series[i].name chart.legend.renderItem(series); }); chart.legend.render(); } } }, } }, xAxis: [{ type: 'datetime', tickPixelInterval: 150, maxZoom: 20 * 1000, title: { text: 'Date (UTC)' } }], tooltip: { useHTML: true, formatter: function() { var x = this.x; var s = ''; s+='<p><b>Time: '+Highcharts.dateFormat('%Y-%m-%d %H:%M:%S UTC', this.x) +'</b></p><p>'; _.each(self.chart.series,function(series) { if (series.visible) { // Assume the data is ordered by time. Find the 1st value that is >= x. var xy = _.find(series.data,function(o){return o.x >= x}); if (xy) { s += '<span style="color: ' + series.color + ';">' + series.name + '</span>' + ': ' + formatter(xy.y)+ '</p>'; } } }); return s; }, shared: true, crosshairs : [true,false] }, yAxis: yAxisList, series: seriesList }); self.chart.showLoading(); } });
mit
XinwLi/Interop-TestSuites-1
ExchangeMAPI/Source/MS-OXCFXICS/Model/Model.cs
359170
[assembly: Microsoft.Xrt.Runtime.NativeType("System.Diagnostics.Tracing.*")] namespace Microsoft.Protocols.TestSuites.MS_OXCFXICS { using Microsoft.Modeling; using Microsoft.Protocols.TestSuites.Common; /// <summary> /// Model program. /// </summary> public static class Model { #region Variables /// <summary> /// Record the SHOULD/MAY requirements container. /// </summary> private static MapContainer<int, bool> requirementContainer = new MapContainer<int, bool>(); /// <summary> /// Record the connections data container. /// </summary> private static MapContainer<int, ConnectionData> connections = new MapContainer<int, ConnectionData>(); /// <summary> /// Record the prior operation. /// </summary> private static PriorOperation priorOperation; /// <summary> /// Record whether Message change is partial or not. /// </summary> private static bool messagechangePartail; /// <summary> /// Record the SourceOperation of RopFastTransferDestinationPutBuffer. /// </summary> private static SourceOperation sourOperation; /// <summary> /// Record the prior download operation. /// </summary> private static PriorDownloadOperation priorDownloadOperation; /// <summary> /// Record the prior upload operation. /// </summary> private static PriorOperation priorUploadOperation; /// <summary> /// Record the soft delete message count. /// </summary> private static int softDeleteMessageCount; /// <summary> /// Record the soft delete folder count. /// </summary> private static int softDeleteFolderCount; #endregion /// <summary> /// Gets or sets the priorOperation. /// </summary> public static PriorOperation PriorOperation { get { return priorOperation; } set { priorOperation = value; } } #region Assistant Rop Interfaces /// <summary> /// Determines if the requirement is enabled or not. /// </summary> /// <param name="rsid"> Indicate the requirement ID.</param> /// <param name="enabled"> Indicate the check result whether the requirement is enabled.</param> [Rule(Action = "CheckRequirementEnabled(rsid, out enabled)")] public static void CheckRequirementEnabled(int rsid, out bool enabled) { enabled = Choice.Some<bool>(); requirementContainer.Add(rsid, enabled); } /// <summary> /// This method is used to check whether MAPIHTTP transport is supported by SUT. /// </summary> /// <param name="isSupported">The transport is supported or not.</param> [Rule(Action = "CheckMAPIHTTPTransportSupported(out isSupported)")] public static void CheckMAPIHTTPTransportSupported(out bool isSupported) { isSupported = Choice.Some<bool>(); } /// <summary> /// This method is used to check whether the second system under test is online or not. /// </summary> /// <param name="isSecondSUTOnline"> Indicate the second SUT is online or not.</param> [Rule(Action = "CheckSecondSUTOnline(out isSecondSUTOnline)")] public static void CheckSecondSUTOnline(out bool isSecondSUTOnline) { isSecondSUTOnline = Choice.Some<bool>(); } /// <summary> /// Connect to the server. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="connectionType">The type of connection.</param> [Rule(Action = "Connect(serverId, connectionType)")] public static void Connect(int serverId, ConnectionType connectionType) { // Initialize ConnectionData. ConnectionData newConnection = new ConnectionData { FolderContainer = new Sequence<AbstractFolder>(), AttachmentContainer = new Sequence<AbstractAttachment>(), MessageContainer = new Sequence<AbstractMessage>() }; // Create a new ConnectionData. connections.Add(serverId, newConnection); } /// <summary> /// Disconnect the connection to server. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> [Rule(Action = "Disconnect(serverId)")] public static void Disconnect(int serverId) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Disconnect from server. connections.Remove(serverId); } /// <summary> /// Logon the Server. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="flag">The type of logon.</param> /// <param name="logonHandleIndex">The server object handle index.</param> /// <param name="inboxFolderIdIndex">The inbox folder Id index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "Logon(serverId,flag, out logonHandleIndex,out inboxFolderIdIndex)/result")] public static RopResult Logon(int serverId, LogonFlags flag, out int logonHandleIndex, out int inboxFolderIdIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. logonHandleIndex = AdapterHelper.GetHandleIndex(); inboxFolderIdIndex = AdapterHelper.GetObjectIdIndex(); ConnectionData changeConnection = connections[serverId]; changeConnection.LogonHandleIndex = logonHandleIndex; changeConnection.LogonFolderType = flag; // Initialize the Container of ConnectionData. changeConnection.FolderContainer = new Sequence<AbstractFolder>(); changeConnection.MessageContainer = new Sequence<AbstractMessage>(); changeConnection.AttachmentContainer = new Sequence<AbstractAttachment>(); changeConnection.DownloadContextContainer = new Sequence<AbstractDownloadInfo>(); changeConnection.UploadContextContainer = new Sequence<AbstractUploadInfo>(); // Create Inbox folder and set value for abstractInboxfolder. AbstractFolder inboxfolder = new AbstractFolder { FolderIdIndex = inboxFolderIdIndex, FolderPermission = PermissionLevels.ReadAny }; // Add inbox folder to FolderContainer. changeConnection.FolderContainer = changeConnection.FolderContainer.Add(inboxfolder); connections[serverId] = changeConnection; RopResult result = RopResult.Success; return result; } /// <summary> /// Open a specific message. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">The handle index folder object which the message in. </param> /// <param name="folderIdIndex">The folder id index of which the specific message in.</param> /// <param name="messageIdIndex">The message id index.</param> /// <param name="openMessageHandleIndex">The message handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "OpenMessage(serverId, objHandleIndex, folderIdIndex, messageIdIndex,out openMessageHandleIndex)/result")] public static RopResult OpenMessage(int serverId, int objHandleIndex, int folderIdIndex, int messageIdIndex, out int openMessageHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].LogonHandleIndex > 0); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); Condition.IsTrue(connections[serverId].MessageContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; openMessageHandleIndex = 0; // Get information of ConnectionData. ConnectionData changeConnection = connections[serverId]; // Identify whether the current message is existent or not. AbstractMessage currentMessage = new AbstractMessage(); bool ismessagExist = false; // Record current message. int messageIndex = 0; foreach (AbstractMessage tempMessage in changeConnection.MessageContainer) { if (tempMessage.MessageIdIndex == messageIdIndex) { ismessagExist = true; currentMessage = tempMessage; messageIndex = changeConnection.MessageContainer.IndexOf(tempMessage); } } if (ismessagExist) { // Set value to current folder. currentMessage.MessageHandleIndex = AdapterHelper.GetHandleIndex(); openMessageHandleIndex = currentMessage.MessageHandleIndex; // Update current message. changeConnection.MessageContainer = changeConnection.MessageContainer.Update(messageIndex, currentMessage); connections[serverId] = changeConnection; result = RopResult.Success; } return result; } /// <summary> /// Open specific folder. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">The server object handle index.</param> /// <param name="folderIdIndex">The folder id index.</param> /// <param name="inboxFolderHandleIndex">The folder handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "OpenFolder(serverId, objHandleIndex, folderIdIndex, out inboxFolderHandleIndex)/result")] public static RopResult OpenFolder(int serverId, int objHandleIndex, int folderIdIndex, out int inboxFolderHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].LogonHandleIndex > 0); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; inboxFolderHandleIndex = 0; // Get information of ConnectionData. ConnectionData changeConnection = connections[serverId]; // Identify whether the CurrentFolder is existent or not. AbstractFolder currentfolder = new AbstractFolder(); bool isFolderExist = false; // Record current folder. int folderIndex = 0; foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderIdIndex == folderIdIndex) { isFolderExist = true; currentfolder = tempfolder; folderIndex = changeConnection.FolderContainer.IndexOf(tempfolder); } } if (isFolderExist) { // Set value to current folder. currentfolder.FolderHandleIndex = AdapterHelper.GetHandleIndex(); inboxFolderHandleIndex = currentfolder.FolderHandleIndex; // Initialize data of part of current folder. currentfolder.SubFolderIds = new Set<int>(); currentfolder.MessageIds = new Set<int>(); currentfolder.FolderProperties = new Set<string>(); // Update current folder. changeConnection.FolderContainer = changeConnection.FolderContainer.Update(folderIndex, currentfolder); connections[serverId] = changeConnection; result = RopResult.Success; } return result; } /// <summary> /// Create a folder and return the folder handle created. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">The server object handle index.</param> /// <param name="folderName">The new folder's name.</param> /// <param name="folderIdIndex">The folder id index.</param> /// <param name="folderHandleIndex">The new folder's handle index.</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = "CreateFolder(serverId, objHandleIndex, folderName, out folderIdIndex, out folderHandleIndex)/result")] public static RopResult CreateFolder(int serverId, int objHandleIndex, string folderName, out int folderIdIndex, out int folderHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].LogonHandleIndex > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; folderIdIndex = 0; folderHandleIndex = 0; // Identify whether the Current Folder is existent or not. ConnectionData changeConnection = connections[serverId]; AbstractFolder parentfolder = new AbstractFolder(); bool isParentFolderExist = false; int parentfolderIndex = 0; // Find Current Folder. foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == objHandleIndex) { isParentFolderExist = true; parentfolder = tempfolder; parentfolderIndex = changeConnection.FolderContainer.IndexOf(tempfolder); } } if (isParentFolderExist) { // Create a new folder. AbstractFolder currentfolder = new AbstractFolder { FolderHandleIndex = AdapterHelper.GetHandleIndex() }; // Set value for new folder folderHandleIndex = currentfolder.FolderHandleIndex; currentfolder.FolderIdIndex = AdapterHelper.GetObjectIdIndex(); folderIdIndex = currentfolder.FolderIdIndex; currentfolder.ParentFolderHandleIndex = parentfolder.FolderHandleIndex; currentfolder.ParentFolderIdIndex = parentfolder.FolderIdIndex; currentfolder.FolderPermission = PermissionLevels.FolderOwner; // Initialize for new folder. currentfolder.SubFolderIds = new Set<int>(); currentfolder.MessageIds = new Set<int>(); currentfolder.ICSStateContainer = new MapContainer<int, AbstractUpdatedState>(); // Update SubFolderIds of parent folder. parentfolder.SubFolderIds = parentfolder.SubFolderIds.Add(currentfolder.FolderIdIndex); // Update parent folder changeConnection.FolderContainer = changeConnection.FolderContainer.Update(parentfolderIndex, parentfolder); // Add new folder to FolderContainer. changeConnection.FolderContainer = changeConnection.FolderContainer.Add(currentfolder); connections[serverId] = changeConnection; if (folderIdIndex > 0) { // Because only if the folder is right can return a valid folderIdIndex, then the requirement is verified. ModelHelper.CaptureRequirement( 1890, @"[In Identifying Objects and Maintaining Change Numbers] On creation, objects in the mailbox are assigned internal identifiers, commonly known as Folder ID structures ([MS-OXCDATA] section 2.2.1.1) for folders."); } result = RopResult.Success; } return result; } /// <summary> /// Create a message and return the message handle created. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">The folder handle index for creating message.</param> /// <param name="folderIdIndex">The folder Id index.</param> /// <param name="associatedFlag">The message is FAI or not.</param> /// <param name="messageHandleIndex">The created message handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "CreateMessage(serverId, folderHandleIndex, folderIdIndex, associatedFlag, out messageHandleIndex)/result")] public static RopResult CreateMessage(int serverId, int folderHandleIndex, int folderIdIndex, bool associatedFlag, out int messageHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].LogonHandleIndex > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; messageHandleIndex = -1; // Identify whether the Current Folder is existent or not. ConnectionData changeConnection = connections[serverId]; AbstractFolder parentfolder = new AbstractFolder(); bool isParentFolderExist = false; int parentfolderIndex = 0; // Find current folder. foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == folderHandleIndex) { isParentFolderExist = true; parentfolder = tempfolder; parentfolderIndex = changeConnection.FolderContainer.IndexOf(tempfolder); } } if (isParentFolderExist) { // Create a new message object. AbstractMessage currentMessage = new AbstractMessage { IsFAImessage = associatedFlag, IsRead = true, FolderHandleIndex = folderHandleIndex, FolderIdIndex = folderIdIndex, MessageHandleIndex = AdapterHelper.GetHandleIndex(), MessageProperties = new Sequence<string>() }; // Set value for new message. // Initialize message properties. messageHandleIndex = currentMessage.MessageHandleIndex; // Update folder changeConnection.FolderContainer = changeConnection.FolderContainer.Update(parentfolderIndex, parentfolder); // Add new message to MessageContainer. changeConnection.MessageContainer = changeConnection.MessageContainer.Add(currentMessage); connections[serverId] = changeConnection; if (currentMessage.MessageHandleIndex > 0) { // Because only if the folder is right can return a valid message handle index, then the requirement is verified. ModelHelper.CaptureRequirement( 1890001, @"[In Identifying Objects and Maintaining Change Numbers] On creation, objects in the mailbox are assigned internal identifiers, commonly known as Message ID structures ([MS-OXCDATA] section 2.2.1.2) for messages."); } result = RopResult.Success; } return result; } /// <summary> /// Create an attachment on specific message object. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server</param> /// <param name="messageHandleIndex">The message handle</param> /// <param name="attachmentHandleIndex">The attachment handle of created</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = "CreateAttachment(serverId,messageHandleIndex, out attachmentHandleIndex)/result")] public static RopResult CreateAttachment(int serverId, int messageHandleIndex, out int attachmentHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. RopResult result = RopResult.InvalidParameter; attachmentHandleIndex = -1; // Identify whether the Current message is existent or not. ConnectionData changeConnection = connections[serverId]; AbstractMessage currentMessage = new AbstractMessage(); bool iscurrentMessageExist = false; int currentMessageIndex = 0; // Find current message foreach (AbstractMessage tempMessage in changeConnection.MessageContainer) { if (tempMessage.MessageHandleIndex == messageHandleIndex) { iscurrentMessageExist = true; currentMessage = tempMessage; currentMessageIndex = changeConnection.MessageContainer.IndexOf(tempMessage); } } if (iscurrentMessageExist) { // Create a new attachment. AbstractAttachment currentAttachment = new AbstractAttachment(); // Set value for new attachment. currentMessage.AttachmentCount++; changeConnection.MessageContainer.Update(currentMessageIndex, currentMessage); currentAttachment.AttachmentHandleIndex = AdapterHelper.GetHandleIndex(); attachmentHandleIndex = currentAttachment.AttachmentHandleIndex; // Add new attachment to attachment container. changeConnection.AttachmentContainer = changeConnection.AttachmentContainer.Add(currentAttachment); connections[serverId] = changeConnection; result = RopResult.Success; } // There is no negative behavior specified in this protocol, so this operation always return true. return result; } /// <summary> /// Save the changes property of message. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="messageHandleIndex">The message handle index.</param> /// <param name="messageIdIndex">The message id index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SaveChangesMessage(serverId, messageHandleIndex, out messageIdIndex)/result")] public static RopResult SaveChangesMessage(int serverId, int messageHandleIndex, out int messageIdIndex) { // The contraction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].MessageContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; messageIdIndex = -1; // Identify whether the Current message is existent or not. ConnectionData changeConnection = connections[serverId]; AbstractMessage currentMessage = new AbstractMessage(); bool isMessageExist = false; int messageIndex = 0; // Find current message foreach (AbstractMessage tempMesage in changeConnection.MessageContainer) { if (tempMesage.MessageHandleIndex == messageHandleIndex) { isMessageExist = true; currentMessage = tempMesage; messageIndex = changeConnection.MessageContainer.IndexOf(tempMesage); } } if (isMessageExist) { // Find the parent folder of relate message AbstractFolder parentfolder = new AbstractFolder(); int parentfolderIndex = 0; foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderHandleIndex == currentMessage.FolderHandleIndex) { parentfolder = tempFolder; parentfolderIndex = changeConnection.FolderContainer.IndexOf(tempFolder); } } // If new message then return a new message id. if (currentMessage.MessageIdIndex == 0) { currentMessage.MessageIdIndex = AdapterHelper.GetObjectIdIndex(); // Because if Create a new messageID then the action which convert GID to a short-term internal identifier and assign it to an imported object execute in MS_OXCFXICSAdapter. So cover this requirement here. ModelHelper.CaptureRequirement(1910, "[In Identifying Objects and Maintaining Change Numbers] Convert the GID structure ([MS-OXCDATA] section 2.2.1.3) to a short-term internal identifier and assign it to an imported object, if the external identifier is a GID value."); } // Set value for the current Message messageIdIndex = currentMessage.MessageIdIndex; parentfolder.MessageIds = parentfolder.MessageIds.Add(messageIdIndex); changeConnection.FolderContainer = changeConnection.FolderContainer.Update(parentfolderIndex, parentfolder); // Assign a new Change number. currentMessage.ChangeNumberIndex = ModelHelper.GetChangeNumberIndex(); // Because of executed import operation before execute RopSaveChangesMessage operation. And assign a new changeNumber. So can cover this requirement here. ModelHelper.CaptureRequirement( 1906, @"[In Identifying Objects and Maintaining Change Numbers]Upon successful import of a new or changed object using ICS upload, the server MUST do the following when receiving the RopSaveChangesMessage ROP:Assign the object a new internal change number (PidTagChangeNumber property (section 2.2.1.2.3))."); // Because of it must execute RopSaveChangesMessage operation after the messaging object each time and assign a new changeNumber. So can cover this requirement Spec here. ModelHelper.CaptureRequirement(1898, "[In Identifying Objects and Maintaining Change Numbers]A new change number is assigned to a messaging object each time it is modified."); currentMessage.ReadStateChangeNumberIndex = 0; // Update current Message into MessageContainer changeConnection.MessageContainer = changeConnection.MessageContainer.Update(messageIndex, currentMessage); connections[serverId] = changeConnection; if (priorOperation == MS_OXCFXICS.PriorOperation.RopCreateMessage && messageIndex > 0) { // When the prior operate is create message and in this ROP return a valid messageIDIndex means this requirement verified. ModelHelper.CaptureRequirement( 1890001, @"[In Identifying Objects and Maintaining Change Numbers] On creation, objects in the mailbox are assigned internal identifiers, commonly known as Message ID structures ([MS-OXCDATA] section 2.2.1.2) for messages."); } result = RopResult.Success; } return result; } /// <summary> /// Commits the changes made to the Attachment object. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="attachmentHandleIndex">The attachment handle</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = "SaveChangesAttachment(serverId,attachmentHandleIndex)/result")] public static RopResult SaveChangesAttachment(int serverId, int attachmentHandleIndex) { // Contraction condition is the Attachment is created successful Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].AttachmentContainer.Count > 0); // Return Success RopResult result = RopResult.Success; return result; } /// <summary> /// Release the object by handle. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">The object handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "Release(serverId, objHandleIndex)/result")] public static RopResult Release(int serverId, int objHandleIndex) { // The contraction conditions Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // The operation success. return RopResult.Success; } /// <summary> /// Delete the specific folder. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">The folder handle index.</param> /// <param name="folderIdIndex">The folder id index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "DeleteFolder(serverId, folderHandleIndex, folderIdIndex)/result")] public static RopResult DeleteFolder(int serverId, int folderHandleIndex, int folderIdIndex) { // The contraction conditions Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].LogonHandleIndex > 0); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; ConnectionData changeConnection = connections[serverId]; // Identify whether the Current folder and Parent folder are existent or not. AbstractFolder currentfolder = new AbstractFolder(); AbstractFolder parentfolder = new AbstractFolder(); bool isCurrentFolderExist = false; bool isParentFolderExist = false; // Find parent folder. foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == folderHandleIndex) { isParentFolderExist = true; parentfolder = tempfolder; } } // Find current folder. foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderIdIndex == folderIdIndex) { isCurrentFolderExist = true; currentfolder = tempfolder; } } if (isParentFolderExist && isCurrentFolderExist) { // Remove current folder from SubFolderIds property of parent folder parentfolder.SubFolderIds = parentfolder.SubFolderIds.Remove(currentfolder.FolderIdIndex); // Remove current folder changeConnection.FolderContainer = changeConnection.FolderContainer.Remove(currentfolder); connections[serverId] = changeConnection; result = RopResult.Success; } return result; } /// <summary> /// Get specific property value. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="handleIndex">Identify from which the property will be gotten.</param> /// <param name="propertyTag">A list of propertyTags.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "GetPropertiesSpecific(serverId, handleIndex, propertyTag)/result")] public static RopResult GetPropertiesSpecific(int serverId, int handleIndex, Sequence<string> propertyTag) { // The contraction conditions Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. RopResult result = RopResult.InvalidParameter; // Identify whether the Current message is existent or not. ConnectionData changeConnection = connections[serverId]; if (connections[serverId].FolderContainer.Count > 0) { result = RopResult.Success; } else if (connections[serverId].MessageContainer.Count > 0) { AbstractMessage currentMessage = new AbstractMessage(); bool ismessageExist = false; int messageIndex = 0; foreach (AbstractMessage tempMesage in changeConnection.MessageContainer) { if (tempMesage.MessageHandleIndex == handleIndex) { ismessageExist = true; currentMessage = tempMesage; messageIndex = changeConnection.MessageContainer.IndexOf(tempMesage); } } if (ismessageExist) { // Set value for MessageProperties currentMessage.MessageProperties = propertyTag; changeConnection.MessageContainer = changeConnection.MessageContainer.Update(messageIndex, currentMessage); connections[serverId] = changeConnection; result = RopResult.Success; } } return result; } /// <summary> /// Set the specific object's property value. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="handleIndex">Server object handle index.</param> /// <param name="propertyTag">The list of property values.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SetProperties(serverId, handleIndex, propertyTag)/result")] public static RopResult SetProperties(int serverId, int handleIndex, Sequence<string> propertyTag) { // The construction conditions Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].MessageContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; // Get value of current ConnectionData ConnectionData changeConnection = connections[serverId]; // Identify whether the Current message is existent or not. AbstractMessage currentMessage = new AbstractMessage(); bool ismessageExist = false; int messageIndex = 0; // Find current message. foreach (AbstractMessage tempMesage in changeConnection.MessageContainer) { if (tempMesage.MessageHandleIndex == handleIndex) { ismessageExist = true; currentMessage = tempMesage; messageIndex = changeConnection.MessageContainer.IndexOf(tempMesage); } } if (ismessageExist) { foreach (string propertyName in propertyTag) { // Identify whether the property is existent or not in MessageProperties. if (!currentMessage.MessageProperties.Contains(propertyName)) { // Add property to MessageProperties. currentMessage.MessageProperties = currentMessage.MessageProperties.Add(propertyName); } } changeConnection.MessageContainer = changeConnection.MessageContainer.Update(messageIndex, currentMessage); connections[serverId] = changeConnection; result = RopResult.Success; } return result; } /// <summary> /// Modifies the permissions associated with a folder. /// </summary> /// <param name="serverId">The server id</param> /// <param name="folderHandleIndex">index of folder handle in container</param> /// <param name="permissionLevel">The permission level</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = "ModifyPermissions(serverId, folderHandleIndex, permissionLevel)/result")] public static RopResult ModifyPermissions(int serverId, int folderHandleIndex, PermissionLevels permissionLevel) { // The contraction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; ConnectionData changeConnection = connections[serverId]; // Identify whether the Current folder is existent or not. AbstractFolder currentfolder = new AbstractFolder(); bool isCurrentFolderExist = false; int currentfolderIndex = 0; // Find current folder foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == folderHandleIndex) { isCurrentFolderExist = true; currentfolder = tempfolder; currentfolderIndex = changeConnection.FolderContainer.IndexOf(tempfolder); } } if (isCurrentFolderExist) { // Set folder Permission for CurrentFolder. currentfolder.FolderPermission = permissionLevel; changeConnection.FolderContainer = changeConnection.FolderContainer.Update(currentfolderIndex, currentfolder); connections[serverId] = changeConnection; result = RopResult.Success; } return result; } #endregion #region MS-OXCFXICS operation actions /// <summary> /// Define the scope and parameters of the synchronization download operation. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">The folder object handle.</param> /// <param name="synchronizationType">The type of synchronization requested: contents or hierarchy.</param> /// <param name="option">Defines the parameters of a download operation.</param> /// <param name="synchronizationFlag">Flag structure that defines the parameters of the synchronization operation.</param> /// <param name="synchronizationExtraFlag">Extra Flag structure that defines the parameters of the synchronization operation.</param> /// <param name="property">A list of properties and sub objects to exclude or include.</param> /// <param name="downloadcontextHandleIndex">Synchronization download context handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SynchronizationConfigure(serverId, folderHandleIndex, synchronizationType, option, synchronizationFlag, synchronizationExtraFlag,property, out downloadcontextHandleIndex)/result")] public static RopResult SynchronizationConfigure(int serverId, int folderHandleIndex, SynchronizationTypes synchronizationType, SendOptionAlls option, SynchronizationFlag synchronizationFlag, SynchronizationExtraFlag synchronizationExtraFlag, Sequence<string> property, out int downloadcontextHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); // Initialize return value. RopResult result = RopResult.Success; downloadcontextHandleIndex = -1; if ((option & SendOptionAlls.Invalid) == SendOptionAlls.Invalid && (requirementContainer.ContainsKey(3463) && requirementContainer[3463])) { result = RopResult.InvalidParameter; return result; } // SynchronizationFlag MUST match the value of the Unicode flag from SendOptions field. if ((synchronizationFlag & SynchronizationFlag.Unicode) == SynchronizationFlag.Unicode) { Condition.IsTrue((option & SendOptionAlls.Unicode) == SendOptionAlls.Unicode); } // When SynchronizationType is 0X04 then Servers return 0x80070057. if (synchronizationType == SynchronizationTypes.InvalidParameter) { if (requirementContainer.ContainsKey(2695) && requirementContainer[2695]) { result = RopResult.NotSupported; } else { result = RopResult.InvalidParameter; ModelHelper.CaptureRequirement(2695, "[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] Servers MUST return 0x80070057 if SynchronizationType is 0x04."); } } else if ((synchronizationFlag & SynchronizationFlag.Reserved) == SynchronizationFlag.Reserved) { // When SynchronizationType is Reserved then Servers MUST fail the ROP request. result = RopResult.RpcFormat; ModelHelper.CaptureRequirement(2180, "[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] The server MUST fail the ROP request if the Reserved flag of the SynchronizationFlags field is set."); } else { // Get ConnectionData value. ConnectionData changeConnection = connections[serverId]; // Identify whether the CurrentFolder is existent or not. bool isCurrentFolderExist = false; // Identify whether the Current Folder is existent or not. foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == folderHandleIndex) { // Set the value to the variable when the current folder is existent. isCurrentFolderExist = true; } } // The condition of CurrentFolder is existent. if (isCurrentFolderExist) { // Initialize the Download information. AbstractDownloadInfo abstractDownloadInfo = new AbstractDownloadInfo { UpdatedState = new AbstractUpdatedState { CnsetRead = new Set<int>(), CnsetSeen = new Set<int>(), CnsetSeenFAI = new Set<int>(), IdsetGiven = new Set<int>() }, DownloadHandleIndex = AdapterHelper.GetHandleIndex() }; // Get the download Handle for download context. downloadcontextHandleIndex = abstractDownloadInfo.DownloadHandleIndex; ModelHelper.CaptureRequirement(669, "[In RopSynchronizationConfigure ROP Response Buffer]OutputServerObject: This value MUST be the synchronization download context."); // Record the flags. abstractDownloadInfo.Sendoptions = option; abstractDownloadInfo.SynchronizationType = synchronizationType; abstractDownloadInfo.Synchronizationflag = synchronizationFlag; abstractDownloadInfo.SynchronizationExtraflag = synchronizationExtraFlag; // Record the Property. abstractDownloadInfo.Property = property; // Record folder handle of related to the download context. abstractDownloadInfo.RelatedObjectHandleIndex = folderHandleIndex; switch (synchronizationType) { // Record synchronizationType value for condition of Synchronization type is Contents. case SynchronizationTypes.Contents: abstractDownloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.contentsSync; abstractDownloadInfo.ObjectType = ObjectType.Folder; break; // Record synchronizationType value for condition of Synchronization type is Hierarchy. case SynchronizationTypes.Hierarchy: abstractDownloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.hierarchySync; abstractDownloadInfo.ObjectType = ObjectType.Folder; break; default: // Condition ofsynchronizationType is invalid parameter. result = RopResult.InvalidParameter; break; } // Condition of the operation return success. if (result == RopResult.Success) { // Add the new value to DownloadContextContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(abstractDownloadInfo); connections[serverId] = changeConnection; priorDownloadOperation = PriorDownloadOperation.RopSynchronizationConfigure; priorOperation = MS_OXCFXICS.PriorOperation.RopSynchronizationConfigure; ModelHelper.CaptureRequirement( 641, @"[In RopSynchronizationConfigure] The RopSynchronizationConfigure ROP ([MS-OXCROPS] section 2.2.13.1) is used to define the synchronization scope and parameters of the synchronization download operation."); } } } return result; } /// <summary> /// Configures the synchronization upload operation. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">The folder object handle index .</param> /// <param name="synchronizationType">The type of synchronization requested: contents or hierarchy.</param> /// <param name="uploadContextHandleIndex">Synchronization upload context handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SynchronizationOpenCollector(serverId, folderHandleIndex, synchronizationType, out uploadContextHandleIndex)/result")] public static RopResult SynchronizationOpenCollector(int serverId, int folderHandleIndex, SynchronizationTypes synchronizationType, out int uploadContextHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); // Initialize return value RopResult result = RopResult.InvalidParameter; uploadContextHandleIndex = -1; // Get ConnectionData value. ConnectionData changeConnection = connections[serverId]; AbstractFolder currentfolder = new AbstractFolder(); // Identify whether the CurrentFolder is existent or not. bool isCurrentFolderExist = false; // Identify whether the Current Folder is existent or not. foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == folderHandleIndex) { // Set the value to the variable when the current folder is existent. isCurrentFolderExist = true; currentfolder = tempfolder; } } if (isCurrentFolderExist) { // Initialize the upload information. AbstractUploadInfo abstractUploadInfo = new AbstractUploadInfo { UploadHandleIndex = AdapterHelper.GetHandleIndex() }; uploadContextHandleIndex = abstractUploadInfo.UploadHandleIndex; ModelHelper.CaptureRequirement(778, "[In RopSynchronizationOpenCollector ROP Response Buffer]OutputServerObject: The value of this field MUST be the synchronization upload context."); abstractUploadInfo.SynchronizationType = synchronizationType; abstractUploadInfo.RelatedObjectHandleIndex = folderHandleIndex; abstractUploadInfo.RelatedObjectIdIndex = currentfolder.FolderIdIndex; // Initialize the updatedState information. abstractUploadInfo.UpdatedState.IdsetGiven = new Set<int>(); abstractUploadInfo.UpdatedState.CnsetRead = new Set<int>(); abstractUploadInfo.UpdatedState.CnsetSeen = new Set<int>(); abstractUploadInfo.UpdatedState.CnsetSeenFAI = new Set<int>(); // Add the new value to UploadContextContainer. changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Add(abstractUploadInfo); connections[serverId] = changeConnection; // Record RopSynchronizationImportHierarchyChange operation. priorOperation = PriorOperation.RopSynchronizationOpenCollector; result = RopResult.Success; if (uploadContextHandleIndex != -1) { // Because if uploadContextHandleIndex doesn't equal -1 and the ROP return success, so only if this ROP success and return a valid handler this requirement will be verified. ModelHelper.CaptureRequirement( 769, @"[In RopSynchronizationOpenCollector ROP] The RopSynchronizationOpenCollector ROP ([MS-OXCROPS] section 2.2.13.7) configures the synchronization upload operation and returns a handle to a synchronization upload context."); } } return result; } /// <summary> /// Imports deletions of messages or folders into the server replica. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server</param> /// <param name="uploadContextHandleIndex">synchronization upload context handle</param> /// <param name="objIdIndexes">all object id</param> /// <param name="importDeleteFlag">Deletions type</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = "SynchronizationImportDeletes(serverId,uploadContextHandleIndex,objIdIndexes,importDeleteFlag)/result")] public static RopResult SynchronizationImportDeletes(int serverId, int uploadContextHandleIndex, Sequence<int> objIdIndexes, byte importDeleteFlag) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); if (requirementContainer.ContainsKey(90205002) && requirementContainer[90205002]) { Condition.IsTrue(((ImportDeleteFlags)importDeleteFlag & ImportDeleteFlags.delete) == ImportDeleteFlags.delete); } // Initialize return value. RopResult result = RopResult.InvalidParameter; // When the ImportDeleteFlags flag is set HardDelete by Exchange 2007 then server return 0x80070057. if (importDeleteFlag == (byte)ImportDeleteFlags.HardDelete) { if (requirementContainer.ContainsKey(2593) && requirementContainer[2593]) { result = RopResult.NotSupported; ModelHelper.CaptureRequirement(2593, "[In Appendix A: Product Behavior] <19> Section 2.2.3.2.4.5.1: The HardDelete flag is not supported by Exchange 2003 or Exchange 2007."); return result; } } // When the ImportDeleteFlags flag is an invalid value (0x10) then server returns 0x80070057. if (importDeleteFlag == 0x10) { if (requirementContainer.ContainsKey(2254001) && requirementContainer[2254001]) { result = RopResult.NotSupported; } else { result = RopResult.InvalidParameter; } return result; } // Get ConnectionData value. ConnectionData changeConnection = connections[serverId]; // Create uploadInfo variable. AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); // Identify whether the Current Upload information is existent or not. bool isCurrentUploadinfoExist = false; // Record the current uploadInfo index. int currentUploadIndex = 0; foreach (AbstractUploadInfo tempUploadInfo in changeConnection.UploadContextContainer) { if (tempUploadInfo.UploadHandleIndex == uploadContextHandleIndex) { // Set the value to the variable when the current upload context is existent. isCurrentUploadinfoExist = true; uploadInfo = tempUploadInfo; currentUploadIndex = changeConnection.UploadContextContainer.IndexOf(tempUploadInfo); } } if (isCurrentUploadinfoExist) { // Set the upload information. uploadInfo.ImportDeleteflags = importDeleteFlag; AbstractFolder currentFolder = new AbstractFolder(); // Record the current Folder Index int currentFolderIndex = 0; foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderHandleIndex == uploadInfo.RelatedObjectHandleIndex) { // Set the value to the variable when the current Folder is existent. currentFolder = tempFolder; currentFolderIndex = changeConnection.FolderContainer.IndexOf(tempFolder); } } foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if ((tempFolder.ParentFolderIdIndex == currentFolder.FolderIdIndex) && objIdIndexes.Contains(tempFolder.FolderIdIndex)) { // Remove current folder from FolderContainer and parent folder when the parent Folder is existent. changeConnection.FolderContainer = changeConnection.FolderContainer.Remove(tempFolder); currentFolder.SubFolderIds = currentFolder.SubFolderIds.Remove(tempFolder.FolderIdIndex); } if (importDeleteFlag == (byte)ImportDeleteFlags.Hierarchy) { softDeleteFolderCount += 1; } } foreach (AbstractMessage tempMessage in changeConnection.MessageContainer) { if ((tempMessage.FolderIdIndex == currentFolder.FolderIdIndex) && objIdIndexes.Contains(tempMessage.MessageIdIndex)) { // Remove current Message from MessageContainer and current folder when current Message is existent. changeConnection.MessageContainer = changeConnection.MessageContainer.Remove(tempMessage); currentFolder.MessageIds = currentFolder.MessageIds.Remove(tempMessage.MessageIdIndex); if (importDeleteFlag == (byte)ImportDeleteFlags.delete) { softDeleteMessageCount += 1; } } } // Update the FolderContainer. changeConnection.FolderContainer = changeConnection.FolderContainer.Update(currentFolderIndex, currentFolder); // Update the UploadContextContainer. changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Update(currentUploadIndex, uploadInfo); connections[serverId] = changeConnection; result = RopResult.Success; ModelHelper.CaptureRequirement( 2449, @"[In Uploading Changes Using ICS] Value is Success indicates No error occurred, or a conflict has been resolved."); // Because if the result is success means deletions of messages or folders into the server replica imported ModelHelper.CaptureRequirement( 884, @"[In RopSynchronizationImportDeletes ROP] The RopSynchronizationImportDeletes ROP ([MS-OXCROPS] section 2.2.13.5) imports deletions of messages or folders into the server replica."); return result; } return result; } /// <summary> /// Import new folders, or changes to existing folders, into the server replica. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="uploadContextHandleIndex">Upload context handle.</param> /// <param name="parentFolderHandleIndex">Parent folder handle index.</param> /// <param name="properties">Properties to be set.</param> /// <param name="localFolderIdIndex">Local folder id index</param> /// <param name="folderIdIndex">The folder object id index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SynchronizationImportHierarchyChange(serverId, uploadContextHandleIndex,parentFolderHandleIndex, properties, localFolderIdIndex, out folderIdIndex)/result")] public static RopResult SynchronizationImportHierarchyChange(int serverId, int uploadContextHandleIndex, int parentFolderHandleIndex, Set<string> properties, int localFolderIdIndex, out int folderIdIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].UploadContextContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; folderIdIndex = -1; if (parentFolderHandleIndex == -1) { result = RopResult.NoParentFolder; ModelHelper.CaptureRequirement( 2450, @"[In Uploading Changes Using ICS] Value is NoParentFolder indicates An attempt is being made to upload a hierarchy change for a folder whose parent folder does not yet exist."); } else { // Get ConnectionData value. ConnectionData changeConnection = connections[serverId]; // Record current Upload Information. AbstractUploadInfo currentUploadInfo = new AbstractUploadInfo(); // Identify current Upload handle. bool isCurrentUploadHandleExist = false; foreach (AbstractUploadInfo tempUploadInfo in changeConnection.UploadContextContainer) { if (tempUploadInfo.UploadHandleIndex == uploadContextHandleIndex) { // Set the value to the variable when the current upload context is existent. isCurrentUploadHandleExist = true; currentUploadInfo = tempUploadInfo; } } if (isCurrentUploadHandleExist) { // Initialize the variable AbstractFolder parentfolder = new AbstractFolder(); bool isParentFolderExist = false; int parentfolderIndex = 0; AbstractFolder currentFolder = new AbstractFolder(); bool isFolderExist = false; int currentFolderIndex = 0; // Research the local folder Id. foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderIdIndex == localFolderIdIndex) { // Set the value to the current Folder variable when the current folder is existent. isFolderExist = true; currentFolder = tempFolder; currentFolderIndex = changeConnection.FolderContainer.IndexOf(tempFolder); } if (tempFolder.FolderIdIndex == currentUploadInfo.RelatedObjectIdIndex) { // Set the value to the parent folder variable when the current parent folder is existent. isParentFolderExist = true; parentfolder = tempFolder; parentfolderIndex = changeConnection.FolderContainer.IndexOf(tempFolder); } } if (isFolderExist & isParentFolderExist) { foreach (string tempProperty in properties) { if (!currentFolder.FolderProperties.Contains(tempProperty)) { // Add Property for folder currentFolder.FolderProperties = currentFolder.FolderProperties.Add(tempProperty); } } // Get the new change Number currentFolder.ChangeNumberIndex = ModelHelper.GetChangeNumberIndex(); // Update the folder Container changeConnection.FolderContainer = changeConnection.FolderContainer.Update(currentFolderIndex, currentFolder); } else { // Create a new folder AbstractFolder newFolder = new AbstractFolder { FolderIdIndex = AdapterHelper.GetObjectIdIndex() }; // Set new folder Id folderIdIndex = newFolder.FolderIdIndex; // Set value for new folder newFolder.FolderProperties = properties; newFolder.ParentFolderHandleIndex = parentfolder.FolderHandleIndex; newFolder.ParentFolderIdIndex = parentfolder.FolderIdIndex; newFolder.SubFolderIds = new Set<int>(); newFolder.MessageIds = new Set<int>(); // Add the new folder to parent folder parentfolder.SubFolderIds = parentfolder.SubFolderIds.Add(newFolder.FolderIdIndex); newFolder.FolderPermission = PermissionLevels.FolderOwner; newFolder.ChangeNumberIndex = ModelHelper.GetChangeNumberIndex(); ModelHelper.CaptureRequirement(1897, "[In Identifying Objects and Maintaining Change Numbers]When a new object is created, it is assigned a change number."); // Update FolderContainer information changeConnection.FolderContainer = changeConnection.FolderContainer.Add(newFolder); changeConnection.FolderContainer = changeConnection.FolderContainer.Update(parentfolderIndex, parentfolder); } // Return Success connections[serverId] = changeConnection; // Record RopSynchronizationImportHierarchyChange operation. priorUploadOperation = PriorOperation.RopSynchronizationImportHierarchyChange; result = RopResult.Success; ModelHelper.CaptureRequirement( 2449, @"[In Uploading Changes Using ICS] Value is Success indicates No error occurred, or a conflict has been resolved."); // Because if the result is success means the folders or changes are imported. ModelHelper.CaptureRequirement( 816, @"[In RopSynchronizationImportHierarchyChange ROP] The RopSynchronizationImportHierarchyChange ROP ([MS-OXCROPS] section 2.2.13.4) is used to import new folders, or changes to existing folders, into the server replica."); } } return result; } /// <summary> /// Import new folders, or changes with conflict PCL to existing folders, into the server replica. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="uploadContextHandleIndex">Upload context handle.</param> /// <param name="parentFolderHandleIndex">Parent folder handle index.</param> /// <param name="properties">Properties to be set.</param> /// <param name="localFolderIdIndex">Local folder id index</param> /// <param name="folderIdIndex">The folder object id index.</param> /// <param name="conflictType">The conflict type to generate.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SynchronizationImportHierarchyChangeWithConflict(serverId, uploadContextHandleIndex,parentFolderHandleIndex, properties, localFolderIdIndex, out folderIdIndex, conflictType)/result")] public static RopResult SynchronizationImportHierarchyChangeWithConflict(int serverId, int uploadContextHandleIndex, int parentFolderHandleIndex, Set<string> properties, int localFolderIdIndex, out int folderIdIndex, ConflictTypes conflictType) { return SynchronizationImportHierarchyChange(serverId, uploadContextHandleIndex, parentFolderHandleIndex, properties, localFolderIdIndex, out folderIdIndex); } /// <summary> /// Import new messages or changes to existing messages into the server replica. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="uploadContextHandleIndex">A synchronization upload context handle index.</param> /// <param name="messageIdindex">new client message id</param> /// <param name="importFlag">An 8-bit flag .</param> /// <param name="importMessageHandleIndex">The index of handle that indicate the Message object into which the client will upload the rest of the message changes.</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = "SynchronizationImportMessageChange(serverId, uploadContextHandleIndex,messageIdindex,importFlag, out importMessageHandleIndex)/result")] public static RopResult SynchronizationImportMessageChange(int serverId, int uploadContextHandleIndex, int messageIdindex, ImportFlag importFlag, out int importMessageHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].UploadContextContainer.Count > 0 && connections[serverId].LogonHandleIndex > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; importMessageHandleIndex = -1; if ((importFlag & ImportFlag.InvalidParameter) == ImportFlag.InvalidParameter && requirementContainer.ContainsKey(3509001) && requirementContainer[3509001]) { result = RopResult.InvalidParameter; ModelHelper.CaptureRequirement( 3509001, @"[In Appendix A: Product Behavior] If unknown flags are set, implementation does fail the operation. &lt;44&gt; Section 3.2.5.9.4.2: Exchange 2010, Exchange 2013, Exchange 2016 and Exchange 2019 fail the ROP [RopSynchronizationImportMessageChange] if unknown bit flags are set."); return result; } else if ((importFlag & ImportFlag.InvalidParameter) == ImportFlag.InvalidParameter && requirementContainer.ContainsKey(350900201) && requirementContainer[350900201]) { result = RopResult.Success; ModelHelper.CaptureRequirement( 350900201, @"[In Appendix A: Product Behavior] If unknown flags are set, implementation does not fail the operation. <44> Section 3.2.5.9.4.2: Exchange 2007 do not fail the ROP [RopSynchronizationImportMessageChange] if unknown bit flags are set."); } // Get ConnectionData value. ConnectionData changeConnection = connections[serverId]; AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); // Identify whether the current Upload information is existent or not. bool isCurrentUploadinfoExist = false; // Record current Upload information. int currentUploadIndex = 0; foreach (AbstractUploadInfo tempUploadInfo in changeConnection.UploadContextContainer) { if (tempUploadInfo.UploadHandleIndex == uploadContextHandleIndex) { // Set the value to the current upload context variable when the current upload context is existent. isCurrentUploadinfoExist = true; uploadInfo = tempUploadInfo; currentUploadIndex = changeConnection.UploadContextContainer.IndexOf(tempUploadInfo); } } if (isCurrentUploadinfoExist) { // Create a new Message AbstractMessage currentMessage = new AbstractMessage(); // Identify whether the current message is existent or not. bool isMessageExist = false; // Record the current Message. int currentMessageIndex = 0; foreach (AbstractMessage tempMessage in changeConnection.MessageContainer) { if (tempMessage.MessageIdIndex == messageIdindex) { // Set the value to the variable when the message is existent. isMessageExist = true; currentMessage = tempMessage; currentMessageIndex = changeConnection.MessageContainer.IndexOf(tempMessage); } } if (isMessageExist) { // Set new change number currentMessage.ChangeNumberIndex = ModelHelper.GetChangeNumberIndex(); ModelHelper.CaptureRequirement(1898, "[In Identifying Objects and Maintaining Change Numbers]A new change number is assigned to a messaging object each time it is modified."); // Update the MessageContainer changeConnection.MessageContainer = changeConnection.MessageContainer.Update(currentMessageIndex, currentMessage); } else { // Set the new message handle currentMessage.MessageHandleIndex = AdapterHelper.GetHandleIndex(); // Set property value of abstract message object currentMessage.FolderHandleIndex = uploadInfo.RelatedObjectHandleIndex; currentMessage.FolderIdIndex = uploadInfo.RelatedObjectIdIndex; currentMessage.MessageProperties = new Sequence<string>(); currentMessage.IsRead = true; if ((importFlag & ImportFlag.Normal) == ImportFlag.Normal) { currentMessage.IsFAImessage = false; } if ((importFlag & ImportFlag.Associated) == ImportFlag.Associated) { currentMessage.IsFAImessage = true; // When the Associated is set and the message being imported is an FAI message this requirement is captured. ModelHelper.CaptureRequirement( 813, @"[In RopSynchronizationImportMessageChange ROP Request Buffer] [ImportFlag,when the name is Associated, the value is 0x10] If this flag is set, the message being imported is an FAI message."); } else { currentMessage.IsFAImessage = false; // When the Associated is not set and the message being imported is a normal message this requirement is captured. ModelHelper.CaptureRequirement( 814, @"[In RopSynchronizationImportMessageChange ROP Request Buffer] [ImportFlag,when the name is Associated, the value is 0x10] If this flag is not set, the message being imported is a normal message."); } // Out the new message handle importMessageHandleIndex = currentMessage.MessageHandleIndex; // Because this is out messageHandle so the OutputServerObject is a Message object. ModelHelper.CaptureRequirement(805, "[In RopSynchronizationImportMessageChange ROP Response Buffer]OutputServerObject: The value of this field MUST be the Message object into which the client will upload the rest of the message changes."); currentMessage.ChangeNumberIndex = ModelHelper.GetChangeNumberIndex(); ModelHelper.CaptureRequirement(1897, "[In Identifying Objects and Maintaining Change Numbers]When a new object is created, it is assigned a change number."); // Add new Message to MessageContainer changeConnection.MessageContainer = changeConnection.MessageContainer.Add(currentMessage); // Record the related FastTransferOperation for Upload Information. uploadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.SynchronizationImportMessageChange; // Update the UploadContextContainer. changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Update(currentUploadIndex, uploadInfo); connections[serverId] = changeConnection; // Record RopSynchronizationImportMessageChange operation. priorOperation = PriorOperation.RopSynchronizationImportMessageChange; result = RopResult.Success; ModelHelper.CaptureRequirement( 2449, @"[In Uploading Changes Using ICS] Value is Success indicates No error occurred, or a conflict has been resolved."); // Because if the result is success means the messages or changes are imported. ModelHelper.CaptureRequirement( 782, @"[In RopSynchronizationImportMessageChange ROP] The RopSynchronizationImportMessageChange ROP ([MS-OXCROPS] section 2.2.13.2) is used to import new messages or changes to existing messages into the server replica."); } } return result; } /// <summary> /// Imports message read state changes into the server replica. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="uploadContextHandleIndex">Sync handle.</param> /// <param name="messageHandleIndex">Message handle</param> /// <param name="ireadstatus">An array of MessageReadState structures one per each message that's changing its read state.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SynchronizationImportReadStateChanges(serverId, uploadContextHandleIndex,messageHandleIndex,ireadstatus)/result")] public static RopResult SynchronizationImportReadStateChanges(int serverId, int uploadContextHandleIndex, int messageHandleIndex, bool ireadstatus) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].MessageContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; ConnectionData changeConnection = connections[serverId]; AbstractMessage currentMessage = new AbstractMessage(); AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); // Identify whether the Message is existent or not and record the index. bool isCurrentMessageExist = false; int currentMessageindex = 0; // Identify whether the Upload information is existent or not and record the index. bool isCurrentUploadinfoExist = false; int currentUploadIndex = 0; foreach (AbstractUploadInfo tempUploadInfo in changeConnection.UploadContextContainer) { if (tempUploadInfo.UploadHandleIndex == uploadContextHandleIndex) { // Set the value to the variable when the upload context is existent. isCurrentUploadinfoExist = true; uploadInfo = tempUploadInfo; currentUploadIndex = changeConnection.UploadContextContainer.IndexOf(tempUploadInfo); } } foreach (AbstractMessage tempMessage in changeConnection.MessageContainer) { if (tempMessage.MessageHandleIndex == messageHandleIndex) { // Set the value to the variable when the Message is existent. isCurrentMessageExist = true; currentMessage = tempMessage; currentMessageindex = changeConnection.MessageContainer.IndexOf(tempMessage); } } if (isCurrentMessageExist) { // Find the parent folder of current message AbstractFolder parentfolder = new AbstractFolder(); int parentfolderIndex = 0; foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderHandleIndex == currentMessage.FolderHandleIndex) { parentfolder = tempFolder; parentfolderIndex = changeConnection.FolderContainer.IndexOf(tempFolder); if (parentfolder.FolderPermission == PermissionLevels.None) { return result = RopResult.AccessDenied; } } } } if (isCurrentUploadinfoExist && isCurrentMessageExist) { // Set the message read status value. if (currentMessage.IsRead != ireadstatus) { currentMessage.IsRead = ireadstatus; // Get read State changeNumber. currentMessage.ReadStateChangeNumberIndex = ModelHelper.GetChangeNumberIndex(); ModelHelper.CaptureRequirement( 2260, @"[In Receiving a RopSynchronizationImportReadStateChanges Request]Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated by adding the new change number to the MetaTagCnsetRead property (section 2.2.1.1.4)."); } // Record the related Synchronization Operation. uploadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.SynchronizationReadStateChanges; // Update the upload context container and message container. changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Update(currentUploadIndex, uploadInfo); changeConnection.MessageContainer = changeConnection.MessageContainer.Update(currentMessageindex, currentMessage); connections[serverId] = changeConnection; result = RopResult.Success; ModelHelper.CaptureRequirement( 2449, @"[In Uploading Changes Using ICS] Value is Success indicates No error occurred, or a conflict has been resolved."); // Because if the result is success means message read state changes is imported into the server replica. ModelHelper.CaptureRequirement( 905, @"[In RopSynchronizationImportReadStateChanges ROP] The RopSynchronizationImportReadStateChanges ROP ([MS-OXCROPS] section 2.2.13.3) imports message read state changes into the server replica."); } return result; } /// <summary> /// Imports information about moving a message between two existing folders within the same mailbox. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="synchronizationUploadContextHandleIndex">The index of the synchronization upload context configured for collecting changes to the contents of the message move destination folder.</param> /// <param name="sourceFolderIdIndex">The index of the source folder id in object id container.</param> /// <param name="destinationFolderIdIndex">The index of the destination folder id in object id container.</param> /// <param name="sourceMessageIdIndex">The index of source message id in object id container.</param> /// <param name="sourceFolderHandleIndex">The index of source folder handle in handleContainer.</param> /// <param name="destinationFolderHandleIndex">The index of destination folder handle in handle container.</param> /// <param name="inewerClientChange">If the client has a newer message.</param> /// <param name="iolderversion">If the server have an older version of a message .</param> /// <param name="icnpc">Verify if the change number has been used.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SynchronizationImportMessageMove(serverId, synchronizationUploadContextHandleIndex,sourceFolderIdIndex,destinationFolderIdIndex,sourceMessageIdIndex,sourceFolderHandleIndex,destinationFolderHandleIndex,inewerClientChange,out iolderversion,out icnpc)/result")] public static RopResult SynchronizationImportMessageMove(int serverId, int synchronizationUploadContextHandleIndex, int sourceFolderIdIndex, int destinationFolderIdIndex, int sourceMessageIdIndex, int sourceFolderHandleIndex, int destinationFolderHandleIndex, bool inewerClientChange, out bool iolderversion, out bool icnpc) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].FolderContainer.Count > 1); // Initialize the return value. RopResult result = RopResult.InvalidParameter; iolderversion = false; icnpc = false; // Get the current ConnectionData value. ConnectionData changeConnection = connections[serverId]; // Identify whether Current Upload information is existent or not. bool isCurrentUploadinfoExist = false; // Record the current Upload information. int currentUploadIndex = 0; AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); foreach (AbstractUploadInfo tempUploadInfo in changeConnection.UploadContextContainer) { if (tempUploadInfo.UploadHandleIndex == synchronizationUploadContextHandleIndex) { // Set the value for current upload information when current upload Information is existent. isCurrentUploadinfoExist = true; uploadInfo = tempUploadInfo; currentUploadIndex = changeConnection.UploadContextContainer.IndexOf(tempUploadInfo); } } // Create variable of relate to source Folder. AbstractFolder sourceFolder = new AbstractFolder(); bool isSourceFolderExist = false; int sourceFolderIndex = 0; // Create variable of relate to destination Folder. AbstractFolder destinationFolder = new AbstractFolder(); bool isdestinationFolderExist = false; int destinationFolderIndex = 0; // Create a new message. AbstractMessage movedMessage = new AbstractMessage(); // Identify whether the Moved Message is existent or not. bool isMovedMessageExist = false; int movedMessageIndex = 0; foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderIdIndex == sourceFolderIdIndex && tempFolder.FolderHandleIndex == sourceFolderHandleIndex) { // Set the value to the variable when the source folder is existent. isSourceFolderExist = true; sourceFolder = tempFolder; sourceFolderIndex = changeConnection.FolderContainer.IndexOf(tempFolder); } } foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderIdIndex == destinationFolderIdIndex && tempFolder.FolderHandleIndex == destinationFolderHandleIndex) { // Set the value to the related variable when the destination folder is existent. isdestinationFolderExist = true; destinationFolder = tempFolder; destinationFolderIndex = changeConnection.FolderContainer.IndexOf(tempFolder); } } foreach (AbstractMessage tempMessage in changeConnection.MessageContainer) { if (tempMessage.MessageIdIndex == sourceMessageIdIndex) { // Set the value to the related variable when the source Message is existent. isMovedMessageExist = true; movedMessage = tempMessage; movedMessageIndex = changeConnection.MessageContainer.IndexOf(tempMessage); } } if (isSourceFolderExist && isdestinationFolderExist && isMovedMessageExist && isCurrentUploadinfoExist) { // Set value for the new abstract message property. movedMessage.FolderIdIndex = destinationFolder.FolderIdIndex; movedMessage.FolderHandleIndex = destinationFolder.FolderHandleIndex; // Assigned a new change. movedMessage.ChangeNumberIndex = ModelHelper.GetChangeNumberIndex(); // Assigned a new message id. movedMessage.MessageIdIndex = AdapterHelper.GetObjectIdIndex(); // Update message Container. changeConnection.MessageContainer = changeConnection.MessageContainer.Update(movedMessageIndex, movedMessage); // Remove the current message id from MessageIds of source folder. sourceFolder.MessageIds = sourceFolder.MessageIds.Remove(movedMessage.MessageIdIndex); changeConnection.FolderContainer = changeConnection.FolderContainer.Update(sourceFolderIndex, sourceFolder); // Remove the current message id from MessageIds of destination Folder. destinationFolder.MessageIds = destinationFolder.MessageIds.Add(movedMessage.MessageIdIndex); changeConnection.FolderContainer = changeConnection.FolderContainer.Update(destinationFolderIndex, destinationFolder); // Add information of Upload context uploadInfo.IsnewerClientChange = inewerClientChange; uploadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.SynchronizationImportMessageMove; // Update the upload context container changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Update(currentUploadIndex, uploadInfo); connections[serverId] = changeConnection; // Identify whether the IsnewerClientChange is true or false. if (uploadInfo.IsnewerClientChange == false) { result = RopResult.Success; ModelHelper.CaptureRequirement( 2449, @"[In Uploading Changes Using ICS] Value is Success indicates No error occurred, or a conflict has been resolved."); // Because if the result is success means the information about moving a message between two existing folders within the same mailbox imported ModelHelper.CaptureRequirement( 839, @"[In RopSynchronizationImportMessageMove ROP] The RopSynchronizationImportMessageMove ROP ([MS-OXCROPS] section 2.2.13.6) imports information about moving a message between two existing folders within the same mailbox."); } else { // Set out put parameter value iolderversion = true; ModelHelper.CaptureRequirement( 875, @"[In RopSynchronizationImportMessageMove ROP Response Buffer] [ Return value (4 bytes):] The following table[In section 2.2.3.2.4.4] contains additional return values[NewerClientChange] , if the ROP succeeded, but the server replica had an older version of a message than the local replica, the return value is 0x00040821."); icnpc = true; ModelHelper.CaptureRequirement( 876, @"[In RopSynchronizationImportMessageMove ROP Response Buffer] [ Return value (4 bytes):] The following table[In section 2.2.3.2.4.4] contains additional return values[NewerClientChange] , if the values of the ChangeNumber and PredecessorChangeList fields, specified in section 2.2.3.2.4.4.1, were not applied to the destination message, the return value is 0x00040821."); ModelHelper.CaptureRequirement( 1892, "[In Identifying Objects and Maintaining Change Numbers]Copying of messaging objects within a mailbox or moving messages between folders of the same mailbox translates into creation of new messaging objects and therefore, new internal identifiers MUST be assigned to new copies."); result = RopResult.NewerClientChange; } // Record RopSynchronizationImportMessageMove operation. priorUploadOperation = PriorOperation.RopSynchronizationImportMessageMove; } return result; } /// <summary> /// Creates a FastTransfer download context for a snapshot of the checkpoint ICS state of the operation identified by the given synchronization download context, or synchronization upload context. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="syncHandleIndex">Synchronization context index.</param> /// <param name="downloadcontextHandleIndex">The index of FastTransfer download context for the ICS state.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SynchronizationGetTransferState(serverId, syncHandleIndex,out downloadcontextHandleIndex)/result")] public static RopResult SynchronizationGetTransferState(int serverId, int syncHandleIndex, out int downloadcontextHandleIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].UploadContextContainer.Count > 0 || connections[serverId].DownloadContextContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; downloadcontextHandleIndex = -1; // Get the current ConnectionData value. ConnectionData changeConnection = connections[serverId]; AbstractDownloadInfo downloadInfo = new AbstractDownloadInfo(); AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); // Identify whether the Download context or Upload context is existent or not and record the index. bool isCurrentDownloadInfoExist = false; bool isCurrentUploadInfoExist = false; foreach (AbstractDownloadInfo temp in changeConnection.DownloadContextContainer) { if (temp.DownloadHandleIndex == syncHandleIndex) { // Set the value to the related variable when the current Download context is existent. isCurrentDownloadInfoExist = true; downloadInfo = temp; } } if (!isCurrentDownloadInfoExist) { foreach (AbstractUploadInfo tempInfo in changeConnection.UploadContextContainer) { if (tempInfo.UploadHandleIndex == syncHandleIndex) { // Set the value to the related variable when the current upload context is existent. isCurrentUploadInfoExist = true; uploadInfo = tempInfo; } } } if (isCurrentDownloadInfoExist || isCurrentUploadInfoExist) { // Create a new download context. AbstractDownloadInfo newDownloadInfo = new AbstractDownloadInfo { DownloadHandleIndex = AdapterHelper.GetHandleIndex() }; // Out the new downloadHandle. downloadcontextHandleIndex = newDownloadInfo.DownloadHandleIndex; ModelHelper.CaptureRequirement(765, "[In RopSynchronizationGetTransferState ROP Response Buffer]OutputServerObject: The value of this field MUST be the FastTransfer download context for the ICS state."); if (isCurrentDownloadInfoExist) { // Set the new Download context value newDownloadInfo.RelatedObjectHandleIndex = downloadInfo.RelatedObjectHandleIndex; newDownloadInfo.SynchronizationType = downloadInfo.SynchronizationType; newDownloadInfo.UpdatedState = downloadInfo.UpdatedState; priorDownloadOperation = PriorDownloadOperation.RopSynchronizationGetTransferState; } else { // Set the new Upload context value newDownloadInfo.RelatedObjectHandleIndex = uploadInfo.RelatedObjectHandleIndex; newDownloadInfo.SynchronizationType = uploadInfo.SynchronizationType; newDownloadInfo.UpdatedState = uploadInfo.UpdatedState; } // Set the abstractFastTransferStreamType for new Down loadContext value newDownloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.state; newDownloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.SynchronizationGetTransferState; // Add new download context to DownloadContextContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(newDownloadInfo); connections[serverId] = changeConnection; result = RopResult.Success; // Because context created if the RopSynchronizationGetTransferState execute successful. ModelHelper.CaptureRequirement( 758, @"[In RopSynchronizationGetTransferState ROP] The RopSynchronizationGetTransferState ROP ([MS-OXCROPS] section 2.2.13.8) creates a FastTransfer download context for the checkpoint ICS state of the operation identified by the given synchronization download context or synchronization upload context at the current moment in time."); } return result; } /// <summary> /// Upload of an ICS state property into the synchronization context. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="uploadContextHandleIndex">The synchronization context handle</param> /// <param name="icsPropertyType">Property tags of the ICS state property.</param> /// <param name="isPidTagIdsetGivenInputAsInter32"> identifies Property tags as PtypInteger32.</param> /// <param name="icsStateIndex">The index of the ICS State.</param> /// <returns>The ICS state property is upload to the server successfully or not.</returns> [Rule(Action = "SynchronizationUploadState(serverId, uploadContextHandleIndex, icsPropertyType, isPidTagIdsetGivenInputAsInter32, icsStateIndex)/result")] public static RopResult SynchronizationUploadState(int serverId, int uploadContextHandleIndex, ICSStateProperties icsPropertyType, bool isPidTagIdsetGivenInputAsInter32, int icsStateIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].DownloadContextContainer.Count > 0 || connections[serverId].UploadContextContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); AbstractDownloadInfo downLoadInfo = new AbstractDownloadInfo(); // Get the current ConnectionData value. ConnectionData changeConnection = connections[serverId]; // Identify whether the DownloadContext or UploadContext is existent or not and record the index. bool isCurrentUploadinfoExist = false; int currentUploadIndex = 0; bool isCurrentDownLoadinfoExist = false; int currentDownLoadIndex = 0; foreach (AbstractUploadInfo tempUploadInfo in changeConnection.UploadContextContainer) { if (tempUploadInfo.UploadHandleIndex == uploadContextHandleIndex) { // Set the value to the related variable when the current upload context is existent. isCurrentUploadinfoExist = true; uploadInfo = tempUploadInfo; currentUploadIndex = changeConnection.UploadContextContainer.IndexOf(tempUploadInfo); break; } } if (!isCurrentUploadinfoExist) { foreach (AbstractDownloadInfo tempDownLoadInfo in changeConnection.DownloadContextContainer) { if (tempDownLoadInfo.DownloadHandleIndex == uploadContextHandleIndex) { // Set the value to the related variable when the current Download context is existent. isCurrentDownLoadinfoExist = true; downLoadInfo = tempDownLoadInfo; currentDownLoadIndex = changeConnection.DownloadContextContainer.IndexOf(tempDownLoadInfo); break; } } } if (isCurrentDownLoadinfoExist || isCurrentUploadinfoExist) { if (isCurrentUploadinfoExist) { if (icsStateIndex != 0) { AbstractFolder currentFolder = new AbstractFolder(); foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderHandleIndex == uploadInfo.RelatedObjectHandleIndex) { // Set the value to the related variable when the current Folder is existent. currentFolder = tempFolder; Condition.IsTrue(currentFolder.ICSStateContainer.ContainsKey(icsStateIndex)); } } // Add ICS State to ICSStateContainer of current folder. AbstractUpdatedState updatedState = currentFolder.ICSStateContainer[icsStateIndex]; switch (icsPropertyType) { case ICSStateProperties.PidTagIdsetGiven: // Set IdsetGiven value uploadInfo.UpdatedState.IdsetGiven = updatedState.IdsetGiven; break; case ICSStateProperties.PidTagCnsetRead: // Set CnsetRead value uploadInfo.UpdatedState.CnsetRead = updatedState.CnsetRead; break; case ICSStateProperties.PidTagCnsetSeen: // Set CnsetSeen value uploadInfo.UpdatedState.CnsetSeen = updatedState.CnsetSeen; break; case ICSStateProperties.PidTagCnsetSeenFAI: // Set CnsetSeenFAI value uploadInfo.UpdatedState.CnsetSeenFAI = updatedState.CnsetSeenFAI; break; default: break; } // Update the UploadContextContainer context. changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Update(currentUploadIndex, uploadInfo); } } else { if (icsStateIndex != 0) { AbstractFolder currentFolder = new AbstractFolder(); foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderHandleIndex == downLoadInfo.RelatedObjectHandleIndex) { // Set the value to the related variable when the current Folder is existent. currentFolder = tempFolder; // Identify ICS State whether exist index or not in ICSStateContainer Condition.IsTrue(currentFolder.ICSStateContainer.ContainsKey(icsStateIndex)); } } // Add update state to ICSStateContainer of current folder. AbstractUpdatedState updatedState = currentFolder.ICSStateContainer[icsStateIndex]; switch (icsPropertyType) { case ICSStateProperties.PidTagIdsetGiven: // Set IdsetGiven value. downLoadInfo.UpdatedState.IdsetGiven = updatedState.IdsetGiven; break; case ICSStateProperties.PidTagCnsetRead: // Set CnsetRead value. downLoadInfo.UpdatedState.CnsetRead = updatedState.CnsetRead; break; case ICSStateProperties.PidTagCnsetSeen: // Set CnsetSeen value. downLoadInfo.UpdatedState.CnsetSeen = updatedState.CnsetSeen; break; case ICSStateProperties.PidTagCnsetSeenFAI: // Set CnsetSeenFAI value. downLoadInfo.UpdatedState.CnsetSeenFAI = updatedState.CnsetSeenFAI; break; default: break; } // Update the DownloadContextContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Update(currentDownLoadIndex, downLoadInfo); } } connections[serverId] = changeConnection; if (isPidTagIdsetGivenInputAsInter32) { // Identify the property tag whether PtypInteger32 is or not. if (requirementContainer.Keys.Contains(2657) && requirementContainer[2657]) { result = RopResult.Success; ModelHelper.CaptureRequirement(2657, "[In Receiving the MetaTagIdsetGiven ICS State Property] Implementation does accept this MetaTagIdsetGiven property when the property tag identifies it as PtypInteger32. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } else { return result; } } result = RopResult.Success; } return result; } /// <summary> /// Allocates a range of internal identifiers for the purpose of assigning them to client-originated objects in a local replica. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="logonHandleIndex">The server object handle index.</param> /// <param name="idcount">An unsigned 32-bit integer specifies the number of IDs to allocate.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "GetLocalReplicaIds(serverId, logonHandleIndex,idcount)/result")] public static RopResult GetLocalReplicaIds(int serverId, int logonHandleIndex, uint idcount) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].LogonHandleIndex > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; // Get the current ConnectionData value. ConnectionData changeConnection = connections[serverId]; if (logonHandleIndex == changeConnection.LogonHandleIndex) { // Set localId Count value. changeConnection.LocalIdCount = idcount; result = RopResult.Success; connections[serverId] = changeConnection; if (idcount > 0) { // Because only if result is success and the idcount larger than 0 indicate a range of internal identifiers (2) for the purpose of assigning them to client-originated objects in a local replica are allocated. ModelHelper.CaptureRequirement( 925, @"[In RopGetLocalReplicaIds ROP] The RopGetLocalReplicaIds ROP ([MS-OXCROPS] section 2.2.13.13) allocates a range of internal identifiers for the purpose of assigning them to client-originated objects in a local replica."); } } return result; } /// <summary> /// Identifies that a set of IDs either belongs to deleted messages in the specified folder or will never be used for any messages in the specified folder. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">A Folder object handle</param> /// <param name="longTermIdRangeIndex">The range of LongTermId.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = "SetLocalReplicaMidsetDeleted(serverId, folderHandleIndex, longTermIdRangeIndex)/result")] public static RopResult SetLocalReplicaMidsetDeleted(int serverId, int folderHandleIndex, Sequence<int> longTermIdRangeIndex) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); Condition.IsTrue(connections[serverId].FolderContainer.Count > 0); // Initialize the return value. RopResult result = RopResult.InvalidParameter; // Get the current ConnectionData value ConnectionData changeConnection = connections[serverId]; // Identify whether the current folder is existent or not and record the index. bool isCurrentFolderExist = false; foreach (AbstractFolder tempfolder in changeConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == folderHandleIndex) { // Set the value to the related variable when the current Folder is existent. isCurrentFolderExist = true; } } if (isCurrentFolderExist == false) { // The server return invalid parameter when current folder is not exist. result = RopResult.InvalidParameter; } else { // The server return Success. result = RopResult.Success; // When the ROP success means server add ranges of IDs supplied through this ROP to the deleted item list. ModelHelper.CaptureRequirement( 2269, @"[In Receiving a RopSetLocalReplicaMidsetDeleted Request] A server MUST add ranges of IDs supplied through this ROP to the deleted item list."); ModelHelper.CaptureRequirement( 940, @"[In RopSetLocalReplicaMidsetDeleted ROP] The RopSetLocalReplicaMidsetDeleted ROP ([MS-OXCROPS] section 2.2.13.12) identifies that a set of IDs either belongs to deleted messages in the specified folder or will never be used for any messages in the specified folder."); } return result; } #endregion #region FastTransfer related actions /// <summary> /// Initializes a FastTransfer operation to download content from a given messaging object and its descendant subObjects. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">Folder or message object handle index. </param> /// <param name="handleType">The input handle type</param> /// <param name="level">Variable indicate whether copy the descendant subObjects.</param> /// <param name="copyFlag">Defines parameters of the FastTransfer download operation.</param> /// <param name="option">Defines the parameters of a download operation .</param> /// <param name="propertyTags">Array of properties and subObjects to exclude.</param> /// <param name="downloadContextHandleIndex">The properties handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = ("FastTransferSourceCopyTo(serverId,objHandleIndex,handleType,level,copyFlag,option,propertyTags,out downloadContextHandleIndex)/result"))] public static RopResult FastTransferSourceCopyTo(int serverId, int objHandleIndex, InputHandleType handleType, bool level, CopyToCopyFlags copyFlag, SendOptionAlls option, Sequence<string> propertyTags, out int downloadContextHandleIndex) { // The contraction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. RopResult result = RopResult.InvalidParameter; // The copyFlag conditions. if (((copyFlag == CopyToCopyFlags.Invalid && (requirementContainer.ContainsKey(3445) && requirementContainer[3445])) || (option == SendOptionAlls.Invalid && (requirementContainer.ContainsKey(3463) && requirementContainer[3463]))) || ((copyFlag & CopyToCopyFlags.Move) == CopyToCopyFlags.Move && (requirementContainer.ContainsKey(3442001) && requirementContainer[3442001])) || ((copyFlag & CopyToCopyFlags.Move) == CopyToCopyFlags.Move && (requirementContainer.ContainsKey(3442003) && requirementContainer[3442003]))) { downloadContextHandleIndex = -1; if ((copyFlag & CopyToCopyFlags.Move) == CopyToCopyFlags.Move) { // CopyToCopyFlags value is Move. if (requirementContainer.ContainsKey(3442001) && requirementContainer[3442001]) { // When the ROP return invalid parameter this requirement verified. ModelHelper.CaptureRequirement( 3442001, @"[In Appendix A: Product Behavior] Implementation does not support. &lt;34&gt; Section 3.2.5.8.1.1: Exchange 2010, Exchange 2013, Exchange 2016 and Exchange 2019 do not support the Move flag for the RopFastTransferSourceCopyTo ROP (section 2.2.3.1.1.1)."); } if (requirementContainer.ContainsKey(3442003) && requirementContainer[3442003]) { result = RopResult.InvalidParameter; // When the ROP return invalid parameter this requirement verified. ModelHelper.CaptureRequirement( 3442003, @"[In Appendix A: Product Behavior] If the server receives the Move flag, implementation does fail the operation with an error code InvalidParameter (0x80070057). &lt;34&gt; Section 3.2.5.8.1.1: The server sets the value of the ReturnValue field to InvalidParameter (0x80070057) if it receives this flag [Move flag].(Microsoft Exchange 2010, Exchange 2013, Exchange 2016 and Exchange 2019 follow this behavior.)"); } } return result; } else { // Create a new download context AbstractDownloadInfo downloadInfo = new AbstractDownloadInfo(); bool isObjExist = false; // Get value of ConnectionData ConnectionData changeConnection = connections[serverId]; connections.Remove(serverId); // Find current message if (handleType == InputHandleType.MessageHandle) { foreach (AbstractMessage temp in changeConnection.MessageContainer) { if (temp.MessageHandleIndex == objHandleIndex) { isObjExist = true; } } Condition.IsTrue(isObjExist); // Set value for new download context. downloadInfo.DownloadHandleIndex = AdapterHelper.GetHandleIndex(); downloadContextHandleIndex = downloadInfo.DownloadHandleIndex; downloadInfo.Sendoptions = option; downloadInfo.Property = propertyTags; downloadInfo.CopyToCopyFlag = copyFlag; downloadInfo.IsLevelTrue = level; // Record FastTransfer Operation. downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyTo; downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.MessageContent; downloadInfo.ObjectType = ObjectType.Message; downloadInfo.RelatedObjectHandleIndex = objHandleIndex; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyTo; // Add new download context to downloadContext Container. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); } else if (handleType == InputHandleType.FolderHandle) { // Find current folder. foreach (AbstractFolder temp in changeConnection.FolderContainer) { if (temp.FolderHandleIndex == objHandleIndex) { isObjExist = true; } } Condition.IsTrue(isObjExist); // Set value for new download context. downloadInfo.DownloadHandleIndex = AdapterHelper.GetHandleIndex(); downloadContextHandleIndex = downloadInfo.DownloadHandleIndex; downloadInfo.Sendoptions = option; downloadInfo.Property = propertyTags; downloadInfo.CopyToCopyFlag = copyFlag; // Record FastTransfer Operation downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyTo; downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.folderContent; downloadInfo.ObjectType = ObjectType.Folder; downloadInfo.RelatedObjectHandleIndex = objHandleIndex; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyTo; // Add new download context to DownloadContextContainer changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); } else { // Find current attachment foreach (AbstractAttachment temp in changeConnection.AttachmentContainer) { if (temp.AttachmentHandleIndex == objHandleIndex) { isObjExist = true; } } Condition.IsTrue(isObjExist); // Set value for new download context. downloadInfo.DownloadHandleIndex = AdapterHelper.GetHandleIndex(); downloadContextHandleIndex = downloadInfo.DownloadHandleIndex; downloadInfo.Sendoptions = option; downloadInfo.Property = propertyTags; downloadInfo.CopyToCopyFlag = copyFlag; // Record FastTransfer Operation downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyTo; downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.attachmentContent; downloadInfo.ObjectType = ObjectType.Attachment; downloadInfo.RelatedObjectHandleIndex = objHandleIndex; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyTo; // Add new download context to DownloadContextContainer changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); } connections.Add(serverId, changeConnection); result = RopResult.Success; ModelHelper.CaptureRequirement( 361, @"[In RopFastTransferSourceCopyTo ROP] The RopFastTransferSourceCopyTo ROP ([MS-OXCROPS] section 2.2.12.6) initializes a FastTransfer operation to download content from a given messaging object and its descendant subobjects."); if ((copyFlag & CopyToCopyFlags.Move) == CopyToCopyFlags.Move) { if (requirementContainer.ContainsKey(3442002) && requirementContainer[3442002]) { ModelHelper.CaptureRequirement( 3442002, @"[In Appendix A: Product Behavior] Implementation does support Move flag [for the RopFastTransferSourceCopyTo ROP]. (Microsoft Exchange Server 2007 follow this behavior.)"); } if (requirementContainer.ContainsKey(3442004) && requirementContainer[3442004]) { ModelHelper.CaptureRequirement( 3442004, @"[In Appendix A: Product Behavior] If the server receives the Move flag, implementation does not fail the operation.(<34> Section 3.2.5.8.1.1: Microsoft Exchange Server 2007 follows this behavior.)"); } } } return result; } /// <summary> /// Initializes a FastTransfer operation to download content from a given messaging object and its descendant subObjects. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">Folder or message object handle index. </param> /// <param name="handleType">Input Handle Type</param> /// <param name="level">Variable indicate whether copy the descendant subObjects.</param> /// <param name="copyFlag">Defines parameters of the FastTransfer download operation.</param> /// <param name="option">Defines the parameters of a download operation .</param> /// <param name="propertyTags">The list of properties and subObjects to exclude.</param> /// <param name="downloadContextHandleIndex">The properties handle index.</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = ("FastTransferSourceCopyProperties(serverId,objHandleIndex,handleType,level,copyFlag,option,propertyTags,out downloadContextHandleIndex)/result"))] public static RopResult FastTransferSourceCopyProperties(int serverId, int objHandleIndex, InputHandleType handleType, bool level, CopyPropertiesCopyFlags copyFlag, SendOptionAlls option, Sequence<string> propertyTags, out int downloadContextHandleIndex) { // The contraction conditions Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. RopResult result = RopResult.InvalidParameter; // SendOptionAll value is Invalid parameter if ((option == SendOptionAlls.Invalid && (requirementContainer.ContainsKey(3470) && requirementContainer[3470])) || (copyFlag == CopyPropertiesCopyFlags.Invalid && (requirementContainer.ContainsKey(3466) && requirementContainer[3466]))) { downloadContextHandleIndex = -1; } else if (((copyFlag & CopyPropertiesCopyFlags.Move) == CopyPropertiesCopyFlags.Move) && (requirementContainer.ContainsKey(3466) && requirementContainer[3466])) { // CopyPropertiesCopyFlags value is Move. result = RopResult.NotImplemented; downloadContextHandleIndex = -1; } else { // Create a new download context. AbstractDownloadInfo downloadInfo = new AbstractDownloadInfo(); ConnectionData changeConnection = connections[serverId]; bool isObjExist = false; connections.Remove(serverId); if (handleType == InputHandleType.MessageHandle) { foreach (AbstractMessage temp in changeConnection.MessageContainer) { if (temp.MessageHandleIndex == objHandleIndex) { isObjExist = true; } } Condition.IsTrue(isObjExist); // Set value for new download context. downloadContextHandleIndex = AdapterHelper.GetHandleIndex(); downloadInfo.DownloadHandleIndex = downloadContextHandleIndex; downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.MessageContent; // Record the FastTransferOperation downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyProperties; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyProperties; // Set value for new download context. downloadInfo.CopyPropertiesCopyFlag = copyFlag; downloadInfo.Property = propertyTags; downloadInfo.Sendoptions = option; downloadInfo.RelatedObjectHandleIndex = objHandleIndex; downloadInfo.ObjectType = ObjectType.Message; downloadInfo.IsLevelTrue = level; // Add new download context to DownloadContextContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); } else if (handleType == InputHandleType.FolderHandle) { // Find current folder. foreach (AbstractFolder temp in changeConnection.FolderContainer) { if (temp.FolderHandleIndex == objHandleIndex) { isObjExist = true; } } Condition.IsTrue(isObjExist); // Set value for new download context. downloadContextHandleIndex = AdapterHelper.GetHandleIndex(); downloadInfo.DownloadHandleIndex = downloadContextHandleIndex; downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.folderContent; // Record the FastTransferOperation downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyProperties; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyProperties; // Set value for new download context. downloadInfo.CopyPropertiesCopyFlag = copyFlag; downloadInfo.Property = propertyTags; downloadInfo.Sendoptions = option; downloadInfo.RelatedObjectHandleIndex = objHandleIndex; downloadInfo.ObjectType = ObjectType.Folder; // Add new download context to DownloadContextContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); } else { // Find the current Attachment foreach (AbstractAttachment temp in changeConnection.AttachmentContainer) { if (temp.AttachmentHandleIndex == objHandleIndex) { isObjExist = true; } } Condition.IsTrue(isObjExist); // Set value for new download context. downloadContextHandleIndex = AdapterHelper.GetHandleIndex(); downloadInfo.DownloadHandleIndex = downloadContextHandleIndex; downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.attachmentContent; // Record the FastTransferOperation downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyProperties; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyProperties; // Set value for new download context. downloadInfo.CopyPropertiesCopyFlag = copyFlag; downloadInfo.Property = propertyTags; downloadInfo.Sendoptions = option; downloadInfo.ObjectType = ObjectType.Attachment; downloadInfo.RelatedObjectHandleIndex = objHandleIndex; // Add new download context to DownloadContextContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); } connections.Add(serverId, changeConnection); result = RopResult.Success; // If the server returns success result, it means the RopFastTransferSourceCopyProperties ROP initializes the FastTransfer operation successfully. And then this requirement can be captured. ModelHelper.CaptureRequirement( 431, @"[In RopFastTransferSourceCopyProperties ROP] The RopFastTransferSourceCopyProperties ROP ([MS-OXCROPS] section 2.2.12.7) initializes a FastTransfer operation to download content from a specified messaging object and its descendant sub objects."); } return result; } /// <summary> /// Initializes a FastTransfer operation on a folder for downloading content and descendant subObjects for messages identified by a given set of IDs. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">Folder object handle index. </param> /// <param name="copyFlag">Defines parameters of the FastTransfer download operation.</param> /// <param name="option">Defines the parameters of a download operation.</param> /// <param name="messageIds">The list of MIDs the messages should copy.</param> /// <param name="downloadContextHandleIndex">The message handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = ("FastTransferSourceCopyMessages(serverId,objHandleIndex,copyFlag,option,messageIds,out downloadContextHandleIndex)/result"))] public static RopResult FastTransferSourceCopyMessages(int serverId, int objHandleIndex, RopFastTransferSourceCopyMessagesCopyFlags copyFlag, SendOptionAlls option, Sequence<int> messageIds, out int downloadContextHandleIndex) { // The contraction conditions Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. RopResult result = RopResult.InvalidParameter; if (option == SendOptionAlls.Invalid) { if (requirementContainer.ContainsKey(3479) && requirementContainer[3479]) { // SendOption flags value is invalid downloadContextHandleIndex = -1; return result; } } // Modify the logical if ((copyFlag & RopFastTransferSourceCopyMessagesCopyFlags.Unused3) == RopFastTransferSourceCopyMessagesCopyFlags.Unused3) { // CopyFlags is set to Unused3 downloadContextHandleIndex = -1; } else { // Identify whether the current folder is existent or not. ConnectionData changeConnection = connections[serverId]; bool isFolderExist = false; foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderHandleIndex == objHandleIndex) { isFolderExist = true; } } Condition.IsTrue(isFolderExist); // Set value for new download context. AbstractDownloadInfo downloadInfo = new AbstractDownloadInfo(); downloadContextHandleIndex = AdapterHelper.GetHandleIndex(); downloadInfo.DownloadHandleIndex = downloadContextHandleIndex; connections.Remove(serverId); downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.MessageList; downloadInfo.CopyMessageCopyFlag = copyFlag; // Record the FastTransferOperation downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyMessage; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyMessage; // Set value for new download context. downloadInfo.Sendoptions = option; downloadInfo.RelatedObjectHandleIndex = objHandleIndex; downloadInfo.ObjectType = ObjectType.Folder; // Add new download context to DownloadContextContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); connections.Add(serverId, changeConnection); priorOperation = MS_OXCFXICS.PriorOperation.RopFastTransferSourceCopyMessage; result = RopResult.Success; // If the server returns success result, it means the RopFastTransferSourceCopyMessages ROP initializes the FastTransfer operation successfully. And then this requirement can be captured. ModelHelper.CaptureRequirement( 3125, @"[In RopFastTransferSourceCopyMessages ROP] The RopFastTransferSourceCopyMessages ROP ([MS-OXCROPS] section 2.2.12.5) initializes a FastTransfer operation on a folder for downloading content and descendant subobjects of messages identified by a set of MID structures ([MS-OXCDATA] section 2.2.1.2)."); } return result; } /// <summary> /// Initializes a FastTransfer operation to download properties and descendant subObjects for a specified folder. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">Folder object handle index. </param> /// <param name="copyFlag">Defines parameters of the FastTransfer download operation.</param> /// <param name="option">Defines the parameters of a download operation.</param> /// <param name="downloadContextHandleIndex">The folder handle index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = ("FastTransferSourceCopyFolder(serverId,folderHandleIndex,copyFlag,option, out downloadContextHandleIndex)/result"))] public static RopResult FastTransferSourceCopyFolder(int serverId, int folderHandleIndex, CopyFolderCopyFlags copyFlag, SendOptionAlls option, out int downloadContextHandleIndex) { // The contraction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. RopResult result = RopResult.InvalidParameter; // Modify the logical if ((option == SendOptionAlls.Invalid && (requirementContainer.ContainsKey(3487) && requirementContainer[3487])) || (copyFlag == CopyFolderCopyFlags.Invalid && (requirementContainer.ContainsKey(3483) && requirementContainer[3483]))) { // SendOption is Invalid parameter and CopyFolderCopyFlags is Invalid parameter. downloadContextHandleIndex = -1; return result; } else if (copyFlag == CopyFolderCopyFlags.Move && (requirementContainer.ContainsKey(526001) && !requirementContainer[526001])) { downloadContextHandleIndex = -1; ModelHelper.CaptureRequirement( 526001, @"[In Appendix A: Product Behavior] [CopyFlags] [When the flag name is Move, value is 0x01] Implementation does set the Move flag on a download operation to indicate the following: The server does not output any objects in a FastTransfer stream that the client does not have permissions to delete. <7> Section 2.2.3.1.1.4.1: In Exchange 2007, the Move bit flag is read by the server."); return result; } else { ConnectionData changeConnection = connections[serverId]; // Identify whether the current folder is existent or not. bool isFolderExist = false; foreach (AbstractFolder tempFolder in changeConnection.FolderContainer) { if (tempFolder.FolderHandleIndex == folderHandleIndex) { isFolderExist = true; } } Condition.IsTrue(isFolderExist); // Create a new download context. AbstractDownloadInfo downloadInfo = new AbstractDownloadInfo(); downloadContextHandleIndex = AdapterHelper.GetHandleIndex(); downloadInfo.DownloadHandleIndex = downloadContextHandleIndex; connections.Remove(serverId); // Record the FastTransferOperation and Stream Type. downloadInfo.AbstractFastTransferStreamType = FastTransferStreamType.TopFolder; downloadInfo.RelatedFastTransferOperation = EnumFastTransferOperation.FastTransferSourceCopyFolder; priorDownloadOperation = PriorDownloadOperation.RopFastTransferSourceCopyFolder; // Set value for new download context. downloadInfo.CopyFolderCopyFlag = copyFlag; downloadInfo.Sendoptions = option; downloadInfo.ObjectType = ObjectType.Folder; downloadInfo.RelatedObjectHandleIndex = folderHandleIndex; // Add new download context to downloadContainer. changeConnection.DownloadContextContainer = changeConnection.DownloadContextContainer.Add(downloadInfo); connections.Add(serverId, changeConnection); result = RopResult.Success; // If the server returns success result, it means the RopFastTransferSourceCopyFolder ROP initializes the FastTransfer operation successfully. And then this requirement can be captured. ModelHelper.CaptureRequirement( 502, @"[In RopFastTransferSourceCopyFolder ROP] The RopFastTransferSourceCopyFolder ROP ([MS-OXCROPS] section 2.2.12.4) initializes a FastTransfer operation to download properties and descendant subobjects for a specified folder."); } return result; } /// <summary> /// Downloads the next portion of a FastTransfer stream. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="downloadHandleIndex">A fastTransfer stream object handle index. </param> /// <param name="bufferSize">Specifies the maximum amount of data to be output in the TransferBuffer.</param> /// <param name="transferBufferIndex">The index of data get from the fastTransfer stream.</param> /// <param name="abstractFastTransferStream">The abstractFastTransferStream.</param> /// <param name="transferDataSmallOrEqualToBufferSize">Variable to not if the transferData is small or equal to bufferSize</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = ("FastTransferSourceGetBuffer(serverId,downloadHandleIndex,bufferSize,out transferBufferIndex,out abstractFastTransferStream ,out transferDataSmallOrEqualToBufferSize)/result"))] public static RopResult FastTransferSourceGetBuffer(int serverId, int downloadHandleIndex, BufferSize bufferSize, out int transferBufferIndex, out AbstractFastTransferStream abstractFastTransferStream, out bool transferDataSmallOrEqualToBufferSize) { // The contractions conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize the return value. RopResult result = RopResult.InvalidParameter; transferBufferIndex = -1; abstractFastTransferStream = new AbstractFastTransferStream(); transferDataSmallOrEqualToBufferSize = false; if (bufferSize == BufferSize.Greater) { result = RopResult.BufferTooSmall; return result; } // Get current ConnectionData value. ConnectionData currentConnection = connections[serverId]; // Create a new currentDownloadContext. AbstractDownloadInfo currentDownloadContext = new AbstractDownloadInfo(); // Identify whether the Download context is existent or not. bool isDownloadHandleExist = false; // Find the current Download Context foreach (AbstractDownloadInfo tempDownloadContext in currentConnection.DownloadContextContainer) { if (tempDownloadContext.DownloadHandleIndex == downloadHandleIndex) { // Set the value to the related variable when the download context is existent. isDownloadHandleExist = true; result = RopResult.Success; currentDownloadContext = tempDownloadContext; int infoIndex = currentConnection.DownloadContextContainer.IndexOf(tempDownloadContext); // Get the Data buffer index transferBufferIndex = AdapterHelper.GetStreamBufferIndex(); currentDownloadContext.DownloadStreamIndex = transferBufferIndex; abstractFastTransferStream.StreamType = currentDownloadContext.AbstractFastTransferStreamType; currentConnection.DownloadContextContainer = currentConnection.DownloadContextContainer.Update(infoIndex, currentDownloadContext); } } // Create new variable relate to current folder. AbstractFolder currentFolder = new AbstractFolder(); int currentFolderIndex = 0; // Identify current whether DownloadHandle is existent or not. if (isDownloadHandleExist) { // If bufferSize is set to a value other than 0xBABE if (bufferSize != BufferSize.Normal) { transferDataSmallOrEqualToBufferSize = true; ModelHelper.CaptureRequirement( 2142, @"[In Receiving a RopFastTransferSourceGetBuffer Request]If the value of BufferSize in the ROP request is set to a value other than 0xBABE, the following semantics apply:The server MUST output, at most, the number of bytes specified by the BufferSize field in the TransferBuffer field even if more data is available."); ModelHelper.CaptureRequirement( 2143, @"[In Receiving a RopFastTransferSourceGetBuffer Request]If the value of BufferSize in the ROP request is set to a value other than 0xBABE, the following semantics apply:The server returns less bytes than the value specified by the BufferSize field, or the server returns the number of bytes specified by the BufferSize field in the TransferBuffer field."); } #region Requirements about RopOperation Response // FolderHandleIndex is the Index of the FastTransfer download context if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo) { ModelHelper.CaptureRequirement(384, "[In RopFastTransferSourceCopyTo ROP Response Buffer] OutputServerObject: The value of this field MUST be the FastTransfer download context."); } else if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyProperties) { ModelHelper.CaptureRequirement(455, "[In RopFastTransferSourceCopyProperties ROP Response Buffer] OutputServerObject: The value of this field MUST be the FastTransfer download context. "); } else if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyMessage) { ModelHelper.CaptureRequirement(487, @"[In RopFastTransferSourceCopyMessages ROP Response Buffer]OutputServerObject: The value of this field MUST be the FastTransfer download context."); } else if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyFolder) { ModelHelper.CaptureRequirement(511, @"[In RopFastTransferSourceCopyFolder ROP Response Buffer]OutputServerObject: The value of this field MUST be the FastTransfer download context."); } #endregion // Get the related folder for the download handle in the folder container. foreach (AbstractFolder tempfolder in currentConnection.FolderContainer) { if (tempfolder.FolderHandleIndex == currentDownloadContext.RelatedObjectHandleIndex) { currentFolder = tempfolder; currentFolderIndex = currentConnection.FolderContainer.IndexOf(tempfolder); break; } } // Identify the abstractFastTransferStream type switch (currentDownloadContext.AbstractFastTransferStreamType) { // The hierarchySync element contains the result of the hierarchy synchronization download operation case FastTransferStreamType.hierarchySync: { if (currentDownloadContext.SynchronizationType == SynchronizationTypes.Hierarchy && priorDownloadOperation == PriorDownloadOperation.RopSynchronizationConfigure) { // Because if the synchronizationType in synchronization configure and the stream type return are Hierarchy indicate this requirement verified. ModelHelper.CaptureRequirement( 3322, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopSynchronizationConfigure, ROP request buffer field conditions is The SynchronizationType field is set to Hierarchy (0x02), Root element in the produced FastTransfer stream is hierarchySync."); } // Create a new HierarchySync. abstractFastTransferStream.AbstractHierarchySync = new AbstractHierarchySync { FolderchangeInfo = new AbstractFolderChange(), AbstractDeletion = { IdSetDeleted = new Set<int>() }, FinalICSState = new AbstractState { AbstractICSStateIndex = AdapterHelper.GetICSStateIndex(), IsNewCnsetSeenFAIPropertyChangeNumber = false } }; // Assigned a new final ICS State for HierarchySync. // This isn't New ChangeNumber for CnsetSeenFAIProperty in Initialize. // Because of the SynchronizationType must optioned "Hierarchy" value in RopSynchronizationConfigure operation if FastTransferStreamType is hierarchySync. ModelHelper.CaptureRequirement(1209, "[In state Element] [MetaTagCnsetSeenFAI, Conditional] MetaTagCnsetSeenFAI MUST NOT be present if the SynchronizationType field is set to Hierarchy (0x02), as specified in section 2.2.3.2.1.1.1."); // This isn't New ChangeNumber for CnsetReadProperty in Initialize. abstractFastTransferStream.AbstractHierarchySync.FinalICSState.IsNewCnsetReadPropertyChangeNumber = false; ModelHelper.CaptureRequirement(1211, "[In state Element] [MetaTagCnsetRead,Conditional] MetaTagCnsetRead MUST NOT be present if the SynchronizationType field is set to Hierarchy (0x02)."); // In case of SynchronizationExtraFlag is EID in current DownloadContext. if (((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.Eid) == SynchronizationExtraFlag.Eid) && (currentFolder.SubFolderIds.Count > 0)) { // Because the SynchronizationExtraFlag is EID and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement(2730, "[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] Reply is the same whether unknown flags [0x00000010] is set or not."); // In case of SynchronizationExtraFlag is EID in current DownloadContext. if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.Eid) == SynchronizationExtraFlag.Eid) { // The PidTagFolderId must be exist in folder change of HierarchySync. abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagFolderIdExist = true; // Because the SynchronizationExtraFlag is EID and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement(1095, "[In folderChange Element] [PidTagFolderId, Conditional] PidTagFolderId MUST be present if and only if the Eid flag of the SynchronizationExtraFlags field is set."); ModelHelper.CaptureRequirement( 2191, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagFolderId property (section 2.2.1.2.2) in a folder change header if and only if the Eid flag of the SynchronizationExtraFlags field flag is set."); ModelHelper.CaptureRequirement( 2761, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMid property (section 2.2.1.2.1) in a message change header if and only if the Eid flag of the SynchronizationExtraFlags field is set."); if (currentDownloadContext.SynchronizationType == SynchronizationTypes.Hierarchy) { ModelHelper.CaptureRequirement( 3500, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagFolderId property in the folder change header if the SynchronizationType field is set to Hierarchy (0x02), as specified in section 2.2.3.2.1.1.1."); } } else { // The PidTagFolderId must be not exist in folder change of HierarchySync. abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagFolderIdExist = false; ModelHelper.CaptureRequirement( 716001, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is Eid, the value is 0x00000001] The server does not include the PidTagFolderId (section 2.2.1.2.2) property in the folder change header when the Eid flag of the SynchronizationExtraFlag field is not set."); } } else { // The PidTagFolderId must be not exist in folder change of HierarchySync. abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagFolderIdExist = false; ModelHelper.CaptureRequirement( 716001, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is Eid, the value is 0x00000001] The server does not include the PidTagFolderId (section 2.2.1.2.2) property in the folder change header when the Eid flag of the SynchronizationExtraFlag field is not set."); } // In case of SynchronizationExtraFlag is NoForeignIdentifiers in current DownloadContext. if (((currentDownloadContext.Synchronizationflag & SynchronizationFlag.NoForeignIdentifiers) == SynchronizationFlag.NoForeignIdentifiers) && (currentFolder.SubFolderIds.Count > 0)) { // The PidTagParentFolderId must be exist in folder change of HierarchySync. abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagParentFolderIdExist = true; ModelHelper.CaptureRequirement(1097, "[In folderChange Element] [PidTagParentFolderId, Conditional] PidTagParentFolderId MUST be present if the NoForeignIdentifiers flag of the SynchronizationFlags field is set."); // The PidTagParentSourceKey and PidTagSourceKey must be exist in folder change of HierarchySync. abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagParentSourceKeyValueZero = false; abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagSourceKeyValueZero = false; ModelHelper.CaptureRequirement( 2178001, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the NoForeignIdentifiers flag of the SynchronizationFlags field is set, server will return null values for the PidTagSourceKey property (section 2.2.1.2.5) and PidTagParentSourceKey (section 2.2.1.2.6) properties when producing the FastTransfer stream for folder and message changes."); ModelHelper.CaptureRequirement(2077, "[In Generating the PidTagSourceKey Value] When requested by the client, the server MUST output the PidTagSourceKey property (section 2.2.1.2.5) value if it is persisted."); ModelHelper.CaptureRequirement( 2179001, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the NoForeignIdentifiers flag of the SynchronizationFlags field is not set, server will return not null values for the PidTagSourceKey and PidTagParentSourceKey properties when producing the FastTransfer stream for folder and message changes."); } else { // The PidTagFolderId must be not exist in folder change of HierarchySync. abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagParentFolderIdExist = false; } // Sub folder count. int subFolderCount = 0; // Record all descendant folders. Set<int> allDescendantFolders = new Set<int>(); if (currentFolder.SubFolderIds.Count > 0) { // Search the current folder in FolderContainer. foreach (AbstractFolder tempFolder in currentConnection.FolderContainer) { if (currentFolder.FolderIdIndex == tempFolder.ParentFolderIdIndex) { // Set the value to the related variable when the current folder is existent. if (!currentDownloadContext.UpdatedState.IdsetGiven.Contains(tempFolder.FolderIdIndex)) { // Because of identify that It is a folder by (CurrentFolder.FolderIdIndex == tempFolder.ParentFolderIdIndex) and identify that change number is not in PidTagCnsetSeen by (!currentDownloadContext.UpdatedState.CnsetSeen.Contains(tempFolder.changeNumberIndex)). so can cover requirement here. ModelHelper.CaptureRequirement( 2042, @"[In Determining What Differences To Download] For every object in the synchronization scope, servers MUST do the following: Include the following syntactical elements in the FastTransfer stream of the OutputServerObject field of the FastTransfer download ROPs, as specified in section 2.2.3.1.1, if one of the following applies: Include the folderChange element, as specified in section 2.2.4.3.5, if the object specified by the InputServerObject field of the FastTransfer download ROP request is a Folder object And the change number is not included in the value of the MetaTagCnsetSeen property (section 2.2.1.1.2)."); // Add current folder id to IdsetGiven of DownloadContext when the IdsetGiven of updatedState contains the current folder id. currentDownloadContext.UpdatedState.IdsetGiven = currentDownloadContext.UpdatedState.IdsetGiven.Add(tempFolder.FolderIdIndex); // Assign a new change number for CnsetSeenProperty. abstractFastTransferStream.AbstractHierarchySync.FinalICSState.IsNewCnsetSeenPropertyChangeNumber = true; if (priorUploadOperation == PriorOperation.RopSynchronizationImportHierarchyChange) { ModelHelper.CaptureRequirement( 2235, @"[In Receiving a RopSynchronizationImportHierarchyChange Request] Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated to include a new change number in the MetaTagCnsetSeen property (section 2.2.1.1.2)."); } subFolderCount++; } else { if (!currentDownloadContext.UpdatedState.CnsetSeen.Contains(tempFolder.ChangeNumberIndex)) { // Add current folder id to updatedState.IdsetGiven when the IdsetGiven of updatedState contains the current folder id. currentDownloadContext.UpdatedState.CnsetSeen = currentDownloadContext.UpdatedState.CnsetSeen.Add(tempFolder.ChangeNumberIndex); abstractFastTransferStream.AbstractHierarchySync.FinalICSState.IsNewCnsetSeenPropertyChangeNumber = true; // Because of identify that It is a folder by (CurrentFolder.FolderIdIndex == tempFolder.ParentFolderIdIndex) and identify that change number is not in PidTagCnsetSeen by (!currentDownloadContext.UpdatedState.CnsetSeen.Contains(tempFolder.changeNumberIndex)). so can cover requirement here. ModelHelper.CaptureRequirement( 2042, @"[In Determining What Differences To Download] For every object in the synchronization scope, servers MUST do the following: Include the following syntactical elements in the FastTransfer stream of the OutputServerObject field of the FastTransfer download ROPs, as specified in section 2.2.3.1.1, if one of the following applies: Include the folderChange element, as specified in section 2.2.4.3.5, if the object specified by the InputServerObject field of the FastTransfer download ROP request is a Folder object And the change number is not included in the value of the MetaTagCnsetSeen property (section 2.2.1.1.2)."); if (priorUploadOperation == PriorOperation.RopSynchronizationImportHierarchyChange) { ModelHelper.CaptureRequirement( 2235, @"[In Receiving a RopSynchronizationImportHierarchyChange Request] Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated to include a new change number in the MetaTagCnsetSeen property (section 2.2.1.1.2)."); } subFolderCount++; } } // In case of current folder's subFolder count greater the 0. if (tempFolder.SubFolderIds.Count > 0) { // Find the second Folder in FolderContainer which was created under current folder. foreach (AbstractFolder secondFolder in currentConnection.FolderContainer) { if (secondFolder.ParentFolderIdIndex == tempFolder.FolderIdIndex) { if (!currentDownloadContext.UpdatedState.IdsetGiven.Contains(secondFolder.FolderIdIndex)) { // Add current folder id to updatedState.IdsetGiven when the IdsetGiven of updatedState contains the current folder id. currentDownloadContext.UpdatedState.IdsetGiven = currentDownloadContext.UpdatedState.IdsetGiven.Add(secondFolder.FolderIdIndex); // Assign a new change number for CnsetSeenPropery. abstractFastTransferStream.AbstractHierarchySync.FinalICSState.IsNewCnsetSeenPropertyChangeNumber = true; if (priorUploadOperation == PriorOperation.RopSynchronizationImportHierarchyChange) { ModelHelper.CaptureRequirement( 2235, @"[In Receiving a RopSynchronizationImportHierarchyChange Request] Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated to include a new change number in the MetaTagCnsetSeen property (section 2.2.1.1.2)."); } subFolderCount++; } else { if (!currentDownloadContext.UpdatedState.CnsetSeen.Contains(secondFolder.ChangeNumberIndex)) { // Add current folder id to updatedState.CnsetSeen when the CnsetSeen of updatedState contains the current folder id. currentDownloadContext.UpdatedState.CnsetSeen = currentDownloadContext.UpdatedState.CnsetSeen.Add(secondFolder.ChangeNumberIndex); // Assign a new change number for CnsetSeenProperty. abstractFastTransferStream.AbstractHierarchySync.FinalICSState.IsNewCnsetSeenPropertyChangeNumber = true; if (priorUploadOperation == PriorOperation.RopSynchronizationImportHierarchyChange) { ModelHelper.CaptureRequirement( 2235, @"[In Receiving a RopSynchronizationImportHierarchyChange Request] Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated to include a new change number in the MetaTagCnsetSeen property (section 2.2.1.1.2)."); } subFolderCount++; } } } // Add second Folder to descendant folder. allDescendantFolders = allDescendantFolders.Add(secondFolder.FolderIdIndex); } } // Add second Folder to descendant folder. allDescendantFolders = allDescendantFolders.Add(tempFolder.FolderIdIndex); } } } // Search the Descendant folderId in IdsetGiven. foreach (int folderId in currentDownloadContext.UpdatedState.IdsetGiven) { // Identify whether the last Updated Id is or not in Descendant Folder. if (!allDescendantFolders.Contains(folderId)) { if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.NoDeletions) == SynchronizationFlag.NoDeletions) { if (requirementContainer.ContainsKey(1062) && requirementContainer[1062]) { // Deletions isn't present in deletions. abstractFastTransferStream.AbstractHierarchySync.AbstractDeletion.IsDeletionPresent = false; ModelHelper.CaptureRequirement( 1062, @"[In deletions Element] Implementation does not present deletions element if the NoDeletions flag of the SynchronizationFlag field, as specified in section 2.2.3.2.1.1.1, was set when the synchronization download operation was configured. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } // Deletions isn't present in deletions. abstractFastTransferStream.AbstractHierarchySync.AbstractDeletion.IsDeletionPresent = false; ModelHelper.CaptureRequirement( 2165, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the NoDeletions flag of the SynchronizationFlags field is set, the server MUST NOT download information about item deletions, as specified in section 2.2.4.3.3"); } else { // Deletions is present in deletions. abstractFastTransferStream.AbstractHierarchySync.AbstractDeletion.IsDeletionPresent = true; // PidTagIdsetNoLongerInScope be present in deletions abstractFastTransferStream.AbstractHierarchySync.AbstractDeletion.IsPidTagIdsetNoLongerInScopeExist = false; ModelHelper.CaptureRequirement( 1333, @"[In deletions Element] [The following restrictions exist on the contained propList element, as specified in section 2.2.4.3.20:] MUST adhere to the following restrictions: MetaTagIdsetNoLongerInScope MUST NOT be present if the Hierarchy value of the SynchronizationType field is set, as specified in section 2.2.3.2.1.1.1."); // Are folders that have never been reported as deleted abstractFastTransferStream.AbstractHierarchySync.AbstractDeletion.IsPidTagIdsetExpiredExist = false; ModelHelper.CaptureRequirement( 2046, @"[In Determining What Differences To Download] [For every object in the synchronization scope, servers MUST do the following:] If the NoDeletions flag of the SynchronizationFlags field is not set, include the deletions element, as specified in section 2.2.4.3.3, for objects that either: Have their internal identifiers present in the value of the MetaTagIdsetGiven property (section 2.2.1.1.1) and are missing from the server replica.Are folders that have never been reported as deleted folders. Are folders that have never been reported as deleted folders."); ModelHelper.CaptureRequirement( 1337002, @"[In deletions Element] [The following restrictions exist on the contained propList element, as specified in section 2.2.4.3.20:] MUST adhere to the following restrictions: ] MetaTagIdsetExpired (section 2.2.1.3.3) MUST NOT be present if the Hierarchy value of the SynchronizationType field is set. "); // Because isPidTagIdsetExpiredExist value is false so have their internal identifiers present in PidTagIdsetGiven and isDeletionPresent is true to those are missing from the server replica. So cover requirement here. ModelHelper.CaptureRequirement( 2045, @"[In Determining What Differences To Download] [For every object in the synchronization scope, servers MUST do the following:] If the NoDeletions flag of the SynchronizationFlag field is not set, include the deletions element, as specified in section 2.2.4.3.3, for objects that either: Have their internal identifiers present in the value of the MetaTagIdsetGiven property (section 2.2.1.1.1) and are missing from the server replica.Are folders that have never been reported as deleted folders. Are folders that have never been reported as deleted folders."); // Identify the current ExchangeServer Version. if (requirementContainer.ContainsKey(2652) && requirementContainer[2652]) { // Add folderId to IdSetDeleted of abstractDeletion abstractFastTransferStream.AbstractHierarchySync.AbstractDeletion.IdSetDeleted = abstractFastTransferStream.AbstractHierarchySync.AbstractDeletion.IdSetDeleted.Add(folderId); // Because of execute RopSynchronizationImportHierarchyChange or RopSynchronizationImportMessageChange operation before execute RopSynchronizationImportDeletes operation, record deletions and prevent it restoring them back finished in MS_OXCFXICSAdapter. So cover this requirement here. ModelHelper.CaptureRequirement( 2652, @"[In Receiving a RopSynchronizationImportDeletes Request] Implementation does record deletions of objects that never existed in the server replica, in order to prevent the RopSynchronizationImportHierarchyChange (section 2.2.3.2.4.3) or RopSynchronizationImportMessageChange (section 2.2.3.2.4.2) ROPs from restoring them back. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } // Delete folder id from DownloadContext. currentDownloadContext.UpdatedState.IdsetGiven = currentDownloadContext.UpdatedState.IdsetGiven.Remove(folderId); // If NoDeletions flag is not set and the operation can be executed successfully, the element isDeletionPresent as true will be returned, which means the deletion elements is downloaded, so this requirement can be verified. ModelHelper.CaptureRequirement( 2167, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the NoDeletions flag of the SynchronizationFlags field is not set, the server MUST download information about item deletions, as specified in section 2.2.4.3.3."); } // This is a new changeNumber abstractFastTransferStream.AbstractHierarchySync.FinalICSState.IsNewCnsetSeenPropertyChangeNumber = true; if (priorUploadOperation == PriorOperation.RopSynchronizationImportHierarchyChange) { ModelHelper.CaptureRequirement( 2235, @"[In Receiving a RopSynchronizationImportHierarchyChange Request] Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated to include a new change number in the MetaTagCnsetSeen property (section 2.2.1.1.2)."); } } } // The lDescendantFolder is existent. if (currentFolder.SubFolderIds == allDescendantFolders) { if (allDescendantFolders.Count > 0) { // Parent folder is existent and PidTagParentSourceKey is not in folder change abstractFastTransferStream.AbstractHierarchySync.FolderchangeInfo.IsPidTagParentSourceKeyValueZero = true; } } else { ModelHelper.CaptureRequirement(1129, "[In hierarchySync Element]The folderChange elements for the parent folders MUST be output before any of their child folders."); abstractFastTransferStream.AbstractHierarchySync.IsParentFolderBeforeChild = true; } // Set value for finalICSState. abstractFastTransferStream.AbstractHierarchySync.FinalICSState.IdSetGiven = currentDownloadContext.UpdatedState.IdsetGiven; abstractFastTransferStream.AbstractHierarchySync.FolderCount = subFolderCount; currentFolder.ICSStateContainer.Add(abstractFastTransferStream.AbstractHierarchySync.FinalICSState.AbstractICSStateIndex, currentDownloadContext.UpdatedState); // Because of the "foreach" Search the Descendant folderId in IdsetGive and the end of "foreach" search. So cover this requirement here. ModelHelper.CaptureRequirement(1128, "[In hierarchySync Element]There MUST be exactly one folderChange element for each descendant folder of the root of the synchronization operation (that is the folder that was passed to the RopSynchronizationConfigure ROP, as specified in section 2.2.3.2.1.1) that is new or has been changed since the last synchronization."); // Update the FolderContainer. currentConnection.FolderContainer = currentConnection.FolderContainer.Update(currentFolderIndex, currentFolder); connections[serverId] = currentConnection; break; } // The state element contains the final ICS state of the synchronization download operation. case FastTransferStreamType.state: { if (priorDownloadOperation == PriorDownloadOperation.RopSynchronizationGetTransferState) { // Because if the isRopSynchronizationGetTransferState called the steam type return by RopFastTransferSourceGetBuffer should be State ModelHelper.CaptureRequirement( 3323, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopSynchronizationGetTransferState, ROP request buffer field conditions is always, Root element in the produced FastTransfer stream is state."); } // Create a new abstractState. abstractFastTransferStream.AbstractState = new AbstractState { AbstractICSStateIndex = AdapterHelper.GetICSStateIndex() }; // Assign a new ICS State Index. // The new IdSetGiven of State value equal to IdsetGiven of current download context. if (requirementContainer.ContainsKey(350400101) && requirementContainer[350400101] && (priorOperation == PriorOperation.RopSynchronizationOpenCollector)) { abstractFastTransferStream.AbstractState.IdSetGiven = new Set<int>(); ModelHelper.CaptureRequirement( 350400101, @"[In Appendix A: Product Behavior] Implementation does use this behavior. <43> Section 3.2.5.9.3.1: In Exchange 2007, the RopSynchronizationGetTransferState ROP (section 2.2.3.2.3.1) returns a checkpoint ICS state that is reflective of the current status."); } else { abstractFastTransferStream.AbstractState.IdSetGiven = currentDownloadContext.UpdatedState.IdsetGiven; } // Add the new stat to ICSStateContainer. currentFolder.ICSStateContainer.Add(abstractFastTransferStream.AbstractState.AbstractICSStateIndex, currentDownloadContext.UpdatedState); currentConnection.FolderContainer = currentConnection.FolderContainer.Update(currentFolderIndex, currentFolder); connections[serverId] = currentConnection; break; } // The messageContent element represents the content of a message. case FastTransferStreamType.contentsSync: { if (currentDownloadContext.SynchronizationType == SynchronizationTypes.Contents && priorDownloadOperation == PriorDownloadOperation.RopSynchronizationConfigure) { // Because if the synchronizationType in synchronization configure and the stream type return are contents indicate this requirement verified. ModelHelper.CaptureRequirement( 3321, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopSynchronizationConfigure, ROP request buffer field conditions is The SynchronizationType field is set to Contents (0x01), Root element in the produced FastTransfer stream is contentsSync."); } // Create a new abstractContentsSync. abstractFastTransferStream.AbstractContentsSync = new AbstractContentsSync { MessageInfo = new Set<AbstractMessageChangeInfo>(), AbstractDeletion = { IdSetDeleted = new Set<int>() }, FinalICSState = new AbstractState { // Assign abstractICSStateIndex. AbstractICSStateIndex = AdapterHelper.GetICSStateIndex() } }; // Create a new finalICSState. if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.Progress) == SynchronizationFlag.Progress) { // The current ContentsSync is include progressTotal. abstractFastTransferStream.AbstractContentsSync.IsprogessTotalPresent = true; ModelHelper.CaptureRequirement(1179, "[In progressTotal Element]This element MUST be present if the Progress flag of the SynchronizationFlags field, as specified in section 2.2.3.2.1.1.1, was set when configuring the synchronization download operation and a server supports progress reporting."); if (requirementContainer.ContainsKey(2675) && requirementContainer[2675]) { // The current ContentsSync is include progressTotal. abstractFastTransferStream.AbstractContentsSync.IsprogessTotalPresent = true; // The current server is exchange. ModelHelper.CaptureRequirement( 2675, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] Implementation does inject the progressTotal element, as specified in section 2.2.4.3.19, into the FastTransfer stream, if the Progress flag of the SynchronizationFlag field is set. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } } else { // The current ContentsSync is not include progressTotal. abstractFastTransferStream.AbstractContentsSync.IsprogessTotalPresent = false; ModelHelper.CaptureRequirement( 2188, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the Progress flag of the SynchronizationFlags field is not set, the server MUST not inject the progressTotal element into the FastTransfer stream."); ModelHelper.CaptureRequirement(1180, "[In progressTotal Element]This element MUST NOT be present if the Progress flag of the SynchronizationFlags field was not set when configuring the synchronization download operation."); } // Search the message ids in IdsetGiven. foreach (int messageId in currentDownloadContext.UpdatedState.IdsetGiven) { if (!currentFolder.MessageIds.Contains(messageId)) { // Assign a new change number for CnsetRead Property. if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.NoDeletions) == SynchronizationFlag.NoDeletions) { // The server MUST NOT download information about item deletions. abstractFastTransferStream.AbstractContentsSync.AbstractDeletion.IsDeletionPresent = false; ModelHelper.CaptureRequirement( 2165, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the NoDeletions flag of the SynchronizationFlags field is set, the server MUST NOT download information about item deletions, as specified in section 2.2.4.3.3"); ModelHelper.CaptureRequirement( 2166, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the NoDeletions flag of the SynchronizationFlags field is set, the server MUST respond as if the IgnoreNoLongerInScope flag was set."); } else if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.IgnoreNoLongerInScope) != SynchronizationFlag.IgnoreNoLongerInScope) { // The server MUST download information about item deletions. abstractFastTransferStream.AbstractContentsSync.AbstractDeletion.IsDeletionPresent = true; ModelHelper.CaptureRequirement( 2167, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the NoDeletions flag of the SynchronizationFlags field is not set, the server MUST download information about item deletions, as specified in section 2.2.4.3.3."); // Identify the current ExchangeServer Version. if (requirementContainer.ContainsKey(2652) && requirementContainer[2652]) { // Add messageId to abstractDeletion of abstractDeletion. abstractFastTransferStream.AbstractContentsSync.AbstractDeletion.IdSetDeleted = abstractFastTransferStream.AbstractContentsSync.AbstractDeletion.IdSetDeleted.Add(messageId); // Because of execute RopSynchronizationImportHierarchyChange or RopSynchronizationImportMessageChange operation before execute RopSynchronizationImportDeletes operation, record deletions and prevent it restoring them back finished in MS_OXCFXICSAdapter. So cover this requirement here. ModelHelper.CaptureRequirement( 2652, @"[In Receiving a RopSynchronizationImportDeletes Request] Implementation does record deletions of objects that never existed in the server replica, in order to prevent the RopSynchronizationImportHierarchyChange (section 2.2.3.2.4.3) or RopSynchronizationImportMessageChange (section 2.2.3.2.4.2) ROPs from restoring them back. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } currentDownloadContext.UpdatedState.IdsetGiven = currentDownloadContext.UpdatedState.IdsetGiven.Remove(messageId); ModelHelper.CaptureRequirement( 2169, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the IgnoreNoLongerInScope flag of the SynchronizationFlags field is not set, the server MUST download information about messages that went out of scope as deletions, as specified in section 2.2.4.3.3."); } if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.IgnoreNoLongerInScope) == SynchronizationFlag.IgnoreNoLongerInScope) { // PidTagIdsetNoLongerInScope MUST NOT be present. abstractFastTransferStream.AbstractContentsSync.AbstractDeletion.IsPidTagIdsetNoLongerInScopeExist = false; ModelHelper.CaptureRequirement(1334, @"[In deletions Element] [The following restrictions exist on the contained propList element, as specified in section 2.2.4.3.20:] MUST adhere to the following restrictions: MetaTagIdsetNoLongerInScope MUST NOT be present if the IgnoreNoLongerInScope flag of the SynchronizationFlags field is set."); ModelHelper.CaptureRequirement( 2168, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the IgnoreNoLongerInScope flag of the SynchronizationFlags field is set, the server MUST NOT download information about messages that went out of scope as deletions, as specified in section 2.2.4.3.3."); } } } #region Set message change contents // Search the current message which match search condition in MessageContainer foreach (AbstractMessage tempMessage in currentConnection.MessageContainer) { if (tempMessage.FolderIdIndex == currentFolder.FolderIdIndex) { // The found message is FAI message. if (tempMessage.IsFAImessage) { if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.FAI) == SynchronizationFlag.FAI) { if (!currentDownloadContext.UpdatedState.IdsetGiven.Contains(tempMessage.MessageIdIndex)) { // Create a new messageChange of contentSync. AbstractMessageChangeInfo newMessageChange = new AbstractMessageChangeInfo { MessageIdIndex = tempMessage.MessageIdIndex, IsMessageChangeFull = true }; // Set the value for new messageChange. // This MessageChangeFull is in new message change. if ((currentDownloadContext.Sendoptions & SendOptionAlls.PartialItem) != SendOptionAlls.PartialItem) { ModelHelper.CaptureRequirement( 1135, @"[In messageChange Element] A server MUST use the messageChangeFull element, instead of the messageChangePartial element, if any of the following are true: The PartialItem flag of the SendOptions field was not set, as specified in section 2.2.3.2.1.1."); } // Because SynchronizationFlag is set FAI and isMessageChangeFull is true so can cover requirement here. ModelHelper.CaptureRequirement(1137, @"[In messageChange Element] [A server MUST use the messageChangeFull element, instead of the messageChangePartial element, if any of the following are true:] The message is an FAI message."); if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.CN) == SynchronizationExtraFlag.CN) { // PidTagChangeNumber must be present . newMessageChange.IsPidTagChangeNumberExist = true; // Because the SynchronizationExtraFlag is CN and the SynchronizationExtraFlag only set CN. So can cover requirement here. ModelHelper.CaptureRequirement(1367, "[In messageChangeHeader Element, PidTagChangeNumber,Conditional]PidTagChangeNumber MUST be present if and only if the CN flag of the SynchronizationExtraFlags field is set."); // Because the SynchronizationExtraFlag is CN and the SynchronizationExtraFlag only set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2196, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagChangeNumber property (section 2.2.1.2.3) in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is set."); } else { // PidTagChangeNumber must not present . newMessageChange.IsPidTagChangeNumberExist = false; // Because the SynchronizationExtraFlag is not CN and the SynchronizationExtraFlag only don't set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2197, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST NOT include the PidTagChangeNumber property in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is not set."); } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.Eid) == SynchronizationExtraFlag.Eid) { // The server MUST include the PidTagMid property in the messageChange. newMessageChange.IsPidTagMidExist = true; // Because the SynchronizationExtraFlag is EID and the SynchronizationExtraFlag only set EID. So can cover requirement here. ModelHelper.CaptureRequirement(1363, "[In messageChangeHeader Element] [PidTagMid,Conditional] PidTagMid MUST be present if and only if the Eid flag of the SynchronizationExtraFlags field is set, as specified in section 2.2.3.2.1.1.1."); } else { // The server don't include the PidTagFolderId property in the messageChange. newMessageChange.IsPidTagMidExist = false; } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.MessageSize) == SynchronizationExtraFlag.MessageSize) { // The server include the PidTagMessageSize property in the messageChange. newMessageChange.IsPidTagMessageSizeExist = true; // Because the SynchronizationExtraFlag is MessageSize and the SynchronizationExtraFlag only set MessageSize. So can cover requirement here. ModelHelper.CaptureRequirement( 2195, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMessageSize property (section 2.2.1.6) in the message change header if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); ModelHelper.CaptureRequirement( 1365, @"[In messageChangeHeader Element] [PidTagMessageSize,Conditional] PidTagMessageSize MUST be present if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); } if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.Progress) == SynchronizationFlag.Progress) { // The server must include the ProgressPerMessage in the messageChange. newMessageChange.IsProgressPerMessagePresent = true; // Message object that follows is FAI newMessageChange.FollowedFAIMessage = true; // Because the SynchronizationExtraFlag is Progress and the SynchronizationExtraFlag only set Progress. So can cover requirement here. ModelHelper.CaptureRequirement( 1171, @"[In progressPerMessage Element]MUST be present if and only if the progessTotal element, as specified in section 2.2.4.3.18, was output within the same ancestor contentsSync element, as specified in section 2.2.4.3.2."); ModelHelper.CaptureRequirement( 1382, @"[In progressPerMessage Element] [[PtypBoolean] 0x0000000B] [The server returns] TRUE (0x01 or any non-zero value) if the Message object that follows is FAI."); } else { // The server don't include the ProgressPerMessage in the messageChange. newMessageChange.IsProgressPerMessagePresent = false; ModelHelper.CaptureRequirement( 1172, @"[In progressPerMessage Element] [ProgressPerMessage Element] MUST NOT be present if the Progress flag of the SynchronizationFlags field was not set when configuring the synchronization download operation."); } if (tempMessage.MessageProperties.Contains("PidTagBody")) { if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.BestBody) != SynchronizationFlag.BestBody) { // Implementation does only support the message body (2) which is always in the original format if (requirementContainer.ContainsKey(3118002) && requirementContainer[3118002]) { newMessageChange.IsRTFformat = false; ModelHelper.CaptureRequirement( 3118002, @"[In Appendix A: Product Behavior] Implementation does only support the message body which is always in the original format. &lt;3&gt; Section 2.2.3.1.1.1.1: In Exchange 2013, Exchange 2016, and Exchange 2019, the message body is always in the original format."); } if (requirementContainer.ContainsKey(2117002) && requirementContainer[2117002]) { // Identify whether message bodies in the compressed RTF format is or not. newMessageChange.IsRTFformat = true; // Because the BestBody flag of the CopyFlags field is not set before and the prior ROP is RopFastTransferSourceCopyMessages, so this requirement can be captured. ModelHelper.CaptureRequirement( 2117002, @"[In Appendix A: Product Behavior] <36> Section 3.2.5.8.1.3: Implementation does support the BestBody flag. If the BestBody flag of the CopyFlags field is not set, implementation does output message bodies in the compressed RTF (Microsoft Exchange Server 2007 and Exchange Server 2010 follow this behavior.)"); } if (requirementContainer.ContainsKey(3118003) && requirementContainer[3118003]) { // Identify whether message bodies in the compressed RTF format is or not. newMessageChange.IsRTFformat = true; // Because the BestBody flag of the CopyFlags field is not set before and the prior ROP is RopFastTransferSourceCopyMessages, so this requirement can be captured. ModelHelper.CaptureRequirement( 3118003, @"[In Appendix A: Product Behavior] Implementation does support this flag [BestBody flag] [in RopFastTransferSourceCopyTo ROP]. (<3> Section 2.2.3.1.1.1.1: Microsoft Exchange Server 2007 and 2010 follow this behavior.)"); } if (requirementContainer.ContainsKey(499001) && requirementContainer[499001]) { // Identify whether message bodies in the compressed RTF format is or not. newMessageChange.IsRTFformat = false; // Because the BestBody flag of the CopyFlags field is set before and the prior ROP is RopFastTransferSourceCopyMessages, so this requirement can be captured. ModelHelper.CaptureRequirement( 499001, @"[In Appendix A: Product Behavior] Implementation does only support the message body which is always in the original format. &lt;5&gt; Section 2.2.3.1.1.3.1: In Exchange 2013, Exchange 2016, and Exchange 2019, the message body is always in the original format."); } if (requirementContainer.ContainsKey(2182002) && requirementContainer[2182002]) { // Identify whether message bodies in the compressed RTF format is or not. newMessageChange.IsRTFformat = true; // Because the BestBody flag of the CopyFlags field is set before and the prior ROP is RopFastTransferSourceCopyMessages, so this requirement can be captured. ModelHelper.CaptureRequirement( 2182002, @"[In Appendix A: Product Behavior] Implementation does support BestBody flag [in RopSynchronizationConfigure ROP]. (<41> Section 3.2.5.9.1.1: Microsoft Exchange Server 2007 and Exchange Server 2010 follow this behavior.)"); } } } // Add new messagChange to ContentsSync. abstractFastTransferStream.AbstractContentsSync.MessageInfo = abstractFastTransferStream.AbstractContentsSync.MessageInfo.Add(newMessageChange); // Add message id to IdsetGiven of current download context. currentDownloadContext.UpdatedState.IdsetGiven = currentDownloadContext.UpdatedState.IdsetGiven.Add(tempMessage.MessageIdIndex); ModelHelper.CaptureRequirement( 2172, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the FAI flag of the SynchronizationFlags field is set, the server MUST download information about changes to FAI messages, as specified by the folderContents element in section 2.2.4.3.7."); } else if (!currentDownloadContext.UpdatedState.CnsetSeenFAI.Contains(tempMessage.ChangeNumberIndex)) { // The message change number is not in CnsetSeenFAI property. // Create a new message change. AbstractMessageChangeInfo newMessageChange = new AbstractMessageChangeInfo { MessageIdIndex = tempMessage.MessageIdIndex, IsMessageChangeFull = true }; // Set message id for new messageChange // The server don't include messagchangeFull in messageChange. ModelHelper.CaptureRequirement( 1137, @"[In messageChange Element] [A server MUST use the messageChangeFull element, instead of the messageChangePartial element, if any of the following are true:] The message is an FAI message."); if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.CN) == SynchronizationExtraFlag.CN) { // The server MUST include the PidTagChangeNumber property in the message change newMessageChange.IsPidTagChangeNumberExist = true; // Because the SynchronizationExtraFlag is CN and the SynchronizationExtraFlag only set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2196, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagChangeNumber property (section 2.2.1.2.3) in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is set."); } else { // The server don't include the PidTagChangeNumber property in the message change newMessageChange.IsPidTagChangeNumberExist = false; // Because the SynchronizationExtraFlag is not CN and the SynchronizationExtraFlag not only set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2197, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST NOT include the PidTagChangeNumber property in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is not set."); } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.Eid) == SynchronizationExtraFlag.Eid) { // The server MUST include the PidTagFolderId property in the messageChange. newMessageChange.IsPidTagMidExist = true; // Because the SynchronizationExtraFlag is EID and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement( 2191, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagFolderId property (section 2.2.1.2.2) in a folder change header if and only if the Eid flag of the SynchronizationExtraFlags field flag is set."); ModelHelper.CaptureRequirement( 2761, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMid property (section 2.2.1.2.1) in a message change header if and only if the Eid flag of the SynchronizationExtraFlags field is set."); } else { // The server MUST NOT include the PidTagMid property in the messageChange. newMessageChange.IsPidTagMidExist = false; // Because the SynchronizationExtraFlag is Eid and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement( 716002, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is Eid, the value is 0x00000001] The server does not include the PidTagMid (section 2.2.1.2.1) property in the message change header when the Eid flag of the SynchronizationExtraFlag field is not set."); } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.MessageSize) == SynchronizationExtraFlag.MessageSize) { ModelHelper.CaptureRequirement( 2195, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMessageSize property (section 2.2.1.6) in the message change header if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); // The server MUST include the PidTagMessageSize property in the message change. newMessageChange.IsPidTagMessageSizeExist = true; // Because the SynchronizationExtraFlag is MessageSize and the SynchronizationExtraFlag only set MessageSize. So can cover requirement here. ModelHelper.CaptureRequirement( 1365, @"[In messageChangeHeader Element] [PidTagMessageSize,Conditional] PidTagMessageSize MUST be present if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); } else { newMessageChange.IsPidTagMessageSizeExist = false; // When the MessageSize flag of the SynchronizationExtraFlag field is not set and the server does not include the PidTagMessageSize property (section 2.2.1.6) in the message change header this requirement captured. ModelHelper.CaptureRequirement( 718001, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is MessageSize, the value is 0x00000002] The server does not include the PidTagMessageSize property (section 2.2.1.6) in the message change header if the MessageSize flag of the SynchronizationExtraFlag field is not set."); } if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.Progress) == SynchronizationFlag.Progress) { // The server include ProgressPerMessag in messageChange. newMessageChange.IsProgressPerMessagePresent = true; // The message is a FAl Message. newMessageChange.FollowedFAIMessage = true; // Because the SynchronizationExtraFlag is Progress and the SynchronizationExtraFlag only set Progress. So can cover requirement here. ModelHelper.CaptureRequirement( 1171, @"[In progressPerMessage Element]MUST be present if and only if the progessTotal element, as specified in section 2.2.4.3.18, was output within the same ancestor contentsSync element, as specified in section 2.2.4.3.2."); ModelHelper.CaptureRequirement(1382, "[In progressPerMessage Element] [[PtypBoolean] 0x0000000B] [The server returns] TRUE (0x01 or any non-zero value) if the Message object that follows is FAI."); } else { // The server don't include ProgressPerMessag in messageChange. newMessageChange.IsProgressPerMessagePresent = false; ModelHelper.CaptureRequirement( 1172, @"[In progressPerMessage Element] [ProgressPerMessage Element] MUST NOT be present if the Progress flag of the SynchronizationFlags field was not set when configuring the synchronization download operation."); } if (!messagechangePartail && (requirementContainer.ContainsKey(2172) && !requirementContainer[2172])) { abstractFastTransferStream.AbstractContentsSync.MessageInfo = new Set<AbstractMessageChangeInfo>(); } else { // Add new messagChange to ContentsSync. abstractFastTransferStream.AbstractContentsSync.MessageInfo = abstractFastTransferStream.AbstractContentsSync.MessageInfo.Add(newMessageChange); ModelHelper.CaptureRequirement( 2172, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the FAI flag of the SynchronizationFlags field is set, the server MUST download information about changes to FAI messages, as specified by the folderContents element in section 2.2.4.3.7."); } } } else { // Because SynchronizationFlag FAI flag is not set and no have download context add to abstractFastTransferStream. So can cover this requirement here. ModelHelper.CaptureRequirement( 2173, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the FAI flag of the SynchronizationFlags field is not set, the server MUST NOT download information about changes to FAI messages, as specified by the folderContents element in section 2.2.4.3.7."); } } else { // The found message is Normal message. // SynchronizationFlag is Normal in download context. if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.Normal) == SynchronizationFlag.Normal) { // The message id not in IdsetGiven of download context. if (!currentDownloadContext.UpdatedState.IdsetGiven.Contains(tempMessage.MessageIdIndex)) { // Create a newMessageChange. AbstractMessageChangeInfo newMessageChange = new AbstractMessageChangeInfo { MessageIdIndex = tempMessage.MessageIdIndex, IsMessageChangeFull = true }; // Set message id for newMessageChange. // This messagechangeFull is in newMessageChange. // Because the message object include MId and it is initial ICS state through set sequence. ModelHelper.CaptureRequirement(1136, "[In messageChange Element] [A server MUST use the messageChangeFull element, instead of the messageChangePartial element, if any of the following are true:] The MID structure ([MS-OXCDATA] section 2.2.1.2) of the message to be output is not in the MetaTagIdsetGiven property (section 2.2.1.1.1) from the initial ICS state."); if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.CN) == SynchronizationExtraFlag.CN) { // The server MUST include the PidTagChangeNumber property in the messageChange. newMessageChange.IsPidTagChangeNumberExist = true; // Because the SynchronizationExtraFlag is CN and the SynchronizationExtraFlag only set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2196, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagChangeNumber property (section 2.2.1.2.3) in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is set."); } else { // The server don't include the PidTagChangeNumber property in the messageChange. newMessageChange.IsPidTagChangeNumberExist = false; // Because the SynchronizationExtraFlag is not CN and the SynchronizationExtraFlag not only set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2197, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST NOT include the PidTagChangeNumber property in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is not set."); } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.Eid) == SynchronizationExtraFlag.Eid) { // The server MUST include the PidTagFolderId property in the messageChange. newMessageChange.IsPidTagMidExist = true; // Because the SynchronizationExtraFlag is EID and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement( 2191, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagFolderId property (section 2.2.1.2.2) in a folder change header if and only if the Eid flag of the SynchronizationExtraFlags field flag is set."); ModelHelper.CaptureRequirement( 2761, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMid property (section 2.2.1.2.1) in a message change header if and only if the Eid flag of the SynchronizationExtraFlags field is set."); if (currentDownloadContext.SynchronizationType == SynchronizationTypes.Contents) { ModelHelper.CaptureRequirement( 3501, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMid property in the message change header if the SynchronizationType field is set Contents (0x01), as specified in section 2.2.3.2.1.1.1."); } } else { // The server don't include the PidTagFolderId property in the messageChange. newMessageChange.IsPidTagMidExist = false; // Because the SynchronizationExtraFlag is Eid and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement( 716002, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is Eid, the value is 0x00000001] The server does not include the PidTagMid (section 2.2.1.2.1) property in the message change header when the Eid flag of the SynchronizationExtraFlag field is not set."); } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.MessageSize) == SynchronizationExtraFlag.MessageSize) { ModelHelper.CaptureRequirement( 2195, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMessageSize property (section 2.2.1.6) in the message change header if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); // The server MUST include the PidTagMessageSize property in the messageChange. newMessageChange.IsPidTagMessageSizeExist = true; // Because the SynchronizationExtraFlag is MessageSize and the SynchronizationExtraFlag only set MessageSize. So can cover requirement here. ModelHelper.CaptureRequirement( 1365, @"[In messageChangeHeader Element] [PidTagMessageSize,Conditional] PidTagMessageSize MUST be present if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); } else { newMessageChange.IsPidTagMessageSizeExist = false; ModelHelper.CaptureRequirement( 718001, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is MessageSize, the value is 0x00000002] The server does not include the PidTagMessageSize property (section 2.2.1.6) in the message change header if the MessageSize flag of the SynchronizationExtraFlag field is not set."); } if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.Progress) == SynchronizationFlag.Progress) { // The server include the progessTotal in the messageChange. newMessageChange.IsProgressPerMessagePresent = true; // The message object is normal message. newMessageChange.FollowedFAIMessage = false; // Because the SynchronizationExtraFlag is Progress and the SynchronizationExtraFlag only set Progress. So can cover requirement here. ModelHelper.CaptureRequirement( 1171, @"[In progressPerMessage Element]MUST be present if and only if the progessTotal element, as specified in section 2.2.4.3.18, was output within the same ancestor contentsSync element, as specified in section 2.2.4.3.2."); ModelHelper.CaptureRequirement( 1383, @"[In progressPerMessage Element] [[PtypBoolean] 0x0000000B] otherwise[if the Message object that follows is not FAI] ,[the server returns] FALSE (0x00)."); } else { // The server don't include the progessTotal in the messageChange. newMessageChange.IsProgressPerMessagePresent = false; ModelHelper.CaptureRequirement( 1172, @"[In progressPerMessage Element] [ProgressPerMessage Element] MUST NOT be present if the Progress flag of the SynchronizationFlags field was not set when configuring the synchronization download operation."); } // Add new messageChange to ContentsSync. abstractFastTransferStream.AbstractContentsSync.MessageInfo = abstractFastTransferStream.AbstractContentsSync.MessageInfo.Add(newMessageChange); // Add messageId to IdsetGiven of download context. currentDownloadContext.UpdatedState.IdsetGiven = currentDownloadContext.UpdatedState.IdsetGiven.Add(tempMessage.MessageIdIndex); // Because SynchronizationFlag is Normal ModelHelper.CaptureRequirement( 2174, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the Normal flag of the SynchronizationFlags flag is set, the server MUST download information about changes to normal messages, as specified in section 2.2.4.3.11."); } else if (!currentDownloadContext.UpdatedState.CnsetSeen.Contains(tempMessage.ChangeNumberIndex)) { // The message change number is not in CnsetSeenFAI property. // Create a newMessageChange. AbstractMessageChangeInfo newMessageChange = new AbstractMessageChangeInfo { // Set messageId for newMessageChange. MessageIdIndex = tempMessage.MessageIdIndex }; if ((currentDownloadContext.Sendoptions & SendOptionAlls.PartialItem) != SendOptionAlls.PartialItem) { // The server include MessageChangeFull in messageChange. newMessageChange.IsMessageChangeFull = true; ModelHelper.CaptureRequirement( 1135, @"[In messageChange Element]A server MUST use the messageChangeFull element, instead of the messageChangePartial element, if any of the following are true:The PartialItem flag of the SendOptions field was not set, as specified in section 2.2.3.2.1.1."); } else { messagechangePartail = false; // The server include MessageChangePartial in messageChange. newMessageChange.IsMessageChangeFull = false; } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.CN) == SynchronizationExtraFlag.CN) { // The server include the PidTagChangeNumber property in the messageChange. newMessageChange.IsPidTagChangeNumberExist = true; // Because the SynchronizationExtraFlag is CN and the SynchronizationExtraFlag only set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2196, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagChangeNumber property (section 2.2.1.2.3) in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is set."); } else { // The server don't include the PidTagChangeNumber property in the messageChange. newMessageChange.IsPidTagChangeNumberExist = false; // Because the SynchronizationExtraFlag is not CN and the SynchronizationExtraFlag not only set CN. So can cover requirement here. ModelHelper.CaptureRequirement( 2197, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST NOT include the PidTagChangeNumber property in the message change header if and only if the CN flag of the SynchronizationExtraFlags field is not set."); } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.Eid) == SynchronizationExtraFlag.Eid) { // The server include the PidTagMid property in messageChange. newMessageChange.IsPidTagMidExist = true; // Because the SynchronizationExtraFlag is EID and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement( 2191, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagFolderId property (section 2.2.1.2.2) in a folder change header if and only if the Eid flag of the SynchronizationExtraFlags field flag is set."); ModelHelper.CaptureRequirement( 2761, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMid property (section 2.2.1.2.1) in a message change header if and only if the Eid flag of the SynchronizationExtraFlags field is set."); } else { // The server don't include the PidTagMid property in messageChange. newMessageChange.IsPidTagMidExist = false; // Because the SynchronizationExtraFlag is Eid and the SynchronizationExtraFlag only set Eid. So can cover requirement here. ModelHelper.CaptureRequirement( 716002, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is Eid, the value is 0x00000001] The server does not include the PidTagMid (section 2.2.1.2.1) property in the message change header when the Eid flag of the SynchronizationExtraFlag field is not set."); } if ((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.MessageSize) == SynchronizationExtraFlag.MessageSize) { // Because the SynchronizationExtraFlag is MessageSize and the SynchronizationExtraFlag only set MessageSize. So can cover requirement here. ModelHelper.CaptureRequirement( 2195, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] The server MUST include the PidTagMessageSize property (section 2.2.1.6) in the message change header if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); // The server include the PidTagMessageSize property in messageChange. newMessageChange.IsPidTagMessageSizeExist = true; ModelHelper.CaptureRequirement( 1365, @"[In messageChangeHeader Element] [PidTagMessageSize,Conditional] PidTagMessageSize MUST be present if and only if the MessageSize flag of the SynchronizationExtraFlags field is set."); } else { newMessageChange.IsPidTagMessageSizeExist = false; ModelHelper.CaptureRequirement( 718001, @"[In RopSynchronizationConfigure ROP Request Buffer] [SynchronizationExtraFlags, When the flag name is MessageSize, the value is 0x00000002] The server does not include the PidTagMessageSize property (section 2.2.1.6) in the message change header if the MessageSize flag of the SynchronizationExtraFlag field is not set."); } if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.Progress) == SynchronizationFlag.Progress) { // The server include ProgressPerMessage in messageChange. newMessageChange.IsProgressPerMessagePresent = true; // The message object is a normal message. newMessageChange.FollowedFAIMessage = false; // Because the SynchronizationExtraFlag is MessageSize and the SynchronizationExtraFlag only set MessageSize. So can cover requirement here. ModelHelper.CaptureRequirement( 1171, @"[In progressPerMessage Element]MUST be present if and only if the progessTotal element, as specified in section 2.2.4.3.18, was output within the same ancestor contentsSync element, as specified in section 2.2.4.3.2."); ModelHelper.CaptureRequirement( 1383, @"[In progressPerMessage Element] [[PtypBoolean] 0x0000000B] otherwise[if the Message object that follows is not FAI] ,[the server returns] FALSE (0x00)."); } else { // The server don't include ProgressPerMessage in messageChange. newMessageChange.IsProgressPerMessagePresent = false; ModelHelper.CaptureRequirement( 1172, @"[In progressPerMessage Element] [ProgressPerMessage Element] MUST NOT be present if the Progress flag of the SynchronizationFlags field was not set when configuring the synchronization download operation."); } // Add new messageChange to ContentsSync. abstractFastTransferStream.AbstractContentsSync.MessageInfo = abstractFastTransferStream.AbstractContentsSync.MessageInfo.Add(newMessageChange); // Because the MessageChange.followedFAIMessage default expect value is false and it is a normal messages. ModelHelper.CaptureRequirement( 2174, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the Normal flag of the SynchronizationFlags flag is set, the server MUST download information about changes to normal messages, as specified in section 2.2.4.3.11."); } } else { // Because the MessageChange.followedFAIMessage default expect value is false and it is a normal messages. ModelHelper.CaptureRequirement( 2175, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the Normal flag of the SynchronizationFlags field is not set, the server MUST NOT download information about changes to normal messages, as specified in section 2.2.4.3.11."); } } } } #endregion if (((currentDownloadContext.SynchronizationExtraflag & SynchronizationExtraFlag.OrderByDeliveryTime) == SynchronizationExtraFlag.OrderByDeliveryTime) && abstractFastTransferStream.AbstractContentsSync.MessageInfo.Count >= 2) { // The server MUST sort messages by the value of their PidTagMessageDeliveryTime property when generating a sequence of messageChange. abstractFastTransferStream.AbstractContentsSync.IsSortByMessageDeliveryTime = true; ModelHelper.CaptureRequirement( 2198, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] If the OrderByDeliveryTime flag of the SynchronizationExtraFlags field is set, the server MUST sort messages by the value of their PidTagMessageDeliveryTime property ([MS-OXOMSG] section 2.2.3.9) when generating a sequence of messageChange elements for the FastTransfer stream, as specified in section 2.2.4.2."); // The server MUST sort messages by the value of their PidTagLastModificationTime property when generating a sequence of messageChange. abstractFastTransferStream.AbstractContentsSync.IsSortByLastModificationTime = true; ModelHelper.CaptureRequirement( 2199, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationExtraFlags Constraints] If the OrderByDeliveryTime flag of the SynchronizationExtraFlags field is set, the server MUST sort messages by the PidTagLastModificationTime property ([MS-OXPROPS] section 2.764) if the former[PidTagMessageDeliveryTime] is missing, when generating a sequence of messageChange elements for the FastTransfer stream, as specified in section 2.2.4.2."); } // Search the message in MessageContainer. foreach (AbstractMessage tempMessage in currentConnection.MessageContainer) { if (tempMessage.FolderIdIndex == currentFolder.FolderIdIndex) { // Identify whether the readStateChange is or not included in messageContent. if (!currentDownloadContext.UpdatedState.CnsetRead.Contains(tempMessage.ReadStateChangeNumberIndex)) { if (tempMessage.ReadStateChangeNumberIndex != 0) { if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.ReadState) != SynchronizationFlag.ReadState) { // Download information about changes to the read state of messages. abstractFastTransferStream.AbstractContentsSync.IsReadStateChangesExist = false; ModelHelper.CaptureRequirement( 2171, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the ReadState flag of the SynchronizationFlags field is not set, the server MUST NOT download information about changes to the read state of messages, as specified in section 2.2.4.3.22."); // Download information about changes to the read state of messages. if (requirementContainer.ContainsKey(1193) && requirementContainer[1193]) { abstractFastTransferStream.AbstractContentsSync.IsReadStateChangesExist = false; ModelHelper.CaptureRequirement( 1193, @"[In readStateChanges Element] Implementation does not present this element if the ReadState flag of the SynchronizationFlag field was not set when configuring the synchronization download operation. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } } if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.ReadState) == SynchronizationFlag.ReadState) { if (requirementContainer.Keys.Contains(2665) && requirementContainer[2665]) { // Assign a new changeNumber for CnsetReadProperty. abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetReadPropertyChangeNumber = true; // Because identify the read state of a message changes by(currentMessage.IsRead != IReadstatus) and get new change number. So can cover this requirement here. ModelHelper.CaptureRequirement(2665, "[In Tracking Read State Changes] Implementation does assign a new value to the separate change number(the read state change number) on the message, whenever the read state of a message changes on the server. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } abstractFastTransferStream.AbstractContentsSync.IsReadStateChangesExist = true; // Assign a new changeNumber for CnsetReadProperty. abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetReadPropertyChangeNumber = true; ModelHelper.CaptureRequirement( 2087, "[In Tracking Read State Changes] An IDSET structure of change numbers associated with message read state transitions, either from read to unread, or unread to read (as determined by the PidTagMessageFlags property in [MS-OXCMSG] section 2.2.1.6) are included in the MetaTagCnsetRead property (section 2.2.1.1.4), which is part of the ICS state and is never directly set on any objects."); ModelHelper.CaptureRequirement( 3315, "[In readStateChanges Element] This element MUST be present if there are changes to the read state of messages."); } } if (tempMessage.ReadStateChangeNumberIndex == 0) { if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.ReadState) == SynchronizationFlag.ReadState) { // Download information about changes to the read state of messages. abstractFastTransferStream.AbstractContentsSync.IsReadStateChangesExist = false; // Assign a new changeNumber for CnsetReadProperty. abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetReadPropertyChangeNumber = true; ModelHelper.CaptureRequirement( 2170, @"[In Receiving a RopSynchronizationConfigure ROP Request] [SynchronizationType Constraints] If the ReadState flag of the SynchronizationFlags field is set, the server MUST also download information about changes to the read state of messages, as specified in section 2.2.4.3.22."); ModelHelper.CaptureRequirement( 2048, @"[In Determining What Differences To Download] [For every object in the synchronization scope, servers MUST do the following:] If the ReadState flag of the SynchronizationFlags field is set, include the readStateChanges element, as specified in section 2.2.4.3.22, for messages that: Do not have their change numbers for read and unread state in the MetaTagCnsetRead property (section 2.2.1.1.4) And are not FAI messages and have not had change information downloaded for them in this session."); } } } // The message change number is not in CnsetSeenFAI property. if (!currentDownloadContext.UpdatedState.CnsetSeenFAI.Contains(tempMessage.ChangeNumberIndex)) { // The message is FAI message. if (tempMessage.IsFAImessage) { if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.FAI) == SynchronizationFlag.FAI) { ModelHelper.CaptureRequirement( 2044, @"[In Determining What Differences To Download] [For every object in the synchronization scope, servers MUST do the following:] [Include the following syntactical elements in the FastTransfer stream of the OutputServerObject field of the FastTransfer download ROPs, as specified in section 2.2.3.1.1, if one of the following applies:] Include the messageChangeFull element, as specified in section 2.2.4.3.13, if the object specified by the InputServerObject field is an FAI message, meaning the PidTagAssociated property (section 2.2.1.5) is set to TRUE And the FAI flag of the SynchronizationFlag field was set And the change number is not included in the value of the MetaTagCnsetSeenFAI property (section 2.2.1.1.3)."); // Add message changeNumber to CnsetSeenFAI of current download context. currentDownloadContext.UpdatedState.CnsetSeenFAI = currentDownloadContext.UpdatedState.CnsetSeenFAI.Add(tempMessage.ChangeNumberIndex); if (priorUploadOperation == MS_OXCFXICS.PriorOperation.RopSynchronizationImportMessageMove) { // Assign a new changeNumber. abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetSeenFAIPropertyChangeNumber = true; ModelHelper.CaptureRequirement( 2247, @"[In Receiving a RopSynchronizationImportMessageMove Request] Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated to include change numbers of messages in the destination folder in or MetaTagCnsetSeenFAI (section 2.2.1.1.3) property, when the message is an FAI message."); } // Assign a new changeNumber. abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetSeenFAIPropertyChangeNumber = true; if (requirementContainer.ContainsKey(218300301) && requirementContainer[218300301]) { abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetSeenFAIPropertyChangeNumber = false; } // Because this ROP is called after successful import of a new or changed object using ICS upload and the server represent the imported version in the MetaTagCnsetSeen property for FAI message, this requirement is captured. ModelHelper.CaptureRequirement( 190701, @"[In Identifying Objects and Maintaining Change Numbers] Upon successful import of a new or changed object using ICS upload, the server MUST do the following when receiving RopSaveChangesMessage ROP: This is necessary because the server MUST be able to represent the imported version in the MetaTagCnsetSeenFAI (section 2.2.1.1.3) property for FAI message."); } } else { // SynchronizationFlag is Normal of current Download Context. if ((currentDownloadContext.Synchronizationflag & SynchronizationFlag.Normal) == SynchronizationFlag.Normal) { if (!currentDownloadContext.UpdatedState.CnsetSeen.Contains(tempMessage.ChangeNumberIndex)) { // Add Message changeNumber to CnsetSeen. currentDownloadContext.UpdatedState.CnsetSeen = currentDownloadContext.UpdatedState.CnsetSeen.Add(tempMessage.ChangeNumberIndex); ModelHelper.CaptureRequirement( 2043, @"[In Determining What Differences To Download] [For every object in the synchronization scope, servers MUST do the following:] [Include the following syntactical elements in the FastTransfer stream of the OutputServerObject field of the FastTransfer download ROPs, as specified in section 2.2.3.1.1, if one of the following applies:] Include the messageChange element, as specified in section 2.2.4.3.11, if the object specified by the InputServerObject field is a normal message And the Normal flag of the SynchronizationFlags field was set, as specified in section 2.2.3.2.1.1.1; And the change number is not included in the value of the MetaTagCnsetSeen property."); } else if (abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetReadPropertyChangeNumber) { if (requirementContainer.ContainsKey(2666) && requirementContainer[2666]) { abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetSeenPropertyChangeNumber = false; ModelHelper.CaptureRequirement( 2666, @"[In Tracking Read State Changes] Implementation does not modify the change number of the message unless other changes to a message were made at the same time. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } } // Assign a new changeNumber. abstractFastTransferStream.AbstractContentsSync.FinalICSState.IsNewCnsetSeenPropertyChangeNumber = true; ModelHelper.CaptureRequirement( 2246, @"[In Receiving a RopSynchronizationImportMessageMove Request]Upon successful completion of this ROP, the ICS state on the synchronization context MUST be updated to include change numbers of messages in the destination folder in the MetaTagCnsetSeen (section 2.2.1.1.2) when the message is a normal message."); // Because this ROP is called after successful import of a new or changed object using ICS upload and the server represent the imported version in the MetaTagCnsetSeen property for normal message, this requirement is captured. ModelHelper.CaptureRequirement( 1907, @"[In Identifying Objects and Maintaining Change Numbers] Upon successful import of a new or changed object using ICS upload, the server MUST do the following when receiving RopSaveChangesMessage ROP: This is necessary because the server MUST be able to represent the imported version in the MetaTagCnsetSeen (section 2.2.1.1.2) property for normal message."); } } } } } // Set ContentsSync IdSetGiven value with IdsetGiven value of current download context. abstractFastTransferStream.AbstractContentsSync.FinalICSState.IdSetGiven = currentDownloadContext.UpdatedState.IdsetGiven; // Add ICS State to ICSStateContainer. currentFolder.ICSStateContainer.Add(abstractFastTransferStream.AbstractContentsSync.FinalICSState.AbstractICSStateIndex, currentDownloadContext.UpdatedState); // Update the FolderContainer. currentConnection.FolderContainer = currentConnection.FolderContainer.Update(currentFolderIndex, currentFolder); connections[serverId] = currentConnection; break; } // In case of the FastTransferStreamType of download context include folderContent. case FastTransferStreamType.folderContent: { if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyTo && currentDownloadContext.ObjectType == ObjectType.Folder) { ModelHelper.CaptureRequirement( 3324, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyTo, ROP request buffer field conditions is The InputServerObject field is a Folder object<25>, Root element in the produced FastTransfer stream is folderContent."); } if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyProperties && currentDownloadContext.ObjectType == ObjectType.Folder) { ModelHelper.CaptureRequirement( 3325, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyProperties, ROP request buffer field conditions is The InputServerObject field is a Folder object<25>, Root element in the produced FastTransfer stream is folderContent."); } if (priorOperation == PriorOperation.RopFastTransferDestinationConfigure && currentDownloadContext.ObjectType == ObjectType.Folder && sourOperation == SourceOperation.CopyProperties) { ModelHelper.CaptureRequirement( 598, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyProperties, if the value of InputServerObject field is a Folder Object, Root element in FastTransfer stream is folderContent element."); } if (priorOperation == PriorOperation.RopFastTransferDestinationConfigure && currentDownloadContext.ObjectType == ObjectType.Folder && sourOperation == SourceOperation.CopyTo) { ModelHelper.CaptureRequirement( 595, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyTo, if the value of the InputServerObject field is a Folder Object, Root element in FastTransfer stream is folderContent element."); } // Initialize the entity variable abstractFastTransferStream.AbstractFolderContent = new AbstractFolderContent { AbsFolderMessage = new AbstractFolderMessage() }; bool isSubFolderExist = false; AbstractFolder subFolder = new AbstractFolder(); // Search the folder container to find if the download folder contains subFolder foreach (AbstractFolder tempSubFolder in currentConnection.FolderContainer) { if (currentFolder.SubFolderIds.Contains(tempSubFolder.FolderIdIndex)) { isSubFolderExist = true; subFolder = tempSubFolder; break; } } // The downLaod folder's subFolder exist if (isSubFolderExist) { if (subFolder.FolderPermission == PermissionLevels.None && (currentDownloadContext.CopyToCopyFlag == CopyToCopyFlags.Move || currentDownloadContext.CopyPropertiesCopyFlag == CopyPropertiesCopyFlags.Move)) { abstractFastTransferStream.AbstractFolderContent.IsNoPermissionObjNotOut = true; if (requirementContainer.ContainsKey(2667) && requirementContainer[2667]) { ModelHelper.CaptureRequirement(2667, @"[In Receiving a RopFastTransferSourceCopyTo ROP Request] Implementation does not output any objects in a FastTransfer stream that the client does not have permissions to delete, if the Move flag of the CopyFlags field is set. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } if (requirementContainer.ContainsKey(2669) && requirementContainer[2669]) { ModelHelper.CaptureRequirement( 2669, @"[In Receiving a RopFastTransferSourceCopyProperties Request] Implementation does not output any objects in a FastTransfer stream that the client does not have permissions to delete, if the Move flag of the CopyFlags field is specified for a download operation. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } } } else if (subFolder.FolderPermission == PermissionLevels.FolderVisible && currentDownloadContext.CopyToCopyFlag == CopyToCopyFlags.Move) { if (requirementContainer.ContainsKey(118201) && requirementContainer[118201]) { abstractFastTransferStream.AbstractFolderContent.IsPidTagEcWarningOut = true; } abstractFastTransferStream.AbstractFolderContent.AbsFolderMessage.MessageList.AbsMessage.AbsMessageContent.IsNoPermissionMessageNotOut = true; } // Search the currentDownloadContext.property to find if the specific property is required download foreach (string propStr in currentDownloadContext.Property) { if (isSubFolderExist && subFolder.FolderPermission != PermissionLevels.None) { // PidTagContainerHierarchy property is required to download if (propStr == "PidTagContainerHierarchy") { // CopyFolder operation will copy subFolder IFF CopySubfolders copyFlag is set if (((currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyFolder && currentDownloadContext.CopyFolderCopyFlag == CopyFolderCopyFlags.CopySubfolders) || currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyProperties) && currentConnection.LogonFolderType != LogonFlags.Ghosted) { if (currentConnection.LogonFolderType != LogonFlags.Ghosted || (requirementContainer.ContainsKey(1113) && requirementContainer[1113] && currentConnection.LogonFolderType == LogonFlags.Ghosted)) { abstractFastTransferStream.AbstractFolderContent.IsSubFolderPrecededByPidTagFXDelProp = true; ModelHelper.CaptureRequirement( 1113, @"[In folderContent Element] Under conditions specified in section 3.2.5.10, the PidTagContainerHierarchy property ([MS-OXPROPS] section 2.645) included in a subFolder element MUST be preceded by a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1)."); } } } else { if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo) { if (currentConnection.LogonFolderType != LogonFlags.Ghosted || (requirementContainer.ContainsKey(1113) && requirementContainer[1113] && currentConnection.LogonFolderType == LogonFlags.Ghosted)) { // The FastTransferOperation is FastTransferSourceCopyTo and the properties that not required in the propertyTag is download abstractFastTransferStream.AbstractFolderContent.IsSubFolderPrecededByPidTagFXDelProp = true; ModelHelper.CaptureRequirement( 1113, @"[In folderContent Element] Under conditions specified in section 3.2.5.10, the PidTagContainerHierarchy property ([MS-OXPROPS] section 2.645) included in a subFolder element MUST be preceded by a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1)."); } } } } if (currentConnection.LogonFolderType != LogonFlags.Ghosted) { // PidTagFolderAssociatedContents property is required to download if (propStr == "PidTagFolderAssociatedContents") { if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyProperties) { // The FastTransferOperation is FastTransferSourceCopyProperties and the properties that required in the propertyTag is download abstractFastTransferStream.AbstractFolderContent.AbsFolderMessage.IsFolderMessagesPrecededByPidTagFXDelProp = true; ModelHelper.CaptureRequirement( 2620, @"[In folderMessages Element] Under conditions specified in section 3.2.5.10, when included in the folderMessages element, the PidTagFolderAssociatedContents ([MS-OXPROPS] section 2.699) and PidTagContainerContents ([MS-OXPROPS] section 2.637) properties MUST be preceded by a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1)."); } } else { if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo) { // The FastTransferOperation is FastTransferSourceCopyTo and the properties that not required in the propertyTag is download abstractFastTransferStream.AbstractFolderContent.AbsFolderMessage.IsFolderMessagesPrecededByPidTagFXDelProp = true; ModelHelper.CaptureRequirement( 2620, @"[In folderMessages Element] Under conditions specified in section 3.2.5.10, when included in the folderMessages element, the PidTagFolderAssociatedContents ([MS-OXPROPS] section 2.699) and PidTagContainerContents ([MS-OXPROPS] section 2.637) properties MUST be preceded by a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1)."); } } // PidTagContainerContents property is required to download if (propStr == "PidTagContainerContents") { if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyProperties) { // The FastTransferOperation is FastTransferSourceCopyProperties and the properties that required in the propertyTag is download abstractFastTransferStream.AbstractFolderContent.AbsFolderMessage.IsFolderMessagesPrecededByPidTagFXDelProp = true; } } else { if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo) { // The FastTransferOperation is FastTransferSourceCopyTo and the properties that not required in the propertyTag is download abstractFastTransferStream.AbstractFolderContent.AbsFolderMessage.IsFolderMessagesPrecededByPidTagFXDelProp = true; } } } } break; } // In case of the FastTransferStreamType of download context include messageContent. case FastTransferStreamType.MessageContent: { if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyTo && currentDownloadContext.ObjectType == ObjectType.Message) { ModelHelper.CaptureRequirement( 3326, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyTo, ROP request buffer field conditions is The InputServerObject field is a Message object, Root element in the produced FastTransfer stream is messageContent."); } if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyProperties && currentDownloadContext.ObjectType == ObjectType.Message) { ModelHelper.CaptureRequirement( 3327, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyProperties, ROP request buffer field conditions is The InputServerObject field is a Message object, Root element in the produced FastTransfer stream is messageContent."); } if (priorOperation == PriorOperation.RopFastTransferDestinationConfigure && currentDownloadContext.ObjectType == ObjectType.Message && sourOperation == SourceOperation.CopyProperties) { ModelHelper.CaptureRequirement( 596, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyProperties, if the value of the InputServerObject field is a Message object, Root element in FastTransfer stream is messageContent element."); } if (priorOperation == PriorOperation.RopFastTransferDestinationConfigure && currentDownloadContext.ObjectType == ObjectType.Message && sourOperation == SourceOperation.CopyTo) { ModelHelper.CaptureRequirement( 599, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyTo, if the value of the InputServerObject field is a Message object, Root element in FastTransfer stream is messageContent element."); } // Initialize the entity variable abstractFastTransferStream.AbstractMessageContent = new AbstractMessageContent { AbsMessageChildren = new AbstractMessageChildren() }; AbstractFolder messageParentFolder = new AbstractFolder(); // Search the MessagecCntianer to find the downLaodMessage foreach (AbstractMessage cumessage in currentConnection.MessageContainer) { if (cumessage.MessageHandleIndex == currentDownloadContext.RelatedObjectHandleIndex) { foreach (AbstractFolder cufolder in currentConnection.FolderContainer) { if (cufolder.FolderHandleIndex == cumessage.FolderHandleIndex) { messageParentFolder = cufolder; break; } } break; } } if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyTo) { if ((currentDownloadContext.CopyToCopyFlag & CopyToCopyFlags.BestBody) == CopyToCopyFlags.BestBody) { if (requirementContainer.ContainsKey(211501) && requirementContainer[211501]) { abstractFastTransferStream.AbstractMessageContent.IsRTFFormat = false; ModelHelper.CaptureRequirement(211501, @"[In Receiving a RopFastTransferSourceCopyTo ROP Request] Implementation does output the message body, and the body of the Embedded Message object, in their original format, if the BestBody flag of the CopyFlags field is set. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } if (requirementContainer.ContainsKey(3118003) && requirementContainer[3118003]) { abstractFastTransferStream.AbstractMessageContent.IsRTFFormat = false; ModelHelper.CaptureRequirement(3118003, @"[In Appendix A: Product Behavior] Implementation does support this flag [BestBody flag] [in RopFastTransferSourceCopyTo ROP]. (<3> Section 2.2.3.1.1.1.1: Microsoft Exchange Server 2007 and 2010 follow this behavior.)"); } } } #region Verify Requirements about Sendoptions if ((currentDownloadContext.Sendoptions & SendOptionAlls.UseCpid) == SendOptionAlls.UseCpid && connections.Count > 1) { if (currentDownloadContext.Sendoptions == SendOptionAlls.UseCpid) { abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicodeCodePage = true; ModelHelper.CaptureRequirement( 3453, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When UseCpid only, if the properties are stored in Unicode on the server, the server MUST return the properties using the Unicode code page (code page property type 0x84B0)."); if (currentDownloadContext.RelatedFastTransferOperation != EnumFastTransferOperation.FastTransferSourceCopyProperties) { if (requirementContainer.ContainsKey(3454) && requirementContainer[3454]) { abstractFastTransferStream.AbstractMessageContent.StringPropertiesInOtherCodePage = true; ModelHelper.CaptureRequirement( 3454, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When UseCpid only, otherwise[the properties are not stored in Unicode on the server] the server MUST send the string using the code page property type of the code page in which the property is stored on the server."); } } ModelHelper.CaptureRequirement( 3452, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When UseCpid only, String properties MUST be output using code page property types, as specified in section 2.2.4.1.1.1."); } else if (currentDownloadContext.Sendoptions == (SendOptionAlls.Unicode | SendOptionAlls.UseCpid)) { abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicodeCodePage = true; ModelHelper.CaptureRequirement( 3457, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When UseCpid and Unicode, If string properties are stored in Unicode on the server, the server MUST return the properties using the Unicode code page (code page property type 0x84B0)."); if (currentDownloadContext.RelatedFastTransferOperation != EnumFastTransferOperation.FastTransferSourceCopyProperties) { if (requirementContainer.ContainsKey(3454) && requirementContainer[3454]) { abstractFastTransferStream.AbstractMessageContent.StringPropertiesInOtherCodePage = true; ModelHelper.CaptureRequirement( 3780, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] UseCpid and Unicode: If string properties are not stored in Unicode on the server, the server MUST send the string using the code page property type of the code page in which the property is stored on the server."); } } ModelHelper.CaptureRequirement( 3456, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When UseCpid and Unicode, String properties MUST be output using code page property types, as specified in section 2.2.4.1.1.1. "); } else if (currentDownloadContext.Sendoptions == (SendOptionAlls.UseCpid | SendOptionAlls.ForceUnicode)) { abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicodeCodePage = true; ModelHelper.CaptureRequirement( 3782, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] UseCpid and ForceUnicode: String properties MUST be output using the Unicode code page (code page property type 0x84B0)."); } else if (currentDownloadContext.Sendoptions == (SendOptionAlls.UseCpid | SendOptionAlls.ForceUnicode | SendOptionAlls.Unicode)) { abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicodeCodePage = true; ModelHelper.CaptureRequirement( 3459, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] WhenUseCpid, Unicode, and ForceUnicode, The combination of the UseCpid and Unicode flags is the ForUpload flag. String properties MUST be output using the Unicode code page (code page property type 0x84B0)."); } } else { if (currentDownloadContext.Sendoptions == SendOptionAlls.ForceUnicode) { // The String properties is saved in the server using unicode format in this test environment ,so the string properties must out in Unicode format abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicode = true; ModelHelper.CaptureRequirement( 3451, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When ForceUnicode only, String properties MUST be output in Unicode with a property type of PtypUnicode."); } else if (((currentDownloadContext.Sendoptions & SendOptionAlls.Unicode) != SendOptionAlls.Unicode) && (currentDownloadContext.Sendoptions != (SendOptionAlls.ForceUnicode | SendOptionAlls.Unicode))) { // String properties MUST be output in code page abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicode = false; ModelHelper.CaptureRequirement( 3447, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When none of the three flags[Unicode, ForceUnicode, and UseCpid] are set, String properties MUST be output in the code page set on the current connection with a property type of PtypString8 ([MS-OXCDATA] section 2.11.1). "); } else if (currentDownloadContext.Sendoptions == (SendOptionAlls.ForceUnicode | SendOptionAlls.Unicode)) { // String properties MUST be output in Unicode abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicode = true; ModelHelper.CaptureRequirement( 3455, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When Unicode and ForceUnicode, String properties MUST be output in Unicode with a property type of PtypUnicode."); } else if (currentDownloadContext.Sendoptions == SendOptionAlls.Unicode) { // The string properties is saved in the server using Unicode format in this test environment ,so the string properties must out in Unicode format abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicode = true; ModelHelper.CaptureRequirement( 3448, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When Unicode only, String properties MUST be output either in Unicode with a property type of PtypUnicode ([MS-OXCDATA] section 2.11.1), or in the code page set on the current connection with a property type of PtypString8. "); ModelHelper.CaptureRequirement( 3449, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When Unicode only, if the properties are stored in Unicode on the server, the server MUST return the properties in Unicode. "); ModelHelper.CaptureRequirement( 3450, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When Unicode only, if the properties are not stored in Unicode on the server, the server MUST return the properties in the code page set on the current connection."); } else if (currentDownloadContext.Sendoptions == SendOptionAlls.ForceUnicode) { // The string properties is saved in the server using unicode format in this test environment ,so the string properties must out in Unicode format abstractFastTransferStream.AbstractMessageContent.StringPropertiesInUnicode = true; ModelHelper.CaptureRequirement( 3451, @"[In Receiving a RopFastTransferSourceCopyTo Request] [valid combinations of the Unicode, ForceUnicode, and UseCpid flags of the SendOptions field] When ForceUnicode only, String properties MUST be output in Unicode with a property type of PtypUnicode."); } } #endregion if (!currentDownloadContext.IsLevelTrue) { bool isPidTagMessageAttachmentsExist = false; bool isPidTagMessageRecipientsExist = false; // Search the currentDownloadContext.property to find if the specific property is required to download foreach (string propStr in currentDownloadContext.Property) { if (propStr == "PidTagMessageAttachments") { isPidTagMessageAttachmentsExist = true; } if (propStr == "PidTagMessageRecipients") { isPidTagMessageRecipientsExist = true; } // CopyTo operation's propertyTags specific the properties not to download if (currentDownloadContext.RelatedFastTransferOperation != EnumFastTransferOperation.FastTransferSourceCopyTo) { // The PidTagMessageRecipients property is required to download if (propStr == "PidTagMessageAttachments") { // The PidTagMessageAttachments property is required to download abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.AttachmentPrecededByPidTagFXDelProp = true; ModelHelper.CaptureRequirement( 3304, @"[In messageChildren Element] Under the conditions specified in section 3.2.5.10 [Effect of Property and Subobject Filters on Download] , the PidTagMessageRecipients ([MS-OXPROPS] section 2.795) property included in a recipient element and the PidTagMessageAttachments ([MS-OXPROPS] section 2.779) property included in an attachment element MUST be preceded by a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1)."); // The AttachmentPrecededByPidTagFXDelProp true means server outputs the MetaTagFXDelProp property before outputting subobjects, such as attachment. ModelHelper.CaptureRequirement( 2276, @"[In Effect of Property and Subobject Filters on Download] Whenever subobject filters have an effect, servers MUST output a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1) immediately before outputting subobjects of a particular type, to differentiate between the cases where a set of subobjects (such as attachments or recipients) was filtered in, but was empty, and where it was filtered out."); ModelHelper.CaptureRequirement( 3464, @"[In Receiving a RopFastTransferSourceCopyProperties Request] If the Level field is set to 0x00, the server MUST copy descendant subobjects by using the property list specified by the PropertyTags field. "); ModelHelper.CaptureRequirement( 3783, @"[In Receiving a RopFastTransferSourceCopyProperties Request] Subobjects are not copied unless listed in the value of the PropertyTags field."); } if (propStr == "PidTagMessageRecipients") { // The PidTagMessageRecipients property is required to download abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.RecipientPrecededByPidTagFXDelProp = true; ModelHelper.CaptureRequirement( 3304, @"[In messageChildren Element] Under the conditions specified in section 3.2.5.10 [Effect of Property and Subobject Filters on Download] , the PidTagMessageRecipients ([MS-OXPROPS] section 2.795) property included in a recipient element and the PidTagMessageAttachments ([MS-OXPROPS] section 2.779) property included in an attachment element MUST be preceded by a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1)."); // The RecipientPrecededByPidTagFXDelProp true means server outputs the MetaTagFXDelProp property before outputting subobjects, such as recipients. ModelHelper.CaptureRequirement( 2276, @"[In Effect of Property and Subobject Filters on Download] Whenever subobject filters have an effect, servers MUST output a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1) immediately before outputting subobjects of a particular type, to differentiate between the cases where a set of subobjects (such as attachments or recipients) was filtered in, but was empty, and where it was filtered out."); } } else if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo) { if (propStr == "PidTagMessageAttachments") { // The PidTagMessageAttachments property is not required to download abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.AttachmentPrecededByPidTagFXDelProp = false; ModelHelper.CaptureRequirement( 3439, @"[In Receiving a RopFastTransferSourceCopyTo ROP Request] If the Level field is set to 0x00, the server MUST copy descendant subobjects by using the property list specified by the PropertyTags field. "); ModelHelper.CaptureRequirement( 3440, @"[In Receiving a RopFastTransferSourceCopyTo ROP Request] Subobjects are only copied when they are not listed in the value of the PropertyTags field. "); } if (propStr == "PidTagMessageRecipients") { // The PidTagMessageRecipients property is not required to download abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.RecipientPrecededByPidTagFXDelProp = false; } } } if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo && currentConnection.AttachmentContainer.Count > 0) { if (!isPidTagMessageAttachmentsExist) { abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.AttachmentPrecededByPidTagFXDelProp = true; ModelHelper.CaptureRequirement( 3304, @"[In messageChildren Element] Under the conditions specified in section 3.2.5.10 [Effect of Property and Subobject Filters on Download] , the PidTagMessageRecipients ([MS-OXPROPS] section 2.795) property included in a recipient element and the PidTagMessageAttachments ([MS-OXPROPS] section 2.779) property included in an attachment element MUST be preceded by a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1)."); } } if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo) { if (!isPidTagMessageRecipientsExist) { abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.RecipientPrecededByPidTagFXDelProp = true; // The RecipientPrecededByPidTagFXDelProp true means server outputs the MetaTagFXDelProp property before outputting subobjects, such as recipients. ModelHelper.CaptureRequirement( 2276, @"[In Effect of Property and Subobject Filters on Download] Whenever subobject filters have an effect, servers MUST output a MetaTagFXDelProp meta-property (section 2.2.4.1.5.1) immediately before outputting subobjects of a particular type, to differentiate between the cases where a set of subobjects (such as attachments or recipients) was filtered in, but was empty, and where it was filtered out."); } } } else { abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.AttachmentPrecededByPidTagFXDelProp = false; abstractFastTransferStream.AbstractMessageContent.AbsMessageChildren.RecipientPrecededByPidTagFXDelProp = false; if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyTo) { ModelHelper.CaptureRequirement( 3441, @"[In Receiving a RopFastTransferSourceCopyTo ROP Request] If the Level field is set to a nonzero value, the server MUST exclude all descendant subobjects from being copied."); } if (currentDownloadContext.RelatedFastTransferOperation == EnumFastTransferOperation.FastTransferSourceCopyProperties) { ModelHelper.CaptureRequirement( 3465, @"[In Receiving a RopFastTransferSourceCopyProperties Request] If the Level field is set to a nonzero value, the server MUST exclude all descendant subobjects from being copied."); } } break; } // In case of the FastTransferStreamType of download context include messageList. case FastTransferStreamType.MessageList: { if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyMessage) { ModelHelper.CaptureRequirement( 3330, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyMessages, ROP request buffer field conditions is always, Root element in the produced FastTransfer stream is messageList."); } if (priorOperation == MS_OXCFXICS.PriorOperation.RopFastTransferDestinationConfigure && sourOperation == SourceOperation.CopyMessages) { ModelHelper.CaptureRequirement( 601, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyMessages, Root element in FastTransfer stream is messageList."); } // Initialize the entity variable abstractFastTransferStream.AbstractMessageList = new AbstractMessageList { AbsMessage = new AbsMessage { AbsMessageContent = new AbstractMessageContent() } }; if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyMessage) { if ((currentDownloadContext.CopyMessageCopyFlag & RopFastTransferSourceCopyMessagesCopyFlags.BestBody) == RopFastTransferSourceCopyMessagesCopyFlags.BestBody) { if (requirementContainer.ContainsKey(211601) && requirementContainer[211601]) { abstractFastTransferStream.AbstractMessageContent.IsRTFFormat = false; ModelHelper.CaptureRequirement(211601, @"[In Receiving a RopFastTransferSourceCopyMessages ROP Request] Implementation does output the message body, and the body of the Embedded Message object, in their original format, If the BestBody flag of the CopyFlags field is set. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } if (requirementContainer.ContainsKey(499003) && requirementContainer[499003]) { abstractFastTransferStream.AbstractMessageContent.IsRTFFormat = false; ModelHelper.CaptureRequirement(499003, @"[In Appendix A: Product Behavior] Implementation does support this flag [BestBody flag] [in RopFastTransferSourceCopyMessages ROP]. (<5> Section 2.2.3.1.1.3.1: Microsoft Exchange Server 2007 and Microsoft Exchange Server 2010 follow this behavior.)"); } } } // If the folder permission is set to None. if (currentFolder.FolderPermission == PermissionLevels.None || currentFolder.FolderPermission == PermissionLevels.FolderVisible) { if (currentDownloadContext.CopyMessageCopyFlag == RopFastTransferSourceCopyMessagesCopyFlags.Move) { if (requirementContainer.ContainsKey(2631) && requirementContainer[2631]) { // The server doesn't output any objects in a FastTransfer stream that the client does not have permissions to delete abstractFastTransferStream.AbstractMessageList.AbsMessage.AbsMessageContent.IsNoPermissionMessageNotOut = true; ModelHelper.CaptureRequirement( 2631, @"[In Receiving a RopFastTransferSourceCopyMessages ROP Request] Implementation does not output any objects in a FastTransfer stream that the client does not have permissions to delete, If the Move flag of the CopyFlags field is set for a download operation. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } } if (requirementContainer.ContainsKey(1168) && requirementContainer[1168]) { // The server doesn't have the permissions necessary to access PidTagEcWarning if the folder permission is set to None. abstractFastTransferStream.AbstractMessageList.IsPidTagEcWarningOut = true; ModelHelper.CaptureRequirement( 1168, @"[In messageList Element] Implementation does output MetaTagEcWarning meta-property (section 2.2.4.1.5.2) if a client does not have the permissions necessary to access it, as specified in section 3.2.5.8.1. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } if (requirementContainer.ContainsKey(34381) && requirementContainer[34381]) { // The server doesn't have the permissions necessary to access PidTagEcWarning if the folder permission is set to None. abstractFastTransferStream.AbstractMessageList.IsPidTagEcWarningOut = true; ModelHelper.CaptureRequirement( 34381, @"[In Download] Implementation does output the MetaTagEcWarning meta-property (section 2.2.4.1.5.2) in a FastTransfer stream if a permission check for an object fails, wherever allowed by its syntactical structure, to signal a client about incomplete content. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } } break; } // In case of the FastTransferStreamType of download context include topFolder. case FastTransferStreamType.TopFolder: { if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyFolder) { ModelHelper.CaptureRequirement( 3331, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyFolder, ROP request buffer field conditions is always, Root element in the produced FastTransfer stream is topFolder."); } if (priorOperation == MS_OXCFXICS.PriorOperation.RopFastTransferDestinationConfigure && sourOperation == SourceOperation.CopyFolder) { ModelHelper.CaptureRequirement( 602, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyFolder, Root element in FastTransfer stream is topFolder."); } // If the logon folder is Ghosted folder if (currentConnection.LogonFolderType == LogonFlags.Ghosted && requirementContainer.ContainsKey(1111) && requirementContainer[1111]) { // The PidTagNewFXFolder meta-property MUST be output for the Ghosted folder abstractFastTransferStream.AbstractTopFolder.AbsFolderContent.IsPidTagNewFXFolderOut = true; ModelHelper.CaptureRequirement( 1111, @"[In folderContent Element] [If there is a valid replica (1) of the public folder on the server and the folder content has not replicated to the server yet, the folder content is not included in the FastTransfer stream as part of the folderContent element] Implementation does not include any data following the MetaTagNewFXFolder meta-property in the buffer returned by the RopFastTransferSourceGetBuffer ROP (section 2.2.3.1.1.5), although additional data can be included in the FastTransfer stream. (Microsoft Exchange Server 2007 and above follow this behavior.)"); } // Identify whether the subFolder is existent or not. bool isSubFolderExist = false; AbstractFolder subFolder = new AbstractFolder(); // Search the folder container to find if the download folder has subFolder foreach (AbstractFolder tempSubFolder in currentConnection.FolderContainer) { if (currentFolder.SubFolderIds.Contains(tempSubFolder.FolderIdIndex)) { isSubFolderExist = true; subFolder = tempSubFolder; break; } } if (isSubFolderExist) { // Identify folder Permission is available. if (subFolder.FolderPermission != PermissionLevels.None) { if ((currentDownloadContext.CopyFolderCopyFlag & CopyFolderCopyFlags.CopySubfolders) == CopyFolderCopyFlags.CopySubfolders || (currentDownloadContext.CopyFolderCopyFlag & CopyFolderCopyFlags.Move) == CopyFolderCopyFlags.Move) { // The server recursively include the subFolders of the folder specified in the InputServerObject in the scope. abstractFastTransferStream.AbstractTopFolder.SubFolderInScope = true; } if ((currentDownloadContext.CopyFolderCopyFlag & CopyFolderCopyFlags.Move) == CopyFolderCopyFlags.Move && (currentDownloadContext.CopyFolderCopyFlag & CopyFolderCopyFlags.CopySubfolders) != CopyFolderCopyFlags.CopySubfolders) { ModelHelper.CaptureRequirement( 3481, @"[In Receiving a RopFastTransferSourceCopyFolder ROP Request] If the Move flag of the CopyFlags field is set and the CopySubfolders flag is not set, the server MUST recursively include the subfolders of the folder specified in the InputServerObject field in the scope."); } } } break; } // In case of the FastTransferStreamType of download context include messageList. case FastTransferStreamType.attachmentContent: { if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyTo && currentDownloadContext.ObjectType == ObjectType.Attachment) { ModelHelper.CaptureRequirement( 3328, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyTo, ROP request buffer field conditions is The InputServerObject field is an Attachment object<26>, Root element in the produced FastTransfer stream is attachmentContent."); } if (priorDownloadOperation == PriorDownloadOperation.RopFastTransferSourceCopyProperties && currentDownloadContext.ObjectType == ObjectType.Attachment) { ModelHelper.CaptureRequirement( 3329, @"[In FastTransfer Streams in ROPs] When ROP that initiates an operation is RopFastTranserSourceCopyProperties, ROP request buffer field conditions is The InputServerObject field is an Attachment object<26>, Root element in the produced FastTransfer stream is attachmentContent."); } if (priorOperation == PriorOperation.RopFastTransferDestinationConfigure && currentConnection.AttachmentContainer.Count > 0 && sourOperation == SourceOperation.CopyTo) { ModelHelper.CaptureRequirement( 597, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyTo, if the value of the InputServerObject field is an Attachment object, Root element in FastTransfer stream is attachmentContent element."); } if (priorOperation == PriorOperation.RopFastTransferDestinationConfigure && currentDownloadContext.ObjectType == ObjectType.Attachment && sourOperation == SourceOperation.CopyProperties) { ModelHelper.CaptureRequirement( 600, @"[In RopFastTransferDestinationConfigure ROP Request Buffer] [SourceOperation] When SourceOperation enumeration value is CopyProperties, if the value of the InputServerObject field is an Attachment object, Root element in FastTransfer stream is attachmentContent element."); } break; } default: break; } } if (result == RopResult.Success) { // If the server returns success result, which means the RopFastTransferSourceGetBuffer ROP downloads the next portion of a FastTransfer stream successfully. Then this requirement can be captured. ModelHelper.CaptureRequirement( 532, @"[In RopFastTransferSourceGetBuffer ROP] The RopFastTransferSourceGetBuffer ROP ([MS-OXCROPS] section 2.2.12.3) downloads the next portion of a FastTransfer stream that is produced by a previously configured download operation."); } return result; } /// <summary> /// Initializes a FastTransfer operation for uploading content encoded in a client-provided FastTransfer stream into a mailbox /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="objHandleIndex">A fast transfer stream object handle index.</param> /// <param name="option">Defines the parameters of a download operation.</param> /// <param name="copyFlag">Defines parameters of the FastTransfer download operation.</param> /// <param name="uploadContextHandleIndex">Configure handle's index.</param> /// <returns>Indicate the result of this ROP operation</returns> [Rule(Action = ("FastTransferDestinationConfigure(serverId,objHandleIndex,option,copyFlag,out uploadContextHandleIndex)/result"))] public static RopResult FastTransferDestinationConfigure(int serverId, int objHandleIndex, SourceOperation option, FastTransferDestinationConfigureCopyFlags copyFlag, out int uploadContextHandleIndex) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize return value. RopResult result = RopResult.InvalidParameter; if (requirementContainer.ContainsKey(3492001)) { if ((copyFlag == FastTransferDestinationConfigureCopyFlags.Invalid) && requirementContainer[3492001] == true) { // FastTransferDestinationConfigureCopyFlags is invalid parameter and exchange server version is not ExchangeServer2007 . uploadContextHandleIndex = -1; ModelHelper.CaptureRequirement( 3492001, @"[In Appendix A: Product Behavior] If unknown flags in the CopyFlags field are set, implementation does fail the operation. <39> Section 3.2.5.8.2.1: Exchange 2010, Exchange 2013 and Exchange 2016 fail the ROP [RopFastTransferDestinationConfigure ROP] if unknown bit flags in the CopyFlags field are set."); return result; } } if (option == SourceOperation.CopyProperties || option == SourceOperation.CopyTo || option == SourceOperation.CopyFolder || option == SourceOperation.CopyMessages) { priorOperation = MS_OXCFXICS.PriorOperation.RopFastTransferDestinationConfigure; } sourOperation = option; // Create a new Upload context. AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); // Set value for upload context. uploadContextHandleIndex = AdapterHelper.GetHandleIndex(); uploadInfo.UploadHandleIndex = uploadContextHandleIndex; ConnectionData changeConnection = connections[serverId]; connections.Remove(serverId); // Add the new Upload context to UploadContextContainer. changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Add(uploadInfo); connections.Add(serverId, changeConnection); result = RopResult.Success; ModelHelper.CaptureRequirement( 581, @"[In RopFastTransferDestinationConfigure ROP] The RopFastTransferDestinationConfigure ROP ([MS-OXCROPS] section 2.2.12.1) initializes a FastTransfer operation for uploading content encoded in a client-provided FastTransfer stream into a mailbox."); if (requirementContainer.ContainsKey(3492002)) { if ((copyFlag == FastTransferDestinationConfigureCopyFlags.Invalid) && requirementContainer[3492002] == true) { // Exchange 2007 ignore unknown values of the CopyFlags field. ModelHelper.CaptureRequirement( 3492002, @"[In Appendix A: Product Behavior] If unknown flags in the CopyFlags field are set, implementation does not fail the operation. <40> Section 3.2.5.8.2.1: Exchange 2007 ignore unknown values of the CopyFlags field."); return result; } } return result; } /// <summary> /// Uploads the next portion of an input FastTransfer stream for a previously configured FastTransfer upload operation. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="uploadContextHandleIndex">A fastTransfer stream object handle index.</param> /// <param name="transferDataIndex">Transfer data index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = ("FastTransferDestinationPutBuffer(serverId,uploadContextHandleIndex,transferDataIndex)/result"))] public static RopResult FastTransferDestinationPutBuffer(int serverId, int uploadContextHandleIndex, int transferDataIndex) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // serverHandleIndex is Invalid Parameter. if (uploadContextHandleIndex < 0 || transferDataIndex <= 0) { return RopResult.InvalidParameter; } ModelHelper.CaptureRequirement( 614, @"[In RopFastTransferDestinationPutBuffer ROP] The RopFastTransferDestinationPutBuffer ROP ([MS-OXCROPS] section 2.2.12.2) uploads the next portion of an input FastTransfer stream for a previously configured FastTransfer upload operation."); return RopResult.Success; } /// <summary> /// Uploads the next portion of an input FastTransfer stream for a previously configured FastTransfer upload operation. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="uploadContextHandleIndex">A fastTransfer stream object handle index.</param> /// <param name="transferDataIndex">Transfer data index.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = ("FastTransferDestinationPutBufferExtended(serverId,uploadContextHandleIndex,transferDataIndex)/result"))] public static RopResult FastTransferDestinationPutBufferExtended(int serverId, int uploadContextHandleIndex, int transferDataIndex) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // serverHandleIndex is Invalid Parameter. if (uploadContextHandleIndex < 0 || transferDataIndex <= 0) { return RopResult.InvalidParameter; } ModelHelper.CaptureRequirement( 3183001, @"[In RopFastTransferDestinationPutBufferExtended ROP] The RopFastTransferDestinationPutBufferExtended ROP ([MS-OXCROPS] section 2.2.12.3) uploads the next portion of an input FastTransfer stream for a previously configured FastTransfer upload operation."); return RopResult.Success; } /// <summary> /// Tell the server of another server's version. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="serverHandleIndex">Server object handle index in handle container.</param> /// <param name="otherServerId">Another server's id.</param> /// <returns>Indicate the result of this ROP operation.</returns> [Rule(Action = ("TellVersion(serverId,serverHandleIndex,otherServerId)/result"))] public static RopResult TellVersion(int serverId, int serverHandleIndex, int otherServerId) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); if (serverHandleIndex < 0) { // serverHandleIndex is Invalid Parameter. return RopResult.InvalidParameter; } else { ModelHelper.CaptureRequirement( 572, @"[In RopTellVersion ROP] The RopTellVersion ROP ([MS-OXCROPS] section 2.2.12.8) is used to provide the version of one server to another server that is participating in the server-to-client-to-server upload, as specified in section 3.3.4.2.1."); return RopResult.Success; } } /// <summary> /// Tell the server of another server's version. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">Folder Handle index.</param> /// <param name="deleteFlags">The delete flag indicates whether checking delete.</param> /// <param name="rowCount">The row count returned from server.</param> /// <returns>Indicate the result of this rop operation.</returns> [Rule(Action = ("GetContentsTable(serverId,folderHandleIndex,deleteFlags,out rowCount)/result"))] public static RopResult GetContentsTable(int serverId, int folderHandleIndex, DeleteFlags deleteFlags, out int rowCount) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Get current ConnectionData value. ConnectionData currentConnection = connections[serverId]; // Create a new currentDownloadContext. AbstractUploadInfo currentUploadContext = new AbstractUploadInfo(); rowCount = -1; // Find the current Upload Context foreach (AbstractUploadInfo tempUploadContext in currentConnection.UploadContextContainer) { if (tempUploadContext.RelatedFastTransferOperation == EnumFastTransferOperation.SynchronizationImportDeletes) { currentUploadContext = tempUploadContext; } } if (folderHandleIndex < 0) { rowCount = -1; // serverHandleIndex is Invalid Parameter. return RopResult.InvalidParameter; } else { if (deleteFlags == DeleteFlags.Initial) { rowCount = 0; return RopResult.Success; } else if (deleteFlags == DeleteFlags.HardDeleteCheck) { rowCount = 0; } else if (deleteFlags == DeleteFlags.SoftDeleteCheck) { rowCount = softDeleteMessageCount; if (priorOperation == MS_OXCFXICS.PriorOperation.RopSynchronizationImportMessageMove) { rowCount = 1; } } return RopResult.Success; } } /// <summary> /// Tell the server of another server's version. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">Folder Handle index.</param> /// <param name="deleteFlags">The delete flag indicates whether checking delete.</param> /// <param name="rowCount">The row count returned from server.</param> /// <returns>Indicate the result of this rop operation.</returns> [Rule(Action = ("GetHierarchyTable(serverId,folderHandleIndex,deleteFlags,out rowCount)/result"))] public static RopResult GetHierarchyTable(int serverId, int folderHandleIndex, DeleteFlags deleteFlags, out int rowCount) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Get current ConnectionData value. ConnectionData currentConnection = connections[serverId]; // Create a new currentDownloadContext. AbstractUploadInfo currentUploadContext = new AbstractUploadInfo(); // Initialize the rowCount value. rowCount = -1; // Find the current Upload Context foreach (AbstractUploadInfo tempUploadContext in currentConnection.UploadContextContainer) { if (tempUploadContext.RelatedFastTransferOperation == EnumFastTransferOperation.SynchronizationImportDeletes) { currentUploadContext = tempUploadContext; } } if (folderHandleIndex < 0) { rowCount = -1; // serverHandleIndex is Invalid Parameter. return RopResult.InvalidParameter; } else { if (deleteFlags == DeleteFlags.Initial) { rowCount = 0; return RopResult.Success; } else if (deleteFlags == DeleteFlags.HardDeleteCheck) { if (requirementContainer.ContainsKey(90205002) && !requirementContainer[90205002]) { rowCount = -1; } else { rowCount = 0; } } else if (deleteFlags == DeleteFlags.SoftDeleteCheck) { rowCount = softDeleteFolderCount; } return RopResult.Success; } } #endregion #region Others /// <summary> /// Validate if the given two buffer is equal /// </summary> /// <param name="operation">The Enumeration Fast Transfer Operation</param> /// <param name="firstBufferIndex">The first Buffer's index</param> /// <param name="secondBufferIndex">The second buffer's index</param> /// <returns>Returns true only if the two buffers are equal</returns> [Rule(Action = ("AreEqual(operation,firstBufferIndex,secondBufferIndex)/result"))] private static bool AreEqual(EnumFastTransferOperation operation, int firstBufferIndex, int secondBufferIndex) { // Identify whether the firstBuffer and the secondBuffer are equal or not. if (firstBufferIndex <= 0 || secondBufferIndex <= 0) { return false; } bool returnValue = true; return returnValue; } #endregion } }
mit
jamiboy16/bearded-ninja
public/app/components/home/homeController.js
179
/* * homeController.js * Jami Boy Mohammad */ var homeController = angular.module('homeController', []); homeController.controller('homeController', function($scope) { });
mit
maritaria/terratech-mod
src/Sylver.PreciseSnapshots/XMLSave.cs
3819
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; using System.Xml; using System.Xml.Linq; using System.IO; using Nuterra; namespace Sylver.PreciseSnapshots { public static class XMLSave { /// <summary> /// Save Techs as XML Files /// </summary> /// <param name="tech">Tech to save</param> /// <param name="path">Path of saving folder</param> public static void SaveTechAsXML(Tank tech,string path) { if (!Directory.Exists(path)) { Console.WriteLine("XMLSave : Specified path \"" + path + "\" doesn't exists !"); return; } XmlWriter saver = XmlWriter.Create(Path.Combine(path, tech.name+".xml"),new XmlWriterSettings { Indent = true }); saver.WriteStartDocument(); saver.WriteStartElement("Tech"); saver.WriteAttributeString("Name", tech.name); saver.WriteStartElement("Blocks"); foreach (var block in tech.blockman.IterateBlocks()) { saver.WriteStartElement("Block"); saver.WriteAttributeString("Type", block.BlockType.ToString()); if(tech.blockman.IsRootBlock(block)) saver.WriteAttributeString("IsRootBlock","true"); saver.WriteStartElement("BlockSpec"); saver.WriteStartElement("OrthoRotation"); saver.WriteString(block.cachedLocalRotation.rot.ToString()); saver.WriteEndElement(); var localPos = new IntVector3(block.cachedLocalPosition); saver.WriteStartElement("IntVector3"); saver.WriteAttributeString("x", localPos.x.ToString()); saver.WriteAttributeString("y", localPos.y.ToString()); saver.WriteAttributeString("z", localPos.z.ToString()); saver.WriteEndElement(); saver.WriteEndElement(); saver.WriteStartElement("Transform"); var pos = block.trans.localPosition; saver.WriteStartElement("Position"); saver.WriteAttributeString("x", pos.x.ToString()); saver.WriteAttributeString("y", pos.y.ToString()); saver.WriteAttributeString("z", pos.z.ToString()); saver.WriteEndElement(); var rotation = block.trans.localRotation.eulerAngles; saver.WriteStartElement("Rotation"); saver.WriteAttributeString("x", rotation.x.ToString()); saver.WriteAttributeString("y", rotation.y.ToString()); saver.WriteAttributeString("z", rotation.z.ToString()); saver.WriteEndElement(); var scale = block.trans.localScale; saver.WriteStartElement("Scale"); saver.WriteAttributeString("x", scale.x.ToString()); saver.WriteAttributeString("y", scale.y.ToString()); saver.WriteAttributeString("z", scale.z.ToString()); saver.WriteEndElement(); saver.WriteEndElement(); saver.WriteEndElement(); } saver.WriteEndElement(); saver.WriteEndDocument(); saver.Close(); } } }
mit
ikerib/sf2-instrucciones
src/Ikerib/IkasiBundle/Tests/Controller/QuestionControllerTest.php
1945
<?php namespace Ikerib\IkasiBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class QuestionControllerTest extends WebTestCase { /* public function testCompleteScenario() { // Create a new client to browse the application $client = static::createClient(); // Create a new entry in the database $crawler = $client->request('GET', '/question/'); $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /question/"); $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); // Fill in the form and submit it $form = $crawler->selectButton('Create')->form(array( 'ikerib_ikasibundle_question[field_name]' => 'Test', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check data in the show view $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); // Edit the entity $crawler = $client->click($crawler->selectLink('Edit')->link()); $form = $crawler->selectButton('Update')->form(array( 'ikerib_ikasibundle_question[field_name]' => 'Foo', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check the element contains an attribute with value equals "Foo" $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); // Delete the entity $client->submit($crawler->selectButton('Delete')->form()); $crawler = $client->followRedirect(); // Check the entity has been delete on the list $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); } */ }
mit
166MMX/Dune-II---The-Maker
resources/tools/LogViewer/src/logviewer/LogReader.java
2290
package logviewer; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; /** * * @author Rene Zwanenburg */ public final class LogReader { private LogReader(){} public static ArrayList<Unit> readFile(File f) { ArrayList<Unit> l = new ArrayList<Unit>(); // Temporary unordered unit storage ArrayList<String> lines = new ArrayList<String>(); // Stores unit info lines try{ BufferedReader in = new BufferedReader(new FileReader(f)); String line = null; while((line = in.readLine()) != null){ // while more lines remain... line = line.trim(); // Remove all leading and trailing spaces. if(line.length() == 0 || !line.startsWith("0| [UNIT")) // If line is empty or isn't about units... continue; // Go to next line. lines.add(line); } } catch(Exception e){ System.err.println("Error Reading File:"); e.printStackTrace(); return null; } for(int i = 0; i < lines.size(); i++) // cut off unused first characters lines.set(i, lines.get(i).substring(9)); for(String s : lines){ // adds units to unordered list if(getUnit(getUnitID(s), l) == null) l.add(new Unit(getUnitID(s))); } ArrayList<Unit> units = new ArrayList<Unit>(); // ordered unit storage int maxID = l.size(); // Lowest possible amount of id's is unordered storage size for(int i = 0; i < maxID; i++){ if(getUnit(i, l) == null){ // If id 'i' is not in the list... maxID++; // The highest possible ID increases by one. continue; } units.add(getUnit(i, l)); } for(String s : lines) getUnit(getUnitID(s), units).addMessage(s); // Parsing the line is up to the unit return units; } private static int getUnitID(String line){ return Integer.parseInt(line.split("]")[0]); } private static Unit getUnit(int id, ArrayList<Unit> list){ for(Unit u : list) if(u.getId() == id) return u; return null; } }
mit
eHealthExperts/gematik-specifications
README.md
6689
# gematik-specifications Dieses Projekt bietet eine Java-Interpretation der gematik-AFOs, die in diversen gematik-Spezifikationen verteilt sind und durch gematik-Produkttypsteckbriefe querreferenziert werden. Die Umsetzung unterteilt die AFOs in jeweilige Namensräume (Java-Packages) und bietet global entsprechende API-Typen (Interfaces) an. ## Lizenz Dieses 2016 durch die [eHealth Experts GmbH](http://www.ehealthexperts.de) initiierte Free-Open-Source Projekt wird unter der MIT-Lizenz veröffentlicht. Den Wortlaut der Lizenzvereinbarung finden sie in der beigefügten Datei *[LICENSE](LICENSE)*. ## Versionierung / Release-Umsetzung Die Versionsnummern der einzelnen Releases referenzieren einen jeweiligen Stand eines gematik-Releases. - Die Major-Nummer **1** zeigt den Bezug zum gematik Release 1.5 ORS1 mit Basis-Rollout – Erprobung und Produktivbetrieb. Die Major-Nummer **2** zeigt den Bezug zum gematik Release 1.6 Online-Produktivbetrieb (Stufe 1) - OPB1. - Jede Minor-Nummer bezieht sich auf einen bestimmten Dokumentenstand der Produkttypsteckbriefe. Exemplarisch steht **1.0** für eine Umsetzung der ORS-1.5-Dokumente vom 19. Juli 2016. - Die Patch-Nummer repräsentiert den Programmierumfang des Projekts und kann den jeweiligen Release-Notes entnommen werden. | Version gematik-specifications | Umsetzung von gematik-Release | Version Produkttypsteckbriefe | |:-------------------------------:|:-----------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| | 1.0.* (Default-Branch) | [Release 1.5 ORS1](http://www.gematik.de/cms/de/spezifikation/release_1_5_ors1/release_1_5.jsp) | [2016-07-19](http://www.gematik.de/cms/media/dokumente/ors1_release_1_5/ORS1_Produkttypsteckbriefe_20160719.zip) | | 1.1.* | [Release 1.5 ORS1](http://www.gematik.de/cms/de/spezifikation/release_1_5_ors1/release_1_5.jsp) | [2016-09-22](http://www.gematik.de/cms/media/dokumente/ors1_release_1_5/ORS1_Produkttypsteckbriefe_20160922.zip) | | 1.2.* | [Release 1.5 ORS1](http://www.gematik.de/cms/de/spezifikation/release_1_5_ors1/release_1_5.jsp) | **TBR**: Vorarbeiten für demnächst erscheinendes gematik-Release aus Release 1.5 ORS1 (*T*o *B*e *R*eleased) | | NO-VERSION | Release 1.6 OPB1 (1.6.0) | | | 2.0.* | [Release 1.6 OPB1 (1.6.1)](http://www.gematik.de/cms/de/spezifikation/release_1_6_opb1/release_1_9.jsp) | [2016-08-24](http://www.gematik.de/cms/media/dokumente/opb1_release_1_6/OPB1_Produkttypsteckbriefe_20160824.zip) | | 2.1.* | [Release 1.6 OPB1](http://www.gematik.de/cms/de/spezifikation/release_1_6_opb1/release_1_9.jsp) | **TBR**: Vorarbeiten für zeitweise erschienenes gematik-Release [2016-11-25](http://www.gematik.de/cms/media/dokumente/opb1_release_1_6/OPB1_Produkttypsteckbriefe_20161125.zip) | | 2.2.* | [Release 1.6 OPB1 (1.6.2)](http://www.gematik.de/cms/de/spezifikation/release_1_6_opb1/release_1_9.jsp) | [2016-12-19](http://www.gematik.de/cms/media/dokumente/opb1_release_1_6/OPB1_Produkttypsteckbriefe_20161219.zip) | | 2.3.* | [Release 1.6 OPB1 (1.6.3)](http://www.gematik.de/cms/de/spezifikation/release_1_6_opb1/release_1_9.jsp) | [2017-03-20](http://www.gematik.de/cms/media/dokumente/opb1_release_1_6/OPB1_Produkttypsteckbriefe_20170316.zip) | | 2.4.* | [Release 1.6 OPB1 (1.6.4)](http://www.gematik.de/cms/de/spezifikation/release_1_6_opb1/release_1_9.jsp) | [2017-04-27](http://www.gematik.de/cms/media/dokumente/opb1_release_1_6/OPB1_Produkttypsteckbriefe_20170426~1.zip) | | 2.5.* | [Release 1.6 OPB1 (1.6.4-1)](http://www.gematik.de/cms/de/spezifikation/release_1_6_opb1/release_1_9.jsp) | [2017-07-12](https://www.gematik.de/cms/media/dokumente/opb1_release_1_6/OPB1_Produkttypsteckbriefe_20170712.zip) | ## Hinweise für Nutzer der gematik-specifications Sämtliche konkreten Klassen sind stets gegen passende Interfaces entwickelt. Es wird ganz deutlich darauf hingewiesen, dass diese anstatt der konkreten Typen für sämtliche Methoden-Schnittstellen zu verwenden sind, um an zukünftigen Weiterentwicklungen teilhaben zu können. Desweiteren sind die gematik-AFOs mit unterschiedlichen Anforderungsleveln versehen. Diese sind grundsätzlich Bestandteil der bereits in den `enum`-Klassen erfassten AFOs. Eine Nichtangabe eines Anforderungslevels impliziert eine *MUSS*-Anforderung. Häufig sind jedoch AFOs erfasst worden ohne deren Anforderungslevel anzugeben, da es sich schlicht nicht aus den Produkttypsteckbriefen bzw. AFO-Titeln herauslesen lässt. Derartige AFOs sind mit einem entsprechenden TODO als Java-Kommentar vermerkt. (Das zur Laufzeit abrufbare Level ist daher ggf. nicht korrekt; In den meisten Fällen handelt es sich bei den gematik-AFOs jedoch um *MUSS*-AFOs.) ## Hinweise für Entwickler der gematik-specifications Sie sind herzlich eingeladen, selbst zu diesem Projekt beizutragen. Legen Sie sich hierzu einem Fork des Projekts an (shared repository model), arbeiten Sie Ihre Ergänzungen ein und tragen Sie diese als Pull-Request an dieses Projekt heran. - Bitte beachten Sie die Code-Konventionen. - Zudem sind alle `enum`-Konstanten alphabetisch sortiert (plus [Trailing-Komma](http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.9)), um die Code-Änderungen schneller überblicken zu können. - Arbeiten Sie stets gegen die Interfaces. - Jeder Code-Beitrag muss, wenn er eine neue Funktionalität beiträgt, durch passende Unit-Tests (oder sogar [j8unit](https://github.com/j8unit-team/j8unit)-Tests) überprüfbar sein. - Mehr Informationen zu einem github-Pull-Request über Fork-Grenzen hinweg finden sie unter: https://help.github.com/articles/about-pull-requests/
mit
DragonBones/DragonBonesJS
Pixi/5.x/src/dragonBones/pixi/PixiTextureAtlasData.ts
4172
/** * The MIT License (MIT) * * Copyright (c) 2012-2018 DragonBones team and other contributors * * 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. */ namespace dragonBones { /** * - The PixiJS texture atlas data. * @version DragonBones 3.0 * @language en_US */ /** * - PixiJS 贴图集数据。 * @version DragonBones 3.0 * @language zh_CN */ export class PixiTextureAtlasData extends TextureAtlasData { public static toString(): string { return "[class dragonBones.PixiTextureAtlasData]"; } private _renderTexture: PIXI.BaseTexture | null = null; // Initial value. protected _onClear(): void { super._onClear(); if (this._renderTexture !== null) { // this._renderTexture.dispose(); } this._renderTexture = null; } /** * @inheritDoc */ public createTexture(): TextureData { return BaseObject.borrowObject(PixiTextureData); } /** * - The PixiJS texture. * @version DragonBones 3.0 * @language en_US */ /** * - PixiJS 贴图。 * @version DragonBones 3.0 * @language zh_CN */ public get renderTexture(): PIXI.BaseTexture | null { return this._renderTexture; } public set renderTexture(value: PIXI.BaseTexture | null) { if (this._renderTexture === value) { return; } this._renderTexture = value; if (this._renderTexture !== null) { for (let k in this.textures) { const textureData = this.textures[k] as PixiTextureData; textureData.renderTexture = new PIXI.Texture( this._renderTexture, new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height), textureData.rotated as any // .d.ts bug ); } } else { for (let k in this.textures) { const textureData = this.textures[k] as PixiTextureData; textureData.renderTexture = null; } } } } /** * @internal */ export class PixiTextureData extends TextureData { public static toString(): string { return "[class dragonBones.PixiTextureData]"; } public renderTexture: PIXI.Texture | null = null; // Initial value. protected _onClear(): void { super._onClear(); if (this.renderTexture !== null) { this.renderTexture.destroy(false); } this.renderTexture = null; } } }
mit
navalev/azure-sdk-for-java
sdk/cognitiveservices/ms-azure-cs-computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageOptionalParameter.java
4218
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.cognitiveservices.vision.computervision.models; import java.util.List; /** * The AnalyzeImageOptionalParameter model. */ public class AnalyzeImageOptionalParameter { /** * A string indicating what visual feature types to return. Multiple values * should be comma-separated. Valid visual feature types include:Categories * - categorizes image content according to a taxonomy defined in * documentation. Tags - tags the image with a detailed list of words * related to the image content. Description - describes the image content * with a complete English sentence. Faces - detects if faces are present. * If present, generate coordinates, gender and age. ImageType - detects if * image is clipart or a line drawing. Color - determines the accent color, * dominant color, and whether an image is black&amp;white.Adult - detects * if the image is pornographic in nature (depicts nudity or a sex act). * Sexually suggestive content is also detected. */ private List<VisualFeatureTypes> visualFeatures; /** * A string indicating which domain-specific details to return. Multiple * values should be comma-separated. Valid visual feature types * include:Celebrities - identifies celebrities if detected in the image. */ private List<Details> details; /** * The desired language for output generation. If this parameter is not * specified, the default value is &amp;quot;en&amp;quot;.Supported * languages:en - English, Default. es - Spanish, ja - Japanese, pt - * Portuguese, zh - Simplified Chinese. Possible values include: 'en', * 'es', 'ja', 'pt', 'zh'. */ private String language; /** * Gets or sets the preferred language for the response. */ private String thisclientacceptLanguage; /** * Get the visualFeatures value. * * @return the visualFeatures value */ public List<VisualFeatureTypes> visualFeatures() { return this.visualFeatures; } /** * Set the visualFeatures value. * * @param visualFeatures the visualFeatures value to set * @return the AnalyzeImageOptionalParameter object itself. */ public AnalyzeImageOptionalParameter withVisualFeatures(List<VisualFeatureTypes> visualFeatures) { this.visualFeatures = visualFeatures; return this; } /** * Get the details value. * * @return the details value */ public List<Details> details() { return this.details; } /** * Set the details value. * * @param details the details value to set * @return the AnalyzeImageOptionalParameter object itself. */ public AnalyzeImageOptionalParameter withDetails(List<Details> details) { this.details = details; return this; } /** * Get the language value. * * @return the language value */ public String language() { return this.language; } /** * Set the language value. * * @param language the language value to set * @return the AnalyzeImageOptionalParameter object itself. */ public AnalyzeImageOptionalParameter withLanguage(String language) { this.language = language; return this; } /** * Get the thisclientacceptLanguage value. * * @return the thisclientacceptLanguage value */ public String thisclientacceptLanguage() { return this.thisclientacceptLanguage; } /** * Set the thisclientacceptLanguage value. * * @param thisclientacceptLanguage the thisclientacceptLanguage value to set * @return the AnalyzeImageOptionalParameter object itself. */ public AnalyzeImageOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { this.thisclientacceptLanguage = thisclientacceptLanguage; return this; } }
mit
LukeTowers/oc-queencityhack2k17-site
plugins/rainlab/user/lang/it/lang.php
10511
<?php return [ 'plugin' => [ 'name' => 'Utenti', 'description' => 'Gestione Utenti Front-End.', 'tab' => 'Utenti', 'access_users' => 'Gestisci Utenti', 'access_groups' => 'Gestisci Gruppi di Utenti', 'access_settings' => 'Gestisci Impostazioni Utenti' ], 'users' => [ 'menu_label' => 'Utenti', 'all_users' => 'Tutti gli utenti', 'new_user' => 'Nuovo Utente', 'list_title' => 'Gestisci Utenti', 'trashed_hint_title' => 'L\'utente ha disabilitato il suo account', 'trashed_hint_desc' => 'Questo utente ha disattivato il suo account and e non vuole più apparire sul sito. Possono riattivarsi in qualsiasi momento effettuando l\'accesso.', 'banned_hint_title' => 'Questo utente è stato bannato', 'banned_hint_desc' => 'Questo utente è stato bannato da un amministratore e non potrà piú effettuare l\'accesso', 'guest_hint_title' => 'Questo è un utente anonimo', 'guest_hint_desc' => 'Questo utente è salvato solo per riferimento e deve registrarsi prima di poter effettuare l\'accesso', 'activate_warning_title' => 'Utente non attivo!', 'activate_warning_desc' => 'Questo utente non è stato attivato e potrebbe non essere in grado di effettuare l\'accesso', 'activate_confirm' => 'Vuoi veramente attivare questo utente?', 'activated_success' => 'Utente Attivato', 'activate_manually' => 'Attiva questo utente manualmente', 'convert_guest_confirm' => 'Convertire questo utente anonimo a un utente registrato?', 'convert_guest_manually' => 'Converti a un utente registrato', 'convert_guest_success' => 'Utente convertito a un account registrato', 'delete_confirm' => 'Vuoi veramente cancellare questo utente?', 'unban_user' => 'Sblocca questo utente', 'unban_confirm' => 'Vuoi veramente sbloccare questo utente?', 'unbanned_success' => 'L\'utente è stato sbloccato', 'return_to_list' => 'Ritorna alla lista utenti', 'update_details' => 'Aggiorna dettagli', 'bulk_actions' => 'Azioni multiple', 'delete_selected' => 'Elimina selezionati', 'delete_selected_confirm' => 'Eliminare gli utenti selezionati?', 'delete_selected_empty' => 'Non ci sono utenti selezionati da cancellare.', 'delete_selected_success' => 'Gli utenti selezionati sono stati cancellati con successo.', 'deactivate_selected' => 'Disabilita selezionati', 'deactivate_selected_confirm' => 'Disattivare gli utenti selezionati?', 'deactivate_selected_empty' => 'Non ci sono utenti selezionati da disattivare.', 'deactivate_selected_success' => 'Utenti selezionati disattivati con successo.', 'restore_selected' => 'Ripristina selezionati', 'restore_selected_confirm' => 'Ripristinare gli utenti selezionati?', 'restore_selected_empty' => 'Non ci sono utenti selezionati da ripristinare.', 'restore_selected_success' => 'Utenti selezionati ripristinati con successo.', 'ban_selected' => 'Blocca selezionati', 'ban_selected_confirm' => 'Bloccare l\'utente selezionato?', 'ban_selected_empty' => 'Non ci sono utenti selezionati da bloccare.', 'ban_selected_success' => 'Utenti selezionati bloccati con successo.', 'unban_selected' => 'Sblocca selezionati', 'unban_selected_confirm' => 'Sbloccare gli utenti selezionati?', 'unban_selected_empty' => 'Non ci sono utenti selezionati da sbloccare.', 'unban_selected_success' => 'Utenti selezionati sbloccati con successo.', ], 'settings' => [ 'users' => 'Utenti', 'menu_label' => 'Impostazioni Utenti', 'menu_description' => 'Gestisci impostazioni degli utenti', 'activation_tab' => 'Attivazione', 'signin_tab' => 'Accesso', 'registration_tab' => 'Registrazione', 'notifications_tab' => 'Notifiche', 'allow_registration' => 'Consenti registrazione utenti', 'allow_registration_comment' => 'Se questo è disabilitato gli utenti possono essere creati solo da un amministratore.', 'activate_mode' => 'Modalità di attivazione', 'activate_mode_comment' => 'Scegli come un utente dovrebbe essere attivato', 'activate_mode_auto' => 'Automaticamente', 'activate_mode_auto_comment' => 'Attivato automaticamente alla registrazione', 'activate_mode_user' => 'Utente', 'activate_mode_user_comment' => 'L\'utente si attiva da solo confermando la sua email', 'activate_mode_admin' => 'Amministratore', 'activate_mode_admin_comment' => 'Solo un amminstratore può attivare un utente.', 'require_activation' => 'Effettuare l\'accesso richiede l\'attivazione.', 'require_activation_comment' => 'Gli utenti devono avere un account attivato per effettuare l\'accesso.', 'block_persistence' => 'Previeni sessioni concorrenti', 'block_persistence_comment' => 'Quando abilitato gli utenti non possono effettuare il log-in da diversi dispositivi contemporaneamente', 'use_throttle' => 'Limita tentativi', 'use_throttle_comment' => 'Ripetuti tentativi errati di accesso porteranno alla sospensione temporanea dell\'utente.', 'login_attribute' => 'Metodo di login', 'login_attribute_comment' => 'Seleziona che attributo gli utenti useranno per effettuare il login.' , ], 'user' => [ 'label' => 'Utente', 'id' => 'ID', 'username' => 'Username', 'name' => 'Nome', 'name_empty' => 'Anonimo', 'surname' => 'Cognome', 'email' => 'Email', 'created_at' => 'Registrato', 'last_seen' => 'Ultimo accesso', 'is_guest' => 'Anonimo', 'joined' => 'Joined', 'is_online' => 'Online adesso', 'is_offline' => 'Al momento non collegato', 'send_invite' => 'Invia invito via mail', 'send_invite_comment' => 'Invia un messaggio di benvenuto contenente le informazioni per l\'accesso', 'create_password' => 'Crea Password', 'create_password_comment' => 'Inserisci una nuova password per l\'accesso.', 'reset_password' => 'Cambia la Password', 'reset_password_comment' => 'Per cambiare la password di questo utente, inserisci una nuova password quí', 'confirm_password' => 'Conferma Password', 'confirm_password_comment' => 'Inserisci nuovamente la password per confermare.', 'groups' => 'Gruppi', 'empty_groups' => 'Non ci sono gruppi di utenti disponibili.', 'avatar' => 'Avatar', 'details' => 'Dettagli', 'account' => 'Account', 'block_mail' => 'Blocca tutte le mail verso questo utente.', 'status_guest' => 'Anonimo', 'status_activated' => 'Attivato', 'status_registered' => 'Registrato', ], 'group' => [ 'label' => 'Gruppo', 'id' => 'ID', 'name' => 'Nome', 'description_field' => 'Descrizione', 'code' => 'Codice', 'code_comment' => 'Inserisci un codice univoco per identificare il gruppo.', 'created_at' => 'Creato', 'users_count' => 'Utenti' ], 'groups' => [ 'menu_label' => 'Gruppi', 'all_groups' => 'Gruppi di Utenti', 'new_group' => 'Nuovo gruppo', 'delete_selected_confirm' => 'Vuoi veramente cancellare i gruppi selezionati?', 'list_title' => 'Gestisci Gruppi', 'delete_confirm' => 'Vuoi veramente cancellare questo gruppo?', 'delete_selected_success' => 'Gruppi selezionati cancellati con successo.', 'delete_selected_empty' => 'Non ci sono gruppi selezionati da cancellare.', 'return_to_list' => 'Torna all\'elenco dei gruppi', 'return_to_users' => 'Torna alla lista utenti', 'create_title' => 'Crea Gruppo di Utenti', 'update_title' => 'Modifica Gruppo di Utenti', 'preview_title' => 'Anteprima Gruppo' ], 'login' => [ 'attribute_email' => 'Email', 'attribute_username' => 'Username' ], 'account' => [ 'account' => 'Account', 'account_desc' => 'Form di gestione account.', 'redirect_to' => 'Reindirizza A', 'redirect_to_desc' => 'Pagina verso cui essere reindirizzati dopo modifica, accesso o registrazione.', 'code_param' => 'Parametro codice di attivazione', 'code_param_desc' => 'Parametro dell\'URL usato per il codice di attivazione', 'invalid_user' => 'Impossibile effettuare il login con le credenziali fornite.', 'invalid_activation_code' => 'Codice di attivazione fornito non valido.', 'invalid_deactivation_pass' => 'La password inserita non è valida.', 'success_activation' => 'Account attivato con successo.', 'success_deactivation' => 'Account disattivato con successo. Ci dispiace vederti andare via!', 'success_saved' => 'Impostazioni salvate con successo!', 'login_first' => 'Devi prima effettuare l\'accesso!', 'already_active' => 'Il tuo account è già stato attivato!', 'activation_email_sent' => 'Una mail di attivazione è stata inviata al tuo indirizzo mail.', 'registration_disabled' => 'La registrazione è al momento disattivata.', 'sign_in' => 'Accedi', 'register' => 'Registra', 'full_name' => 'Nome Completo', 'email' => 'Email', 'password' => 'Password', 'login' => 'Login', 'new_password' => 'Nuova Password', 'new_password_confirm' => 'Conferma Nuova Password' ], 'reset_password' => [ 'reset_password' => 'Ripristina Password', 'reset_password_desc' => 'Form password dimenticata.', 'code_param' => 'Parametro codice di ripristino', 'code_param_desc' => 'Parametro dell\'URL usato per il codice di ripristino' ], 'session' => [ 'session' => 'Sessione', 'session_desc' => 'Aggiungi la sessione utente a una pagina per limitare l\'accesso.', 'security_title' => 'Autorizza solo', 'security_desc' => 'Chi è autorizzato ad accedere alla pagina.', 'all' => 'Tutti', 'users' => 'Utenti', 'guests' => 'Anonimi', 'redirect_title' => 'Reindirizza a', 'redirect_desc' => 'Nome della pagina a cui reindirizzare se l\'accesso è negato.', 'logout' => 'Sei stato scollegato con successo!' ] ];
mit
QuiteQuiet/Pokemon-Showdown
data/aliases.js
43883
'use strict'; /**@type {{[k: string]: string}} */ let BattleAliases = { // formats "randbats": "[Gen 8] Random Battle", "uber": "[Gen 8] Ubers", "ag": "[Gen 8] Anything Goes", "mono": "[Gen 8] Monotype", "randdubs": "[Gen 8] Random Doubles Battle", "doubles": "[Gen 8] Doubles OU", "dubs": "[Gen 8] Doubles OU", "dou": "[Gen 8] Doubles OU", "duu": "[Gen 8] Doubles UU", "vgc17": "[Gen 7] VGC 2017", "vgc18": "[Gen 7] VGC 2018", "vgc19": "[Gen 7] VGC 2019 Ultra Series", "bss": "[Gen 8] Battle Stadium Singles", "bsd": "[Gen 8] Battle Stadium Doubles", "bsdoubles": "[Gen 8] Battle Stadium Doubles", "2v2": "[Gen 8] 2v2 Doubles", "natdex": "[Gen 8] National Dex", "natdexag": "[Gen 8] National Dex AG", "bh": "[Gen 8] Balanced Hackmons", "mnm": "[Gen 8] Mix and Mega", "aaa": "[Gen 8] Almost Any Ability", "gen7bh": "[Gen 7] Balanced Hackmons", "cc1v1": "[Gen 8] Challenge Cup 1v1", "cc2v2": "[Gen 8] Challenge Cup 2v2", "hc": "[Gen 8] Hackmons Cup", "monorandom": "[Gen 8] Monotype Random Battle", "bf": "[Gen 7] Battle Factory", "bssf": "[Gen 7] BSS Factory", "ssb": "[Gen 7] Super Staff Bros Brawl", "lgrandom": "[Gen 7] Let's Go Random Battle", "gen6bf": "[Gen 6] Battle Factory", "gen7mono": "[Gen 7] Monotype", "gen7ag": "[Gen 7] Anything Goes", "gen7bss": "[Gen 7] Battle Spot Singles", "gen7bsd": "[Gen 7] Battle Spot Doubles", "gen6mono": "[Gen 6] Monotype", "gen6ag": "[Gen 6] Anything Goes", "petmod": "[Gen 7 Pet Mod] Clean Slate: Micro", "cleanslatemicro": "[Gen 7 Pet Mod] Clean Slate: Micro", "csm": "[Gen 7 Pet Mod] Clean Slate: Micro", // mega evos "fabio": "Ampharos-Mega", "maero": "Aerodactyl-Mega", "megabunny": "Lopunny-Mega", "megabro": "Slowbro-Mega", "megacharizard": "Charizard-Mega-Y", "megacharizardx": "Charizard-Mega-X", "megacharizardy": "Charizard-Mega-Y", "megadoom": "Houndoom-Mega", "megadrill": "Beedrill-Mega", "megagard": "Gardevoir-Mega", "megacross": "Heracross-Mega", "megakhan": "Kangaskhan-Mega", "megalop": "Lopunny-Mega", "megaluc": "Lucario-Mega", "megamaw": "Mawile-Mega", "megamedi": "Medicham-Mega", "megamewtwo": "Mewtwo-Mega-Y", "megamewtwox": "Mewtwo-Mega-X", "megamewtwoy": "Mewtwo-Mega-Y", "megasnow": "Abomasnow-Mega", "megashark": "Sharpedo-Mega", "megasaur": "Venusaur-Mega", "mmx": "Mewtwo-Mega-X", "mmy": "Mewtwo-Mega-Y", "zardx": "Charizard-Mega-X", "zardy": "Charizard-Mega-y", // Pokéstar Studios "blackdoor": "Pokestar Black-Door", "brycen": "Brycen-Man", "brycenman": "Pokestar Brycen-Man", "f00": "Pokestar F00", "f002": "Pokestar F002", "giant": "Pokestar Giant", "mt": "Pokestar MT", "mt2": "Pokestar MT2", "majin": "Spirit", "mechatyranitar": "MT", "mechatyranitar2": "MT2", "monica": "Giant", "spirit": "Pokestar Spirit", "transport": "Pokestar Transport", "ufo": "Pokestar UFO", "ufo2": "Pokestar UFO-2", "whitedoor": "Pokestar White-Door", // formes "bugceus": "Arceus-Bug", "darkceus": "Arceus-Dark", "dragonceus": "Arceus-Dragon", "eleceus": "Arceus-Electric", "fairyceus": "Arceus-Fairy", "fightceus": "Arceus-Fighting", "fireceus": "Arceus-Fire", "flyceus": "Arceus-Flying", "ghostceus": "Arceus-Ghost", "grassceus": "Arceus-Grass", "groundceus": "Arceus-Ground", "iceceus": "Arceus-Ice", "poisonceus": "Arceus-Poison", "psyceus": "Arceus-Psychic", "rockceus": "Arceus-Rock", "steelceus": "Arceus-Steel", "waterceus": "Arceus-Water", "arcbug": "Arceus-Bug", "arcdark": "Arceus-Dark", "arcdragon": "Arceus-Dragon", "arcelectric": "Arceus-Electric", "arcfairy": "Arceus-Fairy", "arcfighting": "Arceus-Fighting", "arcfire": "Arceus-Fire", "arcflying": "Arceus-Flying", "arcghost": "Arceus-Ghost", "arcgrass": "Arceus-Grass", "arcground": "Arceus-Ground", "arcice": "Arceus-Ice", "arcpoison": "Arceus-Poison", "arcpsychic": "Arceus-Psychic", "arcrock": "Arceus-Rock", "arcsteel": "Arceus-Steel", "arcwater": "Arceus-Water", "basculinb": "Basculin-Blue-Striped", "basculinblue": "Basculin-Blue-Striped", "basculinbluestripe": "Basculin-Blue-Striped", "castformh": "Castform-Snowy", "castformice": "Castform-Snowy", "castformr": "Castform-Rainy", "castformwater": "Castform-Rainy", "castforms": "Castform-Sunny", "castformfire": "Castform-Sunny", "cherrims": "Cherrim-Sunshine", "cherrimsunny": "Cherrim-Sunshine", "darmanitanz": "Darmanitan-Zen", "darmanitanzenmode": "Darmanitan-Zen", "darmanitanzengalar": "Darmanitan-Galar-Zen", "deoxysnormal": "Deoxys", "deon": "Deoxys", "deoxysa": "Deoxys-Attack", "deoa": "Deoxys-Attack", "deoxysd": "Deoxys-Defense", "deoxysdefence": "Deoxys-Defense", "deod": "Deoxys-Defense", "deoxyss": "Deoxys-Speed", "deos": "Deoxys-Speed", "eiscuen": "Eiscue-Noice", "eternalfloette": "Floette-Eternal", "eternamax": "Eternatus-Eternamax", "girao": "Giratina-Origin", "giratinao": "Giratina-Origin", "gourgeists": "Gourgeist-Small", "gourgeistl": "Gourgeist-Large", "gourgeistxl": "Gourgeist-Super", "gourgeisth": "Gourgeist-Super", "gourgeisthuge": "Gourgeist-Super", "hoopau": "Hoopa-Unbound", "keldeor": "Keldeo-Resolute", "keldeoresolution": "Keldeo-Resolute", "kyuremb": "Kyurem-Black", "kyuremw": "Kyurem-White", "landorust": "Landorus-Therian", "meloettap": "Meloetta-Pirouette", "meloettas": "Meloetta-Pirouette", "meloettastep": "Meloetta-Pirouette", "meowsticfemale": "Meowstic-F", "morpekoh": "Morpeko-Hangry", "pumpkaboohuge": "Pumpkaboo-Super", "rotomc": "Rotom-Mow", "rotomcut": "Rotom-Mow", "rotomf": "Rotom-Frost", "rotomh": "Rotom-Heat", "rotoms": "Rotom-Fan", "rotomspin": "Rotom-Fan", "rotomw": "Rotom-Wash", "shaymins": "Shaymin-Sky", "skymin": "Shaymin-Sky", "thundurust": "Thundurus-Therian", "thundyt": "Thundurus-Therian", "tornadust": "Tornadus-Therian", "tornt": "Tornadus-Therian", "toxtricityl": "Toxtricity-Low-Key", "toxtricitylk": "Toxtricity-Low-Key", "wormadamg": "Wormadam-Sandy", "wormadamground": "Wormadam-Sandy", "wormadamsandycloak": "Wormadam-Sandy", "wormadams": "Wormadam-Trash", "wormadamsteel": "Wormadam-Trash", "wormadamtrashcloak": "Wormadam-Trash", "floettee": "Floette-Eternal", "floetteeternalflower": "Floette-Eternal", "ashgreninja": "Greninja-Ash", "zydog": "Zygarde-10%", "zydoge": "Zygarde-10%", "zygardedog": "Zygarde-10%", "zygarde50": "Zygarde", "zyc": "Zygarde-Complete", "zygarde100": "Zygarde-Complete", "zygardec": "Zygarde-Complete", "zygardefull": "Zygarde-Complete", "zygod": "Zygarde-Complete", "perfectzygarde": "Zygarde-Complete", "oricoriob": "Oricorio", "oricoriobaile": "Oricorio", "oricoriof": "Oricorio", "oricoriofire": "Oricorio", "oricorioe": "Oricorio-Pom-Pom", "oricorioelectric": "Oricorio-Pom-Pom", "oricoriog": "Oricorio-Sensu", "oricorioghost": "Oricorio-Sensu", "oricorios": "Oricorio-Sensu", "oricoriop": "Oricorio-Pa'u", "oricoriopsychic": "Oricorio-Pa'u", "lycanrocmidday": "Lycanroc", "lycanrocday": "Lycanroc", "lycanrocn": "Lycanroc-Midnight", "lycanrocnight": "Lycanroc-Midnight", "lycanrocd": "Lycanroc-Dusk", "ndm": "Necrozma-Dusk-Mane", "ndw": "Necrozma-Dawn-Wings", "necrozmadm": "Necrozma-Dusk-Mane", "necrozmadusk": "Necrozma-Dusk-Mane", "duskmane": "Necrozma-Dusk-Mane", "duskmanenecrozma": "Necrozma-Dusk-Mane", "necrozmadw": "Necrozma-Dawn-Wings", "necrozmadawn": "Necrozma-Dawn-Wings", "dawnwings": "Necrozma-Dawn-Wings", "dawnwingsnecrozma": "Necrozma-Dawn-Wings", "necrozmau": "Necrozma-Ultra", "ultranecrozma": "Necrozma-Ultra", "unecro": "Necrozma-Ultra", "ufop": "Pokestar UFO-2", "ufopsychic": "Pokestar UFO-2", "zacianc": "Zacian-Crowned", "zamazentac": "Zamazenta-Crowned", // base formes "nidoranfemale": "Nidoran-F", "nidoranmale": "Nidoran-M", "wormadamgrass": "Wormadam", "wormadamp": "Wormadam", "wormadamplant": "Wormadam", "wormadamplantcloak": "Wormadam", "cherrimo": "Cherrim", "cherrimovercast": "Cherrim", "giratinaa": "Giratina", "giratinaaltered": "Giratina", "shayminl": "Shaymin", "shayminland": "Shaymin", "basculinr": "Basculin", "basculinred": "Basculin", "basculinredstripe": "Basculin", "basculinredstriped": "Basculin", "darmanitans": "Darmanitan", "darmanitanstandard": "Darmanitan", "darmanitanstandardmode": "Darmanitan", "tornadusi": "Tornadus", "tornadusincarnate": "Tornadus", "tornadusincarnation": "Tornadus", "thundurusi": "Thundurus", "thundurusincarnate": "Thundurus", "thundurusincarnation": "Thundurus", "landorusi": "Landorus", "landorusincarnate": "Landorus", "landorusincarnation": "Landorus", "keldeoo": "Keldeo", "keldeoordinary": "Keldeo", "meloettaa": "Meloetta", "meloettaaria": "Meloetta", "meloettavoice": "Meloetta", "meowsticm": "Meowstic", "meowsticmale": "Meowstic", "aegislashs": "Aegislash", "aegislashshield": "Aegislash", "pumpkabooaverage": "Pumpkaboo", "gourgeistaverage": "Gourgeist", "hoopac": "Hoopa", "hoopaconfined": "Hoopa", "wishiwashisolo": "Wishiwashi", "pokestarufof": "Pokestar UFO", "pokestarufoflying": "Pokestar UFO", "toxtricitya": "Toxtricity", "toxtricityamped": "Toxtricity", "ufof": "Pokestar UFO", "ufoflying": "Pokestar UFO", // event formes "rockruffdusk": "Rockruff", // totem formes "raticatet": "Raticate-Alola-Totem", "totemalolanraticate": "Raticate-Alola-Totem", "totemraticate": "Raticate-Alola-Totem", "totemraticatea": "Raticate-Alola-Totem", "totemraticatealola": "Raticate-Alola-Totem", "marowakt": "Marowak-Alola-Totem", "totemalolanmarowak": "Marowak-Alola-Totem", "totemmarowak": "Marowak-Alola-Totem", "totemmarowaka": "Marowak-Alola-Totem", "totemmarowakalola": "Marowak-Alola-Totem", "gumshoost": "Gumshoos-Totem", "totemgumshoos": "Gumshoos-Totem", "totemvikavolt": "Vikavolt-Totem", "vikavoltt": "Vikavolt-Totem", "ribombeet": "Ribombee-Totem", "totemribombee": "Ribombee-Totem", "araquanidt": "Araquanid-Totem", "totemaraquanid": "Araquanid-Totem", "lurantist": "Lurantis-Totem", "totemlurantis": "Lurantis-Totem", "salazzlet": "Salazzle-Totem", "totemsalazzle": "Salazzle-Totem", "mimikyut": "Mimikyu-Totem", "totemmimikyu": "Mimikyu-Totem", "kommoot": "Kommo-o-Totem", "totemkommoo": "Kommo-o-Totem", // cosmetic formes "alcremierubycream": "Alcremie", "alcremiematcha": "Alcremie", "alcremiemint": "Alcremie", "alcremielemon": "Alcremie", "alcremiesalted": "Alcremie", "alcremierubyswirl": "Alcremie", "alcremiecaramel": "Alcremie", "alcremierainbow": "Alcremie", "burmygrass": "Burmy", "burmyplant": "Burmy", "burmysandy": "Burmy", "burmytrash": "Burmy", "shelloseast": "Shellos", "shelloswest": "Shellos", "gastrodone": "Gastrodon", "gastrodoneast": "Gastrodon", "gastrodoneastsea": "Gastrodon", "gastrodonw": "Gastrodon", "gastrodonwest": "Gastrodon", "gastrodonwestsea": "Gastrodon", "deerlingspring": "Deerling", "deerlingsummer": "Deerling", "deerlingautumn": "Deerling", "deerlingwinter": "Deerling", "sawsbuckspring": "Sawsbuck", "sawsbucksummer": "Sawsbuck", "sawsbuckautumn": "Sawsbuck", "sawsbuckwinter": "Sawsbuck", "vivillonarchipelago": "Vivillon", "vivilloncontinental": "Vivillon", "vivillonelegant": "Vivillon", "vivillongarden": "Vivillon", "vivillonhighplains": "Vivillon", "vivillonicysnow": "Vivillon", "vivillonjungle": "Vivillon", "vivillonmarine": "Vivillon", "vivillonmodern": "Vivillon", "vivillonmonsoon": "Vivillon", "vivillonocean": "Vivillon", "vivillonpolar": "Vivillon", "vivillonriver": "Vivillon", "vivillonsandstorm": "Vivillon", "vivillonsavanna": "Vivillon", "vivillonsun": "Vivillon", "vivillontundra": "Vivillon", "flabb": "Flabebe", "flabebered": "Flabebe", "flabebeblue": "Flabebe", "flabebeorange": "Flabebe", "flabebewhite": "Flabebe", "flabebeyellow": "Flabebe", "flabbred": "Flabebe", "flabbblue": "Flabebe", "flabborange": "Flabebe", "flabbwhite": "Flabebe", "flabbyellow": "Flabebe", "floettered": "Floette", "floetteblue": "Floette", "floetteorange": "Floette", "floettewhite": "Floette", "floetteyellow": "Floette", "florgesred": "Florges", "florgesblue": "Florges", "florgesorange": "Florges", "florgeswhite": "Florges", "florgesyellow": "Florges", "furfroudandy": "Furfrou", "furfroudebutante": "Furfrou", "furfroudiamond": "Furfrou", "furfrouheart": "Furfrou", "furfroukabuki": "Furfrou", "furfroulareine": "Furfrou", "furfroumatron": "Furfrou", "furfroupharaoh": "Furfrou", "furfroustar": "Furfrou", "miniorred": "Minior", "miniororange": "Minior", "minioryellow": "Minior", "miniorgreen": "Minior", "miniorblue": "Minior", "miniorindigo": "Minior", "miniorviolet": "Minior", "pokestargiant2": "Pokestar Giant", "pokestarmonica2": "Pokestar Giant", "pokestarufopropu1": "Pokestar UFO", "pokestarpropu1": "Pokestar UFO", "pokestarpropu2": "Pokestar UFO-2", "pokestarbrycenmanprop": "Pokestar Brycen-Man", "pokestarproph1": "Pokestar Brycen-Man", "pokestarmtprop": "Pokestar MT", "pokestarpropm1": "Pokestar MT", "pokestarmt2prop": "Pokestar MT2", "pokestarpropm2": "Pokestar MT2", "pokestartransportprop": "Pokestar Transport", "pokestarpropt1": "Pokestar Transport", "pokestargiantpropo1": "Pokestar Giant", "pokestarpropo1": "Pokestar Giant", "pokestargiantpropo2": "Pokestar Giant", "pokestarpropo2": "Pokestar Giant", "pokestarhumanoidprop": "Pokestar Humanoid", "pokestarpropc1": "Pokestar Humanoid", "pokestarmonsterprop": "Pokestar Monster", "pokestarpropc2": "Pokestar Monster", "pokestarspiritprop": "Pokestar Spirit", "pokestarpropg1": "Pokestar Spirit", "pokestarblackdoorprop": "Pokestar Black Door", "pokestarpropw1": "Pokestar Black Door", "pokestarwhitedoorprop": "Pokestar White Door", "pokestarpropw2": "Pokestar White Door", "pokestarf00prop": "Pokestar F00", "pokestarpropr1": "Pokestar F00", "pokestarf002prop": "Pokestar F002", "pokestarpropr2": "Pokestar F002", "pokestarblackbeltprop": "Pokestar Black Belt", "pokestarpropk1": "Pokestar Black Belt", "giant2": "Pokestar Giant", "monica2": "Pokestar Giant", "ufopropu1": "Pokestar UFO", "propu1": "Pokestar UFO", "ufopropu2": "Pokestar UFO-2", "propu2": "Pokestar UFO-2", "brycenmanprop": "Pokestar Brycen-Man", "proph1": "Pokestar Brycen-Man", "mtprop": "Pokestar MT", "propm1": "Pokestar MT", "mt2prop": "Pokestar MT2", "propm2": "Pokestar MT2", "transportprop": "Pokestar Transport", "propt1": "Pokestar Transport", "giantpropo1": "Pokestar Giant", "propo1": "Pokestar Giant", "giantpropo2": "Pokestar Giant", "propo2": "Pokestar Giant", "humanoidprop": "Pokestar Humanoid", "propc1": "Pokestar Humanoid", "monsterprop": "Pokestar Monster", "propc2": "Pokestar Monster", "spiritprop": "Pokestar Spirit", "propg1": "Pokestar Spirit", "blackdoorprop": "Pokestar Black Door", "propw1": "Pokestar Black Door", "whitedoorprop": "Pokestar White Door", "propw2": "Pokestar White Door", "f00prop": "Pokestar F00", "propr1": "Pokestar F00", "f002prop": "Pokestar F002", "propr2": "Pokestar F002", "blackbeltprop": "Pokestar Black Belt", "propk1": "Pokestar Black Belt", // abilities "ph": "Poison Heal", "regen": "Regenerator", "stag": "Shadow Tag", // items "assvest": "Assault Vest", "av": "Assault Vest", "balloon": "Air Balloon", "band": "Choice Band", "cb": "Choice Band", "ebelt": "Expert Belt", "fightgem": "Fighting Gem", "flightgem": "Flying Gem", "goggles": "Safety Goggles", "helmet": "Rocky Helmet", "lefties": "Leftovers", "lo": "Life Orb", "lorb": "Life Orb", "sash": "Focus Sash", "scarf": "Choice Scarf", "specs": "Choice Specs", "wp": "Weakness Policy", // pokemon "aboma": "Abomasnow", "aegi": "Aegislash", "aegiblade": "Aegislash-Blade", "aegis": "Aegislash", "aero": "Aerodactyl", "amph": "Ampharos", "arc": "Arceus", "arceusnormal": "Arceus", "ashgren": "Greninja-Ash", "azu": "Azumarill", "bdrill": "Beedrill", "bee": "Beedrill", "birdjesus": "Pidgeot", "bish": "Bisharp", "blace": "Blacephalon", "bliss": "Blissey", "bulu": "Tapu Bulu", "camel": "Camerupt", "cathy": "Trevenant", "chandy": "Chandelure", "chomp": "Garchomp", "clef": "Clefable", "coba": "Cobalion", "cofag": "Cofagrigus", "conk": "Conkeldurr", "cress": "Cresselia", "cube": "Kyurem-Black", "cune": "Suicune", "darm": "Darmanitan", "dnite": "Dragonite", "dogars": "Koffing", "don": "Groudon", "drill": "Excadrill", "driller": "Excadrill", "dug": "Dugtrio", "duggy": "Dugtrio", "ekiller": "Arceus", "esca": "Escavalier", "ferro": "Ferrothorn", "fini": "Tapu Fini", "forry": "Forretress", "fug": "Rayquaza", "gar": "Gengar", "garde": "Gardevoir", "gatr": "Feraligatr", "gene": "Genesect", "gira": "Giratina", "gren": "Greninja", "gross": "Metagross", "gyara": "Gyarados", "hera": "Heracross", "hippo": "Hippowdon", "honch": "Honchkrow", "kanga": "Kangaskhan", "karp": "Magikarp", "kart": "Kartana", "keld": "Keldeo", "klef": "Klefki", "koko": "Tapu Koko", "kou": "Raikou", "krook": "Krookodile", "kyub": "Kyurem-Black", "kyuw": "Kyurem-White", "lando": "Landorus", "landoi": "Landorus", "landot": "Landorus-Therian", "lego": "Nihilego", "lele": "Tapu Lele", "linda": "Fletchinder", "luke": "Lucario", "lurk": "Golurk", "mage": "Magearna", "mamo": "Mamoswine", "mandi": "Mandibuzz", "mence": "Salamence", "milo": "Milotic", "morfentshusbando": "Gengar", "naga": "Naganadel", "nape": "Infernape", "nebby": "Cosmog", "neckboy": "Exeggutor-Alola", "nidok": "Nidoking", "nidoq": "Nidoqueen", "obama": "Abomasnow", "ogre": "Kyogre", "ohmagod": "Plasmanta", "p2": "Porygon2", "pert": "Swampert", "pex": "Toxapex", "phero": "Pheromosa", "pika": "Pikachu", "pory2": "Porygon2", "poryz": "Porygon-Z", "pyuku": "Pyukumuku", "pz": "Porygon-Z", "queen": "Nidoqueen", "rachi": "Jirachi", "rank": "Reuniclus", "ray": "Rayquaza", "reuni": "Reuniclus", "sab": "Sableye", "sable": "Sableye", "scept": "Sceptile", "scoli": "Scolipede", "serp": "Serperior", "shao": "Mienshao", "skarm": "Skarmory", "smogon": "Koffing", "smogonbird": "Talonflame", "snips": "Drapion", "staka": "Stakataka", "steela": "Celesteela", "sui": "Suicune", "swole": "Buzzwole", "talon": "Talonflame", "tang": "Tangrowth", "terra": "Terrakion", "tflame": "Talonflame", "thundy": "Thundurus", "toed": "Politoed", "torn": "Tornadus", "tran": "Heatran", "ttar": "Tyranitar", "venu": "Venusaur", "viriz": "Virizion", "whimsi": "Whimsicott", "xern": "Xerneas", "xurk": "Xurkitree", "ygod": "Yveltal", "zam": "Alakazam", "zard": "Charizard", "zong": "Bronzong", "zor": "Scizor", "zyg": "Zygarde", // ultra beast codenames "ub01": "Nihilego", "ub02a": "Buzzwole", "ub02b": "Pheromosa", "ub03": "Xurkitree", "ub04blade": "Kartana", "ub04blaster": "Celesteela", "ub05": "Guzzlord", "ubburst": "Blacephalon", "ubassembly": "Stakataka", "ubadhesive": "Poipole", // moves "bb": "Brave Bird", "bd": "Belly Drum", "bpass": "Baton Pass", "bp": "Baton Pass", "cc": "Close Combat", "cm": "Calm Mind", "dbond": "Destiny Bond", "dd": "Dragon Dance", "dv": "Dark Void", "eq": "Earthquake", "espeed": "ExtremeSpeed", "eterrain": "Electric Terrain", "faintattack": "Feint Attack", "glowpunch": "Power-up Punch", "gterrain": "Grassy Terrain", "hp": "Hidden Power", "hpbug": "Hidden Power Bug", "hpdark": "Hidden Power Dark", "hpdragon": "Hidden Power Dragon", "hpelectric": "Hidden Power electric", "hpfighting": "Hidden Power Fighting", "hpfire": "Hidden Power Fire", "hpflying": "Hidden Power Flying", "hpghost": "Hidden Power Ghost", "hpgrass": "Hidden Power Grass", "hpground": "Hidden Power Ground", "hpice": "Hidden Power Ice", "hppoison": "Hidden Power Poison", "hppsychic": "Hidden Power Psychic", "hprock": "Hidden Power Rock", "hpsteel": "Hidden Power Steel", "hpwater": "Hidden Power Water", "hjk": "High Jump Kick", "hijumpkick": "High Jump Kick", "mterrain": "Misty Terrain", "np": "Nasty Plot", "pfists": "Plasma Fists", "playaround": "Play Rough", "pterrain": "Psychic Terrain", "pup": "Power-up Punch", "qd": "Quiver Dance", "rocks": "Stealth Rock", "sd": "Swords Dance", "se": "Stone Edge", "spin": "Rapid Spin", "sr": "Stealth Rock", "sub": "Substitute", "tr": "Trick Room", "troom": "Trick Room", "tbolt": "Thunderbolt", "tspikes": "Toxic Spikes", "twave": "Thunder Wave", "vicegrip": "Vise Grip", "web": "Sticky Web", "wow": "Will-O-Wisp", // z-moves "10mv": "10,000,000 Volt Thunderbolt", "10mvt": "10,000,000 Volt Thunderbolt", "clangorous": "Clangorous Soulblaze", "cs": "Clangorous Soulblaze", "ee": "Extreme Evoboost", "extreme": "Extreme Evoboost", "genesis": "Genesis Supernova", "goa": "Guardian of Alola", "gs": "Genesis Supernova", "guardian": "Guardian of Alola", "lets": "Let's Snuggle Forever", "light": "Light That Burns the Sky", "lsf": "Let's Snuggle Forever", "ltbts": "Light That Burns the Sky", "malicious": "Malicious Moonsault", "menacing": "Menacing Moonraze Maelstrom", "mmm": "Menacing Moonraze Maelstrom", "moonsault": "Malicious Moonsault", "oceanic": "Oceanic Operetta", "oo": "Oceanic Operetta", "pp": "Pulverizing Pancake", "pulverizing": "Pulverizing Pancake", "sar": "Sinister Arrow Raid", "searing": "Searing Sunraze Smash", "sinister": "Sinister Arrow Raid", "ss": "Stoked Sparksurfer", "sss": "Searing Sunraze Smash", "sssss": "Soul-Stealing 7-Star Strike", "ss7ss": "Soul-Stealing 7-Star Strike", "soul": "Soul-Stealing 7-Star Strike", "soulstealingsevenstarstrike": "Soul-Stealing 7-Star Strike", "splintered": "Splintered Stormshards", "stoked": "Stoked Sparksurfer", "stormshards": "Splintered Stormshards", "zbug": "Savage Spin-Out", "zclangingscales": "Clangorous Soulblaze", "zdark": "Black Hole Eclipse", "zdarkestlariat": "Malicious Moonsault", "zdawnwingsnecrozma": "Menacing Moonraze Maelstrom", "zdecidueye": "Sinister Arrow Raid", "zdragon": "Devastating Drake", "zduskmanenecrozma": "Searing Sunraze Smash", "zelectric": "Gigavolt Havoc", "zeevee": "Extreme Evoboost", "zevo": "Extreme Evoboost", "zfairy": "Twinkle Tackle", "zflying": "Supersonic Skystrike", "zfighting": "All-Out Pummeling", "zfire": "Inferno Overdrive", "zghost": "Never-Ending Nightmare", "zgigaimpact": "Pulverizing Pancake", "zgrass": "Bloom Doom", "zground": "Tectonic Rage", "zice": "Subzero Slammer", "zincineroar": "Malicious Moonsault", "zkommoo": "Clangorous Soulblaze", "zlastresort": "Extreme Evoboost", "zlunala": "Menacing Moonraze Maelstrom", "zlycanroc": "Splintered Stormshards", "znaturesmadness": "Guardian of Alola", "zmarshadow": "Soul-Stealing 7-Star Strike", "zmew": "Genesis Supernova", "zmimikyu": "Let's Snuggle Forever", "zmoongeistbeam": "Menacing Moonraze Maelstrom", "znecrozma": "Light That Burns the Sky", "znormal": "Breakneck Blitz", "zrock": "Continental Crush", "zphotongeyser": "Light That Burns the Sky", "zpikachu": "Catastropika", "zpikachucap": "10,000,000 Volt Thunderbolt", "zplayrough": "Let's Snuggle Forever", "zpoison": "Acid Downpour", "zprimarina": "Oceanic Operetta", "zpsychic": "Shattered Psyche", "zraichu": "Stoked Sparksurfer", "zsnorlax": "Pulverizing Pancake", "zsolgaleo": "Searing Sunraze Smash", "zsparklingaria": "Oceanic Operetta", "zspectralthief": "Soul-Stealing 7-Star Strike", "zspiritshackle": "Sinister Arrow Raid", "zsunsteelstrike": "Searing Sunraze Smash", "zsteel": "Corkscrew Crash", "zstoneedge": "Splintered Stormshards", "ztapu": "Guardian of Alola", "zthunderbolt": "10,000,000 Volt Thunderbolt", "zultranecrozma": "Light That Burns the Sky", "zvolttackle": "Catastropika", "zwater": "Hydro Vortex", // Max moves "maxbug": "Max Flutterby", "maxdark": "Max Darkness", "maxdragon": "Max Wyrmwind", "maxelectric": "Max Lightning", "maxfairy": "Max Starfall", "maxfighting": "Max Knuckle", "maxfire": "Max Flare", "maxflying": "Max Airstream", "maxghost": "Max Phantasm", "maxgrass": "Max Overgrowth", "maxground": "Max Quake", "maxice": "Max Hailstorm", "maxnormal": "Max Strike", "maxpoison": "Max Ooze", "maxpsychic": "Max Mindstorm", "maxrock": "Max Rockfall", "maxsteel": "Max Steelspike", "maxwater": "Max Geyser", "maxstatus": "Max Guard", "maxprotect": "Max Guard", // Japanese names "fushigidane": "Bulbasaur", "fushigisou": "Ivysaur", "fushigibana": "Venusaur", "hitokage": "Charmander", "rizaado": "Charmeleon", "rizaadon": "Charizard", "zenigame": "Squirtle", "kameeru": "Wartortle", "kamekkusu": "Blastoise", "kyatapii": "Caterpie", "toranseru": "Metapod", "batafurii": "Butterfree", "biidoru": "Weedle", "kokuun": "Kakuna", "supiaa": "Beedrill", "poppo": "Pidgey", "pijon": "Pidgeotto", "pijotto": "Pidgeot", "koratta": "Rattata", "ratta": "Raticate", "onisuzume": "Spearow", "onidoriru": "Fearow", "aabo": "Ekans", "aabokku": "Arbok", "pikachuu": "Pikachu", "raichuu": "Raichu", "sando": "Sandshrew", "sandopan": "Sandslash", "nidoranmesu": "Nidoran-F", "nidoriina": "Nidorina", "nidokuin": "Nidoqueen", "nidoranosu": "Nidoran-M", "nidoriino": "Nidorino", "nidokingu": "Nidoking", "pippi": "Clefairy", "pikushii": "Clefable", "rokon": "Vulpix", "kyuukon": "Ninetales", "purin": "Jigglypuff", "pukurin": "Wigglytuff", "zubatto": "Zubat", "gorubatto": "Golbat", "nazonokusa": "Oddish", "kusaihana": "Gloom", "rafureshia": "Vileplume", "parasu": "Paras", "parasekuto": "Parasect", "konpan": "Venonat", "morufon": "Venomoth", "diguda": "Diglett", "dagutorio": "Dugtrio", "nyaasu": "Meowth", "perushian": "Persian", "kodakku": "Psyduck", "gorudakku": "Golduck", "mankii": "Mankey", "okorizaru": "Primeape", "gaadi": "Growlithe", "uindi": "Arcanine", "nyoromo": "Poliwag", "nyorozo": "Poliwhirl", "nyorobon": "Poliwrath", "keeshy": "Abra", "yungeraa": "Kadabra", "fuudin": "Alakazam", "wanrikii": "Machop", "goorikii": "Machoke", "kairikii": "Machamp", "madatsubomi": "Bellsprout", "utsudon": "Weepinbell", "utsubotto": "Victreebel", "menokurage": "Tentacool", "dokukurage": "Tentacruel", "ishitsubute": "Geodude", "goroon": "Graveler", "goroonya": "Golem", "poniita": "Ponyta", "gyaroppu": "Rapidash", "yadon": "Slowpoke", "yadoran": "Slowbro", "koiru": "Magnemite", "reakoiru": "Magneton", "kamonegi": "Farfetch'd", "doodoo": "Doduo", "doodorio": "Dodrio", "pauwau": "Seel", "jugon": "Dewgong", "betobetaa": "Grimer", "betobeton": "Muk", "sherudaa": "Shellder", "parushen": "Cloyster", "goosu": "Gastly", "goosuto": "Haunter", "gengaa": "Gengar", "iwaaku": "Onix", "suriipu": "Drowzee", "suriipaa": "Hypno", "kurabu": "Krabby", "kinguraa": "Kingler", "biriridama": "Voltorb", "marumain": "Electrode", "tamatama": "Exeggcute", "nasshii": "Exeggutor", "karakara": "Cubone", "garagara": "Marowak", "sawamuraa": "Hitmonlee", "ebiwaraa": "Hitmonchan", "beroringa": "Lickitung", "dogaasu": "Koffing", "matadogasu": "Weezing", "saihoon": "Rhyhorn", "saidon": "Rhydon", "rakkii": "Chansey", "monjara": "Tangela", "garuura": "Kangaskhan", "tattsuu": "Horsea", "shiidora": "Seadra", "tosakinto": "Goldeen", "azumaou": "Seaking", "hitodeman": "Staryu", "sutaamii": "Starmie", "bariyaado": "Mr. Mime", "sutoraiku": "Scyther", "ruujura": "Jynx", "erebuu": "Electabuzz", "buubaa": "Magmar", "kairosu": "Pinsir", "kentarosu": "Tauros", "koikingu": "Magikarp", "gyaradosu": "Gyarados", "rapurasu": "Lapras", "metamon": "Ditto", "iibui": "Eevee", "shawaazu": "Vaporeon", "sandaasu": "Jolteon", "buusutaa": "Flareon", "porigon": "Porygon", "omunaito": "Omanyte", "omusutaa": "Omastar", "kabutopusu": "Kabutops", "putera": "Aerodactyl", "kabigon": "Snorlax", "furiizaa": "Articuno", "sandaa": "Zapdos", "faiyaa": "Moltres", "miniryuu": "Dratini", "hakuryuu": "Dragonair", "kairyuu": "Dragonite", "myuutsuu": "Mewtwo", "myuu": "Mew", "chikoriita": "Chikorita", "beiriifu": "Bayleef", "meganiumu": "Meganium", "hinoarashi": "Cyndaquil", "magumarashi": "Quilava", "bakufuun": "Typhlosion", "waninoko": "Totodile", "arigeitsu": "Croconaw", "oodairu": "Feraligatr", "otachi": "Sentret", "ootachi": "Furret", "hoohoo": "Hoothoot", "yorunozuku": "Noctowl", "rediba": "Ledyba", "redian": "Ledian", "itomaru": "Spinarak", "ariadosu": "Ariados", "kurobatto": "Crobat", "chonchii": "Chinchou", "rantaan": "Lanturn", "pichuu": "Pichu", "py": "Cleffa", "pupurin": "Igglybuff", "togepii": "Togepi", "togechikku": "Togetic", "neitei": "Natu", "neiteio": "Xatu", "meriipu": "Mareep", "mokoko": "Flaaffy", "denryuu": "Ampharos", "kireihana": "Bellossom", "mariru": "Marill", "mariruri": "Azumarill", "usokkii": "Sudowoodo", "nyorotono": "Politoed", "hanekko": "Hoppip", "popokko": "Skiploom", "watakko": "Jumpluff", "eipamu": "Aipom", "himanattsu": "Sunkern", "kimawari": "Sunflora", "yanyanma": "Yanma", "upaa": "Wooper", "nuoo": "Quagsire", "eefi": "Espeon", "burakkii": "Umbreon", "yamikarasu": "Murkrow", "yadokingu": "Slowking", "muuma": "Misdreavus", "annoon": "Unown", "soonansu": "Wobbuffet", "kirinriki": "Girafarig", "kunugidama": "Pineco", "foretosu": "Forretress", "nokotchi": "Dunsparce", "guraigaa": "Gligar", "haganeeru": "Steelix", "buruu": "Snubbull", "guranburu": "Granbull", "hariisen": "Qwilfish", "hassamu": "Scizor", "tsubotsubo": "Shuckle", "herakurosu": "Heracross", "nyuura": "Sneasel", "himeguma": "Teddiursa", "ringuma": "Ursaring", "magumaggu": "Slugma", "magukarugo": "Magcargo", "urimuu": "Swinub", "inomuu": "Piloswine", "saniigo": "Corsola", "teppouo": "Remoraid", "okutan": "Octillery", "deribaado": "Delibird", "mantain": "Mantine", "eaamudo": "Skarmory", "derubiru": "Houndour", "herugaa": "Houndoom", "kingudora": "Kingdra", "gomazou": "Phanpy", "donfan": "Donphan", "porigon2": "Porygon2", "odoshishi": "Stantler", "dooburu": "Smeargle", "barukii": "Tyrogue", "kapoeraa": "Hitmontop", "muchuuru": "Smoochum", "erekiddo": "Elekid", "buby": "Magby", "mirutanku": "Miltank", "hapinasu": "Blissey", "suikun": "Suicune", "yoogirasu": "Larvitar", "sanagirasu": "Pupitar", "bangirasu": "Tyranitar", "rugia": "Lugia", "houou": "Ho-Oh", "sereby": "Celebi", "kimori": "Treecko", "juputoru": "Grovyle", "jukain": "Sceptile", "achamo": "Torchic", "wakashamo": "Combusken", "bashaamo": "Blaziken", "mizugorou": "Mudkip", "numakuroo": "Marshtomp", "raguraaji": "Swampert", "pochiena": "Poochyena", "guraena": "Mightyena", "jiguzaguma": "Zigzagoon", "massuguma": "Linoone", "kemusso": "Wurmple", "karasarisu": "Silcoon", "agehanto": "Beautifly", "mayurudo": "Cascoon", "dokukeiru": "Dustox", "hasuboo": "Lotad", "hasuburero": "Lombre", "runpappa": "Ludicolo", "taneboo": "Seedot", "konohana": "Nuzleaf", "daatengu": "Shiftry", "subame": "Taillow", "oosubame": "Swellow", "kyamome": "Wingull", "perippaa": "Pelipper", "rarutosu": "Ralts", "kiruria": "Kirlia", "saanaito": "Gardevoir", "ametama": "Surskit", "amemoosu": "Masquerain", "kinokoko": "Shroomish", "kinogassa": "Breloom", "namakero": "Slakoth", "yarukimono": "Vigoroth", "kekkingu": "Slaking", "tsuchinin": "Nincada", "tekkanin": "Ninjask", "nukenin": "Shedinja", "gonyonyo": "Whismur", "dogoomu": "Loudred", "bakuongu": "Exploud", "makunoshita": "Makuhita", "hariteyama": "Hariyama", "ruriri": "Azurill", "nozupasu": "Nosepass", "eneko": "Skitty", "enekororo": "Delcatty", "yamirami": "Sableye", "kuchiito": "Mawile", "kokodora": "Aron", "kodora": "Lairon", "bosugodora": "Aggron", "asanan": "Meditite", "chaaremu": "Medicham", "rakurai": "Electrike", "raiboruto": "Manectric", "purasuru": "Plusle", "mainan": "Minun", "barubiito": "Volbeat", "irumiize": "Illumise", "rozeria": "Roselia", "gokurin": "Gulpin", "marunoomu": "Swalot", "kibania": "Carvanha", "samehadaa": "Sharpedo", "hoeruko": "Wailmer", "hoeruoo": "Wailord", "donmeru": "Numel", "bakuuda": "Camerupt", "kootasu": "Torkoal", "banebuu": "Spoink", "buupiggu": "Grumpig", "patchiiru": "Spinda", "nakkuraa": "Trapinch", "biburaaba": "Vibrava", "furaigon": "Flygon", "sabonea": "Cacnea", "nokutasu": "Cacturne", "chirutto": "Swablu", "chirutarisu": "Altaria", "zanguusu": "Zangoose", "habuneeku": "Seviper", "runatoon": "Lunatone", "sorurokku": "Solrock", "dojotchi": "Barboach", "namazun": "Whiscash", "heigani": "Corphish", "shizarigaa": "Crawdaunt", "yajiron": "Baltoy", "nendooru": "Claydol", "ririira": "Lileep", "yureidoru": "Cradily", "anopusu": "Anorith", "aamarudo": "Armaldo", "hinbasu": "Feebas", "mirokarosu": "Milotic", "powarun": "Castform", "kakureon": "Kecleon", "kagebouzu": "Shuppet", "jupetta": "Banette", "yomawaru": "Duskull", "samayooru": "Dusclops", "toropiusu": "Tropius", "chiriin": "Chimecho", "abusoru": "Absol", "soonano": "Wynaut", "yukiwarashi": "Snorunt", "onigoori": "Glalie", "tamazarashi": "Spheal", "todoguraa": "Sealeo", "todozeruga": "Walrein", "paaruru": "Clamperl", "hanteeru": "Huntail", "sakurabisu": "Gorebyss", "jiiransu": "Relicanth", "rabukasu": "Luvdisc", "tatsubei": "Bagon", "komoruu": "Shelgon", "boomanda": "Salamence", "danbaru": "Beldum", "metangu": "Metang", "metagurosu": "Metagross", "rejirokku": "Regirock", "rejiaisu": "Regice", "rejisuchiru": "Registeel", "rateiasu": "Latias", "rateiosu": "Latios", "kaiooga": "Kyogre", "guraadon": "Groudon", "rekkuuza": "Rayquaza", "jiraachi": "Jirachi", "deokishisu": "Deoxys", "naetoru": "Turtwig", "hayashigame": "Grotle", "dodaitosu": "Torterra", "hikozaru": "Chimchar", "moukazaru": "Monferno", "goukazaru": "Infernape", "potchama": "Piplup", "pottaishi": "Prinplup", "enperuto": "Empoleon", "mukkuru": "Starly", "mukubaado": "Staravia", "mukuhooku": "Staraptor", "bippa": "Bidoof", "biidaru": "Bibarel", "korobooshi": "Kricketot", "korotokku": "Kricketune", "korinku": "Shinx", "rukushio": "Luxio", "rentoraa": "Luxray", "subomii": "Budew", "rozureido": "Roserade", "zugaidosu": "Cranidos", "ramuparudo": "Rampardos", "tatetopusu": "Shieldon", "toridepusu": "Bastiodon", "minomutchi": "Burmy", "minomadamu": "Wormadam", "gaameiru": "Mothim", "mitsuhanii": "Combee", "biikuin": "Vespiquen", "buizeru": "Buizel", "furoozeru": "Floatzel", "cherinbo": "Cherubi", "cherimu": "Cherrim", "karanakushi": "Shellos", "toritodon": "Gastrodon", "eteboosu": "Ambipom", "fuwante": "Drifloon", "fuwaraido": "Drifblim", "mimiroru": "Buneary", "mimiroppu": "Lopunny", "muumaaji": "Mismagius", "donkarasu": "Honchkrow", "nyarumaa": "Glameow", "bunyatto": "Purugly", "riishan": "Chingling", "sukanpuu": "Stunky", "sukatanku": "Skuntank", "doomiraa": "Bronzor", "dootakun": "Bronzong", "usohachi": "Bonsly", "manene": "Mime Jr.", "pinpuku": "Happiny", "perappu": "Chatot", "mikaruge": "Spiritomb", "fukamaru": "Gible", "gabaito": "Gabite", "gaburiasu": "Garchomp", "gonbe": "Munchlax", "rioru": "Riolu", "rukario": "Lucario", "hipopotasu": "Hippopotas", "kabarudon": "Hippowdon", "sukorupi": "Skorupi", "dorapion": "Drapion", "guregguru": "Croagunk", "dokuroggu": "Toxicroak", "masukippa": "Carnivine", "keikouo": "Finneon", "neoranto": "Lumineon", "tamanta": "Mantyke", "yukikaburi": "Snover", "yukinooo": "Abomasnow", "manyuura": "Weavile", "jibakoiru": "Magnezone", "beroberuto": "Lickilicky", "dosaidon": "Rhyperior", "mojanbo": "Tangrowth", "erekiburu": "Electivire", "buubaan": "Magmortar", "togekissu": "Togekiss", "megayanma": "Yanmega", "riifia": "Leafeon", "gureishia": "Glaceon", "guraion": "Gliscor", "manmuu": "Mamoswine", "porigonz": "Porygon-Z", "erureido": "Gallade", "dainoozu": "Probopass", "yonowaaru": "Dusknoir", "yukimenoko": "Froslass", "rotomu": "Rotom", "yukushii": "Uxie", "emuritto": "Mesprit", "agunomu": "Azelf", "diaruga": "Dialga", "parukia": "Palkia", "hiidoran": "Heatran", "rejigigasu": "Regigigas", "girateina": "Giratina", "kureseria": "Cresselia", "fione": "Phione", "manafi": "Manaphy", "daakurai": "Darkrai", "sheimi": "Shaymin", "aruseusu": "Arceus", "bikuteini": "Victini", "tsutaaja": "Snivy", "janobii": "Servine", "jarooda": "Serperior", "pokabu": "Tepig", "chaobuu": "Pignite", "enbuoo": "Emboar", "mijumaru": "Oshawott", "futachimaru": "Dewott", "daikenki": "Samurott", "minezumi": "Patrat", "miruhoggu": "Watchog", "yooterii": "Lillipup", "haaderia": "Herdier", "muurando": "Stoutland", "choroneko": "Purrloin", "reparudasu": "Liepard", "yanappu": "Pansage", "yanakkii": "Simisage", "baoppu": "Pansear", "baokkii": "Simisear", "hiyappu": "Panpour", "hiyakkii": "Simipour", "mushaana": "Musharna", "mamepato": "Pidove", "hatooboo": "Tranquill", "kenhorou": "Unfezant", "shimama": "Blitzle", "zeburaika": "Zebstrika", "dangoro": "Roggenrola", "gantoru": "Boldore", "gigaiasu": "Gigalith", "koromori": "Woobat", "kokoromori": "Swoobat", "moguryuu": "Drilbur", "doryuuzu": "Excadrill", "tabunne": "Audino", "dokkoraa": "Timburr", "dotekkotsu": "Gurdurr", "roobushin": "Conkeldurr", "otamaro": "Tympole", "gamagaru": "Palpitoad", "gamageroge": "Seismitoad", "nageki": "Throh", "dageki": "Sawk", "kurumiru": "Sewaddle", "kurumayu": "Swadloon", "hahakomori": "Leavanny", "fushide": "Venipede", "hoiiga": "Whirlipede", "pendoraa": "Scolipede", "monmen": "Cottonee", "erufuun": "Whimsicott", "churine": "Petilil", "doredia": "Lilligant", "basurao": "Basculin", "meguroko": "Sandile", "warubiru": "Krokorok", "warubiaru": "Krookodile", "darumakka": "Darumaka", "hihidaruma": "Darmanitan", "marakatchi": "Maractus", "ishizumai": "Dwebble", "iwaparesu": "Crustle", "zuruggu": "Scraggy", "zuruzukin": "Scrafty", "shinboraa": "Sigilyph", "desumasu": "Yamask", "desukaan": "Cofagrigus", "purotooga": "Tirtouga", "abagoora": "Carracosta", "aaken": "Archen", "aakeosu": "Archeops", "yabukuron": "Trubbish", "dasutodasu": "Garbodor", "zoroa": "Zorua", "zoroaaku": "Zoroark", "chiraamy": "Minccino", "chirachiino": "Cinccino", "gochimu": "Gothita", "gochimiru": "Gothorita", "gochiruzeru": "Gothitelle", "yuniran": "Solosis", "daburan": "Duosion", "rankurusu": "Reuniclus", "koaruhii": "Ducklett", "suwanna": "Swanna", "baniputchi": "Vanillite", "baniritchi": "Vanillish", "baibanira": "Vanilluxe", "shikijika": "Deerling", "mebukijika": "Sawsbuck", "emonga": "Emolga", "kaburumo": "Karrablast", "shubarugo": "Escavalier", "tamagetake": "Foongus", "morobareru": "Amoonguss", "pururiru": "Frillish", "burungeru": "Jellicent", "mamanbou": "Alomomola", "bachuru": "Joltik", "denchura": "Galvantula", "tesshiido": "Ferroseed", "nattorei": "Ferrothorn", "giaru": "Klink", "gigiaru": "Klang", "gigigiaru": "Klinklang", "shibishirasu": "Tynamo", "shibibiiru": "Eelektrik", "shibirudon": "Eelektross", "riguree": "Elgyem", "oobemu": "Beheeyem", "hitomoshi": "Litwick", "ranpuraa": "Lampent", "shandera": "Chandelure", "kibago": "Axew", "onondo": "Fraxure", "ononokusu": "Haxorus", "kumashun": "Cubchoo", "tsunbeaa": "Beartic", "furiijio": "Cryogonal", "chobomaki": "Shelmet", "agirudaa": "Accelgor", "maggyo": "Stunfisk", "kojofuu": "Mienfoo", "kojondo": "Mienshao", "kurimugan": "Druddigon", "gobitto": "Golett", "goruugu": "Golurk", "komatana": "Pawniard", "kirikizan": "Bisharp", "baffuron": "Bouffalant", "washibon": "Rufflet", "uooguru": "Braviary", "baruchai": "Vullaby", "barujiina": "Mandibuzz", "kuitaran": "Heatmor", "aianto": "Durant", "monozu": "Deino", "jiheddo": "Zweilous", "sazandora": "Hydreigon", "meraruba": "Larvesta", "urugamosu": "Volcarona", "kobaruon": "Cobalion", "terakion": "Terrakion", "birijion": "Virizion", "torunerosu": "Tornadus", "borutorosu": "Thundurus", "reshiramu": "Reshiram", "zekuromu": "Zekrom", "randorosu": "Landorus", "kyuremu": "Kyurem", "kerudio": "Keldeo", "meroetta": "Meloetta", "genosekuto": "Genesect", "harimaron": "Chespin", "hariboogu": "Quilladin", "burigaron": "Chesnaught", "fokko": "Fennekin", "teerunaa": "Braixen", "mafokushii": "Delphox", "keromatsu": "Froakie", "gekogashira": "Frogadier", "gekkouga": "Greninja", "gekkougasatoshi": "Greninja-Ash", "satoshigekkouga": "Greninja-Ash", "horubii": "Bunnelby", "horuudo": "Diggersby", "yayakoma": "Fletchling", "hinoyakoma": "Fletchinder", "faiaroo": "Talonflame", "kofukimushi": "Scatterbug", "kofuurai": "Spewpa", "bibiyon": "Vivillon", "shishiko": "Litleo", "kaenjishi": "Pyroar", "furabebe": "Flabébé", "furaette": "Floette", "furaajesu": "Florges", "meeekuru": "Skiddo", "googooto": "Gogoat", "yanchamu": "Pancham", "goronda": "Pangoro", "torimian": "Furfrou", "nyasupaa": "Espurr", "nyaonikusu": "Meowstic", "hitotsuki": "Honedge", "nidangiru": "Doublade", "girugarudo": "Aegislash", "shushupu": "Spritzee", "furefuwan": "Aromatisse", "peroppafu": "Swirlix", "peroriimu": "Slurpuff", "maaiika": "Inkay", "karamanero": "Malamar", "kametete": "Binacle", "gamenodesu": "Barbaracle", "kuzumoo": "Skrelp", "doramidoro": "Dragalge", "udeppou": "Clauncher", "burosutaa": "Clawitzer", "erikiteru": "Helioptile", "erezaado": "Heliolisk", "chigorasu": "Tyrunt", "gachigorasu": "Tyrantrum", "amarusu": "Amaura", "amaruruga": "Aurorus", "ninfia": "Sylveon", "ruchaburu": "Hawlucha", "mereshii": "Carbink", "numera": "Goomy", "numeiru": "Sliggoo", "numerugon": "Goodra", "kureffi": "Klefki", "bokuree": "Phantump", "oorotto": "Trevenant", "baketcha": "Pumpkaboo", "panpujin": "Gourgeist", "kachikooru": "Bergmite", "kurebeesu": "Avalugg", "onbatto": "Noibat", "onbaan": "Noivern", "zeruneasu": "Xerneas", "iberutaru": "Yveltal", "jigarude": "Zygarde", "dianshii": "Diancie", "fuupa": "Hoopa", "borukenion": "Volcanion", "mokuroo": "Rowlet", "fukusuroo": "Dartrix", "junaipaa": "Decidueye", "nyabii": "Litten", "nyahiito": "Torracat", "gaogaen": "Incineroar", "ashimari": "Popplio", "oshamari": "Brionne", "ashireenu": "Primarina", "tsutsukera": "Pikipek", "kerarappa": "Trumbeak", "dodekabashi": "Toucannon", "yanguusu": "Yungoos", "dekaguusu": "Gumshoos", "agojimushi": "Grubbin", "denjimushi": "Charjabug", "kuwaganon": "Vikavolt", "makenkani": "Crabrawler", "kekenkani": "Crabominable", "odoridori": "Oricorio", "aburii": "Cutiefly", "aburibon": "Ribombee", "iwanko": "Rockruff", "rugarugan": "Lycanroc", "yowashi": "Wishiwashi", "hidoide": "Mareanie", "dohidoide": "Toxapex", "dorobanko": "Mudbray", "banbadoro": "Mudsdale", "shizukumo": "Dewpider", "onishizukumo": "Araquanid", "karikiri": "Fomantis", "rarantesu": "Lurantis", "nemashu": "Morelull", "masheedo": "Shiinotic", "yatoumori": "Salandit", "ennyuuto": "Salazzle", "nuikoguma": "Stufful", "kiteruguma": "Bewear", "amakaji": "Bounsweet", "amamaiko": "Steenee", "amaajo": "Tsareena", "kyuwawaa": "Comfey", "yareyuutan": "Oranguru", "nagetsukesaru": "Passimian", "kosokumushi": "Wimpod", "gusokumusha": "Golisopod", "sunabaa": "Sandygast", "shirodesuna": "Palossand", "namakobushi": "Pyukumuku", "taipunuru": "Type: Null", "shiruvuadi": "Silvally", "meteno": "Minior", "nekkoara": "Komala", "bakugamesu": "Turtonator", "mimikkyu": "Mimikyu", "hagigishiri": "Bruxish", "jijiiron": "Drampa", "dadarin": "Dhelmise", "jarako": "Jangmo-o", "jarango": "Hakamo-o", "jararanga": "Kommo-o", "kapukokeko": "Tapu Koko", "kaputetefu": "Tapu Lele", "kapubururu": "Tapu Bulu", "kapurehire": "Tapu Fini", "kosumoggu": "Cosmog", "kosumoumu": "Cosmoem", "sorugareo": "Solgaleo", "runaaara": "Lunala", "utsuroido": "Nihilego", "masshibuun": "Buzzwole", "fierooche": "Pheromosa", "denjumoku": "Xurkitree", "tekkaguya": "Celesteela", "kamitsurugi": "Kartana", "akujikingu": "Guzzlord", "nekurozuma": "Necrozma", "magiana": "Magearna", "maashadoo": "Marshadow", "bebenomu": "Poipole", "aagoyon": "Naganadel", "tsundetsunde": "Stakataka", "zugadoon": "Blacephalon", "merutan": "Meltan", "merumetaru": "Melmetal", }; exports.BattleAliases = BattleAliases;
mit
imasaru/sabbath-school-lessons
src/th/2021-01/01/01.md
4127
--- title: วิกฤติด้านเอกลักษณ์ date: 26/12/2020 --- ### อ่านข้อพระคัมภีร์สำหรับบทเรียนสัปดาห์นี้ อิสยาห์ 1:1-9; อิสยาห์ 1:10-17; อิสยาห์ 1:18; อิสยาห์ 1:19-31; อิสยาห์ 5:1-7 > <p>ข้อควรจำ</p> > “พระยาห์เวห์ตรัสว่า ‘มาเถิด ให้พวกเราสู้ความกัน ถึงบาปของเจ้าเป็นเหมือนสีแดงเข้ม ก็จะขาวอย่างหิมะ ถึงมันจะแดงเหมือนผ้าแดงก็จะเป็นอย่างขนแกะ” (อิสยาห์ 1:18) หลงทางในดินแดนแห่งการหลงลืม ถ้าคุณขับรถยนต์ในประเทศไอร์แลนด์ไปตามถนนแคบแถบชนบทซึ่งมีแนวพุ่มไม้เป็นรั้ว คุณอาจเจอกับการปิดถนนโดยฝูงวัว ซึ่งเดินทางกลับบ้านอย่างช้าๆ แบบสบายๆ หลังจากที่ได้กินอาหารเสียงดังกร้วมกร้าม แม้จะไม่มีคนเลี้ยงสัตว์ไล่ต้อนพวกมัน พวกมันจะกลับไปที่คอกสัตว์ของพวกมัน เอง ซึ่งพวกมันทราบว่าอยู่ที่ไหน พวกมันเป็นฝูงสัตว์ของใคร ถ้าเด็กชายอายุยังน้อยคนหนึ่ง พลัดหลงจากแม่ของเขาและร้องขึ้นว่า “ผมพลัดหลงจากคุณแม่ของผม!” เขาอาจไม่ทราบแน่ว่าเขาอยู่ที่ไหน หรือคุณแม่ของเขาอยู่ที่ไหน แต่ท่ามกลางทะเลแห่งคุณแม่ทั้งหลายที่เดิน ผ่านห้างแห่งนั้น แต่เขาจะทราบว่าคุณแม่ของเขาคือใคร ด้วยตัวเขาเอง ว่าใครคือคุณแม่ของเขา เป็นสิ่งน่าเศร้า ไม่เหมือนฝูงวัวของชาวไอซ์แลนด์ (ยิ่งรู้น้อยกว่าสำหรับเด็กชายตัวเล็กที่พลัดหลง) ชาวยูดาห์ลืมไปว่าพวกเขาเป็นประชากรของพระผู้เป็นเจ้า พระเป็นเจ้าแห่งสวรรค์ และพวกเขาได้หลงไปจากการมีเอกลักษณ์แท้จริงของพวกเขาว่า พวกเขาเป็นประชากรแห่งพันธสัญญา “เราได้เลี้ยงลูก และทำให้เติบโตขึ้น แต่พวกเขาได้กบฏต่อเรา โคยังรู้จักเจ้าของมัน และลาก็รู้จักรางหญ้าของมัน แต่อิสราเอลไม่รู้จัก ชน ชาติของเราไม่เข้าใจ” (อิสยาห์ 1:2, 3) สัปดาห์นี้ เราจะมองไปยังงานของพระเจ้า ที่ทรงไถ่ประชากรของพระองค์ให้กลับไปหาพระองค์เอง
mit
kataras/gapi
core/router/handler_execution_rules_test.go
3347
package router_test import ( "testing" "github.com/kataras/iris/v12" "github.com/kataras/iris/v12/context" "github.com/kataras/iris/v12/core/router" "github.com/kataras/iris/v12/httptest" ) var ( finalExecutionRulesResponse = "1234" testExecutionResponse = func(t *testing.T, app *iris.Application, path string) { e := httptest.New(t, app) e.GET(path).Expect().Status(httptest.StatusOK).Body().Equal(finalExecutionRulesResponse) } ) func writeStringHandler(text string, withNext bool) context.Handler { return func(ctx *context.Context) { ctx.WriteString(text) if withNext { ctx.Next() } } } func TestRouterExecutionRulesForceMain(t *testing.T) { app := iris.New() begin := app.Party("/") begin.SetExecutionRules(router.ExecutionRules{Main: router.ExecutionOptions{Force: true}}) // no need of `ctx.Next()` all main handlers should be executed with the Main.Force:True rule. begin.Get("/", writeStringHandler("12", false), writeStringHandler("3", false), writeStringHandler("4", false)) testExecutionResponse(t, app, "/") } func TestRouterExecutionRulesForceBegin(t *testing.T) { app := iris.New() begin := app.Party("/begin_force") begin.SetExecutionRules(router.ExecutionRules{Begin: router.ExecutionOptions{Force: true}}) // should execute, begin rule is to force execute them without `ctx.Next()`. begin.Use(writeStringHandler("1", false)) begin.Use(writeStringHandler("2", false)) // begin starts with begin and ends to the main handlers but not last, so this done should not be executed. begin.Done(writeStringHandler("5", false)) begin.Get("/", writeStringHandler("3", false), writeStringHandler("4", false)) testExecutionResponse(t, app, "/begin_force") } func TestRouterExecutionRulesForceDone(t *testing.T) { app := iris.New() done := app.Party("/done_force") done.SetExecutionRules(router.ExecutionRules{Done: router.ExecutionOptions{Force: true}}) // these done should be executed without `ctx.Next()` done.Done(writeStringHandler("3", false), writeStringHandler("4", false)) // first with `ctx.Next()`, because Done.Force:True rule will alter the latest of the main handler(s) only. done.Get("/", writeStringHandler("1", true), writeStringHandler("2", false)) // rules should be kept in children. doneChild := done.Party("/child") // even if only one, it's the latest, Done.Force:True rule should modify it. doneChild.Get("/", writeStringHandler("12", false)) testExecutionResponse(t, app, "/done_force") testExecutionResponse(t, app, "/done_force/child") } func TestRouterExecutionRulesShouldNotModifyTheCallersHandlerAndChildrenCanResetExecutionRules(t *testing.T) { app := iris.New() app.SetExecutionRules(router.ExecutionRules{Done: router.ExecutionOptions{Force: true}}) h := writeStringHandler("4", false) app.Done(h) app.Get("/", writeStringHandler("123", false)) // remember: the handler stored in var didn't had a `ctx.Next()`, modified its clone above with adding a `ctx.Next()` // note the "clone" word, the original handler shouldn't be changed. app.Party("/c").SetExecutionRules(router.ExecutionRules{}).Get("/", h, writeStringHandler("err caller modified!", false)) testExecutionResponse(t, app, "/") e := httptest.New(t, app) e.GET("/c").Expect().Status(httptest.StatusOK).Body().Equal("4") // the "should not" should not be written. }
mit
quantosobra/ember-data-table-light
tests/integration/components/data-table-test.js
602
import { moduleForComponent, test } from 'ember-qunit'; import wait from 'ember-test-helpers/wait'; import hbs from 'htmlbars-inline-precompile'; import startMirage from '../../helpers/setup-mirage'; moduleForComponent('data-table', 'Integration | Component | data table', { integration: true, setup: function() { startMirage(this.container); } }); test('it renders', function(assert) { assert.expect(1); this.set('columns', [{label: 'Column'}]); this.render(hbs`{{data-table 'user' columns=columns}}`); return wait().then(() => { assert.ok(this.$('table').length); }); });
mit
tf/pageflow
entry_types/scrolled/package/src/entryState/theme.js
548
import {useEntryStateConfig} from "./EntryStateProvider"; /** * Returns an object containing theme asset paths. * * @example * * const theme = useTheme(); * theme // => * { * assets: { * logoDesktop: 'path/to/logoDesktop.svg', * logoMobile: 'path/to/logoMobile.svg' * }, * options: { * // options passed to `themes.register` in `pageflow.rb` initializer * // with camleized keys. * } * } */ export function useTheme() { const config = useEntryStateConfig(); return config.theme; }
mit
Wowu/WikiEduDashboard
spec/support/shared_contexts/survey_assignment.rb
2341
# frozen_string_literal: true shared_context 'survey_assignment' do before do ActionMailer::Base.delivery_method = :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @user = create(:user, username: 'Jonathan', email: '[email protected]') @user2 = create(:user, username: 'Sage', email: '[email protected]') @survey1 = create(:survey) @campaign1 = create(:campaign, title: 'Test', slug: 'test') # Survey Assignment for Instructors in Courses which end 3 days from today. @survey_assignment_params = { published: true, courses_user_role: 1, survey_id: @survey1.id, send_date_days: 3, send_before: true, send_date_relative_to: 'end', email_template: 'instructor_survey' } @survey_assignment1 = create(:survey_assignment, @survey_assignment_params) # Add the Campaign to our survey assignment @survey_assignment1.campaigns << @campaign1 @survey_assignment1.save # Un-published Survey Assignment @survey_assignment2 = create(:survey_assignment, @survey_assignment_params.merge(published: false)) @survey_assignment2.campaigns << @campaign1 @survey_assignment2.save # Course with end date that matches Today for the SurveyAssignment @course_params = { start: Time.zone.today - 2.months, # Accounting for end-of-day default end dates, we set the end date as 2 days # away to makes sure the 'three days until end' covers the end date. end: Time.zone.now + 2.days, passcode: 'pizza', title: 'Underwater basket-weaving' } # Add 2 Courses to our Campaign each with an instructor 2.times do |i| course = create(:course, { id: i + 1 }.merge(@course_params)) course.courses_users << create(:courses_user, course_id: course.id, user_id: @user.id, role: 1) # instructor course.courses_users << create(:courses_user, course_id: course.id, user_id: @user2.id, role: 1) # instructor course.save @campaign1.courses << course end @campaign1.save end end
mit
Donslayer/Introduction-to-programming-Javascript-
laptopWampInfoFiles/oppgave3/nas.proxy.php
190
<?php header("Content-type: text/xml"); $fil = fopen("https://www.yr.no/sted/Norge/%C3%98stfold/Halden/Halden/varsel.xml","r") while($linjer = fopen($fil)) { echo $linjer; } ?>
mit
MCHacker/git
pack.sh
857
#!/bin/bash set -e cd "$(dirname "$0")" git clean -f -d -x app web echo ">> Prepare parameters.yml" touch app/config/parameters.yml if [ ! -f composer.phar ]; then echo ">> Download composer" curl -s http://getcomposer.org/installer | php fi echo ">> Install dependencies" php composer.phar install --optimize-autoloader --prefer-dist echo ">> Dump assets" php app/console assetic:dump --env=prod --no-debug echo ">> Remove development elements" rm -rf app/cache/* rm -rf app/logs/* echo ">> Compress" if [ -f pack.tar.gz ]; then rm pack.tar.gz fi ln -s . gitonomy tar -czf pack.tar.gz --exclude=.git \ gitonomy/app \ gitonomy/src/Gitonomy/Bundle \ gitonomy/src/Gitonomy/Component \ gitonomy/web \ gitonomy/vendor \ gitonomy/install.sh \ gitonomy/LICENSE \ gitonomy/README.md echo ">> Clean" rm gitonomy
mit
LukeWinikates/dotnet-toolbox
src/dotnet-toolbox.api/Query/ILatestPackagesIndex.cs
219
using System.Collections.Generic; namespace dotnet_toolbox.api.Query { public interface ILatestPackagesIndex { IEnumerable<string> Get(); void Update(long timestamp, string packageName); } }
mit
b3j0f/simpleneed
www/www/css/style.css
30
.icons path { fill: white; }
mit
fate83/MailAdmin
app/controllers/users_controller.rb
2318
class UsersController < ApplicationController before_action :set_user, only: [:show, :edit, :update, :destroy] # GET /users # GET /users.json def index @users = current_admin.admin? ? User.all : current_admin.users authorize! :read, User @users.each do |user| authorize! :read, user end end # GET /users/new def new @user = User.new authorize! :create, @user end # GET /users/1/edit def edit authorize! :update, @user end def edit_password @user = User.find(params[:id]) authorize! :change_password, @user end # POST /users # POST /users.json def create @user = User.new(user_params) authorize! :update, @user respond_to do |format| if @user.save format.html { redirect_to users_path, notice: 'Postfach wurde erfolgreich angelegt!' } else format.html { render :new } end end end # PATCH/PUT /users/1 # PATCH/PUT /users/1.json def update authorize! :update, @user respond_to do |format| if @user.update(user_params) format.html { redirect_to users_path, notice: 'Postfach wurde erfolgreich bearbeitet.' } format.json { render :show, status: :ok, location: @user } else format.html { render :edit } format.json { render json: @user.errors, status: :unprocessable_entity } end end end def update_password @user = User.find(params[:id]) authorize! :change_password, @user if @user.update_attributes(user_params) redirect_to users_path, notice: 'Passwort wurde erfolgreich bearbeitet!' else render :edit_password end end # DELETE /users/1 # DELETE /users/1.json def destroy authorize! :destroy, @user @user.destroy #ToDo: Delete Folder in file system respond_to do |format| format.html { redirect_to users_url, notice: 'Postfach wurde erfolgreich gelöscht!' } format.json { head :no_content } end end private # Use callbacks to share common setup or constraints between actions. def set_user @user = User.find(params[:id]) end # Never trust parameters from the scary internet, only allow the white list through. def user_params params.require(:user).permit(:username, :password, :domain_id) end end
mit
aspyatkin/themis-quals-frontend
src/html/category-list.html
418
<% if (categories.length === 0) { %> <p class="lead">No categories have been created yet.</p> <% } else { %> <% var sortedCategories = _.sortBy(categories, 'createdAt').reverse() %> <% for (var i=0; i<sortedCategories.length; ++i) { %> <% var category = sortedCategories[i] %> <%= templates.categoryPartial({ _: _, category: category, identity: identity, contest: contest, moment: moment }) %> <% } %> <% } %>
mit
aanton03/language-list
data/nl_BE/language.php
14046
<?php return array ( 'ab' => 'Abchazisch', 'ada' => 'Adangme', 'ady' => 'Adygees', 'om' => 'Afaan Oromo', 'aa' => 'Afar', 'afh' => 'Afrihili', 'af' => 'Afrikaans', 'agq' => 'Aghem', 'ain' => 'Ainu', 'ak' => 'Akan', 'akk' => 'Akkadisch', 'ach' => 'Akoli', 'bss' => 'Akoose', 'akz' => 'Alabama', 'sq' => 'Albanees', 'ale' => 'Aleoetisch', 'arq' => 'Algerijns Arabisch', 'en_US' => 'Amerikaans Engels', 'ase' => 'Amerikaanse Gebarentaal', 'am' => 'Amhaars', 'anp' => 'Angika', 'njo' => 'Ao Naga', 'ar' => 'Arabisch', 'an' => 'Aragonees', 'arc' => 'Aramees', 'aro' => 'Araona', 'arp' => 'Arapaho', 'arw' => 'Arawak', 'hy' => 'Armeens', 'rup' => 'Aroemeens', 'frp' => 'Arpitaans', 'as' => 'Assamees', 'ast' => 'Asturisch', 'asa' => 'Asu', 'ace' => 'Atjehs', 'cch' => 'Atsam', 'en_AU' => 'Australisch Engels', 'av' => 'Avarisch', 'ae' => 'Avestisch', 'awa' => 'Awadhi', 'ay' => 'Aymara', 'az' => 'Azerbeidzjaans', 'bfq' => 'Badaga', 'ksf' => 'Bafia', 'bfd' => 'Bafut', 'bqi' => 'Bakhtiari', 'ban' => 'Balinees', 'bm' => 'Bambara', 'bax' => 'Bamoun', 'bjn' => 'Banjar', 'bas' => 'Basa', 'ba' => 'Basjkiers', 'eu' => 'Baskisch', 'bbc' => 'Batak Toba', 'bar' => 'Beiers', 'bej' => 'Beja', 'bal' => 'Beloetsji', 'bem' => 'Bemba', 'bez' => 'Bena', 'bn' => 'Bengaals', 'bew' => 'Betawi', 'bho' => 'Bhojpuri', 'bik' => 'Bikol', 'bin' => 'Bini', 'my' => 'Birmaans', 'bpy' => 'Bishnupriya', 'bi' => 'Bislama', 'byn' => 'Blin', 'zbl' => 'Blissymbolen', 'brx' => 'Bodo', 'bua' => 'Boerjatisch', 'bs' => 'Bosnisch', 'brh' => 'Brahui', 'bra' => 'Braj', 'pt_BR' => 'Braziliaans Portugees', 'br' => 'Bretons', 'en_GB' => 'Brits Engels', 'bug' => 'Buginees', 'bg' => 'Bulgaars', 'bum' => 'Bulu', 'cad' => 'Caddo', 'frc' => 'Cajun-Frans', 'en_CA' => 'Canadees Engels', 'fr_CA' => 'Canadees Frans', 'cps' => 'Capiznon', 'car' => 'Caribisch', 'ca' => 'Catalaans', 'cay' => 'Cayuga', 'ceb' => 'Cebuano', 'chg' => 'Chagatai', 'ch' => 'Chamorro', 'chr' => 'Cherokee', 'chy' => 'Cheyenne', 'chb' => 'Chibcha', 'cgg' => 'Chiga', 'zh' => 'Chinees', 'chn' => 'Chinook Jargon', 'chp' => 'Chipewyan', 'cho' => 'Choctaw', 'chk' => 'Chuukees', 'swc' => 'Congo Swahili', 'kw' => 'Cornish', 'co' => 'Corsicaans', 'cr' => 'Cree', 'mus' => 'Creek', 'dak' => 'Dakota', 'dar' => 'Dargwa', 'dzg' => 'Dazaga', 'da' => 'Deens', 'del' => 'Delaware', 'din' => 'Dinka', 'dv' => 'Divehi', 'doi' => 'Dogri', 'dgr' => 'Dogrib', 'dua' => 'Duala', 'de' => 'Duits', 'dtp' => 'Dusun', 'dyu' => 'Dyula', 'dz' => 'Dzongkha', 'efi' => 'Efik', 'arz' => 'Egyptisch Arabisch', 'eka' => 'Ekajuk', 'elx' => 'Elamitisch', 'ebu' => 'Embu', 'egl' => 'Emiliano', 'en' => 'Engels', 'myv' => 'Erzja', 'eo' => 'Esperanto', 'et' => 'Estisch', 'pt_PT' => 'Europees Portugees', 'es_ES' => 'Europees Spaans', 'ee' => 'Ewe', 'ewo' => 'Ewondo', 'ext' => 'Extremeens', 'fo' => 'Faeröers', 'fan' => 'Fang', 'fat' => 'Fanti', 'fj' => 'Fijisch', 'hif' => 'Fijisch Hindi', 'fil' => 'Filipijns', 'fi' => 'Fins', 'phn' => 'Foenicisch', 'fon' => 'Fon', 'fr' => 'Frans', 'fy' => 'Fries', 'fur' => 'Friulisch', 'ff' => 'Fulah', 'gaa' => 'Ga', 'gag' => 'Gagaoezisch', 'gl' => 'Galicisch', 'gan' => 'Gan Chinese', 'gay' => 'Gayo', 'gba' => 'Gbaya', 'gez' => 'Ge’ez', 'zxx' => 'geen linguïstische inhoud', 'aln' => 'Gegisch', 'ka' => 'Georgisch', 'bbj' => 'Ghomala’', 'ki' => 'Gikuyu', 'glk' => 'Gilaki', 'gil' => 'Gilbertees', 'gom' => 'Goa Konkani', 'gon' => 'Gondi', 'gor' => 'Gorontalo', 'got' => 'Gothisch', 'grb' => 'Grebo', 'el' => 'Grieks', 'kl' => 'Groenlands', 'gn' => 'Guaraní', 'gu' => 'Gujarati', 'gur' => 'Gurune', 'guz' => 'Gusii', 'gwi' => 'Gwichʼin', 'hai' => 'Haida', 'ht' => 'Haïtiaans Creools', 'hak' => 'Hakka', 'ha' => 'Hausa', 'haw' => 'Hawaïaans', 'he' => 'Hebreeuws', 'hz' => 'Herero', 'hit' => 'Hettitisch', 'hil' => 'Hiligaynon', 'hi' => 'Hindi', 'ho' => 'Hiri Motu', 'hmn' => 'Hmong', 'hu' => 'Hongaars', 'hup' => 'Hupa', 'iba' => 'Iban', 'ibb' => 'Ibibio', 'io' => 'Ido', 'ga' => 'Iers', 'ig' => 'Igbo', 'is' => 'IJslands', 'ilo' => 'Iloko', 'smn' => 'Inari-Samisch', 'id' => 'Indonesisch', 'inh' => 'Ingoesjetisch', 'izh' => 'Ingrisch', 'ia' => 'Interlingua', 'ie' => 'Interlingue', 'iu' => 'Inuktitut', 'ik' => 'Inupiaq', 'it' => 'Italiaans', 'sah' => 'Jakoets', 'jam' => 'Jamaicaans Creools', 'ja' => 'Japans', 'jv' => 'Javaans', 'yi' => 'Jiddisch', 'kaj' => 'Jju', 'dyo' => 'Jola-Fonyi', 'jrb' => 'Judeo-Arabisch', 'jpr' => 'Judeo-Perzisch', 'jut' => 'Jutlands', 'quc' => 'K’iche’', 'kea' => 'Kaapverdisch Creools', 'kbd' => 'Kabardisch', 'kab' => 'Kabylisch', 'kac' => 'Kachin', 'kgp' => 'Kaingang', 'kkj' => 'Kako', 'kln' => 'Kalenjin', 'xal' => 'Kalmuks', 'kam' => 'Kamba', 'kbl' => 'Kanembu', 'kn' => 'Kannada', 'yue' => 'Kantonees', 'kr' => 'Kanuri', 'kaa' => 'Karakalpaks', 'krc' => 'Karatsjaj-Balkarisch', 'krl' => 'Karelisch', 'ks' => 'Kasjmiri', 'csb' => 'Kasjoebisch', 'kaw' => 'Kawi', 'kk' => 'Kazachs', 'ken' => 'Kenyang', 'cu' => 'Kerkslavisch', 'kha' => 'Khasi', 'km' => 'Khmer', 'kho' => 'Khotanees', 'khw' => 'Khowar', 'qug' => 'Kichwa', 'kmb' => 'Kimbundu', 'krj' => 'Kinaray-a', 'rw' => 'Kinyarwanda', 'ky' => 'Kirgizisch', 'kiu' => 'Kirmanckî', 'rn' => 'Kirundi', 'lzh' => 'Klassiek Chinees', 'nwc' => 'Klassiek Nepalbhasa', 'syc' => 'Klassiek Syrisch', 'tlh' => 'Klingon', 'kum' => 'Koemuks', 'ku' => 'Koerdisch', 'ksh' => 'Kölsch', 'bkm' => 'Kom', 'kv' => 'Komi', 'koi' => 'Komi-Permjaaks', 'kg' => 'Kongo', 'kok' => 'Konkani', 'cop' => 'Koptisch', 'ko' => 'Koreaans', 'kfo' => 'Koro', 'kos' => 'Kosraeaans', 'avk' => 'Kotava', 'khq' => 'Koyra Chiini', 'ses' => 'Koyraboro Senni', 'kpe' => 'Kpelle', 'crh' => 'Krim-Tataars', 'kri' => 'Krio', 'hr' => 'Kroatisch', 'kj' => 'Kuanyama', 'kru' => 'Kurukh', 'kut' => 'Kutenai', 'lad' => 'Ladino', 'lah' => 'Lahnda', 'lkt' => 'Lakota', 'lam' => 'Lamba', 'lag' => 'Langi', 'lo' => 'Laotiaans', 'la' => 'Latijn', 'es_419' => 'Latijns-Amerikaans Spaans', 'lzz' => 'Lazisch', 'ltg' => 'Letgaals', 'lv' => 'Lets', 'lez' => 'Lezgisch', 'lij' => 'Ligurisch', 'liv' => 'Lijfs', 'li' => 'Limburgs', 'ln' => 'Lingala', 'lfn' => 'Lingua Franca Nova', 'lt' => 'Litouws', 'jbo' => 'Lojban', 'lmo' => 'Lombardisch', 'loz' => 'Lozi', 'lu' => 'Luba-Katanga', 'lua' => 'Luba-Lulua', 'lg' => 'Luganda', 'lui' => 'Luiseno', 'smj' => 'Lule-Samisch', 'lun' => 'Lunda', 'luo' => 'Luo', 'lb' => 'Luxemburgs', 'luy' => 'Luyia', 'mas' => 'Maa', 'mde' => 'Maba', 'mk' => 'Macedonisch', 'jmc' => 'Machame', 'mad' => 'Madoerees', 'maf' => 'Mafa', 'mag' => 'Magahi', 'vmf' => 'Main-Franconian', 'mai' => 'Maithili', 'mak' => 'Makassaars', 'mgh' => 'Makhuwa-Meetto', 'kde' => 'Makonde', 'mg' => 'Malagassisch', 'ml' => 'Malayalam', 'ms' => 'Maleis', 'mt' => 'Maltees', 'mdr' => 'Mandar', 'man' => 'Mandingo', 'mnc' => 'Mantsjoe', 'gv' => 'Manx', 'mi' => 'Maori', 'arn' => 'Mapudungun', 'mr' => 'Marathi', 'chm' => 'Mari', 'ary' => 'Marokkaans Arabisch', 'mh' => 'Marshallees', 'mwr' => 'Marwari', 'mzn' => 'Mazanderani', 'byv' => 'Medumba', 'mul' => 'Meerdere talen', 'mni' => 'Meitei', 'men' => 'Mende', 'mwv' => 'Mentawai', 'mer' => 'Meru', 'mgo' => 'Meta’', 'es_MX' => 'Mexicaans Spaans', 'mic' => 'Mi’kmaq', 'enm' => 'Middelengels', 'frm' => 'Middelfrans', 'gmh' => 'Middelhoogduits', 'mga' => 'Middeliers', 'dum' => 'Middelnederlands', 'min' => 'Minangkabau', 'xmf' => 'Mingreels', 'nan' => 'Minnanyu', 'mwl' => 'Mirandees', 'lus' => 'Mizo', 'ar_001' => 'modern standaard Arabisch', 'moh' => 'Mohawk', 'mdf' => 'Moksja', 'ro_MD' => 'Moldavian', 'lol' => 'Mongo', 'mn' => 'Mongools', 'mfe' => 'Morisyen', 'ttt' => 'Moslim Tat', 'mos' => 'Mossi', 'mua' => 'Mundang', 'mye' => 'Myene', 'nqo' => 'N’Ko', 'naq' => 'Nama', 'nap' => 'Napolitaans', 'na' => 'Nauruaans', 'nv' => 'Navajo', 'ng' => 'Ndonga', 'nl' => 'Nederlands', 'nds' => 'Nedersaksisch', 'dsb' => 'Nedersorbisch', 'ne' => 'Nepalees', 'new' => 'Newari', 'sba' => 'Ngambay', 'nnh' => 'Ngiemboon', 'jgo' => 'Ngomba', 'nmg' => 'Ngumba', 'yrl' => 'Nheengatu', 'nia' => 'Nias', 'niu' => 'Niueaans', 'nog' => 'Nogai', 'frr' => 'Noord-Fries', 'nd' => 'Noord-Ndebele', 'se' => 'Noord-Samisch', 'nso' => 'Noord-Sotho', 'no' => 'Noors', 'nb' => 'Noors - Bokmål', 'nn' => 'Noors - Nynorsk', 'nov' => 'Novial', 'nus' => 'Nuer', 'nym' => 'Nyamwezi', 'ny' => 'Nyanja', 'nyn' => 'Nyankole', 'tog' => 'Nyasa Tonga', 'nyo' => 'Nyoro', 'nzi' => 'Nzima', 'oc' => 'Occitaans; Provençaals', 'or' => 'Odia', 'udm' => 'Oedmoerts', 'uga' => 'Oegaritisch', 'ug' => 'Oeigoers', 'uk' => 'Oekraïens', 'uz' => 'Oezbeeks', 'oj' => 'Ojibwa', 'und' => 'onbekende taal', 'frs' => 'Oost-Fries', 'de_AT' => 'Oostenrijks Duits', 'hsb' => 'Oppersorbisch', 'osa' => 'Osage', 'os' => 'Ossetisch', 'ota' => 'Ottomaans-Turks', 'egy' => 'Oudegyptisch', 'ang' => 'Oudengels', 'fro' => 'Oudfrans', 'grc' => 'Oudgrieks', 'goh' => 'Oudhoogduits', 'sga' => 'Oudiers', 'non' => 'Oudnoors', 'peo' => 'Oudperzisch', 'pro' => 'Oudprovençaals', 'prg' => 'Oudpruisisch', 'pal' => 'Pahlavi', 'pau' => 'Palaus', 'pi' => 'Pali', 'pfl' => 'Paltsisch', 'pam' => 'Pampanga', 'pag' => 'Pangasinan', 'pap' => 'Papiaments', 'ps' => 'Pasjtoe', 'pdc' => 'Pennsylvania-Duits', 'fa' => 'Perzisch', 'pcd' => 'Picardisch', 'pms' => 'Piëmontees', 'pdt' => 'Plautdietsch', 'pon' => 'Pohnpeiaans', 'pnt' => 'Pontisch', 'pl' => 'Pools', 'pt' => 'Portugees', 'pa' => 'Punjabi', 'qu' => 'Quechua', 'raj' => 'Rajasthani', 'rap' => 'Rapanui', 'rar' => 'Rarotongan', 'rm' => 'Reto-Romaans', 'rif' => 'Riffijns', 'ro' => 'Roemeens', 'rue' => 'Roetheens', 'rgn' => 'Romagnol', 'rom' => 'Romani', 'rof' => 'Rombo', 'root' => 'Root', 'rtm' => 'Rotumaans', 'rug' => 'Roviana', 'ru' => 'Russisch', 'rwk' => 'Rwa', 'ssy' => 'Saho', 'sam' => 'Samaritaans-Aramees', 'saq' => 'Samburu', 'sm' => 'Samoaans', 'sgs' => 'Samogitisch', 'sad' => 'Sandawe', 'sg' => 'Sango', 'sbp' => 'Sangu', 'sa' => 'Sanskriet', 'sat' => 'Santali', 'sc' => 'Sardijns', 'sas' => 'Sasak', 'sdc' => 'Sassarees', 'stq' => 'Saterfries', 'saz' => 'Saurashtra', 'sco' => 'Schots', 'gd' => 'Schots-Gaelisch', 'sly' => 'Selayar', 'sel' => 'Selkoeps', 'seh' => 'Sena', 'see' => 'Seneca', 'srr' => 'Serer', 'sei' => 'Seri', 'sr' => 'Servisch', 'sh' => 'Servo-Kroatisch', 'ksb' => 'Shambala', 'shn' => 'Shan', 'swb' => 'Shimaore', 'sn' => 'Shona', 'scn' => 'Siciliaans', 'sid' => 'Sidamo', 'bla' => 'Siksika', 'szl' => 'Silezisch', 'sli' => 'Silezisch Duits', 'sd' => 'Sindhi', 'si' => 'Singalees', 'sms' => 'Skolt-Samisch', 'den' => 'Slavey', 'sl' => 'Sloveens', 'sk' => 'Slowaaks', 'sux' => 'Soemerisch', 'su' => 'Soendanees', 'sus' => 'Soesoe', 'xog' => 'Soga', 'sog' => 'Sogdisch', 'so' => 'Somalisch', 'snk' => 'Soninke', 'ckb' => 'Soranî', 'es' => 'Spaans', 'srn' => 'Sranantongo', 'zgh' => 'Standaard Marokkaanse Tamazight', 'suk' => 'Sukuma', 'sw' => 'Swahili', 'ss' => 'Swazi', 'syr' => 'Syrisch', 'tg' => 'Tadzjieks', 'tl' => 'Tagalog', 'ty' => 'Tahitiaans', 'dav' => 'Taita', 'tly' => 'Talysh', 'tmh' => 'Tamashek', 'tzm' => 'Tamazight (Centraal-Marokko)', 'ta' => 'Tamil', 'trv' => 'Taroko', 'twq' => 'Tasawaq', 'shi' => 'Tashelhiyt', 'tt' => 'Tataars', 'te' => 'Telugu', 'ter' => 'Tereno', 'teo' => 'Teso', 'tet' => 'Tetun', 'th' => 'Thais', 'bo' => 'Tibetaans', 'tig' => 'Tigre', 'ti' => 'Tigrinya', 'tem' => 'Timne', 'tiv' => 'Tiv', 'tli' => 'Tlingit', 'tum' => 'Toemboeka', 'tyv' => 'Toevaans', 'tpi' => 'Tok Pisin', 'tkl' => 'Tokelaus', 'to' => 'Tongaans', 'fit' => 'Tornedal-Fins', 'zh_Hant' => 'traditioneel Chinees', 'tkr' => 'Tsakhur', 'tsd' => 'Tsakonisch', 'tsi' => 'Tsimshian', 'shu' => 'Tsjadisch Arabisch', 'cs' => 'Tsjechisch', 'ce' => 'Tsjetsjeens', 'cv' => 'Tsjoevasjisch', 'ts' => 'Tsonga', 'tn' => 'Tswana', 'tcy' => 'Tulu', 'aeb' => 'Tunesisch Arabisch', 'tk' => 'Turkmeens', 'tr' => 'Turks', 'tru' => 'Turoyo', 'tvl' => 'Tuvaluaans', 'tw' => 'Twi', 'kcg' => 'Tyap', 'umb' => 'Umbundu', 'ur' => 'Urdu', 'vai' => 'Vai', 've' => 'Venda', 'vec' => 'Venetiaans', 'zh_Hans' => 'vereenvoudigd Chinees', 'vi' => 'Vietnamees', 'nl_BE' => 'Vlaams', 'vo' => 'Volapük', 'vro' => 'Võro', 'vot' => 'Votisch', 'vun' => 'Vunjo', 'wa' => 'Waals', 'wae' => 'Walser', 'war' => 'Waray', 'was' => 'Washo', 'guc' => 'Wayuu', 'cy' => 'Welsh', 'vep' => 'Wepsisch', 'mrj' => 'West-Mari', 'vls' => 'West-Vlaams', 'be' => 'Wit-Russisch', 'wal' => 'Wolaytta', 'wo' => 'Wolof', 'wuu' => 'Wuyu', 'xh' => 'Xhosa', 'hsn' => 'Xiangyu', 'yav' => 'Yangben', 'yao' => 'Yao', 'yap' => 'Yapees', 'ybb' => 'Yemba', 'ii' => 'Yi', 'yo' => 'Yoruba', 'esu' => 'Yupik', 'zap' => 'Zapotec', 'dje' => 'Zarma', 'zza' => 'Zaza', 'zea' => 'Zeeuws', 'zen' => 'Zenaga', 'za' => 'Zhuang', 'zu' => 'Zoeloe', 'gbz' => 'Zoroastrisch Dari', 'alt' => 'Zuid-Altaïsch', 'azb' => 'Zuid-Azerbeidzjaans Arabisch', 'nr' => 'Zuid-Ndbele', 'sma' => 'Zuid-Samisch', 'st' => 'Zuid-Sotho', 'zun' => 'Zuni', 'sv' => 'Zweeds', 'gsw' => 'Zwitserduits', 'fr_CH' => 'Zwitsers Frans', 'de_CH' => 'Zwitsers Hoogduits', );
mit
relateiq/ews-java-api
src/main/java/microsoft/exchange/webservices/data/core/service/schema/ItemSchema.java
24413
/* * The MIT License * Copyright (c) 2012 Microsoft Corporation * * 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. */ package microsoft.exchange.webservices.data.core.service.schema; import microsoft.exchange.webservices.data.attribute.Schema; import microsoft.exchange.webservices.data.core.XmlElementNames; import microsoft.exchange.webservices.data.enumeration.ExchangeVersion; import microsoft.exchange.webservices.data.enumeration.Importance; import microsoft.exchange.webservices.data.enumeration.PropertyDefinitionFlags; import microsoft.exchange.webservices.data.enumeration.Sensitivity; import microsoft.exchange.webservices.data.property.complex.ConversationId; import microsoft.exchange.webservices.data.property.complex.FolderId; import microsoft.exchange.webservices.data.property.complex.ICreateComplexPropertyDelegate; import microsoft.exchange.webservices.data.property.complex.InternetMessageHeaderCollection; import microsoft.exchange.webservices.data.property.complex.ItemId; import microsoft.exchange.webservices.data.property.complex.MessageBody; import microsoft.exchange.webservices.data.property.complex.MimeContent; import microsoft.exchange.webservices.data.property.complex.StringList; import microsoft.exchange.webservices.data.property.complex.UniqueBody; import microsoft.exchange.webservices.data.property.definition.AttachmentsPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.BoolPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.ByteArrayPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.ComplexPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.DateTimePropertyDefinition; import microsoft.exchange.webservices.data.property.definition.EffectiveRightsPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.GenericPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.IntPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.PropertyDefinition; import microsoft.exchange.webservices.data.property.definition.ResponseObjectsPropertyDefinition; import microsoft.exchange.webservices.data.property.definition.StringPropertyDefinition; import java.util.EnumSet; /** * Represents the schema for generic item. */ @Schema public class ItemSchema extends ServiceObjectSchema { /** * The Interface FieldUris. */ private static interface FieldUris { /** * The Item id. */ String ItemId = "item:ItemId"; /** * The Parent folder id. */ String ParentFolderId = "item:ParentFolderId"; /** * The Item class. */ String ItemClass = "item:ItemClass"; /** * The Mime content. */ String MimeContent = "item:MimeContent"; /** * The Attachments. */ String Attachments = "item:Attachments"; /** * The Subject. */ String Subject = "item:Subject"; /** * The Date time received. */ String DateTimeReceived = "item:DateTimeReceived"; /** * The Size. */ String Size = "item:Size"; /** * The Categories. */ String Categories = "item:Categories"; /** * The Has attachments. */ String HasAttachments = "item:HasAttachments"; /** * The Importance. */ String Importance = "item:Importance"; /** * The In reply to. */ String InReplyTo = "item:InReplyTo"; /** * The Internet message headers. */ String InternetMessageHeaders = "item:InternetMessageHeaders"; /** * The Is associated. */ String IsAssociated = "item:IsAssociated"; /** * The Is draft. */ String IsDraft = "item:IsDraft"; /** * The Is from me. */ String IsFromMe = "item:IsFromMe"; /** * The Is resend. */ String IsResend = "item:IsResend"; /** * The Is submitted. */ String IsSubmitted = "item:IsSubmitted"; /** * The Is unmodified. */ String IsUnmodified = "item:IsUnmodified"; /** * The Date time sent. */ String DateTimeSent = "item:DateTimeSent"; /** * The Date time created. */ String DateTimeCreated = "item:DateTimeCreated"; /** * The Body. */ String Body = "item:Body"; /** * The Response objects. */ String ResponseObjects = "item:ResponseObjects"; /** * The Sensitivity. */ String Sensitivity = "item:Sensitivity"; /** * The Reminder due by. */ String ReminderDueBy = "item:ReminderDueBy"; /** * The Reminder is set. */ String ReminderIsSet = "item:ReminderIsSet"; /** * The Reminder minutes before start. */ String ReminderMinutesBeforeStart = "item:ReminderMinutesBeforeStart"; /** * The Display to. */ String DisplayTo = "item:DisplayTo"; /** * The Display cc. */ String DisplayCc = "item:DisplayCc"; /** * The Culture. */ String Culture = "item:Culture"; /** * The Effective rights. */ String EffectiveRights = "item:EffectiveRights"; /** * The Last modified name. */ String LastModifiedName = "item:LastModifiedName"; /** * The Last modified time. */ String LastModifiedTime = "item:LastModifiedTime"; /** * The Web client read form query string. */ String WebClientReadFormQueryString = "item:WebClientReadFormQueryString"; /** * The Web client edit form query string. */ String WebClientEditFormQueryString = "item:WebClientEditFormQueryString"; /** * The Conversation id. */ String ConversationId = "item:ConversationId"; /** * The Unique body. */ String UniqueBody = "item:UniqueBody"; String StoreEntryId = "item:StoreEntryId"; } /** * Defines the Id property. */ public static final PropertyDefinition Id = new ComplexPropertyDefinition<ItemId>( ItemId.class, XmlElementNames.ItemId, FieldUris.ItemId, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1, new ICreateComplexPropertyDelegate<ItemId>() { public ItemId createComplexProperty() { return new ItemId(); } }); /** * Defines the Body property. */ public static final PropertyDefinition Body = new ComplexPropertyDefinition<MessageBody>( MessageBody.class, XmlElementNames.Body, FieldUris.Body, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanDelete), ExchangeVersion.Exchange2007_SP1, new ICreateComplexPropertyDelegate<MessageBody>() { public MessageBody createComplexProperty() { return new MessageBody(); } }); /** * Defines the ItemClass property. */ public static final PropertyDefinition ItemClass = new StringPropertyDefinition( XmlElementNames.ItemClass, FieldUris.ItemClass, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the Subject property. */ public static final PropertyDefinition Subject = new StringPropertyDefinition( XmlElementNames.Subject, FieldUris.Subject, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanDelete, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the MimeContent property. */ public static final PropertyDefinition MimeContent = new ComplexPropertyDefinition<microsoft.exchange.webservices.data.property.complex.MimeContent>( MimeContent.class, XmlElementNames.MimeContent, FieldUris.MimeContent, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.MustBeExplicitlyLoaded), ExchangeVersion.Exchange2007_SP1, new ICreateComplexPropertyDelegate<MimeContent>() { public MimeContent createComplexProperty() { return new MimeContent(); } }); /** * Defines the ParentFolderId property. */ public static final PropertyDefinition ParentFolderId = new ComplexPropertyDefinition<FolderId>( FolderId.class, XmlElementNames.ParentFolderId, FieldUris.ParentFolderId, ExchangeVersion.Exchange2007_SP1, new ICreateComplexPropertyDelegate<FolderId>() { public FolderId createComplexProperty() { return new FolderId(); } }); /** * Defines the Sensitivity property. */ public static final PropertyDefinition Sensitivity = new GenericPropertyDefinition<microsoft.exchange.webservices.data.enumeration.Sensitivity>( Sensitivity.class, XmlElementNames.Sensitivity, FieldUris.Sensitivity, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the Attachments property. */ public static final PropertyDefinition Attachments = new AttachmentsPropertyDefinition(); /** * Defines the DateTimeReceived property. */ public static final PropertyDefinition DateTimeReceived = new DateTimePropertyDefinition( XmlElementNames.DateTimeReceived, FieldUris.DateTimeReceived, EnumSet.of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the Size property. */ public static final PropertyDefinition Size = new IntPropertyDefinition( XmlElementNames.Size, FieldUris.Size, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the Categories property. */ public static final PropertyDefinition Categories = new ComplexPropertyDefinition<StringList>( StringList.class, XmlElementNames.Categories, FieldUris.Categories, EnumSet.of( PropertyDefinitionFlags.AutoInstantiateOnRead, PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanDelete, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1, new ICreateComplexPropertyDelegate<StringList>() { public StringList createComplexProperty() { return new StringList(); } }); /** * Defines the Importance property. */ public static final PropertyDefinition Importance = new GenericPropertyDefinition<microsoft.exchange.webservices.data.enumeration.Importance>( Importance.class, XmlElementNames.Importance, FieldUris.Importance, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the InReplyTo property. */ public static final PropertyDefinition InReplyTo = new StringPropertyDefinition( XmlElementNames.InReplyTo, FieldUris.InReplyTo, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanDelete, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the IsSubmitted property. */ public static final PropertyDefinition IsSubmitted = new BoolPropertyDefinition( XmlElementNames.IsSubmitted, FieldUris.IsSubmitted, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the IsAssociated property. */ public static final PropertyDefinition IsAssociated = new BoolPropertyDefinition( XmlElementNames.IsAssociated, FieldUris.IsAssociated, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2010); /** * Defines the IsDraft property. */ public static final PropertyDefinition IsDraft = new BoolPropertyDefinition( XmlElementNames.IsDraft, FieldUris.IsDraft, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the IsFromMe property. */ public static final PropertyDefinition IsFromMe = new BoolPropertyDefinition( XmlElementNames.IsFromMe, FieldUris.IsFromMe, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the IsResend property. */ public static final PropertyDefinition IsResend = new BoolPropertyDefinition( XmlElementNames.IsResend, FieldUris.IsResend, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the IsUnmodified property. */ public static final PropertyDefinition IsUnmodified = new BoolPropertyDefinition( XmlElementNames.IsUnmodified, FieldUris.IsUnmodified, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the InternetMessageHeaders property. */ public static final PropertyDefinition InternetMessageHeaders = new ComplexPropertyDefinition<InternetMessageHeaderCollection>( InternetMessageHeaderCollection.class, XmlElementNames.InternetMessageHeaders, FieldUris.InternetMessageHeaders, EnumSet.of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1, new ICreateComplexPropertyDelegate <InternetMessageHeaderCollection>() { public InternetMessageHeaderCollection createComplexProperty() { return new InternetMessageHeaderCollection(); } }); /** * Defines the DateTimeSent property. */ public static final PropertyDefinition DateTimeSent = new DateTimePropertyDefinition( XmlElementNames.DateTimeSent, FieldUris.DateTimeSent, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the DateTimeCreated property. */ public static final PropertyDefinition DateTimeCreated = new DateTimePropertyDefinition( XmlElementNames.DateTimeCreated, FieldUris.DateTimeCreated, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the AllowedResponseActions property. */ public static final PropertyDefinition AllowedResponseActions = new ResponseObjectsPropertyDefinition( XmlElementNames.ResponseObjects, FieldUris.ResponseObjects, ExchangeVersion.Exchange2007_SP1); /** * Defines the ReminderDueBy property. */ public static final PropertyDefinition ReminderDueBy = new DateTimePropertyDefinition( XmlElementNames.ReminderDueBy, FieldUris.ReminderDueBy, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the IsReminderSet property. */ public static final PropertyDefinition IsReminderSet = new BoolPropertyDefinition( XmlElementNames.ReminderIsSet, // Note: server-side the name is // ReminderIsSet FieldUris.ReminderIsSet, EnumSet.of(PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the ReminderMinutesBeforeStart property. */ public static final PropertyDefinition ReminderMinutesBeforeStart = new IntPropertyDefinition( XmlElementNames.ReminderMinutesBeforeStart, FieldUris.ReminderMinutesBeforeStart, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the DisplayCc property. */ public static final PropertyDefinition DisplayCc = new StringPropertyDefinition( XmlElementNames.DisplayCc, FieldUris.DisplayCc, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the DisplayTo property. */ public static final PropertyDefinition DisplayTo = new StringPropertyDefinition( XmlElementNames.DisplayTo, FieldUris.DisplayTo, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the HasAttachments property. */ public static final PropertyDefinition HasAttachments = new BoolPropertyDefinition( XmlElementNames.HasAttachments, FieldUris.HasAttachments, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the Culture property. */ public static final PropertyDefinition Culture = new StringPropertyDefinition( XmlElementNames.Culture, FieldUris.Culture, EnumSet.of( PropertyDefinitionFlags.CanSet, PropertyDefinitionFlags.CanUpdate, PropertyDefinitionFlags.CanDelete, PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the EffectiveRights property. */ public static final PropertyDefinition EffectiveRights = new EffectiveRightsPropertyDefinition( XmlElementNames.EffectiveRights, FieldUris.EffectiveRights, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the LastModifiedName property. */ public static final PropertyDefinition LastModifiedName = new StringPropertyDefinition( XmlElementNames.LastModifiedName, FieldUris.LastModifiedName, EnumSet.of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the LastModifiedTime property. */ public static final PropertyDefinition LastModifiedTime = new DateTimePropertyDefinition( XmlElementNames.LastModifiedTime, FieldUris.LastModifiedTime, EnumSet.of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2007_SP1); /** * Defines the WebClientReadFormQueryString property. */ public static final PropertyDefinition WebClientReadFormQueryString = new StringPropertyDefinition( XmlElementNames.WebClientReadFormQueryString, FieldUris.WebClientReadFormQueryString, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2010); /** * Defines the WebClientEditFormQueryString property. */ public static final PropertyDefinition WebClientEditFormQueryString = new StringPropertyDefinition( XmlElementNames.WebClientEditFormQueryString, FieldUris.WebClientEditFormQueryString, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2010); /** * Defines the ConversationId property. */ public static final PropertyDefinition ConversationId = new ComplexPropertyDefinition<microsoft.exchange.webservices.data.property.complex.ConversationId>( ConversationId.class, XmlElementNames.ConversationId, FieldUris.ConversationId, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2010, new ICreateComplexPropertyDelegate<ConversationId>() { public ConversationId createComplexProperty() { return new ConversationId(); } }); /** * Defines the UniqueBody property. */ public static final PropertyDefinition UniqueBody = new ComplexPropertyDefinition<microsoft.exchange.webservices.data.property.complex.UniqueBody>( UniqueBody.class, XmlElementNames.UniqueBody, FieldUris.UniqueBody, EnumSet .of(PropertyDefinitionFlags.MustBeExplicitlyLoaded), ExchangeVersion.Exchange2010, new ICreateComplexPropertyDelegate<UniqueBody>() { public UniqueBody createComplexProperty() { return new UniqueBody(); } }); /** * Defines the StoreEntryId property. */ public static final PropertyDefinition StoreEntryId = new ByteArrayPropertyDefinition( XmlElementNames.StoreEntryId, FieldUris.StoreEntryId, EnumSet .of(PropertyDefinitionFlags.CanFind), ExchangeVersion.Exchange2010_SP2); /** * The Constant Instance. */ protected static final ItemSchema Instance = new ItemSchema(); /** * Gets the single instance of ItemSchema. * * @return single instance of ItemSchema */ public static ItemSchema getInstance() { return Instance; } /** * Registers property. * <p/> * IMPORTANT NOTE: PROPERTIES MUST BE REGISTERED IN SCHEMA ORDER (i.e. the * same order as they are defined in types.xsd) */ @Override protected void registerProperties() { super.registerProperties(); this.registerProperty(MimeContent); this.registerProperty(Id); this.registerProperty(ParentFolderId); this.registerProperty(ItemClass); this.registerProperty(Subject); this.registerProperty(Sensitivity); this.registerProperty(Body); this.registerProperty(Attachments); this.registerProperty(DateTimeReceived); this.registerProperty(Size); this.registerProperty(Categories); this.registerProperty(Importance); this.registerProperty(InReplyTo); this.registerProperty(IsSubmitted); this.registerProperty(IsDraft); this.registerProperty(IsFromMe); this.registerProperty(IsResend); this.registerProperty(IsUnmodified); this.registerProperty(InternetMessageHeaders); this.registerProperty(DateTimeSent); this.registerProperty(DateTimeCreated); this.registerProperty(AllowedResponseActions); this.registerProperty(ReminderDueBy); this.registerProperty(IsReminderSet); this.registerProperty(ReminderMinutesBeforeStart); this.registerProperty(DisplayCc); this.registerProperty(DisplayTo); this.registerProperty(HasAttachments); this.registerProperty(ServiceObjectSchema.extendedProperties); this.registerProperty(Culture); this.registerProperty(EffectiveRights); this.registerProperty(LastModifiedName); this.registerProperty(LastModifiedTime); this.registerProperty(IsAssociated); this.registerProperty(WebClientReadFormQueryString); this.registerProperty(WebClientEditFormQueryString); this.registerProperty(ConversationId); this.registerProperty(UniqueBody); this.registerProperty(StoreEntryId); } /** * Initializes a new instance. */ protected ItemSchema() { super(); } }
mit
kentaromiura/sugo
node_modules/wrapup/node_modules/prime/cov/node_modules/wrapup/lib/main.js
145
// this exports a "masked" version of the WrapUp class. var WrapUp = require("./wrapup") module.exports = function(x){ return new WrapUp(x) }
mit
alu0100600643/Practica12
lib/matriz.rb
7713
#Practica realizada por: Miguel Aurelio García González y Daura Hernández Díaz #En esta practica desarrollamos tres clases, la clase Matriz, MatrizDensa y MatrizDispersa. #La clase Matriz será la madre de las otras dos. class Matriz attr_accessor :m, :t #definición del método initialize, donde crearemos la matriz que usaremos posteriormente y obtendremos su tamaño def initialize(matriz) if matriz != nil @t = matriz.size-1 end @m = matriz end def get_t return @t end def + (other) end def - (other) end def * (other) end def pos(a, b) end def to_s end end #Definición e implementación de la clas MatrizDensa, que como vemos hereda de la clase Matriz definida anteriormente. class MatrizDensa < Matriz private_class_method :new #Hacemos el new privado, utilizandolo posteriormente en un método que hemos creado, dentro del cual llamamos al constructor de la clase Matriz def Matriz.densa (matriz) new(matriz) end #Max es un método que nos devolverá el mayor elemento que contenga la matriz densa # El valor que tendremos como referencia es el que se encuentre en la posición (0,0) de la matriz, comparandolo luego con el resto de los valores def max elemenmax = @m[0][0] for i in 0..@t for j in 0..@t if(elemenmax < @m[i][j]) elemenmax = @m[i][j] end end end return elemenmax end # El método min devolverá el elemento mínimo de la matriz def min elemenmin = @m[0][0] for i in 0..@t for j in 0..@t if(elemenmin > @m[i][j]) elemenmin = @m[i][j] end end end return elemenmin end #El siguiente método realiza la suma entre dos matrices, pueden ser densa-densa o densa-dispersa def +(m2) if m2.instance_of?MatrizDispersa result = MatrizDensa.densa(@m) (@t+1).times do |i| (@t+1).times do |j| encontrado = 0 (m2.arrayi.size+1).times do |k| if (i==m2.arrayi[k] and j==m2.arrayj[k] and encontrado==0) result.m[i][j] = (result.m[i][j]) + (m2.valores[k]) encontrado = 1 end end end end else result = MatrizDensa.densa(m2.m) (@t+1).times do |i| (@t+1).times do |j| result.m[i][j] = @m[i][j] + result.m[i][j] end end end return result end # El siguiente método realiza la resta de dos matrices, como comentabamos anteriormente las matrices pueden ser densa-densa o densa-dispersa def -(m2) if m2.instance_of?MatrizDispersa result = MatrizDensa.densa(@m) for i in (0..@t) for j in (0..@t) encontrado = 0 for k in (0...m2.arrayi.size) if (i==m2.arrayi[k] and j==m2.arrayj[k] and encontrado==0) result.m[i][j] = (result.m[i][j]) - (m2.valores[k]) encontrado = 1 end end end end else result = MatrizDensa.densa(m2.m) for i in 0..@t do for j in 0..@t do result.m[i][j] = @m[i][j] - result.m[i][j] end end end return result end # El método * realiza la multiplicación entre dos matrices densas def *(m2) mat = Array.new(@t+1){Array.new(@t+1)} (@t+1).times do |i| (@t+1).times do |j| mat[i][j]=0; end end m_resultado = Matriz.new(mat) (@t+1).times do |i| (@t+1).times do |j| (@t+1).times do |k| m_resultado.m[i][j] += @m[i][k] * m2.m[k][j] end end end return m_resultado end #Con este método podemos acceder al valor de una posición determinada de la matriz def pos(a, b) @m[a][b] end #El método to_s devuelve la matriz en otro formato def to_s "#{@mat}" end def encontrar (@t+2).times do |i| (@t+2).times do |j| if yield(@m[i][j]) return [i,j] end end end end end #Definición e implementación de la clase MatrizDispersa #MatrizDispersa hereda de Matriz class MatrizDispersa < Matriz attr_accessor :arrayi, :arrayj , :valores #Dentro del método initialize creamos tres vectores, el vector arrayi contendrá las posiciones de i, arrayj las posiciones de j y valores contendrá # los valores no nulos que contenga la matriz. def initialize(i, j, v) @arrayi = i @arrayj = j @valores = v end # El método pos nos permite acceder al valor de una posición determinada def pos(a,b) for i in [email protected] if((@arrayi[i] == a) and (@arrayj[i] == b)) return @valores[i] end end return nil end #Método max para devolver el mayor elemento de la matriz def max elemenmax = @valores[0] for i in [email protected] if(elemenmax < @valores[i]) elemenmax = @valores[i] end end return elemenmax end #Método min que devuelve el menor elemento de la matriz def min elemenmin = @valores[0] for i in [email protected] if(elemenmin > @valores[i]) elemenmin = @valores[i] end end return elemenmin end #Suma de matrices, bien pueden ser dispersa-dispersa o dispersa-densa def +(m2) if m2.instance_of?MatrizDensa result = MatrizDensa.densa(m2.m) (m2.t+1).times do |i| (m2.t+1).times do |j| encontrado = 0 (@arrayi.size).times do |k| if (i==@arrayi[k] and j==@arrayj[k] and encontrado==0) result.m[i][j] = (result.m[i][j]) + (@valores[k]) encontrado = 1 end end end end return result else result = MatrizDispersa.new(@arrayi, @arrayj, @valores) (m2.arrayi.size).times do |j| encontrado = false (m2.arrayi.size+1).times do |k| if((m2.arrayi[j]) == result.arrayi[k] and m2.arrayj[j] == result.arrayj[k]) result.valores[k] = result.valores[k] + m2.valores[j] encontrado = true end end if(encontrado == false) result.arrayi << m2.arrayi[j] result.arrayj << m2.arrayj[j] result.valores << m2.valores[j] end end return result end end #Resta de dos matrices def -(m2) if m2.instance_of?MatrizDensa result = MatrizDensa.densa(m2.m) for i in (0..m2.t) for j in (0..m2.t) encontrado = 0 for k in ([email protected]) if (i==@arrayi[k] and j==@arrayj[k] and encontrado==0) result.m[i][j] = (result.m[i][j]) - (@valores[k]) encontrado = 1 end end end end return result else result = MatrizDispersa.new(@arrayi, @arrayj, @valores) for j in (0...m2.arrayi.size) encontrado = false for k in (0...m2.arrayi.size) if((m2.arrayi[j]) == result.arrayi[k] and m2.arrayj[j] == result.arrayj[k]) result.valores[k] = result.valores[k] - m2.valores[j] encontrado = true end end if(encontrado == false) result.arrayi << m2.arrayi[j] result.arrayj << m2.arrayj[j] result.valores << m2.valores[j] end end return result end end #Multiplicacion de dos matrices dispersa*dispersa def *(m2) result = MatrizDispersa.new(@arrayi, @arrayj, @valores) (m2.arrayi.size).times do |j| (m2.arrayi.size).times do |k| #for j in (0...m2.arrayi.size) #for k in (0...m2.arrayi.size) if((m2.arrayi[j]) == result.arrayi[k] and m2.arrayj[j] == result.arrayj[k]) result.valores[k] = result.valores[k] * m2.valores[j] end end end return result end end
mit
mammix2/boostcoin-core
src/qt/overviewpage.cpp
7949
#include "overviewpage.h" #include "ui_overviewpage.h" #include "walletmodel.h" #include "bitcoinunits.h" #include "optionsmodel.h" #include "transactiontablemodel.h" #include "transactionfilterproxy.h" #include "guiutil.h" #include "guiconstants.h" #include "askpassphrasedialog.h" #include "util.h" #include <QAbstractItemDelegate> #include <QPainter> #define DECORATION_SIZE 64 #define NUM_ITEMS 3 class TxViewDelegate : public QAbstractItemDelegate { Q_OBJECT public: TxViewDelegate(): QAbstractItemDelegate(), unit(BitcoinUnits::BTC) { } inline void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const { painter->save(); QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole)); QRect mainRect = option.rect; QRect decorationRect(mainRect.topLeft(), QSize(DECORATION_SIZE, DECORATION_SIZE)); int xspace = DECORATION_SIZE + 8; int ypad = 6; int halfheight = (mainRect.height() - 2*ypad)/2; QRect amountRect(mainRect.left() + xspace, mainRect.top()+ypad, mainRect.width() - xspace, halfheight); QRect addressRect(mainRect.left() + xspace, mainRect.top()+ypad+halfheight, mainRect.width() - xspace, halfheight); icon.paint(painter, decorationRect); QDateTime date = index.data(TransactionTableModel::DateRole).toDateTime(); QString address = index.data(Qt::DisplayRole).toString(); qint64 amount = index.data(TransactionTableModel::AmountRole).toLongLong(); bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool(); QVariant value = index.data(Qt::ForegroundRole); QColor foreground = option.palette.color(QPalette::Text); if(qVariantCanConvert<QColor>(value)) { foreground = qvariant_cast<QColor>(value); } painter->setPen(foreground); painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, address); if(amount < 0) { foreground = COLOR_NEGATIVE; } else if(!confirmed) { foreground = COLOR_UNCONFIRMED; } else { foreground = option.palette.color(QPalette::Text); } painter->setPen(foreground); QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true); if(!confirmed) { amountText = QString("[") + amountText + QString("]"); } painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText); painter->setPen(option.palette.color(QPalette::Text)); painter->drawText(amountRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::dateTimeStr(date)); painter->restore(); } inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { return QSize(DECORATION_SIZE, DECORATION_SIZE); } int unit; }; #include "overviewpage.moc" OverviewPage::OverviewPage(QWidget *parent) : QWidget(parent), ui(new Ui::OverviewPage), currentBalance(-1), currentStake(0), currentUnconfirmedBalance(-1), currentImmatureBalance(-1), txdelegate(new TxViewDelegate()), filter(0) { ui->setupUi(this); // Recent transactions ui->listTransactions->setItemDelegate(txdelegate); ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE)); ui->listTransactions->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2)); ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false); connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex))); // init "out of sync" warning labels ui->labelWalletStatus->setText("(" + tr("out of sync") + ")"); ui->labelTransactionsStatus->setText("(" + tr("out of sync") + ")"); // start with displaying the "out of sync" warnings showOutOfSyncWarning(true); } void OverviewPage::handleTransactionClicked(const QModelIndex &index) { if(filter) emit transactionClicked(filter->mapToSource(index)); } OverviewPage::~OverviewPage() { delete ui; } void OverviewPage::setBalance(qint64 balance, qint64 stake, qint64 unconfirmedBalance, qint64 immatureBalance) { int unit = model->getOptionsModel()->getDisplayUnit(); currentBalance = balance; currentStake = stake; currentUnconfirmedBalance = unconfirmedBalance; currentImmatureBalance = immatureBalance; ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance)); ui->labelStake->setText(BitcoinUnits::formatWithUnit(unit, stake)); ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance)); ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance)); ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + stake + unconfirmedBalance + immatureBalance)); // only show immature (newly mined) balance if it's non-zero, so as not to complicate things // for the non-mining users bool showImmature = immatureBalance != 0; ui->labelImmature->setVisible(showImmature); ui->labelImmatureText->setVisible(showImmature); } void OverviewPage::unlockWallet() { if(model->getEncryptionStatus() == WalletModel::Locked) { AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this); dlg.setModel(model); if(dlg.exec() == QDialog::Accepted) { // ui->unlockWalletButton->setText(QString("Lock Wallet")); } } else { model->setWalletLocked(true); // ui->unlockWalletButton->setText(QString("Unlock Wallet")); } } void OverviewPage::setModel(WalletModel *model) { this->model = model; if(model && model->getOptionsModel()) { // Set up transaction list filter = new TransactionFilterProxy(); filter->setSourceModel(model->getTransactionTableModel()); filter->setLimit(NUM_ITEMS); filter->setDynamicSortFilter(true); filter->setSortRole(Qt::EditRole); filter->setShowInactive(false); filter->sort(TransactionTableModel::Status, Qt::DescendingOrder); ui->listTransactions->setModel(filter); ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress); // Keep up to date with wallet setBalance(model->getBalance(), model->getStake(), model->getUnconfirmedBalance(), model->getImmatureBalance()); connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); // Unlock wallet button WalletModel::EncryptionStatus status = model->getEncryptionStatus(); if(status == WalletModel::Unencrypted) { // ui->unlockWalletButton->setDisabled(true); // ui->unlockWalletButton->setText(QString("Wallet is not encrypted!")); } else { // ui->unlockWalletButton->setText(QString("Unlock wallet")); } // connect(ui->unlockWalletButton, SIGNAL(clicked()), this, SLOT(unlockWallet())); } // update the display unit, to not use the default ("BTC") updateDisplayUnit(); } void OverviewPage::updateDisplayUnit() { if(model && model->getOptionsModel()) { if(currentBalance != -1) setBalance(currentBalance, model->getStake(), currentUnconfirmedBalance, currentImmatureBalance); // Update txdelegate->unit with the current unit txdelegate->unit = model->getOptionsModel()->getDisplayUnit(); ui->listTransactions->update(); } } void OverviewPage::showOutOfSyncWarning(bool fShow) { ui->labelWalletStatus->setVisible(fShow); ui->labelTransactionsStatus->setVisible(fShow); }
mit
mkwiatkowski/pythoscope
test/test_code_trees_manager.py
4388
import gc import os.path from mock import Mock from pythoscope.code_trees_manager import CodeTreeNotFound, \ FilesystemCodeTreesManager from pythoscope.store import CodeTree, Module from assertions import * from helper import TempDirectory class TestFilesystemCodeTreesManager(TempDirectory): def setUp(self): super(TestFilesystemCodeTreesManager, self).setUp() self.manager = FilesystemCodeTreesManager(self.tmpdir) def assert_empty_cache(self): assert_equal(None, self.manager._cached_code_tree) def assert_cache(self, module_subpath): assert_equal(module_subpath, self.manager._cached_code_tree[0]) def assert_recalled_tree(self, module_subpath, code): assert_equal(code, self.manager.recall_code_tree(module_subpath).code) def assert_code_tree_saved(self, module_subpath, saved=True): path = self.manager._code_tree_path(module_subpath) assert_equal(saved, os.path.exists(path)) def assert_code_tree_not_saved(self, module_subpath): self.assert_code_tree_saved(module_subpath, saved=False) def assert_calls_once(self, mock, callback): """Assert that given callback calls given Mock object exactly once. """ before_count = mock.call_count callback() assert_equal(before_count + 1, mock.call_count) def test_remembered_code_trees_can_be_recalled(self): code_tree = CodeTree(None) self.manager.remember_code_tree(code_tree, "module.py") assert_equal(code_tree, self.manager.recall_code_tree("module.py")) def test_remembered_and_forgotten_code_trees_cannot_be_recalled(self): code_tree = CodeTree(None) self.manager.remember_code_tree(code_tree, "module.py") self.manager.forget_code_tree("module.py") assert_raises(CodeTreeNotFound, lambda: self.manager.recall_code_tree("module.py")) def test_cache_is_empty_right_after_initialization(self): self.assert_empty_cache() def test_cache_is_empty_after_clearing(self): code_tree = CodeTree(None) self.manager.remember_code_tree(code_tree, "module.py") self.manager.clear_cache() self.assert_empty_cache() def test_cache_contains_the_last_recalled_or_remembered_code_tree(self): # We use numbers to identify CodeTrees. We cannot use their id, because # pickling doesn't preserve those. cts = map(CodeTree, [0, 1, 2]) for i, ct in enumerate(cts): self.manager.remember_code_tree(ct, "module%d.py" % i) # Checking all combinations of recall/remember calls. self.assert_recalled_tree("module0.py", 0) self.assert_cache("module0.py") self.assert_recalled_tree("module1.py", 1) self.assert_cache("module1.py") self.manager.remember_code_tree(CodeTree(3), "module3.py") self.assert_cache("module3.py") self.manager.remember_code_tree(CodeTree(4), "module4.py") self.assert_cache("module4.py") self.assert_recalled_tree("module2.py", 2) self.assert_cache("module2.py") def test_remembering_code_tree_saves_it_to_the_filesystem(self): code_tree = CodeTree(None) self.manager.remember_code_tree(code_tree, "module.py") self.assert_code_tree_saved("module.py") def test_forgetting_code_tree_removes_its_file_from_the_filesystem(self): code_tree = CodeTree(None) self.manager.remember_code_tree(code_tree, "module.py") self.manager.forget_code_tree("module.py") self.assert_code_tree_not_saved("module.py") def test_when_clearing_cache_code_tree_currently_in_cache_is_saved_to_the_filesystem(self): code_tree = CodeTree(None) code_tree.save = Mock() self.manager.remember_code_tree(code_tree, "module.py") self.assert_cache("module.py") self.assert_calls_once(code_tree.save, self.manager.clear_cache) def test_code_tree_not_in_cache_can_be_garbage_collected(self): code_tree = CodeTree(None) self.manager.remember_code_tree(code_tree, "module.py") # Referred from the test and from the CodeTreesManager. assert_length(gc.get_referrers(code_tree), 2) self.manager.clear_cache() # No longer referred from the CodeTreesManager. assert_length(gc.get_referrers(code_tree), 1)
mit
inikoo/fact
libs/yui/yui3-gallery/src/gallery-datatable-row-expansion/assets/skins/sam/gallery-datatable-row-expansion-skin.css
444
.yui3-skin-sam .yui3-datatable tr.row-expansion td.post-row-expansion { border-top:1px solid #CBCBCB; } .yui3-skin-sam .yui3-datatable .row-toggle a.row-expand-nub { padding:0 8px; height:14px; margin-left:2px; *display:inline-block; } .yui3-skin-sam .yui3-datatable .row-closed a.row-expand-nub { background:url(closed.png) no-repeat; } .yui3-skin-sam .yui3-datatable .row-open a.row-expand-nub { background:url(open.png) no-repeat; }
mit
callemall/material-ui
packages/material-ui/src/TextareaAutosize/TextareaAutosize.js
6538
import * as React from 'react'; import PropTypes from 'prop-types'; import debounce from '../utils/debounce'; import useForkRef from '../utils/useForkRef'; import useEnhancedEffect from '../utils/useEnhancedEffect'; import ownerWindow from '../utils/ownerWindow'; function getStyleValue(computedStyle, property) { return parseInt(computedStyle[property], 10) || 0; } const styles = { /* Styles applied to the shadow textarea element. */ shadow: { // Visibility needed to hide the extra text area on iPads visibility: 'hidden', // Remove from the content flow position: 'absolute', // Ignore the scrollbar width overflow: 'hidden', height: 0, top: 0, left: 0, // Create a new layer, increase the isolation of the computed values transform: 'translateZ(0)', }, }; const TextareaAutosize = React.forwardRef(function TextareaAutosize(props, ref) { const { onChange, maxRows, minRows = 1, style, value, ...other } = props; const { current: isControlled } = React.useRef(value != null); const inputRef = React.useRef(null); const handleRef = useForkRef(ref, inputRef); const shadowRef = React.useRef(null); const renders = React.useRef(0); const [state, setState] = React.useState({}); const syncHeight = React.useCallback(() => { const input = inputRef.current; const containerWindow = ownerWindow(input); const computedStyle = containerWindow.getComputedStyle(input); // If input's width is shrunk and it's not visible, don't sync height. if (computedStyle.width === '0px') { return; } const inputShallow = shadowRef.current; inputShallow.style.width = computedStyle.width; inputShallow.value = input.value || props.placeholder || 'x'; if (inputShallow.value.slice(-1) === '\n') { // Certain fonts which overflow the line height will cause the textarea // to report a different scrollHeight depending on whether the last line // is empty. Make it non-empty to avoid this issue. inputShallow.value += ' '; } const boxSizing = computedStyle['box-sizing']; const padding = getStyleValue(computedStyle, 'padding-bottom') + getStyleValue(computedStyle, 'padding-top'); const border = getStyleValue(computedStyle, 'border-bottom-width') + getStyleValue(computedStyle, 'border-top-width'); // The height of the inner content const innerHeight = inputShallow.scrollHeight; // Measure height of a textarea with a single row inputShallow.value = 'x'; const singleRowHeight = inputShallow.scrollHeight; // The height of the outer content let outerHeight = innerHeight; if (minRows) { outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight); } if (maxRows) { outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight); } outerHeight = Math.max(outerHeight, singleRowHeight); // Take the box sizing into account for applying this value as a style. const outerHeightStyle = outerHeight + (boxSizing === 'border-box' ? padding + border : 0); const overflow = Math.abs(outerHeight - innerHeight) <= 1; setState((prevState) => { // Need a large enough difference to update the height. // This prevents infinite rendering loop. if ( renders.current < 20 && ((outerHeightStyle > 0 && Math.abs((prevState.outerHeightStyle || 0) - outerHeightStyle) > 1) || prevState.overflow !== overflow) ) { renders.current += 1; return { overflow, outerHeightStyle, }; } if (process.env.NODE_ENV !== 'production') { if (renders.current === 20) { console.error( [ 'Material-UI: Too many re-renders. The layout is unstable.', 'TextareaAutosize limits the number of renders to prevent an infinite loop.', ].join('\n'), ); } } return prevState; }); }, [maxRows, minRows, props.placeholder]); React.useEffect(() => { const handleResize = debounce(() => { renders.current = 0; syncHeight(); }); const containerWindow = ownerWindow(inputRef.current); containerWindow.addEventListener('resize', handleResize); return () => { handleResize.clear(); containerWindow.removeEventListener('resize', handleResize); }; }, [syncHeight]); useEnhancedEffect(() => { syncHeight(); }); React.useEffect(() => { renders.current = 0; }, [value]); const handleChange = (event) => { renders.current = 0; if (!isControlled) { syncHeight(); } if (onChange) { onChange(event); } }; return ( <React.Fragment> <textarea value={value} onChange={handleChange} ref={handleRef} // Apply the rows prop to get a "correct" first SSR paint rows={minRows} style={{ height: state.outerHeightStyle, // Need a large enough difference to allow scrolling. // This prevents infinite rendering loop. overflow: state.overflow ? 'hidden' : null, ...style, }} {...other} /> <textarea aria-hidden className={props.className} readOnly ref={shadowRef} tabIndex={-1} style={{ ...styles.shadow, ...style, padding: 0, }} /> </React.Fragment> ); }); TextareaAutosize.propTypes /* remove-proptypes */ = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * @ignore */ className: PropTypes.string, /** * Maximum number of rows to display. */ maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * Minimum number of rows to display. * @default 1 */ minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * @ignore */ onChange: PropTypes.func, /** * @ignore */ placeholder: PropTypes.string, /** * @ignore */ style: PropTypes.object, /** * @ignore */ value: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.string), PropTypes.number, PropTypes.string, ]), }; export default TextareaAutosize;
mit
benoitc/socketpool
socketpool/util.py
4541
# -*- coding: utf-8 - # # This file is part of socketpool. # See the NOTICE for more information. import errno import os import platform import select import socket import sys try: from importlib import import_module except ImportError: import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex'): raise ValueError("'package' not set to a string") dot = len(package) for x in range(level, 1, -1): try: dot = package.rindex('.', 0, dot) except ValueError: raise ValueError("attempted relative import beyond top-level " "package") return "%s.%s" % (package[:dot], name) def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ if name.startswith('.'): if not package: raise TypeError("relative imports require the 'package' argument") level = 0 for character in name: if character != '.': break level += 1 name = _resolve_name(name[level:], package, level) __import__(name) return sys.modules[name] def load_backend(backend_name): """ load pool backend. If this is an external module it should be passed as "somelib.backend_mod", for socketpool backend you can just pass the name. Supported backend are : - thread: connection are maintained in a threadsafe queue. - gevent: support gevent - eventlet: support eventlet """ try: if len(backend_name.split(".")) > 1: mod = import_module(backend_name) else: mod = import_module("socketpool.backend_%s" % backend_name) return mod except ImportError: error_msg = "%s isn't a socketpool backend" % backend_name raise ImportError(error_msg) def can_use_kqueue(): # See Issue #15. kqueue doesn't work on OS X 10.6 and below. if not hasattr(select, "kqueue"): return False if platform.system() == 'Darwin' and platform.mac_ver()[0] < '10.7': return False return True def is_connected(skt): try: fno = skt.fileno() except socket.error as e: if e[0] == errno.EBADF: return False raise try: if hasattr(select, "epoll"): ep = select.epoll() ep.register(fno, select.EPOLLOUT | select.EPOLLIN) events = ep.poll(0) for fd, ev in events: if fno == fd and \ (ev & select.EPOLLOUT or ev & select.EPOLLIN): ep.unregister(fno) return True ep.unregister(fno) elif hasattr(select, "poll"): p = select.poll() p.register(fno, select.POLLOUT | select.POLLIN) events = p.poll(0) for fd, ev in events: if fno == fd and \ (ev & select.POLLOUT or ev & select.POLLIN): p.unregister(fno) return True p.unregister(fno) elif can_use_kqueue(): kq = select.kqueue() events = [ select.kevent(fno, select.KQ_FILTER_READ, select.KQ_EV_ADD), select.kevent(fno, select.KQ_FILTER_WRITE, select.KQ_EV_ADD) ] kq.control(events, 0) kevents = kq.control(None, 4, 0) for ev in kevents: if ev.ident == fno: if ev.flags & select.KQ_EV_ERROR: return False else: return True # delete events = [ select.kevent(fno, select.KQ_FILTER_READ, select.KQ_EV_DELETE), select.kevent(fno, select.KQ_FILTER_WRITE, select.KQ_EV_DELETE) ] kq.control(events, 0) kq.close() return True else: r, _, _ = select.select([fno], [], [], 0) if not r: return True except IOError: pass except (ValueError, select.error,) as e: pass return False
mit
yogeshsaroya/new-cdnjs
ajax/libs/yui/3.8.0/calendarnavigator/calendarnavigator.js
129
version https://git-lfs.github.com/spec/v1 oid sha256:ec9603f026a2a1295d751178e7e48bf8b945506e9b05818112c5166e1e950a67 size 9557
mit
final-ci/travis-support
lib/travis/support/async.rb
1467
require 'thread' require 'core_ext/module/prepend_to' module Travis module Async require 'travis/support/async/inline' require 'travis/support/async/sidekiq' require 'travis/support/async/threaded' class << self attr_writer :enabled def enabled? !!@enabled end def run(target, method, options, *args, &block) if enabled? options[:queue] ||= target.is_a?(Module) ? target.name : target.class.name strategy = strategy(options.delete(:use)) puts "Enqueueing target: #{target}, method: #{method} to #{options[:queue]} using #{strategy}" if options[:debug] || Travis.respond_to?(:config) && Travis.config.log_level == :debug strategy.run(target, method, options, *args, &block) elsif method.is_a?(Method) method.call(*args, &block) else target.send(method, *args, &block) end rescue Exception => e puts "Exception caught in #{name}.call. Exceptions should be caught in client code" puts e.message, e.backtrace end def strategy(name) const_get(camelize(name || 'inline')) end def camelize(string) string.to_s.gsub(/^.{1}|_.{1}/) { |char| char.gsub('_', '').upcase } end end def async(name, options = {}) prepend_to name do |target, method, *args, &block| Async.run(target, method, options, *args, &block) end end end end
mit
phpManufakturHeirs/kfBasic
Control/CMS/LEPTON/InstallSearch.php
509
<?php /** * kitFramework::Basic * * @author Team phpManufaktur <[email protected]> * @link https://kit2.phpmanufaktur.de * @copyright 2013 Ralf Hertsch <[email protected]> * @license MIT License (MIT) http://www.opensource.org/licenses/MIT */ namespace phpManufaktur\Basic\Control\CMS\LEPTON; use phpManufaktur\Basic\Control\CMS\WebsiteBaker\InstallSearch as WebsiteBakerInstallSearch; class InstallSearch extends WebsiteBakerInstallSearch { // nothing to extend or to change }
mit
Coding/Coding-iPad
CodingForiPad/Utility/ZLPhotoLib/ZLPhotoBrowser/Views/ZLPhotoPickerBrowserPhotoImageView.h
734
// // ZLPhotoPickerBrowserPhotoImageView.h // ZLAssetsPickerDemo // // Created by 张磊 on 14-11-14. // Copyright (c) 2014年 com.zixue101.www. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @protocol ZLPhotoPickerBrowserPhotoImageViewDelegate; @interface ZLPhotoPickerBrowserPhotoImageView : UIImageView {} @property (nonatomic, weak) id <ZLPhotoPickerBrowserPhotoImageViewDelegate> tapDelegate; @property (assign,nonatomic) CGFloat progress; @end @protocol ZLPhotoPickerBrowserPhotoImageViewDelegate <NSObject> @optional - (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch; - (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch; @end
mit
darshanhs90/Java-Coding
src/Feb2021Leetcode/_1051HeightChecker.java
390
package Feb2021Leetcode; import java.util.Arrays; public class _1051HeightChecker { public static void main(String[] args) { System.out.println(heightChecker(new int[] { 1, 1, 4, 2, 1, 3 })); System.out.println(heightChecker(new int[] { 5, 1, 2, 3, 4 })); System.out.println(heightChecker(new int[] { 1, 2, 3, 4, 5 })); } public static int heightChecker(int[] heights) { } }
mit
watir/watirspec
pre_spec.rb
4436
# encoding: utf-8 require File.expand_path("../spec_helper", __FILE__) describe "Pre" do before :each do browser.goto(WatirSpec.url_for("non_control_elements.html")) end # Exists method describe "#exist?" do it "returns true if the 'p' exists" do expect(browser.pre(id: "rspec")).to exist expect(browser.pre(id: /rspec/)).to exist expect(browser.pre(text: 'browser.pre(id: "rspec").should exist')).to exist expect(browser.pre(text: /browser\.pre/)).to exist expect(browser.pre(class: "ruby")).to exist expect(browser.pre(class: /ruby/)).to exist expect(browser.pre(index: 0)).to exist expect(browser.pre(xpath: "//pre[@id='rspec']")).to exist end it "returns the first pre if given no args" do expect(browser.pre).to exist end it "returns false if the 'p' doesn't exist" do expect(browser.pre(id: "no_such_id")).to_not exist expect(browser.pre(id: /no_such_id/)).to_not exist expect(browser.pre(text: "no_such_text")).to_not exist expect(browser.pre(text: /no_such_text/)).to_not exist expect(browser.pre(class: "no_such_class")).to_not exist expect(browser.pre(class: /no_such_class/)).to_not exist expect(browser.pre(index: 1337)).to_not exist expect(browser.pre(xpath: "//pre[@id='no_such_id']")).to_not exist end it "raises TypeError when 'what' argument is invalid" do expect { browser.pre(id: 3.14).exists? }.to raise_error(TypeError) end it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do expect { browser.pre(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException) end end # Attribute methods describe "#class_name" do it "returns the class attribute" do expect(browser.pre(id: 'rspec').class_name).to eq 'ruby' end it "returns an empty string if the element exists and the attribute doesn't" do expect(browser.pre(index: 0).class_name).to eq '' end it "raises UnknownObjectException if the p doesn't exist" do expect { browser.pre(id: 'no_such_id').class_name }.to raise_error(Watir::Exception::UnknownObjectException) end end describe "#id" do it "returns the id attribute" do expect(browser.pre(class: 'ruby').id).to eq "rspec" end it "returns an empty string if the element exists and the attribute doesn't" do expect(browser.pre(index: 0).id).to eq '' end it "raises UnknownObjectException if the pre doesn't exist" do expect { browser.pre(id: "no_such_id").id }.to raise_error(Watir::Exception::UnknownObjectException) expect { browser.pre(index: 1337).id }.to raise_error(Watir::Exception::UnknownObjectException) end end describe "#title" do it "returns the title attribute" do expect(browser.pre(class: 'brainfuck').title).to eq 'The brainfuck language is an esoteric programming language noted for its extreme minimalism' end it "returns an empty string if the element exists and the attribute doesn't" do expect(browser.pre(index: 0).title).to eq '' end it "raises UnknownObjectException if the pre doesn't exist" do expect { browser.pre(id: 'no_such_id').title }.to raise_error(Watir::Exception::UnknownObjectException) expect { browser.pre(xpath: "//pre[@id='no_such_id']").title }.to raise_error(Watir::Exception::UnknownObjectException) end end describe "#text" do it "returns the text of the pre" do expect(browser.pre(class: 'haskell').text).to eq 'main = putStrLn "Hello World"' end it "returns an empty string if the element doesn't contain any text" do expect(browser.pre(index: 0).text).to eq '' end it "raises UnknownObjectException if the pre doesn't exist" do expect { browser.pre(id: 'no_such_id').text }.to raise_error(Watir::Exception::UnknownObjectException) expect { browser.pre(:xpath , "//pre[@id='no_such_id']").text }.to raise_error(Watir::Exception::UnknownObjectException) end end describe "#respond_to?" do it "returns true for all attribute methods" do expect(browser.image(index: 0)).to respond_to(:class_name) expect(browser.image(index: 0)).to respond_to(:id) expect(browser.image(index: 0)).to respond_to(:title) expect(browser.image(index: 0)).to respond_to(:text) end end end
mit
ericoporto/Pixel.Tools
color_conversion.js
3896
/** * Converts an RGB color value to HSL. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. * Assumes r, g, and b are contained in the set [0, 255] and * returns h, s, and l in the set [0, 1]. * * @param Number r The red color value * @param Number g The green color value * @param Number b The blue color value * @return Array The HSL representation */ function rgbToHsl(r, g, b) { r /= 255, g /= 255, b /= 255; var max = Math.max(r, g, b), min = Math.min(r, g, b); var h, s, l = (max + min) / 2; if (max == min) { h = s = 0; // achromatic } else { var d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } //alert(h*360+","+ s*100+","+ l*100 ); return [ h*360, s*100, l*100 ]; } /** * Converts an HSL color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. * Assumes h, s, and l are contained in the set [0, 1] (CHANGED, they get divided in function so that they are within 0,1)and * returns r, g, and b in the set [0, 255]. * * @param Number h The hue * @param Number s The saturation * @param Number l The lightness * @return Array The RGB representation */ function hslToRgb(h, s, l) { h=h/360,s=s/100,l=l/100; var r, g, b; if (s == 0) { r = g = b = l; // achromatic } else { function hue2rgb(p, q, t) { if (t < 0) t += 1; if (t > 1) t -= 1; if (t < 1/6) return p + (q - p) * 6 * t; if (t < 1/2) return q; if (t < 2/3) return p + (q - p) * (2/3 - t) * 6; return p; } var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; r = hue2rgb(p, q, h + 1/3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1/3); } //alert(r * 255+","+ g * 255+","+ b * 255); return [ r * 255, g * 255, b * 255 ]; } /** * Converts an RGB color value to HSV. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSV_color_space. * Assumes r, g, and b are contained in the set [0, 255] and * returns h, s, and v in the set [0, 1]. * * @param Number r The red color value * @param Number g The green color value * @param Number b The blue color value * @return Array The HSV representation */ function rgbToHsv(r, g, b) { r /= 255, g /= 255, b /= 255; var max = Math.max(r, g, b), min = Math.min(r, g, b); var h, s, v = max; var d = max - min; s = max == 0 ? 0 : d / max; if (max == min) { h = 0; // achromatic } else { switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return [ h*360, s*100, v*100 ]; } /** * Converts an HSV color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSV_color_space. * Assumes h, s, and v are contained in the set [0, 1] and * returns r, g, and b in the set [0, 255]. * * @param Number h The hue * @param Number s The saturation * @param Number v The value * @return Array The RGB representation */ function hsvToRgb(h, s, v) { h=h/360,s=s/100,v=v/100; var r, g, b; var i = Math.floor(h * 6); var f = h * 6 - i; var p = v * (1 - s); var q = v * (1 - f * s); var t = v * (1 - (1 - f) * s); switch (i % 6) { case 0: r = v, g = t, b = p; break; case 1: r = q, g = v, b = p; break; case 2: r = p, g = v, b = t; break; case 3: r = p, g = q, b = v; break; case 4: r = t, g = p, b = v; break; case 5: r = v, g = p, b = q; break; } return [ r * 255, g * 255, b * 255 ]; }
mit
oliviertassinari/material-ui
packages/mui-icons-material/lib/esm/CopyrightRounded.js
915
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon( /*#__PURE__*/_jsx("path", { d: "M10.08 10.86c.05-.33.16-.62.3-.87s.34-.46.59-.62c.24-.15.54-.22.91-.23.23.01.44.05.63.13.2.09.38.21.52.36s.25.33.34.53.13.42.14.64h1.79c-.02-.47-.11-.9-.28-1.29s-.4-.73-.7-1.01-.66-.5-1.08-.66-.88-.23-1.39-.23c-.65 0-1.22.11-1.7.34s-.88.53-1.2.92-.56.84-.71 1.36S8 11.29 8 11.87v.27c0 .58.08 1.12.23 1.64s.39.97.71 1.35.72.69 1.2.91c.48.22 1.05.34 1.7.34.47 0 .91-.08 1.32-.23s.77-.36 1.08-.63.56-.58.74-.94.29-.74.3-1.15h-1.79c-.01.21-.06.4-.15.58s-.21.33-.36.46-.32.23-.52.3c-.19.07-.39.09-.6.1-.36-.01-.66-.08-.89-.23-.25-.16-.45-.37-.59-.62s-.25-.55-.3-.88-.08-.67-.08-1v-.27c0-.35.03-.68.08-1.01zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" }), 'CopyrightRounded');
mit
MarkUsProject/Markus
config/initializers/compressors.rb
164
if Rails.env.production? Rails.application.config.assets.js_compressor = Uglifier.new(harmony: true) Rails.application.config.assets.css_compressor = :sass end
mit
ashnewport/elasticsearch
kibana-5.0.2-linux-x86_64/plugins/x-pack/plugins/monitoring/public/directives/shard_allocation/lib/labels.js
1250
/** * ELASTICSEARCH CONFIDENTIAL * _____________________________ * * [2014] Elasticsearch Incorporated All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Elasticsearch Incorporated and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Elasticsearch Incorporated * and its suppliers and may be covered by U.S. and Foreign Patents, * patents in process, and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Elasticsearch Incorporated. */ // The ui had different columns in different order depending on the // $scope.pane.view variable. This provides a lookup for the column headers // labels are linked to view from public/directives/shard_allocation/lib/changeData.js export default { index: ['Nodes'], // "index detail" page shows nodes on which index shards are allocated node: ['Indices'], // "node detail" page shows the indexes that have shards on this node indexWithUnassigned: ['Unassigned', 'Nodes'] // NOTE: is this unused or is there even an indexWithUnassigned view? };
mit
misuqian/ExcelTool
eclipse/poi-3.12/docs/apidocs/org/apache/poi/ddf/class-use/EscherProperties.html
4315
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <title>Uses of Class org.apache.poi.ddf.EscherProperties (POI API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.ddf.EscherProperties (POI API Documentation)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/poi/ddf/EscherProperties.html" title="class in org.apache.poi.ddf">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/poi/ddf/class-use/EscherProperties.html" target="_top">Frames</a></li> <li><a href="EscherProperties.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.poi.ddf.EscherProperties" class="title">Uses of Class<br>org.apache.poi.ddf.EscherProperties</h2> </div> <div class="classUseContainer">No usage of org.apache.poi.ddf.EscherProperties</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/poi/ddf/EscherProperties.html" title="class in org.apache.poi.ddf">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/poi/ddf/class-use/EscherProperties.html" target="_top">Frames</a></li> <li><a href="EscherProperties.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright 2015 The Apache Software Foundation or its licensors, as applicable.</i> </small></p> </body> </html>
mit
isabo/onfire
src/externs/outgoing/onfire-externs.js
28432
/** * OnFire * Copyright (c) 2013 - 2015 Itzy Sabo * Licensed under the MIT License: https://github.com/isabo/onfire/blob/master/LICENSE */ var onfire = {}; /** * An analogue of a Firebase reference. * @see https://www.firebase.com/docs/web/api/firebase/constructor.html * * @param {string|!Firebase} urlOrRef A Firebase URL or a Firebase reference instance. * @constructor * @final */ onfire.Ref = function(urlOrRef) {}; /** * Firebase.authAnonymously() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/authanonymously.html * * @param {!Object=} opt_options * @return { !Promise<!Firebase.AuthCallbackData,!Error> | !goog.Promise<!Firebase.AuthCallbackData,!Error> } A promise which resolves to the authData, or is rejected with an error. */ onfire.Ref.prototype.authAnonymously = function(opt_options) {}; /** * Firebase.authWithCustomToken() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/authwithcustomtoken.html * * @param {string} authToken * @param {!Object=} opt_options * @return { !Promise<!Firebase.AuthCallbackData,!Error> | !goog.Promise<!Firebase.AuthCallbackData,!Error> } A promise which resolves to the authData, or is rejected with an error. */ onfire.Ref.prototype.authWithCustomToken = function(authToken, opt_options) {}; /** * Firebase.authWithOAuthPopup() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/authwithoauthpopup.html * * @param {string} provider * @param {!Object=} opt_options * @return { !Promise<!Firebase.AuthCallbackData,!Error> | !goog.Promise<!Firebase.AuthCallbackData,!Error> } A promise which resolves to the authData, or is rejected with an error. */ onfire.Ref.prototype.authWithOAuthPopup = function(provider, opt_options) {}; /** * Firebase.authWithOAuthRedirect() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/authwithoauthredirect.html * * @param {string} provider * @param {!Object=} opt_options * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise which is rejected with an * error if the authentication fails. */ onfire.Ref.prototype.authWithOAuthRedirect = function(provider, opt_options) {}; /** * Firebase.authWithOAuthToken() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/authwithoauthtoken.html * * @param {string} provider * @param {string|!Object} credentials * @param {!Object=} opt_options * @return { !Promise<!Firebase.AuthCallbackData,!Error> | !goog.Promise<!Firebase.AuthCallbackData,!Error> } A promise which resolves to the authData, or is rejected with an error. */ onfire.Ref.prototype.authWithOAuthToken = function(provider, credentials, opt_options) {}; /** * Firebase.authWithPassword() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/authwithpassword.html * * @param {!Firebase.AuthPasswordCredentials} credentials * @param {!Object=} opt_options * @return { !Promise<!Firebase.AuthCallbackData,!Error> | !goog.Promise<!Firebase.AuthCallbackData,!Error> } A promise which resolves to the authData, or is rejected with an error. */ onfire.Ref.prototype.authWithPassword = function(credentials, opt_options) {}; /** * Firebase.changeEmail() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/changeemail.html * * @param {!{oldEmail:string, password:string, newEmail:string}} credentials * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise which resolves when the * operation is complete, or is rejected with an error. */ onfire.Ref.prototype.changeEmail = function(credentials) {}; /** * Firebase.changePassword() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/changepassword.html * * @param {!{email:string, oldPassword:string, newPassword:string}} credentials * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise which resolves when the * operation is complete, or is rejected with an error. */ onfire.Ref.prototype.changePassword = function(credentials) {}; /** * Firebase.createUser() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/createuser.html * * @param {!Firebase.AuthPasswordCredentials} credentials * @return {!Promise<!{uid:string},!Error>|!goog.Promise<!{uid:string},!Error>} A promise which * resolves to a userData object, or is rejected with an error. */ onfire.Ref.prototype.createUser = function (credentials) {}; /** * Returns a reference that is relative to the current location. * @see https://www.firebase.com/docs/web/api/firebase/child.html * * @param {string} childPath * @return {!onfire.Ref} A reference that is relative to the current location. * @nosideeffects */ onfire.Ref.prototype.child = function(childPath) {}; /** * Generates a push ID. This takes the place of .push() when all we want is a unique ID, via a * synchronous method instead of a promise, which is what .push() returns. * * @return {string} A unique ID. */ onfire.Ref.prototype.generateId = function() {}; /** * A proxy for Firebase.getAuth(). * @see https://www.firebase.com/docs/web/api/firebase/getauth.html * * @return {Firebase.AuthCallbackData} * @nosideeffects */ onfire.Ref.prototype.getAuth = function() {}; /** * A proxy for Firebase.goOnline(). * @see https://www.firebase.com/docs/web/api/firebase/goonline.html */ onfire.Ref.prototype.goOnline = function() {}; /** * A proxy for Firebase.goOffline(). * @see https://www.firebase.com/docs/web/api/firebase/gooffline.html */ onfire.Ref.prototype.goOffline = function() {}; /** * Returns the key of the current location. * @see https://www.firebase.com/docs/web/api/firebase/key.html * * @return {string} The key of the current location. * @nosideeffects */ onfire.Ref.prototype.key = function() {}; /** * Deregisters a previously registered callback. * @see https://www.firebase.com/docs/web/api/query/off.html * * @param {string=} opt_eventType * @param {!Firebase.EventCallback=} opt_callback If provided, this MUST be the *wrapped* callback * returned by the .on() method. * @param {!Object=} opt_context */ onfire.Ref.prototype.off = function(opt_eventType, opt_callback, opt_context) {}; /** * A proxy for Firebase.offAuth(). * @see https://www.firebase.com/docs/web/api/firebase/offauth.html * * @param {!function(Firebase.AuthCallbackData)} onComplete * @param {!Object=} opt_context */ onfire.Ref.prototype.offAuth = function(onComplete, opt_context) {}; /** * Deregisters a previously registered .onValue() callback. * * @param {!function(Firebase.Value)} callback This MUST be the *wrapped* callback returned * by .onValue(). * @param {!Object=} context */ onfire.Ref.prototype.offValue = function(callback, context) {}; /** * Registers a callback for an event of a specified type at the current location. Make sure to keep * the return value for use when turning this off -- see the off() method. * @see https://www.firebase.com/docs/web/api/query/on.html * * @param {string} eventType * @param {!Firebase.EventCallback} callback * @param {function(!Error)=} cancelCallback * @param {Object=} context * @return {!function(!Firebase.DataSnapshot, ?string=)} A handler function that may be needed when * deregistering the callback. */ onfire.Ref.prototype.on = function(eventType, callback, cancelCallback, context) {}; /** * A proxy for Firebase.onAuth(). * @see https://www.firebase.com/docs/web/api/firebase/onauth.html * * @param {!function(Firebase.AuthCallbackData)} onComplete * @param {!Object=} opt_context */ onfire.Ref.prototype.onAuth = function(onComplete, opt_context) {}; /** * Waits for the first event of a specified type at the current location. A promisified analogue * of Firebase's .once() method. * @see https://www.firebase.com/docs/web/api/query/once.html * * @param {string} eventType * @return {!Promise<!Firebase.DataSnapshot,!Error>|!goog.Promise<!Firebase.DataSnapshot,!Error>} A * promise that resolves to a Firebase snapshot, or is rejected with an error. */ onfire.Ref.prototype.once = function(eventType) {}; /** * Retrieves the value that is stored at the current location. This is shorthand for calling .once() * for the 'value' event and then extracting the value of the returned snapshot. * * @return {!Promise<Firebase.Value,!Error>|!goog.Promise<Firebase.Value,!Error>} A promise that * resolves to the value stored at the current location, or is rejected with an error. */ onfire.Ref.prototype.onceValue = function() {}; /** * Registers a callback for value changes at the current location. This is shorthand for calling * .on() for the 'value' event and then extracting the value of each returned snapshot. Make sure to * keep the return value for when you want to turn this off. See the .offValue() method. * * @param {!function(Firebase.Value)} callback * @param {!function(!Error)=} cancelCallback * @param {!Object=} context * @return {!function(!Firebase.DataSnapshot)} */ onfire.Ref.prototype.onValue = function(callback, cancelCallback, context) {}; /** * Returns a reference to the parent of the current location. * @see https://www.firebase.com/docs/web/api/firebase/parent.html * * @return {onfire.Ref} A reference to the parent of the current location. * @nosideeffects */ onfire.Ref.prototype.parent = function() {}; /** * Returns the path of this reference relative to the root, i.e. not including the firebaseio.com * domain. * * @return {string} The path of this reference relative to the root. * @nosideeffects */ onfire.Ref.prototype.path = function() {}; /** * Pushes a value under the current location. A promisified analogue of Firebase's .push() method. * @see https://www.firebase.com/docs/web/api/firebase/push.html * * @param {Firebase.Value=} opt_value * @return {!Promise<!onfire.Ref,!Error>|!goog.Promise<!onfire.Ref,!Error>} A promise that resolves * to the Ref of the newly pushed child. */ onfire.Ref.prototype.push = function(opt_value) {}; /** * Returns an unwrapped Firebase reference to the current location. * * @return {!Firebase} An unwrapped Firebase reference to the current location. * @nosideeffects */ onfire.Ref.prototype.ref = function() {}; /** * Removes the data that is stored at the current location. A promisified analogue of Firebase's * .remove() method. * @see https://www.firebase.com/docs/web/api/firebase/remove.html * * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise that resolves when the * operation is complete, or is rejected with an error. */ onfire.Ref.prototype.remove = function() {}; /** * Firebase.removeUser() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/removeuser.html * * @param {!Firebase.AuthPasswordCredentials} credentials * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise which resolves when the * operation is complete, or is rejected with an error. */ onfire.Ref.prototype.removeUser = function(credentials) {}; /** * Firebase.resetPassword() wrapped in a promise. * @see https://www.firebase.com/docs/web/api/firebase/resetpassword.html * * @param {!{email:string}} credentials * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise which resolves when the * operation is complete, or is rejected with an error. */ onfire.Ref.prototype.resetPassword = function(credentials) {}; /** * Returns a reference that represents the root of the tree. * @see https://www.firebase.com/docs/web/api/firebase/root.html * * @return {!onfire.Ref} A reference that represents the root of the tree. * @nosideeffects */ onfire.Ref.prototype.root = function() {}; /** * Stores a value at the current location. A promisified analogue of Firebase's .set() method. * @see https://www.firebase.com/docs/web/api/firebase/set.html * * @param {Firebase.Value} value * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise that resolves when the * operation is complete, or is rejected with an error. */ onfire.Ref.prototype.set = function(value) {}; /** * Sets a the values stored at the current location, atomically. A promisified analogue of * Firebase's .transaction() method. * @see https://www.firebase.com/docs/web/api/firebase/transaction.html * * @param {Firebase.TransactionUpdateFunction} updateFn * @return { !Promise<!{{isCommitted:boolean,snapshot:Firebase.DataSnapshot}},!Error> | !goog.Promise<!{{isCommitted:boolean,snapshot:Firebase.DataSnapshot}},!Error> } A promise that resolves when the operation is complete, or is rejected with an error. The value provided when the promise resolves is an object with two properties: isCommitted: whether the operation actually committed a value to the database. snapshot: a snapshot of the current data. */ onfire.Ref.prototype.transaction = function(updateFn) {}; /** * A proxy for Firebase.unauth(). * @see https://www.firebase.com/docs/web/api/firebase/unauth.html */ onfire.Ref.prototype.unauth = function() {}; /** * Updates multiple key/value pairs stored at the current location. A promisified analogue of * Firebase's .update() method. * @see https://www.firebase.com/docs/web/api/firebase/update.html * * @param {!Object<string,Firebase.Value>} values An object containing the key/value pairs. * @return {!Promise<null,!Error>|goog.Promise<null,!Error>} A promise that resolves when the * operation is complete, or is rejected with an error. */ onfire.Ref.prototype.update = function(values) {}; /** * Generates a subclass of onfire.model.Model or onfire.model.Collection with a baked in schema. * * @param {!Object} schema A schema object. * @return {!function(new:onfire.model.Model, !onfire.Ref)} A model constructor. * @throws {Error} */ onfire.defineModel = function(schema) {}; onfire.model = {}; /** * Base class to represent objects that live in Firebase. * * @param {!onfire.Ref} ref The reference of the current object. * @constructor */ onfire.model.Model = function(ref) {}; /** * Releases resources used by the model. Call this when you no longer need the instance. */ onfire.model.Model.prototype.dispose = function() {}; /** * Determines whether the underlying data exists. We may have retrieved a non-existent object, or * it may have subsequently been deleted. * * @return {boolean} Whether the underlying data actually exists. * @throws {Error} */ onfire.model.Model.prototype.exists = function() {}; /** * Synchronously retrieves the value associated with a key. If the value is not a primitive, a model * instance will be returned, in which case .whenLoaded() should be called on the returned model in * order to know when it is ready to use. If the key is already known to represent a model, it is * better to obtain it via the asynchronous .fetch() method. * If the key is specified in the schema, its value, or a model representing its value, will be * returned. If the key represents a primitive but missing value, the return value will be null. * If the key is not specified in the schema, but does have a value in the underlying data, that * value will be returned. Otherwise, an exception will be thrown. * * @param {string} key * @return {Firebase.Value|onfire.model.Model} A primitive value or a model instance. * @throws {Error} */ onfire.model.Model.prototype.get = function(key) {}; /** * Synchronously retrieves the primitive value associated with a key. If the value is an object, it * is returned unwrapped, i.e. not as a model instance. * If the key is specified in the schema, its value will be returned. If the key does not have a * value the return value will be null. * If the key is not specified in the schema, but does have a value in the underlying data, that * value will be returned. Otherwise, an exception will be thrown. * * @param {string} key The key under which the value is stored. * @return {Firebase.Value} The value or unwrapped object associated with the key. * @throws {Error} */ onfire.model.Model.prototype.getBasicValue = function(key) {}; /** * Synchronously retrieves the model instance that represents a non-primitive value that is * associated with a key. Make sure to call .whenLoaded() on the returned model in order to know when * it is ready to use. In many cases it may be more convenient to call the asynchronous .fetch() * method instead. * If the key is not specified in the schema, an exception will be thrown. * * @param {string} key * @return {!onfire.model.Model} * @throws {Error} */ onfire.model.Model.prototype.getModel = function(key) {}; /** * Determines whether there are any unsaved changes on this model. * * @return {boolean} Whether there are any unsaved changes on this model. */ onfire.model.Model.prototype.hasChanges = function() {}; /** * Returns the key of the model's reference. * * @return {string} The key of the model's reference */ onfire.model.Model.prototype.key = function() {}; /** * Register the callback function that will be called whenever the model is updated. To deregister * an existing callback, just pass null as the callback argument. * * @param {function()|null} callback */ onfire.model.Model.prototype.onValueChanged = function(callback) {}; /** * Asynchronously commits the outstanding changes. * * @return {!Promise<!onfire.model.Model,!Error>|!goog.Promise<!onfire.model.Model,!Error>} A * promise that resolves to this model instance when the operation completes successfully, or * is rejected with an error. * @throws {Error} if called when model is not yet loaded. */ onfire.model.Model.prototype.save = function() {}; /** * Registers the desire to change the primitive value associated with a key. The value will be * committed only when .save() is called. Returns a reference to the current model to allow * chaining, e.g., * person.set('firstName', 'John').set('lastName', 'Smith').save() * Throws an error if the key is not specified in the schema and does not already have a value in * the underlying data. * * @param {string} key The name of a property. * @param {Firebase.Value} value The primitive value to assign to the property. * @return {!onfire.model.Model} This model instance, in order to make the method chainable. * @throws {Error} */ onfire.model.Model.prototype.set = function(key, value) {}; /** * Returns a promise that is resolved to this instance when the data has been loaded. * * @return {!Promise<!onfire.model.Model,!Error>|!goog.Promise<!onfire.model.Model,!Error>} A * promise resolves to this instance when the data has been loaded. */ onfire.model.Model.prototype.whenLoaded = function() {}; /** * Exposes the schema. This is only exposed on generated models, and is included here for * documentation purposes only. * * @return {!Object} */ onfire.model.Model.getSchema = function() {}; /** * Base class for collections that live in Firebase. If collection members are not primitives, they * are lazily loaded -- only when requested. * * @param {!onfire.Ref} ref The reference of the current object. * @param {!function(new:onfire.model.Model, !onfire.Ref, number=)=} opt_memberCtor The model * constructor to use for instances of collection members. If the members are primitives, * this should not be supplied. * @constructor * @extends {onfire.model.Model} */ onfire.model.Collection = function(ref, opt_memberCtor) {}; /** * Determines whether the collection already has an entry for the provided key. * * @param {string} key * @return {boolean} * @throws {Error} */ onfire.model.Collection.prototype.containsKey = function(key) {}; /** * Returns the number of values in the collection. * * @return {number} The number of values in the collection. * @throws {Error} */ onfire.model.Collection.prototype.count = function() {}; /** * Asynchronously creates a model instance and adds it as a member of the collection, with an * automatically generated key. * * @param {!Object<string,Firebase.Value>=} opt_values An object containing the property/value pairs * to initialize the new object with. * @return {!Promise<!onfire.model.Model,!Error>|!goog.Promise<!onfire.model.Model,!Error>} A * promise that resolves to a model instance, or is rejected with an error. * @throws {Error} */ onfire.model.Collection.prototype.create = function(opt_values) {}; /** * Asynchronously retrieves a model instance that represents a member of the collection. Throws an * exception if the key does not exist. * * @param {string} key The key of the member. * @return {!Promise<!onfire.model.Model,!Error>|!goog.Promise<!onfire.model.Model,!Error>} A * promise that resolves to a model instance, or is rejected with an error. * @throws {Error} */ onfire.model.Collection.prototype.fetch = function(key) {}; /** * Asynchronously retrieves an existing item by its key, or creates it if it does not yet exist, and * adds it to the collection. * * @param {string} key * @param {!Object<string,Firebase.Value>=} values A set of property/value pairs to assign if * created. If null, don't set any values. The object will come into existence only when a * value is set and committed to the database. * @return {!Promise<!onfire.model.Model,!Error>|!goog.Promise<!onfire.model.Model,!Error>} A * promise that resolves to a model instance, or is rejected with an error. * @throws {Error} */ onfire.model.Collection.prototype.fetchOrCreate = function(key, values) {}; /** * Calls a callback for each member of the collection. Returns a promise that is resolved once all * the callbacks have been invoked, and any promises returned by callbacks have themselves been * resolved. * The callback function should accept a primitive value or a model instance, according to the type * of members in the collection. It does not need to return anything, but if it returns a promise, * the main return value of this method (a promise) will depend on it. * * @param { !function((!onfire.model.Model|Firebase.Value), string=):(!Promise|!goog.Promise|undefined) } callback * @return {(!Promise|!goog.Promise)} A promise that in resolved when all callbacks have completed. * @throws {Error} */ onfire.model.Collection.prototype.forEach = function(callback) {}; /** * Synchronously retrieves the value associated with a key. If the collection members are not * primitive values, a model instance will be returned, in which case .whenLoaded() should be called * on the returned model in order to know when it is ready to use. Consider using the asynchronous * .fetch() method instead. * Throws an exception if the key does not have a value in the underlying data. * * @override * @param {string} key An key of an item in the collection. * @return {Firebase.Value|onfire.model.Model} A primitive value or a model instance. * @throws {Error} */ onfire.model.Collection.prototype.get = function(key) {}; /** * Synchronously retrieves the primitive value associated with a key. If the value is an object, it * is returned unwrapped, i.e. not as a model instance. * Throws an exception if the key does not have a value in the underlying data. * * @param {string} key The key of the desired value. * @return {Firebase.Value} * @throws {Error} */ onfire.model.Collection.prototype.getBasicValue = function(key) {}; /** * Synchronously retrieves the value associated with a key and wraps it in a model instance. Make * sure to call .whenLoaded() on the returned model in order to know when it is ready to use. * Consider using the asynchronous .fetch() method instead. * Throws an exception if the key does not have a value in the underlying data. * * @param {string} key The key of the desired item. * @return {!onfire.model.Model} A model instance. * @throws {Error} */ onfire.model.Collection.prototype.getModel = function(key) {}; /** * Returns an array of the keys of members in the collection. * * @return {!Array<string>} An array of the keys of members in the collection. * @throws {Error} */ onfire.model.Collection.prototype.keys = function() {}; /** * Register the callback function that will be called whenever a child is added. To deregister * an existing callback, just pass null as the callback argument. * * @param {function(string)|null} callback A function that will be called with the key of the new * child. */ onfire.model.Collection.prototype.onChildAdded = function(callback) {}; /** * Register the callback function that will be called whenever a child is removed. To deregister * an existing callback, just pass null as the callback argument. * * @param {function(string)|null} callback A function that will be called with the key of the * removed child. */ onfire.model.Collection.prototype.onChildRemoved = function(callback) {}; /** * Asynchronously removes the specified member of the collection. The promise is not rejected if the * member is not present. * * @param {string} key The key of the member. * @return {!Promise<null,!Error>|!goog.Promise<null,!Error>} A promise that resolves when the * operation is complete, or is rejected with an error. * @throws {Error} */ onfire.model.Collection.prototype.remove = function(key) {}; /** * Registers the desire to change the primitive value associated with a key. The value will be * committed only when .save() is called. Returns a reference to the current model to allow * chaining, e.g., * person.set('firstName', 'John').set('lastName', 'Smith').save() * Throws an error if the key is not specified in the schema and does not already have a value in * the underlying data. * * @override return type. * @param {string} key The name of a property. * @param {Firebase.Value} value The primitive value to assign to the property. * @return {!onfire.model.Collection} * @throws {Error} */ onfire.model.Collection.prototype.set = function(key, value) {}; /** * @override the return type. * @return {!Promise<!onfire.model.Collection,!Error>|!goog.Promise<!onfire.model.Collection,!Error>} */ onfire.model.Collection.prototype.save; /** * @override the return type. * @return {!Promise<!onfire.model.Collection,!Error>|!goog.Promise<!onfire.model.Collection,!Error>} */ onfire.model.Collection.prototype.whenLoaded; /** * Exposes the type of members in the collection. This is only exposed on generated models, and is * dincluded here for ocumentation purposes only. * * @return {function(new:onfire.model.Model, !onfire.Ref)|undefined} */ onfire.model.Collection.getMemberCtor = function() {}; /** * Error messages that are thrown. * * @enum {string} */ onfire.model.Error = {}; /** * Thrown when the argument provided to the model constructor is not an onfire.Ref instance. * * @type {string} */ onfire.model.Error.INVALID_REF; /** * Thrown when a property or method is accessed before the model has finished loading, and the * result would be incorrect or unavailable. * * @type {string} */ onfire.model.Error.NOT_LOADED; /** * Thrown when an attempt is made to get or set the value of a key that is not specified in the * schema and does not exist in the underlying data. * * @type {string} */ onfire.model.Error.NO_SUCH_KEY; /** * Thrown when an attempt is made to obtain a model to represent a primitive value, e.g. calling * .getModel('abc') when .abc has an integer value according to the schema or in reality. * Another example is calling a collection's .create(), .fetch() or fetchOrCreate() methods * when the collection is a colection of primitive values and not models. * * @type {string} */ onfire.model.Error.NOT_A_MODEL; /** * Thrown when an attempt is made to assign a value to a key that represents a model. Any * changes need to be assigned via the model itself. In order to add a model instance to a * collection use .create() or .fetchOrCreate() instead of .set(). * * @type {string} */ onfire.model.Error.NOT_A_PRIMITIVE;
mit
MiracleBlue/html-significant-other
CHANGELOG.md
562
## 0.2.2 - Cleanup ## 0.2.1 - APM Publishing ## 0.1.2 - Cleanup * Cleaned up docs, menus ## 0.1.1 - Bugfixes * Fixed a bug where typing a '>' between an opening and closing pair of tags would...behave poorly ## 0.1.0 - First Release * Closes any tag with entire opening tag on same line when typing '>' * Places your cursor between the opening and closing tags so you can just start goin'! ### Known Bugs * Closes all tags, whether or not the tag closes (e.g. <img>) * Should handle multiline tags, but does not * Is unaware of tags that are already closed
mit
dacap/loseface
third_party/clapack/SRC/zungtr.c
6823
#include "f2c.h" #include "blaswrap.h" /* Table of constant values */ static integer c__1 = 1; static integer c_n1 = -1; /* Subroutine */ int zungtr_(char *uplo, integer *n, doublecomplex *a, integer *lda, doublecomplex *tau, doublecomplex *work, integer *lwork, integer *info) { /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ integer i__, j, nb; extern logical lsame_(char *, char *); integer iinfo; logical upper; extern /* Subroutine */ int xerbla_(char *, integer *); extern integer ilaenv_(integer *, char *, char *, integer *, integer *, integer *, integer *); integer lwkopt; logical lquery; extern /* Subroutine */ int zungql_(integer *, integer *, integer *, doublecomplex *, integer *, doublecomplex *, doublecomplex *, integer *, integer *), zungqr_(integer *, integer *, integer *, doublecomplex *, integer *, doublecomplex *, doublecomplex *, integer *, integer *); /* -- LAPACK routine (version 3.1) -- */ /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ /* November 2006 */ /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Purpose */ /* ======= */ /* ZUNGTR generates a complex unitary matrix Q which is defined as the */ /* product of n-1 elementary reflectors of order N, as returned by */ /* ZHETRD: */ /* if UPLO = 'U', Q = H(n-1) . . . H(2) H(1), */ /* if UPLO = 'L', Q = H(1) H(2) . . . H(n-1). */ /* Arguments */ /* ========= */ /* UPLO (input) CHARACTER*1 */ /* = 'U': Upper triangle of A contains elementary reflectors */ /* from ZHETRD; */ /* = 'L': Lower triangle of A contains elementary reflectors */ /* from ZHETRD. */ /* N (input) INTEGER */ /* The order of the matrix Q. N >= 0. */ /* A (input/output) COMPLEX*16 array, dimension (LDA,N) */ /* On entry, the vectors which define the elementary reflectors, */ /* as returned by ZHETRD. */ /* On exit, the N-by-N unitary matrix Q. */ /* LDA (input) INTEGER */ /* The leading dimension of the array A. LDA >= N. */ /* TAU (input) COMPLEX*16 array, dimension (N-1) */ /* TAU(i) must contain the scalar factor of the elementary */ /* reflector H(i), as returned by ZHETRD. */ /* WORK (workspace/output) COMPLEX*16 array, dimension (MAX(1,LWORK)) */ /* On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */ /* LWORK (input) INTEGER */ /* The dimension of the array WORK. LWORK >= N-1. */ /* For optimum performance LWORK >= (N-1)*NB, where NB is */ /* the optimal blocksize. */ /* If LWORK = -1, then a workspace query is assumed; the routine */ /* only calculates the optimal size of the WORK array, returns */ /* this value as the first entry of the WORK array, and no error */ /* message related to LWORK is issued by XERBLA. */ /* INFO (output) INTEGER */ /* = 0: successful exit */ /* < 0: if INFO = -i, the i-th argument had an illegal value */ /* ===================================================================== */ /* .. Parameters .. */ /* .. */ /* .. Local Scalars .. */ /* .. */ /* .. External Functions .. */ /* .. */ /* .. External Subroutines .. */ /* .. */ /* .. Intrinsic Functions .. */ /* .. */ /* .. Executable Statements .. */ /* Test the input arguments */ /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1; a -= a_offset; --tau; --work; /* Function Body */ *info = 0; lquery = *lwork == -1; upper = lsame_(uplo, "U"); if (! upper && ! lsame_(uplo, "L")) { *info = -1; } else if (*n < 0) { *info = -2; } else if (*lda < max(1,*n)) { *info = -4; } else /* if(complicated condition) */ { /* Computing MAX */ i__1 = 1, i__2 = *n - 1; if (*lwork < max(i__1,i__2) && ! lquery) { *info = -7; } } if (*info == 0) { if (upper) { i__1 = *n - 1; i__2 = *n - 1; i__3 = *n - 1; nb = ilaenv_(&c__1, "ZUNGQL", " ", &i__1, &i__2, &i__3, &c_n1); } else { i__1 = *n - 1; i__2 = *n - 1; i__3 = *n - 1; nb = ilaenv_(&c__1, "ZUNGQR", " ", &i__1, &i__2, &i__3, &c_n1); } /* Computing MAX */ i__1 = 1, i__2 = *n - 1; lwkopt = max(i__1,i__2) * nb; work[1].r = (doublereal) lwkopt, work[1].i = 0.; } if (*info != 0) { i__1 = -(*info); xerbla_("ZUNGTR", &i__1); return 0; } else if (lquery) { return 0; } /* Quick return if possible */ if (*n == 0) { work[1].r = 1., work[1].i = 0.; return 0; } if (upper) { /* Q was determined by a call to ZHETRD with UPLO = 'U' */ /* Shift the vectors which define the elementary reflectors one */ /* column to the left, and set the last row and column of Q to */ /* those of the unit matrix */ i__1 = *n - 1; for (j = 1; j <= i__1; ++j) { i__2 = j - 1; for (i__ = 1; i__ <= i__2; ++i__) { i__3 = i__ + j * a_dim1; i__4 = i__ + (j + 1) * a_dim1; a[i__3].r = a[i__4].r, a[i__3].i = a[i__4].i; /* L10: */ } i__2 = *n + j * a_dim1; a[i__2].r = 0., a[i__2].i = 0.; /* L20: */ } i__1 = *n - 1; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = i__ + *n * a_dim1; a[i__2].r = 0., a[i__2].i = 0.; /* L30: */ } i__1 = *n + *n * a_dim1; a[i__1].r = 1., a[i__1].i = 0.; /* Generate Q(1:n-1,1:n-1) */ i__1 = *n - 1; i__2 = *n - 1; i__3 = *n - 1; zungql_(&i__1, &i__2, &i__3, &a[a_offset], lda, &tau[1], &work[1], lwork, &iinfo); } else { /* Q was determined by a call to ZHETRD with UPLO = 'L'. */ /* Shift the vectors which define the elementary reflectors one */ /* column to the right, and set the first row and column of Q to */ /* those of the unit matrix */ for (j = *n; j >= 2; --j) { i__1 = j * a_dim1 + 1; a[i__1].r = 0., a[i__1].i = 0.; i__1 = *n; for (i__ = j + 1; i__ <= i__1; ++i__) { i__2 = i__ + j * a_dim1; i__3 = i__ + (j - 1) * a_dim1; a[i__2].r = a[i__3].r, a[i__2].i = a[i__3].i; /* L40: */ } /* L50: */ } i__1 = a_dim1 + 1; a[i__1].r = 1., a[i__1].i = 0.; i__1 = *n; for (i__ = 2; i__ <= i__1; ++i__) { i__2 = i__ + a_dim1; a[i__2].r = 0., a[i__2].i = 0.; /* L60: */ } if (*n > 1) { /* Generate Q(2:n,2:n) */ i__1 = *n - 1; i__2 = *n - 1; i__3 = *n - 1; zungqr_(&i__1, &i__2, &i__3, &a[(a_dim1 << 1) + 2], lda, &tau[1], &work[1], lwork, &iinfo); } } work[1].r = (doublereal) lwkopt, work[1].i = 0.; return 0; /* End of ZUNGTR */ } /* zungtr_ */
mit
alvinvarghese/MMFlowView
Classes/osx/MMFlowView+NSResponder.h
1367
/* The MIT License (MIT) Copyright (c) 2014 Markus Müller https://github.com/mmllr 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. */ // // MMFlowView+NSResponder.h // // Created by Markus Müller on 13.02.14. // Copyright (c) 2014 www.isnotnil.com. All rights reserved. // #import "MMFlowView.h" @interface MMFlowView (NSResponder) @end
mit
crofty/sensor_js_message_parsing
vendor/sproutcore-metal/lib/observer.js
4614
// ========================================================================== // Project: SproutCore Metal // Copyright: ©2011 Strobe Inc. and contributors. // License: Licensed under MIT license (see license.js) // ========================================================================== /*globals sc_assert */ require('sproutcore-metal/core'); require('sproutcore-metal/platform'); require('sproutcore-metal/utils'); require('sproutcore-metal/accessors'); var AFTER_OBSERVERS = ':change'; var BEFORE_OBSERVERS = ':before'; var guidFor = SC.guidFor; var normalizePath = SC.normalizePath; var suspended = 0; var array_Slice = Array.prototype.slice; var ObserverSet = function(iterateable) { this.set = {}; if (iterateable) { this.array = []; } } ObserverSet.prototype.add = function(target, name) { var set = this.set, guid = SC.guidFor(target), array; if (!set[guid]) { set[guid] = {}; } set[guid][name] = true; if (array = this.array) { array.push([target, name]); } }; ObserverSet.prototype.contains = function(target, name) { var set = this.set, guid = SC.guidFor(target), nameSet = set[guid]; return nameSet && nameSet[name]; }; ObserverSet.prototype.empty = function() { this.set = {}; this.array = []; }; ObserverSet.prototype.forEach = function(fn) { var q = this.array; this.empty(); q.forEach(function(item) { fn(item[0], item[1]); }); }; var queue = new ObserverSet(true), beforeObserverSet = new ObserverSet(); function notifyObservers(obj, eventName, forceNotification) { if (suspended && !forceNotification) { // if suspended add to the queue to send event later - but only send // event once. if (!queue.contains(obj, eventName)) { queue.add(obj, eventName); } } else { SC.sendEvent(obj, eventName); } } function flushObserverQueue() { beforeObserverSet.empty(); if (!queue || queue.array.length===0) return ; queue.forEach(function(target, event){ SC.sendEvent(target, event); }); } SC.beginPropertyChanges = function() { suspended++; return this; }; SC.endPropertyChanges = function() { suspended--; if (suspended<=0) flushObserverQueue(); }; function changeEvent(keyName) { return keyName+AFTER_OBSERVERS; } function beforeEvent(keyName) { return keyName+BEFORE_OBSERVERS; } function changeKey(eventName) { return eventName.slice(0, -7); } function beforeKey(eventName) { return eventName.slice(0, -7); } function xformForArgs(args) { return function (target, method, params) { var obj = params[0], keyName = changeKey(params[1]), val; if (method.length>2) val = SC.getPath(obj, keyName); args.unshift(obj, keyName, val); method.apply(target, args); } } var xformChange = xformForArgs([]); function xformBefore(target, method, params) { var obj = params[0], keyName = beforeKey(params[1]), val; if (method.length>2) val = SC.getPath(obj, keyName); method.call(target, obj, keyName, val); } SC.addObserver = function(obj, path, target, method) { path = normalizePath(path); var xform; if (arguments.length > 4) { var args = array_Slice.call(arguments, 4); xform = xformForArgs(args); } else { xform = xformChange; } SC.addListener(obj, changeEvent(path), target, method, xform); SC.watch(obj, path); return this; }; /** @private */ SC.observersFor = function(obj, path) { return SC.listenersFor(obj, changeEvent(path)); }; SC.removeObserver = function(obj, path, target, method) { path = normalizePath(path); SC.unwatch(obj, path); SC.removeListener(obj, changeEvent(path), target, method); return this; }; SC.addBeforeObserver = function(obj, path, target, method) { path = normalizePath(path); SC.addListener(obj, beforeEvent(path), target, method, xformBefore); SC.watch(obj, path); return this; }; /** @private */ SC.beforeObserversFor = function(obj, path) { return SC.listenersFor(obj, beforeEvent(path)); }; SC.removeBeforeObserver = function(obj, path, target, method) { path = normalizePath(path); SC.unwatch(obj, path); SC.removeListener(obj, beforeEvent(path), target, method); return this; }; /** @private */ SC.notifyObservers = function(obj, keyName) { notifyObservers(obj, changeEvent(keyName)); }; /** @private */ SC.notifyBeforeObservers = function(obj, keyName) { var guid, set, forceNotification = false; if (suspended) { if (!beforeObserverSet.contains(obj, keyName)) { beforeObserverSet.add(obj, keyName); forceNotification = true; } else { return; } } notifyObservers(obj, beforeEvent(keyName), forceNotification); };
mit
Schumix/CsharpSQLite
Tests/System.Data.SQLite.Tests/CollateFixture.cs
2066
using NUnit.Framework; using NUnit.Framework.Constraints; using System; using System.IO; using System.Data.SQLite; namespace System.Data.SQLite.Tests { [TestFixture] public class CollateFixture { [Test] public void NoCaseCollateTest() { using(var con = new SQLiteConnection("Data Source=:memory:")) using(var cmd = con.CreateCommand()) { con.Open(); cmd.CommandText = @"create table tbl1(one varchar(10), two integer);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"insert into tbl1 values('HELLO!',100);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"insert into tbl1 values('Hello!',20);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"insert into tbl1 values('hello!',310);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"select * from tbl1 order by one collate NOCASE"; var reader = cmd.ExecuteReader(); string value = "a"; while(reader.Read()) { var tmp = (string)reader["one"]; Assert.That(tmp, Is.Not.EqualTo(value)); Assert.That(tmp.ToLower(), Is.GreaterThanOrEqualTo(value.ToLower())); value = tmp; } } } [Test] public void RTrimCollateTest() { using(var con = new SQLiteConnection("Data Source=:memory:")) using(var cmd = con.CreateCommand()) { con.Open(); cmd.CommandText = @"create table tbl1(one varchar(10), two integer);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"insert into tbl1 values('hello! ',100);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"insert into tbl1 values('hello! ',20);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"insert into tbl1 values('hello!',310);"; cmd.ExecuteNonQuery(); cmd.CommandText = @"select * from tbl1 order by one collate NOCASE"; var reader = cmd.ExecuteReader(); string value = "a"; while(reader.Read()) { var tmp = (string)reader["one"]; Assert.That(tmp, Is.Not.EqualTo(value)); Assert.That(tmp.Trim(), Is.GreaterThanOrEqualTo(value.Trim())); value = tmp; } } } } }
mit
schacon/git-ruby
lib/git-ruby/raw/internal/mmap.rb
1176
# # converted from the gitrb project # # authors: # Matthias Lederhofer <[email protected]> # Simon 'corecode' Schubert <[email protected]> # # provides native ruby access to git objects and pack files # begin require 'mmap' rescue LoadError module GitRuby module Raw module Internal class Mmap def initialize(file) @file = file @offset = nil end def unmap @file = nil end def [](*idx) idx = idx[0] if idx.length == 1 case idx when Range offset = idx.first len = idx.last - idx.first + idx.exclude_end? ? 0 : 1 when Fixnum offset = idx len = nil when Array offset, len = idx else raise RuntimeError, "invalid index param: #{idx.class}" end if @offset != offset @file.seek(offset) end @offset = offset + len ? len : 1 if not len @file.read(1)[0] else @file.read(len) end end end end end end end # rescue LoadError
mit
Aprila/laboratory
vendor/nette/application/src/Bridges/ApplicationLatte/UIMacros.php
4523
<?php /** * This file is part of the Nette Framework (https://nette.org) * Copyright (c) 2004 David Grudl (https://davidgrudl.com) */ namespace Nette\Bridges\ApplicationLatte; use Latte; use Latte\CompileException; use Latte\MacroNode; use Latte\PhpWriter; use Nette; use Nette\Utils\Strings; /** * Macros for Nette\Application\UI. * * - {link destination ...} control link * - {plink destination ...} presenter link * - {snippet ?} ... {/snippet ?} control snippet * - n:nonce */ class UIMacros extends Latte\Macros\MacroSet { /** @var bool|string */ private $extends; public static function install(Latte\Compiler $compiler) { $me = new static($compiler); $me->addMacro('control', [$me, 'macroControl']); $me->addMacro('href', null, null, function (MacroNode $node, PhpWriter $writer) use ($me) { return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php '; }); $me->addMacro('plink', [$me, 'macroLink']); $me->addMacro('link', [$me, 'macroLink']); $me->addMacro('ifCurrent', [$me, 'macroIfCurrent'], '}'); // deprecated; use n:class="$presenter->linkCurrent ? ..." $me->addMacro('extends', [$me, 'macroExtends']); $me->addMacro('layout', [$me, 'macroExtends']); $me->addMacro('nonce', null, null, 'echo $this->global->uiNonce ? " nonce=\"{$this->global->uiNonce}\"" : "";'); } /** * Initializes before template parsing. * @return void */ public function initialize() { $this->extends = false; } /** * Finishes template parsing. * @return array(prolog, epilog) */ public function finalize() { return [$this->extends . 'Nette\Bridges\ApplicationLatte\UIRuntime::initialize($this, $this->parentName, $this->blocks);']; } /********************* macros ****************d*g**/ /** * {control name[:method] [params]} */ public function macroControl(MacroNode $node, PhpWriter $writer) { $words = $node->tokenizer->fetchWords(); if (!$words) { throw new CompileException('Missing control name in {control}'); } $name = $writer->formatWord($words[0]); $method = isset($words[1]) ? ucfirst($words[1]) : ''; $method = Strings::match($method, '#^\w*\z#') ? "render$method" : "{\"render$method\"}"; $tokens = $node->tokenizer; $pos = $tokens->position; $param = $writer->formatArray(); $tokens->position = $pos; while ($tokens->nextToken()) { if ($tokens->isCurrent('=>') && !$tokens->depth) { $wrap = true; break; } } if (empty($wrap)) { $param = substr($param, 1, -1); // removes array() or [] } return "/* line $node->startLine */ " . ($name[0] === '$' ? "if (is_object($name)) \$_tmp = $name; else " : '') . '$_tmp = $this->global->uiControl->getComponent(' . $name . '); ' . 'if ($_tmp instanceof Nette\Application\UI\IRenderable) $_tmp->redrawControl(null, false); ' . ($node->modifiers === '' ? "\$_tmp->$method($param);" : $writer->write("ob_start(function () {}); \$_tmp->$method($param); echo %modify(ob_get_clean());") ); } /** * {link destination [,] [params]} * {plink destination [,] [params]} * n:href="destination [,] [params]" */ public function macroLink(MacroNode $node, PhpWriter $writer) { $node->modifiers = preg_replace('#\|safeurl\s*(?=\||\z)#i', '', $node->modifiers); return $writer->using($node) ->write('echo %escape(%modify(' . ($node->name === 'plink' ? '$this->global->uiPresenter' : '$this->global->uiControl') . '->link(%node.word, %node.array?)))' ); } /** * {ifCurrent destination [,] [params]} */ public function macroIfCurrent(MacroNode $node, PhpWriter $writer) { if ($node->modifiers) { throw new CompileException('Modifiers are not allowed in ' . $node->getNotation()); } return $writer->write($node->args ? 'if ($this->global->uiPresenter->isLinkCurrent(%node.word, %node.array?)) {' : 'if ($this->global->uiPresenter->getLastCreatedRequestFlag("current")) {' ); } /** * {extends auto} */ public function macroExtends(MacroNode $node, PhpWriter $writer) { if ($node->modifiers || $node->parentNode || $node->args !== 'auto') { return $this->extends = false; } $this->extends = $writer->write('$this->parentName = $this->global->uiPresenter->findLayoutTemplateFile();'); } /** @deprecated */ public static function renderSnippets(Nette\Application\UI\Control $control, \stdClass $local, array $params) { trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED); UIRuntime::renderSnippets($control, $local, $params); } }
mit
ringcentral/ringcentral-js-client
src/paths/Dictionary.ts
1573
// This is Generated Source. import PathSegment from "../PathSegment"; import FaxCoverPage from "./FaxCoverPage"; import Greeting from "./Greeting"; import Language from "./Language"; import Country from "./Country"; import Location from "./Location"; import State from "./State"; import Timezone from "./Timezone"; import Device from "./Device"; import LicenseTypes from "./LicenseTypes"; export default class Dictionary extends PathSegment { constructor(prv: PathSegment, id?: string, service?) { super("dictionary", id, prv, service); } /** * */ faxCoverPage(id?: string) { return new FaxCoverPage(this, id); } /** * */ greeting(id?: string) { return new Greeting(this, id); } /** * Internal identifier of a language */ language(id?: string) { return new Language(this, id); } /** * Internal identifier of a country */ country(id?: string) { return new Country(this, id); } /** * */ location(id?: string) { return new Location(this, id); } /** * Internal identifier of a state */ state(id?: string) { return new State(this, id); } /** * Internal identifier of a timezone */ timezone(id?: string) { return new Timezone(this, id); } /** * */ device(id?: string) { return new Device(this, id); } /** * */ licenseTypes(id?: string) { return new LicenseTypes(this, id); } }
mit
namjoker/flarumfull
vendor/flarum/flarum-ext-akismet/js/admin/dist/extension.js
2370
'use strict'; System.register('flarum/akismet/components/AkismetSettingsModal', ['flarum/components/SettingsModal'], function (_export, _context) { var SettingsModal, AkismetSettingsModal; return { setters: [function (_flarumComponentsSettingsModal) { SettingsModal = _flarumComponentsSettingsModal.default; }], execute: function () { AkismetSettingsModal = function (_SettingsModal) { babelHelpers.inherits(AkismetSettingsModal, _SettingsModal); function AkismetSettingsModal() { babelHelpers.classCallCheck(this, AkismetSettingsModal); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(AkismetSettingsModal).apply(this, arguments)); } babelHelpers.createClass(AkismetSettingsModal, [{ key: 'className', value: function className() { return 'AkismetSettingsModal Modal--small'; } }, { key: 'title', value: function title() { return app.translator.trans('flarum-akismet.admin.akismet_settings.title'); } }, { key: 'form', value: function form() { return [m( 'div', { className: 'Form-group' }, m( 'label', null, app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label') ), m('input', { className: 'FormControl', bidi: this.setting('flarum-akismet.api_key') }) )]; } }]); return AkismetSettingsModal; }(SettingsModal); _export('default', AkismetSettingsModal); } }; });; 'use strict'; System.register('flarum/akismet/main', ['flarum/app', 'flarum/akismet/components/AkismetSettingsModal'], function (_export, _context) { var app, AkismetSettingsModal; return { setters: [function (_flarumApp) { app = _flarumApp.default; }, function (_flarumAkismetComponentsAkismetSettingsModal) { AkismetSettingsModal = _flarumAkismetComponentsAkismetSettingsModal.default; }], execute: function () { app.initializers.add('flarum-akismet', function () { app.extensionSettings['flarum-akismet'] = function () { return app.modal.show(new AkismetSettingsModal()); }; }); } }; });
mit
gaborkolozsy/XChange
xchange-luno/src/main/java/org/knowm/xchange/luno/dto/trade/LunoOrders.java
3625
package org.knowm.xchange.luno.dto.trade; import java.math.BigDecimal; import java.util.Arrays; import java.util.Date; import com.fasterxml.jackson.annotation.JsonProperty; public class LunoOrders { private final Order[] orders; public LunoOrders(@JsonProperty(value = "orders", required = true) Order[] orders) { this.orders = orders != null ? orders : new Order[0]; } public Order[] getOrders() { Order[] copy = new Order[orders.length]; System.arraycopy(orders, 0, copy, 0, orders.length); return copy; } @Override public String toString() { return "LunoOrders [orders(" + orders.length + ")=" + Arrays.toString(orders) + "]"; } public static class Order { public final String orderId; public final long creationTimestamp; public final long expirationTimestamp; public final long completedTimestamp; public final OrderType type; public final State state; public final BigDecimal limitPrice; public final BigDecimal limitVolume; public final BigDecimal base; public final BigDecimal counter; public final BigDecimal feeBase; public final BigDecimal feeCounter; public final String pair; public Order( @JsonProperty(value = "order_id", required = true) String orderId , @JsonProperty(value = "creation_timestamp", required = true) long creationTimestamp , @JsonProperty(value = "expiration_timestamp", required = true) long expirationTimestamp , @JsonProperty(value = "completed_timestamp", required = true) long completedTimestamp , @JsonProperty(value = "type", required = false) OrderType type , @JsonProperty(value = "state", required = false) State state , @JsonProperty(value = "limit_price", required = true) BigDecimal limitPrice , @JsonProperty(value = "limit_volume", required = true) BigDecimal limitVolume , @JsonProperty(value = "base", required = true) BigDecimal base , @JsonProperty(value = "counter", required = true) BigDecimal counter , @JsonProperty(value = "fee_base", required = true) BigDecimal feeBase , @JsonProperty(value = "fee_counter", required = true) BigDecimal feeCounter , @JsonProperty(value = "pair", required = false) String pair ) { this.orderId = orderId; this.creationTimestamp = creationTimestamp; this.expirationTimestamp = expirationTimestamp; this.completedTimestamp = completedTimestamp; this.type = type; this.state = state; this.limitPrice = limitPrice; this.limitVolume = limitVolume; this.base = base; this.counter = counter; this.feeBase = feeBase; this.feeCounter = feeCounter; this.pair = pair; } public Date getCreationTimestamp() { return new Date(creationTimestamp); } public Date getExpirationTimestamp() { return expirationTimestamp == 0 ? null : new Date(expirationTimestamp); } public Date getCompletedTimestamp() { return completedTimestamp == 0 ? null : new Date(completedTimestamp); } @Override public String toString() { return "Order [orderId=" + orderId + ", type=" + type + ", state=" + state + ", limitPrice=" + limitPrice + ", limitVolume=" + limitVolume + ", base=" + base + ", counter=" + counter + ", feeBase=" + feeBase + ", feeCounter=" + feeCounter + ", pair=" + pair + ", getCreationTimestamp()=" + getCreationTimestamp() + ", getExpirationTimestamp()=" + getExpirationTimestamp() + ", getCompletedTimestamp()=" + getCompletedTimestamp() + "]"; } } }
mit
dpep/theusualrb
test/test_numeric.rb
527
require 'minitest/autorun' require 'theusual' TheUsual::load :numeric class NumericTest < Minitest::Test def test_delimiter # Integers assert_equal( '1,000', 1_000.with_delimiter ) assert_equal( '1,000,000', 1_000_000.with_delimiter ) assert_equal( '1_000', 1_000.with_delimiter('_') ) # Floats assert_equal( '1,000.0', 1_000.0.with_delimiter ) assert_equal( '1,000.123', 1_000.123.with_delimiter ) end end
mit
peppy/osu
osu.Game.Tournament/TournamentSceneManager.cs
9933
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Threading; using osu.Game.Graphics; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Editors; using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.MapPool; using osu.Game.Tournament.Screens.Schedule; using osu.Game.Tournament.Screens.Setup; using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; using osu.Game.Tournament.Screens.TeamWin; using osuTK; using osuTK.Graphics; namespace osu.Game.Tournament { [Cached] public class TournamentSceneManager : CompositeDrawable { private Container screens; private TourneyVideo video; public const float CONTROL_AREA_WIDTH = 160; public const float STREAM_AREA_WIDTH = 1366; public const double REQUIRED_WIDTH = CONTROL_AREA_WIDTH * 2 + STREAM_AREA_WIDTH; [Cached] private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay(); private Container chatContainer; private FillFlowContainer buttons; public TournamentSceneManager() { RelativeSizeAxes = Axes.Both; } [BackgroundDependencyLoader] private void load() { InternalChildren = new Drawable[] { new Container { RelativeSizeAxes = Axes.Y, X = CONTROL_AREA_WIDTH, FillMode = FillMode.Fit, FillAspectRatio = 16 / 9f, Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Width = STREAM_AREA_WIDTH, //Masking = true, Children = new Drawable[] { video = new TourneyVideo("main", true) { Loop = true, RelativeSizeAxes = Axes.Both, }, screens = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new SetupScreen(), new ScheduleScreen(), new LadderScreen(), new LadderEditorScreen(), new TeamEditorScreen(), new RoundEditorScreen(), new ShowcaseScreen(), new MapPoolScreen(), new TeamIntroScreen(), new SeedingScreen(), new DrawingsScreen(), new GameplayScreen(), new TeamWinScreen() } }, chatContainer = new Container { RelativeSizeAxes = Axes.Both, Child = chat }, } }, new Container { RelativeSizeAxes = Axes.Y, Width = CONTROL_AREA_WIDTH, Children = new Drawable[] { new Box { Colour = Color4.Black, RelativeSizeAxes = Axes.Both, }, buttons = new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Spacing = new Vector2(5), Padding = new MarginPadding(5), Children = new Drawable[] { new ScreenButton(typeof(SetupScreen)) { Text = "Setup", RequestSelection = SetScreen }, new Separator(), new ScreenButton(typeof(TeamEditorScreen)) { Text = "Team Editor", RequestSelection = SetScreen }, new ScreenButton(typeof(RoundEditorScreen)) { Text = "Rounds Editor", RequestSelection = SetScreen }, new ScreenButton(typeof(LadderEditorScreen)) { Text = "Bracket Editor", RequestSelection = SetScreen }, new Separator(), new ScreenButton(typeof(ScheduleScreen)) { Text = "Schedule", RequestSelection = SetScreen }, new ScreenButton(typeof(LadderScreen)) { Text = "Bracket", RequestSelection = SetScreen }, new Separator(), new ScreenButton(typeof(TeamIntroScreen)) { Text = "Team Intro", RequestSelection = SetScreen }, new ScreenButton(typeof(SeedingScreen)) { Text = "Seeding", RequestSelection = SetScreen }, new Separator(), new ScreenButton(typeof(MapPoolScreen)) { Text = "Map Pool", RequestSelection = SetScreen }, new ScreenButton(typeof(GameplayScreen)) { Text = "Gameplay", RequestSelection = SetScreen }, new Separator(), new ScreenButton(typeof(TeamWinScreen)) { Text = "Win", RequestSelection = SetScreen }, new Separator(), new ScreenButton(typeof(DrawingsScreen)) { Text = "Drawings", RequestSelection = SetScreen }, new ScreenButton(typeof(ShowcaseScreen)) { Text = "Showcase", RequestSelection = SetScreen }, } }, }, }, }; foreach (var drawable in screens) drawable.Hide(); SetScreen(typeof(SetupScreen)); } private float depth; private Drawable currentScreen; private ScheduledDelegate scheduledHide; private Drawable temporaryScreen; public void SetScreen(Drawable screen) { currentScreen?.Hide(); currentScreen = null; screens.Add(temporaryScreen = screen); } public void SetScreen(Type screenType) { temporaryScreen?.Expire(); var target = screens.FirstOrDefault(s => s.GetType() == screenType); if (target == null || currentScreen == target) return; if (scheduledHide?.Completed == false) { scheduledHide.RunTask(); scheduledHide.Cancel(); // see https://github.com/ppy/osu-framework/issues/2967 scheduledHide = null; } var lastScreen = currentScreen; currentScreen = target; if (currentScreen is IProvideVideo) { video.FadeOut(200); // delay the hide to avoid a double-fade transition. scheduledHide = Scheduler.AddDelayed(() => lastScreen?.Hide(), TournamentScreen.FADE_DELAY); } else { lastScreen?.Hide(); video.Show(); } screens.ChangeChildDepth(currentScreen, depth--); currentScreen.Show(); switch (currentScreen) { case MapPoolScreen _: chatContainer.FadeIn(TournamentScreen.FADE_DELAY); chatContainer.ResizeWidthTo(1, 500, Easing.OutQuint); break; case GameplayScreen _: chatContainer.FadeIn(TournamentScreen.FADE_DELAY); chatContainer.ResizeWidthTo(0.5f, 500, Easing.OutQuint); break; default: chatContainer.FadeOut(TournamentScreen.FADE_DELAY); break; } foreach (var s in buttons.OfType<ScreenButton>()) s.IsSelected = screenType == s.Type; } private class Separator : CompositeDrawable { public Separator() { RelativeSizeAxes = Axes.X; Height = 20; } } private class ScreenButton : TourneyButton { public readonly Type Type; public ScreenButton(Type type) { Type = type; BackgroundColour = OsuColour.Gray(0.2f); Action = () => RequestSelection?.Invoke(type); RelativeSizeAxes = Axes.X; } private bool isSelected; public Action<Type> RequestSelection; public bool IsSelected { get => isSelected; set { if (value == isSelected) return; isSelected = value; BackgroundColour = isSelected ? Color4.SkyBlue : OsuColour.Gray(0.2f); SpriteText.Colour = isSelected ? Color4.Black : Color4.White; } } } } }
mit
gabeg805/Extensible-Login-Manager
src/elmloginmanager.c
14442
/* ***************************************************************************** * * Name: elmloginmanager.c * Author: Gabriel Gonzalez * Email: [email protected] * License: The MIT License (MIT) * * Description: Control setting up, building, and displaying the ELM. * * Notes: None. * * ***************************************************************************** */ /* Includes */ #include "elmloginmanager.h" #include "elmdef.h" #include "elmgtk.h" #include "elminterface.h" #include "elmio.h" #include "elmsession.h" #include "elmx.h" #include <pthread.h> #include <signal.h> #include <stdlib.h> #include <gtk/gtk.h> /* Not sure I need these */ #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> /* Private functions */ static int elm_login_manager_run(void); static int elm_login_manager_login_prompt(void); static void * elm_login_manager_login_session(void *data); static int elm_login_manager_preview_login(void); static int elm_login_manager_build_window(void); static int elm_login_manager_build_apps(void); static int elm_login_manager_setup_dir(void); static int elm_login_manager_setup_xserver(void); static int elm_login_manager_setup_signal_catcher(void); static void elm_login_manager_signal_catcher(int sig, siginfo_t *info, void *context); static int elm_login_manager_show_apps(void); static int elm_login_manager_hide_apps(void); static void elm_login_manager_set_preview_mode(int flag); static void elm_login_manager_thread(GtkWidget *widget, gpointer data); static int elm_login_manager_alloc(void); static int elm_login_manager_alloc_apps(size_t s); static int elm_login_manager_exists(char *message); /* Private globals */ static int Preview = 0; static ElmLoginManager *Manager = NULL; static GtkWidget *Window = NULL; static GtkWidget *Container = NULL; static GtkWidget **Widgets = NULL; static pthread_t Thread; /* ************************************************************************** */ /* Create Extensible Login Manager base structure */ ElmLoginManager * elm_login_manager_new(void) { elmprintf(LOGINFO, "Preparing new Login Manager object."); if (elm_login_manager_alloc() < 0) { exit(ELM_EXIT_MNGR_NEW); } if (elm_login_manager_alloc_apps(1) < 0) { exit(ELM_EXIT_MNGR_APP); } /* Define methods */ Manager->run = &elm_login_manager_run; Manager->login_prompt = &elm_login_manager_login_prompt; Manager->login_session = &elm_login_manager_login_session; Manager->build_window = &elm_login_manager_build_window; Manager->build_apps = &elm_login_manager_build_apps; Manager->setup_dir = &elm_login_manager_setup_dir; Manager->setup_xserver = &elm_login_manager_setup_xserver; Manager->setup_signal_catcher = &elm_login_manager_setup_signal_catcher; Manager->show_apps = &elm_login_manager_show_apps; Manager->hide_apps = &elm_login_manager_hide_apps; Manager->set_preview_mode = &elm_login_manager_set_preview_mode; return Manager; } /* ************************************************************************** */ /* Run login manager */ int elm_login_manager_run(void) { elmprintf(LOGINFO, "Preparing to run the Extensible Login Manager (ELM)."); if (!elm_login_manager_exists("run the Extensible Login Manager")) { return ELM_EXIT_MNGR_RUN; } /* Setup */ if (Manager->setup_dir() < 0) { return ELM_EXIT_MNGR_DIR; } if (Manager->setup_signal_catcher() < 0) { return ELM_EXIT_MNGR_SIG_SETUP; } if (Manager->setup_xserver() < 0) { return ELM_EXIT_MNGR_X; } /* Prompt for username/password */ while (1) { if (Manager->login_prompt() < 0) return ELM_EXIT_MNGR_PROMPT; } return 0; } /* ************************************************************************** */ /* Display GUI login manager prompt */ int elm_login_manager_login_prompt(void) { elmprintf(LOGINFO, "Preparing to display login prompt."); if (!elm_login_manager_exists("display login prompt")) { return -1; } elmprintf(LOGINFO, "Displaying login prompt."); gtk_init(0, 0); if (Manager->build_window() < 0) { exit(ELM_EXIT_MNGR_BUILD_WIN); } if (Manager->build_apps() < 0) { exit(ELM_EXIT_MNGR_BUILD_APP); } gtk_main(); return 0; } /* ************************************************************************** */ /* Run login session */ void * elm_login_manager_login_session(void *data) { elmprintf(LOGINFO, "Preparing to run user session."); if (!elm_login_manager_exists("run user session")) { return NULL; } ElmSessionInfo *info = data; ElmSession *session = elm_session_new(info); if (!session) { exit(ELM_EXIT_SESS_NEW); } if (session->auth() < 0) { /* This does not work, causes SIGSEGV for some reason */ /* Manager->hide_apps(); */ /* sleep(2); */ /* Manager->show_apps(); */ return NULL; } if (elm_login_manager_preview_login()) { exit(ELM_EXIT_MNGR_PREVIEW); } Manager->hide_apps(); if (session->login() < 0) { Manager->show_apps(); return NULL; } if (session->logout() < 0) { } Manager->show_apps(); return NULL; } /* ************************************************************************** */ /* Check if login in Preview mode is underway. Exit if it is: login was * successful. */ int elm_login_manager_preview_login(void) { if (Preview) { elmprintf(LOGINFO, "Login successful in Preview Mode."); return 1; } return 0; } /* ************************************************************************** */ /* Build login manager applications */ int elm_login_manager_build_window(void) { elmprintf(LOGINFO, "Building login manager window."); int width; int height; Window = gtk_window_new(GTK_WINDOW_TOPLEVEL); Container = gtk_fixed_new(); elm_x_screen_dimensions(&width, &height); elm_gtk_set_window_size(&Window, width, height); elm_gtk_add_css_from_conf(&Window, "Manager", "Images", "Background"); elm_gtk_add_widget(&Window, Container); gtk_widget_show(Container); gtk_widget_show_all(Window); return 0; } /* ************************************************************************** */ /* Build login manager applications */ int elm_login_manager_build_apps(void) { elmprintf(LOGINFO, "Building login manager apps."); ElmApp *apps; ElmGravity gravity; int width; int height; int x; int y; size_t i; elm_x_screen_dimensions(&width, &height); /* Iterate over each app, display it, and add it to login manager window */ for (apps=login_interface(), i=0; apps[i].display; i++) { elmprintf(LOGINFO, "Adding app '%d' to login manager.", i); /* Allocate application */ if (elm_login_manager_alloc_apps(i+1) < 0) { exit(ELM_EXIT_MNGR_APP); } /* Append widget to list */ Widgets[i] = apps[i].display(elm_login_manager_thread); /* Add widget to container */ gravity = apps[i].gravity; x = apps[i].x; y = apps[i].y; switch (gravity) { case ELM_GRAV_TOP_LEFT: break; case ELM_GRAV_TOP_RIGHT: x = width - x; break; case ELM_GRAV_CENTER: x = width/2 + x; y = height/2 + y; break; case ELM_GRAV_BOTTOM_LEFT: y = height - y; break; case ELM_GRAV_BOTTOM_RIGHT: x = width - x; y = height - y; break; default: break; } gtk_fixed_put(GTK_FIXED(Container), Widgets[i], x, y); } return 0; } /* ************************************************************************** */ /* Setup run directory */ int elm_login_manager_setup_dir(void) { if (access(ELM_RUN_DIR, F_OK)) { elmprintf(LOGWARNO, "%s '%s'", "Unable to find directory", ELM_RUN_DIR); elmprintf(LOGINFO, "%s '%s'.", "Creating directory", ELM_RUN_DIR); if (mkdir(ELM_RUN_DIR, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0) { elmprintf(LOGERRNO, "%s '%s'", "Unable to create directory", ELM_RUN_DIR); return -1; } } return 0; } /* ************************************************************************** */ /* Setup X server */ int elm_login_manager_setup_xserver(void) { elmprintf(LOGINFO, "Setting up X server."); if (!elm_login_manager_exists("setup X server")) { return 1; } if (elm_x_start() < 0) { return -1; } if (elm_x_set_transparency(1) < 0) { return 2; } if (elm_x_set_cursor() < 0) { return -3; } return 0; } /* ************************************************************************** */ /* Setup signal catcher */ int elm_login_manager_setup_signal_catcher(void) { elmprintf(LOGINFO, "Setting up signal catcher."); if (!elm_login_manager_exists("setup signal catcher")) { return -1; } struct sigaction act; struct sigaction ign; act.sa_flags = SA_SIGINFO; act.sa_sigaction = &elm_login_manager_signal_catcher; ign.sa_flags = SA_SIGINFO; ign.sa_handler = SIG_IGN; sigaction(SIGQUIT, &act, NULL); /* sigaction(SIGTERM, &act, NULL); */ sigaction(SIGKILL, &act, NULL); sigaction(SIGINT, &act, NULL); sigaction(SIGHUP, &act, NULL); sigaction(SIGPIPE, &act, NULL); sigaction(SIGTTIN, &ign, NULL); sigaction(SIGTTOU, &ign, NULL); sigaction(SIGUSR1, &ign, NULL); return 0; } /* ************************************************************************** */ /* Catch signals */ /* To-do: Clean this up. */ void elm_login_manager_signal_catcher(int sig, siginfo_t *info, void *context) { if (!elm_login_manager_exists("catch signals")) { exit(ELM_EXIT_MNGR_SIG); } elmprintf(LOGWARN, "Unexpected signal: %d.", sig); elmprintf(LOGWARN, "signo: %d.", info->si_signo); elmprintf(LOGWARN, "code: %d.", info->si_code); elmprintf(LOGWARN, "errno: %d.", info->si_errno); elmprintf(LOGWARN, "pid: %ld.", info->si_pid); elmprintf(LOGWARN, "uid: %ld.", info->si_uid); elmprintf(LOGWARN, "status: %d.", info->si_status); /* /\* Might not need this *\/ */ /* int signo = info->si_signo; */ /* pid_t pid = info->si_pid; */ /* if ((signo == SIGTERM) && (pid == 1)) { */ /* elmprintf(LOGWARN, "Ignoring signal '%d' from PID '%lu'.", signo, pid); */ /* struct sigaction act; */ /* act.sa_flags = SA_SIGINFO; */ /* act.sa_sigaction = &elm_login_manager_signal_catcher; */ /* sigaction(signo, &act, NULL); */ /* return; */ /* } */ exit(ELM_EXIT_MNGR_SIG); } /* ************************************************************************** */ /* Show widgets */ /* To-do: Allocate memory for apps */ int elm_login_manager_show_apps(void) { elmprintf(LOGINFO, "Showing login manager."); size_t i; for (i=0; Widgets[i]; i++) { elmprintf(LOGINFO, "Showing widget %d: %p.", i, Widgets[i]); gtk_widget_show(Widgets[i]); } elmprintf(LOGINFO, "Showing Container: %p.", Container); gtk_widget_show(Container); elmprintf(LOGINFO, "Showing Window: %p.", Window); gtk_widget_show(Window); return 0; } /* ************************************************************************** */ /* Hide widgets */ int elm_login_manager_hide_apps(void) { elmprintf(LOGINFO, "Hiding login manager."); size_t i; for (i=0; Widgets[i]; i++) { elmprintf(LOGINFO, "Hiding widget %d: %p.", i, Widgets[i]); gtk_widget_hide(Widgets[i]); } elmprintf(LOGINFO, "Hiding Container: %p.", Container); gtk_widget_hide(Container); elmprintf(LOGINFO, "Hiding Window: %p.", Window); gtk_widget_hide(Window); return 0; } /* ************************************************************************** */ /* Set preview mode flag */ void elm_login_manager_set_preview_mode(int flag) { Preview = flag; } /* ************************************************************************** */ /* Thread login manger between GTK and user session */ /* To-do: Allocate memory for thread? */ void elm_login_manager_thread(GtkWidget *widget, gpointer data) { elmprintf(LOGINFO, "Creating login thread."); int status; if (!elm_login_manager_exists("create login thread")) { exit(ELM_EXIT_MNGR_PTHREAD); } if ((status=pthread_create(&Thread, 0, Manager->login_session, data))) { elmprintf(LOGERR, "Error creating thread."); exit(ELM_EXIT_MNGR_PTHREAD); } } /* ************************************************************************** */ /* Allocate login manager object */ int elm_login_manager_alloc(void) { elmprintf(LOGINFO, "Allocating Login Manager object."); Manager = calloc(1, sizeof(*Manager)); if (!Manager) { elmprintf(LOGERRNO, "Unable to initialize login manager"); return -1; } return 0; } /* ************************************************************************** */ /* Allocate application container */ int elm_login_manager_alloc_apps(size_t s) { elmprintf(LOGINFO, "Allocating Login Manager applications."); size_t size = s+1; Widgets = realloc(Widgets, size * sizeof(*Widgets)); if (!Widgets) { elmprintf(LOGERR, "%s '%lu'", "Unable to allocate widget list with size", size); return -1; } Widgets[size-1] = NULL; return 0; } /* ************************************************************************** */ /* Check if login manager object exists. Print message if it does not. */ int elm_login_manager_exists(char *message) { if (!Manager) { elmprintf(LOGERR, "%s %s: %s.", "Unable to", message, "Login Manager object does not exist"); return 0; } return 1; }
mit
brentstineman/PersonalStuff
Presentations/Service Fabric/RealWorldDemo/WebFrontEnd/Program.cs
1348
using Microsoft.ServiceFabric.Services.Runtime; using System; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace WebFrontEnd { internal static class Program { /// <summary> /// This is the entry point of the service host process. /// </summary> private static void Main() { try { // The ServiceManifest.XML file defines one or more service type names. // Registering a service maps a service type name to a .NET type. // When Service Fabric creates an instance of this service type, // an instance of the class is created in this host process. ServiceRuntime.RegisterServiceAsync("WebFrontEndType", context => new WebFrontEnd(context)).GetAwaiter().GetResult(); ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(WebFrontEnd).Name); // Prevents this host process from terminating so services keeps running. Thread.Sleep(Timeout.Infinite); } catch (Exception e) { ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString()); throw; } } } }
mit
OlivierCoue/invow
server/helpers/item-content/createItemTweet.js
1490
module.exports = function createItemTweet (url, user, callback) { var fs = require("fs"); var https = require('https'); var models = require('../../models'); var itemTypes = require('../../models/item/itemTypes.json'); var tweetUrl = url; var options = { host: 'publish.twitter.com', path: '/oembed?format=json&url='+ encodeURI(tweetUrl) }; var twCallback = function(response) { var str = ''; response.on('data', function (chunk) { str += chunk; }); response.on('end', function () { var response = JSON.parse(str); var itemTweet = new models.ItemTweet(); itemTweet.url = response.url; itemTweet.html = response.html; itemTweet.author_name = response.author_name; itemTweet.author_url = response.author_url; itemTweet.width = response.width; itemTweet.height = response.height; itemTweet.type = response.type; itemTweet.provider_name = response.provider_name; itemTweet.version = response.version; itemTweet._user = user._id; itemTweet.save(function(err){ if(err)callback(err) callback(null, itemTypes.TWEET, itemTweet) }) }); response.on('error', function () { callback(JSON.parse(str)); }); }; https.request(options, twCallback).end(); }
mit