answer stringlengths 15 1.25M |
|---|
using System;
class Program
{
static void Main()
{
// \uNNNN = unicode numbers
//int intNum = int.Parse(Console.ReadLine());
int intNum = 72;
char intToChar = (char)intNum;
//'\u0048';
//string stringUnicode = unicode.ToString();
Console.WriteLine("symbol={0}, numberUnicode={1}, hex=0x{2:x}", intToChar, (int)intToChar, (int)intToChar);// or use intNum without cast
string intToHex = intNum.ToString("X");
Console.WriteLine(@"char value '\u{0:D4}'", intToHex);
}
} |
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_03) on Thu Aug 11 12:59:23 EDT 2011 -->
<TITLE>
H-Index
</TITLE>
<META NAME="date" CONTENT="2011-08-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="H-Index";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-6.html"><B>PREV LETTER</B></A>
<A HREF="index-8.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-7.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-7.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<A HREF="index-1.html">A</A> <A HREF="index-2.html">C</A> <A HREF="index-3.html">D</A> <A HREF="index-4.html">E</A> <A HREF="index-5.html">F</A> <A HREF="index-6.html">G</A> <A HREF="index-7.html">H</A> <A HREF="index-8.html">I</A> <A HREF="index-9.html">L</A> <A HREF="index-10.html">M</A> <A HREF="index-11.html">N</A> <A HREF="index-12.html">O</A> <A HREF="index-13.html">P</A> <A HREF="index-14.html">R</A> <A HREF="index-15.html">S</A> <A HREF="index-16.html">T</A> <A HREF="index-17.html">V</A> <A HREF="index-18.html">W</A> <HR>
<A NAME="_H_"></A><H2>
<B>H</B></H2>
<DL>
<DT><A HREF="../lizardSpock/SLArena.html#highlightColor"><B>highlightColor</B></A> -
Variable in class lizardSpock.<A HREF="../lizardSpock/SLArena.html" title="class in lizardSpock">SLArena</A>
<DD>The color for text highlighting
</DL>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-6.html"><B>PREV LETTER</B></A>
<A HREF="index-8.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-7.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-7.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<A HREF="index-1.html">A</A> <A HREF="index-2.html">C</A> <A HREF="index-3.html">D</A> <A HREF="index-4.html">E</A> <A HREF="index-5.html">F</A> <A HREF="index-6.html">G</A> <A HREF="index-7.html">H</A> <A HREF="index-8.html">I</A> <A HREF="index-9.html">L</A> <A HREF="index-10.html">M</A> <A HREF="index-11.html">N</A> <A HREF="index-12.html">O</A> <A HREF="index-13.html">P</A> <A HREF="index-14.html">R</A> <A HREF="index-15.html">S</A> <A HREF="index-16.html">T</A> <A HREF="index-17.html">V</A> <A HREF="index-18.html">W</A> <HR>
</BODY>
</HTML> |
namespace <API key>
{
partial class Training
{
<summary>
Required designer variable.
</summary>
private System.ComponentModel.IContainer components = null;
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
private void InitializeComponent()
{
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.SuspendLayout();
// progressBar1
this.progressBar1.Location = new System.Drawing.Point(56, 100);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(763, 46);
this.progressBar1.TabIndex = 0;
this.progressBar1.Click += new System.EventHandler(this.progressBar1_Click);
// label1
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 50F);
this.label1.Location = new System.Drawing.Point(43, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(783, 76);
this.label1.TabIndex = 1;
this.label1.Text = "Training neural network...";
// textBox1
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.textBox1.Location = new System.Drawing.Point(305, 109);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(151, 53);
this.textBox1.TabIndex = 2;
// textBox2
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.textBox2.Location = new System.Drawing.Point(650, 112);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(151, 53);
this.textBox2.TabIndex = 3;
// label2
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label2.Location = new System.Drawing.Point(97, 187);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(174, 46);
this.label2.TabIndex = 4;
this.label2.Text = "Lambda:";
// label3
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label3.Location = new System.Drawing.Point(462, 112);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(194, 46);
this.label3.TabIndex = 5;
this.label3.Text = "Iterations:";
// button1
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
this.button1.Location = new System.Drawing.Point(491, 186);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(135, 54);
this.button1.TabIndex = 6;
this.button1.Text = "Train";
this.button1.<API key> = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
// label4
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label4.Location = new System.Drawing.Point(12, 109);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(280, 46);
this.label4.TabIndex = 7;
this.label4.Text = "Learning Rate:\r\n";
// textBox3
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.textBox3.Location = new System.Drawing.Point(277, 184);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(151, 53);
this.textBox3.TabIndex = 8;
// label5
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F);
this.label5.Location = new System.Drawing.Point(49, 147);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(328, 39);
this.label5.TabIndex = 9;
this.label5.Text = "TASK IN PROCESS";
// Training
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(877, 242);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.label4);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.label5);
this.Name = "Training";
this.Text = "Training";
this.FormClosed += new System.Windows.Forms.<API key>(this.Training_FormClosed);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label5;
}
} |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class dashboard_m extends CI_Model{
// count all data
public function count_data($table,$cond){
$this->db->select('*');
$this->db->from($table);
$this->db->where($cond);
return $this->db->count_all_results();
}
// count all data END
} |
/** @constructor */
ScalaJS.c.<API key>$Chained = (function() {
ScalaJS.c.java_lang_Object.call(this);
this.h$1 = null
});
ScalaJS.c.<API key>$Chained.prototype = new ScalaJS.inheritable.java_lang_Object();
ScalaJS.c.<API key>$Chained.prototype.constructor = ScalaJS.c.<API key>$Chained;
ScalaJS.c.<API key>$Chained.prototype.hash__O__I = (function(v) {
return ScalaJS.modules.<API key>().byteswap32__I__I(this.h$1.hash__O__I(v))
});
ScalaJS.c.<API key>$Chained.prototype.<API key> = (function(h) {
this.h$1 = h;
ScalaJS.c.java_lang_Object.prototype.init___.call(this);
return this
});
ScalaJS.c.<API key>$Chained.prototype.hash__O__ = (function(v) {
return ScalaJS.bI(this.hash__O__I(v))
});
/** @constructor */
ScalaJS.inheritable.<API key>$Chained = (function() {
/*<skip>*/
});
ScalaJS.inheritable.<API key>$Chained.prototype = ScalaJS.c.<API key>$Chained.prototype;
ScalaJS.is.<API key>$Chained = (function(obj) {
return (!(!((obj && obj.$classData) && obj.$classData.ancestors.<API key>$Chained)))
});
ScalaJS.as.<API key>$Chained = (function(obj) {
if ((ScalaJS.is.<API key>$Chained(obj) || (obj === null))) {
return obj
} else {
ScalaJS.<API key>(obj, "scala.util.hashing.ByteswapHashing$Chained")
}
});
ScalaJS.isArrayOf.<API key>$Chained = (function(obj, depth) {
return (!(!(((obj && obj.$classData) && (obj.$classData.arrayDepth === depth)) && obj.$classData.arrayBase.ancestors.<API key>$Chained)))
});
ScalaJS.asArrayOf.<API key>$Chained = (function(obj, depth) {
if ((ScalaJS.isArrayOf.<API key>$Chained(obj, depth) || (obj === null))) {
return obj
} else {
ScalaJS.<API key>(obj, "Lscala.util.hashing.ByteswapHashing$Chained;", depth)
}
});
ScalaJS.data.<API key>$Chained = new ScalaJS.ClassTypeData({
<API key>$Chained: 0
}, false, "scala.util.hashing.ByteswapHashing$Chained", ScalaJS.data.java_lang_Object, {
<API key>$Chained: 1,
<API key>: 1,
scala_Serializable: 1,
<API key>: 1,
java_lang_Object: 1
});
ScalaJS.c.<API key>$Chained.prototype.$classData = ScalaJS.data.<API key>$Chained;
//@ sourceMappingURL=ByteswapHashing$Chained.js.map |
var foo = {
"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 25,
"height_cm": 167.64,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
},
"phoneNumbers": [
{ "type": "home", "number": "212 555-1234" },
{ "type": "fax", "number": "646 555-4567" }
],
"additionalInfo": null
};
var jsonString = JSON.stringify(foo);
console.log(jsonString);
console.log(typeof(jsonString));
var jsonObj = JSON.parse(jsonString);
console.log(jsonObj);
console.log(typeof(jsonObj)); |
#include <easylogging.h>
#include "core/overlay.h"
#include <cstdio>
#include <cmath>
static bool has_space(const glm::vec2& point,
const std::vector<glm::vec2>& points,
float min_dt) {
for (auto p : points) {
if (glm::length(point - p) < min_dt) {
return false;
}
}
return true;
}
/* Generates n random points in [-1, 1] spaced roughly min_dt apart. */
static std::vector<glm::vec2> gen_points(size_t n, float min_dt) {
std::vector<glm::vec2> points;
while (n > 0) {
auto point = glm::vec2((float)rand() / RAND_MAX * 2 - 1,
(float)rand() / RAND_MAX * 2 - 1);
if (has_space(point, points, min_dt)) {
points.push_back(point);
--n;
}
}
return points;
}
/* Returns a randomly selected disk radius with good distribution. */
static float disk_radius() {
float u = (float)rand() / RAND_MAX;
return 0.002f + sqrt(u) * 0.035f;
}
overlay::overlay(int density)
: m_shader("overlay.vert", "overlay.frag")
{
regenerate_film(density);
}
void overlay::regenerate_film(int density) {
m_film.clear();
srand(42);
auto points = gen_points(density, 0.075f);
srand(42);
for (auto point : points) {
m_film.push_back(std::make_pair(point, disk_radius()));
}
}
void overlay::render(const std::vector<light>& lights,
const gl::texture2D& occlusion,
const camera& camera,
float reflectivity) {
if (lights.size() > 8) {
LOG(WARNING) << "Maximum 8 lights! Extra lights ignored by overlay.";
}
/* Render a set of randomly distributed points with glBlend enabled. */
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glBlendFunc(GL_ONE, GL_ONE);
glViewport(0, 0, camera.dims().x, camera.dims().y);
m_shader.bind();
m_shader.set("viewproj", camera.proj() * camera.view());
m_shader.set("view_dir", glm::normalize(camera.dir()));
m_shader.set("view_pos", camera.pos());
m_shader.set("light_count", std::min((int)lights.size(), 8));
m_shader.set("reflectivity", reflectivity);
m_shader.set("occlusion", occlusion, 0, GL_NEAREST, GL_NEAREST);
m_shader.set("max_lights", 8);
for (int t = 0; t < std::min((int)lights.size(), 8); ++t) {
m_shader.set("lights[" + std::to_string(t) + "].pos",
lights[t].position);
}
float aspect = camera.aspect_ratio();
glBegin(GL_QUADS);
for (size_t t = 0; t < m_film.size(); ++t) {
glm::vec2 pos = m_film[t].first;
float radius = m_film[t].second;
glTexCoord2f(0, 1);
glVertex3f(pos.x - radius, (pos.y + radius) * aspect, 1);
glTexCoord2f(1, 1);
glVertex3f(pos.x + radius, (pos.y + radius) * aspect, 1);
glTexCoord2f(1, 0);
glVertex3f(pos.x + radius, (pos.y - radius) * aspect, 1);
glTexCoord2f(0, 0);
glVertex3f(pos.x - radius, (pos.y - radius) * aspect, 1);
}
glEnd();
m_shader.unbind();
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
} |
#!/bin/bash -ev
# Installation Script
# Written by: Tommy Lincoln <pajamapants3000@gmail.com>
# Dependencies
# Begin Required
#liblxqt-0.9.0
#lxqt_common-0.9.1
# End Required
# Begin Recommended
# End Recommended
# Begin Optional
# End Optional
# Begin Kernel
# End Kernel
# Installation
# Check for previous installation:
PROCEED="yes"
REINSTALL=0
grep "lxqt_session-" /list-$CHRISTENED"-"$SURNAME > /dev/null && ((\!$?)) &&\
REINSTALL=1 && echo "Previous installation detected, proceed?" && read PROCEED
[ $PROCEED = "yes" ] || [ $PROCEED = "y" ] || exit 0
# Download:
wget http://downloads.lxqt.org/lxqt/0.9.1/lxqt-session-0.9.0.tar.xz
# md5sum:
echo "<API key> lxqt-session-0.9.0.tar.xz" | md5sum -c ;\
( exit ${PIPESTATUS[0]} )
tar -xvf lxqt-session-0.9.0.tar.xz
cd lxqt-session-0.9.0
patch -p1 < ../patches/lxqt_session-0.9.0.patch
mkdir -v build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-<API key>=/opt/lxqt \
-DKF5_INCLUDE_DIR=/opt/kf5/include \
-<API key>=/opt/kf5/lib/cmake/KF5WindowSystem \
..
make
as_root make install
cd ../..
as_root rm -rf lxqt-session-0.9.0
# Add to installed list for this computer:
echo "lxqt_session-0.9.0" >> /list-$CHRISTENED"-"$SURNAME |
#!/usr/bin/env python2
import sys
import json
import struct
import subprocess
import shlex
def getMessage():
rawLength = sys.stdin.read(4)
if len(rawLength) == 0:
sys.exit(0)
messageLength = struct.unpack('@I', rawLength)[0]
message = sys.stdin.read(messageLength)
return json.loads(message)
while True:
mpv_args = getMessage()
if len(mpv_args) > 1:
args = shlex.split("mpv " + mpv_args)
subprocess.call(args)
sys.exit(0) |
#include <stdio.h>
#include <iostream>
#include "d3d11imports.hpp"
#include "d3d10state.hpp"
namespace d3dstate {
static void
dumpShaders(JSONWriter &json, ID3D11DeviceContext *pDeviceContext)
{
json.beginMember("shaders");
json.beginObject();
ID3D11VertexShader *pVertexShader = NULL;
pDeviceContext->VSGetShader(&pVertexShader, NULL, NULL);
if (pVertexShader) {
dumpShader<ID3D11DeviceChild>(json, "VS", pVertexShader);
pVertexShader->Release();
}
<API key> *pGeometryShader = NULL;
pDeviceContext->GSGetShader(&pGeometryShader, NULL, NULL);
if (pGeometryShader) {
dumpShader<ID3D11DeviceChild>(json, "GS", pGeometryShader);
pGeometryShader->Release();
}
ID3D11PixelShader *pPixelShader = NULL;
pDeviceContext->PSGetShader(&pPixelShader, NULL, NULL);
if (pPixelShader) {
dumpShader<ID3D11DeviceChild>(json, "PS", pPixelShader);
}
json.endObject();
json.endMember(); // shaders
}
void
dumpDevice(std::ostream &os, ID3D11DeviceContext *pDeviceContext)
{
JSONWriter json(os);
/* TODO */
json.beginMember("parameters");
json.beginObject();
json.endObject();
json.endMember(); // parameters
dumpShaders(json, pDeviceContext);
json.beginMember("textures");
json.beginObject();
json.endObject();
json.endMember(); // textures
dumpFramebuffer(json, pDeviceContext);
}
} /* namespace d3dstate */ |
require 'test_helper'
class <API key> < ActionController::TestCase
setup do
@detalle_arriendo = detalle_arriendos(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:detalle_arriendos)
end
test "should get new" do
get :new
assert_response :success
end
test "should create detalle_arriendo" do
assert_difference('DetalleArriendo.count') do
post :create, detalle_arriendo: { }
end
<API key> <API key>(assigns(:detalle_arriendo))
end
test "should show detalle_arriendo" do
get :show, id: @detalle_arriendo
assert_response :success
end
test "should get edit" do
get :edit, id: @detalle_arriendo
assert_response :success
end
test "should update detalle_arriendo" do
patch :update, id: @detalle_arriendo, detalle_arriendo: { }
<API key> <API key>(assigns(:detalle_arriendo))
end
test "should destroy detalle_arriendo" do
assert_difference('DetalleArriendo.count', -1) do
delete :destroy, id: @detalle_arriendo
end
<API key> <API key>
end
end |
// File: D3D10Misc.h
// Content: D3D10 Device Creation APIs
#ifndef __D3D10MISC_H__
#define __D3D10MISC_H__
#include "d3d10.h"
// ID3D10Blob:
// The buffer object is used by D3D10 to return arbitrary size data.
// GetBufferPointer -
// Returns a pointer to the beginning of the buffer.
// GetBufferSize -
// Returns the size of the buffer, in bytes.
typedef interface ID3D10Blob ID3D10Blob;
typedef interface ID3D10Blob *LPD3D10BLOB;
// {<API key>}
DEFINE_GUID(IID_ID3D10Blob,
0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
#undef INTERFACE
#define INTERFACE ID3D10Blob
DECLARE_INTERFACE_(ID3D10Blob, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3D10Blob
STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
STDMETHOD_(SIZE_T, GetBufferSize)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
// D3D10_DRIVER_TYPE
// This identifier is used to determine the implementation of Direct3D10
// to be used.
// Pass one of these values to D3D10CreateDevice
typedef enum D3D10_DRIVER_TYPE
{
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3,
<API key> = 5,
} D3D10_DRIVER_TYPE;
DEFINE_GUID(GUID_DeviceType,
0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6);
// D3D10CreateDevice
// pAdapter
// If NULL, D3D10CreateDevice will choose the primary adapter and
// create a new instance from a temporarily created IDXGIFactory.
// If non-NULL, D3D10CreateDevice will register the appropriate
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
// creating the device.
// DriverType
// Specifies the driver type to be created: hardware, reference or
// null.
// Software
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
// non-Software driver types.
// Flags
// Any of those documented for D3D10CreateDevice.
// SDKVersion
// SDK version. Use the D3D10_SDK_VERSION macro.
// ppDevice
// Pointer to returned interface.
// Return Values
// Any of those documented for
// CreateDXGIFactory
// IDXGIFactory::EnumAdapters
// IDXGIAdapter::RegisterDriver
// D3D10CreateDevice
HRESULT WINAPI D3D10CreateDevice(
IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
ID3D10Device **ppDevice);
// <API key>
// ppAdapter
// If NULL, D3D10CreateDevice will choose the primary adapter and
// create a new instance from a temporarily created IDXGIFactory.
// If non-NULL, D3D10CreateDevice will register the appropriate
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
// creating the device.
// DriverType
// Specifies the driver type to be created: hardware, reference or
// null.
// Software
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
// non-Software driver types.
// Flags
// Any of those documented for D3D10CreateDevice.
// SDKVersion
// SDK version. Use the D3D10_SDK_VERSION macro.
// pSwapChainDesc
// Swap chain description, may be NULL.
// ppSwapChain
// Pointer to returned interface. May be NULL.
// ppDevice
// Pointer to returned interface.
// Return Values
// Any of those documented for
// CreateDXGIFactory
// IDXGIFactory::EnumAdapters
// IDXGIAdapter::RegisterDriver
// D3D10CreateDevice
// IDXGIFactory::CreateSwapChain
HRESULT WINAPI <API key>(
IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
<API key> *pSwapChainDesc,
IDXGISwapChain **ppSwapChain,
ID3D10Device **ppDevice);
// D3D10CreateBlob:
// Creates a Buffer of n Bytes
HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D10EFFECT_H__ |
package uk.co.cogitolearning.cogpar.functions;
import uk.co.cogitolearning.cogpar.Complex;
/**
*
* @author kaloch
*/
public class SecFunction extends <API key> {
public SecFunction() {
super();
}
@Override
public Complex evaluate(Complex argument) {
return argument.sec();
}
} |
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish,
# Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# shall be included in all copies or substantial portions of
# the Software.
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""Mako template handlers"""
import os
import shutil
from mako import util, lexer
from mako.lookup import TemplateLookup
from nikola.plugin_categories import TemplateSystem
class MakoTemplates(TemplateSystem):
"""Wrapper for Mako templates."""
name = "mako"
lookup = None
cache = {}
def get_deps(self, filename):
text = util.read_file(filename)
lex = lexer.Lexer(text=text, filename=filename)
lex.parse()
deps = []
for n in lex.template.nodes:
keyword = getattr(n, 'keyword', None)
if keyword in ["inherit", "namespace"]:
deps.append(n.attributes['file'])
# TODO: include tags are not handled
return deps
def set_directories(self, directories, cache_folder):
"""Createa template lookup."""
cache_dir = os.path.join(cache_folder, '.mako.tmp')
if os.path.exists(cache_dir):
shutil.rmtree(cache_dir)
self.lookup = TemplateLookup(
directories=directories,
module_directory=cache_dir,
output_encoding='utf-8')
def render_template(self, template_name, output_name, context):
"""Render the template into output_name using context."""
template = self.lookup.get_template(template_name)
data = template.render_unicode(**context)
if output_name is not None:
try:
os.makedirs(os.path.dirname(output_name))
except:
pass
with open(output_name, 'w+') as output:
output.write(data)
return data
def template_deps(self, template_name):
"""Returns filenames which are dependencies for a template."""
# We can cache here because depedencies should
# not change between runs
if self.cache.get(template_name, None) is None:
template = self.lookup.get_template(template_name)
dep_filenames = self.get_deps(template.filename)
deps = [template.filename]
for fname in dep_filenames:
deps += self.template_deps(fname)
self.cache[template_name] = tuple(deps)
return list(self.cache[template_name]) |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.3.4 - v0.3.5: v8::HeapProfiler Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.3.4 - v0.3.5
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html">HeapProfiler</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="<API key>.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::HeapProfiler Class Reference</div> </div>
</div><!--header
<div class="contents">
<p><code>#include <<a class="el" href="<API key>.html">v8-profiler.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">GetSnapshotsCount</a> ()</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="<API key>.html">HeapSnapshot</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">GetSnapshot</a> (int index)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="<API key>.html">HeapSnapshot</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">FindSnapshot</a> (unsigned uid)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="<API key>.html">HeapSnapshot</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">TakeSnapshot</a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > title, HeapSnapshot::Type type=HeapSnapshot::kFull, <a class="el" href="<API key>.html">ActivityControl</a> *control=NULL)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Interface for controlling heap profiling. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static const <a class="el" href="<API key>.html">HeapSnapshot</a>* v8::HeapProfiler::FindSnapshot </td>
<td>(</td>
<td class="paramtype">unsigned </td>
<td class="paramname"><em>uid</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a profile by uid. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static const <a class="el" href="<API key>.html">HeapSnapshot</a>* v8::HeapProfiler::GetSnapshot </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>index</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a snapshot by index. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static int v8::HeapProfiler::GetSnapshotsCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of snapshots taken. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static const <a class="el" href="<API key>.html">HeapSnapshot</a>* v8::HeapProfiler::TakeSnapshot </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td>
<td class="paramname"><em>title</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">HeapSnapshot::Type </td>
<td class="paramname"><em>type</em> = <code>HeapSnapshot::kFull</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="<API key>.html">ActivityControl</a> * </td>
<td class="paramname"><em>control</em> = <code>NULL</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Takes a heap snapshot and returns it. Title may be an empty string. See HeapSnapshot::Type for types description. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="<API key>.html">v8-profiler.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:46:47 for V8 API Reference Guide for node.js v0.3.4 - v0.3.5 by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html> |
using Uheer.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace Uheer.ViewModels
{
<summary>
The view model used to create Channel entries in the database.
</summary>
public class <API key>
{
<summary>
The name that the new Channel should assume.
</summary>
[Required]
[StringLength(128, MinimumLength = 4)]
public string Name { get; set; }
<summary>
The author of the new Channel. It can be their MAC address, email or regular username.
</summary>
public string AuthorId { get; set; }
<summary>
The IP address that uniquely identifies the network used by the Owner of the channel.
This property is overridden by the server's storage procedure and will be ignored if sent to the server.
</summary>
public string HostIpAddress { get; set; }
<summary>
The MAC address that uniquely identifies the network used by the Owner of the channel.
</summary>
public string HostMacAddress { get; set; }
public static explicit operator Channel(<API key> m)
{
return m == null ? null : new Channel
{
Name = m.Name,
AuthorId = m.AuthorId,
HostIpAddress = m.HostIpAddress,
HostMacAddress = m.HostMacAddress
};
}
}
<summary>
The view model used to update Channel entries in the database.
</summary>
public class <API key>
{
<summary>
The surrogate key that uniquely identifies a Channel in the database.
</summary>
public int Id { get; set; }
<summary>
The new name that the existing Channel should assume.
</summary>
[Required]
public string Name { get; set; }
<summary>
A boolean that indicates if the Channel loops its musics or not.
</summary>
[DefaultValue(true)]
public bool Loops { get; set; }
<summary>
The id of the music that is currently on play.
</summary>
public int? CurrentId { get; set; }
public void Update(Channel c)
{
c.Name = Name;
c.Loops = Loops;
c.CurrentId = CurrentId;
}
}
<summary>
The view-model which represents a Channel entry with its Musics.
</summary>
public class <API key> : <API key>
{
<summary>
The collection of Musics that belong to this Channel.
</summary>
public ICollection<<API key>> Musics { get; set; }
<summary>
Explicit conversion from Channel to <API key>.
</summary>
<param name="c">The Channel that will be converted.</param>
<returns>The <API key> that represents the Channel c.</returns>
public static explicit operator <API key>(Channel c)
{
return c == null ? null : new <API key>
{
Id = c.Id,
Name = c.Name,
Author = (UserResultViewModel)c.Author,
HostIpAddress = c.HostIpAddress,
HostMacAddress = c.HostMacAddress,
Loops = c.Loops,
DateCreated = c.DateCreated,
DateUpdated = c.DateUpdated,
DateDeactivated = c.DateDeactivated,
Musics = c.Musics
.Select(m => (<API key>)m)
.ToList(),
CurrentId = c.CurrentId,
CurrentStartTime = c.CurrentStartTime
};
}
}
<summary>
The view-model which represents a Channel entry without its Musics.
</summary>
public class <API key>
{
<summary>
The surrogate key that uniquely identifies a Channel in the database.
</summary>
public int Id { get; set; }
<summary>
The name of the Channel.
</summary>
public string Name { get; set; }
<summary>
The Owner of the Channel. It can be set to be the email address, the MAC address or a regular username.
</summary>
public UserResultViewModel Author { get; set; }
<summary>
The IP address that uniquely identifies the network used by the Owner of the channel.
</summary>
public string HostIpAddress { get; set; }
<summary>
The MAC address that uniquely identifies the network used by the Owner of the channel.
</summary>
public string HostMacAddress { get; set; }
<summary>
A boolean that indicates if the Channel loops its musics or not.
</summary>
public bool Loops { get; set; }
<summary>
The Id of the Music that is currently being played.
</summary>
public int? CurrentId { get; set; }
<summary>
The start timestamp of the current music.
</summary>
public DateTime? CurrentStartTime { get; set; }
<summary>
The moment when the Channel was created.
</summary>
public DateTime DateCreated { get; set; }
<summary>
The moment when the Channel was last updated. If it never were, this value will be null.
</summary>
public DateTime? DateUpdated { get; set; }
<summary>
The moment when the Channel was deactivated. If this Channel is still active, this value will be null.
</summary>
public DateTime? DateDeactivated { get; set; }
<summary>
Explicit conversion from Channel to <API key>.
</summary>
<param name="c">The Channel that will be converted.</param>
<returns>The <API key> that represents the Channel c.</returns>
public static explicit operator <API key>(Channel c)
{
return c == null ? null : new <API key>
{
Id = c.Id,
Name = c.Name,
Author = (UserResultViewModel)c.Author,
HostIpAddress = c.HostIpAddress,
HostMacAddress = c.HostMacAddress,
Loops = c.Loops,
DateCreated = c.DateCreated,
DateUpdated = c.DateUpdated,
DateDeactivated = c.DateDeactivated,
CurrentId = c.CurrentId,
CurrentStartTime = c.CurrentStartTime
};
}
}
<summary>
The view model used to indicate which Music is currently being display in a Channel.
</summary>
public class <API key>
{
<summary>
The surrogate key that uniquely identifies a Channel in the database.
</summary>
public int Id { get; set; }
<summary>
The Id of the Music that is currently being played.
</summary>
public int? CurrentId { get; set; }
<summary>
The start timestamp of the current music.
</summary>
public DateTime? CurrentStartTime { get; set; }
<summary>
Explicit conversion from Channel to <API key>.
</summary>
<param name="c">The Channel that will be converted.</param>
<returns>The <API key> that represents the current song being played at the Channel c.</returns>
public static explicit operator <API key>(Channel c)
{
return c == null ? null : new <API key>
{
Id = c.Id,
CurrentId = c.CurrentId,
CurrentStartTime = c.CurrentStartTime
};
}
}
} |
import React from 'react';
import ReactDOM from 'react-dom';
import {BasePane, Pane} from '../../../src/react/panes';
describe('BasePane', () => {
const renderComponent = props => ReactDOM.render(<BasePane {...props}>Pane content here</BasePane>, root);
it('renders a pane and container', () => {
renderComponent();
expect('.pane .container').toHaveText('Pane content here');
});
describe('pass-through attributes', () => {
beforeEach(() => {
renderComponent({
className: 'bg-dark-gray more-outer',
innerClassName: 'bg-glow',
id: 'outer-id',
'data-foo': 'baz',
style: {opacity: '0.5'}
});
});
it('add classes, id, and styles to the pane and container', () => {
expect('.pane').toHaveClass('bg-dark-gray');
expect('.pane').toHaveAttr('id', 'outer-id');
expect('.pane').toHaveCss({opacity: '0.5'});
expect('.pane').toHaveAttr('data-foo', 'baz');
expect('.pane .container').toHaveClass('bg-glow');
});
});
});
describe('Pane', () => {
const renderComponent = props => ReactDOM.render(<Pane {...props}>Pane content here</Pane>, root);
it('renders a pane and container', () => {
renderComponent();
expect('.pane .container').toHaveText('Pane content here');
});
describe('pass-through attributes', () => {
beforeEach(() => {
renderComponent({
className: 'bg-dark-gray more-outer',
innerClassName: 'bg-glow',
id: 'outer-id',
'data-foo': 'baz',
style: {opacity: '0.5'}
});
});
it('add classes, id, and styles to the pane and container', () => {
expect('.pane').toHaveClass('bg-dark-gray');
expect('.pane').toHaveAttr('id', 'outer-id');
expect('.pane').toHaveCss({opacity: '0.5'});
expect('.pane').toHaveAttr('data-foo', 'baz');
expect('.pane .container').toHaveClass('bg-glow');
});
});
}); |
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_05) on Fri Dec 23 12:54:19 EST 2005 -->
<TITLE>
FormHashtable (ATG Java API)
</TITLE>
<META NAME="keywords" CONTENT="atg.droplet.FormHashtable class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="FormHashtable (ATG Java API)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../atg/droplet/FormEventReceiver.html" title="class in atg.droplet"><B>PREV CLASS</B></A>
<A HREF="../../atg/droplet/FormTag.html" title="class in atg.droplet"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="FormHashtable.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#<API key>.util.Hashtable">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<H2>
<FONT SIZE="-1">
atg.droplet</FONT>
<BR>
Class FormHashtable</H2>
<PRE>
java.lang.Object
<IMG SRC="../../resources/inherit.gif" ALT="extended by">java.util.Dictionary
<IMG SRC="../../resources/inherit.gif" ALT="extended by">java.util.Hashtable
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>atg.droplet.FormHashtable</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable, java.util.Map, java.io.Serializable</DD>
</DL>
<HR>
<DL>
<DT>public class <B>FormHashtable</B><DT>extends java.util.Hashtable</DL>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../serialized-form.html#atg.droplet.FormHashtable">Serialized Form</A></DL>
<HR>
<P>
<A NAME="field_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../atg/droplet/FormHashtable.html#CLASS_VERSION">CLASS_VERSION</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="constructor_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../atg/droplet/FormHashtable.html#FormHashtable()">FormHashtable</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="<API key>.util.Hashtable"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TD><B>Methods inherited from class java.util.Hashtable</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values</CODE></TD>
</TR>
</TABLE>
<A NAME="<API key>.lang.Object"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>finalize, getClass, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<A NAME="field_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="CLASS_VERSION"></A><H3>
CLASS_VERSION</H3>
<PRE>
public static java.lang.String <B>CLASS_VERSION</B></PRE>
<DL>
<DL>
</DL>
</DL>
<A NAME="constructor_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="FormHashtable()"></A><H3>
FormHashtable</H3>
<PRE>
public <B>FormHashtable</B>()</PRE>
<DL>
</DL>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../atg/droplet/FormEventReceiver.html" title="class in atg.droplet"><B>PREV CLASS</B></A>
<A HREF="../../atg/droplet/FormTag.html" title="class in atg.droplet"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="FormHashtable.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#<API key>.util.Hashtable">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
</BODY>
</HTML> |
package io.fundrequest.core.request.fund.dto;
import io.fundrequest.core.token.dto.TokenValueDto;
import lombok.Builder;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@Builder
public class FundWithUserDto {
private String funder;
private TokenValueDto fndFunds;
private TokenValueDto otherFunds;
private String funderAddress;
private boolean isLoggedInUser;
private boolean isRefund;
private LocalDateTime timestamp;
} |
<!DOCTYPE HTML>
<html>
<head>
<title>232</title>
</head>
<body>
<h2>232</h2>
<p>(ENCHANTER) As you casually pluck a few grapes from a bunch offered by one of Balhazar's slaves, you murmur the runes
of the Summon Faltyn spell. The Faltyn imposes its voice tunefully over the music of the harps and flutes, but only
you can hear what it is saying. <em>['I arrive at a moment of merriment,' it sings. 'Have you invited me here to
share the food and wine? Of course not, for I am ethereal and need no earthly sustenance. To entertain you with
my rarefied and beautiful songs, then? No, for you are a loutish mortal with no appreciation of beauty. Ah, now
I understand - you wish me to locate a magus among these masked revellers!']</em></p>
<p><a href="../Text/Episode_436.html">If you tell the Faltyn that this is indeed what you require, turn to 436.</a></p>
<p><a href="../Text/Episode_109.html">If you tell it that is <em>not</em> what you want, turn to 109.</a></p>
</body>
</html> |
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# copies or substantial portions of the Software.
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""
Provides simple sumtype declarations.
"""
from six.moves import zip
from six import iteritems, with_metaclass
import re
import types
import six
__all__ = ['Constructor', 'MemberOf', 'Sumtype', 'AddIsMethods']
class Constructor(object):
"""
Represents a constructor for a sumtype.
"""
def __init__(self, *args):
self.name = None
self.type = None
self.args = args
self.members = {}
def bind(self, type, name):
obj = Constructor(*self.args)
obj.type = type
obj.name = name
obj.members = self.members.copy()
return obj
def accept_args(self, *args):
if self.type is None or self.name is None:
raise RuntimeError('unbound Constructor')
if len(args) != len(self.args):
raise TypeError('{}.{}() expected {} arguments, got {}'.format(
self.type.__name__, self.name, len(self.args), len(args)))
return dict(zip(self.args, args))
def __call__(self, *args):
if self.type is None or self.name is None:
raise RuntimeError('unbound Constructor')
return self.type(self, self.accept_args(*args))
class MemberOf(object):
"""
A decorator for functions or values that are supposed to be members of
only a specific sumtype's constructor (or multiple constructors). Instances
of this class will be automatically unpacked by the :class:`_TypeMeta`
constructor and moved into the :attr:`Constructor.members` dictionary.
"""
def __init__(self, constructors=None, value=None, name=None):
if isinstance(constructors, Constructor):
constructors = [constructors]
self.constructors = constructors
self.value = value
self.name = name
if name:
for c in constructors:
c.members[name] = value
def __call__(self, value):
if not self.name:
self.name = value.__name__
for c in self.constructors:
c.members[self.name] = value
return self
def update_constructors(self, attrname):
for constructor in self.constructors:
constructor.members[attrname] = self.value
class _TypeMeta(type):
def __new__(cls, name, bases, attrs):
subtype = type.__new__(cls, name, bases, attrs)
# Collect all new constructors.
constructors = getattr(subtype, '__constructors__', {}).copy()
for key, value in iteritems(vars(subtype)):
if isinstance(value, Constructor):
constructors[key] = value
# Update constructors from MemberOf declarations.
for key, value in list(iteritems(vars(subtype))):
if isinstance(value, MemberOf):
delattr(subtype, key)
# Bind constructors.
for key, value in iteritems(constructors):
setattr(subtype, key, value.bind(subtype, key))
subtype.__constructors__ = constructors
# Invoke addons.
for addin in getattr(subtype, '__addins__', []):
addin.init_type(subtype)
return subtype
def __getattr__(self, name):
if self.__bases__ == (object,) and name in __all__:
return globals()[name]
raise AttributeError(name)
class Sumtype(with_metaclass(_TypeMeta)):
"""
Base class for sumtypes. You can access all members of the sumtype
module via this type (but not through subclasses).
python
from nr.types import Sumtype
class Result(Sumtype):
Ok = Sumtype.Constructor()
Error = Sumtype.Constructor('message')
assert not hasattr(Result, 'Constructor')
"""
__addins__ = []
__constructors__ = {}
def __init__(self, constructor, attrs):
assert isinstance(constructor, Constructor), type(constructor)
assert isinstance(attrs, dict), type(attrs)
self.__constructor__ = constructor
for key, value in iteritems(constructor.members):
if isinstance(value, types.FunctionType):
value = value.__get__(self, constructor.type)
setattr(self, key, value)
for key in constructor.args:
if key not in attrs:
raise ValueError('missing key in attrs: {!r}'.format(key))
for key, value in iteritems(attrs):
if key not in constructor.args:
raise ValueError('unexpected key in attrs: {!r}'.format(key))
setattr(self, key, value)
def __getitem__(self, index):
if hasattr(index, '__index__'):
index = index.__index__()
if isinstance(index, int):
return getattr(self, self.__constructor__.args[index])
elif isinstance(index, slice):
return tuple(getattr(self, k) for k in self.__constructor__.args[index])
else:
raise TypeError('indices must be integers or slices, not str')
def __iter__(self):
for k in self.__constructor__.args:
yield getattr(self, k)
def __len__(self):
return len(self.__constructor__.args)
def __repr__(self):
return '{}.{}({})'.format(type(self).__name__, self.__constructor__.name,
', '.join('{}={!r}'.format(k, getattr(self, k)) for k in self.__constructor__.args))
class AddIsMethods(object):
@staticmethod
def init_type(type):
def create_is_check(func_name, constructor_name):
def check(self):
constructor = getattr(self, constructor_name)
return self.__constructor__ == constructor
check.__name__ = name
check.__qualname__ = name
return check
for name in type.__constructors__.keys():
func_name = 'is_' + '_'.join(re.findall('[A-Z]+[^A-Z]*', name)).lower()
setattr(type, func_name, create_is_check(func_name, name))
Sumtype.__addins__.append(AddIsMethods) |
#include "checkpoints.h"
#include "db.h"
#include "net.h"
#include "init.h"
#include "ui_interface.h"
#include "kernel.h"
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
using namespace std;
using namespace boost;
// Global state
CCriticalSection <API key>;
set<CWallet*> <API key>;
CCriticalSection cs_main;
CTxMemPool mempool;
unsigned int <API key> = 0;
map<uint256, CBlockIndex*> mapBlockIndex;
set<pair<COutPoint, unsigned int> > setStakeSeen;
uint256 hashGenesisBlock = <API key>;
static CBigNum bnProofOfWorkLimit(~uint256(0) >> 20);
static CBigNum bnInitialHashTarget(~uint256(0) >> 20);
unsigned int nStakeMinAge = STAKE_MIN_AGE;
int nCoinbaseMaturity = <API key>;
CBlockIndex* pindexGenesisBlock = NULL;
int nBestHeight = -1;
CBigNum bnBestChainTrust = 0;
CBigNum bnBestInvalidTrust = 0;
uint256 hashBestChain = 0;
CBlockIndex* pindexBest = NULL;
int64 nTimeBestReceived = 0;
string strMotivational;
CMedianFilter<int> cPeerBlockCounts(5, 0); // Amount of blocks that other nodes claim to have
map<uint256, CBlock*> mapOrphanBlocks;
multimap<uint256, CBlock*> <API key>;
set<pair<COutPoint, unsigned int> > setStakeSeenOrphan;
map<uint256, uint256> mapProofOfStake;
map<uint256, CDataStream*> <API key>;
map<uint256, map<uint256, CDataStream*> > <API key>;
// Constant stuff for coinbase transactions we create:
CScript COINBASE_FLAGS;
const string strMessageMagic = "Pulse Signed Message:\n";
double dHashesPerSec;
int64 nHPSTimerStart;
// Settings
int64 nTransactionFee = MIN_TX_FEE;
// dispatching functions
// These functions dispatch to one or all registered wallets
void RegisterWallet(CWallet* pwalletIn)
{
{
LOCK(<API key>);
<API key>.insert(pwalletIn);
}
}
void UnregisterWallet(CWallet* pwalletIn)
{
{
LOCK(<API key>);
<API key>.erase(pwalletIn);
}
}
// check whether the passed transaction is from us
bool static IsFromMe(CTransaction& tx)
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
if (pwallet->IsFromMe(tx))
return true;
return false;
}
// get the wallet transaction with the given hash (if it exists)
bool static GetTransaction(const uint256& hashTx, CWalletTx& wtx)
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
if (pwallet->GetTransaction(hashTx,wtx))
return true;
return false;
}
// erases transaction with the given hash from all wallets
void static EraseFromWallets(uint256 hash)
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
pwallet->EraseFromWallet(hash);
}
// make sure all wallets know about the given transaction, in the given block
void SyncWithWallets(const CTransaction& tx, const CBlock* pblock, bool fUpdate, bool fConnect)
{
if (!fConnect)
{
// Pulse: wallets need to refund inputs when disconnecting coinstake
if (tx.IsCoinStake())
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
if (pwallet->IsFromMe(tx))
pwallet->DisableTransaction(tx);
}
return;
}
BOOST_FOREACH(CWallet* pwallet, <API key>)
pwallet-><API key>(tx, pblock, fUpdate);
}
// notify wallets about a new best chain
void static SetBestChain(const CBlockLocator& loc)
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
pwallet->SetBestChain(loc);
}
// notify wallets about an updated transaction
void static UpdatedTransaction(const uint256& hashTx)
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
pwallet->UpdatedTransaction(hashTx);
}
// dump all wallets
void static PrintWallets(const CBlock& block)
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
pwallet->PrintWallet(block);
}
// notify wallets about an incoming inventory (for request counts)
void static Inventory(const uint256& hash)
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
pwallet->Inventory(hash);
}
// ask wallets to resend their transactions
void static <API key>()
{
BOOST_FOREACH(CWallet* pwallet, <API key>)
pwallet-><API key>();
}
// <API key>
bool AddOrphanTx(const CDataStream& vMsg)
{
CTransaction tx;
CDataStream(vMsg) >> tx;
uint256 hash = tx.GetHash();
if (<API key>.count(hash))
return false;
CDataStream* pvMsg = new CDataStream(vMsg);
// Ignore big transactions, to avoid a
// send-big-orphans memory exhaustion attack. If a peer has a legitimate
// large transaction with a missing parent then we assume
// it will rebroadcast it later, after the parent transaction(s)
// have been mined or received.
// 10,000 orphans, each of which is at most 5,000 bytes big is
// at most 500 megabytes of orphans:
if (pvMsg->size() > 5000)
{
printf("ignoring large orphan tx (size: %u, hash: %s)\n", pvMsg->size(), hash.ToString().substr(0,10).c_str());
delete pvMsg;
return false;
}
<API key>[hash] = pvMsg;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
<API key>[txin.prevout.hash].insert(make_pair(hash, pvMsg));
printf("stored orphan tx %s (mapsz %u)\n", hash.ToString().substr(0,10).c_str(),
<API key>.size());
return true;
}
void static EraseOrphanTx(uint256 hash)
{
if (!<API key>.count(hash))
return;
const CDataStream* pvMsg = <API key>[hash];
CTransaction tx;
CDataStream(*pvMsg) >> tx;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
<API key>[txin.prevout.hash].erase(hash);
if (<API key>[txin.prevout.hash].empty())
<API key>.erase(txin.prevout.hash);
}
delete pvMsg;
<API key>.erase(hash);
}
unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)
{
unsigned int nEvicted = 0;
while (<API key>.size() > nMaxOrphans)
{
// Evict a random orphan:
uint256 randomhash = GetRandHash();
map<uint256, CDataStream*>::iterator it = <API key>.lower_bound(randomhash);
if (it == <API key>.end())
it = <API key>.begin();
EraseOrphanTx(it->first);
++nEvicted;
}
return nEvicted;
}
// CTransaction and CTxIndex
bool CTransaction::ReadFromDisk(CTxDB& txdb, const uint256& hash, CTxIndex& txindexRet)
{
SetNull();
if (!txdb.ReadTxIndex(hash, txindexRet))
return false;
if (!ReadFromDisk(txindexRet.pos))
return false;
return true;
}
bool CTransaction::ReadFromDisk(CTxDB& txdb, COutPoint prevout, CTxIndex& txindexRet)
{
if (!ReadFromDisk(txdb, prevout.hash, txindexRet))
return false;
if (prevout.n >= vout.size())
{
SetNull();
return false;
}
return true;
}
bool CTransaction::ReadFromDisk(CTxDB& txdb, COutPoint prevout)
{
CTxIndex txindex;
return ReadFromDisk(txdb, prevout, txindex);
}
bool CTransaction::ReadFromDisk(COutPoint prevout)
{
CTxDB txdb("r");
CTxIndex txindex;
return ReadFromDisk(txdb, prevout, txindex);
}
bool CTransaction::IsStandard() const
{
BOOST_FOREACH(const CTxIn& txin, vin)
{
// Biggest 'standard' txin is a 3-signature 3-of-3 CHECKMULTISIG
// pay-to-script-hash, which is 3 ~80-byte signatures, 3
// ~65-byte public keys, plus a few script ops.
if (txin.scriptSig.size() > 500)
return false;
if (!txin.scriptSig.IsPushOnly())
return false;
}
BOOST_FOREACH(const CTxOut& txout, vout)
if (!::IsStandard(txout.scriptPubKey))
return false;
return true;
}
// Check transaction inputs, and make sure any
// pay-to-script-hash transactions are evaluating IsStandard scripts
// Why bother? To avoid denial-of-service attacks; an attacker
// can submit a standard HASH... OP_EQUAL transaction,
// which will get accepted into blocks. The redemption
// script can be anything; an attacker could use a very
// <API key> script like:
// DUP CHECKSIG DROP ... repeated 100 times... OP_1
bool CTransaction::AreInputsStandard(const MapPrevTx& mapInputs) const
{
if (IsCoinBase())
return true; // Coinbases don't use vin normally
for (unsigned int i = 0; i < vin.size(); i++)
{
const CTxOut& prev = GetOutputFor(vin[i], mapInputs);
vector<vector<unsigned char> > vSolutions;
txnouttype whichType;
// get the scriptPubKey corresponding to this input:
const CScript& prevScript = prev.scriptPubKey;
if (!Solver(prevScript, whichType, vSolutions))
return false;
int nArgsExpected = <API key>(whichType, vSolutions);
if (nArgsExpected < 0)
return false;
// Transactions with extra stuff in their scriptSigs are
// non-standard. Note that this EvalScript() call will
// be quick, because if there are any operations
// beside "push data" in the scriptSig the
// IsStandard() call returns false
vector<vector<unsigned char> > stack;
if (!EvalScript(stack, vin[i].scriptSig, *this, i, 0))
return false;
if (whichType == TX_SCRIPTHASH)
{
if (stack.empty())
return false;
CScript subscript(stack.back().begin(), stack.back().end());
vector<vector<unsigned char> > vSolutions2;
txnouttype whichType2;
if (!Solver(subscript, whichType2, vSolutions2))
return false;
if (whichType2 == TX_SCRIPTHASH)
return false;
int tmpExpected;
tmpExpected = <API key>(whichType2, vSolutions2);
if (tmpExpected < 0)
return false;
nArgsExpected += tmpExpected;
}
if (stack.size() != (unsigned int)nArgsExpected)
return false;
}
return true;
}
unsigned int
CTransaction::GetLegacySigOpCount() const
{
unsigned int nSigOps = 0;
BOOST_FOREACH(const CTxIn& txin, vin)
{
nSigOps += txin.scriptSig.GetSigOpCount(false);
}
BOOST_FOREACH(const CTxOut& txout, vout)
{
nSigOps += txout.scriptPubKey.GetSigOpCount(false);
}
return nSigOps;
}
int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
{
if (fClient)
{
if (hashBlock == 0)
return 0;
}
else
{
CBlock blockTmp;
if (pblock == NULL)
{
// Load the block this tx is in
CTxIndex txindex;
if (!CTxDB("r").ReadTxIndex(GetHash(), txindex))
return 0;
if (!blockTmp.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos))
return 0;
pblock = &blockTmp;
}
// Update the tx's hashBlock
hashBlock = pblock->GetHash();
// Locate the transaction
for (nIndex = 0; nIndex < (int)pblock->vtx.size(); nIndex++)
if (pblock->vtx[nIndex] == *(CTransaction*)this)
break;
if (nIndex == (int)pblock->vtx.size())
{
vMerkleBranch.clear();
nIndex = -1;
printf("ERROR: SetMerkleBranch() : couldn't find tx in block\n");
return 0;
}
// Fill in merkle branch
vMerkleBranch = pblock->GetMerkleBranch(nIndex);
}
// Is the tx in a block that's in the main chain
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
if (mi == mapBlockIndex.end())
return 0;
CBlockIndex* pindex = (*mi).second;
if (!pindex || !pindex->IsInMainChain())
return 0;
return pindexBest->nHeight - pindex->nHeight + 1;
}
bool CTransaction::CheckTransaction() const
{
// Basic checks that don't depend on any context
if (vin.empty())
return DoS(10, error("CTransaction::CheckTransaction() : vin empty"));
if (vout.empty())
return DoS(10, error("CTransaction::CheckTransaction() : vout empty"));
// Size limits
if (::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)
return DoS(100, error("CTransaction::CheckTransaction() : size limits failed"));
// Check for negative or overflow output values
int64 nValueOut = 0;
for (int i = 0; i < vout.size(); i++)
{
const CTxOut& txout = vout[i];
if (txout.IsEmpty() && (!IsCoinBase()) && (!IsCoinStake()))
return DoS(100, error("CTransaction::CheckTransaction() : txout empty for user transaction"));
// Pulse: enforce minimum output amount
if ((!txout.IsEmpty()) && txout.nValue < MIN_TXOUT_AMOUNT)
return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue below minimum"));
if (txout.nValue > MAX_MONEY)
return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue too high"));
nValueOut += txout.nValue;
if (!MoneyRange(nValueOut))
return DoS(100, error("CTransaction::CheckTransaction() : txout total out of range"));
}
// Check for duplicate inputs
set<COutPoint> vInOutPoints;
BOOST_FOREACH(const CTxIn& txin, vin)
{
if (vInOutPoints.count(txin.prevout))
return false;
vInOutPoints.insert(txin.prevout);
}
if (IsCoinBase())
{
if (vin[0].scriptSig.size() < 2 || vin[0].scriptSig.size() > 100)
return DoS(100, error("CTransaction::CheckTransaction() : coinbase script size"));
}
else
{
BOOST_FOREACH(const CTxIn& txin, vin)
if (txin.prevout.IsNull())
return DoS(10, error("CTransaction::CheckTransaction() : prevout is null"));
}
return true;
}
int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree,
enum GetMinFee_mode mode, unsigned int nBytes) const
{
// Base fee is either MIN_TX_FEE or MIN_RELAY_TX_FEE
int64 nBaseFee = (mode == GMF_RELAY) ? MIN_RELAY_TX_FEE : MIN_TX_FEE;
unsigned int nNewBlockSize = nBlockSize + nBytes;
int64 nMinFee = (1 + (int64)nBytes / 1000) * nBaseFee;
if (fAllowFree)
{
if (nBlockSize == 1)
{
// Transactions under 10K are free
// (about 4500 BTC if made of 50 BTC inputs)
if (nBytes < 10000)
nMinFee = 0;
}
else
{
// Free transaction area
if (nNewBlockSize < 27000)
nMinFee = 0;
}
}
// To limit dust spam, require MIN_TX_FEE/MIN_RELAY_TX_FEE if any output is less than 0.01
if (nMinFee < nBaseFee)
{
BOOST_FOREACH(const CTxOut& txout, vout)
if (txout.nValue < CENT)
nMinFee = nBaseFee;
}
// Raise the price as the block approaches full
if (nBlockSize != 1 && nNewBlockSize >= MAX_BLOCK_SIZE_GEN/2)
{
if (nNewBlockSize >= MAX_BLOCK_SIZE_GEN)
return MAX_MONEY;
nMinFee *= MAX_BLOCK_SIZE_GEN / (MAX_BLOCK_SIZE_GEN - nNewBlockSize);
}
if (!MoneyRange(nMinFee))
nMinFee = MAX_MONEY;
return nMinFee;
}
bool CTxMemPool::accept(CTxDB& txdb, CTransaction &tx, bool fCheckInputs,
bool* pfMissingInputs)
{
if (pfMissingInputs)
*pfMissingInputs = false;
if (!tx.CheckTransaction())
return error("CTxMemPool::accept() : CheckTransaction failed");
// Coinbase is only valid in a block, not as a loose transaction
if (tx.IsCoinBase())
return tx.DoS(100, error("CTxMemPool::accept() : coinbase as individual tx"));
// Pulse: coinstake is also only valid in a block, not as a loose transaction
if (tx.IsCoinStake())
return tx.DoS(100, error("CTxMemPool::accept() : coinstake as individual tx"));
// To help v0.1.5 clients who would see it as a negative number
if ((int64)tx.nLockTime > std::numeric_limits<int>::max())
return error("CTxMemPool::accept() : not accepting nLockTime beyond 2038 yet");
// Rather not work on nonstandard transactions (unless -testnet)
if (!fTestNet && !tx.IsStandard())
return error("CTxMemPool::accept() : nonstandard transaction type");
// Do we already have it?
uint256 hash = tx.GetHash();
{
LOCK(cs);
if (mapTx.count(hash))
return false;
}
if (fCheckInputs)
if (txdb.ContainsTx(hash))
return false;
// Check for conflicts with in-memory transactions
CTransaction* ptxOld = NULL;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
COutPoint outpoint = tx.vin[i].prevout;
if (mapNextTx.count(outpoint))
{
// Disable replacement feature for now
return false;
// Allow replacing with a newer version of the same transaction
if (i != 0)
return false;
ptxOld = mapNextTx[outpoint].ptx;
if (ptxOld->IsFinal())
return false;
if (!tx.IsNewerThan(*ptxOld))
return false;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
COutPoint outpoint = tx.vin[i].prevout;
if (!mapNextTx.count(outpoint) || mapNextTx[outpoint].ptx != ptxOld)
return false;
}
break;
}
}
if (fCheckInputs)
{
MapPrevTx mapInputs;
map<uint256, CTxIndex> mapUnused;
bool fInvalid = false;
if (!tx.FetchInputs(txdb, mapUnused, false, false, mapInputs, fInvalid))
{
if (fInvalid)
return error("CTxMemPool::accept() : FetchInputs found invalid tx %s", hash.ToString().substr(0,10).c_str());
if (pfMissingInputs)
*pfMissingInputs = true;
return error("CTxMemPool::accept() : FetchInputs failed %s", hash.ToString().substr(0,10).c_str());
}
// Check for non-standard pay-to-script-hash in inputs
if (!tx.AreInputsStandard(mapInputs) && !fTestNet)
return error("CTxMemPool::accept() : nonstandard transaction input");
// Note: if you modify this code to accept non-standard transactions, then
// you should add code here to check that the transaction does a
// reasonable number of ECDSA signature verifications.
int64 nFees = tx.GetValueIn(mapInputs)-tx.GetValueOut();
unsigned int nSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
// Don't accept it if it can't get into a block
int64 txMinFee = tx.GetMinFee(1000, false, GMF_RELAY, nSize);
if (nFees < txMinFee)
return error("CTxMemPool::accept() : not enough fees %s, %"PRI64d" < %"PRI64d,
hash.ToString().c_str(),
nFees, txMinFee);
// Continuously rate-limit free transactions
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
// be annoying or make other's transactions take longer to confirm.
if (nFees < MIN_RELAY_TX_FEE)
{
static CCriticalSection cs;
static double dFreeCount;
static int64 nLastTime;
int64 nNow = GetTime();
{
LOCK(cs);
// Use an exponentially decaying ~10-minute window:
dFreeCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime));
nLastTime = nNow;
// -limitfreerelay unit is <API key>
// At default rate it would take over a month to fill 1GB
if (dFreeCount > GetArg("-limitfreerelay", 15)*10*1000 && !IsFromMe(tx))
return error("CTxMemPool::accept() : free transaction rejected by rate limiter");
if (fDebug)
printf("Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount+nSize);
dFreeCount += nSize;
}
}
// Check against previous transactions
// This is done last to help prevent CPU exhaustion denial-of-service attacks.
if (!tx.ConnectInputs(txdb, mapInputs, mapUnused, CDiskTxPos(1,1,1), pindexBest, false, false))
{
return error("CTxMemPool::accept() : ConnectInputs failed %s", hash.ToString().substr(0,10).c_str());
}
}
// Store transaction in memory
{
LOCK(cs);
if (ptxOld)
{
printf("CTxMemPool::accept() : replacing tx %s with new version\n", ptxOld->GetHash().ToString().c_str());
remove(*ptxOld);
}
addUnchecked(tx);
}
// are we sure this is ok when loading transactions or restoring block txes
// If updated, erase old tx from wallet
if (ptxOld)
EraseFromWallets(ptxOld->GetHash());
printf("CTxMemPool::accept() : accepted %s\n", hash.ToString().substr(0,10).c_str());
return true;
}
bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMissingInputs)
{
return mempool.accept(txdb, *this, fCheckInputs, pfMissingInputs);
}
bool CTxMemPool::addUnchecked(CTransaction &tx)
{
printf("addUnchecked(): size %lu\n", mapTx.size());
// Add to memory pool without checking anything. Don't call this directly,
// call CTxMemPool::accept to properly check the transaction first.
{
LOCK(cs);
uint256 hash = tx.GetHash();
mapTx[hash] = tx;
for (unsigned int i = 0; i < tx.vin.size(); i++)
mapNextTx[tx.vin[i].prevout] = CInPoint(&mapTx[hash], i);
<API key>++;
}
return true;
}
bool CTxMemPool::remove(CTransaction &tx)
{
// Remove transaction from memory pool
{
LOCK(cs);
uint256 hash = tx.GetHash();
if (mapTx.count(hash))
{
BOOST_FOREACH(const CTxIn& txin, tx.vin)
mapNextTx.erase(txin.prevout);
mapTx.erase(hash);
<API key>++;
}
}
return true;
}
void CTxMemPool::queryHashes(std::vector<uint256>& vtxid)
{
vtxid.clear();
LOCK(cs);
vtxid.reserve(mapTx.size());
for (map<uint256, CTransaction>::iterator mi = mapTx.begin(); mi != mapTx.end(); ++mi)
vtxid.push_back((*mi).first);
}
int CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet) const
{
if (hashBlock == 0 || nIndex == -1)
return 0;
// Find the block it claims to be in
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
if (mi == mapBlockIndex.end())
return 0;
CBlockIndex* pindex = (*mi).second;
if (!pindex || !pindex->IsInMainChain())
return 0;
// Make sure the merkle branch connects to this block
if (!fMerkleVerified)
{
if (CBlock::CheckMerkleBranch(GetHash(), vMerkleBranch, nIndex) != pindex->hashMerkleRoot)
return 0;
fMerkleVerified = true;
}
pindexRet = pindex;
return pindexBest->nHeight - pindex->nHeight + 1;
}
int CMerkleTx::GetBlocksToMaturity() const
{
if (!(IsCoinBase() || IsCoinStake()))
return 0;
return max(0, (nCoinbaseMaturity+20) - GetDepthInMainChain());
}
bool CMerkleTx::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs)
{
if (fClient)
{
if (!IsInMainChain() && !ClientConnectInputs())
return false;
return CTransaction::AcceptToMemoryPool(txdb, false);
}
else
{
return CTransaction::AcceptToMemoryPool(txdb, fCheckInputs);
}
}
bool CMerkleTx::AcceptToMemoryPool()
{
CTxDB txdb("r");
return AcceptToMemoryPool(txdb);
}
bool CWalletTx::<API key>(CTxDB& txdb, bool fCheckInputs)
{
{
LOCK(mempool.cs);
// Add previous supporting transactions first
BOOST_FOREACH(CMerkleTx& tx, vtxPrev)
{
if (!(tx.IsCoinBase() || tx.IsCoinStake()))
{
uint256 hash = tx.GetHash();
if (!mempool.exists(hash) && !txdb.ContainsTx(hash))
tx.AcceptToMemoryPool(txdb, fCheckInputs);
}
}
return AcceptToMemoryPool(txdb, fCheckInputs);
}
return false;
}
bool CWalletTx::<API key>()
{
CTxDB txdb("r");
return <API key>(txdb);
}
int CTxIndex::GetDepthInMainChain() const
{
// Read block header
CBlock block;
if (!block.ReadFromDisk(pos.nFile, pos.nBlockPos, false))
return 0;
// Find the block in the index
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(block.GetHash());
if (mi == mapBlockIndex.end())
return 0;
CBlockIndex* pindex = (*mi).second;
if (!pindex || !pindex->IsInMainChain())
return 0;
return 1 + nBestHeight - pindex->nHeight;
}
// Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock
bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock)
{
{
LOCK(cs_main);
{
LOCK(mempool.cs);
if (mempool.exists(hash))
{
tx = mempool.lookup(hash);
return true;
}
}
CTxDB txdb("r");
CTxIndex txindex;
if (tx.ReadFromDisk(txdb, hash, txindex))
{
CBlock block;
if (block.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos, false))
hashBlock = block.GetHash();
return true;
}
// look for transaction in disconnected blocks to find orphaned CoinBase and CoinStake transactions
BOOST_FOREACH(PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex)
{
CBlockIndex* pindex = item.second;
if (pindex == pindexBest || pindex->pnext != 0)
continue;
CBlock block;
if (!block.ReadFromDisk(pindex))
continue;
BOOST_FOREACH(const CTransaction& txOrphan, block.vtx)
{
if (txOrphan.GetHash() == hash)
{
tx = txOrphan;
return true;
}
}
}
}
return false;
}
// CBlock and CBlockIndex
bool CBlock::ReadFromDisk(const CBlockIndex* pindex, bool fReadTransactions)
{
if (!fReadTransactions)
{
*this = pindex->GetBlockHeader();
return true;
}
if (!ReadFromDisk(pindex->nFile, pindex->nBlockPos, fReadTransactions))
return false;
if (GetHash() != pindex->GetBlockHash())
return error("CBlock::ReadFromDisk() : GetHash() doesn't match index");
return true;
}
uint256 static GetOrphanRoot(const CBlock* pblock)
{
// Work back to the first block in the orphan chain
while (mapOrphanBlocks.count(pblock->hashPrevBlock))
pblock = mapOrphanBlocks[pblock->hashPrevBlock];
return pblock->GetHash();
}
// Pulse: find block wanted by given orphan block
uint256 WantedByOrphan(const CBlock* pblockOrphan)
{
// Work back to the first block in the orphan chain
while (mapOrphanBlocks.count(pblockOrphan->hashPrevBlock))
pblockOrphan = mapOrphanBlocks[pblockOrphan->hashPrevBlock];
return pblockOrphan->hashPrevBlock;
}
int64 <API key>(unsigned int nBits)
{
CBigNum bnSubsidyLimit = <API key>;
CBigNum bnTarget;
bnTarget.SetCompact(nBits);
CBigNum bnTargetLimit = bnProofOfWorkLimit;
bnTargetLimit.SetCompact(bnTargetLimit.GetCompact());
// Pulse: subsidy is cut in half every 16x multiply of difficulty
// A reasonably continuous curve is used to avoid shock to market
// (nSubsidyLimit / nSubsidy) ** 4 == bnProofOfWorkLimit / bnTarget
CBigNum bnLowerBound = CENT;
CBigNum bnUpperBound = bnSubsidyLimit;
while (bnLowerBound + CENT <= bnUpperBound)
{
CBigNum bnMidValue = (bnLowerBound + bnUpperBound) / 2;
if (fDebug && GetBoolArg("-printcreation"))
printf("<API key>() : lower=%"PRI64d" upper=%"PRI64d" mid=%"PRI64d"\n", bnLowerBound.getuint64(), bnUpperBound.getuint64(), bnMidValue.getuint64());
if (bnMidValue * bnMidValue * bnMidValue * bnMidValue * bnTargetLimit > bnSubsidyLimit * bnSubsidyLimit * bnSubsidyLimit * bnSubsidyLimit * bnTarget)
bnUpperBound = bnMidValue;
else
bnLowerBound = bnMidValue;
}
int64 nSubsidy = bnUpperBound.getuint64();
nSubsidy = (nSubsidy / CENT) * CENT;
if (fDebug && GetBoolArg("-printcreation"))
printf("<API key>() : create=%s nBits=0x%08x nSubsidy=%"PRI64d"\n", FormatMoney(nSubsidy).c_str(), nBits, nSubsidy);
return min(nSubsidy, <API key>);
}
// Pulse: miner's coin stake is rewarded based on coin age spent (coin-days)
int64 <API key>(int64 nCoinAge)
{
static int64 nRewardCoinYear = 183 * CENT; // creation amount per coin-year 0.5% daily
int64 nSubsidy = nCoinAge * 33 / (365 * 33 + 8) * nRewardCoinYear;
strMotivational = "Revostake!";
if (fDebug && GetBoolArg("-printcreation"))
printf("<API key>(): create=%s nCoinAge=%"PRI64d"\n", FormatMoney(nSubsidy).c_str(), nCoinAge);
return nSubsidy;
}
static const int64 nTargetTimespan = 1 * 24 * 60 * 60; // one week
static const int64 <API key> = 12 * 20 * <API key>; // 2-hour
// minimum amount of work that could possibly be required nTime after
// minimum work required was nBase
unsigned int ComputeMinWork(unsigned int nBase, int64 nTime)
{
CBigNum bnResult;
bnResult.SetCompact(nBase);
bnResult *= 2;
while (nTime > 0 && bnResult < bnProofOfWorkLimit)
{
// Maximum 200% adjustment per day...
bnResult *= 2;
nTime -= 24 * 60 * 60;
}
if (bnResult > bnProofOfWorkLimit)
bnResult = bnProofOfWorkLimit;
return bnResult.GetCompact();
}
// Pulse: find last block index up to pindex
const CBlockIndex* GetLastBlockIndex(const CBlockIndex* pindex, bool fProofOfStake)
{
while (pindex && pindex->pprev && (pindex->IsProofOfStake() != fProofOfStake))
pindex = pindex->pprev;
return pindex;
}
unsigned int static <API key>(const CBlockIndex* pindexLast, bool fProofOfStake)
{
if (pindexLast == NULL)
return bnProofOfWorkLimit.GetCompact(); // genesis block
const CBlockIndex* pindexPrev = GetLastBlockIndex(pindexLast, fProofOfStake);
if (pindexPrev->pprev == NULL)
return bnInitialHashTarget.GetCompact(); // first block
const CBlockIndex* pindexPrevPrev = GetLastBlockIndex(pindexPrev->pprev, fProofOfStake);
if (pindexPrevPrev->pprev == NULL)
return bnInitialHashTarget.GetCompact(); // second block
int64 nActualSpacing = pindexPrev->GetBlockTime() - pindexPrevPrev->GetBlockTime();
// Pulse: target change every block
// Pulse: retarget with exponential moving toward target spacing
CBigNum bnNew;
bnNew.SetCompact(pindexPrev->nBits);
int64 nTargetSpacing = fProofOfStake? <API key> : min(<API key>, (int64) <API key> * (1 + pindexLast->nHeight - pindexPrev->nHeight));
int64 nInterval = nTargetTimespan / nTargetSpacing;
bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
bnNew /= ((nInterval + 1) * nTargetSpacing);
if (bnNew > bnProofOfWorkLimit)
bnNew = bnProofOfWorkLimit;
return bnNew.GetCompact();
}
bool CheckProofOfWork(uint256 hash, unsigned int nBits)
{
CBigNum bnTarget;
bnTarget.SetCompact(nBits);
// Check range
if (bnTarget <= 0 || bnTarget > bnProofOfWorkLimit)
return error("CheckProofOfWork() : nBits below minimum work");
// Check proof of work matches claimed amount
if (hash > bnTarget.getuint256())
return error("CheckProofOfWork() : hash doesn't match nBits");
return true;
}
// Return maximum amount of blocks that other nodes claim to have
int GetNumBlocksOfPeers()
{
return std::max(cPeerBlockCounts.median(), Checkpoints::<API key>());
}
bool <API key>()
{
if (pindexBest == NULL || nBestHeight < Checkpoints::<API key>())
return true;
static int64 nLastUpdate;
static CBlockIndex* pindexLastBest;
if (pindexBest != pindexLastBest)
{
pindexLastBest = pindexBest;
nLastUpdate = GetTime();
}
return (GetTime() - nLastUpdate < 10 &&
pindexBest->GetBlockTime() < GetTime() - 24 * 60 * 60);
}
void static InvalidChainFound(CBlockIndex* pindexNew)
{
if (pindexNew->bnChainTrust > bnBestInvalidTrust)
{
bnBestInvalidTrust = pindexNew->bnChainTrust;
CTxDB().<API key>(bnBestInvalidTrust);
MainFrameRepaint();
}
printf("InvalidChainFound: invalid block=%s height=%d trust=%s\n", pindexNew->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->nHeight, CBigNum(pindexNew->bnChainTrust).ToString().c_str());
printf("InvalidChainFound: current best=%s height=%d trust=%s\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, CBigNum(bnBestChainTrust).ToString().c_str());
// Pulse: should not enter safe mode for longer invalid chain
}
void CBlock::UpdateTime(const CBlockIndex* pindexPrev)
{
nTime = max(GetBlockTime(), GetAdjustedTime());
}
bool CTransaction::DisconnectInputs(CTxDB& txdb)
{
// Relinquish previous transactions' spent pointers
if (!IsCoinBase())
{
BOOST_FOREACH(const CTxIn& txin, vin)
{
COutPoint prevout = txin.prevout;
// Get prev txindex from disk
CTxIndex txindex;
if (!txdb.ReadTxIndex(prevout.hash, txindex))
return error("DisconnectInputs() : ReadTxIndex failed");
if (prevout.n >= txindex.vSpent.size())
return error("DisconnectInputs() : prevout.n out of range");
// Mark outpoint as not spent
txindex.vSpent[prevout.n].SetNull();
// Write back
if (!txdb.UpdateTxIndex(prevout.hash, txindex))
return error("DisconnectInputs() : UpdateTxIndex failed");
}
}
// Remove transaction from index
// This can fail if a duplicate of this transaction was in a chain that got
// reorganized away. This is only possible if this transaction was completely
// spent, so erasing it would be a no-op anway.
txdb.EraseTxIndex(*this);
return true;
}
bool CTransaction::FetchInputs(CTxDB& txdb, const map<uint256, CTxIndex>& mapTestPool,
bool fBlock, bool fMiner, MapPrevTx& inputsRet, bool& fInvalid)
{
// FetchInputs can return false either because we just haven't seen some inputs
// (in which case the transaction should be stored as an orphan)
// or because the transaction is malformed (in which case the transaction should
// be dropped). If tx is definitely invalid, fInvalid will be set to true.
fInvalid = false;
if (IsCoinBase())
return true; // Coinbase transactions have no inputs to fetch.
for (unsigned int i = 0; i < vin.size(); i++)
{
COutPoint prevout = vin[i].prevout;
if (inputsRet.count(prevout.hash))
continue; // Got it already
// Read txindex
CTxIndex& txindex = inputsRet[prevout.hash].first;
bool fFound = true;
if ((fBlock || fMiner) && mapTestPool.count(prevout.hash))
{
// Get txindex from current proposed changes
txindex = mapTestPool.find(prevout.hash)->second;
}
else
{
// Read txindex from txdb
fFound = txdb.ReadTxIndex(prevout.hash, txindex);
}
if (!fFound && (fBlock || fMiner))
return fMiner ? false : error("FetchInputs() : %s prev tx %s index entry not found", GetHash().ToString().substr(0,10).c_str(), prevout.hash.ToString().substr(0,10).c_str());
// Read txPrev
CTransaction& txPrev = inputsRet[prevout.hash].second;
if (!fFound || txindex.pos == CDiskTxPos(1,1,1))
{
// Get prev tx from single transactions in memory
{
LOCK(mempool.cs);
if (!mempool.exists(prevout.hash))
return error("FetchInputs() : %s mempool Tx prev not found %s", GetHash().ToString().substr(0,10).c_str(), prevout.hash.ToString().substr(0,10).c_str());
txPrev = mempool.lookup(prevout.hash);
}
if (!fFound)
txindex.vSpent.resize(txPrev.vout.size());
}
else
{
// Get prev tx from disk
if (!txPrev.ReadFromDisk(txindex.pos))
return error("FetchInputs() : %s ReadFromDisk prev tx %s failed", GetHash().ToString().substr(0,10).c_str(), prevout.hash.ToString().substr(0,10).c_str());
}
}
// Make sure all prevout.n's are valid:
for (unsigned int i = 0; i < vin.size(); i++)
{
const COutPoint prevout = vin[i].prevout;
assert(inputsRet.count(prevout.hash) != 0);
const CTxIndex& txindex = inputsRet[prevout.hash].first;
const CTransaction& txPrev = inputsRet[prevout.hash].second;
if (prevout.n >= txPrev.vout.size() || prevout.n >= txindex.vSpent.size())
{
// Revisit this if/when transaction replacement is implemented and allows
// adding inputs:
fInvalid = true;
return DoS(100, error("FetchInputs() : %s prevout.n out of range %d %d %d prev tx %s\n%s", GetHash().ToString().substr(0,10).c_str(), prevout.n, txPrev.vout.size(), txindex.vSpent.size(), prevout.hash.ToString().substr(0,10).c_str(), txPrev.ToString().c_str()));
}
}
return true;
}
const CTxOut& CTransaction::GetOutputFor(const CTxIn& input, const MapPrevTx& inputs) const
{
MapPrevTx::const_iterator mi = inputs.find(input.prevout.hash);
if (mi == inputs.end())
throw std::runtime_error("CTransaction::GetOutputFor() : prevout.hash not found");
const CTransaction& txPrev = (mi->second).second;
if (input.prevout.n >= txPrev.vout.size())
throw std::runtime_error("CTransaction::GetOutputFor() : prevout.n out of range");
return txPrev.vout[input.prevout.n];
}
int64 CTransaction::GetValueIn(const MapPrevTx& inputs) const
{
if (IsCoinBase())
return 0;
int64 nResult = 0;
for (unsigned int i = 0; i < vin.size(); i++)
{
nResult += GetOutputFor(vin[i], inputs).nValue;
}
return nResult;
}
unsigned int CTransaction::GetP2SHSigOpCount(const MapPrevTx& inputs) const
{
if (IsCoinBase())
return 0;
unsigned int nSigOps = 0;
for (unsigned int i = 0; i < vin.size(); i++)
{
const CTxOut& prevout = GetOutputFor(vin[i], inputs);
if (prevout.scriptPubKey.IsPayToScriptHash())
nSigOps += prevout.scriptPubKey.GetSigOpCount(vin[i].scriptSig);
}
return nSigOps;
}
bool CTransaction::ConnectInputs(CTxDB& txdb, MapPrevTx inputs,
map<uint256, CTxIndex>& mapTestPool, const CDiskTxPos& posThisTx,
const CBlockIndex* pindexBlock, bool fBlock, bool fMiner, bool <API key>)
{
// Take over previous transactions' spent pointers
// fBlock is true when this is called from AcceptBlock when a new best-block is added to the blockchain
// fMiner is true when called from the internal bitcoin miner
// ... both are false when called from CTransaction::AcceptToMemoryPool
if (!IsCoinBase())
{
int64 nValueIn = 0;
int64 nFees = 0;
for (unsigned int i = 0; i < vin.size(); i++)
{
COutPoint prevout = vin[i].prevout;
assert(inputs.count(prevout.hash) > 0);
CTxIndex& txindex = inputs[prevout.hash].first;
CTransaction& txPrev = inputs[prevout.hash].second;
if (prevout.n >= txPrev.vout.size() || prevout.n >= txindex.vSpent.size())
return DoS(100, error("ConnectInputs() : %s prevout.n out of range %d %d %d prev tx %s\n%s", GetHash().ToString().substr(0,10).c_str(), prevout.n, txPrev.vout.size(), txindex.vSpent.size(), prevout.hash.ToString().substr(0,10).c_str(), txPrev.ToString().c_str()));
// If prev is coinbase/coinstake, check that it's matured
if (txPrev.IsCoinBase() || txPrev.IsCoinStake())
for (const CBlockIndex* pindex = pindexBlock; pindex && pindexBlock->nHeight - pindex->nHeight < nCoinbaseMaturity; pindex = pindex->pprev)
if (pindex->nBlockPos == txindex.pos.nBlockPos && pindex->nFile == txindex.pos.nFile)
return error("ConnectInputs() : tried to spend coinbase/coinstake at depth %d", pindexBlock->nHeight - pindex->nHeight);
// Pulse: check transaction timestamp
if (txPrev.nTime > nTime)
return DoS(100, error("ConnectInputs() : transaction timestamp earlier than input transaction"));
// Check for negative or overflow input values
nValueIn += txPrev.vout[prevout.n].nValue;
if (!MoneyRange(txPrev.vout[prevout.n].nValue) || !MoneyRange(nValueIn))
return DoS(100, error("ConnectInputs() : txin values out of range"));
}
// The first loop above does all the inexpensive checks.
// Only if ALL inputs pass do we perform expensive ECDSA signature checks.
// Helps prevent CPU exhaustion attacks.
for (unsigned int i = 0; i < vin.size(); i++)
{
COutPoint prevout = vin[i].prevout;
assert(inputs.count(prevout.hash) > 0);
CTxIndex& txindex = inputs[prevout.hash].first;
CTransaction& txPrev = inputs[prevout.hash].second;
// Check for conflicts (double-spend)
// This doesn't trigger the DoS code on purpose; if it did, it would make it easier
// for an attacker to attempt to split the network.
if (!txindex.vSpent[prevout.n].IsNull())
return fMiner ? false : error("ConnectInputs() : %s prev tx already used at %s", GetHash().ToString().substr(0,10).c_str(), txindex.vSpent[prevout.n].ToString().c_str());
// Skip ECDSA signature verification when connecting blocks (fBlock=true)
// before the last blockchain checkpoint. This is safe because block merkle hashes are
// still computed and checked, and any change will be caught at the next checkpoint.
if (!(fBlock && (nBestHeight < Checkpoints::<API key>())))
{
// Verify signature
if (!VerifySignature(txPrev, *this, i, <API key>, 0))
{
// only during transition phase for P2SH: do not invoke anti-DoS code for
// potentially old clients relaying bad P2SH transactions
if (<API key> && VerifySignature(txPrev, *this, i, false, 0))
return error("ConnectInputs() : %s P2SH VerifySignature failed", GetHash().ToString().substr(0,10).c_str());
return DoS(100,error("ConnectInputs() : %s VerifySignature failed", GetHash().ToString().substr(0,10).c_str()));
}
}
// Mark outpoints as spent
txindex.vSpent[prevout.n] = posThisTx;
// Write back
if (fBlock || fMiner)
{
mapTestPool[prevout.hash] = txindex;
}
}
if (IsCoinStake())
{
// Pulse: coin stake tx earns reward instead of paying fee
uint64 nCoinAge;
if (!GetCoinAge(txdb, nCoinAge))
return error("ConnectInputs() : %s unable to get coin age for coinstake", GetHash().ToString().substr(0,10).c_str());
int64 nStakeReward = GetValueOut() - nValueIn;
if (nStakeReward > <API key>(nCoinAge) - GetMinFee() + MIN_TX_FEE)
return DoS(100, error("ConnectInputs() : %s stake reward exceeded", GetHash().ToString().substr(0,10).c_str()));
}
else
{
if (nValueIn < GetValueOut())
return DoS(100, error("ConnectInputs() : %s value in < value out", GetHash().ToString().substr(0,10).c_str()));
// Tally transaction fees
int64 nTxFee = nValueIn - GetValueOut();
if (nTxFee < 0)
return DoS(100, error("ConnectInputs() : %s nTxFee < 0", GetHash().ToString().substr(0,10).c_str()));
// Pulse: enforce transaction fees for every block
if (nTxFee < GetMinFee())
return fBlock? DoS(100, error("ConnectInputs() : %s not paying required fee=%s, paid=%s", GetHash().ToString().substr(0,10).c_str(), FormatMoney(GetMinFee()).c_str(), FormatMoney(nTxFee).c_str())) : false;
nFees += nTxFee;
if (!MoneyRange(nFees))
return DoS(100, error("ConnectInputs() : nFees out of range"));
}
}
return true;
}
bool CTransaction::ClientConnectInputs()
{
if (IsCoinBase())
return false;
// Take over previous transactions' spent pointers
{
LOCK(mempool.cs);
int64 nValueIn = 0;
for (unsigned int i = 0; i < vin.size(); i++)
{
// Get prev tx from single transactions in memory
COutPoint prevout = vin[i].prevout;
if (!mempool.exists(prevout.hash))
return false;
CTransaction& txPrev = mempool.lookup(prevout.hash);
if (prevout.n >= txPrev.vout.size())
return false;
// Verify signature
if (!VerifySignature(txPrev, *this, i, true, 0))
return error("ConnectInputs() : VerifySignature failed");
// this is redundant with the mempool.mapNextTx stuff,
// not sure which I want to get rid of
// this has to go away now that posNext is gone
// // Check for conflicts
// if (!txPrev.vout[prevout.n].posNext.IsNull())
// return error("ConnectInputs() : prev tx already used");
// // Flag outpoints as used
// txPrev.vout[prevout.n].posNext = posThisTx;
nValueIn += txPrev.vout[prevout.n].nValue;
if (!MoneyRange(txPrev.vout[prevout.n].nValue) || !MoneyRange(nValueIn))
return error("ClientConnectInputs() : txin values out of range");
}
if (GetValueOut() > nValueIn)
return false;
}
return true;
}
bool CBlock::DisconnectBlock(CTxDB& txdb, CBlockIndex* pindex)
{
// Disconnect in reverse order
for (int i = vtx.size()-1; i >= 0; i
if (!vtx[i].DisconnectInputs(txdb))
return false;
// Update block index on disk without changing it in memory.
// The memory index structure will be changed after the db commits.
if (pindex->pprev)
{
CDiskBlockIndex blockindexPrev(pindex->pprev);
blockindexPrev.hashNext = 0;
if (!txdb.WriteBlockIndex(blockindexPrev))
return error("DisconnectBlock() : WriteBlockIndex failed");
}
// Pulse: clean up wallet after disconnecting coinstake
BOOST_FOREACH(CTransaction& tx, vtx)
SyncWithWallets(tx, this, false, false);
return true;
}
bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
{
// Check it again in case a previous version let a bad block in
if (!CheckBlock())
return false;
// Do not allow blocks that contain transactions which 'overwrite' older transactions,
// unless those are already completely spent.
// If such overwrites are allowed, coinbases and transactions depending upon those
// can be duplicated to remove the ability to spend the first instance -- even after
// being sent to another address.
// This logic is not necessary for memory pool transactions, as AcceptToMemoryPool
// already refuses previously-known transaction id's entirely.
// This rule applies to all blocks whose timestamp is after March 15, 2012, 0:00 UTC.
// On testnet it is enabled as of februari 20, 2012, 0:00 UTC.
if (pindex->nTime > 1331769600 || (fTestNet && pindex->nTime > 1329696000))
{
BOOST_FOREACH(CTransaction& tx, vtx)
{
CTxIndex txindexOld;
if (txdb.ReadTxIndex(tx.GetHash(), txindexOld))
{
BOOST_FOREACH(CDiskTxPos &pos, txindexOld.vSpent)
if (pos.IsNull())
return false;
}
}
}
// BIP16 didn't become active until Apr 1 2012 (Feb 15 on testnet)
int64 nBIP16SwitchTime = fTestNet ? 1329264000 : 1333238400;
bool <API key> = (pindex->nTime >= nBIP16SwitchTime);
/ issue here: it doesn't know the version
unsigned int nTxPos = pindex->nBlockPos + ::GetSerializeSize(CBlock(), SER_DISK, CLIENT_VERSION) - (2 * <API key>(0)) + <API key>(vtx.size());
map<uint256, CTxIndex> mapQueuedChanges;
int64 nFees = 0;
int64 nValueIn = 0;
int64 nValueOut = 0;
unsigned int nSigOps = 0;
BOOST_FOREACH(CTransaction& tx, vtx)
{
nSigOps += tx.GetLegacySigOpCount();
if (nSigOps > MAX_BLOCK_SIGOPS)
return DoS(100, error("ConnectBlock() : too many sigops"));
CDiskTxPos posThisTx(pindex->nFile, pindex->nBlockPos, nTxPos);
nTxPos += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION);
MapPrevTx mapInputs;
if (tx.IsCoinBase())
nValueOut += tx.GetValueOut();
else
{
bool fInvalid;
if (!tx.FetchInputs(txdb, mapQueuedChanges, true, false, mapInputs, fInvalid))
return false;
if (<API key>)
{
// Add in sigops done by pay-to-script-hash inputs;
// this is to prevent a "rogue miner" from creating
// an <API key> block.
nSigOps += tx.GetP2SHSigOpCount(mapInputs);
if (nSigOps > MAX_BLOCK_SIGOPS)
return DoS(100, error("ConnectBlock() : too many sigops"));
}
int64 nTxValueIn = tx.GetValueIn(mapInputs);
int64 nTxValueOut = tx.GetValueOut();
nValueIn += nTxValueIn;
nValueOut += nTxValueOut;
if (!tx.IsCoinStake())
nFees += nTxValueIn - nTxValueOut;
if (!tx.ConnectInputs(txdb, mapInputs, mapQueuedChanges, posThisTx, pindex, true, false, <API key>))
return false;
}
mapQueuedChanges[tx.GetHash()] = CTxIndex(posThisTx, tx.vout.size());
}
// Pulse: track money supply and mint amount info
pindex->nMint = nValueOut - nValueIn + nFees;
pindex->nMoneySupply = (pindex->pprev? pindex->pprev->nMoneySupply : 0) + nValueOut - nValueIn;
if (!txdb.WriteBlockIndex(CDiskBlockIndex(pindex)))
return error("Connect() : WriteBlockIndex for pindex failed");
// Write queued txindex changes
for (map<uint256, CTxIndex>::iterator mi = mapQueuedChanges.begin(); mi != mapQueuedChanges.end(); ++mi)
{
if (!txdb.UpdateTxIndex((*mi).first, (*mi).second))
return error("ConnectBlock() : UpdateTxIndex failed");
}
// Pulse: fees are not collected by miners as in bitcoin
// Pulse: fees are destroyed to compensate the entire network
if (fDebug && GetBoolArg("-printcreation"))
printf("ConnectBlock() : destroy=%s nFees=%"PRI64d"\n", FormatMoney(nFees).c_str(), nFees);
// Update block index on disk without changing it in memory.
// The memory index structure will be changed after the db commits.
if (pindex->pprev)
{
CDiskBlockIndex blockindexPrev(pindex->pprev);
blockindexPrev.hashNext = pindex->GetBlockHash();
if (!txdb.WriteBlockIndex(blockindexPrev))
return error("ConnectBlock() : WriteBlockIndex for blockindexPrev failed");
}
// Watch for transactions paying to me
BOOST_FOREACH(CTransaction& tx, vtx)
SyncWithWallets(tx, this, true);
return true;
}
bool Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
{
printf("REORGANIZE\n");
// Find the fork
CBlockIndex* pfork = pindexBest;
CBlockIndex* plonger = pindexNew;
while (pfork != plonger)
{
while (plonger->nHeight > pfork->nHeight)
if (!(plonger = plonger->pprev))
return error("Reorganize() : plonger->pprev is null");
if (pfork == plonger)
break;
if (!(pfork = pfork->pprev))
return error("Reorganize() : pfork->pprev is null");
}
// List of what to disconnect
vector<CBlockIndex*> vDisconnect;
for (CBlockIndex* pindex = pindexBest; pindex != pfork; pindex = pindex->pprev)
vDisconnect.push_back(pindex);
// List of what to connect
vector<CBlockIndex*> vConnect;
for (CBlockIndex* pindex = pindexNew; pindex != pfork; pindex = pindex->pprev)
vConnect.push_back(pindex);
reverse(vConnect.begin(), vConnect.end());
printf("REORGANIZE: Disconnect %i blocks; %s..%s\n", vDisconnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexBest->GetBlockHash().ToString().substr(0,20).c_str());
printf("REORGANIZE: Connect %i blocks; %s..%s\n", vConnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->GetBlockHash().ToString().substr(0,20).c_str());
// Disconnect shorter branch
vector<CTransaction> vResurrect;
BOOST_FOREACH(CBlockIndex* pindex, vDisconnect)
{
CBlock block;
if (!block.ReadFromDisk(pindex))
return error("Reorganize() : ReadFromDisk for disconnect failed");
if (!block.DisconnectBlock(txdb, pindex))
return error("Reorganize() : DisconnectBlock %s failed", pindex->GetBlockHash().ToString().substr(0,20).c_str());
// Queue memory transactions to resurrect
BOOST_FOREACH(const CTransaction& tx, block.vtx)
if (!(tx.IsCoinBase() || tx.IsCoinStake()))
vResurrect.push_back(tx);
}
// Connect longer branch
vector<CTransaction> vDelete;
for (unsigned int i = 0; i < vConnect.size(); i++)
{
CBlockIndex* pindex = vConnect[i];
CBlock block;
if (!block.ReadFromDisk(pindex))
return error("Reorganize() : ReadFromDisk for connect failed");
if (!block.ConnectBlock(txdb, pindex))
{
// Invalid block
txdb.TxnAbort();
return error("Reorganize() : ConnectBlock %s failed", pindex->GetBlockHash().ToString().substr(0,20).c_str());
}
// Queue memory transactions to delete
BOOST_FOREACH(const CTransaction& tx, block.vtx)
vDelete.push_back(tx);
}
if (!txdb.WriteHashBestChain(pindexNew->GetBlockHash()))
return error("Reorganize() : WriteHashBestChain failed");
// Make sure it's successfully written to disk before changing memory structure
if (!txdb.TxnCommit())
return error("Reorganize() : TxnCommit failed");
// Disconnect shorter branch
BOOST_FOREACH(CBlockIndex* pindex, vDisconnect)
if (pindex->pprev)
pindex->pprev->pnext = NULL;
// Connect longer branch
BOOST_FOREACH(CBlockIndex* pindex, vConnect)
if (pindex->pprev)
pindex->pprev->pnext = pindex;
// Resurrect memory transactions that were in the disconnected branch
BOOST_FOREACH(CTransaction& tx, vResurrect)
tx.AcceptToMemoryPool(txdb, false);
// Delete redundant memory transactions that are in the connected branch
BOOST_FOREACH(CTransaction& tx, vDelete)
mempool.remove(tx);
printf("REORGANIZE: done\n");
return true;
}
// Called from inside SetBestChain: attaches a block to the new best chain being built
bool CBlock::SetBestChainInner(CTxDB& txdb, CBlockIndex *pindexNew)
{
uint256 hash = GetHash();
// Adding to current best branch
if (!ConnectBlock(txdb, pindexNew) || !txdb.WriteHashBestChain(hash))
{
txdb.TxnAbort();
InvalidChainFound(pindexNew);
return false;
}
if (!txdb.TxnCommit())
return error("SetBestChain() : TxnCommit failed");
// Add to current best branch
pindexNew->pprev->pnext = pindexNew;
// Delete redundant memory transactions
BOOST_FOREACH(CTransaction& tx, vtx)
mempool.remove(tx);
return true;
}
bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew)
{
uint256 hash = GetHash();
if (!txdb.TxnBegin())
return error("SetBestChain() : TxnBegin failed");
if (pindexGenesisBlock == NULL && hash == hashGenesisBlock)
{
txdb.WriteHashBestChain(hash);
if (!txdb.TxnCommit())
return error("SetBestChain() : TxnCommit failed");
pindexGenesisBlock = pindexNew;
}
else if (hashPrevBlock == hashBestChain)
{
if (!SetBestChainInner(txdb, pindexNew))
return error("SetBestChain() : SetBestChainInner failed");
}
else
{
// the first block in the new chain that will cause it to become the new best chain
CBlockIndex *pindexIntermediate = pindexNew;
// list of blocks that need to be connected afterwards
std::vector<CBlockIndex*> vpindexSecondary;
// Reorganize is costly in terms of db load, as it works in a single db transaction.
// Try to limit how much needs to be done inside
while (pindexIntermediate->pprev && pindexIntermediate->pprev->bnChainTrust > pindexBest->bnChainTrust)
{
vpindexSecondary.push_back(pindexIntermediate);
pindexIntermediate = pindexIntermediate->pprev;
}
if (!vpindexSecondary.empty())
printf("Postponing %i reconnects\n", vpindexSecondary.size());
// Switch to new best branch
if (!Reorganize(txdb, pindexIntermediate))
{
txdb.TxnAbort();
InvalidChainFound(pindexNew);
return error("SetBestChain() : Reorganize failed");
}
// Connect futher blocks
<API key>(CBlockIndex *pindex, vpindexSecondary)
{
CBlock block;
if (!block.ReadFromDisk(pindex))
{
printf("SetBestChain() : ReadFromDisk failed\n");
break;
}
if (!txdb.TxnBegin()) {
printf("SetBestChain() : TxnBegin 2 failed\n");
break;
}
// errors now are not fatal, we still did a reorganisation to a new chain in a valid way
if (!block.SetBestChainInner(txdb, pindex))
break;
}
}
// Update best block in wallet (so we can detect restored wallets)
bool fIsInitialDownload = <API key>();
if (!fIsInitialDownload)
{
const CBlockLocator locator(pindexNew);
::SetBestChain(locator);
}
// New best block
hashBestChain = hash;
pindexBest = pindexNew;
nBestHeight = pindexBest->nHeight;
bnBestChainTrust = pindexNew->bnChainTrust;
nTimeBestReceived = GetTime();
<API key>++;
printf("SetBestChain: new best=%s height=%d trust=%s moneysupply=%s\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainTrust.ToString().c_str(), FormatMoney(pindexBest->nMoneySupply).c_str());
std::string strCmd = GetArg("-blocknotify", "");
if (!fIsInitialDownload && !strCmd.empty())
{
boost::replace_all(strCmd, "%s", hashBestChain.GetHex());
boost::thread t(runCommand, strCmd); // thread runs free
}
return true;
}
// Pulse: total coin age spent in transaction, in the unit of coin-days.
// Only those coins meeting minimum age requirement counts. As those
// transactions not in main chain are not currently indexed so we
// might not find out about their coin age. Older transactions are
// guaranteed to be in main chain by sync-checkpoint. This rule is
// introduced to help nodes establish a consistent view of the coin
// age (trust score) of competing branches.
bool CTransaction::GetCoinAge(CTxDB& txdb, uint64& nCoinAge) const
{
CBigNum bnCentSecond = 0; // coin age in the unit of cent-seconds
nCoinAge = 0;
if (IsCoinBase())
return true;
BOOST_FOREACH(const CTxIn& txin, vin)
{
// First try finding the previous transaction in database
CTransaction txPrev;
CTxIndex txindex;
if (!txPrev.ReadFromDisk(txdb, txin.prevout, txindex))
continue; // previous transaction not in main chain
if (nTime < txPrev.nTime)
return false; // Transaction timestamp violation
// Read block header
CBlock block;
if (!block.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos, false))
return false; // unable to read block of previous transaction
if (block.GetBlockTime() + nStakeMinAge > nTime)
continue; // only count coins meeting min age requirement
int64 nValueIn = txPrev.vout[txin.prevout.n].nValue;
bnCentSecond += CBigNum(nValueIn) * (nTime-txPrev.nTime) / CENT;
if (fDebug && GetBoolArg("-printcoinage"))
printf("coin age nValueIn=%-12I64d nTimeDiff=%d bnCentSecond=%s\n", nValueIn, nTime - txPrev.nTime, bnCentSecond.ToString().c_str());
}
CBigNum bnCoinDay = bnCentSecond * CENT / COIN / (24 * 60 * 60);
if (fDebug && GetBoolArg("-printcoinage"))
printf("coin age bnCoinDay=%s\n", bnCoinDay.ToString().c_str());
nCoinAge = bnCoinDay.getuint64();
return true;
}
// Pulse: total coin age spent in block, in the unit of coin-days.
bool CBlock::GetCoinAge(uint64& nCoinAge) const
{
nCoinAge = 0;
CTxDB txdb("r");
BOOST_FOREACH(const CTransaction& tx, vtx)
{
uint64 nTxCoinAge;
if (tx.GetCoinAge(txdb, nTxCoinAge))
nCoinAge += nTxCoinAge;
else
return false;
}
if (nCoinAge == 0) // block coin age minimum 1 coin-day
nCoinAge = 1;
if (fDebug && GetBoolArg("-printcoinage"))
printf("block coin age total nCoinDays=%"PRI64d"\n", nCoinAge);
return true;
}
bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos)
{
// Check for duplicate
uint256 hash = GetHash();
if (mapBlockIndex.count(hash))
return error("AddToBlockIndex() : %s already exists", hash.ToString().substr(0,20).c_str());
// Construct new block index object
CBlockIndex* pindexNew = new CBlockIndex(nFile, nBlockPos, *this);
if (!pindexNew)
return error("AddToBlockIndex() : new CBlockIndex failed");
pindexNew->phashBlock = &hash;
map<uint256, CBlockIndex*>::iterator miPrev = mapBlockIndex.find(hashPrevBlock);
if (miPrev != mapBlockIndex.end())
{
pindexNew->pprev = (*miPrev).second;
pindexNew->nHeight = pindexNew->pprev->nHeight + 1;
}
// Pulse: compute chain trust score
pindexNew->bnChainTrust = (pindexNew->pprev ? pindexNew->pprev->bnChainTrust : 0) + pindexNew->GetBlockTrust();
// Pulse: compute stake entropy bit for stake modifier
if (!pindexNew->SetStakeEntropyBit(GetStakeEntropyBit()))
return error("AddToBlockIndex() : SetStakeEntropyBit() failed");
// Pulse: record proof-of-stake hash value
if (pindexNew->IsProofOfStake())
{
if (!mapProofOfStake.count(hash))
return error("AddToBlockIndex() : hashProofOfStake not found in map");
pindexNew->hashProofOfStake = mapProofOfStake[hash];
}
// Pulse: compute stake modifier
uint64 nStakeModifier = 0;
bool <API key> = false;
if (!<API key>(pindexNew, nStakeModifier, <API key>))
return error("AddToBlockIndex() : <API key>() failed");
pindexNew->SetStakeModifier(nStakeModifier, <API key>);
pindexNew-><API key> = <API key>(pindexNew);
if (!<API key>(pindexNew->nHeight, pindexNew-><API key>))
return error("AddToBlockIndex() : Rejected by stake modifier checkpoint height=%d, modifier=0x%016"PRI64x, pindexNew->nHeight, nStakeModifier);
// Add to mapBlockIndex
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;
if (pindexNew->IsProofOfStake())
setStakeSeen.insert(make_pair(pindexNew->prevoutStake, pindexNew->nStakeTime));
pindexNew->phashBlock = &((*mi).first);
// Write to disk block index
CTxDB txdb;
if (!txdb.TxnBegin())
return false;
txdb.WriteBlockIndex(CDiskBlockIndex(pindexNew));
if (!txdb.TxnCommit())
return false;
// New best
if (pindexNew->bnChainTrust > bnBestChainTrust)
if (!SetBestChain(txdb, pindexNew))
return false;
txdb.Close();
if (pindexNew == pindexBest)
{
// Notify UI to display prev block's coinbase if it was ours
static uint256 <API key>;
UpdatedTransaction(<API key>);
<API key> = vtx[0].GetHash();
}
MainFrameRepaint();
return true;
}
bool CBlock::CheckBlock() const
{
// These are checks that are independent of context
// that can be verified before saving an orphan block.
// Size limits
if (vtx.empty() || vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)
return DoS(100, error("CheckBlock() : size limits failed"));
// Check proof of work matches claimed amount
if (IsProofOfWork() && !CheckProofOfWork(GetHash(), nBits))
return DoS(50, error("CheckBlock() : proof of work failed"));
// Check timestamp
if (GetBlockTime() > GetAdjustedTime() + nMaxClockDrift)
return error("CheckBlock() : block timestamp too far in the future");
// First transaction must be coinbase, the rest must not be
if (vtx.empty() || !vtx[0].IsCoinBase())
return DoS(100, error("CheckBlock() : first tx is not coinbase"));
for (unsigned int i = 1; i < vtx.size(); i++)
if (vtx[i].IsCoinBase())
return DoS(100, error("CheckBlock() : more than one coinbase"));
// Pulse: only the second transaction can be the optional coinstake
for (int i = 2; i < vtx.size(); i++)
if (vtx[i].IsCoinStake())
return DoS(100, error("CheckBlock() : coinstake in wrong position"));
// Pulse: coinbase output should be empty if proof-of-stake block
if (IsProofOfStake() && (vtx[0].vout.size() != 1 || !vtx[0].vout[0].IsEmpty()))
return error("CheckBlock() : coinbase output not empty for proof-of-stake block");
// Check coinbase timestamp
if (GetBlockTime() > (int64)vtx[0].nTime + nMaxClockDrift)
return DoS(50, error("CheckBlock() : coinbase timestamp is too early"));
// Check coinstake timestamp
if (IsProofOfStake() && !<API key>(GetBlockTime(), (int64)vtx[1].nTime))
return DoS(50, error("CheckBlock() : coinstake timestamp violation nTimeBlock=%u nTimeTx=%u", GetBlockTime(), vtx[1].nTime));
// Check coinbase reward
if (vtx[0].GetValueOut() > (IsProofOfWork()? (<API key>(nBits) - vtx[0].GetMinFee() + MIN_TX_FEE) : 0))
return DoS(50, error("CheckBlock() : coinbase reward exceeded %s > %s",
FormatMoney(vtx[0].GetValueOut()).c_str(),
FormatMoney(IsProofOfWork()? <API key>(nBits) : 0).c_str()));
// Check transactions
BOOST_FOREACH(const CTransaction& tx, vtx)
{
if (!tx.CheckTransaction())
return DoS(tx.nDoS, error("CheckBlock() : CheckTransaction failed"));
// Pulse: check transaction timestamp
if (GetBlockTime() < (int64)tx.nTime)
return DoS(50, error("CheckBlock() : block timestamp earlier than transaction timestamp"));
}
// Check for duplicate txids. This is caught by ConnectInputs(),
// but catching it earlier avoids a potential DoS attack:
set<uint256> uniqueTx;
BOOST_FOREACH(const CTransaction& tx, vtx)
{
uniqueTx.insert(tx.GetHash());
}
if (uniqueTx.size() != vtx.size())
return DoS(100, error("CheckBlock() : duplicate transaction"));
unsigned int nSigOps = 0;
BOOST_FOREACH(const CTransaction& tx, vtx)
{
nSigOps += tx.GetLegacySigOpCount();
}
if (nSigOps > MAX_BLOCK_SIGOPS)
return DoS(100, error("CheckBlock() : out-of-bounds SigOpCount"));
// Check merkleroot
if (hashMerkleRoot != BuildMerkleTree())
return DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"));
// Pulse: check block signature
if (!CheckBlockSignature())
return DoS(100, error("CheckBlock() : bad block signature"));
return true;
}
bool CBlock::AcceptBlock()
{
// Check for duplicate
uint256 hash = GetHash();
if (mapBlockIndex.count(hash))
return error("AcceptBlock() : block already in mapBlockIndex");
// Get prev block index
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashPrevBlock);
if (mi == mapBlockIndex.end())
return DoS(10, error("AcceptBlock() : prev block not found"));
CBlockIndex* pindexPrev = (*mi).second;
int nHeight = pindexPrev->nHeight+1;
// Check proof-of-work or proof-of-stake
if (nBits != <API key>(pindexPrev, IsProofOfStake()))
return DoS(100, error("AcceptBlock() : incorrect proof-of-work/proof-of-stake"));
// Check timestamp against prev
if (GetBlockTime() <= pindexPrev->GetMedianTimePast() || GetBlockTime() + nMaxClockDrift < pindexPrev->GetBlockTime())
return error("AcceptBlock() : block's timestamp is too early");
// Check that all transactions are finalized
BOOST_FOREACH(const CTransaction& tx, vtx)
if (!tx.IsFinal(nHeight, GetBlockTime()))
return DoS(10, error("AcceptBlock() : contains a non-final transaction"));
// Check that the block chain matches the known block chain up to a hardened checkpoint
if (!Checkpoints::CheckHardened(nHeight, hash))
return DoS(100, error("AcceptBlock() : rejected by hardened checkpoint lockin at %d", nHeight));
// Pulse: check that the block satisfies synchronized checkpoint
if (!Checkpoints::CheckSync(hash, pindexPrev))
return error("AcceptBlock() : rejected by synchronized checkpoint");
// Write block to history file
if (!CheckDiskSpace(::GetSerializeSize(*this, SER_DISK, CLIENT_VERSION)))
return error("AcceptBlock() : out of disk space");
unsigned int nFile = -1;
unsigned int nBlockPos = 0;
if (!WriteToDisk(nFile, nBlockPos))
return error("AcceptBlock() : WriteToDisk failed");
if (!AddToBlockIndex(nFile, nBlockPos))
return error("AcceptBlock() : AddToBlockIndex failed");
// Relay inventory, but don't relay old inventory during initial block download
int nBlockEstimate = Checkpoints::<API key>();
if (hashBestChain == hash)
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate))
pnode->PushInventory(CInv(MSG_BLOCK, hash));
}
// Pulse: check pending sync-checkpoint
Checkpoints::<API key>();
return true;
}
bool ProcessBlock(CNode* pfrom, CBlock* pblock)
{
// Check for duplicate
uint256 hash = pblock->GetHash();
if (mapBlockIndex.count(hash))
return error("ProcessBlock() : already have block %d %s", mapBlockIndex[hash]->nHeight, hash.ToString().substr(0,20).c_str());
if (mapOrphanBlocks.count(hash))
return error("ProcessBlock() : already have block (orphan) %s", hash.ToString().substr(0,20).c_str());
// Pulse: check proof-of-stake
// Limited duplicity on stake: prevents block flood attack
// Duplicate stake allowed only when there is orphan child block
if (pblock->IsProofOfStake() && setStakeSeen.count(pblock->GetProofOfStake()) && !<API key>.count(hash) && !Checkpoints::<API key>(hash))
return error("ProcessBlock() : duplicate proof-of-stake (%s, %d) for block %s", pblock->GetProofOfStake().first.ToString().c_str(), pblock->GetProofOfStake().second, hash.ToString().c_str());
// Preliminary checks
if (!pblock->CheckBlock())
return error("ProcessBlock() : CheckBlock FAILED");
// Pulse: verify hash target and signature of coinstake tx
if (pblock->IsProofOfStake())
{
uint256 hashProofOfStake = 0;
if (!CheckProofOfStake(pblock->vtx[1], pblock->nBits, hashProofOfStake))
{
printf("WARNING: ProcessBlock(): check proof-of-stake failed for block %s\n", hash.ToString().c_str());
// pulse: ask for missing blocks
if (pfrom)
pfrom->PushGetBlocks(pindexBest, pblock->GetHash());
return false; // do not error here as we expect this during initial block download
}
if (!mapProofOfStake.count(hash)) // add to mapProofOfStake
mapProofOfStake.insert(make_pair(hash, hashProofOfStake));
}
CBlockIndex* pcheckpoint = Checkpoints::<API key>();
if (pcheckpoint && pblock->hashPrevBlock != hashBestChain && !Checkpoints::<API key>(hash))
{
// Extra checks to prevent "fill up memory by spamming with bogus blocks"
int64 deltaTime = pblock->GetBlockTime() - pcheckpoint->nTime;
CBigNum bnNewBlock;
bnNewBlock.SetCompact(pblock->nBits);
CBigNum bnRequired;
bnRequired.SetCompact(ComputeMinWork(GetLastBlockIndex(pcheckpoint, pblock->IsProofOfStake())->nBits, deltaTime));
if (bnNewBlock > bnRequired)
{
if (pfrom)
pfrom->Misbehaving(100);
return error("ProcessBlock() : block with too little %s", pblock->IsProofOfStake()? "proof-of-stake" : "proof-of-work");
}
}
// Pulse: ask for pending sync-checkpoint if any
if (!<API key>())
Checkpoints::<API key>(pfrom);
// If don't already have its previous block, shunt it off to holding area until we get it
if (!mapBlockIndex.count(pblock->hashPrevBlock))
{
printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().substr(0,20).c_str());
CBlock* pblock2 = new CBlock(*pblock);
// Pulse: check proof-of-stake
if (pblock2->IsProofOfStake())
{
// Limited duplicity on stake: prevents block flood attack
// Duplicate stake allowed only when there is orphan child block
if (setStakeSeenOrphan.count(pblock2->GetProofOfStake()) && !<API key>.count(hash) && !Checkpoints::<API key>(hash))
{
error("ProcessBlock() : duplicate proof-of-stake (%s, %d) for orphan block %s", pblock2->GetProofOfStake().first.ToString().c_str(), pblock2->GetProofOfStake().second, hash.ToString().c_str());
//pblock2 will not be needed, free it
delete pblock2;
return false;
}
else
setStakeSeenOrphan.insert(pblock2->GetProofOfStake());
}
mapOrphanBlocks.insert(make_pair(hash, pblock2));
<API key>.insert(make_pair(pblock2->hashPrevBlock, pblock2));
// Ask this guy to fill in what we're missing
if (pfrom)
{
pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(pblock2));
// Pulse: getblocks may not obtain the ancestor block rejected
// earlier by duplicate-stake check so we ask for it again directly
if (!<API key>())
pfrom->AskFor(CInv(MSG_BLOCK, WantedByOrphan(pblock2)));
}
return true;
}
// Store to disk
if (!pblock->AcceptBlock())
return error("ProcessBlock() : AcceptBlock FAILED");
// Recursively process any orphan blocks that depended on this one
vector<uint256> vWorkQueue;
vWorkQueue.push_back(hash);
for (unsigned int i = 0; i < vWorkQueue.size(); i++)
{
uint256 hashPrev = vWorkQueue[i];
for (multimap<uint256, CBlock*>::iterator mi = <API key>.lower_bound(hashPrev);
mi != <API key>.upper_bound(hashPrev);
++mi)
{
CBlock* pblockOrphan = (*mi).second;
if (pblockOrphan->AcceptBlock())
vWorkQueue.push_back(pblockOrphan->GetHash());
mapOrphanBlocks.erase(pblockOrphan->GetHash());
setStakeSeenOrphan.erase(pblockOrphan->GetProofOfStake());
delete pblockOrphan;
}
<API key>.erase(hashPrev);
}
printf("ProcessBlock: ACCEPTED\n");
// Pulse: if responsible for sync-checkpoint send it
if (pfrom && !CSyncCheckpoint::strMasterPrivKey.empty())
Checkpoints::SendSyncCheckpoint(Checkpoints::<API key>());
return true;
}
// Pulse: sign block
bool CBlock::SignBlock(const CKeyStore& keystore)
{
vector<valtype> vSolutions;
txnouttype whichType;
const CTxOut& txout = IsProofOfStake()? vtx[1].vout[1] : vtx[0].vout[0];
if (!Solver(txout.scriptPubKey, whichType, vSolutions))
return false;
if (whichType == TX_PUBKEY)
{
// Sign
const valtype& vchPubKey = vSolutions[0];
CKey key;
if (!keystore.GetKey(Hash160(vchPubKey), key))
return false;
if (key.GetPubKey() != vchPubKey)
return false;
return key.Sign(GetHash(), vchBlockSig);
}
return false;
}
// Pulse: check block signature
bool CBlock::CheckBlockSignature() const
{
if (GetHash() == hashGenesisBlock)
return vchBlockSig.empty();
vector<valtype> vSolutions;
txnouttype whichType;
const CTxOut& txout = IsProofOfStake()? vtx[1].vout[1] : vtx[0].vout[0];
if (!Solver(txout.scriptPubKey, whichType, vSolutions))
return false;
if (whichType == TX_PUBKEY)
{
const valtype& vchPubKey = vSolutions[0];
CKey key;
if (!key.SetPubKey(vchPubKey))
return false;
if (vchBlockSig.empty())
return false;
return key.Verify(GetHash(), vchBlockSig);
}
return false;
}
// Pulse: entropy bit for stake modifier if chosen by modifier
unsigned int CBlock::GetStakeEntropyBit() const
{
unsigned int nEntropyBit = 0;
if (IsProtocolV04(nTime))
{
nEntropyBit = ((GetHash().Get64()) & 1llu);// last bit of block hash
if (fDebug && GetBoolArg("-printstakemodifier"))
printf("GetStakeEntropyBit(v0.4+): nTime=%u hashBlock=%s entropybit=%d\n", nTime, GetHash().ToString().c_str(), nEntropyBit);
}
else
{
// old protocol for entropy bit pre v0.4
uint160 hashSig = Hash160(vchBlockSig);
if (fDebug && GetBoolArg("-printstakemodifier"))
printf("GetStakeEntropyBit(v0.3): nTime=%u hashSig=%s", nTime, hashSig.ToString().c_str());
hashSig >>= 159; // take the first bit of the hash
nEntropyBit = hashSig.Get64();
if (fDebug && GetBoolArg("-printstakemodifier"))
printf(" entropybit=%d\n", nEntropyBit);
}
return nEntropyBit;
}
bool CheckDiskSpace(uint64 nAdditionalBytes)
{
uint64 nFreeBytesAvailable = filesystem::space(GetDataDir()).available;
// Check for 15MB because database could create another 10MB log file at any time
if (nFreeBytesAvailable < (uint64)15000000 + nAdditionalBytes)
{
fShutdown = true;
string strMessage = _("Warning: Disk space is low");
strMiscWarning = strMessage;
printf("*** %s\n", strMessage.c_str());
<API key>(strMessage, "Pulse", wxOK | wxICON_EXCLAMATION | wxMODAL);
StartShutdown();
return false;
}
return true;
}
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode)
{
if (nFile == -1)
return NULL;
FILE* file = fopen((GetDataDir() / strprintf("blk%04d.dat", nFile)).string().c_str(), pszMode);
if (!file)
return NULL;
if (nBlockPos != 0 && !strchr(pszMode, 'a') && !strchr(pszMode, 'w'))
{
if (fseek(file, nBlockPos, SEEK_SET) != 0)
{
fclose(file);
return NULL;
}
}
return file;
}
static unsigned int nCurrentBlockFile = 1;
FILE* AppendBlockFile(unsigned int& nFileRet)
{
nFileRet = 0;
loop
{
FILE* file = OpenBlockFile(nCurrentBlockFile, 0, "ab");
if (!file)
return NULL;
if (fseek(file, 0, SEEK_END) != 0)
return NULL;
// FAT32 filesize max 4GB, fseek and ftell max 2GB, so we must stay under 2GB
if (ftell(file) < 0x7F000000 - MAX_SIZE)
{
nFileRet = nCurrentBlockFile;
return file;
}
fclose(file);
nCurrentBlockFile++;
}
}
bool LoadBlockIndex(bool fAllowNew)
{
if (fTestNet)
{
hashGenesisBlock = <API key>;
bnProofOfWorkLimit = CBigNum(~uint256(0) >> 28);
nStakeMinAge = 60 * 60 * 24; // test net min age is 1 day
nCoinbaseMaturity = 60;
bnInitialHashTarget = CBigNum(~uint256(0) >> 29);
nModifierInterval = 60 * 20; // test net modifier interval is 20 minutes
}
printf("%s Network: genesis=0x%s nBitsLimit=0x%08x nBitsInitial=0x%08x nStakeMinAge=%d nCoinbaseMaturity=%d nModifierInterval=%d\n",
fTestNet? "Test" : "Pulse", hashGenesisBlock.ToString().substr(0, 20).c_str(), bnProofOfWorkLimit.GetCompact(), bnInitialHashTarget.GetCompact(), nStakeMinAge, nCoinbaseMaturity, nModifierInterval);
// Load block index
CTxDB txdb("cr");
if (!txdb.LoadBlockIndex())
return false;
txdb.Close();
// Init with genesis block
if (mapBlockIndex.empty())
{
if (!fAllowNew)
return false;
// Genesis Block:
// CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
// CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
// CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)
// CTxOut(nValue=50.00000000, scriptPubKey=<API key>)
// vMerkleTree: 4a5e1e
// Genesis block
const char* pszTimestamp = "Look at how a single candle can both defy and define the darkness";
CTransaction txNew;
txNew.nTime = 1435547102;
txNew.vin.resize(1);
txNew.vout.resize(1);
txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(9999) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
txNew.vout[0].SetEmpty();
CBlock block;
block.vtx.push_back(txNew);
block.hashPrevBlock = 0;
block.hashMerkleRoot = block.BuildMerkleTree();
block.nVersion = 1;
block.nTime = 1435547102;
block.nBits = bnProofOfWorkLimit.GetCompact();
block.nNonce = 1560399;
if (fTestNet)
{
block.nTime = 1345090000;
block.nNonce = 122894938;
}
/ debug print
printf("%s\n", block.GetHash().ToString().c_str());
printf("%s\n", hashGenesisBlock.ToString().c_str());
printf("%s\n", block.hashMerkleRoot.ToString().c_str());
assert(block.hashMerkleRoot == uint256("<API key>"));
block.print();
assert(block.GetHash() == hashGenesisBlock);
assert(block.CheckBlock());
// Start new block file
unsigned int nFile;
unsigned int nBlockPos;
if (!block.WriteToDisk(nFile, nBlockPos))
return error("LoadBlockIndex() : writing genesis block to disk failed");
if (!block.AddToBlockIndex(nFile, nBlockPos))
return error("LoadBlockIndex() : genesis block not accepted");
// Pulse: initialize synchronized checkpoint
if (!Checkpoints::WriteSyncCheckpoint(hashGenesisBlock))
return error("LoadBlockIndex() : failed to init sync checkpoint");
// Pulse: upgrade time set to zero if txdb initialized
{
CTxDB txdb;
if (!txdb.WriteV04UpgradeTime(0))
return error("LoadBlockIndex() : failed to init upgrade info");
printf(" Upgrade Info: v0.4+ txdb initialization\n");
txdb.Close();
}
}
// Pulse: if checkpoint master key changed must reset sync-checkpoint
{
CTxDB txdb;
string strPubKey = "";
if (!txdb.<API key>(strPubKey) || strPubKey != CSyncCheckpoint::strMasterPubKey)
{
// write checkpoint master key to db
txdb.TxnBegin();
if (!txdb.<API key>(CSyncCheckpoint::strMasterPubKey))
return error("LoadBlockIndex() : failed to write new checkpoint master key to db");
if (!txdb.TxnCommit())
return error("LoadBlockIndex() : failed to commit new checkpoint master key to db");
if ((!fTestNet) && !Checkpoints::ResetSyncCheckpoint())
return error("LoadBlockIndex() : failed to reset sync-checkpoint");
}
txdb.Close();
}
// Pulse: upgrade time set to zero if txdb initialized
{
CTxDB txdb;
if (txdb.ReadV04UpgradeTime(<API key>))
{
if (<API key>)
printf(" Upgrade Info: txdb upgrade to v0.4 detected at timestamp %d\n", <API key>);
else
printf(" Upgrade Info: v0.4+ no txdb upgrade detected.\n");
}
else
{
<API key> = GetTime();
printf(" Upgrade Info: upgrading txdb from v0.3 at timestamp %u\n", <API key>);
if (!txdb.WriteV04UpgradeTime(<API key>))
return error("LoadBlockIndex() : failed to write upgrade info");
}
txdb.Close();
}
return true;
}
void PrintBlockTree()
{
// precompute tree structure
map<CBlockIndex*, vector<CBlockIndex*> > mapNext;
for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
{
CBlockIndex* pindex = (*mi).second;
mapNext[pindex->pprev].push_back(pindex);
// test
//while (rand() % 3 == 0)
// mapNext[pindex->pprev].push_back(pindex);
}
vector<pair<int, CBlockIndex*> > vStack;
vStack.push_back(make_pair(0, pindexGenesisBlock));
int nPrevCol = 0;
while (!vStack.empty())
{
int nCol = vStack.back().first;
CBlockIndex* pindex = vStack.back().second;
vStack.pop_back();
// print split or gap
if (nCol > nPrevCol)
{
for (int i = 0; i < nCol-1; i++)
printf("| ");
printf("|\\\n");
}
else if (nCol < nPrevCol)
{
for (int i = 0; i < nCol; i++)
printf("| ");
printf("|\n");
}
nPrevCol = nCol;
// print columns
for (int i = 0; i < nCol; i++)
printf("| ");
// print item
CBlock block;
block.ReadFromDisk(pindex);
printf("%d (%u,%u) %s %08lx %s mint %7s tx %d",
pindex->nHeight,
pindex->nFile,
pindex->nBlockPos,
block.GetHash().ToString().c_str(),
block.nBits,
DateTimeStrFormat(block.GetBlockTime()).c_str(),
FormatMoney(pindex->nMint).c_str(),
block.vtx.size());
PrintWallets(block);
// put the main timechain first
vector<CBlockIndex*>& vNext = mapNext[pindex];
for (unsigned int i = 0; i < vNext.size(); i++)
{
if (vNext[i]->pnext)
{
swap(vNext[0], vNext[i]);
break;
}
}
// iterate children
for (unsigned int i = 0; i < vNext.size(); i++)
vStack.push_back(make_pair(nCol+i, vNext[i]));
}
}
// CAlert
map<uint256, CAlert> mapAlerts;
CCriticalSection cs_mapAlerts;
static string strMintMessage = _("Info: Minting suspended due to locked wallet.");
static string strMintWarning;
string GetWarnings(string strFor)
{
int nPriority = 0;
string strStatusBar;
string strRPC;
if (GetBoolArg("-testsafemode"))
strRPC = "test";
// Pulse: wallet lock warning for minting
if (strMintWarning != "")
{
nPriority = 0;
strStatusBar = strMintWarning;
}
// Pulse: wallet lock warning for minting
if (strMotivational != "")
{
nPriority = 101;
strStatusBar = strMotivational;
}
// Misc warnings like out of disk space and clock is wrong
if (strMiscWarning != "")
{
nPriority = 1000;
strStatusBar = strMiscWarning;
}
// Pulse: should not enter safe mode for longer invalid chain
// Pulse: if sync-checkpoint is too old do not enter safe mode
if (Checkpoints::<API key>(60 * 60 * 24 * 15) && !fTestNet)
{
nPriority = 100;
strStatusBar = "Pulse";
}
// Pulse: if detected invalid checkpoint enter safe mode
if (Checkpoints::<API key> != 0)
{
nPriority = 3000;
strStatusBar = strRPC = "WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers of the issue.";
}
// Pulse: if detected unmet upgrade requirement enter safe mode
// Note: v0.4 upgrade requires blockchain redownload if past protocol switch
if (IsProtocolV04(<API key> + 60*60*24)) // 1 day margin
{
nPriority = 5000;
strStatusBar = strRPC = "WARNING: Blockchain redownload required approaching or past v0.4 upgrade deadline.";
}
// Alerts
{
LOCK(cs_mapAlerts);
BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
{
const CAlert& alert = item.second;
if (alert.AppliesToMe() && alert.nPriority > nPriority)
{
nPriority = alert.nPriority;
strStatusBar = alert.strStatusBar;
if (nPriority > 1000)
strRPC = strStatusBar; // Pulse: safe mode for high alert
}
}
}
if (strFor == "statusbar")
return strStatusBar;
else if (strFor == "rpc")
return strRPC;
assert(!"GetWarnings() : invalid parameter");
return "error";
}
bool CAlert::ProcessAlert()
{
if (!CheckSignature())
return false;
if (!IsInEffect())
return false;
{
LOCK(cs_mapAlerts);
// Cancel previous alerts
for (map<uint256, CAlert>::iterator mi = mapAlerts.begin(); mi != mapAlerts.end();)
{
const CAlert& alert = (*mi).second;
if (Cancels(alert))
{
printf("cancelling alert %d\n", alert.nID);
mapAlerts.erase(mi++);
}
else if (!alert.IsInEffect())
{
printf("expiring alert %d\n", alert.nID);
mapAlerts.erase(mi++);
}
else
mi++;
}
// Check if this alert has been cancelled
BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
{
const CAlert& alert = item.second;
if (alert.Cancels(*this))
{
printf("alert already cancelled by %d\n", alert.nID);
return false;
}
}
// Add to mapAlerts
mapAlerts.insert(make_pair(GetHash(), *this));
}
printf("accepted alert %d, AppliesToMe()=%d\n", nID, AppliesToMe());
MainFrameRepaint();
return true;
}
// Messages
bool static AlreadyHave(CTxDB& txdb, const CInv& inv)
{
switch (inv.type)
{
case MSG_TX:
{
bool txInMap = false;
{
LOCK(mempool.cs);
txInMap = (mempool.exists(inv.hash));
}
return txInMap ||
<API key>.count(inv.hash) ||
txdb.ContainsTx(inv.hash);
}
case MSG_BLOCK:
return mapBlockIndex.count(inv.hash) ||
mapOrphanBlocks.count(inv.hash);
}
// Don't know what it is, just say we already got one
return true;
}
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
static map<CService, CPubKey> mapReuseKey;
RandAddSeedPerfmon();
if (fDebug) {
printf("%s ", DateTimeStrFormat(GetTime()).c_str());
printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size());
}
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
{
printf("dropmessagestest DROPPING RECV MESSAGE\n");
return true;
}
if (strCommand == "version")
{
// Each connection can only send one version message
if (pfrom->nVersion != 0)
{
pfrom->Misbehaving(1);
return false;
}
int64 nTime;
CAddress addrMe;
CAddress addrFrom;
uint64 nNonce = 1;
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
if (pfrom->nVersion < MIN_PROTO_VERSION)
{
// Since February 20, 2012, the protocol is initiated at version 209,
// and earlier versions are no longer supported
printf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString().c_str(), pfrom->nVersion);
pfrom->fDisconnect = true;
return false;
}
if (pfrom->nVersion == 10300)
pfrom->nVersion = 300;
if (!vRecv.empty())
vRecv >> addrFrom >> nNonce;
if (!vRecv.empty())
vRecv >> pfrom->strSubVer;
if (!vRecv.empty())
vRecv >> pfrom->nStartingHeight;
if (pfrom->fInbound && addrMe.IsRoutable())
{
pfrom->addrLocal = addrMe;
SeenLocal(addrMe);
}
// Disconnect if we connected to ourself
if (nNonce == nLocalHostNonce && nNonce > 1)
{
printf("connected to self at %s, disconnecting\n", pfrom->addr.ToString().c_str());
pfrom->fDisconnect = true;
return true;
}
// Pulse: record my external IP reported by peer
if (addrFrom.IsRoutable() && addrMe.IsRoutable())
addrSeenByPeer = addrMe;
// Be shy and don't send version until we hear
if (pfrom->fInbound)
pfrom->PushVersion();
pfrom->fClient = !(pfrom->nServices & NODE_NETWORK);
AddTimeData(pfrom->addr, nTime);
// Change version
pfrom->PushMessage("verack");
pfrom->vSend.SetVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
if (!pfrom->fInbound)
{
// Advertise our address
if (!fNoListen && !fUseProxy && !<API key>())
{
CAddress addr = GetLocalAddress(&pfrom->addr);
if (addr.IsRoutable())
pfrom->PushAddress(addr);
}
// Get recent addresses
if (pfrom->fOneShot || pfrom->nVersion >= CADDR_TIME_VERSION || addrman.size() < 1000)
{
pfrom->PushMessage("getaddr");
pfrom->fGetAddr = true;
}
addrman.Good(pfrom->addr);
} else {
if (((CNetAddr)pfrom->addr) == (CNetAddr)addrFrom)
{
addrman.Add(addrFrom, addrFrom);
addrman.Good(addrFrom);
}
}
// Ask the first connected node for block updates
static int nAskedForBlocks = 0;
if (!pfrom->fClient && !pfrom->fOneShot &&
(pfrom->nVersion < <API key> ||
pfrom->nVersion >= NOBLKS_VERSION_END) &&
(nAskedForBlocks < 1 || vNodes.size() <= 1))
{
nAskedForBlocks++;
pfrom->PushGetBlocks(pindexBest, uint256(0));
}
// Relay alerts
{
LOCK(cs_mapAlerts);
BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
item.second.RelayTo(pfrom);
}
// Pulse: relay sync-checkpoint
{
LOCK(Checkpoints::<API key>);
if (!Checkpoints::checkpointMessage.IsNull())
Checkpoints::checkpointMessage.RelayTo(pfrom);
}
pfrom-><API key> = true;
printf("version message: version %d, blocks=%d\n", pfrom->nVersion, pfrom->nStartingHeight);
cPeerBlockCounts.input(pfrom->nStartingHeight);
// Pulse: ask for pending sync-checkpoint if any
if (!<API key>())
Checkpoints::<API key>(pfrom);
}
else if (pfrom->nVersion == 0)
{
// Must have a version message before anything else
pfrom->Misbehaving(1);
return false;
}
else if (strCommand == "verack")
{
pfrom->vRecv.SetVersion(min(pfrom->nVersion, PROTOCOL_VERSION));
}
else if (strCommand == "addr")
{
vector<CAddress> vAddr;
vRecv >> vAddr;
// Don't want addr from older versions unless seeding
if (pfrom->nVersion < CADDR_TIME_VERSION && addrman.size() > 1000)
return true;
if (vAddr.size() > 1000)
{
pfrom->Misbehaving(20);
return error("message addr size() = %d", vAddr.size());
}
// Store the new addresses
vector<CAddress> vAddrOk;
int64 nNow = GetAdjustedTime();
int64 nSince = nNow - 10 * 60;
BOOST_FOREACH(CAddress& addr, vAddr)
{
if (fShutdown)
return true;
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
addr.nTime = nNow - 5 * 24 * 60 * 60;
pfrom->AddAddressKnown(addr);
bool fReachable = IsReachable(addr);
if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())
{
// Relay to a limited number of other nodes
{
LOCK(cs_vNodes);
// Use deterministic randomness to send to the same nodes for 24 hours
// at a time so the setAddrKnowns of the chosen nodes prevent repeats
static uint256 hashSalt;
if (hashSalt == 0)
hashSalt = GetRandHash();
int64 hashAddr = addr.GetHash();
uint256 hashRand = hashSalt ^ (hashAddr<<32) ^ ((GetTime()+hashAddr)/(24*60*60));
hashRand = Hash(BEGIN(hashRand), END(hashRand));
multimap<uint256, CNode*> mapMix;
BOOST_FOREACH(CNode* pnode, vNodes)
{
if (pnode->nVersion < CADDR_TIME_VERSION)
continue;
unsigned int nPointer;
memcpy(&nPointer, &pnode, sizeof(nPointer));
uint256 hashKey = hashRand ^ nPointer;
hashKey = Hash(BEGIN(hashKey), END(hashKey));
mapMix.insert(make_pair(hashKey, pnode));
}
int nRelayNodes = fReachable ? 2 : 1; // limited relaying of addresses outside our network(s)
for (multimap<uint256, CNode*>::iterator mi = mapMix.begin(); mi != mapMix.end() && nRelayNodes-- > 0; ++mi)
((*mi).second)->PushAddress(addr);
}
}
// Do not store addresses outside our network
if (fReachable)
vAddrOk.push_back(addr);
}
addrman.Add(vAddrOk, pfrom->addr, 2 * 60 * 60);
if (vAddr.size() < 1000)
pfrom->fGetAddr = false;
if (pfrom->fOneShot)
pfrom->fDisconnect = true;
}
else if (strCommand == "inv")
{
vector<CInv> vInv;
vRecv >> vInv;
if (vInv.size() > 50000)
{
pfrom->Misbehaving(20);
return error("message inv size() = %d", vInv.size());
}
// find last block in inv vector
unsigned int nLastBlock = (unsigned int)(-1);
for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) {
if (vInv[vInv.size() - 1 - nInv].type == MSG_BLOCK) {
nLastBlock = vInv.size() - 1 - nInv;
break;
}
}
CTxDB txdb("r");
for (unsigned int nInv = 0; nInv < vInv.size(); nInv++)
{
const CInv &inv = vInv[nInv];
if (fShutdown)
return true;
pfrom->AddInventoryKnown(inv);
bool fAlreadyHave = AlreadyHave(txdb, inv);
if (fDebug)
printf(" got inventory: %s %s\n", inv.ToString().c_str(), fAlreadyHave ? "have" : "new");
if (!fAlreadyHave)
pfrom->AskFor(inv, <API key>()); // immediate retry during initial download
else if (inv.type == MSG_BLOCK && mapOrphanBlocks.count(inv.hash)) {
pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(mapOrphanBlocks[inv.hash]));
} else if (nInv == nLastBlock) {
// In case we are on a very long side-chain, it is possible that we already have
// the last block in an inv bundle sent in response to getblocks. Try to detect
// this situation and push another getblocks to continue.
std::vector<CInv> vGetData(1,inv);
pfrom->PushGetBlocks(mapBlockIndex[inv.hash], uint256(0));
if (fDebug)
printf("force request: %s\n", inv.ToString().c_str());
}
// Track requests for our stuff
Inventory(inv.hash);
}
}
else if (strCommand == "getdata")
{
vector<CInv> vInv;
vRecv >> vInv;
if (vInv.size() > 50000)
{
pfrom->Misbehaving(20);
return error("message getdata size() = %d", vInv.size());
}
BOOST_FOREACH(const CInv& inv, vInv)
{
if (fShutdown)
return true;
printf("received getdata for: %s\n", inv.ToString().c_str());
if (inv.type == MSG_BLOCK)
{
// Send block from disk
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(inv.hash);
if (mi != mapBlockIndex.end())
{
CBlock block;
block.ReadFromDisk((*mi).second);
pfrom->PushMessage("block", block);
// Trigger them to send a getblocks request for the next batch of inventory
if (inv.hash == pfrom->hashContinue)
{
// Bypass PushInventory, this must send even if redundant,
// and we want it right after the last block so they don't
// wait for other stuff first.
// Pulse: send latest proof-of-work block to allow the
// download node to accept as orphan (proof-of-stake
// block might be rejected by stake connection check)
vector<CInv> vInv;
vInv.push_back(CInv(MSG_BLOCK, hashBestChain));
pfrom->PushMessage("inv", vInv);
pfrom->hashContinue = 0;
}
}
}
else if (inv.IsKnownType())
{
// Send stream from relay memory
{
LOCK(cs_mapRelay);
map<CInv, CDataStream>::iterator mi = mapRelay.find(inv);
if (mi != mapRelay.end())
pfrom->PushMessage(inv.GetCommand(), (*mi).second);
}
}
// Track requests for our stuff
Inventory(inv.hash);
}
}
else if (strCommand == "getblocks")
{
CBlockLocator locator;
uint256 hashStop;
vRecv >> locator >> hashStop;
// Find the last block the caller has in the main chain
CBlockIndex* pindex = locator.GetBlockIndex();
// Send the rest of the chain
if (pindex)
pindex = pindex->pnext;
int nLimit = 500 + locator.GetDistanceBack();
unsigned int nBytes = 0;
printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().substr(0,20).c_str(), nLimit);
for (; pindex; pindex = pindex->pnext)
{
if (pindex->GetBlockHash() == hashStop)
{
printf(" getblocks stopping at %d %s (%u bytes)\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str(), nBytes);
// Pulse: tell downloading node about the latest block if it's
// without risk being rejected due to stake connection check
if (hashStop != hashBestChain && pindex->GetBlockTime() + nStakeMinAge > pindexBest->GetBlockTime())
pfrom->PushInventory(CInv(MSG_BLOCK, hashBestChain));
break;
}
pfrom->PushInventory(CInv(MSG_BLOCK, pindex->GetBlockHash()));
CBlock block;
block.ReadFromDisk(pindex, true);
nBytes += block.GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION);
if (--nLimit <= 0 || nBytes >= SendBufferSize()/2)
{
// When this block is requested, we'll send an inv that'll make them
// getblocks the next batch of inventory.
printf(" getblocks stopping at limit %d %s (%u bytes)\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str(), nBytes);
pfrom->hashContinue = pindex->GetBlockHash();
break;
}
}
}
else if (strCommand == "getheaders")
{
CBlockLocator locator;
uint256 hashStop;
vRecv >> locator >> hashStop;
CBlockIndex* pindex = NULL;
if (locator.IsNull())
{
// If locator is null, return the hashStop block
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashStop);
if (mi == mapBlockIndex.end())
return true;
pindex = (*mi).second;
}
else
{
// Find the last block the caller has in the main chain
pindex = locator.GetBlockIndex();
if (pindex)
pindex = pindex->pnext;
}
vector<CBlock> vHeaders;
int nLimit = 2000;
printf("getheaders %d to %s\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().substr(0,20).c_str());
for (; pindex; pindex = pindex->pnext)
{
vHeaders.push_back(pindex->GetBlockHeader());
if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)
break;
}
pfrom->PushMessage("headers", vHeaders);
}
else if (strCommand == "tx")
{
vector<uint256> vWorkQueue;
vector<uint256> vEraseQueue;
CDataStream vMsg(vRecv);
CTxDB txdb("r");
CTransaction tx;
vRecv >> tx;
CInv inv(MSG_TX, tx.GetHash());
pfrom->AddInventoryKnown(inv);
bool fMissingInputs = false;
if (tx.AcceptToMemoryPool(txdb, true, &fMissingInputs))
{
SyncWithWallets(tx, NULL, true);
RelayMessage(inv, vMsg);
mapAlreadyAskedFor.erase(inv);
vWorkQueue.push_back(inv.hash);
vEraseQueue.push_back(inv.hash);
// Recursively process any orphan transactions that depended on this one
for (unsigned int i = 0; i < vWorkQueue.size(); i++)
{
uint256 hashPrev = vWorkQueue[i];
for (map<uint256, CDataStream*>::iterator mi = <API key>[hashPrev].begin();
mi != <API key>[hashPrev].end();
++mi)
{
const CDataStream& vMsg = *((*mi).second);
CTransaction tx;
CDataStream(vMsg) >> tx;
CInv inv(MSG_TX, tx.GetHash());
bool fMissingInputs2 = false;
if (tx.AcceptToMemoryPool(txdb, true, &fMissingInputs2))
{
printf(" accepted orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str());
SyncWithWallets(tx, NULL, true);
RelayMessage(inv, vMsg);
mapAlreadyAskedFor.erase(inv);
vWorkQueue.push_back(inv.hash);
vEraseQueue.push_back(inv.hash);
}
else if (!fMissingInputs2)
{
// invalid orphan
vEraseQueue.push_back(inv.hash);
printf(" removed invalid orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str());
}
}
}
BOOST_FOREACH(uint256 hash, vEraseQueue)
EraseOrphanTx(hash);
}
else if (fMissingInputs)
{
AddOrphanTx(vMsg);
// DoS prevention: do not allow <API key> to grow unbounded
unsigned int nEvicted = LimitOrphanTxSize(<API key>);
if (nEvicted > 0)
printf("mapOrphan overflow, removed %u tx\n", nEvicted);
}
if (tx.nDoS) pfrom->Misbehaving(tx.nDoS);
}
else if (strCommand == "block")
{
CBlock block;
vRecv >> block;
printf("received block %s\n", block.GetHash().ToString().substr(0,20).c_str());
// block.print();
CInv inv(MSG_BLOCK, block.GetHash());
pfrom->AddInventoryKnown(inv);
if (ProcessBlock(pfrom, &block))
mapAlreadyAskedFor.erase(inv);
if (block.nDoS) pfrom->Misbehaving(block.nDoS);
}
else if (strCommand == "getaddr")
{
pfrom->vAddrToSend.clear();
vector<CAddress> vAddr = addrman.GetAddr();
BOOST_FOREACH(const CAddress &addr, vAddr)
pfrom->PushAddress(addr);
}
else if (strCommand == "checkorder")
{
uint256 hashReply;
vRecv >> hashReply;
if (!GetBoolArg("-allowreceivebyip"))
{
pfrom->PushMessage("reply", hashReply, (int)2, string(""));
return true;
}
CWalletTx order;
vRecv >> order;
we have a chance to check the order here
// Keep giving the same key to the same ip until they use it
if (!mapReuseKey.count(pfrom->addr))
pwalletMain->GetKeyFromPool(mapReuseKey[pfrom->addr], true);
// Send back approval of order and pubkey to use
CScript scriptPubKey;
scriptPubKey << mapReuseKey[pfrom->addr] << OP_CHECKSIG;
pfrom->PushMessage("reply", hashReply, (int)0, scriptPubKey);
}
else if (strCommand == "reply")
{
uint256 hashReply;
vRecv >> hashReply;
CRequestTracker tracker;
{
LOCK(pfrom->cs_mapRequests);
map<uint256, CRequestTracker>::iterator mi = pfrom->mapRequests.find(hashReply);
if (mi != pfrom->mapRequests.end())
{
tracker = (*mi).second;
pfrom->mapRequests.erase(mi);
}
}
if (!tracker.IsNull())
tracker.fn(tracker.param1, vRecv);
}
else if (strCommand == "ping")
{
if (pfrom->nVersion > BIP0031_VERSION)
{
uint64 nonce = 0;
vRecv >> nonce;
// Echo the message back with the nonce. This allows for two useful features:
// 1) A remote node can quickly check if the connection is operational
// 2) Remote nodes can measure the latency of the network thread. If this node
// is overloaded it won't respond to pings quickly and the remote node can
// avoid sending us more work, like chain download requests.
// The nonce stops the remote getting confused between different pings: without
// it, if the remote node sends a ping once per second and this node takes 5
// seconds to respond to each, the 5th ping the remote sends would appear to
// return very quickly.
pfrom->PushMessage("pong", nonce);
}
}
else if (strCommand == "alert")
{
CAlert alert;
vRecv >> alert;
if (alert.ProcessAlert())
{
// Relay
pfrom->setKnown.insert(alert.GetHash());
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
alert.RelayTo(pnode);
}
}
}
else if (strCommand == "checkpoint")
{
CSyncCheckpoint checkpoint;
vRecv >> checkpoint;
if (checkpoint.<API key>(pfrom))
{
// Relay
pfrom->hashCheckpointKnown = checkpoint.hashCheckpoint;
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
checkpoint.RelayTo(pnode);
}
}
else
{
// Ignore unknown commands for extensibility
}
// Update the last seen time for this node's address
if (pfrom->fNetworkNode)
if (strCommand == "version" || strCommand == "addr" || strCommand == "inv" || strCommand == "getdata" || strCommand == "ping")
<API key>(pfrom->addr);
return true;
}
bool ProcessMessages(CNode* pfrom)
{
CDataStream& vRecv = pfrom->vRecv;
if (vRecv.empty())
return true;
//if (fDebug)
// printf("ProcessMessages(%u bytes)\n", vRecv.size());
// Message format
// (4) message start
// (12) command
// (4) size
// (4) checksum
// (x) data
unsigned char pchMessageStart[4];
GetMessageStart(pchMessageStart);
static int64 <API key> = 0;
if (fDebug && GetBoolArg("-printmessagestart") && <API key> + 30 < GetAdjustedTime())
{
string strMessageStart((const char *)pchMessageStart, sizeof(pchMessageStart));
vector<unsigned char> vchMessageStart(strMessageStart.begin(), strMessageStart.end());
printf("ProcessMessages : AdjustedTime=%"PRI64d" MessageStart=%s\n", GetAdjustedTime(), HexStr(vchMessageStart).c_str());
<API key> = GetAdjustedTime();
}
loop
{
// Scan for message start
CDataStream::iterator pstart = search(vRecv.begin(), vRecv.end(), BEGIN(pchMessageStart), END(pchMessageStart));
int nHeaderSize = vRecv.GetSerializeSize(CMessageHeader());
if (vRecv.end() - pstart < nHeaderSize)
{
if ((int)vRecv.size() > nHeaderSize)
{
printf("\n\nPROCESSMESSAGE MESSAGESTART NOT FOUND\n\n");
vRecv.erase(vRecv.begin(), vRecv.end() - nHeaderSize);
}
break;
}
if (pstart - vRecv.begin() > 0)
printf("\n\nPROCESSMESSAGE SKIPPED %d BYTES\n\n", pstart - vRecv.begin());
vRecv.erase(vRecv.begin(), pstart);
// Read header
vector<char> vHeaderSave(vRecv.begin(), vRecv.begin() + nHeaderSize);
CMessageHeader hdr;
vRecv >> hdr;
if (!hdr.IsValid())
{
printf("\n\nPROCESSMESSAGE: ERRORS IN HEADER %s\n\n\n", hdr.GetCommand().c_str());
continue;
}
string strCommand = hdr.GetCommand();
// Message size
unsigned int nMessageSize = hdr.nMessageSize;
if (nMessageSize > MAX_SIZE)
{
printf("ProcessMessages(%s, %u bytes) : nMessageSize > MAX_SIZE\n", strCommand.c_str(), nMessageSize);
continue;
}
if (nMessageSize > vRecv.size())
{
// Rewind and wait for rest of message
vRecv.insert(vRecv.begin(), vHeaderSave.begin(), vHeaderSave.end());
break;
}
// Checksum
uint256 hash = Hash(vRecv.begin(), vRecv.begin() + nMessageSize);
unsigned int nChecksum = 0;
memcpy(&nChecksum, &hash, sizeof(nChecksum));
if (nChecksum != hdr.nChecksum)
{
printf("ProcessMessages(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",
strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum);
continue;
}
// Copy message to its own buffer
CDataStream vMsg(vRecv.begin(), vRecv.begin() + nMessageSize, vRecv.nType, vRecv.nVersion);
vRecv.ignore(nMessageSize);
// Process message
bool fRet = false;
try
{
{
LOCK(cs_main);
fRet = ProcessMessage(pfrom, strCommand, vMsg);
}
if (fShutdown)
return true;
}
catch (std::ios_base::failure& e)
{
if (strstr(e.what(), "end of data"))
{
// Allow exceptions from underlength message on vRecv
printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what());
}
else if (strstr(e.what(), "size too large"))
{
// Allow exceptions from overlong size
printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what());
}
else
{
<API key>(&e, "ProcessMessages()");
}
}
catch (std::exception& e) {
<API key>(&e, "ProcessMessages()");
} catch (...) {
<API key>(NULL, "ProcessMessages()");
}
if (!fRet)
printf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize);
}
vRecv.Compact();
return true;
}
bool SendMessages(CNode* pto, bool fSendTrickle)
{
TRY_LOCK(cs_main, lockMain);
if (lockMain) {
// Don't send anything until we get their version message
if (pto->nVersion == 0)
return true;
// Keep-alive ping. We send a nonce of zero because we don't use it anywhere
// right now.
if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSend.empty()) {
uint64 nonce = 0;
if (pto->nVersion > BIP0031_VERSION)
pto->PushMessage("ping", nonce);
else
pto->PushMessage("ping");
}
// Resend wallet transactions that haven't gotten in a block yet
<API key>();
// Address refresh broadcast
static int64 nLastRebroadcast;
if (!<API key>() && (GetTime() - nLastRebroadcast > 24 * 60 * 60))
{
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
// Periodically clear setAddrKnown to allow refresh broadcasts
if (nLastRebroadcast)
pnode->setAddrKnown.clear();
// Rebroadcast our address
if (!fNoListen && !fUseProxy)
{
CAddress addr = GetLocalAddress(&pnode->addr);
if (addr.IsRoutable())
pnode->PushAddress(addr);
}
}
}
nLastRebroadcast = GetTime();
}
// Message: addr
if (fSendTrickle)
{
vector<CAddress> vAddr;
vAddr.reserve(pto->vAddrToSend.size());
BOOST_FOREACH(const CAddress& addr, pto->vAddrToSend)
{
// returns true if wasn't already contained in the set
if (pto->setAddrKnown.insert(addr).second)
{
vAddr.push_back(addr);
// receiver rejects addr messages larger than 1000
if (vAddr.size() >= 1000)
{
pto->PushMessage("addr", vAddr);
vAddr.clear();
}
}
}
pto->vAddrToSend.clear();
if (!vAddr.empty())
pto->PushMessage("addr", vAddr);
}
// Message: inventory
vector<CInv> vInv;
vector<CInv> vInvWait;
{
LOCK(pto->cs_inventory);
vInv.reserve(pto->vInventoryToSend.size());
vInvWait.reserve(pto->vInventoryToSend.size());
BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend)
{
if (pto->setInventoryKnown.count(inv))
continue;
// trickle out tx inv to protect privacy
if (inv.type == MSG_TX && !fSendTrickle)
{
// 1/4 of tx invs blast to all immediately
static uint256 hashSalt;
if (hashSalt == 0)
hashSalt = GetRandHash();
uint256 hashRand = inv.hash ^ hashSalt;
hashRand = Hash(BEGIN(hashRand), END(hashRand));
bool fTrickleWait = ((hashRand & 3) != 0);
// always trickle our own transactions
if (!fTrickleWait)
{
CWalletTx wtx;
if (GetTransaction(inv.hash, wtx))
if (wtx.fFromMe)
fTrickleWait = true;
}
if (fTrickleWait)
{
vInvWait.push_back(inv);
continue;
}
}
// returns true if wasn't already contained in the set
if (pto->setInventoryKnown.insert(inv).second)
{
vInv.push_back(inv);
if (vInv.size() >= 1000)
{
pto->PushMessage("inv", vInv);
vInv.clear();
}
}
}
pto->vInventoryToSend = vInvWait;
}
if (!vInv.empty())
pto->PushMessage("inv", vInv);
// Message: getdata
vector<CInv> vGetData;
int64 nNow = GetTime() * 1000000;
CTxDB txdb("r");
while (!pto->mapAskFor.empty() && (*pto->mapAskFor.begin()).first <= nNow)
{
const CInv& inv = (*pto->mapAskFor.begin()).second;
if (!AlreadyHave(txdb, inv))
{
printf("sending getdata: %s\n", inv.ToString().c_str());
vGetData.push_back(inv);
if (vGetData.size() >= 1000)
{
pto->PushMessage("getdata", vGetData);
vGetData.clear();
}
}
mapAlreadyAskedFor[inv] = nNow;
pto->mapAskFor.erase(pto->mapAskFor.begin());
}
if (!vGetData.empty())
pto->PushMessage("getdata", vGetData);
}
return true;
}
// BitcoinMiner
int static FormatHashBlocks(void* pbuffer, unsigned int len)
{
unsigned char* pdata = (unsigned char*)pbuffer;
unsigned int blocks = 1 + ((len + 8) / 64);
unsigned char* pend = pdata + 64 * blocks;
memset(pdata + len, 0, 64 * blocks - len);
pdata[len] = 0x80;
unsigned int bits = len * 8;
pend[-1] = (bits >> 0) & 0xff;
pend[-2] = (bits >> 8) & 0xff;
pend[-3] = (bits >> 16) & 0xff;
pend[-4] = (bits >> 24) & 0xff;
return blocks;
}
static const unsigned int pSHA256InitState[8] =
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
void SHA256Transform(void* pstate, void* pinput, const void* pinit)
{
SHA256_CTX ctx;
unsigned char data[64];
SHA256_Init(&ctx);
for (int i = 0; i < 16; i++)
((uint32_t*)data)[i] = ByteReverse(((uint32_t*)pinput)[i]);
for (int i = 0; i < 8; i++)
ctx.h[i] = ((uint32_t*)pinit)[i];
SHA256_Update(&ctx, data, sizeof(data));
for (int i = 0; i < 8; i++)
((uint32_t*)pstate)[i] = ctx.h[i];
}
// ScanHash scans nonces looking for a hash with at least some zero bits.
// It operates on big endian data. Caller does the byte reversing.
// All input buffers are 16-byte aligned. nNonce is usually preserved
// between calls, but periodically or if nNonce is 0xffff0000 or above,
// the block is rebuilt and nNonce starts over at zero.
unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)
{
unsigned int& nNonce = *(unsigned int*)(pdata + 12);
for (;;)
{
// Crypto++ SHA-256
// Hash pdata using pmidstate as the starting state into
// preformatted buffer phash1, then hash phash1 into phash
nNonce++;
SHA256Transform(phash1, pdata, pmidstate);
SHA256Transform(phash, phash1, pSHA256InitState);
// Return the nonce if the hash has at least some zero bits,
// caller will check if it has enough to reach the target
if (((unsigned short*)phash)[14] == 0)
return nNonce;
// If nothing found after trying for a while, return -1
if ((nNonce & 0xffff) == 0)
{
nHashesDone = 0xffff+1;
return (unsigned int) -1;
}
}
}
// Some explaining would be appreciated
class COrphan
{
public:
CTransaction* ptx;
set<uint256> setDependsOn;
double dPriority;
COrphan(CTransaction* ptxIn)
{
ptx = ptxIn;
dPriority = 0;
}
void print() const
{
printf("COrphan(hash=%s, dPriority=%.1f)\n", ptx->GetHash().ToString().substr(0,10).c_str(), dPriority);
BOOST_FOREACH(uint256 hash, setDependsOn)
printf(" setDependsOn %s\n", hash.ToString().substr(0,10).c_str());
}
};
uint64 nLastBlockTx = 0;
uint64 nLastBlockSize = 0;
int64 <API key> = 0;
// CreateNewBlock:
// fProofOfStake: try (best effort) to make a proof-of-stake block
CBlock* CreateNewBlock(CReserveKey& reservekey, CWallet* pwallet, bool fProofOfStake)
{
// Create new block
auto_ptr<CBlock> pblock(new CBlock());
if (!pblock.get())
return NULL;
// Create coinbase tx
CTransaction txNew;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
txNew.vout[0].scriptPubKey << reservekey.GetReservedKey() << OP_CHECKSIG;
// Add our coinbase tx as first transaction
pblock->vtx.push_back(txNew);
// Pulse: if coinstake available add coinstake tx
static int64 <API key> = GetAdjustedTime(); // only initialized at startup
CBlockIndex* pindexPrev = pindexBest;
if (fProofOfStake) // attemp to find a coinstake
{
pblock->nBits = <API key>(pindexPrev, true);
CTransaction txCoinStake;
int64 nSearchTime = txCoinStake.nTime; // search to current time
if (nSearchTime > <API key>)
{
if (pwallet->CreateCoinStake(*pwallet, pblock->nBits, <API key>, txCoinStake))
{
if (txCoinStake.nTime >= max(pindexPrev->GetMedianTimePast()+1, pindexPrev->GetBlockTime() - nMaxClockDrift))
{ // make sure coinstake would meet timestamp protocol
// as it would be the same as the block timestamp
pblock->vtx[0].vout[0].SetEmpty();
pblock->vtx[0].nTime = txCoinStake.nTime;
pblock->vtx.push_back(txCoinStake);
}
}
<API key> = nSearchTime - <API key>;
<API key> = nSearchTime;
}
}
pblock->nBits = <API key>(pindexPrev, pblock->IsProofOfStake());
// Collect memory pool transactions into the block
int64 nFees = 0;
{
LOCK2(cs_main, mempool.cs);
CTxDB txdb("r");
// Priority order to process transactions
list<COrphan> vOrphan; // list memory doesn't move
map<uint256, vector<COrphan*> > mapDependers;
multimap<double, CTransaction*> mapPriority;
for (map<uint256, CTransaction>::iterator mi = mempool.mapTx.begin(); mi != mempool.mapTx.end(); ++mi)
{
CTransaction& tx = (*mi).second;
if (tx.IsCoinBase() || tx.IsCoinStake() || !tx.IsFinal())
continue;
COrphan* porphan = NULL;
double dPriority = 0;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
// Read prev transaction
CTransaction txPrev;
CTxIndex txindex;
if (!txPrev.ReadFromDisk(txdb, txin.prevout, txindex))
{
// Has to wait for dependencies
if (!porphan)
{
// Use list for automatic deletion
vOrphan.push_back(COrphan(&tx));
porphan = &vOrphan.back();
}
mapDependers[txin.prevout.hash].push_back(porphan);
porphan->setDependsOn.insert(txin.prevout.hash);
continue;
}
int64 nValueIn = txPrev.vout[txin.prevout.n].nValue;
// Read block header
int nConf = txindex.GetDepthInMainChain();
dPriority += (double)nValueIn * nConf;
if (fDebug && GetBoolArg("-printpriority"))
printf("priority nValueIn=%-12"PRI64d" nConf=%-5d dPriority=%-20.1f\n", nValueIn, nConf, dPriority);
}
// Priority is sum(valuein * age) / txsize
dPriority /= ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
if (porphan)
porphan->dPriority = dPriority;
else
mapPriority.insert(make_pair(-dPriority, &(*mi).second));
if (fDebug && GetBoolArg("-printpriority"))
{
printf("priority %-20.1f %s\n%s", dPriority, tx.GetHash().ToString().substr(0,10).c_str(), tx.ToString().c_str());
if (porphan)
porphan->print();
printf("\n");
}
}
// Collect transactions into block
map<uint256, CTxIndex> mapTestPool;
uint64 nBlockSize = 1000;
uint64 nBlockTx = 0;
int nBlockSigOps = 100;
while (!mapPriority.empty())
{
// Take highest priority transaction off priority queue
CTransaction& tx = *(*mapPriority.begin()).second;
mapPriority.erase(mapPriority.begin());
// Size limits
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE_GEN)
continue;
// Legacy limits on sigOps:
unsigned int nTxSigOps = tx.GetLegacySigOpCount();
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
// Timestamp limit
if (tx.nTime > GetAdjustedTime() || (pblock->IsProofOfStake() && tx.nTime > pblock->vtx[1].nTime))
continue;
// Pulse: simplify transaction fee - allow free = false
int64 nMinFee = tx.GetMinFee(nBlockSize, false, GMF_BLOCK);
// Connecting shouldn't fail due to dependency on other memory pool transactions
// because we're already processing them in order of dependency
map<uint256, CTxIndex> mapTestPoolTmp(mapTestPool);
MapPrevTx mapInputs;
bool fInvalid;
if (!tx.FetchInputs(txdb, mapTestPoolTmp, false, true, mapInputs, fInvalid))
continue;
int64 nTxFees = tx.GetValueIn(mapInputs)-tx.GetValueOut();
if (nTxFees < nMinFee)
continue;
nTxSigOps += tx.GetP2SHSigOpCount(mapInputs);
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
if (!tx.ConnectInputs(txdb, mapInputs, mapTestPoolTmp, CDiskTxPos(1,1,1), pindexPrev, false, true))
continue;
mapTestPoolTmp[tx.GetHash()] = CTxIndex(CDiskTxPos(1,1,1), tx.vout.size());
swap(mapTestPool, mapTestPoolTmp);
// Added
pblock->vtx.push_back(tx);
nBlockSize += nTxSize;
++nBlockTx;
nBlockSigOps += nTxSigOps;
nFees += nTxFees;
// Add transactions that depend on this one to the priority queue
uint256 hash = tx.GetHash();
if (mapDependers.count(hash))
{
BOOST_FOREACH(COrphan* porphan, mapDependers[hash])
{
if (!porphan->setDependsOn.empty())
{
porphan->setDependsOn.erase(hash);
if (porphan->setDependsOn.empty())
mapPriority.insert(make_pair(-porphan->dPriority, porphan->ptx));
}
}
}
}
nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
if (fDebug && GetBoolArg("-printpriority"))
printf("CreateNewBlock(): total size %lu\n", nBlockSize);
}
if (pblock->IsProofOfWork())
pblock->vtx[0].vout[0].nValue = <API key>(pblock->nBits);
// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
if (pblock->IsProofOfStake())
pblock->nTime = pblock->vtx[1].nTime; //same as coinstake timestamp
pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, pblock-><API key>());
pblock->nTime = max(pblock->GetBlockTime(), pindexPrev->GetBlockTime() - nMaxClockDrift);
if (pblock->IsProofOfWork())
pblock->UpdateTime(pindexPrev);
pblock->nNonce = 0;
return pblock.release();
}
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce)
{
// Update nExtraNonce
static uint256 hashPrevBlock;
if (hashPrevBlock != pblock->hashPrevBlock)
{
nExtraNonce = 0;
hashPrevBlock = pblock->hashPrevBlock;
}
++nExtraNonce;
pblock->vtx[0].vin[0].scriptSig = (CScript() << pblock->nTime << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
}
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1)
{
// Prebuild hash buffers
struct
{
struct unnamed2
{
int nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;
}
block;
unsigned char pchPadding0[64];
uint256 hash1;
unsigned char pchPadding1[64];
}
tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.block.nVersion = pblock->nVersion;
tmp.block.hashPrevBlock = pblock->hashPrevBlock;
tmp.block.hashMerkleRoot = pblock->hashMerkleRoot;
tmp.block.nTime = pblock->nTime;
tmp.block.nBits = pblock->nBits;
tmp.block.nNonce = pblock->nNonce;
FormatHashBlocks(&tmp.block, sizeof(tmp.block));
FormatHashBlocks(&tmp.hash1, sizeof(tmp.hash1));
// Byte swap all the input buffer
for (unsigned int i = 0; i < sizeof(tmp)/4; i++)
((unsigned int*)&tmp)[i] = ByteReverse(((unsigned int*)&tmp)[i]);
// Precalc the first half of the first hash, which stays constant
SHA256Transform(pmidstate, &tmp.block, pSHA256InitState);
memcpy(pdata, &tmp.block, 128);
memcpy(phash1, &tmp.hash1, 64);
}
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
uint256 hash = pblock->GetHash();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
if (hash > hashTarget && pblock->IsProofOfWork())
return error("PeerMiner : proof-of-work not meeting target");
/ debug print
printf("PeerMiner:\n");
printf("new block found \n hash: %s \ntarget: %s\n", hash.GetHex().c_str(), hashTarget.GetHex().c_str());
pblock->print();
printf("%s ", DateTimeStrFormat(GetTime()).c_str());
printf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue).c_str());
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("PeerMiner : generated block is stale");
// Remove key from key pool
reservekey.KeepKey();
// Track how many getdata requests this block gets
{
LOCK(wallet.cs_wallet);
wallet.mapRequestCount[pblock->GetHash()] = 0;
}
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
return error("BitcoinMiner : ProcessBlock, block not accepted");
}
return true;
}
void static ThreadBitcoinMiner(void* parg);
static bool fGenerateBitcoins = false;
static bool fLimitProcessors = false;
static int nLimitProcessors = -1;
void SetMintWarning(const string& strNewWarning)
{
if (strMintWarning != strNewWarning)
{
strMintWarning = strNewWarning;
MainFrameRepaint();
}
}
void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
{
printf("CPUMiner started for proof-of-%s\n", fProofOfStake? "stake" : "work");
SetThreadPriority(<API key>);
// Each thread has its own key and counter
CReserveKey reservekey(pwallet);
unsigned int nExtraNonce = 0;
while (fGenerateBitcoins || fProofOfStake)
{
if (fShutdown)
return;
while (vNodes.empty() || <API key>())
{
Sleep(1000);
if (fShutdown)
return;
if ((!fGenerateBitcoins) && !fProofOfStake)
return;
}
while (pwallet->IsLocked())
{
SetMintWarning(strMintMessage);
Sleep(1000);
}
SetMintWarning("");
// Create new block
unsigned int <API key> = <API key>;
CBlockIndex* pindexPrev = pindexBest;
auto_ptr<CBlock> pblock(CreateNewBlock(reservekey, pwallet, fProofOfStake));
if (!pblock.get())
return;
IncrementExtraNonce(pblock.get(), pindexPrev, nExtraNonce);
if (fProofOfStake)
{
// Pulse: if proof-of-stake block found then process block
if (pblock->IsProofOfStake())
{
if (!pblock->SignBlock(*pwalletMain))
{
SetMintWarning(strMintMessage);
continue;
}
SetMintWarning("");
printf("CPUMiner : proof-of-stake block found %s\n", pblock->GetHash().ToString().c_str());
SetThreadPriority(<API key>);
CheckWork(pblock.get(), *pwalletMain, reservekey);
SetThreadPriority(<API key>);
}
Sleep(500);
continue;
}
printf("Running PeerMiner with %d transactions in block\n", pblock->vtx.size());
// Prebuild hash buffers
char pmidstatebuf[32+16]; char* pmidstate = alignup<16>(pmidstatebuf);
char pdatabuf[128+16]; char* pdata = alignup<16>(pdatabuf);
char phash1buf[64+16]; char* phash1 = alignup<16>(phash1buf);
FormatHashBuffers(pblock.get(), pmidstate, pdata, phash1);
unsigned int& nBlockTime = *(unsigned int*)(pdata + 64 + 4);
unsigned int& nBlockNonce = *(unsigned int*)(pdata + 64 + 12);
// Search
int64 nStart = GetTime();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
uint256 hashbuf[2];
uint256& hash = *alignup<16>(hashbuf);
loop
{
unsigned int nHashesDone = 0;
unsigned int nNonceFound;
// Crypto++ SHA-256
nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1,
(char*)&hash, nHashesDone);
// Check if something found
if (nNonceFound != (unsigned int) -1)
{
for (unsigned int i = 0; i < sizeof(hash)/4; i++)
((unsigned int*)&hash)[i] = ByteReverse(((unsigned int*)&hash)[i]);
if (hash <= hashTarget)
{
// Found a solution
pblock->nNonce = ByteReverse(nNonceFound);
assert(hash == pblock->GetHash());
if (!pblock->SignBlock(*pwalletMain))
{
SetMintWarning(strMintMessage);
break;
}
SetMintWarning("");
SetThreadPriority(<API key>);
CheckWork(pblock.get(), *pwalletMain, reservekey);
SetThreadPriority(<API key>);
break;
}
}
// Meter hashes/sec
static int64 nHashCounter;
if (nHPSTimerStart == 0)
{
nHPSTimerStart = GetTimeMillis();
nHashCounter = 0;
}
else
nHashCounter += nHashesDone;
if (GetTimeMillis() - nHPSTimerStart > 4000)
{
static CCriticalSection cs;
{
LOCK(cs);
if (GetTimeMillis() - nHPSTimerStart > 4000)
{
dHashesPerSec = 1000.0 * nHashCounter / (GetTimeMillis() - nHPSTimerStart);
nHPSTimerStart = GetTimeMillis();
nHashCounter = 0;
static int64 nLogTime;
if (GetTime() - nLogTime > 30 * 60)
{
nLogTime = GetTime();
printf("%s ", DateTimeStrFormat(GetTime()).c_str());
printf("hashmeter %3d CPUs %6.0f khash/s\n", vnThreadsRunning[THREAD_MINER], dHashesPerSec/1000.0);
}
}
}
}
// Check for stop or if block needs to be rebuilt
if (fShutdown)
return;
if (!fGenerateBitcoins)
return;
if (fLimitProcessors && vnThreadsRunning[THREAD_MINER] > nLimitProcessors)
return;
if (vNodes.empty())
break;
if (nBlockNonce >= 0xffff0000)
break;
if (<API key> != <API key> && GetTime() - nStart > 60)
break;
if (pindexPrev != pindexBest)
break;
// Update nTime every few seconds
pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, pblock-><API key>());
pblock->nTime = max(pblock->GetBlockTime(), pindexPrev->GetBlockTime() - nMaxClockDrift);
pblock->UpdateTime(pindexPrev);
nBlockTime = ByteReverse(pblock->nTime);
if (pblock->GetBlockTime() >= (int64)pblock->vtx[0].nTime + nMaxClockDrift)
break; // need to update coinbase timestamp
}
}
}
void static ThreadBitcoinMiner(void* parg)
{
CWallet* pwallet = (CWallet*)parg;
try
{
vnThreadsRunning[THREAD_MINER]++;
BitcoinMiner(pwallet, false);
vnThreadsRunning[THREAD_MINER]
}
catch (std::exception& e) {
vnThreadsRunning[THREAD_MINER]
PrintException(&e, "ThreadBitcoinMiner()");
} catch (...) {
vnThreadsRunning[THREAD_MINER]
PrintException(NULL, "ThreadBitcoinMiner()");
}
nHPSTimerStart = 0;
if (vnThreadsRunning[THREAD_MINER] == 0)
dHashesPerSec = 0;
printf("ThreadBitcoinMiner exiting, %d threads remaining\n", vnThreadsRunning[THREAD_MINER]);
}
void GenerateBitcoins(bool fGenerate, CWallet* pwallet)
{
fGenerateBitcoins = fGenerate;
nLimitProcessors = GetArg("-genproclimit", -1);
if (nLimitProcessors == 0)
fGenerateBitcoins = false;
fLimitProcessors = (nLimitProcessors != -1);
if (fGenerate)
{
int nProcessors = boost::thread::<API key>();
printf("%d processors\n", nProcessors);
if (nProcessors < 1)
nProcessors = 1;
if (fLimitProcessors && nProcessors > nLimitProcessors)
nProcessors = nLimitProcessors;
int nAddThreads = nProcessors - vnThreadsRunning[THREAD_MINER];
printf("Starting %d BitcoinMiner threads\n", nAddThreads);
for (int i = 0; i < nAddThreads; i++)
{
if (!CreateThread(ThreadBitcoinMiner, pwallet))
printf("Error: CreateThread(ThreadBitcoinMiner) failed\n");
Sleep(10);
}
}
} |
/*jshint -W079 */
'use strict';
import { Path as PathUtils } from './Path';
/**
* A class that can be used to associate any item with a path.
* Items and paths are kept in flat arrays for easy iteration
* and a memo is used to provide constant time lookup.
*
* @class
*
*/
class PathStore {
constructor() {
this.items = [];
this.paths = [];
this.memo = {};
}
/**
* Associates an item with the given path. Errors if an item
* already exists at the given path.
*
* @method
*
* @param {String} path The path at which to insert the item
* @param {Any} item The item to associate with the given path.
*
* @return {undefined} undefined
*/
insert(path, item) {
var paths = this.paths;
var index = paths.indexOf(path);
if (index !== -1)
throw new Error('item already exists at path: ' + path);
var i = 0;
var targetDepth = PathUtils.depth(path);
var targetIndex = PathUtils.index(path);
// The item will be inserted at a point in the array
// such that it is within its own breadth in the tree
// that the paths represent
while (
paths[i] &&
targetDepth >= PathUtils.depth(paths[i])
) i++;
// The item will be sorted within its breadth by index
// in regard to its siblings.
while (
paths[i] &&
targetDepth === PathUtils.depth(paths[i]) &&
targetIndex < PathUtils.index(paths[i])
) i++;
// insert the items in the path
paths.splice(i, 0, path);
this.items.splice(i, 0, item);
// store the relationship between path and index in the memo
this.memo[path] = i;
// all items behind the inserted item are now no longer
// accurately stored in the memo. Thus the memo must be cleared for
// these items.
for (var len = this.paths.length; i < len; i++)
this.memo[this.paths[i]] = null;
};
/**
* Removes the the item from the store at the given path.
* Errors if no item exists at the given path.
*
* @method
*
* @param {String} path The path at which to remove the item.
*
* @return {undefined} undefined
*/
remove(path) {
var paths = this.paths;
var index = this.memo[path] ? this.memo[path] : paths.indexOf(path);
if (index === -1)
throw new Error('Cannot remove. No item exists at path: ' + path);
paths.splice(index, 1);
this.items.splice(index, 1);
this.memo[path] = null;
for (var len = this.paths.length; index < len; index++)
this.memo[this.paths[index]] = null;
};
/**
* Returns the item stored at the current path. Returns undefined
* if no item is stored at that path.
*
* @method
*
* @param {String} path The path to lookup the item for
*
* @return {Any | undefined} the item stored or undefined
*/
get(path) {
if (this.memo[path]) return this.items[this.memo[path]];
var index = this.paths.indexOf(path);
if (index === -1) return void 0;
this.memo[path] = index;
return this.items[index];
};
/**
* Returns an array of the items currently stored in this
* PathStore.
*
* @method
*
* @return {Array} items currently stored
*/
getItems() {
return this.items;
};
/**
* Returns an array of the paths currently stored in this
* PathStore.
*
* @method
*
* @return {Array} paths currently stored
*/
getPaths() {
return this.paths;
};
}
export { PathStore }; |
# BulgePinchFilter
PixiJS filter to apply a bulge or a pinch effect.
## Installation
bash
npm install @pixi/filter-bulge-pinch
## Usage
js
import {BulgePinchFilter} from '@pixi/filter-bulge-pinch';
import {Container} from 'pixi.js';
const container = new Container();
container.filters = [new BulgePinchFilter()];
## Documentation
See https://pixijs.github.io/pixi-filters/docs |
class UploadsController < <API key>
helper S3AwsUploader::ViewHelpers
def new
@upload = 'test'
end
end |
'use strict';
angular.module('controllers.client', [])
.controller('ClientsListCtrl', ['$scope', '$modal', '$stateParams', 'Client',
function ($scope, $modal, $stateParams, Client) {
$scope.totalPages = 0;
$scope.clientsCount = 0;
$scope.headers = [
{
title: 'ClientID',
value: '_id'
},
{
title: 'Application Name',
value: 'name'
},
{
title: 'Updated By',
value: 'updated_by'
},
{
title: 'Created By',
value: 'created_by'
},
{
title: 'Update Date',
value: 'update_date'
},
{
title: 'Create Date',
value: 'create_date'
}
];
$scope.filterCriteria = {
page: 1,
sort_dir: 'ASC',
sorted_by: 'name'
};
//The function that is responsible of fetching the result from the server and setting the grid to the new result
$scope.fetchResult = function () {
return Client.page($scope.filterCriteria).then(function (response) {
$scope.clients = response.content;
$scope.totalPages = Math.ceil(response.total / response.size);
$scope.clientsCount = response.total;
}, function (resp) {
$scope.clients = [];
$scope.totalPages = 0;
$scope.clientsCount = 0;
throw {
message: !!resp.data.error ? resp.data.error + ' : ' + resp.data.messages[0] : 'Error: ' + resp.status,
namespace: 'clients'
};
});
};
//called when navigate to another page in the pagination
$scope.selectPage = function (page) {
$scope.filterCriteria.page = page;
$scope.fetchResult();
};
//Will be called when filtering the grid, will reset the page number to one
$scope.filterResult = function () {
$scope.filterCriteria.page = 1;
$scope.fetchResult().then(function () {
//The request fires correctly but sometimes the ui doesn't update, that's a fix
$scope.filterCriteria.page = 1;
});
};
//call back function that we passed to our custom directive sortBy, will be called when clicking on any field to sort
$scope.onSort = function (sortedBy, sortDir) {
$scope.filterCriteria.sort_dir = sortDir;
$scope.filterCriteria.sorted_by = sortedBy;
$scope.filterCriteria.page = 1;
$scope.fetchResult().then(function () {
//The request fires correctly but sometimes the ui doesn't update, that's a fix
$scope.filterCriteria.page = 1;
});
};
$scope.remove = function (client) {
Client.delete(client).then(function (response) {
$scope.fetchResult();
}, function (response) {
});
};
//manually select a page to trigger an ajax request to populate the grid on page load
$scope.selectPage(1);
}])
.controller('ClientDetailsCtrl', ['$scope', '$state', '$stateParams', 'Client', 'AlertMgr',
function ($scope, $state, $stateParams, Client, AlertMgr) {
$scope.mode = $stateParams.mode;
$scope.client = {
name: '',
secret: '',
description: '',
web_uri: '',
redirect_uris: [],
scopes: []
};
$scope.original = angular.copy($scope.client);
if ($scope.mode === 'edit') {
Client.get($stateParams.client_id).then(function (response) {
if (response) {
$scope.client = response;
$scope.client.redirect_uris = $scope.client.redirect_uris || [];
$scope.client.scopes = $scope.client.scopes || [];
$scope.original = angular.copy($scope.client);
}
}, function () {
});
}
$scope.discard = function () {
$scope.client = angular.copy($scope.original);
};
$scope.save = function () {
$scope.original = angular.copy($scope.client);
if ($scope.mode === 'new') {
Client.add($scope.client).then(function (response) {
$state.go('client.details', {client_id: $scope.client.client_id, mode: 'edit'});
}, function (error) {
error.data.messages.forEach(function (item) {
AlertMgr.addAlert('danger', item);
});
});
} else if ($scope.mode === 'edit') {
$scope.client.save();
}
};
$scope.isCancelDisabled = function () {
return angular.equals($scope.original, $scope.client);
};
$scope.isSaveDisabled = function () {
return $scope.client_form.$invalid || angular.equals($scope.original, $scope.client);
};
$scope.discard();
}]); |
import json
import os
import ntpath
import datetime as dt
import pprint
import boto3
def get_config():
'''
Load the configuration from ./config.json
'''
with open('config.json', 'r') as config_file:
return json.load(config_file)
def get_new_files(config, max_age_in_hours=24):
'''
Get array of all files younger than max_age_in_hours,
unless max_age_in_hours is set to 0 - in which case all files
are provided.
Note, directories and files with the wrong extension type are ignored.
'''
now = dt.datetime.now()
content_dir = config['content']
ext = config['content_ext']
if max_age_in_hours <= 0:
cutoff = dt.datetime.min
else:
cutoff = now-dt.timedelta(hours=max_age_in_hours)
def is_new_file(fname):
path = os.path.join(content_dir, fname)
st = os.stat(path)
mtime = dt.datetime.fromtimestamp(st.st_mtime)
return mtime > cutoff and os.path.isfile(path) and path.endswith('.'+ext)
files = os.listdir(content_dir)
files = [os.path.join(content_dir, fname) for fname in files if is_new_file(fname)]
print("Found %d new files" % len(files))
return files
def <API key>(config, files):
'''
Get a dictionary of pointing from files to encode, to
where these should be saved
'''
encoded_dir = config['encoded']
ext = '.' + config['encoded_ext']
result = {}
for ifname in files:
path, fname = ntpath.split(ifname)
ofname = os.path.join(encoded_dir, fname.split('.')[0] + ext)
result[ifname] = ofname
return result
def encode_files(config, filesmap):
'''
Save each file with line breaks replaced by spaces (or rather
the value of config['encoded_linebreak'])
'''
br_out= config['encoded_linebreak']
num_encodings = 0
for ifname, ofname in filesmap.items():
with open(ifname) as ifile, open(ofname, 'w') as ofile:
ofile.write(ifile.read().replace('\n',br_out).replace('\r',''))
num_encodings += 1
return num_encodings
def upload_files(config, filesmap):
'''
Upload the destination values of filesmap to S3.
'''
s3 = boto3.resource('s3')
bucket = config['s3_bucket']
s3_bucket = s3.Bucket(bucket)
folder = config['s3_folder']
for file in filesmap.values():
key = "/".join([folder, ntpath.split(file)[-1]])
print("Will upload %s --> %s / %s" % (file, bucket, key))
with open(file, 'rb') as data:
s3_bucket.put_object(Key=key, Body=data)
if __name__ == '__main__':
pp = pprint.PrettyPrinter(indent=4)
config = get_config()
print("\nconfig:")
pp.pprint(config)
new_files = get_new_files(config, max_age_in_hours=24)
print("\nnew files:")
pp.pprint(new_files)
encoding_filemap = <API key>(config, new_files)
print("\nfile encoding map:")
pp.pprint(encoding_filemap)
success_count = encode_files(config, encoding_filemap)
print("\nSuccessfully encoded %d files" % success_count)
upload_files(config, encoding_filemap) |
<?php namespace Socketty;
use React\EventLoop\LoopInterface;
class TerminalFactory{
/** @var LoopInterface */
protected $loop;
/** @var SpawnerInterface */
protected $spawner;
public function __construct(LoopInterface $loop, SpawnerInterface $spawner){
$this->loop = $loop;
$this->spawner = $spawner;
}
public function getTerminal($id, $cmd, $args, $onData, $onExit){
return new Terminal($this->loop, $this->spawner, $id, $cmd, $args, $onData, $onExit);
}
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>kildall: 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.7.1+1 / kildall - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
kildall
<small>
8.6.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-03-02 21:28:58 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-03-02 21:28:58 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.11 <API key> of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.7.1+1 Formal proof management system.
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.0 Official release 4.09.0
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/kildall"
license: "Unknown"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Kildall"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: Kildall" "keyword: data flow analysis" "keyword: bytecode verification" "category: Computer Science/Semantics and Compilation/Semantics" "date: 2005-07" ]
authors: [ "Solange Coupet-Grimal <Solange.Coupet@cmi.univ-mrs.fr>" "William Delobel <delobel@cmi.univ-mrs.fr>" ]
bug-reports: "https://github.com/coq-contribs/kildall/issues"
dev-repo: "git+https://github.com/coq-contribs/kildall.git"
synopsis: "Application of the Generic kildall's Data Flow Analysis Algorithm to a Type and Shape Static Analyses of Bytecode"
description: """
http:
This Library provides a generic data flow analysis
algorithm and a proof of its correctness.
This algorithm is then used to perform type and
shape analysis at bytecode level
on a first order functionnal language."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/kildall/archive/v8.6.0.tar.gz"
checksum: "md5=<API key>"
}
</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-kildall.8.6.0 coq.8.7.1+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.7.1+1).
The following dependencies couldn't be met:
- coq-kildall -> coq < 8.7~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-kildall.8.6.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https:
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html> |
using System;
using System.Collections.Generic;
using System.Linq;
using JimBobBennett.JimLib.Events;
using JimBobBennett.JimLib.Xamarin.Purchases;
using Foundation;
using StoreKit;
namespace JimBobBennett.JimLib.Xamarin.ios.Purchases
{
public class InAppPurchase : IInAppPurchase
{
private Dictionary<string, IPurchasableProduct> <API key>;
private readonly TransactionObserver <API key> = new TransactionObserver();
public InAppPurchase()
{
<API key>.TransactionFailed += <API key>;
<API key>.<API key> += <API key>;
if (CanMakePayments)
SKPaymentQueue.DefaultQueue.<API key>(<API key>);
}
private void <API key>(object sender, EventArgs<<API key>> eventArgs)
{
SKPaymentQueue.DefaultQueue.FinishTransaction(eventArgs.Value);
IsPurchasing = false;
OnProductPurchased(<API key>[eventArgs.Value.Payment.ProductIdentifier]);
}
private void <API key>(object sender, EventArgs<<API key>> eventArgs)
{
SKPaymentQueue.DefaultQueue.FinishTransaction(eventArgs.Value);
IsPurchasing = false;
<API key>(<API key>[eventArgs.Value.Payment.ProductIdentifier]);
}
public event EventHandler<EventArgs<IEnumerable<IPurchasableProduct>>> <API key>
{
add { WeakEventManager.GetWeakEventManager(this).AddEventHandler("<API key>", value); }
remove { WeakEventManager.GetWeakEventManager(this).RemoveEventHandler("<API key>", value); }
}
public event EventHandler<EventArgs<IPurchasableProduct>> ProductPurchased
{
add { WeakEventManager.GetWeakEventManager(this).AddEventHandler("ProductPurchased", value); }
remove { WeakEventManager.GetWeakEventManager(this).RemoveEventHandler("ProductPurchased", value); }
}
public event EventHandler<EventArgs<IPurchasableProduct>> <API key>
{
add { WeakEventManager.GetWeakEventManager(this).AddEventHandler("<API key>", value); }
remove { WeakEventManager.GetWeakEventManager(this).RemoveEventHandler("<API key>", value); }
}
private void <API key>(IEnumerable<IPurchasableProduct> e)
{
WeakEventManager.GetWeakEventManager(this).RaiseEvent(this,
new EventArgs<IEnumerable<IPurchasableProduct>>(e), "<API key>");
}
private void OnProductPurchased(IPurchasableProduct e)
{
WeakEventManager.GetWeakEventManager(this).RaiseEvent(this,
new EventArgs<IPurchasableProduct>(e), "ProductPurchased");
}
private void <API key>(IPurchasableProduct e)
{
WeakEventManager.GetWeakEventManager(this).RaiseEvent(this,
new EventArgs<IPurchasableProduct>(e), "<API key>");
}
public bool IsPurchasing { get; private set; }
public bool <API key> { get { return <API key> != null; } }
public bool CanMakePayments { get { return SKPaymentQueue.CanMakePayments; } }
private bool _loadCalled;
private SKProductsRequest _request; // keep as a field so it doesn't get disposed
public void <API key>(params string[] productIdentifiers)
{
if (!CanMakePayments)
throw new <API key>("Payments are not allowed");
if (_loadCalled) return;
_loadCalled = true;
var productKeys = new NSSet(productIdentifiers);
_request = new SKProductsRequest(productKeys);
_request.RequestFailed += (s, e) => <API key>(new List<IPurchasableProduct>());
_request.ReceivedResponse += (s, e) =>
{
<API key> = e.Response.Products.ToDictionary(p => p.ProductIdentifier,
p => (IPurchasableProduct)new PurchasableProduct(p));
<API key>(<API key>.Values.ToList());
};
_request.Start();
}
public void PurchaseProduct(IPurchasableProduct purchasableProduct)
{
if (!CanMakePayments)
throw new <API key>("Payments are not allowed");
if (<API key> == null)
throw new <API key>("Products not loaded");
if (purchasableProduct == null)
throw new <API key>("purchasableProduct");
IsPurchasing = true;
var payment = SKPayment.PaymentWithProduct(((PurchasableProduct)purchasableProduct).Product);
SKPaymentQueue.DefaultQueue.AddPayment(payment);
}
}
} |
# Let's encrypt Express
[ctime:1453306073000]
Since [_Let's Encrypt_][1] will be coming out [soon][2], I thought I'd try it on my Site. _Let's Encrypts_ infrastructure is actually fully operational already. They still label it as being in beta, because the client has some ([around 400][3]) bugs. My Site runs on Node.js using Express on [_Alpine Linux_][4]. The guide should work on pretty much any Linux system, since both _Node.js_ and _Let's Encrypt_ are made to be as <API key> as possible.
I'll be covering three things in this guide. **Requesting the certificate**, **Installing it to the Express app** and **A simple Express app running over TLS**.
## Requesting the certificate
First of all lets get our certificate. I basically just followed the [README inside Let's Encrypt's Github repo][5].
We'll need to install the utility. This will become easier once it's released as stable. You'll then be able to use your package-manager.
bash
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto --help
Then we can request the certificate. Here's what I did for this site.
bash
./letsencrypt-auto certonly --standalone --email <API key>@lucaschmid.net -d lucaschmid.net
This threw an error on my server because I had IPv6 enabled. If [this issue][6] hasn't been resolved yet, **you might need to do deactivate IPv6**, before running the last command.
bash
sysctl -w net.ipv6.conf.all.disable_ipv6=1
When you now run the last command again, you should recieve the certificate. After that, you can enable IPv6 again.
bash
sysctl -w net.ipv6.conf.all.disable_ipv6=0
## Installing the certificate to the Express app
Inside my app's directory I created a directory called `tls`. I then created some symlinks for the certificate and the key.
bash
mkdir tls
cd tls
ln -s /etc/letsencrypt/live/lucaschmid.net/fullchain.pem cert.pem
ln -s /etc/letsencrypt/live/lucaschmid.net/privkey.pem key.pem
_I'm using Docker to run this site, so the symlinks won't work inside the container. To fix this, I had to make copies of the files instead of only symlinking them. This has the disadvantage of Let’s Encrypt not being able to manage them. The certificates have a pretty short lifetime (3 months), letsencrypt could renew them itself._
## A simple Express app running over TLS
Now we can integrate the `https` module into our Express server. Here's a simple example:
js
var express = require('express')
var fs = require('fs')
var https = require('https')
var ports = process.env.NODE_ENV === 'production'
? [80, 443]
: [3442, 3443]
var app = express()
var server = https.createServer(
{
key: fs.readFileSync('./tls/key.pem'),
cert: fs.readFileSync('./tls/cert.pem')
},
app
)
server.listen(ports[1])
app.listen(ports[0])
app.use('/', (req, res) => {
res.end('Hi')
})
This script simply serves 'Hi' on all routes both over HTTP and HTTPS. It might be a good idea to redirect HTTP to HTTPS. I just wanted to keep it as simple as possible here.
When you run this and go to your Website via HTTPS, you should see something like this:
![Image of the certificate opened in Firefox][image-1]
Now go on!
**ENCRYPT ALL THE THINGS!!**
**UPDATE** 21. July 2016:
A while ago I noticed, that some browsers (i.e. IE) marked my certificate as unverified. That didn't make much sense to me, since Let's Encrypts intermediate certificates are cross-signed by IdenTrust and IdenTrust is a well known CA. So any browser that has whitelisted IdenTrusts root certificate should also trust any Let's Encrypt certificate. The certificate this post used to instruct you to use (`/etc/letsencrypt/live/[domain]/cert.pem`) is of course only signed by the Let's Encrypt CA. For a browser to know that the certificate is indirectly cross-signed by IdenTrust we actually need to use `/etc/letsencrypt/live/[domain]/fullchain.pem`, which as the name implies, contains the whole certificate chain. That includes the cross-signed Let's Encrypt intermediate certificates. You can view the changes I made to the post [here](https://github.com/Kriegslustig/lucaschmid.net/commits/master/common/data/blog/letsencrypt-express.md).
[0]: https://lucaschmid.net/anotherblog/letsencrypt-express
[1]: https://letsencrypt.org/
[2]: https://letsencrypt.org/2015/11/12/public-beta-timing.html
[3]: https://github.com/letsencrypt/letsencrypt/issues
[4]: https://alpinelinux.org/
[5]: https://github.com/letsencrypt/letsencrypt/blob/master/README.rst
[6]: https://github.com/letsencrypt/boulder/issues/1046
[7]: https://letsencrypt.org/
[image-1]: https://lucaschmid.net/img/certificate.png |
layout: post
title: "Leith Hill Place - Short Film"
subtitle: "Family picnic and art exhibition launch event"
date: 2016-08-13 23:30:00
author: "Voice for Leith Hill"
header-img: "img/leith-hill-place.png"
<div id="avplayer"></div>
<script>
// Load the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https:
var firstScriptTag = document.<API key>('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// Replace the 'ytplayer' element with an <iframe> and
// YouTube player after the API code downloads.
var player;
function <API key>() {
player = new YT.Player('avplayer', {
height: '315',
width: '560',
videoId: 'j7m4eS60Dnk'
});
}
</script> |
<div class='centered'>
<br>
<div>
<div class='logo'>jackal</div>
</div>
<br>
<div>
<image src='jackal.64.ico'></image>
</div>
<br/>
<table class='panel'>
<tr>
<td>channel</td>
<td>
<button type='button' id='genRandomChannelKey'>
re-generate
</button>
</td>
<td><input
id='channelKey'
class='key-input'
placeholder="channel key"/>
</td>
<td>
<button type='button' id='copyChannelKey'>
copy
</button>
</td>
</tr>
<tr>
<td>secret</td>
<td>
<button type='button' id='genRandomSecretKey'>
re-generate
</button>
</td>
<td>
<input
id='secretKey'
class='key-input'
placeholder="secret key"/>
</td>
<td>
<button type='button' id='copySecretKey'>
copy
</button>
</td>
</tr>
</table>
<br/>
<div class='centered'>
<div>
<input style='text-align: center;'' id='nick' placeholder='nickname'></input>
</div>
<br/>
<div>
<span id='status'>status</span>
</div>
<br/>
<div>
<button type='button' id='connect'>connect</button>
</div>
</div>
<br/>
<div>
<input id='stdin' class='centered stdin' style='width:50%;'/>
</div>
</div>
<div id='stdout' class='centered' style='display: block;height: 400px;overflow-y: scroll;'>
</div>
<div class='centered' style='color:darkgray'>
jackal | 2016 | david barkhuizen
</div> |
<?php
namespace PHPExiftool\Driver\Tag\Nikon;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class Face2Position extends AbstractTag
{
protected $Id = 8;
protected $Name = 'Face2Position';
protected $FullName = 'Nikon::FaceDetect';
protected $GroupName = 'Nikon';
protected $g0 = 'MakerNotes';
protected $g1 = 'Nikon';
protected $g2 = 'Image';
protected $Type = 'int16u';
protected $Writable = true;
protected $Description = 'Face 2 Position';
protected $flag_Permanent = true;
protected $MaxLength = 4;
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division,absolute_import)
from .K2onSilicon import K2onSilicon |
from rest_framework import routers
class NestedRouter(routers.DefaultRouter):
"""
Custom router which hides nested URLs as they cannot be reversed.
"""
def get_api_root_view(self):
"""
Return a view to use as the API root.
Ignores any URLs which do not reverse correctly.
"""
from django.core.urlresolvers import NoReverseMatch
from rest_framework import views
from rest_framework.response import Response
from rest_framework.urlresolvers import reverse
api_root_dict = {}
list_name = self.routes[0].name
for prefix, viewset, basename in self.registry:
api_root_dict[prefix] = list_name.format(basename=basename)
class APIRoot(views.APIView):
<API key> = True
def get(self, request, format=None):
ret = {}
for key, url_name in api_root_dict.items():
try:
ret[key] = reverse(url_name, request=request,
format=format)
except NoReverseMatch:
pass
return Response(ret)
return APIRoot.as_view() |
@charset "utf-8";
/* CSS Document */
body{
padding:0px;
margin:0px;
background: #788191;
font-size:16px;
font-family:Arial, Helvetica, sans-serif;
}
a{text-decoration:none;}
.loginimg{
position:absolute;
bottom:0px;
left:0px;
width:445px;
height:523px;
background:url(../images/loginimg.png) no-repeat;
}
input[type="text"],input[type="password"]{
/*-<API key>: 3px;
-moz-border-radius: 3px;
border-radius: 3px;*/
border:1px #e5e5e5 solid;
padding:10px 10px;
color:#333;
width:200px;
font-size:12px;
background:url(../images/logintxt-bg.png);
/*-moz-box-shadow:inset 0px 0px 3px #747474;
-webkit-box-shadow:inset 0px 0px 3px #747474;
box-shadow:inset 0px 1px 3px #cacaca;*/
outline:none;
}
.loginbut{
padding:0px 20px;
background:#f38108;
height:37px;
border:1px #de7504 solid;
color:#fff;
font-size:15px;
cursor:pointer;
outline:none;
}
.loginbut:hover{
background:#de7504;
}
.loginboxWrapper{
margin:180px auto 0 auto; width:718px; height:295px; color:#3e3d3d; font-size:12px;
background:#FFF;
/*border-left:15px #ffbb00 solid;*/
/*background:url(../images/login_bg.png) repeat-x bottom;*/
-<API key>: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow:0px 0px 3px #747474;
-webkit-box-shadow:0px 0px 3px #747474;
box-shadow:0px 0px 8px #272626;
}
.loginboxWrapper h1{font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#000; font-weight:lighter; margin:0px; padding:0px;}
.loginboxWrapper a{color:#09F; text-decoration:none;}
.loginboxWrapper a:hover{text-decoration:underline;}
.lw_left{
width:325px;
height:295px;
position:relative;
float:left;
border-right:1px #F5F5F5 solid;
}
.lw_right{
width:350px;
height:245px;
position:relative;
float:left;
padding:25px 20px 20px 20px;
}
.lw_right p{padding:12px 0px 8px 0px; margin:0px;}
.lw_right td{
padding:7px 0px;
}
.lw_logo{
position:absolute;
top:60px;
left:65px;
width:171px;
height:161px;
}
.loginrow{position:relative;}
.errorSummary{
font-size:11px;
color:#F00;
padding:5px 0 5px 30px;
display:block;
background:url(../img/alert-triangle-red.png) no-repeat left top;
}
/*login credentials*/
.logincredential{
margin:0px auto 0 auto; width:690px; height:80px; color:#3e3d3d; font-size:12px;
background:#2a2e34;
color:#798699;
text-align:left;
}
.logincredential h6{
font-size:12px;
color:#ffbb00;
margin:0px;
padding:0px 0px 10px 0px;
}
.logincredential p{
font-size:11px;
color:#798699;
padding:0px;
margin:0px;
line-height:14px;
}
.logincredential ul{
padding:0px;
margin:0px;
list-style:none;
}
.logincredential ul li{
width:145px;
height:65px;
padding:15px 0px 0px 25px;
float:left;
border-right:1px #1e2126 solid;
border-left:1px #383c43 solid;
}
.logincredential ul li:first-child{
border-left:0px #383c43 solid;
}
.logincredential ul li:last-child{
border-right:0px #383c43 solid;
} |
'use strict';
var Lib = require('../../lib');
var id2name = require('./axis_ids').id2name;
var scaleZoom = require('./scale_zoom');
var makePadFn = require('./autorange').makePadFn;
var concatExtremes = require('./autorange').concatExtremes;
var ALMOST_EQUAL = require('../../constants/numerical').ALMOST_EQUAL;
var FROM_BL = require('../../constants/alignment').FROM_BL;
exports.<API key> = function(containerIn, containerOut, coerce, opts) {
var allAxisIds = opts.allAxisIds;
var layoutOut = opts.layoutOut;
var scaleanchorDflt = opts.scaleanchorDflt;
var constrainDflt = opts.constrainDflt;
var constraintGroups = layoutOut.<API key>;
var matchGroups = layoutOut._axisMatchGroups;
var axId = containerOut._id;
var axLetter = axId.charAt(0);
var splomStash = ((layoutOut._splomAxes || {})[axLetter] || {})[axId] || {};
var thisID = containerOut._id;
var letter = thisID.charAt(0);
// coerce the constraint mechanics even if this axis has no scaleanchor
// because it may be the anchor of another axis.
var constrain = coerce('constrain', constrainDflt);
Lib.coerce(containerIn, containerOut, {
constraintoward: {
valType: 'enumerated',
values: letter === 'x' ? ['left', 'center', 'right'] : ['bottom', 'middle', 'top'],
dflt: letter === 'x' ? 'center' : 'middle'
}
}, 'constraintoward');
var matches, matchOpts;
if((containerIn.matches || splomStash.matches) && !containerOut.fixedrange) {
matchOpts = getConstraintOpts(matchGroups, thisID, allAxisIds, layoutOut);
matches = Lib.coerce(containerIn, containerOut, {
matches: {
valType: 'enumerated',
values: matchOpts.linkableAxes || [],
dflt: splomStash.matches
}
}, 'matches');
}
// 'matches' wins over 'scaleanchor' (for now)
var scaleanchor, scaleOpts;
if(!matches &&
!(containerOut.fixedrange && constrain !== 'domain') &&
(containerIn.scaleanchor || scaleanchorDflt)
) {
scaleOpts = getConstraintOpts(constraintGroups, thisID, allAxisIds, layoutOut, constrain);
scaleanchor = Lib.coerce(containerIn, containerOut, {
scaleanchor: {
valType: 'enumerated',
values: scaleOpts.linkableAxes || []
}
}, 'scaleanchor', scaleanchorDflt);
}
if(matches) {
delete containerOut.constrain;
<API key>(matchGroups, matchOpts.thisGroup, thisID, matches, 1);
} else if(allAxisIds.indexOf(containerIn.matches) !== -1) {
Lib.warn('ignored ' + containerOut._name + '.matches: "' +
containerIn.matches + '" to avoid either an infinite loop ' +
'or because the target axis has fixed range.');
}
if(scaleanchor) {
var scaleratio = coerce('scaleratio');
// TODO: I suppose I could do attribute.min: Number.MIN_VALUE to avoid zero,
// but that seems hacky. Better way to say "must be a positive number"?
// Of course if you use several super-tiny values you could eventually
// force a product of these to zero and all hell would break loose...
// Likewise with super-huge values.
if(!scaleratio) scaleratio = containerOut.scaleratio = 1;
<API key>(constraintGroups, scaleOpts.thisGroup, thisID, scaleanchor, scaleratio);
} else if(allAxisIds.indexOf(containerIn.scaleanchor) !== -1) {
Lib.warn('ignored ' + containerOut._name + '.scaleanchor: "' +
containerIn.scaleanchor + '" to avoid either an infinite loop ' +
'and possibly inconsistent scaleratios, or because the target ' +
'axis has fixed range or this axis declares a *matches* constraint.');
}
};
// If this axis is already part of a constraint group, we can't
// scaleanchor any other axis in that group, or we'd make a loop.
// Filter allAxisIds to enforce this, also matching axis types.
function getConstraintOpts(groups, thisID, allAxisIds, layoutOut, constrain) {
var <API key> = constrain !== 'range';
var thisType = layoutOut[id2name(thisID)].type;
var i, j, idj, axj;
var linkableAxes = [];
for(j = 0; j < allAxisIds.length; j++) {
idj = allAxisIds[j];
if(idj === thisID) continue;
axj = layoutOut[id2name(idj)];
if(axj.type === thisType) {
if(!axj.fixedrange) {
linkableAxes.push(idj);
} else if(<API key> && axj.anchor) {
// allow domain constraints on subplots where
// BOTH axes have fixedrange:true and constrain:domain
var counterAxj = layoutOut[id2name(axj.anchor)];
if(counterAxj.fixedrange) {
linkableAxes.push(idj);
}
}
}
}
for(i = 0; i < groups.length; i++) {
if(groups[i][thisID]) {
var thisGroup = groups[i];
var linkableAxesNoLoops = [];
for(j = 0; j < linkableAxes.length; j++) {
idj = linkableAxes[j];
if(!thisGroup[idj]) linkableAxesNoLoops.push(idj);
}
return {linkableAxes: linkableAxesNoLoops, thisGroup: thisGroup};
}
}
return {linkableAxes: linkableAxes, thisGroup: null};
}
/*
* Add this axis to the axis constraint groups, which is the collection
* of axes that are all constrained together on scale.
*
* constraintGroups: a list of objects. each object is
* {axis_id: scale_within_group}, where scale_within_group is
* only important relative to the rest of the group, and defines
* the relative scales between all axes in the group
*
* thisGroup: the group the current axis is already in
* thisID: the id if the current axis
* scaleanchor: the id of the axis to scale it with
* scaleratio: the ratio of this axis to the scaleanchor axis
*/
function <API key>(constraintGroups, thisGroup, thisID, scaleanchor, scaleratio) {
var i, j, groupi, keyj, thisGroupIndex;
if(thisGroup === null) {
thisGroup = {};
thisGroup[thisID] = 1;
thisGroupIndex = constraintGroups.length;
constraintGroups.push(thisGroup);
} else {
thisGroupIndex = constraintGroups.indexOf(thisGroup);
}
var thisGroupKeys = Object.keys(thisGroup);
// we know that this axis isn't in any other groups, but we don't know
// about the scaleanchor axis. If it is, we need to merge the groups.
for(i = 0; i < constraintGroups.length; i++) {
groupi = constraintGroups[i];
if(i !== thisGroupIndex && groupi[scaleanchor]) {
var baseScale = groupi[scaleanchor];
for(j = 0; j < thisGroupKeys.length; j++) {
keyj = thisGroupKeys[j];
groupi[keyj] = baseScale * scaleratio * thisGroup[keyj];
}
constraintGroups.splice(thisGroupIndex, 1);
return;
}
}
// otherwise, we insert the new scaleanchor axis as the base scale (1)
// in its group, and scale the rest of the group to it
if(scaleratio !== 1) {
for(j = 0; j < thisGroupKeys.length; j++) {
thisGroup[thisGroupKeys[j]] *= scaleratio;
}
}
thisGroup[scaleanchor] = 1;
}
exports.enforce = function enforce(gd) {
var fullLayout = gd._fullLayout;
var constraintGroups = fullLayout.<API key> || [];
var i, j, axisID, ax, normScale, mode, factor;
for(i = 0; i < constraintGroups.length; i++) {
var group = constraintGroups[i];
var axisIDs = Object.keys(group);
var minScale = Infinity;
var maxScale = 0;
// mostly matchScale will be the same as minScale
// ie we expand axis ranges to encompass *everything*
// that's currently in any of their ranges, but during
// autorange of a subset of axes we will ignore other
// axes for this purpose.
var matchScale = Infinity;
var normScales = {};
var axes = {};
var <API key> = false;
// find the (normalized) scale of each axis in the group
for(j = 0; j < axisIDs.length; j++) {
axisID = axisIDs[j];
axes[axisID] = ax = fullLayout[id2name(axisID)];
if(ax._inputDomain) ax.domain = ax._inputDomain.slice();
else ax._inputDomain = ax.domain.slice();
if(!ax._inputRange) ax._inputRange = ax.range.slice();
// set axis scale here so we can use _m rather than
// having to calculate it from length and range
ax.setScale();
// abs: inverted scales still satisfy the constraint
normScales[axisID] = normScale = Math.abs(ax._m) / group[axisID];
minScale = Math.min(minScale, normScale);
if(ax.constrain === 'domain' || !ax.<API key>) {
matchScale = Math.min(matchScale, normScale);
}
// this has served its purpose, so remove it
delete ax.<API key>;
maxScale = Math.max(maxScale, normScale);
if(ax.constrain === 'domain') <API key> = true;
}
// Do we have a constraint mismatch? Give a small buffer for rounding errors
if(minScale > ALMOST_EQUAL * maxScale && !<API key>) continue;
// now increase any ranges we need to until all normalized scales are equal
for(j = 0; j < axisIDs.length; j++) {
axisID = axisIDs[j];
normScale = normScales[axisID];
ax = axes[axisID];
mode = ax.constrain;
// even if the scale didn't change, if we're shrinking domain
// we need to recalculate in case `constraintoward` changed
if(normScale !== matchScale || mode === 'domain') {
factor = normScale / matchScale;
if(mode === 'range') {
scaleZoom(ax, factor);
} else {
var inputDomain = ax._inputDomain;
var domainShrunk = (ax.domain[1] - ax.domain[0]) /
(inputDomain[1] - inputDomain[0]);
var rangeShrunk = (ax.r2l(ax.range[1]) - ax.r2l(ax.range[0])) /
(ax.r2l(ax._inputRange[1]) - ax.r2l(ax._inputRange[0]));
factor /= domainShrunk;
if(factor * rangeShrunk < 1) {
// we've asked to magnify the axis more than we can just by
// enlarging the domain - so we need to constrict range
ax.domain = ax._input.domain = inputDomain.slice();
scaleZoom(ax, factor);
continue;
}
if(rangeShrunk < 1) {
// the range has previously been constricted by ^^, but we've
// switched to the domain-constricted regime, so reset range
ax.range = ax._input.range = ax._inputRange.slice();
factor *= rangeShrunk;
}
if(ax.autorange) {
/*
* range & factor may need to change because range was
* calculated for the larger scaling, so some pixel
* paddings may get cut off when we reduce the domain.
*
* This is easier than the regular autorange calculation
* because we already know the scaling `m`, but we still
* need to cut out impossible constraints (like
* annotations with super-long arrows). That's what
* outerMin/Max are for - if the expansion was going to
* go beyond the original domain, it must be impossible
*/
var rl0 = ax.r2l(ax.range[0]);
var rl1 = ax.r2l(ax.range[1]);
var rangeCenter = (rl0 + rl1) / 2;
var rangeMin = rangeCenter;
var rangeMax = rangeCenter;
var halfRange = Math.abs(rl1 - rangeCenter);
// extra tiny bit for rounding errors, in case we actually
// *are* expanding to the full domain
var outerMin = rangeCenter - halfRange * factor * 1.0001;
var outerMax = rangeCenter + halfRange * factor * 1.0001;
var getPad = makePadFn(ax);
updateDomain(ax, factor);
var m = Math.abs(ax._m);
var extremes = concatExtremes(gd, ax);
var minArray = extremes.min;
var maxArray = extremes.max;
var newVal;
var k;
for(k = 0; k < minArray.length; k++) {
newVal = minArray[k].val - getPad(minArray[k]) / m;
if(newVal > outerMin && newVal < rangeMin) {
rangeMin = newVal;
}
}
for(k = 0; k < maxArray.length; k++) {
newVal = maxArray[k].val + getPad(maxArray[k]) / m;
if(newVal < outerMax && newVal > rangeMax) {
rangeMax = newVal;
}
}
var domainExpand = (rangeMax - rangeMin) / (2 * halfRange);
factor /= domainExpand;
rangeMin = ax.l2r(rangeMin);
rangeMax = ax.l2r(rangeMax);
ax.range = ax._input.range = (rl0 < rl1) ?
[rangeMin, rangeMax] : [rangeMax, rangeMin];
}
updateDomain(ax, factor);
}
}
}
}
};
// For use before autoranging, check if this axis was previously constrained
// by domain but no longer is
exports.clean = function clean(gd, ax) {
if(ax._inputDomain) {
var isConstrained = false;
var axId = ax._id;
var constraintGroups = gd._fullLayout.<API key>;
for(var j = 0; j < constraintGroups.length; j++) {
if(constraintGroups[j][axId]) {
isConstrained = true;
break;
}
}
if(!isConstrained || ax.constrain !== 'domain') {
ax._input.domain = ax.domain = ax._inputDomain;
delete ax._inputDomain;
}
}
};
function updateDomain(ax, factor) {
var inputDomain = ax._inputDomain;
var centerFraction = FROM_BL[ax.constraintoward];
var center = inputDomain[0] + (inputDomain[1] - inputDomain[0]) * centerFraction;
ax.domain = ax._input.domain = [
center + (inputDomain[0] - center) / factor,
center + (inputDomain[1] - center) / factor
];
ax.setScale();
} |
using UnityEngine;
using System.Collections;
public enum ResourceItemType {
COIN,
PLAYER_HOLDER,
CAMERA_HOLDER,
SHORT_TRACK,
MEDIUM_TRACK,
LONG_TRACK,
OBSTACLE,
LANE_HOLDER,
SEGMENT_HOLDER,
CRACKED_FLOOR,
FALL_SUBJECT,
MILESTONE_SUBJECT,
HOLE,
NONE
} |
# 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_11_01
module Models
# Describes the settings for producing output into a log analytics
# workspace.
class <API key>
include MsRestAzure
# @return [String] Log analytics workspace resource ID.
attr_accessor :<API key>
# Mapper for <API key> class as Ruby Hash.
# This will be used for serialization/deserialization.
def self.mapper()
{
<API key>: true,
required: false,
serialized_name: '<API key>',
type: {
name: 'Composite',
class_name: '<API key>',
model_properties: {
<API key>: {
<API key>: true,
required: false,
serialized_name: 'workspaceResourceId',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end |
[Skip to main content](#content)
[Bootstrap](/)
* [Bootstrap](/)
* [Documentation](/getting-started/introduction/)
* [Examples](/examples/)
* [Themes](https://themes.getbootstrap.com)
* [Expo](https://expo.getbootstrap.com)
* [Blog](https://blog.getbootstrap.com) |
#ifndef DBDIMVAR_H
#define DBDIMVAR_H
// agreement provided at the time of installation or download, or which
// otherwise accompanies this software in either electronic or hard copy form.
// DESCRIPTION:
// The api for dimensioning variables shared by
// AcDbDatabase,
// <API key>, and
// AcDbDimension
virtual int dimadec () const; // new to R15
virtual bool dimalt () const;
virtual int dimaltd () const;
virtual double dimaltf () const;
virtual double dimaltrnd() const; // new to R15
virtual int dimalttd () const;
virtual int dimalttz () const;
virtual int dimaltu () const;
virtual int dimaltz () const;
virtual const ACHAR * dimapost () const;
virtual int dimarcsym() const; // new to 2007
virtual double dimasz () const;
virtual int dimatfit () const; // new to R15
virtual int dimaunit () const;
virtual int dimazin () const; // new to R15
virtual AcDbObjectId dimblk () const;
virtual AcDbObjectId dimblk1 () const;
virtual AcDbObjectId dimblk2 () const;
virtual double dimcen () const;
virtual AcCmColor dimclrd () const;
virtual AcCmColor dimclre () const;
virtual AcCmColor dimclrt () const;
virtual int dimdec () const;
virtual double dimdle () const;
virtual double dimdli () const;
virtual ACHAR dimdsep () const; // new to R15
virtual double dimexe () const;
virtual double dimexo () const;
virtual int dimfrac () const; // new to R15
virtual double dimgap () const;
virtual double dimjogang() const; // new to 2007
virtual int dimjust () const;
virtual AcDbObjectId dimldrblk() const; // new to R15
virtual double dimlfac () const;
virtual bool dimlim () const;
virtual AcDbObjectId dimltex1 () const; // new to 2007
virtual AcDbObjectId dimltex2 () const; // new to 2007
virtual AcDbObjectId dimltype () const; // new to 2007
virtual int dimlunit () const; // new to R15
virtual AcDb::LineWeight dimlwd () const; // new to R15
virtual AcDb::LineWeight dimlwe () const; // new to R15
virtual const ACHAR * dimpost () const;
virtual double dimrnd () const;
virtual bool dimsah () const;
virtual double dimscale () const;
virtual bool dimsd1 () const;
virtual bool dimsd2 () const;
virtual bool dimse1 () const;
virtual bool dimse2 () const;
virtual bool dimsoxd () const;
virtual int dimtad () const;
virtual int dimtdec () const;
virtual double dimtfac () const;
virtual int dimtfill () const; // new to 2007
virtual AcCmColor dimtfillclr() const; // new to 2007
virtual bool dimtih () const;
virtual bool dimtix () const;
virtual double dimtm () const;
virtual int dimtmove () const; // new to R15
virtual bool dimtofl () const;
virtual bool dimtoh () const;
virtual bool dimtol () const;
virtual int dimtolj () const;
virtual double dimtp () const;
virtual double dimtsz () const;
virtual double dimtvp () const;
virtual AcDbObjectId dimtxsty () const;
virtual double dimtxt () const;
virtual int dimtzin () const;
virtual bool dimupt () const;
virtual int dimzin () const;
virtual bool dimfxlenOn () const; // new to R2007
virtual double dimfxlen () const; // new to R2007
virtual bool dimtxtdirection() const; // new to 2010
virtual double dimmzf () const; // new to 2010
virtual const ACHAR * dimmzs () const; // new to 2010
virtual double dimaltmzf() const; // new to 2010
virtual const ACHAR * dimaltmzs() const; // new to 2010
virtual Acad::ErrorStatus setDimadec (int v); // new to R15
virtual Acad::ErrorStatus setDimalt (bool v);
virtual Acad::ErrorStatus setDimaltd (int v);
virtual Acad::ErrorStatus setDimaltf (double v);
virtual Acad::ErrorStatus setDimaltmzf(double v); // new to 2010
virtual Acad::ErrorStatus setDimaltmzs(const ACHAR * v); // new to 2010
virtual Acad::ErrorStatus setDimaltrnd(double v); // new to R15
virtual Acad::ErrorStatus setDimalttd (int v);
virtual Acad::ErrorStatus setDimalttz (int v);
virtual Acad::ErrorStatus setDimaltu (int v);
virtual Acad::ErrorStatus setDimaltz (int v);
virtual Acad::ErrorStatus setDimapost (const ACHAR * v);
virtual Acad::ErrorStatus setDimarcsym(int v); // new to 2007
virtual Acad::ErrorStatus setDimasz (double v);
virtual Acad::ErrorStatus setDimatfit (int v); // new to R15
virtual Acad::ErrorStatus setDimaunit (int v);
virtual Acad::ErrorStatus setDimazin (int v); // new to R15
virtual Acad::ErrorStatus setDimblk (AcDbObjectId v); // new to R15
virtual Acad::ErrorStatus setDimblk1 (AcDbObjectId v); // new to R15
virtual Acad::ErrorStatus setDimblk2 (AcDbObjectId v); // new to R15
virtual Acad::ErrorStatus setDimcen (double v);
virtual Acad::ErrorStatus setDimclrd (const AcCmColor& v);
virtual Acad::ErrorStatus setDimclre (const AcCmColor& v);
virtual Acad::ErrorStatus setDimclrt (const AcCmColor& v);
virtual Acad::ErrorStatus setDimdec (int v);
virtual Acad::ErrorStatus setDimdle (double v);
virtual Acad::ErrorStatus setDimdli (double v);
virtual Acad::ErrorStatus setDimdsep (ACHAR v); // new to R15
virtual Acad::ErrorStatus setDimexe (double v);
virtual Acad::ErrorStatus setDimexo (double v);
virtual Acad::ErrorStatus setDimfrac (int v); // new to R15
virtual Acad::ErrorStatus setDimgap (double v);
virtual Acad::ErrorStatus setDimjogang(double v); // new to 2007
virtual Acad::ErrorStatus setDimjust (int v);
virtual Acad::ErrorStatus setDimldrblk(AcDbObjectId v); // new to R15
virtual Acad::ErrorStatus setDimlfac (double v);
virtual Acad::ErrorStatus setDimlim (bool v);
virtual Acad::ErrorStatus setDimltex1 (AcDbObjectId v); // new to 2007
virtual Acad::ErrorStatus setDimltex2 (AcDbObjectId v); // new to 2007
virtual Acad::ErrorStatus setDimltype (AcDbObjectId v); // new to 2007
virtual Acad::ErrorStatus setDimlunit (int v); // new to R15
virtual Acad::ErrorStatus setDimlwd (AcDb::LineWeight v); // new to R15
virtual Acad::ErrorStatus setDimlwe (AcDb::LineWeight v); // new to R15
virtual Acad::ErrorStatus setDimmzf (double v); // new to 2010
virtual Acad::ErrorStatus setDimmzs (const ACHAR * v); // new to 2010
virtual Acad::ErrorStatus setDimpost (const ACHAR * v);
virtual Acad::ErrorStatus setDimrnd (double v);
virtual Acad::ErrorStatus setDimsah (bool v);
virtual Acad::ErrorStatus setDimscale (double v);
virtual Acad::ErrorStatus setDimsd1 (bool v);
virtual Acad::ErrorStatus setDimsd2 (bool v);
virtual Acad::ErrorStatus setDimse1 (bool v);
virtual Acad::ErrorStatus setDimse2 (bool v);
virtual Acad::ErrorStatus setDimsoxd (bool v);
virtual Acad::ErrorStatus setDimtad (int v);
virtual Acad::ErrorStatus setDimtdec (int v);
virtual Acad::ErrorStatus setDimtfac (double v);
virtual Acad::ErrorStatus setDimtfill (int v); // new to 2007
virtual Acad::ErrorStatus setDimtfillclr(const AcCmColor& v); // new to 2007
virtual Acad::ErrorStatus setDimtih (bool v);
virtual Acad::ErrorStatus setDimtix (bool v);
virtual Acad::ErrorStatus setDimtm (double v);
virtual Acad::ErrorStatus setDimtmove (int v); // new to R15
virtual Acad::ErrorStatus setDimtofl (bool v);
virtual Acad::ErrorStatus setDimtoh (bool v);
virtual Acad::ErrorStatus setDimtol (bool v);
virtual Acad::ErrorStatus setDimtolj (int v);
virtual Acad::ErrorStatus setDimtp (double v);
virtual Acad::ErrorStatus setDimtsz (double v);
virtual Acad::ErrorStatus setDimtvp (double v);
virtual Acad::ErrorStatus setDimtxsty (AcDbObjectId v);
virtual Acad::ErrorStatus setDimtxt (double v);
virtual Acad::ErrorStatus setDimtxtdirection (bool v); // new 2010
virtual Acad::ErrorStatus setDimtzin (int v);
virtual Acad::ErrorStatus setDimupt (bool v);
virtual Acad::ErrorStatus setDimzin (int v);
virtual Acad::ErrorStatus setDimblk (const ACHAR * v);
virtual Acad::ErrorStatus setDimblk1 (const ACHAR * v);
virtual Acad::ErrorStatus setDimblk2 (const ACHAR * v);
virtual Acad::ErrorStatus setDimldrblk(const ACHAR * v); // new to R15
virtual Acad::ErrorStatus setDimfxlenOn (bool v); // new to R2007
virtual Acad::ErrorStatus setDimfxlen (double v); // new to R2007
#endif // ifndef DBDIMVAR_H |
# coding=utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import <API key>, HttpResponseError, ResourceExistsError, <API key>, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
class <API key>(object):
"""<API key> operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2019_11_01.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
resource_group_name, # type: str
load_balancer_name, # type: str
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.<API key>"]
"""Gets all the load balancer backed address pools.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param load_balancer_name: The name of the load balancer.
:type load_balancer_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either <API key> or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.<API key>]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.<API key>"]
error_map = {
401: <API key>, 404: <API key>, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
<API key> = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **<API key>)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('<API key>', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} # type: ignore
def get(
self,
resource_group_name, # type: str
load_balancer_name, # type: str
<API key>, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.BackendAddressPool"
"""Gets load balancer backend address pool.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param load_balancer_name: The name of the load balancer.
:type load_balancer_name: str
:param <API key>: The name of the backend address pool.
:type <API key>: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: BackendAddressPool, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2019_11_01.models.BackendAddressPool
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"]
error_map = {
401: <API key>, 404: <API key>, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
<API key> = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'),
'<API key>': self._serialize.url("<API key>", <API key>, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **<API key>)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('BackendAddressPool', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{<API key>}'} # type: ignore |
paper_ln = [];
paper_ln["modify_it"] = "Modifica card";
paper_ln["delete_it"] = "Elimina card";
paper_ln["open_it"] = "Apri anteprima";
paper_ln["modify_en"] = "Modify card";
paper_ln["delete_en"] = "Delete card";
paper_ln["open_en"] = "Open preview";
paper_ln["modify_fr"] = "Modifier";
paper_ln["delete_fr"] = "Supprimer";
paper_ln["open_fr"] = "Ouvrir aperçu";
paper_ln["modify_nl"] = "Wijzigen card";
paper_ln["delete_nl"] = "Wissen card";
paper_ln["open_nl"] = "Open preview";
paper_ln["modify_es-ES"] = "Modificar tarjeta";
paper_ln["delete_es-ES"] = "Borrar tarjeta";
paper_ln["open_es-ES"] = "Abrir tarjeta";
/* (Simplified)CN */
paper_ln["modify_cn"] = "";
paper_ln["delete_cn"] = "";
paper_ln["open_cn"] = ""; |
<?php return array (
'az' => 'الأذربيجانية',
'az_AZ' => 'الأذربيجانية (أذربيجان)',
'az_Cyrl_AZ' => 'الأذربيجانية (السيريلية, أذربيجان)',
'az_Cyrl' => 'الأذربيجانية (السيريلية)',
'az_Latn_AZ' => 'الأذربيجانية (اللاتينية, أذربيجان)',
'az_Latn' => 'الأذربيجانية (اللاتينية)',
'ur' => 'الأردية',
'ur_IN' => 'الأردية (الهند)',
'ur_PK' => 'الأردية (باكستان)',
'hy' => 'الأرمينية',
'hy_AM' => 'الأرمينية (أرمينيا)',
'as' => 'الأساميزية',
'as_IN' => 'الأساميزية (الهند)',
'es' => 'الإسبانية',
'es_ES' => 'الإسبانية (إسبانيا)',
'es_AR' => 'الإسبانية (الأرجنتين)',
'es_EC' => 'الإسبانية (الإكوادور)',
'es_SV' => 'الإسبانية (السلفادور)',
'es_PH' => 'الإسبانية (الفلبين)',
'es_MX' => 'الإسبانية (المكسيك)',
'es_US' => 'الإسبانية (الولايات المتحدة)',
'es_UY' => 'الإسبانية (أورغواي)',
'es_PY' => 'الإسبانية (باراغواي)',
'es_PA' => 'الإسبانية (بنما)',
'es_PR' => 'الإسبانية (بورتوريكو)',
'es_BO' => 'الإسبانية (بوليفيا)',
'es_PE' => 'الإسبانية (بيرو)',
'es_IC' => 'الإسبانية (جزر الكناري)',
'es_DO' => 'الإسبانية (جمهورية الدومينيك)',
'es_EA' => 'الإسبانية (سيوتا وميليلا)',
'es_CL' => 'الإسبانية (شيلي)',
'es_GT' => 'الإسبانية (غواتيمالا)',
'es_GQ' => 'الإسبانية (غينيا الإستوائية)',
'es_VE' => 'الإسبانية (فنزويلا)',
'es_CU' => 'الإسبانية (كوبا)',
'es_CR' => 'الإسبانية (كوستاريكا)',
'es_CO' => 'الإسبانية (كولومبيا)',
'es_NI' => 'الإسبانية (نيكاراغوا)',
'es_HN' => 'الإسبانية (هندوراس)',
'eo' => 'الإسبرانتو',
'et' => 'الإستونية',
'et_EE' => 'الإستونية (أستونيا)',
'af' => 'الأفريقانية',
'af_ZA' => 'الأفريقانية (جنوب أفريقيا)',
'af_NA' => 'الأفريقانية (ناميبيا)',
'ak' => 'الأكانية',
'ak_GH' => 'الأكانية (غانا)',
'sq' => 'الألبانية',
'sq_AL' => 'الألبانية (ألبانيا)',
'sq_XK' => 'الألبانية (كوسوفو)',
'sq_MK' => 'الألبانية (مقدونيا)',
'de' => 'الألمانية',
'de_DE' => 'الألمانية (ألمانيا)',
'de_AT' => 'الألمانية (النمسا)',
'de_BE' => 'الألمانية (بلجيكا)',
'de_CH' => 'الألمانية (سويسرا)',
'de_LU' => 'الألمانية (لوكسمبورغ)',
'de_LI' => 'الألمانية (ليختنشتاين)',
'am' => 'الأمهرية',
'am_ET' => 'الأمهرية (إثيوبيا)',
'en' => 'الإنجليزية',
'en_ER' => 'الإنجليزية (أريتريا)',
'en_AU' => 'الإنجليزية (أستراليا)',
'en_IO' => 'الإنجليزية (الإقليم البريطاني في المحيط الهندي)',
'en_BS' => 'الإنجليزية (الباهاما)',
'en_SD' => 'الإنجليزية (السودان)',
'en_PH' => 'الإنجليزية (الفلبين)',
'en_CM' => 'الإنجليزية (الكاميرون)',
'en_GB' => 'الإنجليزية (المملكة المتحدة)',
'en_IN' => 'الإنجليزية (الهند)',
'en_US' => 'الإنجليزية (الولايات المتحدة)',
'en_AG' => 'الإنجليزية (أنتيغوا وبربودا)',
'en_AI' => 'الإنجليزية (أنغويلا)',
'en_UG' => 'الإنجليزية (أوغندا)',
'en_IE' => 'الإنجليزية (أيرلندا)',
'en_PG' => 'الإنجليزية (بابوا غينيا الجديدة)',
'en_PK' => 'الإنجليزية (باكستان)',
'en_PW' => 'الإنجليزية (بالاو)',
'en_BW' => 'الإنجليزية (بتسوانا)',
'en_BB' => 'الإنجليزية (بربادوس)',
'en_BM' => 'الإنجليزية (برمودا)',
'en_BE' => 'الإنجليزية (بلجيكا)',
'en_BZ' => 'الإنجليزية (بليز)',
'en_PR' => 'الإنجليزية (بورتوريكو)',
'en_TZ' => 'الإنجليزية (تانزانيا)',
'en_TT' => 'الإنجليزية (ترينيداد وتوباغو)',
'en_TV' => 'الإنجليزية (توفالو)',
'en_TK' => 'الإنجليزية (توكيلو)',
'en_TO' => 'الإنجليزية (تونغا)',
'en_JM' => 'الإنجليزية (جامايكا)',
'en_GI' => 'الإنجليزية (جبل طارق)',
'en_TC' => 'الإنجليزية (جزر الترك وجايكوس)',
'en_KY' => 'الإنجليزية (جزر الكايمن)',
'en_MH' => 'الإنجليزية (جزر المارشال)',
'en_UM' => 'الإنجليزية (جزر الولايات المتحدة النائية)',
'en_PN' => 'الإنجليزية (جزر بيتكيرن)',
'en_SB' => 'الإنجليزية (جزر سليمان)',
'en_VI' => 'الإنجليزية (جزر فرجين الأمريكية)',
'en_VG' => 'الإنجليزية (جزر فرجين البريطانية)',
'en_FK' => 'الإنجليزية (جزر فوكلاند)',
'en_CK' => 'الإنجليزية (جزر كوك)',
'en_CC' => 'الإنجليزية (جزر كوكوس)',
'en_MP' => 'الإنجليزية (جزر ماريانا الشمالية)',
'en_CX' => 'الإنجليزية (جزيرة الكريسماس)',
'en_IM' => 'الإنجليزية (جزيرة مان)',
'en_NF' => 'الإنجليزية (جزيرة نورفوك)',
'en_ZA' => 'الإنجليزية (جنوب أفريقيا)',
'en_SS' => 'الإنجليزية (جنوب السودان)',
'en_JE' => 'الإنجليزية (جيرسي)',
'en_DM' => 'الإنجليزية (دومينيكا)',
'en_DG' => 'الإنجليزية (دييغو غارسيا)',
'en_RW' => 'الإنجليزية (رواندا)',
'en_ZM' => 'الإنجليزية (زامبيا)',
'en_ZW' => 'الإنجليزية (زيمبابوي)',
'en_AS' => 'الإنجليزية (ساموا الأمريكية)',
'en_WS' => 'الإنجليزية (ساموا)',
'en_VC' => 'الإنجليزية (سانت فنسنت وغرنادين)',
'en_KN' => 'الإنجليزية (سانت كيتس ونيفيس)',
'en_LC' => 'الإنجليزية (سانت لوسيا)',
'en_SH' => 'الإنجليزية (سانت هيلنا)',
'en_SG' => 'الإنجليزية (سنغافورة)',
'en_SZ' => 'الإنجليزية (سوازيلاند)',
'en_SL' => 'الإنجليزية (سيراليون)',
'en_SC' => 'الإنجليزية (سيشل)',
'en_SX' => 'الإنجليزية (سينت مارتن)',
'en_GM' => 'الإنجليزية (غامبيا)',
'en_GH' => 'الإنجليزية (غانا)',
'en_GD' => 'الإنجليزية (غرينادا)',
'en_GU' => 'الإنجليزية (غوام)',
'en_GY' => 'الإنجليزية (غيانا)',
'en_GG' => 'الإنجليزية (غيرنزي)',
'en_VU' => 'الإنجليزية (فانواتو)',
'en_FJ' => 'الإنجليزية (فيجي)',
'en_CA' => 'الإنجليزية (كندا)',
'en_KI' => 'الإنجليزية (كيريباتي)',
'en_KE' => 'الإنجليزية (كينيا)',
'en_LR' => 'الإنجليزية (ليبيريا)',
'en_LS' => 'الإنجليزية (ليسوتو)',
'en_MT' => 'الإنجليزية (مالطا)',
'en_MY' => 'الإنجليزية (ماليزيا)',
'en_MG' => 'الإنجليزية (مدغشقر)',
'en_MO' => 'الإنجليزية (مكاو الصينية (منطقة إدارية خاصة))',
'en_MW' => 'الإنجليزية (ملاوي)',
'en_MU' => 'الإنجليزية (موريشيوس)',
'en_MS' => 'الإنجليزية (مونتسرات)',
'en_FM' => 'الإنجليزية (ميكرونيزيا)',
'en_NA' => 'الإنجليزية (ناميبيا)',
'en_NR' => 'الإنجليزية (ناورو)',
'en_NG' => 'الإنجليزية (نيجيريا)',
'en_NZ' => 'الإنجليزية (نيوزيلاندا)',
'en_NU' => 'الإنجليزية (نيوي)',
'en_HK' => 'الإنجليزية (هونغ كونغ الصينية)',
'id' => 'الإندونيسية',
'id_ID' => 'الإندونيسية (أندونيسيا)',
'om' => 'الأورومو',
'om_ET' => 'الأورومو (إثيوبيا)',
'om_KE' => 'الأورومو (كينيا)',
'or' => 'الأورييا',
'or_IN' => 'الأورييا (الهند)',
'uz' => 'الأوزبكية',
'uz_AF' => 'الأوزبكية (أفغانستان)',
'uz_Cyrl_UZ' => 'الأوزبكية (السيريلية, أوزبكستان)',
'uz_Cyrl' => 'الأوزبكية (السيريلية)',
'uz_Arab_AF' => 'الأوزبكية (العربية, أفغانستان)',
'uz_Arab' => 'الأوزبكية (العربية)',
'uz_Latn_UZ' => 'الأوزبكية (اللاتينية, أوزبكستان)',
'uz_Latn' => 'الأوزبكية (اللاتينية)',
'uz_UZ' => 'الأوزبكية (أوزبكستان)',
'os' => 'الأوسيتيك',
'os_GE' => 'الأوسيتيك (جورجيا)',
'os_RU' => 'الأوسيتيك (روسيا)',
'uk' => 'الأوكرانية',
'uk_UA' => 'الأوكرانية (أوكرانيا)',
'ug' => 'الأويغورية',
'ug_CN' => 'الأويغورية (الصين)',
'ug_Arab_CN' => 'الأويغورية (العربية, الصين)',
'ug_Arab' => 'الأويغورية (العربية)',
'ig' => 'الإيجبو',
'ig_NG' => 'الإيجبو (نيجيريا)',
'ga' => 'الأيرلندية',
'ga_IE' => 'الأيرلندية (أيرلندا)',
'is' => 'الأيسلاندية',
'is_IS' => 'الأيسلاندية (أيسلندا)',
'it' => 'الإيطالية',
'it_IT' => 'الإيطالية (إيطاليا)',
'it_SM' => 'الإيطالية (سان مارينو)',
'it_CH' => 'الإيطالية (سويسرا)',
'ee' => 'الإيوي',
'ee_TG' => 'الإيوي (توجو)',
'ee_GH' => 'الإيوي (غانا)',
'bm' => 'البامبارا',
'bm_Latn_ML' => 'البامبارا (اللاتينية, مالي)',
'bm_Latn' => 'البامبارا (اللاتينية)',
'pt' => 'البرتغالية',
'pt_BR' => 'البرتغالية (البرازيل)',
'pt_PT' => 'البرتغالية (البرتغال)',
'pt_CV' => 'البرتغالية (الرأس الأخضر)',
'pt_AO' => 'البرتغالية (أنغولا)',
'pt_TL' => 'البرتغالية (تيمور الشرقية)',
'pt_ST' => 'البرتغالية (ساو تومي وبرينسيبي)',
'pt_GW' => 'البرتغالية (غينيا بيساو)',
'pt_MO' => 'البرتغالية (مكاو الصينية (منطقة إدارية خاصة))',
'pt_MZ' => 'البرتغالية (موزمبيق)',
'br' => 'البريتونية',
'br_FR' => 'البريتونية (فرنسا)',
'ps' => 'البشتونية',
'ps_AF' => 'البشتونية (أفغانستان)',
'bg' => 'البلغارية',
'bg_BG' => 'البلغارية (بلغاريا)',
'pa' => 'البنجابية',
'pa_Guru_IN' => 'البنجابية (الجرمخي, الهند)',
'pa_Guru' => 'البنجابية (الجرمخي)',
'pa_Arab_PK' => 'البنجابية (العربية, باكستان)',
'pa_Arab' => 'البنجابية (العربية)',
'pa_IN' => 'البنجابية (الهند)',
'pa_PK' => 'البنجابية (باكستان)',
'bn' => 'البنغالية',
'bn_IN' => 'البنغالية (الهند)',
'bn_BD' => 'البنغالية (بنجلاديش)',
'my' => 'البورمية',
'my_MM' => 'البورمية (ميانمار -بورما)',
'bs' => 'البوسنية',
'bs_BA' => 'البوسنية (البوسنة والهرسك)',
'bs_Cyrl_BA' => 'البوسنية (السيريلية, البوسنة والهرسك)',
'bs_Cyrl' => 'البوسنية (السيريلية)',
'bs_Latn_BA' => 'البوسنية (اللاتينية, البوسنة والهرسك)',
'bs_Latn' => 'البوسنية (اللاتينية)',
'nb' => 'البوكمالية النرويجية',
'nb_NO' => 'البوكمالية النرويجية (النرويج)',
'nb_SJ' => 'البوكمالية النرويجية (سفالبارد وجان مايان)',
'pl' => 'البولندية',
'pl_PL' => 'البولندية (بولندا)',
'be' => 'البيلاروسية',
'be_BY' => 'البيلاروسية (روسيا البيضاء)',
'tl' => 'التاغالوغية',
'tl_PH' => 'التاغالوغية (الفلبين)',
'ta' => 'التاميلية',
'ta_IN' => 'التاميلية (الهند)',
'ta_LK' => 'التاميلية (سريلانكا)',
'ta_SG' => 'التاميلية (سنغافورة)',
'ta_MY' => 'التاميلية (ماليزيا)',
'th' => 'التايلاندية',
'th_TH' => 'التايلاندية (تايلاند)',
'bo' => 'التبتية',
'bo_CN' => 'التبتية (الصين)',
'bo_IN' => 'التبتية (الهند)',
'tr' => 'التركية',
'tr_TR' => 'التركية (تركيا)',
'tr_CY' => 'التركية (قبرص)',
'cs' => 'التشيكية',
'cs_CZ' => 'التشيكية (جمهورية التشيك)',
'to' => 'التونغية',
'to_TO' => 'التونغية (تونغا)',
'ti' => 'التيغرينية',
'ti_ET' => 'التيغرينية (إثيوبيا)',
'ti_ER' => 'التيغرينية (أريتريا)',
'te' => 'التيلجو',
'te_IN' => 'التيلجو (الهند)',
'gl' => 'الجاليكية',
'gl_ES' => 'الجاليكية (إسبانيا)',
'lg' => 'الجاندا',
'lg_UG' => 'الجاندا (أوغندا)',
'ka' => 'الجورجية',
'ka_GE' => 'الجورجية (جورجيا)',
'km' => 'الخميرية',
'km_KH' => 'الخميرية (كمبوديا)',
'da' => 'الدنماركية',
'da_DK' => 'الدنماركية (الدانمرك)',
'da_GL' => 'الدنماركية (غرينلاند)',
'rn' => 'الرندي',
'rn_BI' => 'الرندي (بوروندي)',
'ru' => 'الروسية',
'ru_UA' => 'الروسية (أوكرانيا)',
'ru_BY' => 'الروسية (روسيا البيضاء)',
'ru_RU' => 'الروسية (روسيا)',
'ru_KG' => 'الروسية (قرغيزستان)',
'ru_KZ' => 'الروسية (كازاخستان)',
'ru_MD' => 'الروسية (مولدافيا)',
'rm' => 'الرومانشية',
'rm_CH' => 'الرومانشية (سويسرا)',
'ro' => 'الرومانية',
'ro_RO' => 'الرومانية (رومانيا)',
'ro_MD' => 'الرومانية (مولدافيا)',
'zu' => 'الزولو',
'zu_ZA' => 'الزولو (جنوب أفريقيا)',
'dz' => 'الزونخاية',
'dz_BT' => 'الزونخاية (بوتان)',
'se' => 'السامي الشمالي',
'se_SE' => 'السامي الشمالي (السويد)',
'se_NO' => 'السامي الشمالي (النرويج)',
'se_FI' => 'السامي الشمالي (فنلندا)',
'sg' => 'السانجو',
'sg_CF' => 'السانجو (جمهورية أفريقيا الوسطى)',
'sk' => 'السلوفاكية',
'sk_SK' => 'السلوفاكية (سلوفاكيا)',
'sl' => 'السلوفانية',
'sl_SI' => 'السلوفانية (سلوفينيا)',
'si' => 'السنهالية',
'si_LK' => 'السنهالية (سريلانكا)',
'sw' => 'السواحلية',
'sw_UG' => 'السواحلية (أوغندا)',
'sw_TZ' => 'السواحلية (تانزانيا)',
'sw_KE' => 'السواحلية (كينيا)',
'sv' => 'السويدية',
'sv_SE' => 'السويدية (السويد)',
'sv_AX' => 'السويدية (جزر آلاند)',
'sv_FI' => 'السويدية (فنلندا)',
'ii' => 'السيتشيون يي',
'ii_CN' => 'السيتشيون يي (الصين)',
'sn' => 'الشونا',
'sn_ZW' => 'الشونا (زيمبابوي)',
'sr' => 'الصربية',
'sr_BA' => 'الصربية (البوسنة والهرسك)',
'sr_ME' => 'الصربية (الجبل الأسود)',
'sr_Cyrl_BA' => 'الصربية (السيريلية, البوسنة والهرسك)',
'sr_Cyrl_ME' => 'الصربية (السيريلية, الجبل الأسود)',
'sr_Cyrl_RS' => 'الصربية (السيريلية, صربيا)',
'sr_Cyrl_XK' => 'الصربية (السيريلية, كوسوفو)',
'sr_Cyrl' => 'الصربية (السيريلية)',
'sr_Latn_BA' => 'الصربية (اللاتينية, البوسنة والهرسك)',
'sr_Latn_ME' => 'الصربية (اللاتينية, الجبل الأسود)',
'sr_Latn_RS' => 'الصربية (اللاتينية, صربيا)',
'sr_Latn_XK' => 'الصربية (اللاتينية, كوسوفو)',
'sr_Latn' => 'الصربية (اللاتينية)',
'sr_RS' => 'الصربية (صربيا)',
'sr_XK' => 'الصربية (كوسوفو)',
'so' => 'الصومالية',
'so_ET' => 'الصومالية (إثيوبيا)',
'so_SO' => 'الصومالية (الصومال)',
'so_DJ' => 'الصومالية (جيبوتي)',
'so_KE' => 'الصومالية (كينيا)',
'zh' => 'الصينية',
'zh_Hant_TW' => 'الصينية (التقليدية, تايوان)',
'zh_Hant_MO' => 'الصينية (التقليدية, مكاو الصينية (منطقة إدارية خاصة))',
'zh_Hant_HK' => 'الصينية (التقليدية, هونغ كونغ الصينية)',
'zh_Hant' => 'الصينية (التقليدية)',
'zh_CN' => 'الصينية (الصين)',
'zh_Hans_CN' => 'الصينية (المبسطة, الصين)',
'zh_Hans_SG' => 'الصينية (المبسطة, سنغافورة)',
'zh_Hans_MO' => 'الصينية (المبسطة, مكاو الصينية (منطقة إدارية خاصة))',
'zh_Hans_HK' => 'الصينية (المبسطة, هونغ كونغ الصينية)',
'zh_Hans' => 'الصينية (المبسطة)',
'zh_TW' => 'الصينية (تايوان)',
'zh_SG' => 'الصينية (سنغافورة)',
'zh_MO' => 'الصينية (مكاو الصينية (منطقة إدارية خاصة))',
'zh_HK' => 'الصينية (هونغ كونغ الصينية)',
'he' => 'العبرية',
'he_IL' => 'العبرية (إسرائيل)',
'ar' => 'العربية',
'ar_ER' => 'العربية (أريتريا)',
'ar_IL' => 'العربية (إسرائيل)',
'ar_PS' => 'العربية (الأراضي الفلسطينية)',
'ar_JO' => 'العربية (الأردن)',
'ar_AE' => 'العربية (الإمارات العربية المتحدة)',
'ar_BH' => 'العربية (البحرين)',
'ar_DZ' => 'العربية (الجزائر)',
'ar_SD' => 'العربية (السودان)',
'ar_EH' => 'العربية (الصحراء الغربية)',
'ar_SO' => 'العربية (الصومال)',
'ar_IQ' => 'العربية (العراق)',
'ar_KW' => 'العربية (الكويت)',
'ar_MA' => 'العربية (المغرب)',
'ar_SA' => 'العربية (المملكة العربية السعودية)',
'ar_YE' => 'العربية (اليمن)',
'ar_TD' => 'العربية (تشاد)',
'ar_TN' => 'العربية (تونس)',
'ar_KM' => 'العربية (جزر القمر)',
'ar_SS' => 'العربية (جنوب السودان)',
'ar_DJ' => 'العربية (جيبوتي)',
'ar_SY' => 'العربية (سوريا)',
'ar_OM' => 'العربية (عُمان)',
'ar_QA' => 'العربية (قطر)',
'ar_LB' => 'العربية (لبنان)',
'ar_LY' => 'العربية (ليبيا)',
'ar_EG' => 'العربية (مصر)',
'ar_MR' => 'العربية (موريتانيا)',
'gu' => 'الغوجاراتية',
'gu_IN' => 'الغوجاراتية (الهند)',
'gd' => 'الغيلية الأسكتلندية',
'gd_GB' => 'الغيلية الأسكتلندية (المملكة المتحدة)',
'fa' => 'الفارسية',
'fa_AF' => 'الفارسية (أفغانستان)',
'fa_IR' => 'الفارسية (إيران)',
'fo' => 'الفارويز',
'fo_FO' => 'الفارويز (جزر فارو)',
'fr' => 'الفرنسية',
'fr_GA' => 'الفرنسية (الجابون)',
'fr_DZ' => 'الفرنسية (الجزائر)',
'fr_SN' => 'الفرنسية (السنغال)',
'fr_CM' => 'الفرنسية (الكاميرون)',
'fr_CG' => 'الفرنسية (الكونغو - برازافيل)',
'fr_CD' => 'الفرنسية (الكونغو - كينشاسا)',
'fr_MA' => 'الفرنسية (المغرب)',
'fr_NE' => 'الفرنسية (النيجر)',
'fr_BE' => 'الفرنسية (بلجيكا)',
'fr_BJ' => 'الفرنسية (بنين)',
'fr_BF' => 'الفرنسية (بوركينا فاسو)',
'fr_BI' => 'الفرنسية (بوروندي)',
'fr_PF' => 'الفرنسية (بولينيزيا الفرنسية)',
'fr_TD' => 'الفرنسية (تشاد)',
'fr_TG' => 'الفرنسية (توجو)',
'fr_TN' => 'الفرنسية (تونس)',
'fr_KM' => 'الفرنسية (جزر القمر)',
'fr_WF' => 'الفرنسية (جزر والس وفوتونا)',
'fr_CF' => 'الفرنسية (جمهورية أفريقيا الوسطى)',
'fr_GP' => 'الفرنسية (جوادلوب)',
'fr_DJ' => 'الفرنسية (جيبوتي)',
'fr_RW' => 'الفرنسية (رواندا)',
'fr_RE' => 'الفرنسية (روينيون)',
'fr_CI' => 'الفرنسية (ساحل العاج)',
'fr_BL' => 'الفرنسية (سان بارتليمي)',
'fr_PM' => 'الفرنسية (سانت بيير وميكولون)',
'fr_MF' => 'الفرنسية (سانت مارتن)',
'fr_SY' => 'الفرنسية (سوريا)',
'fr_CH' => 'الفرنسية (سويسرا)',
'fr_SC' => 'الفرنسية (سيشل)',
'fr_GF' => 'الفرنسية (غويانا الفرنسية)',
'fr_GQ' => 'الفرنسية (غينيا الإستوائية)',
'fr_GN' => 'الفرنسية (غينيا)',
'fr_VU' => 'الفرنسية (فانواتو)',
'fr_FR' => 'الفرنسية (فرنسا)',
'fr_NC' => 'الفرنسية (كاليدونيا الجديدة)',
'fr_CA' => 'الفرنسية (كندا)',
'fr_LU' => 'الفرنسية (لوكسمبورغ)',
'fr_MQ' => 'الفرنسية (مارتينيك)',
'fr_ML' => 'الفرنسية (مالي)',
'fr_YT' => 'الفرنسية (مايوت)',
'fr_MG' => 'الفرنسية (مدغشقر)',
'fr_MR' => 'الفرنسية (موريتانيا)',
'fr_MU' => 'الفرنسية (موريشيوس)',
'fr_MC' => 'الفرنسية (موناكو)',
'fr_HT' => 'الفرنسية (هايتي)',
'fy' => 'الفريزيان',
'fy_NL' => 'الفريزيان (هولندا)',
'ff' => 'الفلة',
'ff_SN' => 'الفلة (السنغال)',
'ff_CM' => 'الفلة (الكاميرون)',
'ff_GN' => 'الفلة (غينيا)',
'ff_MR' => 'الفلة (موريتانيا)',
'fi' => 'الفنلندية',
'fi_FI' => 'الفنلندية (فنلندا)',
'vi' => 'الفيتنامية',
'vi_VN' => 'الفيتنامية (فيتنام)',
'kk' => 'الكازاخستانية',
'kk_Cyrl_KZ' => 'الكازاخستانية (السيريلية, كازاخستان)',
'kk_Cyrl' => 'الكازاخستانية (السيريلية)',
'kk_KZ' => 'الكازاخستانية (كازاخستان)',
'kl' => 'الكالاليست',
'kl_GL' => 'الكالاليست (غرينلاند)',
'kn' => 'الكانادية',
'kn_IN' => 'الكانادية (الهند)',
'ca' => 'الكتالانية',
'ca_ES' => 'الكتالانية (إسبانيا)',
'ca_AD' => 'الكتالانية (أندورا)',
'ca_IT' => 'الكتالانية (إيطاليا)',
'ca_FR' => 'الكتالانية (فرنسا)',
'hr' => 'الكرواتية',
'hr_BA' => 'الكرواتية (البوسنة والهرسك)',
'hr_HR' => 'الكرواتية (كرواتيا)',
'ks' => 'الكشميرية',
'ks_Arab_IN' => 'الكشميرية (العربية, الهند)',
'ks_Arab' => 'الكشميرية (العربية)',
'ks_IN' => 'الكشميرية (الهند)',
'kw' => 'الكورنية',
'kw_GB' => 'الكورنية (المملكة المتحدة)',
'ko' => 'الكورية',
'ko_KR' => 'الكورية (كوريا الجنوبية)',
'ko_KP' => 'الكورية (كوريا الشمالية)',
'qu' => 'الكويتشوا',
'qu_EC' => 'الكويتشوا (الإكوادور)',
'qu_BO' => 'الكويتشوا (بوليفيا)',
'qu_PE' => 'الكويتشوا (بيرو)',
'ky' => 'الكيرغزستانية',
'ky_Cyrl_KG' => 'الكيرغزستانية (السيريلية, قرغيزستان)',
'ky_Cyrl' => 'الكيرغزستانية (السيريلية)',
'ky_KG' => 'الكيرغزستانية (قرغيزستان)',
'ki' => 'الكيكيو',
'ki_KE' => 'الكيكيو (كينيا)',
'rw' => 'الكينيارواندا',
'rw_RW' => 'الكينيارواندا (رواندا)',
'lv' => 'اللاتفية',
'lv_LV' => 'اللاتفية (لاتفيا)',
'lo' => 'اللاوية',
'lo_LA' => 'اللاوية (لاوس)',
'lu' => 'اللبا-كاتانجا',
'lu_CD' => 'اللبا-كاتانجا (الكونغو - كينشاسا)',
'lt' => 'اللتوانية',
'lt_LT' => 'اللتوانية (ليتوانيا)',
'lb' => 'اللوكسمبرجية',
'lb_LU' => 'اللوكسمبرجية (لوكسمبورغ)',
'ln' => 'اللينجالا',
'ln_CG' => 'اللينجالا (الكونغو - برازافيل)',
'ln_CD' => 'اللينجالا (الكونغو - كينشاسا)',
'ln_AO' => 'اللينجالا (أنغولا)',
'ln_CF' => 'اللينجالا (جمهورية أفريقيا الوسطى)',
'mr' => 'الماراثية',
'mr_IN' => 'الماراثية (الهند)',
'mg' => 'المالاجاشية',
'mg_MG' => 'المالاجاشية (مدغشقر)',
'mt' => 'المالطية',
'mt_MT' => 'المالطية (مالطا)',
'ml' => 'الماليالام',
'ml_IN' => 'الماليالام (الهند)',
'mk' => 'المقدونية',
'mk_MK' => 'المقدونية (مقدونيا)',
'mn' => 'المنغولية',
'mn_Cyrl_MN' => 'المنغولية (السيريلية, منغوليا)',
'mn_Cyrl' => 'المنغولية (السيريلية)',
'mn_MN' => 'المنغولية (منغوليا)',
'gv' => 'المنكية',
'gv_IM' => 'المنكية (جزيرة مان)',
'nd' => 'النديبيل الشمالي',
'nd_ZW' => 'النديبيل الشمالي (زيمبابوي)',
'no' => 'النرويجية',
'no_NO' => 'النرويجية (النرويج)',
'ne' => 'النيبالية',
'ne_IN' => 'النيبالية (الهند)',
'ne_NP' => 'النيبالية (نيبال)',
'nn' => 'النينورسك النرويجي',
'nn_NO' => 'النينورسك النرويجي (النرويج)',
'hi' => 'الهندية',
'hi_IN' => 'الهندية (الهند)',
'hu' => 'الهنغارية',
'hu_HU' => 'الهنغارية (هنغاريا)',
'ha' => 'الهوسا',
'ha_Latn_NE' => 'الهوسا (اللاتينية, النيجر)',
'ha_Latn_GH' => 'الهوسا (اللاتينية, غانا)',
'ha_Latn_NG' => 'الهوسا (اللاتينية, نيجيريا)',
'ha_Latn' => 'الهوسا (اللاتينية)',
'ha_NE' => 'الهوسا (النيجر)',
'ha_GH' => 'الهوسا (غانا)',
'ha_NG' => 'الهوسا (نيجيريا)',
'nl' => 'الهولندية',
'nl_AW' => 'الهولندية (آروبا)',
'nl_BE' => 'الهولندية (بلجيكا)',
'nl_SR' => 'الهولندية (سورينام)',
'nl_SX' => 'الهولندية (سينت مارتن)',
'nl_CW' => 'الهولندية (كوراساو)',
'nl_BQ' => 'الهولندية (هولندا الكاريبية)',
'nl_NL' => 'الهولندية (هولندا)',
'cy' => 'الولشية',
'cy_GB' => 'الولشية (المملكة المتحدة)',
'ja' => 'اليابانية',
'ja_JP' => 'اليابانية (اليابان)',
'yi' => 'اليديشية',
'yo' => 'اليوروبية',
'yo_BJ' => 'اليوروبية (بنين)',
'yo_NG' => 'اليوروبية (نيجيريا)',
'el' => 'اليونانية',
'el_GR' => 'اليونانية (اليونان)',
'el_CY' => 'اليونانية (قبرص)',
'sh' => 'صربية-كرواتية',
'sh_BA' => 'صربية-كرواتية (البوسنة والهرسك)',
'eu' => 'لغة الباسك',
'eu_ES' => 'لغة الباسك (إسبانيا)',
'ms' => 'لغة الملايو',
'ms_Latn_BN' => 'لغة الملايو (اللاتينية, بروناي)',
'ms_Latn_SG' => 'لغة الملايو (اللاتينية, سنغافورة)',
'ms_Latn_MY' => 'لغة الملايو (اللاتينية, ماليزيا)',
'ms_Latn' => 'لغة الملايو (اللاتينية)',
'ms_BN' => 'لغة الملايو (بروناي)',
'ms_SG' => 'لغة الملايو (سنغافورة)',
'ms_MY' => 'لغة الملايو (ماليزيا)',
); |
layout: blank
description: Head of Software Development based out of Manchester, UK.
<script src="https://f.convertkit.com/ckjs/ck.5.js"></script>
<div class="container">
<div class="row">
<div class="mt-3 col-12 col-md-8 offset-md-2">
<div class="text-center mx-auto">
<img class="img-fluid mb-3" src="/assets/images/small_headshot_v2.png" width="80">
<h2 class="font-weight-bold text-center d-block">Subscription confirmed</h2>
<p>Look out for the first email dropping in your inbox shortly.</p>
</div>
<div class="footer navbar-fixed-bottom">
<hr />
<div class="text-center">
<a class="<API key> border-0" href="https://twitter.com/joshua_hornby" target="_blank">
<img loading="lazy" width="14" class="d-inline-block" src="/assets/images/twitter.svg" alt="Twitter Logo"/>
</a>
<a class="<API key> border-0" href="https:
<img loading="lazy" width="14" class="d-inline-block" src="/assets/images/linkedin.svg" alt="Linkedin Logo"/>
</a>
</div>
</div>
</div>
</div>
</div> |
package ch.heigvd.quaris.api.dto;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* ErrorDTO
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2017-01-25T15:44:32.358+01:00")
public class ErrorDTO {
private Integer code = null;
private String message = null;
public ErrorDTO code(Integer code) {
this.code = code;
return this;
}
/**
* Get code
* @return code
**/
@ApiModelProperty(value = "")
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public ErrorDTO message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ErrorDTO errorDTO = (ErrorDTO) o;
return Objects.equals(this.code, errorDTO.code) &&
Objects.equals(this.message, errorDTO.message);
}
@Override
public int hashCode() {
return Objects.hash(code, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ErrorDTO {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
} |
namespace NUnit.Engine.Internal.FileSystemAccess
{
<summary>
Abstraction of a file-system.
</summary>
// TODO: Temporarily public
public interface IFileSystem
{
<summary>
Checks whether a directory exists or not.
</summary>
<param name="directory">Directory to check.</param>
<returns><see langword="true"/> if <paramref name="directory"/> points to an existing directory; <see langword="false"/> otherwhise.</returns>
<exception cref="System.<API key>"><paramref name="directory"/> is <see langword="null"/>.</exception>
bool Exists(IDirectory directory);
<summary>
Checks whether a file exists or not.
</summary>
<param name="file">File to check.</param>
<returns><see langword="true"/> if <paramref name="file"/> points to an existing file; <see langword="false"/> otherwhise.</returns>
<exception cref="System.<API key>"><paramref name="file"/> is <see langword="null"/>.</exception>
bool Exists(IFile file);
<summary>
Creates a <see cref="IDirectory"/> that points to an existing directory.
</summary>
<param name="path">Path of the directory.</param>
<returns>An object representing the file-system entry located at <paramref name="path"/>.</returns>
<exception cref="System.Security.SecurityException">The caller does not have the required permission.</exception>
<exception cref="System.<API key>"><paramref name="path"/> is <see langword="null"/>.</exception>
<exception cref="System.ArgumentException"><paramref name="path"/> is empty or contains invalid characters (see <see cref="SIO.Path.InvalidPathChars"/> for details).</exception>
<exception cref="System.IO.<API key>"><paramref name="path"/> points to a non-existing directory.</exception>
<exception cref="System.IO.<API key>">The specified path exceeds the system-defined maximum length.</exception>
IDirectory GetDirectory(string path);
<summary>
Creates a <see cref="IFile"/> that points to an existing file.
</summary>
<param name="path">Path of the file.</param>
<returns>An object representing the file-system entry located at <paramref name="path"/>.</returns>
<exception cref="System.Security.SecurityException">The caller does not have the required permission.</exception>
<exception cref="System.<API key>"><paramref name="path"/> is <see langword="null"/>.</exception>
<exception cref="System.ArgumentException"><paramref name="path"/> is empty, contains no file-name or contains invalid characters (see <see cref="SIO.Path.<API key>"/> for details).</exception>
<exception cref="System.IO.<API key>">The specified path exceeds the system-defined maximum length.</exception>
<exception cref="System.Un<API key>>Access to <paramref name="path"/> is denied.</exception>
<exception cref="System.<API key>"><paramref name="path"/> contains a colon (:) in the middle of the string.</exception>
<exception cref="System.IO.<API key>"><paramref name="path"/> points to a non-existing directory.</exception>
IFile GetFile(string path);
}
} |
#pragma once
#ifdef WRQ_REACTOR_MOUDLE
#define DLLIMPEXP __declspec(dllexport)
#else
#define DLLIMPEXP
#endif
#include "acdocman.h"
class /*DLLIMPEXP*/ CBaseDocReactor : public <API key> {
public:
<API key>(CBaseDocReactor) ;
protected:
bool <API key> ;
public:
CBaseDocReactor (const bool autoInitAndRelease =true) ;
virtual ~CBaseDocReactor () ;
virtual void Attach () ;
virtual void Detach () ;
virtual AcApDocManager *Subject () const ;
virtual bool IsAttached () const ;
virtual void <API key>(AcApDocument* pDocCreating);
// Fired when a document has been successfully created replaces kLoadDwgMsg.
virtual void documentCreated(AcApDocument* pDocCreating);
// Fired when a document is about to be destroyed replaces kUnloadDwgMsg
virtual void <API key>(AcApDocument* pDocToDestroy);
// Fired when a document is completely destroyed
virtual void documentDestroyed(const ACHAR* fileName);
// Fired when a user action has cancelled a documents creation.
// Only fired in MDI mode and after a <API key>
virtual void <API key>(AcApDocument* pDocCreateCancelled);
virtual void <API key>(AcApDocument * param2, AcAp::DocLockMode myCurrentMode, AcAp::DocLockMode myNewMode, AcAp::DocLockMode currentMode, const ACHAR * pGlobalCmdName);
virtual void <API key>(AcApDocument * param2);
virtual void <API key>(AcApDocument * pActivatingDoc);
virtual void <API key>(AcApDocument * pDeActivatedDoc);
virtual void <API key>(bool bActivation);
virtual void documentActivated(AcApDocument * pActivatedDoc);
protected:
Acad::ErrorStatus veto(void);
} ;
#ifdef WRQ_REACTOR_MOUDLE
<API key>(CBaseDocReactor)
#endif |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v2/enums/<API key>.proto
package enums
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.<API key> // please upgrade the proto package
// Enum describing possible user list number rule item operators.
type <API key> int32
const (
// Not specified.
<API key> <API key> = 0
// Used for return value only. Represents value unknown in this version.
<API key> <API key> = 1
// Greater than.
<API key> <API key> = 2
// Greater than or equal.
<API key> <API key> = 3
// Equals.
<API key> <API key> = 4
// Not equals.
<API key> <API key> = 5
// Less than.
<API key> <API key> = 6
// Less than or equal.
<API key> <API key> = 7
)
var <API key> = map[int32]string{
0: "UNSPECIFIED",
1: "UNKNOWN",
2: "GREATER_THAN",
3: "<API key>",
4: "EQUALS",
5: "NOT_EQUALS",
6: "LESS_THAN",
7: "LESS_THAN_OR_EQUAL",
}
var <API key> = map[string]int32{
"UNSPECIFIED": 0,
"UNKNOWN": 1,
"GREATER_THAN": 2,
"<API key>": 3,
"EQUALS": 4,
"NOT_EQUALS": 5,
"LESS_THAN": 6,
"LESS_THAN_OR_EQUAL": 7,
}
func (x <API key>) String() string {
return proto.EnumName(<API key>, int32(x))
}
func (<API key>) EnumDescriptor() ([]byte, []int) {
return <API key>, []int{0, 0}
}
// Supported rule operator for number type.
type <API key> struct {
<API key> struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *<API key>) Reset() { *m = <API key>{} }
func (m *<API key>) String() string { return proto.CompactTextString(m) }
func (*<API key>) ProtoMessage() {}
func (*<API key>) Descriptor() ([]byte, []int) {
return <API key>, []int{0}
}
func (m *<API key>) XXX_Unmarshal(b []byte) error {
return <API key>.Unmarshal(m, b)
}
func (m *<API key>) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return <API key>.Marshal(b, m, deterministic)
}
func (m *<API key>) XXX_Merge(src proto.Message) {
<API key>.Merge(m, src)
}
func (m *<API key>) XXX_Size() int {
return <API key>.Size(m)
}
func (m *<API key>) XXX_DiscardUnknown() {
<API key>.DiscardUnknown(m)
}
var <API key> proto.InternalMessageInfo
func init() {
proto.RegisterEnum("google.ads.googleads.v2.enums.<API key>", <API key>, <API key>)
proto.RegisterType((*<API key>)(nil), "google.ads.googleads.v2.enums.<API key>")
}
func init() {
proto.RegisterFile("google/ads/googleads/v2/enums/<API key>.proto", <API key>)
}
var <API key> = []byte{
// 379 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xcd, 0xae, 0x93, 0x40,
0x14, 0xc7, 0x85, 0x6a, 0x1b, 0xa7, 0x7e, 0x90, 0x49, 0x34, 0xd1, 0x58, 0x93, 0xd6, 0xfd, 0x90,
0xe0, 0x6e, 0x5c, 0x4d, 0x15, 0xb1, 0xb1, 0x81, 0x0a, 0xa5, 0x26, 0x86, 0x64, 0x42, 0x65, 0x42,
0x48, 0x60, 0x86, 0xcc, 0x0c, 0x7d, 0x20, 0x97, 0x2e, 0x7c, 0x10, 0xf7, 0xbe, 0x84, 0x4f, 0xe0,
0xd2, 0x30, 0xb4, 0xdc, 0xbb, 0xb9, 0xdd, 0x90, 0xff, 0xf9, 0xfa, 0x1d, 0xe6, 0x7f, 0x40, 0x50,
0x0a, 0x51, 0xd6, 0xcc, 0xcd, 0x0b, 0xe5, 0x0e, 0xb2, 0x57, 0x27, 0xcf, 0x65, 0xbc, 0x6b, 0x94,
0xdb, 0x29, 0x26, 0x69, 0x5d, 0x29, 0x4d, 0x79, 0xd7, 0x1c, 0x99, 0xa4, 0xb2, 0xab, 0x19, 0xad,
0x34, 0x6b, 0xa8, 0x68, 0x99, 0xcc, 0xb5, 0x90, 0xa8, 0x95, 0x42, 0x0b, 0xb8, 0x18, 0xa6, 0x51,
0x5e, 0x28, 0x34, 0x82, 0xd0, 0xc9, 0x43, 0x06, 0xf4, 0xf2, 0xd5, 0x65, 0x4f, 0x5b, 0xb9, 0x39,
0xe7, 0x42, 0xe7, 0xba, 0x12, 0x5c, 0x0d, 0xc3, 0xab, 0x3f, 0x16, 0x58, 0xa5, 0x8a, 0xc9, 0x6d,
0xa5, 0x74, 0x68, 0x16, 0xc5, 0x5d, 0xcd, 0x36, 0x9a, 0x35, 0xd1, 0x79, 0x8b, 0xcf, 0xbb, 0x66,
0xf5, 0xcb, 0x02, 0xaf, 0xaf, 0xb7, 0xc1, 0xa7, 0x60, 0x9e, 0x86, 0xc9, 0xce, 0x7f, 0xbf, 0xf9,
0xb8, 0xf1, 0x3f, 0x38, 0xf7, 0xe0, 0x1c, 0xcc, 0xd2, 0xf0, 0x73, 0x18, 0x7d, 0x0d, 0x1d, 0x0b,
0x3a, 0xe0, 0x51, 0x10, 0xfb, 0x64, 0xef, 0xc7, 0x74, 0xff, 0x89, 0x84, 0x8e, 0x0d, 0x5f, 0x80,
0x67, 0xb7, 0x33, 0x34, 0x8a, 0xa9, 0xff, 0x25, 0x25, 0x5b, 0x67, 0x02, 0x01, 0x98, 0x1a, 0x99,
0x38, 0xf7, 0xe1, 0x13, 0x00, 0xc2, 0x68, 0x4f, 0xcf, 0xf1, 0x03, 0xf8, 0x18, 0x3c, 0xdc, 0xfa,
0x49, 0x32, 0x50, 0xa6, 0xf0, 0x39, 0x80, 0x63, 0x78, 0x83, 0x98, 0xad, 0xff, 0x59, 0x60, 0xf9,
0x5d, 0x34, 0xe8, 0xaa, 0x37, 0xeb, 0x37, 0xd7, 0xdf, 0xb4, 0xeb, 0x2d, 0xda, 0x59, 0xdf, 0xd6,
0x67, 0x4a, 0x29, 0xea, 0x9c, 0x97, 0x48, 0xc8, 0xd2, 0x2d, 0x19, 0x37, 0x06, 0x5e, 0x4e, 0xd7,
0x56, 0xea, 0x8e, 0x4b, 0xbe, 0x33, 0xdf, 0x1f, 0xf6, 0x24, 0x20, 0xe4, 0xa7, 0xbd, 0x08, 0x06,
0x14, 0x29, 0x14, 0x1a, 0x64, 0xaf, 0x0e, 0x1e, 0xea, 0x6d, 0x56, 0xbf, 0x2f, 0xf5, 0x8c, 0x14,
0x2a, 0x1b, 0xeb, 0xd9, 0xc1, 0xcb, 0x4c, 0xfd, 0xaf, 0xbd, 0x1c, 0x92, 0x18, 0x93, 0x42, 0x61,
0x3c, 0x76, 0x60, 0x7c, 0xf0, 0x30, 0x36, 0x3d, 0xc7, 0xa9, 0xf9, 0xb1, 0xb7, 0xff, 0x03, 0x00,
0x00, 0xff, 0xff, 0xff, 0x63, 0x34, 0x3a, 0x61, 0x02, 0x00, 0x00,
} |
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot?v=4.6.3');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-<API key>: antialiased;
-<API key>: grayscale;
}
/* makes the font 33% larger relative to the icon container */
.fa-lg {
font-size: 1.33333333em;
line-height: 0.75em;
vertical-align: -15%;
}
.fa-2x {
font-size: 2em;
}
.fa-3x {
font-size: 3em;
}
.fa-4x {
font-size: 4em;
}
.fa-5x {
font-size: 5em;
}
.fa-fw {
width: 1.28571429em;
text-align: center;
}
.fa-ul {
padding-left: 0;
margin-left: 2.14285714em;
list-style-type: none;
}
.fa-ul > li {
position: relative;
}
.fa-li {
position: absolute;
left: -2.14285714em;
width: 2.14285714em;
top: 0.14285714em;
text-align: center;
}
.fa-li.fa-lg {
left: -1.85714286em;
}
.fa-border {
padding: .2em .25em .15em;
border: solid 0.08em #eee;
border-radius: .1em;
}
.fa-pull-left {
float: left;
}
.fa-pull-right {
float: right;
}
.fa.fa-pull-left {
margin-right: .3em;
}
.fa.fa-pull-right {
margin-left: .3em;
}
/* Deprecated as of 4.4.0 */
.pull-right {
float: right;
}
.pull-left {
float: left;
}
.fa.pull-left {
margin-right: .3em;
}
.fa.pull-right {
margin-left: .3em;
}
.fa-spin {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
.fa-pulse {
-webkit-animation: fa-spin 1s infinite steps(8);
animation: fa-spin 1s infinite steps(8);
}
@-webkit-keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
.fa-rotate-90 {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
.fa-rotate-180 {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
.fa-rotate-270 {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
}
.fa-flip-horizontal {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
-webkit-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.fa-flip-vertical {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
-webkit-transform: scale(1, -1);
-ms-transform: scale(1, -1);
transform: scale(1, -1);
}
:root .fa-rotate-90,
:root .fa-rotate-180,
:root .fa-rotate-270,
:root .fa-flip-horizontal,
:root .fa-flip-vertical {
filter: none;
}
.fa-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.fa-stack-1x,
.fa-stack-2x {
position: absolute;
left: 0;
width: 100%;
text-align: center;
}
.fa-stack-1x {
line-height: inherit;
}
.fa-stack-2x {
font-size: 2em;
}
.fa-inverse {
color: #fff;
}
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons */
.fa-glass:before {
content: "\f000";
}
.fa-music:before {
content: "\f001";
}
.fa-search:before {
content: "\f002";
}
.fa-envelope-o:before {
content: "\f003";
}
.fa-heart:before {
content: "\f004";
}
.fa-star:before {
content: "\f005";
}
.fa-star-o:before {
content: "\f006";
}
.fa-user:before {
content: "\f007";
}
.fa-film:before {
content: "\f008";
}
.fa-th-large:before {
content: "\f009";
}
.fa-th:before {
content: "\f00a";
}
.fa-th-list:before {
content: "\f00b";
}
.fa-check:before {
content: "\f00c";
}
.fa-remove:before,
.fa-close:before,
.fa-times:before {
content: "\f00d";
}
.fa-search-plus:before {
content: "\f00e";
}
.fa-search-minus:before {
content: "\f010";
}
.fa-power-off:before {
content: "\f011";
}
.fa-signal:before {
content: "\f012";
}
.fa-gear:before,
.fa-cog:before {
content: "\f013";
}
.fa-trash-o:before {
content: "\f014";
}
.fa-home:before {
content: "\f015";
}
.fa-file-o:before {
content: "\f016";
}
.fa-clock-o:before {
content: "\f017";
}
.fa-road:before {
content: "\f018";
}
.fa-download:before {
content: "\f019";
}
.<API key>:before {
content: "\f01a";
}
.<API key>:before {
content: "\f01b";
}
.fa-inbox:before {
content: "\f01c";
}
.fa-play-circle-o:before {
content: "\f01d";
}
.fa-rotate-right:before,
.fa-repeat:before {
content: "\f01e";
}
.fa-refresh:before {
content: "\f021";
}
.fa-list-alt:before {
content: "\f022";
}
.fa-lock:before {
content: "\f023";
}
.fa-flag:before {
content: "\f024";
}
.fa-headphones:before {
content: "\f025";
}
.fa-volume-off:before {
content: "\f026";
}
.fa-volume-down:before {
content: "\f027";
}
.fa-volume-up:before {
content: "\f028";
}
.fa-qrcode:before {
content: "\f029";
}
.fa-barcode:before {
content: "\f02a";
}
.fa-tag:before {
content: "\f02b";
}
.fa-tags:before {
content: "\f02c";
}
.fa-book:before {
content: "\f02d";
}
.fa-bookmark:before {
content: "\f02e";
}
.fa-print:before {
content: "\f02f";
}
.fa-camera:before {
content: "\f030";
}
.fa-font:before {
content: "\f031";
}
.fa-bold:before {
content: "\f032";
}
.fa-italic:before {
content: "\f033";
}
.fa-text-height:before {
content: "\f034";
}
.fa-text-width:before {
content: "\f035";
}
.fa-align-left:before {
content: "\f036";
}
.fa-align-center:before {
content: "\f037";
}
.fa-align-right:before {
content: "\f038";
}
.fa-align-justify:before {
content: "\f039";
}
.fa-list:before {
content: "\f03a";
}
.fa-dedent:before,
.fa-outdent:before {
content: "\f03b";
}
.fa-indent:before {
content: "\f03c";
}
.fa-video-camera:before {
content: "\f03d";
}
.fa-photo:before,
.fa-image:before,
.fa-picture-o:before {
content: "\f03e";
}
.fa-pencil:before {
content: "\f040";
}
.fa-map-marker:before {
content: "\f041";
}
.fa-adjust:before {
content: "\f042";
}
.fa-tint:before {
content: "\f043";
}
.fa-edit:before,
.fa-pencil-square-o:before {
content: "\f044";
}
.fa-share-square-o:before {
content: "\f045";
}
.fa-check-square-o:before {
content: "\f046";
}
.fa-arrows:before {
content: "\f047";
}
.fa-step-backward:before {
content: "\f048";
}
.fa-fast-backward:before {
content: "\f049";
}
.fa-backward:before {
content: "\f04a";
}
.fa-play:before {
content: "\f04b";
}
.fa-pause:before {
content: "\f04c";
}
.fa-stop:before {
content: "\f04d";
}
.fa-forward:before {
content: "\f04e";
}
.fa-fast-forward:before {
content: "\f050";
}
.fa-step-forward:before {
content: "\f051";
}
.fa-eject:before {
content: "\f052";
}
.fa-chevron-left:before {
content: "\f053";
}
.fa-chevron-right:before {
content: "\f054";
}
.fa-plus-circle:before {
content: "\f055";
}
.fa-minus-circle:before {
content: "\f056";
}
.fa-times-circle:before {
content: "\f057";
}
.fa-check-circle:before {
content: "\f058";
}
.fa-question-circle:before {
content: "\f059";
}
.fa-info-circle:before {
content: "\f05a";
}
.fa-crosshairs:before {
content: "\f05b";
}
.fa-times-circle-o:before {
content: "\f05c";
}
.fa-check-circle-o:before {
content: "\f05d";
}
.fa-ban:before {
content: "\f05e";
}
.fa-arrow-left:before {
content: "\f060";
}
.fa-arrow-right:before {
content: "\f061";
}
.fa-arrow-up:before {
content: "\f062";
}
.fa-arrow-down:before {
content: "\f063";
}
.fa-mail-forward:before,
.fa-share:before {
content: "\f064";
}
.fa-expand:before {
content: "\f065";
}
.fa-compress:before {
content: "\f066";
}
.fa-plus:before {
content: "\f067";
}
.fa-minus:before {
content: "\f068";
}
.fa-asterisk:before {
content: "\f069";
}
.<API key>:before {
content: "\f06a";
}
.fa-gift:before {
content: "\f06b";
}
.fa-leaf:before {
content: "\f06c";
}
.fa-fire:before {
content: "\f06d";
}
.fa-eye:before {
content: "\f06e";
}
.fa-eye-slash:before {
content: "\f070";
}
.fa-warning:before,
.<API key>:before {
content: "\f071";
}
.fa-plane:before {
content: "\f072";
}
.fa-calendar:before {
content: "\f073";
}
.fa-random:before {
content: "\f074";
}
.fa-comment:before {
content: "\f075";
}
.fa-magnet:before {
content: "\f076";
}
.fa-chevron-up:before {
content: "\f077";
}
.fa-chevron-down:before {
content: "\f078";
}
.fa-retweet:before {
content: "\f079";
}
.fa-shopping-cart:before {
content: "\f07a";
}
.fa-folder:before {
content: "\f07b";
}
.fa-folder-open:before {
content: "\f07c";
}
.fa-arrows-v:before {
content: "\f07d";
}
.fa-arrows-h:before {
content: "\f07e";
}
.fa-bar-chart-o:before,
.fa-bar-chart:before {
content: "\f080";
}
.fa-twitter-square:before {
content: "\f081";
}
.fa-facebook-square:before {
content: "\f082";
}
.fa-camera-retro:before {
content: "\f083";
}
.fa-key:before {
content: "\f084";
}
.fa-gears:before,
.fa-cogs:before {
content: "\f085";
}
.fa-comments:before {
content: "\f086";
}
.fa-thumbs-o-up:before {
content: "\f087";
}
.fa-thumbs-o-down:before {
content: "\f088";
}
.fa-star-half:before {
content: "\f089";
}
.fa-heart-o:before {
content: "\f08a";
}
.fa-sign-out:before {
content: "\f08b";
}
.fa-linkedin-square:before {
content: "\f08c";
}
.fa-thumb-tack:before {
content: "\f08d";
}
.fa-external-link:before {
content: "\f08e";
}
.fa-sign-in:before {
content: "\f090";
}
.fa-trophy:before {
content: "\f091";
}
.fa-github-square:before {
content: "\f092";
}
.fa-upload:before {
content: "\f093";
}
.fa-lemon-o:before {
content: "\f094";
}
.fa-phone:before {
content: "\f095";
}
.fa-square-o:before {
content: "\f096";
}
.fa-bookmark-o:before {
content: "\f097";
}
.fa-phone-square:before {
content: "\f098";
}
.fa-twitter:before {
content: "\f099";
}
.fa-facebook-f:before,
.fa-facebook:before {
content: "\f09a";
}
.fa-github:before {
content: "\f09b";
}
.fa-unlock:before {
content: "\f09c";
}
.fa-credit-card:before {
content: "\f09d";
}
.fa-feed:before,
.fa-rss:before {
content: "\f09e";
}
.fa-hdd-o:before {
content: "\f0a0";
}
.fa-bullhorn:before {
content: "\f0a1";
}
.fa-bell:before {
content: "\f0f3";
}
.fa-certificate:before {
content: "\f0a3";
}
.fa-hand-o-right:before {
content: "\f0a4";
}
.fa-hand-o-left:before {
content: "\f0a5";
}
.fa-hand-o-up:before {
content: "\f0a6";
}
.fa-hand-o-down:before {
content: "\f0a7";
}
.<API key>:before {
content: "\f0a8";
}
.<API key>:before {
content: "\f0a9";
}
.fa-arrow-circle-up:before {
content: "\f0aa";
}
.<API key>:before {
content: "\f0ab";
}
.fa-globe:before {
content: "\f0ac";
}
.fa-wrench:before {
content: "\f0ad";
}
.fa-tasks:before {
content: "\f0ae";
}
.fa-filter:before {
content: "\f0b0";
}
.fa-briefcase:before {
content: "\f0b1";
}
.fa-arrows-alt:before {
content: "\f0b2";
}
.fa-group:before,
.fa-users:before {
content: "\f0c0";
}
.fa-chain:before,
.fa-link:before {
content: "\f0c1";
}
.fa-cloud:before {
content: "\f0c2";
}
.fa-flask:before {
content: "\f0c3";
}
.fa-cut:before,
.fa-scissors:before {
content: "\f0c4";
}
.fa-copy:before,
.fa-files-o:before {
content: "\f0c5";
}
.fa-paperclip:before {
content: "\f0c6";
}
.fa-save:before,
.fa-floppy-o:before {
content: "\f0c7";
}
.fa-square:before {
content: "\f0c8";
}
.fa-navicon:before,
.fa-reorder:before,
.fa-bars:before {
content: "\f0c9";
}
.fa-list-ul:before {
content: "\f0ca";
}
.fa-list-ol:before {
content: "\f0cb";
}
.fa-strikethrough:before {
content: "\f0cc";
}
.fa-underline:before {
content: "\f0cd";
}
.fa-table:before {
content: "\f0ce";
}
.fa-magic:before {
content: "\f0d0";
}
.fa-truck:before {
content: "\f0d1";
}
.fa-pinterest:before {
content: "\f0d2";
}
.fa-pinterest-square:before {
content: "\f0d3";
}
.<API key>:before {
content: "\f0d4";
}
.fa-google-plus:before {
content: "\f0d5";
}
.fa-money:before {
content: "\f0d6";
}
.fa-caret-down:before {
content: "\f0d7";
}
.fa-caret-up:before {
content: "\f0d8";
}
.fa-caret-left:before {
content: "\f0d9";
}
.fa-caret-right:before {
content: "\f0da";
}
.fa-columns:before {
content: "\f0db";
}
.fa-unsorted:before,
.fa-sort:before {
content: "\f0dc";
}
.fa-sort-down:before,
.fa-sort-desc:before {
content: "\f0dd";
}
.fa-sort-up:before,
.fa-sort-asc:before {
content: "\f0de";
}
.fa-envelope:before {
content: "\f0e0";
}
.fa-linkedin:before {
content: "\f0e1";
}
.fa-rotate-left:before,
.fa-undo:before {
content: "\f0e2";
}
.fa-legal:before,
.fa-gavel:before {
content: "\f0e3";
}
.fa-dashboard:before,
.fa-tachometer:before {
content: "\f0e4";
}
.fa-comment-o:before {
content: "\f0e5";
}
.fa-comments-o:before {
content: "\f0e6";
}
.fa-flash:before,
.fa-bolt:before {
content: "\f0e7";
}
.fa-sitemap:before {
content: "\f0e8";
}
.fa-umbrella:before {
content: "\f0e9";
}
.fa-paste:before,
.fa-clipboard:before {
content: "\f0ea";
}
.fa-lightbulb-o:before {
content: "\f0eb";
}
.fa-exchange:before {
content: "\f0ec";
}
.fa-cloud-download:before {
content: "\f0ed";
}
.fa-cloud-upload:before {
content: "\f0ee";
}
.fa-user-md:before {
content: "\f0f0";
}
.fa-stethoscope:before {
content: "\f0f1";
}
.fa-suitcase:before {
content: "\f0f2";
}
.fa-bell-o:before {
content: "\f0a2";
}
.fa-coffee:before {
content: "\f0f4";
}
.fa-cutlery:before {
content: "\f0f5";
}
.fa-file-text-o:before {
content: "\f0f6";
}
.fa-building-o:before {
content: "\f0f7";
}
.fa-hospital-o:before {
content: "\f0f8";
}
.fa-ambulance:before {
content: "\f0f9";
}
.fa-medkit:before {
content: "\f0fa";
}
.fa-fighter-jet:before {
content: "\f0fb";
}
.fa-beer:before {
content: "\f0fc";
}
.fa-h-square:before {
content: "\f0fd";
}
.fa-plus-square:before {
content: "\f0fe";
}
.<API key>:before {
content: "\f100";
}
.<API key>:before {
content: "\f101";
}
.fa-angle-double-up:before {
content: "\f102";
}
.<API key>:before {
content: "\f103";
}
.fa-angle-left:before {
content: "\f104";
}
.fa-angle-right:before {
content: "\f105";
}
.fa-angle-up:before {
content: "\f106";
}
.fa-angle-down:before {
content: "\f107";
}
.fa-desktop:before {
content: "\f108";
}
.fa-laptop:before {
content: "\f109";
}
.fa-tablet:before {
content: "\f10a";
}
.fa-mobile-phone:before,
.fa-mobile:before {
content: "\f10b";
}
.fa-circle-o:before {
content: "\f10c";
}
.fa-quote-left:before {
content: "\f10d";
}
.fa-quote-right:before {
content: "\f10e";
}
.fa-spinner:before {
content: "\f110";
}
.fa-circle:before {
content: "\f111";
}
.fa-mail-reply:before,
.fa-reply:before {
content: "\f112";
}
.fa-github-alt:before {
content: "\f113";
}
.fa-folder-o:before {
content: "\f114";
}
.fa-folder-open-o:before {
content: "\f115";
}
.fa-smile-o:before {
content: "\f118";
}
.fa-frown-o:before {
content: "\f119";
}
.fa-meh-o:before {
content: "\f11a";
}
.fa-gamepad:before {
content: "\f11b";
}
.fa-keyboard-o:before {
content: "\f11c";
}
.fa-flag-o:before {
content: "\f11d";
}
.fa-flag-checkered:before {
content: "\f11e";
}
.fa-terminal:before {
content: "\f120";
}
.fa-code:before {
content: "\f121";
}
.fa-mail-reply-all:before,
.fa-reply-all:before {
content: "\f122";
}
.fa-star-half-empty:before,
.fa-star-half-full:before,
.fa-star-half-o:before {
content: "\f123";
}
.fa-location-arrow:before {
content: "\f124";
}
.fa-crop:before {
content: "\f125";
}
.fa-code-fork:before {
content: "\f126";
}
.fa-unlink:before,
.fa-chain-broken:before {
content: "\f127";
}
.fa-question:before {
content: "\f128";
}
.fa-info:before {
content: "\f129";
}
.fa-exclamation:before {
content: "\f12a";
}
.fa-superscript:before {
content: "\f12b";
}
.fa-subscript:before {
content: "\f12c";
}
.fa-eraser:before {
content: "\f12d";
}
.fa-puzzle-piece:before {
content: "\f12e";
}
.fa-microphone:before {
content: "\f130";
}
.fa-microphone-slash:before {
content: "\f131";
}
.fa-shield:before {
content: "\f132";
}
.fa-calendar-o:before {
content: "\f133";
}
.<API key>:before {
content: "\f134";
}
.fa-rocket:before {
content: "\f135";
}
.fa-maxcdn:before {
content: "\f136";
}
.<API key>:before {
content: "\f137";
}
.<API key>:before {
content: "\f138";
}
.<API key>:before {
content: "\f139";
}
.<API key>:before {
content: "\f13a";
}
.fa-html5:before {
content: "\f13b";
}
.fa-css3:before {
content: "\f13c";
}
.fa-anchor:before {
content: "\f13d";
}
.fa-unlock-alt:before {
content: "\f13e";
}
.fa-bullseye:before {
content: "\f140";
}
.fa-ellipsis-h:before {
content: "\f141";
}
.fa-ellipsis-v:before {
content: "\f142";
}
.fa-rss-square:before {
content: "\f143";
}
.fa-play-circle:before {
content: "\f144";
}
.fa-ticket:before {
content: "\f145";
}
.fa-minus-square:before {
content: "\f146";
}
.fa-minus-square-o:before {
content: "\f147";
}
.fa-level-up:before {
content: "\f148";
}
.fa-level-down:before {
content: "\f149";
}
.fa-check-square:before {
content: "\f14a";
}
.fa-pencil-square:before {
content: "\f14b";
}
.<API key>:before {
content: "\f14c";
}
.fa-share-square:before {
content: "\f14d";
}
.fa-compass:before {
content: "\f14e";
}
.fa-toggle-down:before,
.<API key>:before {
content: "\f150";
}
.fa-toggle-up:before,
.<API key>:before {
content: "\f151";
}
.fa-toggle-right:before,
.<API key>:before {
content: "\f152";
}
.fa-euro:before,
.fa-eur:before {
content: "\f153";
}
.fa-gbp:before {
content: "\f154";
}
.fa-dollar:before,
.fa-usd:before {
content: "\f155";
}
.fa-rupee:before,
.fa-inr:before {
content: "\f156";
}
.fa-cny:before,
.fa-rmb:before,
.fa-yen:before,
.fa-jpy:before {
content: "\f157";
}
.fa-ruble:before,
.fa-rouble:before,
.fa-rub:before {
content: "\f158";
}
.fa-won:before,
.fa-krw:before {
content: "\f159";
}
.fa-bitcoin:before,
.fa-btc:before {
content: "\f15a";
}
.fa-file:before {
content: "\f15b";
}
.fa-file-text:before {
content: "\f15c";
}
.fa-sort-alpha-asc:before {
content: "\f15d";
}
.fa-sort-alpha-desc:before {
content: "\f15e";
}
.fa-sort-amount-asc:before {
content: "\f160";
}
.fa-sort-amount-desc:before {
content: "\f161";
}
.fa-sort-numeric-asc:before {
content: "\f162";
}
.<API key>:before {
content: "\f163";
}
.fa-thumbs-up:before {
content: "\f164";
}
.fa-thumbs-down:before {
content: "\f165";
}
.fa-youtube-square:before {
content: "\f166";
}
.fa-youtube:before {
content: "\f167";
}
.fa-xing:before {
content: "\f168";
}
.fa-xing-square:before {
content: "\f169";
}
.fa-youtube-play:before {
content: "\f16a";
}
.fa-dropbox:before {
content: "\f16b";
}
.fa-stack-overflow:before {
content: "\f16c";
}
.fa-instagram:before {
content: "\f16d";
}
.fa-flickr:before {
content: "\f16e";
}
.fa-adn:before {
content: "\f170";
}
.fa-bitbucket:before {
content: "\f171";
}
.fa-bitbucket-square:before {
content: "\f172";
}
.fa-tumblr:before {
content: "\f173";
}
.fa-tumblr-square:before {
content: "\f174";
}
.fa-long-arrow-down:before {
content: "\f175";
}
.fa-long-arrow-up:before {
content: "\f176";
}
.fa-long-arrow-left:before {
content: "\f177";
}
.fa-long-arrow-right:before {
content: "\f178";
}
.fa-apple:before {
content: "\f179";
}
.fa-windows:before {
content: "\f17a";
}
.fa-android:before {
content: "\f17b";
}
.fa-linux:before {
content: "\f17c";
}
.fa-dribbble:before {
content: "\f17d";
}
.fa-skype:before {
content: "\f17e";
}
.fa-foursquare:before {
content: "\f180";
}
.fa-trello:before {
content: "\f181";
}
.fa-female:before {
content: "\f182";
}
.fa-male:before {
content: "\f183";
}
.fa-gittip:before,
.fa-gratipay:before {
content: "\f184";
}
.fa-sun-o:before {
content: "\f185";
}
.fa-moon-o:before {
content: "\f186";
}
.fa-archive:before {
content: "\f187";
}
.fa-bug:before {
content: "\f188";
}
.fa-vk:before {
content: "\f189";
}
.fa-weibo:before {
content: "\f18a";
}
.fa-renren:before {
content: "\f18b";
}
.fa-pagelines:before {
content: "\f18c";
}
.fa-stack-exchange:before {
content: "\f18d";
}
.<API key>:before {
content: "\f18e";
}
.<API key>:before {
content: "\f190";
}
.fa-toggle-left:before,
.<API key>:before {
content: "\f191";
}
.fa-dot-circle-o:before {
content: "\f192";
}
.fa-wheelchair:before {
content: "\f193";
}
.fa-vimeo-square:before {
content: "\f194";
}
.fa-turkish-lira:before,
.fa-try:before {
content: "\f195";
}
.fa-plus-square-o:before {
content: "\f196";
}
.fa-space-shuttle:before {
content: "\f197";
}
.fa-slack:before {
content: "\f198";
}
.fa-envelope-square:before {
content: "\f199";
}
.fa-wordpress:before {
content: "\f19a";
}
.fa-openid:before {
content: "\f19b";
}
.fa-institution:before,
.fa-bank:before,
.fa-university:before {
content: "\f19c";
}
.fa-mortar-board:before,
.fa-graduation-cap:before {
content: "\f19d";
}
.fa-yahoo:before {
content: "\f19e";
}
.fa-google:before {
content: "\f1a0";
}
.fa-reddit:before {
content: "\f1a1";
}
.fa-reddit-square:before {
content: "\f1a2";
}
.<API key>:before {
content: "\f1a3";
}
.fa-stumbleupon:before {
content: "\f1a4";
}
.fa-delicious:before {
content: "\f1a5";
}
.fa-digg:before {
content: "\f1a6";
}
.fa-pied-piper-pp:before {
content: "\f1a7";
}
.fa-pied-piper-alt:before {
content: "\f1a8";
}
.fa-drupal:before {
content: "\f1a9";
}
.fa-joomla:before {
content: "\f1aa";
}
.fa-language:before {
content: "\f1ab";
}
.fa-fax:before {
content: "\f1ac";
}
.fa-building:before {
content: "\f1ad";
}
.fa-child:before {
content: "\f1ae";
}
.fa-paw:before {
content: "\f1b0";
}
.fa-spoon:before {
content: "\f1b1";
}
.fa-cube:before {
content: "\f1b2";
}
.fa-cubes:before {
content: "\f1b3";
}
.fa-behance:before {
content: "\f1b4";
}
.fa-behance-square:before {
content: "\f1b5";
}
.fa-steam:before {
content: "\f1b6";
}
.fa-steam-square:before {
content: "\f1b7";
}
.fa-recycle:before {
content: "\f1b8";
}
.fa-automobile:before,
.fa-car:before {
content: "\f1b9";
}
.fa-cab:before,
.fa-taxi:before {
content: "\f1ba";
}
.fa-tree:before {
content: "\f1bb";
}
.fa-spotify:before {
content: "\f1bc";
}
.fa-deviantart:before {
content: "\f1bd";
}
.fa-soundcloud:before {
content: "\f1be";
}
.fa-database:before {
content: "\f1c0";
}
.fa-file-pdf-o:before {
content: "\f1c1";
}
.fa-file-word-o:before {
content: "\f1c2";
}
.fa-file-excel-o:before {
content: "\f1c3";
}
.<API key>:before {
content: "\f1c4";
}
.fa-file-photo-o:before,
.fa-file-picture-o:before,
.fa-file-image-o:before {
content: "\f1c5";
}
.fa-file-zip-o:before,
.fa-file-archive-o:before {
content: "\f1c6";
}
.fa-file-sound-o:before,
.fa-file-audio-o:before {
content: "\f1c7";
}
.fa-file-movie-o:before,
.fa-file-video-o:before {
content: "\f1c8";
}
.fa-file-code-o:before {
content: "\f1c9";
}
.fa-vine:before {
content: "\f1ca";
}
.fa-codepen:before {
content: "\f1cb";
}
.fa-jsfiddle:before {
content: "\f1cc";
}
.fa-life-bouy:before,
.fa-life-buoy:before,
.fa-life-saver:before,
.fa-support:before,
.fa-life-ring:before {
content: "\f1cd";
}
.fa-circle-o-notch:before {
content: "\f1ce";
}
.fa-ra:before,
.fa-resistance:before,
.fa-rebel:before {
content: "\f1d0";
}
.fa-ge:before,
.fa-empire:before {
content: "\f1d1";
}
.fa-git-square:before {
content: "\f1d2";
}
.fa-git:before {
content: "\f1d3";
}
.<API key>:before,
.fa-yc-square:before,
.fa-hacker-news:before {
content: "\f1d4";
}
.fa-tencent-weibo:before {
content: "\f1d5";
}
.fa-qq:before {
content: "\f1d6";
}
.fa-wechat:before,
.fa-weixin:before {
content: "\f1d7";
}
.fa-send:before,
.fa-paper-plane:before {
content: "\f1d8";
}
.fa-send-o:before,
.fa-paper-plane-o:before {
content: "\f1d9";
}
.fa-history:before {
content: "\f1da";
}
.fa-circle-thin:before {
content: "\f1db";
}
.fa-header:before {
content: "\f1dc";
}
.fa-paragraph:before {
content: "\f1dd";
}
.fa-sliders:before {
content: "\f1de";
}
.fa-share-alt:before {
content: "\f1e0";
}
.fa-share-alt-square:before {
content: "\f1e1";
}
.fa-bomb:before {
content: "\f1e2";
}
.fa-soccer-ball-o:before,
.fa-futbol-o:before {
content: "\f1e3";
}
.fa-tty:before {
content: "\f1e4";
}
.fa-binoculars:before {
content: "\f1e5";
}
.fa-plug:before {
content: "\f1e6";
}
.fa-slideshare:before {
content: "\f1e7";
}
.fa-twitch:before {
content: "\f1e8";
}
.fa-yelp:before {
content: "\f1e9";
}
.fa-newspaper-o:before {
content: "\f1ea";
}
.fa-wifi:before {
content: "\f1eb";
}
.fa-calculator:before {
content: "\f1ec";
}
.fa-paypal:before {
content: "\f1ed";
}
.fa-google-wallet:before {
content: "\f1ee";
}
.fa-cc-visa:before {
content: "\f1f0";
}
.fa-cc-mastercard:before {
content: "\f1f1";
}
.fa-cc-discover:before {
content: "\f1f2";
}
.fa-cc-amex:before {
content: "\f1f3";
}
.fa-cc-paypal:before {
content: "\f1f4";
}
.fa-cc-stripe:before {
content: "\f1f5";
}
.fa-bell-slash:before {
content: "\f1f6";
}
.fa-bell-slash-o:before {
content: "\f1f7";
}
.fa-trash:before {
content: "\f1f8";
}
.fa-copyright:before {
content: "\f1f9";
}
.fa-at:before {
content: "\f1fa";
}
.fa-eyedropper:before {
content: "\f1fb";
}
.fa-paint-brush:before {
content: "\f1fc";
}
.fa-birthday-cake:before {
content: "\f1fd";
}
.fa-area-chart:before {
content: "\f1fe";
}
.fa-pie-chart:before {
content: "\f200";
}
.fa-line-chart:before {
content: "\f201";
}
.fa-lastfm:before {
content: "\f202";
}
.fa-lastfm-square:before {
content: "\f203";
}
.fa-toggle-off:before {
content: "\f204";
}
.fa-toggle-on:before {
content: "\f205";
}
.fa-bicycle:before {
content: "\f206";
}
.fa-bus:before {
content: "\f207";
}
.fa-ioxhost:before {
content: "\f208";
}
.fa-angellist:before {
content: "\f209";
}
.fa-cc:before {
content: "\f20a";
}
.fa-shekel:before,
.fa-sheqel:before,
.fa-ils:before {
content: "\f20b";
}
.fa-meanpath:before {
content: "\f20c";
}
.fa-buysellads:before {
content: "\f20d";
}
.fa-connectdevelop:before {
content: "\f20e";
}
.fa-dashcube:before {
content: "\f210";
}
.fa-forumbee:before {
content: "\f211";
}
.fa-leanpub:before {
content: "\f212";
}
.fa-sellsy:before {
content: "\f213";
}
.fa-shirtsinbulk:before {
content: "\f214";
}
.fa-simplybuilt:before {
content: "\f215";
}
.fa-skyatlas:before {
content: "\f216";
}
.fa-cart-plus:before {
content: "\f217";
}
.fa-cart-arrow-down:before {
content: "\f218";
}
.fa-diamond:before {
content: "\f219";
}
.fa-ship:before {
content: "\f21a";
}
.fa-user-secret:before {
content: "\f21b";
}
.fa-motorcycle:before {
content: "\f21c";
}
.fa-street-view:before {
content: "\f21d";
}
.fa-heartbeat:before {
content: "\f21e";
}
.fa-venus:before {
content: "\f221";
}
.fa-mars:before {
content: "\f222";
}
.fa-mercury:before {
content: "\f223";
}
.fa-intersex:before,
.fa-transgender:before {
content: "\f224";
}
.fa-transgender-alt:before {
content: "\f225";
}
.fa-venus-double:before {
content: "\f226";
}
.fa-mars-double:before {
content: "\f227";
}
.fa-venus-mars:before {
content: "\f228";
}
.fa-mars-stroke:before {
content: "\f229";
}
.fa-mars-stroke-v:before {
content: "\f22a";
}
.fa-mars-stroke-h:before {
content: "\f22b";
}
.fa-neuter:before {
content: "\f22c";
}
.fa-genderless:before {
content: "\f22d";
}
.<API key>:before {
content: "\f230";
}
.fa-pinterest-p:before {
content: "\f231";
}
.fa-whatsapp:before {
content: "\f232";
}
.fa-server:before {
content: "\f233";
}
.fa-user-plus:before {
content: "\f234";
}
.fa-user-times:before {
content: "\f235";
}
.fa-hotel:before,
.fa-bed:before {
content: "\f236";
}
.fa-viacoin:before {
content: "\f237";
}
.fa-train:before {
content: "\f238";
}
.fa-subway:before {
content: "\f239";
}
.fa-medium:before {
content: "\f23a";
}
.fa-yc:before,
.fa-y-combinator:before {
content: "\f23b";
}
.fa-optin-monster:before {
content: "\f23c";
}
.fa-opencart:before {
content: "\f23d";
}
.fa-expeditedssl:before {
content: "\f23e";
}
.fa-battery-4:before,
.fa-battery-full:before {
content: "\f240";
}
.fa-battery-3:before,
.<API key>:before {
content: "\f241";
}
.fa-battery-2:before,
.fa-battery-half:before {
content: "\f242";
}
.fa-battery-1:before,
.fa-battery-quarter:before {
content: "\f243";
}
.fa-battery-0:before,
.fa-battery-empty:before {
content: "\f244";
}
.fa-mouse-pointer:before {
content: "\f245";
}
.fa-i-cursor:before {
content: "\f246";
}
.fa-object-group:before {
content: "\f247";
}
.fa-object-ungroup:before {
content: "\f248";
}
.fa-sticky-note:before {
content: "\f249";
}
.fa-sticky-note-o:before {
content: "\f24a";
}
.fa-cc-jcb:before {
content: "\f24b";
}
.fa-cc-diners-club:before {
content: "\f24c";
}
.fa-clone:before {
content: "\f24d";
}
.fa-balance-scale:before {
content: "\f24e";
}
.fa-hourglass-o:before {
content: "\f250";
}
.fa-hourglass-1:before,
.fa-hourglass-start:before {
content: "\f251";
}
.fa-hourglass-2:before,
.fa-hourglass-half:before {
content: "\f252";
}
.fa-hourglass-3:before,
.fa-hourglass-end:before {
content: "\f253";
}
.fa-hourglass:before {
content: "\f254";
}
.fa-hand-grab-o:before,
.fa-hand-rock-o:before {
content: "\f255";
}
.fa-hand-stop-o:before,
.fa-hand-paper-o:before {
content: "\f256";
}
.fa-hand-scissors-o:before {
content: "\f257";
}
.fa-hand-lizard-o:before {
content: "\f258";
}
.fa-hand-spock-o:before {
content: "\f259";
}
.fa-hand-pointer-o:before {
content: "\f25a";
}
.fa-hand-peace-o:before {
content: "\f25b";
}
.fa-trademark:before {
content: "\f25c";
}
.fa-registered:before {
content: "\f25d";
}
.fa-creative-commons:before {
content: "\f25e";
}
.fa-gg:before {
content: "\f260";
}
.fa-gg-circle:before {
content: "\f261";
}
.fa-tripadvisor:before {
content: "\f262";
}
.fa-odnoklassniki:before {
content: "\f263";
}
.<API key>:before {
content: "\f264";
}
.fa-get-pocket:before {
content: "\f265";
}
.fa-wikipedia-w:before {
content: "\f266";
}
.fa-safari:before {
content: "\f267";
}
.fa-chrome:before {
content: "\f268";
}
.fa-firefox:before {
content: "\f269";
}
.fa-opera:before {
content: "\f26a";
}
.<API key>:before {
content: "\f26b";
}
.fa-tv:before,
.fa-television:before {
content: "\f26c";
}
.fa-contao:before {
content: "\f26d";
}
.fa-500px:before {
content: "\f26e";
}
.fa-amazon:before {
content: "\f270";
}
.fa-calendar-plus-o:before {
content: "\f271";
}
.fa-calendar-minus-o:before {
content: "\f272";
}
.fa-calendar-times-o:before {
content: "\f273";
}
.fa-calendar-check-o:before {
content: "\f274";
}
.fa-industry:before {
content: "\f275";
}
.fa-map-pin:before {
content: "\f276";
}
.fa-map-signs:before {
content: "\f277";
}
.fa-map-o:before {
content: "\f278";
}
.fa-map:before {
content: "\f279";
}
.fa-commenting:before {
content: "\f27a";
}
.fa-commenting-o:before {
content: "\f27b";
}
.fa-houzz:before {
content: "\f27c";
}
.fa-vimeo:before {
content: "\f27d";
}
.fa-black-tie:before {
content: "\f27e";
}
.fa-fonticons:before {
content: "\f280";
}
.fa-reddit-alien:before {
content: "\f281";
}
.fa-edge:before {
content: "\f282";
}
.fa-credit-card-alt:before {
content: "\f283";
}
.fa-codiepie:before {
content: "\f284";
}
.fa-modx:before {
content: "\f285";
}
.fa-fort-awesome:before {
content: "\f286";
}
.fa-usb:before {
content: "\f287";
}
.fa-product-hunt:before {
content: "\f288";
}
.fa-mixcloud:before {
content: "\f289";
}
.fa-scribd:before {
content: "\f28a";
}
.fa-pause-circle:before {
content: "\f28b";
}
.fa-pause-circle-o:before {
content: "\f28c";
}
.fa-stop-circle:before {
content: "\f28d";
}
.fa-stop-circle-o:before {
content: "\f28e";
}
.fa-shopping-bag:before {
content: "\f290";
}
.fa-shopping-basket:before {
content: "\f291";
}
.fa-hashtag:before {
content: "\f292";
}
.fa-bluetooth:before {
content: "\f293";
}
.fa-bluetooth-b:before {
content: "\f294";
}
.fa-percent:before {
content: "\f295";
}
.fa-gitlab:before {
content: "\f296";
}
.fa-wpbeginner:before {
content: "\f297";
}
.fa-wpforms:before {
content: "\f298";
}
.fa-envira:before {
content: "\f299";
}
.fa-universal-access:before {
content: "\f29a";
}
.fa-wheelchair-alt:before {
content: "\f29b";
}
.<API key>:before {
content: "\f29c";
}
.fa-blind:before {
content: "\f29d";
}
.<API key>:before {
content: "\f29e";
}
.<API key>:before {
content: "\f2a0";
}
.fa-braille:before {
content: "\f2a1";
}
.<API key>:before {
content: "\f2a2";
}
.fa-asl-interpreting:before,
.<API key>:before {
content: "\f2a3";
}
.fa-deafness:before,
.fa-hard-of-hearing:before,
.fa-deaf:before {
content: "\f2a4";
}
.fa-glide:before {
content: "\f2a5";
}
.fa-glide-g:before {
content: "\f2a6";
}
.fa-signing:before,
.fa-sign-language:before {
content: "\f2a7";
}
.fa-low-vision:before {
content: "\f2a8";
}
.fa-viadeo:before {
content: "\f2a9";
}
.fa-viadeo-square:before {
content: "\f2aa";
}
.fa-snapchat:before {
content: "\f2ab";
}
.fa-snapchat-ghost:before {
content: "\f2ac";
}
.fa-snapchat-square:before {
content: "\f2ad";
}
.fa-pied-piper:before {
content: "\f2ae";
}
.fa-first-order:before {
content: "\f2b0";
}
.fa-yoast:before {
content: "\f2b1";
}
.fa-themeisle:before {
content: "\f2b2";
}
.<API key>:before,
.<API key>:before {
content: "\f2b3";
}
.fa-fa:before,
.fa-font-awesome:before {
content: "\f2b4";
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
.fa-facebook {
width: 40px;
height: 40px;
border: 20px;
font-size: 25px;
color: #ffffff;
text-align: center;
}
.fa-twitter {
width: 40px;
height: 40px;
border: 20px;
font-size: 25px;
color: #ffffff;
text-align: center;
}
.fa-instagram {
width: 40px;
height: 40px;
border: 20px;
font-size: 25px;
color: #ffffff;
text-align: center;
}
.fa-github {
width: 40px;
height: 40px;
border: 20px;
font-size: 25px;
color: #ffffff;
text-align: center;
} |
# -*- coding: utf-8 -*-
import unittest
from sqlalchemy.schema import Table
from carepoint.tests.db.db import DatabaseTest
from carepoint.models.cph.fdb_gcn_seq import FdbGcnSeq
class <API key>(DatabaseTest):
def <API key>(self, ):
self.assertIsInstance(FdbGcnSeq.__table__, Table)
if __name__ == '__main__':
unittest.main() |
/*
* Page Styles
*/
.kw-index h2 {
text-align: left;
} |
# -*- coding: utf-8 -*-
import sys
def getC1(srcdata):
c1 = {}
for transaction in srcdata:
for item in transaction:
key = frozenset(set([item]))
if key in c1:
c1[key] = c1[key] + 1
else:
c1[key] = 1
return c1
def getL(c, supct):
for key in [item for item in c if c[item] < supct]:
del c[key]
#if c != {}:
#print c
return c
def getnextcandi(preL, srcdata):
c = {}
for key1 in preL:
for key2 in preL:
if key1 != key2:
key = key1.union(key2)
c[key] = 0
for i in srcdata:
for item in c:
if item.issubset(i):
c[item] = c[item] + 1
return c
def Apriori(filename, supct):
srcdata = [line.strip("\n").split(" ") for line in file(filename)]
c = getC1(srcdata)
L = getL(c, supct)
c = getnextcandi(L, srcdata)
return c
if __name__ == "__main__":
if len(sys.argv) == 3:
#Usage: apri.py filename surpport
items = Apriori(sys.argv[1], int(sys.argv[2]))
for key in [item for item in items if items[item] < int(sys.argv[2])]:
del items[key]
ap = {}
for itor in items:
#print items[itor]
#print itor
strword = ''
for word in itor:
strword += word + " "
ap[strword.strip(' ')] = items[itor]
linelst = sorted(ap.items(), lambda x, y: cmp(x[1], y[1]), reverse=True)
for i in range(len(linelst)):
print "#" + str(linelst[i][1]) + " " + linelst[i][0]
#for (k, v) in ap.items():
#print "#" + str(v) + " " + k
else:
#for example
print "err args" |
package ke.co.greid.entities;
// Generated Apr 1, 2015 12:52:51 PM by Hibernate Tools 3.4.0.CR1
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* Country generated by hbm2java
*/
@Entity
@Table(name = "country", catalog = "hims")
public class Country implements java.io.Serializable {
private String countryCode;
private String countryName;
private Set<Patient> patients = new HashSet<Patient>(0);
public Country() {
}
public Country(String countryCode) {
this.countryCode = countryCode;
}
public Country(String countryCode, String countryName, Set<Patient> patients) {
this.countryCode = countryCode;
this.countryName = countryName;
this.patients = patients;
}
@Id
@Column(name = "country_code", unique = true, nullable = false, length = 2)
public String getCountryCode() {
return this.countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
@Column(name = "country_name", length = 45)
public String getCountryName() {
return this.countryName;
}
public void setCountryName(String countryName) {
this.countryName = countryName;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "country")
public Set<Patient> getPatients() {
return this.patients;
}
public void setPatients(Set<Patient> patients) {
this.patients = patients;
}
} |
layout: post
title: "Arkapong"
date: 2014-04-07 07:35:33
categories: arkapong, game, libgdx
<img src="http://pello.io/images/arkapong0.png" title="" alt="" />
<p>
This a classic pong-like game that takes some ideas from Arkanoid. Basically
two paddles try to hit the ball until one of them fails but, from time to time
the rules can change if special bricks are touched.
</p>
<ul>
<li><b>Red:</b> invert ball direction</li>
<li><b>White:</b> triple ball</li>
<li><b>Yellow:</b> smaller paddles</li>
<li><b>Blue:</b> bigger paddles</li>
<li><b>Green:</b> speed up ball</li>
<li><b>Orange:</b> change ball up-down direction</li>
<li><b>Brown:</b> minimize paddles</li>
<li><b>Pink:</b> move paddles randomly</li>
</ul>
<img src="http://pello.io/images/arkapong2.png" title="" alt="" />
<p>
For one or two players, much more fun if you play it against someone else,
the game is controlled with your fingers. You can set your preferred ball speed using
the preferences screen.</p>
<p>There is another <a href="http: |
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C
#region Using directives
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using AM.Data;
using AM.Xml;
using CodeJam;
using JetBrains.Annotations;
#endregion
namespace AM.Windows.Forms
{
<summary>
</summary>
[PublicAPI]
public static class DataGridViewUtility
{
#region Private members
#endregion
#region Public methods
<summary>
Apply specified columns to the <see cref="DataGridView"/>.
</summary>
public static void ApplyColumns
(
[NotNull] DataGridView grid,
[NotNull][ItemNotNull] IEnumerable<DataColumnInfo> columns
)
{
Code.NotNull(grid, "grid");
Code.NotNull(columns, "columns");
try
{
grid.SuspendLayout();
grid.AutoGenerateColumns = false;
grid.Columns.Clear();
foreach (DataColumnInfo info in columns)
{
DataGridViewColumn column = info.ToGridColumn();
grid.Columns.Add(column);
}
}
finally
{
grid.ResumeLayout();
}
}
<summary>
Converts the column description into
<see cref="DataGridViewColumn"/>
</summary>
[NotNull]
public static DataGridViewColumn ToGridColumn
(
[NotNull] this DataColumnInfo column
)
{
Code.NotNull(column, "column");
string columnTypeName = column.Type;
Type columnType = null;
if (!string.IsNullOrEmpty(columnTypeName))
{
columnType = Type.GetType(columnTypeName, true);
}
DataGridViewColumn result = ReferenceEquals(columnType, null)
? new <API key>()
: (DataGridViewColumn)Activator.CreateInstance(columnType);
result.DataPropertyName = column.Name;
result.HeaderText = column.Title;
result.DataPropertyName = column.Name;
result.ReadOnly = column.ReadOnly;
result.Frozen = column.Frozen;
result.Visible = !column.Invisible;
if (column.Width != 0)
{
if (column.Width > 0)
{
result.AutoSizeMode
= <API key>.None;
result.Width = column.Width;
}
else
{
result.AutoSizeMode
= <API key>.Fill;
result.FillWeight = Math.Abs(column.Width);
}
}
result.HeaderCell.Style.Alignment
= <API key>.MiddleCenter;
return result;
}
<summary>
Gets the columns.
</summary>
[NotNull]
public static List<DataGridViewColumn> GetColumns
(
[NotNull] string xmlText
)
{
Code.NotNullNorEmpty(xmlText, "xmlText");
DataSetInfo info
= XmlUtility.DeserializeString<DataSetInfo>(xmlText);
List<DataGridViewColumn> result = new List<DataGridViewColumn>();
foreach (DataColumnInfo column in info.Tables[0].Columns)
{
result.Add(column.ToGridColumn());
}
return result;
}
// <summary>
// Generates the table HTML.
// </summary>
// <param name="grid">The grid.</param>
// <param name="title">The title.</param>
// <returns></returns>
//public static string GenerateTableHtml
// DataGridView grid,
// string title
// ArgumentUtility.NotNull(grid, "grid");
// ArgumentUtility.NotNull(title, "title");
// StringWriter writer = new StringWriter();
// Html32TextWriter html = new Html32TextWriter(writer);
// html.RenderBeginTag(HtmlTextWriterTag.Html);
// html.RenderBeginTag(HtmlTextWriterTag.Head);
// html.RenderBeginTag(HtmlTextWriterTag.Title);
// html.WriteEncodedText(title);
// html.RenderEndTag(); // title
// html.RenderEndTag(); // head
// html.RenderBeginTag(HtmlTextWriterTag.Body);
// html.AddAttribute(<API key>.Width, "90%");
// html.AddAttribute(<API key>.Border, "1");
// html.AddAttribute(<API key>.Cellspacing, "0");
// html.AddAttribute(<API key>.Cellpadding, "3");
// html.AddAttribute(<API key>.Bordercolor, "black");
// html.AddAttribute(<API key>.Align, "center");
// html.RenderBeginTag(HtmlTextWriterTag.Table);
// html.RenderBeginTag(HtmlTextWriterTag.Tr);
// foreach (DataGridViewColumn column in grid.Columns)
// if (column.Visible)
// html.RenderBeginTag(HtmlTextWriterTag.Td);
// html.RenderBeginTag(HtmlTextWriterTag.B);
// html.WriteEncodedText(column.HeaderText);
// html.RenderEndTag();
// html.RenderEndTag(); // td
// html.RenderEndTag(); // tr
// foreach (DataGridViewRow row in grid.Rows)
// html.RenderBeginTag(HtmlTextWriterTag.Tr);
// foreach (DataGridViewCell cell in row.Cells)
// if (cell.OwningColumn.Visible)
// html.RenderBeginTag(HtmlTextWriterTag.Td);
// object formattedValue = cell.FormattedValue;
// bool written = false;
// if (formattedValue != null)
// string text = formattedValue.ToString();
// if (!string.IsNullOrEmpty(text))
// html.WriteEncodedText(formattedValue.ToString());
// written = true;
// if (!written)
// html.Write(" ");
// html.RenderEndTag(); // td
// html.RenderEndTag(); // tr
// html.RenderEndTag(); // table
// html.RenderEndTag(); // body
// html.RenderEndTag(); // html
// html.Flush();
// return writer.ToString();
#endregion
}
} |
# Glory to Rome
A .NET implementation of Glory to Rome, a card game unique for its self-modifying ruleset and multifunction cards |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sq" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About SperoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>SperoCoin</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2017 The Sperocoin developers
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X13 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:
Technical information about SperoCoin:
Algorithm: X13
Total Supply: 7 million
Block Time: 60 seconds
PoS Return: 25% per year
Difficulty reset to each block
Encrypted Message
Confirmations: 05 for mining and 03 for transactions
Website: https://sperocoin.ddns.net/
Block Explorer: http://sperocoin.ddns.net:3001
Telegram: https://t.me/joinchat/<API key>
Slack: https://sperocoin.slack.com
Facebook: https:
Twitter: https://twitter.com/Spero_Official
Discord: https://discord.gg/CVRFwC7
BTCTalk: https://bitcointalk.org/index.php?topic=2260985.0
GitHub: https://github.com/DigitalCoin1/DigitalCoinBRL
Trello: https://trello.com/b/jYZvXKDs/sperocoin
E-mail: sperocoin@gmail.com
</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Klikoni 2 herë për të ndryshuar adressën ose etiketën</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Krijo një adresë të re</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopjo adresën e zgjedhur në memorjen e sistemit </translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your SperoCoin 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 line="+60"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a SperoCoin 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="-14"/>
<source>Verify a message to ensure it was signed with a specified SperoCoin 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>&Fshi</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Skedar i ndarë me pikëpresje(*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Etiketë</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresë</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(pa etiketë)</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>Futni frazkalimin</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Frazkalim i ri</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Përsërisni frazkalimin e ri</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<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>Futni frazkalimin e ri në portofol.<br/>Ju lutemi përdorni një frazkalim prej<b>10 ose më shumë shkronjash të rastësishme<b/>, ose tetë apo më shumë fjalë</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Enkripto portofolin</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Ky veprim ka nevojë per frazkalimin e portofolit tuaj që të ç'kyç portofolin.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>ç'kyç portofolin.</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Ky veprim kërkon frazkalimin e portofolit tuaj që të dekriptoj portofolin.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dekripto portofolin</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Ndrysho frazkalimin</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Futni frazkalimin e vjetër dhe të ri në portofol. </translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Konfirmoni enkriptimin e portofolit</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</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="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Portofoli u enkriptua</translation>
</message>
<message>
<location line="-58"/>
<source>SperoCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Enkriptimi i portofolit dështoi</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Enkriptimi i portofolit dështoi për shkak të një gabimi të brëndshëm. portofoli juaj nuk u enkriptua.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>Frazkalimet e plotësuara nuk përputhen.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>ç'kyçja e portofolit dështoi</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Frazkalimi i futur për dekriptimin e portofolit nuk ishte i saktë.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Dekriptimi i portofolit dështoi</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="+282"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>Synchronizing with network...</source>
<translation>Duke u sinkronizuar me rrjetin...</translation>
</message>
<message>
<location line="-319"/>
<source>&Overview</source>
<translation>&Përmbledhje</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Trego një përmbledhje te përgjithshme të portofolit</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Transaksionet</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Shfleto historinë e transaksioneve</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Mbyllni aplikacionin</translation>
</message>
<message>
<location line="+6"/>
<source>Show information about SperoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Opsione</translation>
</message>
<message>
<location line="+4"/>
<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 numerus="yes">
<location line="+259"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-256"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Send coins to a SperoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Modify configuration options for SperoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<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>Ndrysho frazkalimin e përdorur per enkriptimin e portofolit</translation>
</message>
<message>
<location line="+10"/>
<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="-5"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-202"/>
<source>SperoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+180"/>
<source>&About SperoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>&File</source>
<translation>&Skedar</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>&Konfigurimet</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&Ndihmë</translation>
</message>
<message>
<location line="+12"/>
<source>Tabs toolbar</source>
<translation>Shiriti i mjeteve</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testo rrjetin]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>SperoCoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+75"/>
<source>%n active connection(s) to SperoCoin network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="-312"/>
<source>About SperoCoin card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about SperoCoin card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+297"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>I azhornuar</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>Duke u azhornuar...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<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="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Dërgo transaksionin</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Transaksion në ardhje</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid SperoCoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Portofoli po <b> enkriptohet</b> dhe është <b> i ç'kyçur</b></translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Portofoli po <b> enkriptohet</b> dhe është <b> i kyçur</b></translation>
</message>
<message>
<location line="+25"/>
<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 numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<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>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. SperoCoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Sasia</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Adresë</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(pa etiketë)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Ndrysho Adresën</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Etiketë</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresa</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 type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Adresë e re pritëse</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Adresë e re dërgimi</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Ndrysho adresën pritëse</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>ndrysho adresën dërguese</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Adresa e dhënë "%1" është e zënë në librin e adresave. </translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid SperoCoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Nuk mund të ç'kyçet portofoli.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Krijimi i çelësit të ri dështoi.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>SperoCoin-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>Opsionet</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. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start SperoCoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start SperoCoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the SperoCoin 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 SperoCoin 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 SperoCoin.</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 SperoCoin 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="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</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="+55"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+149"/>
<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 SperoCoin.</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>Formilarë</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the SperoCoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<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="+20"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Transaksionet e fundit</b></translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</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 type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</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="+348"/>
<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 SperoCoin-Qt help message to get a list with possible SperoCoin 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>SperoCoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>SperoCoin 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 SperoCoin 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="-33"/>
<source>Welcome to the SperoCoin 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="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Dërgo Monedha</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 SPERO</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Dërgo marrësve të ndryshëm njëkohësisht</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="+28"/>
<source>Balance:</source>
<translation>Balanca:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 SPERO</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Konfirmo veprimin e dërgimit</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a SperoCoin address (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>konfirmo dërgimin e monedhave</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<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>Shuma e paguar duhet të jetë më e madhe se 0.</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>
<message>
<location line="+251"/>
<source>WARNING: Invalid SperoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(pa etiketë)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Sh&uma:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Paguaj &drejt:</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Krijoni një etiketë për këtë adresë që t'ja shtoni librit të adresave</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>&Etiketë:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<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>Ngjit nga memorja e sistemit</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 type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a SperoCoin address (e.g. <API key>)</source>
<translation type="unfinished"/>
</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"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-118"/>
<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="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Ngjit nga memorja e sistemit</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="+24"/>
<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 SperoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<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"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<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 SperoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<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 SperoCoin address (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter SperoCoin 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>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>Hapur deri më %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/I pakonfirmuar</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 konfirmimet</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 510 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="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Sasia</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="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>, nuk është transmetuar me sukses deri tani</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>i/e panjohur</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../forms/<API key>.ui" line="+14"/>
<source>Transaction details</source>
<translation>Detajet e transaksionit</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Ky panel tregon një përshkrim të detajuar të transaksionit</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../<API key>.cpp" line="+226"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Lloji</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresë</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Sasia</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>Hapur deri më %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>I/E konfirmuar(%1 konfirmime)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Ky bllok është marrë nga ndonjë nyje dhe ka shumë mundësi të mos pranohet! </translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>I krijuar por i papranuar</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Marrë me</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Dërguar drejt</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Pagesë ndaj vetvetes</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Minuar</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(p/a)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Marrë me</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Dërguar drejt</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Minuar</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</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="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Skedar i ndarë me pikëpresje(*.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>Lloji</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etiketë</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresë</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Sasia</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</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="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>SperoCoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or SperoCoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: SperoCoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: SperoCoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<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="-5"/>
<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="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<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="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<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="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong SperoCoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<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="-18"/>
<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="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<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="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<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="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<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="+28"/>
<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="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<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="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=SperoCoinrpc
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 "SperoCoin Alert" sperocoin@sperocoin.org
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</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="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<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>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<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="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. SperoCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>SperoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of SperoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart SperoCoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<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="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. SperoCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<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
// <API key>:front:blog.html.twig
return array (
); |
package fr.cneftali.integrations.dropwizard.spring.example.resources;
import com.codahale.metrics.annotation.Timed;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
@Path("/hello-world")
@Produces(APPLICATION_JSON)
@Consumes(APPLICATION_JSON)
public interface HelloWorldResource {
@GET
@Timed
Response get(@QueryParam("says") String says);
} |
import { CanActivate, <API key>, Component } from "../core";
@Component({
template: require("./<API key>.component.html"),
styles: [require("./<API key>.component.css")],
selector: "<API key>",
inputs: ['entities','edit','remove'],
changeDetection: <API key>.OnPush
})
export class <API key> {
constructor() { }
} |
/**
* EpicEditor
*
* @param {Element} textarea
* @return {EpicEditor}
*/
function createEpicEditor (textarea) {
var $node = $(textarea);
var id = $node.attr('id');
var h = $node.height();
var l = $node.parents('.reply2_form').find('#editor_'+id).length;
if (l == 0) {
$node.before('<div id="editor_' + id + '" style="height:' + h + 'px; border: 1px solid #DDD; border-radius: 4px;"></div>');
}
$node.hide();
var opts = {
container: 'editor_' + id,
textarea: id,
basePath: '/public/libs/epiceditor',
clientSideStorage: false,
useNativeFullscreen: true,
parser: marked,
theme: {
base: '/themes/base/epiceditor.css',
preview: '/themes/preview/github.css',
editor: '/themes/editor/epic-light.css'
},
button: {
preview: true,
fullscreen: true,
bar: true
},
focusOnLoad: false,
shortcut: {
modifier: 18,
fullscreen: 70,
preview: 80
},
string: {
togglePreview: '',
toggleEdit: '',
toggleFullscreen: ''
},
autogrow: {
minHeight: 200
}
};
var editor = new EpicEditor(opts);
function _fullscreenenter ($e) {
var d = {
margin: '90px 8px 8px 8px',
padding: '8px',
border: '1px solid #aaa',
width: $e.width() - 34,
height: $e.height() - 114
};
setTimeout(function () {
$e.css(d);
}, 100);
}
function _fullscreenexit ($e) {
$e.css({
margin: '0',
padding: '0',
border: 'none'
});
}
function fullscreenenter () {
_fullscreenenter($(editor.editorIframe));
_fullscreenenter($(editor.previewerIframe));
window.e = editor;
}
function fullscreenexit () {
_fullscreenexit($(editor.editorIframe));
_fullscreenexit($(editor.previewerIframe));
}
editor.on('fullscreenenter', fullscreenenter);
editor.on('fullscreenexit', fullscreenexit);
$(window).resize(function () {
if (editor.is('fullscreen')) {
fullscreenenter();
}
});
return editor;
}
/**
* EpicEditor
*
* @param {EpicEditor} editor
* @param {String} text
* @return {String}
*/
function epicEditorAppend (editor, text) {
return editor.getElement('editor').body.innerHTML += text;
}
/**
* EpicEditor
*
* @param {EpicEditor} editor
* @param {String} text
* @return {String}
*/
function epicEditorPrepend (editor, text) {
return editor.getElement('editor').body.innerHTML = text + editor.getElement('editor').body.innerHTML;
}
$(function () {
var $node = $('#wmd-input');
if ($node.length > 0) {
createEpicEditor($node).load();
}
}); |
# @redux-requests/fetch
[.
## Licence
MIT |
<!--[if lt IE 10]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]
<div class="message" ng-class="{'close': messageClosed}">
<div class="message__container">
<a href="http://baasic.com" class="<API key>">
</a>
<a href="https://github.com/Baasic/<API key>">
<p class="message__title">Grab a Starter Kit and start building!</p>
</a>
</div>
<a href="javascript:void(0)" ng-click="messageClosed=!messageClosed" ng-class="{'nShow': messageClosed}"><span class="<API key>">Close</span></a>
</div>
<main ui-view></main> |
/*global window: false, $:false, document:false, jQuery:false, XDomainRequest:false*/
(function ($) {
var GenderApi = function (element, config) {
var TYPE_NAME = 'name';
var TYPE_EMAIL = 'email';
var $this = $(element);
var block = false; //only 1 request at a time
var timeout = 500; // 500 ms
var timer = null;
var currentQuery = null;
var attached = true; //enables or disables the detection
var type = TYPE_NAME;
/**
* Can be called to disable detection
* $(element).genderApi('detach');
*/
$this.detachApi = function () {
attached = false;
};
/**
* Can be called to enable detection
* $(element).genderApi('attach');
*/
$this.attachApi = function () {
attached = true;
};
var data = {
ip: 'auto'
};
if (config.key) {
data.key = config.key;
}
if (config.country) {
data.country = config.country;
}
if (config.language) {
data.language = config.language;
}
if (config.type) {
type = config.type;
}
var protocol = 'https:' == document.location.protocol ? 'https:
var url = config.url ? config.url : protocol + 'gender-api.com/get';
$this.query = function (value, callback) {
value = $.trim(value);
if ((type == TYPE_EMAIL && value.indexOf('@') > 0) || ( type == TYPE_NAME && value.length > 1)) {
if (type == TYPE_EMAIL) {
data.email = value;
} else {
data.name = value;
}
if (block == true) return;
if (value == currentQuery) return;
block = true;
currentQuery = value;
if (!$.support.cors && $.ajaxTransport && window.XDomainRequest) {
var xdr = new XDomainRequest();
if (xdr) {
if (window.location && window.location.href) {
data.ref = window.location.href;
}
xdr.onload = function () {
var result = $.parseJSON(xdr.responseText);
callback(result);
block = false;
};
var dataString = '';
$.each(data, function (key, value) {
dataString += '&' + key + '=' + encodeURIComponent(value);
});
xdr.open("get", url + '?' + dataString.substr(1));
xdr.send();
}
} else {
$.ajax({
url: url,
data: data,
dataType: 'json'
}).done(function (result) {
callback(result);
block = false;
});
}
}
else {
callback({name: value, gender: null});
}
};
if (config.hasOwnProperty('name') && config.callback) {
$this.query(config.name, config.callback);
return;
}
var startTimer = function () {
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(parse, timeout);
};
var parse = function () {
if (attached) {
var value = $this.val();
$this.query(value, function (result) {
if (result.gender) {
$this.trigger('gender-found', result);
}
block = false;
});
}
};
$this.on({
'change': parse,
'focusout': parse,
'keyup': startTimer,
'paste': function () {
setTimeout(parse, 100)
}
});
$this.data('genderapi', $this);
};
/** @namespace $.fn */
$.fn.genderApi = function (config) {
return this.each(function () {
var api = $(this).data('genderapi');
switch (config) {
case 'detach':
if (api) {
api.detachApi();
return api;
}
return null;
case 'attach':
if (api) {
api.attachApi();
return api;
}
return null;
}
return new GenderApi(this, config);
});
}
})(jQuery); |
import Sqlite3Adapter from '../../Sqlite3Adapter';
import Mysql2Adapter from '../../Mysql2Adapter';
function createTable(td) {
td.primaryKey('id');
td.string('name', { default: 'Untitled' });
td.string('email');
td.integer('age', { default: 0 });
td.text('bio');
td.boolean('active', { default: true });
td.date('birthday');
td.datetime('last_active_at');
td.timestamps();
}
describe('Sqlite3Adapter', () => {
const conn = new Sqlite3Adapter();
it('createTable', () => {
const td = conn.<API key>('users');
createTable(td);
expect(conn.schemaCreation.accept(td)).toBe(
`CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar DEFAULT 'Untitled', "email" varchar, "age" integer DEFAULT 0, "bio" text, "active" boolean DEFAULT 't', "birthday" date, "last_active_at" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)`
);
});
});
describe('Mysql2Adapter', () => {
const conn = new Mysql2Adapter();
it('createTable', () => {
const td = conn.<API key>('users', false, 'ENGINE=InnoDB');
createTable(td);
td.json('payload');
expect(conn.schemaCreation.accept(td)).toBe(
"CREATE TABLE `users` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255) DEFAULT 'Untitled', `email` varchar(255), `age` int DEFAULT 0, `bio` text, `active` tinyint(1) DEFAULT 1, `birthday` date, `last_active_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `payload` json) ENGINE=InnoDB"
);
});
}); |
var should = require('chai').should();
describe('Grasshopper core - content', function(){
'use strict';
var async = require('async'),
path = require('path'),
_ = require('lodash'),
grasshopper = require('../../lib/grasshopper').init(require('../fixtures/config')),
tokens = {},
tokenRequests = [
['apitestuseradmin', 'TestPassword', 'globalAdminToken'],
['apitestuserreader', 'TestPassword', 'globalReaderToken'],
['<API key>', 'TestPassword', '<API key>'],
// There are no tests for the following:
['apitestusereditor', 'TestPassword', 'globalEditorToken'],
['apitestuserreader_1', 'TestPassword', 'nodeEditorToken']
],
<API key> = [];
before(function(done){
_.each(tokenRequests, function(theRequest) {
<API key>.push(createGetToken(theRequest[0], theRequest[1], theRequest[2]).closure);
});
async.parallel(<API key>, insertContent.bind(null, done));
});
describe('query', function() {
var query = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test1'}]
},
query2 = {
filters: [{key: 'nonsense', cmp: '=', value: '<API key>'}],
options: {}
},
query3 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test2'}],
options: {
include: ['fields.testfield']
}
},
query4 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test3'}],
options: {
exclude: ['fields.newColumn']
}
},
query5 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test4'}],
options: {
sortBy: 1111
}
},
query6 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test5'}],
options: []
},
query7 = {
filters: [],
nodes: ['<API key>']
},
query8 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test6'}],
options : {
limit : 1
}
},
query9 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test6'}],
options : {
limit : '1'
}
},
query10 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test6'}],
options : {
limit : 'string'
}
},
query11 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test7'}],
options : {
limit : 1,
skip : 2
}
},
query12 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test7'}],
options : {
limit : 1,
skip : '2'
}
},
query13 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test7'}],
options : {
limit : 1,
skip : 'string'
}
},
query14 = {
filters: [{key: 'fields.label', cmp: '=', value: 'search test7'}],
options : {
limit : 1,
skip : -1
}
},
query15 = {
filters: [ { key: ['fields.othertestfield', 'fields.testfield'], cmp: '=', value: 'customtestvalue'}],
options : {
limit : 20
}
};
before(function(done){
var base = {
meta: {
type: '<API key>',
node : '<API key>',
labelfield: 'testfield'
}
};
grasshopper.request(tokens.globalEditorToken)
.content.insert(_.extend({
fields:{
label:'search test1'
}
}, base))
.then(function(){
return grasshopper.request(tokens.globalEditorToken).content.insert(_.extend({
fields:{
label:'search test2',
testfield: 'testvalue',
newColumn: 'testvalue'
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalEditorToken).content.insert(_.extend({
fields:{
label:'search test3',
testfield: 'testvalue',
newColumn: 'testvalue'
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalEditorToken).content.insert(_.extend({
fields:{
label:'search test4',
testfield: 'testvalue',
newColumn: 'testvalue'
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalEditorToken).content.insert(_.extend({
fields:{
label:'search test5',
testfield: 'testvalue',
newColumn: 'testvalue'
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalAdminToken).content.insert(_.extend({
fields:{
label:'search test6',
testfield: 'testvalue',
newColumn: 'testvalue'
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalAdminToken).content.insert(_.extend({
fields:{
label:'search test6',
testfield: 'testvalue',
newColumn: 'testvalue'
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalAdminToken).content.insert(_.extend({
fields:{
label:'search test7',
testfield: 'testvalue',
newColumn: 'testvalue',
<API key> : true,
first : true
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalAdminToken).content.insert(_.extend({
fields:{
label:'search test7',
testfield: 'testvalue',
newColumn: 'testvalue',
<API key> : true,
second : true
}
}, base));
})
.then(function() {
return grasshopper.request(tokens.globalAdminToken).content.insert(_.extend({
fields:{
label:'search test7',
testfield: 'testvalue',
newColumn: 'testvalue',
<API key> : true,
third : true
}
}, base));
})
.done(done.bind(done, undefined));
});
it('should not a 401 because trying to access unauthenticated', function(done) {
grasshopper.request().content.query(query).then(
function(payload){
should.not.exist(payload);
},
function(err){
err.code.should.equal(401);
}
).done(done);
});
it('should return array of search results.', function(done) {
grasshopper.request(tokens.globalReaderToken).content.query(query).then(
function(payload){
payload.results.length.should.equal(1);
},
function(err){
should.not.exist(err);
}
).done(done);
});
it('test "including" fields in a query', function(done) {
grasshopper.request(tokens.globalReaderToken).content.query(query3).then(
function(payload){
payload.results.length.should.equal(1);
payload.results[0].fields.testfield.should.equal('testvalue');
payload.results[0].fields.should.not.have.property('newColumn');
},
function(err){
should.not.exist(err);
}
).done(done);
});
it('test "excluding" fields in a query', function(done) {
grasshopper.request(tokens.globalReaderToken).content.query(query4).then(
function(payload){
payload.results.length.should.equal(1);
payload.results[0].fields.should.have.property('testfield');
payload.results[0].fields.should.not.have.property('newColumn');
},
function(err){
should.not.exist(err);
}
).done(done);
});
it('should return empty results if it finds nothing', function(done) {
grasshopper.request(tokens.globalReaderToken).content.query(query2).then(
function(payload){
payload.results.length.should.equal(0);
},
function(err){
should.not.exist(err);
}
).done(done);
});
it('return valid results even if sortBy is not valid', function(done) {
grasshopper.request(tokens.globalReaderToken).content.query(query5)
.then(function(payload){
payload.results.length.should.equal(1);
done();
})
.catch(done)
.fail(done)
.done();
});
it('return valid results even if options is an empty array', function(done) {
grasshopper.request(tokens.globalReaderToken).content.query(query6)
.then(function(payload){
payload.results.length.should.equal(1);
})
.fail(function(err){
should.not.exist(err);
})
.done(done);
});
it('return valid results for everything within a node', function(done) {
grasshopper.request(tokens.globalReaderToken).content.query(query7)
.then(function(payload){
payload.total.should.be.greaterThan(0);
done();
})
.catch(done)
.fail(done)
.done();
});
it('returns distinct values within a find', function(done) {
grasshopper
.request(tokens.globalReaderToken)
.content.query({
filters: [{key: 'meta.type', cmp: '=', value: '<API key>'}],
options: {
distinct : 'fields.label'
}
})
.then(function(payload){
var ary = [
'Generated title',
'search test1',
'search test2',
'search test3',
'search test4',
'search test5',
'search test6',
'search test7'
];
_.difference(payload.results, ary).should.deep.equal([]);
done();
})
.catch(done)
.fail(done)
.done();
});
it('distinct works with types', function(done) {
grasshopper
.request(tokens.globalReaderToken)
.content.query({
types : ['<API key>'],
options: {
distinct : 'fields.label'
}
})
.then(function(payload){
var ary = [
'Generated title',
'search test1',
'search test2',
'search test3',
'search test4',
'search test5',
'search test6',
'search test7'
];
_.difference(payload.results, ary).should.deep.equal([]);
done();
})
.catch(done)
.fail(done)
.done();
});
describe('options.limit eq number', function() {
it('should limit the results, based on the options.limit', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query8)
.then(function(payload){
payload.results.length.should.equal(1);
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('options.limit eq string parsed to number', function() {
it('should limit the results, based on the options.limit', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query9)
.then(function(payload){
payload.results.length.should.equal(1);
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('options.limit eq string', function() {
it('should use default if options.limit has a string value', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query10)
.then(function(payload){
payload.limit.should.eq(100000);
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('options.skip eq number', function() {
it('should skip the results, based on the options.limit and options.skip', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query11)
.then(function(payload){
payload.results.length.should.equal(1);
payload.results[0].fields.should.have.property('third');
payload.results[0].fields.third.should.equal(true);
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('options.skip eq string parsed to number', function() {
it('should skip the results, based on the options.limit and options.skip', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query12)
.then(function(payload){
payload.results.length.should.equal(1);
payload.results[0].fields.should.have.property('<API key>');
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('options.skip eq string', function() {
it('should use default if options.skip has a string value', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query13)
.then(function(payload){
payload.skip.should.eq(0);
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('options.skip eq string', function() {
it('should ignore negative values', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query14)
.then(function(payload){
payload.should.be.ok;
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('search with an array of keys', function() {
it('should ignore negative values', function(done) {
grasshopper.request(tokens.globalAdminToken).content.query(query15)
.then(function(payload){
payload.should.be.ok;
payload.total.should.equal(2);
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('like (%) operator', function() {
it ('accepts a regular expression as a value', function (done) {
grasshopper.request(tokens.globalAdminToken).content.query({
filters: [{ key: 'fields.label', cmp: '%', value: /test(1|2)/ }]
}).then(function (results) {
results.should.be.ok;
results.total.should.equal(2);
done();
})
.fail(done)
.catch(done)
.done();
});
it ('should apply a case insensitive search when a string is supplied as a value', function (done) {
grasshopper.request(tokens.globalAdminToken).content.query({
filters : [{key : 'fields.label', cmp : '%', value : 'TEST1'}]
}).then(function (results) {
results.should.be.ok;
results.total.should.equal(1);
done();
})
.fail(done)
.catch(done)
.done();
});
});
describe('or query', function() {
});
});
function createGetToken(username, password, storage) {
return {
closure : function getToken(cb){
grasshopper.auth('basic', { username: username, password: password }).then(function(token){
tokens[storage] = token;
cb();
}).done();
}
};
}
function insertContent(done) {
var obj = {
meta: {
type: '<API key>',
node : '<API key>',
labelfield: 'testfield'
},
fields: {
label: 'Generated title',
testfield: 'testvalue'
}
};
grasshopper
.request(tokens.globalEditorToken)
.content.insert(obj)
.done(done.bind(done, undefined));
}
}); |
package rye
import (
"context"
"encoding/json"
"errors"
"net/http"
"reflect"
"runtime"
"strconv"
"strings"
"time"
//log "github.com/Sirupsen/logrus"
"github.com/cactus/go-statsd-client/statsd"
)
//go:generate counterfeiter -o fakes/statsdfakes/fake_statter.go $GOPATH/src/github.com/cactus/go-statsd-client/statsd/client.go Statter
//go:generate perl -pi -e 's/$GOPATH\/src\///g' fakes/statsdfakes/fake_statter.go
// MWHandler struct is used to configure and access rye's basic functionality.
type MWHandler struct {
Config Config
beforeHandlers []Handler
}
// Config struct allows you to set a reference to a statsd.Statter and include it's stats rate.
type Config struct {
Statter statsd.Statter
StatRate float32
}
// JSONStatus is a simple container used for conveying status messages.
type JSONStatus struct {
Message string `json:"message"`
Status string `json:"status"`
}
// Response struct is utilized by middlewares as a way to share state;
// ie. a middleware can return a *Response as a way to indicate
// that further middleware execution should stop (without an error) or return a
// a hard error by setting `Err` + `StatusCode`.
type Response struct {
Err error
StatusCode int
StopExecution bool
Context context.Context
}
// Error bubbles a response error providing an implementation of the Error interface.
// It returns the error as a string.
func (r *Response) Error() string {
return r.Err.Error()
}
// Handler is the primary type that any rye middleware must implement to be called in the Handle() function.
// In order to use this you must return a *rye.Response.
type Handler func(w http.ResponseWriter, r *http.Request) *Response
// Constructor for new instantiating new rye instances
// It returns a constructed *MWHandler instance.
func NewMWHandler(config Config) *MWHandler {
return &MWHandler{
Config: config,
}
}
// Use adds a handler to every request. All handlers set up with use
// are fired first and then any route specific handlers are called
func (m *MWHandler) Use(handler Handler) {
m.beforeHandlers = append(m.beforeHandlers, handler)
}
// The Handle function is the primary way to set up your chain of middlewares to be called by rye.
// It returns a http.HandlerFunc from net/http that can be set as a route in your http server.
func (m *MWHandler) Handle(customHandlers []Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
handlers := append(m.beforeHandlers, customHandlers...)
for _, handler := range handlers {
var resp *Response
// Record handler runtime
func() {
statusCode := "2xx"
startTime := time.Now()
if resp = handler(w, r); resp != nil {
func() {
// Stop execution if it's passed
if resp.StopExecution {
return
}
// If a context is returned, we will
// replace the current request with a new request
if resp.Context != nil {
r = r.WithContext(resp.Context)
return
}
// If there's no error but we have a response
if resp.Err == nil {
resp.Err = errors.New("Problem with middleware; neither Err or StopExecution is set")
resp.StatusCode = http.<API key>
}
// Now assume we have an error.
if m.Config.Statter != nil && resp.StatusCode >= 500 {
go m.Config.Statter.Inc("errors", 1, m.Config.StatRate)
}
// Write the error out
statusCode = strconv.Itoa(resp.StatusCode)
WriteJSONStatus(w, "error", resp.Error(), resp.StatusCode)
}()
}
handlerName := getFuncName(handler)
if m.Config.Statter != nil {
// Record runtime metric
go m.Config.Statter.TimingDuration(
"handlers."+handlerName+".runtime",
time.Since(startTime), // delta
m.Config.StatRate,
)
// Record status code metric (default 2xx)
go m.Config.Statter.Inc(
"handlers."+handlerName+"."+statusCode,
1,
m.Config.StatRate,
)
}
}()
// stop executing rest of the
// handlers if we encounter an error
if resp != nil && (resp.StopExecution || resp.Err != nil) {
return
}
}
})
}
// WriteJSONStatus is a wrapper for WriteJSONResponse that returns a marshalled JSONStatus blob
func WriteJSONStatus(rw http.ResponseWriter, status, message string, statusCode int) {
jsonData, _ := json.Marshal(&JSONStatus{
Message: message,
Status: status,
})
WriteJSONResponse(rw, statusCode, jsonData)
}
// WriteJSONResponse writes data and status code to the ResponseWriter
func WriteJSONResponse(rw http.ResponseWriter, statusCode int, content []byte) {
rw.Header().Set("Content-Type", "application/json")
rw.WriteHeader(statusCode)
rw.Write(content)
}
// getFuncName uses reflection to determine a given function name
// It returns a string version of the function name (and performs string cleanup)
func getFuncName(i interface{}) string {
fullName := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
ns := strings.Split(fullName, ".")
// when we get a method (not a raw function) it comes attached to whatever struct is in its
// method receiver via a function closure, this is not precisely the same as that method itself
// so the compiler appends "-fm" so the name of the closure does not conflict with the actual function
// http://grokbase.com/t/gg/golang-nuts/153jyb5b7p/<API key>#<API key>
return strings.TrimSuffix(ns[len(ns)-1], ")-fm")
} |
import React from 'react'
import { Tweet } from '<API key>'
import ContentLoader from './Preloader'
import './styles/tweets.css'
export default ({tweets, fetching}) => {
if (tweets.length > 0) {
const embededTweets = tweets.map((tweet) => {
let id = tweet.id
return (
<div key={id}>
<Tweet tweetId={id} />
</div>)
})
const loader = (fetching)? (<ContentLoader />) : ''
return (
<div className="tweets-wrapper">
{ embededTweets }
{ loader }
</div>
)
} else {
return (
<div className="tweets-wrapper">
<ContentLoader />
</div>)
}
} |
// Ecma International makes this code available under the terms and conditions set
function testcase() {
var accessed = false;
var objDate = new Date();
function callbackfn(prevVal, curVal, idx, obj) {
accessed = true;
return prevVal === objDate;
}
var obj = { 0: 11, length: 1 };
return Array.prototype.reduceRight.call(obj, callbackfn, objDate) === true && accessed;
}
runTestCase(testcase); |
body {
font-family:sans;
margin-right: 10%;
margin-left: 10%;
font-size: 18px;
background: #EFEFEF;
}
h2, section {
border-bottom: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid white;
border-top: 1px solid white;
border-radius: 10px;
width: 100%;
}
section {
margin-top: 20px;
}
li {
margin: 10px;
} |
#ifndef _LTaskClass_h
#define _LTaskClass_h
#include "vmsys.h"
#include "vmthread.h"
#include "message.h"
class _LTaskClass
{
private:
<API key> m_mutex;
msg_struct m_msg;
VM_THREAD_HANDLE m_handle;
VM_SIGNAL_ID m_signal;
void sendMsg(VMUINT32 msg_id, void* user_data);
public:
_LTaskClass();
void begin(void);
void mutexLock();
void mutexUnlock();
void stop(void);
void remoteCall(remote_call_ptr func, void* userdata);
public:
void post_signal();
};
extern _LTaskClass LTask;
#endif |
# DarkCoder
def sum_of_series(first_term, common_diff, num_of_terms):
"""
Find the sum of n terms in an arithmetic progression.
sum_of_series(1, 1, 10)
55.0
sum_of_series(1, 10, 100)
49600.0
"""
sum = (num_of_terms / 2) * (2 * first_term + (num_of_terms - 1) * common_diff)
# formula for sum of series
return sum
def main():
print(sum_of_series(1, 1, 10))
if __name__ == "__main__":
import doctest
doctest.testmod() |
#include <System/Utilities/Units.h>
// Sizes
template<> static float Units::Convert(float value, SizeUnit from, SizeUnit to)
{
return value * Size::Values[from] / Size::Values[to];
}
template<> static s32 Units::Convert(s32 value, SizeUnit from, SizeUnit to)
{
return value * Size::Values[from] / Size::Values[to];
}
float Units::Size::Values[SizeUnit::Count] = { /* Pixel */ 1, /* Point */ 1, /* Centimeter */ 64.94f, /* Inch */ 164.95f };
//Unit Units::Size::Default = SizeUnit::Pixel;
// Temperatures
template<> static float Units::Convert(float value, TemperatureUnit from, TemperatureUnit to)
{
return (value / Temperature::Factors[from] - Temperature::Deltas[from]) * Temperature::Factors[to] + Temperature::Deltas[to];
}
float Units::Temperature::Factors[TemperatureUnit::Count] = { /* Celsius */ 1, /* Fareneight */ 1 };
float Units::Temperature::Deltas[TemperatureUnit::Count] = { /* Celsius */ 1, /* Fareneight */ 1 };
//Unit Units::Temperature::Default = TemperatureUnit::Celsius;
// FileSizes
template<> static float Units::Convert(float value, FileSizeUnit from, FileSizeUnit to)
{
return value * FileSize::Factors[from] / FileSize::Factors[to];
}
u32 Units::FileSize::Factors[FileSize::Count] = { /* Bit */ 1, /* Byte */ 8, /* KiloByte */ 8 * 1024, /* MegaByte */ 8 * 1024 * 1024, /* GigaByte */ 8 * 1024 * 1024 * 1024 };
//Unit Units::Temperature::Default = TemperatureUnit::Celsius; |
require 'zip/filesystem'
require 'fileutils'
require 'tmpdir'
module Powerpoint
class Presentation
include Powerpoint::Util
attr_reader :slides
def initialize
@slides = []
end
def add_intro(title, subtitile = nil)
<API key> = @slides.select {|s| s.class == Powerpoint::Slide::Intro}[0]
slide = Powerpoint::Slide::Intro.new(presentation: self, title: title, subtitile: subtitile)
if <API key>
@slides[@slides.index(<API key>)] = slide
else
@slides.insert 0, slide
end
end
def add_textual_slide(title, content = [])
@slides << Powerpoint::Slide::Textual.new(presentation: self, title: title, content: content)
end
def add_pictorial_slide(title, image_path, coords = {})
@slides << Powerpoint::Slide::Pictorial.new(presentation: self, title: title, image_path: image_path, coords: coords)
end
def <API key>(title, image_path, content = [])
@slides << Powerpoint::Slide::TextPicSplit.new(presentation: self, title: title, image_path: image_path, content: content)
end
def <API key>(title, image_path, content = [])
@slides << Powerpoint::Slide::DescriptionPic.new(presentation: self, title: title, image_path: image_path, content: content)
end
def save(path)
Dir.mktmpdir do |dir|
extract_path = "#{dir}/extract_#{Time.now.strftime("%Y-%m-%d-%H%M%S")}"
# Copy template to temp path
FileUtils.copy_entry(TEMPLATE_PATH, extract_path)
# Remove keep files
Dir.glob("#{extract_path}.keep").each do |keep_file|
FileUtils.rm_rf(keep_file)
end
# Render/save generic stuff
render_view('content_type.xml.erb', "#{extract_path}/[Content_Types].xml")
render_view('presentation.xml.rel.erb', "#{extract_path}/ppt/_rels/presentation.xml.rels")
render_view('presentation.xml.erb', "#{extract_path}/ppt/presentation.xml")
render_view('app.xml.erb', "#{extract_path}/docProps/app.xml")
# Save slides
slides.each_with_index do |slide, index|
slide.save(extract_path, index + 1)
end
# Create .pptx file
File.delete(path) if File.exist?(path)
Powerpoint.compress_pptx(extract_path, path)
end
path
end
def file_types
slides.map {|slide| slide.file_type if slide.respond_to? :file_type }.compact.uniq
end
end
end |
d3.<API key>
======================================
an example of calculating center and angles of elliptic arc and draw points using d3.js
## Demo
http://hnakamur.github.io/d3.<API key>
## References
- [F.6 Elliptical arc implementation notes - SVG 1.1 (Second Edition)]( http://www.w3.org/TR/SVG/implnote.html#<API key> )
- [sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java]( http://svn.apache.org/repos/asf/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java )
## Develop
* Run ```gulp``` to start the webpack-dev-server and watch source files to be modified.
* Run ```gulp build``` to build for the production.
MIT |
*{
border: 0;
padding: 0;
margin: 0;
font-family: 'Calibri';
}
body
{
background: #FFF;
}
#fundo
{
margin: 0 auto;
}
#perguntas ul
{
text-decoration: none;
font-size: medium;
font-family: inherit;
text-align: center;
font-size: 30px;
list-style-type: none;
}
#perguntas ul li a
{
margin-top: 20px;
text-decoration: none;
font-size: medium;
font-family: inherit;
text-align: center;
color: #080;
border-bottom: 5px solid #ccc;
}
#perguntas ul li a:hover
{
color: #6D6D6D;
border-bottom:7px solid #080;
}
#perguntas ul h1 li
{
font-weight: normal;
font-size: 44px;
color: darkolivegreen;
}
#banner
{
background: #FFF;
}
#banner img
{
margin-left:35%
}
#imagem img
{
margin: 0 auto;
}
#menu > ul
{
padding-right: 25px;
padding-left: 25px;
margin: 0px;
}
#menu > ul
{
padding-right: 20px;
padding-left: 20px;
margin:0px;
background-color:#EDEDED;
border-bottom: 5px solid #ccc;
list-style-type: none;
}
.item
{
padding-right: 80px;
padding-left: 80px;
}
#menu ul li
{
display: inline;
font-size: 19px;
-webkit-transition: height 2s ease;
-moz-transition: height2s ease;
}
#menu ul li:hover
{
background-color:#D6D6D6;
color: #6D6D6D;
border-bottom:7px solid #080;
}
#menu ul li a
{
text-decoration: none;
color: #080;
}
#conteudo
{
color: #008B00;
height: 320px;
margin-right:10%;
margin-left: 10%;
}
#conteudo p
{
margin-top: 5%;
text-align: justify;
}
#imagem
{
display: block;
}
#imagem img
{
display: block;
margin: 60 auto;
}
footer
{
margin-top: 20px;
height: 115px;
background-color: #fff;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
footer p
{
margin-top: 2px;
color: #008B00;
text-align: center;
}
.container > ul
{
list-style-type: none;
} |
package opencraft.lib.entity;
import opencraft.lib.event.IEventHandler;
public interface IEntity extends IEventHandler {
IEntity copy();
void addSubEntity(IEntity entity);
IEntity getSubEntity(Class<? extends IEntity> clazz);
} |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v9.8.0: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v9.8.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
<li><a href="functions_type.html"><span>Typedefs</span></a></li>
<li><a href="functions_enum.html"><span>Enumerations</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions.html#index_a"><span>a</span></a></li>
<li><a href="functions_b.html#index_b"><span>b</span></a></li>
<li><a href="functions_c.html#index_c"><span>c</span></a></li>
<li><a href="functions_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_e.html#index_e"><span>e</span></a></li>
<li><a href="functions_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_g.html#index_g"><span>g</span></a></li>
<li><a href="functions_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_j.html#index_j"><span>j</span></a></li>
<li><a href="functions_k.html#index_k"><span>k</span></a></li>
<li><a href="functions_l.html#index_l"><span>l</span></a></li>
<li><a href="functions_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_n.html#index_n"><span>n</span></a></li>
<li><a href="functions_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_p.html#index_p"><span>p</span></a></li>
<li><a href="functions_r.html#index_r"><span>r</span></a></li>
<li><a href="functions_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_t.html#index_t"><span>t</span></a></li>
<li><a href="functions_u.html#index_u"><span>u</span></a></li>
<li class="current"><a href="functions_v.html#index_v"><span>v</span></a></li>
<li><a href="functions_w.html#index_w"><span>w</span></a></li>
<li><a href="functions_0x7e.html#index_0x7e"><span>~</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
<div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div>
<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
<li>V8_DEPRECATE_SOON()
: <a class="el" href="<API key>.html#<API key>">v8::CpuProfileNode</a>
, <a class="el" href="<API key>.html#<API key>">v8::FunctionTemplate</a>
, <a class="el" href="classv8_1_1Isolate.html#<API key>">v8::Isolate</a>
, <a class="el" href="classv8_1_1Message.html#<API key>">v8::Message</a>
, <a class="el" href="classv8_1_1Object.html#<API key>">v8::Object</a>
, <a class="el" href="<API key>.html#<API key>">v8::ObjectTemplate</a>
, <a class="el" href="<API key>.html#<API key>">v8::Promise::Resolver</a>
, <a class="el" href="classv8_1_1RegExp.html#<API key>">v8::RegExp</a>
, <a class="el" href="classv8_1_1Script.html#<API key>">v8::Script</a>
, <a class="el" href="<API key>.html#<API key>">v8::ScriptCompiler</a>
, <a class="el" href="classv8_1_1String.html#<API key>">v8::String</a>
, <a class="el" href="classv8_1_1TryCatch.html#<API key>">v8::TryCatch</a>
, <a class="el" href="classv8_1_1V8.html#<API key>">v8::V8</a>
, <a class="el" href="classv8_1_1Value.html#<API key>">v8::Value</a>
, <a class="el" href="<API key>.html#<API key>">v8::ValueSerializer</a>
</li>
<li>V8_DEPRECATED()
: <a class="el" href="classv8_1_1Array.html#<API key>">v8::Array</a>
, <a class="el" href="classv8_1_1Context.html#<API key>">v8::Context</a>
, <a class="el" href="classv8_1_1Debug.html#<API key>">v8::Debug</a>
, <a class="el" href="classv8_1_1Function.html#<API key>">v8::Function</a>
, <a class="el" href="classv8_1_1JSON.html#<API key>">v8::JSON</a>
, <a class="el" href="classv8_1_1Message.html#<API key>">v8::Message</a>
, <a class="el" href="classv8_1_1Module.html#<API key>">v8::Module</a>
, <a class="el" href="classv8_1_1Object.html#<API key>">v8::Object</a>
, <a class="el" href="classv8_1_1Promise.html#<API key>">v8::Promise</a>
, <a class="el" href="<API key>.html#<API key>">v8::ScriptCompiler</a>
, <a class="el" href="<API key>.html#<API key>">v8::StackTrace</a>
, <a class="el" href="classv8_1_1String.html#<API key>">v8::String</a>
, <a class="el" href="classv8_1_1TryCatch.html#<API key>">v8::TryCatch</a>
, <a class="el" href="classv8_1_1V8.html#<API key>">v8::V8</a>
, <a class="el" href="classv8_1_1Value.html#<API key>">v8::Value</a>
</li>
<li>ValueOf()
: <a class="el" href="classv8_1_1Date.html#<API key>">v8::Date</a>
</li>
<li><API key>()
: <a class="el" href="classv8_1_1Isolate.html#<API key>">v8::Isolate</a>
</li>
<li><API key>()
: <a class="el" href="classv8_1_1Isolate.html#<API key>">v8::Isolate</a>
</li>
<li><API key>()
: <a class="el" href="classv8_1_1Isolate.html#<API key>">v8::Isolate</a>
</li>
<li>VisitWeakHandles()
: <a class="el" href="classv8_1_1Isolate.html#<API key>">v8::Isolate</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html> |
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Controllers;
using Microsoft.Owin;
using Microsoft.Owin.Cors;
using Owin;
using TSW_B2B.Web.App_Start;
using TSW_B2B.Web.Filter;
using Unity.WebApi;
[assembly: OwinStartup(typeof(TSW_B2B.Web.Startup))]
namespace TSW_B2B.Web {
public partial class Startup {
public void Configuration(IAppBuilder app) {
var webApiConfiguration = ConfigureWebApi();
app.UseCors(CorsOptions.AllowAll);
app.UseWebApi(webApiConfiguration);
}
private HttpConfiguration ConfigureWebApi() {
var config = new HttpConfiguration();
config.Formatters.Clear();
config.Formatters.Add(new <API key>());
config.Services.Replace(typeof(IHttpActionInvoker), new ServiceInvoker());
config.DependencyResolver = new <API key>(UnityConfiguration.<API key>());
SwaggerConfig.Register(config);
// TODO: Put different type of filters
config.<API key>();
return config;
}
}
} |
//Language: GNU C++
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define For(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)
#define db(x) cout << #x << " = " << (x) << endl;
#define dba(a, x, y){cout << #a << " :";For(i, (x), (y))cout<<" "<<(a)[(i)];cout<<endl;}
#define dbp(p){cout << #p << " = (" << p.first << " " << p.second << ")"<< endl;}
#define mp make_pair
#define pb push_back
#define ll long long
#define ld long double
#define pi 3.<API key>
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
int N, M, size;
vector< pair<int,int> > snake(10);
char table[16][16];
//map<pair<int,int>, int> seen;
map<int, int> seen;
queue<vector< pair<int,int> > > q;
int hash_direction(int x1, int y1)
{
if (x1 == 1) return 0;
if (y1 == 1) return 1;
if (x1 == -1) return 2;
if (y1 == -1) return 3;
}
int hash_snake(vector< pair<int,int> > sn)
{
int h = (sn[0].first<<4)+sn[0].second;
rep1(i, size-1)
{
int x = sn[i].first - sn[i-1].first;
int y = sn[i].second - sn[i-1].second;
int a=0;
if (x == -1) a = 1;
if (y == 1) a = 2;
if (y == -1) a = 3;
h = (h << 2) + a;
}
return h;
}
int get_direcition_hash(int x, int y)
{
if (x == 1) return 0;
if (x == -1) return 1;
if (y == 1) return 2;
if (y == -1) return 3;
}
int get_hash(vector< pair<int,int> > snake)
{
int ret = snake[0].first << 4 + snake[0].second;
rep1(i, size - 1)
{
ret = ret * 230009 + 16*snake[0].first + snake[0].second;
}
return ret;
}
int get_hash2(vector< pair<int,int> > snake)
{
int ret = snake[0].first << 4 + snake[0].second;
rep1(i, size - 1)
{
int dx = snake[i].first - snake[i-1].first;
int dy = snake[i].second - snake[i-1].second;
ret = (ret << 2) + get_direcition_hash(dx, dy);
}
return ret;
}
int was[16][16];
int dfs(int x, int y)
{
if (! was[x][y])
{
was[x][y]=1;
int dx[4] = {0, 1, 0, -1};
int dy[4] = { 1, 0, -1, 0};
rep(j, 4)
{
int nx = x + dx[j];
int ny = y + dy[j];
if (1 <= nx && nx <= N && 1 <= ny && ny <= M && (table[x][y] != '
{
dfs(nx, ny);
}
}
}
}
int main()
{
ios_base::sync_with_stdio(0); cout.precision(15);
cin>> N >> M;
pair<int,int> target;
rep1(i, N)
{
string s;
cin >> s;
rep1(j, M)
{
char ch = s[j-1];
if ('1' <= ch && ch <= '9')
{
snake[ch-'1'] = mp(i,j);
size = max(size, ch-'0');
ch = '.';
}
table[i][j] = ch;
if (ch == '@')
target = mp(i,j);
}
}
// rep(i, 9) dbp(snake[i]);
dfs(snake[0].first, snake[0].second);
if (! was[target.first][target.second])
{
cout << -1 << endl;
return 0;
}
q.push(snake);
seen[hash_snake(snake)]=0;
while (! q.empty())
{
snake = q.front();
int dist = seen[hash_snake(snake)];
q.pop();
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
rep(i, 4)
{
int r = snake[0].first + dx[i];
int c = snake[0].second + dy[i];
if (1 <= r && r <= N && 1 <= c && c <= M)
{
int stepping_on_myself = 0;
rep(j, size-1) if (snake[j] == mp(r,c))
{
// dbp(snake[j]);
stepping_on_myself = 1;
}
if (stepping_on_myself) continue;
if (table[r][c] == '.')
{
vector< pair<int,int> > new_snake;
new_snake.pb(mp(r,c));
rep(k, size-1) new_snake.pb(snake[k]);
int h = hash_snake(new_snake);
if (seen.find(h) == seen.end())
{
seen[h] = dist + 1;
q.push(new_snake);
}
}
else if (table[r][c] == '@')
{
cout << dist + 1 << endl;
//rep(i, size) cout << snake[i].first << " " << snake[i].second << endl;
return 0;
}
}
}
}
cout << -1 << endl;
return 0;
} |
import {resolve, reject} from '<API key>';
import {push} from 'react-router-redux'
import cookie from 'react-cookie';
const LOGIN = 'auth/LOGIN';
const LOGOUT = 'auth/LOGOUT';
const SIGNUP = 'auth/SIGNUP';
const LOAD_USER = 'auth/LOAD_USER';
export default function reducer(state = {}, action = {}) {
switch (action.type) {
case LOGOUT:
cookie.remove('token');
return Object.assign({}, state, {
token: null,
user: null,
error: null
});
case LOGIN:
case SIGNUP:
return Object.assign({}, state, {
token: null,
user: null,
error: null
});
case resolve(SIGNUP):
case resolve(LOGIN):
cookie.save('token', action.payload.data.token);
return Object.assign({}, state, {
token: action.payload.data.token,
user: null,
error: null
});
case reject(LOGIN):
case reject(SIGNUP):
return Object.assign({}, state, {
token: null,
user: null,
error: action.payload.data
});
case LOAD_USER:
return Object.assign({}, state, {
user: null,
error: null
});
case resolve(LOAD_USER):
return Object.assign({}, state, {
user: action.payload.data,
error: null
});
case reject(LOAD_USER):
// TODO: change token to null only if error 401
return Object.assign({}, state, {
token: null,
user: null,
error: action.payload.data
});
default:
return state;
}
}
export function getToken(globalState) {
return globalState.auth.token;
}
export function hasToken(globalState) {
return globalState.auth && globalState.auth.token;
}
export function hasUser(globalState) {
return globalState.auth && globalState.auth.user;
}
export function hasRole(user, role) {
return (role === 'manager' && user.type === 'teacher' && user.manager) ||
user.type === role;
}
export function loadUser() {
return {
type: LOAD_USER,
payload: {
promise: client => client.get('/api/users/me')
}
};
}
export function login({email, password}) {
const action = {
type: LOGIN,
payload: {
promise: client => client.post('/auth/local', {email, password})
}
};
return dispatch => dispatch(action).then(() => dispatch(push('/')));
}
export function signup({name, email, password}) {
const action = {
type: SIGNUP,
payload: {
promise: client => client.post('/api/users', {name, email, password})
}
};
return dispatch => dispatch(action).then(() => dispatch(push('/')));
}
export function goToSignup() {
return push('/signup');
}
export function goToLogin() {
return push('/login');
}
export function logout() {
const action = {
type: LOGOUT
};
return dispatch => {
dispatch(action);
dispatch(push('/login'));
};
} |
package com.github.sarweshkumar47.<API key>.Models;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class AllPlacesDetails {
@SerializedName("place_id")
private String placeId;
@SerializedName("licence")
private String license;
@SerializedName("osm_type")
private String osmType;
@SerializedName("osm_id")
private String osmId;
@SerializedName("boundingbox")
private ArrayList<String> geoLocation;
@SerializedName("lat")
private String lat;
@SerializedName("lon")
private String lon;
@SerializedName("display_name")
private String displayName;
@SerializedName("class")
private String classType;
@SerializedName("type")
private String type;
@SerializedName("importance")
private String importance;
@SerializedName("icon")
private String icon;
public String getPlaceId() {
return placeId;
}
public void setPlaceId(String placeId) {
this.placeId = placeId;
}
public String getLicense() {
return license;
}
public void setLicense(String license) {
this.license = license;
}
public String getOsmType() {
return osmType;
}
public void setOsmType(String osmType) {
this.osmType = osmType;
}
public String getOsmId() {
return osmId;
}
public void setOsmId(String osmId) {
this.osmId = osmId;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public ArrayList<String> getGeoLocation() {
return geoLocation;
}
public void setGeoLocation(ArrayList<String> geoLocation) {
this.geoLocation = geoLocation;
}
public String getLon() {
return lon;
}
public void setLon(String lon) {
this.lon = lon;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getImportance() {
return importance;
}
public void setImportance(String importance) {
this.importance = importance;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
} |
<reference path="..\..\Typings\google.maps.d.ts" />
<reference path="Interfaces.d.ts" />
define(["require", "exports", "Scripts/NE/Model"], function(require, exports, VM) {
var G = google.maps;
function bindDom(me, el, event, method) {
G.event.addDomListener(el, event, function (ev) {
return method.apply(me, arguments);
});
}
exports.bindDom = bindDom;
function bind(me, el, event, method) {
G.event.addListener(el, event, function (ev) {
return method.apply(me, arguments);
});
}
exports.bind = bind;
var ViewPort = (function () {
function ViewPort(ctx, map, mapDiv) {
this.ctx = ctx;
this.map = map;
this.mapDiv = mapDiv;
this.transform = new G.OverlayView();
this.transform.draw = function () {
};
this.transform.setMap(map);
}
ViewPort.prototype.autoscroll = function () {
var point = this.ctx.lastPoint;
var rect = this.getClientRect();
var xDelta = rect.width * 0.01;
var yDelta = rect.height * 0.01;
var centerX = rect.left + (rect.width / 2.0);
var centerY = rect.top + (rect.height / 2.0);
centerX += point.x > rect.right ? xDelta : 0;
centerX -= point.x < rect.left ? xDelta : 0;
centerY += point.y > rect.bottom ? yDelta : 0;
centerY -= point.y < rect.top ? yDelta : 0;
this.ctx.map.setCenter(this.clientToLatLng({ x: centerX, y: centerY }));
};
ViewPort.prototype.startAutoScroll = function () {
var _this = this;
this.timerId = setInterval(function () {
_this.autoscroll();
}, 50);
};
ViewPort.prototype.stopAutoScroll = function () {
clearInterval(this.timerId);
};
ViewPort.prototype.getClientRect = function () {
return this.mapDiv.<API key>();
};
ViewPort.prototype.clientToBox = function (point) {
var rect = this.getClientRect();
return new G.Point(point.x - rect.left, point.y - rect.top);
};
ViewPort.prototype.clientToLatLng = function (client) {
var projection = this.transform.getProjection;
if (!projection)
return new G.LatLng(0, 0);
var point = this.clientToBox(client);
return projection.apply(this.transform).<API key>(point);
};
ViewPort.prototype.latLngToPixel = function (latLng) {
throw "Not implemented";
};
ViewPort.prototype.clientContains = function (point) {
var rect = this.getClientRect();
return rect.left < point.x && point.x < rect.right && rect.top < point.y && point.y < rect.bottom;
};
return ViewPort;
})();
var LastInput = (function () {
function LastInput(viewPort, ev, old) {
this.viewPort = viewPort;
if (ev) {
var point = new G.Point(ev.clientX, ev.clientY);
this.latLng = this.viewPort.clientToLatLng(point);
this.point = point;
this.keyAlt = ev.altKey;
this.keyCtrl = ev.ctrlKey;
this.keyShift = ev.shiftKey;
}
if (old)
this.hovered = old.hovered;
}
return LastInput;
})();
var Controller = (function () {
function Controller(control, map, mapDiv, model) {
this.control = control;
this.map = map;
this.model = model;
this.begin = null;
this.end = null;
this.active = false;
this.viewPort = new ViewPort(this, map, mapDiv);
this._input = new LastInput(this.viewPort);
exports.bindDom(this, document, 'mousedown', this.onMouseDown);
exports.bindDom(this, document, 'mouseup', this.onMouseUp);
exports.bindDom(this, document, 'mousemove', this.onMouseMove);
}
Controller.prototype.startAutoScroll = function () {
this.viewPort.startAutoScroll();
};
Controller.prototype.stopAutoScroll = function () {
this.viewPort.stopAutoScroll();
};
Object.defineProperty(Controller.prototype, "lastModifiers", {
get: function () {
return { keyCtrl: this._input.keyCtrl, keyAlt: this._input.keyAlt, keyShift: this._input.keyShift };
},
enumerable: true,
configurable: true
});
Object.defineProperty(Controller.prototype, "lastLatLng", {
get: function () {
return this._input.latLng;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Controller.prototype, "lastPoint", {
get: function () {
return this._input.point;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Controller.prototype, "hovered", {
get: function () {
return this._input.hovered;
},
set: function (value) {
this._input.hovered = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Controller.prototype, "tracker", {
get: function () {
return this._tracker;
},
set: function (value) {
this._tracker = value;
},
enumerable: true,
configurable: true
});
Controller.prototype.updateInput = function (ev) {
this._input = new LastInput(this.viewPort, ev, this._input);
};
Controller.prototype.onMouseUp = function (ev) {
this.updateInput(ev);
if (!this.viewPort.clientContains({ x: ev.clientX, y: ev.clientY }) && !this.active)
return;
this.end = this.lastLatLng;
this.active = false;
this.tracker.end();
};
Controller.prototype.onMouseDown = function (ev) {
var e = (ev || window.event);
if (!this.viewPort.clientContains({ x: e.clientX, y: e.clientY }))
return;
this.updateInput(ev);
this.begin = this.lastLatLng;
this.end = this.lastLatLng;
this.active = true;
this.tracker.begin();
};
Controller.prototype.onMouseMove = function (ev) {
this.updateInput(ev);
var beginPoint = this.begin;
if (!beginPoint)
beginPoint = this.lastLatLng;
else if (!this.active)
beginPoint = this.lastLatLng;
this.begin = beginPoint;
this.end = this.lastLatLng;
this.tracker.processing();
};
return Controller;
})();
exports.Controller = Controller;
var EmptyTracker = (function () {
function EmptyTracker() {
}
EmptyTracker.prototype.begin = function () {
};
EmptyTracker.prototype.end = function () {
};
EmptyTracker.prototype.processing = function () {
};
return EmptyTracker;
})();
exports.EmptyTracker = EmptyTracker;
var DefaultTracker = (function () {
function DefaultTracker(ctx, nodeStyle) {
this.ctx = ctx;
this.nodeStyle = nodeStyle;
}
DefaultTracker.prototype.reset = function () {
this.tracker = null;
this.startPoint = null;
this.target = null;
};
DefaultTracker.prototype.isNoDrag = function () {
if (!this.startPoint)
return true;
var end = this.ctx.lastPoint;
return Math.abs(end.x - this.startPoint.x) < 7 && Math.abs(end.y - this.startPoint.y) < 7;
};
DefaultTracker.prototype.begin = function () {
if (this.tracker) {
this.tracker.begin();
return;
}
if (!this.startPoint) {
this.startPoint = this.ctx.lastPoint;
this.target = this.ctx.hovered;
return;
}
};
DefaultTracker.prototype.end = function () {
if (this.tracker)
this.tracker.end();
else
this.processClick();
this.reset();
};
DefaultTracker.prototype.processClick = function () {
if (!this.target) {
if (!this.ctx.lastModifiers.keyCtrl)
this.ctx.model.selection.clear();
return;
}
if (this.ctx.lastModifiers.keyCtrl)
this.ctx.model.selection.toggle(this.target);
else
this.ctx.model.selection.select([this.target]);
};
DefaultTracker.prototype.processing = function () {
var _this = this;
if (this.tracker) {
this.tracker.processing();
return;
}
if (!this.startPoint)
return;
if (this.isNoDrag())
return;
if (this.target)
this.tracker = new DragTracker(this.ctx, this.target, this.nodeStyle);
else {
var rectTracker = this.tracker = new RectTracker(this.ctx);
rectTracker.completed = function () {
_this.ctx.model.selectWithinBounds(rectTracker.bounds(), _this.ctx.lastModifiers.keyCtrl);
};
}
this.tracker.begin();
};
return DefaultTracker;
})();
exports.DefaultTracker = DefaultTracker;
var DragTracker = (function () {
function DragTracker(ctx, target, style) {
var _this = this;
this.ctx = ctx;
this.style = style;
if (target.selected)
this.target = ctx.model.selection.getItems().filter(function (x) {
return x instanceof VM.Vertex;
});
else
this.target = [target];
this.dragMarkers = this.target.map(function (x) {
var marker = new G.Marker(_this.style('dragged'));
marker.setMap(_this.ctx.map);
return marker;
});
}
DragTracker.prototype.begin = function () {
this.ctx.startAutoScroll();
};
DragTracker.prototype.end = function () {
var _this = this;
this.dragMarkers.forEach(function (x) {
return x.setMap(null);
});
this.target.forEach(function (x, i) {
return x.setPosition(_this.dragMarkers[i].getPosition());
});
this.ctx.stopAutoScroll();
};
DragTracker.prototype.processing = function () {
var _this = this;
var dlat = this.ctx.end.lat() - this.ctx.begin.lat();
var dlng = this.ctx.end.lng() - this.ctx.begin.lng();
this.dragMarkers.forEach(function (x, i) {
var pos = _this.target[i].getPosition();
x.setPosition(new G.LatLng(pos.lat() + dlat, pos.lng() + dlng));
});
};
return DragTracker;
})();
var ScrollTracker = (function () {
function ScrollTracker(ctx) {
this.ctx = ctx;
}
ScrollTracker.prototype.begin = function () {
};
ScrollTracker.prototype.end = function () {
};
ScrollTracker.prototype.processing = function () {
if (!this.ctx.active)
return;
var dlat = this.ctx.begin.lat() - this.ctx.end.lat();
var dlng = this.ctx.begin.lng() - this.ctx.end.lng();
var center = this.ctx.map.getCenter();
var newCenter = new G.LatLng(center.lat() + dlat, center.lng() + dlng);
this.ctx.map.setCenter(newCenter);
};
return ScrollTracker;
})();
exports.ScrollTracker = ScrollTracker;
var RectTracker = (function () {
function RectTracker(ctx) {
this.ctx = ctx;
this._rectangle = new G.Rectangle({ strokeColor: 'navy', fillColor: 'navy' });
}
RectTracker.prototype.bounds = function () {
var bounds = new G.LatLngBounds();
bounds.extend(this.ctx.begin);
bounds.extend(this.ctx.end);
return bounds;
};
RectTracker.prototype.render = function () {
this._rectangle.setBounds(this.bounds());
this._rectangle.setMap(this.ctx.active ? this.ctx.map : null);
};
RectTracker.prototype.begin = function () {
this.ctx.startAutoScroll();
};
RectTracker.prototype.end = function () {
this.render();
this.ctx.stopAutoScroll();
this.completed();
};
RectTracker.prototype.processing = function () {
this.render();
};
RectTracker.prototype.completed = function () {
};
return RectTracker;
})();
exports.RectTracker = RectTracker;
var EdgeTracker = (function () {
function EdgeTracker(ctx) {
this.ctx = ctx;
this._line = new G.Polyline();
}
EdgeTracker.prototype.render = function () {
if (!this.vertexA)
return;
this._line.setPath([this.vertexA.getPosition(), this.ctx.end]);
this._line.setMap(this.ctx.active ? this.ctx.map : null);
};
EdgeTracker.prototype.begin = function () {
if (!(this.ctx.hovered && this.ctx.hovered instanceof VM.Vertex))
return;
this.vertexA = this.ctx.hovered;
this.render();
this.ctx.startAutoScroll();
};
EdgeTracker.prototype.end = function () {
this.render();
this.ctx.stopAutoScroll();
var vertexA = this.vertexA;
var vertexZ = this.ctx.hovered;
try {
if (vertexA && vertexZ && vertexA !== vertexZ)
this.createNew(vertexA, vertexZ);
} finally {
this.reset();
}
};
EdgeTracker.prototype.reset = function () {
this.vertexA = null;
};
EdgeTracker.prototype.processing = function () {
if (!this.vertexA)
return;
this.render();
};
return EdgeTracker;
})();
exports.EdgeTracker = EdgeTracker;
var VertexTracker = (function () {
function VertexTracker(ctx) {
this.ctx = ctx;
}
VertexTracker.prototype.begin = function () {
};
VertexTracker.prototype.end = function () {
this.createNew(this.ctx.end);
};
VertexTracker.prototype.processing = function () {
};
return VertexTracker;
})();
exports.VertexTracker = VertexTracker;
});
//# sourceMappingURL=Controller.js.map |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using <API key>.Models;
namespace <API key>.Controllers
{
public class ValuesController : ApiController
{
// GET api/values/GetAllBooks
<summary>
This method is going to be used for the prefetching of all data used for the Twitter typeahead
</summary>
<returns>A list of books that will be serialized to JSON and used by the Twitter typeahead</returns>
public IEnumerable<Book> GetAllBooks()
{
List<Book> books = GetBooks();
return books;
}
// GET api/values/SearchBooks?searchTerm={%QUERY}
<summary>
This method will be used to handle searching for books
</summary>
<param name="searchTerm">The term being searched for. In this case, either an author or a book title.</param>
<returns>A list of books matching the searched term.</returns>
[HttpGet]
public IEnumerable<Book> SearchBooks(string searchTerm)
{
searchTerm = searchTerm.ToUpper();
IEnumerable<Book> books = GetAllBooks().Where(x=>x.Title.ToUpper().Contains(searchTerm) || x.Author.ToUpper().Contains(searchTerm));
return books;
}
private List<Book> GetBooks()
{
List<Book> books = new List<Book>();
if (HttpContext.Current.Cache["BooksList"] != null)
{
books = (List<Book>)HttpContext.Current.Cache["BooksList"];
}
else
{
books.Add(new Book()
{
Author = "Bret Easton Ellis",
Title = "American Psycho"
});
books.Add(new Book()
{
Author = "Bret Easton Ellis",
Title = "Less Than Zero"
});
books.Add(new Book()
{
Title = "The Winner",
Author = "David Baldacci"
});
books.Add(new Book()
{
Title = "Private Vegas",
Author = "James Patterson"
});
}
return books;
}
}
} |
namespace Octopost.Model.ApiResponse.HTTP403
{
using Octopost.Model.Validation;
public interface IForbiddenApiResult : IApiResult
{
long UserId { get; set; }
OctopostEntityName AccessedEntityType { get; set; }
long AccessedEntityId { get; set; }
}
} |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '<API key>'),
]
operations = [
migrations.AlterField(
model_name='meeting',
name='organization',
field=models.ForeignKey(blank=True, to='backend.Organization', null=True),
preserve_default=True,
),
] |
// Name: wx/msw/dc.h
// Purpose: wxDC class
// Created: 01/02/97
// Licence: wxWindows licence
#ifndef _WX_MSW_DC_H_
# define _WX_MSW_DC_H_
# include "wx/defs.h"
# include "wx/dc.h"
// macros
# if wxUSE_DC_CACHEING
/*
* Cached blitting, maintaining a cache
* of bitmaps required for transparent blitting
* instead of constant creation/deletion
*/
class wxDCCacheEntry : public wxObject
{
public:
wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth);
wxDCCacheEntry(WXHDC hDC, int depth);
virtual ~wxDCCacheEntry();
WXHBITMAP m_bitmap;
WXHDC m_dc;
int m_width;
int m_height;
int m_depth;
};
# endif
// this is an ABC: use one of the derived classes to create a DC associated
// with a window, screen, printer and so on
class WXDLLIMPEXP_CORE wxMSWDCImpl : public wxDCImpl
{
public:
wxMSWDCImpl(wxDC* owner, WXHDC hDC);
virtual ~wxMSWDCImpl();
// implement base class pure virtuals
void Clear() override;
bool StartDoc(const wxString& message) override;
void EndDoc() override;
void StartPage() override;
void EndPage() override;
void SetFont(const wxFont& font) override;
void SetPen(const wxPen& pen) override;
void SetBrush(const wxBrush& brush) override;
void SetBackground(const wxBrush& brush) override;
void SetBackgroundMode(int mode) override;
# if wxUSE_PALETTE
void SetPalette(const wxPalette& palette) override;
# endif
void <API key>() override;
wxCoord GetCharHeight() const override;
wxCoord GetCharWidth() const override;
bool CanDrawBitmap() const override;
bool CanGetTextExtent() const override;
int GetDepth() const override;
wxSize GetPPI() const override;
void SetMapMode(wxMappingMode mode) override;
void SetUserScale(double x, double y) override;
void SetLogicalScale(double x, double y) override;
void SetLogicalOrigin(wxCoord x, wxCoord y) override;
void SetDeviceOrigin(wxCoord x, wxCoord y) override;
void SetAxisOrientation(bool xLeftRight, bool yBottomUp) override;
wxPoint DeviceToLogical(wxCoord x, wxCoord y) const override;
wxPoint LogicalToDevice(wxCoord x, wxCoord y) const override;
wxSize DeviceToLogicalRel(int x, int y) const override;
wxSize LogicalToDeviceRel(int x, int y) const override;
# if <API key>
bool <API key>() const override;
bool SetTransformMatrix(const wxAffineMatrix2D& matrix) override;
wxAffineMatrix2D GetTransformMatrix() const override;
void <API key>() override;
# endif
void SetLogicalFunction(<API key> function) override;
// implementation from now on
virtual void SetRop(WXHDC cdc);
virtual void SelectOldObjects(WXHDC dc);
void SetWindow(wxWindow* win)
{
m_window = win;
# if wxUSE_PALETTE
// if we have palettes use the correct one for this window
InitializePalette();
# endif
}
WXHDC GetHDC() const
{
return m_hDC;
}
void SetHDC(WXHDC dc, bool bOwnsDC = false)
{
m_hDC = dc;
m_bOwnsDC = bOwnsDC;
// we might have a pre existing clipping region, make sure that we
// return it if asked -- but avoid calling ::GetClipBox() right now as
// it could be unnecessary wasteful
m_clipping = true;
m_isClipBoxValid = false;
}
void* GetHandle() const override
{
return (void*) GetHDC();
}
const wxBitmap& GetSelectedBitmap() const override
{
return m_selectedBitmap;
}
wxBitmap& GetSelectedBitmap() override
{
return m_selectedBitmap;
}
// update the internal clip box variables
void UpdateClipBox();
# if wxUSE_DC_CACHEING
static wxDCCacheEntry* FindBitmapInCache(WXHDC hDC, int w, int h);
static wxDCCacheEntry* FindDCInCache(wxDCCacheEntry* notThis, WXHDC hDC);
static void AddToBitmapCache(wxDCCacheEntry* entry);
static void AddToDCCache(wxDCCacheEntry* entry);
static void ClearCache();
# endif
// RTL related functions
// get or change the layout direction (LTR or RTL) for this dc,
// wxLayout_Default is returned if layout direction is not supported
wxLayoutDirection GetLayoutDirection() const override;
void SetLayoutDirection(wxLayoutDirection dir) override;
protected:
void Init()
{
m_bOwnsDC = false;
m_hDC = NULL;
m_oldBitmap = NULL;
m_oldPen = NULL;
m_oldBrush = NULL;
m_oldFont = NULL;
# if wxUSE_PALETTE
m_oldPalette = NULL;
# endif
m_isClipBoxValid = false;
}
// create an uninitialized DC: this should be only used by the derived
// classes
wxMSWDCImpl(wxDC* owner)
: wxDCImpl(owner)
{
Init();
}
void <API key>();
public:
void DoGetFontMetrics(int* height, int* ascent, int* descent, int* internalLeading, int* externalLeading, int* averageWidth) const override;
void DoGetTextExtent(const wxString& string, wxCoord* x, wxCoord* y, wxCoord* descent = NULL, wxCoord* externalLeading = NULL, const wxFont* theFont = NULL) const override;
bool <API key>(const wxString& text, wxArrayInt& widths) const override;
bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style = wxFLOOD_SURFACE) override;
void <API key>(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, wxDirection nDirection = wxEAST) override;
bool DoGetPixel(wxCoord x, wxCoord y, wxColour* col) const override;
void DoDrawPoint(wxCoord x, wxCoord y) override;
void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) override;
void DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc) override;
void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea) override;
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) override;
void <API key>(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius) override;
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) override;
# if wxUSE_SPLINES
void DoDrawSpline(const wxPointList* points) override;
# endif
void DoCrossHair(wxCoord x, wxCoord y) override;
void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) override;
void DoDrawBitmap(const wxBitmap& bmp, wxCoord x, wxCoord y, bool useMask = false) override;
void DoDrawText(const wxString& text, wxCoord x, wxCoord y) override;
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle) override;
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc, <API key> rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) override;
bool DoStretchBlit(wxCoord xdest, wxCoord ydest, wxCoord dstWidth, wxCoord dstHeight, wxDC* source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, <API key> rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) override;
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) override;
void <API key>(const wxRegion& region) override;
bool DoGetClippingRect(wxRect& rect) const override;
void DoGetSizeMM(int* width, int* height) const override;
void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset) override;
void DoDrawPolygon(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle = wxODDEVEN_RULE) override;
void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle = wxODDEVEN_RULE) override;
wxBitmap DoGetAsBitmap(const wxRect* subrect) const override
{
return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect);
}
# if wxUSE_PALETTE
// MSW specific, select a logical palette into the HDC
// (tell windows to translate pixel from other palettes to our custom one
// and vice versa)
// Realize tells it to also reset the system palette to this one.
void DoSelectPalette(bool realize = false);
// Find out what palette our parent window has, then select it into the dc
void InitializePalette();
# endif
protected:
// common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);
// common part of DoSetClippingRegion() and <API key>()
void SetClippingHrgn(WXHRGN hrgn);
// implementation of DoGetSize() for wxScreen/PrinterDC: this simply
// returns the size of the entire device this DC is associated with
// notice that we intentionally put it in a separate function instead of
// DoGetSize() itself because we want it to remain pure virtual both
// because each derived class should take care to define it as needed (this
// implementation is not at all always appropriate) and because we want
// wxDC to be an ABC to prevent it from being created directly
void GetDeviceSize(int* width, int* height) const;
// MSW-specific member variables
wxBitmap m_selectedBitmap;
// TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it
bool m_bOwnsDC;
// our HDC
WXHDC m_hDC;
// Store all old GDI objects when do a SelectObject, so we can select them
// back in (this unselecting user's objects) so we can safely delete the
WXHBITMAP m_oldBitmap;
WXHPEN m_oldPen;
WXHBRUSH m_oldBrush;
WXHFONT m_oldFont;
# if wxUSE_PALETTE
WXHPALETTE m_oldPalette;
# endif
# if wxUSE_DC_CACHEING
static wxObjectList sm_bitmapCache;
static wxObjectList sm_dcCache;
# endif
bool m_isClipBoxValid;
wxDECLARE_CLASS(wxMSWDCImpl);
<API key>(wxMSWDCImpl);
};
// wxDCTemp: a wxDC which doesn't free the given HDC (used by wxWidgets
// only/mainly)
class WXDLLIMPEXP_CORE wxDCTempImpl : public wxMSWDCImpl
{
public:
// construct a temporary DC with the specified HDC and size (it should be
// specified whenever we know it for this HDC)
wxDCTempImpl(wxDC* owner, WXHDC hdc, const wxSize& size)
: wxMSWDCImpl(owner, hdc)
, m_size(size)
{
}
virtual ~wxDCTempImpl()
{
// prevent base class dtor from freeing it
SetHDC((WXHDC) NULL);
}
void DoGetSize(int* w, int* h) const override
{
wxASSERT_MSG( m_size.IsFullySpecified(),
wxT("size of this DC hadn't been set and is unknown") );
if (w)
{
*w = m_size.x;
}
if (h)
{
*h = m_size.y;
}
}
private:
// size of this DC must be explicitly set by SetSize() as we have no way to
// find it ourselves
const wxSize m_size;
<API key>(wxDCTempImpl);
};
class WXDLLIMPEXP_CORE wxDCTemp : public wxDC
{
public:
wxDCTemp(WXHDC hdc, const wxSize& size = wxDefaultSize)
: wxDC(new wxDCTempImpl(this, hdc, size))
{
}
};
#endif |
<?php
if (class_exists('<API key>', true) === false) {
throw new <API key>('Class <API key> not found');
}
class <API key> extends <API key>
{
/**
* Return a list of external sniffs to include with this standard.
*
* @return array
*/
public function getIncludedSniffs() {
return array(
'Generic/Sniffs/Metrics/NestingLevelSniff.php',
'Generic/Sniffs/Functions/<API key>.php',
'Generic/Sniffs/Formatting/<API key>.php',
'PEAR/Sniffs/Functions/<API key>.php',
'Squiz/Sniffs/WhiteSpace/<API key>.php',
//'Squiz/Sniffs/NamingConventions/<API key>.php'
//'Squiz/Sniffs/WhiteSpace/<API key>.php',
//'Squiz/Sniffs/NamingConventions/<API key>.php'
);
}//end getIncludedSniffs()
}//end class
?> |
import Crafty from 'craftyjs';
Crafty.c('Control', {
started: false,
init: function () {
this.requires('Mouse');
this.enableCapture();
},
enableCapture: function () {
Crafty.addEvent(this, Crafty.stage.elem, 'mousedown', this.attachMoveHandler);
Crafty.addEvent(this, Crafty.stage.elem, 'mouseup', this.detachMoveHandler);
},
disableCapture: function () {
Crafty.removeEvent(this, Crafty.stage.elem, 'mousedown', this.attachMoveHandler);
Crafty.removeEvent(this, Crafty.stage.elem, 'mouseup', this.detachMoveHandler);
},
attachMoveHandler: function (e) {
if (this.started) {
return this;
}
this.addComponent('Line');
this.started = true;
this.startX = this.endX = this.x = e.realX;
this.startY = this.endY = this.y = e.realY;
this.w = this.h = 0;
Crafty.addEvent(this, Crafty.stage.elem, 'mousemove', this.moveHandler);
},
setDimensions: function (x, y) {
this.endX = x;
this.endY = y;
const bboxBuffer = 2;
this.x = Math.max(0, Math.min(this.startX, this.endX) - bboxBuffer);
this.y = Math.max(0, Math.min(this.startY, this.endY) - bboxBuffer);
this.w = (this.endX >= this.startX ? this.endX - this.startX : this.startX - this.endX) + bboxBuffer * 2;
this.h = (this.endY >= this.startY ? this.endY - this.startY : this.startY - this.endY) + bboxBuffer * 2;
this.distance = Crafty.math.distance(this.startX, this.startY, this.endX, this.endY);
},
detachMoveHandler: function (e) {
this.setDimensions(e.realX, e.realY);
this.started = false;
this.removeComponent('Line');
Crafty.removeEvent(this, Crafty.stage.elem, 'mousemove', this.moveHandler);
Crafty.trigger('ControlFinished', {
distance: this.distance,
startX: this.startX,
startY: this.startY,
endX: this.endX,
endY: this.endY,
angle: Math.atan2(this.endY - this.startY, this.endX - this.startX)
});
},
moveHandler: function (e) {
this.setDimensions(e.realX, e.realY);
}
}); |
<?php
use Core\Language;
?>
<div class="page-header">
<h1><?php echo $data['title'] ?></h1><form action="" method="POST">
<input type="text" name="test" value="<API key>">
<input type="submit" value="123">
</form>
</div>
<p><?php echo $data['welcome_message'] ?></p>
<a class="btn btn-md btn-success" href="<?php echo DIR;?>subpage">
<?php echo Language::show('open_subpage', 'welcome'); ?>
</a> |
# Lab
A place for various WebGL sketches, particularly with three.js.
Todo
* Transition to using modules with three.js.
* Re-create a number of old projects I made with modern three.js. |
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\<API key>\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use AppBundle\Entity\Series;
/**
* Series1 controller.
*
* @Route("/series1")
*/
class Series1Controller extends Controller
{
/**
* @Route("/")
*/
public function indexAction()
{
return $this->render('series1/index.html.twig');
}
/**
* Pokazuje konkretny rekord series1
*
* @Route("/show/{id}")
*/
public function showAction($id)
{
$serial = $this->getDoctrine()->getRepository("AppBundle:Series")->find($id);
return $this->render( 'series1/show.html.twig', array(
'serial' => $serial
));
}
/**
* Dodaje rekord do series1
*
* @Route("/add")
*/
public function addAction()
{
//FUTURE
}
/**
* Usuwa rekord z series1
*
* @Route("/remove/{id}")
*/
public function removeAction($id)
{
$serial = $this->getDoctrine()->getRepository("AppBundle:Series")->find($id);
$dm = $this->getDoctrine()->getManager();
$dm->remove($serial); //remove przy usuwaniu
$dm->flush();
return $this->render('series1/remove.html.twig');
}
} |
<?php
namespace Deplink\Resolvers;
use DI\Container;
class ResolverFactory
{
/**
* @var Container
*/
private $di;
/**
* ResolverFactory constructor.
*
* @param Container $di
*/
public function __construct(Container $di)
{
$this->di = $di;
}
/**
* @return <API key>
* @throws \DI\DependencyException
* @throws \DI\NotFoundException
* @throws \<API key>
*/
public function <API key>()
{
return $this->di->make(<API key>::class);
}
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='<API key>'>/**
</span> * # Wave JSON data format
*
* Describes the data structure of the waves
*
* // List of waves
* [
* {
* "id" : 1,
* "name":"Wave 1",
* "visible" : false
* },
* {
* "id" : 28,
* "name" : "Wave 2",
* "visible" : false
* },
* {
* "id" : 29,
* "name" : "Wave 3",
* "visible" : true
* },
* {
* "id" : 33,
* "name" : "Wave 4",
* "visible" : true
* }
* ]
*
*
* @class askiaVista.data.wave
* @protected
*/
<span id='<API key>'>/**
</span> * Id of the wave
*
* @member askiaVista.data.wave
* @property {Number} id
*/
<span id='<API key>'>/**
</span> * Name of the wave
*
* @member askiaVista.data.wave
* @property {String} name
*/
<span id='<API key>'>/**
</span> * Indicates if the wave is visible by default
*
* @member askiaVista.data.wave
* @property {Boolean} visible
*/
</pre>
</body>
</html> |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>additions: 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.12.2 / additions - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
additions
<small>
8.9.0
<span class="label label-info">Not compatible </span>
</small>
</h1>
<p> <em><script>document.write(moment("2022-02-09 06:27:18 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-09 06:27:18 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.12.2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.10.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.2 Official release 4.10.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/additions"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Additions"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: addition chains"
"category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms"
"category: Miscellaneous/Extracted Programs/Arithmetic"
]
authors: [
"Pierre Castéran"
]
bug-reports: "https://github.com/coq-contribs/additions/issues"
dev-repo: "git+https://github.com/coq-contribs/additions.git"
synopsis: "Addition Chains"
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/additions/archive/v8.9.0.tar.gz"
checksum: "md5=<API key>"
}
</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-additions.8.9.0 coq.8.12.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.12.2).
The following dependencies couldn't be met:
- coq-additions -> coq < 8.10~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-additions.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
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> |
module.exports = function (acetate) {
acetate.helper('helper', function (context, text) {
return context.title + '\n' + text + '\nhelper';
});
acetate.block('content', function (context, text) {
return context.title + '\n' + text + '\nblock';
});
acetate.filter('filter', function (value) {
return value + ' filter';
});
}; |
using System.Collections.Generic;
using UnityEngine;
namespace KSPCommEngr.Extensions
{
public static class PartExtensions
{
public static bool IsPrimary(this Part thisPart, List<Part> partsList, int moduleClassId)
{
foreach (Part part in partsList)
{
if (part.Modules.Contains(moduleClassId))
{
if (part == thisPart)
return true;
else break;
}
}
return false;
}
}
} |
MySQL Workbench Deployment Utilities
=================================
Command line deployment tools for MySQL Workbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.