answer
stringlengths
15
1.25M
using System; using static LanguageExt.Prelude; namespace LanguageExt.UnitsOfMeasure { <summary> Numeric VelocitySquared value Handles unit conversions automatically </summary> public struct VelocitySq : IComparable<VelocitySq>, IEquatable<VelocitySq> { readonly double Value; internal VelocitySq(double length) { Value = length; } public override string ToString() => Value + " m/s²"; public bool Equals(VelocitySq other) => Value.Equals(other.Value); public bool Equals(VelocitySq other, double epsilon) => Math.Abs(other.Value - Value) < epsilon; public override bool Equals(object obj) => obj == null ? false : obj is Length ? Equals((Length)obj) : false; public override int GetHashCode() => Value.GetHashCode(); public int CompareTo(VelocitySq other) => Value.CompareTo(other.Value); public VelocitySq Append(VelocitySq rhs) => new VelocitySq(Value + rhs.Value); public VelocitySq Subtract(VelocitySq rhs) => new VelocitySq(Value - rhs.Value); public VelocitySq Multiply(double rhs) => new VelocitySq(Value * rhs); public VelocitySq Divide(double rhs) => new VelocitySq(Value / rhs); public static VelocitySq operator *(VelocitySq lhs, double rhs) => lhs.Multiply(rhs); public static VelocitySq operator *(double lhs, VelocitySq rhs) => rhs.Multiply(lhs); public static VelocitySq operator +(VelocitySq lhs, VelocitySq rhs) => lhs.Append(rhs); public static VelocitySq operator -(VelocitySq lhs, VelocitySq rhs) => lhs.Subtract(rhs); public static VelocitySq operator /(VelocitySq lhs, double rhs) => lhs.Divide(rhs); public static double operator /(VelocitySq lhs, VelocitySq rhs) => lhs.Value / rhs.Value; public static bool operator ==(VelocitySq lhs, VelocitySq rhs) => lhs.Equals(rhs); public static bool operator !=(VelocitySq lhs, VelocitySq rhs) => !lhs.Equals(rhs); public static bool operator >(VelocitySq lhs, VelocitySq rhs) => lhs.Value > rhs.Value; public static bool operator <(VelocitySq lhs, VelocitySq rhs) => lhs.Value < rhs.Value; public static bool operator >=(VelocitySq lhs, VelocitySq rhs) => lhs.Value >= rhs.Value; public static bool operator <=(VelocitySq lhs, VelocitySq rhs) => lhs.Value <= rhs.Value; public Velocity Sqrt() => new Velocity(Math.Sqrt(Value)); public VelocitySq Round() => new VelocitySq(Math.Round(Value)); public VelocitySq Abs() => new VelocitySq(Math.Abs(Value)); public VelocitySq Min(VelocitySq rhs) => new VelocitySq(Math.Min(Value, rhs.Value)); public VelocitySq Max(VelocitySq rhs) => new VelocitySq(Math.Max(Value, rhs.Value)); public double MetresPerSecond2 => Value; } }
// Lexer.cpp // lut-lang #include "Lexer.h" #include <string> #include <regex> #include <iostream> #include "TokenType.h" #include "ErrorHandler.h" using std::cout; using std::endl; using std::smatch; using std::string; using std::regex_search; using std ::smatch; // Regexs const char keyword_str[] = "^(const |var |ecrire |lire )"; const char identifier_str[] = "^([a-zA-Z][a-zA-Z0-9]*)"; const char number_str[] = "^([0-9]*\\.?[0-9]+)"; const char <API key>[] = "^(\\+|-|\\*|\\/|\\(|\\)|;|=|,)"; const char affectation_str[] = "^(:=)"; const std::regex keyword(keyword_str); const std::regex identifier(identifier_str); const std::regex number(number_str); const std::regex single_operators(<API key>); const std::regex affectation(affectation_str); int Lexer::find_first_not_of(string str) { string::iterator it; int index = 0; for (it = str.begin(); it < str.end(); it++, index++) { switch ( str.at(index) ) { case ' ': this->column++; break; case '\t': break; case '\n': this->line++; this->column = 0; break; case '\r': break; case '\f': break; case '\v': default: return index; break; } } return -1; } string& Lexer::ltrim(string& s) { s.erase(0, find_first_not_of(s)); return s; } Lexer::Lexer(string inString) : inputString(inString) { this->currentToken = new ASTTokenNode(TokenType::INVALID_SYMBOL); this->line = 0; this->column = 0; this-><API key> = 0; } bool Lexer::has_next() { // remove spaces before analyzing // we remove left spaces and not right to handle cases like "const " ltrim(inputString); if ( inputString.length() <= 0 ) { currentToken = new ASTTokenNode(TokenType::ENDOFFILE); return false; } return true; } ASTTokenNode* Lexer::top() { return currentToken; } void Lexer::shift() { if ( !has_next() ) return; this->column += this-><API key>; std::smatch m; if ( !analyze(inputString, m) ) { ErrorHandler::getInstance().LexicalError(this->getLine(), this->getColumn(), inputString.at(0)); ErrorHandler::getInstance().outputErrors(); currentToken = new ASTTokenNode(TokenType::INVALID_SYMBOL); inputString.erase(0, 1); // not sure return; } this-><API key> = (int)m.length(); inputString = m.suffix().str(); } bool Lexer::analyze(string s, smatch &m) { if ( std::regex_search(inputString, m, keyword) ) { std::string currentTokenValue = m.str(); switch (currentTokenValue[0]) { case 'c': currentToken = new ASTTokenNode(TokenType::CONST); break; case 'v': currentToken = new ASTTokenNode(TokenType::VAR); break; case 'e': currentToken = new ASTTokenNode(TokenType::WRITE); break; case 'l': currentToken = new ASTTokenNode(TokenType::READ); break; default: #warning "symbole non reconnu" return false; } } else if ( std::regex_search(inputString, m, identifier) ) { std::string currentTokenValue = m.str(); currentToken = new ASTTokenNode(TokenType::ID, currentTokenValue); } else if ( std::regex_search(inputString, m, number) ) { std::string currentTokenValue = m.str(); currentToken = new ASTTokenNode(TokenType::VAL, currentTokenValue); } else if ( std::regex_search(inputString, m, single_operators) ) { std::string currentTokenValue = m.str(); switch (currentTokenValue[0]) { case '+': currentToken = new ASTTokenNode(TokenType::ADD, "+"); break; case '-': currentToken = new ASTTokenNode(TokenType::SUB, "-"); break; case '*': currentToken = new ASTTokenNode(TokenType::MUL, "*"); break; case '/': currentToken = new ASTTokenNode(TokenType::DIV, "/"); break; case '(': currentToken = new ASTTokenNode(TokenType::PO); break; case ')': currentToken = new ASTTokenNode(TokenType::PF); break; case ';': currentToken = new ASTTokenNode(TokenType::PV); break; case '=': currentToken = new ASTTokenNode(TokenType::EQ); break; case ',': currentToken = new ASTTokenNode(TokenType::V); break; default: #warning "symbole non reconnu" return false; } } else if ( std::regex_search(inputString, m, affectation) ) { currentToken = new ASTTokenNode(TokenType::AFF); } else { #warning "symbole non reconnu" return false; } return true; } int Lexer::getLine() { return this->line+1; } int Lexer::getColumn() { return this->column+1; }
<?php namespace Redsys\Tests\Api; use Redsys\Api\Titular; class TitularTest extends \<API key> { public function <API key>() { $titular = new Titular("Lorem ipsum"); $this->assertEquals("Lorem ipsum", $titular->getValue()); } public function <API key>() { $titular = new Titular("Lorem ipsum"); $this->assertEquals("Lorem ipsum", (string)$titular); } /** * @expectedException \LengthException */ public function <API key>() { new Titular(str_repeat("abcdefghij", 6) . "z"); } }
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("KnowledgeCenter.Domain")] [assembly: AssemblyDescription("")] [assembly: Guid("<API key>")]
<!DOCTYPE html> <html xmlns:msxsl="urn:<API key>:xslt"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-16" http-equiv="Content-Type" /> <title _locid="<API key>">.NET Portability Report</title> <style> /* Body style, for the entire document */ body { background: #F3F3F4; color: #1E1E1F; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; padding: 0; margin: 0; } /* Header1 style, used for the main title */ h1 { padding: 10px 0px 10px 10px; font-size: 21pt; background-color: #E2E2E2; border-bottom: 1px #C1C1C2 solid; color: #201F20; margin: 0; font-weight: normal; } /* Header2 style, used for "Overview" and other sections */ h2 { font-size: 18pt; font-weight: normal; padding: 15px 0 5px 0; margin: 0; } /* Header3 style, used for sub-sections, such as project name */ h3 { font-weight: normal; font-size: 15pt; margin: 0; padding: 15px 0 5px 0; background-color: transparent; } h4 { font-weight: normal; font-size: 12pt; margin: 0; padding: 0 0 0 0; background-color: transparent; } /* Color all hyperlinks one color */ a { color: #1382CE; } /* Paragraph text (for longer informational messages) */ p { font-size: 10pt; } /* Table styles */ table { border-spacing: 0 0; border-collapse: collapse; font-size: 10pt; } table th { background: #E7E7E8; text-align: left; text-decoration: none; font-weight: normal; padding: 3px 6px 3px 6px; } table td { vertical-align: top; padding: 3px 6px 5px 5px; margin: 0px; border: 1px solid #E7E7E8; background: #F7F7F8; } .NoBreakingChanges { color: darkgreen; font-weight:bold; } .FewBreakingChanges { color: orange; font-weight:bold; } .ManyBreakingChanges { color: red; font-weight:bold; } .BreakDetails { margin-left: 30px; } .CompatMessage { font-style: italic; font-size: 10pt; } .GoodMessage { color: darkgreen; } /* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */ .localLink { color: #1E1E1F; background: #EEEEED; text-decoration: none; } .localLink:hover { color: #1382CE; background: #FFFF99; text-decoration: none; } /* Center text, used in the over views cells that contain message level counts */ .textCentered { text-align: center; } /* The message cells in message tables should take up all avaliable space */ .messageCell { width: 100%; } /* Padding around the content after the h1 */ #content { padding: 0px 12px 12px 12px; } /* The overview table expands to width, with a max width of 97% */ #overview table { width: auto; max-width: 75%; } /* The messages tables are always 97% width */ #messages table { width: 97%; } /* All Icons */ .IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded { min-width: 18px; min-height: 18px; background-repeat: no-repeat; background-position: center; } /* Success icon encoded */ .IconSuccessEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+<API key>/H5+sHpZwYfxyRjTs+<API key>/13u3Fjrs/EdhsdDFHGB/<API key>+m3tVe/t97D52CB/ziG0nIgD/<API key>/<API key>/<API key>+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==); } /* Information icon encoded */ .IconInfoEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/<API key>+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/<API key>/HF1RsMXq+<API key>/<API key>+<API key>/<API key>=); } /* Warning icon encoded */ .IconWarningEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/<API key>+wVDSyyzFoJjfz9NB+pAF+<API key>/<API key>/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/<API key>==); } /* Error icon encoded */ .IconErrorEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/<API key>/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+<API key>/<API key>/<API key>=); } </style> </head> <body> <h1 _locid="PortabilityReport">.NET Portability Report</h1> <div id="content"> <div id="submissionId" style="font-size:8pt;"> <p> <i> Submission Id&nbsp; <API key> </i> </p> </div> <h2 _locid="SummaryTitle"> <a name="Portability Summary"></a>Portability Summary </h2> <div id="summary"> <table> <tbody> <tr> <th>Assembly</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> </tr> <tr> <td><strong><a href="#Hazzik.Owin.Security.TradeMe">Hazzik.Owin.Security.TradeMe</a></strong></td> <td class="text-center">98.92 %</td> <td class="text-center">92.99 %</td> <td class="text-center">100.00 %</td> <td class="text-center">92.99 %</td> </tr> </tbody> </table> </div> <div id="details"> <a name="Hazzik.Owin.Security.TradeMe"><h3>Hazzik.Owin.Security.TradeMe</h3></a> <table> <tbody> <tr> <th>Target type</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> <th>Recommended changes</th> </tr> <tr> <td>System.Net.Http.WebRequestHandler</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em"><API key>(System.Net.Security.<API key>)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Net.Security.<API key></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Not supported for HTTP - use new Handler and ignorable server certificate errors instead</td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Object,System.IntPtr)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Not supported for HTTP - use new Handler and ignorable server certificate errors instead</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Net.Security.SslPolicyErrors</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Not supported for HTTP - use new Handler and ignorable server certificate errors instead</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Claims.Claim</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String,System.String,System.String,System.String)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Claims.ClaimsIdentity</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Collections.Generic.IEnumerable{System.Security.Claims.Claim},System.String,System.String,System.String)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String,System.String,System.String)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">AddClaim(System.Security.Claims.Claim)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em"><API key></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Claims</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_NameClaimType</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_RoleClaimType</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.HashAlgorithm</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">ComputeHash(System.Byte[])</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.HMACSHA1</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Currently there is no workaround, but we are working on it. Please check back.</td> </tr> <tr> <td style="padding-left:2em">#ctor</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Currently there is no workaround, but we are working on it. Please check back.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.KeyedHashAlgorithm</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">set_Key(System.Byte[])</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.X509Certificates.X509Certificate</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.X509Certificates.X509Chain</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Text.Encoding</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ASCII</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Type</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().Assembly</td> </tr> <tr> <td style="padding-left:2em">get_Assembly</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().Assembly</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </tbody> </table> <p> <a href="#Portability Summary">Back to Summary</a> </p> </div> </div> </body> </html>
# Update for Chrome 71 Due to abuse of users with the Speech Synthesis API (ADS, Fake system warnings), Google decided to remove the usage of the API in the browser when it's not triggered by an user gesture (click, touch etc.). This means that calling for example <code>artyom.say("Hello")</code> if it's not wrapped inside an user event won't work. So on every page load, the user will need to click at least once time per page to allow the usage of the API in the website, otherwise the following exception will be raised: "[Deprecation] speechSynthesis.speak() without user activation is no longer allowed since M71, around December 2018. See https: For more information, visit the bug or [this entry in the forum](https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/WsnBm53M4Pc). To bypass this error, the user will need to interact manually with the website at least once, for example with a click: html <button id="btn">Allow Voice Synthesis</button> <script src="artyom.window.js"></script> <script> var Jarvis = new Artyom(); // Needed user interaction at least once in the website to make // it work automatically without user interaction later... thanks google .i. document.getElementById("btn").addEventListener("click", function(){ Jarvis.say("Hello World !"); }, false); </script> <p align="center"> <img src="https://raw.githubusercontent.com/sdkcarlos/artyom.js/master/public/images/artyomjs-logo.png" width="256" title="Artyom logo"> </p> # Table of Contents - [About Artyom](#about-artyom) * [Speech Recognition](#speech-recognition) * [Voice Synthesis](#voice-synthesis) - [Installation](#installation) * [NPM](#npm) * [Bower](#bower) - [How to use](#how-to-use) - [Basic usage](#basic-usage) - [All you need to know about Artyom](#<API key>) - [Development](#development) * [Building Artyom from source](#<API key>) * [Testing](#testing) - [Languages](#languages) - [Demonstrations](#demonstrations) - [Thanks](#thanks) # About Artyom Artyom.js is a robust and useful wrapper of the <API key> and speechSynthesis APIs. Besides, artyom allows you to add dynamic commands to your web app (website). Artyom is constantly updated with new gadgets and awesome features, so be sure to star and watch this repository to be aware of any update. The main features of Artyom are: Speech Recognition - Quick recognition of voice commands. - Add commands easily. - Smart commands (usage of wildcards and regular expressions). - Create a dictation object to convert voice to text easily. - Simulate commands without microphone. - Execution keyword to execute a command immediately after the use of the keyword. - Pause and resume command recognition. - Artyom has available the soundex algorithm to increase the accuracy of the recognition of commands (disabled by default). - Use a remote command processor service instead of local processing with Javascript. - Works both in desktop browser and mobile device. Voice Synthesis - Synthesize extreme huge blocks of text (+20K words according to the last test). - onStart and onEnd callbacks **will be always executed independently of the text length**. - Works both in desktop browser and mobile device. Read [the changelog to be informed about changes and additions in Artyom.js](http://docs.ourcodeworld.com/projects/artyom-js/documentation/getting-started/official-changelog) # Installation # NPM batch npm install artyom.js # Bower batch bower install artyom.js Or just download a .zip package with the source code, minified file and commands examples : [download .zip file](https://github.com/sdkcarlos/artyom.js/raw/master/public/artyom-source.zip) # How to use Artyom is totally written in TypeScript, but it's transpiled on every version to JavaScript. 2 files are built namely `artyom.js` (used with Bundlers like Webpack, Browserify etc.) and `artyom.window.js` (only for the web browser). As everyone seems to use a bundler nowadays, for the module loader used is CommonJS: javascript // Using the /build/artyom.js file import Artyom from './artyom.js'; const Jarvis = new Artyom(); Jarvis.say("Hello World !"); Alternatively, if you are of the old school and just want to use it with a script tag, you will need to use the `artyom.window.js` file instead: html <script src="artyom.window.js"></script> <script> var Jarvis = new Artyom(); Jarvis.say("Hello World !"); </script> The source code of artyom handles a single TypeScript file `/source/artyom.ts`. # Basic usage Writing code with artyom is very simple: javascript // With ES6,TypeScript etc import Artyom from './artyom.js'; // Create a variable that stores your instance const artyom = new Artyom(); // Or if you are using it in the browser // var artyom = new Artyom();// or `new window.Artyom()` // Add command (Short code artisan way) artyom.on(['Good morning','Good afternoon']).then((i) => { switch (i) { case 0: artyom.say("Good morning, how are you?"); break; case 1: artyom.say("Good afternoon, how are you?"); break; } }); // Smart command (Short code artisan way), set the second parameter of .on to true artyom.on(['Repeat after me *'] , true).then((i,wildcard) => { artyom.say("You've said : " + wildcard); }); // or add some <API key> in the normal way artyom.addCommands([ { indexes: ['Hello','Hi','is someone there'], action: (i) => { artyom.say("Hello, it's me"); } }, { indexes: ['Repeat after me *'], smart:true, action: (i,wildcard) => { artyom.say("You've said : "+ wildcard); } }, // The smart commands support regular expressions { indexes: [/Good Morning/i], smart:true, action: (i,wildcard) => { artyom.say("You've said : "+ wildcard); } }, { indexes: ['shut down yourself'], action: (i,wildcard) => { artyom.fatality().then(() => { console.log("Artyom succesfully stopped"); }); } }, ]); // Start the commands ! artyom.initialize({ lang: "en-GB", // GreatBritain english continuous: true, // Listen forever soundex: true,// Use the soundex algorithm to increase accuracy debug: true, // Show messages in the console executionKeyword: "and do it now", listen: true, // Start to listen commands ! // If providen, you can only trigger a command if you say its name // e.g to trigger Good Morning, you need to say "Jarvis Good Morning" name: "Jarvis" }).then(() => { console.log("Artyom has been succesfully initialized"); }).catch((err) => { console.error("Artyom couldn't be initialized: ", err); }); /** * To speech text */ artyom.say("Hello, this is a demo text. The next text will be spoken in Spanish",{ onStart: () => { console.log("Reading ..."); }, onEnd: () => { console.log("No more text to talk"); // Force the language of a single speechSynthesis artyom.say("Hola, esto está en Español", { lang:"es-ES" }); } }); # All you need to know about Artyom - [Documentation and FAQ](http://docs.ourcodeworld.com/projects/artyom-js) Do not hesitate to create a ticket on the issues area of the Github repository for any question, problem or inconvenient that you may have about artyom. # Development ## Building Artyom from source On every update, we build the latest version that can be retrieved from `/build` (for the browser and module). However, if you are willing to create your own version of Artyom, you would just need to modify the source file `/source/artyom.ts` and generate the build files using the following commands. If you want to create the Browser version, you will need as first remove the `export default` keywords at the beginning of the class and run then the following command: bash npm run build-artyom-window If you want to create the Module version with CommonJS (for webpack, browserify etc) just run: bash npm run build-artyom-module ## Testing If you're interested in modifying or working with Artyom, or *you just simply want to test it quickly in your environment*, we recommend you to use the little Sandbox utility of Artyom. Using Webpack, the Artyom Sandbox creates an HTTPS server accessible at https://localhost:3000, here Artyom will be accesible in Continuous mode too. Start by cloning the repository of artyom: bash git clone https://github.com/sdkcarlos/artyom.js/ cd artyom.js Switch to the sandbox directory: bash cd sandbox Then install the dependencies: bash npm install And start the Webpack dev server using: bash npm start and finally access to the [https: # Languages Artyom provides **complete** support for the following languages. Every language needs an initialization code that needs to be provided in the lang property at the initialization. | |Description |Code for initialization| |<img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-usa.png" alt="Supported language"/>| English (USA)<br/>English (Great Britain) Great Britain| en-US<br/>en-GB | |<img src="https: |<img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-german.png" alt="Supported language"/>| Deutsch (German) | de-DE | | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-italy.png" alt="Supported language"/> | Italiano |it-IT | | <img src="https: | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-japan.png" alt="Supported language"/> | Japanese | ja-JP | | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-russia.png" alt="Supported language"/> | Russian | ru-RU | | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-brasil.png" alt="Supported language"/> | Brazil | pt-PT | | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-netherlands.png" alt="Supported language"/> | Dutch (netherlands)| nl-NL | | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-poland.png" alt="Supported language"/> | Polski (polonia)| pl-PL | | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-indonesia.png" alt="Supported language"/> | Indonesian (Indonesia)| id-ID | | <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-china.png" alt="Supported language"/> | Chinese (Cantonese[ ] <br/> Mandarin[])| Cantonese<br/>zh-HK<br/> Mandarin<br />zh-CN| |<img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/flag-hindi.png" alt="Supported language" />| Hindi (India) | hi-IN | # Demonstrations - [Homepage](https://sdkcarlos.github.io/sites/artyom.html) - [Continuous mode J.A.R.V.I.S](https://sdkcarlos.github.io/jarvis.html) - [Sticky Notes](https://sdkcarlos.github.io/demo-sites/artyom/artyom_sticky_notes.html) # Thanks Working with artyom is cool and easy, read the documentation to discover more awesome features. Thanks for visiting the repository ! <p align="center"> <img src="https://raw.githubusercontent.com/sdkcarlos/sdkcarlos.github.io/master/sites/artyom-resources/images/<API key>.jpg" alt="Artyom example use" width="256"/> </p>
#include "src/math/float/log10f.c" #include "log.h" int main(void) { test(log10f, log10); }
<?php namespace XeroPHP\Reports; class <API key> { /** * @var string[] */ private $headers; /** * @var mixed[] */ private $rows; /** * @param string[] $headers * @param mixed[] $rows */ public function __construct(array $headers, array $rows = []) { $this->headers = $headers; $this->rows = $rows; } /** * @return string[] */ public function getHeaders() { return $this->headers; } /** * @return mixed[] */ public function getRows() { return $this->rows; } }
# mrb\_manager [![Gitter](https: mruby binary manager having a affinity for mgem ## Installation Install it yourself as: $ gem install mrb_manager Afterwards you will still need to add ```eval "$(mrbm init)"``` to your profile. You'll only ever have to do this once. ## Usage Install mruby with current active mgems You should be able to: $ mgem add mruby-redis $ mrbm install If ```-t tag_name``` specified, you can install tagged mruby $ mgem add mryby-redis $ mgem add mruby-http2 $ mrbm install -t redis-and-http2 Uninstall mruby You should be able to: # list all available mruby $ mrbm list ID CREATED VERSION TAG cfb43c1811c5 1 month ago 1.1.0 $ mrbm uninstall cfb43c1811c5 If you tagged: $ mrbm list ID CREATED VERSION TAG cf3889727b2a 1 month ago 1.0.0 redis-and-http2 $ mrbm uninstall -t redis-and-http2 ## Contributing 1. Fork it ( https://github.com/rrreeeyyy/mrb_manager/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
var searchData= [ ['nalloc',['NALLOC',['../dwarfDbgInt_8h.html#<API key>',1,'dwarfDbgInt.h']]], ['name',['name',['../structattrValues.html#<API key>',1,'attrValues']]], ['<API key>',['<API key>',['../structcompileUnit.html#<API key>',1,'compileUnit']]], ['numaddchild',['numAddChild',['../<API key>.html#<API key>',1,'dwarfDbgGetDbgInfo.c']]], ['numaddsibling',['numAddSibling',['../<API key>.html#<API key>',1,'dwarfDbgGetDbgInfo.c']]], ['numattr',['numAttr',['../structdieInfo.html#<API key>',1,'dieInfo']]], ['numattrstr',['numAttrStr',['../<API key>.html#<API key>',1,'<API key>']]], ['numchildren',['numChildren',['../<API key>.html#<API key>',1,'dieAndChildrenInfo']]], ['numciefde',['numCieFde',['../structframeInfo.html#<API key>',1,'frameInfo']]], ['numcompileunit',['numCompileUnit',['../<API key>.html#<API key>',1,'<API key>']]], ['numdieandchildren',['numDieAndChildren',['../structcompileUnit.html#<API key>',1,'compileUnit']]], ['numdies',['numDies',['../<API key>.html#<API key>',1,'dwarfDbgGetDbgInfo.c']]], ['numdirname',['numDirName',['../structdirNamesInfo.html#<API key>',1,'dirNamesInfo']]], ['numdwarraytype',['numDwArrayType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwbasetype',['numDwBaseType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwconsttype',['numDwConstType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['<API key>',['<API key>',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwenumeratortype',['numDwEnumeratorType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwmember',['numDwMember',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwpointertype',['numDwPointerType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwstructuretype',['numDwStructureType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwsubroutinetype',['numDwSubroutineType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwtypedef',['numDwTypeDef',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwuniontype',['numDwUnionType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numdwvolatiletype',['numDwVolatileType',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numfde',['numFde',['../structcieFde.html#<API key>',1,'cieFde::numFde()'],['../structframeInfo.html#<API key>',1,'frameInfo::numFde()']]], ['numfileinfo',['numFileInfo',['../structcompileUnit.html#<API key>',1,'compileUnit']]], ['numfileline',['numFileLine',['../structfileInfo.html#<API key>',1,'fileInfo']]], ['<API key>',['<API key>',['../<API key>.html#<API key>',1,'subProgramInfo']]], ['numframeregcol',['numFrameRegCol',['../<API key>.html#<API key>',1,'frameDataEntry']]], ['numlocentry',['numLocEntry',['../structlocationInfo.html#<API key>',1,'locationInfo']]], ['numpathname',['numPathName',['../structpathNamesInfo.html#<API key>',1,'pathNamesInfo']]], ['numrangeinfo',['numRangeInfo',['../structcompileUnit.html#<API key>',1,'compileUnit']]], ['numsiblings',['numSiblings',['../<API key>.html#<API key>',1,'dieAndChildrenInfo::numSiblings()'],['../<API key>.html#<API key>',1,'numSiblings():&#160;dwarfDbgGetDbgInfo.c']]], ['numsourcefile',['numSourceFile',['../structcompileUnit.html#<API key>',1,'compileUnit']]], ['numsubprograminfo',['numSubProgramInfo',['../structcompileUnit.html#<API key>',1,'compileUnit']]], ['numtypestr',['numTypeStr',['../<API key>.html#<API key>',1,'dwarfDbgTypeInfo']]], ['numvariableinfo',['numVariableInfo',['../<API key>.html#<API key>',1,'subProgramInfo']]] ];
<?php namespace Mastercel\ChartBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Solicitudespagos * * @ORM\Table(name="SolicitudesPagos", indexes={@ORM\Index(name="Indice_1", columns={"DteSolicitud", "TmeSolicitud"}), @ORM\Index(name="Indice_2", columns={"DteActualizacion"}), @ORM\Index(name="Indice_3", columns={"<API key>"})}) * @ORM\Entity */ class Solicitudespagos { /** * @var integer * * @ORM\Column(name="NumSolicitud_id", type="integer", nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ private $numsolicitudId = '0'; /** * @var integer * * @ORM\Column(name="<API key>", type="integer", nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ private $<API key> = '0'; /** * @var \DateTime * * @ORM\Column(name="DteSolicitud", type="datetime", nullable=true) */ private $dtesolicitud; /** * @var \DateTime * * @ORM\Column(name="TmeSolicitud", type="datetime", nullable=true) */ private $tmesolicitud; /** * @var \DateTime * * @ORM\Column(name="DteVencimiento", type="datetime", nullable=true) */ private $dtevencimiento; /** * @var integer * * @ORM\Column(name="NumEmpresa_id", type="integer", nullable=true) */ private $numempresaId = '0'; /** * @var integer * * @ORM\Column(name="NumMoneda_id", type="integer", nullable=true) */ private $nummonedaId = '0'; /** * @var integer * * @ORM\Column(name="NumEjecutivo_id", type="integer", nullable=true) */ private $numejecutivoId = '0'; /** * @var integer * * @ORM\Column(name="NumProveedor_id", type="integer", nullable=true) */ private $numproveedorId = '0'; /** * @var integer * * @ORM\Column(name="NumCategoria_id", type="integer", nullable=true) */ private $numcategoriaId = '0'; /** * @var integer * * @ORM\Column(name="NumAutorizador_id", type="integer", nullable=true) */ private $numautorizadorId = '0'; /** * @var integer * * @ORM\Column(name="NumCreadoPor_id", type="integer", nullable=true) */ private $numcreadoporId = '0'; /** * @var \DateTime * * @ORM\Column(name="DteCreacion", type="datetime", nullable=true) */ private $dtecreacion; /** * @var integer * * @ORM\Column(name="<API key>", type="integer", nullable=true) */ private $numactualizadoporId = '0'; /** * @var \DateTime * * @ORM\Column(name="DteActualizacion", type="datetime", nullable=true) */ private $dteactualizacion; /** * @var integer * * @ORM\Column(name="NumTipoEstado", type="integer", nullable=true) */ private $numtipoestado = '0'; /** * @var integer * * @ORM\Column(name="<API key>", type="integer", nullable=true) */ private $<API key> = '0'; /** * Set numsolicitudId * * @param integer $numsolicitudId * @return Solicitudespagos */ public function setNumsolicitudId($numsolicitudId) { $this->numsolicitudId = $numsolicitudId; return $this; } /** * Get numsolicitudId * * @return integer */ public function getNumsolicitudId() { return $this->numsolicitudId; } /** * Set <API key> * * @param integer $<API key> * @return Solicitudespagos */ public function <API key>($<API key>) { $this-><API key> = $<API key>; return $this; } /** * Get <API key> * * @return integer */ public function <API key>() { return $this-><API key>; } /** * Set dtesolicitud * * @param \DateTime $dtesolicitud * @return Solicitudespagos */ public function setDtesolicitud($dtesolicitud) { $this->dtesolicitud = $dtesolicitud; return $this; } /** * Get dtesolicitud * * @return \DateTime */ public function getDtesolicitud() { return $this->dtesolicitud; } /** * Set tmesolicitud * * @param \DateTime $tmesolicitud * @return Solicitudespagos */ public function setTmesolicitud($tmesolicitud) { $this->tmesolicitud = $tmesolicitud; return $this; } /** * Get tmesolicitud * * @return \DateTime */ public function getTmesolicitud() { return $this->tmesolicitud; } /** * Set dtevencimiento * * @param \DateTime $dtevencimiento * @return Solicitudespagos */ public function setDtevencimiento($dtevencimiento) { $this->dtevencimiento = $dtevencimiento; return $this; } /** * Get dtevencimiento * * @return \DateTime */ public function getDtevencimiento() { return $this->dtevencimiento; } /** * Set numempresaId * * @param integer $numempresaId * @return Solicitudespagos */ public function setNumempresaId($numempresaId) { $this->numempresaId = $numempresaId; return $this; } /** * Get numempresaId * * @return integer */ public function getNumempresaId() { return $this->numempresaId; } /** * Set nummonedaId * * @param integer $nummonedaId * @return Solicitudespagos */ public function setNummonedaId($nummonedaId) { $this->nummonedaId = $nummonedaId; return $this; } /** * Get nummonedaId * * @return integer */ public function getNummonedaId() { return $this->nummonedaId; } /** * Set numejecutivoId * * @param integer $numejecutivoId * @return Solicitudespagos */ public function setNumejecutivoId($numejecutivoId) { $this->numejecutivoId = $numejecutivoId; return $this; } /** * Get numejecutivoId * * @return integer */ public function getNumejecutivoId() { return $this->numejecutivoId; } /** * Set numproveedorId * * @param integer $numproveedorId * @return Solicitudespagos */ public function setNumproveedorId($numproveedorId) { $this->numproveedorId = $numproveedorId; return $this; } /** * Get numproveedorId * * @return integer */ public function getNumproveedorId() { return $this->numproveedorId; } /** * Set numcategoriaId * * @param integer $numcategoriaId * @return Solicitudespagos */ public function setNumcategoriaId($numcategoriaId) { $this->numcategoriaId = $numcategoriaId; return $this; } /** * Get numcategoriaId * * @return integer */ public function getNumcategoriaId() { return $this->numcategoriaId; } /** * Set numautorizadorId * * @param integer $numautorizadorId * @return Solicitudespagos */ public function setNumautorizadorId($numautorizadorId) { $this->numautorizadorId = $numautorizadorId; return $this; } /** * Get numautorizadorId * * @return integer */ public function getNumautorizadorId() { return $this->numautorizadorId; } /** * Set numcreadoporId * * @param integer $numcreadoporId * @return Solicitudespagos */ public function setNumcreadoporId($numcreadoporId) { $this->numcreadoporId = $numcreadoporId; return $this; } /** * Get numcreadoporId * * @return integer */ public function getNumcreadoporId() { return $this->numcreadoporId; } /** * Set dtecreacion * * @param \DateTime $dtecreacion * @return Solicitudespagos */ public function setDtecreacion($dtecreacion) { $this->dtecreacion = $dtecreacion; return $this; } /** * Get dtecreacion * * @return \DateTime */ public function getDtecreacion() { return $this->dtecreacion; } /** * Set numactualizadoporId * * @param integer $numactualizadoporId * @return Solicitudespagos */ public function <API key>($numactualizadoporId) { $this->numactualizadoporId = $numactualizadoporId; return $this; } /** * Get numactualizadoporId * * @return integer */ public function <API key>() { return $this->numactualizadoporId; } /** * Set dteactualizacion * * @param \DateTime $dteactualizacion * @return Solicitudespagos */ public function setDteactualizacion($dteactualizacion) { $this->dteactualizacion = $dteactualizacion; return $this; } /** * Get dteactualizacion * * @return \DateTime */ public function getDteactualizacion() { return $this->dteactualizacion; } /** * Set numtipoestado * * @param integer $numtipoestado * @return Solicitudespagos */ public function setNumtipoestado($numtipoestado) { $this->numtipoestado = $numtipoestado; return $this; } /** * Get numtipoestado * * @return integer */ public function getNumtipoestado() { return $this->numtipoestado; } /** * Set <API key> * * @param integer $<API key> * @return Solicitudespagos */ public function <API key>($<API key>) { $this-><API key> = $<API key>; return $this; } /** * Get <API key> * * @return integer */ public function <API key>() { return $this-><API key>; } }
const moment = require('moment') const expect = require('chai').expect const sinon = require('sinon') const proxyquire = require('proxyquire') const breadcrumbHelper = require('../../helpers/breadcrumb-helper') const orgUnitConstant = require('../../../app/constants/organisation-unit.js') const activeStartDate = moment('25-12-2017', 'DD-MM-YYYY').toDate() // 2017-12-25T00:00:00.000Z const activeEndDate = moment('25-12-2018', 'DD-MM-YYYY').toDate() // 2018-12-25T00:00:00.000Z const breadcrumbs = breadcrumbHelper.TEAM_BREADCRUMBS const <API key> = [ { offenderManager: 'Test_Forename Test_Surname', reason: 'Disability', amount: 5, startDate: activeStartDate, endDate: activeEndDate, status: 'ACTIVE', additionalNotes: 'New Test Note' }] let getReductionsData let <API key> let getBreadcrumbsStub beforeEach(function () { getReductionsData = sinon.stub() getBreadcrumbsStub = sinon.stub().resolves(breadcrumbs) <API key> = proxyquire('../../../app/services/<API key>', { './data/<API key>': getReductionsData, './get-breadcrumbs': getBreadcrumbsStub }) }) describe('services/<API key>', function () { it('should return the expected reductions exports for team level', function () { getReductionsData.resolves(<API key>) return <API key>(1, orgUnitConstant.TEAM.name) .then(function (result) { expect(getReductionsData.calledWith(1, orgUnitConstant.TEAM.name)).to.be.eql(true) expect(getBreadcrumbsStub.calledWith(1, orgUnitConstant.TEAM.name)).to.be.eql(true) expect(result.reductionNotes[0].offenderManager).to.be.eql(<API key>[0].offenderManager) expect(result.reductionNotes[0].reason).to.be.eql(<API key>[0].reason) expect(result.reductionNotes[0].amount).to.be.eql(<API key>[0].amount) expect(result.reductionNotes[0].startDate).to.be.eql('25 12 2017, 00:00') expect(result.reductionNotes[0].endDate).to.be.eql('25 12 2018, 00:00') expect(result.reductionNotes[0].status).to.be.eql(<API key>[0].status) expect(result.reductionNotes[0].additionalNotes).to.be.eql(<API key>[0].additionalNotes) }) }) })
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using ProjectData; using Tools; using ProjectBLL; using System.Data; using Approve.RuleCenter; using System.Text; using System.Collections; using Approve.RuleApp; public partial class <API key> : Page { ProjectDB db = new ProjectDB(); RCenter rc = new RCenter(); protected void Page_Load(object sender, EventArgs e) { pageTool tool = new pageTool(this.Page); tool.ExecuteScript("tab();"); if (Session["FIsApprove"] != null && Session["FIsApprove"].ToString() == "1") { this.<API key>(Guid.NewGuid().ToString(), "<script>FIsApprove();</script>"); } if (!IsPostBack) { btnSave.Attributes["onclick"] = "return checkInfo();"; BindControl(); showInfo(); } } private void BindControl() { string deptId = ComFunction.GetDefaultDept(); StringBuilder sb = new StringBuilder(); sb.Append("select case FLevel when 1 then FFullName when 2 then FName when 3 then FName end FName,"); sb.Append("FNumber from cf_Sys_ManageDept "); sb.Append("where fnumber like '" + deptId + "%' "); sb.Append("and fname<>'' "); sb.Append("order by left(FNumber,4),flevel"); DataTable dt = rc.GetTable(sb.ToString()); p_FManageDeptId.DataSource = dt; p_FManageDeptId.DataSource = dt; p_FManageDeptId.DataTextField = "FName"; p_FManageDeptId.DataValueField = "FNumber"; p_FManageDeptId.DataBind(); } private void showInfo() { string FAppId = EConvert.ToString(Session["FAppId"]); var app = (from t in db.CF_App_List where t.FId == FAppId select new { t.FName, t.FYear, t.FLinkId, t.FBaseName, t.FPrjId, t.FState, }).FirstOrDefault(); pageTool tool = new pageTool(this.Page, "p_"); if (app != null) { t_FName.Text = app.FName; if (app.FState == 1 || app.FState == 6) { tool.ExecuteScript("btnEnable();"); } CF_Prj_BaseInfo prj = db.CF_Prj_BaseInfo.Where(t => t.FId == app.FPrjId).FirstOrDefault(); if (prj != null) { tool.fillPageControl(prj); } } } <summary> </summary> <returns></returns> bool IsUploadFile(int? FMTypeId, string FAppId) { CF_Prj_BaseInfo prj = (from p in db.CF_Prj_BaseInfo join a in db.CF_App_List on p.FId equals a.FPrjId where a.FId == FAppId select p).FirstOrDefault(); var v =false ; if (prj != null) { v = db.CF_Sys_PrjList.Count(t => t.FIsMust == 1 && t.FManageType == FMTypeId && t.FIsPrjType.Contains(prj.FType.ToString()) && db.CF_AppPrj_FileOther.Count(o => o.FPrjFileId == t.FId && o.FAppId == FAppId) < 1) > 0; } return v; } public void Report() { RCenter rc = new RCenter(); pageTool tool = new pageTool(this.Page); string fDeptNumber = ComFunction.GetDefaultDept(); if (fDeptNumber == null || fDeptNumber == "") { tool.showMessage(","); return; } string FAppId = EConvert.ToString(Session["FAppId"]); var app = (from t in db.CF_App_List where t.FId == FAppId select t).FirstOrDefault(); SortedList[] sl = new SortedList[1]; if (app != null) { if (IsUploadFile(app.FManageTypeId, FAppId)) { tool.showMessage("“”()"); return; } CF_Prj_BaseInfo prj = db.CF_Prj_BaseInfo.Where(t => t.FId == app.FPrjId).FirstOrDefault(); if (prj != null) { sl[0] = new SortedList(); sl[0].Add("FID", app.FId); sl[0].Add("FAppId", app.FId); sl[0].Add("FBaseInfoId", app.FBaseinfoId); sl[0].Add("FManageTypeId", app.FManageTypeId); sl[0].Add("FListId", "19301"); sl[0].Add("FTypeId", "1930100"); sl[0].Add("FLevelId", "1930100"); sl[0].Add("FIsPrime", 0); //sl.Add("FAppDeptId", row["FAppDeptId"].ToString()); //sl.Add("FAppDeptName", row["FAppDeptName"].ToString()); sl[0].Add("FAppTime", DateTime.Now); sl[0].Add("FIsNew", 0); sl[0].Add("FIsBase", 0); sl[0].Add("FIsTemp", 0); sl[0].Add("FUpDept", p_FManageDeptId.SelectedValue); sl[0].Add("FEmpId", prj.FId); sl[0].Add("FEmpName", prj.FPrjName); var s = (from t in db.CF_Prj_Ent join a in db.CF_App_List on t.FAppId equals a.FId where a.FPrjId == app.FPrjId && a.FManageTypeId == 291 && t.FEntType == 155 && a.FState == 6 select new { t.FId, t.FBaseInfoId, t.FName, t.FLevelName, t.FCertiNo, t.FMoney, t.FPlanDate, t.FAppId }).FirstOrDefault(); if (s != null) { sl[0].Add("FLeadId", s.FBaseInfoId); sl[0].Add("FLeadName", s.FName); } StringBuilder sb = new StringBuilder(); sb.Append("update CF_App_List set FUpDeptId=" + p_FManageDeptId.SelectedValue + ","); sb.Append("ftime=getdate() where fid = '" + FAppId + "'"); rc.PExcute(sb.ToString()); string fsystemid = CurrentEntUser.SystemId; RApp ra = new RApp(); if (ra.EntStartProcessKCSJ(app.FBaseinfoId, FAppId, app.FYear.ToString(), DateTime.Now.Month.ToString(), fsystemid, fDeptNumber, p_FManageDeptId.SelectedValue, sl)) { sb.Remove(0, sb.Length); this.Session["FIsApprove"] = 1; tool.<API key>("", "location.href=location.href"); } } } } protected void btnSave_Click(object sender, EventArgs e) { Report(); } }
using System.Threading.Tasks; using Test.Utilities; using Xunit; using VerifyCS = Test.Utilities.<API key>< Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.<API key>, Microsoft.CodeQuality.CSharp.Analyzers.ApiDesignGuidelines.<API key>>; using VerifyVB = Test.Utilities.<API key>< Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.<API key>, Microsoft.CodeQuality.VisualBasic.Analyzers.ApiDesignGuidelines.<API key>>; namespace Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.UnitTests { public class <API key> { [Fact] public async Task <API key>() { var code = @" public class Outer { [System.Flags] public enum E { A = 0, B = 3 } } [System.Flags] public enum E2 { A2 = 0, B2 = 1 } [System.Flags] public enum E3 { A3 = (ushort)0, B3 = (ushort)1 } [System.Flags] public enum E4 { A4 = 0, B4 = (int)2 // Sample comment } [System.Flags] public enum NoZeroValuedField { A5 = 1, B5 = 2 }"; var expectedFixedCode = @" public class Outer { [System.Flags] public enum E { None = 0, B = 3 } } [System.Flags] public enum E2 { None = 0, B2 = 1 } [System.Flags] public enum E3 { None = (ushort)0, B3 = (ushort)1 } [System.Flags] public enum E4 { None = 0, B4 = (int)2 // Sample comment } [System.Flags] public enum NoZeroValuedField { A5 = 1, B5 = 2 }"; await VerifyCS.VerifyCodeFixAsync( code, new[] { VerifyCS.Diagnostic(<API key>.RuleRename).WithSpan(7, 9, 7, 10).WithArguments("E", "A"), VerifyCS.Diagnostic(<API key>.RuleRename).WithSpan(15, 5, 15, 7).WithArguments("E2", "A2"), VerifyCS.Diagnostic(<API key>.RuleRename).WithSpan(22, 5, 22, 7).WithArguments("E3", "A3"), VerifyCS.Diagnostic(<API key>.RuleRename).WithSpan(29, 5, 29, 7).WithArguments("E4", "A4"), }, expectedFixedCode); } [Fact] public async Task <API key>() { var code = @"// Some comment public class Outer { [System.Flags] public enum E { None = 0, A = 0 } } // Some comment [System.Flags] public enum E2 { None = 0, A = None }"; var expectedFixedCode = @"// Some comment public class Outer { [System.Flags] public enum E { None = 0 } } // Some comment [System.Flags] public enum E2 { None = 0 }"; await VerifyCS.VerifyCodeFixAsync( code, new[] { VerifyCS.Diagnostic(<API key>.RuleMultipleZero).WithSpan(5, 17, 5, 18).WithArguments("E"), VerifyCS.Diagnostic(<API key>.RuleMultipleZero).WithSpan(13, 13, 13, 15).WithArguments("E2"), }, expectedFixedCode); } [Fact] public async Task <API key>() { var code = @" public class Outer { public enum E { A = 1 } public enum E2 { None = 1, A = 2 } } public enum E3 { None = 0, A = 1 } public enum E4 { None = 0, A = 0 } "; var expectedFixedCode = @" public class Outer { public enum E { None, A = 1 } public enum E2 { None, A = 2 } } public enum E3 { None = 0, A = 1 } public enum E4 { None = 0, A = 0 } "; await VerifyCS.VerifyCodeFixAsync( code, new[] { VerifyCS.Diagnostic(<API key>.RuleNoZero).WithSpan(4, 17, 4, 18).WithArguments("E"), VerifyCS.Diagnostic(<API key>.RuleNoZero).WithSpan(9, 17, 9, 19).WithArguments("E2"), }, expectedFixedCode); } [Fact] public async Task <API key>() { var code = @" Public Class Outer <System.Flags> Public Enum E A = 0 B = 1 End Enum End Class <System.Flags> Public Enum E2 A2 = 0 B2 = 1 End Enum <System.Flags> Public Enum E3 A3 = CUShort(0) B3 = CUShort(1) End Enum <System.Flags> Public Enum NoZeroValuedField A5 = 1 B5 = 2 End Enum "; var expectedFixedCode = @" Public Class Outer <System.Flags> Public Enum E None = 0 B = 1 End Enum End Class <System.Flags> Public Enum E2 None = 0 B2 = 1 End Enum <System.Flags> Public Enum E3 None = CUShort(0) B3 = CUShort(1) End Enum <System.Flags> Public Enum NoZeroValuedField A5 = 1 B5 = 2 End Enum "; await VerifyVB.VerifyCodeFixAsync( code, new[] { VerifyVB.Diagnostic(<API key>.RuleRename).WithSpan(5, 9, 5, 10).WithArguments("E", "A"), VerifyVB.Diagnostic(<API key>.RuleRename).WithSpan(12, 5, 12, 7).WithArguments("E2", "A2"), VerifyVB.Diagnostic(<API key>.RuleRename).WithSpan(18, 5, 18, 7).WithArguments("E3", "A3"), }, expectedFixedCode); } [WorkItem(836193, "DevDiv")] [Fact] public async Task <API key>() { var code = @" Public Class Outer <System.Flags> _ Public Enum E A = 0 B = 1 End Enum End Class <System.Flags> _ Public Enum E2 A2 = 0 B2 = 1 End Enum <System.Flags> _ Public Enum E3 A3 = CUShort(0) B3 = CUShort(1) End Enum <System.Flags> _ Public Enum NoZeroValuedField A5 = 1 B5 = 2 End Enum "; var expectedFixedCode = @" Public Class Outer <System.Flags> _ Public Enum E None = 0 B = 1 End Enum End Class <System.Flags> _ Public Enum E2 None = 0 B2 = 1 End Enum <System.Flags> _ Public Enum E3 None = CUShort(0) B3 = CUShort(1) End Enum <System.Flags> _ Public Enum NoZeroValuedField A5 = 1 B5 = 2 End Enum "; await VerifyVB.VerifyCodeFixAsync( code, new[] { VerifyVB.Diagnostic(<API key>.RuleRename).WithSpan(5, 9, 5, 10).WithArguments("E", "A"), VerifyVB.Diagnostic(<API key>.RuleRename).WithSpan(12, 5, 12, 7).WithArguments("E2", "A2"), VerifyVB.Diagnostic(<API key>.RuleRename).WithSpan(18, 5, 18, 7).WithArguments("E3", "A3"), }, expectedFixedCode); } [Fact] public async Task <API key>() { var code = @" Public Class Outer <System.Flags> Public Enum E None = 0 A = 0 End Enum End Class <System.Flags> Public Enum E2 None = 0 A = None End Enum <System.Flags> Public Enum E3 A3 = 0 B3 = CUInt(0) ' Not a constant End Enum"; var expectedFixedCode = @" Public Class Outer <System.Flags> Public Enum E None = 0 End Enum End Class <System.Flags> Public Enum E2 None = 0 End Enum <System.Flags> Public Enum E3 None End Enum"; await VerifyVB.VerifyCodeFixAsync( code, new[] { VerifyVB.Diagnostic(<API key>.RuleMultipleZero).WithSpan(4, 17, 4, 18).WithArguments("E"), VerifyVB.Diagnostic(<API key>.RuleMultipleZero).WithSpan(11, 13, 11, 15).WithArguments("E2"), VerifyVB.Diagnostic(<API key>.RuleMultipleZero).WithSpan(17, 13, 17, 15).WithArguments("E3"), }, expectedFixedCode); } [Fact] public async Task <API key>() { var code = @" Public Class C Public Enum E A = 1 End Enum Public Enum E2 None = 1 A = 2 End Enum End Class Public Enum E3 None = 0 A = 1 End Enum Public Enum E4 None = 0 A = 0 End Enum "; var expectedFixedCode = @" Public Class C Public Enum E None A = 1 End Enum Public Enum E2 None A = 2 End Enum End Class Public Enum E3 None = 0 A = 1 End Enum Public Enum E4 None = 0 A = 0 End Enum "; await VerifyVB.VerifyCodeFixAsync( code, new[] { VerifyVB.Diagnostic(<API key>.RuleNoZero).WithSpan(3, 17, 3, 18).WithArguments("E"), VerifyVB.Diagnostic(<API key>.RuleNoZero).WithSpan(7, 17, 7, 19).WithArguments("E2"), }, expectedFixedCode); } } }
/** * Config */ var PRIVATE_<API key>; /** * Globals. */ var autocompleteOpts, projectOpts, currentProjectID, currentProjectPath; $(function () { initGlobals(); handleAll(); mapUrlHandler(location.pathname, [ { pattern: /^\/[^\/]+\/[^\/]+$/, handle: <API key> }, { pattern: /^.+\/tree\/.+/, handle: handleTreeView }, { pattern: /^.+\/blob\/[^\/]+\/.+\.md$/, handle: handleMdBlobView } ]); }); $(document).ajaxSuccess(function (event, xhr, settings) { mapUrlHandler(settings.url, [ { pattern: /.+\?limit=20/, handle: <API key> }, { pattern: /.+\/refs\/.+\/logs_tree\/.+/, handle: handleLogsTree }, { pattern: /.+notes\.js\?target_type=issue.+/, handle: handleIssueComments } ]); }); /** * Parse useful data from dom elements and assign them to globals for later use. */ function initGlobals () { autocompleteOpts = JSON.parse($('.<API key>').attr('<API key>')); projectOpts = _.where(autocompleteOpts, function (opt) { if (opt.label.indexOf('project:') !== -1) { return true; } }); currentUser = $('.profile-pic').attr('href').slice(3); currentProjectID = $(document.body).attr('data-project-id'); currentProjectPath = '/'; if ($('h1.project_name span').length) { currentProjectPath += $('h1.project_name span').text() .replace(/\s/, '').replace(/\s/, '').replace(' ', '-').toLowerCase(); } else { currentProjectPath += currentUser + '/' + $('h1.project_name').text().replace(' ', '-').toLowerCase(); } currentBranch = $('.project-refs-select').val(); console.log(currentUser, currentProjectID, currentProjectPath, currentBranch); } /** * Document loaded url handlers. */ /** * Handle tweak tasks for all pages. */ function handleAll() { $('.home a').attr('href', $('.home a').attr('href') + ' addProjectSelect(); } /** * Handle tweak tasks for project dashboard page. */ function <API key>() { // Nothing to do. } /** * Handle tweak tasks for files tree view. */ function handleTreeView() { <API key>(); } /** * Handle tweak tasks for markdown file blob view. */ function handleMdBlobView() { var slideLink = $('<a class="btn btn-tiny" target="_blank">slide</a>') .attr('href', '/reveal/md.html?p=' + location.pathname.replace('blob', 'raw')); $('.file-title .options .btn-group a:nth-child(2)').after(slideLink); <API key>(); } /** * Add project select on the top bar. */ function addProjectSelect() { var projectSelectForm = $('<form class="navbar-form pull-left">' + '<select id="t-project-list"></select>' + '</form>'); $('.navbar .container .nav li:nth-child(2)').after(projectSelectForm); var options = projectOpts.map(function (project) { return $('<option />').val(project.url.toLowerCase()).text(project.label.slice(9)); }); if (!$('h1.project_name span').length) { options.unshift('<option>Go to Project</option>'); } $('#t-project-list').append(options) .val(currentProjectPath) .change(function () { location.href = $(this).val(); }); } /** * Generate TOC for markdown file. */ function <API key>() { // Assume there is only one .file-holder. var fileHolder = $('.file-holder'); if (fileHolder.length !== 1) { return; } var fileTitle = fileHolder.find('.file-title'), fileContent = fileHolder.find('.file-content'); fileTitle.wrapInner('<div class="t-file-title-header" />') .scrollToFixed(); var fileTitleFooter = $('<div class="t-file-title-footer"><div class="t-file-title-toc navbar-inner" /></div>') .appendTo(fileTitle) .hide(); var fileTitleToc = fileTitleFooter.find('.t-file-title-toc') .tocify({ context: fileContent, selectors: 'h1,h2,h3,h4,h5,h6', showAndHide: false, hashGenerator: 'pretty', scrollTo: 38 }); // Some special characters will cause tocify hash error, replace them with empty string. fileHolder.find('[data-unique]').each(function () { $(this).attr('data-unique', $(this).attr('data-unique').replace(/\./g, '')); }); $('<span class="<API key> options">' + '<div class="btn-group tree-btn-group">' + '<a class="btn btn-tiny" title="Table of Content, \'m\' for shortcut.">TOC</a>' + '</div>' + '</span>') .click(function () { fileTitleFooter.toggle(); }) .appendTo(fileTitle.find('.t-file-title-header')); $(document).keyup(function(e) { switch (e.which) { case 27: fileTitleFooter.hide(); break; case 77: fileTitleFooter.toggle(); break; } }); // Jumpt to ahchor if has one. if (location.hash) { var anchor = location.hash.slice(1); fileTitleToc.find('li[data-unique="' + anchor + '"] a').click(); } // Adjust hyperlink. fileContent.find('a').each(function () { var href = $(this).attr('href'); // Sine 6-2-stable, gitlab will handle relative links when rendering markdown, // but it didn't work, all relative links fallback to wikis path, // I didn't have much time to figure out why, so I did this quick fix. var <API key> = currentProjectPath + '/wikis/'; var <API key> = href.indexOf(<API key>); if (<API key> != -1) { href = href.slice(<API key>.length); } // If not start with '/' and doesn't have '//', consider it as a relative path. if (/^[^\/]/.test(href) && !/.*\/\/.*/.test(href)) { var middlePath; // If end with .ext, this is a file path, otherwise is a directory path. if (/.*\.[^\/]+$/.test(href)) { middlePath = '/blob/'; } else { middlePath = '/tree/'; } $(this).attr('href', currentProjectPath + middlePath + currentBranch + '/' + href); } }); } /** * Ajax success url handlers. */ /** * Handle tweak tasks for dashboard activities. */ function <API key>() { // Nothing to do. } /** * Handle tweak tasks for issue comments. */ function handleIssueComments() { $('.note-image-attach').each(function () { var img = $(this); var wrapper = $('<a class="<API key>" rel="<API key>" />') .attr('href', img.attr('src')) .attr('title', img.attr('alt')); img.wrap(wrapper); wrapper.commonFancybox(); }); $('.<API key>').commonFancybox(); } /** * Handle tweak tasks for git logs tree. */ function handleLogsTree() { // Nothing to do. } /** * Helpers. */ function mapUrlHandler(url, handlers) { handlers.forEach(function (handler) { if (handler.pattern.test(url)) { handler.handle(); } }); } function mySetInterval(fn, interval) { setTimeout(function () { fn(function () { mySetInterval(fn, interval); }); }, interval); } function myGitLabAPIGet(url, data, cb) { $.get('/api/v3/' + url + '?private_token=' + PRIVATE_TOKEN, data, function (data) { cb(data); }); } /** * Extensions */ if (typeof String.prototype.endsWith !== 'function') { String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; }; } (function ($) { $.fn.extend({ commonFancybox: function () { $(this).fancybox({ closeBtn: false, helpers: { title: { type : 'inside' }, buttons: {} } }); } }); })(jQuery);
import axios from 'axios' import pipelineApi from './api' import { addMessage } from '../../../client/utils/flash-messages' import { <API key> } from '../../../client/utils/date' function <API key>(values, oldValues = {}) { const data = { name: values.name, status: values.category, } function addValue(key, value) { const existingValue = oldValues[key] const hasExistingValue = Array.isArray(existingValue) ? !!existingValue.length : !!existingValue if (hasExistingValue || (Array.isArray(value) ? value.length : value)) { data[key] = value || null } } addValue('likelihood_to_win', parseInt(values.likelihood, 10)) addValue('sector', values.sector?.value) addValue( 'contacts', values.contacts ? values.contacts.map(({ value }) => value) : [] ) addValue('potential_value', values.export_value) addValue('expected_win_date', <API key>(values.expected_win_date)) return data } export async function <API key>({ companyId }) { const { data } = await pipelineApi.list({ company_id: companyId }) return { companyId, count: data.count, results: data.results, } } export async function <API key>({ values, companyId }) { const { data } = await pipelineApi.create({ company: companyId, <API key>(values), }) addMessage('success', `You added ${values.name} to your pipeline`) return data } export async function getPipelineItem({ pipelineItemId }) { const { data } = await pipelineApi.get(pipelineItemId) return data } export async function getCompanyContacts({ companyId, features }) { const <API key> = features['<API key>'] ? 'v4' : 'v3' const { data } = await axios.get( `/api-proxy/${<API key>}/contact`, { params: { company_id: companyId, limit: 500 }, } ) return data.results } export async function editPipelineItem({ values, pipelineItemId, currentPipelineItem, }) { const { data } = await pipelineApi.update( pipelineItemId, <API key>(values, currentPipelineItem) ) addMessage('success', `You saved changes to ${values.name}`) return data } export async function archivePipelineItem({ values, pipelineItemId, projectName, }) { const { data } = await pipelineApi.archive(pipelineItemId, { reason: values.reason, }) addMessage('success', `You archived ${projectName}`) return data } export async function <API key>({ projectName, pipelineItemId }) { const { data } = await pipelineApi.unarchive(pipelineItemId) addMessage('success', `You unarchived ${projectName}`) return data } export async function deletePipelineItem({ projectName, pipelineItemId }) { const { status } = await pipelineApi.delete(pipelineItemId) addMessage('success', `You deleted ${projectName} from your pipeline`) return status }
var global = require('../../global'); module.exports = function (data, offset) { var items = data.items.map(invoiceNote => { var invoiceItem = invoiceNote.items.map(dataItem => { var _items = dataItem.items.map(item => { dueDate = new Date(dataItem.<API key>); dueDate.setDate(dueDate.getDate() + item.paymentDueDays); return { deliveryOrderNo: dataItem.deliveryOrderNo, date: dataItem.deliveryOrderDate, <API key>: item.<API key>, product: item.product.name, productDesc: item.product.description, quantity: item.deliveredQuantity, uom: item.purchaseOrderUom.unit, unit: item.unit, price: item.pricePerDealUnit, priceTotal: item.pricePerDealUnit * item.deliveredQuantity, correction: item.correction, dueDate: dueDate, paymentMethod: item.paymentMethod, currRate: item.kursRate, } }); _items = [].concat.apply([], _items); return _items; }) invoiceItem = [].concat.apply([], invoiceItem); return invoiceItem; }); items = [].concat.apply([], items); var dueDate, paymentMethod; var dueDates = items.map(item => { return item.dueDate }) dueDate = Math.max.apply(null, dueDates); paymentMethod = items[0].paymentMethod; var useIncomeTax = data.items .map((item) => item.useIncomeTax) .reduce((prev, curr, index) => { return prev && curr }, true); var useVat = data.items .map((item) => item.useVat) .reduce((prev, curr, index) => { return prev && curr }, true); var vatRate = 0; if (useVat) { vatRate = data.items[0].vat.rate; } var sumByUnit = []; items.reduce(function (res, value) { if (!res[value.unit]) { res[value.unit] = { priceTotal: 0, unit: value.unit }; sumByUnit.push(res[value.unit]) } res[value.unit].priceTotal += value.priceTotal return res; }, {}); var locale = global.config.locale; var moment = require('moment'); moment.locale(locale.name); var header = [ { stack: [ 'PT. DAN LIRIS', 'Head Office : ', 'Kelurahan Banaran, Kecamatan Grogol', 'Sukoharjo 57193 - INDONESIA', 'PO.BOX 166 Solo 57100', 'Telp. (0271) 740888, 714400', 'Fax. (0271) 735222, 740777' ], alignment: "left", style: ['size06', 'bold'] }, { alignment: "center", text: 'NOTA INTERN', style: ['size08', 'bold'] }, '\n' ]; var subHeader = [ { columns: [ { width: '50%', stack: [ { columns: [{ width: '25%', text: 'No. Nota Intern', style: ['size06'] }, { width: '2%', text: ':', style: ['size06'] }, { width: '*', text: data.no, style: ['size06'] }] }, { columns: [{ width: '25%', text: 'Kode Supplier', style: ['size06'] }, { width: '2%', text: ':', style: ['size06'] }, { width: '*', text: data.supplier.code, style: ['size06'] }] }, { columns: [{ width: '25%', text: 'Nama Supplier', style: ['size06'] }, { width: '2%', text: ':', style: ['size06'] }, { width: '*', text: data.supplier.name, style: ['size06'] }] } ] }, { width: '50%', stack: [ { columns: [{ width: '28%', text: 'Tgl. Nota Intern', style: ['size06'] }, { width: '2%', text: ':', style: ['size06'] }, { width: '*', text: `${moment(data.date).add(offset, 'h').format("DD MMM YYYY")}`, style: ['size06'] }] }, { columns: [{ width: '28%', text: 'Tgl. Jatuh Tempo', style: ['size06'] }, { width: '2%', text: ':', style: ['size06'] }, { width: '*', text: `${moment(dueDate).add(offset, 'h').format("DD MMM YYYY")}`, style: ['size06'] }] },{ columns: [{ width: '28%', text: 'Term Pembayaran', style: ['size06'] }, { width: '2%', text: ':', style: ['size06'] }, { width: '*', text: paymentMethod, style: ['size06'] }] }, ] } ] }, { text: '\n', style: ['size06'] } ]; var thead = [ { text: 'No. Surat Jalan', style: ['size06', 'bold', 'center'] }, { text: 'Tgl. Surat Jalan', style: ['size06', 'bold', 'center'] }, { text: 'Nomor referensi PR', style: ['size06', 'bold', 'center'] }, { text: 'Keterangan Barang', style: ['size06', 'bold', 'center'] }, { text: 'Jumlah', style: ['size06', 'bold', 'center'] }, { text: 'Satuan', style: ['size06', 'bold', 'center'] }, { text: 'Harga Satuan', style: ['size06', 'bold', 'center'] }, { text: 'Harga Total', style: ['size06', 'bold', 'center'] } ]; var tbody = items.map(function (item, index) { return [{ text: item.deliveryOrderNo, style: ['size06', 'left'] }, { text: `${moment(item.date).add(offset, 'h').format("DD MMM YYYY")}`, style: ['size06', 'left'] }, { text: item.<API key>, style: ['size06', 'left'] }, { text: `${item.product};${item.productDesc}`, style: ['size06', 'left'] }, { text: item.quantity, style: ['size06', 'right'] }, { text: item.uom, style: ['size06', 'left'] }, { text: parseFloat(item.price).toLocaleString(locale, locale.currency), style: ['size06', 'right'] }, { text: parseFloat(item.priceTotal).toLocaleString(locale, locale.currency), style: ['size06', 'right'] }]; }); tbody = tbody.length > 0 ? tbody : [ [{ text: "tidak ada barang", style: ['size06', 'center'], colSpan: 8 }, "", "", "", "", "", "", ""] ]; var table = [{ table: { widths: ['12%', '12%', '10%', '25%', '7%', '7%', '12%', '15%'], headerRows: 1, body: [].concat([thead], tbody) } }]; var unitK1 = sumByUnit.find((item) => item.unit.toUpperCase() == "C2A"); var unitK2 = sumByUnit.find((item) => item.unit.toUpperCase() == "C2B"); var unitK3 = sumByUnit.find((item) => item.unit.toUpperCase() == "C2C"); var unitK4 = sumByUnit.find((item) => item.unit.toUpperCase() == "C1A"); var unit2D = sumByUnit.find((item) => item.unit.toUpperCase() == "C1B"); var sum = sumByUnit.map(item => item.priceTotal) .reduce(function (prev, curr, index, arr) { return prev + curr; }, 0); var sumKoreksi = items.map(item => item.correction) .reduce(function (prev, curr, index, arr) { return prev + curr; }, 0); var sumByCurrency = items.map(item => item.priceTotal * item.currRate) .reduce(function (prev, curr, index, arr) { return prev + curr; }, 0); var incomeTaxTotal = useIncomeTax ? sumByCurrency * 0.1 : 0; var vatTotal = useVat ? sumByCurrency * vatRate / 100 : 0; var sumTotal = sumByCurrency - vatTotal + incomeTaxTotal + sumKoreksi; var subFooter = [ { text: '\n', style: ['size06'] }, { columns: [ { stack: [ { columns: [ { width: '25%', text: 'Total K1 (2A)' }, { width: '2%', text: ':' }, { width: '*', text: unitK1 ? parseFloat(unitK1.priceTotal).toLocaleString(locale, locale.currency) : "" } ] }, { columns: [ { width: '25%', text: 'Total K2 (2B)' }, { width: '2%', text: ':' }, { width: '*', text: unitK2 ? parseFloat(unitK2.priceTotal).toLocaleString(locale, locale.currency) : "" } ] }, { columns: [ { width: '25%', text: 'Total K3 (2C)' }, { width: '2%', text: ':' }, { width: '*', text: unitK3 ? parseFloat(unitK3.priceTotal).toLocaleString(locale, locale.currency) : "" } ] }, { columns: [ { width: '25%', text: 'Total K4 (1)' }, { width: '2%', text: ':' }, { width: '*', text: unitK4 ? parseFloat(unitK4.priceTotal).toLocaleString(locale, locale.currency) : "" } ] }, { columns: [ { width: '25%', text: 'Total 2D' }, { width: '2%', text: ':' }, { width: '*', text: unit2D ? parseFloat(unit2D.priceTotal).toLocaleString(locale, locale.currency) : "" } ] }, ] }, { stack: [ { columns: [ { width: '45%', text: 'Total Harga Pokok (DPP)' }, { width: '2%', text: ':' }, { width: '*', text: parseFloat(sum).toLocaleString(locale, locale.currency) } ] }, { columns: [ { width: '45%', text: 'Mata Uang' }, { width: '2%', text: ':' }, { width: '*', text: data.currency.code } ] }, { columns: [ { width: '45%', text: 'Total Harga Pokok (Rp)' }, { width: '2%', text: ':' }, { width: '*', text: parseFloat(sum * data.currency.rate).toLocaleString(locale, locale.currency) } ] }, { columns: [ { width: '45%', text: 'Total Nota Koreksi' }, { width: '2%', text: ':' }, { width: '*', text: parseFloat(sumKoreksi).toLocaleString(locale, locale.currency) } ] }, { columns: [ { width: '45%', text: 'Total Nota PPN' }, { width: '2%', text: ':' }, { width: '*', text: parseFloat(incomeTaxTotal).toLocaleString(locale, locale.currency) } ] }, { columns: [ { width: '45%', text: 'Total Nota PPH' }, { width: '2%', text: ':' }, { width: '*', text: parseFloat(vatTotal).toLocaleString(locale, locale.currency) } ] }, { columns: [ { width: '45%', text: 'Total yang harus dibayar' }, { width: '2%', text: ':' }, { width: '*', text: parseFloat(sumTotal).toLocaleString(locale, locale.currency) } ] }, ] } ], style: ['size07'] }]; var footer = ['\n\n', { alignment: "center", table: { widths: ['33%', '33%', '33%'], body: [ [ { text: 'Administrasi', style: ['size06', 'bold', 'center'] }, { text: 'Staff Pembelian', style: ['size06', 'bold', 'center'] }, { text: 'Verifikasi', style: ['size06', 'bold', 'center'] } ], [ { stack: ['\n\n\n\n', { text: '(Nama & Tanggal)', style: ['size06', 'center'] } ] }, { stack: ['\n\n\n\n', { text: '(Nama & Tanggal)', style: ['size06', 'center'] } ] }, { stack: ['\n\n\n\n', { text: '(Nama & Tanggal)', style: ['size06', 'center'] } ] } ] ] } }]; var dd = { pageSize: 'A5', pageOrientation: 'portrait', pageMargins: 20, content: [].concat(header, subHeader, table, subFooter, footer), styles: { size06: { fontSize: 6 }, size07: { fontSize: 7 }, size08: { fontSize: 8 }, size09: { fontSize: 9 }, size10: { fontSize: 10 }, bold: { bold: true }, center: { alignment: 'center' }, left: { alignment: 'left' }, right: { alignment: 'right' }, justify: { alignment: 'justify' } } }; return dd; };
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>coqffi: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.8.1 / coqffi - 1.0.0~beta7</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> coqffi <small> 1.0.0~beta7 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2021-12-20 02:39:21 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-20 02:39:21 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 <API key> of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.8.1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;lthms@soap.coffee&quot; homepage: &quot;https://github.com/coq-community/coqffi&quot; dev-repo: &quot;git+https://github.com/coq-community/coqffi.git&quot; bug-reports: &quot;https://github.com/coq-community/coqffi/issues&quot; license: &quot;MIT&quot; synopsis: &quot;Tool for generating Coq FFI bindings to OCaml libraries&quot; description: &quot;&quot;&quot; `coqffi` generates the necessary Coq boilerplate to use OCaml functions in a Coq development, and configures the Coq extraction mechanism accordingly.&quot;&quot;&quot; build: [ [&quot;./src-prepare.sh&quot;] [&quot;dune&quot; &quot;build&quot; &quot;-p&quot; name &quot;-j&quot; jobs] ] depends: [ &quot;ocaml&quot; {&gt;= &quot;4.08&quot; &amp; &lt; &quot;4.13~&quot; } &quot;dune&quot; {&gt;= &quot;2.5&quot;} &quot;coq&quot; {(&gt;= &quot;8.12&quot; &amp; &lt; &quot;8.14~&quot;) | = &quot;dev&quot;} &quot;cmdliner&quot; {&gt;= &quot;1.0.4&quot;} &quot;sexplib&quot; {&gt;= &quot;0.14&quot;} ] tags: [ &quot;category:Miscellaneous/Coq Extensions&quot; &quot;keyword:foreign function interface&quot; &quot;keyword:extraction&quot; &quot;keyword:OCaml&quot; &quot;logpath:CoqFFI&quot; ] authors: [ &quot;Thomas Letan&quot; &quot;Li-yao Xia&quot; &quot;Yann Régis-Gianas&quot; &quot;Yannick Zakowski&quot; ] url { src: &quot;https://github.com/coq-community/coqffi/archive/1.0.0-beta7.tar.gz&quot; checksum: &quot;sha512=0f9d2893f59f8d09caec83f8476a2e7a511a7044516d639e4283b4187a86cf1563e60f1647cd12ae06e7e395bbc5dfedf5d798af3eb6baf81c0c2e482e14507b&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-coqffi.1.0.0~beta7 coq.8.8.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1). The following dependencies couldn&#39;t be met: - coq-coqffi -&gt; ocaml &gt;= 4.08 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-coqffi.1.0.0~beta7</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bignums: 3 m 34 s </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+2 / bignums - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> bignums <small> 8.7.0 <span class="label label-success">3 m 34 s </span> </small> </h1> <p> <em><script>document.write(moment("2021-11-14 19:55:30 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-14 19:55:30 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 <API key> of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.7.1+2 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;pierre.letouzey@inria.fr&quot; homepage: &quot;https://github.com/coq/bignums&quot; dev-repo: &quot;git+https://github.com/coq/bignums.git&quot; bug-reports: &quot;https://github.com/coq/bignums/issues&quot; authors: [ &quot;Laurent Théry&quot; &quot;Benjamin Grégoire&quot; &quot;Arnaud Spiwack&quot; &quot;Evgeny Makarov&quot; &quot;Pierre Letouzey&quot; ] license: &quot;LGPL-2.1-only&quot; build: [ [make &quot;-j%{jobs}%&quot; {ocaml:version &gt;= &quot;4.06&quot;}] ] install: [ [make &quot;install&quot;] ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword:integer numbers&quot; &quot;keyword:rational numbers&quot; &quot;keyword:arithmetic&quot; &quot;keyword:arbitrary-precision&quot; &quot;category:Miscellaneous/Coq Extensions&quot; &quot;category:Mathematics/Arithmetic and Number Theory/Number theory&quot; &quot;category:Mathematics/Arithmetic and Number Theory/Rational numbers&quot; &quot;date:2017-06-15&quot; &quot;logpath:Bignums&quot; ] synopsis: &quot;Bignums, the Coq library of arbitrary large numbers&quot; description: &quot;Provides BigN, BigZ, BigQ that used to be part of Coq standard library &lt; 8.7.&quot; url { src: &quot;https://github.com/coq/bignums/archive/V8.7.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-bignums.8.7.0 coq.8.7.1+2</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-bignums.8.7.0 coq.8.7.1+2</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>13 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-bignums.8.7.0 coq.8.7.1+2</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>3 m 34 s</dd> </dl> <h2>Installation size</h2> <p>Total: 10 M</p> <ul> <li>1 M <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/BigN.vo</code></li> <li>777 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.vo</code></li> <li>712 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.vo</code></li> <li>641 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.vo</code></li> <li>610 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/NMake.vo</code></li> <li>549 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.glob</code></li> <li>366 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.vo</code></li> <li>344 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.glob</code></li> <li>306 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigQ/QMake.vo</code></li> <li>295 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.vo</code></li> <li>290 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.vo</code></li> <li>274 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.vo</code></li> <li>265 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.vo</code></li> <li>263 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/NMake.glob</code></li> <li>211 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.vo</code></li> <li>209 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.vo</code></li> <li>200 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.glob</code></li> <li>197 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.glob</code></li> <li>197 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.glob</code></li> <li>189 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.vo</code></li> <li>181 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.glob</code></li> <li>177 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.vo</code></li> <li>151 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.glob</code></li> <li>145 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigQ/QMake.glob</code></li> <li>138 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.vo</code></li> <li>116 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigNumPrelude.vo</code></li> <li>116 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.glob</code></li> <li>101 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.vo</code></li> <li>96 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.vo</code></li> <li>92 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.vo</code></li> <li>87 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.glob</code></li> <li>80 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.vo</code></li> <li>74 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.glob</code></li> <li>72 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.glob</code></li> <li>69 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.glob</code></li> <li>69 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/<API key>.cmxs</code></li> <li>68 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigNumPrelude.glob</code></li> <li>62 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.glob</code></li> <li>61 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.glob</code></li> <li>60 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.vo</code></li> <li>56 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.vo</code></li> <li>55 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.v</code></li> <li>52 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/NMake.v</code></li> <li>48 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.v</code></li> <li>37 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.glob</code></li> <li>35 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigQ/QMake.v</code></li> <li>35 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.glob</code></li> <li>33 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.v</code></li> <li>31 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.glob</code></li> <li>28 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.v</code></li> <li>24 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.v</code></li> <li>21 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.v</code></li> <li>20 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.v</code></li> <li>19 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.v</code></li> <li>16 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.v</code></li> <li>16 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.glob</code></li> <li>13 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/BigN.glob</code></li> <li>13 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.v</code></li> <li>13 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigNumPrelude.v</code></li> <li>12 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.v</code></li> <li>12 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.v</code></li> <li>12 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.glob</code></li> <li>12 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.v</code></li> <li>11 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.v</code></li> <li>9 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/<API key>.cmi</code></li> <li>9 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/<API key>.cmx</code></li> <li>7 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.v</code></li> <li>6 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.v</code></li> <li>6 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigN/BigN.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.v</code></li> <li>4 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/Bignums/<API key>.cmxa</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-bignums.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><API key>: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.11.1 / <API key> - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> <API key> <small> 8.10.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2021-04-06 21:49:33 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-04-06 21:49:33 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.11.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.11.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.11.1 Official release 4.11.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;http: license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/PersistentUnionFind&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: program verification&quot; &quot;keyword: union-find&quot; &quot;keyword: data structures&quot; &quot;keyword: Tarjan&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms&quot; ] authors: [ &quot;Jean-Christophe Filliâtre&quot; ] bug-reports: &quot;https://github.com/coq-contribs/<API key>/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/<API key>.git&quot; synopsis: &quot;Persistent Union Find&quot; description: &quot;&quot;&quot; Correctness proof of the Ocaml implementation of a persistent union-find data structure. See http: flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/<API key>/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action <API key>.8.10.0 coq.8.11.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.11.1). The following dependencies couldn&#39;t be met: - <API key> -&gt; coq &lt; 8.11~ -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base <API key>.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
// <API key>.hpp // Pods #ifndef <API key> #define <API key> #include <string> #include "ee/store/StoreFwd.hpp" namespace ee { namespace store { class AppleReceiptParser { public: AppleReceiptParser(); std::shared_ptr<AppleReceipt> parse(const std::string& receiptData); private: IMessageBridge& bridge_; }; } // namespace store } // namespace ee #endif /* <API key> */
package com.azure.resourcemanager.network; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.network.models.DdosProtectionPlan; import com.azure.resourcemanager.test.utils.TestUtilities; import com.azure.core.management.Region; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class <API key> extends <API key> { @Test public void <API key>() throws Exception { String ppName = <API key>("ddosplan", 15); DdosProtectionPlan pPlan = networkManager .ddosProtectionPlans() .define(ppName) .withRegion(locationOrDefault(Region.US_SOUTH_CENTRAL)) .<API key>(rgName) .withTag("tag1", "value1") .create(); Assertions.assertEquals("value1", pPlan.tags().get("tag1")); PagedIterable<DdosProtectionPlan> ppList = networkManager.ddosProtectionPlans().list(); Assertions.assertTrue(TestUtilities.getSize(ppList) > 0); ppList = networkManager.ddosProtectionPlans().listByResourceGroup(rgName); Assertions.assertTrue(TestUtilities.getSize(ppList) > 0); networkManager.ddosProtectionPlans().deleteById(pPlan.id()); ppList = networkManager.ddosProtectionPlans().listByResourceGroup(rgName); Assertions.assertTrue(TestUtilities.isEmpty(ppList)); } }
"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.random() assert kmeans.<API key>(num1, num2) == abs(num1-num2) def test_ndim_distance(): """Test to see if changing val by 1 does what it ought to do convert to float to integer because floating arithmetic makes testing analytic functions a mess""" rand = random.random point1 = [rand(), rand(), rand(), rand(), rand(), rand()] point2 = [point1[0]+1] + point1[1:] # just shift x to the right by 1 assert int(round(kmeans.<API key>(point1, point2))) == 1 def test_maxiters(): """ensure the iteration ceiling works""" # assert kmeans.should_iter([], [], iterations=29) == True assert kmeans.should_iter([], [], iterations=30) == False assert kmeans.should_iter([], [], iterations=31) == False def <API key>(): """ensure the correct number of dimensions""" dimensions = random.randrange(1, 100) k = random.randrange(1, 100) centroids = kmeans.random_centroids(k, dimensions) for centroid in centroids: assert len(centroid) == dimensions def <API key>(): """ensure that the average across each dimension is returned""" new_centroid = kmeans.iterated_centroid([[1, 1, 1], [2, 2, 2]],\ [[100, 200, 300]], [(0, 0), (1, 0)]) np.testing.assert_allclose(new_centroid, np.array([[1.5, 1.5, 1.5]]),\ rtol=1e-5)
const multiples = '(hundred|thousand|million|billion|trillion|quadrillion|quintillion|sextillion|septillion)' const here = 'fraction-tagger' // plural-ordinals like 'hundredths' are already tagged as Fraction by compromise const tagFractions = function (doc) { // hundred doc.match(multiples).tag('#Multiple', here) // half a penny doc.match('[(half|quarter)] of? (a|an)', 0).tag('Fraction', 'millionth') // nearly half doc.match('#Adverb [half]', 0).tag('Fraction', 'nearly-half') // half the doc.match('[half] the', 0).tag('Fraction', 'half-the') // two-halves doc.match('#Value (halves|halfs|quarters)').tag('Fraction', 'two-halves') // a fifth doc.match('a #Ordinal').tag('Fraction', 'a-quarter') // seven fifths doc.match('(#Fraction && /s$/)').lookBefore('#Cardinal+$').tag('Fraction') // one third of .. doc.match('[#Cardinal+ #Ordinal] of .', 0).tag('Fraction', 'ordinal-of') // 100th of doc.match('[(#NumericValue && #Ordinal)] of .', 0).tag('Fraction', 'num-ordinal-of') // a twenty fifth doc.match('(a|one) #Cardinal?+ #Ordinal').tag('Fraction', 'a-ordinal') // doc.match('(a|one) [#Ordinal]', 0).tag('Fraction', 'a-ordinal') // values.if('#Ordinal$').tag('Fraction', '4-fifths') // seven quarters // values.tag('Fraction', '4-quarters') // doc.match('(#Value && !#Ordinal)+ (#Ordinal|#Fraction)').tag('Fraction', '4-fifths') // 12 and seven fifths // doc.match('#Value+ and #Value+ (#Ordinal|half|quarter|#Fraction)').tag('Fraction', 'val-and-ord') // fixups // doc.match('#Cardinal+? (second|seconds)').unTag('Fraction', '3 seconds') // doc.match('#Ordinal (half|quarter)').unTag('Fraction', '2nd quarter') // doc.match('#Ordinal #Ordinal+').unTag('Fraction') // doc.match('[#Cardinal+? (second|seconds)] of (a|an)', 0).tag('Fraction', here) // doc.match(multiples).tag('#Multiple', here) // // '3 out of 5' doc.match('#Cardinal+ out? of every? #Cardinal').tag('Fraction', here) // // one and a half // doc.match('#Cardinal and a (#Fraction && #Value)').tag('Fraction', here) // fraction - 'a third of a slice' // TODO:fixme // m = doc.match(`[(#Cardinal|a) ${ordinals}] of (a|an|the)`, 0).tag('Fraction', 'ord-of') // tag 'thirds' as a ordinal // m.match('.$').tag('Ordinal', 'plural-ordinal') return doc } module.exports = tagFractions
window._skel_config = { prefix: 'css/style', preloadStyleSheets: true, resetCSS: true, boxModel: 'border', grid: { gutters: 30 }, breakpoints: { wide: { range: '1200-', containers: 1140, grid: { gutters: 50 } }, narrow: { range: '481-1199', containers: 960 }, mobile: { range: '-480', containers: 'fluid', lockViewport: true, grid: { collapse: true } } } }; $(document).ready(function () { $("#calculate").click(function () { var opOne = $("#opOneID").val(); var opTwo = $("#opTwoID").val(); var selected = $('#mathFunction :selected').val(); if (opOne.length != 0) { $("#resultID").val(process(selected, opOne, opTwo)); // puts the result into the correct dom element resultID on the page. } else if (opTwo.length != 0) { $("#resultID").val(process(selected, opOne, opTwo)); // puts the result into the correct dom element resultID on the page. } }); $("#clear").click(function () { $("#opOneID").val(''); $("#opTwoID").val(''); $("#resultID").val(''); }); $("#pnlRemove").click(function () { /* this function remove the fron panelof the cube so you can see inside and changes the bottom image which is the manchester United chrest with the image that ] was the front panel image] this only shows the panels being changed by using code*/ var imageName = 'img/v8liv.PNG'; var changepnl = $('#btmpnl'); var pnlID = $('#v8front'); $(pnlID).hide(); // hide the front panel $('#btmpnl').attr('src', imageName); // change the bottom image to v8rear.PNG }); $('#mathFunction :selected').val(); $('#mathFunction').change(function () { /* this fucntion calls the calucate funtion with the number to be converted with the conversion type which comes from the select tag, eg pk is pounds to kilo's this function fires when the select dropdown box changes */ var opOne = $("#opOneID").val(); var opTwo = $("#opTwoID").val(); var selected = $('#mathFunction :selected').val(); // console.log($('#conversion :selected').val()); //write it out to the console to verify what was $("#resultID").val(process(selected, opOne,opTwo)); // puts the convertion into the correct dom element on the page. }).change(); }); function process(selected, opOne,opTwo) { switch (selected) { case "+": return Calc.AddNo(opOne,opTwo); break; case "-": return Calc.SubNo(opOne, opTwo); break; case "/": return Calc.DivideNo(opOne, opTwo); break; case "*": return Calc.MultplyNo(opOne, opTwo); break; default: return "Error ! "; // code to be executed if n is different from case 1 and 2 } }
(function(app, undefined) { 'use strict'; if(!app) throw new Error('Application "app" namespace not found.'); console.log( 'hello world' ); console.log( 'Application Running...' ); // @begin: renders app.render.jquery(); app.render.vanilla(); // @end: renders // @begin: to_jquery app.to_jquery.run(); // @end: to_jquery // @begin: mustache app.menu.render(); app.menu.option.reset(); // @begin: mustache })(window.app);
{-# LANGUAGE CPP #-} module Database.Orville.PostgreSQL.Plan.Explanation ( Explanation , noExplanation , explainStep , explanationSteps ) where newtype Explanation = Explanation ([String] -> [String]) #if MIN_VERSION_base(4,11,0) instance Semigroup Explanation where (<>) = appendExplanation #endif instance Monoid Explanation where mempty = noExplanation mappend = appendExplanation appendExplanation :: Explanation -> Explanation -> Explanation appendExplanation (Explanation front) (Explanation back) = Explanation (front . back) noExplanation :: Explanation noExplanation = Explanation id explainStep :: String -> Explanation explainStep str = Explanation (str:) explanationSteps :: Explanation -> [String] explanationSteps (Explanation prependTo) = prependTo []
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace KUI.Controls { public class FlatAccentButton : FlatButton { protected override void OnPaintBackground(PaintEventArgs pevent) { pevent.Graphics.FillRectangle( MouseOver ? Theme.ForeBrush : Theme.AccentBrush, ClientRectangle); } public override void DrawShadow(Graphics g) { if (HasShadow) { for (int i = 0; i < ShadowLevel; i++) { g.DrawRectangle( new Pen(Theme.AccentColor.Shade(Theme.ShadowSize, i)), ShadeRect(i)); } } } } }
// crm114_config.h -- Configuration for CRM114 library. // This file is part of the CRM114 Library. // The CRM114 Library is free software: you can redistribute it and/or modify // (at your option) any later version. // The CRM114 Library is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // Derived from engine version of crm114_config.h. // Some things here you can change with relative impunity. // Other things, not so much. Where there are limiting factors // noted, please obey them or you may break something important. // And, of course, realize that this is LGPLed software with #ifndef __CRM114_CONFIG_H__ #define __CRM114_CONFIG_H__ // Do you want all the classifiers? Or just the "production // ready ones"? Comment the next line out if you want everything. //#define <API key> // As used in the library: #define <API key> 1024 #define CLASSNAME_LENGTH 31 #define <API key> 2 #define DEFAULT_CLASS_SIZE (1<<23) // 8 megabytes // Markov family config // do we use Sparse Binary Polynomial Hashing (sensitive to both // sequence and spacing of individual words), Token Grab Bag, or // Token Sequence Sensitive? Testing against the SpamAssassin // "hard" database shows that SBPH, TGB, and TGB2, are somewhat // more accurate than TSS, and about 50% more accurate than First // Order Only. However, that's for English, and other natural // languages may show a different statistical distribution. // Choose ONE of the following: // SBPH, TGB2, TGB, TSS, or <API key>: // samples of text if you change this. // Sparse Binary Polynomial Hashing #define SBPH // Token Grab Bag, noaliasing //#define TGB2 // Token Grab Bag, aliasing //#define TGB // Token Sequence Sensitive //#define TSS // First Order Only (i.e. single words, like SpamBayes) // Note- if you use FOO, you must turn off weights!! //#define FOO // Generalized format for the window length. // DO NOT SET THIS TO MORE THAN 10 WITHOUT LENGTHENING hctable // the classifier modules !!!!!! "hctable" contains the pipeline // hashing coefficients and needs to be extended to 2 * WINDOW_LEN // Generic window length code //#define <API key> #define <API key> 5 #define <API key> 5 // DO NOT set this to more than 5 without lengthening the // htup1 and htup2 tables in crm_unified_bayes.c #define <API key> 5 // Unified tokenization pipeline length. // maximum window length _ever_. #define UNIFIED_WINDOW_MAX 32 // maximum number of iterations or phases of a pipeline, // maximum number of rows in a matrix of coefficients #define UNIFIED_ITERS_MAX 64 // Now, choose whether we want to use the "old" or the "new" local // probability calculation. The "old" one works slightly better // for SBPH and much better for TSS, the "new" one works slightly // better for TGB and TGB2, and _much_ better for FOO // The current default (not necessarily optimal) // is Markovian SBPH, <API key>, // LOCAL_PROB_DENOM = 16, and SUPER_MARKOV //#define LOCAL_PROB_DENOM 2.0 #define LOCAL_PROB_DENOM 16.0 //#define LOCAL_PROB_DENOM 256.0 #define <API key> //#define <API key> //#define ENTROPIC_WEIGHTS //#define MARKOV_WEIGHTS #define <API key> //#define <API key> //#define <API key> //#define BCS_MWS_WEIGHTS //#define BCS_EXP_WEIGHTS // Do we take only the maximum probability feature? //#define USE_PEAK // Should we use stochastic microgrooming, or weight-distance microgrooming- // Make sure ONE of these is turned on. //#define STOCHASTIC_AMNESIA #define <API key> #if (! defined (STOCHASTIC_AMNESIA) && ! defined (<API key>)) #error Neither STOCHASTIC_AMNESIA nor <API key> defined #elif (defined (STOCHASTIC_AMNESIA) && defined (<API key>)) #error Both STOCHASTIC_AMNESIA and <API key> defined #endif // define the default max chain length in a .css file that triggers // autogrooming, the rescale factor when we rescale, and how often // we rescale, and what chance (mask and key) for any particular // slot to get rescaled when a rescale is triggered for that slot chain. //#define <API key> 1024 #define <API key> 256 //#define <API key> 64 #define <API key> .75 #define <API key> 0x0000000F #define <API key> 0x00000001 #define <API key> 32 // maximum number of buckets groom-zeroed // define the default number of buckets in a learning file hash table // (note that this should be a prime number, or at least one with a // lot of big factors) // this value (2097153) is one more than 2 megs, for a .css of 24 megs //#define <API key> 2097153 // this value (1048577) is one more than a meg, for a .css of 12 megs // for the Markovian, and half that for OSB classifiers #define <API key> 1048577 #define <API key> 1048577 #define <API key> 524287 // Mersenne prime // How big is a feature bucket? Is it a byte, a short, a long, // a float, whatever. :) //#define <API key> 32767 #define <API key> 1000000000 #define <API key> 4096 // end Markov family config // define default internal debug level #define <API key> 0 // define default user debug level #define <API key> 0 / // Winnow algorithm parameters here... #define <API key> 5 #define <API key> 1.23 #define OSB_WINNOW_DEMOTION 0.83 #define <API key> 1048577 // For the hyperspace matcher, we need to define a few things. //#define <API key> 1000000 #define <API key> 100 // Stuff for bit-entropic configuration // Define the size of our alphabet, and how many bits per alph. #define <API key> 2 #define ENTROPY_CHAR_SIZE 1 #define <API key> 0x1 // What fraction of the nodes in a bit-entropic file should be // referenceable from the FIR prior arithmetical encoding // lookaside table? 0.01 is 1% == average of 100 steps to find // the best node. 0.2 is 20% or 5 steps to find the best node. #define <API key> 0.1 #define <API key> 128 #define <API key> 0.5 #define <API key> 1024 // was 256 #define <API key> 1024 // was 256 #define <API key> 0.0000000000000000001 //#define <API key> 2000000 #define <API key> 1000000 // Defines for the svm classifier // All defines you should want to use without getting into // the nitty details of the SVM are here. For nitty detail // defines, see crm114_matrix_util.h, <API key>.h, // crm114_matrix.h, and <API key>.h #define MAX_SVM_FEATURES 100000 //per example #define <API key> 3 //the debug level when <API key> is #define SVM_ACCURACY 1e-3 //The accuracy to which to run the solver //This is the average margin violation NOT //accounted for by the slack variable. #define SV_TOLERANCE 0.01 //An example is a support vector if //theta*y*x <= 1 + SV_TOLERANCE. //The smaller SV_TOLERANCE, the fewer //examples will be tagged as support //vectors. This will make it faster to //learn new examples, but possibly less //accurate. #define SVM_ADD_CONSTANT 1 //Define this to be 1 if you want a //constant offset in the classification //ie h(x) = theta*x + b where b is //the offset. If you don't want //a constant offset (just h(x) = theta*x), //define this to be 0. #define SVM_HOLE_FRAC 0.25 //Size of the "hole" left at the end of //the file to allow for quick appends //without having to forcibly unmap the //file. This is as a fraction of the //size of the file without the hole. So //setting it to 1 doubles the file size. //If you don't want a hole left, set //this to 0. #define <API key> 200 //absolute maximum number of loops the //solver is allowed #define SVM_CHECK 100 //every SVM_CHECK we look to see if //the accuracy is better than //SVM_CHECK_FACTOR*SVM_ACCURACY. //If it is, we exit the solver loop. #define SVM_CHECK_FACTOR 2 //every SVM_CHECK we look to see if //the accuracy is better than //SVM_CHECK_FACTOR*SVM_ACCURACY. //If it is, we exit the solver loop. //defines for SVM microgrooming #define SVM_GROOM_OLD 10000 //we groom only if there are this many //examples (or more) not being used in //solving #define SVM_GROOM_FRAC 0.9 //we keep this fraction of examples after //grooming //defines for svm_smart_mode #define SVM_BASE_EXAMPLES 1000 //the number of examples we need to see //before we train #define SVM_INCR_FRAC 0.1 //if more than this fraction of examples //are appended, we do a fromstart rather //than use the incremental method. // Defines for the PCA classifier // All defines you should want to use without getting into // the nitty details of the PCA are here. For nitty detail // defines, see crm114_matrix_util.h and <API key>.h #define <API key> 3 //the debug level when <API key> is on #define PCA_ACCURACY 1e-8 //accuracy to which to run the solver #define MAX_PCA_ITERATIONS 1000 //maximum number of solver iterations #define PCA_CLASS_MAG 50 //the starting class magnitudes. if this //is too small, the solver will double it //and resolve. if it is too large, the //solver will be less accurate. #define PCA_REDO_FRAC 0.001 //if we get this fraction of training //examples wrong with class mag enabled, we //retrain with class mag doubled. #define PCA_MAX_REDOS 20 //The maximum number of redos allowed when //trying to find the correct class mag. #define PCA_HOLE_FRAC 0.25 //Size of the "hole" left at the end of //the file to allow for quick appends //without having to forcibly unmap the file. //This is as a fraction of the size of the //file without the hole. So setting it to //1 doubles the file size. If you don't //want a hole left, set this to 0. //defines for PCA microgrooming #define PCA_GROOM_OLD 10000 //we groom only if there are this many //examples (or more) present #define PCA_GROOM_FRAC 0.9 //we keep this fraction of examples after //grooming // DANGER DANGER DANGER DANGER DANGER // CHANGE THESE AT YOUR PERIL- YOUR .CSS FILES WILL NOT BE // FORWARD COMPATIBLE WITH ANYONE ELSES IF YOU CHANGE THESE. // how many classes per datablock can the library support? #define CRM114_MAX_CLASSES 128 // FSCM uses two blocks / class #define CRM114_MAX_BLOCKS (2 * CRM114_MAX_CLASSES) // Maximum length of a stored regex (ugly! But we need a max length // in the mapping. GROT GROT GROT ) #define MAX_REGEX 4096 END OF DANGER DANGER DANGER DANGER // Improved FSCM-specific parameters // this is 2^18 + 1 // This determines the tradeoff in memory vs. speed/accuracy. //define <API key> 262145 // This is 1 meg + 1 #define <API key> 1048577 // How long are our prefixes? Original prefix was 3 but that's // rather suboptimal for best speed. 6 looks pretty good for speed and // accuracy. // prefix length 6 and thickness 10 (200 multiplier) yields 29 / 4147 //#define <API key> 3 #define <API key> 6 // The chain cache is a speedup for the FSCM match // It's indexed modulo the chainstart, with associativity 1.0 #define <API key> <API key> // How much space to start out initially for the forwarding index area #define <API key> 1048577 // Neural Net parameters #define NN_RETINA_SIZE 8192 #define NN_FIRST_LAYER_SIZE 8 #define <API key> 8 // Neural Net training setups // Note- convergence seems to work well at // alpha 0.2 init_noise 0.5 stoch_noise 0.1 gain_noise 0.00000001 // alpha 0.2 init_noise 0.2 stoch_noise 0.1 gain_noise 0.00000001 // alpha 0.2 init_noise 0.2 stoch_noise 0.05 gain_noise 0.00000001 // alpha 0.2 init_noise 0.2 stoch_noise 0.05 gain_noise 0.00000001 // alpha 0.2 init_noise 0.2 stoch_noise 0.05 gain_noise 2.0 // alpha 0.2 init_noise 0.2 stoch_noise 0.05 gain_noise 2.0 zerotr 0.9999 #define NN_DEFAULT_ALPHA 0.2 // Initialization noise magnitude #define <API key> 0.2 // Stochastic noise magnitude #define <API key> 0.05 // Gain noise magnitude #define <API key> 2.0 // Zero-tracking factor - factor the weights move toward zero every epoch #define NN_ZERO_TRACKING 0.9999 // Threshold for back propagation #define <API key> 0.1 // Just use 1 neuron excitation per token coming in. #define NN_N_PUMPS 1 // How many training cycles before we punt out #define <API key> 500 // When doing a "nuke and retry", allow this many training cycles. #define <API key> 5000 // How often do we cause a punt (we punt every 0th epoch modulo this number) #define <API key> 10000000 // After how many "not needed" cycles do we microgroom this doc away? #define <API key> 1000000 // use the sparse retina design? No, it's not good. #define NN_SPARSE_RETINA 0 // End of configurable parameters. #endif // !__CRM114_CONFIG_H__
using MortgageCalc.Models; using System; using System.Collections.Generic; namespace MortgageCalc.Calculators { public class <API key> { private RateCalc _calc = new RateCalc(6); // initialize with 6 decimal places private decimal _monthlyPayment; private decimal _principal; private decimal _rate; private int _term; public <API key>(decimal principal, decimal rate, int term) { this._principal = principal; this._rate = rate; this._term = term; this._monthlyPayment = this._calc.Interest(principal, rate); } public Schedule Schedule() { return new Schedule { MonthlyPayment = Math.Round(this._monthlyPayment, 2), CostOfCredit = Math.Round(this._monthlyPayment * this._term, 2) }; } } }
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> <title>grapp-core-ajax tests</title> <script src="../lib/<API key>/browser.js"></script> </head> <body> <script> WCT.loadSuites([ 'basic.html', ]); </script> <script src="//localhost:35729/livereload.js"></script> </body> </html>
import Ember from 'ember'; import CheckboxMixin from '../mixins/checkbox-mixin'; export default Ember.Component.extend(CheckboxMixin, { type: 'checkbox', checked: false, onChange: function() { this.set('checked', this.$('input').prop('checked')); this.sendAction("action", { checked: this.get('checked'), value: this.get('value') }); } });
@<API key> package org.zalando.problem.spring.web.advice; import javax.annotation.<API key>;
<?php use Stringizer\Stringizer; /** * Date Unit Tests */ class DateTest extends <API key> { public function testValidDate() { <API key>('America/Vancouver'); $s = new Stringizer("January 1st"); $this->assertEquals(true, $s->isDate()); $s = new Stringizer("2015-03-15"); $this->assertEquals(true, $s->isDate()); $s = new Stringizer("1 week ago"); $this->assertEquals(true, $s->isDate()); } public function testInValidDate() { <API key>('America/Vancouver'); $s = new Stringizer("Bad Date Input"); $this->assertEquals(false, $s->isDate()); } }
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'jtn=n8&nq9jgir8_z1ck40^c1s22d%=)z5qsm*q(bku*_=^sg&' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.<API key>, 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.<API key>', ] ROOT_URLCONF = 'ross.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'ross.wsgi.application' # Database DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation <API key> = [ { 'NAME': 'django.contrib.auth.password_validation.<API key>', }, { 'NAME': 'django.contrib.auth.password_validation.<API key>', }, { 'NAME': 'django.contrib.auth.password_validation.<API key>', }, { 'NAME': 'django.contrib.auth.password_validation.<API key>', }, ] # <API key> LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) STATIC_URL = '/static/'
//worldgenerator.cs //Project VoxelEngine using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Text; using VoxelEngine.Game.Blocks; using VoxelEngine.GameConsole; using VoxelEngine.Utility; namespace VoxelEngine.Game { public class WorldGenerator { private World mWorldRef; public WorldGenerator(World worldRef) { this.mWorldRef = worldRef; } public Chunk GenerateChunk(int xp, int yp, int zp) { Chunk chunk = null; chunk = new Chunk(new Vector3(xp, yp, zp)); Vector3 chunkPosBlock = new Vector3(xp, yp, zp) * Chunk.CHUNK_SIZE; int treeDensity = 2; float stoneBaseHeight = 0; float stoneBaseNoise = 0.05f; float <API key> = 4; float stoneMountainHeight = 48; float <API key> = 0.008f; float stoneMinHeight = -12; float dirtBaseHeight = 1; float dirtNoise = 0.04f; float dirtNoiseHeight = 3; for (int x = (int)chunkPosBlock.X - 5; x < chunkPosBlock.X + Chunk.CHUNK_SIZE + 5; x++) { for(int z = (int)chunkPosBlock.Z - 5; z < chunkPosBlock.Z + Chunk.CHUNK_SIZE + 5; z++) { int stoneHeight = (int)Math.Floor(stoneBaseHeight); stoneHeight += (int)Math.Floor(GetNoiseValue(x, 0, z, <API key>, (int)(stoneMountainHeight))); if (stoneHeight < stoneMinHeight) stoneHeight = (int)Math.Floor((stoneMinHeight)); stoneHeight += (int)Math.Floor(GetNoiseValue(x, 0, z, stoneBaseNoise, (int)(<API key>))); int dirtHeight = stoneHeight + (int)(dirtBaseHeight); dirtHeight += (int)Math.Floor(GetNoiseValue(x, 100, z, dirtNoise, (int)(dirtNoiseHeight))); for (int y = (int)chunkPosBlock.Y - 10; y < chunkPosBlock.Y+Chunk.CHUNK_SIZE + 10; y++) { //from world block space to local chunk space int xfactor = (int)chunkPosBlock.X; int yfactor = (int)chunkPosBlock.Y; int zfactor = (int)chunkPosBlock.Z; if (y <= stoneHeight) chunk.SetBlock(x-xfactor, y-yfactor, z-zfactor, new Block(BlockType.Stone)); else if (y <= dirtHeight) { chunk.SetBlock(x - xfactor, y - yfactor, z - zfactor, new Block(BlockType.Grass)); if (y == dirtHeight && GetNoiseValue(x, 0, z, 0.2f, 100) < treeDensity) { //CreateTree(x, y, z); } } } } } //chunk.ApplySunlight(); return chunk; } public Chunk GenerateChunk(Vector3 position) { return GenerateChunk((int)position.X, (int)position.Y, (int)position.Z); } private void CreateTree(int x, int y, int z) { //TODO: //major performance hit here... //fix.. Random random = new Random(); int trunkLength = random.Next(5, 10); for(int yy = y; yy < y + trunkLength; yy++) { mWorldRef.SetBlock(x, yy+1, z, new Block(BlockType.Log)); } int leavesStart = y+trunkLength; for(int xi = -3; xi <= 3; xi++) { for(int yi = 0; yi <= 1; yi++) { for(int zi = -3; zi <= 3; zi++) { mWorldRef.SetBlock(x + xi, leavesStart + yi, z + zi, new Block(BlockType.Leaves)); } } } for(int xi = -2; xi <= 2; xi++) { for(int zi = -2; zi <= 2; zi++) { mWorldRef.SetBlock(x + xi, leavesStart + 2, z + zi, new Block(BlockType.Leaves)); } } mWorldRef.SetBlock(x - 1, leavesStart + 3, z, new Block(BlockType.Leaves)); mWorldRef.SetBlock(x + 1, leavesStart + 3, z, new Block(BlockType.Leaves)); mWorldRef.SetBlock(x, leavesStart + 3, z - 1, new Block(BlockType.Leaves)); mWorldRef.SetBlock(x, leavesStart + 3, z + 1, new Block(BlockType.Leaves)); } private int GetNoiseValue(int x, int z, float scale, int max) { int value = (int)((Noise.Generate(x*scale, 0, z*scale)) * (max / 2f)); return value; } private float GetNoiseValue(int x, int y, int z, float scale, int max) { int value = (int)Math.Floor((Noise.Generate(x * scale, y * scale, z * scale) + 1f) * (max / 2f)); return value; } } }
"use strict" var express = require('express'); var app = express(); var elasticsearch = require('elasticsearch'); var client = new elasticsearch.Client({ host: 'localhost:9200', log: 'trace' }); var router = express.Router(); router.get('/accidents', function(req, res) { var query = { index: 'wildmap', type: 'accidents', size: 10000, body: { query: { bool: { must: [ { match_all: {} } ] } } } } var animal_type = req.query.animal_type; var day_type = req.query.day_type; var season = req.query.season; if(animal_type && animal_type!="all"){ query.body.query.bool.must.push({ term: { "accidents.pin.animal_type": animal_type } }); } if(day_type && day_type!="all"){ query.body.query.bool.must.push({ term: { "accidents.pin.day_type": day_type } }); } if(season && season!="all"){ query.body.query.bool.must.push({ term: { "accidents.pin.season": season } }); } console.log(query); client.search(query).then(function (resp) { console.log(resp.hits.hits); var response = resp.hits.hits.map(function(e){ return e._source.pin; }) res.send(response); }, function (err) { console.log(err.message); res.status(500).end(); }); }); app.use('/api', router); var port = process.env.PORT || 8080; app.listen(port); console.log("Backend is running on port " + port);
var generatetask = require('../source/ajgenesis/tasks/generate'), createtask = require('../create'), path = require('path'), fs = require('fs'), ajgenesis = require('ajgenesis'); exports['generate'] = function (test) { test.async(); var cwd = process.cwd(); process.chdir('test'); var model = ajgenesis.loadModel(); test.ok(model.entities); test.ok(Array.isArray(model.entities)); test.equal(model.entities.length, 4); if (fs.existsSync('build') && !fs.existsSync(path.join('build', 'development.db'))) removeDirSync('build'); ajgenesis.createDirectory('build'); process.chdir('build'); generatetask(model, [], ajgenesis, function (err, result) { test.equal(err, null); test.equal(result, null); test.ok(fs.existsSync('app.rb')); test.ok(fs.existsSync('public')); //test.ok(fs.existsSync(path.join('views', 'index.erb'))); test.ok(fs.existsSync('views')); test.ok(fs.existsSync(path.join('views', 'customerlist.erb'))); test.ok(fs.existsSync(path.join('views', 'customernew.erb'))); test.ok(fs.existsSync(path.join('views', 'customerview.erb'))); test.ok(fs.existsSync(path.join('views', 'customeredit.erb'))); test.ok(fs.existsSync(path.join('views', 'supplierlist.erb'))); test.ok(fs.existsSync(path.join('views', 'suppliernew.erb'))); test.ok(fs.existsSync(path.join('views', 'supplierview.erb'))); test.ok(fs.existsSync(path.join('views', 'supplieredit.erb'))); test.ok(fs.existsSync(path.join('views', 'departmentlist.erb'))); test.ok(fs.existsSync(path.join('views', 'departmentnew.erb'))); test.ok(fs.existsSync(path.join('views', 'departmentview.erb'))); test.ok(fs.existsSync(path.join('views', 'departmentedit.erb'))); test.ok(fs.existsSync(path.join('views', 'employeelist.erb'))); test.ok(fs.existsSync(path.join('views', 'employeenew.erb'))); test.ok(fs.existsSync(path.join('views', 'employeeview.erb'))); test.ok(fs.existsSync(path.join('views', 'employeeedit.erb'))); test.ok(fs.existsSync(path.join('entities'))); test.ok(fs.existsSync(path.join('entities', 'customer.rb'))); test.ok(fs.existsSync(path.join('entities', 'supplier.rb'))); test.ok(fs.existsSync(path.join('entities', 'department.rb'))); test.ok(fs.existsSync(path.join('entities', 'employee.rb'))); test.ok(fs.existsSync('controllers')); test.ok(fs.existsSync(path.join('controllers', 'customer.rb'))); test.ok(fs.existsSync(path.join('controllers', 'supplier.rb'))); test.ok(fs.existsSync(path.join('controllers', 'department.rb'))); test.ok(fs.existsSync(path.join('controllers', 'employee.rb'))); process.chdir(cwd); test.done(); }); } exports['generate in directory'] = function (test) { test.async(); var cwd = process.cwd(); process.chdir('test'); var model = ajgenesis.loadModel(); test.ok(model.entities); test.ok(Array.isArray(model.entities)); test.equal(model.entities.length, 4); model.builddir = 'build'; if (fs.existsSync('build') && !fs.existsSync(path.join('build', 'development.db'))) removeDirSync('build'); generatetask(model, [], ajgenesis, function (err, result) { test.equal(err, null); test.equal(result, null); test.ok(fs.existsSync(path.join('build', 'app.rb'))); test.ok(fs.existsSync(path.join('build', 'public'))); test.ok(fs.existsSync(path.join('build', 'views'))); //test.ok(fs.existsSync(path.join('views', 'index.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customerlist.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customernew.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customerview.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customeredit.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'supplierlist.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'suppliernew.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'supplierview.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'supplieredit.erb'))); test.ok(fs.existsSync(path.join('build', 'entities'))); test.ok(fs.existsSync(path.join('build', 'entities', 'customer.rb'))); test.ok(fs.existsSync(path.join('build', 'entities', 'supplier.rb'))); test.ok(fs.existsSync(path.join('build', 'entities', 'department.rb'))); test.ok(fs.existsSync(path.join('build', 'entities', 'employee.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'customer.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'supplier.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'department.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'employee.rb'))); process.chdir(cwd); test.done(); }); } exports['create and generate'] = function (test) { test.async(); var cwd = process.cwd(); process.chdir('test'); var model = ajgenesis.loadModel(); test.ok(model.entities); test.ok(Array.isArray(model.entities)); test.equal(model.entities.length, 4); if (fs.existsSync('build') && !fs.existsSync(path.join('build', 'development.db'))) removeDirSync('build'); createtask(null, ['build'], ajgenesis, function (err, result) { test.equal(err, null); test.ok(fs.existsSync('build')); model.builddir = 'build'; generatetask(model, [], ajgenesis, function (err, result) { test.equal(err, null); test.equal(result, null); test.ok(fs.existsSync(path.join('build', 'app.rb'))); test.ok(fs.existsSync(path.join('build', 'public'))); test.ok(fs.existsSync(path.join('build', 'views'))); test.ok(fs.existsSync(path.join('build', 'views', 'index.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customerlist.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customernew.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customerview.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'customeredit.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'supplierlist.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'suppliernew.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'supplierview.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'supplieredit.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'departmentlist.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'departmentnew.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'departmentview.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'departmentedit.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'employeelist.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'employeenew.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'employeeview.erb'))); test.ok(fs.existsSync(path.join('build', 'views', 'employeeedit.erb'))); test.ok(fs.existsSync(path.join('build', 'entities'))); test.ok(fs.existsSync(path.join('build', 'entities', 'customer.rb'))); test.ok(fs.existsSync(path.join('build', 'entities', 'supplier.rb'))); test.ok(fs.existsSync(path.join('build', 'entities', 'department.rb'))); test.ok(fs.existsSync(path.join('build', 'entities', 'employee.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'customer.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'supplier.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'department.rb'))); test.ok(fs.existsSync(path.join('build', 'controllers', 'employee.rb'))); process.chdir(cwd); test.done(); }); }); } function removeDirSync(dirname) { var filenames = fs.readdirSync(dirname); filenames.forEach(function (filename) { filename = path.join(dirname, filename); if (isDirectory(filename)) removeDirSync(filename); else removeFileSync(filename); }); fs.rmdirSync(dirname); } function removeFileSync(filename) { fs.unlinkSync(filename); } function isDirectory(filename) { try { var stats = fs.lstatSync(filename); return stats.isDirectory(); } catch (err) { return false; } }
#include <math.h> #include <stdio.h> #include <pthread.h> #include <stdlib.h> #define THREAD_COUNT 4 typedef struct { int start; int end; } range_t; void *calculate_range(void* range) { range_t* curr_range = (range_t*)range; void* result = (void*)1; for (int i = curr_range->start; i < curr_range->end; i++) { double a = cos(i) * cos(i) + sin(i) * sin(i); if (a > 1.0005 || a < 0.9995) { result = (void*)0; } } free(curr_range); return result; } int main() { pthread_t threads[THREAD_COUNT]; int arg_start = 0; for (int i = 0; i < THREAD_COUNT; i++) { range_t *curr_range = (range_t*)malloc(sizeof(range_t)); curr_range->start = arg_start; curr_range->end = arg_start + 25000000; int res = pthread_create(&threads[i], NULL, calculate_range, curr_range); if (res != 0) { perror("Could not spawn new thread"); exit(-1); } arg_start = curr_range->end; } long final_result = 1; for (int i = 0; i < THREAD_COUNT; i++) { void *thread_result; int res = pthread_join(threads[i], (void **)&thread_result); if (res != 0) { perror("Could not spawn thread"); exit(-1); } final_result <<= (long)thread_result; } if (final_result & (1 << 4)) { printf("OK!\n"); } else { printf("Not OK!\n"); } return 0; }
package com.virtualfactory.screen.layer.components; import de.lessvoid.nifty.Nifty; import de.lessvoid.nifty.<API key>; import de.lessvoid.nifty.controls.ButtonClickedEvent; import de.lessvoid.nifty.controls.Controller; import de.lessvoid.nifty.controls.window.WindowControl; import de.lessvoid.nifty.elements.Element; import de.lessvoid.nifty.elements.render.ImageRenderer; import de.lessvoid.nifty.input.NiftyInputEvent; import de.lessvoid.nifty.render.NiftyImage; import de.lessvoid.nifty.screen.Screen; import de.lessvoid.nifty.tools.SizeValue; import de.lessvoid.xml.xpp3.Attributes; import com.virtualfactory.engine.GameEngine; import com.virtualfactory.utils.CommonBuilders; import com.virtualfactory.utils.Pair; import java.util.Properties; /** * * @author David */ public class <API key> implements Controller { private Nifty nifty; private Screen screen; private WindowControl winControls; private boolean isVisible; private GameEngine gameEngine; final CommonBuilders common = new CommonBuilders(); private NiftyImage flowChartImage; @Override public void bind( final Nifty nifty, final Screen screen, final Element element, final Properties parameter, final Attributes <API key>) { this.nifty = nifty; this.screen = screen; this.winControls = screen.findNiftyControl("winFlowChartControl", WindowControl.class); Attributes x = new Attributes(); x.set("hideOnClose", "true"); this.winControls.bind(nifty, screen, winControls.getElement(), null, x); isVisible = false; } public boolean isIsVisible() { return isVisible; } public void setIsVisible(boolean isVisible) { this.isVisible = isVisible; } @Override public void init(Properties parameter, Attributes <API key>) { } @Override public void onStartScreen() { } @Override public void onFocus(boolean getFocus) { } @Override public boolean inputEvent(final NiftyInputEvent inputEvent) { return false; } public void loadWindowControl(GameEngine game,int index, Pair<Integer,Integer> position){ this.gameEngine = game; if (index == -1){ winControls.getElement().setVisible(false); winControls.getContent().hide(); isVisible = false; }else{ winControls.getElement().setVisible(true); winControls.getContent().show(); isVisible = true; if (position != null){ if (winControls.getWidth() + position.getFirst() > gameEngine.jmonkeyApp.getGuiViewPort().getCamera().getWidth()) position.setFirst(gameEngine.jmonkeyApp.getGuiViewPort().getCamera().getWidth() - winControls.getWidth()); if (winControls.getHeight() + position.getSecond() > gameEngine.jmonkeyApp.getGuiViewPort().getCamera().getHeight()) position.setSecond(gameEngine.jmonkeyApp.getGuiViewPort().getCamera().getHeight() - winControls.getHeight()); winControls.getElement().setConstraintX(new SizeValue(position.getFirst() + "px")); winControls.getElement().setConstraintY(new SizeValue(position.getSecond() + "px")); winControls.getElement().getParent().layoutElements(); } winControls.getElement().setConstraintX(null); winControls.getElement().setConstraintY(null); } loadValues(index); } private void loadValues(int index){ if (index == -1){ flowChartImage = nifty.createImage("Models/Flows/none.png", false); screen.findElementByName("<API key>").getRenderer(ImageRenderer.class).setImage(flowChartImage); }else{ flowChartImage = nifty.createImage("Models/Flows/" + gameEngine.getGameData().getCurrentGame().getFlowImage(), false); screen.findElementByName("<API key>").getRenderer(ImageRenderer.class).setImage(flowChartImage); } } @<API key>(id="closeFlowChart") public void <API key>(final String id, final ButtonClickedEvent event) { gameEngine.<API key>(); loadWindowControl(gameEngine, -1, null); } }
const S$ = require('S$'); function loadSrc(obj, src) { throw src; } const cookies = S$.symbol('Cookie', ''); const world = {}; if (cookies) { if (/iPhone/.exec(cookies)) { loadSrc(world, '/resources/' + cookies); } loadSrc(world, '/resources/unknown'); } else { loadSrc(world, '/resources/fresh'); }
layout: post title: "Problem 2_0" modified: categories: /AcceleratedC++/ch2 excerpt: tags: [] image: feature: date: 2015-09-25T00:37:18-07:00 [Github Source](https://github.com/patricknyu/<API key>/tree/master/ch2/Question2_0) Q: Compile and run the program presented in this chapter. A: c++ #include <iostream> #include <string> // say what standard-library names we use using std::cin; using std::endl; using std::cout; using std::string; int main() { // ask for the person's name cout << "Please enter your first name: "; // read the name string name; cin >> name; // build the message that we intend to write const string greeting = "Hello, " + name + "!"; // the number of blanks surrounding the greeting const int pad = 1; // the number of rows and columns to write const int rows = pad * 2 + 3; const string::size_type cols = greeting.size() + pad * 2 + 2; // write a blank line to separate the output from the input cout << endl; // write rows rows of output // invariant: we have written r rows so far for (int r = 0; r != rows; ++r) { string::size_type c = 0; // invariant: we have written c characters so far in the current row while (c != cols) { // is it time to write the greeting? if (r == pad + 1 && c == pad + 1) { cout << greeting; c += greeting.size(); } else { // are we on the border? if (r == 0 || r == rows - 1 ||c == 0 || c == cols - 1) cout << "*"; else cout << " "; ++c; } } cout << endl; } return 0; }
module.exports = function (seneca, util) { //var Joi = util.Joi }
package Digivolver; public class Digivolution{ private Digimon digimon; private int minDp = 0; private int maxDp = 0; public boolean isWithinDp(int minDp, int maxDp){ return this.minDp<=maxDp && this.maxDp>=minDp; } public Digivolution(Digimon digimon, int minDp, int maxDp) { this.digimon = digimon; this.minDp = minDp; this.maxDp = maxDp; } public Digimon getDigimon() { return digimon; } public void setDigimon(Digimon digimon) { this.digimon = digimon; } public int getMinDp(){ return minDp; } public int getMaxDp(){ return maxDp; } }
import re import hashlib FNAME_MATCH = re.compile(r'/([^/]+)$') # From the last slash to the end of the string PREFIX = re.compile(r'([^:]+://)(/)?(.+)') # Check for a prefix like data:// def getParentAndBase(path): match = PREFIX.match(path) if match is None: if path.endswith('/'): stripped_path = path[:-1] else: stripped_path = path base = FNAME_MATCH.search(stripped_path) if base is None: raise ValueError('Invalid path') parent = FNAME_MATCH.sub('', stripped_path) return parent, base.group(1) else: prefix, leading_slash, uri = match.groups() parts = uri.split('/') parent_path = '/'.join(parts[:-1]) if leading_slash is not None: parent_path = '{prefix}/{uri}'.format(prefix=prefix, uri='/'.join(parts[:-1])) else: parent_path = '{prefix}{uri}'.format(prefix=prefix, uri='/'.join(parts[:-1])) return parent_path, parts[-1] def pathJoin(parent, base): if parent.endswith('/'): return parent + base return parent + '/' + base def md5_for_file(fname): hash_md5 = hashlib.md5() with open(fname, "rb") as f: for chunk in iter(lambda: f.read(4096), b""): hash_md5.update(chunk) return str(hash_md5.hexdigest()) def md5_for_str(content): hash_md5 = hashlib.md5() hash_md5.update(content.encode()) return str(hash_md5.hexdigest())
#ifndef VECTOR4_H #define VECTOR4_H #include "gamemath_internal.h" <API key> <API key> class <API key> Vector4 : public AlignedAllocation { friend class Matrix4; friend GAMEMATH_INLINE Vector4 operator +(const Vector4 &a, const Vector4 &b); friend GAMEMATH_INLINE Vector4 operator -(const Vector4 &a, const Vector4 &b); friend GAMEMATH_INLINE Vector4 operator *(const float, const Vector4 &vector); friend GAMEMATH_INLINE Vector4 operator *(const Vector4 &vector, const float); friend class Ray3d; friend class Box3d; public: Vector4(); Vector4(const float x, const float y, const float z, const float w); #if !defined(<API key>) Vector4(const __m128 value); #endif /** * Returns the x component of this vector. */ float x() const; /** * Returns the y component of this vector. */ float y() const; /** * Returns the z component of this vector. */ float z() const; /** * Returns the w component of this vector. Usually 1 means this is a position vector, while 0 * means this is a directional vector. */ float w() const; /** * Changes the X component of this vector. */ void setX(float x); /** * Changes the Y component of this vector. */ void setY(float y); /** * Changes the Z component of this vector. */ void setZ(float z); /** * Changes the W component of this vector. */ void setW(float w); /** * Computes the squared length of this vector. This method is significantly * faster than computing the normal length, since the square root can be omitted. */ float lengthSquared() const; /** * Computes this vector's length. */ float length() const; /** * Normalizes this vector by dividing its components by this vectors length. */ Vector4 &normalize(); /** * Normalizes using a reciprocal square root, which only has 11-bit precision. Use this if the * result doesn't need to be very precisely normalized. */ Vector4 &normalizeEstimated(); /** * Normalizes this vector and returns it in a new object, while leaving this object untouched. */ Vector4 normalized() const; /** * Computes the dot product between this and another vector. */ float dot(const Vector4 &vector) const; /** Returns the absolute of this vector. */ Vector4 absolute() const; /** Returns true if one of the components of this vector are negative or positive infinity. */ bool isInfinite() const; /** * Computes the three-dimensional cross product of two vectors, interpreting both vectors as directional vectors * (w=0). If either vector's w is not zero, the result may be wrong. * * @return this x vector */ Vector4 cross(const Vector4 &vector) const; /** * Adds another vector to this vector. */ Vector4 &operator +=(const Vector4 &vector); /** * Multiplies this vector with a scalar factor. * Only the x,y, and z components of the vector are multiplied. */ Vector4 &operator *=(const float factor); /** * Subtracts another vector from this vector. */ Vector4 &operator -=(const Vector4 &vector); /** * Returns a negated version of this vector, negating only the x, y, and z components. */ Vector4 operator -() const; #if !defined(<API key>) operator __m128() const; #endif /** Checks two vectors for equality. */ bool operator ==(const Vector4 &other) const; const float *data() const; float *data(); private: #if !defined(<API key>) union { struct { float mX; float mY; float mZ; float mW; }; __m128 mSse; }; #else float mX; float mY; float mZ; float mW; #endif // <API key> } <API key>; GAMEMATH_INLINE float Vector4::x() const { return mX; } GAMEMATH_INLINE float Vector4::y() const { return mY; } GAMEMATH_INLINE float Vector4::z() const { return mZ; } GAMEMATH_INLINE float Vector4::w() const { return mW; } GAMEMATH_INLINE void Vector4::setX(float x) { mX = x; } GAMEMATH_INLINE void Vector4::setY(float y) { mY = y; } GAMEMATH_INLINE void Vector4::setZ(float z) { mZ = z; } GAMEMATH_INLINE void Vector4::setW(float w) { mW = w; } GAMEMATH_INLINE const float *Vector4::data() const { return &mX; } GAMEMATH_INLINE float *Vector4::data() { return &mX; } <API key> #if !defined(<API key>) #include "vector4_sse.h" #else #include "vector4_sisd.h" #endif // <API key> #endif // VECTOR4_H
#include "tiledb/sm/query/query.h" #include "tiledb/common/heap_memory.h" #include "tiledb/common/logger.h" #include "tiledb/common/memory.h" #include "tiledb/sm/array/array.h" #include "tiledb/sm/enums/query_status.h" #include "tiledb/sm/enums/query_type.h" #include "tiledb/sm/fragment/fragment_metadata.h" #include "tiledb/sm/misc/parse_argument.h" #include "tiledb/sm/query/dense_reader.h" #include "tiledb/sm/query/global_order_writer.h" #include "tiledb/sm/query/ordered_writer.h" #include "tiledb/sm/query/query_condition.h" #include "tiledb/sm/query/reader.h" #include "tiledb/sm/query/<API key>.h" #include "tiledb/sm/query/<API key>.h" #include "tiledb/sm/query/unordered_writer.h" #include "tiledb/sm/rest/rest_client.h" #include "tiledb/sm/storage_manager/storage_manager.h" #include "tiledb/sm/tile/writer_tile.h" #include <cassert> #include <iostream> #include <sstream> using namespace tiledb::common; using namespace tiledb::sm::stats; namespace tiledb { namespace sm { /* CONSTRUCTORS & DESTRUCTORS */ Query::Query(StorageManager* storage_manager, Array* array, URI fragment_uri) : array_(array) , array_schema_(array-><API key>()) , layout_(Layout::ROW_MAJOR) , storage_manager_(storage_manager) , stats_(storage_manager_->stats()->create_child("Query")) , logger_(storage_manager->logger()->clone("Query", ++logger_id_)) , has_coords_buffer_(false) , <API key>(false) , <API key>(false) , <API key>(false) , <API key>(false) , data_buffer_name_("") , <API key>("") , <API key>(false) , fragment_uri_(fragment_uri) { assert(array->is_open()); auto st = array->get_query_type(&type_); assert(st.ok()); if (type_ == QueryType::WRITE) { subarray_ = Subarray(array, stats_, logger_); } else { subarray_ = Subarray(array, Layout::ROW_MAJOR, stats_, logger_); } fragment_metadata_ = array->fragment_metadata(); coords_info_.coords_buffer_ = nullptr; coords_info_.coords_buffer_size_ = nullptr; coords_info_.coords_num_ = 0; coords_info_.has_coords_ = false; callback_ = nullptr; callback_data_ = nullptr; status_ = QueryStatus::UNINITIALIZED; if (storage_manager != nullptr) config_ = storage_manager->config(); // Set initial subarray configuration subarray_.set_config(config_); rest_scratch_ = make_shared<Buffer>(HERE()); } Query::~Query() { bool found = false; bool use_malloc_trim = false; const Status& st = config_.get<bool>("sm.mem.malloc_trim", &use_malloc_trim, &found); if (st.ok() && found && use_malloc_trim) { tdb_malloc_trim(); } }; /* API */ Status Query::add_range( unsigned dim_idx, const void* start, const void* end, const void* stride) { if (dim_idx >= array_schema_->dim_num()) return logger_->status( Status_QueryError("Cannot add range; Invalid dimension index")); if (start == nullptr || end == nullptr) return logger_->status( Status_QueryError("Cannot add range; Invalid range")); if (stride != nullptr) return logger_->status(Status_QueryError( "Cannot add range; Setting range stride is currently unsupported")); if (array_schema_->domain()->dimension(dim_idx)->var_size()) return logger_->status( Status_QueryError("Cannot add range; Range must be fixed-sized")); // Prepare a temp range std::vector<uint8_t> range; auto coord_size = array_schema_->dimension(dim_idx)->coord_size(); range.resize(2 * coord_size); std::memcpy(&range[0], start, coord_size); std::memcpy(&range[coord_size], end, coord_size); bool <API key> = true; if (type_ == QueryType::READ) { // Get read_range_oob config setting bool found = false; std::string read_range_oob = config_.get("sm.read_range_oob", &found); assert(found); if (read_range_oob != "error" && read_range_oob != "warn") return logger_->status(Status_QueryError( "Invalid value " + read_range_oob + " for sm.read_range_obb. Acceptable values are 'error' or 'warn'.")); <API key> = read_range_oob == "error"; } else { if (!array_schema_->dense()) return logger_->status( Status_QueryError("Adding a subarray range to a write query is not " "supported in sparse arrays")); if (subarray_.is_set(dim_idx)) return logger_->status( Status_QueryError("Cannot add range; Multi-range dense writes " "are not supported")); } // Add range Range r(&range[0], 2 * coord_size); return subarray_.add_range(dim_idx, std::move(r), <API key>); } Status Query::add_range_var( unsigned dim_idx, const void* start, uint64_t start_size, const void* end, uint64_t end_size) { if (dim_idx >= array_schema_->dim_num()) return logger_->status( Status_QueryError("Cannot add range; Invalid dimension index")); if ((start == nullptr && start_size != 0) || (end == nullptr && end_size != 0)) return logger_->status( Status_QueryError("Cannot add range; Invalid range")); if (!array_schema_->domain()->dimension(dim_idx)->var_size()) return logger_->status( Status_QueryError("Cannot add range; Range must be variable-sized")); if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot add range; Function applicable only to reads")); // Get read_range_oob config setting bool found = false; std::string read_range_oob = config_.get("sm.read_range_oob", &found); assert(found); if (read_range_oob != "error" && read_range_oob != "warn") return logger_->status(Status_QueryError( "Invalid value " + read_range_oob + " for sm.read_range_obb. Acceptable values are 'error' or 'warn'.")); // Add range Range r; r.set_range_var(start, start_size, end, end_size); return subarray_.add_range(dim_idx, std::move(r), read_range_oob == "error"); } Status Query::get_range_num(unsigned dim_idx, uint64_t* range_num) const { if (type_ == QueryType::WRITE && !array_schema_->dense()) return logger_->status( Status_QueryError("Getting the number of ranges from a write query " "is not applicable to sparse arrays")); return subarray_.get_range_num(dim_idx, range_num); } Status Query::get_range( unsigned dim_idx, uint64_t range_idx, const void** start, const void** end, const void** stride) const { if (type_ == QueryType::WRITE && !array_schema_->dense()) return logger_->status( Status_QueryError("Getting a range from a write query is not " "applicable to sparse arrays")); *stride = nullptr; return subarray_.get_range(dim_idx, range_idx, start, end); } Status Query::get_range_var_size( unsigned dim_idx, uint64_t range_idx, uint64_t* start_size, uint64_t* end_size) const { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Getting a var range size from a write query is not applicable")); return subarray_.get_range_var_size(dim_idx, range_idx, start_size, end_size); ; } Status Query::get_range_var( unsigned dim_idx, uint64_t range_idx, void* start, void* end) const { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Getting a var range from a write query is not applicable")); uint64_t start_size = 0; uint64_t end_size = 0; subarray_.get_range_var_size(dim_idx, range_idx, &start_size, &end_size); const void* range_start; const void* range_end; const void* stride; RETURN_NOT_OK( get_range(dim_idx, range_idx, &range_start, &range_end, &stride)); std::memcpy(start, range_start, start_size); std::memcpy(end, range_end, end_size); return Status::Ok(); } Status Query::add_range_by_name( const std::string& dim_name, const void* start, const void* end, const void* stride) { unsigned dim_idx; RETURN_NOT_OK( array_schema_->domain()->get_dimension_index(dim_name, &dim_idx)); return add_range(dim_idx, start, end, stride); } Status Query::<API key>( const std::string& dim_name, const void* start, uint64_t start_size, const void* end, uint64_t end_size) { unsigned dim_idx; RETURN_NOT_OK( array_schema_->domain()->get_dimension_index(dim_name, &dim_idx)); return add_range_var(dim_idx, start, start_size, end, end_size); } Status Query::<API key>( const std::string& dim_name, uint64_t* range_num) const { unsigned dim_idx; RETURN_NOT_OK( array_schema_->domain()->get_dimension_index(dim_name, &dim_idx)); return get_range_num(dim_idx, range_num); } Status Query::get_range_from_name( const std::string& dim_name, uint64_t range_idx, const void** start, const void** end, const void** stride) const { unsigned dim_idx; RETURN_NOT_OK( array_schema_->domain()->get_dimension_index(dim_name, &dim_idx)); return get_range(dim_idx, range_idx, start, end, stride); } Status Query::<API key>( const std::string& dim_name, uint64_t range_idx, uint64_t* start_size, uint64_t* end_size) const { unsigned dim_idx; RETURN_NOT_OK( array_schema_->domain()->get_dimension_index(dim_name, &dim_idx)); return get_range_var_size(dim_idx, range_idx, start_size, end_size); } Status Query::<API key>( const std::string& dim_name, uint64_t range_idx, void* start, void* end) const { unsigned dim_idx; RETURN_NOT_OK( array_schema_->domain()->get_dimension_index(dim_name, &dim_idx)); return get_range_var(dim_idx, range_idx, start, end); } Status Query::get_est_result_size(const char* name, uint64_t* size) { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot get estimated result size; Operation currently " "unsupported for write queries")); if (name == nullptr) return logger_->status(Status_QueryError( "Cannot get estimated result size; Name cannot be null")); if (name == constants::coords && !array_schema_->domain()->all_dims_same_type()) return logger_->status(Status_QueryError( "Cannot get estimated result size; Not applicable to zipped " "coordinates in arrays with heterogeneous domain")); if (name == constants::coords && !array_schema_->domain()->all_dims_fixed()) return logger_->status(Status_QueryError( "Cannot get estimated result size; Not applicable to zipped " "coordinates in arrays with domains with variable-sized dimensions")); if (array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string( "Cannot get estimated result size; Input attribute/dimension '") + name + "' is nullable")); if (array_->is_remote() && !subarray_.<API key>()) { auto rest_client = storage_manager_->rest_client(); if (rest_client == nullptr) return logger_->status( Status_QueryError("Error in query estimate result size; remote " "array with no rest client.")); RETURN_NOT_OK( rest_client-><API key>(array_->array_uri(), this)); } return subarray_.<API key>( name, size, &config_, storage_manager_->compute_tp()); } Status Query::get_est_result_size( const char* name, uint64_t* size_off, uint64_t* size_val) { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot get estimated result size; Operation currently " "unsupported for write queries")); if (array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string( "Cannot get estimated result size; Input attribute/dimension '") + name + "' is nullable")); if (array_->is_remote() && !subarray_.<API key>()) { auto rest_client = storage_manager_->rest_client(); if (rest_client == nullptr) return logger_->status( Status_QueryError("Error in query estimate result size; remote " "array with no rest client.")); RETURN_NOT_OK( rest_client-><API key>(array_->array_uri(), this)); } return subarray_.get_est_result_size( name, size_off, size_val, &config_, storage_manager_->compute_tp()); } Status Query::<API key>( const char* name, uint64_t* size_val, uint64_t* size_validity) { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot get estimated result size; Operation currently " "unsupported for write queries")); if (name == nullptr) return logger_->status(Status_QueryError( "Cannot get estimated result size; Name cannot be null")); if (!array_schema_->attribute(name)) return logger_->status(Status_QueryError( "Cannot get estimated result size; Nullable API is only" "applicable to attributes")); if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot get estimated result size; Input attribute '") + name + "' is not nullable")); if (array_->is_remote() && !subarray_.<API key>()) { auto rest_client = storage_manager_->rest_client(); if (rest_client == nullptr) return logger_->status( Status_QueryError("Error in query estimate result size; remote " "array with no rest client.")); return logger_->status( Status_QueryError("Error in query estimate result size; unimplemented " "for nullable attributes in remote arrays.")); } return subarray_.<API key>( name, size_val, size_validity, &config_, storage_manager_->compute_tp()); } Status Query::<API key>( const char* name, uint64_t* size_off, uint64_t* size_val, uint64_t* size_validity) { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot get estimated result size; Operation currently " "unsupported for write queries")); if (!array_schema_->attribute(name)) return logger_->status(Status_QueryError( "Cannot get estimated result size; Nullable API is only" "applicable to attributes")); if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot get estimated result size; Input attribute '") + name + "' is not nullable")); if (array_->is_remote() && !subarray_.<API key>()) { auto rest_client = storage_manager_->rest_client(); if (rest_client == nullptr) return logger_->status( Status_QueryError("Error in query estimate result size; remote " "array with no rest client.")); return logger_->status( Status_QueryError("Error in query estimate result size; unimplemented " "for nullable attributes in remote arrays.")); } return subarray_.<API key>( name, size_off, size_val, size_validity, &config_, storage_manager_->compute_tp()); } std::unordered_map<std::string, Subarray::ResultSize> Query::<API key>() { return subarray_.<API key>( &config_, storage_manager_->compute_tp()); } std::unordered_map<std::string, Subarray::MemorySize> Query::<API key>() { return subarray_.<API key>( &config_, storage_manager_->compute_tp()); } Status Query::<API key>(uint32_t* num) const { if (type_ != QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot get number of fragments; Applicable only to WRITE mode")); *num = (uint32_t)<API key>.size(); return Status::Ok(); } Status Query::<API key>(uint32_t idx, const char** uri) const { if (type_ != QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot get fragment URI; Applicable only to WRITE mode")); auto num = (uint32_t)<API key>.size(); if (idx >= num) return logger_->status( Status_QueryError("Cannot get fragment URI; Invalid fragment index")); *uri = <API key>[idx].uri_.c_str(); return Status::Ok(); } Status Query::<API key>( uint32_t idx, uint64_t* t1, uint64_t* t2) const { if (type_ != QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot get fragment timestamp range; Applicable only to WRITE mode")); auto num = (uint32_t)<API key>.size(); if (idx >= num) return logger_->status(Status_QueryError( "Cannot get fragment timestamp range; Invalid fragment index")); *t1 = <API key>[idx].timestamp_range_.first; *t2 = <API key>[idx].timestamp_range_.second; return Status::Ok(); } const Array* Query::array() const { return array_; } Array* Query::array() { return array_; } const ArraySchema& Query::array_schema() const { return *(array_schema_.get()); } std::vector<std::string> Query::buffer_names() const { std::vector<std::string> ret; // Add to the buffer names the attributes, as well as the dimensions only if // coords_buffer_ has not been set for (const auto& it : buffers_) { if (!array_schema_->is_dim(it.first) || (!coords_info_.coords_buffer_)) ret.push_back(it.first); } // Special zipped coordinates name if (coords_info_.coords_buffer_) ret.push_back(constants::coords); return ret; } QueryBuffer Query::buffer(const std::string& name) const { // Special zipped coordinates if (type_ == QueryType::WRITE && name == constants::coords) return QueryBuffer( coords_info_.coords_buffer_, nullptr, coords_info_.coords_buffer_size_, nullptr); // Attribute or dimension auto buf = buffers_.find(name); if (buf != buffers_.end()) return buf->second; // Named buffer does not exist return QueryBuffer{}; } Status Query::finalize() { if (status_ == QueryStatus::UNINITIALIZED) return Status::Ok(); if (array_->is_remote()) { auto rest_client = storage_manager_->rest_client(); if (rest_client == nullptr) return logger_->status(Status_QueryError( "Error in query finalize; remote array with no rest client.")); return rest_client-><API key>(array_->array_uri(), this); } RETURN_NOT_OK(strategy_->finalize()); status_ = QueryStatus::COMPLETED; return Status::Ok(); } Status Query::get_buffer( const char* name, void** buffer, uint64_t** buffer_size) const { // Check attribute if (name != constants::coords) { if (array_schema_->attribute(name) == nullptr && array_schema_->dimension(name) == nullptr) return logger_->status(Status_QueryError( std::string("Cannot get buffer; Invalid attribute/dimension name '") + name + "'")); } if (array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is var-sized")); return get_data_buffer(name, buffer, buffer_size); } Status Query::get_buffer( const char* name, uint64_t** buffer_off, uint64_t** buffer_off_size, void** buffer_val, uint64_t** buffer_val_size) const { // Check attribute if (name == constants::coords) { return logger_->status( Status_QueryError("Cannot get buffer; Coordinates are not var-sized")); } if (array_schema_->attribute(name) == nullptr && array_schema_->dimension(name) == nullptr) return logger_->status(Status_QueryError( std::string("Cannot get buffer; Invalid attribute/dimension name '") + name + "'")); if (!array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is fixed-sized")); // Attribute or dimension auto it = buffers_.find(name); if (it != buffers_.end()) { *buffer_off = (uint64_t*)it->second.buffer_; *buffer_off_size = it->second.buffer_size_; *buffer_val = it->second.buffer_var_; *buffer_val_size = it->second.buffer_var_size_; return Status::Ok(); } // Named buffer does not exist *buffer_off = nullptr; *buffer_off_size = nullptr; *buffer_val = nullptr; *buffer_val_size = nullptr; return Status::Ok(); } Status Query::get_offsets_buffer( const char* name, uint64_t** buffer_off, uint64_t** buffer_off_size) const { // Check attribute if (name == constants::coords) { return logger_->status( Status_QueryError("Cannot get buffer; Coordinates are not var-sized")); } if (array_schema_->attribute(name) == nullptr && array_schema_->dimension(name) == nullptr) return logger_->status(Status_QueryError( std::string("Cannot get buffer; Invalid attribute/dimension name '") + name + "'")); if (!array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is fixed-sized")); // Attribute or dimension auto it = buffers_.find(name); if (it != buffers_.end()) { *buffer_off = (uint64_t*)it->second.buffer_; *buffer_off_size = it->second.buffer_size_; return Status::Ok(); } // Named buffer does not exist *buffer_off = nullptr; *buffer_off_size = nullptr; return Status::Ok(); } Status Query::get_data_buffer( const char* name, void** buffer, uint64_t** buffer_size) const { // Check attribute if (name != constants::coords) { if (array_schema_->attribute(name) == nullptr && array_schema_->dimension(name) == nullptr) return logger_->status(Status_QueryError( std::string("Cannot get buffer; Invalid attribute/dimension name '") + name + "'")); } // Special zipped coordinates if (type_ == QueryType::WRITE && name == constants::coords) { *buffer = coords_info_.coords_buffer_; *buffer_size = coords_info_.coords_buffer_size_; return Status::Ok(); } // Attribute or dimension auto it = buffers_.find(name); if (it != buffers_.end()) { if (!array_schema_->var_size(name)) { *buffer = it->second.buffer_; *buffer_size = it->second.buffer_size_; } else { *buffer = it->second.buffer_var_; *buffer_size = it->second.buffer_var_size_; } return Status::Ok(); } // Named buffer does not exist *buffer = nullptr; *buffer_size = nullptr; return Status::Ok(); } Status Query::get_validity_buffer( const char* name, uint8_t** <API key>, uint64_t** <API key>) const { // Check attribute if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is non-nullable")); // Attribute or dimension auto it = buffers_.find(name); if (it != buffers_.end()) { auto vv = &it->second.validity_vector_; *<API key> = vv->bytemap(); *<API key> = vv->bytemap_size(); } return Status::Ok(); } Status Query::get_buffer_vbytemap( const char* name, uint64_t** buffer_off, uint64_t** buffer_off_size, void** buffer_val, uint64_t** buffer_val_size, uint8_t** <API key>, uint64_t** <API key>) const { const ValidityVector* vv = nullptr; RETURN_NOT_OK(get_buffer( name, buffer_off, buffer_off_size, buffer_val, buffer_val_size, &vv)); if (vv != nullptr) { *<API key> = vv->bytemap(); *<API key> = vv->bytemap_size(); } return Status::Ok(); } Status Query::get_buffer_vbytemap( const char* name, void** buffer, uint64_t** buffer_size, uint8_t** <API key>, uint64_t** <API key>) const { const ValidityVector* vv = nullptr; RETURN_NOT_OK(get_buffer(name, buffer, buffer_size, &vv)); if (vv != nullptr) { *<API key> = vv->bytemap(); *<API key> = vv->bytemap_size(); } return Status::Ok(); } Status Query::get_buffer( const char* name, void** buffer, uint64_t** buffer_size, const ValidityVector** validity_vector) const { // Check nullable attribute if (array_schema_->attribute(name) == nullptr) return logger_->status(Status_QueryError( std::string("Cannot get buffer; Invalid attribute name '") + name + "'")); if (array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is var-sized")); if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is non-nullable")); // Attribute or dimension auto it = buffers_.find(name); if (it != buffers_.end()) { *buffer = it->second.buffer_; *buffer_size = it->second.buffer_size_; *validity_vector = &it->second.validity_vector_; return Status::Ok(); } // Named buffer does not exist *buffer = nullptr; *buffer_size = nullptr; *validity_vector = nullptr; return Status::Ok(); } Status Query::get_buffer( const char* name, uint64_t** buffer_off, uint64_t** buffer_off_size, void** buffer_val, uint64_t** buffer_val_size, const ValidityVector** validity_vector) const { // Check attribute if (array_schema_->attribute(name) == nullptr) return logger_->status(Status_QueryError( std::string("Cannot get buffer; Invalid attribute name '") + name + "'")); if (!array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is fixed-sized")); if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot get buffer; '") + name + "' is non-nullable")); // Attribute or dimension auto it = buffers_.find(name); if (it != buffers_.end()) { *buffer_off = (uint64_t*)it->second.buffer_; *buffer_off_size = it->second.buffer_size_; *buffer_val = it->second.buffer_var_; *buffer_val_size = it->second.buffer_var_size_; *validity_vector = &it->second.validity_vector_; return Status::Ok(); } // Named buffer does not exist *buffer_off = nullptr; *buffer_off_size = nullptr; *buffer_val = nullptr; *buffer_val_size = nullptr; *validity_vector = nullptr; return Status::Ok(); } Status Query::<API key>( const std::string& attribute, SerializationState::AttrState** state) { *state = &<API key>.attribute_states[attribute]; return Status::Ok(); } bool Query::has_results() const { if (status_ == QueryStatus::UNINITIALIZED || type_ == QueryType::WRITE) return false; for (const auto& it : buffers_) { if (*(it.second.buffer_size_) != 0) return true; } return false; } Status Query::init() { // Only if the query has not been initialized before if (status_ == QueryStatus::UNINITIALIZED) { // Check if the array got closed if (array_ == nullptr || !array_->is_open()) return logger_->status(Status_QueryError( "Cannot init query; The associated array is not open")); // Check if the array got re-opened with a different query type QueryType array_query_type; RETURN_NOT_OK(array_->get_query_type(&array_query_type)); if (array_query_type != type_) { std::stringstream errmsg; errmsg << "Cannot init query; " << "Associated array query type does not match query type: " << "(" << query_type_str(array_query_type) << " != " << query_type_str(type_) << ")"; return logger_->status(Status_QueryError(errmsg.str())); } RETURN_NOT_OK(check_buffer_names()); RETURN_NOT_OK(create_strategy()); RETURN_NOT_OK(strategy_->init()); } status_ = QueryStatus::INPROGRESS; return Status::Ok(); } URI Query::first_fragment_uri() const { if (type_ == QueryType::WRITE || fragment_metadata_.empty()) return URI(); return fragment_metadata_.front()->fragment_uri(); } URI Query::last_fragment_uri() const { if (type_ == QueryType::WRITE || fragment_metadata_.empty()) return URI(); return fragment_metadata_.back()->fragment_uri(); } Layout Query::layout() const { return layout_; } const QueryCondition* Query::condition() const { if (type_ == QueryType::WRITE) return nullptr; return &condition_; } Status Query::cancel() { status_ = QueryStatus::FAILED; return Status::Ok(); } Status Query::process() { if (status_ == QueryStatus::UNINITIALIZED) return logger_->status( Status_QueryError("Cannot process query; Query is not initialized")); status_ = QueryStatus::INPROGRESS; // Process query Status st = strategy_->dowork(); // Handle error if (!st.ok()) { status_ = QueryStatus::FAILED; return st; } if (type_ == QueryType::WRITE && layout_ == Layout::GLOBAL_ORDER) { // reset coord buffer marker at end of global write // this will allow for the user to properly set the next write batch <API key> = false; <API key> = false; <API key> = false; } // Check if the query is complete bool completed = !strategy_->incomplete(); // Handle callback and status if (completed) { if (callback_ != nullptr) callback_(callback_data_); status_ = QueryStatus::COMPLETED; } else { // Incomplete status_ = QueryStatus::INCOMPLETE; } return Status::Ok(); } Status Query::create_strategy() { if (type_ == QueryType::WRITE) { if (layout_ == Layout::COL_MAJOR || layout_ == Layout::ROW_MAJOR) { strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( OrderedWriter, stats_->create_child("Writer"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, <API key>, <API key>, coords_info_, fragment_uri_)); } else if (layout_ == Layout::UNORDERED) { strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( UnorderedWriter, stats_->create_child("Writer"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, <API key>, <API key>, coords_info_, fragment_uri_)); } else if (layout_ == Layout::GLOBAL_ORDER) { strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( GlobalOrderWriter, stats_->create_child("Writer"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, <API key>, <API key>, coords_info_, fragment_uri_)); } else { assert(false); } } else { bool use_default = true; if (<API key>() && !array_schema_->dense() && layout_ == Layout::UNORDERED && array_schema_->allows_dups()) { use_default = false; auto&& [st, <API key>]{Query::<API key>()}; RETURN_NOT_OK(st); if (*<API key> || !subarray_.is_set() || subarray_.range_num() == 1) { strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( <API key><uint8_t>, stats_->create_child("Reader"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, condition_)); } else { strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( <API key><uint64_t>, stats_->create_child("Reader"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, condition_)); } } else if ( <API key>() && !array_schema_->dense() && (layout_ == Layout::GLOBAL_ORDER || (layout_ == Layout::UNORDERED && subarray_.range_num() <= 1))) { // Using the reader for unordered queries to do deduplication. use_default = false; strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( <API key>, stats_->create_child("Reader"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, condition_)); } else if (<API key>() && array_schema_->dense()) { bool all_dense = true; for (auto& frag_md : fragment_metadata_) all_dense &= frag_md->dense(); if (all_dense) { use_default = false; strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( DenseReader, stats_->create_child("Reader"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, condition_)); } } if (use_default) { strategy_ = tdb_unique_ptr<IQueryStrategy>(tdb_new( Reader, stats_->create_child("Reader"), logger_, storage_manager_, array_, config_, buffers_, subarray_, layout_, condition_)); } } if (strategy_ == nullptr) return logger_->status( Status_QueryError("Cannot create strategy; allocation failed")); return Status::Ok(); } IQueryStrategy* Query::strategy() { if (strategy_ == nullptr) { create_strategy(); } return strategy_.get(); } void Query::clear_strategy() { strategy_ = nullptr; } Status Query::<API key>() { if (status_ != QueryStatus::UNINITIALIZED) return logger_->status(Status_QueryError( "Cannot disable checking global order after initialization")); if (type_ == QueryType::READ) return logger_->status(Status_QueryError( "Cannot disable checking global order; Applicable only to writes")); <API key> = true; return Status::Ok(); } Status Query::check_buffer_names() { if (type_ == QueryType::WRITE) { // If the array is sparse, the coordinates must be provided if (!array_schema_->dense() && !coords_info_.has_coords_) return logger_->status(Status_WriterError( "Sparse array writes expect the coordinates of the " "cells to be written")); // If the layout is unordered, the coordinates must be provided if (layout_ == Layout::UNORDERED && !coords_info_.has_coords_) return logger_->status( Status_WriterError("Unordered writes expect the coordinates of the " "cells to be written")); // All attributes/dimensions must be provided auto expected_num = array_schema_->attribute_num(); expected_num += (<API key> || <API key> || <API key>) ? array_schema_->dim_num() : 0; if (buffers_.size() != expected_num) return logger_->status( Status_WriterError("Writes expect all attributes (and coordinates in " "the sparse/unordered case) to be set")); } return Status::Ok(); } Status Query::<API key>(const std::string& name) { if (name == constants::coords && !array_schema_->domain()->all_dims_same_type()) return logger_->status(Status_QueryError( "Cannot set buffer; Setting a buffer for zipped coordinates is not " "applicable to heterogeneous domains")); if (name == constants::coords && !array_schema_->domain()->all_dims_fixed()) return logger_->status(Status_QueryError( "Cannot set buffer; Setting a buffer for zipped coordinates is not " "applicable to domains with variable-sized dimensions")); return Status::Ok(); } Status Query::set_config(const Config& config) { config_ = config; // Refresh memory budget configuration. if (strategy_ != nullptr) RETURN_NOT_OK(strategy_-><API key>()); // Set subarray's config for backwards compatibility // Users expect the query config to effect the subarray based on existing // behavior before subarray was exposed directly subarray_.set_config(config_); return Status::Ok(); } Status Query::set_coords_buffer(void* buffer, uint64_t* buffer_size) { // Set zipped coordinates buffer coords_info_.coords_buffer_ = buffer; coords_info_.coords_buffer_size_ = buffer_size; coords_info_.has_coords_ = true; return Status::Ok(); } Status Query::set_buffer( const std::string& name, void* const buffer, uint64_t* const buffer_size, const bool check_null_buffers) { RETURN_NOT_OK(<API key>(name)); // Check buffer if (check_null_buffers && buffer == nullptr) return logger_->status( Status_QueryError("Cannot set buffer; " + name + " buffer is null")); // Check buffer size if (check_null_buffers && buffer_size == nullptr) return logger_->status( Status_QueryError("Cannot set buffer; " + name + " buffer is null")); // For easy reference const bool is_dim = array_schema_->is_dim(name); const bool is_attr = array_schema_->is_attr(name); // Check that attribute/dimension exists if (name != constants::coords && !is_dim && !is_attr) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Invalid attribute/dimension '") + name + "'")); // Must not be nullable if (array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute/dimension '") + name + "' is nullable")); // Check that attribute/dimension is fixed-sized const bool var_size = (name != constants::coords && array_schema_->var_size(name)); if (var_size) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute/dimension '") + name + "' is var-sized")); // Check if zipped coordinates coexist with separate coordinate buffers if ((is_dim && <API key>) || (name == constants::coords && has_coords_buffer_)) return logger_->status(Status_QueryError( std::string("Cannot set separate coordinate buffers and " "a zipped coordinate buffer in the same query"))); // Error if setting a new attribute/dimension after initialization const bool exists = buffers_.find(name) != buffers_.end(); if (status_ != QueryStatus::UNINITIALIZED && !exists) return logger_->status(Status_QueryError( std::string("Cannot set buffer for new attribute/dimension '") + name + "' after initialization")); if (name == constants::coords) { <API key> = true; // Set special function for zipped coordinates buffer if (type_ == QueryType::WRITE) return set_coords_buffer(buffer, buffer_size); } if (is_dim && type_ == QueryType::WRITE) { // Check number of coordinates uint64_t coords_num = *buffer_size / array_schema_->cell_size(name); if (<API key> && coords_num != coords_info_.coords_num_) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input buffer for dimension '") + name + "' has a different number of coordinates than previously " "set coordinate buffers")); coords_info_.coords_num_ = coords_num; <API key> = true; coords_info_.has_coords_ = true; } has_coords_buffer_ |= is_dim; // Set attribute buffer buffers_[name].set_data_buffer(buffer, buffer_size); return Status::Ok(); } Status Query::set_data_buffer( const std::string& name, void* const buffer, uint64_t* const buffer_size, const bool check_null_buffers) { RETURN_NOT_OK(<API key>(name)); // Check buffer if (check_null_buffers && buffer == nullptr) if (type_ != QueryType::WRITE || *buffer_size != 0) return logger_->status( Status_QueryError("Cannot set buffer; " + name + " buffer is null")); // Check buffer size if (check_null_buffers && buffer_size == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " buffer size is null")); // For easy reference const bool is_dim = array_schema_->is_dim(name); const bool is_attr = array_schema_->is_attr(name); // Check that attribute/dimension exists if (name != constants::coords && !is_dim && !is_attr) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Invalid attribute/dimension '") + name + "'")); if (array_schema_->dense() && type_ == QueryType::WRITE && !is_attr) { return logger_->status(Status_QueryError( std::string("Dense write queries cannot set dimension buffers"))); } // Check if zipped coordinates coexist with separate coordinate buffers if ((is_dim && <API key>) || (name == constants::coords && has_coords_buffer_)) return logger_->status(Status_QueryError( std::string("Cannot set separate coordinate buffers and " "a zipped coordinate buffer in the same query"))); // Error if setting a new attribute/dimension after initialization const bool exists = buffers_.find(name) != buffers_.end(); if (status_ != QueryStatus::UNINITIALIZED && !exists) return logger_->status(Status_QueryError( std::string("Cannot set buffer for new attribute/dimension '") + name + "' after initialization")); if (name == constants::coords) { <API key> = true; // Set special function for zipped coordinates buffer if (type_ == QueryType::WRITE) return set_coords_buffer(buffer, buffer_size); } if (is_dim && type_ == QueryType::WRITE) { // Check number of coordinates uint64_t coords_num = *buffer_size / array_schema_->cell_size(name); if (<API key> && coords_num != coords_info_.coords_num_ && name == data_buffer_name_) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input buffer for dimension '") + name + "' has a different number of coordinates than previously " "set coordinate buffers")); coords_info_.coords_num_ = coords_num; <API key> = true; data_buffer_name_ = name; coords_info_.has_coords_ = true; } has_coords_buffer_ |= is_dim; // Set attribute/dimension buffer on the appropriate buffer if (!array_schema_->var_size(name)) // Fixed size data buffer buffers_[name].set_data_buffer(buffer, buffer_size); else // Var sized data buffer buffers_[name].set_data_var_buffer(buffer, buffer_size); return Status::Ok(); } Status Query::set_offsets_buffer( const std::string& name, uint64_t* const buffer_offsets, uint64_t* const buffer_offsets_size, const bool check_null_buffers) { RETURN_NOT_OK(<API key>(name)); // Check buffer if (check_null_buffers && buffer_offsets == nullptr) return logger_->status( Status_QueryError("Cannot set buffer; " + name + " buffer is null")); // Check buffer size if (check_null_buffers && buffer_offsets_size == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " buffer size is null")); // For easy reference const bool is_dim = array_schema_->is_dim(name); const bool is_attr = array_schema_->is_attr(name); // Neither a dimension nor an attribute if (!is_dim && !is_attr) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Invalid buffer name '") + name + "' (it should be an attribute or dimension)")); // Error if it is fixed-sized if (!array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute/dimension '") + name + "' is fixed-sized")); // Error if setting a new attribute/dimension after initialization bool exists = buffers_.find(name) != buffers_.end(); if (status_ != QueryStatus::UNINITIALIZED && !exists) return logger_->status(Status_QueryError( std::string("Cannot set buffer for new attribute/dimension '") + name + "' after initialization")); if (is_dim && type_ == QueryType::WRITE) { // Check number of coordinates uint64_t coords_num = *buffer_offsets_size / constants::<API key>; if (<API key> && coords_num != coords_info_.coords_num_ && name == <API key>) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input buffer for dimension '") + name + "' has a different number of coordinates than previously " "set coordinate buffers")); coords_info_.coords_num_ = coords_num; <API key> = true; coords_info_.has_coords_ = true; <API key> = name; } has_coords_buffer_ |= is_dim; // Set attribute/dimension buffer buffers_[name].set_offsets_buffer(buffer_offsets, buffer_offsets_size); return Status::Ok(); } Status Query::set_validity_buffer( const std::string& name, uint8_t* const <API key>, uint64_t* const <API key>, const bool check_null_buffers) { RETURN_NOT_OK(<API key>(name)); ValidityVector validity_vector; RETURN_NOT_OK(validity_vector.init_bytemap( <API key>, <API key>)); // Check validity buffer if (check_null_buffers && validity_vector.buffer() == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " validity buffer is null")); // Check validity buffer size if (check_null_buffers && validity_vector.buffer_size() == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " validity buffer size is null")); // Must be an attribute if (!array_schema_->is_attr(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Buffer name '") + name + "' is not an attribute")); // Must be nullable if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute '") + name + "' is not nullable")); // Error if setting a new attribute after initialization const bool exists = buffers_.find(name) != buffers_.end(); if (status_ != QueryStatus::UNINITIALIZED && !exists) return logger_->status(Status_QueryError( std::string("Cannot set buffer for new attribute '") + name + "' after initialization")); // Set attribute/dimension buffer buffers_[name].set_validity_buffer(std::move(validity_vector)); return Status::Ok(); } Status Query::set_buffer( const std::string& name, uint64_t* const buffer_off, uint64_t* const buffer_off_size, void* const buffer_val, uint64_t* const buffer_val_size, const bool check_null_buffers) { // Check buffer if (check_null_buffers && buffer_val == nullptr) if (type_ != QueryType::WRITE || *buffer_val_size != 0) return logger_->status( Status_QueryError("Cannot set buffer; " + name + " buffer is null")); // Check buffer size if (check_null_buffers && buffer_val_size == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " buffer size is null")); // Check offset buffer if (check_null_buffers && buffer_off == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " offset buffer is null")); // Check offset buffer size if (check_null_buffers && buffer_off_size == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " offset buffer size is null")); // For easy reference const bool is_dim = array_schema_->is_dim(name); const bool is_attr = array_schema_->is_attr(name); // Check that attribute/dimension exists if (!is_dim && !is_attr) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Invalid attribute/dimension '") + name + "'")); // Must not be nullable if (array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute/dimension '") + name + "' is nullable")); // Check that attribute/dimension is var-sized if (!array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute/dimension '") + name + "' is fixed-sized")); // Error if setting a new attribute/dimension after initialization const bool exists = buffers_.find(name) != buffers_.end(); if (status_ != QueryStatus::UNINITIALIZED && !exists) return logger_->status(Status_QueryError( std::string("Cannot set buffer for new attribute/dimension '") + name + "' after initialization")); if (is_dim && type_ == QueryType::WRITE) { // Check number of coordinates uint64_t coords_num = *buffer_off_size / constants::<API key>; if (<API key> && coords_num != coords_info_.coords_num_) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input buffer for dimension '") + name + "' has a different number of coordinates than previously " "set coordinate buffers")); coords_info_.coords_num_ = coords_num; <API key> = true; coords_info_.has_coords_ = true; } // Set attribute/dimension buffer buffers_[name].set_data_var_buffer(buffer_val, buffer_val_size); buffers_[name].set_offsets_buffer(buffer_off, buffer_off_size); return Status::Ok(); } Status Query::set_buffer_vbytemap( const std::string& name, void* const buffer, uint64_t* const buffer_size, uint8_t* const <API key>, uint64_t* const <API key>, const bool check_null_buffers) { // Convert the bytemap into a ValidityVector. ValidityVector vv; RETURN_NOT_OK( vv.init_bytemap(<API key>, <API key>)); return set_buffer( name, buffer, buffer_size, std::move(vv), check_null_buffers); } Status Query::set_buffer_vbytemap( const std::string& name, uint64_t* const buffer_off, uint64_t* const buffer_off_size, void* const buffer_val, uint64_t* const buffer_val_size, uint8_t* const <API key>, uint64_t* const <API key>, const bool check_null_buffers) { // Convert the bytemap into a ValidityVector. ValidityVector vv; RETURN_NOT_OK( vv.init_bytemap(<API key>, <API key>)); return set_buffer( name, buffer_off, buffer_off_size, buffer_val, buffer_val_size, std::move(vv), check_null_buffers); } Status Query::set_buffer( const std::string& name, void* const buffer, uint64_t* const buffer_size, ValidityVector&& validity_vector, const bool check_null_buffers) { RETURN_NOT_OK(<API key>(name)); // Check buffer if (check_null_buffers && buffer == nullptr) return logger_->status( Status_QueryError("Cannot set buffer; " + name + " buffer is null")); // Check buffer size if (check_null_buffers && buffer_size == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " buffer size is null")); // Check validity buffer offset if (check_null_buffers && validity_vector.buffer() == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " validity buffer is null")); // Check validity buffer size if (check_null_buffers && validity_vector.buffer_size() == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " validity buffer size is null")); // Must be an attribute if (!array_schema_->is_attr(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Buffer name '") + name + "' is not an attribute")); // Must be fixed-size if (array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute '") + name + "' is var-sized")); // Must be nullable if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute '") + name + "' is not nullable")); // Error if setting a new attribute/dimension after initialization const bool exists = buffers_.find(name) != buffers_.end(); if (status_ != QueryStatus::UNINITIALIZED && !exists) return logger_->status(Status_QueryError( std::string("Cannot set buffer for new attribute '") + name + "' after initialization")); // Set attribute buffer buffers_[name].set_data_buffer(buffer, buffer_size); buffers_[name].set_validity_buffer(std::move(validity_vector)); return Status::Ok(); } Status Query::set_buffer( const std::string& name, uint64_t* const buffer_off, uint64_t* const buffer_off_size, void* const buffer_val, uint64_t* const buffer_val_size, ValidityVector&& validity_vector, const bool check_null_buffers) { // Check buffer if (check_null_buffers && buffer_val == nullptr) if (type_ != QueryType::WRITE || *buffer_val_size != 0) return logger_->status( Status_QueryError("Cannot set buffer; " + name + " buffer is null")); // Check buffer size if (check_null_buffers && buffer_val_size == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " buffer size is null")); // Check buffer offset if (check_null_buffers && buffer_off == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " offset buffer is null")); // Check buffer offset size if (check_null_buffers && buffer_off_size == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " offset buffer size is null")); ; // Check validity buffer offset if (check_null_buffers && validity_vector.buffer() == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " validity buffer is null")); // Check validity buffer size if (check_null_buffers && validity_vector.buffer_size() == nullptr) return logger_->status(Status_QueryError( "Cannot set buffer; " + name + " validity buffer size is null")); // Must be an attribute if (!array_schema_->is_attr(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Buffer name '") + name + "' is not an attribute")); // Must be var-size if (!array_schema_->var_size(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute '") + name + "' is fixed-sized")); // Must be nullable if (!array_schema_->is_nullable(name)) return logger_->status(Status_QueryError( std::string("Cannot set buffer; Input attribute '") + name + "' is not nullable")); // Error if setting a new attribute after initialization const bool exists = buffers_.find(name) != buffers_.end(); if (status_ != QueryStatus::UNINITIALIZED && !exists) return logger_->status(Status_QueryError( std::string("Cannot set buffer for new attribute '") + name + "' after initialization")); // Set attribute/dimension buffer buffers_[name].set_data_var_buffer(buffer_val, buffer_val_size); buffers_[name].set_offsets_buffer(buffer_off, buffer_off_size); buffers_[name].set_validity_buffer(std::move(validity_vector)); return Status::Ok(); } Status Query::set_est_result_size( std::unordered_map<std::string, Subarray::ResultSize>& est_result_size, std::unordered_map<std::string, Subarray::MemorySize>& max_mem_size) { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot set estimated result size; Operation currently " "unsupported for write queries")); return subarray_.set_est_result_size(est_result_size, max_mem_size); } Status Query::set_layout_unsafe(Layout layout) { layout_ = layout; subarray_.set_layout(layout); return Status::Ok(); } Status Query::set_layout(Layout layout) { if (type_ == QueryType::READ && status_ != QueryStatus::UNINITIALIZED) return logger_->status( Status_QueryError("Cannot set layout after initialization")); if (layout == Layout::HILBERT) return logger_->status(Status_QueryError( "Cannot set layout; Hilbert order is not applicable to queries")); if (type_ == QueryType::WRITE && array_schema_->dense() && layout == Layout::UNORDERED) { return logger_->status(Status_QueryError( "Unordered writes are only possible for sparse arrays")); } layout_ = layout; subarray_.set_layout(layout); return Status::Ok(); } Status Query::set_condition(const QueryCondition& condition) { if (type_ == QueryType::WRITE) return logger_->status(Status_QueryError( "Cannot set query condition; Operation only applicable " "to read queries")); condition_ = condition; return Status::Ok(); } void Query::set_status(QueryStatus status) { status_ = status; } Status Query::set_subarray(const void* subarray) { if (!array_schema_->domain()->all_dims_same_type()) return logger_->status( Status_QueryError("Cannot set subarray; Function not applicable to " "heterogeneous domains")); if (!array_schema_->domain()->all_dims_fixed()) return logger_->status( Status_QueryError("Cannot set subarray; Function not applicable to " "domains with variable-sized dimensions")); // Prepare a subarray object Subarray sub(array_, layout_, stats_, logger_); if (subarray != nullptr) { auto dim_num = array_schema_->dim_num(); auto s_ptr = (const unsigned char*)subarray; uint64_t offset = 0; bool err_on_range_oob = true; if (type_ == QueryType::READ) { // Get read_range_oob config setting bool found = false; std::string read_range_oob_str = config()->get("sm.read_range_oob", &found); assert(found); if (read_range_oob_str != "error" && read_range_oob_str != "warn") return logger_->status(Status_QueryError( "Invalid value " + read_range_oob_str + " for sm.read_range_obb. Acceptable values are 'error' or " "'warn'.")); err_on_range_oob = read_range_oob_str == "error"; } for (unsigned d = 0; d < dim_num; ++d) { auto r_size = 2 * array_schema_->dimension(d)->coord_size(); Range range(&s_ptr[offset], r_size); RETURN_NOT_OK(sub.add_range(d, std::move(range), err_on_range_oob)); offset += r_size; } } if (type_ == QueryType::WRITE) { // Not applicable to sparse arrays if (!array_schema_->dense()) return logger_->status(Status_WriterError( "Setting a subarray is not supported in sparse writes")); // Subarray must be unary for dense writes if (sub.range_num() != 1) return logger_->status( Status_WriterError("Cannot set subarray; Multi-range dense writes " "are not supported")); if (strategy_ != nullptr) strategy_->reset(); } subarray_ = sub; status_ = QueryStatus::UNINITIALIZED; return Status::Ok(); } const Subarray* Query::subarray() const { return &subarray_; } Status Query::set_subarray_unsafe(const Subarray& subarray) { subarray_ = subarray; return Status::Ok(); } Status Query::set_subarray(const tiledb::sm::Subarray& subarray) { auto query_status = status(); if (query_status != tiledb::sm::QueryStatus::UNINITIALIZED && query_status != tiledb::sm::QueryStatus::COMPLETED) { // Can be in this initialized state when query has been de-serialized // server-side and are trying to perform local submit. // Don't change anything and return indication of success. return Status::Ok(); } // Set subarray if (!subarray.is_set()) // Nothing useful to set here, will leave query with its current // settings and consider successful. return Status::Ok(); auto prev_layout = subarray_.layout(); subarray_ = subarray; subarray_.set_layout(prev_layout); status_ = QueryStatus::UNINITIALIZED; return Status::Ok(); } Status Query::set_subarray_unsafe(const NDRange& subarray) { // Prepare a subarray object Subarray sub(array_, layout_, stats_, logger_); if (!subarray.empty()) { auto dim_num = array_schema_->dim_num(); for (unsigned d = 0; d < dim_num; ++d) RETURN_NOT_OK(sub.add_range_unsafe(d, subarray[d])); } assert(layout_ == sub.layout()); subarray_ = sub; status_ = QueryStatus::UNINITIALIZED; return Status::Ok(); } Status Query::<API key>() { // Iterate through each attribute for (auto& attr : buffer_names()) { if (array_schema_->var_size(attr)) { // Check for data buffer under buffer_var and offsets buffer under buffer if (type_ == QueryType::READ) { if (buffer(attr).buffer_var_ == nullptr) { return logger_->status(Status_QueryError( std::string("Var-Sized input attribute/dimension '") + attr + "' is not set correctly. \nVar size buffer is not set.")); } } else { if (buffer(attr).buffer_var_ == nullptr && *buffer(attr).buffer_var_size_ != 0) { return logger_->status(Status_QueryError( std::string("Var-Sized input attribute/dimension '") + attr + "' is not set correctly. \nVar size buffer is not set and buffer " "size if not 0.")); } } if (buffer(attr).buffer_ == nullptr) { return logger_->status(Status_QueryError( std::string("Var-Sized input attribute/dimension '") + attr + "' is not set correctly. \nOffsets buffer is not set.")); } } else { // Fixed sized if (buffer(attr).buffer_ == nullptr) { return logger_->status(Status_QueryError( std::string("Fix-Sized input attribute/dimension '") + attr + "' is not set correctly. \nData buffer is not set.")); } } if (array_schema_->is_nullable(attr)) { bool exists_validity = buffer(attr).validity_vector_.buffer() != nullptr; if (!exists_validity) { return logger_->status(Status_QueryError( std::string("Nullable input attribute/dimension '") + attr + "' is not set correctly \nValidity buffer is not set")); } } } return Status::Ok(); } Status Query::submit() { // Do not resubmit completed reads. if (type_ == QueryType::READ && status_ == QueryStatus::COMPLETED) { return Status::Ok(); } // Check attribute/dimensions buffers completeness before query submits RETURN_NOT_OK(<API key>()); if (array_->is_remote()) { auto rest_client = storage_manager_->rest_client(); if (rest_client == nullptr) return logger_->status(Status_QueryError( "Error in query submission; remote array with no rest client.")); if (status_ == QueryStatus::UNINITIALIZED) { RETURN_NOT_OK(create_strategy()); RETURN_NOT_OK(strategy_->init()); } return rest_client-><API key>(array_->array_uri(), this); } RETURN_NOT_OK(init()); return storage_manager_->query_submit(this); } Status Query::submit_async( std::function<void(void*)> callback, void* callback_data) { // Do not resubmit completed reads. if (type_ == QueryType::READ && status_ == QueryStatus::COMPLETED) { callback(callback_data); return Status::Ok(); } RETURN_NOT_OK(init()); if (array_->is_remote()) return logger_->status( Status_QueryError("Error in async query submission; async queries not " "supported for remote arrays.")); callback_ = callback; callback_data_ = callback_data; return storage_manager_->query_submit_async(this); } QueryStatus Query::status() const { return status_; } <API key> Query::<API key>() const { if (strategy_ != nullptr) return strategy_-><API key>(); return <API key>::REASON_NONE; } QueryType Query::type() const { return type_; } const Config* Query::config() const { return &config_; } stats::Stats* Query::stats() const { return stats_; } tdb_shared_ptr<Buffer> Query::rest_scratch() const { return rest_scratch_; } bool Query::<API key>() { bool <API key> = false; bool found = false; // First check for legacy option config_.get<bool>( "sm.<API key>", &<API key>, &found); // If the legacy/deprecated option is set use it over the new parameters // This facilitates backwards compatibility if (found) { logger_->warn( "sm.<API key> config option is deprecated.\nPlease use " "'sm.query.dense.reader' with value of 'refactored' or 'legacy'"); return <API key>; } const std::string& val = config_.get("sm.query.dense.reader", &found); assert(found); return val == "refactored"; } bool Query::<API key>() { bool <API key> = false; bool found = false; // First check for legacy option config_.get<bool>( "sm.<API key>", &<API key>, &found); // If the legacy/deprecated option is set use it over the new parameters // This facilitates backwards compatibility if (found) { logger_->warn( "sm.<API key> config option is deprecated.\nPlease use " "'sm.query.sparse_global_order.reader' with value of 'refactored' or " "'legacy'"); return <API key>; } const std::string& val = config_.get("sm.query.sparse_global_order.reader", &found); assert(found); return val == "refactored"; } bool Query::<API key>() { bool <API key> = false; bool found = false; // First check for legacy option config_.get<bool>( "sm.<API key>", &<API key>, &found); // If the legacy/deprecated option is set use it over the new parameters // This facilitates backwards compatibility if (found) { logger_->warn( "sm.<API key> config option is deprecated.\nPlease use " "'sm.query.<API key>.reader' with value of " "'refactored' or 'legacy'"); return <API key>; } const std::string& val = config_.get("sm.query.<API key>.reader", &found); assert(found); return val == "refactored"; } tuple<Status, optional<bool>> Query::<API key>() { return subarray_.<API key>(storage_manager_->compute_tp()); } /* PRIVATE METHODS */ } // namespace sm } // namespace tiledb
class <API key> < ActiveRecord::Migration[5.0] def change create_table :product_materials do |t| t.belongs_to :product, index: true t.string :name t.string :material t.string :description t.timestamps end end end
'use strict' var test = require('tap').test var strip = require('./') test('stripFalsy', function(t) { t.plan(5) t.deepEqual(strip(null), {}) t.deepEqual(strip('test'), {}) t.deepEqual(strip(13), {}) t.deepEqual(strip(), {}) var input = { a: false , b: 0 , c: null , d: undefined , e: '' , f: 'biscuits' , g: '0' } var exp = { f: 'biscuits' , g: '0' } t.deepEqual(strip(input), exp) })
<?php defined('IN_IA') or exit('Access Denied'); load()->func('file'); load()->model('article'); load()->model('account'); $dos = array('display', 'post', 'del'); $do = in_array($do, $dos) ? $do : 'display'; <API key>('platform_site'); $_W['page']['title'] = ' - '; $category = pdo_fetchall("SELECT id,parentid,name FROM ".tablename('site_category')." WHERE uniacid = '{$_W['uniacid']}' ORDER BY parentid ASC, displayorder ASC, id ASC ", array(), 'id'); $parent = array(); $children = array(); if (!empty($category)) { foreach ($category as $cid => $cate) { if (!empty($cate['parentid'])) { $children[$cate['parentid']][] = $cate; } else { $parent[$cate['id']] = $cate; } } } if ($do == 'display') { $pindex = max(1, intval($_GPC['page'])); $psize = 20; $condition = ''; $params = array(); if (!empty($_GPC['keyword'])) { $condition .= " AND `title` LIKE :keyword"; $params[':keyword'] = "%{$_GPC['keyword']}%"; } if (!empty($_GPC['category']['childid'])) { $cid = intval($_GPC['category']['childid']); $condition .= " AND ccate = '{$cid}'"; } elseif (!empty($_GPC['category']['parentid'])) { $cid = intval($_GPC['category']['parentid']); $condition .= " AND pcate = '{$cid}'"; } $list = pdo_fetchall("SELECT * FROM ".tablename('site_article')." WHERE uniacid = '{$_W['uniacid']}' $condition ORDER BY displayorder DESC, edittime DESC, id DESC LIMIT ".($pindex - 1) * $psize.','.$psize, $params); $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('site_article') . " WHERE uniacid = '{$_W['uniacid']}'".$condition, $params); $pager = pagination($total, $pindex, $psize); $article_ids = array(); if (!empty($list)) { foreach ($list as $item) { $article_ids[] = $item['id']; } } $article_comment = table('sitearticlecomment')-><API key>($article_ids); $setting = uni_setting($_W['uniacid']); template('site/article-display'); } elseif ($do == 'post') { $id = intval($_GPC['id']); $template = uni_templates(); $pcate = intval($_GPC['pcate']); $ccate = intval($_GPC['ccate']); if (!empty($id)) { $item = pdo_fetch("SELECT * FROM ".tablename('site_article')." WHERE id = :id" , array(':id' => $id)); $item['type'] = explode(',', $item['type']); $pcate = $item['pcate']; $ccate = $item['ccate']; if (empty($item)) { itoast('', '', 'error'); } $key = pdo_fetchall('SELECT content FROM ' . tablename('rule_keyword') . ' WHERE rid = :rid AND uniacid = :uniacid', array(':rid' => $item['rid'], ':uniacid' => $_W['uniacid'])); if (!empty($key)) { $keywords = array(); foreach ($key as $row) { $keywords[] = $row['content']; } $keywords = implode(',', array_values($keywords)); } $item['credit'] = iunserializer($item['credit']) ? iunserializer($item['credit']) : array(); if (!empty($item['credit']['limit'])) { $credit_num = pdo_fetchcolumn('SELECT SUM(credit_value) FROM ' . tablename('mc_handsel') . ' WHERE uniacid = :uniacid AND module = :module AND sign = :sign', array(':uniacid' => $_W['uniacid'], ':module' => 'article', ':sign' => md5(iserializer(array('id' => $id))))); if (is_null($credit_num)) { $credit_num = 0; } $credit_yu = (($item['credit']['limit'] - $credit_num) < 0) ? 0 : $item['credit']['limit'] - $credit_num; } } else { $item['credit'] = array(); $keywords = ''; } if (checksubmit('submit')) { if (empty($_GPC['title'])) { itoast('', '', ''); } $sensitive_title = <API key>($_GPC['title']); if (!empty($sensitive_title)) { itoast(':' . $sensitive_title, '', ''); } $sensitive_content = <API key>($_GPC['content']); if (!empty($sensitive_content)) { itoast(':' . $sensitive_content, '', ''); } $data = array( 'uniacid' => $_W['uniacid'], 'iscommend' => intval($_GPC['option']['commend']), 'ishot' => intval($_GPC['option']['hot']), 'pcate' => intval($_GPC['category']['parentid']), 'ccate' => intval($_GPC['category']['childid']), 'template' => addslashes($_GPC['template']), 'title' => addslashes($_GPC['title']), 'description' => addslashes($_GPC['description']), 'content' => safe_gpc_html(<API key>($_GPC['content'], ENT_QUOTES)), 'incontent' => intval($_GPC['incontent']), 'source' => addslashes($_GPC['source']), 'author' => addslashes($_GPC['author']), 'displayorder' => intval($_GPC['displayorder']), 'linkurl' => addslashes($_GPC['linkurl']), 'createtime' => TIMESTAMP, 'edittime' => TIMESTAMP, 'click' => intval($_GPC['click']) ); if (!empty($_GPC['thumb'])) { if (file_is_image($_GPC['thumb'])) { $data['thumb'] = $_GPC['thumb']; } } elseif (!empty($_GPC['autolitpic'])) { $match = array(); preg_match('/&lt;img.*?src=&quot;?(.+\.(jpg|jpeg|gif|bmp|png))&quot;/', $_GPC['content'], $match); if (!empty($match[1])) { $url = $match[1]; $file = <API key>($url); if (!is_error($file)) { $data['thumb'] = $file; file_remote_upload($file); } } } else { $data['thumb'] = ''; } $keyword = str_replace('', ',', trim($_GPC['keyword'])); $keyword = explode(',', $keyword); if (!empty($keyword)) { $rule['uniacid'] = $_W['uniacid']; $rule['name'] = '' . $_GPC['title'] . ' '; $rule['module'] = 'news'; $rule['status'] = 1; $keywords = array(); foreach ($keyword as $key) { $key = trim($key); if (empty($key)) continue; $keywords[] = array( 'uniacid' => $_W['uniacid'], 'module' => 'news', 'content' => $key, 'status' => 1, 'type' => 1, 'displayorder' => 1, ); } $reply['title'] = $_GPC['title']; $reply['description'] = $_GPC['description']; $reply['thumb'] = $data['thumb']; $reply['url'] = murl('site/site/detail', array('id' => $id)); } if (!empty($_GPC['credit']['status'])) { $credit['status'] = intval($_GPC['credit']['status']); $credit['limit'] = intval($_GPC['credit']['limit']) ? intval($_GPC['credit']['limit']) : itoast('', '', ''); $credit['share'] = intval($_GPC['credit']['share']) ? intval($_GPC['credit']['share']) : itoast('', '', ''); $credit['click'] = intval($_GPC['credit']['click']) ? intval($_GPC['credit']['click']) : itoast('', '', ''); $data['credit'] = iserializer($credit); } else { $data['credit'] = iserializer(array('status' => 0, 'limit' => 0, 'share' => 0, 'click' => 0)); } if (empty($id)) { unset($data['edittime']); if (!empty($keywords)) { pdo_insert('rule', $rule); $rid = pdo_insertid(); foreach ($keywords as $li) { $li['rid'] = $rid; pdo_insert('rule_keyword', $li); } $reply['rid'] = $rid; pdo_insert('news_reply', $reply); $data['rid'] = $rid; } pdo_insert('site_article', $data); $aid = pdo_insertid(); pdo_update('news_reply', array('url' => murl('site/site/detail', array('id' => $aid))), array('rid' => $rid)); } else { unset($data['createtime']); pdo_delete('rule', array('id' => $item['rid'], 'uniacid' => $_W['uniacid'])); pdo_delete('rule_keyword', array('rid' => $item['rid'], 'uniacid' => $_W['uniacid'])); pdo_delete('news_reply', array('rid' => $item['rid'])); if (!empty($keywords)) { pdo_insert('rule', $rule); $rid = pdo_insertid(); foreach ($keywords as $li) { $li['rid'] = $rid; pdo_insert('rule_keyword', $li); } $reply['rid'] = $rid; pdo_insert('news_reply', $reply); $data['rid'] = $rid; } else { $data['rid'] = 0; $data['kid'] = 0; } pdo_update('site_article', $data, array('id' => $id)); } itoast('', url('site/article/display'), 'success'); } else { template('site/article-post'); } } elseif($do == 'del') { if (checksubmit('submit')) { foreach ($_GPC['rid'] as $key => $id) { $id = intval($id); $row = pdo_get('site_article', array('id' => $id, 'uniacid' => $_W['uniacid'])); if (empty($row)) { itoast('', '', ''); } if (!empty($row['rid'])) { pdo_delete('rule', array('id' => $row['rid'], 'uniacid' => $_W['uniacid'])); pdo_delete('rule_keyword', array('rid' => $row['rid'], 'uniacid' => $_W['uniacid'])); pdo_delete('news_reply', array('rid' => $row['rid'])); } pdo_delete('site_article', array('id' => $id, 'uniacid'=>$_W['uniacid'])); } itoast('', referer(), 'success'); } else { $id = intval($_GPC['id']); $row = pdo_fetch("SELECT id,rid,kid,thumb FROM ".tablename('site_article')." WHERE id = :id", array(':id' => $id)); if (empty($row)) { itoast('', '', ''); } if (!empty($row['rid'])) { pdo_delete('rule', array('id' => $row['rid'], 'uniacid' => $_W['uniacid'])); pdo_delete('rule_keyword', array('rid' => $row['rid'], 'uniacid' => $_W['uniacid'])); pdo_delete('news_reply', array('rid' => $row['rid'])); } if (pdo_delete('site_article', array('id' => $id,'uniacid'=>$_W['uniacid']))){ itoast('', referer(), 'success'); } else { itoast('', referer(), 'error'); } } }
<?php namespace Kr\OAuthClient\Credentials; class Client extends AbstractCredentials { protected $clientId, $clientSecret, $redirectUri; /** * Client constructor. * @param string $clientId * @param string $clientSecret * @param string $redirectUri */ public function __construct($clientId, $clientSecret, $redirectUri) { $this->clientId = $clientId; $this->clientSecret = $clientSecret; $this->redirectUri = $redirectUri; } /** * @inheritdoc */ public function getCredentials() { return [ "client_id" => $this->getClientId(), "client_secret" => $this->getClientSecret(), "redirect_uri" => $this->getRedirectUri(), ]; } /** * @return mixed */ public function getClientId() { return $this->clientId; } /** * @return mixed */ public function getClientSecret() { return $this->clientSecret; } /** * @return mixed */ public function getRedirectUri() { return $this->redirectUri; } /** * @inheritdoc */ public static function getType() { return "client_credentials"; } }
$(function () { $('.imageUploadMultiple').each(function (index, item) { var $item = $(item); var $group = $item.closest('.form-group'); var $innerGroup = $item.find('.form-group'); var $errors = $item.find('.errors'); var $input = $item.find('.imageValue'); var flow = new Flow({ target: $item.data('target'), testChunks: false, chunkSize: 1024 * 1024 * 1024, query: { _token: $item.data('token') } }); var updateValue = function () { var values = []; $item.find('img[data-value]').each(function () { values.push($(this).data('value')); }); $input.val(values.join(',')); }; flow.assignBrowse($item.find('.imageBrowse')); flow.on('filesSubmitted', function (file) { flow.upload(); }); flow.on('fileSuccess', function (file, message) { flow.removeFile(file); $errors.html(''); $group.removeClass('has-error'); var result = $.parseJSON(message); $innerGroup.append('<div class="col-xs-6 col-md-3 imageThumbnail"><div class="thumbnail">' + '<img data-value="' + result.value + '" src="' + result.url + '" />' + '<a href="#" class="imageRemove">Remove</a></div></div>'); updateValue(); }); flow.on('fileError', function (file, message) { flow.removeFile(file); var response = $.parseJSON(message); var errors = ''; $.each(response, function (index, error) { errors += '<p class="help-block">' + error + '</p>' }); $errors.html(errors); $group.addClass('has-error'); }); $item.on('click', '.imageRemove', function (e) { e.preventDefault(); $(this).closest('.imageThumbnail').remove(); updateValue(); }); $innerGroup.sortable({ onUpdate: function () { updateValue(); } }); }); });
#!/bin/bash f="$1" d="$2" CURRENT_DIR=$( pushd $(dirname $0) >/dev/null; pwd; popd >/dev/null ) if [ ! -d $d ]; then echo "$d is not found" exit 2 fi F="$d/$f" if [ -f "$F" ]; then s1=`wc -c "$f" | cut -d ' ' -f 1` s2=`wc -c "$F" | cut -d ' ' -f 1` if [ $s1 -eq $s2 ]; then cksum1=`md5sum -b "$f" | cut -d ' ' -f 1` cksum2=`md5sum -b "$F" | cut -d ' ' -f 1` if [ "$cksum1" == "$cksum2" ]; then rm -v "$f" else echo "\"$F\" exists, has the same size, but different md5sum than \"$f\"" fi else echo "\"$F\" exists and has differrent size than \"$f\"" echo "\"$F\" - $s2" echo "\"$f\" - $s1" fi else echo "\"$F\" does not exist" fi
module Schema include Virtus.module(:constructor => false, :mass_assignment => false) def initialize <API key> end def attributes attribute_set.get(self) end def to_h attributes end end
#!/bin/sh # CYBERWATCH SAS - 2017 # Security fix for DSA-3663-1 # Operating System: Debian 8 (Jessie) # Architecture: i386 # - xen:4.4.1-9+deb8u7 # - libxen-4.4:4.4.1-9+deb8u7 # - libxenstore3.0:4.4.1-9+deb8u7 # - libxen-dev:4.4.1-9+deb8u7 # - xenstore-utils:4.4.1-9+deb8u7 # - xen-utils-common:4.4.1-9+deb8u7 # - xen-utils-4.4:4.4.1-9+deb8u7 # - xen-hypervisor-4.4-amd64:4.4.1-9+deb8u7 # - xen-system-amd64:4.4.1-9+deb8u7 # Last versions recommanded by security team: # - xen:4.4.1-9+deb8u7 # - libxen-4.4:4.4.1-9+deb8u7 # - libxenstore3.0:4.4.1-9+deb8u7 # - libxen-dev:4.4.1-9+deb8u7 # - xenstore-utils:4.4.1-9+deb8u7 # - xen-utils-common:4.4.1-9+deb8u7 # - xen-utils-4.4:4.4.1-9+deb8u7 # - xen-hypervisor-4.4-amd64:4.4.1-9+deb8u7 # - xen-system-amd64:4.4.1-9+deb8u7 # CVE List: # - CVE-2016-7092 # - CVE-2016-7094 # - CVE-2016-7154 # More details: sudo apt-get install --only-upgrade xen=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade libxen-4.4=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade libxenstore3.0=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade libxen-dev=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade xenstore-utils=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade xen-utils-common=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade xen-utils-4.4=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade xen-hypervisor-4.4-amd64=4.4.1-9+deb8u7 -y sudo apt-get install --only-upgrade xen-system-amd64=4.4.1-9+deb8u7 -y
(function (root, factory) { if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports === 'object') { factory(exports); } else { factory((root.commonJsStrict = {})); } }(this, function (exports) { function Node(obj, dimension, parent) { this.obj = obj; this.left = null; this.right = null; this.parent = parent; this.dimension = dimension; } function kdTree(points, metric, dimensions) { var self = this; function buildTree(points, depth, parent) { var dim = depth % dimensions.length, median, node; if (points.length === 0) { return null; } if (points.length === 1) { return new Node(points[0], dim, parent); } points.sort(function (a, b) { return a[dimensions[dim]] - b[dimensions[dim]]; }); median = Math.floor(points.length / 2); node = new Node(points[median], dim, parent); node.left = buildTree(points.slice(0, median), depth + 1, node); node.right = buildTree(points.slice(median + 1), depth + 1, node); return node; } // Reloads a serialied tree function loadTree (data) { // Just need to restore the `parent` parameter self.root = data; function restoreParent (root) { if (root.left) { root.left.parent = root; restoreParent(root.left); } if (root.right) { root.right.parent = root; restoreParent(root.right); } } restoreParent(self.root); } // If points is not an array, assume we're loading a pre-built tree if (!Array.isArray(points)) loadTree(points, metric, dimensions); else this.root = buildTree(points, 0, null); // Convert to a JSON serializable structure; this just requires removing // the `parent` property this.toJSON = function (src) { if (!src) src = this.root; var dest = new Node(src.obj, src.dimension, null); if (src.left) dest.left = self.toJSON(src.left); if (src.right) dest.right = self.toJSON(src.right); return dest; }; this.insert = function (point) { function innerSearch(node, parent) { if (node === null) { return parent; } var dimension = dimensions[node.dimension]; if (point[dimension] < node.obj[dimension]) { return innerSearch(node.left, node); } else { return innerSearch(node.right, node); } } var insertPosition = innerSearch(this.root, null), newNode, dimension; if (insertPosition === null) { this.root = new Node(point, 0, null); return; } newNode = new Node(point, (insertPosition.dimension + 1) % dimensions.length, insertPosition); dimension = dimensions[insertPosition.dimension]; if (point[dimension] < insertPosition.obj[dimension]) { insertPosition.left = newNode; } else { insertPosition.right = newNode; } }; this.remove = function (point) { var node; function nodeSearch(node) { if (node === null) { return null; } if (node.obj === point) { return node; } var dimension = dimensions[node.dimension]; if (point[dimension] < node.obj[dimension]) { return nodeSearch(node.left, node); } else { return nodeSearch(node.right, node); } } function removeNode(node) { var nextNode, nextObj, pDimension; function findMin(node, dim) { var dimension, own, left, right, min; if (node === null) { return null; } dimension = dimensions[dim]; if (node.dimension === dim) { if (node.left !== null) { return findMin(node.left, dim); } return node; } own = node.obj[dimension]; left = findMin(node.left, dim); right = findMin(node.right, dim); min = node; if (left !== null && left.obj[dimension] < own) { min = left; } if (right !== null && right.obj[dimension] < min.obj[dimension]) { min = right; } return min; } if (node.left === null && node.right === null) { if (node.parent === null) { self.root = null; return; } pDimension = dimensions[node.parent.dimension]; if (node.obj[pDimension] < node.parent.obj[pDimension]) { node.parent.left = null; } else { node.parent.right = null; } return; } // If the right subtree is not empty, swap with the minimum element on the // node's dimension. If it is empty, we swap the left and right subtrees and // do the same. if (node.right !== null) { nextNode = findMin(node.right, node.dimension); nextObj = nextNode.obj; removeNode(nextNode); node.obj = nextObj; } else { nextNode = findMin(node.left, node.dimension); nextObj = nextNode.obj; removeNode(nextNode); node.right = node.left; node.left = null; node.obj = nextObj; } } node = nodeSearch(self.root); if (node === null) { return; } removeNode(node); }; this.nearest = function (point, maxNodes, maxDistance) { var i, result, bestNodes; bestNodes = new BinaryHeap( function (e) { return -e[1]; } ); function nearestSearch(node) { var bestChild, dimension = dimensions[node.dimension], ownDistance = metric(point, node.obj), linearPoint = {}, linearDistance, otherChild, i; function saveNode(node, distance) { bestNodes.push([node, distance]); if (bestNodes.size() > maxNodes) { bestNodes.pop(); } } for (i = 0; i < dimensions.length; i += 1) { if (i === node.dimension) { linearPoint[dimensions[i]] = point[dimensions[i]]; } else { linearPoint[dimensions[i]] = node.obj[dimensions[i]]; } } linearDistance = metric(linearPoint, node.obj); if (node.right === null && node.left === null) { if (bestNodes.size() < maxNodes || ownDistance < bestNodes.peek()[1]) { saveNode(node, ownDistance); } return; } if (node.right === null) { bestChild = node.left; } else if (node.left === null) { bestChild = node.right; } else { if (point[dimension] < node.obj[dimension]) { bestChild = node.left; } else { bestChild = node.right; } } nearestSearch(bestChild); if (bestNodes.size() < maxNodes || ownDistance < bestNodes.peek()[1]) { saveNode(node, ownDistance); } if (bestNodes.size() < maxNodes || Math.abs(linearDistance) < bestNodes.peek()[1]) { if (bestChild === node.left) { otherChild = node.right; } else { otherChild = node.left; } if (otherChild !== null) { nearestSearch(otherChild); } } } if (maxDistance) { for (i = 0; i < maxNodes; i += 1) { bestNodes.push([null, maxDistance]); } } if(self.root) nearestSearch(self.root); result = []; for (i = 0; i < Math.min(maxNodes, bestNodes.content.length); i += 1) { if (bestNodes.content[i][0]) { result.push([bestNodes.content[i][0].obj, bestNodes.content[i][1]]); } } return result; }; this.balanceFactor = function () { function height(node) { if (node === null) { return 0; } return Math.max(height(node.left), height(node.right)) + 1; } function count(node) { if (node === null) { return 0; } return count(node.left) + count(node.right) + 1; } return height(self.root) / (Math.log(count(self.root)) / Math.log(2)); }; } // Binary heap implementation from: function BinaryHeap(scoreFunction){ this.content = []; this.scoreFunction = scoreFunction; } BinaryHeap.prototype = { push: function(element) { // Add the new element to the end of the array. this.content.push(element); // Allow it to bubble up. this.bubbleUp(this.content.length - 1); }, pop: function() { // Store the first element so we can return it later. var result = this.content[0]; // Get the element at the end of the array. var end = this.content.pop(); // If there are any elements left, put the end element at the // start, and let it sink down. if (this.content.length > 0) { this.content[0] = end; this.sinkDown(0); } return result; }, peek: function() { return this.content[0]; }, remove: function(node) { var len = this.content.length; // To remove a value, we must search through the array to find for (var i = 0; i < len; i++) { if (this.content[i] == node) { // When it is found, the process seen in 'pop' is repeated // to fill up the hole. var end = this.content.pop(); if (i != len - 1) { this.content[i] = end; if (this.scoreFunction(end) < this.scoreFunction(node)) this.bubbleUp(i); else this.sinkDown(i); } return; } } throw new Error("Node not found."); }, size: function() { return this.content.length; }, bubbleUp: function(n) { // Fetch the element that has to be moved. var element = this.content[n]; // When at 0, an element can not go up any further. while (n > 0) { // Compute the parent element's index, and fetch it. var parentN = Math.floor((n + 1) / 2) - 1, parent = this.content[parentN]; // Swap the elements if the parent is greater. if (this.scoreFunction(element) < this.scoreFunction(parent)) { this.content[parentN] = element; this.content[n] = parent; // Update 'n' to continue at the new position. n = parentN; } // Found a parent that is less, no need to move it further. else { break; } } }, sinkDown: function(n) { // Look up the target element and its score. var length = this.content.length, element = this.content[n], elemScore = this.scoreFunction(element); while(true) { // Compute the indices of the child elements. var child2N = (n + 1) * 2, child1N = child2N - 1; // This is used to store the new position of the element, // if any. var swap = null; // If the first child exists (is inside the array)... if (child1N < length) { // Look it up and compute its score. var child1 = this.content[child1N], child1Score = this.scoreFunction(child1); // If the score is less than our element's, we need to swap. if (child1Score < elemScore) swap = child1N; } // Do the same checks for the other child. if (child2N < length) { var child2 = this.content[child2N], child2Score = this.scoreFunction(child2); if (child2Score < (swap == null ? elemScore : child1Score)){ swap = child2N; } } // If the element needs to be moved, swap it, and continue. if (swap != null) { this.content[n] = this.content[swap]; this.content[swap] = element; n = swap; } // Otherwise, we are done. else { break; } } } }; this.kdTree = kdTree; exports.kdTree = kdTree; exports.BinaryHeap = BinaryHeap; }));
// function that finds the sum of two parameters function findSum(firstnr, secondnr){ return firstnr + secondnr; } //function that finds the product of two parameters function findProduct(firstnr, secondnr){ return firstnr * secondnr; } /* threeOperation calls the operation parameter as a function so it's able to run and "do" different things depending on the global function it takes as a parameter when calling it*/ function threeOperation (x, operation){ /*put console.log here so it doesn't only returns the result but also prints it in the console first: to check if it gives the right answer when it's called*/ console.log(operation(3, x)); return operation(3, x); } //Call "threeOperation" with the values of "4" and "findSum" threeOperation(4, findSum); //Call "threeOperation" with the values of "5" and "findSum" threeOperation(5, findSum); //Call "threeOperation" with the values of "4" and "findProduct" threeOperation(4, findProduct); //Call "threeOperation" with the values of "5" and "findProduct" threeOperation(5, findProduct);
// LJRouterPath.h // <API key> #import <Foundation/Foundation.h> @interface LJRouterPath : NSObject @property (nonatomic, strong) NSString *schema; @property (nonatomic, strong) NSArray *components; @property (nonatomic, strong) NSDictionary *params; - (instancetype)initWithRouterURL:(NSString *)URL; @end
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace Everyplay.XCodeEditor { public class XCConfigurationList : PBXObject { public XCConfigurationList(string guid, PBXDictionary dictionary) : base(guid, dictionary) { internalNewlines = true; } } }
// GPG4Browsers - An OpenPGP implementation in javascript // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // This library is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // You should have received a copy of the GNU Lesser General Public // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA var type_s2k = require('../type/s2k.js'), enums = require('../enums.js'), crypto = require('../crypto'); module.exports = <API key>; /** * @constructor */ function <API key>() { this.tag = enums.packet.<API key>; this.<API key> = null; this.sessionKeyAlgorithm = 'aes256'; this.encrypted = null; this.s2k = new type_s2k(); } /** * Parsing function for a symmetric encrypted session key packet (tag 3). * * @param {String} input Payload of a tag 1 packet * @param {Integer} position Position to start reading from the input string * @param {Integer} len * Length of the packet or the remaining length of * input at position * @return {module:packet/<API key>} Object representation */ <API key>.prototype.read = function(bytes) { // A one-octet version number. The only currently defined version is 4. this.version = bytes.charCodeAt(0); // A one-octet number describing the symmetric algorithm used. var algo = enums.read(enums.symmetric, bytes.charCodeAt(1)); // A string-to-key (S2K) specifier, length as defined above. var s2klength = this.s2k.read(bytes.substr(2)); // Optionally, the encrypted session key itself, which is decrypted // with the string-to-key object. var done = s2klength + 2; if (done < bytes.length) { this.encrypted = bytes.substr(done); this.<API key> = algo; } else this.sessionKeyAlgorithm = algo; }; <API key>.prototype.write = function() { var algo = this.encrypted === null ? this.sessionKeyAlgorithm : this.<API key>; var bytes = String.fromCharCode(this.version) + String.fromCharCode(enums.write(enums.symmetric, algo)) + this.s2k.write(); if (this.encrypted !== null) bytes += this.encrypted; return bytes; }; /** * Decrypts the session key (only for public key encrypted session key * packets (tag 1) * * @return {String} The unencrypted session key */ <API key>.prototype.decrypt = function(passphrase) { var algo = this.<API key> !== null ? this.<API key> : this.sessionKeyAlgorithm; var length = crypto.cipher[algo].keySize; var key = this.s2k.produce_key(passphrase, length); if (this.encrypted === null) { this.sessionKey = key; } else { var decrypted = crypto.cfb.decrypt( this.<API key>, key, this.encrypted, true); this.sessionKeyAlgorithm = enums.read(enums.symmetric, decrypted[0].keyCodeAt()); this.sessionKey = decrypted.substr(1); } }; <API key>.prototype.encrypt = function(passphrase) { var length = crypto.getKeyLength(this.<API key>); var key = this.s2k.produce_key(passphrase, length); var private_key = String.fromCharCode( enums.write(enums.symmetric, this.sessionKeyAlgorithm)) + crypto.getRandomBytes( crypto.getKeyLength(this.sessionKeyAlgorithm)); this.encrypted = crypto.cfb.encrypt( crypto.getPrefixRandom(this.<API key>), this.<API key>, key, private_key, true); }; /** * Fix custom types after cloning */ <API key>.prototype.postCloneTypeFix = function() { this.s2k = type_s2k.fromClone(this.s2k); };
""" train supervised classifier with what's cooking recipe data objective - determine recipe type categorical value from 20 """ import time from features_bow import * from features_word2vec import * from sklearn.preprocessing import StandardScaler from sklearn.ensemble import <API key>, <API key> from sklearn.linear_model import SGDClassifier from sklearn.cross_validation import cross_val_score """ main entry method """ def main(use_idf=False, random_state=None, std=False, n_jobs=-1, verbose=2): wc_idf_map = None if use_idf: # ingredients inverse document frequencies wc_components = build_tfidf_wc(verbose=(verbose > 0)) wc_idf = wc_components['model'].idf_ wc_idf_words = wc_components['model'].get_feature_names() wc_idf_map = dict(zip(wc_idf_words, wc_idf)) # word2vec recipe feature vectors wc_components = build_word2vec_wc(feature_vec_size=120, avg=True, idf=wc_idf_map, verbose=(verbose > 0)) y_train = wc_components['train']['df']['cuisine_code'].as_matrix() X_train = wc_components['train']['features_matrix'] # standardize features aka mean ~ 0, std ~ 1 if std: scaler = StandardScaler() scaler.fit(X_train) X_train = scaler.transform(X_train) # random forest supervised classifier time_0 = time.time() clf = <API key>(n_estimators=100, max_depth=None, n_jobs=n_jobs, random_state=random_state, verbose=verbose) # perform cross validation cv_n_fold = 8 print 'cross validating %s ways...' % cv_n_fold scores_cv = cross_val_score(clf, X_train, y_train, cv=cv_n_fold, n_jobs=-1) print 'accuracy: %0.5f (+/- %0.5f)' % (scores_cv.mean(), scores_cv.std() * 2) time_1 = time.time() elapsed_time = time_1 - time_0 print 'cross validation took %.3f seconds' % elapsed_time if __name__ == '__main__': main()
# -*- coding: utf-8 -*- # This file is part of Invenio. # Invenio is free software; you can redistribute it and/or modify it """Configuration options for Invenio-Search. The documentation for the configuration is in docs/configuration.rst. """ # ELASTIC configuration <API key> = None """Dictionary of options for the Elasticsearch client. The value of this variable is passed to :py:class:`elasticsearch.Elasticsearch` as keyword arguments and is used to configure the client. See the available keyword arguments in the two following classes: - :py:class:`elasticsearch.Elasticsearch` - :py:class:`elasticsearch.Transport` If you specify the key ``hosts`` in this dictionary, the configuration variable :py:class:`~invenio_search.config.<API key>` will have no effect. """ <API key> = None # default localhost """Elasticsearch hosts. By default, Invenio connects to ``localhost:9200``. The value of this variable is a list of dictionaries, where each dictionary represents a host. The available keys in each dictionary is determined by the connection class: - :py:class:`elasticsearch.connection.<API key>` (default) - :py:class:`elasticsearch.connection.<API key>` You can change the connection class via the :py:class:`~invenio_search.config.<API key>`. If you specified the ``hosts`` key in :py:class:`~invenio_search.config.<API key>` then this configuration variable will have no effect. """ SEARCH_MAPPINGS = None # loads all mappings and creates aliases for them """List of aliases for which, their search mappings should be created. - If `None` all aliases (and their search mappings) defined through the ``invenio_search.mappings`` entry point in setup.py will be created. - Provide an empty list ``[]`` if no aliases (or their search mappings) should be created. For example if you don't want to create aliases and their mappings for `authors`: .. code-block:: python # in your `setup.py` you would specify: entry_points={ 'invenio_search.mappings': [ 'records = invenio_foo_bar.mappings', 'authors = invenio_foo_bar.mappings', ], } # and in your config.py SEARCH_MAPPINGS = ['records'] """ <API key> = None SEARCH_INDEX_PREFIX = '' """Any index, alias and templates will be prefixed with this string. Useful to host multiple instances of the app on the same Elasticsearch cluster, for example on one app you can set it to `dev-` and on the other to `prod-`, and each will create non-colliding indices prefixed with the corresponding string. Usage example: .. code-block:: python # in your config.py SEARCH_INDEX_PREFIX = 'prod-' For templates, ensure that the prefix `<API key>` is added to your index names. This pattern will be replaced by the prefix config value. Usage example in your template.json: .. code-block:: json { "index_patterns": ["<API key>-*"] } """
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Setting extends Model { use SoftDeletes; protected $dates = ['deleted_at']; protected $table = 'avatars'; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>DSJCL</title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <!-- Navigation --> <nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark fixed-top"> <div class="container"> <a class="navbar-brand" href="index.html">Home</a> <button class="navbar-toggler <API key>" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarResponsive"> <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a class="nav-link" href="about.html">Comments</a> </li> <li class="nav-item"> <a class="nav-link" href="services.html">Constitution</a> </li> <li class="nav-item"> <a class="nav-link" href="contact.html">State and Nationals</a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="<API key>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> More </a> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="<API key>"> <a class="dropdown-item" href="portfolio-1-col.html">Announcements</a> <a class="dropdown-item" href="portfolio-2-col.html">Event Schedule</a> <a class="dropdown-item" href="portfolio-3-col.html">Officers</a> <a class="dropdown-item" href="portfolio-4-col.html">About JCL</a> <a class="dropdown-item" href="portfolio-item.html">Important Documents</a> </div> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownBlog" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> The Torch </a> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownBlog"> <a class="dropdown-item" href="blog-home-1.html">Edition 1</a> <a class="dropdown-item" href="blog-home-2.html">Edtion 2</a> <a class="dropdown-item" href="blog-post.html">Edition 3</a> </div> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownBlog" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Dev </a> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownBlog"> <a class="dropdown-item" href="full-width.html">Full Width Page</a> <a class="dropdown-item" href="sidebar.html">Sidebar Page</a> <a class="dropdown-item" href="faq.html">FAQ</a> <a class="dropdown-item" href="404.html">404</a> </div> </li> </ul> </div> </div> </nav> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3">State and Nationals <small></small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.html">Home</a> </li> <li class="breadcrumb-item active">State and Nationals</li> </ol> <!-- Image Header --> <img class="img-fluid rounded mb-4" src="http://placehold.it/1200x300" alt=""> <!-- Marketing Icons Section --> <div class="row"> <div class="col-lg-4 mb-4"> <div class="card h-100"> <h4 class="card-header">Card Title</h4> <div class="card-body"> <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente esse necessitatibus neque.</p> </div> <div class="card-footer"> <a href="#" class="btn btn-primary">Learn More</a> </div> </div> </div> <div class="col-lg-4 mb-4"> <div class="card h-100"> <h4 class="card-header">Card Title</h4> <div class="card-body"> <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reiciendis ipsam eos, nam perspiciatis natus commodi similique totam consectetur praesentium molestiae atque exercitationem ut consequuntur, sed eveniet, magni nostrum sint fuga.</p> </div> <div class="card-footer"> <a href="#" class="btn btn-primary">Learn More</a> </div> </div> </div> <div class="col-lg-4 mb-4"> <div class="card h-100"> <h4 class="card-header">Card Title</h4> <div class="card-body"> <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente esse necessitatibus neque.</p> </div> <div class="card-footer"> <a href="#" class="btn btn-primary">Learn More</a> </div> </div> </div> </div> <!-- /.row --> </div> <!-- /.container --> <!-- Footer --> <footer class="py-5 bg-dark"> <div class="container"> <p class="m-0 text-center text-white">Copyright &copy; All rights reserved Whitergirl279 2017</p> </div> <!-- /.container --> </footer> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/popper/popper.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.min.js"></script> </body> </html>
package net.robobalasko.dfa.gui; import net.robobalasko.dfa.core.Automaton; import net.robobalasko.dfa.core.exceptions.<API key>; import net.robobalasko.dfa.core.exceptions.<API key>; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.Document; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class MainFrame extends JFrame { private final Automaton automaton; private JButton checkButton; public MainFrame(final Automaton automaton) throws HeadlessException { super("DFA Simulator"); this.automaton = automaton; <API key>(WindowConstants.EXIT_ON_CLOSE); JPanel containerPanel = new JPanel(); containerPanel.setLayout(new BoxLayout(containerPanel, BoxLayout.PAGE_AXIS)); containerPanel.setBorder(new EmptyBorder(20, 20, 20, 20)); setContentPane(containerPanel); CanvasPanel canvasPanel = new CanvasPanel(this, automaton); containerPanel.add(canvasPanel); JPanel checkInputPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); containerPanel.add(checkInputPanel); final JTextField inputText = new JTextField(40); Document document = inputText.getDocument(); document.addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { checkButton.setEnabled(e.getDocument().getLength() > 0); } @Override public void removeUpdate(DocumentEvent e) { checkButton.setEnabled(e.getDocument().getLength() > 0); } @Override public void changedUpdate(DocumentEvent e) { checkButton.setEnabled(e.getDocument().getLength() > 0); } }); checkInputPanel.add(inputText); checkButton = new JButton("Check"); checkButton.setEnabled(false); checkButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { JOptionPane.showMessageDialog(MainFrame.this, automaton.acceptsString(inputText.getText()) ? "Input accepted." : "Input rejected."); } catch (<API key> ex) { JOptionPane.showMessageDialog(MainFrame.this, "Missing start node."); } catch (<API key> ex) { JOptionPane.showMessageDialog(MainFrame.this, "Not a good string. Automat doesn't accept it."); } } }); checkInputPanel.add(checkButton); setResizable(false); setVisible(true); pack(); } }
types: - utility id: <API key> Converts all tabs in a string to a given number of spaces, `4` by default. This is a boring modifier to output examples of. Here's just a few examples on how the syntax looks. {{ string | to_spaces }} {{ string | to_spaces:2 }}
from __future__ import unicode_literals from django.apps import AppConfig class RfhistoryConfig(AppConfig): name = 'RFHistory'
#include "main.h" #include "db.h" #include "init.h" #include "bitcoinrpc.h" using namespace json_spirit; using namespace std; // Return average network hashes per second based on the last 'lookup' blocks, // or from the last difficulty change if 'lookup' is nonpositive. // If 'height' is nonnegative, compute the estimate at the time when a given block was found. Value GetNetworkHashPS(int lookup, int height) { CBlockIndex *pb = pindexBest; if (height >= 0 && height < nBestHeight) pb = FindBlockByHeight(height); if (pb == NULL || !pb->nHeight) return 0; // If lookup is -1, then use blocks since last difficulty change. if (lookup <= 0) lookup = pb->nHeight % 2016 + 1; // If lookup is larger than chain, then set it to chain length. if (lookup > pb->nHeight) lookup = pb->nHeight; CBlockIndex *pb0 = pb; int64 minTime = pb0->GetBlockTime(); int64 maxTime = minTime; for (int i = 0; i < lookup; i++) { pb0 = pb0->pprev; int64 time = pb0->GetBlockTime(); minTime = std::min(time, minTime); maxTime = std::max(time, maxTime); } // In case there's a situation where minTime == maxTime, we don't want a divide by zero exception. if (minTime == maxTime) return 0; uint256 workDiff = pb->nChainWork - pb0->nChainWork; int64 timeDiff = maxTime - minTime; return (boost::int64_t)(workDiff.getdouble() / timeDiff); } Value getnetworkhashps(const Array& params, bool fHelp) { if (fHelp || params.size() > 2) throw runtime_error( "getnetworkhashps [blocks] [height]\n" "Returns the estimated network hashes per second based on the last 120 blocks.\n" "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n" "Pass in [height] to estimate the network speed at the time when a certain block was found."); return GetNetworkHashPS(params.size() > 0 ? params[0].get_int() : 120, params.size() > 1 ? params[1].get_int() : -1); } // Key used by getwork/getblocktemplate miners. // Allocated in InitRPCMining, free'd in ShutdownRPCMining static CReserveKey* pMiningKey = NULL; void InitRPCMining() { if (!pwalletMain) return; // getwork/getblocktemplate mining rewards paid here: pMiningKey = new CReserveKey(pwalletMain); } void ShutdownRPCMining() { if (!pMiningKey) return; delete pMiningKey; pMiningKey = NULL; } Value getgenerate(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getgenerate\n" "Returns true or false."); if (!pMiningKey) return false; return GetBoolArg("-gen"); } Value setgenerate(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "setgenerate <generate> [genproclimit]\n" "<generate> is true or false to turn generation on or off.\n" "Generation is limited to [genproclimit] processors, -1 is unlimited."); bool fGenerate = true; if (params.size() > 0) fGenerate = params[0].get_bool(); if (params.size() > 1) { int nGenProcLimit = params[1].get_int(); mapArgs["-genproclimit"] = itostr(nGenProcLimit); if (nGenProcLimit == 0) fGenerate = false; } mapArgs["-gen"] = (fGenerate ? "1" : "0"); assert(pwalletMain != NULL); GenerateBitcoins(fGenerate, pwalletMain); return Value::null; } Value gethashespersec(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "gethashespersec\n" "Returns a recent hashes per second performance measurement while generating."); if (GetTimeMillis() - nHPSTimerStart > 8000) return (boost::int64_t)0; return (boost::int64_t)dHashesPerSec; } Value getmininginfo(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getmininginfo\n" "Returns an object containing mining-related information."); Object obj; obj.push_back(Pair("blocks", (int)nBestHeight)); obj.push_back(Pair("currentblocksize",(uint64_t)nLastBlockSize)); obj.push_back(Pair("currentblocktx",(uint64_t)nLastBlockTx)); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("errors", GetWarnings("statusbar"))); obj.push_back(Pair("generate", GetBoolArg("-gen"))); obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1))); obj.push_back(Pair("hashespersec", gethashespersec(params, false))); obj.push_back(Pair("networkhashps", getnetworkhashps(params, false))); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); obj.push_back(Pair("testnet", fTestNet)); return obj; } Value getworkex(const Array& params, bool fHelp) { if (fHelp || params.size() > 2) throw runtime_error( "getworkex [data, coinbase]\n" "If [data, coinbase] is not specified, returns extended work data.\n" ); if (vNodes.empty()) throw JSONRPCError(<API key>, "Riestercoin is not connected!"); if (<API key>()) throw JSONRPCError(<API key>, "Riestercoin is downloading blocks..."); typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t; static mapNewBlock_t mapNewBlock; // FIXME: thread safety static vector<CBlockTemplate*> vNewBlockTemplate; static CReserveKey reservekey(pwalletMain); if (params.size() == 0) { // Update block static unsigned int <API key>; static CBlockIndex* pindexPrev; static int64 nStart; static CBlockTemplate* pblocktemplate; if (pindexPrev != pindexBest || (<API key> != <API key> && GetTime() - nStart > 60)) { if (pindexPrev != pindexBest) { // Deallocate old blocks since they're obsolete now mapNewBlock.clear(); BOOST_FOREACH(CBlockTemplate* pblocktemplate, vNewBlockTemplate) delete pblocktemplate; vNewBlockTemplate.clear(); } // Clear pindexPrev so future getworks make a new block, despite any failures from here on pindexPrev = NULL; // Store the pindexBest used before CreateNewBlock, to avoid races <API key> = <API key>; CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block pblocktemplate = <API key>(*pMiningKey); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); vNewBlockTemplate.push_back(pblocktemplate); // Need to update only after we know CreateNewBlock succeeded pindexPrev = pindexPrevNew; } CBlock* pblock = &pblocktemplate->block; // pointer for convenience // Update nTime pblock->UpdateTime(pindexPrev); pblock->nNonce = 0; // Update nExtraNonce static unsigned int nExtraNonce = 0; IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); // Save mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig); // Pre-build hash buffers char pmidstate[32]; char pdata[128]; char phash1[64]; FormatHashBuffers(pblock, pmidstate, pdata, phash1); uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); CTransaction coinbaseTx = pblock->vtx[0]; std::vector<uint256> merkle = pblock->GetMerkleBranch(0); Object result; result.push_back(Pair("data", HexStr(BEGIN(pdata), END(pdata)))); result.push_back(Pair("target", HexStr(BEGIN(hashTarget), END(hashTarget)))); CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << coinbaseTx; result.push_back(Pair("coinbase", HexStr(ssTx.begin(), ssTx.end()))); Array merkle_arr; BOOST_FOREACH(uint256 merkleh, merkle) { printf("%s\n", merkleh.ToString().c_str()); merkle_arr.push_back(HexStr(BEGIN(merkleh), END(merkleh))); } result.push_back(Pair("merkle", merkle_arr)); return result; } else { // Parse parameters vector<unsigned char> vchData = ParseHex(params[0].get_str()); vector<unsigned char> coinbase; if(params.size() == 2) coinbase = ParseHex(params[1].get_str()); if (vchData.size() != 128) throw JSONRPCError(<API key>, "Invalid parameter"); CBlock* pdata = (CBlock*)&vchData[0]; // Byte reverse for (int i = 0; i < 128/4; i++) ((unsigned int*)pdata)[i] = ByteReverse(((unsigned int*)pdata)[i]); // Get saved block if (!mapNewBlock.count(pdata->hashMerkleRoot)) return false; CBlock* pblock = mapNewBlock[pdata->hashMerkleRoot].first; pblock->nTime = pdata->nTime; pblock->nNonce = pdata->nNonce; if(coinbase.size() == 0) pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second; else CDataStream(coinbase, SER_NETWORK, PROTOCOL_VERSION) >> pblock->vtx[0]; pblock->hashMerkleRoot = pblock->BuildMerkleTree(); return CheckWork(pblock, *pwalletMain, reservekey); } } Value getwork(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) throw runtime_error( "getwork [data]\n" "If [data] is not specified, returns formatted hash data to work on:\n" " \"midstate\" : precomputed hash state after hashing the first half of the data (DEPRECATED)\n" // deprecated " \"data\" : block data\n" " \"hash1\" : formatted hash buffer for second hash (DEPRECATED)\n" // deprecated " \"target\" : little endian hash target\n" "If [data] is specified, tries to solve the block and returns true if it was successful."); if (vNodes.empty()) throw JSONRPCError(<API key>, "Riestercoin is not connected!"); if (<API key>()) throw JSONRPCError(<API key>, "Riestercoin is downloading blocks..."); typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t; static mapNewBlock_t mapNewBlock; // FIXME: thread safety static vector<CBlockTemplate*> vNewBlockTemplate; if (params.size() == 0) { // Update block static unsigned int <API key>; static CBlockIndex* pindexPrev; static int64 nStart; static CBlockTemplate* pblocktemplate; if (pindexPrev != pindexBest || (<API key> != <API key> && GetTime() - nStart > 60)) { if (pindexPrev != pindexBest) { // Deallocate old blocks since they're obsolete now mapNewBlock.clear(); BOOST_FOREACH(CBlockTemplate* pblocktemplate, vNewBlockTemplate) delete pblocktemplate; vNewBlockTemplate.clear(); } // Clear pindexPrev so future getworks make a new block, despite any failures from here on pindexPrev = NULL; // Store the pindexBest used before CreateNewBlock, to avoid races <API key> = <API key>; CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block pblocktemplate = <API key>(*pMiningKey); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); vNewBlockTemplate.push_back(pblocktemplate); // Need to update only after we know CreateNewBlock succeeded pindexPrev = pindexPrevNew; } CBlock* pblock = &pblocktemplate->block; // pointer for convenience // Update nTime pblock->UpdateTime(pindexPrev); pblock->nNonce = 0; // Update nExtraNonce static unsigned int nExtraNonce = 0; IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); // Save mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig); // Pre-build hash buffers char pmidstate[32]; char pdata[128]; char phash1[64]; FormatHashBuffers(pblock, pmidstate, pdata, phash1); uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); Object result; result.push_back(Pair("midstate", HexStr(BEGIN(pmidstate), END(pmidstate)))); // deprecated result.push_back(Pair("data", HexStr(BEGIN(pdata), END(pdata)))); result.push_back(Pair("hash1", HexStr(BEGIN(phash1), END(phash1)))); // deprecated result.push_back(Pair("target", HexStr(BEGIN(hashTarget), END(hashTarget)))); return result; } else { // Parse parameters vector<unsigned char> vchData = ParseHex(params[0].get_str()); if (vchData.size() != 128) throw JSONRPCError(<API key>, "Invalid parameter"); CBlock* pdata = (CBlock*)&vchData[0]; // Byte reverse for (int i = 0; i < 128/4; i++) ((unsigned int*)pdata)[i] = ByteReverse(((unsigned int*)pdata)[i]); // Get saved block if (!mapNewBlock.count(pdata->hashMerkleRoot)) return false; CBlock* pblock = mapNewBlock[pdata->hashMerkleRoot].first; pblock->nTime = pdata->nTime; pblock->nNonce = pdata->nNonce; pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second; pblock->hashMerkleRoot = pblock->BuildMerkleTree(); assert(pwalletMain != NULL); return CheckWork(pblock, *pwalletMain, *pMiningKey); } } Value getblocktemplate(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) throw runtime_error( "getblocktemplate [params]\n" "Returns data needed to construct a block to work on:\n" " \"version\" : block version\n" " \"previousblockhash\" : hash of current highest block\n" " \"transactions\" : contents of non-coinbase transactions that should be included in the next block\n" " \"coinbaseaux\" : data that should be included in coinbase\n" " \"coinbasevalue\" : maximum allowable input to coinbase transaction, including the generation award and transaction fees\n" " \"target\" : hash target\n" " \"mintime\" : minimum timestamp appropriate for next block\n" " \"curtime\" : current timestamp\n" " \"mutable\" : list of ways the block template may be changed\n" " \"noncerange\" : range of valid nonces\n" " \"sigoplimit\" : limit of sigops in blocks\n" " \"sizelimit\" : limit of block size\n" " \"bits\" : compressed target of next block\n" " \"height\" : height of the next block\n" "See https://en.bitcoin.it/wiki/BIP_0022 for full specification."); std::string strMode = "template"; if (params.size() > 0) { const Object& oparam = params[0].get_obj(); const Value& modeval = find_value(oparam, "mode"); if (modeval.type() == str_type) strMode = modeval.get_str(); else if (modeval.type() == null_type) { /* Do nothing */ } else throw JSONRPCError(<API key>, "Invalid mode"); } if (strMode != "template") throw JSONRPCError(<API key>, "Invalid mode"); if (vNodes.empty()) throw JSONRPCError(<API key>, "Riestercoin is not connected!"); if (<API key>()) throw JSONRPCError(<API key>, "Riestercoin is downloading blocks..."); // Update block static unsigned int <API key>; static CBlockIndex* pindexPrev; static int64 nStart; static CBlockTemplate* pblocktemplate; if (pindexPrev != pindexBest || (<API key> != <API key> && GetTime() - nStart > 5)) { // Clear pindexPrev so future calls make a new block, despite any failures from here on pindexPrev = NULL; // Store the pindexBest used before CreateNewBlock, to avoid races <API key> = <API key>; CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block if(pblocktemplate) { delete pblocktemplate; pblocktemplate = NULL; } CScript scriptDummy = CScript() << OP_TRUE; pblocktemplate = CreateNewBlock(scriptDummy); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); // Need to update only after we know CreateNewBlock succeeded pindexPrev = pindexPrevNew; } CBlock* pblock = &pblocktemplate->block; // pointer for convenience // Update nTime pblock->UpdateTime(pindexPrev); pblock->nNonce = 0; Array transactions; map<uint256, int64_t> setTxIndex; int i = 0; BOOST_FOREACH (CTransaction& tx, pblock->vtx) { uint256 txHash = tx.GetHash(); setTxIndex[txHash] = i++; if (tx.IsCoinBase()) continue; Object entry; CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << tx; entry.push_back(Pair("data", HexStr(ssTx.begin(), ssTx.end()))); entry.push_back(Pair("hash", txHash.GetHex())); Array deps; BOOST_FOREACH (const CTxIn &in, tx.vin) { if (setTxIndex.count(in.prevout.hash)) deps.push_back(setTxIndex[in.prevout.hash]); } entry.push_back(Pair("depends", deps)); int index_in_template = i - 1; entry.push_back(Pair("fee", pblocktemplate->vTxFees[index_in_template])); entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[index_in_template])); transactions.push_back(entry); } Object aux; aux.push_back(Pair("flags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end()))); uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); static Array aMutable; if (aMutable.empty()) { aMutable.push_back("time"); aMutable.push_back("transactions"); aMutable.push_back("prevblock"); } Object result; result.push_back(Pair("version", pblock->nVersion)); result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex())); result.push_back(Pair("transactions", transactions)); result.push_back(Pair("coinbaseaux", aux)); result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue)); result.push_back(Pair("target", hashTarget.GetHex())); result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1)); result.push_back(Pair("mutable", aMutable)); result.push_back(Pair("noncerange", "00000000ffffffff")); result.push_back(Pair("sigoplimit", (int64_t)MAX_BLOCK_SIGOPS)); result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SIZE)); result.push_back(Pair("curtime", (int64_t)pblock->nTime)); result.push_back(Pair("bits", HexBits(pblock->nBits))); result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1))); return result; } Value submitblock(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "submitblock <hex data> [optional-params-obj]\n" "[optional-params-obj] parameter is currently ignored.\n" "Attempts to submit new block to network.\n" "See https://en.bitcoin.it/wiki/BIP_0022 for full specification."); vector<unsigned char> blockData(ParseHex(params[0].get_str())); CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION); CBlock pblock; try { ssBlock >> pblock; } catch (std::exception &e) { throw JSONRPCError(<API key>, "Block decode failed"); } CValidationState state; bool fAccepted = ProcessBlock(state, NULL, &pblock); if (!fAccepted) return "rejected"; // TODO: report validation state return Value::null; }
<!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8"> <title>Interlude</title> </head> <link href="css/interlude.css" media="screen" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script> <script src="lib/interlude.js"></script> <script src="lib/CV_particles.js"></script> <style> #sample { position: absolute; left: 10%; top: 10%; width: 80%; height: 80%; background: yellow; } </style> <script> function start() { var o = {}; o.div = "sample"; o.centered = true; // var a = new Interlude.Loading(o); // var x = new Interlude.Forms(o); var p = {}; p.div = "sample"; var z = new Particles(p); }; $( document ).ready(function() { $("#sample").click(function(){ start(); }); }); </script> <body> <!-- Invisible comment --> <div id = "sample"></div> </body> </html>
#ifndef _PARSER_HPP #define _PARSER_HPP #include <cassert> #include <iostream> #include <vector> #include <string> #include <cstdlib> #include "toyobj.hpp" #include "lexer.hpp" #include "toy.hpp" #include "ast.hpp" class ParserContext { public: explicit ParserContext(LexerContext &lexer) : lexer_(lexer) { lexer_.fetchtok(); } AST *parse_ast(bool); private: Statement *parse_statement(); Statement *parse_while(); Statement *parse_if(); Statement *parse_return(); Statement *parse_def(); Expression *parse_expression(); Expression *parse_primary(); Expression *<API key>(Expression*, int); Expression *<API key>(); Expression *parse_number(); Expression *parse_string(); Expression *<API key>(); AST *parse_block(); int get_prec(TokenType) const; inline const Token *curtok() { return lexer_.curtok(); } inline void eat_token(TokenType type) { if (type != curtok()->type()) { std::cout << "I was expecting " << Token::token_type_name(type) << " but got " << curtok()->name() << std::endl; exit(1); } lexer_.fetchtok(); } LexerContext &lexer_; <API key>(ParserContext); }; #endif
require 'aws-sdk' require 'awspec/resource_reader' require 'awspec/helper/finder' module Awspec::Type class Base include Awspec::Helper::Finder include Awspec::<API key> attr_accessor :account def resource_via_client raise 'this method must be override!' end def to_s type = self.class.name.demodulize.underscore "#{type} '#{@display_name}'" end def inspect to_s end def self.tags_allowed define_method :has_tag? do |key, value| begin tags = resource_via_client.tags rescue NoMethodError tags = resource_via_client.tag_set end return false unless tags tags.any? { |t| t['key'] == key && t['value'] == value } end end def method_missing(name) name_str = name.to_s if name.class == Symbol describe = name_str.tr('-', '_').to_sym if !resource_via_client.nil? && resource_via_client.members.include?(describe) resource_via_client[describe] else super unless self.respond_to?(:resource) <API key>(name, delegate_to: resource) end end end end
// EPTTimer.h // PodcastTimer #import <Foundation/Foundation.h> @protocol EPTTimerDelegate <NSObject> - (void)timerFired; @end @interface EPTTimer : NSObject @property (nonatomic) id<EPTTimerDelegate> delegate; - (void)scheduleTimer; - (void)stopTimer; @end
package core import ( . "github.com/smartystreets/goconvey/convey" "strings" "testing" ) func TestValidateSymbol(t *testing.T) { Convey("Given a node name validation function", t, func() { cases := []struct { title string name string success bool }{ {"an empty string", "", false}, {"one alphabet name", "a", true}, {"one digit name", "0", false}, {"one underscore name", "_", false}, {"a name starting from a digit", "0test", false}, {"a name starting from an underscore", "_test", false}, {"a name only containing alphabet", "test", true}, {"a name containing alphabet-digit", "t1e2s3t4", true}, {"a name containing <API key>", "t1e2_s3t4", true}, {"a name containing an invalid letter", "da-me", false}, {"a name has maximum length", strings.Repeat("a", 127), true}, {"a name longer than the maximum length", strings.Repeat("a", 128), false}, {"a reserved word", "UNTIL", false}, {"a reserved word with different capitalization", "vaLIdaTE", false}, } for _, c := range cases { c := c Convey("When validating "+c.title, func() { if c.success { Convey("Then it should succeed", func() { So(ValidateSymbol(c.name), ShouldBeNil) }) } else { Convey("Then it should fail", func() { So(ValidateSymbol(c.name), ShouldNotBeNil) }) } }) } }) } func <API key>(t *testing.T) { Convey("Given validateCapacity function", t, func() { Convey("When passing a valid value to it", func() { Convey("Then it should accept 0", func() { So(validateCapacity(0), ShouldBeNil) }) Convey("Then it should accept a maximum value", func() { So(validateCapacity(MaxCapacity), ShouldBeNil) }) }) Convey("When passing a too large value", func() { Convey("Then it should fail", func() { So(validateCapacity(MaxCapacity+1), ShouldNotBeNil) }) }) Convey("When passing a negative value", func() { Convey("Then it should fail", func() { So(validateCapacity(-1), ShouldNotBeNil) }) }) }) }
require './lib/graph' require './lib/path_measurer' require './lib/path_searcher' require './lib/path_explorer' require './lib/<API key>' require './lib/<API key>' require './lib/<API key>' edges = [] $stdin.each_line do | line | line.strip! edges.concat line.split(/\s|,\s|,/) end graph = Graph.new path_measurer = PathMeasurer.new(graph) path_searcher = PathSearcher.new(graph) <API key> = <API key>.new(graph, 4) <API key> = <API key>.new(graph, 3) <API key> = <API key>.new(graph, 30) <API key> = PathExplorer.new(graph, <API key>) <API key> = PathExplorer.new(graph, <API key>) <API key> = PathExplorer.new(graph, <API key>) edges.each do | edge | graph.add_edge(edge[0], edge[1], edge[2..-1].to_i) end # 1. The distance of the route A-B-C. puts 'Output #1: ' + path_measurer.distance(['A', 'B', 'C']).to_s # 2. The distance of the route A-D. puts 'Output #2: ' + path_measurer.distance(['A', 'D']).to_s # 3. The distance of the route A-D-C. puts 'Output #3: ' + path_measurer.distance(['A', 'D', 'C']).to_s # 4. The distance of the route A-E-B-C-D. puts 'Output #4: ' + path_measurer.distance(['A', 'E', 'B', 'C', 'D']).to_s # 5. The distance of the route A-E-D. puts 'Output #5: ' + path_measurer.distance(['A', 'E', 'D']).to_s # 6. The number of trips starting at C and ending at # C with a maximum of 3 stops. puts 'Output #6: ' + <API key>.explore('C', 'C').count.to_s # 7. The number of trips starting at A and ending at # C with exactly 4 stops. puts 'Output #7: ' + <API key>.explore('A', 'C').count.to_s # 8. The length of the shortest route (in terms of # distance to travel) from A to C. puts 'Output #8: ' + path_searcher.shortest_path('A', 'C').to_s # 9. The length of the shortest route (in terms of # distance to travel) from B to B. puts 'Output #9: ' + path_searcher.shortest_path('B', 'B').to_s # 10. The number of different routes from C to C with # a distance of less than 30. puts 'Output #10: ' + <API key>.explore('C', 'C').count.to_s
export default { FETCH_TAGS_PENDING: Symbol("FETCH_TAGS_PENDING"), FETCH_TAGS_SUCCESS: Symbol("FETCH_TAGS_SUCCESS"), FETCH_TAGS_FAILURE: Symbol("FETCH_TAGS_FAILURE"), FILTER_TAGS: Symbol("FILTER_TAGS"), ORDER_TAGS: Symbol("ORDER_TAGS") };
import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; import { Observable } from 'rxjs/Observable'; import { AngularFireDatabase, <API key> } from 'angularfire2/database'; import { AngularFireAuth } from 'angularfire2/auth'; import * as firebase from 'firebase/app'; import {Http, Headers} from '@angular/http'; import {Router } from '@angular/router'; import 'rxjs/add/operator/map'; @Injectable() export class AuthService { submission: <API key><any>; constructor(public afAuth: AngularFireAuth, private db: AngularFireDatabase, private router: Router){ console.log("Authentication service started"); console.log(firebase.auth()); } login(email, pass){ this.afAuth.auth.<API key>(email, pass) .then(res => { console.log('Nice, logging you in!!!'); this.router.navigate(['/admin']); }); } checkAuth(){ this.afAuth.authState.subscribe(res => { if (res && res.uid) { console.log('user is logged in'); return true; } else { console.log('user not logged in...redirecting to welcome..'); this.router.navigate(['/login']); return false; } }); } logout() { this.afAuth.auth.signOut(); this.router.navigate(['/']); } }
/** * * @function * @param {Array|arraylike} value * @param {Function} cmd * @param {any} context * @returns {?} */ export default function eachValue(value, cmd, context, keepReverse) { if (value === undefined || value === null) return undefined; const size = (0 | value.length) - 1; for (let index = size; index > -1; index -= 1) { const i = keepReverse ? index : size - index; const item = value[i]; const resolve = cmd.call(context || item, item, i, value, i); if (resolve === undefined === false) { return resolve; } } return undefined; }
package scalation.analytics import scalation.linalgebra.{MatriD, MatrixD, VectorD} /** The `Centering` object is used to center the input matrix 'x'. This is done by * subtracting the column means from each value. */ object Centering { /** Center the input matrix 'x' to zero mean, columnwise, by subtracting the mean. * @param x the input matrix to center * @param mu_x the vector of column means of matrix x */ def center (x: MatriD, mu_x: VectorD): MatrixD = { val x_c = new MatrixD (x.dim1, x.dim2) for (j <- 0 until x.dim2) { x_c.setCol (j, x.col(j) - mu_x(j)) // subtract column means } // for x_c } // center } // Centering object
const should = require('should'), sinon = require('sinon'), _ = require('lodash'), settingsCache = require('../../../../server/services/settings/cache'), common = require('../../../../server/lib/common'), controllers = require('../../../../server/services/routing/controllers'), TaxonomyRouter = require('../../../../server/services/routing/TaxonomyRouter'), RESOURCE_CONFIG = require('../../../../server/services/routing/assets/resource-config'), sandbox = sinon.sandbox.create(); describe('UNIT - services/routing/TaxonomyRouter', function () { let req, res, next; beforeEach(function () { sandbox.stub(settingsCache, 'get').withArgs('permalinks').returns('/:slug/'); sandbox.stub(common.events, 'emit'); sandbox.stub(common.events, 'on'); sandbox.spy(TaxonomyRouter.prototype, 'mountRoute'); sandbox.spy(TaxonomyRouter.prototype, 'mountRouter'); req = sandbox.stub(); res = sandbox.stub(); next = sandbox.stub(); res.locals = {}; }); afterEach(function () { sandbox.restore(); }); it('instantiate', function () { const taxonomyRouter = new TaxonomyRouter('tag', '/tag/:slug/'); should.exist(taxonomyRouter.router); should.exist(taxonomyRouter.rssRouter); taxonomyRouter.taxonomyKey.should.eql('tag'); taxonomyRouter.getPermalinks().getValue().should.eql('/tag/:slug/'); common.events.emit.calledOnce.should.be.true(); common.events.emit.calledWith('router.created', taxonomyRouter).should.be.true(); taxonomyRouter.mountRouter.callCount.should.eql(1); taxonomyRouter.mountRouter.args[0][0].should.eql('/tag/:slug/'); taxonomyRouter.mountRouter.args[0][1].should.eql(taxonomyRouter.rssRouter.router()); taxonomyRouter.mountRoute.callCount.should.eql(3); // permalink route taxonomyRouter.mountRoute.args[0][0].should.eql('/tag/:slug/'); taxonomyRouter.mountRoute.args[0][1].should.eql(controllers.channel); // pagination feature taxonomyRouter.mountRoute.args[1][0].should.eql('/tag/:slug/page/:page(\\d+)'); taxonomyRouter.mountRoute.args[1][1].should.eql(controllers.channel); // edit feature taxonomyRouter.mountRoute.args[2][0].should.eql('/tag/:slug/edit'); taxonomyRouter.mountRoute.args[2][1].should.eql(taxonomyRouter._redirectEditOption.bind(taxonomyRouter)); }); it('fn: _prepareContext', function () { const taxonomyRouter = new TaxonomyRouter('tag', '/tag/:slug/'); taxonomyRouter._prepareContext(req, res, next); next.calledOnce.should.eql(true); res.locals.routerOptions.should.eql({ name: 'tag', permalinks: '/tag/:slug/', type: RESOURCE_CONFIG.QUERY.tag.resource, data: {tag: _.omit(RESOURCE_CONFIG.QUERY.tag, 'alias')}, filter: RESOURCE_CONFIG.TAXONOMIES.tag.filter, context: ['tag'], slugTemplate: true, identifier: taxonomyRouter.identifier }); res._route.type.should.eql('channel'); }); });
<?php use Snscripts\HtmlHelper\Html; use Snscripts\HtmlHelper\Services; use Snscripts\HtmlHelper\Helpers; class HtmlTest extends \<API key> { public function <API key>() { $this->assertInstanceOf( 'Snscripts\HtmlHelper\Html', new Html( new Helpers\Form( new Services\Basic\Data ), new Services\Basic\Router, new Services\Basic\Assets ) ); } /** * return an instance of the Html Helper * with constructor */ protected function getHtml() { return new Html( new Helpers\Form( new Services\Basic\Data ), new Services\Basic\Router, new Services\Basic\Assets ); } /** * return an instance of the Html Helper * with constructor dissabled so we can test the constructor setters */ protected function <API key>() { return $this->getMockBuilder('\Snscripts\HtmlHelper\Html') ->setMethods(array('__construct')) ->setConstructorArgs(array(false, false)) -><API key>() ->getMock(); } public function <API key>() { $Html = $this-><API key>(); $this->assertTrue( $Html->setForm( new Helpers\Form( new Services\Basic\Data ) ) ); } public function <API key>() { $this-><API key>('<API key>'); $Html = $this-><API key>(); $Html->setForm( new \stdClass ); } public function <API key>() { $Html = $this-><API key>(); $this->assertTrue( $Html->setRouter( new Services\Basic\Router ) ); } public function <API key>() { $this-><API key>('<API key>'); $Html = $this-><API key>(); $Html->setRouter( new \stdClass ); } public function <API key>() { $Html = $this-><API key>(); $this->assertTrue( $Html->setAssets( new Services\Basic\Assets ) ); } public function <API key>() { $this-><API key>('<API key>'); $Html = $this-><API key>(); $Html->setAssets( new \stdClass ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<div class="myClass" id="content">Div Contents</div>', $Html->tag( 'div', array( 'class' => 'myClass', 'id' => 'content' ), 'Div Contents', true ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<div class="myClass" id="content">Div Contents</div>', $Html->div( 'Div Contents', array( 'class' => 'myClass', 'id' => 'content' ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<p class="intro">Paragraph Contents</p>', $Html->p( 'Paragraph Contents', array( 'class' => 'intro' ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<ul id="main ul"><li>this is a list item</li><li>this is a list item 2</li><li>sub-item<ul><li>will they work?</li><li>or won\'t they, who knows?</li></ul></li><li id="listID">subitem attr!<ul id="sub-list"><li>this is a sub item</li><li>this list should have attributes</li></ul></li></ul>', $Html->ul( array( 'this is a list item', 'this is a list item 2', 'sub-item' => array( 'will they work?', 'or won\'t they, who knows?' ), 'subitem attr!' => array( 'attr' => array( 'id' => 'listID' ), 'listAttr' => array( 'id' => 'sub-list' ), 'list' => array( 'this is a sub item', 'this list should have attributes' ) ) ), array( 'id' => 'main ul' ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<ol id="main ol"><li>this is a list item</li><li>this is a list item 2</li><li>sub-item<ol><li>will they work?</li><li>or won\'t they, who knows?</li></ol></li><li id="listID">subitem attr!<ol id="sub-list"><li>this is a sub item</li><li>this list should have attributes</li></ol></li></ol>', $Html->ol( array( 'this is a list item', 'this is a list item 2', 'sub-item' => array( 'will they work?', 'or won\'t they, who knows?' ), 'subitem attr!' => array( 'attr' => array( 'id' => 'listID' ), 'listAttr' => array( 'id' => 'sub-list' ), 'list' => array( 'this is a sub item', 'this list should have attributes' ) ) ), array( 'id' => 'main ol' ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<li>this is a list item</li><li>this is a list item 2</li><li>sub-item<ul><li>will they work?</li><li>or won\'t they, who knows?</li></ul></li><li id="listID">subitem attr!<ul id="sub-list"><li>this is a sub item</li><li>this list should have attributes</li></ul></li>', $Html->processList( array( 'this is a list item', 'this is a list item 2', 'sub-item' => array( 'will they work?', 'or won\'t they, who knows?' ), 'subitem attr!' => array( 'attr' => array( 'id' => 'listID' ), 'listAttr' => array( 'id' => 'sub-list' ), 'list' => array( 'this is a sub item', 'this list should have attributes' ) ) ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<a target="_blank" class="myClass" href="http://google.com">Google</a>', $Html->link( 'Google', 'http://google.com', array( 'target' => '_blank', 'class' => 'myClass' ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<img alt="This is alt text" title="This is the title" class="logo" src="/assets/img/logo.png">', $Html->image( '/assets/img/logo.png', array( 'alt' => 'This is alt text', 'title' => 'This is the title', 'class' => 'logo' ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<link media="print" rel="stylesheet" type="text/css" href="/assets/css/print.css">', $Html->style( '/assets/css/print.css', array( 'media' => 'print' ) ) ); } public function <API key>() { $Html = $this->getHtml(); $this->assertSame( '<script src="/assets/js/site.js"></script>', $Html->script( '/assets/js/site.js' ) ); } }
<h1>Access Denied</h1> <p>You have logged in correctly, but you have tried to access a page without a high enough level of security clearance.</p>
<!DOCTYPE html PUBLIC "- <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.11"/> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_6.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><! createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><! document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for io.js v2.0.1 - v2.3.0: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for io.js v2.0.1 - v2.3.0 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_date.html">Date</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::Date Member List</div> </div> </div><!--header <div class="contents"> <p>This is the complete list of members for <a class="el" href="classv8_1_1_date.html">v8::Date</a>, including all inherited members.</p> <table class="directory"> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>BooleanValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">CallAsConstructor</a>(int argc, Handle&lt; Value &gt; argv[])</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">CallAsFunction</a>(Handle&lt; Value &gt; recv, int argc, Handle&lt; Value &gt; argv[])</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Cast</b>(v8::Value *obj) (defined in <a class="el" href="classv8_1_1_date.html">v8::Date</a>)</td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Cast</b>(T *value) (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">Clone</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">CreationContext</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_date.html#<API key>"><API key></a>(Isolate *isolate)</td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Delete</b>(Handle&lt; Value &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Delete</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>DeleteHiddenValue</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>DeletePrivate</b>(Handle&lt; Private &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">Equals</a>(Handle&lt; Value &gt; that) const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(Handle&lt; FunctionTemplate &gt; tmpl)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ForceSet</b>(Handle&lt; Value &gt; key, Handle&lt; Value &gt; value, PropertyAttribute attribs=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Get</b>(Handle&lt; Value &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Get</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(const PersistentBase&lt; Object &gt; &amp;object, int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">GetConstructorName</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetHiddenValue</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">GetIdentityHash</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b><API key></b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b><API key></b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b><API key></b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b><API key></b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b><API key></b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">GetInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">GetIsolate</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(Local&lt; String &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">GetOwnPropertyNames</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>GetPrivate</b>(Handle&lt; Private &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(Handle&lt; Value &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">GetPropertyNames</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">GetPrototype</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(Handle&lt; String &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(Handle&lt; String &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Has</b>(Handle&lt; Value &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Has</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b><API key></b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b><API key></b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>HasOwnProperty</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">HasPrivate</a>(Handle&lt; Private &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b><API key></b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b><API key></b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b><API key></b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Int32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>IntegerValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">InternalFieldCount</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">InternalFieldCount</a>(const PersistentBase&lt; Object &gt; &amp;object)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsArgumentsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsArrayBuffer</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsArrayBufferView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsBoolean</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsBooleanObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">IsCallable</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsDataView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsDate</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsExternal</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsFalse</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsFloat32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsFloat64Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsGeneratorFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsGeneratorObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsInt16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsInt32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsInt32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsInt8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsMapIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsName</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsNativeError</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsNull</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsNumberObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsPromise</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsRegExp</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsSetIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsString</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsStringObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsSymbol</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsSymbolObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsTrue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsTypedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsUint16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsUint32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsUint32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsUint8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsUint8ClampedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsUndefined</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsWeakMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">IsWeakSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>New</b>(Isolate *isolate, double time) (defined in <a class="el" href="classv8_1_1_date.html">v8::Date</a>)</td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>New</b>(Isolate *isolate) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>NumberValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">ObjectProtoToString</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SameValue</b>(Handle&lt; Value &gt; that) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Set</b>(Handle&lt; Value &gt; key, Handle&lt; Value &gt; value) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Set</b>(uint32_t index, Handle&lt; Value &gt; value) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessor</b>(Handle&lt; String &gt; name, <API key> getter, <API key> setter=0, Handle&lt; Value &gt; data=Handle&lt; Value &gt;(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SetAccessor</b>(Handle&lt; Name &gt; name, <API key> getter, <API key> setter=0, Handle&lt; Value &gt; data=Handle&lt; Value &gt;(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessorProperty</b>(Local&lt; Name &gt; name, Local&lt; Function &gt; getter, Handle&lt; Function &gt; setter=Handle&lt; Function &gt;(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(int index, void *value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">SetHiddenValue</a>(Handle&lt; String &gt; key, Handle&lt; Value &gt; value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(void *data, ExternalArrayType array_type, int number_of_elements)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>"><API key></a>(uint8_t *data, int length)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">SetInternalField</a>(int index, Handle&lt; Value &gt; value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>SetPrivate</b>(Handle&lt; Private &gt; key, Handle&lt; Value &gt; value) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">SetPrototype</a>(Handle&lt; Value &gt; prototype)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>StrictEquals</b>(Handle&lt; Value &gt; that) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#<API key>">ToArrayIndex</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToBoolean</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToBoolean</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToDetailString</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToDetailString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToInt32</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInt32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToInteger</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInteger</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToNumber</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToNumber</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToObject</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToObject</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToString</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToUint32</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToUint32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#<API key>">TurnOnAccessCheck</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Uint32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_date.html#<API key>">ValueOf</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:49:54 for V8 API Reference Guide for io.js v2.0.1 - v2.3.0 by & <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
require_relative '../user' RSpec.describe 'Tapjoy::LDAP::API::User' do include_context 'user' describe '#create' do let(:ldap_attr) {{ uid: "test.user", cn: "Test User", objectclass: %w( top posixAccount shadowAccount inetOrgPerson <API key> person ldapPublicKey), sn: "User", givenname: "Test", homedirectory: "/home/test.user", loginshell: "/bin/bash", mail: "test.user@tapjoy.com", uidnumber: 10001, gidnumber: 19000, userpassword: '{SSHA}testpass' }} it 'creates a user' do ARGV << %w(create -n test user -g users); ARGV.flatten! allow(Tapjoy::LDAP::API::User).to receive(:create_password).and_return('testpass') expect(fake_ldap).to receive(:add).with(distinguished_name, ldap_attr) Tapjoy::LDAP::CLI::User.commands end end describe '#delete' do it 'deletes a user' do ARGV << %w(delete -u test.user -f); ARGV.flatten! # Tapjoy::LDAP::API::User.create(fname, lname, # opts[:type], opts[:group]) allow(Tapjoy::LDAP::API::User).to receive(:create_password).and_return('testpass') expect(fake_ldap).to receive(:delete).with(distinguished_name) Tapjoy::LDAP::CLI::User.commands end end end
import React from 'react'; import $ from 'jquery'; import _ from 'lodash'; import Block from './Block'; export default class BlockGrid extends React.Component { constructor() { super(); this.setDefaults(); this.setContainerWidth = this.setContainerWidth.bind(this); this.handleWindowResize = this.handleWindowResize.bind(this); this.resizeTimer = null; // throttle call to this func whenever an image is loaded this.<API key> = _.throttle(this.setContainerWidth, 500); } setDefaults(){ this.blockWidth = 260; // initial desired block width this.borderWidth = 5; this.wrapperWidth = 0; this.colCount = 0; this.blocks = []; this.blockCount = 0; } handleWindowResize(){ clearTimeout(this.resizeTimer); const _this = this; this.resizeTimer = setTimeout(function() { $('.block-container').css('width', '100%'); _this.setDefaults(); _this.setContainerWidth(); // above code computes false height of blocks // so as a lose patch re-position blocks after 500 ms setTimeout(_this.setContainerWidth, 700); }, 200); } componentDidMount(){ this.setContainerWidth(); /* height of each block is measured with an error the first time so there are some space between blocks specially the top values of the grid. Only solution seems like re calculating positions of the block after few seconds */ // _.delay(this.setContainerWidth, 3000); // reset all blocks when window resized $(window).resize(this.handleWindowResize); } <API key>(nextProps){ // after clicking Load More there will be newProps here // Re calculate block positions so no error occurs when there are // all image less blocks // _.delay(this.setContainerWidth, 2000); } componentDidUpdate(prevProps, prevState){ if(this.blockCount != this.props.data.length){ this.setDefaults(); this.setContainerWidth(); } } <API key>(){ $(window).off("resize", this.handleWindowResize); } setContainerWidth(){ // setContainerWidth only first time we recieve BlockList data if(this.wrapperWidth == 0){ this.wrapperWidth = $('.block-container').outerWidth(); this.colCount = Math.round(this.wrapperWidth/this.blockWidth); $('.block').css('width', this.blockWidth); this.blockCount = document.<API key>('block').length; if(this.blockCount < this.colCount){ this.wrapperWidth = (this.blockWidth*this.blockCount) - ( (this.blockCount - 1) * this.borderWidth); this.colCount = this.blockCount; } else { this.wrapperWidth = (this.blockWidth*this.colCount) - ( (this.colCount - 1) * this.borderWidth); } $('.block-container').css('width', this.wrapperWidth); } // if wrapperWidth is already calculated than just reset block positions for( var i = 0; i < this.colCount; i++ ) this.blocks[i] = 0; this.setBlocks(); } setBlocks() { const component = this; $('.block').each(function(){ var min = Math.min.apply(Math, component.blocks); var index = $.inArray(min, component.blocks); var left = index * (component.blockWidth - component.borderWidth) - component.borderWidth; // for the first blocks that needs to overlap container border if(left == 0) left = - component.borderWidth; // start with overlap on top container border var top = min + 10 - component.borderWidth; $(this).css({ 'top' : top + 'px', 'left' : left + 'px' }); component.blocks[index] = top + this.offsetHeight; }); // set wrapper height var wrapperHeight = Math.max.apply(Math, this.blocks); wrapperHeight += this.borderWidth; // block borders $(".block-container").css("height",wrapperHeight + 'px'); } renderBlocks() { const { data } = this.props; return data.map((pin) => { return <Block {...pin} key={pin._id} loadHandler={this.<API key>}/>; }); } render() { return( <div class="row"> <div class="col-sm-offset-2 col-sm-8 col-xs-offset-1 col-xs-10"> <div class="block-container"> { this.renderBlocks() } </div> </div> </div> ); } }
<?php namespace Eni\MainBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\<API key>; use Doctrine\Common\Persistence\ObjectManager; use Eni\MainBundle\Entity\Question; use Eni\MainBundle\Entity\ReponseProposee; class <API key> extends AbstractFixture implements <API key> { public function getOrder() { return 6; } public function load(ObjectManager $oManager) { //Question1 $oQuestion1 = $this->getReference('question1'); /* @var $oQuestion1 Question */ $tReponsesProposees = [ ['enonce' => 'Dim', 'valide' => true], ['enonce' => 'Public', 'valide' => false], ['enonce' => 'Aucun mot-clé', 'valide' => false], ]; foreach ($tReponsesProposees as $tReponseProposee) { $oReponseProposee = new ReponseProposee(); $oReponseProposee ->setQuestion($oQuestion1) ->setEnonce($tReponseProposee['enonce']) ->setValide($tReponseProposee['valide']); $oQuestion1->addReponsesProposee($oReponseProposee); $oManager->persist($oReponseProposee); } //Question2 $oQuestion2 = $this->getReference('question2'); /* @var $oQuestion2 Question */ $tReponsesProposees2 = [ ['enonce' => 'VS refusera de compiler la dernière ligne de code', 'valide' => false], ['enonce' => ' La valeur de Res restera à True', 'valide' => false], ['enonce' => 'La valeur de Res sera False', 'valide' => true], ['enonce' => 'Res = 4', 'valide' => false], ]; foreach ($tReponsesProposees2 as $tReponseProposee) { $oReponseProposee = new ReponseProposee(); $oReponseProposee ->setQuestion($oQuestion2) ->setEnonce($tReponseProposee['enonce']) ->setValide($tReponseProposee['valide']); $oQuestion2->addReponsesProposee($oReponseProposee); $oManager->persist($oReponseProposee); } //Question3 $oQuestion3 = $this->getReference('question3'); /* @var $oQuestion3 Question */ $tReponsesProposees3 = [ ['enonce' => 'Un', 'valide' => false], ['enonce' => 'Deux', 'valide' => true], ['enonce' => 'Trois', 'valide' => false], ]; foreach ($tReponsesProposees3 as $tReponseProposee) { $oReponseProposee = new ReponseProposee(); $oReponseProposee ->setQuestion($oQuestion3) ->setEnonce($tReponseProposee['enonce']) ->setValide($tReponseProposee['valide']); $oQuestion3->addReponsesProposee($oReponseProposee); $oManager->persist($oReponseProposee); } //Question4 $oQuestion4 = $this->getReference('question4'); /* @var $oQuestion4 Question */ $tReponsesProposees4 = [ ['enonce' => 'Vrai', 'valide' => true], ['enonce' => 'Faux', 'valide' => false], ]; foreach ($tReponsesProposees4 as $tReponseProposee) { $oReponseProposee = new ReponseProposee(); $oReponseProposee ->setQuestion($oQuestion4) ->setEnonce($tReponseProposee['enonce']) ->setValide($tReponseProposee['valide']); $oQuestion4->addReponsesProposee($oReponseProposee); $oManager->persist($oReponseProposee); } $oManager->flush(); } }
{% extends "layout.html" %} {% block page_title %} Add medication {% endblock %} {% block head %} {% include "includes/head.html" %} {% include "includes/scripts.html" %} {% endblock %} {% block after_header %} {{ banner.input() }} {% endblock %} {% block content %} <main id="content" role="main" tabindex="-1"> <div class="grid-row" id="FEP8"> <div class="column-two-thirds"> <h1 class="heading-large">Your <span class="currentCondition"></span> medication</h1> <p>Tell us about your current <span class="currentCondition"></span> medication, as well as medication that you have now stopped taking</p> <div class="form-group medication"> <div id="medication" class="medication"> </div> </div> <div class="form-group"> <a class="bold-small" id="add" href="javascript:goInvisible('/epilepsy/medication/add')">Add more medication</a> </div> <div class="form-group" id="question"> <input id="continue" name="continue" class="button" type="button" value="I have finished providing medication" onclick="validate()"> </div> </div> {% include "includes/widgets/need-help.html" %} </div> </main> {% endblock %} {% block body_end %} <script type="text/javascript"> $('.currentCondition').html(<API key>()); // If no medication added yet, show different messages var medicationList = []; var <API key> = []; var medicationTable = ""; <API key>(); function validate() { var question = "Provide details of your " + <API key>() + " medication"; var medicationPlayback = "<div class='medication'><div class='grid-row'><p>Medication</p></div>"; var <API key> = 0; <API key>.forEach(function(medication, index, array) { medicationPlayback += "<div class='grid-row'>"; medicationPlayback += "<div class='column-half'><p><strong>" + medication.name + "</strong></p></div>"; medicationPlayback += "<div class='column-half'><p>" + moment(medication.start).format("DD/MM/YYYY") + " – " + (medication.end !== undefined ? moment(medication.end).format('DD/MM/YYYY') : "Current") + "</p></div>"; medicationPlayback += "</div>"; if (medication.end === undefined) { ++<API key>; } }); medicationPlayback += "</div>"; addResponse("FEP", "8", question, <API key>, medicationPlayback, '/epilepsy/medication/your-medication'); if (<API key> > 0) { go('/epilepsy/confused-drowsy'); } else { go('/epilepsy/regular-check-ups'); } } function <API key>() { medicationTable = ""; try { medicationList = responses["FEP"]["8"].response; <API key> = _(medicationList).chain().sortBy(function(medication) { return medication.start; }).sortBy(function(medication) { return medication.end; }).reverse().value(); <API key>.forEach(function(medication, index) { medicationTable += '<div class="grid-row"><div class="column-third"><p class="bold-xsmall">' + medication.name + '</p></div><div class="column-third"><p class="font-xsmall">' + moment(medication.start).format('DD/MM/YYYY') + ' – ' + (medication.end !== undefined ? moment(medication.end).format('DD/MM/YYYY') : "Current") + '</p></div><div class="column-third"><p class="bold-xsmall"><a href="javascript:change(' + index + ')">Change <a href="javascript:remove(' + index + ')">Remove</a></p></div></div>' }); $('#medication').html(medicationTable); if (<API key>.length === 0) { $('#add').html('Add medication'); $('#continue').val('I have never taken ' + <API key>() + ' medication'); } } catch (err) { $('#add').html('Add medication'); $('#continue').val('I have never taken ' + <API key>() + ' medication'); } } function remove(index) { if (confirm('Are you sure want to remove this medication?')) { <API key>.splice(index, 1); addResponse("FEP", "8", question, <API key>, "List", '/epilepsy/medication/your-medication'); // Make sure ordering changes are saved <API key>(); } } function change(index) { addResponse("FEP", "8", question, <API key>, "List", '/epilepsy/medication/your-medication'); // Make sure ordering changes are saved for correct index goInvisible('/epilepsy/medication/edit?change=' + index); } </script> {% endblock %}
package com.exasol.adapter.dialects.bigquery; import java.sql.Connection; import java.sql.Types; import com.exasol.adapter.AdapterProperties; import com.exasol.adapter.dialects.IdentifierConverter; import com.exasol.adapter.jdbc.<API key>; import com.exasol.adapter.jdbc.JdbcTypeDescription; import com.exasol.adapter.metadata.DataType; /** * This class implements BigQuery-specific reading of column metadata. */ public class <API key> extends <API key> { /** * Create a new instance of the {@link <API key>}. * * @param connection connection to the remote data source * @param properties user-defined adapter properties * @param identifierConverter converter between source and Exasol identifiers */ public <API key>(final Connection connection, final AdapterProperties properties, final IdentifierConverter identifierConverter) { super(connection, properties, identifierConverter); } @Override public DataType mapJdbcType(final JdbcTypeDescription jdbcTypeDescription) { if (jdbcTypeDescription.getJdbcType() == Types.TIME) { return DataType.createVarChar(30, DataType.ExaCharset.UTF8); } return super.mapJdbcType(jdbcTypeDescription); } }
const chalk = require('chalk'); const Sequelize = require('sequelize'); // db server constant(s) const dbName = '<API key>'; const url = process.env.DATABASE_URL || `postgres://localhost:5432/${dbName}`; // notify the user we're about to do it console.log(chalk.yellow(`Opening database connection to ${url}`)) // init the db const db = new Sequelize(url, { define: { freezeTableName: true // don't go changing my table names sequelize! }, logging: false }); module.exports = db;
#!/usr/bin/env bash mkdir -p target/sandboxjava9jlink; /usr/lib/jvm/java-9-oracle/bin/javac \ --module-path ./../java9module/target/sandboxjava9module \ -d target/sandboxjava9jlink \ $(find ./src/main/java -name "*.java")
using System; using Windows.Devices.Enumeration; using Windows.Devices.Spi; using Windows.Foundation.Metadata; namespace <API key> { <summary> Class for accessing the ADCDAC Pi from AB Electronics UK. </summary> public class ADCDACPi : IDisposable { private const string SPI_CONTROLLER_NAME = "SPI0"; private const Int32 <API key> = 0; // ADC on SPI channel select CE0 private const Int32 <API key> = 1; // ADC on SPI channel select CE1 private SpiDevice adc; private double ADCReferenceVoltage = 3.3; private SpiDevice dac; <summary> Event triggers when a connection is established. </summary> public bool IsConnected { get; private set; } // Flag: Has Dispose already been called? bool disposed = false; // Instantiate a SafeHandle instance. System.Runtime.InteropServices.SafeHandle handle = new Microsoft.Win32.SafeHandles.SafeFileHandle(IntPtr.Zero, true); <summary> Open a connection to the ADCDAC Pi. </summary> public async void Connect() { if (IsConnected) { return; // Already connected } if(!ApiInformation.IsTypePresent("Windows.Devices.Spi.SpiDevice")) { return; // This system does not support this feature: can't connect } try { // Create SPI initialization settings for the ADC var adcsettings = new <API key>(<API key>) { ClockFrequency = 10000000, // SPI clock frequency of 10MHz Mode = SpiMode.Mode0 }; var spiAqs = SpiDevice.GetDeviceSelector(SPI_CONTROLLER_NAME); // Find the selector string for the SPI bus controller var devicesInfo = await DeviceInformation.FindAllAsync(spiAqs); // Find the SPI bus controller device with our selector string if (devicesInfo.Count == 0) { return; // Controller not found } adc = await SpiDevice.FromIdAsync(devicesInfo[0].Id, adcsettings); // Create an ADC connection with our bus controller and SPI settings // Create SPI initialization settings for the DAC var dacSettings = new <API key>(<API key>) { ClockFrequency = 2000000, // SPI clock frequency of 20MHz Mode = SpiMode.Mode0 }; dac = await SpiDevice.FromIdAsync(devicesInfo[0].Id, dacSettings); // Create a DAC connection with our bus controller and SPI settings IsConnected = true; // connection established, set IsConnected to true. // Fire the Connected event handler Connected?.Invoke(this, EventArgs.Empty); } /* If initialization fails, display the exception and stop running */ catch (Exception ex) { IsConnected = false; throw new Exception("SPI Initialization Failed", ex); } } <summary> Event occurs when connection is made. </summary> public event EventHandler Connected; <summary> Read the voltage from the selected <paramref name="channel" /> on the ADC. </summary> <param name="channel">1 or 2</param> <returns>voltage</returns> public double ReadADCVoltage(byte channel) { if (channel < 1 || channel > 2) { throw new <API key>(nameof(channel)); } var raw = ReadADCRaw(channel); var voltage = ADCReferenceVoltage / 4096 * raw; // convert the raw value into a voltage based on the reference voltage. return voltage; } <summary> Read the raw value from the selected <paramref name="channel" /> on the ADC. </summary> <param name="channel">1 or 2</param> <returns>Integer</returns> public int ReadADCRaw(byte channel) { if (channel < 1 || channel > 2) { throw new <API key>(nameof(channel)); } CheckConnected(); var writeArray = new byte[] { 0x01, (byte) ((1 + channel) << 6), 0x00}; // create the write bytes based on the input channel var readBuffer = new byte[3]; // this holds the output data adc.TransferFullDuplex(writeArray, readBuffer); // transfer the adc data var ret = (short) (((readBuffer[1] & 0x0F) << 8) + readBuffer[2]); // combine the two bytes into a single 16bit integer return ret; } <summary> Set the reference <paramref name="voltage" /> for the analogue to digital converter. The ADC uses the raspberry pi 3.3V power as a <paramref name="voltage" /> reference so using this method to set the reference to match the exact output <paramref name="voltage" /> from the 3.3V regulator will increase the accuracy of the ADC readings. </summary> <param name="voltage">double</param> public void SetADCrefVoltage(double voltage) { CheckConnected(); if (voltage < 0.0 || voltage > 7.0) { throw new <API key>(nameof(voltage), "Reference voltage must be between 0.0V and 7.0V."); } ADCReferenceVoltage = voltage; } <summary> Set the <paramref name="voltage" /> for the selected channel on the DAC. </summary> <param name="channel">1 or 2</param> <param name="voltage">Voltage can be between 0 and 2.047 volts</param> public void SetDACVoltage(byte channel, double voltage) { // Check for valid channel and voltage variables if (channel < 1 || channel > 2) { throw new <API key>(); } if (voltage >= 0.0 && voltage < 2.048) { var rawval = Convert.ToInt16(voltage / 2.048 * 4096); // convert the voltage into a raw value SetDACRaw(channel, rawval); } else { throw new <API key>(); } } <summary> Set the raw <paramref name="value" /> from the selected <paramref name="channel" /> on the DAC. </summary> <param name="channel">1 or 2</param> <param name="value">Value between 0 and 4095</param> public void SetDACRaw(byte channel, short value) { CheckConnected(); if (channel < 1 || channel > 2) { throw new <API key>(); } // split the raw value into two bytes and send it to the DAC. var lowByte = (byte) (value & 0xff); var highByte = (byte) (((value >> 8) & 0xff) | ((channel - 1) << 7) | (0x1 << 5) | (1 << 4)); var writeBuffer = new [] { highByte, lowByte}; dac.Write(writeBuffer); } private void CheckConnected() { if (!IsConnected) { throw new <API key>("Not connected. You must call .Connect() first."); } } <summary> Dispose of the resources </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } <summary> Protected implementation of Dispose pattern </summary> <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (disposed) return; if (disposing) { handle.Dispose(); // Free any other managed objects here. adc?.Dispose(); adc = null; dac?.Dispose(); dac = null; IsConnected = false; } // Free any unmanaged objects here. disposed = true; } } }
FROM stilliard/pure-ftpd ENV FTP_USER=ftpuser \ FTP_PASSWORD=ftpuser \ FTP_HOME_DIRECTORY=/share/ftp \ PASV_PORT_MIN=30000 \ PASV_PORT_MAX=30009 \ CONTAINER_USER_UID=ftpuser \ MAX_CLIENTS_NUMBER=50 \ MAX_CLIENTS_PER_IP=10 \ DOWNLOAD_LIMIT_KB=0 \ UPLOAD_LIMIT_KB=0 \ <API key>=0 \ LOG_ENABLED=0 COPY run.sh /pure-ftpd/run.sh RUN chmod u+x /pure-ftpd/run.sh CMD ["/pure-ftpd/run.sh"]
var system = require('system'); var args = system.args; var url = "http://"+args[1], filename = args[2]+".png", timeout = args[3], savePath = args[4], page = require('webpage').create(); //setTimeout(function(){phantom.exit();}, timeout) page.viewportSize = { width: 1200, height: 700 }; page.clipRect = { top: 0, left: 0, width: 1200, height: 700 }; var f = false; page.onLoadFinished = function(status) { console.log('Status: ' + status); setTimeout(function(){ render(page); phantom.exit(); }, 15000) }; page.onResourceReceived = function(response) { if (response.url === url && !f) { setTimeout(function(){ render(page); phantom.exit(); }, 15000) f = true } }; function render(page) { var resPath if (savePath == "") { resPath = filename } else { resPath = savePath + "/" + filename } page.render(resPath) } console.log("start get " + url) page.open(url, function() { });
class SiteController < <API key> skip_before_filter :<API key><API key> cattr_writer :cache_timeout def self.cache_timeout @@cache_timeout ||= 5.minutes end def show_page url = params[:url] if Array === url url = url.join('/') else url = url.to_s end if @page = find_page(url) <API key> if (url == "/" || url == "") process_page(@page) set_cache_control @performed_render ||= true else render :template => 'site/not_found', :status => 404 end rescue Page::<API key> redirect_to welcome_url end private def <API key> @changed_pages = [] @pages = Page.find(:all, :conditions => {:status_id => 90}) @pages.each do |page| if page.published_at <= Time.now page.status_id = 100 page.save @changed_pages << page.id end end expires_in nil, :private=>true, "no-cache" => true if @changed_pages.length > 0 end def set_cache_control if (request.head? || request.get?) && @page.cache? && live? expires_in self.class.cache_timeout, :public => true, :private => false else expires_in nil, :private => true, "no-cache" => true headers['ETag'] = '' end end def find_page(url) found = Page.find_by_url(url, live?) found if found and (found.published? or dev?) end def process_page(page) page.process(request, response) end def dev? if dev_host = @config['dev.host'] request.host == dev_host else request.host =~ /^dev\./ end end def live? not dev? end end
namespace Vulcan.Core.DataAccess.Migrations.MigrationProviders { public enum ExecutionType { Insert, InsertWithIdentity, Update, Delete } }
<!-- Jumbotron Header --> <header class="jumbotron hero-spacer" style="padding: 2em; text-align: center;"> <img style="max-width:100%; max-height:100%;" src="<?=base_url()?>assets/img/slogan.png"> <! <h1>Read and let read!</h1> <p> Welcome to Discipulus, your humble start up for buying and selling books. We’re dedicated to giving you the very best experience on this website, with a focus on look, feel, functionality, and great community of likeminded people.Welcome to Discipulus, your humble start up for buying and selling books. We’re dedicated to giving you the very best experience on this website, with a focus on look, feel, functionality, and great community of likeminded people. </p> <!-- <p><a class="btn btn-primary btn-large">Call to action!</a>--> </header> <hr> <!-- Title --> <!-- <div class="row">--> <!-- <div class="col-lg-12">--> <!-- <h3>Latest Features</h3>--> <!-- </div>--> <!-- </div>--> <!-- /.row --> <!-- Page Features --> <div class="row text-center"> <?php if(count($products) == 0){ echo '<center><i><h3>No data available</h3></i></center>'; } foreach($products as $product){ ?> <div class="col-sm-3 col-lg-3 col-md-3"> <div class="thumbnail"> <div class="thumbnailx"> <img src="<?=$product->img?>" style="" alt=""> </div> <div class="caption-ownad"> <h4><a href="<?=base_url().'shop/viewProduct/'.$product->id?>"><?=$product->title?></a></h4> <span style="font-weight: bold;">P<?=$product->price?>.00</span> <p style="margin-top: 0.3em;"><?=$product->description?></p> </div> </div> </div> <?php } ?> </div> <!-- /.row -->
# vimconfig stuff from my vimrc breaks into pieces for keeping organised things more organised Install On Unix execute: sh #backup current vimrc file if existed mv ~/.vimrc{,_backup} #clone project into special folder git clone https://github.com/iiey/vimconfig ~/.vim/bundle/vimconfig \ && ln -sfn ~/.vim/bundle/vimconfig/vimrc ~/.vim/vimrc # Structure - Basic vim setting: ``vimconfig/plugin/setting.vim`` - Commands: ``vimconfig/plugin/command.vim`` - Mapping: ``vimconfig/plugin/mapping.vim`` - Plugins configuration: ``vimconfig/plugin/bundle.vim`` - Functions implementation: ``vimconfig/autoload/utilfunc.vim`` # Note - Some plugin keybindings may changed to avoid conflict with default vim mapping - More detail see each plugin SECTION under **bundle.vim** - ``~/.vim/bundle`` is path where plugins are stored and managed by [vim-plug][1] ## [airline][2] - Modify setting.vim to enable statusline with powerline symbols vim let g:<API key>=0 - Make sure powerline-fonts installed - On Linux: [fontconfig][3] should work out for any font without patching - On MacOS: download and install patched [fonts][4] from [powerline-fonts][5], set terminal using patched fonts ## [ultisnip][6] - See also ``:h ultisnips-triggers`` - Key changes in section ULTISNIPS vim g:<API key> <c-l> g:<API key> <c-l>l g:<API key> <c-l>n g:<API key> <c-l>p ## [clang\_complete][7] - Set default library path vim let g:clang_library_path=expand("$HOME")."/lib/" - Avoid conflict with tagjump ``<c-]>`` vim g:<API key> <c-w>[ ## [ctrlp][8] - Default shortcut to not conflict with behaviours ``<c-n>`` ``<c-p>`` vim let g:ctrlp_map =[p - Just fall back method which rarely used. Better using ``[f`` to call [fzf][9] [1]: https://github.com/junegunn/vim-plug [2]: https://github.com/vim-airline/vim-airline [3]: http://powerline.readthedocs.io/en/master/installation/linux.html#fontconfig [4]: https://github.com/iiey/dotfiles/tree/master/fonts/Powerline [5]: https://github.com/powerline/fonts [6]: https://github.com/SirVer/ultisnips [7]: https://github.com/Rip-Rip/clang_complete [8]: https://github.com/ctrlpvim/ctrlp.vim [9]: https://github.com/junegunn/fzf
/* globals describe, before, beforeEach, after, afterEach, it */ 'use strict'; const chai = require('chai'); const assert = chai.assert; const expect = chai.expect; chai.should(); chai.use(require('chai-things')); chai.use(require('chai-arrays')); describe('<%= pkgName %>', function () { before('before', function () { }); beforeEach('beforeEach', function () { }); afterEach('afterEach', function () { }); after('after', function () { }); describe('Stub test', function () { it('should have unit test', function () { assert(false, 'Please add unit tests.'); }); }); });
// PgpMimeTests.cs // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // all copies or substantial portions of the Software. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 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. using System; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using NUnit.Framework; using Org.BouncyCastle.Bcpg; using Org.BouncyCastle.Bcpg.OpenPgp; using MimeKit; using MimeKit.IO; using MimeKit.IO.Filters; using MimeKit.Cryptography; namespace UnitTests.Cryptography { [TestFixture] public class PgpMimeTests { static PgpMimeTests () { Environment.<API key> ("GNUPGHOME", Path.GetFullPath (".")); var dataDir = Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp"); CryptographyContext.Register (typeof (DummyOpenPgpContext)); foreach (var name in new [] { "pubring.gpg", "pubring.gpg~", "secring.gpg", "secring.gpg~", "gpg.conf" }) { if (File.Exists (name)) File.Delete (name); } using (var ctx = new DummyOpenPgpContext ()) { using (var seckeys = File.OpenRead (Path.Combine (dataDir, "mimekit.gpg.sec"))) { using (var armored = new ArmoredInputStream (seckeys)) ctx.Import (new <API key> (armored)); } using (var pubkeys = File.OpenRead (Path.Combine (dataDir, "mimekit.gpg.pub"))) ctx.Import (pubkeys); } File.Copy (Path.Combine (dataDir, "gpg.conf"), "gpg.conf", true); } static bool IsSupported (EncryptionAlgorithm algorithm) { switch (algorithm) { case EncryptionAlgorithm.RC2128: case EncryptionAlgorithm.RC264: case EncryptionAlgorithm.RC240: case EncryptionAlgorithm.Seed: return false; default: return true; } } [Test] public void <API key> () { using (var ctx = new DummyOpenPgpContext ()) { var <API key> = ctx.<API key>; Assert.AreEqual (4, <API key>.Length); Assert.AreEqual (EncryptionAlgorithm.Aes256, <API key>[0]); Assert.AreEqual (EncryptionAlgorithm.Aes192, <API key>[1]); Assert.AreEqual (EncryptionAlgorithm.Aes128, <API key>[2]); Assert.AreEqual (EncryptionAlgorithm.TripleDes, <API key>[3]); var digestAlgorithms = ctx.<API key>; Assert.AreEqual (3, digestAlgorithms.Length); Assert.AreEqual (DigestAlgorithm.Sha256, digestAlgorithms[0]); Assert.AreEqual (DigestAlgorithm.Sha512, digestAlgorithms[1]); Assert.AreEqual (DigestAlgorithm.Sha1, digestAlgorithms[2]); } } [Test] public void TestKeyEnumeration () { using (var ctx = new DummyOpenPgpContext ()) { var unknownMailbox = new MailboxAddress ("Snarky McSnarkypants", "snarky@snarkypants.net"); var knownMailbox = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); int count = ctx.EnumeratePublicKeys ().Count (); // Note: the count will be 8 if run as a complete unit test or 2 if run individually Assert.IsTrue (count == 8 || count == 2, "Unexpected number of public keys"); Assert.AreEqual (0, ctx.EnumeratePublicKeys (unknownMailbox).Count (), "Unexpected number of public keys for an unknown mailbox"); Assert.AreEqual (2, ctx.EnumeratePublicKeys (knownMailbox).Count (), "Unexpected number of public keys for a known mailbox"); Assert.AreEqual (2, ctx.EnumerateSecretKeys ().Count (), "Unexpected number of secret keys"); Assert.AreEqual (0, ctx.EnumerateSecretKeys (unknownMailbox).Count (), "Unexpected number of secret keys for an unknown mailbox"); Assert.AreEqual (2, ctx.EnumerateSecretKeys (knownMailbox).Count (), "Unexpected number of secret keys for a known mailbox"); Assert.IsTrue (ctx.CanSign (knownMailbox)); Assert.IsFalse (ctx.CanSign (unknownMailbox)); Assert.IsTrue (ctx.CanEncrypt (knownMailbox)); Assert.IsFalse (ctx.CanEncrypt (unknownMailbox)); } } [Test] public void TestKeyGeneration () { using (var ctx = new DummyOpenPgpContext ()) { var mailbox = new MailboxAddress ("Snarky McSnarkypants", "snarky@snarkypants.net"); int publicKeyRings = ctx.<API key> ().Count (); int secretKeyRings = ctx.<API key> ().Count (); ctx.GenerateKeyPair (mailbox, "password", DateTime.Now.AddYears (1), EncryptionAlgorithm.Cast5); var pubring = ctx.<API key> (mailbox).FirstOrDefault (); Assert.IsNotNull (pubring, "Expected to find the generated public keyring"); ctx.Delete (pubring); Assert.AreEqual (publicKeyRings, ctx.<API key> ().Count (), "Unexpected number of public keyrings"); var secring = ctx.<API key> (mailbox).FirstOrDefault (); Assert.IsNotNull (secring, "Expected to find the generated secret keyring"); ctx.Delete (secring); Assert.AreEqual (secretKeyRings, ctx.<API key> ().Count (), "Unexpected number of secret keyrings"); } } [Test] public void TestKeySigning () { using (var ctx = new DummyOpenPgpContext ()) { var seckey = ctx.EnumerateSecretKeys (new MailboxAddress ("", "mimekit@example.com")).FirstOrDefault (); var mailbox = new MailboxAddress ("Snarky McSnarkypants", "snarky@snarkypants.net"); ctx.GenerateKeyPair (mailbox, "password", DateTime.Now.AddYears (1), EncryptionAlgorithm.Cast5); // delete the secret keyring, we don't need it var secring = ctx.<API key> (mailbox).FirstOrDefault (); ctx.Delete (secring); var pubring = ctx.<API key> (mailbox).FirstOrDefault (); var pubkey = pubring.GetPublicKey (); int sigCount = 0; foreach (PgpSignature sig in pubkey.GetKeySignatures ()) sigCount++; Assert.AreEqual (0, sigCount); ctx.SignKey (seckey, pubkey, DigestAlgorithm.Sha256, <API key>.CasualCertification); pubring = ctx.<API key> (mailbox).FirstOrDefault (); pubkey = pubring.GetPublicKey (); sigCount = 0; foreach (PgpSignature sig in pubkey.GetKeySignatures ()) { Assert.AreEqual (seckey.KeyId, sig.KeyId); Assert.AreEqual (HashAlgorithmTag.Sha256, sig.HashAlgorithm); Assert.AreEqual ((int) <API key>.CasualCertification, sig.SignatureType); sigCount++; } Assert.AreEqual (1, sigCount); ctx.Delete (pubring); } } [Test] public void TestMimeMessageSign () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); var message = new MimeMessage { Subject = "Test of signing with OpenPGP" }; using (var ctx = new DummyOpenPgpContext ()) { // throws because no Body is set Assert.Throws<<API key>> (() => message.Sign (ctx)); message.Body = body; // throws because no sender is set Assert.Throws<<API key>> (() => message.Sign (ctx)); message.From.Add (self); // ok, now we can sign message.Sign (ctx); Assert.IsInstanceOf<MultipartSigned> (message.Body); var multipart = (MultipartSigned) message.Body; Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children."); var protocol = multipart.ContentType.Parameters["protocol"]; Assert.AreEqual (ctx.SignatureProtocol, protocol, "The multipart/signed protocol does not match."); Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part."); Assert.IsInstanceOf<<API key>> (multipart[1], "The second child is not a detached signature."); var signatures = multipart.Verify (ctx); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); var signature = signatures[0]; Assert.AreEqual ("MimeKit UnitTests", signature.SignerCertificate.Name); Assert.AreEqual ("mimekit@example.com", signature.SignerCertificate.Email); Assert.AreEqual ("<API key>", signature.SignerCertificate.Fingerprint); Assert.AreEqual (new DateTime (2013, 11, 3, 18, 32, 27), signature.SignerCertificate.CreationDate, "CreationDate"); Assert.AreEqual (DateTime.MaxValue, signature.SignerCertificate.ExpirationDate, "ExpirationDate"); Assert.AreEqual (PublicKeyAlgorithm.RsaGeneral, signature.SignerCertificate.PublicKeyAlgorithm); try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); var message = new MimeMessage { Subject = "Test of signing with OpenPGP" }; using (var ctx = new DummyOpenPgpContext ()) { // throws because no Body is set Assert.Throws<<API key>> (() => message.Sign (ctx)); message.Body = body; // throws because no sender is set Assert.Throws<<API key>> (() => message.Sign (ctx)); message.From.Add (self); // ok, now we can sign message.Sign (ctx); Assert.IsInstanceOf<MultipartSigned> (message.Body); var multipart = (MultipartSigned) message.Body; Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children."); var protocol = multipart.ContentType.Parameters["protocol"]; Assert.AreEqual (ctx.SignatureProtocol, protocol, "The multipart/signed protocol does not match."); Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part."); Assert.IsInstanceOf<<API key>> (multipart[1], "The second child is not a detached signature."); var signatures = await multipart.VerifyAsync (ctx); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); var signature = signatures[0]; Assert.AreEqual ("MimeKit UnitTests", signature.SignerCertificate.Name); Assert.AreEqual ("mimekit@example.com", signature.SignerCertificate.Email); Assert.AreEqual ("<API key>", signature.SignerCertificate.Fingerprint); Assert.AreEqual (new DateTime (2013, 11, 3, 18, 32, 27), signature.SignerCertificate.CreationDate, "CreationDate"); Assert.AreEqual (DateTime.MaxValue, signature.SignerCertificate.ExpirationDate, "ExpirationDate"); Assert.AreEqual (PublicKeyAlgorithm.RsaGeneral, signature.SignerCertificate.PublicKeyAlgorithm); try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); using (var ctx = new DummyOpenPgpContext ()) { var signed = MultipartSigned.Create (ctx, self, DigestAlgorithm.Sha256, body); var protocol = signed.ContentType.Parameters["protocol"]; signed.ContentType.Parameters.Remove ("protocol"); Assert.Throws<FormatException> (() => signed.Verify (), "Verify() w/o protocol parameter"); Assert.Throws<FormatException> (() => signed.Verify (ctx), "Verify(ctx) w/o protocol parameter"); Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (), "VerifyAsync() w/o protocol parameter"); Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/o protocol parameter"); signed.ContentType.Parameters.Add ("protocol", "invalid-protocol"); Assert.Throws<<API key>> (() => signed.Verify (), "Verify() w/ invalid protocol parameter"); Assert.Throws<<API key>> (() => signed.Verify (ctx), "Verify(ctx) w/ invalid protocol parameter"); Assert.ThrowsAsync<<API key>> (() => signed.VerifyAsync (), "VerifyAsync() w/ invalid protocol parameter"); Assert.ThrowsAsync<<API key>> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ invalid protocol parameter"); signed.ContentType.Parameters["protocol"] = protocol; var signature = signed[1]; signed.RemoveAt (1); Assert.Throws<FormatException> (() => signed.Verify (), "Verify() w/ < 2 parts"); Assert.Throws<FormatException> (() => signed.Verify (ctx), "Verify(ctx) w/ < 2 parts"); Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (), "VerifyAsync() w/ < 2 parts"); Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ < 2 parts"); var emptySignature = new MimePart ("application", "octet-stream"); signed.Add (emptySignature); Assert.Throws<FormatException> (() => signed.Verify (), "Verify() w/ invalid signature part"); Assert.Throws<FormatException> (() => signed.Verify (ctx), "Verify(ctx) w/ invalid signature part"); Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (), "VerifyAsync() w/ invalid signature part"); Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ invalid signature part"); var invalidContent = new MimePart ("image", "jpeg") { Content = new MimeContent (new MemoryStream (Array.Empty<byte> (), false)) }; signed[1] = invalidContent; Assert.Throws<<API key>> (() => signed.Verify (), "Verify() w/ invalid content part"); Assert.Throws<<API key>> (() => signed.Verify (ctx), "Verify(ctx) w/ invalid content part"); Assert.ThrowsAsync<<API key>> (() => signed.VerifyAsync (), "VerifyAsync() w/ invalid content part"); Assert.ThrowsAsync<<API key>> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ invalid content part"); } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "<API key>"); PgpSecretKey signer; using (var ctx = new DummyOpenPgpContext ()) { signer = ctx.GetSigningKey (self); foreach (DigestAlgorithm digest in Enum.GetValues (typeof (DigestAlgorithm))) { if (digest == DigestAlgorithm.None || digest == DigestAlgorithm.DoubleSha || digest == DigestAlgorithm.Tiger192 || digest == DigestAlgorithm.Haval5160 || digest == DigestAlgorithm.MD4) continue; var multipart = MultipartSigned.Create (signer, digest, body); Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children."); var protocol = multipart.ContentType.Parameters["protocol"]; Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match."); var micalg = multipart.ContentType.Parameters["micalg"]; var algorithm = ctx.GetDigestAlgorithm (micalg); Assert.AreEqual (digest, algorithm, "The multipart/signed micalg does not match."); Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part."); Assert.IsInstanceOf<<API key>> (multipart[1], "The second child is not a detached signature."); var signatures = multipart.Verify (); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "<API key>"); PgpSecretKey signer; using (var ctx = new DummyOpenPgpContext ()) { signer = ctx.GetSigningKey (self); foreach (DigestAlgorithm digest in Enum.GetValues (typeof (DigestAlgorithm))) { if (digest == DigestAlgorithm.None || digest == DigestAlgorithm.DoubleSha || digest == DigestAlgorithm.Tiger192 || digest == DigestAlgorithm.Haval5160 || digest == DigestAlgorithm.MD4) continue; var multipart = await MultipartSigned.CreateAsync (signer, digest, body); Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children."); var protocol = multipart.ContentType.Parameters["protocol"]; Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match."); var micalg = multipart.ContentType.Parameters["micalg"]; var algorithm = ctx.GetDigestAlgorithm (micalg); Assert.AreEqual (digest, algorithm, "The multipart/signed micalg does not match."); Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part."); Assert.IsInstanceOf<<API key>> (multipart[1], "The second child is not a detached signature."); var signatures = await multipart.VerifyAsync (); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "<API key>"); var message = new MimeMessage { Subject = "Test of signing with OpenPGP" }; using (var ctx = new DummyOpenPgpContext ()) { // throws because no Body has been set Assert.Throws<<API key>> (() => message.Encrypt (ctx)); message.Body = body; // throws because no recipients have been set Assert.Throws<<API key>> (() => message.Encrypt (ctx)); message.From.Add (self); message.To.Add (self); message.Encrypt (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); var encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (ctx); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); // now do the same thing, but encrypt to the Resent-To headers message.From.Clear (); message.To.Clear (); message.From.Add (new MailboxAddress ("Dummy Sender", "dummy@sender.com")); message.To.Add (new MailboxAddress ("Dummy Recipient", "dummy@recipient.com")); message.ResentFrom.Add (self); message.ResentTo.Add (self); message.Body = body; message.Encrypt (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); decrypted = encrypted.Decrypt (ctx); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "<API key>"); var message = new MimeMessage { Subject = "Test of signing with OpenPGP" }; using (var ctx = new DummyOpenPgpContext ()) { // throws because no Body has been set Assert.ThrowsAsync<<API key>> (() => message.EncryptAsync (ctx)); message.Body = body; // throws because no recipients have been set Assert.ThrowsAsync<<API key>> (() => message.EncryptAsync (ctx)); message.From.Add (self); message.To.Add (self); await message.EncryptAsync (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); var encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (ctx); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); // now do the same thing, but encrypt to the Resent-To headers message.From.Clear (); message.To.Clear (); message.From.Add (new MailboxAddress ("Dummy Sender", "dummy@sender.com")); message.To.Add (new MailboxAddress ("Dummy Recipient", "dummy@recipient.com")); message.ResentFrom.Add (self); message.ResentTo.Add (self); message.Body = body; await message.EncryptAsync (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync decrypted = encrypted.Decrypt (ctx); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); var encrypted = MultipartEncrypted.Encrypt (new[] { self }, body); using (var ctx = new DummyOpenPgpContext ()) { var protocol = encrypted.ContentType.Parameters["protocol"]; encrypted.ContentType.Parameters.Remove ("protocol"); Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/o protocol parameter"); Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/o protocol parameter"); encrypted.ContentType.Parameters.Add ("protocol", "invalid-protocol"); //Assert.Throws<<API key>> (() => encrypted.Decrypt (), "Decrypt() w/ invalid protocol parameter"); Assert.Throws<<API key>> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ invalid protocol parameter"); encrypted.ContentType.Parameters["protocol"] = protocol; var version = encrypted[0]; encrypted.RemoveAt (0); Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ < 2 parts"); Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ < 2 parts"); var invalidVersion = new MimePart ("application", "octet-stream") { Content = new MimeContent (new MemoryStream (Array.Empty<byte> (), false)) }; encrypted.Insert (0, invalidVersion); Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ invalid version part"); Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ invalid version part"); var emptyContent = new MimePart ("application", "octet-stream"); var content = encrypted[1]; encrypted[1] = emptyContent; encrypted[0] = version; Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ empty content part"); Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ empty content part"); var invalidContent = new MimePart ("image", "jpeg") { Content = new MimeContent (new MemoryStream (Array.Empty<byte> (), false)) }; encrypted[1] = invalidContent; Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ invalid content part"); Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ invalid content part"); } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); var encrypted = MultipartEncrypted.Encrypt (new [] { self }, body); using (var stream = new MemoryStream ()) { encrypted.WriteTo (stream); stream.Position = 0; var entity = MimeEntity.Load (stream); Assert.IsInstanceOf<MultipartEncrypted> (entity, "Encrypted part is not the expected type"); encrypted = (MultipartEncrypted) entity; Assert.IsInstanceOf<<API key>> (encrypted[0], "First child of multipart/encrypted is not the expected type"); Assert.IsInstanceOf<MimePart> (encrypted[1], "Second child of multipart/encrypted is not the expected type"); Assert.AreEqual ("application/octet-stream", encrypted[1].ContentType.MimeType, "Second child of multipart/encrypted is not the expected mime-type"); } var decrypted = encrypted.Decrypt (); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); var encrypted = await MultipartEncrypted.EncryptAsync (new[] { self }, body); using (var stream = new MemoryStream ()) { await encrypted.WriteToAsync (stream); stream.Position = 0; var entity = await MimeEntity.LoadAsync (stream); Assert.IsInstanceOf<MultipartEncrypted> (entity, "Encrypted part is not the expected type"); encrypted = (MultipartEncrypted) entity; Assert.IsInstanceOf<<API key>> (encrypted[0], "First child of multipart/encrypted is not the expected type"); Assert.IsInstanceOf<MimePart> (encrypted[1], "Second child of multipart/encrypted is not the expected type"); Assert.AreEqual ("application/octet-stream", encrypted[1].ContentType.MimeType, "Second child of multipart/encrypted is not the expected mime-type"); } // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); IList<PgpPublicKey> recipients; using (var ctx = new DummyOpenPgpContext ()) { recipients = ctx.GetPublicKeys (new [] { self }); } var encrypted = MultipartEncrypted.Encrypt (recipients, body); //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); IList<PgpPublicKey> recipients; using (var ctx = new DummyOpenPgpContext ()) { recipients = await ctx.GetPublicKeysAsync (new[] { self }); } var encrypted = await MultipartEncrypted.EncryptAsync (recipients, body); //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); using (var ctx = new DummyOpenPgpContext ()) { foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) { if (!IsSupported (algorithm)) continue; var encrypted = MultipartEncrypted.Encrypt (algorithm, new [] { self }, body); //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (ctx); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); using (var ctx = new DummyOpenPgpContext ()) { foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) { if (!IsSupported (algorithm)) continue; var encrypted = await MultipartEncrypted.EncryptAsync (algorithm, new[] { self }, body); //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (ctx); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); IList<PgpPublicKey> recipients; using (var ctx = new DummyOpenPgpContext ()) { recipients = ctx.GetPublicKeys (new [] { self }); } foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) { if (!IsSupported (algorithm)) continue; var encrypted = MultipartEncrypted.Encrypt (algorithm, recipients, body); //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." }; var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); IList<PgpPublicKey> recipients; using (var ctx = new DummyOpenPgpContext ()) { recipients = await ctx.GetPublicKeysAsync (new[] { self }); } foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) { if (!IsSupported (algorithm)) continue; var encrypted = await MultipartEncrypted.EncryptAsync (algorithm, recipients, body); //using (var file = File.Create ("pgp-encrypted.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); var message = new MimeMessage { Subject = "Test of signing with OpenPGP" }; <API key> signatures; using (var ctx = new DummyOpenPgpContext ()) { // throws because no Body has been set Assert.Throws<<API key>> (() => message.SignAndEncrypt (ctx)); message.Body = body; // throws because no sender has been set Assert.Throws<<API key>> (() => message.SignAndEncrypt (ctx)); message.From.Add (self); message.To.Add (self); message.SignAndEncrypt (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); var encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (ctx, out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } // now do the same thing, but encrypt to the Resent-To headers message.From.Clear (); message.To.Clear (); message.From.Add (new MailboxAddress ("Dummy Sender", "dummy@sender.com")); message.To.Add (new MailboxAddress ("Dummy Recipient", "dummy@recipient.com")); message.ResentFrom.Add (self); message.ResentTo.Add (self); message.Body = body; message.SignAndEncrypt (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); decrypted = encrypted.Decrypt (ctx, out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); var message = new MimeMessage { Subject = "Test of signing with OpenPGP" }; <API key> signatures; using (var ctx = new DummyOpenPgpContext ()) { // throws because no Body has been set Assert.ThrowsAsync<<API key>> (() => message.SignAndEncryptAsync (ctx)); message.Body = body; // throws because no sender has been set Assert.ThrowsAsync<<API key>> (() => message.SignAndEncryptAsync (ctx)); message.From.Add (self); message.To.Add (self); await message.SignAndEncryptAsync (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); var encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (ctx, out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } // now do the same thing, but encrypt to the Resent-To headers message.From.Clear (); message.To.Clear (); message.From.Add (new MailboxAddress ("Dummy Sender", "dummy@sender.com")); message.To.Add (new MailboxAddress ("Dummy Recipient", "dummy@recipient.com")); message.ResentFrom.Add (self); message.ResentTo.Add (self); message.Body = body; await message.SignAndEncryptAsync (ctx); Assert.IsInstanceOf<MultipartEncrypted> (message.Body); encrypted = (MultipartEncrypted) message.Body; //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync decrypted = encrypted.Decrypt (ctx, out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; var encrypted = MultipartEncrypted.SignAndEncrypt (self, DigestAlgorithm.Sha1, new [] { self }, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; var encrypted = await MultipartEncrypted.SignAndEncryptAsync (self, DigestAlgorithm.Sha1, new[] { self }, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; IList<PgpPublicKey> recipients; PgpSecretKey signer; using (var ctx = new DummyOpenPgpContext ()) { recipients = ctx.GetPublicKeys (new [] { self }); signer = ctx.GetSigningKey (self); } var encrypted = MultipartEncrypted.SignAndEncrypt (signer, DigestAlgorithm.Sha1, recipients, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; IList<PgpPublicKey> recipients; PgpSecretKey signer; using (var ctx = new DummyOpenPgpContext ()) { recipients = await ctx.GetPublicKeysAsync (new[] { self }); signer = await ctx.GetSigningKeyAsync (self); } var encrypted = await MultipartEncrypted.SignAndEncryptAsync (signer, DigestAlgorithm.Sha1, recipients, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; var encrypted = MultipartEncrypted.SignAndEncrypt (self, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, new [] { self }, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; var encrypted = await MultipartEncrypted.SignAndEncryptAsync (self, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, new[] { self }, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public void <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; IList<PgpPublicKey> recipients; PgpSecretKey signer; using (var ctx = new DummyOpenPgpContext ()) { recipients = ctx.GetPublicKeys (new [] { self }); signer = ctx.GetSigningKey (self); } var encrypted = MultipartEncrypted.SignAndEncrypt (signer, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, recipients, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public async Task <API key> () { var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." }; var self = new <API key> ("MimeKit UnitTests", "mimekit@example.com", "AB0821A2"); <API key> signatures; IList<PgpPublicKey> recipients; PgpSecretKey signer; using (var ctx = new DummyOpenPgpContext ()) { recipients = await ctx.GetPublicKeysAsync (new[] { self }); signer = await ctx.GetSigningKeyAsync (self); } var encrypted = await MultipartEncrypted.SignAndEncryptAsync (signer, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, recipients, body); //using (var file = File.Create ("<API key>.asc")) // encrypted.WriteTo (file); // TODO: implement DecryptAsync var decrypted = encrypted.Decrypt (out signatures); Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type."); Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original."); Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key> ex) { Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public void TestAutoKeyRetrieve () { var message = MimeMessage.Load (Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "[Announce] GnuPG 2.1.20 released.eml")); var multipart = (MultipartSigned) ((Multipart) message.Body)[0]; Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children."); var protocol = multipart.ContentType.Parameters["protocol"]; Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match."); var micalg = multipart.ContentType.Parameters["micalg"]; Assert.AreEqual ("pgp-sha1", micalg, "The multipart/signed micalg does not match."); Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part."); Assert.IsInstanceOf<<API key>> (multipart[1], "The second child is not a detached signature."); <API key> signatures; try { signatures = multipart.Verify (); } catch (IOException ex) { if (ex.Message == "unknown PGP public key algorithm encountered") { Assert.Ignore ("Known issue: {0}", ex.Message); return; } throw; } Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key>) { // Note: Werner Koch's keyring has an EdDSA subkey which breaks BouncyCastle's // <API key> reader. If/when one of the round-robin keys.gnupg.net // key servers returns this particular keyring, we can expect to get an exception // about being unable to find Werner's public key. //Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public async Task <API key> () { var message = await MimeMessage.LoadAsync (Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "[Announce] GnuPG 2.1.20 released.eml")); var multipart = (MultipartSigned) ((Multipart) message.Body)[0]; Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children."); var protocol = multipart.ContentType.Parameters["protocol"]; Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match."); var micalg = multipart.ContentType.Parameters["micalg"]; Assert.AreEqual ("pgp-sha1", micalg, "The multipart/signed micalg does not match."); Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part."); Assert.IsInstanceOf<<API key>> (multipart[1], "The second child is not a detached signature."); <API key> signatures; try { signatures = await multipart.VerifyAsync (); } catch (IOException ex) { if (ex.Message == "unknown PGP public key algorithm encountered") { Assert.Ignore ("Known issue: {0}", ex.Message); return; } throw; } Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures."); foreach (var signature in signatures) { try { bool valid = signature.Verify (); Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email); } catch (<API key>) { // Note: Werner Koch's keyring has an EdDSA subkey which breaks BouncyCastle's // <API key> reader. If/when one of the round-robin keys.gnupg.net // key servers returns this particular keyring, we can expect to get an exception // about being unable to find Werner's public key. //Assert.Fail ("Failed to verify signature: {0}", ex); } } } [Test] public void TestExport () { var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); using (var ctx = new DummyOpenPgpContext ()) { Assert.AreEqual ("application/pgp-keys", ctx.KeyExchangeProtocol, "The key-exchange protocol does not match."); var keys = ctx.EnumeratePublicKeys (self).ToList (); var exported = ctx.Export (new [] { self }); Assert.IsNotNull (exported, "The exported MIME part should not be null."); Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart."); Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType); exported = ctx.Export (keys); Assert.IsNotNull (exported, "The exported MIME part should not be null."); Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart."); Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType); using (var stream = new MemoryStream ()) { ctx.Export (new[] { self }, stream, true); Assert.AreEqual (exported.Content.Stream.Length, stream.Length); } foreach (var keyring in ctx.<API key> (self)) { using (var stream = new MemoryStream ()) { ctx.Export (new[] { self }, stream, true); Assert.AreEqual (exported.Content.Stream.Length, stream.Length); } } using (var stream = new MemoryStream ()) { ctx.Export (keys, stream, true); Assert.AreEqual (exported.Content.Stream.Length, stream.Length); } } } [Test] public async Task TestExportAsync () { var self = new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com"); using (var ctx = new DummyOpenPgpContext ()) { Assert.AreEqual ("application/pgp-keys", ctx.KeyExchangeProtocol, "The key-exchange protocol does not match."); var keys = ctx.EnumeratePublicKeys (self).ToList (); var exported = await ctx.ExportAsync (new[] { self }); Assert.IsNotNull (exported, "The exported MIME part should not be null."); Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart."); Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType); exported = await ctx.ExportAsync (keys); Assert.IsNotNull (exported, "The exported MIME part should not be null."); Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart."); Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType); using (var stream = new MemoryStream ()) { await ctx.ExportAsync (new[] { self }, stream, true); Assert.AreEqual (exported.Content.Stream.Length, stream.Length); } foreach (var keyring in ctx.<API key> (self)) { using (var stream = new MemoryStream ()) { await ctx.ExportAsync (new[] { self }, stream, true); Assert.AreEqual (exported.Content.Stream.Length, stream.Length); } } using (var stream = new MemoryStream ()) { await ctx.ExportAsync (keys, stream, true); Assert.AreEqual (exported.Content.Stream.Length, stream.Length); } } } [Test] public void <API key> () { using (var ctx = new DummyOpenPgpContext ()) { foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) { if (!IsSupported (algorithm)) { Assert.Throws<<API key>> (() => ctx.<API key> = algorithm); continue; } ctx.<API key> = algorithm; Assert.AreEqual (algorithm, ctx.<API key>, "Default encryption algorithm does not match."); } } } [Test] public void TestSupports () { var supports = new [] { "application/pgp-encrypted", "application/pgp-signature", "application/pgp-keys", "application/x-pgp-encrypted", "application/x-pgp-signature", "application/x-pgp-keys" }; using (var ctx = new DummyOpenPgpContext ()) { for (int i = 0; i < supports.Length; i++) Assert.IsTrue (ctx.Supports (supports[i]), supports[i]); Assert.IsFalse (ctx.Supports ("application/octet-stream"), "application/octet-stream"); Assert.IsFalse (ctx.Supports ("text/plain"), "text/plain"); } } [Test] public void <API key> () { using (var ctx = new DummyOpenPgpContext ()) { foreach (DigestAlgorithm digest in Enum.GetValues (typeof (DigestAlgorithm))) { if (digest == DigestAlgorithm.None || digest == DigestAlgorithm.DoubleSha) continue; var name = ctx.<API key> (digest); var algo = ctx.GetDigestAlgorithm (name); Assert.AreEqual (digest, algo); } Assert.AreEqual (DigestAlgorithm.MD5, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.MD5)); Assert.AreEqual (DigestAlgorithm.Sha1, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha1)); Assert.AreEqual (DigestAlgorithm.RipeMD160, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.RipeMD160)); Assert.AreEqual (DigestAlgorithm.DoubleSha, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.DoubleSha)); Assert.AreEqual (DigestAlgorithm.MD2, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.MD2)); Assert.AreEqual (DigestAlgorithm.Tiger192, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Tiger192)); Assert.AreEqual (DigestAlgorithm.Haval5160, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Haval5pass160)); Assert.AreEqual (DigestAlgorithm.Sha256, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha256)); Assert.AreEqual (DigestAlgorithm.Sha384, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha384)); Assert.AreEqual (DigestAlgorithm.Sha512, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha512)); Assert.AreEqual (DigestAlgorithm.Sha224, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha224)); Assert.AreEqual (PublicKeyAlgorithm.RsaGeneral, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.RsaGeneral)); Assert.AreEqual (PublicKeyAlgorithm.RsaEncrypt, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.RsaEncrypt)); Assert.AreEqual (PublicKeyAlgorithm.RsaSign, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.RsaSign)); Assert.AreEqual (PublicKeyAlgorithm.ElGamalGeneral, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.ElGamalGeneral)); Assert.AreEqual (PublicKeyAlgorithm.ElGamalEncrypt, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.ElGamalEncrypt)); Assert.AreEqual (PublicKeyAlgorithm.Dsa, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.Dsa)); Assert.AreEqual (PublicKeyAlgorithm.EllipticCurve, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.ECDH)); Assert.AreEqual (PublicKeyAlgorithm.EllipticCurveDsa, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.ECDsa)); Assert.AreEqual (PublicKeyAlgorithm.DiffieHellman, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.DiffieHellman)); //Assert.AreEqual (PublicKeyAlgorithm.EdwardsCurveDsa, OpenPgpContext.<API key> (Org.BouncyCastle.Bcpg.<API key>.EdDSA)); } } [Test] public void <API key> () { Assert.Throws<<API key>> (() => CryptographyContext.Create (null)); Assert.Throws<<API key>> (() => CryptographyContext.Register ((Type) null)); Assert.Throws<<API key>> (() => CryptographyContext.Register ((Func<OpenPgpContext>) null)); Assert.Throws<<API key>> (() => CryptographyContext.Register ((Func<SecureMimeContext>) null)); using (var ctx = new DummyOpenPgpContext ()) { var clientEastwood = new MailboxAddress ("Man with No Name", "client.eastwood@fistfullofdollars.com"); var mailboxes = new [] { new MailboxAddress ("MimeKit UnitTests", "mimekit@example.com") }; var emptyMailboxes = new MailboxAddress[0]; var pubkeys = ctx.GetPublicKeys (mailboxes); var key = ctx.GetSigningKey (mailboxes[0]); var emptyPubkeys = new PgpPublicKey[0]; <API key> signatures; var stream = new MemoryStream (); var entity = new MimePart (); Assert.Throws<ArgumentException> (() => ctx.KeyServer = new Uri ("relative/uri", UriKind.Relative)); Assert.Throws<<API key>> (() => ctx.GetDigestAlgorithm (null)); Assert.Throws<<API key>> (() => ctx.<API key> (DigestAlgorithm.DoubleSha)); Assert.Throws<<API key>> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.DoubleSha)); Assert.Throws<<API key>> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.Tiger192)); Assert.Throws<<API key>> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.Haval5160)); Assert.Throws<<API key>> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.MD4)); Assert.Throws<<API key>> (() => OpenPgpContext.GetDigestAlgorithm ((Org.BouncyCastle.Bcpg.HashAlgorithmTag) 1024)); Assert.Throws<<API key>> (() => new <API key> ((<API key>) null)); Assert.Throws<<API key>> (() => new <API key> ((<API key>) null)); Assert.Throws<<API key>> (() => new <API key> ((Stream) null)); // Accept Assert.Throws<<API key>> (() => new <API key> ().Accept (null)); Assert.Throws<<API key>> (() => new <API key> (stream).Accept (null)); Assert.Throws<<API key>> (() => ctx.CanSign (null)); Assert.Throws<<API key>> (() => ctx.CanEncrypt (null)); Assert.ThrowsAsync<<API key>> (() => ctx.CanSignAsync (null)); Assert.ThrowsAsync<<API key>> (() => ctx.CanEncryptAsync (null)); // Delete Assert.Throws<<API key>> (() => ctx.Delete ((PgpPublicKeyRing) null), "Delete"); Assert.Throws<<API key>> (() => ctx.Delete ((PgpSecretKeyRing) null), "Delete"); // Decrypt Assert.Throws<<API key>> (() => ctx.Decrypt (null), "Decrypt"); // Encrypt Assert.Throws<<API key>> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "Encrypt"); Assert.Throws<<API key>> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "Encrypt"); Assert.Throws<<API key>> (() => ctx.Encrypt ((MailboxAddress[]) null, stream), "Encrypt"); Assert.Throws<<API key>> (() => ctx.Encrypt ((PgpPublicKey[]) null, stream), "Encrypt"); Assert.Throws<ArgumentException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "Encrypt"); Assert.Throws<ArgumentException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "Encrypt"); Assert.Throws<ArgumentException> (() => ctx.Encrypt (emptyMailboxes, stream), "Encrypt"); Assert.Throws<ArgumentException> (() => ctx.Encrypt (emptyPubkeys, stream), "Encrypt"); Assert.Throws<<API key>> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, mailboxes, null), "Encrypt"); Assert.Throws<<API key>> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, pubkeys, null), "Encrypt"); Assert.Throws<<API key>> (() => ctx.Encrypt (mailboxes, null), "Encrypt"); Assert.Throws<<API key>> (() => ctx.Encrypt (pubkeys, null), "Encrypt"); // EncryptAsync Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "EncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "EncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync ((MailboxAddress[]) null, stream), "EncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync ((PgpPublicKey[]) null, stream), "EncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "EncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "EncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (emptyMailboxes, stream), "EncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (emptyPubkeys, stream), "EncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, mailboxes, null), "EncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, pubkeys, null), "EncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync (mailboxes, null), "EncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.EncryptAsync (pubkeys, null), "EncryptAsync"); // Export Assert.Throws<<API key>> (() => ctx.Export ((<API key>) null), "Export"); Assert.Throws<<API key>> (() => ctx.Export ((MailboxAddress[]) null), "Export"); Assert.Throws<<API key>> (() => ctx.Export ((PgpPublicKey[]) null), "Export"); Assert.Throws<<API key>> (() => ctx.Export ((<API key>) null, stream, true), "Export"); Assert.Throws<<API key>> (() => ctx.Export ((MailboxAddress[]) null, stream, true), "Export"); Assert.Throws<<API key>> (() => ctx.Export ((PgpPublicKey[]) null, stream, true), "Export"); Assert.Throws<<API key>> (() => ctx.Export (ctx.PublicKeyRingBundle, null, true), "Export"); Assert.Throws<<API key>> (() => ctx.Export (mailboxes, null, true), "Export"); Assert.Throws<<API key>> (() => ctx.Export (pubkeys, null, true), "Export"); // ExportAsync Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync ((<API key>) null), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync ((MailboxAddress[]) null), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync ((PgpPublicKey[]) null), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync ((<API key>) null, stream, true), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync ((MailboxAddress[]) null, stream, true), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync ((PgpPublicKey[]) null, stream, true), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync (ctx.PublicKeyRingBundle, null, true), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync (mailboxes, null, true), "ExportAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.ExportAsync (pubkeys, null, true), "ExportAsync"); // EnumeratePublicKey[Ring]s Assert.Throws<<API key>> (() => ctx.<API key> (null).FirstOrDefault ()); Assert.Throws<<API key>> (() => ctx.EnumeratePublicKeys (null).FirstOrDefault ()); Assert.Throws<<API key>> (() => ctx.<API key> (null).FirstOrDefault ()); Assert.Throws<<API key>> (() => ctx.EnumerateSecretKeys (null).FirstOrDefault ()); // GenerateKeyPair Assert.Throws<<API key>> (() => ctx.GenerateKeyPair (null, "password")); Assert.Throws<<API key>> (() => ctx.GenerateKeyPair (mailboxes[0], null)); Assert.Throws<ArgumentException> (() => ctx.GenerateKeyPair (mailboxes[0], "password", DateTime.Now)); // DecryptTo Assert.Throws<<API key>> (() => ctx.DecryptTo (null, stream), "DecryptTo"); Assert.Throws<<API key>> (() => ctx.DecryptTo (stream, null), "DecryptTo"); // DecryptToAsync Assert.ThrowsAsync<<API key>> (() => ctx.DecryptToAsync (null, stream), "DecryptToAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.DecryptToAsync (stream, null), "DecryptToAsync"); // <API key> Assert.Throws<<API key>> (() => ctx.<API key> (DigestAlgorithm.None), "<API key>"); // GetPublicKeys Assert.Throws<<API key>> (() => ctx.GetPublicKeys (null)); Assert.ThrowsAsync<<API key>> (() => ctx.GetPublicKeysAsync (null)); Assert.Throws<<API key>> (() => ctx.GetPublicKeys (new MailboxAddress[] { clientEastwood })); Assert.ThrowsAsync<<API key>> (() => ctx.GetPublicKeysAsync (new MailboxAddress[] { clientEastwood })); // GetSigningKey Assert.Throws<<API key>> (() => ctx.GetSigningKey (null)); Assert.ThrowsAsync<<API key>> (() => ctx.GetSigningKeyAsync (null)); Assert.Throws<<API key>> (() => ctx.GetSigningKey (clientEastwood)); Assert.ThrowsAsync<<API key>> (() => ctx.GetSigningKeyAsync (clientEastwood)); // Import Assert.Throws<<API key>> (() => ctx.Import ((Stream) null), "Import"); Assert.Throws<<API key>> (() => ctx.Import ((PgpPublicKeyRing) null), "Import"); Assert.Throws<<API key>> (() => ctx.Import ((<API key>) null), "Import"); Assert.Throws<<API key>> (() => ctx.Import ((PgpSecretKeyRing) null), "Import"); Assert.Throws<<API key>> (() => ctx.Import ((<API key>) null), "Import"); // ImportAsync Assert.ThrowsAsync<<API key>> (() => ctx.ImportAsync ((Stream) null), "ImportAsync"); //Assert.ThrowsAsync<<API key>> (() => ctx.ImportAsync ((PgpPublicKeyRing) null), "ImportAsync"); //Assert.ThrowsAsync<<API key>> (() => ctx.ImportAsync ((<API key>) null), "ImportAsync"); //Assert.ThrowsAsync<<API key>> (() => ctx.ImportAsync ((PgpSecretKeyRing) null), "ImportAsync"); //Assert.ThrowsAsync<<API key>> (() => ctx.ImportAsync ((<API key>) null), "ImportAsync"); // Sign Assert.Throws<<API key>> (() => ctx.Sign ((MailboxAddress) null, DigestAlgorithm.Sha1, stream), "Sign"); Assert.Throws<<API key>> (() => ctx.Sign ((PgpSecretKey) null, DigestAlgorithm.Sha1, stream), "Sign"); Assert.Throws<<API key>> (() => ctx.Sign (mailboxes[0], DigestAlgorithm.Sha1, null), "Sign"); Assert.Throws<<API key>> (() => ctx.Sign (key, DigestAlgorithm.Sha1, null), "Sign"); // SignAsync Assert.ThrowsAsync<<API key>> (() => ctx.SignAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, stream), "SignAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, stream), "SignAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAsync (mailboxes[0], DigestAlgorithm.Sha1, null), "SignAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAsync (key, DigestAlgorithm.Sha1, null), "SignAsync"); // SignAndEncrypt Assert.Throws<<API key>> (() => ctx.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "SignAndEncrypt"); Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "SignAndEncrypt"); Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, (MailboxAddress[]) null, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, (PgpPublicKey[]) null, stream), "SignAndEncrypt"); Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, stream), "SignAndEncrypt"); Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, emptyPubkeys, stream), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null), "SignAndEncrypt"); Assert.Throws<<API key>> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, pubkeys, null), "SignAndEncrypt"); // SignAndEncryptAsync Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, (MailboxAddress[]) null, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, (PgpPublicKey[]) null, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, emptyPubkeys, stream), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null), "SignAndEncryptAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, pubkeys, null), "SignAndEncryptAsync"); // SignKey Assert.Throws<<API key>> (() => ctx.SignKey (null, pubkeys[0]), "SignKey"); Assert.Throws<<API key>> (() => ctx.SignKey (key, null), "SignKey"); // Supports Assert.Throws<<API key>> (() => ctx.Supports (null), "Supports"); // Verify Assert.Throws<<API key>> (() => ctx.Verify (null, stream), "Verify"); Assert.Throws<<API key>> (() => ctx.Verify (stream, null), "Verify"); // VerifyAsync Assert.ThrowsAsync<<API key>> (() => ctx.VerifyAsync (null, stream), "VerifyAsync"); Assert.ThrowsAsync<<API key>> (() => ctx.VerifyAsync (stream, null), "VerifyAsync"); // MultipartEncrypted // Encrypt Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt ((MailboxAddress[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt ((PgpPublicKey[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (pubkeys, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (null, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, (MailboxAddress[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (null, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, (PgpPublicKey[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, pubkeys, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, pubkeys, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (null, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (null, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, pubkeys, null)); // EncryptAsync Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync ((MailboxAddress[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync ((PgpPublicKey[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (pubkeys, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (null, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, (MailboxAddress[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (null, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, (PgpPublicKey[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, pubkeys, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, pubkeys, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (null, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (null, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, pubkeys, null)); // SignAndEncrypt Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, pubkeys, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (null, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (null, key, DigestAlgorithm.Sha1, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, pubkeys, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (null, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (null, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.Throws<<API key>> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null)); // SignAndEncryptAsync Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, pubkeys, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (null, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (null, key, DigestAlgorithm.Sha1, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, pubkeys, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (null, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (null, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity)); Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null)); var encrypted = new MultipartEncrypted (); Assert.Throws<<API key>> (() => encrypted.Accept (null)); Assert.Throws<<API key>> (() => encrypted.Decrypt (null)); Assert.Throws<<API key>> (() => encrypted.Decrypt (null, out signatures)); // MultipartSigned.Create Assert.Throws<<API key>> (() => MultipartSigned.Create (null, mailboxes[0], DigestAlgorithm.Sha1, entity)); Assert.Throws<<API key>> (() => MultipartSigned.Create (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, entity)); Assert.Throws<<API key>> (() => MultipartSigned.Create (ctx, mailboxes[0], DigestAlgorithm.Sha1, null)); Assert.Throws<<API key>> (() => MultipartSigned.Create (null, key, DigestAlgorithm.Sha1, entity)); Assert.Throws<<API key>> (() => MultipartSigned.Create (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, entity)); Assert.Throws<<API key>> (() => MultipartSigned.Create (ctx, key, DigestAlgorithm.Sha1, null)); Assert.Throws<<API key>> (() => MultipartSigned.Create ((PgpSecretKey) null, DigestAlgorithm.Sha1, entity)); Assert.Throws<<API key>> (() => MultipartSigned.Create (key, DigestAlgorithm.Sha1, null)); // MultipartSigned.CreateAsync Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync (null, mailboxes[0], DigestAlgorithm.Sha1, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, null)); Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync (null, key, DigestAlgorithm.Sha1, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync (ctx, key, DigestAlgorithm.Sha1, null)); Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, entity)); Assert.ThrowsAsync<<API key>> (() => MultipartSigned.CreateAsync (key, DigestAlgorithm.Sha1, null)); var signed = MultipartSigned.Create (key, DigestAlgorithm.Sha1, entity); Assert.Throws<<API key>> (() => signed.Accept (null)); Assert.Throws<<API key>> (() => signed.Prepare (EncodingConstraint.SevenBit, 0)); Assert.Throws<<API key>> (() => signed.Verify (null)); Assert.ThrowsAsync<<API key>> (() => signed.VerifyAsync (null)); } } static void <API key> (IMimeFilter filter, string fileName, bool isText) { using (var stream = File.OpenRead (fileName)) { using (var filtered = new FilteredStream (stream)) { var buffer = new byte[1]; int outputLength; int outputIndex; int n; if (isText) filtered.Add (new Unix2DosFilter ()); while ((n = filtered.Read (buffer, 0, buffer.Length)) > 0) filter.Filter (buffer, 0, n, out outputIndex, out outputLength); filter.Flush (buffer, 0, 0, out outputIndex, out outputLength); } } } [Test] public void <API key> () { var filter = new <API key> (); <API key> (filter, Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "mimekit.gpg.pub"), true); Assert.AreEqual (OpenPgpDataType.PublicKey, filter.DataType); Assert.AreEqual (0, filter.BeginOffset); Assert.AreEqual (1754, filter.EndOffset); filter.Reset (); <API key> (filter, Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "mimekit.gpg.sec"), true); Assert.AreEqual (OpenPgpDataType.PrivateKey, filter.DataType); Assert.AreEqual (0, filter.BeginOffset); Assert.AreEqual (3650, filter.EndOffset); } } }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="el_GR" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Number7</source> <translation>Σχετικά με το Number7</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Number7&lt;/b&gt; version</source> <translation>Έκδοση Number7</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http: <translation> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http: </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Πνευματική ιδιοκτησία </translation> </message> <message> <location line="+0"/> <source>The Number7 developers</source> <translation>Οι Number7 προγραμματιστές </translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Βιβλίο Διευθύνσεων</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Διπλό-κλικ για επεξεργασία της διεύθυνσης ή της ετικέτας</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Δημιούργησε νέα διεύθυνση</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Αντέγραψε την επιλεγμένη διεύθυνση στο πρόχειρο του συστήματος</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Νέα διεύθυνση</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Number7 addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Αυτές είναι οι Number7 διευθύνσεις σας για να λαμβάνετε πληρωμές. Δίνοντας μία ξεχωριστή διεύθυνση σε κάθε αποστολέα, θα μπορείτε να ελέγχετε ποιος σας πληρώνει.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Αντιγραφή διεύθυνσης</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Δείξε &amp;QR κωδικα</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Number7 address</source> <translation>Υπογράψτε ένα μήνυμα για ν&apos; αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση Number7</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>&amp;Υπέγραψε το μήνυμα</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Αντιγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Εξαγωγή</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Number7 address</source> <translation>Υπογράψτε ένα μήνυμα για ν&apos; αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση Number7</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Επιβεβαίωση μηνύματος</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Διαγραφή</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Number7 addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Αυτές είναι οι Number7 διευθύνσεις σας για να λαμβάνετε πληρωμές. Δίνοντας μία ξεχωριστή διεύθυνση σε κάθε αποστολέα, θα μπορείτε να ελέγχετε ποιος σας πληρώνει.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Αντιγραφή &amp;επιγραφής</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Επεξεργασία</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Αποστολή νομισμάτων</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Εξαγωγή Δεδομενων Βιβλίου Διευθύνσεων</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Εξαγωγή λαθών</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Αδυναμία εγγραφής στο αρχείο %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Ετικέτα</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Διεύθυνση</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(χωρίς ετικέτα)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Φράση πρόσβασης </translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Βάλτε κωδικό πρόσβασης</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Νέος κωδικός πρόσβασης</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Επανέλαβε τον νέο κωδικό πρόσβασης</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Εισάγετε τον νέο κωδικό πρόσβασης στον πορτοφόλι &lt;br/&gt; Παρακαλώ χρησιμοποιείστε ένα κωδικό με &lt;b&gt; 10 ή περισσότερους τυχαίους χαρακτήρες&lt;/b&gt; ή &lt;b&gt; οχτώ ή παραπάνω λέξεις&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Κρυπτογράφησε το πορτοφόλι</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Αυτη η ενεργεία χρειάζεται τον κωδικό του πορτοφολιού για να ξεκλειδώσει το πορτοφόλι.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Ξεκλειδωσε το πορτοφολι</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Αυτη η ενεργεια χρειάζεται τον κωδικο του πορτοφολιου για να αποκρυπτογραφησειι το πορτοφολι.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Αποκρυπτογράφησε το πορτοφολι</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Άλλαξε κωδικο πρόσβασης</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Εισάγετε τον παλιό και τον νεο κωδικο στο πορτοφολι.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Επιβεβαίωσε την κρυπτογραφηση του πορτοφολιού</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR NUMBER7S&lt;/b&gt;!</source> <translation>Προσοχη: Εαν κρυπτογραφησεις το πορτοφολι σου και χάσεις τον κωδικο σου θα χάσεις &lt;b&gt; ΟΛΑ ΣΟΥ ΤΑ NUMBER7S&lt;/b&gt;! Είσαι σίγουρος ότι θέλεις να κρυπτογραφησεις το πορτοφολι;</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Είστε σίγουροι ότι θέλετε να κρυπτογραφήσετε το πορτοφόλι σας;</translation> </message> <message> <location line="+15"/> <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>ΣΗΜΑΝΤΙΚΟ: Τα προηγούμενα αντίγραφα ασφαλείας που έχετε κάνει από το αρχείο του πορτοφόλιου σας θα πρέπει να αντικατασταθουν με το νέο που δημιουργείται, κρυπτογραφημένο αρχείο πορτοφόλιου. Για λόγους ασφαλείας, τα προηγούμενα αντίγραφα ασφαλείας του μη κρυπτογραφημένου αρχείου πορτοφόλιου θα καταστουν άχρηστα μόλις αρχίσετε να χρησιμοποιείτε το νέο κρυπτογραφημένο πορτοφόλι. </translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Προσοχη: το πλήκτρο Caps Lock είναι ενεργο.</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Κρυπτογραφημενο πορτοφολι</translation> </message> <message> <location line="-56"/> <source>Number7 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your number7s from being stolen by malware infecting your computer.</source> <translation>Το Number7 θα κλεισει τώρα για να τελειώσει την διαδικασία κρυπτογραφησης. Θυμησου ότι κρυπτογραφώντας το πορτοφολι σου δεν μπορείς να προστατέψεις πλήρως τα number7s σου από κλοπή στην περίπτωση όπου μολυνθεί ο υπολογιστής σου με κακόβουλο λογισμικο.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Η κρυπτογραφηση του πορτοφολιού απέτυχε</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Η κρυπτογράφηση του πορτοφολιού απέτυχε λογω εσωτερικού σφάλματος. Το πορτοφολι δεν κρυπτογραφηθηκε.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Οι εισαχθέντες κωδικοί δεν ταιριάζουν.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Ο κωδικος που εισήχθη για την αποκρυπτογραφηση του πορτοφολιού ήταν λαθος.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Η αποκρυπτογραφηση του πορτοφολιού απέτυχε</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Ο κωδικος του πορτοφολιού άλλαξε με επιτυχία.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Υπογραφή &amp;Μηνύματος...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Συγχρονισμός με το δίκτυο...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Επισκόπηση</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Εμφάνισε γενική εικονα του πορτοφολιού</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Συναλλαγές</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Περιήγηση στο ιστορικο συνναλαγων</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Εξεργασια της λιστας των αποθηκευμενων διευθύνσεων και ετικετων</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Εμφάνισε την λίστα των διευθύνσεων για την παραλαβή πληρωμων</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>Έ&amp;ξοδος</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Εξοδος από την εφαρμογή</translation> </message> <message> <location line="+4"/> <source>Show information about Number7</source> <translation>Εμφάνισε πληροφορίες σχετικά με το Number7</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Σχετικά με &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Εμφάνισε πληροφορίες σχετικά με Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Επιλογές...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Κρυπτογράφησε το πορτοφόλι</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Αντίγραφο ασφαλείας του πορτοφολιού</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Άλλαξε κωδικο πρόσβασης</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Εισαγωγή μπλοκ από τον σκληρο δίσκο ... </translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Φόρτωση ευρετηρίου μπλοκ στον σκληρο δισκο...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Number7 address</source> <translation>Στείλε νομισματα σε μια διεύθυνση number7</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Number7</source> <translation>Επεργασία ρυθμισεων επιλογών για το Number7</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Δημιουργία αντιγράφου ασφαλείας πορτοφολιού σε άλλη τοποθεσία</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Αλλαγή του κωδικού κρυπτογράφησης του πορτοφολιού</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Παράθυρο αποσφαλμάτωσης</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Άνοιγμα κονσόλας αποσφαλμάτωσης και διαγνωστικών</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Επιβεβαίωση μηνύματος</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Number7</source> <translation>Number7</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Πορτοφόλι</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Αποστολή</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Παραλαβή </translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Διεύθυνσεις</translation> </message> <message> <location line="+22"/> <source>&amp;About Number7</source> <translation>&amp;Σχετικα:Number7</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Εμφάνισε/Κρύψε</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Εμφάνιση ή αποκρύψη του κεντρικου παράθυρου </translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Κρυπτογραφήστε τα ιδιωτικά κλειδιά που ανήκουν στο πορτοφόλι σας </translation> </message> <message> <location line="+7"/> <source>Sign messages with your Number7 addresses to prove you own them</source> <translation>Υπογράψτε ένα μήνυμα για να βεβαιώσετε πως είστε ο κάτοχος αυτής της διεύθυνσης</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Number7 addresses</source> <translation>Υπογράψτε ένα μήνυμα για ν&apos; αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση Number7</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Αρχείο</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Ρυθμίσεις</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Βοήθεια</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Εργαλειοθήκη καρτελών</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>Number7 client</source> <translation>Πελάτης Number7</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Number7 network</source> <translation><numerusform>%n ενεργή σύνδεση στο δίκτυο Number7</numerusform><numerusform>%n ενεργές συνδέσεις στο δίκτυο Βitcoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Η πηγή του μπλοκ δεν ειναι διαθέσιμη... </translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Μεταποιημένα %1 απο % 2 (κατ &apos;εκτίμηση) μπλοκ της ιστορίας της συναλλαγής. </translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Έγινε λήψη %1 μπλοκ ιστορικού συναλλαγών</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n ώρες </numerusform><numerusform>%n ώρες </numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n ημέρες </numerusform><numerusform>%n ημέρες </numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n εβδομαδες</numerusform><numerusform>%n εβδομαδες</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 πίσω</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Το τελευταίο μπλοκ που ελήφθη δημιουργήθηκε %1 πριν.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Οι συναλλαγές μετά από αυτό δεν θα είναι ακόμη ορατες.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Σφάλμα</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Προειδοποίηση</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Πληροφορία</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Η συναλλαγή ξεπερνάει το όριο. Μπορεί να ολοκληρωθεί με μια αμοιβή των %1, η οποία αποδίδεται στους κόμβους που επεξεργάζονται τις συναλλαγές και βοηθούν στην υποστήριξη του δικτύου. Θέλετε να συνεχίσετε;</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Ενημερωμένο</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Ενημέρωση...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Επιβεβαίωση αμοιβής συναλλαγής</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Η συναλλαγή απεστάλη</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Εισερχόμενη συναλλαγή</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Ημερομηνία: %1 Ποσό: %2 Τύπος: %3 Διεύθυνση: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Χειρισμός URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Number7 address or malformed URI parameters.</source> <translation>Το URI δεν μπορεί να αναλυθεί! Αυτό μπορεί να προκληθεί από μια μη έγκυρη διεύθυνση Number7 ή ακατάλληλη παραμέτρο URI.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Το πορτοφόλι είναι &lt;b&gt;κρυπτογραφημένο&lt;/b&gt; και &lt;b&gt;ξεκλείδωτο&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Το πορτοφόλι είναι &lt;b&gt;κρυπτογραφημένο&lt;/b&gt; και &lt;b&gt;κλειδωμένο&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Number7 can no longer continue safely and will quit.</source> <translation>Παρουσιάστηκε ανεπανόρθωτο σφάλμα. Το Number7 δεν μπορεί πλέον να συνεχίσει με ασφάλεια και θα τερματισθει.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Ειδοποίηση Δικτύου</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Επεξεργασία Διεύθυνσης</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Επιγραφή</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Η επιγραφή που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Διεύθυνση</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>Η διεύθυνση που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων. Μπορεί να τροποποιηθεί μόνο για τις διευθύνσεις αποστολής.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Νέα διεύθυνση λήψης</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Νέα διεύθυνση αποστολής</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Επεξεργασία διεύθυνσης λήψης</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Επεξεργασία διεύθυνσης αποστολής</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Η διεύθυνση &quot;%1&quot; βρίσκεται ήδη στο βιβλίο διευθύνσεων.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Number7 address.</source> <translation>Η διεύθυνση &quot;%1&quot; δεν είναι έγκυρη Number7 διεύθυνση.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Δεν είναι δυνατό το ξεκλείδωμα του πορτοφολιού.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Η δημιουργία νέου κλειδιού απέτυχε.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Number7-Qt</source> <translation>number7-qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>έκδοση</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Χρήση:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>επιλογής γραμμής εντολών</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>επιλογές UI</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Όρισε γλώσσα, για παράδειγμα &quot;de_DE&quot;(προεπιλογή:τοπικές ρυθμίσεις)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Έναρξη ελαχιστοποιημένο</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Εμφάνισε την οθόνη εκκίνησης κατά την εκκίνηση(προεπιλογή:1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Ρυθμίσεις</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Κύριο</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Η προαιρετική αμοιβή για κάθε kB επισπεύδει την επεξεργασία των συναλλαγών σας. Οι περισσότερες συναλλαγές είναι 1 kB. </translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Αμοιβή &amp;συναλλαγής</translation> </message> <message> <location line="+31"/> <source>Automatically start Number7 after logging in to the system.</source> <translation>Αυτόματη εκκίνηση του Number7 μετά την εισαγωγή στο σύστημα</translation> </message> <message> <location line="+3"/> <source>&amp;Start Number7 on system login</source> <translation>&amp;Έναρξη του Βιtcoin κατά την εκκίνηση του συστήματος</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Επαναφορα όλων των επιλογων του πελάτη σε default.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>Επαναφορα ρυθμίσεων</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Δίκτυο</translation> </message> <message> <location line="+6"/> <source>Automatically open the Number7 client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Αυτόματο άνοιγμα των θυρών Number7 στον δρομολογητή. Λειτουργεί μόνο αν ο δρομολογητής σας υποστηρίζει τη λειτουργία UPnP.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Απόδοση θυρών με χρήστη &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Number7 network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Σύνδεση στο Number7 δίκτυο μέσω διαμεσολαβητή SOCKS4 (π.χ. για σύνδεση μέσω Tor)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Σύνδεση μέσω διαμεσολαβητή SOCKS</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP διαμεσολαβητή:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Διεύθυνση IP του διαμεσολαβητή (π.χ. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Θύρα:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Θύρα διαμεσολαβητή</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Έκδοση:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>SOCKS εκδοση του διαμεσολαβητη (e.g. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Παράθυρο</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Εμφάνιση μόνο εικονιδίου στην περιοχή ειδοποιήσεων κατά την ελαχιστοποίηση</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Ελαχιστοποίηση στην περιοχή ειδοποιήσεων αντί της γραμμής εργασιών</translation> </message> <message> <location line="+7"/> <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 Quit in the menu.</source> <translation>Ελαχιστοποίηση αντί για έξοδο κατά το κλείσιμο του παραθύρου</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>Ε&amp;λαχιστοποίηση κατά το κλείσιμο</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>%Απεικόνιση</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>Γλώσσα περιβάλλοντος εργασίας: </translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Number7.</source> <translation>Εδώ μπορεί να ρυθμιστεί η γλώσσα διεπαφής χρήστη. Αυτή η ρύθμιση θα ισχύσει μετά την επανεκκίνηση του Number7.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Μονάδα μέτρησης:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Διαλέξτε την προεπιλεγμένη υποδιαίρεση που θα εμφανίζεται όταν στέλνετε νομίσματα.</translation> </message> <message> <location line="+9"/> <source>Whether to show Number7 addresses in the transaction list or not.</source> <translation>Επιλέξτε αν θέλετε να εμφανίζονται οι διευθύνσεις Number7 στη λίστα συναλλαγών.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Εμφάνιση διευθύνσεων στη λίστα συναλλαγών</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;ΟΚ</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Ακύρωση</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Εφαρμογή</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>προεπιλογή</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Επιβεβαιώση των επιλογων επαναφοράς </translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Για ορισμένες ρυθμίσεις πρεπει η επανεκκίνηση να τεθεί σε ισχύ.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Θέλετε να προχωρήσετε;</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Προειδοποίηση</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Number7.</source> <translation>Αυτή η ρύθμιση θα ισχύσει μετά την επανεκκίνηση του Number7.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Φόρμα</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Number7 network after a connection is established, but this process has not completed yet.</source> <translation>Οι πληροφορίες που εμφανίζονται μπορεί να είναι ξεπερασμένες. Το πορτοφόλι σας συγχρονίζεται αυτόματα με το δίκτυο Number7 μετά από μια σύνδεση, αλλά αυτή η διαδικασία δεν έχει ακόμη ολοκληρωθεί. </translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Υπόλοιπο</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Ανεπιβεβαίωτες</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Πορτοφόλι</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Ανώριμος</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Εξορυγμενο υπόλοιπο που δεν έχει ακόμα ωριμάσει </translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Πρόσφατες συναλλαγές&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Το τρέχον υπόλοιπο</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Το άθροισμα των συναλλαγών που δεν έχουν ακόμα επιβεβαιωθεί και δεν προσμετρώνται στο τρέχον υπόλοιπό σας</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>εκτός συγχρονισμού</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start number7: click-to-pay handler</source> <translation>Δεν είναι δυνατή η εκκίνηση του Number7: click-to-pay handler</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Κώδικας QR</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Αίτηση πληρωμής</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Ποσό:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Επιγραφή:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Μήνυμα:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Αποθήκευση ως...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Σφάλμα κατά την κωδικοποίηση του URI σε κώδικα QR</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Το αναγραφόμενο ποσό δεν είναι έγκυρο, παρακαλούμε να το ελέγξετε.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Το αποτέλεσμα της διεύθυνσης είναι πολύ μεγάλο. Μειώστε το μέγεθος για το κείμενο της ετικέτας/ μηνύματος.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Αποθήκευση κώδικα QR</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Εικόνες PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Όνομα Πελάτη</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>Μη διαθέσιμο</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Έκδοση Πελάτη</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Πληροφορία</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Χρησιμοποιηση της OpenSSL εκδοσης</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Χρόνος εκκίνησης</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Δίκτυο</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Αριθμός συνδέσεων</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Στο testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>αλυσίδα εμποδισμού</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Τρέχον αριθμός μπλοκ</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Κατ&apos; εκτίμηση συνολικά μπλοκς</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Χρόνος τελευταίου μπλοκ</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Άνοιγμα</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>επιλογής γραμμής εντολών</translation> </message> <message> <location line="+7"/> <source>Show the Number7-Qt help message to get a list with possible Number7 command-line options.</source> <translation>Εμφανιση του Number7-Qt μήνυματος βοήθειας για να πάρετε μια λίστα με τις πιθανές επιλογές Number7 γραμμής εντολών.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Εμφάνιση</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Κονσόλα</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Ημερομηνία κατασκευής</translation> </message> <message> <location line="-104"/> <source>Number7 - Debug window</source> <translation>Number7 - Παράθυρο αποσφαλμάτωσης</translation> </message> <message> <location line="+25"/> <source>Number7 Core</source> <translation>Number7 Core</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Αρχείο καταγραφής εντοπισμού σφαλμάτων </translation> </message> <message> <location line="+7"/> <source>Open the Number7 debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Ανοίξτε το αρχείο καταγραφής εντοπισμού σφαλμάτων από τον τρέχοντα κατάλογο δεδομένων. Αυτό μπορεί να πάρει μερικά δευτερόλεπτα για τα μεγάλα αρχεία καταγραφής. </translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Καθαρισμός κονσόλας</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Number7 RPC console.</source> <translation>Καλώς ήρθατε στην Number7 RPC κονσόλα.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Χρησιμοποιήστε το πάνω και κάτω βέλος για να περιηγηθείτε στο ιστορικο, και &lt;b&gt;Ctrl-L&lt;/b&gt; για εκκαθαριση οθονης.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Γράψτε &lt;b&gt;βοήθεια&lt;/b&gt; για μια επισκόπηση των διαθέσιμων εντολών</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Αποστολή νομισμάτων</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Αποστολή σε πολλούς αποδέκτες ταυτόχρονα</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Προσθήκη αποδέκτη</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Διαγραφή όλων των πεδίων συναλλαγής</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Καθαρισμός &amp;Όλων</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Υπόλοιπο:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123,456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Επιβεβαίωση αποστολής</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>Αποστολη</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; σε %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Επιβεβαίωση αποστολής νομισμάτων</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Είστε βέβαιοι για την αποστολή %1;</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>και</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Η διεύθυνση του αποδέκτη δεν είναι σωστή. Παρακαλώ ελέγξτε ξανά.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Το ποσό πληρωμής πρέπει να είναι μεγαλύτερο από 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Το ποσό ξεπερνάει το διαθέσιμο υπόλοιπο</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Το σύνολο υπερβαίνει το υπόλοιπό σας όταν συμπεριληφθεί και η αμοιβή %1</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Βρέθηκε η ίδια διεύθυνση δύο φορές. Επιτρέπεται μία μόνο εγγραφή για κάθε διεύθυνση, σε κάθε διαδικασία αποστολής.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Σφάλμα: Η δημιουργία της συναλλαγής απέτυχε</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Σφάλμα: Η συναλλαγή απερρίφθη. Αυτό ενδέχεται να συμβαίνει αν κάποια από τα νομίσματα έχουν ήδη ξοδευθεί, όπως αν χρησιμοποιήσατε αντίγραφο του wallet.dat και τα νομίσματα ξοδεύθηκαν εκεί.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Φόρμα</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Ποσό:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Πληρωμή &amp;σε:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. <API key>)</source> <translation>Διεύθυνση αποστολής της πληρωμής (e.g. <API key>)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Εισάγετε μια επιγραφή για αυτή τη διεύθυνση ώστε να καταχωρηθεί στο βιβλίο διευθύνσεων</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Επιγραφή</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Επιλογή διεύθυνσης από το βιβλίο διευθύνσεων</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Επικόλληση διεύθυνσης από το πρόχειρο</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Αφαίρεση αποδέκτη</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Number7 address (e.g. <API key>)</source> <translation>Εισάγετε μια διεύθυνση Number7 (π.χ. <API key>)</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Υπογραφές - Είσοδος / Επαλήθευση μήνυματος </translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Υπογραφή Μηνύματος</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, 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>Μπορείτε να υπογράφετε μηνύματα με τις διευθύνσεις σας, ώστε ν&apos; αποδεικνύετε πως αυτές σας ανήκουν. Αποφεύγετε να υπογράφετε κάτι αόριστο καθώς ενδέχεται να εξαπατηθείτε. Υπογράφετε μόνο πλήρης δηλώσεις με τις οποίες συμφωνείτε.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. <API key>)</source> <translation>Εισάγετε μια διεύθυνση Number7 (π.χ. <API key>)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Επιλογή διεύθυνσης από το βιβλίο διευθύνσεων</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Επικόλληση διεύθυνσης από το βιβλίο διευθύνσεων</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Εισάγετε εδώ το μήνυμα που θέλετε να υπογράψετε</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Υπογραφή</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Αντέγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Number7 address</source> <translation>Υπογράψτε ένα μήνυμα για ν&apos; αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση Number7</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Υπογραφη μήνυματος</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Επαναφορά όλων των πεδίων μήνυματος</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Καθαρισμός &amp;Όλων</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Επιβεβαίωση μηνύματος</translation> </message> <message> <location line="+6"/> <source>Enter the signing 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.</source> <translation>Πληκτρολογήστε την υπογραφή διεύθυνσης, μήνυμα (βεβαιωθείτε ότι έχετε αντιγράψει τις αλλαγές γραμμής, κενά, tabs, κ.λπ. ακριβώς) και την υπογραφή παρακάτω, για να ελέγξει το μήνυμα. Να είστε προσεκτικοί για να μην διαβάσετε περισσότερα στην υπογραφή ό, τι είναι στην υπογραφή ίδιο το μήνυμα , για να μην εξαπατηθούν από έναν άνθρωπο -in - the-middle επίθεση.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. <API key>)</source> <translation>Εισάγετε μια διεύθυνση Number7 (π.χ. <API key>)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Number7 address</source> <translation>Υπογράψτε ένα μήνυμα για ν&apos; αποδείξετε πως υπογραφθηκε απο μια συγκεκριμένη διεύθυνση Number7</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Επιβεβαίωση μηνύματος</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Επαναφορά όλων επαλήθευμενων πεδίων μήνυματος </translation> </message> <message> <location filename="../<API key>.cpp" line="+27"/> <location line="+3"/> <source>Enter a Number7 address (e.g. <API key>)</source> <translation>Εισάγετε μια διεύθυνση Number7 (π.χ. <API key>)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Κάντε κλικ στο &quot;Υπογραφή Μηνύματος&quot; για να λάβετε την υπογραφή</translation> </message> <message> <location line="+3"/> <source>Enter Number7 signature</source> <translation>Εισαγωγή υπογραφής Number7</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Η διεύθυνση που εισήχθη είναι λάθος.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Παρακαλούμε ελέγξτε την διεύθυνση και δοκιμάστε ξανά.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Η διεύθυνση που έχει εισαχθεί δεν αναφέρεται σε ένα πλήκτρο.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Το προσωπικό κλειδί εισαγμενης διευθυνσης δεν είναι διαθέσιμο.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Η υπογραφή του μηνύματος απέτυχε.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Μήνυμα υπεγράφη.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Η υπογραφή δεν μπόρεσε να αποκρυπτογραφηθεί.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Παρακαλούμε ελέγξτε την υπογραφή και δοκιμάστε ξανά.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Η υπογραφή δεν ταιριάζει με το μήνυμα. </translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Η επιβεβαίωση του μηνύματος απέτυχε</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Μήνυμα επιβεβαιώθηκε.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Number7 developers</source> <translation>Οι Number7 προγραμματιστές </translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Ανοιχτό μέχρι %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/χωρίς σύνδεση;</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/χωρίς επιβεβαίωση</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 επιβεβαιώσεις</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Κατάσταση</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Ημερομηνία</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Πηγή</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Δημιουργία </translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Από</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Προς</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation> δική σας διεύθυνση </translation> </message> <message> <location line="-2"/> <source>label</source> <translation>eπιγραφή</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Πίστωση </translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>μη αποδεκτό</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debit</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Τέλος συναλλαγής </translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Καθαρό ποσό</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Μήνυμα</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Σχόλιο:</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID Συναλλαγής:</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 7 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Πρέπει να περιμένετε 7 μπλοκ πριν μπορέσετε να χρησιμοποιήσετε τα νομίσματα που έχετε δημιουργήσει. Το μπλοκ που δημιουργήσατε μεταδόθηκε στο δίκτυο για να συμπεριληφθεί στην αλυσίδα των μπλοκ. Αν δεν μπει σε αυτή θα μετατραπεί σε &quot;μη αποδεκτό&quot; και δε θα μπορεί να καταναλωθεί. Αυτό συμβαίνει σπάνια όταν κάποιος άλλος κόμβος δημιουργήσει ένα μπλοκ λίγα δευτερόλεπτα πριν από εσάς.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Πληροφορίες αποσφαλμάτωσης</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Συναλλαγή</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>εισροές </translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Ποσό</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>αληθής</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>αναληθής </translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, δεν έχει ακόμα μεταδοθεί μ&apos; επιτυχία</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>άγνωστο</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Transaction details</source> <translation>Λεπτομέρειες συναλλαγής</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Αυτό το παράθυρο δείχνει μια λεπτομερή περιγραφή της συναλλαγής</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../<API key>.cpp" line="+225"/> <source>Date</source> <translation>Ημερομηνία</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Τύπος</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Διεύθυνση</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Ποσό</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Ανοιχτό μέχρι %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Χωρίς σύνδεση (%1 επικυρώσεις)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Χωρίς επιβεβαίωση (%1 από %2 επικυρώσεις)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Επικυρωμένη (%1 επικυρώσεις)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Αυτό το μπλοκ δεν έχει παραληφθεί από κανέναν άλλο κόμβο και κατά πάσα πιθανότητα θα απορριφθεί!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Δημιουργήθηκε αλλά απορρίφθηκε</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Παραλαβή με</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Ελήφθη από</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Αποστολή προς</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Πληρωμή προς εσάς</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Εξόρυξη</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(δ/α)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Κατάσταση συναλλαγής. Πηγαίνετε το ποντίκι πάνω από αυτό το πεδίο για να δείτε τον αριθμό των επικυρώσεων</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Ημερομηνία κι ώρα λήψης της συναλλαγής.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Είδος συναλλαγής.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Διεύθυνση αποστολής της συναλλαγής.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Ποσό που αφαιρέθηκε ή προστέθηκε στο υπόλοιπο.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Όλα</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Σήμερα</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Αυτή την εβδομάδα</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Αυτόν τον μήνα</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Τον προηγούμενο μήνα</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Αυτό το έτος</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Έκταση...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Ελήφθη με</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Απεστάλη προς</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Προς εσάς</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Εξόρυξη</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Άλλο</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Αναζήτηση με βάση τη διεύθυνση ή την επιγραφή</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Ελάχιστο ποσό</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Αντιγραφή διεύθυνσης</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Αντιγραφή επιγραφής</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Αντιγραφή ποσού</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Αντιγραφη του ID Συναλλαγής</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Επεξεργασία επιγραφής</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Εμφάνιση λεπτομερειών συναλλαγής</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Εξαγωγή Στοιχείων Συναλλαγών</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Επικυρωμένες</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Ημερομηνία</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Τύπος</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Επιγραφή</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Διεύθυνση</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Ποσό</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Σφάλμα εξαγωγής</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Αδυναμία εγγραφής στο αρχείο %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Έκταση:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>έως</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Αποστολή νομισμάτων</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Εξαγωγή</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Αντίγραφο ασφαλείας του πορτοφολιού</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Αρχεία δεδομένων πορτοφολιού (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Αποτυχία κατά τη δημιουργία αντιγράφου</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Παρουσιάστηκε σφάλμα κατά την αποθήκευση των δεδομένων πορτοφολιού στη νέα τοποθεσία.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Η δημιουργια αντιγραφου ασφαλειας πετυχε</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Τα δεδομένα πορτοφόλιου αποθηκεύτηκαν με επιτυχία στη νέα θέση. </translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Number7 version</source> <translation>Έκδοση Number7</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Χρήση:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or number7d</source> <translation>Αποστολή εντολής στον εξυπηρετητή ή στο number7d</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Λίστα εντολών</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Επεξήγηση εντολής</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Επιλογές:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: number7.conf)</source> <translation>Ορίστε αρχείο ρυθμίσεων (προεπιλογή: number7.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: number7d.pid)</source> <translation>Ορίστε αρχείο pid (προεπιλογή: number7d.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Ορισμός φακέλου δεδομένων</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Όρισε το μέγεθος της βάσης προσωρινής αποθήκευσης σε megabytes(προεπιλογή:25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 6093 or testnet: 16093)</source> <translation>Εισερχόμενες συνδέσεις στη θύρα &lt;port&gt; (προεπιλογή: 6093 ή στο testnet: 16093)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Μέγιστες αριθμός συνδέσεων με τους peers &lt;n&gt; (προεπιλογή: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Σύνδεση σε έναν κόμβο για την ανάκτηση διευθύνσεων από ομοτίμους, και αποσυνδέσh</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Διευκρινίστε τη δικιά σας δημόσια διεύθυνση.</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Όριο αποσύνδεσης προβληματικών peers (προεπιλογή: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Δευτερόλεπτα πριν επιτραπεί ξανά η σύνδεση των προβληματικών peers (προεπιλογή: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η πόρτα RPC %u για αναμονή IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 6094 or testnet: 16094)</source> <translation>Εισερχόμενες συνδέσεις JSON-RPC στη θύρα &lt;port&gt; (προεπιλογή: 6094 or testnet: 16094)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Αποδοχή εντολών κονσόλας και JSON-RPC</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Εκτέλεση στο παρασκήνιο κι αποδοχή εντολών</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Χρήση του δοκιμαστικού δικτύου</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Να δέχεσαι συνδέσεις από έξω(προεπιλογή:1)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=number7rpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Number7 Alert&quot; admin@foo.com </source> <translation>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=number7rpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Number7 Alert&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η υποδοχη RPC %u για αναμονη του IPv6, επεσε πισω στο IPv4:%s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Αποθηκευση σε συγκεκριμένη διεύθυνση. Χρησιμοποιήστε τα πλήκτρα [Host] : συμβολισμός θύρα για IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Number7 is probably already running.</source> <translation>Αδυναμία κλειδώματος του φακέλου δεδομένων %s. Πιθανώς το Number7 να είναι ήδη ενεργό.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Σφάλμα: Η συναλλαγή απορρίφθηκε. Αυτό ίσως οφείλεται στο ότι τα νομίσματά σας έχουν ήδη ξοδευτεί, π.χ. με την αντιγραφή του wallet.dat σε άλλο σύστημα και την χρήση τους εκεί, χωρίς η συναλλαγή να έχει καταγραφεί στο παρόν σύστημα.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Σφάλμα: Αυτή η συναλλαγή απαιτεί αμοιβή συναλλαγής τουλάχιστον %s λόγω του μεγέθους, πολυπλοκότητας ή της χρήσης πρόσφατης παραλαβής κεφαλαίου</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Εκτέλεση της εντολής όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Ορίστε το μέγιστο μέγεθος των high-priority/low-fee συναλλαγων σε bytes (προεπιλογή: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Αυτό είναι ένα προ-τεστ κυκλοφορίας - χρησιμοποιήστε το με δική σας ευθύνη - δεν χρησιμοποιείτε για εξόρυξη ή για αλλες εφαρμογές</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Προειδοποίηση: Η παράμετρος -paytxfee είναι πολύ υψηλή. Πρόκειται για την αμοιβή που θα πληρώνετε για κάθε συναλλαγή που θα στέλνετε.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Προειδοποίηση: Εμφανίσεις συναλλαγων δεν μπορεί να είναι σωστες! Μπορεί να χρειαστεί να αναβαθμίσετε, ή άλλοι κόμβοι μπορεί να χρειαστεί να αναβαθμίστουν. </translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Number7 will not work properly.</source> <translation>Προειδοποίηση: Παρακαλώ βεβαιωθείτε πως η ημερομηνία κι ώρα του συστήματός σας είναι σωστές. Αν το ρολόι του υπολογιστή σας πάει λάθος, ενδέχεται να μη λειτουργεί σωστά το Number7.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Προειδοποίηση : Σφάλμα wallet.dat κατα την ανάγνωση ! Όλα τα κλειδιά αναγνωρισθηκαν σωστά, αλλά τα δεδομένα των συναλλαγών ή καταχωρήσεις στο βιβλίο διευθύνσεων μπορεί να είναι ελλιπείς ή λανθασμένα. </translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Προειδοποίηση : το αρχειο wallet.dat ειναι διεφθαρμένο, τα δεδομένα σώζονται ! Original wallet.dat αποθηκεύονται ως πορτοφόλι { timestamp } bak στο % s ? . . Αν το υπόλοιπο του ή τις συναλλαγές σας, είναι λάθος θα πρέπει να επαναφέρετε από ένα αντίγραφο ασφαλείας</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Προσπάθεια για ανακτησει ιδιωτικων κλειδιων από ενα διεφθαρμένο αρχειο wallet.dat </translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Αποκλεισμός επιλογων δημιουργίας: </translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Σύνδεση μόνο με ορισμένους κόμβους</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Εντοπισθηκε διεφθαρμενη βαση δεδομενων των μπλοκ</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Ανακαλύψτε την δικη σας IP διεύθυνση (προεπιλογή: 1 όταν ακούει και δεν - externalip) </translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Θελετε να δημιουργηθει τωρα η βαση δεδομενων του μπλοκ? </translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων μπλοκ</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων πορτοφόλιου %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Σφάλμα φορτωσης της βασης δεδομενων των μπλοκ</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Σφάλμα φορτωσης της βασης δεδομενων των μπλοκ</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Προειδοποίηση: Χαμηλός χώρος στο δίσκο </translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Σφάλμα: το πορτοφόλι είναι κλειδωμένο, δεν μπορεί να δημιουργηθεί συναλλαγή</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Λάθος: λάθος συστήματος:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>ταλαιπωρηθειτε για να ακούσετε σε οποιαδήποτε θύρα. Χρήση - ακούστε = 0 , αν θέλετε αυτό.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Αποτυχία αναγνωσης των block πληροφοριων</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Η αναγνωση του μπλοκ απετυχε</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Ο συγχρονισμος του μπλοκ ευρετηριου απετυχε</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Η δημιουργια του μπλοκ ευρετηριου απετυχε</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Η δημιουργια των μπλοκ πληροφοριων απετυχε</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Η δημιουργια του μπλοκ απετυχε</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Αδυναμία εγγραφής πληροφοριων αρχειου</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Αποτυχία εγγραφής στη βάση δεδομένων νομίσματος</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Αποτυχία εγγραφής δείκτη συναλλαγών </translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Αποτυχία εγγραφής αναίρεσης δεδομένων </translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Βρες ομότιμους υπολογιστές χρησιμοποιώντας αναζήτηση DNS(προεπιλογή:1)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Δημιουργία νομισμάτων (προκαθορισμος: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Πόσα μπλοκ να ελέγχθουν κατά την εκκίνηση (προεπιλογή:288,0=όλα)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Πόσο εξονυχιστική να είναι η επιβεβαίωση του μπλοκ(0-4, προεπιλογή:3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Δεν ειναι αρκετες περιγραφες αρχείων διαθέσιμες.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Ορίσμος του αριθμόυ θεματων στην υπηρεσία κλήσεων RPC (προεπιλογή: 4) </translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Επαλήθευση των μπλοκ... </translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Επαλήθευση πορτοφολιου... </translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Ορίσμος του αριθμό των νημάτων ελέγχου σεναρίου (μέχρι 16, 0 = auto, &lt;0 = αφήνουν τους πολλους πυρήνες δωρεάν, default: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Πληροφορία</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Διατηρήση ένος πλήρες ευρετήριου συναλλαγών (προεπιλογή: 0) </translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Μέγιστος buffer λήψης ανά σύνδεση, &lt;n&gt;*1000 bytes (προεπιλογή: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Μέγιστος buffer αποστολής ανά σύνδεση, &lt;n&gt;*1000 bytes (προεπιλογή: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Μονο αποδοχη αλυσίδας μπλοκ που ταιριάζει με τα ενσωματωμένα σημεία ελέγχου (προεπιλογή: 1) </translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation> Συνδέση μόνο σε κόμβους του δικτύου &lt;net&gt; (IPv4, IPv6 ή Tor) </translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Έξοδος επιπλέον πληροφοριών εντοπισμού σφαλμάτων</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Έξοδος επιπλέον πληροφοριών εντοπισμού σφαλμάτων</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Χρονοσφραγίδα πληροφοριών εντοπισμού σφαλμάτων</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Number7 Wiki for SSL setup instructions)</source> <translation>Ρυθμίσεις SSL: (ανατρέξτε στο Number7 Wiki για οδηγίες ρυθμίσεων SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Επιλέξτε την έκδοση του διαμεσολαβητη για να χρησιμοποιήσετε (4-5 , προεπιλογή: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στον debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Ορίσμος του μέγιστου μέγεθος block σε bytes (προεπιλογή: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Ορίστε το μέγιστο μέγεθος block σε bytes (προεπιλογή: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Συρρίκνωση του αρχείο debug.log κατα την εκκίνηση του πελάτη (προεπιλογή: 1 όταν δεν-debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Η υπογραφή συναλλαγής απέτυχε </translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή:5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Λάθος Συστήματος:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Το ποσό της συναλλαγής είναι πολύ μικρο </translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Τα ποσά των συναλλαγών πρέπει να είναι θετικα</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Η συναλλαγή ειναι πολύ μεγάλη </translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:1)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Χρήση διακομιστή μεσολάβησης για την επίτευξη των Tor κρυμμένων υπηρεσιων (προεπιλογή: ίδιο με το-proxy) </translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Όνομα χρήστη για τις συνδέσεις JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Προειδοποίηση</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Προειδοποίηση: Αυτή η έκδοση είναι ξεπερασμένη, απαιτείται αναβάθμιση </translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Θα πρέπει να ξαναχτίστουν οι βάσεις δεδομένων που χρησιμοποιούντε-Αναδημιουργία αλλάγων-txindex </translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>Το αρχειο wallet.dat ειναι διεφθαρμένο, η διάσωση απέτυχε</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Κωδικός για τις συνδέσεις JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Αποδοχή συνδέσεων JSON-RPC από συγκεκριμένη διεύθυνση IP</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Αποστολή εντολών στον κόμβο &lt;ip&gt; (προεπιλογή: 127.0.0.1)</translation> </message> <message> <location line="-7"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Αναβάθμισε το πορτοφόλι στην τελευταία έκδοση</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Όριο πλήθους κλειδιών pool &lt;n&gt; (προεπιλογή: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Επανέλεγχος της αλυσίδας μπλοκ για απούσες συναλλαγές</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Χρήση του OpenSSL (https) για συνδέσεις JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Αρχείο πιστοποιητικού του διακομιστή (προεπιλογή: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Προσωπικό κλειδί του διακομιστή (προεπιλογή: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Αποδεκτά κρυπτογραφήματα (προεπιλογή: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Αυτό το κείμενο βοήθειας</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή (bind returned error %d, %s) </translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Σύνδεση μέσω διαμεσολαβητή socks</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Να επιτρέπονται οι έλεγχοι DNS για προσθήκη και σύνδεση κόμβων</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Φόρτωση διευθύνσεων...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Σφάλμα φόρτωσης wallet.dat: Κατεστραμμένο Πορτοφόλι</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Number7</source> <translation>Σφάλμα φόρτωσης wallet.dat: Το Πορτοφόλι απαιτεί μια νεότερη έκδοση του Number7</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Number7 to complete</source> <translation>Απαιτείται η επανεγγραφή του Πορτοφολιού, η οποία θα ολοκληρωθεί στην επανεκκίνηση του Number7</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Σφάλμα φόρτωσης αρχείου wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Άγνωστo δίκτυο ορίζεται σε onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Άγνωστo δίκτυο ορίζεται: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Λάθος ποσότητα</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Ανεπαρκές κεφάλαιο</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Φόρτωση ευρετηρίου μπλοκ...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Προσέθεσε ένα κόμβο για σύνδεση και προσπάθησε να κρατήσεις την σύνδεση ανοιχτή</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Number7 is probably already running.</source> <translation>Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή. Το Number7 είναι πιθανώς ήδη ενεργό.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Αμοιβή ανά KB που θα προστίθεται στις συναλλαγές που στέλνεις</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Φόρτωση πορτοφολιού...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Δεν μπορώ να υποβαθμίσω το πορτοφόλι</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Ανίχνευση...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Η φόρτωση ολοκληρώθηκε</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Χρήση της %s επιλογής</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Σφάλμα</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Πρέπει να βάλεις ένα κωδικό στο αρχείο παραμέτρων: %s Εάν το αρχείο δεν υπάρχει, δημιούργησε το με δικαιώματα μόνο για ανάγνωση από τον δημιουργό</translation> </message> </context> </TS>