answer
stringlengths 15
1.25M
|
|---|
/*
* This file exports the configuration Express.js back to the application
* so that it can be used in other parts of the product.
*/
var path = require('path');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
exports.setup = function(app, express) {
app.set('views', path.join(__dirname + '../../public/views'));
app.engine('html', require('ejs').renderFile);
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(session({
cookie: { maxAge: (24*3600*1000*30) },
store: new RedisStore({
host: 'localhost',
port: 6379,
db: 1,
pass: ''
}),
secret: 'mylittlesecret',
resave: false,
saveUninitialized: false
}));
app.use(express.static(path.join(__dirname + '../../public')));
}
|
layout: pattern
summary: "Base classes for creating simple 'nav-like' lists. Ideal for simple nav menus or for forming the basis of more complex navigation componenets."
<ul class="tan-nav-menu <API key>">
{% for i in (1..4) %}
<li class="">
<a href="#">Stacked Link {{i}}</a>
</li>
{% endfor %}
</ul>
<br><br><br>
<ul class="tan-nav-menu <API key>">
{% for i in (1..4) %}
<li class="">
<a href="#">Inline Link {{i}}</a>
</li>
{% endfor %}
</ul>
|
(function() {
chai.should();
describe("Dropzone", function() {
var getMockFile, xhr;
getMockFile = function() {
return {
status: Dropzone.ADDED,
accepted: true,
name: "test file name",
size: 123456,
type: "text/html"
};
};
xhr = null;
beforeEach(function() {
return xhr = sinon.<API key>();
});
describe("Emitter", function() {
var emitter;
emitter = null;
beforeEach(function() {
return emitter = new Dropzone.prototype.Emitter();
});
it(".on() should return the object itself", function() {
return (emitter.on("test", function() {})).should.equal(emitter);
});
it(".on() should properly register listeners", function() {
var callback, callback2;
(emitter._callbacks === void 0).should.be["true"];
callback = function() {};
callback2 = function() {};
emitter.on("test", callback);
emitter.on("test", callback2);
emitter.on("test2", callback);
emitter._callbacks.test.length.should.equal(2);
emitter._callbacks.test[0].should.equal(callback);
emitter._callbacks.test[1].should.equal(callback2);
emitter._callbacks.test2.length.should.equal(1);
return emitter._callbacks.test2[0].should.equal(callback);
});
it(".emit() should return the object itself", function() {
return emitter.emit('test').should.equal(emitter);
});
it(".emit() should properly invoke all registered callbacks with arguments", function() {
var callCount1, callCount12, callCount2, callback1, callback12, callback2;
callCount1 = 0;
callCount12 = 0;
callCount2 = 0;
callback1 = function(var1, var2) {
callCount1++;
var1.should.equal('callback1 var1');
return var2.should.equal('callback1 var2');
};
callback12 = function(var1, var2) {
callCount12++;
var1.should.equal('callback1 var1');
return var2.should.equal('callback1 var2');
};
callback2 = function(var1, var2) {
callCount2++;
var1.should.equal('callback2 var1');
return var2.should.equal('callback2 var2');
};
emitter.on("test1", callback1);
emitter.on("test1", callback12);
emitter.on("test2", callback2);
callCount1.should.equal(0);
callCount12.should.equal(0);
callCount2.should.equal(0);
emitter.emit("test1", "callback1 var1", "callback1 var2");
callCount1.should.equal(1);
callCount12.should.equal(1);
callCount2.should.equal(0);
emitter.emit("test2", "callback2 var1", "callback2 var2");
callCount1.should.equal(1);
callCount12.should.equal(1);
callCount2.should.equal(1);
emitter.emit("test1", "callback1 var1", "callback1 var2");
callCount1.should.equal(2);
callCount12.should.equal(2);
return callCount2.should.equal(1);
});
return describe(".off()", function() {
var callback1, callback2, callback3, callback4;
callback1 = function() {};
callback2 = function() {};
callback3 = function() {};
callback4 = function() {};
beforeEach(function() {
return emitter._callbacks = {
'test1': [callback1, callback2],
'test2': [callback3],
'test3': [callback1, callback4],
'test4': []
};
});
it("should work without any listeners", function() {
var emt;
emitter._callbacks = void 0;
emt = emitter.off();
emitter._callbacks.should.eql({});
return emt.should.equal(emitter);
});
it("should properly remove all event listeners", function() {
var emt;
emt = emitter.off();
emitter._callbacks.should.eql({});
return emt.should.equal(emitter);
});
it("should properly remove all event listeners for specific event", function() {
var emt;
emitter.off("test1");
(emitter._callbacks["test1"] === void 0).should.be["true"];
emitter._callbacks["test2"].length.should.equal(1);
emitter._callbacks["test3"].length.should.equal(2);
emt = emitter.off("test2");
(emitter._callbacks["test2"] === void 0).should.be["true"];
return emt.should.equal(emitter);
});
return it("should properly remove specific event listener", function() {
var emt;
emitter.off("test1", callback1);
emitter._callbacks["test1"].length.should.equal(1);
emitter._callbacks["test1"][0].should.equal(callback2);
emitter._callbacks["test3"].length.should.equal(2);
emt = emitter.off("test3", callback4);
emitter._callbacks["test3"].length.should.equal(1);
emitter._callbacks["test3"][0].should.equal(callback1);
return emt.should.equal(emitter);
});
});
});
describe("static functions", function() {
describe("Dropzone.createElement()", function() {
var element;
element = Dropzone.createElement("<div class=\"test\"><span>Hallo</span></div>");
it("should properly create an element from a string", function() {
return element.tagName.should.equal("DIV");
});
it("should properly add the correct class", function() {
return element.classList.contains("test").should.be.ok;
});
it("should properly create child elements", function() {
return element.querySelector("span").tagName.should.equal("SPAN");
});
return it("should always return only one element", function() {
element = Dropzone.createElement("<div></div><span></span>");
return element.tagName.should.equal("DIV");
});
});
describe("Dropzone.elementInside()", function() {
var child1, child2, element;
element = Dropzone.createElement("<div id=\"test\"><div class=\"child1\"><div class=\"child2\"></div></div></div>");
document.body.appendChild(element);
child1 = element.querySelector(".child1");
child2 = element.querySelector(".child2");
after(function() {
return document.body.removeChild(element);
});
it("should return yes if elements are the same", function() {
return Dropzone.elementInside(element, element).should.be.ok;
});
it("should return yes if element is direct child", function() {
return Dropzone.elementInside(child1, element).should.be.ok;
});
it("should return yes if element is some child", function() {
Dropzone.elementInside(child2, element).should.be.ok;
return Dropzone.elementInside(child2, document.body).should.be.ok;
});
return it("should return no unless element is some child", function() {
Dropzone.elementInside(element, child1).should.not.be.ok;
return Dropzone.elementInside(document.body, child1).should.not.be.ok;
});
});
describe("Dropzone.optionsForElement()", function() {
var element, testOptions;
testOptions = {
url: "/some/url",
method: "put"
};
before(function() {
return Dropzone.options.testElement = testOptions;
});
after(function() {
return delete Dropzone.options.testElement;
});
element = document.createElement("div");
it("should take options set in Dropzone.options from camelized id", function() {
element.id = "test-element";
return Dropzone.optionsForElement(element).should.equal(testOptions);
});
it("should return undefined if no options set", function() {
element.id = "test-element2";
return expect(Dropzone.optionsForElement(element)).to.equal(void 0);
});
it("should return undefined and not throw if it's a form with an input element of the name 'id'", function() {
element = Dropzone.createElement("<form><input name=\"id\" /</form>");
return expect(Dropzone.optionsForElement(element)).to.equal(void 0);
});
return it("should ignore input fields with the name='id'", function() {
element = Dropzone.createElement("<form id=\"test-element\"><input type=\"hidden\" name=\"id\" value=\"fooo\" /></form>");
return Dropzone.optionsForElement(element).should.equal(testOptions);
});
});
describe("Dropzone.forElement()", function() {
var dropzone, element;
element = document.createElement("div");
element.id = "some-test-element";
dropzone = null;
before(function() {
document.body.appendChild(element);
return dropzone = new Dropzone(element, {
url: "/test"
});
});
after(function() {
dropzone.disable();
return document.body.removeChild(element);
});
it("should throw an exception if no dropzone attached", function() {
return expect(function() {
return Dropzone.forElement(document.createElement("div"));
}).to["throw"]("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");
});
it("should accept css selectors", function() {
return expect(Dropzone.forElement("#some-test-element")).to.equal(dropzone);
});
return it("should accept native elements", function() {
return expect(Dropzone.forElement(element)).to.equal(dropzone);
});
});
describe("Dropzone.discover()", function() {
var element1, element2, element3;
element1 = document.createElement("div");
element1.className = "dropzone";
element2 = element1.cloneNode();
element3 = element1.cloneNode();
element1.id = "test-element-1";
element2.id = "test-element-2";
element3.id = "test-element-3";
describe("specific options", function() {
before(function() {
Dropzone.options.testElement1 = {
url: "test-url"
};
Dropzone.options.testElement2 = false;
document.body.appendChild(element1);
document.body.appendChild(element2);
return Dropzone.discover();
});
after(function() {
document.body.removeChild(element1);
return document.body.removeChild(element2);
});
it("should find elements with a .dropzone class", function() {
return element1.dropzone.should.be.ok;
});
return it("should not create dropzones with disabled options", function() {
return expect(element2.dropzone).to.not.be.ok;
});
});
return describe("Dropzone.autoDiscover", function() {
before(function() {
Dropzone.options.testElement3 = {
url: "test-url"
};
return document.body.appendChild(element3);
});
after(function() {
return document.body.removeChild(element3);
});
it("should create dropzones even if Dropzone.autoDiscover == false", function() {
Dropzone.autoDiscover = false;
Dropzone.discover();
return expect(element3.dropzone).to.be.ok;
});
return it("should not automatically be called if Dropzone.autoDiscover == false", function() {
Dropzone.autoDiscover = false;
Dropzone.discover = function() {
return expect(false).to.be.ok;
};
return Dropzone.<API key>();
});
});
});
describe("Dropzone.isValidFile()", function() {
it("should return true if called without acceptedFiles", function() {
return Dropzone.isValidFile({
type: "some/type"
}, null).should.be.ok;
});
it("should properly validate if called with concrete mime types", function() {
var acceptedMimeTypes;
acceptedMimeTypes = "text/html,image/jpeg,application/json";
Dropzone.isValidFile({
type: "text/html"
}, acceptedMimeTypes).should.be.ok;
Dropzone.isValidFile({
type: "image/jpeg"
}, acceptedMimeTypes).should.be.ok;
Dropzone.isValidFile({
type: "application/json"
}, acceptedMimeTypes).should.be.ok;
return Dropzone.isValidFile({
type: "image/bmp"
}, acceptedMimeTypes).should.not.be.ok;
});
it("should properly validate if called with base mime types", function() {
var acceptedMimeTypes;
|
answer = sum [1..100] ^ 2 - foldl (\x y -> y^2 + x) 0 [1..100]
|
/**
* generated by Xtext
*/
package dk.itu.smdp.group2.ui.outline;
import org.eclipse.xtext.ui.editor.outline.impl.<API key>;
@SuppressWarnings("all")
public class <API key> extends <API key> {
}
|
<?php
define('ROOT_PATH', __DIR__ . '/');
require ROOT_PATH . 'loader.php';
$app = new Ghz\App();
// Handle our two cases:
// - Redirect (when requestiong anything except BASEPATH)
// - Save URL when posted here.
$app->doRedirect();
$app->savePostedUrl();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>GHz url shortener</title>
<link rel="stylesheet" href="_assets/style.css">
<?php if (defined('GA_TRACKING')) : ?>
<script>
(function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
ga('create', '<?php echo GA_TRACKING; ?>', 'auto');
ga('send', 'pageview');
</script>
<?php endif; ?>
</head>
<body>
<div class="main">
<h1>
<a href="/">Ghz</a>
</h1>
<p class="subhead">url shortener</p>
<form action="" method="post">
<div class="error<?php if ($app->isFailure()) : ?> visible<?php endif; ?>">
please enter a valid url
</div>
<div class="success<?php if ($app->isSuccess()) : ?> visible<?php endif; ?>">
created!
</div>
<div>
<input placeholder="paste or enter a url and press enter" name="url"
type="text" value="<?php echo $app->getGeneratedUrl(); ?>">
</div>
</form>
</div>
<div class="bottom-left">
© <?php echo date('Y'); ?> Ghz.me
</div>
<div class="bottom-right">
</div>
<!-- fork me banner -->
<a href="https://github.com/samt/ghz">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https:
</a>
<script type="text/javascript" src="_assets/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="_assets/main.js"></script>
</body>
</html>
|
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>module Rack::Mime - 'Rack Documentation'</title>
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
<script type="text/javascript">
var rdoc_rel_prefix = "../";
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
<body id="top" class="module">
<nav id="metadata">
<nav id="home-section" class="section">
<h3 class="section-header">
<a href="../index.html">Home</a>
<a href="../table_of_contents.html#classes">Classes</a>
<a href="../table_of_contents.html#methods">Methods</a>
</h3>
</nav>
<nav id="search-section" class="section project-section" class="initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<h3 class="section-header">
<input type="text" name="search" placeholder="Search" id="search-field"
title="Type to search, Up and Down to navigate, Enter to load">
</h3>
</form>
<ul id="search-results" class="initially-hidden"></ul>
</nav>
<div id="file-metadata">
<nav id="file-list-section" class="section">
<h3 class="section-header">Defined In</h3>
<ul>
<li>lib/rack/mime.rb
</ul>
</nav>
</div>
<div id="class-metadata">
<!-- Method Quickref -->
<nav id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-c-mime_type">::mime_type</a>
</ul>
</nav>
</div>
<div id="project-metadata">
<nav id="fileindex-section" class="section project-section">
<h3 class="section-header">Pages</h3>
<ul>
<li class="file"><a href="../KNOWN-ISSUES.html">KNOWN-ISSUES</a>
<li class="file"><a href="../README_rdoc.html">README</a>
<li class="file"><a href="../SPEC.html">SPEC</a>
</ul>
</nav>
<nav id="classindex-section" class="section project-section">
<h3 class="section-header">Class and Module Index</h3>
<ul class="link-list">
<li><a href="../Rack.html">Rack</a>
<li><a href="../Rack/Auth.html">Rack::Auth</a>
<li><a href="../Rack/Auth/AbstractHandler.html">Rack::Auth::AbstractHandler</a>
<li><a href="../Rack/Auth/AbstractRequest.html">Rack::Auth::AbstractRequest</a>
<li><a href="../Rack/Auth/Basic.html">Rack::Auth::Basic</a>
<li><a href="../Rack/Auth/Basic/Request.html">Rack::Auth::Basic::Request</a>
<li><a href="../Rack/Auth/Digest.html">Rack::Auth::Digest</a>
<li><a href="../Rack/Auth/Digest/MD5.html">Rack::Auth::Digest::MD5</a>
<li><a href="../Rack/Auth/Digest/Nonce.html">Rack::Auth::Digest::Nonce</a>
<li><a href="../Rack/Auth/Digest/Params.html">Rack::Auth::Digest::Params</a>
<li><a href="../Rack/Auth/Digest/Request.html">Rack::Auth::Digest::Request</a>
<li><a href="../Rack/BodyProxy.html">Rack::BodyProxy</a>
<li><a href="../Rack/Builder.html">Rack::Builder</a>
<li><a href="../Rack/Cascade.html">Rack::Cascade</a>
<li><a href="../Rack/Chunked.html">Rack::Chunked</a>
<li><a href="../Rack/Chunked/Body.html">Rack::Chunked::Body</a>
<li><a href="../Rack/CommonLogger.html">Rack::CommonLogger</a>
<li><a href="../Rack/ConditionalGet.html">Rack::ConditionalGet</a>
<li><a href="../Rack/Config.html">Rack::Config</a>
<li><a href="../Rack/ContentLength.html">Rack::ContentLength</a>
<li><a href="../Rack/ContentType.html">Rack::ContentType</a>
<li><a href="../Rack/Deflater.html">Rack::Deflater</a>
<li><a href="../Rack/Deflater/DeflateStream.html">Rack::Deflater::DeflateStream</a>
<li><a href="../Rack/Deflater/GzipStream.html">Rack::Deflater::GzipStream</a>
<li><a href="../Rack/Directory.html">Rack::Directory</a>
<li><a href="../Rack/ETag.html">Rack::ETag</a>
<li><a href="../Rack/File.html">Rack::File</a>
<li><a href="../Rack/ForwardRequest.html">Rack::ForwardRequest</a>
<li><a href="../Rack/Handler.html">Rack::Handler</a>
<li><a href="../Rack/Handler/CGI.html">Rack::Handler::CGI</a>
<li><a href="../Rack/Handler/EventedMongrel.html">Rack::Handler::EventedMongrel</a>
<li><a href="../Rack/Handler/FastCGI.html">Rack::Handler::FastCGI</a>
<li><a href="../Rack/Handler/LSWS.html">Rack::Handler::LSWS</a>
<li><a href="../Rack/Handler/Mongrel.html">Rack::Handler::Mongrel</a>
<li><a href="../Rack/Handler/SCGI.html">Rack::Handler::SCGI</a>
<li><a href="../Rack/Handler/SwiftipliedMongrel.html">Rack::Handler::SwiftipliedMongrel</a>
<li><a href="../Rack/Handler/Thin.html">Rack::Handler::Thin</a>
<li><a href="../Rack/Handler/WEBrick.html">Rack::Handler::WEBrick</a>
<li><a href="../Rack/Head.html">Rack::Head</a>
<li><a href="../Rack/Lint.html">Rack::Lint</a>
<li><a href="../Rack/Lobster.html">Rack::Lobster</a>
<li><a href="../Rack/Lock.html">Rack::Lock</a>
<li><a href="../Rack/Logger.html">Rack::Logger</a>
<li><a href="../Rack/MethodOverride.html">Rack::MethodOverride</a>
<li><a href="../Rack/Mime.html">Rack::Mime</a>
<li><a href="../Rack/MockRequest.html">Rack::MockRequest</a>
<li><a href="../Rack/MockRequest/FatalWarner.html">Rack::MockRequest::FatalWarner</a>
<li><a href="../Rack/MockRequest/FatalWarning.html">Rack::MockRequest::FatalWarning</a>
<li><a href="../Rack/MockResponse.html">Rack::MockResponse</a>
<li><a href="../Rack/Multipart.html">Rack::Multipart</a>
<li><a href="../Rack/Multipart/Generator.html">Rack::Multipart::Generator</a>
<li><a href="../Rack/Multipart/Parser.html">Rack::Multipart::Parser</a>
<li><a href="../Rack/Multipart/UploadedFile.html">Rack::Multipart::UploadedFile</a>
<li><a href="../Rack/NullLogger.html">Rack::NullLogger</a>
<li><a href="../Rack/Recursive.html">Rack::Recursive</a>
<li><a href="../Rack/Reloader.html">Rack::Reloader</a>
<li><a href="../Rack/Reloader/Stat.html">Rack::Reloader::Stat</a>
<li><a href="../Rack/Request.html">Rack::Request</a>
<li><a href="../Rack/Response.html">Rack::Response</a>
<li><a href="../Rack/Response/Helpers.html">Rack::Response::Helpers</a>
<li><a href="../Rack/RewindableInput.html">Rack::RewindableInput</a>
<li><a href="../Rack/RewindableInput/Tempfile.html">Rack::RewindableInput::Tempfile</a>
<li><a href="../Rack/Runtime.html">Rack::Runtime</a>
<li><a href="../Rack/Sendfile.html">Rack::Sendfile</a>
<li><a href="../Rack/Server.html">Rack::Server</a>
<li><a href="../Rack/Server/Options.html">Rack::Server::Options</a>
<li><a href="../Rack/Session.html">Rack::Session</a>
<li><a href="../Rack/Session/Abstract.html">Rack::Session::Abstract</a>
<li><a href="../Rack/Session/Abstract/ID.html">Rack::Session::Abstract::ID</a>
<li><a href="../Rack/Session/Abstract/SessionHash.html">Rack::Session::Abstract::SessionHash</a>
<li><a href="../Rack/Session/Cookie.html">Rack::Session::Cookie</a>
<li><a href="../Rack/Session/Cookie/Base64.html">Rack::Session::Cookie::Base64</a>
<li><a href="../Rack/Session/Cookie/Base64/Marshal.html">Rack::Session::Cookie::Base64::Marshal</a>
<li><a href="../Rack/Session/Cookie/Identity.html">Rack::Session::Cookie::Identity</a>
<li><a href="../Rack/Session/Cookie/Reverse.html">Rack::Session::Cookie::Reverse</a>
<li><a href="../Rack/Session/Memcache.html">Rack::Session::Memcache</a>
<li><a href="../Rack/Session/Pool.html">Rack::Session::Pool</a>
<li><a href="../Rack/ShowExceptions.html">Rack::ShowExceptions</a>
<li><a href="../Rack/ShowStatus.html">Rack::ShowStatus</a>
<li><a href="../Rack/Static.html">Rack::Static</a>
<li><a href="../Rack/URLMap.html">Rack::URLMap</a>
<li><a href="../Rack/Utils.html">Rack::Utils</a>
<li><a href="../Rack/Utils/Context.html">Rack::Utils::Context</a>
<li><a href="../Rack/Utils/HeaderHash.html">Rack::Utils::HeaderHash</a>
<li><a href="../Rack/Multipart.html">Rack::Utils::Multipart</a>
<li><a href="../FCGI.html">FCGI</a>
<li><a href="../FCGI/Stream.html">FCGI::Stream</a>
</ul>
</nav>
</div>
</nav>
<div id="documentation">
<h1 class="module">module Rack::Mime</h1>
<div id="description" class="description">
</div><!-- description -->
<section id="5Buntitled-5D" class="<API key>">
<!-- Constants -->
<section id="constants-list" class="section">
<h3 class="section-header">Constants</h3>
<dl>
<dt id="MIME_TYPES">MIME_TYPES
<dd class="description"><p>List of most common mime-types, selected various sources according to their
usefulness in a webserving scope for Ruby users.</p>
<p>To amend this list with your local mime.types list you can use:</p>
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'webrick/httputils'</span>
<span class="ruby-identifier">list</span> = <span class="ruby-constant">WEBrick</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPUtils</span>.<span class="ruby-identifier">load_mime_types</span>(<span class="ruby-string">'/etc/mime.types'</span>)
<span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">list</span>)
</pre>
<p>N.B. On Ubuntu the mime.types file does not include the leading period, so
users may need to modify the data before merging into the hash.</p>
<p>To add the list mongrel provides, use:</p>
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'mongrel/handlers'</span>
<span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-constant">Mongrel</span><span class="ruby-operator">::</span><span class="ruby-constant">DirHandler</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>)
</pre>
</dl>
</section>
<!-- Methods -->
<section id="<API key>" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="method-c-mime_type" class="method-detail ">
<div class="method-heading">
<span class="method-name">mime_type</span><span
class="method-args">(ext, fallback='application/octet-stream')</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Returns String with mime type if found, otherwise use
<code>fallback</code>. <code>ext</code> should be filename extension in the
‘.ext’ format that</p>
<pre>File.extname(file) returns.</pre>
<p><code>fallback</code> may be any object</p>
<p>Also see the documentation for <a
href="Mime.html#MIME_TYPES">MIME_TYPES</a></p>
<p>Usage:</p>
<pre>Rack::Mime.mime_type('.foo')</pre>
<p>This is a shortcut for:</p>
<pre>Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')</pre>
<div class="method-source-code" id="mime_type-source">
<pre><span class="ruby-comment"># File lib/rack/mime.rb, line 16</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">mime_type</span>(<span class="ruby-identifier">ext</span>, <span class="ruby-identifier">fallback</span>=<span class="ruby-string">'application/octet-stream'</span>)
<span class="ruby-constant">MIME_TYPES</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">ext</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>, <span class="ruby-identifier">fallback</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- mime_type-source -->
</div>
</div><!-- mime_type-method -->
</section><!-- <API key> -->
</section><!-- 5Buntitled-5D -->
</div><!-- documentation -->
<footer id="validator-badges">
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>
|
package wsclient
import (
"github.com/cosminrentea/gobbler/testutil"
"fmt"
"strings"
"testing"
"time"
"github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
)
var aNormalMessage = `/foo/bar,42,user01,phone01,{},,1420110000,0
Hello World`
var aSendNotification = "#send"
var anErrorNotification = "!error-send"
func <API key>(connectionMock *MockWSConnection) func(string, string) (WSConnection, error) {
return func(url string, origin string) (WSConnection, error) {
return connectionMock, nil
}
}
func <API key>(t *testing.T) {
a := assert.New(t)
// given a client
c := New("url", "origin", 1, false)
// which raises an error on connect
callCounter := 0
c.<API key>(func(url string, origin string) (WSConnection, error) {
a.Equal("url", url)
a.Equal("origin", origin)
callCounter++
return nil, fmt.Errorf("emulate connection error")
})
// when we start
err := c.Start()
// then
a.Error(err)
a.Equal(1, callCounter)
}
func <API key>(t *testing.T) {
a := assert.New(t)
c, err := Open("url", "origin", 1, false)
// which raises an error on connect
callCounter := 0
c.<API key>(func(url string, origin string) (WSConnection, error) {
a.Equal("url", url)
a.Equal("origin", origin)
callCounter++
return nil, fmt.Errorf("emulate connection error")
})
a.Error(err)
}
func <API key>(t *testing.T) {
ctrl, finish := testutil.NewMockCtrl(t)
defer finish()
a := assert.New(t)
// given a client
c := New("url", "origin", 1, true)
// which raises an error twice and then allows to connect
callCounter := 0
connMock := NewMockWSConnection(ctrl)
connMock.EXPECT().ReadMessage().Do(func() { time.Sleep(time.Second) })
c.<API key>(func(url string, origin string) (WSConnection, error) {
a.Equal("url", url)
a.Equal("origin", origin)
if callCounter <= 2 {
callCounter++
return nil, fmt.Errorf("emulate connection error")
}
return connMock, nil
})
// when we start
err := c.Start()
// then we get an error, first
a.Error(err)
a.False(c.IsConnected())
// when we wait for two iterations and 10ms buffer time to connect
time.Sleep(time.Millisecond * 110)
// then we got connected
a.True(c.IsConnected())
a.Equal(3, callCounter)
}
func TestStopableClient(t *testing.T) {
ctrl, finish := testutil.NewMockCtrl(t)
defer finish()
a := assert.New(t)
// given a client
c := New("url", "origin", 1, true)
// with a closeable connection
connMock := NewMockWSConnection(ctrl)
close := make(chan bool, 1)
connMock.EXPECT().ReadMessage().
Do(func() { <-close }).
Return(0, []byte{}, fmt.Errorf("expected close error"))
connMock.EXPECT().Close().Do(func() {
close <- true
})
c.<API key>(<API key>(connMock))
// when we start
err := c.Start()
// than we are connected
a.NoError(err)
a.True(c.IsConnected())
// when we clode
c.Close()
time.Sleep(time.Millisecond * 1)
// than the client returns
a.False(c.IsConnected())
}
func TestReceiveAMessage(t *testing.T) {
ctrl, finish := testutil.NewMockCtrl(t)
defer finish()
a := assert.New(t)
// given a client
c := New("url", "origin", 10, false)
// with a closeable connection
connMock := NewMockWSConnection(ctrl)
close := make(chan bool, 1)
// normal message
call1 := connMock.EXPECT().ReadMessage().
Return(4, []byte(aNormalMessage), nil)
call2 := connMock.EXPECT().ReadMessage().
Return(4, []byte(aSendNotification), nil)
call3 := connMock.EXPECT().ReadMessage().
Return(4, []byte("---"), nil)
call4 := connMock.EXPECT().ReadMessage().
Return(4, []byte(anErrorNotification), nil)
call5 := connMock.EXPECT().ReadMessage().
Do(func() { <-close }).
Return(0, []byte{}, fmt.Errorf("expected close error")).
AnyTimes()
call5.After(call4)
call4.After(call3)
call3.After(call2)
call2.After(call1)
c.<API key>(<API key>(connMock))
connMock.EXPECT().Close().Do(func() {
close <- true
})
// when we start
err := c.Start()
a.NoError(err)
a.True(c.IsConnected())
// than we receive the expected message
select {
case m := <-c.Messages():
a.Equal(aNormalMessage, string(m.Encode()))
case <-time.After(time.Millisecond * 10):
a.Fail("timeout while waiting for message")
}
// and we receive the notification
select {
case m := <-c.StatusMessages():
a.Equal(aSendNotification, string(m.Bytes()))
case <-time.After(time.Millisecond * 10):
a.Fail("timeout while waiting for message")
}
// parse error
select {
case m := <-c.Errors():
a.True(strings.HasPrefix(string(m.Bytes()), "!clientError "))
case <-time.After(time.Millisecond * 10):
a.Fail("timeout while waiting for message")
}
// and we receive the error notification
select {
case m := <-c.Errors():
a.Equal(anErrorNotification, string(m.Bytes()))
case <-time.After(time.Millisecond * 10):
a.Fail("timeout while waiting for message")
}
c.Close()
}
func TestSendAMessage(t *testing.T) {
ctrl, finish := testutil.NewMockCtrl(t)
defer finish()
// a := assert.New(t)
// given a client
c := New("url", "origin", 1, true)
// when expects a message
connMock := NewMockWSConnection(ctrl)
connMock.EXPECT().WriteMessage(websocket.BinaryMessage, []byte("> /foo\n{}\nTest"))
connMock.EXPECT().
ReadMessage().
Return(websocket.BinaryMessage, []byte(aNormalMessage), nil).
Do(func() {
time.Sleep(time.Millisecond * 50)
}).
AnyTimes()
c.<API key>(<API key>(connMock))
c.Start()
// then the expectation is meet by sending it
c.Send("/foo", "Test", "{}")
// stop client after 200ms
time.AfterFunc(time.Millisecond*200, func() { c.Close() })
}
func <API key>(t *testing.T) {
ctrl, finish := testutil.NewMockCtrl(t)
defer finish()
// given a client
c := New("url", "origin", 1, true)
// when expects a message
connMock := NewMockWSConnection(ctrl)
connMock.EXPECT().WriteMessage(websocket.BinaryMessage, []byte("+ /foo"))
connMock.EXPECT().
ReadMessage().
Return(websocket.BinaryMessage, []byte(aNormalMessage), nil).
Do(func() {
time.Sleep(time.Millisecond * 50)
}).
AnyTimes()
c.<API key>(<API key>(connMock))
c.Start()
c.Subscribe("/foo")
// stop client after 200ms
time.AfterFunc(time.Millisecond*200, func() { c.Close() })
}
func <API key>(t *testing.T) {
ctrl, finish := testutil.NewMockCtrl(t)
defer finish()
// given a client
c := New("url", "origin", 1, true)
// when expects a message
connMock := NewMockWSConnection(ctrl)
connMock.EXPECT().WriteMessage(websocket.BinaryMessage, []byte("- /foo"))
connMock.EXPECT().
ReadMessage().
Return(websocket.BinaryMessage, []byte(aNormalMessage), nil).
Do(func() {
time.Sleep(time.Millisecond * 50)
}).
AnyTimes()
c.<API key>(<API key>(connMock))
c.Start()
c.Unsubscribe("/foo")
// stop client after 200ms
time.AfterFunc(time.Millisecond*200, func() { c.Close() })
}
|
namespace LadderLogic.Controller.State
{
using Surface;
public class CursorState : State
{
public CursorState () : base(StateType.CursorState)
{
}
#region implemented abstract members of State
public override bool Handle (State previous, Segment prevSegment, Segment newSegment, bool left)
{
base.Handle (previous, prevSegment, newSegment, left);
return true;
}
#endregion
}
}
|
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_12_01
module Models
# A load balancer probe.
class Probe < SubResource
include MsRestAzure
# @return [Array<SubResource>] The load balancer rules that use this
# probe.
attr_accessor :<API key>
# @return [ProbeProtocol] The protocol of the end point. If 'Tcp' is
# specified, a received ACK is required for the probe to be successful.
# If 'Http' or 'Https' is specified, a 200 OK response from the specifies
# URI is required for the probe to be successful. Possible values
# include: 'Http', 'Tcp', 'Https'
attr_accessor :protocol
# @return [Integer] The port for communicating the probe. Possible values
# range from 1 to 65535, inclusive.
attr_accessor :port
# @return [Integer] The interval, in seconds, for how frequently to probe
# the endpoint for health status. Typically, the interval is slightly
# less than half the allocated timeout period (in seconds) which allows
# two full probes before taking the instance out of rotation. The default
# value is 15, the minimum value is 5.
attr_accessor :interval_in_seconds
# @return [Integer] The number of probes where if no response, will
# result in stopping further traffic from being delivered to the
# endpoint. This values allows endpoints to be taken out of rotation
# faster or slower than the typical times used in Azure.
attr_accessor :number_of_probes
# @return [String] The URI used for requesting health status from the VM.
# Path is required if a protocol is set to http. Otherwise, it is not
# allowed. There is no default value.
attr_accessor :request_path
# @return [ProvisioningState] The provisioning state of the probe
# resource. Possible values include: 'Succeeded', 'Updating', 'Deleting',
# 'Failed'
attr_accessor :provisioning_state
# @return [String] The name of the resource that is unique within the set
# of probes used by the load balancer. This name can be used to access
# the resource.
attr_accessor :name
# @return [String] A unique read-only string that changes whenever the
# resource is updated.
attr_accessor :etag
# @return [String] Type of the resource.
attr_accessor :type
# Mapper for Probe class as Ruby Hash.
# This will be used for serialization/deserialization.
def self.mapper()
{
<API key>: true,
required: false,
serialized_name: 'Probe',
type: {
name: 'Composite',
class_name: 'Probe',
model_properties: {
id: {
<API key>: true,
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
<API key>: {
<API key>: true,
required: false,
read_only: true,
serialized_name: 'properties.loadBalancingRules',
type: {
name: 'Sequence',
element: {
<API key>: true,
required: false,
serialized_name: '<API key>',
type: {
name: 'Composite',
class_name: 'SubResource'
}
}
}
},
protocol: {
<API key>: true,
required: true,
serialized_name: 'properties.protocol',
type: {
name: 'String'
}
},
port: {
<API key>: true,
required: true,
serialized_name: 'properties.port',
type: {
name: 'Number'
}
},
interval_in_seconds: {
<API key>: true,
required: false,
serialized_name: 'properties.intervalInSeconds',
type: {
name: 'Number'
}
},
number_of_probes: {
<API key>: true,
required: false,
serialized_name: 'properties.numberOfProbes',
type: {
name: 'Number'
}
},
request_path: {
<API key>: true,
required: false,
serialized_name: 'properties.requestPath',
type: {
name: 'String'
}
},
provisioning_state: {
<API key>: true,
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
},
name: {
<API key>: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
etag: {
<API key>: true,
required: false,
read_only: true,
serialized_name: 'etag',
type: {
name: 'String'
}
},
type: {
<API key>: true,
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
|
#pragma once
#include <mime/mimepp/mimepp.h>
namespace Zimbra
{
namespace MAPI
{
#define PR_URL_NAME PROP_TAG(PT_TSTRING, 0x6707)
#define EXCHIVERB_OPEN 0
#define <API key> 100
#define <API key> 101
#define <API key> 102
#define <API key> 103
#define EXCHIVERB_FORWARD 104
#define EXCHIVERB_PRINT 105
#define EXCHIVERB_SAVEAS 106
#define <API key> 107
#define <API key> 108
typedef enum _ZM_ITEM_TYPE
{
ZT_NONE = 0, ZT_MAIL, ZT_CONTACTS, ZT_APPOINTMENTS, ZT_TASKS, ZT_MEETREQ, ZTMAX
} ZM_ITEM_TYPE;
// <API key> class
class <API key>: public GenericException
{
public:
<API key>(HRESULT hrErrCode, LPCWSTR lpszDescription);
<API key>(HRESULT hrErrCode, LPCWSTR lpszDescription, LPCWSTR <API key>, int nLine, LPCSTR strFile);
virtual ~<API key>() {}
};
// MAPIMessage Class
class MAPIMessage
{
private:
// order of the message properties in _pMessagePropVals
typedef enum _MessagePropIndex
{
MESSAGE_CLASS, MESSAGE_FLAGS, MESSAGE_DATE, SENDER_ADDRTYPE, SENDER_EMAIL_ADDR,
SENDER_NAME, SENDER_ENTRYID, SUBJECT, TEXT_BODY, HTML_BODY, INTERNET_CPID,
MESSAGE_CODEPAGE, LAST_VERB_EXECUTED, FLAG_STATUS, ENTRYID, SENT_ADDRTYPE,
SENT_ENTRYID, SENT_EMAIL_ADDR, SENT_NAME, REPLY_NAMES, REPLY_ENTRIES,
MIME_HEADERS, IMPORTANCE, INTERNET_MESSAGE_ID, DELIVERY_DATE, URL_NAME,
MESSAGE_SIZE, STORE_SUPPORT_MASK, RTF_IN_SYNC, NMSGPROPS
} MessagePropIndex;
// defined so a static variable can hold the message props to retrieve
typedef struct _MessagePropTags
{
ULONG cValues;
ULONG aulPropTags[NMSGPROPS];
} MessagePropTags;
// order of the recipient properties in each row of _pRecipRows
typedef enum _RecipientPropIndex
{
RDISPLAY_NAME, RENTRYID, RADDRTYPE, REMAIL_ADDRESS, RRECIPIENT_TYPE, RNPROPS
} RecipientPropIndex;
// defined so a static variable can hold the recipient properties to retrieve
typedef struct _RecipientPropTags
{
ULONG cValues;
ULONG aulPropTags[RNPROPS];
} RecipientPropTags;
// order of the recipient properties in each row of _pRecipRows
typedef enum _ReplyToPropIndex
{
<API key>, REPLYTO_ENTRYID, REPLYTO_ADDRTYPE, <API key>,
NREPLYTOPROPS
} ReplyToPropIndex;
// defined so a static variable can hold the recipient properties to retrieve
typedef struct _ReplyToPropTags
{
ULONG cValues;
ULONG aulPropTags[NREPLYTOPROPS];
} ReplyToPropTags;
MAPISession *m_session;
LPMESSAGE m_pMessage;
LPSPropValue m_pMessagePropVals;
LPSRowSet m_pRecipientRows;
SBinary m_EntryID;
CHAR m_pDateTimeStr[32];
CHAR <API key>[32];
CHAR <API key>[32];
std::vector<std::string> RTFElement;
enum EnumRTFElement
{
NOTFOUND = -1, OPENBRACE = 0, CLOSEBRACE, HTMLTAG, MHTMLTAG, PAR, TAB, LI, FI, HEXCHAR,
PNTEXT, HTMLRTF, OPENBRACEESC, CLOSEBRACEESC, END, HTMLRTF0
};
static MessagePropTags m_messagePropTags;
static RecipientPropTags m_recipientPropTags;
static ReplyToPropTags m_replyToPropTags;
unsigned int CodePageId();
EnumRTFElement MatchRTFElement(const char *psz);
const char *Advance(const char *psz, const char *pszCharSet);
public:
MAPIMessage();
~MAPIMessage();
void Initialize(LPMESSAGE pMessage, MAPISession &session, bool bPartial=false);
void InternalFree();
LPMESSAGE <API key>() { return m_pMessage; }
bool Subject(LPTSTR *ppSubject);
ZM_ITEM_TYPE ItemType();
bool IsFlagged();
bool GetURLName(LPTSTR *pstrUrlName);
bool IsDraft();
BOOL IsFromMe();
BOOL IsUnread();
BOOL Forwarded();
BOOL RepliedTo();
bool HasAttach();
BOOL IsUnsent();
bool HasHtmlPart();
bool HasTextPart();
SBinary &UniqueId();
__int64 DeliveryDate();
LPSTR DateString();
__int64 Date();
DWORD Size();
LPSTR DeliveryDateString();
LPSTR DeliveryUnixString();
std::vector<LPWSTR>* SetKeywords();
SBinary EntryID() { return m_EntryID; }
bool TextBody(LPTSTR *ppBody, unsigned int &nTextChars);
// reads the utf8 body and retruns it with accented chararcters
bool UTF8EncBody(LPTSTR *ppBody, unsigned int &nTextChars);
// return the html body of the message
bool HtmlBody(LPVOID *ppBody, unsigned int &nHtmlBodyLen);
bool DecodeRTF2HTML(char *buf, unsigned int *len);
bool IsRTFHTML(const char *buf);
void ToMimePPMessage(mimepp::Message &msg);
};
class MIRestriction;
// Message Iterator class
class MessageIterator: public MAPITableIterator
{
private:
typedef enum <API key>
{
MI_ENTRYID, <API key>, MI_DATE, MI_MESSAGE_CLASS, NMSGPROPS
} <API key>;
typedef struct <API key>
{
ULONG cValues;
ULONG aulPropTags[NMSGPROPS];
} MessageIterPropTags;
typedef struct _MessageIterSort
{
ULONG cSorts;
ULONG cCategories;
ULONG cExpanded;
SSortOrder aSort[1];
} <API key>;
public:
MessageIterator();
virtual ~MessageIterator();
virtual LPSPropTagArray GetProps();
virtual LPSSortOrderSet GetSortOrder();
virtual LPSRestriction GetRestriction(ULONG TypeMask, FILETIME startDate);
BOOL GetNext(MAPIMessage &msg);
BOOL GetNext(__int64 &date, SBinary &bin);
protected:
static MessageIterPropTags m_props;
static <API key> m_sortOrder;
static MIRestriction m_restriction;
};
// Restriction class
class MIRestriction
{
public:
MIRestriction();
~MIRestriction();
LPSRestriction GetRestriction(ULONG TypeMask, FILETIME startDate);
private:
SRestriction pR[25];
SPropValue _propValCont;
SPropValue _propValMail;
SPropValue _propValCTime;
SPropValue _propValSTime;
SPropValue _propValCanbeMail;
SPropValue <API key>;
SPropValue _propValAppt;
LPWSTR _pApptClass;
SPropValue _propValTask;
LPWSTR _pTaskClass;
SPropValue _propValReqAndRes;
LPWSTR _pReqAndResClass;
SPropValue _propValDistList;
LPWSTR _pDistListClass;
LPWSTR _pContactClass;
LPWSTR _pMailClass;
SPropValue <API key>;
};
mimepp::Mailbox *MakeMimePPMailbox(LPTSTR pDisplayName, LPTSTR pSmtpAddress);
}
}
|
<?php
namespace Juice\UploadBundle\Form\Type;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\<API key>;
class BaseFileType extends AbstractUploadType
{
public function buildView(FormView $view, FormInterface $form, array $options)
{
$this->addVars($view, $options);
}
public function getName()
{
return '<API key>';
}
}
|
<html>
<head>
<meta http-equiv="refresh" content="0; url=https://minecrafthopper.net/">
<link rel="canonical" href="https://minecrafthopper.net/"/>
</head>
</html>
|
<?php
namespace TFE\LibrairieBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\<API key>;
class <API key> extends AbstractType
{
/**
* @param <API key> $builder
* @param array $options
*/
public function buildForm(<API key> $builder, array $options) {}
/**
* @return string
*/
public function getName()
{
return '<API key>';
}
/**
* @return AccompagnementType
*/
public function getParent()
{
return new AccompagnementType();
}
}
|
using Dufry.Comissoes.Domain.Validation;
namespace Dufry.Comissoes.Domain.Interfaces.Validation
{
public interface IValidation<in TEntity>
{
ValidationResult Valid(TEntity entity);
}
}
|
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable, ReplaySubject, throwError} from 'rxjs';
import {map, tap, switchMap} from 'rxjs/operators';
import {SocketService} from './sockets';
import {StorageService} from './storage';
@Injectable({
providedIn: 'root'
})
export class AuthService {
private session: string;
private userInfo: any;
private authEvents: ReplaySubject<{User: any, Session: string}>;
constructor(
private _http: HttpClient,
private _storage: StorageService,
private _sockets: SocketService,
) {
this.authEvents = new ReplaySubject<{User: any, Session: string}>(1);
}
private nuke() {
this._storage.clear();
this.session = undefined;
this.userInfo = undefined;
this._sockets.leave();
}
getSession() {
return this.session;
}
getUser() {
return this.userInfo;
}
hasAccess(): boolean {
return !!this.userInfo;
}
observe(): Observable<{User: any, Session: string}> {
return this.authEvents;
}
identify() {
this._http.get<{Data: any}>(`/api/auth/`)
.pipe(
map(res => res.Data)
)
.subscribe(
data => {
this.session = data.Session.Key;
this.userInfo = data.User;
this._sockets.join(data.Session.Key);
this.authEvents.next({User: data.User, Session: data.Session.Key});
},
err => console.error(err)
);
}
logIn(creds): Observable<any> {
if (!creds || !creds.Username || !creds.Password) {
return throwError('Need login creds');
}
return this._http.post<{Data: any}>('/api/login', creds)
.pipe(
map(res => res.Data),
tap(data => {
this.session = data.Session;
this.userInfo = data.User;
this._sockets.join(data.Session);
this.authEvents.next(data);
})
);
}
signUp(creds): Observable<any> {
if (!creds || !creds.Username || !creds.Email || !creds.Password) {
return throwError('Need signup creds');
}
return this._http.post('/api/signup', creds, {responseType: 'text' as 'text'})
.pipe(
switchMap(_ => this.logIn(creds))
);
}
expireSocket() {
this.userInfo = null;
this.session = null;
this.authEvents.next(null);
}
logOut(): Observable<any> {
return this._http.post('/api/logOut', null)
.pipe(
tap(
res => this.nuke(),
err => this.nuke(),
() => this.authEvents.next(null)
)
);
}
}
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module DirectoryAPI.API
( directoryAPIProxy
, DirectoryAPI
) where
import Servant
import AuthAPI.API (AuthToken)
import Models (File, Node, NodeId)
type DirectoryAPI = "ls" :> -- List all files
AuthToken :>
Get '[JSON] [File] -- Listing of all files
:<|> "whereis" :> -- Lookup the node for a given file path
AuthToken :>
ReqBody '[JSON] FilePath :> -- Path of file being looked up
Post '[JSON] Node -- Node where the file is kept
:<|> "roundRobinNode" :> -- Next node to use as a file primary
AuthToken :>
ReqBody '[JSON] FilePath :> -- Path of file that will be written
Get '[JSON] Node -- Primary node of the file being stored
:<|> "registerFileServer" :> -- Register a node with the directory service
ReqBody '[JSON] Int :> -- Port file server node is running on
Post '[JSON] NodeId -- Id of the newly created node record
directoryAPIProxy :: Proxy DirectoryAPI
directoryAPIProxy = Proxy
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="jquery/jquery-1.8.1.js"></script>
<script src="jquery/jquery-ui-1.10.3.custom.js"></script>
<script src="treema/tv4.js"></script>
<script src="treema/treema.js"></script>
<link href="jquery/jquery-ui-1.10.3.custom.css" rel="stylesheet">
<link href="treema/treema.css" rel="stylesheet">
</head>
<body>
<div id="addresses"></div>
<script>
var contacts = [
{ 'street-address': '10 Downing Street', 'country-name': 'UK', 'locality': 'London', 'name': 'Prime Minister' },
{ 'street-address': '1600 Amphitheatre Pkwy', 'phone-number': '(650) 253-0000', 'name': 'Google'},
{ 'street-address': '45 Rockefeller Plaza', 'region': 'NY', 'locality': 'New York', 'name': 'Rockefeller Center'},
];
var contact_book_schema = {
type: 'array',
items: {
"<API key>": false,
"type": "object",
"displayProperty": 'name',
"properties": {
"name": { type: "string", maxLength: 20 },
"street-address": { title: "Address 1", description: "Don't forget the number.", type: "string" },
"locality":{ "type": "string", title: "Locality" },
"region": { 'title': 'Region', type: 'string' },
"country-name": { "type": "string", title: "Country" },
"friend": { "type": "boolean", title: "Friend" },
"phone-number": { type: "string", maxLength: 20, minLength:4, title: 'Phone Number' }
}
}
};
//buildTreemaExample($('#addresses'), contact_book_schema, contacts);
var treema = $('#addresses').treema({schema: contact_book_schema, data: contacts});
treema.build();
</script>
</body>
</html>
|
package com.lightspeedhq.ecom;
import com.lightspeedhq.ecom.domain.LightspeedEComError;
import feign.FeignException;
import lombok.Getter;
/**
*
* @author stevensnoeijen
*/
public class <API key> extends FeignException {
@Getter
private LightspeedEComError error;
public <API key>(String message, LightspeedEComError error) {
super(message);
this.error = error;
}
@Override
public String toString() {
return error.toString();
}
}
|
<?xml version="1.0" ?><!DOCTYPE TS><TS language="eu_ES" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About POPCoin</source>
<translation>POPCoin-i buruz</translation>
</message>
<message>
<location line="+39"/>
<source><b>POPCoin</b> version</source>
<translation><b>POPCoin</b> bertsioa</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 type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>POPCoin</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Helbide-liburua</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Klik bikoitza helbidea edo etiketa editatzeko</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Sortu helbide berria</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopiatu hautatutako helbidea sistemaren arbelera</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your POPCoin 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 type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Erakutsi &QR kodea</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a POPCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified POPCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Ezabatu</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your POPCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Esportatu Helbide-liburuaren datuak</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Komaz bereizitako artxiboa (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Errorea esportatzean</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Ezin idatzi %1 artxiboan.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Etiketa</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Helbidea</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(etiketarik ez)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Sartu pasahitza</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Pasahitz berria</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Errepikatu pasahitz berria</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Sartu zorrorako pasahitz berria.<br/> Mesedez erabili <b>gutxienez ausazko 10 karaktere</b>, edo <b>gutxienez zortzi hitz</b> pasahitza osatzeko.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Enkriptatu zorroa</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Eragiketa honek zorroaren pasahitza behar du zorroa desblokeatzeko.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Desblokeatu zorroa</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Eragiketa honek zure zorroaren pasahitza behar du, zorroa desenkriptatzeko.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Desenkriptatu zorroa</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Aldatu pasahitza</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Sartu zorroaren pasahitz zaharra eta berria.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Berretsi zorroaren enkriptazioa</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR POPCOIN</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Zorroa enkriptatuta</translation>
</message>
<message>
<location line="-56"/>
<source>POPCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your popcoins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Zorroaren enkriptazioak huts egin du</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Zorroaren enkriptazioak huts egin du barne-errore baten ondorioz. Zure zorroa ez da enkriptatu.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Eman dituzun pasahitzak ez datoz bat.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Zorroaren desblokeoak huts egin du</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Zorroa desenkriptatzeko sartutako pasahitza okerra da.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Zorroaren desenkriptazioak huts egin du</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Sarearekin sinkronizatzen...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Gainbegiratu</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Ikusi zorroaren begirada orokorra</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Transakzioak</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Ikusi transakzioen historia</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Editatu gordetako helbide eta etiketen zerrenda</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Erakutsi ordainketak jasotzeko helbideen zerrenda</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>Irten</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Irten aplikaziotik</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about POPCoin</source>
<translation>Erakutsi POPCoin-i buruzko informazioa</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>&Qt-ari buruz</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Erakutsi POPCoin-i buruzko informazioa</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Aukerak...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a POPCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for POPCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Aldatu zorroa enkriptatzeko erabilitako pasahitza</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>POPCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About POPCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your POPCoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified POPCoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Artxiboa</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Ezarpenak</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Laguntza</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Fitxen tresna-barra</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+47"/>
<source>POPCoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to POPCoin network</source>
<translation><numerusform>Konexio aktibo %n POPCoin-en sarera</numerusform><numerusform>%n konexio aktibo POPCoin-en sarera</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Egunean</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Eguneratzen...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Bidalitako transakzioa</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Sarrerako transakzioa</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid POPCoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Zorroa <b>enkriptatuta</b> eta <b>desblokeatuta</b> dago une honetan</translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Zorroa <b>enkriptatuta</b> eta <b>blokeatuta</b> dago une honetan</translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. POPCoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Editatu helbidea</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Etiketa</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Helbide-liburuko sarrera honekin lotutako etiketa</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Helbidea</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>Helbide-liburuko sarrera honekin lotutako helbidea. Bidaltzeko helbideeta soilik alda daiteke.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Jasotzeko helbide berria</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Bidaltzeko helbide berria</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Editatu jasotzeko helbidea</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Editatu bidaltzeko helbidea</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Sartu berri den helbidea, "%1", helbide-liburuan dago jadanik.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid POPCoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Ezin desblokeatu zorroa.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Gako berriaren sorrerak huts egin du.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>POPCoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Aukerak</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start POPCoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start POPCoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the POPCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the POPCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting POPCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show POPCoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting POPCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Inprimakia</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the POPCoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Saldoa:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Konfirmatu gabe:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Azken transakzioak</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Zure uneko saldoa</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>Oraindik konfirmatu gabe daudenez, uneko saldoab kontatu gabe dagoen transakzio kopurua</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start popcoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Kopurua</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>&Etiketa:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Mezua</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>Gorde honela...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the POPCoin-Qt help message to get a list with possible POPCoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>POPCoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>POPCoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the POPCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the POPCoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</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>Bidali txanponak</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Bidali hainbat jasotzaileri batera</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Saldoa:</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>Berretsi bidaltzeko ekintza</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> honi: %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Berretsi txanponak bidaltzea</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Ziur zaude %1 bidali nahi duzula?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>eta</translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Ordaintzeko kopurua 0 baino handiagoa izan behar du.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Inprimakia</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>K&opurua:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Ordaindu &honi:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. <API key>)</source>
<translation type="unfinished"/>
</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>Sartu etiketa bat helbide honetarako, eta gehitu zure helbide-liburuan</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Etiketa:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</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>Itsatsi helbidea arbeletik</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>Ezabatu jasotzaile hau</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a POPCoin address (e.g. <API key>)</source>
<translation>Sartu Bitocin helbide bat (adb.: <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 type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</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>Itsatsi helbidea arbeletik</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 type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this POPCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified POPCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../<API key>.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a POPCoin address (e.g. <API key>)</source>
<translation>Sartu Bitocin helbide bat (adb.: <API key>) </translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter POPCoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>POPCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Zabalik %1 arte</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/konfirmatu gabe</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 konfirmazioak</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 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 "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Kopurua</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, ez da arrakastaz emititu oraindik</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>ezezaguna</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../forms/<API key>.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transakzioaren xehetasunak</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Panel honek transakzioaren deskribapen xehea erakusten du</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../<API key>.cpp" line="+225"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Mota</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Helbidea</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Kopurua</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Zabalik %1 arte</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Offline (%1 konfirmazio)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Konfirmatuta (%1 konfirmazio)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></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>Bloke hau ez du beste inongo nodorik jaso, eta seguruenik ez da onartuko!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Sortua, baina ez onartua</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Jasoa honekin: </translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Honi bidalia: </translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Ordainketa zeure buruari</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Bildua</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transakzioaren egoera. Pasatu sagua gainetik konfirmazio kopurua ikusteko.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Transakzioa jasotako data eta ordua.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Transakzio mota.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Transakzioaren xede-helbidea.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Saldoan kendu edo gehitutako kopurua.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Denak</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Gaur</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Aste honetan</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Hil honetan</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Azken hilean</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Aurten</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Muga...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Jasota honekin: </translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Hona bidalia: </translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Zeure buruari</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Bildua</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Beste</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Sartu bilatzeko helbide edo etiketa</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Kopuru minimoa</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopiatu helbidea</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopiatu etiketa</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Transakzioaren xehetasunak</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Komaz bereizitako artxiboa (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Mota</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etiketa</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Helbidea</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Kopurua</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Errorea esportatzean</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Ezin idatzi %1 artxiboan.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>POPCoin version</source>
<translation>Botcoin bertsioa</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or popcoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Komandoen lista</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Laguntza komando batean</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Aukerak</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: popcoin.conf)</source>
<translation>Ezarpen fitxategia aukeratu (berezkoa: popcoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: popcoind.pid)</source>
<translation>pid fitxategia aukeratu (berezkoa: popcoind.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9247 or testnet: 19247)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9347 or testnet: 19347)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</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=popcoinrpc
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 "POPCoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. POPCoin is probably already running.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong POPCoin will not work properly.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the POPCoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Laguntza mezu hau</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of POPCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart POPCoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. POPCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Birbilatzen...</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Zamaketa amaitua</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS>
|
<?php
namespace ZpgRtf\Tests\Objects;
use PHPUnit\Framework\TestCase;
use ZpgRtf\Objects\EpcRatingsObject;
class <API key> extends TestCase
{
/**
* @var EpcRatingsObject
*/
protected $object;
public function setUp()
{
$this->object = new EpcRatingsObject();
}
public function testCanInstantiate()
{
$this->assertInstanceOf(
EpcRatingsObject::class,
$this->object
);
}
public function <API key>()
{
$this->assertInstanceOf(
EpcRatingsObject::class,
$this->object->setEerCurrentRating(80)
);
$this->assertSame(
80,
$this->object->getEerCurrentRating()
);
}
public function <API key>()
{
$this->assertInstanceOf(
EpcRatingsObject::class,
$this->object-><API key>(95)
);
$this->assertSame(
95,
$this->object-><API key>()
);
}
public function <API key>()
{
$this->assertInstanceOf(
EpcRatingsObject::class,
$this->object->setEirCurrentRating(50)
);
$this->assertSame(
50,
$this->object->getEirCurrentRating()
);
}
public function <API key>()
{
$this->assertInstanceOf(
EpcRatingsObject::class,
$this->object-><API key>(100)
);
$this->assertSame(
100,
$this->object-><API key>()
);
}
public function <API key>()
{
$this->assertJson(
json_encode($this->object)
);
$this->assertInstanceOf(
\JsonSerializable::class,
$this->object
);
}
}
|
import sys
tagging_filepath = sys.argv[1]
following_filepath = sys.argv[2]
delim = '\t'
if len(sys.argv) > 3:
delim = sys.argv[3]
graph = {}
for line in open(tagging_filepath):
entry = line.rstrip().split('\t')
src = entry[0]
dst = entry[1]
if not src in graph: graph[src] = {}
graph[src][dst] = 0
for line in open(following_filepath):
entry = line.rstrip().split('\t')
src = entry[0]
dst = entry[1]
if src in graph and dst in graph[src]:
graph[src][dst] += 1
if dst in graph and src in graph[dst]:
graph[dst][src] += 2
w_dir = 0
wo_dir = 0
count = 0.0
for src in graph:
for dst in graph[src]:
val = graph[src][dst]
count += 1
if val in [1,3]:
w_dir += 1
if val in [1,2,3]:
wo_dir += 1
print "%s\t%s" % (w_dir/count, wo_dir/count)
|
#include "core/or/or.h"
#ifndef <API key>
#define <API key>
/** An element of mock_saved_logs(); records the log element that we
* received. */
typedef struct <API key> {
int severity;
const char *funcname;
const char *suffix;
const char *format;
char *generated_msg;
} <API key>;
void <API key>(void);
const smartlist_t *mock_saved_logs(void);
void <API key>(int new_level);
void <API key>(int new_level);
void <API key>(void);
int <API key>(const char *msg);
int <API key>(const char *msg);
int <API key>(const char *msg);
int <API key>(int severity);
int <API key>(void);
int <API key>(void);
void <API key>(void);
#define <API key>(predicate, failure_msg) \
do { \
if (!(predicate)) { \
TT_FAIL(failure_msg); \
<API key>(); \
<API key>; \
} \
} while (0)
#define expect_log_msg(str) \
<API key>(<API key>(str), \
("expected log to contain \"%s\"", str));
#define <API key>(str) \
<API key>(<API key>(str), \
("expected log to contain \"%s\"", str));
#define <API key>(str) \
<API key>(<API key>(str), \
("expected log to not contain \"%s\"", str));
#define <API key>(str1, str2) \
<API key>(<API key>(str1) || \
<API key>(str2), \
("expected log to contain \"%s\" or \"%s\"", str1, str2));
#define <API key>(str1, str2, str3) \
<API key>(<API key>(str1) || \
<API key>(str2) || \
<API key>(str3), \
("expected log to contain \"%s\" or \"%s\" or \"%s\"", \
str1, str2, str3))
#define <API key>(str1, str2, str3, str4) \
<API key>(<API key>(str1) || \
<API key>(str2) || \
<API key>(str3) || \
<API key>(str4), \
("expected log to contain \"%s\" or \"%s\" or \"%s\" or \"%s\"", \
str1, str2, str3, str4))
#define <API key>(str) \
do { \
\
<API key>(<API key>(str) && \
<API key>() == 1, \
("expected log to contain exactly 1 message \"%s\"", \
str)); \
} while (0);
#define <API key>(str) \
do { \
<API key>(<API key>(str)&& \
<API key>() == 1 , \
("expected log to contain 1 message, containing \"%s\"",\
str)); \
} while (0);
#define expect_no_log_msg(str) \
<API key>(!<API key>(str), \
("expected log to not contain \"%s\"",str));
#define <API key>(str) \
<API key>(!<API key>(str), \
("expected log to not contain \"%s\"", str));
#define expect_log_severity(severity) \
<API key>(<API key>(severity), \
("expected log to contain severity " # severity));
#define <API key>(severity) \
<API key>(!<API key>(severity), \
("expected log to not contain severity " # severity));
#define expect_log_entry() \
<API key>(<API key>(), \
("expected log to contain entries"));
#define expect_no_log_entry() \
<API key>(!<API key>(), \
("expected log to not contain entries"));
#endif /* !defined(<API key>) */
|
package plaid
import (
"encoding/json"
)
// <API key> <API key> defines the response schema for `/wallet/transaction/execute`
type <API key> struct {
// A unique ID identifying the transaction
TransactionId string `json:"transaction_id"`
Status <API key> `json:"status"`
// A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
RequestId string `json:"request_id"`
<API key> map[string]interface{}
}
type <API key> <API key>
// <API key> instantiates a new <API key> object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func <API key>(transactionId string, status <API key>, requestId string) *<API key> {
this := <API key>{}
this.TransactionId = transactionId
this.Status = status
this.RequestId = requestId
return &this
}
// <API key> instantiates a new <API key> object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func <API key>() *<API key> {
this := <API key>{}
return &this
}
// GetTransactionId returns the TransactionId field value
func (o *<API key>) GetTransactionId() string {
if o == nil {
var ret string
return ret
}
return o.TransactionId
}
// GetTransactionIdOk returns a tuple with the TransactionId field value
// and a boolean to check if the value has been set.
func (o *<API key>) GetTransactionIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TransactionId, true
}
// SetTransactionId sets field value
func (o *<API key>) SetTransactionId(v string) {
o.TransactionId = v
}
// GetStatus returns the Status field value
func (o *<API key>) GetStatus() <API key> {
if o == nil {
var ret <API key>
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *<API key>) GetStatusOk() (*<API key>, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *<API key>) SetStatus(v <API key>) {
o.Status = v
}
// GetRequestId returns the RequestId field value
func (o *<API key>) GetRequestId() string {
if o == nil {
var ret string
return ret
}
return o.RequestId
}
// GetRequestIdOk returns a tuple with the RequestId field value
// and a boolean to check if the value has been set.
func (o *<API key>) GetRequestIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RequestId, true
}
// SetRequestId sets field value
func (o *<API key>) SetRequestId(v string) {
o.RequestId = v
}
func (o <API key>) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["transaction_id"] = o.TransactionId
}
if true {
toSerialize["status"] = o.Status
}
if true {
toSerialize["request_id"] = o.RequestId
}
for key, value := range o.<API key> {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *<API key>) UnmarshalJSON(bytes []byte) (err error) {
<API key> := <API key>{}
if err = json.Unmarshal(bytes, &<API key>); err == nil {
*o = <API key>(<API key>)
}
<API key> := make(map[string]interface{})
if err = json.Unmarshal(bytes, &<API key>); err == nil {
delete(<API key>, "transaction_id")
delete(<API key>, "status")
delete(<API key>, "request_id")
o.<API key> = <API key>
}
return err
}
type <API key> struct {
value *<API key>
isSet bool
}
func (v <API key>) Get() *<API key> {
return v.value
}
func (v *<API key>) Set(val *<API key>) {
v.value = val
v.isSet = true
}
func (v <API key>) IsSet() bool {
return v.isSet
}
func (v *<API key>) Unset() {
v.value = nil
v.isSet = false
}
func <API key>(val *<API key>) *<API key> {
return &<API key>{value: val, isSet: true}
}
func (v <API key>) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *<API key>) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
|
chrome.app.runtime.onLaunched.addListener(function(){
chrome.app.window.create('index.html', {
bounds: {
width: Math.round(window.screen.availWidth - 100),
height: Math.round(window.screen.availHeight - 100)
}
});
});
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require "yaml"
shared_examples "a bullet" do
let(:capacity) { 2 }
subject do
described_class.new(:machines => machines, :guns => capacity)
end
describe :fire do
it "spawns correct number of threads" do
bullets = ["first", "second"]
subject.specs = bullets
Parallel.expects(:map).with(bullets, :in_threads => capacity)
subject.fire
end
it "executes loaded specs" do
bullets = ["first", "second"]
subject.specs = bullets
Bullet::BulletClient.any_instance.stubs(:execute).returns("hello")
subject.fire.should == ["hello"] * bullets.length
end
it "unloads after fire" do
bullets = ["first", "second"]
subject.specs = bullets
Bullet::BulletClient.any_instance.stubs(:execute).returns(true)
subject.fire
subject.specs.should have(0).bullets
end
end
end
describe Bullet::BulletClient do
subject { Bullet::BulletClient.new() }
describe :unload do
it "drops all collected specs and plan_list" do
subject.plan_list = {"hello" => 1}
subject.specs = ["test"]
subject.unload
subject.specs.should have(0).spec
end
end
describe :load do
it "collect plans" do
subject.load("dummy_bullet.yml")
subject.plan_list.should eq({"github" => {
"user" => {"register" => 10},
"admin" => {"create_user" => 20}
}})
end
end
describe :aim do
it "choose target as the plan" do
subject.aim("plan")
subject.plan.should == "plan"
end
end
describe :prepare do
it "calculates path to specs" do
subject.plan_list = {"normal" => {"user" => {"signin" => 1, "register" => 2}}}
subject.plan = "normal"
expected = ["user_signin", "user_register", "user_register"]
subject.prepare
(subject.specs.flatten - expected).should be_empty
end
it "distribute specs to machines" do
subject.plan_list = {"normal" => {"user" => {"signin" => 1, "register" => 2}}}
subject.plan = "normal"
subject.machines = 2
subject.prepare
subject.specs.should have(2).sets
end
end
describe :ready? do
it "verifies that specs exists" do
subject.specs = [["hello"]]
subject.ready?.should be_true
end
end
describe :use do
it "accept the path as look up path" do
subject.use("hello")
subject.spec_path.should == "hello"
end
end
context "with threads" do
it_behaves_like "a bullet" do
let(:machines) { 2 }
end
end
context "with processes" do
it_behaves_like "a bullet" do
let(:machines) { 2 }
end
end
end
|
FactoryGirl.define do
factory :transaction do |t|
t.description "Test transaction"
t.association :account_from, :factory => :foo_account
t.association :account_to, :factory => :foo_account
t.amount 10.00
end
factory :invoice_payment, :parent => :transaction do
auxilliary_model :factory => :invoice
end
end
|
// AppDelegate.h
// EXTabBarController
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <<API key>>
@property (strong, nonatomic) UIWindow *window;
@end
|
"use strict";
var task = require("../tasks/tar.gz"),
fs = require("fs");
exports["targz"] = {
setUp: function(done) {
// setup here
done();
},
"targz sqlite3": function(test) {
test.expect(1);
var actual;
actual = fs.statSync("tmp/node_sqlite3.node");
test.equal(actual.size, 831488);
test.done();
}
};
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Comp625Component } from './comp-625.component';
describe('Comp625Component', () => {
let component: Comp625Component;
let fixture: ComponentFixture<Comp625Component>;
beforeEach(async(() => {
TestBed.<API key>({
declarations: [ Comp625Component ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(Comp625Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
|
require 'moosex/types'
require 'moosex/attribute/modifiers'
module MooseX
class Attribute
include MooseX::Types
attr_reader :attr_symbol, :methods, :attribute_map
def is ; @attribute_map[:is] ; end
def writter ; @attribute_map[:writter] ; end
def reader ; @attribute_map[:reader] ; end
def override ; @attribute_map[:override] ; end
def doc ; @attribute_map[:doc] ; end
def default ; @attribute_map[:default] ; end
@@LIST_OF_PARAMETERS = [
:is, #MooseX::AttributeModifiers::Is ],
:isa, #MooseX::AttributeModifiers::Isa ],
:default, #MooseX::AttributeModifiers::Default ],
:required, #MooseX::AttributeModifiers::Required ],
:predicate, #MooseX::AttributeModifiers::Predicate],
:clearer, #MooseX::AttributeModifiers::Clearer ],
:traits, #MooseX::AttributeModifiers::Traits ],
:handles, #MooseX::AttributeModifiers::Handles ],
:lazy, #MooseX::AttributeModifiers::Lazy ],
:reader, #MooseX::AttributeModifiers::Reader ],
:writter, #MooseX::AttributeModifiers::Writter ],
:builder, #MooseX::AttributeModifiers::Builder ],
:init_arg, #MooseX::AttributeModifiers::Init_arg ],
:trigger, #MooseX::AttributeModifiers::Trigger ],
:coerce, #MooseX::AttributeModifiers::Coerce ],
:weak, #MooseX::AttributeModifiers::Weak ],
:doc, #MooseX::AttributeModifiers::Doc ],
:override, #MooseX::AttributeModifiers::Override ],
]
def initialize(attr_symbol, options ,klass)
@attr_symbol = attr_symbol
@attribute_map = {}
<API key>(options.clone, klass.__moosex__meta.plugins, klass)
end
def <API key>(options, plugins, klass)
list = @@LIST_OF_PARAMETERS.map do |parameter|
MooseX::AttributeModifiers::const_get(parameter.capitalize).new(self)
end
list.each do |plugin|
plugin.prepare(options)
end
plugins.sort.uniq.each do |plugin_klass|
begin
plugin_klass.new(self).prepare(options)
rescue => e
raise "Unexpected Error in #{klass} #{plugin_klass} #{@attr_symbol}: #{e}"
end
end
list.each do |plugin|
plugin.process(options)
end
<API key>
plugins.sort.uniq.each do |plugin_klass|
begin
plugin_klass.new(self).process(options)
rescue NameError => e
next
rescue => e
raise "Unexpected Error in #{klass} #{plugin_klass} #{@attr_symbol}: #{e}"
end
end
MooseX.warn "Unused attributes #{options} for attribute #{@attr_symbol} @ #{klass} #{klass.class}",caller() if ! options.empty?
end
def <API key>
@methods = {}
if @attribute_map[:reader]
@methods[@attribute_map[:reader]] = generate_reader
end
if @attribute_map[:writter]
@methods[@attribute_map[:writter]] = generate_writter
end
inst_variable_name = "@#{@attr_symbol}".to_sym
if @attribute_map[:predicate]
@methods[@attribute_map[:predicate]] = ->(this) do
this.<API key>? inst_variable_name
end
end
if @attribute_map[:clearer]
@methods[@attribute_map[:clearer]] = ->(this) do
if this.<API key>? inst_variable_name
this.<API key> inst_variable_name
end
end
end
generate_handles @attr_symbol
end
def generate_handles(attr_symbol)
delegator = ->(this) { this.__send__(attr_symbol) }
@attribute_map[:handles].each_pair do | method, target_method |
if target_method.is_a? Array
original_method, currying = target_method
@methods[method] = <API key>(delegator, original_method, currying)
else
@methods[method] = Proc.new do |this, *args, &proc|
delegator.call(this).__send__(target_method, *args, &proc)
end
end
end
end
def <API key>(delegator, original_method, currying)
Proc.new do |this, *args, &proc|
a1 = [ currying ]
if currying.is_a?Proc
a1 = currying[]
elsif currying.is_a? Array
a1 = currying.map{|c| (c.is_a?(Proc)) ? c[] : c }
end
delegator.call(this).__send__(original_method, *a1, *args, &proc)
end
end
def init(object, args)
value = nil
value_from_default = false
if args.has_key? @attribute_map[:init_arg]
value = args.delete(@attribute_map[:init_arg])
elsif @attribute_map[:default]
value = @attribute_map[:default].call
value_from_default = true
elsif @attribute_map[:required]
raise <API key>, "attr \"#{@attr_symbol}\" is required"
else
return
end
value = @attribute_map[:coerce].call(value)
begin
@attribute_map[:isa].call( value )
rescue MooseX::Types::TypeCheckError => e
raise MooseX::Types::TypeCheckError, "isa check for field #{attr_symbol}: #{e}"
end
unless value_from_default
@attribute_map[:trigger].call(object, value)
end
value = @attribute_map[:traits].call(value)
inst_variable_name = "@#{@attr_symbol}".to_sym
object.<API key> inst_variable_name, value
end
def generate_reader
inst_variable_name = "@#{@attr_symbol}".to_sym
builder = @attribute_map[:builder]
before_get = ->(object) { }
if @attribute_map[:lazy]
type_check = protect_isa(@attribute_map[:isa], "isa check for #{inst_variable_name} from builder")
coerce = @attribute_map[:coerce]
trigger = @attribute_map[:trigger]
traits = @attribute_map[:traits]
before_get = ->(object) do
return if object.<API key>? inst_variable_name
value = builder.call(object)
value = coerce.call(value)
type_check.call( value )
trigger.call(object, value)
value = traits.call(value)
object.<API key>(inst_variable_name, value)
end
end
->(this) do
before_get.call(this)
this.<API key> inst_variable_name
end
end
def protect_isa(type_check, message)
->(value) do
begin
type_check.call( value )
rescue MooseX::Types::TypeCheckError => e
raise MooseX::Types::TypeCheckError, "#{message}: #{e}"
end
end
end
def generate_writter
writter_name = @attribute_map[:writter]
inst_variable_name = "@#{@attr_symbol}".to_sym
coerce = @attribute_map[:coerce]
type_check = protect_isa(@attribute_map[:isa], "isa check for #{writter_name}")
trigger = @attribute_map[:trigger]
traits = @attribute_map[:traits]
->(this, value) do
value = coerce.call(value)
type_check.call( value )
trigger.call(this,value)
value = traits.call(value)
this.<API key> inst_variable_name, value
end
end
end
end
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/favicon.ico"/>
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/iosicon.png"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/css/css_compiled/<API key>.css?v1.1" media="all"/>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/<API key>.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="<API key>">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.<API key>').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.<API key>').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="<API key>">
<div class="form-window-login">
<div class="<API key>">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/css/css_compiled/js/bootstrap/css/css_compiled/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="jquery.flot.resize.js.html#">Sign Up »</a>
<a href="jquery.flot.resize.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="jquery.flot.resize.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https:
var s = document.<API key>('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
|
#include<stdio.h>
int main(void)
{
double a,b;
printf("Enter a\&b:\n");
while(scanf("%lf%lf",&a,&b)==2)
{
printf("%.3g - %.3g / %.3g * %.3g = %.3g .\n",a,b,a,b,(double)(a-b)/(a*b));
printf("\n");
printf("Enter a\&b:\n");
}
printf("done!");
return 0;
}
|
using Microsoft.SPOT.Hardware;
namespace GrFamily.MainBoard
{
<summary>
LEDNX
</summary>
public class Led
{
<summary>LEDªÚ±³ê½s</summary>
protected readonly OutputPort LedPort;
<summary>
RXgN^
</summary>
<param name="pin">LEDªÚ±³ê½s</param>
public Led(Cpu.Pin pin)
{
LedPort = new OutputPort(pin, false);
}
<summary>
LEDð_^Á·é
</summary>
<param name="on">LEDð_·éêÍ trueAÁ·éêÍ false</param>
public void SetLed(bool on)
{
LedPort.Write(on);
}
}
}
|
FROM midvalestudent/jupyter-scipy:latest
USER root
ENV HOME /root
ADD requirements.txt /usr/local/share/requirements.txt
RUN pip install --upgrade pip && pip install -r /usr/local/share/requirements.txt
# Download/build/install ffmpeg
ARG FFMPEG_VERSION
ENV FFMPEG_VERSION ${FFMPEG_VERSION:-"3.2"}
RUN DEBIAN_FRONTEND=noninteractive \
&& REPO=http:
&& echo "deb $REPO jessie main non-free\ndeb-src $REPO jessie main non-free" >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y --force-yes <API key> && apt-get update \
&& apt-get remove ffmpeg \
&& apt-get install -yq --<API key> \
build-essential \
libmp3lame-dev \
libvorbis-dev \
libtheora-dev \
libspeex-dev \
yasm \
pkg-config \
libfaac-dev \
libopenjpeg-dev \
libx264-dev \
&& apt-get clean \
|
<img src="icon.png" alt="Icon" width="128">
NUS Exam Paper Downloader
============
Simple script to download exam papers from the NUS database. Requires NUSNET login.
Runs on Python 2.7 only.
Using via Command Line
$ python examdownloader-cli.py
The required username and target destination can be set in the script or passed as a command line argument.
If no command line arguments are provided, the user is prompted for input.
Using via a Graphical User Interface
$ python examdownloader-gui.py
Compiling the Binary
1. Install `pyinstaller`:
$ pip install pyinstaller
2. Compile the app:
$ pyinstaller build.spec
The compiled app can be found inside the `dist` folder.
Credits
- Oh Shunhao [(https:
- Liu Xinan [(https:
- Yangshun Tay [(https:
|
module ngFoundation.directives {
//@NgDirective('topBarSection')
class <API key> implements ng.IDirective {
template = '<section class="top-bar-section" ng-transclude></section>';
restrict = "E";
transclude = true;
replace = true;
}
}
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Three20" do
it "fails" do
fail "hey buddy, you should probably rename this file and start specing for real"
end
end
|
if (Zepto.ajax.restore) {
Zepto.ajax.restore();
}
sinon.stub(Zepto, "ajax")
.yieldsTo("success", {
responseStatus : 200,
responseDetails : null,
responseData : {
feed: {
link : "http://github.com",
title : "GitHub Public Timeline",
entries : [
{ title : "Croaky signed up",
link : "http://github.com/Croaky/openbeerdatabase",
author : "",
publishedDate : "Thu, 24 Nov 2011 19:00:00 -0600",
content : "\u003cstrong\u003eCroaky\u003c/strong\u003e signed up for GitHub.",
contentSnippet : "Croaky signed up for GitHub.",
categories : []
}
]
}
}
});
|
#include "estimation/sensors/make_interpolator.hh"
namespace estimation {
geometry::spatial::TimeInterpolator <API key>(
const std::vector<TimedMeasurement<jet_filter::AccelMeasurement>>&
accel_meas,
const ImuModel& imu_model) {
std::vector<geometry::spatial::TimeControlPoint> points;
for (const auto& accel : accel_meas) {
const jcc::Vec3 corrected_accel =
imu_model.<API key>(accel.measurement.<API key>);
points.push_back({accel.timestamp, corrected_accel});
}
const geometry::spatial::TimeInterpolator interp(points);
return interp;
}
geometry::spatial::TimeInterpolator <API key>(
const std::vector<TimedMeasurement<jet_filter::GyroMeasurement>>&
gyro_meas) {
std::vector<geometry::spatial::TimeControlPoint> points;
for (const auto& gyro : gyro_meas) {
points.push_back({gyro.timestamp, gyro.measurement.observed_w});
}
const geometry::spatial::TimeInterpolator interp(points);
return interp;
}
} // namespace estimation
|
# coding=utf-8
import threading
from typing import Optional, Tuple
from pyqrllib.pyqrllib import bin2hstr
from pyqryptonight.pyqryptonight import StringToUInt256, UInt256ToString
from qrl.core import config, BlockHeader
from qrl.core.AddressState import AddressState
from qrl.core.Block import Block
from qrl.core.BlockMetadata import BlockMetadata
from qrl.core.DifficultyTracker import DifficultyTracker
from qrl.core.GenesisBlock import GenesisBlock
from qrl.core.PoWValidator import PoWValidator
from qrl.core.txs.Transaction import Transaction
from qrl.core.txs.CoinBase import CoinBase
from qrl.core.TransactionPool import TransactionPool
from qrl.core.misc import logger
from qrl.crypto.Qryptonight import Qryptonight
from qrl.generated import qrl_pb2, qrlstateinfo_pb2
class ChainManager:
def __init__(self, state):
self._state = state
self.tx_pool = TransactionPool(None)
self._last_block = Block.deserialize(GenesisBlock().serialize())
self.current_difficulty = StringToUInt256(str(config.user.genesis_difficulty))
self.trigger_miner = False
self.lock = threading.RLock()
@property
def height(self):
with self.lock:
if not self._last_block:
return -1
return self._last_block.block_number
@property
def last_block(self) -> Block:
with self.lock:
return self._last_block
@property
def total_coin_supply(self):
with self.lock:
return self._state.total_coin_supply
def get_block_datapoint(self, headerhash):
with self.lock:
return self._state.get_block_datapoint(headerhash)
def <API key>(self):
with self.lock:
last_block_metadata = self._state.get_block_metadata(self._last_block.headerhash)
return last_block_metadata.<API key>
def get_block_by_number(self, block_number) -> Optional[Block]:
with self.lock:
return self._state.get_block_by_number(block_number)
def <API key>(self, block_number) -> Optional[bytes]:
with self.lock:
return self._state.<API key>(block_number)
def get_block(self, header_hash: bytes) -> Optional[Block]:
with self.lock:
return self._state.get_block(header_hash)
def get_address_balance(self, address: bytes) -> int:
with self.lock:
return self._state.get_address_balance(address)
def get_address_is_used(self, address: bytes) -> bool:
with self.lock:
return self._state.get_address_is_used(address)
def get_address_state(self, address: bytes) -> AddressState:
with self.lock:
return self._state.get_address_state(address)
def <API key>(self):
with self.lock:
return self._state.<API key>()
def get_tx_metadata(self, transaction_hash) -> list:
with self.lock:
return self._state.get_tx_metadata(transaction_hash)
def <API key>(self):
with self.lock:
return self._state.get_last_txs()
def <API key>(self, transaction_hash) -> list:
with self.lock:
for tx_set in self.tx_pool.transactions:
tx = tx_set[1].transaction
if tx.txhash == transaction_hash:
return [tx, tx_set[1].timestamp]
if transaction_hash in self.tx_pool.<API key>:
for tx_set in self.tx_pool.pending_tx_pool:
tx = tx_set[1].transaction
if tx.txhash == transaction_hash:
return [tx, tx_set[1].timestamp]
return []
def get_block_metadata(self, header_hash: bytes) -> Optional[BlockMetadata]:
with self.lock:
return self._state.get_block_metadata(header_hash)
def <API key>(self, block_number=0) -> Tuple:
with self.lock:
block_number = block_number or self.height # if both are non-zero, then block_number takes priority
result = (None, None)
block = self.get_block_by_number(block_number)
if block:
blockheader = block.blockheader
blockmetadata = self.get_block_metadata(blockheader.headerhash)
result = (blockheader, blockmetadata)
return result
def get_block_to_mine(self, miner, wallet_address) -> list:
with miner.lock: # Trying to acquire miner.lock to make sure pre_block_logic is not running
with self.lock:
last_block = self.last_block
last_block_metadata = self.get_block_metadata(last_block.headerhash)
return miner.get_block_to_mine(wallet_address,
self.tx_pool,
last_block,
last_block_metadata.block_difficulty)
def get_measurement(self, block_timestamp, parent_headerhash, parent_metadata: BlockMetadata):
with self.lock:
return self._state.get_measurement(block_timestamp, parent_headerhash, parent_metadata)
def <API key>(self, block: Block):
with self.lock:
return self._state.<API key>(block)
def <API key>(self, block: Block) -> bool:
with self.lock:
return self._state.get_block(block.headerhash) is not None
def <API key>(self, blockheader: BlockHeader, enable_logging=True):
with self.lock:
parent_metadata = self.get_block_metadata(blockheader.prev_headerhash)
parent_block = self._state.get_block(blockheader.prev_headerhash)
measurement = self.get_measurement(blockheader.timestamp, blockheader.prev_headerhash, parent_metadata)
diff, target = DifficultyTracker.get(
measurement=measurement,
parent_difficulty=parent_metadata.block_difficulty)
if enable_logging:
logger.debug('
logger.debug('Validate #%s', blockheader.block_number)
logger.debug('block.timestamp %s', blockheader.timestamp)
logger.debug('parent_block.timestamp %s', parent_block.timestamp)
logger.debug('parent_block.difficulty %s', UInt256ToString(parent_metadata.block_difficulty))
logger.debug('diff %s', UInt256ToString(diff))
logger.debug('target %s', bin2hstr(target))
logger.debug('
if not PoWValidator().verify_input(blockheader.mining_blob, target):
if enable_logging:
logger.warning("PoW verification failed")
qn = Qryptonight()
tmp_hash = qn.hash(blockheader.mining_blob)
logger.warning("{}".format(bin2hstr(tmp_hash)))
logger.debug('%s', blockheader.to_json())
return False
return True
def get_headerhashes(self, start_blocknumber):
with self.lock:
start_blocknumber = max(0, start_blocknumber)
end_blocknumber = min(self._last_block.block_number,
start_blocknumber + 2 * config.dev.reorg_limit)
<API key> = end_blocknumber - start_blocknumber + 1
node_header_hash = qrl_pb2.NodeHeaderHash()
node_header_hash.block_number = start_blocknumber
block = self._state.get_block_by_number(end_blocknumber)
block_headerhash = block.headerhash
node_header_hash.headerhashes.append(block_headerhash)
end_blocknumber -= 1
while end_blocknumber >= start_blocknumber:
block_metadata = self._state.get_block_metadata(block_headerhash)
for headerhash in block_metadata.last_N_headerhashes[-1::-1]:
node_header_hash.headerhashes.append(headerhash)
end_blocknumber -= len(block_metadata.last_N_headerhashes)
if len(block_metadata.last_N_headerhashes) == 0:
break
block_headerhash = block_metadata.last_N_headerhashes[0]
node_header_hash.headerhashes[:] = node_header_hash.headerhashes[-1::-1]
del node_header_hash.headerhashes[:len(node_header_hash.headerhashes) - <API key>]
return node_header_hash
def set_broadcast_tx(self, broadcast_tx):
with self.lock:
self.tx_pool.set_broadcast_tx(broadcast_tx)
def load(self, genesis_block):
# load() has the following tasks:
# Write Genesis Block into State immediately
# Register block_number <-> blockhash mapping
# Calculate difficulty Metadata for Genesis Block
# Generate AddressStates from Genesis Block balances
# Apply Genesis Block's transactions to the state
# Detect if we are forked from genesis block and if so initiate recovery.
height = self._state.<API key>()
if height == -1:
self._state.put_block(genesis_block, None)
<API key> = qrl_pb2.BlockNumberMapping(headerhash=genesis_block.headerhash,
prev_headerhash=genesis_block.prev_headerhash)
self._state.<API key>(genesis_block.block_number, <API key>, None)
parent_difficulty = StringToUInt256(str(config.user.genesis_difficulty))
self.current_difficulty, _ = DifficultyTracker.get(
measurement=config.dev.<API key>,
parent_difficulty=parent_difficulty)
block_metadata = BlockMetadata.create()
block_metadata.<API key>(self.current_difficulty)
block_metadata.<API key>(self.current_difficulty)
self._state.put_block_metadata(genesis_block.headerhash, block_metadata, None)
addresses_state = dict()
for genesis_balance in GenesisBlock().genesis_balance:
bytes_addr = genesis_balance.address
addresses_state[bytes_addr] = AddressState.get_default(bytes_addr)
addresses_state[bytes_addr]._data.balance = genesis_balance.balance
for tx_idx in range(1, len(genesis_block.transactions)):
tx = Transaction.from_pbdata(genesis_block.transactions[tx_idx])
for addr in tx.addrs_to:
addresses_state[addr] = AddressState.get_default(addr)
coinbase_tx = Transaction.from_pbdata(genesis_block.transactions[0])
if not isinstance(coinbase_tx, CoinBase):
return False
addresses_state[coinbase_tx.addr_to] = AddressState.get_default(coinbase_tx.addr_to)
if not coinbase_tx.validate_extended(genesis_block.block_number):
return False
coinbase_tx.apply_state_changes(addresses_state)
for tx_idx in range(1, len(genesis_block.transactions)):
tx = Transaction.from_pbdata(genesis_block.transactions[tx_idx])
tx.apply_state_changes(addresses_state)
self._state.put_addresses_state(addresses_state)
self._state.update_tx_metadata(genesis_block, None)
self._state.<API key>(0, None)
else:
self._last_block = self.get_block_by_number(height)
self.current_difficulty = self._state.get_block_metadata(self._last_block.headerhash).block_difficulty
fork_state = self._state.get_fork_state()
if fork_state:
block = self._state.get_block(fork_state.<API key>)
self._fork_recovery(block, fork_state)
def _apply_block(self, block: Block, batch) -> bool:
address_set = self._state.<API key>(block) # Prepare list for current block
addresses_state = self._state.get_state_mainchain(address_set)
if not block.apply_state_changes(addresses_state):
return False
self._state.put_addresses_state(addresses_state, batch)
return True
def _update_chainstate(self, block: Block, batch):
self._last_block = block
self.<API key>(block, batch)
self.tx_pool.<API key>(block)
self._state.<API key>(block.block_number, batch)
self._state.update_tx_metadata(block, batch)
def <API key>(self, block, batch, check_stale=True) -> (bool, bool):
"""
This function returns list of bool types. The first bool represent
if the block has been added successfully and the second bool
represent the fork_flag, which becomes true when a block triggered
into fork recovery.
:param block:
:param batch:
:return: [Added successfully, fork_flag]
"""
if self._last_block.headerhash == block.prev_headerhash:
if not self._apply_block(block, batch):
return False, False
self._state.put_block(block, batch)
last_block_metadata = self._state.get_block_metadata(self._last_block.headerhash)
if last_block_metadata is None:
logger.warning("Could not find log metadata for %s", bin2hstr(self._last_block.headerhash))
return False, False
<API key> = int(UInt256ToString(last_block_metadata.<API key>))
new_block_metadata = self._add_block_metadata(block.headerhash, block.timestamp, block.prev_headerhash, batch)
<API key> = int(UInt256ToString(new_block_metadata.<API key>))
if <API key> > <API key>:
if self._last_block.headerhash != block.prev_headerhash:
fork_state = qrlstateinfo_pb2.ForkState(<API key>=block.headerhash)
self._state.put_fork_state(fork_state, batch)
self._state.write_batch(batch)
return self._fork_recovery(block, fork_state), True
self._update_chainstate(block, batch)
if check_stale:
self.tx_pool.check_stale_txn(self._state, block.block_number)
self.trigger_miner = True
return True, False
def <API key>(self, block: Block, latest_block_number: int, batch):
addresses_set = self._state.<API key>(block)
addresses_state = self._state.get_state_mainchain(addresses_set)
for tx_idx in range(len(block.transactions) - 1, -1, -1):
tx = Transaction.from_pbdata(block.transactions[tx_idx])
tx.<API key>(addresses_state, self)
self.tx_pool.<API key>(block, latest_block_number)
self._state.<API key>(block.block_number - 1, batch)
self._state.<API key>(block, batch)
self._state.<API key>(block.block_number, batch)
self._state.put_addresses_state(addresses_state, batch)
def _get_fork_point(self, block: Block):
tmp_block = block
hash_path = []
while True:
if not block:
raise Exception('[get_state] No Block Found %s, Initiator %s', block.headerhash, tmp_block.headerhash)
mainchain_block = self.get_block_by_number(block.block_number)
if mainchain_block and mainchain_block.headerhash == block.headerhash:
break
if block.block_number == 0:
raise Exception('[get_state] Alternate chain genesis is different, Initiator %s', tmp_block.headerhash)
hash_path.append(block.headerhash)
block = self._state.get_block(block.prev_headerhash)
return block.headerhash, hash_path
def _rollback(self, forked_header_hash: bytes, fork_state: qrlstateinfo_pb2.ForkState = None):
"""
Rollback from last block to the block just before the forked_header_hash
:param forked_header_hash:
:param fork_state:
:return:
"""
hash_path = []
while self._last_block.headerhash != forked_header_hash:
block = self._state.get_block(self._last_block.headerhash)
mainchain_block = self._state.get_block_by_number(block.block_number)
if block is None:
logger.warning("self.state.get_block(self.last_block.headerhash) returned None")
if mainchain_block is None:
logger.warning("self.get_block_by_number(block.block_number) returned None")
if block.headerhash != mainchain_block.headerhash:
break
hash_path.append(self._last_block.headerhash)
batch = self._state.batch
self.<API key>(self._last_block, block.block_number, batch)
if fork_state:
fork_state.<API key>.extend([self._last_block.headerhash])
self._state.put_fork_state(fork_state, batch)
self._state.write_batch(batch)
self._last_block = self._state.get_block(self._last_block.prev_headerhash)
return hash_path
def add_chain(self, hash_path: list, fork_state: qrlstateinfo_pb2.ForkState) -> bool:
"""
Add series of blocks whose headerhash mentioned into hash_path
:param hash_path:
:param fork_state:
:param batch:
:return:
"""
with self.lock:
start = 0
try:
start = hash_path.index(self._last_block.headerhash) + 1
except ValueError:
# Following condition can only be true if the fork recovery was interrupted last time
if self._last_block.headerhash in fork_state.<API key>:
return False
for i in range(start, len(hash_path)):
header_hash = hash_path[i]
block = self._state.get_block(header_hash)
batch = self._state.batch
if not self._apply_block(block, batch):
return False
self._update_chainstate(block, batch)
logger.debug('Apply block #%d - [batch %d | %s]', block.block_number, i, hash_path[i])
self._state.write_batch(batch)
self._state.delete_fork_state()
return True
def _fork_recovery(self, block: Block, fork_state: qrlstateinfo_pb2.ForkState) -> bool:
logger.info("Triggered Fork Recovery")
# This condition only becomes true, when fork recovery was interrupted
if fork_state.<API key>:
logger.info("Recovering from last fork recovery interruption")
forked_header_hash, hash_path = fork_state.<API key>, fork_state.<API key>
else:
forked_header_hash, hash_path = self._get_fork_point(block)
fork_state.<API key> = forked_header_hash
fork_state.<API key>.extend(hash_path)
self._state.put_fork_state(fork_state)
rollback_done = False
if fork_state.<API key>:
b = self._state.get_block(fork_state.<API key>[-1])
if b and b.prev_headerhash == fork_state.<API key>:
rollback_done = True
if not rollback_done:
logger.info("Rolling back")
old_hash_path = self._rollback(forked_header_hash, fork_state)
else:
old_hash_path = fork_state.<API key>
if not self.add_chain(hash_path[-1::-1], fork_state):
logger.warning("Fork Recovery Failed... Recovering back to old mainchain")
# If above condition is true, then it means, the node failed to add_chain
# Thus old chain state, must be retrieved
self._rollback(forked_header_hash)
self.add_chain(old_hash_path[-1::-1], fork_state) # Restores the old chain state
return False
logger.info("Fork Recovery Finished")
self.trigger_miner = True
return True
def _add_block(self, block, batch=None, check_stale=True) -> (bool, bool):
self.trigger_miner = False
block_size_limit = self.<API key>(block)
if block_size_limit and block.size > block_size_limit:
logger.info('Block Size greater than threshold limit %s > %s', block.size, block_size_limit)
return False, False
return self.<API key>(block, batch, check_stale)
def add_block(self, block: Block, check_stale=True) -> bool:
with self.lock:
if block.block_number < self.height - config.dev.reorg_limit:
logger.debug('Skipping block #%s as beyond re-org limit', block.block_number)
return False
if self.<API key>(block):
return False
batch = self._state.batch
block_flag, fork_flag = self._add_block(block, batch=batch, check_stale=check_stale)
if block_flag:
if not fork_flag:
self._state.write_batch(batch)
logger.info('Added Block #%s %s', block.block_number, bin2hstr(block.headerhash))
return True
return False
def _add_block_metadata(self,
headerhash,
block_timestamp,
parent_headerhash,
batch):
block_metadata = self._state.get_block_metadata(headerhash)
if not block_metadata:
block_metadata = BlockMetadata.create()
parent_metadata = self._state.get_block_metadata(parent_headerhash)
<API key> = parent_metadata.block_difficulty
<API key> = parent_metadata.<API key>
block_metadata.<API key>(parent_metadata.last_N_headerhashes, parent_headerhash)
measurement = self._state.get_measurement(block_timestamp, parent_headerhash, parent_metadata)
block_difficulty, _ = DifficultyTracker.get(
measurement=measurement,
parent_difficulty=<API key>)
<API key> = StringToUInt256(str(
int(UInt256ToString(block_difficulty)) +
int(UInt256ToString(<API key>))))
block_metadata.<API key>(block_difficulty)
block_metadata.<API key>(<API key>)
parent_metadata.<API key>(headerhash)
self._state.put_block_metadata(parent_headerhash, parent_metadata, batch)
self._state.put_block_metadata(headerhash, block_metadata, batch)
return block_metadata
def <API key>(self, block, batch):
<API key> = qrl_pb2.BlockNumberMapping(headerhash=block.headerhash,
prev_headerhash=block.prev_headerhash)
self._state.<API key>(block.block_number, <API key>, batch)
|
<?php
namespace Nitrapi\Common\Exceptions;
class <API key> extends NitrapiException
{
}
|
var baseURL;
$.validator.addMethod("alfanumerico", function(value, element) {
return this.optional(element) || /^[-._a-z0-9\- ]+$/i.test(value);
}, "Este campo es alfanumerico.");
$("#<API key>").validate({
rules : {
descripcion : "required",
codigo : {required:true,alfanumerico:true},
},
messages : {
descripcion : "Ingrese este campo.",
codigo : {required:"Ingrese este campo.",alfanumerico:"Este campo es alfanumerico."},
},
submitHandler : function(form) {
$.ajax(form.action, {
async : false,
type : "POST",
data : $(form).serialize(),
success : function(contenido) {
//alert("contenido :"+ contenido);
if(contenido=="error"){
var mensaje="Este tipo de documento ya ha sido registrado";
alert(mensaje);
}
else{
baseURL = $("#baseURL").val();
$.get(baseURL + "<API key>/<API key>?info="+contenido, function(respuesta) {
$("#contenidoPrincipal").html(respuesta);
$("#title-page").html("Mantenimiento Tipo Entidad Documento - Listado");
});
}
}
});
}
});
function <API key>(){
var baseURL;
baseURL = $("#baseURL").val();
$("#contenidoPrincipal").html("Cargando . . .");
$.get(baseURL + "<API key>/<API key>", function(respuesta) {
$("#contenidoPrincipal").html(respuesta);
$("#title-page").html("Mantenimiento Tipo Entidad Documento - Listado");
});
}
|
export { default } from '<API key>/controllers/<API key>/new';
|
<?php
use Illuminate\Http\Request;
//Route::middleware('auth:api')->get('/user', function (Request $request) {
// return $request->user();
//Route::get('wechat/index', 'WechatController@index');
|
#ifndef _ZLX_PLATFORM_H
#define _ZLX_PLATFORM_H
#include "arch.h"
#if defined(ZLX_FREESTANDING) && ZLX_FREESTANDING
#else
# undef ZLX_FREESTANDING
# define ZLX_FREESTANDING 0
# if defined(_WIN32)
# define ZLX_MSWIN 1
# elif defined(_AIX)
# define ZLX_AIX 1
# elif defined(__unix__) || defined(__unix)
# define ZLX_UNIX 1
# include <unistd.h>
# if defined(POSIX_VERSION)
# define ZLX_POSIX POSIX_VERSION
# endif
# if defined(__DragonFly__)
# define ZLX_BSD 1
# define ZLX_DRAGONFLY_BSD 1
# elif defined(__FreeBSD__)
# define ZLX_BSD 1
# define ZLX_FREEBSD 1
# elif defined(__NetBSD__)
# define ZLX_BSD 1
# define ZLX_NETBSD 1
# elif defined(__OpenBSD__)
# define ZLX_BSD 1
# define ZLX_OPENBSD 1
# endif
# endif /* OS defines */
#endif /* ZLX_FREESTANDING */
/* assume System V ABI if we're not under a Microsoft environment */
#if !defined(ZLX_ABI_SYSV) && !defined(ZLX_ABI_MS)
# if defined(_WIN32)
# define ZLX_ABI_MS 1
# else
# define ZLX_ABI_SYSV 1
# endif
#endif
#if ZLX_IA32 && ZLX_ABI_MS
# define ZLX_FAST_CALL __fastcall
#elif ZLX_IA32 && ZLX_ABI_SYSV && (ZLX_GCC || ZLX_CLANG)
# define ZLX_FAST_CALL __attribute__((regparm((3))))
#else
# define ZLX_FAST_CALL
#endif
#endif /* _ZLX_PLATFORM_H */
|
title: Color Palette
layout: page
description: taCss color palette same as the Material Design Lite color palette.
utilities: true
<div class="row p-3">
<h6>color setup</h6>
<div class="code col-12 info p-3 m-b-3">
{% highlight scss %}
/* colors setups in "core/_variables.scss" */
/* enable/disable the default colors for components */
$enable-colors: true !default;
/* don't forget include minimum the primary and the accent color */
/* the palette variables can be found in the "core/_colorpalette.scss" */
$primary-palette: $teal-palette !default;
$accent-palette: $deep-orange-palette !default;
$enable--red-palette: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
$<API key>: true !default;
/* basic palette contains black, white and the midle colors for the rest even if the color-palette not enabled. no accent color. */
$<API key>: true !default;
{% endhighlight %}
</div>
<h6>background</h6>
<p>
Use the <span class="code-class">bg-</span> prefix with your <i>color</i> of choice.
</p>
<p class="col-6 col-t-8 ">
<button class='btn bg-red'> red </button>
<button class='btn bg-pink'> pink </button>
<button class='btn bg-purple'> purple </button>
<button class='btn bg-deep-purple'> deep-purple </button>
<button class='btn bg-indigo'> indigo </button>
<button class='btn bg-blue'> blue </button>
<button class='btn bg-light-blue'> light-blue </button>
<button class='btn bg-lime'> lime </button>
<button class='btn bg-yellow'> yellow </button>
<button class='btn bg-amber'> amber </button>
<button class='btn bg-orange'> orange </button>
<button class='btn bg-deep-orange'> deep-orange </button>
<button class='btn bg-brown'> brown </button>
<button class='btn bg-grey'> grey </button>
<button class='btn bg-blue-grey'> blue-grey </button>
<button class='btn bg-black'> black </button>
<button class='btn bg-white'> white </button>
</p>
<div class="code info code-large col-6 col-t-8">
{% highlight html %}
<button class='btn bg-red'> red </button>
<button class='btn bg-pink'> pink </button>
<button class='btn bg-purple'> purple </button>
<button class='btn bg-deep-purple'> deep-purple </button>
<button class='btn bg-indigo'> indigo </button>
<button class='btn bg-blue'> blue </button>
<button class='btn bg-light-blue'> light-blue </button>
<button class='btn bg-lime'> lime </button>
<button class='btn bg-yellow'> yellow </button>
<button class='btn bg-amber'> amber </button>
<button class='btn bg-orange'> orange </button>
<button class='btn bg-deep-orange'> deep-orange </button>
<button class='btn bg-brown'> brown </button>
<button class='btn bg-grey'> grey </button>
<button class='btn bg-blue-grey'> blue-grey </button>
<button class='btn bg-black'> black </button>
<button class='btn bg-white'> white </button>
{% endhighlight %}
</div>
<h6>auto textcolor</h6>
<p>
To choose readable font color automatic to the choosen background use the <span class="code-class">colored</span> class.
</p>
<p class="col-6 col-t-8 ">
<button class='colored btn bg-red'> red </button>
<button class='colored btn bg-pink'> pink </button>
<button class='colored btn bg-purple'> purple </button>
<button class='colored btn bg-deep-purple'> deep-purple </button>
<button class='colored btn bg-indigo'> indigo </button>
<button class='colored btn bg-blue'> blue </button>
<button class='colored btn bg-light-blue'> light-blue </button>
<button class='colored btn bg-lime'> lime </button>
<button class='colored btn bg-yellow'> yellow </button>
<button class='colored btn bg-amber'> amber </button>
<button class='colored btn bg-orange'> orange </button>
<button class='colored btn bg-deep-orange'> deep-orange </button>
<button class='colored btn bg-brown'> brown </button>
<button class='colored btn bg-grey'> grey </button>
<button class='colored btn bg-blue-grey'> blue-grey </button>
<button class='colored btn bg-black'> black </button>
<button class='colored btn bg-white'> white </button>
</p>
<div class="code info code-large col-6 col-t-8">
{% highlight html %}
<button class='colored btn bg-red'> red </button>
<button class='colored btn bg-pink'> pink </button>
<button class='colored btn bg-purple'> purple </button>
<button class='colored btn bg-deep-purple'> deep-purple </button>
<button class='colored btn bg-indigo'> indigo </button>
<button class='colored btn bg-blue'> blue </button>
<button class='colored btn bg-light-blue'> light-blue </button>
<button class='colored btn bg-lime'> lime </button>
<button class='colored btn bg-yellow'> yellow </button>
<button class='colored btn bg-amber'> amber </button>
<button class='colored btn bg-orange'> orange </button>
<button class='colored btn bg-deep-orange'> deep-orange </button>
<button class='colored btn bg-brown'> brown </button>
<button class='colored btn bg-grey'> grey </button>
<button class='colored btn bg-blue-grey'> blue-grey </button>
<button class='colored btn bg-black'> black </button>
<button class='colored btn bg-white'> white </button>
{% endhighlight %}
</div>
<h6>outline (border and text color)</h6>
<p>
Use the <span class="code-class">outline-</span> prefix with your <i>color</i> of choice to get colored border and text.
</p>
<p class="col-6 col-t-9">
<button class='btn outline-red'> red </button>
<button class='btn outline-pink'> pink </button>
<button class='btn outline-purple'> purple </button>
<button class='btn outline-deep-purple'> deep-purple </button>
<button class='btn outline-indigo'> indigo </button>
<button class='btn outline-blue'> blue </button>
<button class='btn outline-light-blue'> light-blue </button>
<button class='btn outline-lime'> lime </button>
<button class='btn outline-yellow'> yellow </button>
<button class='btn outline-amber'> amber </button>
<button class='btn outline-orange'> orange </button>
<button class='btn outline-deep-orange'> deep-orange </button>
<button class='btn outline-brown'> brown </button>
<button class='btn outline-grey'> grey </button>
<button class='btn outline-blue-grey'> blue-grey </button>
<button class='btn outline-black'> black </button>
<button class='btn outline-white'> white </button>
</p>
<div class="code info code-large col-6 col-t-8">
{% highlight html %}
<button class='btn outline-red'> red </button>
<button class='btn outline-pink'> pink </button>
<button class='btn outline-purple'> purple </button>
<button class='btn outline-deep-purple'> deep-purple </button>
<button class='btn outline-indigo'> indigo </button>
<button class='btn outline-blue'> blue </button>
<button class='btn outline-light-blue'> light-blue </button>
<button class='btn outline-lime'> lime </button>
<button class='btn outline-yellow'> yellow </button>
<button class='btn outline-amber'> amber </button>
<button class='btn outline-orange'> orange </button>
<button class='btn outline-deep-orange'> deep-orange </button>
<button class='btn outline-brown'> brown </button>
<button class='btn outline-grey'> grey </button>
<button class='btn outline-blue-grey'> blue-grey </button>
<button class='btn outline-black'> black </button>
<button class='btn outline-white'> white </button>
{% endhighlight %}
</div>
<h6>text color</h6>
<p>
Use the <span class="code-class">text-</span> prefix with your <i>color</i> of choice to get colored text.
</p>
<p class="col-6 col-t-8">
<button class='btn text-red'> red </button>
<button class='btn text-pink'> pink </button>
<button class='btn text-purple'> purple </button>
<button class='btn text-deep-purple'> deep-purple </button>
<button class='btn text-indigo'> indigo </button>
<button class='btn text-blue'> blue </button>
<button class='btn text-light-blue'> light-blue </button>
<button class='btn text-lime'> lime </button>
<button class='btn text-yellow'> yellow </button>
<button class='btn text-amber'> amber </button>
<button class='btn text-orange'> orange </button>
<button class='btn text-deep-orange'> deep-orange </button>
<button class='btn text-brown'> brown </button>
<button class='btn text-grey'> grey </button>
<button class='btn text-blue-grey'> blue-grey </button>
<button class='btn text-black'> black </button>
<button class='btn text-white'> white </button>
</p>
<div class="code info code-large col-6 col-t-8">
{% highlight html %}
<button class='btn text-red'> red </button>
<button class='btn text-pink'> pink </button>
<button class='btn text-purple'> purple </button>
<button class='btn text-deep-purple'> deep-purple </button>
<button class='btn text-indigo'> indigo </button>
<button class='btn text-blue'> blue </button>
<button class='btn text-light-blue'> light-blue </button>
<button class='btn text-lime'> lime </button>
<button class='btn text-yellow'> yellow </button>
<button class='btn text-amber'> amber </button>
<button class='btn text-orange'> orange </button>
<button class='btn text-deep-orange'> deep-orange </button>
<button class='btn text-brown'> brown </button>
<button class='btn text-grey'> grey </button>
<button class='btn text-blue-grey'> blue-grey </button>
<button class='btn text-black'> black </button>
<button class='btn text-white'> white </button>
{% endhighlight %}
</div>
<h6>the full color palette</h6>
<div class="row" id="colorPalettesBlock">
</div>
<div class="row" id=<API key>>
</div>
<script type="text/javascript">
var basicPalette = [
"red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "lime",
"yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey", "black", "white",
];
var redPalette = ['red-0','red-1','red-2','red-3','red-4','red','red-6','red-7','red-8','red-9','red-a1','red-a2','red-a3','red-a4'];
var pinkPalette = ['pink-0','pink-1','pink-2','pink-3','pink-4','pink','pink-6','pink-7','pink-8','pink-9','pink-a1','pink-a2','pink-a3','pink-a4'];
var purplePalette = ['purple-0','purple-1','purple-2','purple-3','purple-4','purple','purple-6','purple-7','purple-8','purple-9','purple-a1','purple-a2','purple-a3','purple-a4'];
var deepPurplePalette = ['deep-purple-0','deep-purple-1','deep-purple-2','deep-purple-3','deep-purple-4','deep-purple','deep-purple-6','deep-purple-7','deep-purple-8','deep-purple-9','deep-purple-a1','deep-purple-a2','deep-purple-a3','deep-purple-a3'];
var indigoPalette = ['indigo-0','indigo-1','indigo-2','indigo-3','indigo-4','indigo','indigo-6','indigo-7','indigo-8','indigo-9','indigo-a1','indigo-a2','indigo-a3','indigo-a4'];
var bluePalette = ['blue-0','blue-1','blue-2','blue-3','blue-4','blue','blue-6','blue-7','blue-8','blue-9','blue-a1','blue-a2','blue-a3','blue-a4'];
var lightBluePalette = ['light-blue-0','light-blue-1','light-blue-2','light-blue-3','light-blue-4','light-blue','light-blue-6','light-blue-7','light-blue-8','light-blue-9','light-blue-a1','light-blue-a2','light-blue-a3','light-blue-a4'];
var cyanPalette = ['cyan-0','cyan-1','cyan-2','cyan-3','cyan-4','cyan','cyan-6','cyan-7','cyan-8','cyan-9','cyan-a1','cyan-a2','cyan-a3','cyan-a4'];
var tealPalette = ['teal-0','teal-1','teal-2','teal-3','teal-4','teal','teal-6','teal-7','teal-8','teal-9','teal-a1','teal-a2','teal-a3','teal-a4'];
var greenPalette = ['green-0','green-1','green-2','green-3','green-4','green','green-6','green-7','green-8','green-9','green-a1','green-a2','green-a3','green-a4'];
var lightGreenPalette = ['light-green-0','light-green-1','light-green-2','light-green-3','light-green-4','light-green','light-green-6','light-green-7','light-green-8','light-green-9','light-green-a1','light-green-a2','light-green-a3','light-green-a4'];
var limePalette = ['lime-0','lime-1','lime-2','lime-3','lime-4','lime','lime-6','lime-7','lime-8','lime-9','lime-a1','lime-a2','lime-a3','lime-a4'];
var yellowPalette = ['yellow-0','yellow-1','yellow-2','yellow-3','yellow-4','yellow','yellow-6','yellow-7','yellow-8','yellow-9','yellow-a1','yellow-a2','yellow-a3','yellow-a4'];
var amberPalette = ['amber-0','amber-1','amber-2','amber-3','amber-4','amber','amber-6','amber-7','amber-8','amber-9','amber-a1','amber-a2','amber-a3','amber-a4'];
var orangePalette = ['orange-0','orange-1','orange-2','orange-3','orange-4','orange','orange-6','orange-7','orange-8','orange-9','orange-a1','orange-a2','orange-a3','orange-a4'];
var deepOrangePalette = ['deep-orange-0','deep-orange-1','deep-orange-2','deep-orange-3','deep-orange-4','deep-orange','deep-orange-6','deep-orange-7','deep-orange-8','deep-orange-9','deep-orange-a1','deep-orange-a2','deep-orange-a3','deep-orange-a4'];
var brownPalette = ['brown-0','brown-1','brown-2','brown-3','brown-4','brown','brown-6','brown-7','brown-8','brown-9'];
var greyPalette = ['grey-0','grey-1','grey-2','grey-3','grey-4','grey','grey-6','grey-7','grey-8','grey-9'];
var blueGreyPalette = ['blue-grey-0','blue-grey-1','blue-grey-2','blue-grey-3','blue-grey-4','blue-grey','blue-grey-6','blue-grey-7','blue-grey-8','blue-grey-9'];
var blackPalette = ['black'];
var whitePalette = ['white'];
var colorPalettes = ['redPalette','pinkPalette','purplePalette','deepPurplePalette','indigoPalette','bluePalette','lightBluePalette','cyanPalette','tealPalette','greenPalette','lightGreenPalette','limePalette','yellowPalette','amberPalette','orangePalette','deepOrangePalette','brownPalette','greyPalette','blueGreyPalette']; //+'blackPalette','whitePalette'
str = '';
str = "<div class='no-gutter col col-m-2 col-t-4 col-6'><div class='bg-black p-1 w-100 t-center colored'>black</div></div><div class='no-gutter col col-m-2 col-t-4 col-6'><div class='bg-white p-1 w-100 t-center colored'>white</div></div><div class='no-gutter col col-m-2 col-t-4 col-6'><div class='bg-white p-1 w-100 t-center colored'>black</div></div><div class='no-gutter col col-m-2 col-t-4 col-6'><div class='bg-black p-1 w-100 t-center colored'>white</div></div>";
for (var i = 0; i < colorPalettes.length; i++) {
str += "<div class='no-gutter col col-2 bg-" + window[colorPalettes[i]][9] + "'>";
for (var j = 0; j < window[colorPalettes[i]].length; j++) {
str += "<div class='bg-" + window[colorPalettes[i]][j] + " p-1 w-100 t-center colored'> " + window[colorPalettes[i]][j] + " </div>";
}
str += "</div>";
}
for (var i = 0; i < colorPalettes.length; i++) {
str += "<div class='bg-black no-gutter col col-2'>";
for (var j = 0; j < window[colorPalettes[i]].length; j++) {
str += "<div class='text-" + window[colorPalettes[i]][j] + " p-1 w-100 t-center colored'> " + window[colorPalettes[i]][j] + " </div>";
}
str += "</div>";
}
document.getElementById("colorPalettesBlock").innerHTML = str;
</script>
</div>
|
# testtesttest-yo
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Dependency Status][daviddm-image]][daviddm-url]
[![Code Coverage][coverage-image]][coverage-url]
[![Code Climate][climate-image]][climate-url]
[![License][license-image]][license-url]
[![Code Style][code-style-image]][code-style-url]
## Table of Contents
1. [Features](#features)
1. [Requirements](#requirements)
1. [Getting Started](#getting-started)
1. [Application Structure](#<API key>)
1. [Development](#development)
1. [Routing](#routing)
1. [Testing](#testing)
1. [Configuration](#configuration)
1. [Production](#production)
1. [Deployment](#deployment)
## Requirements
* node `^5.0.0` (`6.11.0` suggested)
* yarn `^0.23.0` or npm `^3.0.0`
## Getting Started
1. Install dependencies: `yarn` or `npm install`
2. Start Development server: `yarn start` or `npm start`
While developing, you will probably rely mostly on `npm start`; however, there are additional scripts at your disposal:
|`npm run <script>` |Description|
|
|`start` |Serves your app at `localhost:3000` and displays [Webpack Dashboard](https://github.com/FormidableLabs/webpack-dashboard)|
|`start:simple` |Serves your app at `localhost:3000` without [Webpack Dashboard](https://github.com/FormidableLabs/webpack-dashboard)|
|`build` |Builds the application to ./dist|
|`test` |Runs unit tests with Karma. See [testing](#testing)|
|`test:watch` |Runs `test` in watch mode to re-run tests when changed|
|`lint` |[Lints](http://stackoverflow.com/questions/8503559/what-is-linting) the project for potential errors|
|`lint:fix` |Lints the project and [fixes all correctable errors](http://eslint.org/docs/user-guide/<API key>.html#fix)|
[Husky](https://github.com/typicode/husky) is used to enable `prepush` hook capability. The `prepush` script currently runs `eslint`, which will keep you from pushing if there is any lint within your code. If you would like to disable this, remove the `prepush` script from the `package.json`.
## Application Structure
The application structure presented in this boilerplate is **fractal**, where functionality is grouped primarily by feature rather than file type. Please note, however, that this structure is only meant to serve as a guide, it is by no means prescriptive. That said, it aims to represent generally accepted guidelines and patterns for building scalable applications. If you wish to read more about this pattern, please check out this [awesome writeup](https:
.
build # All build-related configuration
create-config # Script for building config.js in ci environments
karma.config.js # Test configuration for Karma
webpack.config.js # <API key> configuration files for webpack
server # Express application that provides webpack middleware
main.js # Server application entry point
src # Application source code
index.html # Main HTML page container for app
main.js # Application bootstrap and rendering
normalize.js # Browser normalization and polyfills
components # Global Reusable Presentational Components
containers # Global Reusable Container Components
layouts # Components that dictate major page structure
CoreLayout # Global application layout in which to render routes
routes # Main route definitions and async split points
index.js # Bootstrap main application routes with store
Home # Fractal route
index.js # Route definitions and async split points
assets # Assets required to render components
components # Presentational React Components
container # Connect components to actions and store
modules # Collections of reducers/constants/actions
routes ** # Fractal sub-routes (** optional)
static # Static assets
store # Redux-specific pieces
createStore.js # Create and instrument redux store
reducers.js # Reducer registry and injection
styles # Application-wide styles (generally settings)
project.config.js # Project configuration settings (includes ci settings)
tests # Unit tests
Routing
We use `react-router` [route definitions](https://github.com/ReactTraining/react-router/blob/v3/docs/API.md#plainroute) (`<route>/index.js`) to define units of logic within our application. See the [application structure](#<API key>) section for more information.
## Testing
To add a unit test, create a `.spec.js` file anywhere inside of `./tests`. Karma and webpack will automatically find these files, and Mocha and Chai will be available within your test without the need to import them.
## Production
Build code before deployment by running `npm run build`. There are multiple options below for types of deployment, if you are unsure, checkout the Firebase section.
Deployment
1. Login to [Firebase](firebase.google.com) (or Signup if you don't have an account) and create a new project
2. Install cli: `npm i -g firebase-tools`
# CI Deploy (recommended)
**Note**: Config for this is located within `travis.yml`
`firebase-ci` has been added to simplify the CI deployment process. All that is required is providing authentication with Firebase:
1. Login: `firebase login:ci` to generate an authentication token (will be used to give Travis-CI rights to deploy on your behalf)
1. Set `FIREBASE_TOKEN` environment variable within Travis-CI environment
1. Run a build on Travis-CI
If you would like to deploy to different Firebase instances for different branches (i.e. `prod`), change `ci` settings within `.firebaserc`.
For more options on CI settings checkout the [firebase-ci docs](https://github.com/prescottprue/firebase-ci)
# Manual deploy
1. Run `firebase:login`
1. Initialize project with `firebase init` then answer:
* What file should be used for Database Rules? -> `database.rules.json`
* What do you want to use as your public directory? -> `build`
* Configure as a single-page app (rewrite all urls to /index.html)? -> `Yes`
* What Firebase project do you want to associate as default? -> **your Firebase project name**
1. Build Project: `npm run build`
1. Confirm Firebase config by running locally: `firebase serve`
1. Deploy to firebase: `firebase deploy`
**NOTE:** You can use `firebase serve` to test how your application will work when deployed to Firebase, but make sure you run `npm run build` first.
[npm-image]: https://img.shields.io/npm/v/testtesttest-yo.svg?style=flat-square
[npm-url]: https://npmjs.org/package/testtesttest-yo
[travis-image]: https://img.shields.io/travis/taforyou@hotmail.com/testtesttest-yo/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/taforyou@hotmail.com/testtesttest-yo
[daviddm-image]: https://img.shields.io/david/taforyou@hotmail.com/testtesttest-yo.svg?style=flat-square
[daviddm-url]: https://david-dm.org/taforyou@hotmail.com/testtesttest-yo
[climate-image]: https://img.shields.io/codeclimate/github/taforyou@hotmail.com/testtesttest-yo.svg?style=flat-square
[climate-url]: https://codeclimate.com/github/taforyou@hotmail.com/testtesttest-yo
[coverage-image]: https://img.shields.io/codeclimate/coverage/github/taforyou@hotmail.com/testtesttest-yo.svg?style=flat-square
[coverage-url]: https://codeclimate.com/github/taforyou@hotmail.com/testtesttest-yo
[license-image]: https://img.shields.io/npm/l/testtesttest-yo.svg?style=flat-square
[license-url]: https:
[code-style-image]: https://img.shields.io/badge/code%<API key>.svg?style=flat-square
[code-style-url]: http://standardjs.com/
|
package com.board.gd.domain.stock;
import lombok.Data;
import java.util.List;
import java.util.stream.Collectors;
@Data
public class StockResult {
private Long id;
private String name;
private String code;
public static StockResult getStockResult(Stock stock) {
StockResult stockResult = new StockResult();
stockResult.setId(stock.getId());
stockResult.setName(stock.getName());
stockResult.setCode(stock.getCode());
return stockResult;
}
public static List<StockResult> getStockResultList(List<Stock> stockList) {
return stockList.stream()
.map(stock -> getStockResult(stock))
.collect(Collectors.toList());
}
}
|
<?php
namespace Mekras\Interfaces\Http\Message;
use Psr\Http\Message\RequestInterface;
interface RequestFactory
{
/**
* Create empty HTTP request
*
* @return RequestInterface
*
* @since 3.02
*/
public function createEmptyRequest();
}
|
<!
Unsafe sample
input : get the UserData field of $_SESSION
Uses a number_float_filter via filter_var function
File : unsafe, use of untrusted data in CSS
<!--Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
<!DOCTYPE html>
<html>
<head>
<style>
<?php
$tainted = $_SESSION['UserData'];
$sanitized = filter_var($tainted, <API key>);
if (filter_var($sanitized, <API key>))
$tainted = $sanitized ;
else
$tainted = "" ;
//flaw
echo $tainted ;
?>
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
|
var today = new Date();
console.log(today);
|
var RocketBoots = {
isInitialized : false,
readyFunctions : [],
components : {},
loadedScripts: [],
version: {full: "0.7.0", major: 0, minor: 7, patch: 0, codeName: "sun-master"},
<API key>: true,
_initTimer : null,
_MAX_ATTEMPTS : 300,
_BOOTING_ELEMENT_ID : "<API key>",
_: null, // Lodash
$: null, // jQuery
Component : function(c){
this.fileName = c;
this.name = null;
this.isLoaded = false;
this.isInstalled = false;
},
log : console.log,
loadScript : function(url, callback){
//console.log("Loading script", url);
var o = this;
var s = document.createElement('script');
var r = false;
var t;
s.type = 'text/javascript';
s.src = "scripts/" + url + ".js";
s.className = "rocketboots-script";
s.onload = s.onreadystatechange = function() {
//console.log( this.readyState ); //uncomment this line to see which ready states are called.
if ( !r && (!this.readyState || this.readyState == 'complete') )
{
r = true;
o.loadedScripts.push(url);
if (typeof callback == "function") callback();
}
};
t = document.<API key>('script')[0];
t.parentNode.insertBefore(s, t);
return this;
},
hasComponent: function (componentClass) {
if (typeof RocketBoots[componentClass] == "function") {
return true;
} else {
return false;
}
},
installComponent : function (options, callback, attempt) {
// options = { fileName, classNames, requirements, description, credits }
var o = this;
var mainClassName = (typeof options.classNames === 'object' && options.classNames.length > 0) ? options.classNames[0] : (options.classNames || options.className);
var componentClass = options[mainClassName];
var requirements = options.requirements;
var fileName = options.fileName;
var callbacks = [];
var i;
// Setup array of callbacks
if (typeof callback === 'function') { callbacks.push(callback); }
if (typeof options.callback === 'function') { callbacks.push(options.callback); }
if (typeof options.callbacks === 'object') { callbacks.concat(options.callbacks); }
// Check for possible errors
if (typeof mainClassName !== 'string') {
console.error("Error installing component: mainClassName is not a string", mainClassName, options);
console.log("options", options);
return;
} else if (typeof componentClass !== 'function') {
console.error("Error installing component: class name", mainClassName, "not found on options:", options);
console.log("options", options);
return;
}
//console.log("Installing", fileName, " ...Are required components", requirements, " loaded?", o.areComponentsLoaded(requirements));
if (!o.areComponentsLoaded(requirements)) {
var tryAgainDelay, compTimer;
if (typeof attempt === "undefined") {
attempt = 1;
} else if (attempt > o._MAX_ATTEMPTS) {
console.error("Could not initialize RocketBoots: too many attempts");
return false;
} else {
attempt++;
}
if (o.<API key>) {
console.log(fileName, "requires component(s)", requirements, " which aren't loaded. Autoloading...");
o.loadComponents(requirements);
tryAgainDelay = 100 * attempt;
} else {
console.warn(fileName, "requires component(s)", requirements, " which aren't loaded.");
tryAgainDelay = 5000;
}
compTimer = window.setTimeout(function(){
o.installComponent(options, callback, attempt);
}, tryAgainDelay);
} else {
if (typeof o.components[fileName] == "undefined") {
o.components[fileName] = new o.Component(fileName);
}
o.components[fileName].name = mainClassName;
o.components[fileName].isInstalled = true;
o.components[fileName].callbacks = callbacks;
// TODO: Add description and credits
//o.components[fileName].description = "";
//o.components[fileName].credits = "";
o[mainClassName] = componentClass;
}
return this;
},
getComponentByName: function (componentName) {
var o = this;
for (var cKey in o.components) {
if (o.components[cKey].name == componentName) {
return o.components[cKey];
}
};
return;
},
areComponentsLoaded: function (componentNameArr) {
var o = this, areLoaded = true;
if (typeof componentNameArr !== 'object') {
return areLoaded;
}
for (var i = 0; i < componentNameArr.length; i++) {
if (!o.<API key>(componentNameArr[i])) { areLoaded = false; }
};
return areLoaded;
},
<API key>: function (componentName) {
var comp = this.getComponentByName(componentName);
return (comp && comp.isInstalled);
},
loadComponents : function(arr, path){
var o = this;
var componentName;
path = (typeof path === 'undefined') ? "rocketboots/" : path;
for (var i = 0, al = arr.length; i < al; i++){
componentName = arr[i];
if (typeof o.components[componentName] == "undefined") {
o.components[componentName] = new o.Component(componentName);
o.loadScript(path + arr[i], function(){
o.components[componentName].isLoaded = true;
});
} else {
//console.warn("Trying to load", componentName, "component that already exists.");
}
}
return this;
},
<API key> : function (arr, path) {
path = (typeof path === 'undefined') ? "" : path;
return this.loadComponents(arr, path);
},
<API key> : function(){
var o = this;
var componentCount = 0,
<API key> = 0;
for (var c in o.components) {
componentCount++;
if (o.components[c].isInstalled) <API key>++;
}
console.log("RB Components Installed: " + <API key> + "/" + componentCount);
return (<API key> >= componentCount);
},
ready : function(callback){
if (typeof callback == "function") {
if (this.isInitialized) {
callback(this);
} else {
this.readyFunctions.push(callback);
}
} else {
console.error("Ready argument (callback) not a function");
}
return this;
},
runReadyFunctions : function(){
var o = this;
// Loop over readyFunctions and run each one
var f, fn;
for (var i = 0; o.readyFunctions.length > 0; i++){
f = o.readyFunctions.splice(i,1);
fn = f[0];
fn(o);
}
return this;
},
init : function(attempt){
var o = this;
// TODO: allow dependecies to be injected rather than forcing them to be on the window scope
var isJQueryUndefined = (typeof $ === "undefined");
var isLodashUndefined = (typeof _ === "undefined");
var <API key> = isJQueryUndefined || isLodashUndefined;
if (typeof attempt === "undefined") {
attempt = 1;
} else if (attempt > o._MAX_ATTEMPTS) {
console.error("Could not initialize RocketBoots: too many attempts");
return false;
} else {
attempt++;
}
//console.log("RB Init", attempt, (<API key> ? "Waiting on required objects from external scripts" : ""));
if (!isJQueryUndefined) {
o.$ = $;
o.$('#' + o._BOOTING_ELEMENT_ID).show();
}
if (!isLodashUndefined) {
o._ = _;
o.each = o.forEach = _.each;
}
function tryAgain () {
// Clear previous to stop multiple inits from happening
window.clearTimeout(o._initTimer);
o._initTimer = window.setTimeout(function(){
o.init(attempt);
}, (attempt * 10));
}
// On first time through, do some things
if (attempt === 1) {
// Create "rb" alias
if (typeof window.rb !== "undefined") {
o._rb = window.rb;
}
window.rb = o;
// Aliases
o.window = window;
o.document = window.document;
// Load default components
// TODO: make this configurable
this.loadComponents(["Game"]);
// Load required scripts
if (isJQueryUndefined) {
o.loadScript("libs/jquery-2.2.4.min", function(){
//o.init(1);
});
}
if (isLodashUndefined) {
o.loadScript("libs/lodash.min", function(){ });
}
}
if (o.<API key>() && !<API key>) {
console.log("RB Init - All scripts and components are loaded.", o.loadedScripts, "\nRunning component callbacks...");
// TODO: These don't necessarily run in the correct order for requirements
o.each(o.components, function(component){
o.each(component.callbacks, function(callback){
console.log("Callback for", component.name);
callback(); // TODO: Make this run in the right context?
});
});
console.log("RB Init - Running Ready functions.\n");
o.$('#' + o._BOOTING_ELEMENT_ID).hide();
o.runReadyFunctions();
o.isInitialized = true;
return true;
}
tryAgain();
return false;
}
};
RocketBoots.init();
|
<?php
namespace ErenMustafaOzdal\LaravelModulesBase;
use Illuminate\Database\Eloquent\Model;
class Neighborhood extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'neighborhoods';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['neighborhood'];
public $timestamps = false;
/**
* Get the postal code of the district.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function postalCode()
{
return $this->hasOne('App\PostalCode');
}
/**
* get the neighborhood uc first
*
* @return string
*/
public function <API key>()
{
return ucfirst_tr($this->neighborhood);
}
}
|
#!/usr/bin/env python3
"""Utilities for manipulating blocks and transactions."""
import struct
import time
import unittest
from .address import (
key_to_p2sh_p2wpkh,
key_to_p2wpkh,
<API key>,
script_to_p2wsh,
)
from .messages import (
CBlock,
COIN,
COutPoint,
CTransaction,
CTxIn,
CTxInWitness,
CTxOut,
hash256,
ser_uint256,
tx_from_hex,
uint256_from_str,
)
from .script import (
CScript,
CScriptNum,
CScriptOp,
OP_1,
OP_CHECKMULTISIG,
OP_CHECKSIG,
OP_RETURN,
OP_TRUE,
)
from .script_util import (
<API key>,
<API key>,
)
from .util import assert_equal
<API key> = 4
MAX_BLOCK_SIGOPS = 20000
<API key> = MAX_BLOCK_SIGOPS * <API key>
# Genesis block time (regtest)
TIME_GENESIS_BLOCK = 1296688602
# Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
COINBASE_MATURITY = 100
# Soft-fork activation heights
DERSIG_HEIGHT = 102 # BIP 66
CLTV_HEIGHT = 111 # BIP 65
<API key> = 432
# From BIP141
<API key> = b"\xaa\x21\xa9\xed"
<API key> = {"rules": ["segwit"]}
<API key> = 4
def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl=None, txlist=None):
"""Create a block (with regtest difficulty)."""
block = CBlock()
if tmpl is None:
tmpl = {}
block.nVersion = version or tmpl.get('version') or <API key>
block.nTime = ntime or tmpl.get('curtime') or int(time.time() + 600)
block.hashPrevBlock = hashprev or int(tmpl['previousblockhash'], 0x10)
if tmpl and not tmpl.get('bits') is None:
block.nBits = struct.unpack('>I', bytes.fromhex(tmpl['bits']))[0]
else:
block.nBits = 0x207fffff # difficulty retargeting is disabled in REGTEST chainparams
if coinbase is None:
coinbase = create_coinbase(height=tmpl['height'])
block.vtx.append(coinbase)
if txlist:
for tx in txlist:
if not hasattr(tx, 'calc_sha256'):
tx = tx_from_hex(tx)
block.vtx.append(tx)
block.hashMerkleRoot = block.calc_merkle_root()
block.calc_sha256()
return block
def get_witness_script(witness_root, witness_nonce):
witness_commitment = uint256_from_str(hash256(ser_uint256(witness_root) + ser_uint256(witness_nonce)))
output_data = <API key> + ser_uint256(witness_commitment)
return CScript([OP_RETURN, output_data])
def <API key>(block, nonce=0):
"""Add a witness commitment to the block's coinbase transaction.
According to BIP141, blocks with witness rules active must commit to the
hash of all in-block transactions including witness."""
# First calculate the merkle root of the block's
# transactions, with witnesses.
witness_nonce = nonce
witness_root = block.<API key>()
# witness_nonce should go to coinbase witness.
block.vtx[0].wit.vtxinwit = [CTxInWitness()]
block.vtx[0].wit.vtxinwit[0].scriptWitness.stack = [ser_uint256(witness_nonce)]
# witness commitment is the last OP_RETURN output in coinbase
block.vtx[0].vout.append(CTxOut(0, get_witness_script(witness_root, witness_nonce)))
block.vtx[0].rehash()
block.hashMerkleRoot = block.calc_merkle_root()
block.rehash()
def <API key>(height):
if height <= 16:
res = CScriptOp.encode_op_n(height)
# Append dummy to increase scriptSig size above 2 (see bad-cb-length consensus rule)
return CScript([res, OP_1])
return CScript([CScriptNum(height)])
def create_coinbase(height, pubkey=None, extra_output_script=None, fees=0, nValue=50):
"""Create a coinbase transaction.
If pubkey is passed in, the coinbase output will be a P2PK output;
otherwise an anyone-can-spend output.
If extra_output_script is given, make a 0-value output to that
script. This is useful to pad block weight/sigops as needed. """
coinbase = CTransaction()
coinbase.vin.append(CTxIn(COutPoint(0, 0xffffffff), <API key>(height), 0xffffffff))
coinbaseoutput = CTxOut()
coinbaseoutput.nValue = nValue * COIN
if nValue == 50:
halvings = int(height / 150) # regtest
coinbaseoutput.nValue >>= halvings
coinbaseoutput.nValue += fees
if pubkey is not None:
coinbaseoutput.scriptPubKey = CScript([pubkey, OP_CHECKSIG])
else:
coinbaseoutput.scriptPubKey = CScript([OP_TRUE])
coinbase.vout = [coinbaseoutput]
if extra_output_script is not None:
coinbaseoutput2 = CTxOut()
coinbaseoutput2.nValue = 0
coinbaseoutput2.scriptPubKey = extra_output_script
coinbase.vout.append(coinbaseoutput2)
coinbase.calc_sha256()
return coinbase
def <API key>(prevtx, n, script_sig=b"", *, amount, script_pub_key=CScript()):
"""Return one-input, one-output transaction object
spending the prevtx's n-th output with the given amount.
Can optionally pass scriptPubKey and scriptSig, default is anyone-can-spend output.
"""
tx = CTransaction()
assert n < len(prevtx.vout)
tx.vin.append(CTxIn(COutPoint(prevtx.sha256, n), script_sig, 0xffffffff))
tx.vout.append(CTxOut(amount, script_pub_key))
tx.calc_sha256()
return tx
def create_transaction(node, txid, to_address, *, amount):
""" Return signed transaction spending the first output of the
input txid. Note that the node must have a wallet that can
sign for the output that is being spent.
"""
raw_tx = <API key>(node, txid, to_address, amount=amount)
tx = tx_from_hex(raw_tx)
return tx
def <API key>(node, txid, to_address, *, amount):
""" Return raw signed transaction spending the first output of the
input txid. Note that the node must have a wallet that can sign
for the output that is being spent.
"""
psbt = node.createpsbt(inputs=[{"txid": txid, "vout": 0}], outputs={to_address: amount})
for _ in range(2):
for w in node.listwallets():
wrpc = node.get_wallet_rpc(w)
signed_psbt = wrpc.walletprocesspsbt(psbt)
psbt = signed_psbt['psbt']
final_psbt = node.finalizepsbt(psbt)
assert_equal(final_psbt["complete"], True)
return final_psbt['hex']
def <API key>(block, accurate=True):
count = 0
for tx in block.vtx:
count += <API key>(tx, accurate)
return count
def <API key>(tx, accurate=True):
count = 0
for i in tx.vout:
count += i.scriptPubKey.GetSigOpCount(accurate)
for j in tx.vin:
# scriptSig might be of type bytes, so convert to CScript for the moment
count += CScript(j.scriptSig).GetSigOpCount(accurate)
return count
def witness_script(use_p2wsh, pubkey):
"""Create a scriptPubKey for a pay-to-witness TxOut.
This is either a P2WPKH output for the given pubkey, or a P2WSH output of a
1-of-1 multisig for the given pubkey. Returns the hex encoding of the
scriptPubKey."""
if not use_p2wsh:
# P2WPKH instead
pkscript = <API key>(pubkey)
else:
# 1-of-1 multisig
witness_script = CScript([OP_1, bytes.fromhex(pubkey), OP_1, OP_CHECKMULTISIG])
pkscript = <API key>(witness_script)
return pkscript.hex()
def create_witness_tx(node, use_p2wsh, utxo, pubkey, encode_p2sh, amount):
"""Return a transaction (in hex) that spends the given utxo to a segwit output.
Optionally wrap the segwit output using P2SH."""
if use_p2wsh:
program = CScript([OP_1, bytes.fromhex(pubkey), OP_1, OP_CHECKMULTISIG])
addr = <API key>(program) if encode_p2sh else script_to_p2wsh(program)
else:
addr = key_to_p2sh_p2wpkh(pubkey) if encode_p2sh else key_to_p2wpkh(pubkey)
if not encode_p2sh:
assert_equal(node.getaddressinfo(addr)['scriptPubKey'], witness_script(use_p2wsh, pubkey))
return node.<API key>([utxo], {addr: amount})
def send_to_witness(use_p2wsh, node, utxo, pubkey, encode_p2sh, amount, sign=True, <API key>=""):
"""Create a transaction spending a given utxo to a segwit output.
The output corresponds to the given pubkey: use_p2wsh determines whether to
use P2WPKH or P2WSH; encode_p2sh determines whether to wrap in P2SH.
sign=True will have the given node sign the transaction.
<API key> will be added to the scriptSig, if given."""
tx_to_witness = create_witness_tx(node, use_p2wsh, utxo, pubkey, encode_p2sh, amount)
if (sign):
signed = node.<API key>(tx_to_witness)
assert "errors" not in signed or len(["errors"]) == 0
return node.sendrawtransaction(signed["hex"])
else:
if (<API key>):
tx = tx_from_hex(tx_to_witness)
tx.vin[0].scriptSig += CScript([bytes.fromhex(<API key>)])
tx_to_witness = tx.serialize().hex()
return node.sendrawtransaction(tx_to_witness)
class <API key>(unittest.TestCase):
def <API key>(self):
height = 20
coinbase_tx = create_coinbase(height=height)
assert_equal(CScriptNum.decode(coinbase_tx.vin[0].scriptSig), height)
|
#include "StdAfx.h"
#include "Distance Joint Description.h"
#include "Spring Description.h"
#include "Distance Joint.h"
#include <NxDistanceJointDesc.h>
using namespace StillDesign::PhysX;
<API key>::<API key>() : JointDescription( new NxDistanceJointDesc() )
{
}
<API key>::<API key>( NxDistanceJointDesc* desc ) : JointDescription( desc )
{
}
float <API key>::MinimumDistance::get()
{
return this->UnmanagedPointer->minDistance;
}
void <API key>::MinimumDistance::set( float value )
{
this->UnmanagedPointer->minDistance = value;
}
float <API key>::MaximumDistance::get()
{
return this->UnmanagedPointer->maxDistance;
}
void <API key>::MaximumDistance::set( float value )
{
this->UnmanagedPointer->maxDistance = value;
}
SpringDescription <API key>::Spring::get()
{
return (SpringDescription)this->UnmanagedPointer->spring;
}
void <API key>::Spring::set( SpringDescription value )
{
this->UnmanagedPointer->spring = (NxSpringDesc)value;
}
DistanceJointFlag <API key>::Flags::get()
{
return (DistanceJointFlag)this->UnmanagedPointer->flags;
}
void <API key>::Flags::set( DistanceJointFlag value )
{
this->UnmanagedPointer->flags = (NxDistanceJointFlag)value;
}
NxDistanceJointDesc* <API key>::UnmanagedPointer::get()
{
return (NxDistanceJointDesc*)JointDescription::UnmanagedPointer;
}
|
using UnityEngine;
using UnityEditor;
using System.Collections;
using UForms.Attributes;
namespace UForms.Controls.Fields
{
<summary>
</summary>
[ExposeControl( "Object Field", "Fields" )]
public class ObjectField : AbstractField< Object >
{
<summary>
</summary>
protected override Vector2 DefaultSize
{
get { return new Vector2( 200.0f, 16.0f ); }
}
<summary>
</summary>
protected override bool <API key>
{
get { return true; }
}
<summary>
</summary>
public System.Type Type { get; set; }
<summary>
</summary>
public bool AllowSceneObjects { get; set; }
public ObjectField() : base ()
{
}
<summary>
</summary>
<param name="type"></param>
<param name="allowSceneObjects"></param>
<param name="value"></param>
<param name="label"></param>
public ObjectField( System.Type type, bool allowSceneObjects = false, Object value = null, string label = "" ) : base( value, label )
{
Type = type;
AllowSceneObjects = allowSceneObjects;
}
<summary>
</summary>
<param name="position"></param>
<param name="size"></param>
<param name="type"></param>
<param name="allowSceneObjects"></param>
<param name="value"></param>
<param name="label"></param>
public ObjectField( Vector2 position, Vector2 size, System.Type type, bool allowSceneObjects = false, Object value = null, string label = "" ) : base( position, size, value, label )
{
Type = type;
AllowSceneObjects = allowSceneObjects;
}
<summary>
</summary>
<returns></returns>
protected override Object DrawAndUpdateValue()
{
return EditorGUI.ObjectField( ScreenRect, Label, m_cachedValue, Type, AllowSceneObjects );
}
<summary>
</summary>
<param name="oldval"></param>
<param name="newval"></param>
<returns></returns>
protected override bool TestValueEquality( Object oldval, Object newval )
{
if ( oldval == null || newval == null )
{
if ( oldval == null && newval == null )
{
return true;
}
return false;
}
return oldval.Equals( newval );
}
}
}
|
using Microsoft.AspNetCore.Http;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.Extensions.Primitives;
using System.Globalization;
namespace TCPServer.ServerImplemetation
{
class TCPRequest : HttpRequest
{
private TCPRequest()
{
}
public static async Task<TCPRequest> Parse(TCPStream input, bool includeHeaders)
{
var r = new TCPRequest();
await r.ParseCore(input, includeHeaders).ConfigureAwait(false);
return r;
}
private async Task ParseCore(TCPStream stream, bool includeHeaders)
{
Method = await stream.ReadStringAync().ConfigureAwait(false);
var requestUri = await stream.ReadStringAync().ConfigureAwait(false);
var uri = new Uri(requestUri);
Scheme = uri.Scheme;
IsHttps = false;
Host = new HostString(uri.Host, uri.Port);
PathBase = new PathString(uri.AbsolutePath);
Path = new PathString(uri.AbsolutePath);
QueryString = new QueryString(uri.Query);
Query = new QueryCollection(Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query));
Protocol = "http";
if(includeHeaders)
{
var headers = new List<Tuple<string, string>>();
var headersCount = await stream.ReadVarIntAsync().ConfigureAwait(false);
for(int i = 0; i < (int)headersCount; i++)
{
var key = await stream.ReadStringAync().ConfigureAwait(false);
var value = await stream.ReadStringAync().ConfigureAwait(false);
headers.Add(Tuple.Create(key, value));
}
foreach(var h in headers.GroupBy(g => g.Item1, g => g.Item2))
{
Headers.Add(h.Key, new StringValues(h.ToArray()));
}
}
var hasContent = (await stream.ReadVarIntAsync().ConfigureAwait(false)) == 1;
if(hasContent)
{
var buffer = await stream.ReadBytesAync(TCPStream.ReadType.ManagedPool).ConfigureAwait(false);
Body = new MemoryStream(buffer.Array);
Body.SetLength(buffer.Count);
ContentLength = buffer.Count;
}
}
HttpContext _HttpContext;
public void SetHttpContext(HttpContext context)
{
if(context == null)
throw new <API key>(nameof(context));
_HttpContext = context;
}
public override HttpContext HttpContext => _HttpContext;
public override string Method
{
get;
set;
}
public override string Scheme
{
get;
set;
}
public override bool IsHttps
{
get;
set;
}
public override HostString Host
{
get;
set;
}
public override PathString PathBase
{
get;
set;
}
public override PathString Path
{
get;
set;
}
public override QueryString QueryString
{
get;
set;
}
public override IQueryCollection Query
{
get;
set;
}
public override string Protocol
{
get;
set;
}
IHeaderDictionary _Headers = new HeaderDictionary();
public override IHeaderDictionary Headers => _Headers;
public override <API key> Cookies
{
get;
set;
} = new <API key>();
public override long? ContentLength
{
get
{
StringValues value;
if(!Headers.TryGetValue("Content-Length", out value))
return null;
return long.Parse(value.FirstOrDefault(), CultureInfo.InvariantCulture);
}
set
{
Headers.Remove("Content-Length");
if(value != null)
Headers.Add("Content-Length", value.Value.ToString(CultureInfo.InvariantCulture));
}
}
public override string ContentType
{
get
{
StringValues value;
if(!Headers.TryGetValue("Content-Type", out value))
return null;
return value.FirstOrDefault();
}
set
{
Headers.Remove("Content-Type");
if(value != null)
Headers.Add("Content-Type", new StringValues(value));
}
}
public override Stream Body
{
get;
set;
}
public override bool HasFormContentType => false;
public override IFormCollection Form
{
get;
set;
}
FormCollection _ReadFormAsync = new FormCollection(new Dictionary<string, Microsoft.Extensions.Primitives.StringValues>());
public override Task<IFormCollection> ReadFormAsync(Cancellation<API key> = default(CancellationToken))
{
return Task.FromResult<IFormCollection>(_ReadFormAsync);
}
}
}
|
<?php
namespace VirtualPersistAPI\<API key>\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
class <API key> extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this-><API key>($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}
|
import { Selector } from 'testcafe'
import { ROOT_URL, login } from '../e2e/utils'
// <API key>
fixture`imported data check`.beforeEach(async (t /*: TestController */) => {
await t.<API key>(() => true)
await t.navigateTo(`${ROOT_URL}/login`)
await login(t)
})
test('wait entry', async (t /*: TestController */) => {
await t
.expect(Selector('a').withText('Ask HN: single comment').exists)
.ok({ timeout: 20000 })
})
|
layout: post
date: '2016-12-21'
title: "Compelling Strapless Sleeveless Full Back Floor Length Satin Sheath Wedding Dress "
category: Wedding Dress
tags: ["dress","full","floor","length","bride"]
image: http:
Compelling Strapless Sleeveless Full Back Floor Length Satin Sheath Wedding Dress
On Sales: **$195.594**
<a href="https:
<a href="https:
Buy it: [Compelling Strapless Sleeveless Full Back Floor Length Satin Sheath Wedding Dress ](https:
View more: [Wedding Dress](https:
|
<div itemprop="description" class="col-12">
<div [innerHTML]="description | sanitizeHtml"></div>
</div>
|
# This program is free software; you can redistribute it and/or modify it
# This program is distributed in the hope that it will be useful, but
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# This plugin is to monitor queue lengths in Redis. Based on redis_info.py by
# Garret Heaton <powdahound at gmail.com>, hence the GPL at the top.
import collectd
from contextlib import closing, contextmanager
import socket
# Host to connect to. Override in config by specifying 'Host'.
REDIS_HOST = 'localhost'
# Port to connect on. Override in config by specifying 'Port'.
REDIS_PORT = 6379
# Verbose logging on/off. Override in config by specifying 'Verbose'.
VERBOSE_LOGGING = False
# Queue names to monitor. Override in config by specifying 'Queues'.
QUEUE_NAMES = []
def fetch_queue_lengths(queue_names):
"""Connect to Redis server and request queue lengths.
Return a dictionary from queue names to integers.
"""
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((REDIS_HOST, REDIS_PORT))
log_verbose('Connected to Redis at %s:%s' % (REDIS_HOST, REDIS_PORT))
except socket.error, e:
collectd.error('redis_queues plugin: Error connecting to %s:%d - %r'
% (REDIS_HOST, REDIS_PORT, e))
return None
queue_lengths = {}
with closing(s) as redis_socket:
for queue_name in queue_names:
log_verbose('Requesting length of queue %s' % queue_name)
redis_socket.sendall('llen %s\r\n' % queue_name)
with closing(redis_socket.makefile('r')) as response_file:
response = response_file.readline()
if response.startswith(':'):
try:
queue_lengths[queue_name] = int(response[1:-1])
except ValueError:
log_verbose('Invalid response: %r' % response)
else:
log_verbose('Invalid response: %r' % response)
return queue_lengths
def configure_callback(conf):
"""Receive configuration block"""
global REDIS_HOST, REDIS_PORT, VERBOSE_LOGGING, QUEUE_NAMES
for node in conf.children:
if node.key == 'Host':
REDIS_HOST = node.values[0]
elif node.key == 'Port':
REDIS_PORT = int(node.values[0])
elif node.key == 'Verbose':
VERBOSE_LOGGING = bool(node.values[0])
elif node.key == 'Queues':
QUEUE_NAMES = list(node.values)
else:
collectd.warning('redis_queues plugin: Unknown config key: %s.'
% node.key)
log_verbose('Configured with host=%s, port=%s' % (REDIS_HOST, REDIS_PORT))
for queue in QUEUE_NAMES:
log_verbose('Watching queue %s' % queue)
if not QUEUE_NAMES:
log_verbose('Not watching any queues')
def read_callback():
log_verbose('Read callback called')
queue_lengths = fetch_queue_lengths(QUEUE_NAMES)
if queue_lengths is None:
# An earlier error, reported to collectd by fetch_queue_lengths
return
for queue_name, queue_length in queue_lengths.items():
log_verbose('Sending value: %s=%s' % (queue_name, queue_length))
val = collectd.Values(plugin='redis_queues')
val.type = 'gauge'
val.type_instance = queue_name
val.values = [queue_length]
val.dispatch()
def log_verbose(msg):
if not VERBOSE_LOGGING:
return
collectd.info('redis plugin [verbose]: %s' % msg)
# register callbacks
collectd.register_config(configure_callback)
collectd.register_read(read_callback)
|
from .DiscreteFactor import State, DiscreteFactor
from .CPD import TabularCPD
from .<API key> import <API key>
__all__ = ['TabularCPD',
'DiscreteFactor',
'State'
]
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dev to DevOps</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="<API key>" content="yes" />
<meta name="<API key>" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/sky.css" id="theme">
<link rel="stylesheet" href="css/dev2devops.css">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]
</head>
<body>
<div class='screen-logo'>
<div style='position: absolute; left: 20px; bottom: 20px; opacity: 0.5;'>
<img src='img/<API key>.png' width='250'>
</div>
</div>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h3>Intro to DevOps</h3>
<p>Hi, my name is Dinshaw.</p>
</section>
<section>
<h2>Computers</h2>
<p>The cause of – and the solution to – all of life's problems.</p>
</section>
<section>
<h2>A Brief History of Computing</h2>
</section>
<section>
<img src="img/colosus.jpg">
<h3>Mainframe</h3>
</section>
<section>
<img src="img/punch-cards.jpg">
<h3>Punch Cards</h3>
</section>
<section>
<img src="img/computer.jpg">
<h3>Personal Computers</h3>
</section>
<section class='the-wall-goes-up'>
<h3><span>Users . . .</span> The Wall <span>. . . Operations</span></h3>
</section>
<section>
<img src="img/patrick.jpg">
<h3>Patrick Dubois</h3>
<p>The 'Godfather' of DevOps</p>
</section>
<section>
<h3>10+ Deploys Per Day:</h3>
<h3>Dev and Ops Cooperation at Flickr</h3>
<p>John Allspaw and Paul Hammond</p>
<p>@ Velocity Conference 2009, San Jose</p>
</section>
<section>
<img src="img/spock-scotty.jpg">
</section>
<section>
<h1>#devops</h1>
</section>
<section>
<img src='img/culture.jpg'>
<h3>Culture</h3>
</section>
<section>
<img src='img/computer.jpg'>
<h3>Tools</h3>
</section>
<section>
<h3>... habits [tools & culture] that allow us to survive in <em><strong>The Danger Zone</strong></em>.</h3>
</section>
<section>
<h3>TurboTax</h3>
<p>165 new-feature experiments in the 3 month tax season</p>
<p><a href="http://network.intuit.com/2011/04/20/<API key>/">Economist conference 2011</a></p>
</section>
<section>
<h3>Puppet: State of DevOps Report</h3>
<p>'DevOps' up 50% on Linkedin keyword searches</p>
</section>
<section>
<h3>Puppet: What is a DevOps Engineer?</h3>
<ul>
<li class='fragment'>Coding/Scripting</li>
<li class='fragment'>Strong grasp of automation tools</li>
<li class='fragment'>Process re-engineering</li>
<li class='fragment'>A focus on business outcomes</li>
<li class='fragment'>Communication & Collaboration</li>
</ul>
</section>
<section>
<h2>Questions?</h2>
</section>
<section>
<h2>Puppet & Chef</h2>
<ul>
<li>Configuration Management</li>
<li>Portable</li>
<li>Repeatable</li>
</ul>
</section>
<section>
<h2>Puppet</h2>
<ul>
<li>http://puppetlabs.com/</li>
<li>Ruby-like</li>
<li>Modules @ Puppet Forge</li>
</ul>
<pre>
<code>
package { "gtypist":
ensure => installed,
provider => homebrew,
}
package { "redis":
ensure => installed,
provider => homebrew,
}
</code>
</pre>
</section>
<section>
<h2>Chef</h2>
<ul>
<li>http:
<li>Opscode</li>
<li>Ruby</li>
<li>Cookbooks @ Opscode Community</li>
</ul>
<pre>
<code>
package "mysql" do
action :install
end
package "redis" do
action :install
end
</code>
</pre>
</section>
<section>
<h2>Vagrant</h2>
<p>http:
<pre>
<code>
Vagrant.configure do |config|
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = "my_manifests"
puppet.manifest_file = "default.pp"
end
end
</code>
</pre>
</section>
<section>
<h2>You build it; you run it.</h2>
<p>Deliver working code AND the environment it runs in.</p>
</section>
<section>
<h2>T.D.D.</h2>
<div>
<blockquote>
"If you tell the truth, you don't have to remember anything."
</blockquote>
<small class="author">- Mark Twain</small>
</div>
<p>Dev and Test are no longer separable</p>
</section>
<section>
<h2>What we need from Ops</h2>
<ul>
<li class='fragment'>One button environment</li>
<li class='fragment'>One button deploy</li>
</ul>
</section>
<section>
<h3>First Steps:</h3>
<ul>
<li class='fragment'>Automate something simple</li>
<ul>
<li class='fragment'>White space</li>
<li class='fragment'>Dev Log rotation</li>
<li class='fragment'><a href="http://dotfiles.github.io/">.Dotfiles</a></li>
</ul>
<li class='fragment'>Automate something not-so-simple</li>
<ul>
<li class='fragment'>Development machine configuration</li>
<li class='fragment'>Production configuration</li>
</ul>
</ul>
</section>
<section>
<h3>Questions?</h3>
</section>
<section>
<h2>Google SRE</h2>
<p class='fragment'>Hand-off Readiness Review</p>
<ul>
<li class='fragment'>Types/Frequency of defects</li>
<li class='fragment'>Maturity of monitoring</li>
<li class='fragment'>Release process</li>
</ul>
</section>
<section>
<h2><a href="http://techblog.netflix.com/2012/07/<API key>.html">Netflix: Chaos Monkey</a></h2>
<p>April 21st, 2011 Amazon Web Service outage</p>
<p>Netfilx maintained availability</p>
</section>
<section>
<h2><a href="https://blog.twitter.com/2010/<API key>">Twitter Murder!</a></h2>
<p class='fragment'>40 minute to 12 seconds!</p>
</section>
<section>
<h2><a href="http:
<p>Automating common operational tasks with Hu-Bot</p>
<img src='img/hu-bot.jpg'>
</section>
<section>
<h3>
<a href='http://assets.en.oreilly.com/1/event/60/Velocity%20Culture%20Presentation.pdf'>Amazon @ O'rily Velocity Conf. 2011</a>
</h3>
<ul>
<li class='fragment'>A deploy every 11.6 seconds</li>
<li class='fragment'>Max deployments per hour: 10,000</li>
<li class='fragment'>30,000 hosts simultaneously receiving a deployment</li>
</ul>
</section>
<section class='links'>
<ul>
<li><a href="http:
<li><a href='http://velocityconf.com/velocity2009'>Velocity Conference 2009, San Jose</a></li>
<li><a href='http://velocityconference.blip.tv/file/2284377/'>10+ Deploys Per Day: Dev and Ops Cooperation at Flickr</a></li>
<li><a href='http://continuousdelivery.com/2012/10/<API key>/'>No such thing as a DevOps team</a></li>
<li><a href='http:
<li><a href='http://info.puppetlabs.com/<API key>.html'>State of DevOps 2013 - Puppet Report</a></li>
<li><a href="http://network.intuit.com/2011/04/20/<API key>/">Scott Cook on TurboTax @ Economist conference 2011</a></li>
<li><a href="http://dotfiles.github.io/">.Dotfiles</a></li>
<li><a href="http://docs.puppetlabs.com/learning/">Learning Puppet</a></li>
<li><a href="http://forge.puppetlabs.com/">Puppet Forge</a></li>
<li><a href='http://boxen.github.com/'>Boxen</a></li>
<li><a href="http://vimeo.com/61172067">Boxen presentation: Managing an army of laptops</a></li>
<li><a href='http:
<li><a href="http://docs.opscode.com/">Learning Chef</a></li>
<li><a href="https://github.com/opscode-cookbooks">Chef Cookbooks</a></li>
<li><a href='http:
<li><a href="http://techblog.netflix.com/2012/07/<API key>.html">Netflix: Chaos Monkey</a></li>
<li><a href="https://blog.twitter.com/2010/<API key>">Twitter Murder!</a></li>
<li><a href="http:
<li><a href="http://assets.en.oreilly.com/1/event/60/Velocity%20Culture%20Presentation.pdf">Amazon: A deploy every 11 seconds slides</a></li>
<li><a href='http://vimeo.com/61172067'>Managing an Army of Laptops with Puppet</a></li>
<li><a href='http:
</ul>
</section>
<section>
<p>Intro to DevOps</p>
<p>Dinshaw Gobhai | <a href="mailto:dgobhai@constantcontact.com">dgobhai@constantcontact.com</a></p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
// { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
// { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.<API key>(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// { src: 'plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } }
// { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</head>
</html>
|
/*
Ql builtin and external frmt command.
format text
*/
package frmt
import (
"clive/cmd"
"clive/cmd/opt"
"clive/nchan"
"clive/zx"
"errors"
"fmt"
"io"
"strings"
"unicode"
)
type parFmt {
rc chan string
ec chan bool
}
func startPar(out io.Writer, indent0, indent string, max int) *parFmt {
rc := make(chan string)
ec := make(chan bool, 1)
wc := make(chan string)
pf := &parFmt{rc, ec}
go func() {
for s := range rc {
if s == "\n" {
wc <- s
continue
}
words := strings.Fields(strings.TrimSpace(s))
for _, w := range words {
wc <- w
}
}
close(wc)
}()
go func() {
pos, _ := fmt.Fprintf(out, "%s", indent0)
firstword := true
lastword := "x"
for w := range wc {
if len(w) == 0 {
continue
}
if w == "\n" {
fmt.Fprintf(out, "\n")
firstword = true
pos = 0
continue
}
if pos+len(w)+1 > max {
fmt.Fprintf(out, "\n")
pos, _ = fmt.Fprintf(out, "%s", indent)
firstword = true
}
if !firstword && len(w)>0 && !unicode.IsPunct(rune(w[0])) {
lastr := rune(lastword[len(lastword)-1])
if !strings.ContainsRune("([{", lastr) {
fmt.Fprintf(out, " ")
pos++
}
}
fmt.Fprintf(out, "%s", w)
pos += len(w)
firstword = false
lastword = w
}
if !firstword {
fmt.Fprintf(out, "\n")
}
close(ec)
}()
return pf
}
func (pf *parFmt) WriteString(s string) {
pf.rc <- s
}
func (pf *parFmt) Close() {
if pf == nil {
return
}
close(pf.rc)
<-pf.ec
}
type xCmd {
*cmd.Ctx
*opt.Flags
wid int
}
func tabsOf(s string) int {
for i := 0; i < len(s); i++ {
if s[i] != '\t' {
return i
}
}
return 0
}
func (x *xCmd) RunFile(d zx.Dir, dc <-chan []byte) error {
if dc == nil {
return nil
}
rc := nchan.Lines(dc, '\n')
var pf *parFmt
ntabs := 0
tabs := ""
doselect {
case <-x.Intrc:
close(rc, "interrupted")
pf.Close()
return errors.New("interrupted")
case s, ok := <-rc:
if !ok {
pf.Close()
return cerror(rc)
}
if s=="\n" || s=="" {
pf.Close()
pf = nil
x.Printf("\n")
continue
}
nt := tabsOf(s)
if nt != ntabs {
pf.Close()
pf = nil
ntabs = nt
tabs = strings.Repeat("\t", ntabs)
}
if pf == nil {
pf = startPar(x.Stdout, tabs, tabs, x.wid)
}
pf.WriteString(s)
}
pf.Close()
if err := cerror(rc); err != nil {
return err
}
return nil
}
func Run(c cmd.Ctx) (err error) {
argv := c.Args
x := &xCmd{Ctx: &c}
x.Flags = opt.New("{file}")
x.Argv0 = argv[0]
x.NewFlag("w", "wid: set max line width", &x.wid)
args, err := x.Parse(argv)
if err != nil {
x.Usage(x.Stderr)
return err
}
if x.wid < 10 {
x.wid = 70
}
if cmd.Ns == nil {
cmd.MkNS()
}
return cmd.RunFiles(x, args...)
}
|
({
baseUrl: "../linesocial/public/js",
paths: {
jquery: "public/js/libs/jquery-1.9.1.js"
},
name: "main",
out: "main-built.js"
})
|
<?php
namespace Usolv\TrackingBundle\Form\Model;
use Doctrine\Common\Collections\ArrayCollection;
class TimeRecordSearch
{
protected $project;
public function setProject($project)
{
$this->project = $project;
return $this;
}
public function getProject()
{
return $this->project;
}
}
|
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Fieldset, Layout
from django import forms
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.db import transaction
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
from django_filters import FilterSet
from easy_select2 import Select2
from crispy_layout_mixin import form_actions, to_row
from utils import (TIPO_TELEFONE, YES_NO_CHOICES, get_medicos,
get_or_create_grupo)
from .models import Especialidade, EspecialidadeMedico, Usuario
class <API key>(FilterSet):
class Meta:
model = EspecialidadeMedico
fields = ['especialidade']
def __init__(self, *args, **kwargs):
super(<API key>, self).__init__(*args, **kwargs)
row1 = to_row([('especialidade', 12)])
self.form.helper = FormHelper()
self.form.helper.form_method = 'GET'
self.form.helper.layout = Layout(
Fieldset(_('Pesquisar Médico'),
row1, form_actions(save_label='Filtrar'))
)
class MudarSenhaForm(forms.Form):
nova_senha = forms.CharField(
label="Nova Senha", max_length=30,
widget=forms.PasswordInput(
attrs={'class': 'form-control form-control-lg',
'name': 'senha',
'placeholder': 'Nova Senha'}))
confirmar_senha = forms.CharField(
label="Confirmar Senha", max_length=30,
widget=forms.PasswordInput(
attrs={'class': 'form-control form-control-lg',
'name': 'confirmar_senha',
'placeholder': 'Confirmar Senha'}))
class LoginForm(AuthenticationForm):
username = forms.CharField(
label="Username", max_length=30,
widget=forms.TextInput(
attrs={'class': 'form-control form-control-lg',
'name': 'username',
'placeholder': 'Usuário'}))
password = forms.CharField(
label="Password", max_length=30,
widget=forms.PasswordInput(
attrs={'class': 'form-control',
'name': 'password',
'placeholder': 'Senha'}))
class UsuarioForm(ModelForm):
password = forms.CharField(
max_length=20,
label=_('Senha'),
widget=forms.PasswordInput())
password_confirm = forms.CharField(
max_length=20,
label=_('Confirmar Senha'),
widget=forms.PasswordInput())
class Meta:
model = Usuario
fields = ['username', 'email', 'nome', 'password', 'password_confirm',
'data_nascimento', 'sexo', 'plano', 'tipo', 'cep', 'end',
'numero', 'complemento', 'bairro', 'referencia',
'primeiro_telefone', 'segundo_telefone']
widgets = {'email': forms.TextInput(
attrs={'style': 'text-transform:lowercase;'})}
def __init__(self, *args, **kwargs):
super(UsuarioForm, self).__init__(*args, **kwargs)
self.fields['primeiro_telefone'].widget.attrs['class'] = 'telefone'
self.fields['segundo_telefone'].widget.attrs['class'] = 'telefone'
def valida_igualdade(self, texto1, texto2, msg):
if texto1 != texto2:
raise ValidationError(msg)
return True
def clean(self):
if ('password' not in self.cleaned_data or
'password_confirm' not in self.cleaned_data):
raise ValidationError(_('Favor informar senhas atuais ou novas'))
msg = _('As senhas não conferem.')
self.valida_igualdade(
self.cleaned_data['password'],
self.cleaned_data['password_confirm'],
msg)
try:
validate_password(self.cleaned_data['password'])
except ValidationError as error:
raise ValidationError(error)
return self.cleaned_data
@transaction.atomic
def save(self, commit=False):
usuario = super(UsuarioForm, self).save(commit)
# Cria User
u = User.objects.create(username=usuario.username, email=usuario.email)
u.set_password(self.cleaned_data['password'])
u.is_active = True
u.groups.add(get_or_create_grupo(self.cleaned_data['tipo'].descricao))
u.save()
usuario.user = u
usuario.save()
return usuario
class UsuarioEditForm(ModelForm):
# Primeiro Telefone
primeiro_tipo = forms.ChoiceField(
widget=forms.Select(),
choices=TIPO_TELEFONE,
label=_('Tipo Telefone'))
primeiro_ddd = forms.CharField(max_length=2, label=_('DDD'))
primeiro_numero = forms.CharField(max_length=10, label=_('Número'))
primeiro_principal = forms.TypedChoiceField(
widget=forms.Select(),
label=_('Telefone Principal?'),
choices=YES_NO_CHOICES)
# Primeiro Telefone
segundo_tipo = forms.ChoiceField(
required=False,
widget=forms.Select(),
choices=TIPO_TELEFONE,
label=_('Tipo Telefone'))
segundo_ddd = forms.CharField(required=False, max_length=2, label=_('DDD'))
segundo_numero = forms.CharField(
required=False, max_length=10, label=_('Número'))
segundo_principal = forms.ChoiceField(
required=False,
widget=forms.Select(),
label=_('Telefone Principal?'),
choices=YES_NO_CHOICES)
class Meta:
model = Usuario
fields = ['username', 'email', 'nome', 'data_nascimento', 'sexo',
'plano', 'tipo', 'cep', 'end', 'numero', 'complemento',
'bairro', 'referencia', 'primeiro_telefone',
'segundo_telefone']
widgets = {'username': forms.TextInput(attrs={'readonly': 'readonly'}),
'email': forms.TextInput(
attrs={'style': 'text-transform:lowercase;'}),
}
def __init__(self, *args, **kwargs):
super(UsuarioEditForm, self).__init__(*args, **kwargs)
self.fields['primeiro_telefone'].widget.attrs['class'] = 'telefone'
self.fields['segundo_telefone'].widget.attrs['class'] = 'telefone'
def valida_igualdade(self, texto1, texto2, msg):
if texto1 != texto2:
raise ValidationError(msg)
return True
def <API key>(self):
cleaned_data = self.cleaned_data
telefone = Telefone()
telefone.tipo = self.data['primeiro_tipo']
telefone.ddd = self.data['primeiro_ddd']
telefone.numero = self.data['primeiro_numero']
telefone.principal = self.data['primeiro_principal']
cleaned_data['primeiro_telefone'] = telefone
return cleaned_data
def <API key>(self):
cleaned_data = self.cleaned_data
telefone = Telefone()
telefone.tipo = self.data['segundo_tipo']
telefone.ddd = self.data['segundo_ddd']
telefone.numero = self.data['segundo_numero']
telefone.principal = self.data['segundo_principal']
cleaned_data['segundo_telefone'] = telefone
return cleaned_data
@transaction.atomic
def save(self, commit=False):
usuario = super(UsuarioEditForm, self).save(commit)
# Primeiro telefone
tel = usuario.primeiro_telefone
tel.tipo = self.data['primeiro_tipo']
tel.ddd = self.data['primeiro_ddd']
tel.numero = self.data['primeiro_numero']
tel.principal = self.data['primeiro_principal']
tel.save()
usuario.primeiro_telefone = tel
# Segundo telefone
tel = usuario.segundo_telefone
if tel:
tel.tipo = self.data['segundo_tipo']
tel.ddd = self.data['segundo_ddd']
tel.numero = self.data['segundo_numero']
tel.principal = self.data['segundo_principal']
tel.save()
usuario.segundo_telefone = tel
# User
u = usuario.user
u.email = usuario.email
u.groups.remove(u.groups.first())
u.groups.add(get_or_create_grupo(self.cleaned_data['tipo'].descricao))
u.save()
usuario.save()
return usuario
class <API key>(ModelForm):
medico = forms.ModelChoiceField(
queryset=get_medicos(),
widget=Select2(select2attrs={'width': '535px'}))
especialidade = forms.ModelChoiceField(
queryset=Especialidade.objects.all(),
widget=Select2(select2attrs={'width': '535px'}))
class Meta:
model = EspecialidadeMedico
fields = ['especialidade', 'medico']
|
<!DOCTYPE html><html><head><meta charset=utf-8><meta itemprop=name content=ESS_><meta name=keywords content=", "><meta name=description content=", , , "><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel=icon href=./logo.png><link href=/static/css/app.<API key>.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.<API key>.js></script><script type=text/javascript src=/static/js/vendor.<API key>.js></script><script type=text/javascript src=/static/js/app.<API key>.js></script></body><script src=//at.alicdn.com/t/<API key>.js></script></html>
|
/* exported Qualifications */
function Qualifications(skills, items) {
var requirements = {
'soldier': {
meta: {
passPercentage: 100
},
classes: {
'Heavy Assault': {
certifications: [
{ skill: skills.heavyAssault.flakArmor, level: 3 }
],
equipment: []
},
'Light Assault': {
certifications: [
{ skill: skills.lightAssault.flakArmor, level: 3 }
],
equipment: []
},
'Engineer': {
certifications: [
{ skill: skills.engineer.flakArmor, level: 3 },
{ skill: skills.engineer.nanoArmorKit, level: 4 },
{ skill: skills.engineer.tankMine, level: 1 }
],
equipment: []
},
'Medic': {
certifications: [
{ skill: skills.medic.flakArmor, level: 3 },
{ skill: skills.medic.medicalApplicator, level: 4 }
],
equipment: []
},
'Infiltrator': {
certifications: [
{ skill: skills.infiltrator.flakArmor, level: 3 }
],
equipment: []
},
'Sunderer': {
certifications: [
{ skill: skills.sunderer.<API key>, level: 1 }
],
equipment: []
},
'Squad Leader': {
certifications: [
{ skill: skills.squadLeader.priorityDeployment, level: 0 }
],
equipment: []
}
}
},
'veteran': {
meta: {
passPercentage: 100
},
classes: {
'Heavy Assault': {
certifications: [
{ skill: skills.heavyAssault.resistShield, level: 1 },
{ skill: skills.heavyAssault.antiVehicleGrenade, level: 1 },
{ skill: skills.universal.medicalKit, level: 1 }
],
equipment: []
},
'Light Assault': {
certifications: [
{ skill: skills.lightAssault.c4, level: 2 },
{ skill: skills.lightAssault.drifterJumpJets, level: 2 }
],
equipment: []
},
'Engineer': {
certifications: [
{ skill: skills.engineer.nanoArmorKit, level: 6 },
{ skill: skills.engineer.claymoreMine, level: 2 },
{ skill: skills.engineer.tankMine, level: 2 },
{ skill: skills.engineer.ammunitionPackage, level: 3 },
{ skill: skills.engineer.stickyGrenade, level: 1 }
],
equipment: [
items.weapon.trac5s,
items.engineer.avManaTurret
]
},
'Medic': {
certifications: [
{ skill: skills.medic.medicalApplicator, level: 6 },
{ skill: skills.medic.nanoRegenDevice, level: 6 }
],
equipment: []
},
'Infiltrator': {
certifications: [
{ skill: skills.infiltrator.<API key>, level: 3 }
],
equipment: []
},
'Sunderer': {
certifications: [
{ skill: skills.sunderer.<API key>, level: 1 },
{ skill: skills.sunderer.blockadeArmor, level: 3 },
{ skill: skills.sunderer.gateShieldDiffuser, level: 2 }
],
equipment: []
},
'Squad Leader': {
certifications: [
{ skill: skills.squadLeader.priorityDeployment, level: 2 }
],
equipment: []
}
}
},
'medic': {
meta: {
passPercentage: 100
},
classes: {
'Loadout: Offensive Medic': {
certifications: [
{ skill: skills.medic.grenadeBandolier, level: 2 },
{ skill: skills.medic.naniteReviveGrenade, level: 1 },
{ skill: skills.medic.nanoRegenDevice, level: 6 },
{ skill: skills.universal.medicalKit, level: 3 }
],
equipment: []
},
'Loadout: Defensive Medic': {
certifications: [
{ skill: skills.medic.flakArmor, level: 4 },
{ skill: skills.medic.naniteReviveGrenade, level: 1 },
{ skill: skills.medic.regenerationField, level: 5 },
{ skill: skills.universal.medicalKit, level: 3 }
],
equipment: []
}
}
},
'engineer': {
meta: {
passPercentage: 100
},
classes: {
'Loadout: Anti-Infantry MANA Turret': {
certifications: [
{ skill: skills.engineer.flakArmor, level: 4 },
{ skill: skills.engineer.claymoreMine, level: 2 }
],
equipment: [
items.weapon.trac5s
]
},
'Loadout: Anti-Vehicle MANA Turret': {
certifications: [
{ skill: skills.engineer.flakArmor, level: 4 },
{ skill: skills.engineer.tankMine, level: 2 },
{ skill: skills.engineer.avManaTurret, level: 1 }
],
equipment: [
items.weapon.trac5s,
items.engineer.avManaTurret
]
}
}
},
'lightAssault': {
meta: {
passPercentage: 100
},
classes: {
'Loadout: Bounty Hunter': {
certifications: [
{ skill: skills.lightAssault.flakArmor, level: 4 },
{ skill: skills.lightAssault.jumpJets, level: 6 },
{ skill: skills.lightAssault.flashGrenade, level: 1 }
],
equipment: []
},
'Loadout: Death From Above': {
certifications: [
{ skill: skills.lightAssault.grenadeBandolier, level: 2 },
{ skill: skills.lightAssault.drifterJumpJets, level: 5 },
{ skill: skills.lightAssault.smokeGrenade, level: 1 }
],
equipment: []
}
}
},
'infiltrator': {
meta: {
passPercentage: 100
},
classes: {
'Loadout: Close Quarters': {
certifications: [
{ skill: skills.infiltrator.flakArmor, level: 4 },
{ skill: skills.infiltrator.grenadeBandolier, level: 2 },
{ skill: skills.infiltrator.reconDetectDevice, level: 6 },
{ skill: skills.infiltrator.claymoreMine, level: 2 },
{ skill: skills.infiltrator.empGrenade, level: 1 }
],
equipment: [
items.weapon.ns7pdw
]
},
'Loadout: Assassin': {
certifications: [
{ skill: skills.infiltrator.ammunitionBelt, level: 3 },
{ skill: skills.infiltrator.motionSpotter, level: 5 },
{ skill: skills.infiltrator.claymoreMine, level: 2 },
{ skill: skills.infiltrator.decoyGrenade, level: 1 },
{ skill: skills.universal.medicalKit, level: 3 }
],
equipment: [
items.weapon.rams
]
}
}
},
'heavyAssault': {
meta: {
passPercentage: 100
},
classes: {
'Loadout: Anti-Infantry': {
certifications: [
{ skill: skills.heavyAssault.grenadeBandolier, level: 2 },
{ skill: skills.heavyAssault.flakArmor, level: 4 },
{ skill: skills.heavyAssault.resistShield, level: 1 },
{ skill: skills.heavyAssault.concussionGrenade, level: 1 },
{ skill: skills.universal.medicalKit, level: 3 }
],
equipment: [
items.weapon.decimator
]
},
'Loadout: Anti-Armor': {
certifications: [
{ skill: skills.heavyAssault.flakArmor, level: 4 },
{ skill: skills.heavyAssault.resistShield, level: 1 },
{ skill: skills.heavyAssault.c4, level: 1 },
{ skill: skills.heavyAssault.antiVehicleGrenade, level: 1 }
],
equipment: [
items.weapon.skep,
items.weapon.grounder
]
}
}
},
'maxUnit': {
meta: {
passPercentage: 100
},
classes: {
'Loadout: Anti-Infantry': {
certifications: [
{ skill: skills.max.kineticArmor, level: 5 },
{ skill: skills.max.lockdown, level: 2 }
],
equipment: [
items.max.leftMercy,
items.max.rightMercy
]
},
'Loadout: Anti-Armor': {
certifications: [
{ skill: skills.max.flakArmor, level: 5 },
{ skill: skills.max.kineticArmor, level: 5 },
{ skill: skills.max.lockdown, level: 2 }
],
equipment: [
items.max.leftPounder,
items.max.rightPounder
]
},
'Loadout: Anti-Air': {
certifications: [
{ skill: skills.max.flakArmor, level: 5 },
{ skill: skills.max.lockdown, level: 2 }
],
equipment: [
items.max.leftBurster,
items.max.rightBurster
]
}
}
},
'basicTanks': {
meta: {
passPercentage: 100
},
classes: {
'Prowler': {
certifications: [
{ skill: skills.prowler.anchoredMode, level: 1 }
],
equipment: [
items.prowler.walker
]
},
'Sunderer': {
certifications: [
{ skill: skills.sunderer.<API key>, level: 1 },
{ skill: skills.sunderer.gateShieldDiffuser, level: 2 }
],
equipment: []
}
}
},
'sunderer': {
meta: {
passPercentage: 100
},
classes: {
'Sunderer': {
certifications: [
{ skill: skills.sunderer.mineGuard, level: 4 },
{ skill: skills.sunderer.blockadeArmor, level: 4 },
{ skill: skills.sunderer.gateShieldDiffuser, level: 3 },
{ skill: skills.sunderer.<API key>, level: 6 }
],
equipment: []
}
}
},
'prowler': {
meta: {
passPercentage: 100
},
classes: {
'Prowler': {
certifications: [
{ skill: skills.prowler.anchoredMode, level: 4 },
{ skill: skills.prowler.mineGuard, level: 4 }
],
equipment: [
items.prowler.p2120ap,
items.prowler.halberd
]
}
}
},
'lightning': {
meta: {
passPercentage: 100
},
classes: {
'Lightning': {
certifications: [
{ skill: skills.lightning.reinforcedTopArmor, level: 1 }
],
equipment: [
items.lightning.skyguard
]
}
}
},
'harasser': {
meta: {
passPercentage: 100
},
classes: {
'Harasser': {
certifications: [
{ skill: skills.harasser.<API key>, level: 4 },
{ skill: skills.harasser.compositeArmor, level: 4 },
{ skill: skills.harasser.turbo, level: 5 }
],
equipment: [
items.harasser.halberd
]
}
}
},
'commander': {
meta: {
passPercentage: 100
},
classes: {
'Squad Leader': {
certifications: [
{ skill: skills.squadLeader.commandCommChannel, level: 1 },
{ skill: skills.squadLeader.<API key>, level: 1 },
{ skill: skills.squadLeader.rallyPointGreen, level: 1 },
{ skill: skills.squadLeader.rallyPointOrange, level: 1 },
{ skill: skills.squadLeader.rallyPointPurple, level: 1 },
{ skill: skills.squadLeader.rallyPointYellow, level: 1 },
{ skill: skills.squadLeader.priorityDeployment, level: 4 }
],
equipment: []
}
}
}
},
echoHavoc = qual('Echo Havoc', null, null, true),
max = qual('MAX', echoHavoc, requirements.maxUnit),
heavyAssault = qual('Heavy Assault', max, requirements.heavyAssault),
echoCovertOps = qual('Echo Covert Ops', null, null, true),
infiltrator = qual('Infiltrator', echoCovertOps, requirements.infiltrator),
lightAssault = qual('Light Assault', infiltrator, requirements.lightAssault),
echoSpecialist = qual('Echo Specialist', null, null, true),
engineer = qual('Engineer', echoSpecialist, requirements.engineer),
combatMedic = qual('Combat Medic', engineer, requirements.medic),
commander = qual('Commander', null, requirements.commander, true),
sunderer = qual('Sunderer', [ echoSpecialist, echoCovertOps, echoHavoc ], requirements.sunderer),
harasser = qual('Harasser', null, requirements.harasser),
lightning = qual('Lightning', harasser, requirements.lightning),
prowler = qual('Prowler', lightning, requirements.prowler),
basicTanks = qual('Basic Tanks', [ sunderer, prowler ], requirements.basicTanks),
veteran = qual('Veteran', [ combatMedic, lightAssault, heavyAssault, commander ], requirements.veteran, true),
soldier = qual('Soldier', [ veteran, basicTanks ], requirements.soldier, true);
<API key>(soldier);
return soldier;
function qual(name, child, certs, isRank) {
var obj = {};
obj.name = name;
if (child) {
if ($.isArray(child)) {
obj.child = child;
} else {
obj.child = [ child ];
}
}
if (certs) {
obj.cert = certs;
}
if (isRank) {
obj.isRank = true;
}
return obj;
}
function <API key>(rank, parent) {
if (parent) {
if (rank.parent) {
rank.parent.push(parent);
} else {
rank.parent = [ parent ];
}
}
if (rank.child) {
$.each(rank.child, function() {
<API key>(this, rank);
});
}
}
}
|
package addonloader.util;
import java.io.File;
import java.io.<API key>;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
/**
* Simple wrapper around {@link Properites},
* allowing to easily access objects.
* @author Enginecrafter77
*/
public class ObjectSettings extends Properties{
private static final long serialVersionUID = -<API key>;
private final File path;
public ObjectSettings(File path) throws <API key>, IOException
{
this.path = path;
this.load(new FileReader(path));
}
public ObjectSettings(String path) throws <API key>, IOException
{
this(new File(path));
}
public boolean getBoolean(String key, boolean def)
{
return Boolean.parseBoolean(this.getProperty(key, String.valueOf(def)));
}
public int getInteger(String key, int def)
{
return Integer.parseInt(this.getProperty(key, String.valueOf(def)));
}
public float getFloat(String key, float def)
{
return Float.parseFloat(this.getProperty(key, String.valueOf(def)));
}
public void set(String key, Object val)
{
this.setProperty(key, val.toString());
}
public void store(String comment)
{
try
{
this.store(new FileOutputStream(path), comment);
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
|
print ARGF.read.gsub!(/\B[a-z]+\B/) {|x| x.split('').sort_by{rand}.join}
|
require 'minitest/autorun'
require 'minitest/pride'
require 'bundler/setup'
Bundler.require(:default)
require 'active_record'
require File.dirname(__FILE__) + '/../lib/where_exists'
ActiveRecord::Base.default_timezone = :utc
ActiveRecord::Base.<API key> = true
ActiveRecord::Base.<API key>(
:adapter => 'sqlite3',
:database => File.dirname(__FILE__) + "/db/test.db"
)
|
const ConfigLoader = require( 'easy/core/ConfigLoader' )
const EventsEmitter = require( 'events' )
/**
* @class Database
*/
class Database {
/**
* @constructor
*/
constructor( config ) {
this._config = config
this.stateEmitter = new EventsEmitter()
this.name = config.config.name
this.init()
}
/**
* init - init attributes
*/
init() {
this._instance = null
this._connector = this._config.connector
this.resetProperties()
}
/**
* Reset instance and connected state
*
* @memberOf Database
*/
resetProperties() {
this._connected = false
this._connectionError = null
}
/**
* load - load database config
*/
async start() {
await this.connect()
}
/**
* restart - restart database component
*/
async restart() {
this.resetProperties()
await this.start()
}
/**
* connect - connect database to instance
*/
async connect() {
const { instance, connected, error } = await this.config.connector()
const oldConnected = this.connected
this.instance = instance
this.connected = connected
this.connectionError = error
if ( this.connected !== oldConnected ) {
this.stateEmitter.emit( 'change', this.connected )
}
if ( error ) {
throw new Error( error )
}
}
/**
* Reset database connection and instance
*
* @memberOf Database
*/
disconnect() {
const oldConnected = this.connected
this.resetProperties()
if ( this.connected !== oldConnected ) {
this.stateEmitter.emit( 'change', this.connected )
}
}
/**
* <API key> - handler called by daemon which indicates if database still available or not
*
* @returns {Promise}
*
* @memberOf Database
*/
<API key>() {
return this.config.<API key>()
}
/**
* Branch handler on database state events
*
* @param {Function} handler
*
* @memberOf Database
*/
<API key>( handler ) {
this.stateEmitter.on( 'change', handler )
}
/**
* get - get database instance
*
* @returns {Object}
*/
get instance() {
return this._instance
}
/**
* set - set database instance
*
* @param {Object} instance
* @returns {Object}
*/
set instance( instance ) {
this._instance = instance
return this._instance
}
/**
* get - get database connection state
*
* @returns {Object}
*/
get connected() {
return this._connected
}
/**
* set - set database connection state
*
* @param {boolean} connected
* @returns {Database}
*/
set connected( connected ) {
this._connected = connected
return this
}
/**
* get - get database configurations
*
* @returns {Object}
*/
get config() {
return this._config
}
/**
* Get connection error
*
* @readonly
*
* @memberOf Database
*/
get connectionError() {
return this._connectionError
}
/**
* Set connection error
*
* @returns {Database}
*
* @memberOf Database
*/
set connectionError( error ) {
this._connectionError = error
return this
}
}
module.exports = Database
|
import { useEffect, useRef, useState } from "react"
import * as React from "react"
import {
RelayPaginationProp,
RelayRefetchProp,
<API key>,
} from "react-relay"
import { graphql } from "relay-runtime"
import Waypoint from "react-waypoint"
import { Box, Flex, Spacer, Spinner } from "@artsy/palette"
import compact from "lodash/compact"
import styled from "styled-components"
import { extractNodes } from "v2/Utils/extractNodes"
import { <API key> } from "./Item"
import { Reply } from "./Reply"
import { <API key> as <API key> } from "./<API key>"
import { ConversationHeader } from "./ConversationHeader"
import { <API key> } from "./ConfirmArtworkModal"
import { <API key> } from "./<API key>"
import { <API key> } from "../Utils/<API key>"
import { OrderModal } from "./OrderModal"
import { <API key> } from "./UnreadMessagesToast"
import useOnScreen from "../Utils/useOnScreen"
import { UpdateConversation } from "../Mutation/<API key>"
import { <API key> } from "v2/__generated__/<API key>.graphql"
import { useRouter } from "v2/System/Router/useRouter"
export interface ConversationProps {
conversation: <API key>
showDetails: boolean
setShowDetails: (showDetails: boolean) => void
relay: RelayPaginationProp
refetch: RelayRefetchProp["refetch"]
}
export const PAGE_SIZE: number = 15
const Loading: React.FC = () => (
<SpinnerContainer>
<Spinner />
</SpinnerContainer>
)
const Conversation: React.FC<ConversationProps> = props => {
const { conversation, relay, showDetails, setShowDetails } = props
const liveArtwork = conversation?.items?.[0]?.liveArtwork
const artwork = liveArtwork?.__typename === "Artwork" ? liveArtwork : null
const isOfferable = !!artwork && !!artwork?.<API key>
const [<API key>, <API key>] = useState<
boolean
>(false)
const inquiryItemBox = compact(conversation.items).map((i, idx) => {
const isValidType =
i.item?.__typename === "Artwork" || i.item?.__typename === "Show"
return (
<<API key>
item={i.item!}
key={isValidType ? i.item?.id : idx}
/>
)
})
// ORDERS
const [showOrderModal, setShowOrderModal] = useState<boolean>(false)
const activeOrder = extractNodes(conversation.orderConnection)[0]
let orderID
let kind
if (activeOrder) {
kind = activeOrder.buyerAction
orderID = activeOrder.internalID
}
const { url, modalTitle } = <API key>({
kind: kind!,
orderID: orderID,
})
// SCROLLING AND FETCHING
// States and Refs
const <API key> = useRef<HTMLElement>(null)
const initialMount = useRef(true)
const initialScroll = useRef(true)
const scrollContainer = useRef<HTMLDivElement>(null)
const [fetchingMore, setFetchingMore] = useState<boolean>(false)
const [lastMessageID, setLastMessageID] = useState<string | null>()
const [lastOrderUpdate, setLastOrderUpdate] = useState<string | null>()
const isBottomVisible = useOnScreen(<API key>)
// Functions
const loadMore = (): void => {
if (relay.isLoading() || !relay.hasMore() || !initialMount.current) return
setFetchingMore(true)
const scrollCursor = scrollContainer.current
? scrollContainer.current?.scrollHeight -
scrollContainer.current?.scrollTop
: 0
relay.loadMore(PAGE_SIZE, error => {
if (error) console.error(error)
setFetchingMore(false)
if (scrollContainer.current) {
// Scrolling to former position
scrollContainer.current?.scrollTo({
top: scrollContainer.current?.scrollHeight - scrollCursor,
behavior: "smooth",
})
}
})
}
const { match } = useRouter()
const conversationID = match?.params?.conversationID
// TODO: refactor
useEffect(() => {
initialScroll.current = false
}, [conversationID])
useEffect(() => {
initialScroll.current = !fetchingMore
}, [fetchingMore])
useEffect(() => {
if (!fetchingMore && !initialScroll.current) {
scrollToBottom()
}
})
const scrollToBottom = () => {
if (!!<API key>?.current) {
<API key>.current?.scrollIntoView?.({
block: "end",
inline: "nearest",
behavior: initialMount.current ? "auto" : "smooth",
})
if (isBottomVisible) initialMount.current = false
setLastMessageID(conversation?.lastMessageID)
setOrderKey()
}
}
const refreshData = () => {
props.refetch({ conversationID: conversation.internalID }, null, error => {
if (error) console.error(error)
scrollToBottom()
})
}
const setOrderKey = () => {
setLastOrderUpdate(activeOrder?.updatedAt)
}
const [toastBottom, setToastBottom] = useState(0)
// Behaviours
// -Navigation
useEffect(() => {
setLastMessageID(conversation?.<API key>)
initialMount.current = true
setOrderKey()
}, [
conversation.internalID,
conversation.<API key>,
setOrderKey,
])
// -Last message opened
useEffect(() => {
// Set on a timeout so the user sees the "new" flag
setTimeout(
() => {
UpdateConversation(relay.environment, conversation)
},
!!conversation.isLastMessageToUser ? 3000 : 0
)
}, [lastMessageID])
// -Workaround Reply render resizing race condition
useEffect(() => {
if (initialMount.current) scrollToBottom()
const rect = scrollContainer.current?.<API key>()
setToastBottom(window.innerHeight - (rect?.bottom ?? 0) + 30)
}, [scrollContainer?.current?.clientHeight])
// -On scroll down
useEffect(() => {
if (isBottomVisible) refreshData()
}, [isBottomVisible])
return (
<Flex flexDirection="column" flexGrow={1}>
<ConversationHeader
partnerName={conversation.to.name}
showDetails={showDetails}
setShowDetails={setShowDetails}
/>
<NoScrollFlex flexDirection="column" width="100%">
<MessageContainer ref={scrollContainer as any}>
<Box pb={[6, 6, 6, 0]} pr={1}>
<Spacer mt={["75px", "75px", 2]} />
<Flex flexDirection="column" width="100%" px={1}>
{isOfferable && <<API key> />}
{inquiryItemBox}
<Waypoint onEnter={loadMore} />
{fetchingMore ? <Loading /> : null}
<<API key>
messages={conversation.messagesConnection!}
events={conversation.orderConnection}
lastViewedMessageID={conversation?.<API key>}
setShowDetails={setShowDetails}
/>
<Box ref={<API key> as any} />
</Flex>
</Box>
<<API key>
conversationID={conversation?.internalID!}
lastOrderUpdate={lastOrderUpdate}
bottom={toastBottom}
hasScrolled={!isBottomVisible}
onClick={scrollToBottom}
refreshCallback={refreshData}
/>
</MessageContainer>
<Reply
onScroll={scrollToBottom}
conversation={conversation}
refetch={props.refetch}
environment={relay.environment}
openInquiryModal={() => <API key>(true)}
openOrderModal={() => setShowOrderModal(true)}
/>
</NoScrollFlex>
{isOfferable && (
<<API key>
artworkID={artwork?.internalID!}
conversationID={conversation.internalID!}
show={<API key>}
closeModal={() => <API key>(false)}
/>
)}
{isOfferable && (
<OrderModal
path={url!}
orderID={orderID}
title={modalTitle!}
show={showOrderModal}
closeModal={() => {
refreshData()
setShowOrderModal(false)
}}
/>
)}
</Flex>
)
}
const MessageContainer = styled(Box)`
flex-grow: 1;
overflow-y: auto;
`
const NoScrollFlex = styled(Flex)`
overflow: hidden;
flex-grow: 1;
`
const SpinnerContainer = styled.div`
width: 100%;
height: 100px;
position: relative;
`
export const <API key> = <API key>(
Conversation,
{
conversation: graphql`
fragment <API key> on Conversation
@argumentDefinitions(
count: { type: "Int", defaultValue: 30 }
after: { type: "String" }
) {
id
internalID
from {
name
email
}
to {
name
initials
}
initialMessage
lastMessageID
<API key>
isLastMessageToUser
unread
orderConnection(
first: 10
states: [APPROVED, FULFILLED, SUBMITTED, REFUNDED, CANCELED]
participantType: BUYER
) {
edges {
node {
internalID
updatedAt
on CommerceOfferOrder {
buyerAction
}
}
}
<API key>
}
unread
messagesConnection(first: $count, after: $after, sort: DESC)
@connection(key: "<API key>", filters: []) {
pageInfo {
startCursor
endCursor
hasPreviousPage
hasNextPage
}
edges {
node {
id
}
}
totalCount
<API key>
}
items {
item {
__typename
on Artwork {
id
<API key>
internalID
}
Item_item
}
liveArtwork {
on Artwork {
<API key>
internalID
__typename
}
}
}
<API key>
}
`,
},
{
direction: "forward",
<API key>(props) {
return props.conversation?.messagesConnection
},
<API key>(prevVars, count) {
return {
prevVars,
count,
}
},
getVariables(props, { cursor, count }) {
return {
count,
cursor,
after: cursor,
conversationID: props.conversation.id,
}
},
query: graphql`
query <API key>(
$count: Int
$after: String
$conversationID: ID!
) {
node(id: $conversationID) {
<API key> @arguments(count: $count, after: $after)
}
}
`,
}
)
|
layout: post
title: Hybrid
color: blue
width: 3
height: 1
category: hybrid
# Hybrid

# Common
Scss Widget

***
**Scss **
component
* _button()
* _list-item( )
* _name-gender( )
* _notice-bar()
* _value()
mixins
* _border-line(ios9 Android 1px 1px)
* _button( + )
* _clearfix()
* _cus-font-height( button )
* _ellipse()
* _list-item( componentlist-item)
* _value( componentvalue)
* _way-step-v( )
themes
*
*
*
*
*
*
*
core
***
**Widget **
* animate
* bannerbanner
* baseloading
* fundItem
* indexCrowdfunding()
* newsItem
* prodfixItem )
* slick )
* tab ( tab )
***
# Pages

|
<?php
class LinterTests extends <API key>
{
/**
* @param string $source
* @param \Superbalist\Money\Linter\Tests\LinterTestInterface $test
*/
protected function <API key>($source, \Superbalist\Money\Linter\Tests\LinterTestInterface $test)
{
$result = $test->analyse($source);
$this->assertNotEmpty($result);
}
public function <API key>()
{
$this-><API key>(
'<?php echo abs(-37);',
new \Superbalist\Money\Linter\Tests\AbsFunctionCallTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $values = array(0, 1, 2, 3); $sum = array_sum($values);',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo ceil(3.3);',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = 1 / 0.1;',
new \Superbalist\Money\Linter\Tests\DivideOperatorTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = "3.3"; echo (float) $test;',
new \Superbalist\Money\Linter\Tests\FloatCastTest()
);
}
public function <API key>()
{
$source = <<<'EOT'
<?php
/**
* @param float $number this is a test
* @return float test
*/
public function getFloatNumber($number)
{
return $number;
}
EOT;
$this-><API key>($source, new \Superbalist\Money\Linter\Tests\<API key>());
}
public function <API key>()
{
$source = <<<'EOT'
<?php
/**
* @param float $number this is a test
* @return float test
*/
public function getFloatNumber($number)
{
return $number;
}
EOT;
$this-><API key>($source, new \Superbalist\Money\Linter\Tests\<API key>());
}
public function <API key>()
{
$this-><API key>(
'<?php echo floatval("3.3");',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$source = <<<'EOT'
<?php
/**
* @var float
*/
protected $number = 0.0;
EOT;
$this-><API key>($source, new \Superbalist\Money\Linter\Tests\<API key>());
}
public function <API key>()
{
$this-><API key>(
'<?php echo floor(3.3);',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php if (4 > 3) { echo "true"; } else { echo "false"; }',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php if (4 >= 3) { echo "true"; } else { echo "false"; }',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = "3.3"; echo (int) $test;',
new \Superbalist\Money\Linter\Tests\IntCastTest()
);
}
public function <API key>()
{
$source = <<<'EOT'
<?php
/**
* @param int $number this is a test
* @return int test
*/
public function getIntNumber($number)
{
return $number;
}
EOT;
$this-><API key>($source, new \Superbalist\Money\Linter\Tests\<API key>());
}
public function <API key>()
{
$source = <<<'EOT'
<?php
/**
* @param int $number this is a test
* @return int test
*/
public function getIntNumber($number)
{
return $number;
}
EOT;
$this-><API key>($source, new \Superbalist\Money\Linter\Tests\<API key>());
}
public function <API key>()
{
$this-><API key>(
'<?php echo intval("3.3");',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$source = <<<'EOT'
<?php
/**
* @var int
*/
protected $number = 0;
EOT;
$this-><API key>($source, new \Superbalist\Money\Linter\Tests\IntVarDocBlockTest());
}
public function <API key>()
{
$this-><API key>(
'<?php $a = 3.3; var_dump(is_float($a));',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $a = 3; var_dump(is_integer($a));',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $a = 3; var_dump(is_int($a));',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $a = 3; var_dump(is_numeric($a));',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo max(0, 3.3);',
new \Superbalist\Money\Linter\Tests\MaxFunctionCallTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo min(0, 3.3);',
new \Superbalist\Money\Linter\Tests\MinFunctionCallTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = 1 - 0.1;',
new \Superbalist\Money\Linter\Tests\MinusOperatorTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = 4 % 2;',
new \Superbalist\Money\Linter\Tests\ModOperatorTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo money_format("%.2n", 2.4562)',
new \Superbalist\Money\Linter\Tests\MoneyFormatCallTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = 1 * 0.1;',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = 0.2 + 0.1;',
new \Superbalist\Money\Linter\Tests\NumberFloatTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo number_format(1.3, 2)',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = 1 + 0.1;',
new \Superbalist\Money\Linter\Tests\NumberIntTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $test = 1 + 0.1;',
new \Superbalist\Money\Linter\Tests\PlusOperatorTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo pow(2, 8);',
new \Superbalist\Money\Linter\Tests\PowFunctionCallTest()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo round(9.93434, 2);',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php if (4 < 3) { echo "true"; } else { echo "false"; }',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php if (4 <= 3) { echo "true"; } else { echo "false"; }',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php echo sprintf("%f", 4.55555);',
new \Superbalist\Money\Linter\Tests\<API key>()
);
$this-><API key>(
'<?php echo sprintf("%.2f %s", 4.55555, "test");',
new \Superbalist\Money\Linter\Tests\<API key>()
);
$this-><API key>(
'<?php echo sprintf("%.2f %s", 4.55555, sprintf("%s", "test")); $test = intval(1.1);',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $n = 3; $n
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $n = 21; $n /= 3;',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $n = 3; $n++;',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $n = 21; $n -= 2;',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $n = 24; $n %= 2;',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $n = 21; $n += 2;',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
public function <API key>()
{
$this-><API key>(
'<?php $n = 21; $n *= 2;',
new \Superbalist\Money\Linter\Tests\<API key>()
);
}
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hammer: 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 / hammer - 1.3+8.12</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hammer
<small>
1.3+8.12
<span class="label label-info">Not compatible </span>
</small>
</h1>
<p> <em><script>document.write(moment("2022-02-10 07:56:43 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-10 07:56:43 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 2 Virtual package relying on perl
coq 8.8.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/lukaszcz/coqhammer"
dev-repo: "git+https://github.com/lukaszcz/coqhammer.git"
bug-reports: "https://github.com/lukaszcz/coqhammer/issues"
license: "LGPL-2.1-only"
synopsis: "General-purpose automated reasoning hammer tool for Coq"
description: """
A general-purpose automated reasoning hammer tool for Coq that combines
learning from previous proofs with the translation of problems to the
logics of automated systems and the reconstruction of successfully found proofs.
"""
build: [make "-j%{jobs}%" {ocaml:version >= "4.06"} "plugin"]
install: [
[make "install-plugin"]
[make "test-plugin"] {with-test}
]
depends: [
"ocaml"
"coq" {>= "8.12" & < "8.13~"}
("conf-g++" {build} | "conf-clang" {build})
"coq-hammer-tactics" {= version}
]
tags: [
"category:Miscellaneous/Coq Extensions"
"keyword:automation"
"keyword:hammer"
"logpath:Hammer.Plugin"
"date:2020-07-28"
]
authors: [
"Lukasz Czajka <lukaszcz@mimuw.edu.pl>"
"Cezary Kaliszyk <cezary.kaliszyk@uibk.ac.at>"
]
url {
src: "https://github.com/lukaszcz/coqhammer/archive/v1.3-coq8.12.tar.gz"
checksum: "sha512=666ea825c122319e398efb7287f429ebfb5d35611b4cabe4b88732ffb5c265ef348b53d5046c958831ac0b7a759b44ce1ca04220ca68b1915accfd23435b479c"
}
</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-hammer.1.3+8.12 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't be met:
- coq-hammer -> coq >= 8.12
Your request can't be satisfied:
- No available version of coq satisfies the constraints
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-hammer.1.3+8.12</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>
|
package ch.bisi.koukan.job;
import ch.bisi.koukan.provider.<API key>;
import ch.bisi.koukan.repository.DataAccessException;
import ch.bisi.koukan.repository.<API key>;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* Executes scheduled tasks for updating the in memory exchange rates
* by querying the European Central Bank endpoints.
*/
@Component
public class <API key> {
private static final Logger logger = LoggerFactory.getLogger(<API key>.class);
private final <API key> <API key>;
private final <API key> <API key>;
private final URL dailyEndpoint;
private final URL pastDaysEndpoint;
/**
* Instantiates a new {@link <API key>}.
*
* @param <API key> the provider of exchange rates
* @param <API key> the repository
* @param dailyEndpoint the ECB daily endpoint {@link URL}
* @param pastDaysEndpoint the ECB endpoint {@link URL} for retrieving past days data
*/
@Autowired
public <API key>(
@Qualifier("ECBProvider") final <API key> <API key>,
final <API key> <API key>,
@Qualifier("dailyEndpoint") final URL dailyEndpoint,
@Qualifier("pastDaysEndpoint") final URL pastDaysEndpoint) {
this.<API key> = <API key>;
this.<API key> = <API key>;
this.dailyEndpoint = dailyEndpoint;
this.pastDaysEndpoint = pastDaysEndpoint;
}
/**
* Retrieves the whole exchange rates daily data.
*
* @throws IOException in case of the problems accessing the ECB endpoint
* @throws XMLStreamException in case of problems parsing the ECB XML
* @throws DataAccessException in case of problems accessing the underlying data
*/
@Scheduled(initialDelay = 0, fixedRateString = "${daily.rates.update.rate}")
public void loadDailyData() throws IOException, XMLStreamException, DataAccessException {
try (final InputStream inputStream = dailyEndpoint.openStream()) {
logger.info("Updating ECB daily exchange rates data");
loadData(inputStream);
}
}
/**
* Retrieves the whole exchange rates data for past days.
*
* @throws IOException in case of the problems accessing the ECB endpoint
* @throws XMLStreamException in case of problems parsing the ECB XML
* @throws DataAccessException in case of problems accessing the underlying data
*/
@Scheduled(initialDelay = 0, fixedRateString = "${past.days.rates.update.rate}")
public void loadPastDaysData() throws IOException, XMLStreamException, DataAccessException {
try (final InputStream inputStream = pastDaysEndpoint.openStream()) {
logger.info("Updating ECB exchange rates data for the past 90 days");
loadData(inputStream);
}
}
/**
* Loads exchange rates data from the given {@link InputStream}.
*
* @param inputStream the {@link InputStream}
* @throws XMLStreamException in case of problems parsing the ECB XML
* @throws DataAccessException in case of problems accessing the underlying data
*/
private void loadData(final InputStream inputStream)
throws XMLStreamException, DataAccessException {
final XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance()
.<API key>(inputStream);
<API key>.save(<API key>.retrieveAll(xmlStreamReader));
}
}
|
<?php namespace JetMinds\Job\Updates;
use Schema;
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class CreateResumesTable extends Migration
{
public function up()
{
Schema::create('<API key>', function(Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('email')->nullable();
$table->string('phone')->nullable();
$table->string('position')->nullable();
$table->longText('location')->nullable();
$table->string('resume_category')->nullable();
$table->string('resume_education')->nullable();
$table->longText('education_note')->nullable();
$table->string('resume_experience')->nullable();
$table->longText('experience_note')->nullable();
$table->string('resume_language')->nullable();
$table->string('resume_skill')->nullable();
$table->longText('resume_note')->nullable();
$table->boolean('is_invite')->default(1);
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('<API key>');
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace SpartaHack
{
<summary>
An empty page that can be used on its own or navigated to within a Frame.
</summary>
public sealed partial class MainPage : Page
{
public static ObservableValue<string> Title { get; set; }
public static ObservableValue<bool> LoggedIn { get; set; }
public static ObservableValue<string> Time { get; set; }
public static MainPage root;
private DateTime DoneTime;
public MainPage(Frame frame)
{
this.InitializeComponent();
Title = new ObservableValue<string>();
LoggedIn = new ObservableValue<bool>();
Time = new ObservableValue<string>();
this.MySplitView.Content = frame;
DataContext = this;
DoneTime = DateTime.Parse("1/22/2017 17:00:00 GMT");
DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(1);
dt.Tick += Dt_Tick;
this.Loaded += (s,e) =>
{
rdAnnouncements.IsChecked = true;
dt.Start();
};
MySplitView.PaneClosed += (s, e) =>
{
grdHideView.Visibility = Visibility.Collapsed;
bgPane.Margin = new Thickness(MySplitView.IsPaneOpen ? MySplitView.OpenPaneLength : MySplitView.CompactPaneLength, bgPane.Margin.Top, bgPane.Margin.Right, bgPane.Margin.Bottom);
};
}
private void Dt_Tick(object sender, object e)
{
TimeSpan dt = DoneTime.ToUniversalTime().Subtract(DateTime.Now.ToUniversalTime());
if (dt.TotalSeconds <= 0)
Time.Value = "FINISHED";
else
//txtCountDown.Text = dt.ToString(@"hh\:mm\:ss");
//Time.Value = $"{(int)dt.TotalHours}H {dt.Minutes}M {dt.Seconds}S";
Time.Value= string.Format("{0:##}h {1:##}m {2:##}s", ((int)dt.TotalHours), dt.Minutes.ToString(), dt.Seconds.ToString());
}
private void <API key>(object sender, RoutedEventArgs e)
{
try
{
MySplitView.IsPaneOpen = false;
if (MySplitView.Content != null)
((Frame)MySplitView.Content).Navigate(typeof(AnnouncementsPage));
}
catch { }
}
private void OnScheduleChecked(object sender, RoutedEventArgs e)
{
try
{
MySplitView.IsPaneOpen = false;
if (MySplitView.Content != null)
((Frame)MySplitView.Content).Navigate(typeof(SchedulePage));
}
catch { }
}
private void OnTicketChecked(object sender, RoutedEventArgs e)
{
try
{
MySplitView.IsPaneOpen = false;
if (MySplitView.Content != null)
((Frame)MySplitView.Content).Navigate(typeof(TicketPage));
}
catch { }
}
private void OnMapChecked(object sender, RoutedEventArgs e)
{
try
{
MySplitView.IsPaneOpen = false;
if (MySplitView.Content != null)
((Frame)MySplitView.Content).Navigate(typeof(MapPage));
}
catch { }
}
private void OnSponsorChecked(object sender, RoutedEventArgs e)
{
try
{
MySplitView.IsPaneOpen = false;
if (MySplitView.Content != null)
((Frame)MySplitView.Content).Navigate(typeof(SponsorPage));
}
catch { }
}
private void OnPrizeChecked(object sender, RoutedEventArgs e)
{
try
{
MySplitView.IsPaneOpen = false;
if (MySplitView.Content != null)
((Frame)MySplitView.Content).Navigate(typeof(PrizePage));
}
catch { }
}
private void OnLoginChecked(object sender, RoutedEventArgs e)
{
try
{
MySplitView.IsPaneOpen = false;
if (MySplitView.Content != null)
((Frame)MySplitView.Content).Navigate(typeof(ProfilePage));
}
catch { }
}
private void HambButton_Click(object sender, RoutedEventArgs e)
{
try
{
grdHideView.Visibility = grdHideView.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
MySplitView.IsPaneOpen = !MySplitView.IsPaneOpen;
bgPane.Margin = new Thickness(MySplitView.IsPaneOpen ? MySplitView.OpenPaneLength : MySplitView.CompactPaneLength, bgPane.Margin.Top, bgPane.Margin.Right, bgPane.Margin.Bottom);
}
catch { }
}
private void grdHideView_Tapped(object sender, <API key> e)
{
try
{
grdHideView.Visibility = grdHideView.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
MySplitView.IsPaneOpen = !MySplitView.IsPaneOpen;
bgPane.Margin = new Thickness(MySplitView.IsPaneOpen ? MySplitView.OpenPaneLength : MySplitView.CompactPaneLength, bgPane.Margin.Top, bgPane.Margin.Right, bgPane.Margin.Bottom);
}
catch { }
}
}
}
|
using System;
using System.Diagnostics;
namespace Oragon.Architecture.IO.Path
{
partial class PathHelpers
{
#region Private Classes
private sealed class RelativeFilePath : RelativePathBase, IRelativeFilePath
{
#region Internal Constructors
internal RelativeFilePath(string pathString)
: base(pathString)
{
Debug.Assert(pathString != null);
Debug.Assert(pathString.Length > 0);
Debug.Assert(pathString.<API key>());
}
#endregion Internal Constructors
#region Public Properties
public string FileExtension { get { return FileNameHelpers.<API key>(m_PathString); } }
// File Name and File Name Extension
public string FileName { get { return FileNameHelpers.GetFileName(m_PathString); } }
public string <API key> { get { return FileNameHelpers.<API key>(m_PathString); } }
// IsFilePath ; IsDirectoryPath
public override bool IsDirectoryPath { get { return false; } }
public override bool IsFilePath { get { return true; } }
#endregion Public Properties
#region Public Methods
public override IAbsolutePath GetAbsolutePathFrom(<API key> path)
{
return (this as IRelativeFilePath).GetAbsolutePathFrom(path);
}
public <API key> <API key>(string directoryName)
{
Debug.Assert(directoryName != null); // Enforced by contract
Debug.Assert(directoryName.Length > 0); // Enforced by contract
IDirectoryPath path = PathBrowsingHelpers.<API key>(this, directoryName);
var pathTyped = path as <API key>;
Debug.Assert(pathTyped != null);
return pathTyped;
}
public IRelativeFilePath <API key>(string fileName)
{
Debug.Assert(fileName != null); // Enforced by contract
Debug.Assert(fileName.Length > 0); // Enforced by contract
IFilePath path = PathBrowsingHelpers.<API key>(this, fileName);
var pathTyped = path as IRelativeFilePath;
Debug.Assert(pathTyped != null);
return pathTyped;
}
public bool HasExtension(string extension)
{
// All these 3 assertions have been checked by contract!
Debug.Assert(extension != null);
Debug.Assert(extension.Length >= 2);
Debug.Assert(extension[0] == '.');
return FileNameHelpers.HasExtension(m_PathString, extension);
}
IDirectoryPath IFilePath.<API key>(string directoryName)
{
Debug.Assert(directoryName != null); // Enforced by contract
Debug.Assert(directoryName.Length > 0); // Enforced by contract
return this.<API key>(directoryName);
}
// Explicit Impl methods
IFilePath IFilePath.<API key>(string fileName)
{
Debug.Assert(fileName != null); // Enforced by contract
Debug.Assert(fileName.Length > 0); // Enforced by contract
return this.<API key>(fileName);
}
IFilePath IFilePath.UpdateExtension(string newExtension)
{
// All these 3 assertions have been checked by contract!
Debug.Assert(newExtension != null);
Debug.Assert(newExtension.Length >= 2);
Debug.Assert(newExtension[0] == '.');
return this.UpdateExtension(newExtension);
}
// Absolute/Relative pathString conversion
IAbsoluteFilePath IRelativeFilePath.GetAbsolutePathFrom(<API key> path)
{
Debug.Assert(path != null); // Enforced by contracts!
string pathAbsolute, failureReason;
if (!<API key>.<API key>(path, this, out pathAbsolute, out failureReason))
{
throw new ArgumentException(failureReason);
}
Debug.Assert(pathAbsolute != null);
Debug.Assert(pathAbsolute.Length > 0);
return (pathAbsolute + MiscHelpers.DIR_SEPARATOR_CHAR + this.FileName).ToAbsoluteFilePath();
}
// Path Browsing facilities
public IRelativeFilePath UpdateExtension(string newExtension)
{
// All these 3 assertions have been checked by contract!
Debug.Assert(newExtension != null);
Debug.Assert(newExtension.Length >= 2);
Debug.Assert(newExtension[0] == '.');
string pathString = PathBrowsingHelpers.UpdateExtension(this, newExtension);
Debug.Assert(pathString.<API key>());
return new RelativeFilePath(pathString);
}
#endregion Public Methods
}
#endregion Private Classes
}
}
|
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.05.03 at 03:15:27 PM EDT
package API.amazon.mws.xml.JAXB;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "cdrh_classification")
public class CdrhClassification {
@XmlElement(required = true)
protected CdrhClassification.Value value;
@XmlAttribute(name = "delete")
protected BooleanType delete;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link CdrhClassification.Value }
*
*/
public CdrhClassification.Value getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link CdrhClassification.Value }
*
*/
public void setValue(CdrhClassification.Value value) {
this.value = value;
}
/**
* Gets the value of the delete property.
*
* @return
* possible object is
* {@link BooleanType }
*
*/
public BooleanType getDelete() {
return delete;
}
/**
* Sets the value of the delete property.
*
* @param value
* allowed object is
* {@link BooleanType }
*
*/
public void setDelete(BooleanType value) {
this.delete = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <simpleContent>
* <extension base="<>String200Type">
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
public static class Value {
@XmlValue
protected String value;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
}
}
|
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace Marius.Html.Hap
{
<summary>
Represents a base class for fragments in a mixed code document.
</summary>
public abstract class <API key>
{
#region Fields
internal MixedCodeDocument Doc;
private string _fragmentText;
internal int Index;
internal int Length;
private int _line;
internal int _lineposition;
internal <API key> _type;
#endregion
#region Constructors
internal <API key>(MixedCodeDocument doc, <API key> type)
{
Doc = doc;
_type = type;
switch (type)
{
case <API key>.Text:
Doc._textfragments.Append(this);
break;
case <API key>.Code:
Doc._codefragments.Append(this);
break;
}
Doc._fragments.Append(this);
}
#endregion
#region Properties
<summary>
Gets the fragement text.
</summary>
public string FragmentText
{
get
{
if (_fragmentText == null)
{
_fragmentText = Doc._text.Substring(Index, Length);
}
return FragmentText;
}
internal set { _fragmentText = value; }
}
<summary>
Gets the type of fragment.
</summary>
public <API key> FragmentType
{
get { return _type; }
}
<summary>
Gets the line number of the fragment.
</summary>
public int Line
{
get { return _line; }
internal set { _line = value; }
}
<summary>
Gets the line position (column) of the fragment.
</summary>
public int LinePosition
{
get { return _lineposition; }
}
<summary>
Gets the fragment position in the document's stream.
</summary>
public int StreamPosition
{
get { return Index; }
}
#endregion
}
}
|
import React from 'react'
import { User } from '../../lib/accounts/users'
import styled from '../../lib/styled'
import MdiIcon from '@mdi/react'
import { mdiAccount } from '@mdi/js'
import { <API key> } from './styled'
import { useTranslation } from 'react-i18next'
interface UserProps {
user: User
signout: (user: User) => void
}
const Container = styled.div`
margin-bottom: 8px;
`
export default ({ user, signout }: UserProps) => {
const { t } = useTranslation()
return (
<Container>
<MdiIcon path={mdiAccount} size='80px' />
<p>{user.name}</p>
<<API key> onClick={() => signout(user)}>
{t('general.signOut')}
</<API key>>
</Container>
)
}
|
#include "TextItem.h"
#include <QPainter>
#include <QFont>
#include <QDebug>
TextItem::TextItem(const QString& text, QGraphicsLayoutItem *parent)
: BaseItem(parent)
{
_text = text;
QFont font;
font.setPointSize(11);
font.setBold(false);
setFont(font);
}
TextItem::~TextItem()
{
}
void TextItem::setFont(const QFont &font)
{
_font = font;
QFontMetrics fm(_font);
}
QSizeF TextItem::measureSize() const
{
QFontMetrics fm(_font);
const QSizeF& size = fm.size(Qt::TextExpandTabs, _text);
// NOTE: flag Qt::TextSingleLine ignores newline characters.
return size;
}
void TextItem::draw(QPainter *painter, const QRectF& bounds)
{
painter->setFont(_font);
// TODO: mozno bude treba specialne handlovat novy riadok
painter->drawText(bounds, _text);
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>LCOV - coverage.infosrc/core</title>
<link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>
<body>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="title">LCOV - code coverage report</td></tr>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
<tr>
<td width="100%">
<table cellpadding=1 border=0 width="100%">
<tr>
<td width="10%" class="headerItem">Current view:</td>
<td width="35%" class="headerValue"><a href="../../index.html">top level</a> - src/core</td>
<td width="5%"></td>
<td width="15%"></td>
<td width="10%" class="headerCovTableHead">Hit</td>
<td width="10%" class="headerCovTableHead">Total</td>
<td width="15%" class="headerCovTableHead">Coverage</td>
</tr>
<tr>
<td class="headerItem">Test:</td>
<td class="headerValue">coverage.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">193</td>
<td class="headerCovTableEntry">220</td>
<td class="<API key>">87.7 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2013-01-10</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">23</td>
<td class="headerCovTableEntry">26</td>
<td class="<API key>">88.5 %</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="headerItem">Branches:</td>
<td class="headerCovTableEntry">20</td>
<td class="headerCovTableEntry">24</td>
<td class="<API key>">83.3 %</td>
</tr>
<tr><td><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
</table>
</td>
</tr>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
</table>
<center>
<table width="80%" cellpadding=1 cellspacing=1 border=0>
<tr>
<td width="44%"><br></td>
<td width="8%"></td>
<td width="8%"></td>
<td width="8%"></td>
<td width="8%"></td>
<td width="8%"></td>
<td width="8%"></td>
<td width="8%"></td>
</tr>
<tr>
<td class="tableHead">Filename <span class="tableHeadSort"><img src="../../glass.png" width=10 height=14 alt="Sort by name" title="Sort by name" border=0></span></td>
<td class="tableHead" colspan=3>Line Coverage <span class="tableHeadSort"><a href="index-sort-l.html"><img src="../../updown.png" width=10 height=14 alt="Sort by line coverage" title="Sort by line coverage" border=0></a></span></td>
<td class="tableHead" colspan=2>Functions <span class="tableHeadSort"><a href="index-sort-f.html"><img src="../../updown.png" width=10 height=14 alt="Sort by function coverage" title="Sort by function coverage" border=0></a></span></td>
<td class="tableHead" colspan=2>Branches <span class="tableHeadSort"><a href="index-sort-b.html"><img src="../../updown.png" width=10 height=14 alt="Sort by branch coverage" title="Sort by branch coverage" border=0></a></span></td>
</tr>
<tr>
<td class="coverFile"><a href="dvm.c.gcov.html">dvm.c</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../emerald.png" width=91 height=10 alt="91.4%"><img src="../../snow.png" width=9 height=10 alt="91.4%"></td></tr></table>
</td>
<td class="coverPerHi">91.4 %</td>
<td class="coverNumHi">128 / 140</td>
<td class="coverPerHi">92.3 %</td>
<td class="coverNumHi">12 / 13</td>
<td class="coverPerMed">88.9 %</td>
<td class="coverNumMed">16 / 18</td>
</tr>
<tr>
<td class="coverFile"><a href="vmbase.c.gcov.html">vmbase.c</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../amber.png" width=81 height=10 alt="81.2%"><img src="../../snow.png" width=19 height=10 alt="81.2%"></td></tr></table>
</td>
<td class="coverPerMed">81.2 %</td>
<td class="coverNumMed">65 / 80</td>
<td class="coverPerMed">84.6 %</td>
<td class="coverNumMed">11 / 13</td>
<td class="coverPerLo">66.7 %</td>
<td class="coverNumLo">4 / 6</td>
</tr>
</table>
</center>
<br>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
<tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php">LCOV version 1.9</a></td></tr>
</table>
<br>
</body>
</html>
|
import {writeFile} from 'fs-promise';
import {get, has, merge, set} from 'lodash/fp';
import flatten from 'flat';
import fs from 'fs';
import path from 'path';
const data = new WeakMap();
const initial = new WeakMap();
export default class Config {
constructor(d) {
data.set(this, d);
initial.set(this, Object.assign({}, d));
}
clone() {
return Object.assign({}, data.get(this));
}
get(keypath) {
return get(keypath, data.get(this));
}
has(keypath) {
return has(keypath, data.get(this));
}
inspect() {
return data.get(this);
}
merge(extra) {
data.set(this, merge(data.get(this), extra));
}
set(keypath, value) {
return set(keypath, data.get(this), value);
}
async save() {
const out = this.toString();
return await writeFile(`.boilerizerc`, out);
}
toJSON() {
const keys = Object.keys(flatten(data.get(this), {safe: true}));
const init = initial.get(this);
let target;
try {
const filepath = path.join(process.cwd(), `.boilerizerc`);
// Using sync here because toJSON can't have async functions in it
// <API key> no-sync
const raw = fs.readFileSync(filepath, `utf8`);
target = JSON.parse(raw);
}
catch (e) {
if (e.code !== `ENOENT`) {
console.error(e);
throw e;
}
target = {};
}
return keys.reduce((acc, key) => {
if (!has(key, init) || has(key, target)) {
const val = this.get(key);
acc = set(key, val, acc);
}
return acc;
}, target);
}
toString() {
return JSON.stringify(this, null, 2);
}
}
|
package net.sourceforge.pmd.lang.dfa.report;
public class ClassNode extends AbstractReportNode {
private String className;
public ClassNode(String className) {
this.className = className;
}
public String getClassName() {
return className;
}
public boolean equalsNode(AbstractReportNode arg0) {
if (!(arg0 instanceof ClassNode)) {
return false;
}
return ((ClassNode) arg0).getClassName().equals(className);
}
}
|
<?php namespace Helpers;
use Drivers\Templates\Implementation;
use Exceptions\BaseException;
use Drivers\Cache\CacheBase;
use Drivers\Registry;
class View {
/**
*This is the constructor class. We make this private to avoid creating instances of
*this object
*
*@param null
*@return void
*/
private function __construct() {}
/**
*This method stops creation of a copy of this object by making it private
*
*@param null
*@return void
*
*/
private function __clone(){}
/**
*This method parses the input variables and loads the specified views
*
*@param string $filePath the string that specifies the view file to load
*@param array $data an array with variables to be passed to the view file
*@return void This method does not return anything, it directly loads the view file
*@throws
*/
public static function render($filePath, array $data = null)
{
//this try block is excecuted to enable throwing and catching of errors as appropriate
try {
//get the variables passed and make them available to the view
if ( $data != null)
{
//loop through the array setting the respective variables
foreach ($data as $key => $value)
{
$$key = $value;
}
}
//get the parsed contents of the template file
$contents = self::getContents($filePath);
//start the output buffer
ob_start();
//evaluate the contents of this view file
eval("?>" . $contents . "<?");
//get the evaluated contents
$contents = ob_get_contents();
//clean the output buffer
ob_end_clean();
//return the evaluated contents
echo $contents;
//stop further script execution
exit();
}
catch(BaseException $e) {
//echo $e->getMessage();
$e->show();
}
catch(Exception $e) {
echo $e->getMessage();
}
}
/**
*This method converts the code into valid php code
*
*@param string $file The name of the view whose contant is to be parsed
*@return string $parsedContent The parsed content of the template file
*/
public static function getContents($filePath)
{
//compose the file full path
$path = Path::view($filePath);
//get an instance of the view template class
$template = Registry::get('template');
//get the compiled file contents
$contents = $template->compiled($path);
//return the compiled template file contents
return $contents;
}
}
|
package pl.mmorpg.prototype.server.objects.monsters.properties.builders;
import pl.mmorpg.prototype.clientservercommon.packets.monsters.properties.MonsterProperties;
public class <API key> extends MonsterProperties.Builder
{
@Override
public MonsterProperties build()
{
experienceGain(100)
.hp(100)
.strength(5)
.level(1);
return super.build();
}
}
|
using Microsoft.DataTransfer.AzureTable.Source;
using System;
using System.Globalization;
namespace Microsoft.DataTransfer.AzureTable
{
<summary>
Contains dynamic resources for data adapters configuration.
</summary>
public static class <API key>
{
<summary>
Gets the description for source internal fields configuration property.
</summary>
public static string <API key>
{
get
{
return Format(<API key>.<API key>, Defaults.Current.<API key>,
String.Join(", ", Enum.GetNames(typeof(<API key>))));
}
}
private static string Format(string format, params object[] args)
{
return String.Format(CultureInfo.InvariantCulture, format, args);
}
}
}
|
// Karma configuration
// Generated on Thu Aug 21 2014 10:24:39 GMT+0200 (CEST)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
frameworks: ['mocha', 'chai-jquery', 'jquery-1.8.3', 'sinon-chai'],
plugins: [
'karma-mocha',
'karma-chai',
'karma-sinon-chai',
'<API key>',
'<API key>',
'karma-jquery',
'karma-chai-jquery',
'<API key>'
],
// list of files / patterns to load in the browser
files: [
'bower/angular/angular.js',
'bower/angular-sanitize/angular-sanitize.js',
'bower/angular-mocks/angular-mocks.js',
'dist/ac-components.min.js',
'test/unit*.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
preprocessors: {
},
// test results reporter to use
// possible values: 'dots', 'progress'
reporters: ['mocha'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};
|
using System.Threading;
using CodeTiger;
using Xunit;
namespace UnitTests.CodeTiger
{
public class LazyTests
{
public class Create1
{
[Fact]
public void <API key>()
{
var target = Lazy.Create<object>();
Assert.False(target.IsValueCreated);
}
[Fact]
public void <API key>()
{
var target = Lazy.Create<object>();
Assert.NotNull(target.Value);
Assert.Equal(typeof(object), target.Value.GetType());
}
[Fact]
public void <API key>()
{
var target = Lazy.Create<bool>();
Assert.Equal(new bool(), target.Value);
}
[Fact]
public void <API key>()
{
var target = Lazy.Create<decimal>();
Assert.Equal(new decimal(), target.Value);
}
}
public class Create1_Boolean
{
[Theory]
[InlineData(false)]
[InlineData(true)]
public void <API key>(bool isThreadSafe)
{
var target = Lazy.Create<object>(isThreadSafe);
Assert.False(target.IsValueCreated);
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void <API key>(bool isThreadSafe)
{
var target = Lazy.Create<object>(isThreadSafe);
Assert.NotNull(target.Value);
Assert.Equal(typeof(object), target.Value.GetType());
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void <API key>(bool isThreadSafe)
{
var target = Lazy.Create<bool>(isThreadSafe);
Assert.Equal(new bool(), target.Value);
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void <API key>(bool isThreadSafe)
{
var target = Lazy.Create<decimal>(isThreadSafe);
Assert.Equal(new decimal(), target.Value);
}
}
public class <API key>
{
[Theory]
[InlineData(<API key>.None)]
[InlineData(<API key>.PublicationOnly)]
[InlineData(<API key>.<API key>)]
public void <API key>(<API key> mode)
{
var target = Lazy.Create<object>(mode);
Assert.False(target.IsValueCreated);
}
[Theory]
[InlineData(<API key>.None)]
[InlineData(<API key>.PublicationOnly)]
[InlineData(<API key>.<API key>)]
public void <API key>(<API key> mode)
{
var target = Lazy.Create<object>(mode);
Assert.NotNull(target.Value);
Assert.Equal(typeof(object), target.Value.GetType());
}
[Theory]
[InlineData(<API key>.None)]
[InlineData(<API key>.PublicationOnly)]
[InlineData(<API key>.<API key>)]
public void <API key>(<API key> mode)
{
var target = Lazy.Create<bool>(mode);
Assert.Equal(new bool(), target.Value);
}
[Theory]
[InlineData(<API key>.None)]
[InlineData(<API key>.PublicationOnly)]
[InlineData(<API key>.<API key>)]
public void <API key>(<API key> mode)
{
var target = Lazy.Create<decimal>(mode);
Assert.Equal(new decimal(), target.Value);
}
}
public class <API key>
{
[Fact]
public void <API key>()
{
object expected = new object();
var target = Lazy.Create(() => expected);
Assert.False(target.IsValueCreated);
}
[Fact]
public void <API key>()
{
object expected = new object();
var target = Lazy.Create(() => expected);
Assert.Same(expected, target.Value);
}
}
public class <API key>
{
[Theory]
[InlineData(false)]
[InlineData(true)]
public void <API key>(bool isThreadSafe)
{
object expected = new object();
var target = Lazy.Create(() => expected, isThreadSafe);
Assert.False(target.IsValueCreated);
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void <API key>(bool isThreadSafe)
{
object expected = new object();
var target = Lazy.Create(() => expected, isThreadSafe);
Assert.Same(expected, target.Value);
}
}
public class <API key>
{
[Theory]
[InlineData(<API key>.None)]
[InlineData(<API key>.PublicationOnly)]
[InlineData(<API key>.<API key>)]
public void <API key>(<API key> mode)
{
object expected = new object();
var target = Lazy.Create(() => expected, mode);
Assert.False(target.IsValueCreated);
}
[Theory]
[InlineData(<API key>.None)]
[InlineData(<API key>.PublicationOnly)]
[InlineData(<API key>.<API key>)]
public void <API key>(<API key> mode)
{
object expected = new object();
var target = Lazy.Create(() => expected, mode);
Assert.Same(expected, target.Value);
}
}
}
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/><!-- using block title in layout.dt--><!-- using block ddox.defs in ddox.layout.dt--><!-- using block ddox.title in ddox.layout.dt-->
<title>Function <API key></title>
<link rel="stylesheet" type="text/css" href="../../styles/ddox.css"/>
<link rel="stylesheet" href="../../prettify/prettify.css" type="text/css"/>
<script type="text/javascript" src="../../scripts/jquery.js"></script>
<script type="text/javascript" src="../../prettify/prettify.js"></script>
<script type="text/javascript" src="../../scripts/ddox.js"></script>
</head>
<body onload="prettyPrint(); setupDdox();">
<nav id="main-nav"><!-- using block navigation in layout.dt-->
<ul class="tree-view">
<li class="collapsed tree-view">
<a href="#" class="package">components</a>
<ul class="tree-view">
<li>
<a href="../../components/animation.html" class=" module">animation</a>
</li>
<li>
<a href="../../components/assets.html" class=" module">assets</a>
</li>
<li>
<a href="../../components/camera.html" class=" module">camera</a>
</li>
<li>
<a href="../../components/component.html" class=" module">component</a>
</li>
<li>
<a href="../../components/lights.html" class=" module">lights</a>
</li>
<li>
<a href="../../components/material.html" class=" module">material</a>
</li>
<li>
<a href="../../components/mesh.html" class=" module">mesh</a>
</li>
<li>
<a href="../../components/userinterface.html" class=" module">userinterface</a>
</li>
</ul>
</li>
<li class="collapsed tree-view">
<a href="#" class="package">core</a>
<ul class="tree-view">
<li>
<a href="../../core/dgame.html" class=" module">dgame</a>
</li>
<li>
<a href="../../core/gameobject.html" class=" module">gameobject</a>
</li>
<li>
<a href="../../core/prefabs.html" class=" module">prefabs</a>
</li>
<li>
<a href="../../core/properties.html" class=" module">properties</a>
</li>
<li>
<a href="../../core/reflection.html" class=" module">reflection</a>
</li>
<li>
<a href="../../core/scene.html" class=" module">scene</a>
</li>
</ul>
</li>
<li class="collapsed tree-view">
<a href="#" class="package">graphics</a>
<ul class="tree-view">
<li class="collapsed tree-view">
<a href="#" class="package">adapters</a>
<ul class="tree-view">
<li>
<a href="../../graphics/adapters/adapter.html" class=" module">adapter</a>
</li>
<li>
<a href="../../graphics/adapters/linux.html" class=" module">linux</a>
</li>
<li>
<a href="../../graphics/adapters/mac.html" class=" module">mac</a>
</li>
<li>
<a href="../../graphics/adapters/win32.html" class=" module">win32</a>
</li>
</ul>
</li>
<li class="collapsed tree-view">
<a href="#" class="package">shaders</a>
<ul class="tree-view">
<li class="collapsed tree-view">
<a href="#" class="package">glsl</a>
<ul class="tree-view">
<li>
<a href="../../graphics/shaders/glsl/ambientlight.html" class=" module">ambientlight</a>
</li>
<li>
<a href="../../graphics/shaders/glsl/animatedgeometry.html" class=" module">animatedgeometry</a>
</li>
<li>
<a href="../../graphics/shaders/glsl/directionallight.html" class=" module">directionallight</a>
</li>
<li>
<a href="../../graphics/shaders/glsl/geometry.html" class=" module">geometry</a>
</li>
<li>
<a href="../../graphics/shaders/glsl/pointlight.html" class=" module">pointlight</a>
</li>
<li>
<a href="../../graphics/shaders/glsl/shadowmap.html" class=" module">shadowmap</a>
</li>
<li>
<a href="../../graphics/shaders/glsl/userinterface.html" class=" module">userinterface</a>
</li>
</ul>
</li>
<li>
<a href="../../graphics/shaders/glsl.html" class=" module">glsl</a>
</li>
<li>
<a href="../../graphics/shaders/shaders.html" class=" module">shaders</a>
</li>
</ul>
</li>
<li>
<a href="../../graphics/adapters.html" class=" module">adapters</a>
</li>
<li>
<a href="../../graphics/graphics.html" class=" module">graphics</a>
</li>
<li>
<a href="../../graphics/shaders.html" class=" module">shaders</a>
</li>
</ul>
</li>
<li class=" tree-view">
<a href="#" class="package">utility</a>
<ul class="tree-view">
<li>
<a href="../../utility/awesomium.html" class="selected module">awesomium</a>
</li>
<li>
<a href="../../utility/concurrency.html" class=" module">concurrency</a>
</li>
<li>
<a href="../../utility/config.html" class=" module">config</a>
</li>
<li>
<a href="../../utility/filepath.html" class=" module">filepath</a>
</li>
<li>
<a href="../../utility/input.html" class=" module">input</a>
</li>
<li>
<a href="../../utility/output.html" class=" module">output</a>
</li>
<li>
<a href="../../utility/resources.html" class=" module">resources</a>
</li>
<li>
<a href="../../utility/string.html" class=" module">string</a>
</li>
<li>
<a href="../../utility/tasks.html" class=" module">tasks</a>
</li>
<li>
<a href="../../utility/time.html" class=" module">time</a>
</li>
</ul>
</li>
<li>
<a href="../../components.html" class=" module">components</a>
</li>
<li>
<a href="../../core.html" class=" module">core</a>
</li>
<li>
<a href="../../graphics.html" class=" module">graphics</a>
</li>
<li>
<a href="../../utility.html" class=" module">utility</a>
</li>
</ul>
<noscript>
<p style="color: red">The search functionality needs JavaScript enabled</p>
</noscript>
<div id="symbolSearchPane" style="display: none">
<p>
<input id="symbolSearch" type="text" placeholder="Search for symbols" onchange="performSymbolSearch(24);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"/>
</p>
<ul id="symbolSearchResults" style="display: none"></ul>
<script type="application/javascript" src="../../symbols.js"></script>
<script type="application/javascript">
//<![CDATA[
var symbolSearchRootDir = "../../"; $('#symbolSearchPane').show();
</script>
</div>
</nav>
<div id="main-contents">
<h1>Function <API key></h1><!-- using block body in layout.dt--><!-- Default block ddox.description in ddox.layout.dt--><!-- Default block ddox.sections in ddox.layout.dt--><!-- using block ddox.members in ddox.layout.dt-->
<p> Assign a <a href="../../utility/awesomium/<API key>.html#callback"><code class="prettyprint lang-d">callback</code></a> function to be notified when the target URL has changed.
This is usually the result of hovering over a link on the page.
</p>
<section>
<p> @param <a href="../../utility/awesomium/<API key>.html#webview"><code class="prettyprint lang-d">webview</code></a> The WebView instance.
</p>
<p> @param <a href="../../utility/awesomium/<API key>.html#callback"><code class="prettyprint lang-d">callback</code></a> A function pointer to the <a href="../../utility/awesomium/<API key>.html#callback"><code class="prettyprint lang-d">callback</code></a>.
</p>
</section>
<section>
<h2>Prototype</h2>
<pre class="code prettyprint lang-d prototype">
void <API key>(
<a href="../../utility/awesomium/awe_webview.html">awe_webview</a>* webview,
extern(C) void function(<a href="../../utility/awesomium/awe_webview.html">awe_webview</a>*, const(<a href="../../utility/awesomium/awe_string.html">awe_string</a>)*) callback
) extern(C);</pre>
</section>
<section>
<h2>Authors</h2><!-- using block ddox.authors in ddox.layout.dt-->
</section>
<section>
<h2>Copyright</h2>
</section>
<section>
<h2>License</h2>
</section>
</div>
</body>
</html>
|
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
func main() {
sc := bufio.NewScanner(os.Stdin)
sc.Split(bufio.ScanWords)
n := nextInt(sc)
a := nextInt(sc)
b := nextInt(sc)
answer := 0
for i := 1; i <= n; i++ {
sum := 0
for _, s := range fmt.Sprintf("%d", i) {
x, _ := strconv.Atoi(string(s))
sum = sum + x
}
if a <= sum && sum <= b {
answer = answer + i
}
}
fmt.Println(answer)
}
func nextString(sc *bufio.Scanner) string {
sc.Scan()
return sc.Text()
}
func nextNumber(sc *bufio.Scanner) float64 {
sc.Scan()
f, err := strconv.ParseFloat(sc.Text(), 32)
if err != nil {
panic(err)
}
return f
}
func nextInt(sc *bufio.Scanner) int {
sc.Scan()
n, err := strconv.Atoi(sc.Text())
if err != nil {
panic(err)
}
return n
}
func printArray(xs []int) {
fmt.Println(strings.Trim(fmt.Sprint(xs), "[]"))
}
func debugPrintf(format string, a ...interface{}) {
fmt.Fprintf(os.Stderr, format, a...)
}
|
export default function _isString(obj) {
return toString.call(obj) === '[object String]'
}
|
<!-- description -->
## Install
bash
$ npm install cortex-ls --save
## Usage
js
var cortex_ls = require('cortex-ls);
## Licence
MIT
<!-- do not want to make nodeinit to complicated, you can edit this whenever you want. -->
|
import Vue from 'vue'
import Router from 'vue-router'
import index from '../components/index'
import project from '../components/project/index'
import proAdd from '../components/project/proAdd'
import proList from '../components/project/proList'
import apiList from '../components/project/apiList'
import apiView from '../components/project/apiView'
import apiEdit from '../components/project/apiEdit'
import apiHistory from '../components/project/apiHistory'
import test from '../components/test'
import message from '../components/message'
import member from '../components/member'
import doc from '../components/doc'
import set from '../components/set'
import userSet from '../components/user/set'
import login from '../components/user/login'
Vue.use(Router)
const router:any = new Router({
mode: 'history',
routes: [
{
path: '/',
name: 'index',
component: index
},
{
path: '/project',
name: 'project',
component: project,
children: [
{
path: 'list',
name: 'proList',
component: proList,
meta: {
requireLogin: true
}
},
{
path: 'add',
name: 'proAdd',
component: proAdd,
meta: {
requireLogin: true
}
},
{
path: ':proId/edit',
name: 'proEdit',
component: proAdd,
meta: {
requireLogin: true
}
},
{
path: ':proId/api',
name: 'proApiList',
component: apiList,
children: [
{
path: 'add',
name: 'apiAdd',
component: apiEdit,
meta: {
requireLogin: true
}
},
{
path: ':apiId/detail',
name: 'apiView',
component: apiView,
meta: {
requireLogin: true
},
},
{
path: ':apiId/edit',
name: 'apiEdit',
component: apiEdit,
meta: {
requireLogin: true
}
},
{
path: ':apiId/history',
name: 'apiHistory',
component: apiHistory,
meta: {
requireLogin: true
}
}
]
}
]
},
{
path: '/test',
name: 'test',
component: test,
meta: {
requireLogin: true
}
},
{
path: '/message',
name: 'message',
component: message,
meta: {
requireLogin: true
}
},
{
path: '/member',
name: 'member',
component: member,
meta: {
requireLogin: true
}
},
{
path: '/doc',
name: 'doc',
component: doc
},
{
path: '/set',
name: 'set',
component: set,
meta: {
requireLogin: true
}
},
{
path: '/user/set',
name: 'userSet',
component: userSet,
meta: {
requireLogin: true
}
},
{
path: '/user/login',
name: 'login',
component: login
}
]
})
router.beforeEach((to:any, from:any, next:any) => {
if (to.matched.some((res:any) => res.meta.requireLogin)) {
if (localStorage.getItem('token')) {
next()
} else {
next('/user/login')
}
} else {
next()
}
})
export default router
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.